PageSourceSearch

https://hd2d.teco-sample.workers.dev/_nuxt/B9CpY8Lj.js

js hd2d.teco-sample.workers.dev collected 2026-10-03 08:07:45 UTC 1,634,532 bytes, 5,035 lines download raw bytes

vendor: 13,810 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DfWXOafs.js","./error-404.BLrjNXsr.css","./skG6Pv-s.js","./error-500.DLkAwcfL.css"])))=>i.map(i=>d[i]);
2(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function u_(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const nn={},wc=[],Ts=()=>{},_A=()=>!1,ad=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),h_=n=>n.startsWith("onUpdate:"),ni=Object.assign,d_=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},pL=Object.prototype.hasOwnProperty,tn=(n,e)=>pL.call(n,e),_t=Array.isArray,Sc=n=>sg(n)==="[object Map]",bA=n=>sg(n)==="[object Set]",bt=n=>typeof n=="function",Tn=n=>typeof n=="string",To=n=>typeof n=="symbol",_n=n=>n!==null&&typeof n=="object",rg=n=>(_n(n)||bt(n))&&bt(n.then)&&bt(n.catch),wA=Object.prototype.toString,sg=n=>wA.call(n),mL=n=>sg(n).slice(8,-1),SA=n=>sg(n)==="[object Object]",f_=n=>Tn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Mc=u_(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),og=n=>{const e=Object.create(null);return(t=>e[t]||(e[t]=n(t)))},gL=/-\w/g,$i=og(n=>n.replace(gL,e=>e.slice(1).toUpperCase())),vL=/\B([A-Z])/g,aa=og(n=>n.replace(vL,"-$1").toLowerCase()),ag=og(n=>n.charAt(0).toUpperCase()+n.slice(1)),rh=og(n=>n?`on${ag(n)}`:""),rr=(n,e)=>!Object.is(n,e),C0=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},MA=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},xL=n=>{const e=parseFloat(n);return isNaN(e)?n:e},yL=n=>{const e=Tn(n)?Number(n):NaN;return isNaN(e)?n:e};let $1;const lg=()=>$1||($1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function kr(n){if(_t(n)){const e={};for(let t=0;t<n.length;t++){const i=n[t],r=Tn(i)?SL(i):kr(i);if(r)for(const s in r)e[s]=r[s]}return e}else if(Tn(n)||_n(n))return n}const _L=/;(?![^(]*\))/g,bL=/:([^]+)/,wL=/\/\*[^]*?\*\//g;function SL(n){const e={};return n.replace(wL,"").split(_L).forEach(t=>{if(t){const i=t.split(bL);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function qt(n){let e="";if(Tn(n))e=n;else if(_t(n))for(let t=0;t<n.length;t++){const i=qt(n[t]);i&&(e+=i+" ")}else if(_n(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function ji(n){if(!n)return null;let{class:e,style:t}=n;return e&&!Tn(e)&&(n.class=qt(e)),t&&(n.style=kr(t)),n}const ML="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",TL=u_(ML);function TA(n){return!!n||n===""}const EA=n=>!!(n&&n.__v_isRef===!0),qi=n=>Tn(n)?n:n==null?"":_t(n)||_n(n)&&(n.toString===wA||!bt(n.toString))?EA(n)?qi(n.value):JSON.stringify(n,AA,2):String(n),AA=(n,e)=>EA(e)?AA(n,e.value):Sc(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,r],s)=>(t[R0(i,s)+" =>"]=r,t),{})}:bA(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>R0(t))}:To(e)?R0(e):_n(e)&&!_t(e)&&!SA(e)?String(e):e,R0=(n,e="")=>{var t;return To(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};let Mi;class CA{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Mi,!e&&Mi&&(this.index=(Mi.scopes||(Mi.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Mi;try{return Mi=this,e()}finally{Mi=t}}}on(){++this._on===1&&(this.prevScope=Mi,Mi=this)}off(){this._on>0&&--this._on===0&&(Mi=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function RA(n){return new CA(n)}function Jc(){return Mi}function cg(n,e=!1){Mi&&Mi.cleanups.push(n)}let gn;const P0=new WeakSet;class PA{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Mi&&Mi.active&&Mi.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,P0.has(this)&&(P0.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||NA(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,j1(this),LA(this);const e=gn,t=ns;gn=this,ns=!0;try{return this.fn()}finally{OA(this),gn=e,ns=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)g_(e);this.deps=this.depsTail=void 0,j1(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?P0.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){wx(this)&&this.run()}get dirty(){return wx(this)}}let IA=0,sh,oh;function NA(n,e=!1){if(n.flags|=8,e){n.next=oh,oh=n;return}n.next=sh,sh=n}function p_(){IA++}function m_(){if(--IA>0)return;if(oh){let e=oh;for(oh=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;sh;){let e=sh;for(sh=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function LA(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function OA(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),g_(i),EL(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function wx(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(DA(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function DA(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Th)||(n.globalVersion=Th,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!wx(n))))return;n.flags|=2;const e=n.dep,t=gn,i=ns;gn=n,ns=!0;try{LA(n);const r=n.fn(n._value);(e.version===0||rr(r,n._value))&&(n.flags|=128,n._value=r,e.version++)}catch(r){throw e.version++,r}finally{gn=t,ns=i,OA(n),n.flags&=-3}}function g_(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)g_(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function EL(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let ns=!0;const kA=[];function vo(){kA.push(ns),ns=!1}function xo(){const n=kA.pop();ns=n===void 0?!0:n}function j1(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=gn;gn=void 0;try{e()}finally{gn=t}}}let Th=0;class AL{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ug{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!gn||!ns||gn===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==gn)t=this.activeLink=new AL(gn,this),gn.deps?(t.prevDep=gn.depsTail,gn.depsTail.nextDep=t,gn.depsTail=t):gn.deps=gn.depsTail=t,FA(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=gn.depsTail,t.nextDep=void 0,gn.depsTail.nextDep=t,gn.depsTail=t,gn.deps===t&&(gn.deps=i)}return t}trigger(e){this.version++,Th++,this.notify(e)}notify(e){p_();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{m_()}}}function FA(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)FA(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Op=new WeakMap,Ja=Symbol(""),Sx=Symbol(""),Eh=Symbol("");function Ti(n,e,t){if(ns&&gn){let i=Op.get(n);i||Op.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new ug),r.map=i,r.key=t),r.track()}}function uo(n,e,t,i,r,s){const o=Op.get(n);if(!o){Th++;return}const a=l=>{l&&l.trigger()};if(p_(),e==="clear")o.forEach(a);else{const l=_t(n),c=l&&f_(t);if(l&&t==="length"){const u=Number(i);o.forEach((h,d)=>{(d==="length"||d===Eh||!To(d)&&d>=u)&&a(h)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Eh)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Ja)),Sc(n)&&a(o.get(Sx)));break;case"delete":l||(a(o.get(Ja)),Sc(n)&&a(o.get(Sx)));break;case"set":Sc(n)&&a(o.get(Ja));break}}m_()}function CL(n,e){const t=Op.get(n);return t&&t.get(e)}function Nl(n){const e=$t(n);return e===n?e:(Ti(e,"iterate",Eh),Lr(n)?e:e.map(pi))}function hg(n){return Ti(n=$t(n),"iterate",Eh),n}const RL={__proto__:null,[Symbol.iterator](){return I0(this,Symbol.iterator,pi)},concat(...n){return Nl(this).concat(...n.map(e=>_t(e)?Nl(e):e))},entries(){return I0(this,"entries",n=>(n[1]=pi(n[1]),n))},every(n,e){return Xs(this,"every",n,e,void 0,arguments)},filter(n,e){return Xs(this,"filter",n,e,t=>t.map(pi),arguments)},find(n,e){return Xs(this,"find",n,e,pi,arguments)},findIndex(n,e){return Xs(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Xs(this,"findLast",n,e,pi,arguments)},findLastIndex(n,e){return Xs(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Xs(this,"forEach",n,e,void 0,arguments)},includes(...n){return N0(this,"includes",n)},indexOf(...n){return N0(this,"indexOf",n)},join(n){return Nl(this).join(n)},lastIndexOf(...n){return N0(this,"lastIndexOf",n)},map(n,e){return Xs(this,"map",n,e,void 0,arguments)},pop(){return yu(this,"pop")},push(...n){return yu(this,"push",n)},reduce(n,...e){return q1(this,"reduce",n,e)},reduceRight(n,...e){return q1(this,"reduceRight",n,e)},shift(){return yu(this,"shift")},some(n,e){return Xs(this,"some",n,e,void 0,arguments)},splice(...n){return yu(this,"splice",n)},toReversed(){return Nl(this).toReversed()},toSorted(n){return Nl(this).toSorted(n)},toSpliced(...n){return Nl(this).toSpliced(...n)},unshift(...n){return yu(this,"unshift",n)},values(){return I0(this,"values",pi)}};function I0(n,e,t){const i=hg(n),r=i[e]();return i!==n&&!Lr(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=t(s.value)),s}),r}const PL=Array.prototype;function Xs(n,e,t,i,r,s){const o=hg(n),a=o!==n&&!Lr(n),l=o[e];if(l!==PL[e]){const h=l.apply(n,s);return a?pi(h):h}let c=t;o!==n&&(a?c=function(h,d){return t.call(this,pi(h),d,n)}:t.length>2&&(c=function(h,d){return t.call(this,h,d,n)}));const u=l.call(o,c,i);return a&&r?r(u):u}function q1(n,e,t,i){const r=hg(n);let s=t;return r!==n&&(Lr(n)?t.length>3&&(s=function(o,a,l){return t.call(this,o,a,l,n)}):s=function(o,a,l){return t.call(this,o,pi(a),l,n)}),r[e](s,...i)}function N0(n,e,t){const i=$t(n);Ti(i,"iterate",Eh);const r=i[e](...t);return(r===-1||r===!1)&&v_(t[0])?(t[0]=$t(t[0]),i[e](...t)):r}function yu(n,e,t=[]){vo(),p_();const i=$t(n)[e].apply(n,t);return m_(),xo(),i}const IL=u_("__proto__,__v_isRef,__isVue"),UA=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(To));function NL(n){To(n)||(n=String(n));const e=$t(this);return Ti(e,"has",n),e.hasOwnProperty(n)}class BA{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?$A:WA:s?GA:HA).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=_t(e);if(!r){let l;if(o&&(l=RL[t]))return l;if(t==="hasOwnProperty")return NL}const a=Reflect.get(e,t,Xt(e)?e:i);if((To(t)?UA.has(t):IL(t))||(r||Ti(e,"get",t),s))return a;if(Xt(a)){const l=o&&f_(t)?a:a.value;return r&&_n(l)?ss(l):l}return _n(a)?r?ss(a):Mn(a):a}}class zA extends BA{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];if(!this._isShallow){const l=yo(s);if(!Lr(i)&&!yo(i)&&(s=$t(s),i=$t(i)),!_t(e)&&Xt(s)&&!Xt(i))return l||(s.value=i),!0}const o=_t(e)&&f_(t)?Number(t)<e.length:tn(e,t),a=Reflect.set(e,t,i,Xt(e)?e:r);return e===$t(r)&&(o?rr(i,s)&&uo(e,"set",t,i):uo(e,"add",t,i)),a}deleteProperty(e,t){const i=tn(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&i&&uo(e,"delete",t,void 0),r}has(e,t){const i=Reflect.has(e,t);return(!To(t)||!UA.has(t))&&Ti(e,"has",t),i}ownKeys(e){return Ti(e,"iterate",_t(e)?"length":Ja),Reflect.ownKeys(e)}}class VA extends BA{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const LL=new zA,OL=new VA,DL=new zA(!0),kL=new VA(!0),Mx=n=>n,zd=n=>Reflect.getPrototypeOf(n);function FL(n,e,t){return function(...i){const r=this.__v_raw,s=$t(r),o=Sc(s),a=n==="entr
2ies"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=r[n](...i),u=t?Mx:e?Dp:pi;return!e&&Ti(s,"iterate",l?Sx:Ja),{next(){const{value:h,done:d}=c.next();return d?{value:h,done:d}:{value:a?[u(h[0]),u(h[1])]:u(h),done:d}},[Symbol.iterator](){return this}}}}function Vd(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function UL(n,e){const t={get(r){const s=this.__v_raw,o=$t(s),a=$t(r);n||(rr(r,a)&&Ti(o,"get",r),Ti(o,"get",a));const{has:l}=zd(o),c=e?Mx:n?Dp:pi;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!n&&Ti($t(r),"iterate",Ja),r.size},has(r){const s=this.__v_raw,o=$t(s),a=$t(r);return n||(rr(r,a)&&Ti(o,"has",r),Ti(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=$t(a),c=e?Mx:n?Dp:pi;return!n&&Ti(l,"iterate",Ja),a.forEach((u,h)=>r.call(s,c(u),c(h),o))}};return ni(t,n?{add:Vd("add"),set:Vd("set"),delete:Vd("delete"),clear:Vd("clear")}:{add(r){!e&&!Lr(r)&&!yo(r)&&(r=$t(r));const s=$t(this);return zd(s).has.call(s,r)||(s.add(r),uo(s,"add",r,r)),this},set(r,s){!e&&!Lr(s)&&!yo(s)&&(s=$t(s));const o=$t(this),{has:a,get:l}=zd(o);let c=a.call(o,r);c||(r=$t(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?rr(s,u)&&uo(o,"set",r,s):uo(o,"add",r,s),this},delete(r){const s=$t(this),{has:o,get:a}=zd(s);let l=o.call(s,r);l||(r=$t(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&uo(s,"delete",r,void 0),c},clear(){const r=$t(this),s=r.size!==0,o=r.clear();return s&&uo(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=FL(r,n,e)}),t}function dg(n,e){const t=UL(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(tn(t,r)&&r in i?t:i,r,s)}const BL={get:dg(!1,!1)},zL={get:dg(!1,!0)},VL={get:dg(!0,!1)},HL={get:dg(!0,!0)},HA=new WeakMap,GA=new WeakMap,WA=new WeakMap,$A=new WeakMap;function GL(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function WL(n){return n.__v_skip||!Object.isExtensible(n)?0:GL(mL(n))}function Mn(n){return yo(n)?n:fg(n,!1,LL,BL,HA)}function $a(n){return fg(n,!1,DL,zL,GA)}function ss(n){return fg(n,!0,OL,VL,WA)}function ao(n){return fg(n,!0,kL,HL,$A)}function fg(n,e,t,i,r){if(!_n(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=WL(n);if(s===0)return n;const o=r.get(n);if(o)return o;const a=new Proxy(n,s===2?i:t);return r.set(n,a),a}function Qa(n){return yo(n)?Qa(n.__v_raw):!!(n&&n.__v_isReactive)}function yo(n){return!!(n&&n.__v_isReadonly)}function Lr(n){return!!(n&&n.__v_isShallow)}function v_(n){return n?!!n.__v_raw:!1}function $t(n){const e=n&&n.__v_raw;return e?$t(e):n}function x_(n){return!tn(n,"__v_skip")&&Object.isExtensible(n)&&MA(n,"__v_skip",!0),n}const pi=n=>_n(n)?Mn(n):n,Dp=n=>_n(n)?ss(n):n;function Xt(n){return n?n.__v_isRef===!0:!1}function Te(n){return jA(n,!1)}function Mt(n){return jA(n,!0)}function jA(n,e){return Xt(n)?n:new $L(n,e)}class $L{constructor(e,t){this.dep=new ug,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:$t(e),this._value=t?e:pi(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Lr(e)||yo(e);e=i?e:$t(e),rr(e,t)&&(this._rawValue=e,this._value=i?e:pi(e),this.dep.trigger())}}function L(n){return Xt(n)?n.value:n}function tt(n){return bt(n)?n():L(n)}const jL={get:(n,e,t)=>e==="__v_raw"?n:L(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const r=n[e];return Xt(r)&&!Xt(t)?(r.value=t,!0):Reflect.set(n,e,t,i)}};function qA(n){return Qa(n)?n:new Proxy(n,jL)}class qL{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new ug,{get:i,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function y_(n){return new qL(n)}function Ar(n){const e=_t(n)?new Array(n.length):{};for(const t in n)e[t]=XA(n,t);return e}class XL{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return CL($t(this._object),this._key)}}class YL{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function or(n,e,t){return Xt(n)?n:bt(n)?new YL(n):_n(n)&&arguments.length>1?XA(n,e,t):Te(n)}function XA(n,e,t){const i=n[e];return Xt(i)?i:new XL(n,e,t)}class KL{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ug(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Th-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&gn!==this)return NA(this,!0),!0}get value(){const e=this.dep.track();return DA(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ZL(n,e,t=!1){let i,r;return bt(n)?i=n:(i=n.get,r=n.set),new KL(i,r,t)}const Hd={},kp=new WeakMap;let Ba;function JL(n,e=!1,t=Ba){if(t){let i=kp.get(t);i||kp.set(t,i=[]),i.push(n)}}function QL(n,e,t=nn){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=t,c=_=>r?_:Lr(_)||r===!1||r===0?Wo(_,1):Wo(_);let u,h,d,f,p=!1,v=!1;if(Xt(n)?(h=()=>n.value,p=Lr(n)):Qa(n)?(h=()=>c(n),p=!0):_t(n)?(v=!0,p=n.some(_=>Qa(_)||Lr(_)),h=()=>n.map(_=>{if(Xt(_))return _.value;if(Qa(_))return c(_);if(bt(_))return l?l(_,2):_()})):bt(n)?e?h=l?()=>l(n,2):n:h=()=>
vendor: 57,589 bytes, lines 2-4
2{if(d){vo();try{d()}finally{xo()}}const _=Ba;Ba=u;try{return l?l(n,3,[f]):n(f)}finally{Ba=_}}:h=Ts,e&&r){const _=h,T=r===!0?1/0:r;h=()=>Wo(_(),T)}const m=Jc(),g=()=>{u.stop(),m&&m.active&&d_(m.effects,u)};if(s&&e){const _=e;e=(...T)=>{_(...T),g()}}let y=v?new Array(n.length).fill(Hd):Hd;const x=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const T=u.run();if(r||p||(v?T.some((S,E)=>rr(S,y[E])):rr(T,y))){d&&d();const S=Ba;Ba=u;try{const E=[T,y===Hd?void 0:v&&y[0]===Hd?[]:y,f];y=T,l?l(e,3,E):e(...E)}finally{Ba=S}}}else u.run()};return a&&a(x),u=new PA(h),u.scheduler=o?()=>o(x,!1):x,f=_=>JL(_,!1,u),d=u.onStop=()=>{const _=kp.get(u);if(_){if(l)l(_,4);else for(const T of _)T();kp.delete(u)}},e?i?x(!0):y=u.run():o?o(x.bind(null,!0),!0):u.run(),g.pause=u.pause.bind(u),g.resume=u.resume.bind(u),g.stop=g,g}function Wo(n,e=1/0,t){if(e<=0||!_n(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,Xt(n))Wo(n.value,e,t);else if(_t(n))for(let i=0;i<n.length;i++)Wo(n[i],e,t);else if(bA(n)||Sc(n))n.forEach(i=>{Wo(i,e,t)});else if(SA(n)){for(const i in n)Wo(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Wo(n[i],e,t)}return n}function ld(n,e,t,i){try{return i?n(...i):n()}catch(r){Qc(r,e,t)}}function Ps(n,e,t,i){if(bt(n)){const r=ld(n,e,t,i);return r&&rg(r)&&r.catch(s=>{Qc(s,e,t)}),r}if(_t(n)){const r=[];for(let s=0;s<n.length;s++)r.push(Ps(n[s],e,t,i));return r}}function Qc(n,e,t,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||nn;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const u=a.ec;if(u){for(let h=0;h<u.length;h++)if(u[h](n,l,c)===!1)return}a=a.parent}if(s){vo(),ld(s,null,10,[n,l,c]),xo();return}}eO(n,t,r,i,o)}function eO(n,e,t,i=!0,r=!1){if(r)throw n;console.error(n)}const Ui=[];let xs=-1;const Tc=[];let Ho=null,fc=0;const YA=Promise.resolve();let Fp=null;function xi(n){const e=Fp||YA;return n?e.then(this?n.bind(this):n):e}function tO(n){let e=xs+1,t=Ui.length;for(;e<t;){const i=e+t>>>1,r=Ui[i],s=Ah(r);s<n||s===n&&r.flags&2?e=i+1:t=i}return e}function __(n){if(!(n.flags&1)){const e=Ah(n),t=Ui[Ui.length-1];!t||!(n.flags&2)&&e>=Ah(t)?Ui.push(n):Ui.splice(tO(e),0,n),n.flags|=1,KA()}}function KA(){Fp||(Fp=YA.then(ZA))}function Tx(n){_t(n)?Tc.push(...n):Ho&&n.id===-1?Ho.splice(fc+1,0,n):n.flags&1||(Tc.push(n),n.flags|=1),KA()}function X1(n,e,t=xs+1){for(;t<Ui.length;t++){const i=Ui[t];if(i&&i.flags&2){if(n&&i.id!==n.uid)continue;Ui.splice(t,1),t--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function Up(n){if(Tc.length){const e=[...new Set(Tc)].sort((t,i)=>Ah(t)-Ah(i));if(Tc.length=0,Ho){Ho.push(...e);return}for(Ho=e,fc=0;fc<Ho.length;fc++){const t=Ho[fc];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}Ho=null,fc=0}}const Ah=n=>n.id==null?n.flags&2?-1:1/0:n.id;function ZA(n){try{for(xs=0;xs<Ui.length;xs++){const e=Ui[xs];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),ld(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;xs<Ui.length;xs++){const e=Ui[xs];e&&(e.flags&=-2)}xs=-1,Ui.length=0,Up(),Fp=null,(Ui.length||Tc.length)&&ZA()}}let Hi=null,JA=null;function Bp(n){const e=Hi;return Hi=n,JA=n&&n.type.__scopeId||null,e}function Ae(n,e=Hi,t){if(!e||n._n)return n;const i=(...r)=>{i._d&&Hp(-1);const s=Bp(e);let o;try{o=n(...r)}finally{Bp(s),i._d&&Hp(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function _s(n,e,t,i){const r=n.dirs,s=e&&e.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(vo(),Ps(l,t,8,[n.el,a,n,e]),xo())}}const QA=Symbol("_vte"),nO=n=>n.__isTeleport,ah=n=>n&&(n.disabled||n.disabled===""),Y1=n=>n&&(n.defer||n.defer===""),K1=n=>typeof SVGElement<"u"&&n instanceof SVGElement,Z1=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Ex=(n,e)=>{const t=n&&n.to;return Tn(t)?e?e(t):null:t},e2={name:"Teleport",__isTeleport:!0,process(n,e,t,i,r,s,o,a,l,c){const{mc:u,pc:h,pbc:d,o:{insert:f,querySelector:p,createText:v,createComment:m}}=c,g=ah(e.props);let{shapeFlag:y,children:x,dynamicChildren:_}=e;if(n==null){const T=e.el=v(""),S=e.anchor=v("");f(T,t,i),f(S,t,i);const E=(b,w)=>{y&16&&u(x,b,w,r,s,o,a,l)},M=()=>{const b=e.target=Ex(e.props,p),w=n2(b,e,v,f);b&&(o!=="svg"&&K1(b)?o="svg":o!=="mathml"&&Z1(b)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(b),g||(E(b,w),xp(e,!1)))};g&&(E(t,S),xp(e,!0)),Y1(e.props)?(e.el.__isMounted=!1,Fi(()=>{M(),delete e.el.__isMounted},s)):M()}else{if(Y1(e.props)&&n.el.__isMounted===!1){Fi(()=>{e2.process(n,e,t,i,r,s,o,a,l,c)},s);return}e.el=n.el,e.targetStart=n.targetStart;const T=e.anchor=n.anchor,S=e.target=n.target,E=e.targetAnchor=n.targetAnchor,M=ah(n.props),b=M?t:S,w=M?T:E;if(o==="svg"||K1(S)?o="svg":(o==="mathml"||Z1(S))&&(o="mathml"),_?(d(n.dynamicChildren,_,b,r,s,o,a),A_(n,e,!0)):l||h(n,e,b,w,r,s,o,a,!1),g)M?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Gd(e,t,T,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const A=e.target=Ex(e.props,p);A&&Gd(e,A,null,c,0)}else M&&Gd(e,S,E,c,1);xp(e,g)}},remove(n,e,t,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:h,props:d}=n;if(h&&(r(c),r(u)),s&&r(l),o&16){const f=s||!ah(d);for(let p=0;p<a.length;p++){const v=a[p];i(v,e,t,f,!!v.dynamicChildren)}}},move:Gd,hydrate:iO};function Gd(n,e,t,{o:{insert:i},m:r},s=2){s===0&&i(n.targetAnchor,e,t);const{el:o,anchor:a,shapeFlag:l,children:c,props:u}=n,h=s===2;if(h&&i(o,e,t),(!h||ah(u))&&l&16)for(let d=0;d<c.length;d++)r(c[d],e,t,2);h&&i(a,e,t)}function iO(n,e,t,i,r,s,{o:{nextSibling:o,parentNode:a,querySelector:l,insert:c,createText:u}},h){function d(v,m,g,y){m.anchor=h(o(v),m,a(v),t,i,r,s),m.targetStart=g,m.targetAnchor=y}const f=e.target=Ex(e.props,l),p=ah(e.props);if(f){const v=f._lpa||f.firstChild;if(e.shapeFlag&16)if(p)d(n,e,v,v&&o(v));else{e.anchor=o(n);let m=v;for(;m;){if(m&&m.nodeType===8){if(m.data==="teleport start anchor")e.targetStart=m;else if(m.data==="teleport anchor"){e.targetAnchor=m,f._lpa=e.targetAnchor&&o(e.targetAnchor);break}}m=o(m)}e.targetAnchor||n2(f,e,u,c),h(v&&o(v),e,f,t,i,r,s)}xp(e,p)}else p&&e.shapeFlag&16&&d(n,e,n,o(n));return e.anchor&&o(e.anchor)}const t2=e2;function xp(n,e){const t=n.ctx;if(t&&t.ut){let i,r;for(e?(i=n.el,r=n.anchor):(i=n.targetStart,r=n.targetAnchor);i&&i!==r;)i.nodeType===1&&i.setAttribute("data-v-owner",t.uid),i=i.nextSibling;t.ut()}}function n2(n,e,t,i){const r=e.targetStart=t(""),s=e.targetAnchor=t("");return r[QA]=s,n&&(i(r,n),i(s,n)),s}const rO=Symbol("_leaveCb");function b_(n,e){n.shapeFlag&6&&n.component?(n.transition=e,b_(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function qe(n,e){return bt(n)?ni({name:n.name},e,{setup:n}):n}function i2(){const n=Gn();return n?(n.appContext.config.idPrefix||"v")+"-"+n.ids[0]+n.ids[1]++:""}function w_(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}const zp=new WeakMap;function Ec(n,e,t,i,r=!1){if(_t(n)){n.forEach((p,v)=>Ec(p,e&&(_t(e)?e[v]:e),t,i,r));return}if(el(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Ec(n,e,t,i.component.subTree);return}const s=i.shapeFlag&4?R_(i.component):i.el,o=r?null:s,{i:a,r:l}=n,c=e&&e.r,u=a.refs===nn?a.refs={}:a.refs,h=a.setupState,d=$t(h),f=h===nn?_A:p=>tn(d,p);if(c!=null&&c!==l){if(J1(e),Tn(c))u[c]=null,f(c)&&(h[c]=null);else if(Xt(c)){c.value=null;const p=e;p.k&&(u[p.k]=null)}}if(bt(l))ld(l,a,12,[o,u]);else{const p=Tn(l),v=Xt(l);if(p||v){const m=()=>{if(n.f){const g=p?f(l)?h[l]:u[l]:l.value;if(r)_t(g)&&d_(g,s);else if(_t(g))g.includes(s)||g.push(s);else if(p)u[l]=[s],f(l)&&(h[l]=u[l]);else{const y=[s];l.value=y,n.k&&(u[n.k]=y)}}else p?(u[l]=o,f(l)&&(h[l]=o)):v&&(l.value=o,n.k&&(u[n.k]=o))};if(o){const g=()=>{m(),zp.delete(n)};g.id=-1,zp.set(n,g),Fi(g,t)}else J1(n),m()}}}function J1(n){const e=zp.get(n);e&&(e.flags|=8,zp.delete(n))}let Q1=!1;const Ll=()=>{Q1||(console.error("Hydration completed but contains mismatches."),Q1=!0)},sO=n=>n.namespaceURI.includes("svg")&&n.tagName!=="foreignObject",oO=n=>n.namespaceURI.includes("MathML"),Wd=n=>{if(n.nodeType===1){if(sO(n))return"svg";if(oO(n))return"mathml"}},mc=n=>n.nodeType===8;function aO(n){const{mt:e,p:t,o:{patchProp:i,createText:r,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:c}}=n,u=(x,_)=>{if(!_.hasChildNodes()){t(null,x,_),Up(),_._vnode=x;return}h(_.firstChild,x,null,null,null),Up(),_._vnode=x},h=(x,_,T,S,E,M=!1)=>{M=M||!!_.dynamicChildren;const b=mc(x)&&x.data==="[",w=()=>v(x,_,T,S,E,b),{type:A,ref:P,shapeFlag:H,patchFlag:B}=_;let G=x.nodeType;_.el=x,B===-2&&(M=!1,_.dynamicChildren=null);let O=null;switch(A){case nl:G!==3?_.children===""?(l(_.el=r(""),o(x),x),O=x):O=w():(x.data!==_.children&&(Ll(),x.data=_.children),O=s(x));break;case ur:y(x)?(O=s(x),g(_.el=x.content.firstChild,x,T)):G!==8||b?O=w():O=s(x);break;case ch:if(b&&(x=s(x),G=x.nodeType),G===1||G===3){O=x;const $=!_.children.length;for(let F=0;F<_.staticCount;F++)$&&(_.children+=O.nodeType===1?O.outerHTML:O.data),F===_.staticCount-1&&(_.anchor=O),O=s(O);return b?s(O):O}else w();break;case vn:b?O=p(x,_,T,S,E,M):O=w();break;default:if(H&1)(G!==1||_.type.toLowerCase()!==x.tagName.toLowerCase())&&!y(x)?O=w():O=d(x,_,T,S,E,M);else if(H&6){_.slotScopeIds=E;const $=o(x);if(b?O=m(x):mc(x)&&x.data==="teleport start"?O=m(x,x.data,"teleport end"):O=s(x),e(_,$,null,T,S,Wd($),M),el(_)&&!_.type.__asyncResolved){let F;b?(F=Ie(vn),F.anchor=O?O.previousSibling:$.lastChild):F=x.nodeType===3?os(""):Ie("div"),F.el=x,_.component.subTree=F}}else H&64?G!==8?O=w():O=_.type.hydrate(x,_,T,S,E,M,n,f):H&128&&(O=_.type.hydrate(x,_,T,S,Wd(o(x)),E,M,n,h))}return P!=null&&Ec(P,null,S,_),O},d=(x,_,T,S,E,M)=>{M=M||!!_.dynamicChildren;const{type:b,props:w,patchFlag:A,shapeFlag:P,dirs:H,transition:B}=_,G=b==="input"||b==="option";if(G||A!==-1){H&&_s(_,null,T,"created");let O=!1;if(y(x)){O=E2(null,B)&&T&&T.vnode.props&&T.vnode.props.appear;const F=x.content.firstChild;if(O){const J=F.getAttribute("class");J&&(F.$cls=J),B.beforeEnter(F)}g(F,x,T),_.el=x=F}if(P&16&&!(w&&(w.innerHTML||w.textContent))){let F=f(x.firstChild,_,x,T,S,E,M);for(;F;){$d(x,1)||Ll();const J=F;F=F.nextSibling,a(J)}}else if(P&8){let F=_.children;F[0]===`
3`&&(x.tagName==="PRE"||x.tagName==="TEXTAREA")&&(F=F.slice(1));const{textContent:J}=x;J!==F&&J!==F.replace(/\r\n|\r/g,`
4`)&&($d(x,0)||Ll(),x.textContent=_.children)}if(w){if(G||!M||A&48){const F=x.tagName.includes("-");for(const J in w)(G&&(J.endsWith("value")||J==="indeterminate")||ad(J)&&!Mc(J)||J[0]==="."||F)&&i(x,J,null,w[J],void 0,T)}else if(w.onClick)i(x,"onClick",null,w.onClick,void 0,T);else if(A&4&&Qa(w.style))for(const F in w.style)w.style[F]}let $;($=w&&w.onVnodeBeforeMount)&&Ir($,T,_),H&&_s(_,null,T,"beforeMount"),(($=w&&w.onVnodeMounted)||H||O)&&O2(()=>{$&&Ir($,T,_),O&&B.enter(x),H&&_s(_,null,T,"mounted")},S)}return x.nextSibling},f=(x,_,T,S,E,M,b)=>{b=b||!!_.dynamicChildren;const w=_.children,A=w.length;for(let P=0;P<A;P++){const H=b?w[P]:w[P]=_r(w[P]),B=H.type===nl;x?(B&&!b&&P+1<A&&_r(w[P+1]).type===nl&&(l(r(x.data.slice(H.children.length)),T,s(x)),x.data=H.children),x=h(x,H,S,E,M,b)):B&&!H.children?l(H.el=r(""),T):($d(T,1)||Ll(),t(null,H,T,null,S,E,Wd(T),M))}return x},p=(x,_,T,S,E,M)=>{const{slotScopeIds:b}=_;b&&(E=E?E.concat(b):b);const w=o(x),A=f(s(x),_,w,T,S,E,M);return A&&mc(A)&&A.data==="]"?s(_.anchor=A):(Ll(),l(_.anchor=c("]"),w,A),A)},v=(x,_,T,S,E,M)=>{if($d(x.parentElement,1)||Ll(),_.el=null,M){const A=m(x);for(;;){const P=s(x);if(P&&P!==A)a(P);else break}}const b=s(x),w=o(x);return a(x),t(null,_,w,b,T,S,Wd(w),E),T&&(T.vnode.el=_.el,vg(T,_.el)),b},m=(x,_="[",T="]")=>{let S=0;for(;x;)if(x=s(x),x&&mc(x)&&(x.data===_&&S++,x.data===T)){if(S===0)return s(x);S--}return x},g=(x,_,T)=>{const S=_.parentNode;S&&S.replaceChild(x,_);let E=T;for(;E;)E.vnode.el===_&&(E.vnode.el=E.subTree.el=x),E=E.parent},y=x=>x.nodeType===1&&x.tagName==="TEMPLATE";return[u,h]}const ew="data-allow-mismatch",lO={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function $d(n,e){if(e===0||e===1)for(;n&&!n.hasAttribute(ew);)n=n.parentElement;const t=n&&n.getAttribute(ew);if(t==null)return!1;if(t==="")return!0;{const i=t.split(",");return e===0&&i.includes("children")?!0:i.includes(lO[e])}}lg().requestIdleCallback;lg().cancelIdleCallback;function cO(n,e){if(mc(n)&&n.data==="["){let t=1,i=n.nextSibling;for(;i;){if(i.nodeType===1){if(e(i)===!1)break}else if(mc(i))if(i.data==="]"){if(--t===0)break}else i.data==="["&&t++;i=i.nextSibling}}else e(n)}const el=n=>!!n.type.__asyncLoader;function Ax(n){bt(n)&&(n={loader:n});const{loader:e,loadingComponent:t,errorComponent:i,delay:r=200,hydrate:s,timeout:o,suspensible:a=!0,onError:l}=n;let c=null,u,h=0;const d=()=>(h++,c=null,f()),f=()=>{let p;return c||(p=c=e().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),l)return new Promise((m,g)=>{l(v,()=>m(d()),()=>g(v),h+1)});throw v}).then(v=>p!==c&&c?c:(v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),u=v,v)))};return qe({name:"AsyncComponentWrapper",__asyncLoader:f,__asyncHydrate(p,v,m){let g=!1;(v.bu||(v.bu=[])).push(()=>g=!0);const y=()=>{g||m()},x=s?()=>{const _=s(y,T=>cO(p,T));_&&(v.bum||(v.bum=[])).push(_)}:y;u?x():f().then(()=>!v.isUnmounted&&x())},get __asyncResolved(){return u},setup(){const p=mi;if(w_(p),u)return()=>jd(u,p);const v=x=>{c=null,Qc(x,p,13,!i)};if(a&&p.suspense||Dc)return f().then(x=>()=>jd(x,p)).catch(x=>(v(x),()=>i?Ie(i,{error:x}):null));const m=Te(!1),g=Te(),y=Te(!!r);return r&&setTimeout(()=>{y.value=!1},r),o!=null&&setTimeout(()=>{if(!m.value&&!g.value){const x=new Error(`Async component timed out after ${o}ms.`);v(x),g.value=x}},o),f().then(()=>{m.value=!0,p.parent&&S_(p.parent.vnode)&&p.parent.update()}).catch(x=>{v(x),g.value=x}),()=>{if(m.value&&u)return jd(u,p);if(g.value&&i)return Ie(i,{error:g.value});if(t&&!y.value)return jd(t,p)}}})}function jd(n,e){const{ref:t,props:i,children:r,ce:s}=e.vnode,o=Ie(n,i,r);return o.ref=t,o.ce=s,delete e.vnode.ce,o}const S_=n=>n.type.__isKeepAlive;function r2(n,e){o2(n,"a",e)}function s2(n,e){o2(n,"da",e)}function o2(n,e,t=mi){const i=n.__wdc||(n.__wdc=()=>{let r=t;for(;r;){if(r.isDeactivated)return;r=r.parent}return n()});if(pg(e,i,t),t){let r=t.parent;for(;r&&r.parent;)S_(r.parent.vnode)&&uO(i,e,t,r),r=r.parent}}function uO(n,e,t,i){const r=pg(e,n,i,!0);di(()=>{d_(i[e],r)},t)}function pg(n,e,t=mi,i=!1){if(t){const r=t[n]||(t[n]=[]),s=e.__weh||(e.__weh=(...o)=>{vo();const a=hl(t),l=Ps(e,t,n,o);return a(),xo(),l});return i?r.unshift(s):r.push(s),s}}const Eo=n=>(e,t=mi)=>{(!Dc||n==="sp")&&pg(n,(...i)=>e(...i),t)},hO=Eo("bm"),On=Eo("m"),dO=Eo("bu"),fO=Eo("u"),mg=Eo("bum"),di=Eo("um"),pO=Eo("sp"),mO=Eo("rtg"),gO=Eo("rtc");function a2(n,e=mi){pg("ec",n,e)}const l2="components";function tw(n,e){return u2(l2,n,!0,e)||n}const c2=Symbol.for("v-ndc");function ws(n){return Tn(n)?u2(l2,n,!1)||n:n||c2}function u2(n,e,t=!0,i=!1){const r=Hi||mi;if(r){const s=r.type;{const a=aD(s,!1);if(a&&(a===e||a===$i(e)||a===ag($i(e))))return s}const o=nw(r[n]||s[n],e)||nw(r.appContext[n],e);return!o&&i?s:o}}function nw(n,e){return n&&(n[e]||n[$i(e)]||n[ag($i(e))])}function ul(n,e,t,i){let r;const s=t,o=_t(n);if(o||Tn(n)){const a=o&&Qa(n);let l=!1,c=!1;a&&(l=!Lr(n),c=yo(n),n=hg(n)),r=new Array(n.length);for(let u=0,h=n.length;u<h;u++)r[u]=e(l?c?Dp(pi(n[u])):pi(n[u]):n[u],u,void 0,s)}else if(typeof n=="number"){r=new Array(n);for(let a=0;a<n;a++)r[a]=e(a+1,a,void 0,s)}else if(_n(n))if(n[Symbol.iterator])r=Array.from(n,(a,l)=>e(a,l,void 0,s));else{const a=Object.keys(n);r=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];r[l]=e(n[u],u,l,s)}}else r=[];return r}function lt(n,e,t={},i,r){if(Hi.ce||Hi.parent&&el(Hi.parent)&&Hi.parent.ce){const c=Object.keys(t).length>0;return e!=="default"&&(t.name=e),pe(),Re(vn,null,[Ie("slot",t,i&&i())],c?-2:64)}let s=n[e];s&&s._c&&(s._d=!1),pe();const o=s&&h2(s(t)),a=t.key||o&&o.key,l=Re(vn,{key:(a&&!To(a)?a:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&n._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function h2(n){return n.some(e=>Oc(e)?!(e.type===ur||e.type===vn&&!h2(e.children)):!0)?n:null}function vO(n,e){const t={};for(const i in n)t[rh(i)]=n[i];return t}const Cx=n=>n?U2(n)?R_(n):Cx(n.parent):null,lh=ni(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Cx(n.parent),$root:n=>Cx(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>M_(n),$forceUpdate:n=>n.f||(n.f=()=>{__(n.update)}),$nextTick:n=>n.n||(n.n=xi.bind(n.proxy)),$watch:n=>BO.bind(n)}),L0=(n,e)=>n!==nn&&!n.__isScriptSetup&&tn(n,e),xO={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return t[e];case 3:return s[e]}else{if(L0(i,e))return o[e]=1,i[e];if(r!==nn&&tn(r,e))return o[e]=2,r[e];if((c=n.propsOptions[0])&&tn(c,e))return o[e]=3,s[e];if(t!==nn&&tn(t,e))return o[e]=4,t[e];Rx&&(o[e]=0)}}const u=lh[e];let h,d;if(u)return e==="$attrs"&&Ti(n.attrs,"get",""),u(n);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==nn&&tn(t,e))return o[e]=4,t[e];if(d=l.config.globalProperties,tn(d,e))return d[e]},set({_:n},e,t){const{data:i,setupState:r,ctx:s}=n;return L0(r,e)?(r[e]=t,!0):i!==nn&&tn(i,e)?(i[e]=t,!0):tn(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(s[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:r,propsOptions:s,type:o}},a){let l,c;return!!(t[a]||n!==nn&&a[0]!=="$"&&tn(n,a)||L0(e,a)||(l=s[0])&&tn(l,a)||tn(i,a)||tn(lh,a)||tn(r.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:tn(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function la(){return f2().slots}function d2(){return f2().attrs}function f2(n){const e=Gn();return e.setupContext||(e.setupContext=z2(e))}function Ch(n){return _t(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function yO(n,e){const t=Ch(n);for(const i in e){if(i.startsWith("__skip"))continue;let r=t[i];r?_t(r)||bt(r)?r=t[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(r=t[i]={default:e[i]}),r&&e[`__skip_${i}`]&&(r.skipFactory=!0)}return t}function _O(n,e){return!n||!e?n||e:_t(n)&&_t(e)?n.concat(e):ni({},Ch(n),Ch(e))}function zs(n){const e=Gn();let t=n();return Ox(),rg(t)&&(t=t.catch(i=>{throw hl(e),i})),[t,()=>hl(e)]}let Rx=!0;function bO(n){const e=M_(n),t=n.proxy,i=n.ctx;Rx=!1,e.beforeCreate&&iw(e.beforeCreate,n,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:d,beforeUpdate:f,updated:p,activated:v,deactivated:m,beforeDestroy:g,beforeUnmount:y,destroyed:x,unmounted:_,render:T,renderTracked:S,renderTriggered:E,errorCaptured:M,serverPrefetch:b,expose:w,inheritAttrs:A,components:P,directives:H,filters:B}=e;if(c&&wO(c,i,null),o)for(const $ in o){const F=o[$];bt(F)&&(i[$]=F.bind(t))}if(r){const $=r.call(t,t);_n($)&&(n.data=Mn($))}if(Rx=!0,s)for(const $ in s){const F=s[$],J=bt(F)?F.bind(t,t):bt(F.get)?F.get.bind(t,t):Ts,se=!bt(F)&&bt(F.set)?F.set.bind(t):Ts,be=ge({get:J,set:se});Object.defineProperty(i,$,{enumerable:!0,configurable:!0,get:()=>be.value,set:Fe=>be.value=Fe})}if(a)for(const $ in a)p2(a[$],i,t,$);if(l){const $=bt(l)?l.call(t):l;Reflect.ownKeys($).forEach(F=>{Mr(F,$[F])})}u&&iw(u,n,"c");function O($,F){_t(F)?F.forEach(J=>$(J.bind(t))):F&&$(F.bind(t))}if(O(hO,h),O(On,d),O(dO,f),O(fO,p),O(r2,v),O(s2,m),O(a2,M),O(gO,S),O(mO,E),O(mg,y),O(di,_),O(pO,b),_t(w))if(w.length){const $=n.exposed||(n.exposed={});w.forEach(F=>{Object.defineProperty($,F,{get:()=>t[F],set:J=>t[F]=J,enumerable:!0})})}else n.exposed||(n.exposed={});T&&n.render===Ts&&(n.render=T),A!=null&&(n.inheritAttrs=A),P&&(n.components=P),H&&(n.directives=H),b&&w_(n)}function wO(n,e,t=Ts){_t(n)&&(n=Px(n));for(const i in n){const r=n[i];let s;_n(r)?"default"in r?s=gi(r.from||i,r.default,!0):s=gi(r.from||i):s=gi(r),Xt(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function iw(n,e,t){Ps(_t(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function p2(n,e,t,i){let r=i.includes(".")?R2(t,i):()=>t[i];if(Tn(n)){const s=e[n];bt(s)&&Je(r,s)}else if(bt(n))Je(r,n.bind(t));else if(_n(n))if(_t(n))n.forEach(s=>p2(s,e,t,i));else{const s=bt(n.handler)?n.handler.bind(t):e[n.handler];bt(s)&&Je(r,s,n)}}function M_(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=n.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!t&&!i?l=e:(l={},r.length&&r.forEach(c=>Vp(l,c,o,!0)),Vp(l,e,o)),_n(e)&&s.set(e,l),l}function Vp(n,e,t,i=!1){const{mixins:r,extends:s}=e;s&&Vp(n,s,t,!0),r&&r.forEach(o=>Vp(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=SO[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const SO={data:rw,props:sw,emits:sw,methods:Ku,computed:Ku,beforeCreate:Oi,created:Oi,beforeMount:Oi,mounted:Oi,beforeUpdate:Oi,updated:Oi,beforeDestroy:Oi,beforeUnmount:Oi,destroyed:Oi,unmounted:Oi,activated:Oi,deactivated:Oi,errorCaptured:Oi,serverPrefetch:Oi,components:Ku,directives:Ku,watch:TO,provide:rw,inject:MO};function rw(n,e){return e?n?function(){return ni(bt(n)?n.call(this,this):n,bt(e)?e.call(this,this):e)}:e:n}function MO(n,e){return Ku(Px(n),Px(e))}function Px(n){if(_t(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function Oi(n,e){return n?[...new Set([].concat(n,e))]:e}function Ku(n,e){return n?ni(Object.create(null),n,e):e}function sw(n,e){return n?_t(n)&&_t(e)?[...new Set([...n,...e])]:ni(Object.create(null),Ch(n),Ch(e??{})):e}function TO(n,e){if(!n)return e;if(!e)return n;const t=ni(Object.create(null),n);for(const i in e)t[i]=Oi(n[i],e[i]);return t}function m2(){return{app:null,config:{isNativeTag:_A,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let EO=0;function AO(n,e){return function(i,r=null){bt(i)||(i=ni({},i)),r!=null&&!_n(r)&&(r=null);const s=m2(),o=new WeakSet,a=[];let l=!1;const c=s.app={_uid:EO++,_component:i,_props:r,_container:null,_context:s,_instance:null,version:cD,get config(){return s.config},set config(u){},use(u,...h){return o.has(u)||(u&&bt(u.install)?(o.add(u),u.install(c,...h)):bt(u)&&(o.add(u),u(c,...h))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,h){return h?(s.components[u]=h,c):s.components[u]},directive(u,h){return h?(s.directives[u]=h,c):s.directives[u]},mount(u,h,d){if(!l){const f=c._ceVNode||Ie(i,r);return f.appContext=s,d===!0?d="svg":d===!1&&(d=void 0),h&&e?e(f,u):n(f,u,d),l=!0,c._container=u,u.__vue_app__=c,R_(f.component)}},onUnmount(u){a.push(u)},unmount(){l&&(Ps(a,c._instance,16),n(null,c._container),delete c._container.__vue_app__)},provide(u,h){return s.provides[u]=h,c},runWithContext(u){const h=tl;tl=c;try{return u()}finally{tl=h}}};return c}}let tl=null;function Mr(n,e){if(mi){let t=mi.provides;const i=mi.parent&&mi.parent.provides;i===t&&(t=mi.provides=Object.create(i)),t[n]=e}}function gi(n,e,t=!1){const i=Gn();if(i||tl){let r=tl?tl._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&n in r)return r[n];if(arguments.length>1)return t&&bt(e)?e.call(i&&i.proxy):e}}function eu(){return!!(Gn()||tl)}const g2={},v2=()=>Object.create(g2),x2=n=>Object.getPrototypeOf(n)===g2;function CO(n,e,t,i=!1){const r={},s=v2();n.propsDefaults=Object.create(null),y2(n,e,r,s);for(const o in n.propsOptions[0])o in r||(r[o]=void 0);t?n.props=i?r:$a(r):n.type.props?n.props=r:n.props=s,n.attrs=s}function RO(n,e,t,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=n,a=$t(r),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let h=0;h<u.length;h++){let d=u[h];if(gg(n.emitsOptions,d))continue;const f=e[d];if(l)if(tn(s,d))f!==s[d]&&(s[d]=f,c=!0);else{const p=$i(d);r[p]=Ix(l,a,p,f,n,!1)}else f!==s[d]&&(s[d]=f,c=!0)}}}else{y2(n,e,r,s)&&(c=!0);let u;for(const h in a)(!e||!tn(e,h)&&((u=aa(h))===h||!tn(e,u)))&&(l?t&&(t[h]!==void 0||t[u]!==void 0)&&(r[h]=Ix(l,a,h,void 0,n,!0)):delete r[h]);if(s!==a)for(const h in s)(!e||!tn(e,h))&&(delete s[h],c=!0)}c&&uo(n.attrs,"set","")}function y2(n,e,t,i){const[r,s]=n.propsOptions;let o=!1,a;if(e)for(let l in e){if(Mc(l))continue;const c=e[l];let u;r&&tn(r,u=$i(l))?!s||!s.includes(u)?t[u]=c:(a||(a={}))[u]=c:gg(n.emitsOptions,l)||(!(l in i)||c!==i[l])&&(i[l]=c,o=!0)}if(s){const l=$t(t),c=a||nn;for(let u=0;u<s.length;u++){const h=s[u];t[h]=Ix(r,l,h,c[h],n,!tn(c,h))}}return o}function Ix(n,e,t,i,r,s){const o=n[t];if(o!=null){const a=tn(o,"default");if(a&&i===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&bt(l)){const{propsDefaults:c}=r;if(t in c)i=c[t];else{const u=hl(r);i=c[t]=l.call(null,e),u()}}else i=l;r.ce&&r.ce._setProp(t,i)}o[0]&&(s&&!a?i=!1:o[1]&&(i===""||i===aa(t))&&(i=!0))}return i}const PO=new WeakMap;function _2(n,e,t=!1){const i=t?PO:e.propsCache,r=i.get(n);if(r)return r;const s=n.props,o={},a=[];let l=!1;if(!bt(n)){const u=h=>{l=!0;const[d,f]=_2(h,e,!0);ni(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!s&&!l)return _n(n)&&i.set(n,wc),wc;if(_t(s))for(let u=0;u<s.length;u++){const h=$i(s[u]);ow(h)&&(o[h]=nn)}else if(s)for(const u in s){const h=$i(u);if(ow(h)){const d=s[u],f=o[h]=_t(d)||bt(d)?{type:d}:ni({},d),p=f.type;let v=!1,m=!0;if(_t(p))for(let g=0;g<p.length;++g){const y=p[g],x=bt(y)&&y.name;if(x==="Boolean"){v=!0;break}else x==="String"&&(m=!1)}else v=bt(p)&&p.name==="Boolean";f[0]=v,f[1]=m,(v||tn(f,"default"))&&a.push(h)}}const c=[o,a];return _n(n)&&i.set(n,c),c}function ow(n){return n[0]!=="$"&&!Mc(n)}const T_=n=>n==="_"||n==="_ctx"||n==="$stable",E_=n=>_t(n)?n.map(_r):[_r(n)],IO=(n,e,t)=>{if(e._n)return e;const i=Ae((...r)=>E_(e(...r)),t);return i._c=!1,i},b2=(n,e,t)=>{const i=n._ctx;for(const r in n){if(T_(r))continue;const s=n[r];if(bt(s))e[r]=IO(r,s,i);else if(s!=null){const o=E_(s);e[r]=()=>o}}},w2=(n,e)=>{const t=E_(e);n.slots.default=()=>t},S2=(n,e,t)=>{for(const i in e)(t||!T_(i))&&(n[i]=e[i])},NO=(n,e,t)=>{const i=n.slots=v2();if(n.vnode.shapeFlag&32){const r=e._;r?(S2(i,e,t),t&&MA(i,"_",r,!0)):b2(e,i)}else e&&w2(n,e)},LO=(n,e,t)=>{const{vnode:i,slots:r}=n;let s=!0,o=nn;if(i.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:S2(r,e,t):(s=!e.$stable,b2(e,r)),o=e}else e&&(w2(n,e),o={default:1});if(s)for(const a in r)!T_(a)&&o[a]==null&&delete r[a]},Fi=O2;function M2(n){return T2(n)}function OO(n){return T2(n,aO)}function T2(n,e){const t=lg();t.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:d,setScopeId:f=Ts,insertStaticContent:p}=n,v=(N,D,R,X=null,Z=null,K=null,Q=void 0,ae=null,ee=!!D.dynamicChildren)=>{if(N===D)return;N&&!$o(N,D)&&(X=fe(N),Fe(N,Z,K,!0),N=null),D.patchFlag===-2&&(ee=!1,D.dynamicChildren=null);const{type:te,ref:k,shapeFlag:C}=D;switch(te){case nl:m(N,D,R,X);break;case ur:g(N,D,R,X);break;case ch:N==null&&y(D,R,X,Q);break;case vn:P(N,D,R,X,Z,K,Q,ae,ee);break;default:C&1?T(N,D,R,X,Z,K,Q,ae,ee):C&6?H(N,D,R,X,Z,K,Q,ae,ee):(C&64||C&128)&&te.process(N,D,R,X,Z,K,Q,ae,ee,V)}k!=null&&Z?Ec(k,N&&N.ref,K,D||N,!D):k==null&&N&&N.ref!=null&&Ec(N.ref,null,K,N,!0)},m=(N,D,R,X)=>{if(N==null)i(D.el=a(D.children),R,X);else{const Z=D.el=N.el;D.children!==N.children&&c(Z,D.children)}},g=(N,D,R,X)=>{N==null?i(D.el=l(D.children||""),R,X):D.el=N.el},y=(N,D,R,X)=>{[N.el,N.anchor]=p(N.children,D,R,X,N.el,N.anchor)},x=({el:N,anchor:D},R,X)=>{let Z;for(;N&&N!==D;)Z=d(N),i(N,R,X),N=Z;i(D,R,X)},_=({el:N,anchor:D})=>{let R;for(;N&&N!==D;)R=d(N),r(N),N=R;r(D)},T=(N,D,R,X,Z,K,Q,ae,ee)=>{if(D.type==="svg"?Q="svg":D.type==="math"&&(Q="mathml"),N==null)S(D,R,X,Z,K,Q,ae,ee);else{const te=N.el&&N.el._isVueCE?N.el:null;try{te&&te._beginPatch(),b(N,D,Z,K,Q,ae,ee)}finally{te&&te._endPatch()}}},S=(N,D,R,X,Z,K,Q,ae)=>{let ee,te;const{props:k,shapeFlag:C,transition:Y,dirs:ne}=N;if(ee=N.el=o(N.type,K,k&&k.is,k),C&8?u(ee,N.children):C&16&&M(N.children,ee,null,X,Z,O0(N,K),Q,ae),ne&&_s(N,null,X,"created"),E(ee,N,N.scopeId,Q,X),k){for(const le in k)le!=="value"&&!Mc(le)&&s(ee,le,null,k[le],K,X);"value"in k&&s(ee,"value",null,k.value,K),(te=k.onVnodeBeforeMount)&&Ir(te,X,N)}ne&&_s(N,null,X,"beforeMount");const me=E2(Z,Y);me&&Y.beforeEnter(ee),i(ee,D,R),((te=k&&k.onVnodeMounted)||me||ne)&&Fi(()=>{te&&Ir(te,X,N),me&&Y.enter(ee),ne&&_s(N,null,X,"mounted")},Z)},E=(N,D,R,X,Z)=>{if(R&&f(N,R),X)for(let K=0;K<X.length;K++)f(N,X[K]);if(Z){let K=Z.subTree;if(D===K||N2(K.type)&&(K.ssContent===D||K.ssFallback===D)){const Q=Z.vnode;E(N,Q,Q.scopeId,Q.slotScopeIds,Z.parent)}}},M=(N,D,R,X,Z,K,Q,ae,ee=0)=>{for(let te=ee;te<N.length;te++){const k=N[te]=ae?Go(N[te]):_r(N[te]);v(null,k,D,R,X,Z,K,Q,ae)}},b=(N,D,R,X,Z,K,Q)=>{const ae=D.el=N.el;let{patchFlag:ee,dynamicChildren:te,dirs:k}=D;ee|=N.patchFlag&16;const C=N.props||nn,Y=D.props||nn;let ne;if(R&&ya(R,!1),(ne=Y.onVnodeBeforeUpdate)&&Ir(ne,R,D,N),k&&_s(D,N,R,"beforeUpdate"),R&&ya(R,!0),(C.innerHTML&&Y.innerHTML==null||C.textContent&&Y.textContent==null)&&u(ae,""),te?w(N.dynamicChildren,te,ae,R,X,O0(D,Z),K):Q||F(N,D,ae,null,R,X,O0(D,Z),K,!1),ee>0){if(ee&16)A(ae,C,Y,R,Z);else if(ee&2&&C.class!==Y.class&&s(ae,"class",null,Y.class,Z),ee&4&&s(ae,"style",C.style,Y.style,Z),ee&8){const me=D.dynamicProps;for(let le=0;le<me.length;le++){const De=me[le],Ne=C[De],Ye=Y[De];(Ye!==Ne||De==="value")&&s(ae,De,Ne,Ye,Z,R)}}ee&1&&N.children!==D.children&&u(ae,D.children)}else!Q&&te==null&&A(ae,C,Y,R,Z);((ne=Y.onVnodeUpdated)||k)&&Fi(()=>{ne&&Ir(ne,R,D,N),k&&_s(D,N,R,"updated")},X)},w=(N,D,R,X,Z,K,Q)=>{for(let ae=0;ae<D.length;ae++){const ee=N[ae],te=D[ae],k=ee.el&&(ee.type===vn||!$o(ee,te)||ee.shapeFlag&198)?h(ee.el):R;v(ee,te,k,null,X,Z,K,Q,!0)}},A=(N,D,R,X,Z)=>{if(D!==R){if(D!==nn)for(const K in D)!Mc(K)&&!(K in R)&&s(N,K,D[K],null,Z,X);for(const K in R){if(Mc(K))continue;const Q=R[K],ae=D[K];Q!==ae&&K!=="value"&&s(N,K,ae,Q,Z,X)}"value"in R&&s(N,"value",D.value,R.value,Z)}},P=(N,D,R,X,Z,K,Q,ae,ee)=>{const te=D.el=N?N.el:a(""),k=D.anchor=N?N.anchor:a("");let{patchFlag:C,dynamicChildren:Y,slotScopeIds:ne}=D;ne&&(ae=ae?ae.concat(ne):ne),N==null?(i(te,R,X),i(k,R,X),M(D.children||[],R,k,Z,K,Q,ae,ee)):C>0&&C&64&&Y&&N.dynamicChildren?(w(N.dynamicChildren,Y,R,Z,K,Q,ae),(D.key!=null||Z&&D===Z.subTree)&&A_(N,D,!0)):F(N,D,R,k,Z,K,Q,ae,ee)},H=(N,D,R,X,Z,K,Q,ae,ee)=>{D.slotScopeIds=ae,N==null?D.shapeFlag&512?Z.ctx.activate(D,R,X,Q,ee):B(D,R,X,Z,K,Q,ee):G(N,D,ee)},B=(N,D,R,X,Z,K,Q)=>{const ae=N.component=iD(N,X,Z);if(S_(N)&&(ae.ctx.renderer=V),rD(ae,!1,Q),ae.asyncDep){if(Z&&Z.registerDep(ae,O,Q),!N.el){const ee=ae.subTree=Ie(ur);g(null,ee,D,R),N.placeholder=ee.el}}else O(ae,N,D,R,Z,K,Q)},G=(N,D,R)=>{const X=D.component=N.component;if(jO(N,D,R))if(X.asyncDep&&!X.asyncResolved){$(X,D,R);return}else X.next=D,X.update();else D.el=N.el,X.vnode=D},O=(N,D,R,X,Z,K,Q)=>{const ae=()=>{if(N.isMounted){let{next:C,bu:Y,u:ne,parent:me,vnode:le}=N;{const Se=A2(N);if(Se){C&&(C.el=le.el,$(N,C,Q)),Se.asyncDep.then(()=>{N.isUnmounted||ae()});return}}let De=C,Ne;ya(N,!1),C?(C.el=le.el,$(N,C,Q)):C=le,Y&&C0(Y),(Ne=C.props&&C.props.onVnodeBeforeUpdate)&&Ir(Ne,me,C,le),ya(N,!0);const Ye=D0(N),Xe=N.subTree;N.subTree=Ye,v(Xe,Ye,h(Xe.el),fe(Xe),N,Z,K),C.el=Ye.el,De===null&&vg(N,Ye.el),ne&&Fi(ne,Z),(Ne=C.props&&C.props.onVnodeUpdated)&&Fi(()=>Ir(Ne,me,C,le),Z)}else{let C;const{el:Y,props:ne}=D,{bm:me,m:le,parent:De,root:Ne,type:Ye}=N,Xe=el(D);if(ya(N,!1),me&&C0(me),!Xe&&(C=ne&&ne.onVnodeBeforeMount)&&Ir(C,De,D),ya(N,!0),Y&&ye){const Se=()=>{N.subTree=D0(N),ye(Y,N.subTree,N,Z,null)};Xe&&Ye.__asyncHydrate?Ye.__asyncHydrate(Y,N,Se):Se()}else{Ne.ce&&Ne.ce._def.shadowRoot!==!1&&Ne.ce._injectChildStyle(Ye);const Se=N.subTree=D0(N);v(null,Se,R,X,N,Z,K),D.el=Se.el}if(le&&Fi(le,Z),!Xe&&(C=ne&&ne.onVnodeMounted)){const Se=D;Fi(()=>Ir(C,De,Se),Z)}(D.shapeFlag&256||De&&el(De.vnode)&&De.vnode.shapeFlag&256)&&N.a&&Fi(N.a,Z),N.isMounted=!0,D=R=X=null}};N.scope.on();const ee=N.effect=new PA(ae);N.scope.off();const te=N.update=ee.run.bind(ee),k=N.job=ee.runIfDirty.bind(ee);k.i=N,k.id=N.uid,ee.scheduler=()=>__(k),ya(N,!0),te()},$=(N,D,R)=>{D.component=N;const X=N.vnode.props;N.vnode=D,N.next=null,RO(N,D.props,X,R),LO(N,D.children,R),vo(),X1(N),xo()},F=(N,D,R,X,Z,K,Q,ae,ee=!1)=>{const te=N&&N.children,k=N?N.shapeFlag:0,C=D.children,{patchFlag:Y,shapeFlag:ne}=D;if(Y>0){if(Y&128){se(te,C,R,X,Z,K,Q,ae,ee);return}else if(Y&256){J(te,C,R,X,Z,K,Q,ae,ee);return}}ne&8?(k&16&&he(te,Z,K),C!==te&&u(R,C)):k&16?ne&16?se(te,C,R,X,Z,K,Q,ae,ee):he(te,Z,K,!0):(k&8&&u(R,""),ne&16&&M(C,R,X,Z,K,Q,ae,ee))},J=(N,D,R,X,Z,K,Q,ae,ee)=>{N=N||wc,D=D||wc;const te=N.length,k=D.length,C=Math.min(te,k);let Y;for(Y=0;Y<C;Y++){const ne=D[Y]=ee?Go(D[Y]):_r(D[Y]);v(N[Y],ne,R,null,Z,K,Q,ae,ee)}te>k?he(N,Z,K,!0,!1,C):M(D,R,X,Z,K,Q,ae,ee,C)},se=(N,D,R,X,Z,K,Q,ae,ee)=>{let te=0;const k=D.length;let C=N.length-1,Y=k-1;for(;te<=C&&te<=Y;){const ne=N[te],me=D[te]=ee?Go(D[te]):_r(D[te]);if($o(ne,me))v(ne,me,R,null,Z,K,Q,ae,ee);else break;te++}for(;te<=C&&te<=Y;){const ne=N[C],me=D[Y]=ee?Go(D[Y]):_r(D[Y]);if($o(ne,me))v(ne,me,R,null,Z,K,Q,ae,ee);else break;C--,Y--}if(te>C){if(te<=Y){const ne=Y+1,me=ne<k?D[ne].el:X;for(;te<=Y;)v(null,D[te]=ee?Go(D[te]):_r(D[te]),R,me,Z,K,Q,ae,ee),te++}}else if(te>Y)for(;te<=C;)Fe(N[te],Z,K,!0),te++;else{const ne=te,me=te,le=new Map;for(te=me;te<=Y;te++){const j=D[te]=ee?Go(D[te]):_r(D[te]);j.key!=null&&le.set(j.key,te)}let De,Ne=0;const Ye=Y-me+1;let Xe=!1,Se=0;const ke=new Array(Ye);for(te=0;te<Ye;te++)ke[te]=0;for(te=ne;te<=C;te++){const j=N[te];if(Ne>=Ye){Fe(j,Z,K,!0);continue}let ce;if(j.key!=null)ce=le.get(j.key);else for(De=me;De<=Y;De++)if(ke[De-me]===0&&$o(j,D[De])){ce=De;break}ce===void 0?Fe(j,Z,K,!0):(ke[ce-me]=te+1,ce>=Se?Se=ce:Xe=!0,v(j,D[ce],R,null,Z,K,Q,ae,ee),Ne++)}const ut=Xe?DO(ke):wc;for(De=ut.length-1,te=Ye-1;te>=0;te--){const j=me+te,ce=D[j],Ce=D[j+1],W=j+1<k?Ce.el||Ce.placeholder:X;ke[te]===0?v(null,ce,R,W,Z,K,Q,ae,ee):Xe&&(De<0||te!==ut[De]?be(ce,R,W,2):De--)}}},be=(N,D,R,X,Z=null)=>{const{el:K,type:Q,transition:ae,children:ee,shapeFlag:te}=N;if(te&6){be(N.component.subTree,D,R,X);return}if(te&128){N.suspense.move(D,R,X);return}if(te&64){Q.move(N,D,R,V);return}if(Q===vn){i(K,D,R);for(let C=0;C<ee.length;C++)be(ee[C],D,R,X);i(N.anchor,D,R);return}if(Q===ch){x(N,D,R);return}if(X!==2&&te&1&&ae)if(X===0)ae.beforeEnter(K),i(K,D,R),Fi(()=>ae.enter(K),Z);else{const{leave:C,delayLeave:Y,afterLeave:ne}=ae,me=()=>{N.ctx.isUnmounted?r(K):i(K,D,R)},le=()=>{K._isLeaving&&K[rO](!0),C(K,()=>{me(),ne&&ne()})};Y?Y(K,me,le):le()}else i(K,D,R)},Fe=(N,D,R,X=!1,Z=!1)=>{const{type:K,props:Q,ref:ae,children:ee,dynamicChildren:te,shapeFlag:k,patchFlag:C,dirs:Y,cacheIndex:ne}=N;if(C===-2&&(Z=!1),ae!=null&&(vo(),Ec(ae,null,R,N,!0),xo()),ne!=null&&(D.renderCache[ne]=void 0),k&256){D.ctx.deactivate(N);return}const me=k&1&&Y,le=!el(N);let De;if(le&&(De=Q&&Q.onVnodeBeforeUnmount)&&Ir(De,D,N),k&6)ze(N.component,R,X);else{if(k&128){N.suspense.unmount(R,X);return}me&&_s(N,null,D,"beforeUnmount"),k&64?N.type.remove(N,D,R,V,X):te&&!te.hasOnce&&(K!==vn||C>0&&C&64)?he(te,D,R,!1,!0):(K===vn&&C&384||!Z&&k&16)&&he(ee,D,R),X&&Le(N)}(le&&(De=Q&&Q.onVnodeUnmounted)||me)&&Fi(()=>{De&&Ir(De,D,N),me&&_s(N,null,D,"unmounted")},R)},Le=N=>{const{type:D,el:R,anchor:X,transition:Z}=N;if(D===vn){Ge(R,X);return}if(D===ch){_(N);return}const K=()=>{r(R),Z&&!Z.persisted&&Z.afterLeave&&Z.afterLeave()};if(N.shapeFlag&1&&Z&&!Z.persisted){const{leave:Q,delayLeave:ae}=Z,ee=()=>Q(R,K);ae?ae(N.el,K,ee):ee()}else K()},Ge=(N,D)=>{let R;for(;N!==D;)R=d(N),r(N),N=R;r(D)},ze=(N,D,R)=>{const{bum:X,scope:Z,job:K,subTree:Q,um:ae,m:ee,a:te}=N;aw(ee),aw(te),X&&C0(X),Z.stop(),K&&(K.flags|=8,Fe(Q,N,D,R)),ae&&Fi(ae,D),Fi(()=>{N.isUnmounted=!0},D)},he=(N,D,R,X=!1,Z=!1,K=0)=>{for(let Q=K;Q<N.length;Q++)Fe(N[Q],D,R,X,Z)},fe=N=>{if(N.shapeFlag&6)return fe(N.component.subTree);if(N.shapeFlag&128)return N.suspense.next();const D=d(N.anchor||N.el),R=D&&D[QA];return R?d(R):D};let ue=!1;const I=(N,D,R)=>{N==null?D._vnode&&Fe(D._vnode,null,null,!0):v(D._vnode||null,N,D,null,null,null,R),D._vnode=N,ue||(ue=!0,X1(),Up(),ue=!1)},V={p:v,um:Fe,m:be,r:Le,mt:B,mc:M,pc:F,pbc:w,n:fe,o:n};let q,ye;return e&&([q,ye]=e(V)),{render:I,hydrate:q,createApp:AO(I,q)}}function O0({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function ya({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function E2(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function A_(n,e,t=!1){const i=n.children,r=e.children;if(_t(i)&&_t(r))for(let s=0;s<i.length;s++){const o=i[s];let a=r[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[s]=Go(r[s]),a.el=o.el),!t&&a.patchFlag!==-2&&A_(o,a)),a.type===nl&&a.patchFlag!==-1&&(a.el=o.el),a.type===ur&&!a.el&&(a.el=o.el)}}function DO(n){const e=n.slice(),t=[0];let i,r,s,o,a;const l=n.length;for(i=0;i<l;i++){const c=n[i];if(c!==0){if(r=t[t.length-1],n[r]<c){e[i]=r,t.push(i);continue}for(s=0,o=t.length-1;s<o;)a=s+o>>1,n[t[a]]<c?s=a+1:o=a;c<n[t[s]]&&(s>0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function A2(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:A2(e)}function aw(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}const kO=Symbol.for("v-scx"),FO=()=>gi(kO);function un(n,e){return cd(n,null,e)}function C2(n,e){return cd(n,null,{flush:"post"})}function UO(n,e){return cd(n,null,{flush:"sync"})}function Je(n,e,t){return cd(n,e,t)}function cd(n,e,t=nn){const{immediate:i,deep:r,flush:s,once:o}=t,a=ni({},t),l=e&&i||!e&&s!=="post";let c;if(Dc){if(s==="sync"){const f=FO();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=Ts,f.resume=Ts,f.pause=Ts,f}}const u=mi;a.call=(f,p,v)=>Ps(f,u,p,v);let h=!1;s==="post"?a.scheduler=f=>{Fi(f,u&&u.suspense)}:s!=="sync"&&(h=!0,a.scheduler=(f,p)=>{p?f():__(f)}),a.augmentJob=f=>{e&&(f.flags|=4),h&&(f.flags|=2,u&&(f.id=u.uid,f.i=u))};const d=QL(n,e,a);return Dc&&(c?c.push(d):l&&d()),d}function BO(n,e,t){const i=this.proxy,r=Tn(n)?n.includes(".")?R2(i,n):()=>i[n]:n.bind(i,i);let s;bt(e)?s=e:(s=e.handler,t=e);const o=hl(this),a=cd(r,s.bind(i),t);return o(),a}function R2(n,e){const t=e.split(".");return()=>{let i=n;for(let r=0;r<t.length&&i;r++)i=i[t[r]];return i}}function zO(n,e,t=nn){const i=Gn(),r=$i(e),s=aa(e),o=P2(n,r),a=y_((l,c)=>{let u,h=nn,d;return UO(()=>{const f=n[r];rr(u,f)&&(u=f,c())}),{get(){return l(),t.get?t.get(u):u},set(f){const p=t.set?t.set(f):f;if(!rr(p,u)&&!(h!==nn&&rr(f,h)))return;const v=i.vnode.props;v&&(e in v||r in v||s in v)&&(`onUpdate:${e}`in v||`onUpdate:${r}`in v||`onUpdate:${s}`in v)||(u=f,c()),i.emit(`update:${e}`,p),rr(f,p)&&rr(f,h)&&!rr(p,d)&&c(),h=f,d=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||nn:a,done:!1}:{done:!0}}}},a}const P2=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${$i(e)}Modifiers`]||n[`${aa(e)}Modifiers`];function VO(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||nn;let r=t;const s=e.startsWith("update:"),o=s&&P2(i,e.slice(7));o&&(o.trim&&(r=t.map(u=>Tn(u)?u.trim():u)),o.number&&(r=t.map(xL)));let a,l=i[a=rh(e)]||i[a=rh($i(e))];!l&&s&&(l=i[a=rh(aa(e))]),l&&Ps(l,n,6,r);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,Ps(c,n,6,r)}}const HO=new WeakMap;function I2(n,e,t=!1){const i=t?HO:e.emitsCache,r=i.get(n);if(r!==void 0)return r;const s=n.emits;let o={},a=!1;if(!bt(n)){const l=c=>{const u=I2(c,e,!0);u&&(a=!0,ni(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!s&&!a?(_n(n)&&i.set(n,null),null):(_t(s)?s.forEach(l=>o[l]=null):ni(o,s),_n(n)&&i.set(n,o),o)}function gg(n,e){return!n||!ad(e)?!1:(e=e.slice(2).replace(/Once$/,""),tn(n,e[0].toLowerCase()+e.slice(1))||tn(n,aa(e))||tn(n,e))}function D0(n){const{type:e,vnode:t,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:d,setupState:f,ctx:p,inheritAttrs:v}=n,m=Bp(n);let g,y;try{if(t.shapeFlag&4){const _=r||i,T=_;g=_r(c.call(T,_,u,h,f,d,p)),y=a}else{const _=e;g=_r(_.length>1?_(h,{attrs:a,slots:o,emit:l}):_(h,null)),y=e.props?a:WO(a)}}catch(_){uh.length=0,Qc(_,n,1),g=Ie(ur)}let x=g;if(y&&v!==!1){const _=Object.keys(y),{shapeFlag:T}=x;_.length&&T&7&&(s&&_.some(h_)&&(y=$O(y,s)),x=Es(x,y,!1,!0))}return t.dirs&&(x=Es(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition&&b_(x,t.transition),g=x,Bp(m),g}function GO(n,e=!0){let t;for(let i=0;i<n.length;i++){const r=n[i];if(Oc(r)){if(r.type!==ur||r.children==="v-if"){if(t)return;t=r}}else return}return t}const WO=n=>{let e;for(const t in n)(t==="class"||t==="style"||ad(t))&&((e||(e={}))[t]=n[t]);return e},$O=(n,e)=>{const t={};for(const i in n)(!h_(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function jO(n,e,t){const{props:i,children:r,component:s}=n,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?lw(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let h=0;h<u.length;h++){const d=u[h];if(o[d]!==i[d]&&!gg(c,d))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:i===o?!1:i?o?lw(i,o,c):!0:!!o;return!1}function lw(n,e,t){const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(e[s]!==n[s]&&!gg(t,s))return!0}return!1}function vg({vnode:n,parent:e},t){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===n&&(i.el=n.el),i===n)(n=e.vnode).el=t,e=e.parent;else break}}const N2=n=>n.__isSuspense;let Nx=0;const qO={name:"Suspense",__isSuspense:!0,process(n,e,t,i,r,s,o,a,l,c){if(n==null)XO(e,t,i,r,s,o,a,l,c);else{if(s&&s.deps>0&&!n.suspense.isInFallback){e.suspense=n.suspense,e.suspense.vnode=e,e.el=n.el;return}YO(n,e,t,i,r,o,a,l,c)}},hydrate:KO,normalize:ZO},yr=qO;function Rh(n,e){const t=n.props&&n.props[e];bt(t)&&t()}function XO(n,e,t,i,r,s,o,a,l){const{p:c,o:{createElement:u}}=l,h=u("div"),d=n.suspense=L2(n,r,i,e,h,t,s,o,a,l);c(null,d.pendingBranch=n.ssContent,h,null,i,d,s,o),d.deps>0?(Rh(n,"onPending"),Rh(n,"onFallback"),c(null,n.ssFallback,e,t,i,null,s,o),Ac(d,n.ssFallback)):d.resolve(!1,!0)}function YO(n,e,t,i,r,s,o,a,{p:l,um:c,o:{createElement:u}}){const h=e.suspense=n.suspense;h.vnode=e,e.el=n.el;const d=e.ssContent,f=e.ssFallback,{activeBranch:p,pendingBranch:v,isInFallback:m,isHydrating:g}=h;if(v)h.pendingBranch=d,$o(v,d)?(l(v,d,h.hiddenContainer,null,r,h,s,o,a),h.deps<=0?h.resolve():m&&(g||(l(p,f,t,i,r,null,s,o,a),Ac(h,f)))):(h.pendingId=Nx++,g?(h.isHydrating=!1,h.activeBranch=v):c(v,r,h),h.deps=0,h.effects.length=0,h.hiddenContainer=u("div"),m?(l(null,d,h.hiddenContainer,null,r,h,s,o,a),h.deps<=0?h.resolve():(l(p,f,t,i,r,null,s,o,a),Ac(h,f))):p&&$o(p,d)?(l(p,d,t,i,r,h,s,o,a),h.resolve(!0)):(l(null,d,h.hiddenContainer,null,r,h,s,o,a),h.deps<=0&&h.resolve()));else if(p&&$o(p,d))l(p,d,t,i,r,h,s,o,a),Ac(h,d);else if(Rh(e,"onPending"),h.pendingBranch=d,d.shapeFlag&512?h.pendingId=d.component.suspenseId:h.pendingId=Nx++,l(null,d,h.hiddenContainer,null,r,h,s,o,a),h.deps<=0)h.resolve();else{const{timeout:y,pendingId:x}=h;y>0?setTimeout(()=>{h.pendingId===x&&h.fallback(f)},y):y===0&&h.fallback(f)}}function L2(n,e,t,i,r,s,o,a,l,c,u=!1){const{p:h,m:d,um:f,n:p,o:{parentNode:v,remove:m}}=c;let g;const y=JO(n);y&&e&&e.pendingBranch&&(g=e.pendingId,e.deps++);const x=n.props?yL(n.props.timeout):void 0,_=s,T={vnode:n,parent:e,parentComponent:t,namespace:o,container:i,hiddenContainer:r,deps:0,pendingId:Nx++,timeout:typeof x=="number"?x:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(S=!1,E=!1){const{vnode:M,activeBranch:b,pendingBranch:w,pendingId:A,effects:P,parentComponent:H,container:B,isInFallback:G}=T;let O=!1;T.isHydrating?T.isHydrating=!1:S||(O=b&&w.transition&&w.transition.mode==="out-in",O&&(b.transition.afterLeave=()=>{A===T.pendingId&&(d(w,B,s===_?p(b):s,0),Tx(P),G&&M.ssFallback&&(M.ssFallback.el=null))}),b&&(v(b.el)===B&&(s=p(b)),f(b,H,T,!0),!O&&G&&M.ssFallback&&(M.ssFallback.el=null)),O||d(w,B,s,0)),Ac(T,w),T.pendingBranch=null,T.isInFallback=!1;let $=T.parent,F=!1;for(;$;){if($.pendingBranch){$.effects.push(...P),F=!0;break}$=$.parent}!F&&!O&&Tx(P),T.effects=[],y&&e&&e.pendingBranch&&g===e.pendingId&&(e.deps--,e.deps===0&&!E&&e.resolve()),Rh(M,"onResolve")},fallback(S){if(!T.pendingBranch)return;const{vnode:E,activeBranch:M,parentComponent:b,container:w,namespace:A}=T;Rh(E,"onFallback");const P=p(M),H=()=>{T.isInFallback&&(h(null,S,w,P,b,null,A,a,l),Ac(T,S))},B=S.transition&&S.transition.mode==="out-in";B&&(M.transition.afterLeave=H),T.isInFallback=!0,f(M,b,null,!0),B||H()},move(S,E,M){T.activeBranch&&d(T.activeBranch,S,E,M),T.container=S},next(){return T.activeBranch&&p(T.activeBranch)},registerDep(S,E,M){const b=!!T.pendingBranch;b&&T.deps++;const w=S.vnode.el;S.asyncDep.catch(A=>{Qc(A,S,0)}).then(A=>{if(S.isUnmounted||T.isUnmounted||T.pendingId!==S.suspenseId)return;S.asyncResolved=!0;const{vnode:P}=S;Dx(S,A,!1),w&&(P.el=w);const H=!w&&S.subTree.el;E(S,P,v(w||S.subTree.el),w?null:p(S.subTree),T,o,M),H&&(P.placeholder=null,m(H)),vg(S,P.el),b&&--T.deps===0&&T.resolve()})},unmount(S,E){T.isUnmounted=!0,T.activeBranch&&f(T.activeBranch,t,S,E),T.pendingBranch&&f(T.pendingBranch,t,S,E)}};return T}function KO(n,e,t,i,r,s,o,a,l){const c=e.suspense=L2(e,i,t,n.parentNode,document.createElement("div"),null,r,s,o,a,!0),u=l(n,c.pendingBranch=e.ssContent,t,c,s,o);return c.deps===0&&c.resolve(!1,!0),u}function ZO(n){const{shapeFlag:e,children:t}=n,i=e&32;n.ssContent=cw(i?t.default:t),n.ssFallback=i?cw(t.fallback):Ie(ur)}function cw(n){let e;if(bt(n)){const t=Lc&&n._c;t&&(n._d=!1,pe()),n=n(),t&&(n._d=!0,e=ar,D2())}return _t(n)&&(n=GO(n)),n=_r(n),e&&!n.dynamicChildren&&(n.dynamicChildren=e.filter(t=>t!==n)),n}function O2(n,e){e&&e.pendingBranch?_t(n)?e.effects.push(...n):e.effects.push(n):Tx(n)}function Ac(n,e){n.activeBranch=e;const{vnode:t,parentComponent:i}=n;let r=e.el;for(;!r&&e.component;)e=e.component.subTree,r=e.el;t.el=r,i&&i.subTree===t&&(i.vnode.el=r,vg(i,r))}function JO(n){const e=n.props&&n.props.suspensible;return e!=null&&e!==!1}const vn=Symbol.for("v-fgt"),nl=Symbol.for("v-txt"),ur=Symbol.for("v-cmt"),ch=Symbol.for("v-stc"),uh=[];let ar=null;function pe(n=!1){uh.push(ar=n?null:[])}function D2(){uh.pop(),ar=uh[uh.length-1]||null}let Lc=1;function Hp(n,e=!1){Lc+=n,n<0&&ar&&e&&(ar.hasOnce=!0)}function k2(n){return n.dynamicChildren=Lc>0?ar||wc:null,D2(),Lc>0&&ar&&ar.push(n),n}function pt(n,e,t,i,r,s){return k2(Me(n,e,t,i,r,s,!0))}function Re(n,e,t,i,r){return k2(Ie(n,e,t,i,r,!0))}function Oc(n){return n?n.__v_isVNode===!0:!1}function $o(n,e){return n.type===e.type&&n.key===e.key}const F2=({key:n})=>n??null,yp=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Tn(n)||Xt(n)||bt(n)?{i:Hi,r:n,k:e,f:!!t}:n:null);function Me(n,e=null,t=null,i=0,r=null,s=n===vn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&F2(e),ref:e&&yp(e),scopeId:JA,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Hi};return a?(C_(l,t),s&128&&n.normalize(l)):t&&(l.shapeFlag|=Tn(t)?8:16),Lc>0&&!o&&ar&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ar.push(l),l}const Ie=QO;function QO(n,e=null,t=null,i=0,r=null,s=!1){if((!n||n===c2)&&(n=ur),Oc(n)){const a=Es(n,e,!0);return t&&C_(a,t),Lc>0&&!s&&ar&&(a.shapeFlag&6?ar[ar.indexOf(n)]=a:ar.push(a)),a.patchFlag=-2,a}if(lD(n)&&(n=n.__vccOpts),e){e=Ur(e);let{class:a,style:l}=e;a&&!Tn(a)&&(e.class=qt(a)),_n(l)&&(v_(l)&&!_t(l)&&(l=ni({},l)),e.style=kr(l))}const o=Tn(n)?1:N2(n)?128:nO(n)?64:_n(n)?4:bt(n)?2:0;return Me(n,e,t,i,r,o,s,!0)}function Ur(n){return n?v_(n)||x2(n)?ni({},n):n:null}function Es(n,e,t=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=n,c=e?Rt(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&F2(c),ref:e&&e.ref?t&&s?_t(s)?s.concat(yp(e)):[s,yp(e)]:yp(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==vn?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Es(n.ssContent),ssFallback:n.ssFallback&&Es(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&b_(u,l.clone(u)),u}function os(n=" ",e=0){return Ie(nl,null,n,e)}function eD(n,e){const t=Ie(ch,null,n);return t.staticCount=e,t}function en(n="",e=!1){return e?(pe(),Re(ur,null,n)):Ie(ur,null,n)}function _r(n){return n==null||typeof n=="boolean"?Ie(ur):_t(n)?Ie(vn,null,n.slice()):Oc(n)?Go(n):Ie(nl,null,String(n))}function Go(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Es(n)}function C_(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(_t(e))t=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),C_(n,r()),r._c&&(r._d=!0));return}else{t=32;const r=e._;!r&&!x2(e)?e._ctx=Hi:r===3&&Hi&&(Hi.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else bt(e)?(e={default:e,_ctx:Hi},t=32):(e=String(e),i&64?(t=16,e=[os(e)]):t=8);n.children=e,n.shapeFlag|=t}function Rt(...n){const e={};for(let t=0;t<n.length;t++){const i=n[t];for(const r in i)if(r==="class")e.class!==i.class&&(e.class=qt([e.class,i.class]));else if(r==="style")e.style=kr([e.style,i.style]);else if(ad(r)){const s=e[r],o=i[r];o&&s!==o&&!(_t(s)&&s.includes(o))&&(e[r]=s?[].concat(s,o):o)}else r!==""&&(e[r]=i[r])}return e}function Ir(n,e,t,i=null){Ps(n,e,7,[t,i])}const tD=m2();let nD=0;function iD(n,e,t){const i=n.type,r=(e?e.appContext:n.appContext)||tD,s={uid:nD++,vnode:n,type:i,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new CA(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:_2(i,r),emitsOptions:I2(i,r),emit:null,emitted:null,propsDefaults:nn,inheritAttrs:i.inheritAttrs,ctx:nn,data:nn,props:nn,attrs:nn,slots:nn,refs:nn,setupState:nn,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=VO.bind(null,s),n.ce&&n.ce(s),s}let mi=null;const Gn=()=>mi||Hi;let Gp,Lx;{const n=lg(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Gp=e("__VUE_INSTANCE_SETTERS__",t=>mi=t),Lx=e("__VUE_SSR_SETTERS__",t=>Dc=t)}const hl=n=>{const e=mi;return Gp(n),n.scope.on(),()=>{n.scope.off(),Gp(e)}},Ox=()=>{mi&&mi.scope.off(),Gp(null)};function U2(n){return n.vnode.shapeFlag&4}let Dc=!1;function rD(n,e=!1,t=!1){e&&Lx(e);const{props:i,children:r}=n.vnode,s=U2(n);CO(n,i,s,e),NO(n,r,t||e);const o=s?sD(n,e):void 0;return e&&Lx(!1),o}function sD(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,xO);const{setup:i}=t;if(i){vo();const r=n.setupContext=i.length>1?z2(n):null,s=hl(n),o=ld(i,n,0,[n.props,r]),a=rg(o);if(xo(),s(),(a||n.sp)&&!el(n)&&w_(n),a){if(o.then(Ox,Ox),e)return o.then(l=>{Dx(n,l,e)}).catch(l=>{Qc(l,n,0)});n.asyncDep=o}else Dx(n,o,e)}else B2(n,e)}function Dx(n,e,t){bt(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:_n(e)&&(n.setupState=qA(e)),B2(n,t)}let uw;function B2(n,e,t){const i=n.type;if(!n.render){if(!e&&uw&&!i.render){const r=i.template||M_(n).template;if(r){const{isCustomElement:s,compilerOptions:o}=n.appContext.config,{delimiters:a,compilerOptions:l}=i,c=ni(ni({isCustomElement:s,delimiters:a},o),l);i.render=uw(r,c)}}n.render=i.render||Ts}{const r=hl(n);vo();try{bO(n)}finally{xo(),r()}}}const oD={get(n,e){return Ti(n,"get",""),n[e]}};function z2(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,oD),slots:n.slots,emit:n.emit,expose:e}}function R_(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(qA(x_(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in lh)return lh[t](n)},has(e,t){return t in e||t in lh}})):n.proxy}function aD(n,e=!0){return bt(n)?n.displayName||n.name:n.name||e&&n.__name}function lD(n){return bt(n)&&"__vccOpts"in n}const ge=(n,e)=>ZL(n,e,Dc);function Yn(n,e,t){try{Hp(-1);const i=arguments.length;return i===2?_n(e)&&!_t(e)?Oc(e)?Ie(n,null,[e]):Ie(n,e):Ie(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Oc(t)&&(t=[t]),Ie(n,e,t))}finally{Hp(1)}}const cD="3.5.24";let kx;const hw=typeof window<"u"&&window.trustedTypes;if(hw)try{kx=hw.createPolicy("vue",{createHTML:n=>n})}catch{}const V2=kx?n=>kx.createHTML(n):n=>n,uD="http://www.w3.org/2000/svg",hD="http://www.w3.org/1998/Math/MathML",oo=typeof document<"u"?document:null,dw=oo&&oo.createElement("template"),dD={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const r=e==="svg"?oo.createElementNS(uD,n):e==="mathml"?oo.createElementNS(hD,n):t?oo.createElement(n,{is:t}):oo.createElement(n);return n==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:n=>oo.createTextNode(n),createComment:n=>oo.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>oo.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,r,s){const o=t?t.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),t),!(r===s||!(r=r.nextSibling)););else{dw.innerHTML=V2(i==="svg"?`<svg>${n}</svg>`:i==="mathml"?`<math>${n}</math>`:n);const a=dw.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},fD=Symbol("_vtc");function pD(n,e,t){const i=n[fD];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const fw=Symbol("_vod"),mD=Symbol("_vsh"),gD=Symbol(""),vD=/(?:^|;)\s*display\s*:/;function xD(n,e,t){const i=n.style,r=Tn(t);let s=!1;if(t&&!r){if(e)if(Tn(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&_p(i,a,"")}else for(const o in e)t[o]==null&&_p(i,o,"");for(const o in t)o==="display"&&(s=!0),_p(i,o,t[o])}else if(r){if(e!==t){const o=i[gD];o&&(t+=";"+o),i.cssText=t,s=vD.test(t)}}else e&&n.removeAttribute("style");fw in n&&(n[fw]=s?i.display:"",n[mD]&&(i.display="none"))}const pw=/\s*!important$/;function _p(n,e,t){if(_t(t))t.forEach(i=>_p(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=yD(n,e);pw.test(t)?n.setProperty(aa(i),t.replace(pw,""),"important"):n[i]=t}}const mw=["Webkit","Moz","ms"],k0={};function yD(n,e){const t=k0[e];if(t)return t;let i=$i(e);if(i!=="filter"&&i in n)return k0[e]=i;i=ag(i);for(let r=0;r<mw.length;r++){const s=mw[r]+i;if(s in n)return k0[e]=s}return e}const gw="http://www.w3.org/1999/xlink";function vw(n,e,t,i,r,s=TL(e)){i&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(gw,e.slice(6,e.length)):n.setAttributeNS(gw,e,t):t==null||s&&!TA(t)?n.removeAttribute(e):n.setAttribute(e,s?"":To(t)?String(t):t)}function xw(n,e,t,i,r){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?V2(t):t);return}const s=n.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?n.getAttribute("value")||"":n.value,l=t==null?n.type==="checkbox"?"on":"":String(t);(a!==l||!("_value"in n))&&(n.value=l),t==null&&n.removeAttribute(e),n._value=t;return}let o=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=TA(t):t==null&&a==="string"?(t="",o=!0):a==="number"&&(t=0,o=!0)}try{n[e]=t}catch{}o&&n.removeAttribute(r||e)}function _D(n,e,t,i){n.addEventListener(e,t,i)}function bD(n,e,t,i){n.removeEventListener(e,t,i)}const yw=Symbol("_vei");function wD(n,e,t,i,r=null){const s=n[yw]||(n[yw]={}),o=s[e];if(i&&o)o.value=i;else{const[a,l]=SD(e);if(i){const c=s[e]=ED(i,r);_D(n,a,c,l)}else o&&(bD(n,a,o,l),s[e]=void 0)}}const _w=/(?:Once|Passive|Capture)$/;function SD(n){let e;if(_w.test(n)){e={};let i;for(;i=n.match(_w);)n=n.slice(0,n.length-i[0].length),e[i[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):aa(n.slice(2)),e]}let F0=0;const MD=Promise.resolve(),TD=()=>F0||(MD.then(()=>F0=0),F0=Date.now());function ED(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Ps(AD(i,t.value),e,5,[i])};return t.value=n,t.attached=TD(),t}function AD(n,e){if(_t(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const bw=n=>
4n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,CD=(n,e,t,i,r,s)=>{const o=r==="svg";e==="class"?pD(n,i,o):e==="style"?xD(n,t,i):ad(e)?h_(e)||wD(n,e,t,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):RD(n,e,i,o))?(xw(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&vw(n,e,i,o,s,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Tn(i))?xw(n,$i(e),i,s,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),vw(n,e,i,o))};function RD(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&bw(e)&&bt(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&n.tagName==="IFRAME"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=n.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return bw(e)&&Tn(t)?!1:e in n}const PD=["ctrl","shift","alt","meta"],ID={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>PD.some(t=>n[`${t}Key`]&&!e.includes(t))},hh=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=((r,...s)=>{for(let o=0;o<e.length;o++){const a=ID[e[o]];if(a&&a(r,e))return}return n(r,...s)}))},H2=ni({patchProp:CD},dD);let dh,ww=!1;function G2(){return dh||(dh=M2(H2))}function ND(){return dh=ww?dh:OO(H2),ww=!0,dh}const LD=((...n)=>{G2().render(...n)}),OD=((...n)=>{const e=G2().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=$2(i);if(!r)return;const s=e._component;!bt(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=t(r,!1,W2(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e}),DD=((...n)=>{const e=ND().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=$2(i);if(r)return t(r,!0,W2(r))},e});function W2(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function $2(n){return Tn(n)?document.querySelector(n):n}const kD=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,FD=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,UD=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function BD(n,e){if(n==="__proto__"||n==="constructor"&&e&&typeof e=="object"&&"prototype"in e){zD(n);return}return e}function zD(n){console.warn(`[destr] Dropping "${n}" key to prevent prototype pollution.`)}function Wp(n,e={}){if(typeof n!="string")return n;if(n[0]==='"'&&n[n.length-1]==='"'&&n.indexOf("\\")===-1)return n.slice(1,-1);const t=n.trim();if(t.length<=9)switch(t.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!UD.test(n)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return n}try{if(kD.test(n)||FD.test(n)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(n,BD)}return JSON.parse(n)}catch(i){if(e.strict)throw i;return n}}const VD=/#/g,HD=/&/g,GD=/\//g,WD=/=/g,P_=/\+/g,$D=/%5e/gi,jD=/%60/gi,qD=/%7c/gi,XD=/%20/gi;function YD(n){return encodeURI(""+n).replace(qD,"|")}function Fx(n){return YD(typeof n=="string"?n:JSON.stringify(n)).replace(P_,"%2B").replace(XD,"+").replace(VD,"%23").replace(HD,"%26").replace(jD,"`").replace($D,"^").replace(GD,"%2F")}function U0(n){return Fx(n).replace(WD,"%3D")}function $p(n=""){try{return decodeURIComponent(""+n)}catch{return""+n}}function KD(n){return $p(n.replace(P_," "))}function ZD(n){return $p(n.replace(P_," "))}function xg(n=""){const e=Object.create(null);n[0]==="?"&&(n=n.slice(1));for(const t of n.split("&")){const i=t.match(/([^=]+)=?(.*)/)||[];if(i.length<2)continue;const r=KD(i[1]);if(r==="__proto__"||r==="constructor")continue;const s=ZD(i[2]||"");e[r]===void 0?e[r]=s:Array.isArray(e[r])?e[r].push(s):e[r]=[e[r],s]}return e}function JD(n,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(t=>`${U0(n)}=${Fx(t)}`).join("&"):`${U0(n)}=${Fx(e)}`:U0(n)}function j2(n){return Object.keys(n).filter(e=>n[e]!==void 0).map(e=>
4JD(e,n[e])).filter(Boolean).join("&")}const QD=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,ek=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,tk=/^([/\\]\s*){2,}[^/\\]/,nk=/^[\s\0]*(blob|data|javascript|vbscript):$/i,ik=/\/$|\/\?|\/#/,rk=/^\.?\//;function ca(n,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?QD.test(n):ek.test(n)||(e.acceptRelative?tk.test(n):!1)}function sk(n){return!!n&&nk.test(n)}function Ux(n="",e){return e?ik.test(n):n.endsWith("/")}function I_(n="",e){if(!e)return(Ux(n)?n.slice(0,-1):n)||"/";if(!Ux(n,!0))return n||"/";let t=n,i="";const r=n.indexOf("#");r!==-1&&(t=n.slice(0,r),i=n.slice(r));const[s,...o]=t.split("?");return((s.endsWith("/")?s.slice(0,-1):s)||"/")+(o.length>0?`?${o.join("?")}`:"")+i}function jp(n="",e){if(!e)return n.endsWith("/")?n:n+"/";if(Ux(n,!0))return n||"/";let t=n,i="";const r=n.indexOf("#");if(r!==-1&&(t=n.slice(0,r),i=n.slice(r),!t))return i;const[s,...o]=t.split("?");return s+"/"+(o.length>0?`?${o.join("?")}`:"")+i}function ok(n=""){return n.startsWith("/")}function Sw(n=""){return ok(n)?n:"/"+n}function ak(n,e){if(X2(e)||ca(n))return n;const t=I_(e);return n.startsWith(t)?n:ud(t,n)}function lk(n,e){if(X2(e))return n;const t=I_(e);if(!n.startsWith(t))return n;const i=n.slice(t.length);return i[0]==="/"?i:"/"+i}function q2(n,e){const t=Z2(n),i={...xg(t.search),...e};return t.search=j2(i),J2(t)}function X2(n){return!n||n==="/"}function ck(n){return n&&n!=="/"}function ud(n,...e){let t=n||"";for(const i of e.filter(r=>ck(r)))if(t){const r=i.replace(rk,"");t=jp(t)+r}else t=i;return t}function Y2(...n){const e=/\/(?!\/)/,t=n.filter(Boolean),i=[];let r=0;for(const o of t)if(!(!o||o==="/")){for(const[a,l]of o.split(e).entries())if(!(!l||l===".")){if(l===".."){if(i.length===1&&ca(i[0]))continue;i.pop(),r--;continue}if(a===1&&i[i.length-1]?.endsWith(":/")){i[i.length-1]+="/"+l;continue}i.push(l),r++}}let s=i.join("/");return r>=0?t[0]?.startsWith("/")&&!s.startsWith("/")?s="/"+s:t[0]?.startsWith("./")&&!s.startsWith("./")&&(s="./"+s):s="../".repeat(-1*r)+s,t[t.length-1]?.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}function uk(n,e,t={}){return t.trailingSlash||(n=jp(n),e=jp(e)),t.leadingSlash||(n=Sw(n),e=Sw(e)),t.encoding||(n=$p(n),e=$p(e)),n===e}const K2=Symbol.for("ufo:protocolRelative");function Z2(n="",e){const t=n.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(t){const[,h,d=""]=t;return{protocol:h.toLowerCase(),pathname:d,href:h+d,auth:"",host:"",search:"",hash:""}}if(!ca(n,{acceptRelative:!0}))return Mw(n);const[,i="",r,s=""]=n.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];i==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=Mw(a);return{protocol:i.toLowerCase(),auth:r?r.slice(0,Math.max(0,r.length-1)):"",host:o,pathname:l,search:c,hash:u,[K2]:!i}}function Mw(n=""){const[e="",t="",i=""]=(n.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:t,hash:i}}function J2(n){const e=n.pathname||"",t=n.search?(n.search.startsWith("?")?"":"?")+n.search:"",i=n.hash||"",r=n.auth?n.auth+"@":"",s=n.host||"";return(n.protocol||n[K2]?(n.protocol||"")+"//":"")+r+s+e+t+i}class hk extends Error{constructor(e,t){super(e,t),this.name="FetchError",t?.cause&&!this.cause&&(this.cause=t.cause)}}function dk(n){const e=n.error?.message||n.error?.toString()||"",t=n.request?.method||n.options?.method||"GET",i=n.request?.url||String(n.request)||"/",r=`[${t}] ${JSON.stringify(i)}`,s=n.response?`${n.response.status} ${n.response.statusText}`:"<no response>",o=`${r}: ${s}${e?` ${e}`:""}`,a=new hk(o,n.error?{cause:n.error}:void 0);for(const l of["request","options","response"])Object.defineProperty(a,l,{get(){return n[l]}});for(const[l,c]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,l,{get(){return n.response&&n.response[c]}});return a}const fk=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function Tw(n="GET"){return fk.has(n.toUpperCase())}function pk(n){if(n===void 0)return!1;const e=typeof n;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(n)?!0:n.buffer||n instanceof FormData||n instanceof URLSearchParams?!1:n.constructor&&n.constructor.name==="Object"||typeof n.toJSON=="function"}const mk=new Set(["image/svg","application/xml","application/xhtml","application/html"]),gk=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vk(n=""){if(!n)return"json";const e=n.split(";").shift()||"";return gk.test(e)?"json":e==="text/event-stream"?"stream":mk.has(e)||e.startsWith("text/")?"text":"blob"}function xk(n,e,t,i){const r=yk(e?.headers??n?.headers,t?.headers,i);let s;return(t?.query||t?.params||e?.params||e?.query)&&(s={...t?.params,...t?.query,...e?.params,...e?.query}),{...t,...e,query:s,params:s,headers:r}}function yk(n,e,t){if(!e)return new t(n);const i=new t(e);if(n)for(const[r,s]of Symbol.iterator in n||Array.isArray(n)?n:new t(n))i.set(r,s);return i}async function qd(n,e){if(e)if(Array.isArray(e))for(const t of e)await t(n);else await e(n)}const _k=new Set([408,409,425,429,500,502,503,504]),bk=new Set([101,204,205,304]);function Q2(n={}){const{fetch:e=globalThis.fetch,Headers:t=globalThis.Headers,AbortController:i=globalThis.AbortController}=n;async function r(a){const l=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!l){let u;typeof a.options.retry=="number"?u=a.options.retry:u=Tw(a.options.method)?0:1;const h=a.response&&a.response.status||500;if(u>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(h):_k.has(h))){const d=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return d>0&&await new Promise(f=>setTimeout(f,d)),s(a.request,{...a.options,retry:u-1})}}const c=dk(a);throw Error.captureStackTrace&&Error.captureStackTrace(c,s),c}const s=async function(l,c={}){const u={request:l,options:xk(l,c,n.defaults,t),response:void 0,error:void 0};if(u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&(await qd(u,u.options.onRequest),u.options.headers instanceof t||(u.options.headers=new t(u.options.headers||{}))),typeof u.request=="string"&&(u.options.baseURL&&(u.request=ak(u.request,u.options.baseURL)),u.options.query&&(u.request=q2(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&Tw(u.options.method))if(pk(u.options.body)){const f=u.options.headers.get("content-type");typeof u.options.body!="string"&&(u.options.body=f==="application/x-www-form-urlencoded"?new URLSearchParams(u.options.body).toString():JSON.stringify(u.options.body)),f||u.options.headers.set("content-type","application/json"),u.o
4ptions.headers.has("accept")||u.options.headers.set("accept","application/json")}else("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half"));let h;if(!u.options.signal&&u.options.timeout){const f=new i;h=setTimeout(()=>{const p=new Error("[TimeoutError]: The operation was aborted due to timeout");p.name="TimeoutError",p.code=23,f.abort(p)},u.options.timeout),u.options.signal=f.signal}try{u.response=await e(u.request,u.options)}catch(f){return u.error=f,u.options.onRequestError&&await qd(u,u.options.onRequestError),await r(u)}finally{h&&clearTimeout(h)}if((u.response.body||u.response._bodyInit)&&!bk.has(u.response.status)&&u.options.method!=="HEAD"){const f=(u.options.parseResponse?"json":u.options.responseType)||vk(u.response.headers.get("content-type")||"");switch(f){case"json":{const p=await u.response.text(),v=u.options.parseResponse||Wp;u.response._data=v(p);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[f]()}}return u.options.onResponse&&await qd(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await qd(u,u.options.onResponseError),await r(u)):u.response},o=async function(l,c){return(await s(l,c))._data};return o.raw=s,o.native=(...a)=>e(...a),o.create=(a={},l={})=>Q2({...n,...l,defaults:{...n.defaults,...l.defaults,...a}}),o}const qp=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),wk=qp.fetch?(...n)=>qp.fetch(...n):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),Sk=qp.Headers,Mk=qp.AbortController,Tk=Q2({fetch:wk,Headers:Sk,AbortController:Mk}),Ek=Tk,Ak=()=>window?.__NUXT__?.config||window?.useNuxtApp?.().payload?.config,N_=()=>Ak().app,Ck=()=>N_().baseURL,Rk=()=>N_().buildAssetsDir,L_=(...n)=>Y2(eC(),Rk(),...n),eC=(...n)=>{const e=N_(),t=e.cdnURL||e.baseURL;return n.length?Y2(t,...n):t};globalThis.__buildAssetsURL=L_,globalThis.__publicAssetsURL=eC;globalThis.$fetch||(globalThis.$fetch=Ek.create({baseURL:Ck()}));"global"in globalThis||(globalThis.global=globalThis);function Bx(n,e={},t){for(const i in n){const r=n[i],s=t?`${t}:${i}`:i;typeof r=="object"&&r!==null?Bx(r,e,s):typeof r=="function"&&(e[s]=r)}return e}const Pk={run:n=>n()},Ik=()=>Pk,tC=typeof console.createTask<"u"?console.createTask:Ik;function Nk(n,e){const t=e.shift(),i=tC(t);return n.reduce((r,s)=>r.then(()=>i.run(()=>s(...e))),Promise.resolve())}function Lk(n,e){const t=e.shift(),i=tC(t);return Promise.all(n.map(r=>i.run(()=>r(...e))))}function B0(n,e){for(const t of[...n])t(e)}class Ok{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,i={}){if(!e||typeof t!="function")return()=>{};const r=e;let s;for(;this._deprecatedHooks[e];)s=this._deprecatedHooks[e],e=s.to;if(s&&!i.allowDeprecated){let o=s.message;o||(o=`${r} hook has been deprecated`+(s.to?`, please use ${s.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||(console.warn(o),this._deprecatedMessages.add(o))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let i,r=(...s)=>(typeof i=="function"&&i(),i=void 0,r=void 0,t(...s));return i=this.hook(e,r),i}removeHook(e,t){if(this._hooks[e]){const i=this._hooks[e].indexOf(t);i!==-1&&this._hooks[e].splice(i,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const i=this._hooks[e]||[];delete this._hooks[e];for(const r of i)this.hook(e,r)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=Bx(e),i=Object.keys(t).map(r=>this.hook(r,t[r]));return()=>{for(const r of i.splice(0,i.length))r()}}removeHooks(e){const t=Bx(e);for(const i in t)this.removeHook(i,t[i])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(Nk,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(Lk,e,...t)}callHookWith(e,t,...i){const r=this._before||this._after?{name:t,args:i,context:{}}:void 0;this._before&&B0(this._before,r);const s=e(t in this._hooks?[...this._hooks[t]]:[],i);return s instanceof Promise?s.finally(()=>{this._after&&r&&B0(this._after,r)}):(this._after&&r&&B0(this._after,r),s)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}}function nC(){return new Ok}function Dk(n={}){let e,t=!1;const i=o=>
4{if(e&&e!==o)throw new Error("Context conflict")};let r;if(n.asyncContext){const o=n.AsyncLocalStorage||globalThis.AsyncLocalStorage;o?r=new o:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const s=()=>{if(r){const o=r.getStore();if(o!==void 0)return o}return e};return{use:()=>{const o=s();if(o===void 0)throw new Error("Context is not available");return o},tryUse:()=>s(),set:(o,a)=>{a||i(o),e=o,t=!0},unset:()=>{e=void 0,t=!1},call:(o,a)=>{i(o),e=o;try{return r?r.run(o,a):a()}finally{t||(e=void 0)}},async callAsync(o,a){e=o;const l=()=>{e=o},c=()=>e===o?l:void 0;zx.add(c);try{const u=r?r.run(o,a):a();return t||(e=void 0),await u}finally{zx.delete(c)}}}}function kk(n={}){const e={};return{get(t,i={}){return e[t]||(e[t]=Dk({...n,...i})),e[t]}}}const Xp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},Ew="__unctx__",Fk=Xp[Ew]||(Xp[Ew]=kk()),Uk=(n,e={})=>Fk.get(n,e),Aw="__unctx_async_handlers__",zx=Xp[Aw]||(Xp[Aw]=new Set);function iC(n){const e=[];for(const r of zx){const s=r();s&&e.push(s)}const t=()=>{for(const r of e)r()};let i=n();return i&&typeof i=="object"&&"catch"in i&&(i=i.catch(r=>{throw t(),r})),[i,t]}const Cw={id:"__nuxt-loader"},Bk={componentName:"NuxtLink",prefetch:!0,prefetchOn:{visibility:!0}},zk="#__nuxt",rC="nuxt-app",Rw=36e5,Vk="vite:preloadError";function sC(n=rC){return Uk(n,{asyncContext:!1})}const Hk="__nuxt_plugin";function Gk(n){let e=0;const t={_id:n.id||rC||"nuxt-app",_scope:RA(),provide:void 0,versions:{get nuxt(){return"4.2.1"},get vue(){return t.vueApp.version}},payload:$a({...n.ssrContext?.payload||{},data:$a({}),state:Mn({}),once:new Set,_errors:$a({})}),static:{data:{}},runWithContext(r){return t._scope.active&&!Jc()?t._scope.run(()=>Pw(t,r)):Pw(t,r)},isHydrating:!0,deferHydration(){if(!t.isHydrating)return()=>{};e++;let r=!1;return()=>{if(!r&&(r=!0,e--,e===0))return t.isHydrating=!1,t.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:$a({}),_payloadRevivers:{},...n};{const r=window.__NUXT__;if(r)for(const s in r)switch(s){case"data":case"state":case"_errors":Object.assign(t.payload[s],r[s]);break;default:t.payload[s]=r[s]}}t.hooks=nC(),t.hook=t.hooks.hook,t.callHook=t.hooks.callHook,t.provide=(r,s)=>{const o="$"+r;Xd(t,o,s),Xd(t.vueApp.config.globalProperties,o,s)},Xd(t.vueApp,"$nuxt",t),Xd(t.vueApp.config.globalProperties,"$nuxt",t);{window.addEventListener(Vk,s=>{t.callHook("app:chunkError",{error:s.payload}),s.payload.message.includes("Unable to preload CSS")&&s.preventDefault()}),window.useNuxtApp||=fn;const r=t.hook("app:error",(...s)=>{console.error("[nuxt] error caught during app initialization",...s)});t.hook("app:mounted",r)}const i=t.payload.config;return t.provide("config",i),t}function Wk(n,e){e.hooks&&n.hooks.addHooks(e.hooks)}async function $k(n,e){if(typeof e=="function"){const{provide:t}=await n.runWithContext(()=>e(n))||{};if(t&&typeof t=="object")for(const i in t)n.provide(i,t[i])}}async function jk(n,e){const t=new Set,i=[],r=[];let s,o=0;async function a(l){const c=l.dependsOn?.filter(u=>e.some(h=>h._name===u)&&!t.has(u))??[];if(c.length>0)i.push([new Set(c),l]);else{const u=$k(n,l).then(async()=>{l._name&&(t.add(l._name),await Promise.all(i.map(async([h,d])=>{h.has(l._name)&&(h.delete(l._name),h.size===0&&(o++,await a(d)))})))}).catch(h=>{if(!l.parallel&&!n.payload.error)throw h;s||=h});l.parallel?r.push(u):await u}}for(const l of e)Wk(n,l);for(const l of e)await a(l);if(await Promise.all(r),o)for(let l=0;l<o;l++)await Promise.all(r);if(s)throw n.payload.error||s}function Vs(n){if(typeof n=="function")return n;const e=n._name||n.name;return delete n.name,Object.assign(n.setup||(()=>{}),n,{[Hk]:!0,_name:e})}function Pw(n,e,t){const i=()=>e();return sC(n._id).set(n),n.vueApp.runWithContext(i)}function qk(n){let e;return eu()&&(e=Gn()?.appContext.app.$nuxt),e||=sC(n).tryUse(),e||null}function fn(n){const e=qk(n);if(!e)throw new Error("[nuxt] instance unavailable");return e}function dl(n){return fn().$config}function Xd(n,e,t){Object.defineProperty(n,e,{get:()=>t})}function Xk(n,e){return{ctx:{table:n},matchAll:t=>aC(t,n)}}function oC(n){const e={};for(const t in n)e[t]=t==="dynamic"?new Map(Object.entries(n[t]).map(([i,r])=>[i,oC(r)])):new Map(Object.entries(n[t]));return e}function Yk(n){return Xk(oC(n))}function aC(n,e,t){n.endsWith("/")&&(n=n.slice(0,-1)||"/");const i=[];for(const[s,o]of Iw(e.wildcard))(n===s||n.startsWith(s+"/"))&&i.push(o);for(const[s,o]of Iw(e.dynamic))if(n.startsWith(s+"/")){const a="/"+n.slice(s.length).split("/").splice(2).join("/");i.push(...aC(a,o))}const r=e.static.get(n);
4return r&&i.push(r),i.filter(Boolean)}function Iw(n){return[...n.entries()].sort((e,t)=>e[0].length-t[0].length)}function z0(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function Vx(n,e,t=".",i){if(!z0(e))return Vx(n,{},t,i);const r=Object.assign({},e);for(const s in n){if(s==="__proto__"||s==="constructor")continue;const o=n[s];o!=null&&(i&&i(r,s,o,t)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:z0(o)&&z0(r[s])?r[s]=Vx(o,r[s],(t?`${t}.`:"")+s.toString(),i):r[s]=o))}return r}function lC(n){return(...e)=>e.reduce((t,i)=>Vx(t,i,"",n),{})}const tu=lC(),Kk=lC((n,e,t)=>{if(n[e]!==void 0&&typeof t=="function")return n[e]=t(n[e]),!0});function Zk(n,e){try{return e in n}catch{return!1}}class Nw extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(e,t={}){super(e,t),t.cause&&!this.cause&&(this.cause=t.cause)}toJSON(){const e={message:this.message,statusCode:Hx(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=cC(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}}function Jk(n){if(typeof n=="string")return new Nw(n);if(Qk(n))return n;const e=new Nw(n.message??n.statusMessage??"",{cause:n.cause||n});if(Zk(n,"stack"))try{Object.defineProperty(e,"stack",{get(){return n.stack}})}catch{try{e.stack=n.stack}catch{}}if(n.data&&(e.data=n.data),n.statusCode?e.statusCode=Hx(n.statusCode,e.statusCode):n.status&&(e.statusCode=Hx(n.status,e.statusCode)),n.statusMessage?e.statusMessage=n.statusMessage:n.statusText&&(e.statusMessage=n.statusText),e.statusMessage){const t=e.statusMessage;cC(e.statusMessage)!==t&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return n.fatal!==void 0&&(e.fatal=n.fatal),n.unhandled!==void 0&&(e.unhandled=n.unhandled),e}function Qk(n){return n?.constructor?.__h3_error__===!0}const eF=/[^\u0009\u0020-\u007E]/g;function cC(n=""){return n.replace(eF,"")}function Hx(n,e=200){return!n||(typeof n=="string"&&(n=Number.parseInt(n,10)),n<100||n>999)?e:n}const uC=Symbol("route");import.meta.url.replace(/\/app\/.*$/,"/");const Is=()=>fn()?.$router,O_=()=>eu()?gi(uC,fn()._route):fn()._route;const tF=()=>{try{if(fn()._processingMiddleware)return!0}catch{return!1}return!1},hC=(n,e)=>{n||="/";const t=typeof n=="string"?n:"path"in n?Gx(n):Is().resolve(n).href;if(e?.open){const{target:l="_blank",windowFeatures:c={}}=e.open,u=[];for(const[h,d]of Object.entries(c))d!==void 0&&u.push(`${h.toLowerCase()}=${d}`);return open(t,l,u.join(", ")),Promise.resolve()}const i=ca(t,{acceptRelative:!0}),r=e?.external||i;if(r){if(!e?.external)throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const{protocol:l}=new URL(t,window.location.href);if(l&&sk(l))throw new Error(`Cannot navigate to a URL with '${l}' protocol.`)}const s=tF();if(!r&&s){if(e?.replace){if(typeof n=="string"){const{pathname:l,search:c,hash:u}=Z2(n);return{path:l,...c&&{query:xg(c)},...u&&{hash:u},replace:!0}}return{...n,replace:!0}}return n}const o=Is(),a=fn();return r?(a._scope.stop(),e?.replace?location.replace(t):location.href=t,s?a.isHydrating?new Promise(()=>{}):!1:Promise.resolve()):e?.replace?o.replace(n):o.push(n)};function Gx(n){return q2(n.path||"",n.query||{})+(n.hash||"")}const dC="__nuxt_error",D_=()=>or(fn().payload,"error"),nF=n=>{const e=k_(n);try{const t=D_();fn().hooks.callHook("app:error",e),t.value||=e}catch{throw e}return e},iF=async(n={})=>{const e=fn(),t=D_();e.callHook("app:error:cleared",n),n.redirect&&await Is().replace(n.redirect),t.value=void 0},rF=n=>!!n&&typeof n=="object"&&dC in n,k_=n=>{const e=Jk(n);return Object.defineProperty(e,dC,{value:!0,configurable:!1,writable:!1}),e};function sF(n){const e=aF(n),t=new ArrayBuffer(e.length),i=new DataView(t);for(let r=0;r<t.byteLength;r++)i.setUint8(r,e.charCodeAt(r));return t}const oF="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
4+/";function aF(n){n.length%4===0&&(n=n.replace(/==?$/,""));let e="",t=0,i=0;for(let r=0;r<n.length;r++)t<<=6,t|=oF.indexOf(n[r]),i+=6,i===24&&(e+=String.fromCharCode((t&16711680)>>16),e+=String.fromCharCode((t&65280)>>8),e+=String.fromCharCode(t&255),t=i=0);return i===12?(t>>=4,e+=String.fromCharCode(t)):i===18&&(t>>=2,e+=String.fromCharCode((t&65280)>>8),e+=String.fromCharCode(t&255)),e}const lF=-1,cF=-2,uF=-3,hF=-4,dF=-5,fF=-6;function pF(n,e){return mF(JSON.parse(n),e)}function mF(n,e){if(typeof n=="number")return r(n,!0);if(!Array.isArray(n)||n.length===0)throw new Error("Invalid input");const t=n,i=Array(t.length);function r(s,o=!1){if(s===lF)return;if(s===uF)return NaN;if(s===hF)return 1/0;if(s===dF)return-1/0;if(s===fF)return-0;if(o||typeof s!="number")throw new Error("Invalid input");if(s in i)return i[s];const a=t[s];if(!a||typeof a!="object")i[s]=a;else if(Array.isArray(a))if(typeof a[0]=="string"){const l=a[0],c=e?.[l];if(c){let u=a[1];return typeof u!="number"&&(u=t.push(a[1])-1),i[s]=c(r(u))}switch(l){case"Date":i[s]=new Date(a[1]);break;case"Set":const u=new Set;i[s]=u;for(let f=1;f<a.length;f+=1)u.add(r(a[f]));break;case"Map":const h=new Map;i[s]=h;for(let f=1;f<a.length;f+=2)h.set(r(a[f]),r(a[f+1]));break;case"RegExp":i[s]=new RegExp(a[1],a[2]);break;case"Object":i[s]=Object(a[1]);break;case"BigInt":i[s]=BigInt(a[1]);break;case"null":const d=Object.create(null);i[s]=d;for(let f=1;f<a.length;f+=2)d[a[f]]=r(a[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[l],p=new f(r(a[1]));i[s]=a[2]!==void 0?p.subarray(a[2],a[3]):p;break}case"ArrayBuffer":{const f=a[1],p=sF(f);i[s]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=l.slice(9);i[s]=Temporal[f].from(a[1]);break}case"URL":{const f=new URL(a[1]);i[s]=f;break}case"URLSearchParams":{const f=new URLSearchParams(a[1]);i[s]=f;break}default:throw new Error(`Unknown type ${l}`)}}else{const l=new Array(a.length);i[s]=l;for(let c=0;c<a.length;c+=1){const u=a[c];u!==cF&&(l[c]=r(u))}}else{const l={};i[s]=l;for(const c in a){if(c==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=a[c];l[c]=r(u)}}return i[s]}return r(0)}const gF=new Set(["link","style","script","noscript"]),vF=new Set(["title","titleTemplate","script","style","noscript"]),Lw=new Set(["base","meta","link","style","script","noscript"]),xF=new Set(["title","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),yF=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),_F=new Set(["key","tagPosition","tagPriority","tagDuplicateStrategy","innerHTML","textContent","processTemplateParams"]),bF=new Set(["templateParams","htmlAttrs","bodyAttrs"]),wF=new Set(["theme-color","google-site-verification","og","article","book","profile","twitter","author"]),SF=["name","property","http-equiv"],MF=new Set(["viewport","description","keywords","robots"]);function fC(n){const e=n.split(":");return e.length?wF.has(e[1]):!1}function Wx(n){const{props:e,tag:t}=n;if(yF.has(t))return t;if(t==="link"&&e.rel==="canonical")return"canonical";if(e.charset)return"charset";if(n.tag==="meta"){for(const i of SF)if(e[i]!==void 0){const r=e[i],s=r.includes(":"),o=MF.has(r),l=!(s||o)&&n.key?`:key:${n.key}`:"";return`${t}:${r}${l}`}}if(n.key)return`${t}:key:${n.key}`;if(e.id)return`${t}:id:${e.id}`;if(vF.has(t)){const i=n.textContent||n.innerHTML;if(i)return`${t}:content:${i}`}}function Ow(n){const e=n._h||n._d;if(e)return e;const t=n.textContent||n.innerHTML;return t||`${n.tag}:${Object.entries(n.props).map(([i,r])=>`${i}:${String(r)}`).join(",")}`}function Yp(n,e,t){typeof n==="function"&&(!t||t!=="titleTemplate"&&!(t[0]==="o"&&t[1]==="n"))&&(n=n());let r;if(e&&(r=e(t,n)),Array.isArray(r))return r.map(s=>Yp(s,e));if(r?.constructor===Object){const s={};for(const o of Object.keys(r))s[o]=Yp(r[o],e,o);return s}return r}function TF(n,e){const t=n==="style"?new Map:new Set;function i(r){const s=r.trim();if(s)if(n==="style"){const[o,...a]=s.split(":").map(l=>l.trim());o&&a.length&&t.set(o,a.join(":"))}
4else s.split(" ").filter(Boolean).forEach(o=>t.add(o))}return typeof e=="string"?n==="style"?e.split(";").forEach(i):i(e):Array.isArray(e)?e.forEach(r=>i(r)):e&&typeof e=="object"&&Object.entries(e).forEach(([r,s])=>{s&&s!=="false"&&(n==="style"?t.set(r.trim(),s):i(r))}),t}function pC(n,e){return n.props=n.props||{},e?n.tag==="templateParams"?(n.props=e,n):(Object.entries(e).forEach(([t,i])=>{if(i===null){n.props[t]=null;return}if(t==="class"||t==="style"){n.props[t]=TF(t,i);return}if(_F.has(t)){if(["textContent","innerHTML"].includes(t)&&typeof i=="object"){let o=e.type;if(e.type||(o="application/json"),!o?.endsWith("json")&&o!=="speculationrules")return;e.type=o,n.props.type=o,n[t]=JSON.stringify(i)}else n[t]=i;return}const r=String(i),s=t.startsWith("data-");r==="true"||r===""?n.props[t]=s?r:!0:!i&&s&&r==="false"?n.props[t]="false":i!==void 0&&(n.props[t]=i)}),n):n}function EF(n,e){const t=typeof e=="object"&&typeof e!="function"?e:{[n==="script"||n==="noscript"||n==="style"?"innerHTML":"textContent"]:e},i=pC({tag:n,props:{}},t);return i.key&&gF.has(i.tag)&&(i.props["data-hid"]=i._h=i.key),i.tag==="script"&&typeof i.innerHTML=="object"&&(i.innerHTML=JSON.stringify(i.innerHTML),i.props.type=i.props.type||"application/json"),Array.isArray(i.props.content)?i.props.content.map(r=>({...i,props:{...i.props,content:r}})):i}function AF(n,e){if(!n)return[];typeof n=="function"&&(n=n());const t=(r,s)=>{for(let o=0;o<e.length;o++)s=e[o](r,s);return s};n=t(void 0,n);const i=[];return n=Yp(n,t),Object.entries(n||{}).forEach(([r,s])=>{if(s!==void 0)for(const o of Array.isArray(s)?s:[s])i.push(EF(r,o))}),i.flat()}const Dw=(n,e)=>n._w===e._w?n._p-e._p:n._w-e._w,kw={base:-10,title:10},CF={critical:-8,high:-1,low:2},Fw={meta:{"content-security-policy":-30,charset:-20,viewport:-15},link:{preconnect:20,stylesheet:60,preload:70,modulepreload:70,prefetch:90,"dns-prefetch":90,prerender:90},script:{async:30,defer:80,sync:50},style:{imported:40,sync:60}},RF=/@import/,_u=n=>n===""||n===!0;function PF(n,e){if(typeof e.tagPriority=="number")return e.tagPriority;let t=100;const i=CF[e.tagPriority]||0,r=n.resolvedOptions.disableCapoSorting?{link:{},script:{},style:{}}:Fw;if(e.tag in kw)t=kw[e.tag];else if(e.tag==="meta"){const s=e.props["http-equiv"]==="content-security-policy"?"content-security-policy":e.props.charset?"charset":e.props.name==="viewport"?"viewport":null;s&&(t=Fw.meta[s])}else e.tag==="link"&&e.props.rel?t=r.link[e.props.rel]:e.tag==="script"?_u(e.props.async)?t=r.script.async:e.props.src&&!_u(e.props.defer)&&!_u(e.props.async)&&e.props.type!=="module"&&!e.props.type?.endsWith("json")?t=r.script.sync:_u(e.props.defer)&&e.props.src&&!_u(e.props.async)&&(t=r.script.defer):e.tag==="style"&&(t=e.innerHTML&&RF.test(e.innerHTML)?r.style.imported:r.style.sync);return(t||100)+i}function Uw(n,e){const t=typeof e=="function"?e(n):e,i=t.key||String(n.plugins.size+1);n.plugins.get(i)||(n.plugins.set(i,t),n.hooks.addHooks(t.hooks||{}))}function IF(n={}){const e=nC();e.addHooks(n.hooks||{});const t=!n.document,i=new Map,r=new Map,s=new Set,o={_entryCount:1,plugins:r,dirty:!1,resolvedOptions:n,hooks:e,ssr:t,entries:i,headEntries(){return[...i.values()]},use:a=>Uw(o,a),push(a,l){const c={...l||{}};delete c.head;const u=c._index??o._entryCount++,h={_i:u,input:a,options:c},d={_poll(f=!1){o.dirty=!0,!f&&s.add(u),e.callHook("entries:updated",o)},dispose(){i.delete(u)&&o.invalidate()},patch(f){(!c.mode||c.mode==="server"&&t||c.mode==="client"&&!t)&&(h.input=f,i.set(u,h),d._poll())}};return d.patch(a),d},async resolveTags(){const a={tagMap:new Map,tags:[],entries:[...o.entries.values()]};for(await e.callHook("entries:resolve",a);s.size;){const d=s.values().next().value;s.delete(d);const f=i.get(d);if(f){const p={tags:AF(f.input,n.propResolvers||[]).map(v=>Object.assign(v,f.options)),entry:f};await e.callHook("entries:normalize",p),f._tags=p.tags.map((v,m)=>(v._w=PF(o,v),v._p=(f._i<<10)+m,v._d=Wx(v),v))}}let l=!1;a.entries.flatMap(d=>(d._tags||[]).map(f=>({...f,props:{...f.props}}))).sort(Dw).reduce((d,f)=>{const p=String(f._d||f._p);
4if(!d.has(p))return d.set(p,f);const v=d.get(p);if((f?.tagDuplicateStrategy||(bF.has(f.tag)?"merge":null)||(f.key&&f.key===v.key?"merge":null))==="merge"){const g={...v.props};Object.entries(f.props).forEach(([y,x])=>g[y]=y==="style"?new Map([...v.props.style||new Map,...x]):y==="class"?new Set([...v.props.class||new Set,...x]):x),d.set(p,{...f,props:g})}else f._p>>10===v._p>>10&&f.tag==="meta"&&fC(p)?(d.set(p,Object.assign([...Array.isArray(v)?v:[v],f],f)),l=!0):(f._w===v._w?f._p>v._p:f?._w<v?._w)&&d.set(p,f);return d},a.tagMap);const c=a.tagMap.get("title"),u=a.tagMap.get("titleTemplate");if(o._title=c?.textContent,u){const d=u?.textContent;if(o._titleTemplate=d,d){let f=typeof d=="function"?d(c?.textContent):d;typeof f=="string"&&!o.plugins.has("template-params")&&(f=f.replace("%s",c?.textContent||"")),c?f===null?a.tagMap.delete("title"):a.tagMap.set("title",{...c,textContent:f}):(u.tag="title",u.textContent=f)}}a.tags=Array.from(a.tagMap.values()),l&&(a.tags=a.tags.flat().sort(Dw)),await e.callHook("tags:beforeResolve",a),await e.callHook("tags:resolve",a),await e.callHook("tags:afterResolve",a);const h=[];for(const d of a.tags){const{innerHTML:f,tag:p,props:v}=d;if(xF.has(p)&&!(Object.keys(v).length===0&&!d.innerHTML&&!d.textContent)&&!(p==="meta"&&!v.content&&!v["http-equiv"]&&!v.charset)){if(p==="script"&&f){if(v.type?.endsWith("json")){const m=typeof f=="string"?f:JSON.stringify(f);d.innerHTML=m.replace(/</g,"\\u003C")}else typeof f=="string"&&(d.innerHTML=f.replace(new RegExp(`</${p}`,"g"),`<\\/${p}`));d._d=Wx(d)}h.push(d)}}return h},invalidate(){for(const a of i.values())s.add(a._i);o.dirty=!0,e.callHook("entries:updated",o)}};return(n?.plugins||[]).forEach(a=>Uw(o,a)),o.hooks.callHook("init",o),n.init?.forEach(a=>a&&o.push(a)),o}const NF=(n,e)=>Xt(e)?tt(e):e,F_="usehead";function LF(n){return{install(t){t.config.globalProperties.$unhead=n,t.config.globalProperties.$head=n,t.provide(F_,n)}}.install}function OF(){if(eu()){const n=gi(F_);if(!n)throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");return n}throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.")}function DF(n,e={}){const t=e.head||OF();return t.ssr?t.push(n||{},e):kF(t,n,e)}function kF(n,e,t={}){const i=Te(!1);let r;return un(()=>{const o=i.value?{}:Yp(e,NF);r?r.patch(o):r=n.push(o,t)}),Gn()&&(mg(()=>{r.dispose()}),s2(()=>{i.value=!0}),r2(()=>{i.value=!1})),r}function FF(n){const e=n||fn();return e.ssrContext?.head||e.runWithContext(()=>{if(eu()){const t=gi(F_);if(!t)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return t}})}function UF(n,e={}){const t=e.head||FF(e.nuxt);return DF(n,{head:t,...e})}let bp,wp;function BF(){return bp=$fetch(L_(`builds/meta/${dl().app.buildId}.json`),{responseType:"json"}),bp.then(n=>{wp=Yk(n.matcher)}).catch(n=>{console.error("[nuxt] Error fetching app manifest.",n)}),bp}function yg(){return bp||BF()}async function U_(n){const e=typeof n=="string"?n:n.path;if(await yg(),!wp)return console.error("[nuxt] Error creating app manifest matcher.",wp),{};try{return tu({},...wp.matchAll(e).reverse())}catch(t){return console.error("[nuxt] Error matching route rules.",t),{}}}async function Bw(n,e={}){if(!await gC(n))return null;const i=await VF(n,e);return await mC(i)||null}const zF="_payload.json";async function VF(n,e={}){const t=new URL(n,"http://localhost");if(t.host!=="localhost"||ca(t.pathname,{acceptRelative:!0}))throw new Error("Payload URL must not include hostname: "+n);const i=dl(),r=e.hash||(e.fresh?Date.now():i.app.buildId),s=i.app.cdnURL,o=s&&await gC(n)?s:i.app.baseURL;return ud(o,t.pathname,zF+(r?`?${r}`:""))}async function mC(n){const e=fetch(n,{cache:"force-cache"}).then(t=>t.text().then(vC));try{return await e}catch(t){console.warn("[nuxt] Cannot load payload ",n,t)}return null}async function gC(n=O_().path){const e=fn();return n=n==="/"?n:n.replace(/\/$/,""),(await yg()).prerendered.includes(n)?!0:e.runWithContext(async()=>{const i=await U_({path:n});return!!i.prerender&&!i.redirect})}let _a=null;
4async function HF(){if(_a)return _a;const n=document.getElementById("__NUXT_DATA__");if(!n)return{};const e=await vC(n.textContent||""),t=n.dataset.src?await mC(n.dataset.src):void 0;return _a={...e,...t,...window.__NUXT__},_a.config?.public&&(_a.config.public=Mn(_a.config.public)),_a}async function vC(n){return await pF(n,fn()._payloadRevivers)}function GF(n,e){fn()._payloadRevivers[n]=e}const WF=[["NuxtError",n=>k_(n)],["EmptyShallowRef",n=>Mt(n==="_"?void 0:n==="0n"?BigInt(0):Wp(n))],["EmptyRef",n=>Te(n==="_"?void 0:n==="0n"?BigInt(0):Wp(n))],["ShallowRef",n=>Mt(n)],["ShallowReactive",n=>$a(n)],["Ref",n=>Te(n)],["Reactive",n=>Mn(n)]],$F=Vs({name:"nuxt:revive-payload:client",order:-30,async setup(n){let e,t;for(const[i,r]of WF)GF(i,r);Object.assign(n.payload,([e,t]=iC(()=>n.runWithContext(HF)),e=await e,t(),e)),delete window.__NUXT__}});async function B_(n,e={}){const t=e.document||n.resolvedOptions.document;if(!t||!n.dirty)return;const i={shouldRender:!0,tags:[]};if(await n.hooks.callHook("dom:beforeRender",i),!!i.shouldRender)return n._domUpdatePromise||(n._domUpdatePromise=new Promise(async r=>{const s=new Map,o=new Promise(f=>{n.resolveTags().then(p=>{f(p.map(v=>{const m=s.get(v._d)||0,g={tag:v,id:(m?`${v._d}:${m}`:v._d)||Ow(v),shouldRender:!0};return v._d&&fC(v._d)&&s.set(v._d,m+1),g}))})});let a=n._dom;if(!a){a={title:t.title,elMap:new Map().set("htmlAttrs",t.documentElement).set("bodyAttrs",t.body)};for(const f of["body","head"]){const p=t[f]?.children;for(const v of p){const m=v.tagName.toLowerCase();if(!Lw.has(m))continue;const g=pC({tag:m,props:{}},{innerHTML:v.innerHTML,...v.getAttributeNames().reduce((y,x)=>(y[x]=v.getAttribute(x),y),{})||{}});if(g.key=v.getAttribute("data-hid")||void 0,g._d=Wx(g)||Ow(g),a.elMap.has(g._d)){let y=1,x=g._d;for(;a.elMap.has(x);)x=`${g._d}:${y++}`;a.elMap.set(x,v)}else a.elMap.set(g._d,v)}}}a.pendingSideEffects={...a.sideEffects},a.sideEffects={};function l(f,p,v){const m=`${f}:${p}`;a.sideEffects[m]=v,delete a.pendingSideEffects[m]}function c({id:f,$el:p,tag:v}){const m=v.tag.endsWith("Attrs");a.elMap.set(f,p),m||(v.textContent&&v.textContent!==p.textContent&&(p.textContent=v.textContent),v.innerHTML&&v.innerHTML!==p.innerHTML&&(p.innerHTML=v.innerHTML),l(f,"el",()=>{p?.remove(),a.elMap.delete(f)}));for(const g in v.props){if(!Object.prototype.hasOwnProperty.call(v.props,g))continue;const y=v.props[g];if(g.startsWith("on")&&typeof y=="function"){const _=p?.dataset;if(_&&_[`${g}fired`]){const T=g.slice(0,-5);y.call(p,new Event(T.substring(2)))}p.getAttribute(`data-${g}`)!==""&&((v.tag==="bodyAttrs"?t.defaultView:p).addEventListener(g.substring(2),y.bind(p)),p.setAttribute(`data-${g}`,""));continue}const x=`attr:${g}`;if(g==="class"){if(!y)continue;for(const _ of y)m&&l(f,`${x}:${_}`,()=>p.classList.remove(_)),!p.classList.contains(_)&&p.classList.add(_)}else if(g==="style"){if(!y)continue;for(const[_,T]of y)l(f,`${x}:${_}`,()=>{p.style.removeProperty(_)}),p.style.setProperty(_,T)}else y!==!1&&y!==null&&(p.getAttribute(g)!==y&&p.setAttribute(g,y===!0?"":String(y)),m&&l(f,x,()=>p.removeAttribute(g)))}}const u=[],h={bodyClose:void 0,bodyOpen:void 0,head:void 0},d=await o;for(const f of d){const{tag:p,shouldRender:v,id:m}=f;if(v){if(p.tag==="title"){t.title=p.textContent,l("title","",()=>t.title=a.title);continue}f.$el=f.$el||a.elMap.get(m),f.$el?c(f):Lw.has(p.tag)&&u.push(f)}}for(const f of u){const p=f.tag.tagPosition||"head";f.$el=t.createElement(f.tag.tag),c(f),h[p]=h[p]||t.createDocumentFragment(),h[p].appendChild(f.$el)}for(const f of d)await n.hooks.callHook("dom:renderTag",f,t,l);h.head&&t.head.appendChild(h.head),h.bodyOpen&&t.body.insertBefore(h.bodyOpen,t.body.firstChild),h.bodyClose&&t.body.appendChild(h.bodyClose);for(const f in a.pendingSideEffects)a.pendingSideEffects[f]();n._dom=a,await n.hooks.callHook("dom:rendered",{renders:d}),r()}).finally(()=>{n._domUpdatePromise=void 0,n.dirty=!1})),n._domUpdatePromise}function jF(n={}){const e=n.domOptions?.render||B_;n.document=n.document||(typeof window<"u"?document:void 0);const t=n.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML||!1;return IF({...n,plugins:[...n.plugins||[],{key:"client",hooks:{"entries:updated":e}}],init:[t?JSON.parse(t):!1,...n.init||[]]})}function qF(n,e){let t=0;return()=>{const i=++t;e(()=>{t===i&&n()})}}function XF(n={}){const e=jF({domOptions:{render:qF(()=>B_(e),t=>setTimeout(t,0))},...n});return e.install=LF(e),e}const YF={disableDefaults:!0}
4,KF=Vs({name:"nuxt:head",enforce:"pre",setup(n){const e=XF(YF);n.vueApp.use(e);{let t=!0;const i=async()=>{t=!1,await B_(e)};e.hooks.hook("dom:beforeRender",r=>{r.shouldRender=!t}),n.hooks.hook("page:start",()=>{t=!0}),n.hooks.hook("page:finish",()=>{n.isHydrating||i()}),n.hooks.hook("app:error",i),n.hooks.hook("app:suspense:resolve",i)}}}),ZF=async n=>{let e,t;const i=([e,t]=iC(()=>U_({path:n.path})),e=await e,t(),e);if(i.redirect){const r=i.redirect.includes("#")?i.redirect:i.redirect+n.hash;return ca(r,{acceptRelative:!0})?(window.location.href=r,!1):r}},JF=[ZF];function V0(n){const e=n&&typeof n=="object"?n:{};typeof n=="object"&&(n=J2({pathname:n.path||"",search:j2(n.query||{}),hash:n.hash||""}));const t=new URL(n.toString(),window.location.href);return{path:t.pathname,fullPath:n,query:xg(t.search),hash:t.hash,params:e.params||{},name:void 0,matched:e.matched||[],redirectedFrom:void 0,meta:e.meta||{},href:n}}const QF=Vs({name:"nuxt:router",enforce:"pre",setup(n){const e=lk(window.location.pathname,dl().app.baseURL)+window.location.search+window.location.hash,t=[],i={"navigate:before":[],"resolve:before":[],"navigate:after":[],error:[]},r=(h,d)=>(i[h].push(d),()=>i[h].splice(i[h].indexOf(d),1)),s=dl().app.baseURL,o=Mn(V0(e));async function a(h,d){try{const f=V0(h);for(const p of i["navigate:before"]){const v=await p(f,o);if(v===!1||v instanceof Error)return;if(typeof v=="string"&&v.length)return a(v,!0)}for(const p of i["resolve:before"])await p(f,o);Object.assign(o,f),window.history[d?"replaceState":"pushState"]({},"",ud(s,f.fullPath)),n.isHydrating||await n.runWithContext(iF);for(const p of i["navigate:after"])await p(f,o)}catch(f){for(const p of i.error)await p(f)}}const c={currentRoute:ge(()=>o),isReady:()=>Promise.resolve(),options:{},install:()=>Promise.resolve(),push:h=>a(h,!1),replace:h=>a(h,!0),back:()=>window.history.go(-1),go:h=>window.history.go(h),forward:()=>window.history.go(1),beforeResolve:h=>r("resolve:before",h),beforeEach:h=>r("navigate:before",h),afterEach:h=>r("navigate:after",h),onError:h=>r("error",h),resolve:V0,addRoute:(h,d)=>{t.push(d)},getRoutes:()=>t,hasRoute:h=>t.some(d=>d.name===h),removeRoute:h=>{const d=t.findIndex(f=>f.name===h);d!==-1&&t.splice(d,1)}};n.vueApp.component("RouterLink",qe({functional:!0,props:{to:{type:String,required:!0},custom:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:String},setup:(h,{slots:d})=>{const f=()=>a(h.to,h.replace);return()=>{const p=c.resolve(h.to);return h.custom?d.default?.({href:h.to,navigate:f,route:p}):Yn("a",{href:h.to,onClick:v=>(v.preventDefault(),f())},d)}}})),window.addEventListener("popstate",h=>{const d=h.target.location;c.replace(d.href.replace(d.origin,""))}),n._route=o,n._middleware||={global:[],named:{}};const u=n.payload.state._layout;return n.hooks.hookOnce("app:created",async()=>{c.beforeEach(async(h,d)=>{h.meta=Mn(h.meta||{}),n.isHydrating&&u&&!yo(h.meta.layout)&&(h.meta.layout=u),n._processingMiddleware=!0;{const f=new Set([...JF,...n._middleware.global]);{const p=await n.runWithContext(()=>U_({path:h.path}));if(p.appMiddleware)for(const v in p.appMiddleware){const m=n._middleware.named[v];if(!m)return;p.appMiddleware[v]?f.add(m):f.delete(m)}}for(const p of f){const v=await n.runWithContext(()=>p(h,d));if(v!==!0&&(v||v===!1))return v}}}),c.afterEach(()=>{delete n._processingMiddleware}),await c.replace(e),uk(o.fullPath,e)||await n.runWithContext(()=>hC(o.fullPath))}),{provide:{route:o,router:c}}}}),$x=globalThis.requestIdleCallback||(n=>{const e=Date.now(),t={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))};return setTimeout(()=>{n(t)},1)}),eU=globalThis.cancelIdleCallback||(n=>{clearTimeout(n)}),_g=n=>{const e=fn();e.isHydrating?e.hooks.hookOnce("app:suspense:resolve",()=>{$x(()=>n())}):$x(()=>n())},tU=Vs({name:"nuxt:payload",setup(n){const e=new Set;Is().beforeResolve(async(t,i)=>{if(t.path===i.path)return;const r=await Bw(t.path);if(r){for(const s of e)delete n.static.data[s];for(const s in r.data)s in n.static.data||e.add(s),n.static.data[s]=r.data[s]}}),_g(()=>{n.hooks.hook("link:prefetch",async t=>{const{hostname:i}=new URL(t,window.location.href);i===window.location.hostname&&await Bw(t).catch(()=>{console.warn("[nuxt] Error preloading payload for",t)})}),navigator.connection?.effectiveType!=="slow-2g"&&setTimeout(yg,1e3)}
4)}}),nU=Vs(()=>{const n=Is();_g(()=>{n.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),iU=Vs(n=>{let e;async function t(){let i;try{i=await yg()}catch(r){const s=r;if(!("status"in s&&(s.status===404||s.status===403)))throw s}e&&clearTimeout(e),e=setTimeout(t,Rw);try{const r=await $fetch(L_("builds/latest.json")+`?${Date.now()}`);r.id!==i?.id&&(n.hooks.callHook("app:manifest:update",r),e&&clearTimeout(e))}catch{}}_g(()=>{e=setTimeout(t,Rw)})});function rU(n={}){const e=n.path||window.location.pathname;let t={};try{t=Wp(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(n.force||t?.path!==e||t?.expires<Date.now()){try{sessionStorage.setItem("nuxt:reload",JSON.stringify({path:e,expires:Date.now()+(n.ttl??1e4)}))}catch{}if(n.persistState)try{sessionStorage.setItem("nuxt:reload:state",JSON.stringify({state:fn().payload.state}))}catch{}window.location.pathname!==e?window.location.href=e:window.location.reload()}}const sU=Vs({name:"nuxt:chunk-reload",setup(n){const e=Is(),t=dl(),i=new Set;e.beforeEach(()=>{i.clear()}),n.hook("app:chunkError",({error:s})=>{i.add(s)});function r(s){const o=ud(t.app.baseURL,s.fullPath);rU({path:o,persistState:!0})}n.hook("app:manifest:update",()=>{e.beforeResolve(r)}),e.onError((s,o)=>{i.has(s)&&r(o)})}}),oU="modulepreload",aU=function(n,e){return new URL(n,e).href},zw={},jx=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let c=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");r=c(t.map(u=>{if(u=aU(u,i),u in zw)return;zw[u]=!0;const h=u.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(i)for(let p=o.length-1;p>=0;p--){const v=o[p];if(v.href===u&&(!h||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":oU,h||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),h)return new Promise((p,v)=>{f.addEventListener("load",p),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},lU=Ax(()=>jx(()=>Promise.resolve().then(()=>Noe),void 0,import.meta.url).then(n=>
4n.default||n.default||n)),cU=[["Icon",lU]],uU=Vs({name:"nuxt:global-components",setup(n){for(const[e,t]of cU)n.vueApp.component(e,t),n.vueApp.component("Lazy"+e,t)}});var Yd={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"}
4,emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};const hU={nuxt:{},ui:{colors:{primary:"green",secondary:"blue",success:"green",info:"blue",warning:"yellow",error:"red",neutral:"slate"},icons:{arrowDown:"i-lucide-arrow-down",arrowLeft:"i-lucide-arrow-left",arrowRight:"i-lucide-arrow-right",arrowUp:"i-lucide-arrow-up",caution:"i-lucide-circle-alert",check:"i-lucide-check",chevronDoubleLeft:"i-lucide-chevrons-left",chevronDoubleRight:"i-lucide-chevrons-right",chevronDown:"i-lucide-chevron-down",chevronLeft:"i-lucide-chevron-left",chevronRight:"i-lucide-chevron-right",chevronUp:"i-lucide-chevron-up",close:"i-lucide-x",copy:"i-lucide-copy",copyCheck:"i-lucide-copy-check",dark:"i-lucide-moon",ellipsis:"i-lucide-ellipsis",error:"i-lucide-circle-x",external:"i-lucide-arrow-up-right",eye:"i-lucide-eye",eyeOff:"i-lucide-eye-off",file:"i-lucide-file",folder:"i-lucide-folder",folderOpen:"i-lucide-folder-open",hash:"i-lucide-hash",info:"i-lucide-info",light:"i-lucide-sun",loading:"i-lucide-loader-circle",menu:"i-lucide-menu",minu
4s:"i-lucide-minus",panelClose:"i-lucide-panel-left-close",panelOpen:"i-lucide-panel-left-open",plus:"i-lucide-plus",reload:"i-lucide-rotate-ccw",search:"i-lucide-search",stop:"i-lucide-square",success:"i-lucide-circle-check",system:"i-lucide-monitor",tip:"i-lucide-lightbulb",upload:"i-lucide-upload",warning:"i-lucide-triangle-alert"}},icon:{provider:"iconify",class:"",aliases:{},iconifyApiEndpoint:"https://api.iconify.design",localApiEndpoint:"/api/_nuxt_icon",fallbackToApi:!0,cssSelectorPrefix:"i-",cssWherePseudo:!0,cssLayer:"components",mode:"css",attrs:{"aria-hidden":!0},collections:["academicons","akar-icons","ant-design","arcticons","basil","bi","bitcoin-icons","bpmn","brandico","bx","bxl","bxs","bytesize","carbon","catppuccin","cbi","charm","ci","cib","cif","cil","circle-flags","circum","clarity","codicon","covid","cryptocurrency","cryptocurrency-color","dashicons","devicon","devicon-plain","ei","el","emojione","emojione-monotone","emojione-v1","entypo","entypo-social","eos-icons","ep","et","eva","f7","fa","fa-brands","fa-regular","fa-solid","fa6-brands","fa6-regular","fa6-solid","fad","fe","feather","file-icons","flag","flagpack","flat-color-icons","flat-ui","flowbite","fluent","fluent-emoji","fluent-emoji-flat","fluent-emoji-high-contrast","fluent-mdl2","fontelico","fontisto","formkit","foundation","fxemoji","gala","game-icons","geo","gg","gis","gravity-ui","gridicons","grommet-icons","guidance","healthicons","heroicons","heroicons-outline","heroicons-solid","hugeicons","humbleicons","ic","icomoon-free","icon-park","icon-park-outline","icon-park-solid","icon-park-twotone","iconamoon","iconoir","icons8","il","ion","iwwa","jam","la","lets-icons","line-md","logos","ls","lucide","lucide-lab","mage","majesticons","maki","map","marketeq","material-symbols","material-symbols-light","mdi","mdi-light","medical-icon","memory","meteocons","mi","mingcute","mono-icons","mynaui","nimbus","nonicons","noto","noto-v1","octicon","oi","ooui","openmoji","oui","pajamas","pepicons","pepicons-pencil","pepicons-pop","pepicons-print","ph","pixelarticons","prime","ps","quill","radix-icons","raphael","ri","rivet-icons","si-glyph","simple-icons","simple-line-icons","skill-icons","solar","streamline","streamline-emojis","subway","svg-spinners","system-uicons","tabler","tdesign","teenyicons","token","token-branded","topcoat","twemoji","typcn","uil","uim","uis","uit","uiw","unjs","vaadin","vs","vscode-icons","websymbol","weui","whh","wi","wpf","zmdi","zondicons"],fetchTimeout:1500}},xC=Kk(hU);function Ci(){const n=fn();return n._appConfig||=Mn(xC),n._appConfig}const dU=[50,100,200,300,400,500,600,700,800,900,950];function fU(n,e){return n in Yd&&typeof Yd[n]=="object"&&e in Yd[n]?Yd[n][e]:""}function pU(n,e){return`${dU.map(t=>`--ui-color-${n}-${t}: var(--color-${e==="neutral"?"old-neutral":e}-${t}, ${fU(e,t)});`).join(`
5  `)}`}function Vw(n,e){return`--ui-${n}: var(--ui-color-${n}-${e});`}const mU=Vs(()=>{const n=Ci(),e=fn(),t=ge(()=>{const{neutral:r,...s}=n.ui.colors;return`@layer base {
6  :root {
7  ${Object.entries(n.ui.colors).map(([o,a])=>pU(o,a)).join(`
8  `)}
9  }
10  :root, .light {
11  ${Object.keys(s).map(o=>Vw(o,500)).join(`
12  `)}
13  }
14  .dark {
15  ${Object.keys(s).map(o=>Vw(o,400)).join(`
16  `)}
17  }
18}`}),i={style:[{innerHTML:()=>t.value,tagPriority:-2,id:"nuxt-ui-colors"}]};if(e.isHydrating&&!e.payload.serverRendered){const r=document.createElement("style");r.innerHTML=t.value,r.setAttribute("data-nuxt-ui-colors",""),document.head.appendChild(r),i.script=[{innerHTML:"document.head.removeChild(document.querySelector('[data-nuxt-ui-colors]'))"}]}UF(i)}),yC=/^[a-z0-9]+(-[a-z0-9]+)*$/,hd=(n,e,t,i="")=>{const r=n.split(":");if(n.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),c={provider:r.length>0?r[0]:i,prefix:l,name:a};return e&&!Sp(c)?null:c}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return e&&!Sp(a)?null:a}if(t&&i===""){const a={provider:i,prefix:"",name:s};return e&&!Sp(a,t)?null:a}return null},Sp=(n,e)=>n?!!((e&&n.prefix===""||n.prefix)&&n.name):!1,_C=Object.freeze({left:0,top:0,width:16,height:16}),Kp=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),nu=Object.freeze({..._C,...Kp}),qx=Object.freeze({...nu,body:"",hidden:!1});function gU(n,e){const t={};!n.hFlip!=!e.hFlip&&(t.hFlip=!0),!n.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((n.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Hw(n,e){const t=gU(n,e);for(const i in qx)i in Kp?i in n&&!(i in t)&&(t[i]=Kp[i]):i in e?t[i]=e[i]:i in n&&(t[i]=n[i]);return t}function vU(n,e){const t=n.icons,i=n.aliases||Object.create(null),r=Object.create(null);function s(o){if(t[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,l=a&&s(a);l&&(r[o]=[a].concat(l))}return r[o]}
18return Object.keys(t).concat(Object.keys(i)).forEach(s),r}function xU(n,e,t){const i=n.icons,r=n.aliases||Object.create(null);let s={};function o(a){s=Hw(i[a]||r[a],s)}return o(e),t.forEach(o),Hw(n,s)}function bC(n,e){const t=[];if(typeof n!="object"||typeof n.icons!="object")return t;n.not_found instanceof Array&&n.not_found.forEach(r=>{e(r,null),t.push(r)});const i=vU(n);for(const r in i){const s=i[r];s&&(e(r,xU(n,r,s)),t.push(r))}return t}const yU={provider:"",aliases:{},not_found:{},..._C};function H0(n,e){for(const t in e)if(t in n&&typeof n[t]!=typeof e[t])return!1;return!0}function wC(n){if(typeof n!="object"||n===null)return null;const e=n;if(typeof e.prefix!="string"||!n.icons||typeof n.icons!="object"||!H0(n,yU))return null;const t=e.icons;for(const r in t){const s=t[r];if(!r||typeof s.body!="string"||!H0(s,qx))return null}const i=e.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r||typeof o!="string"||!t[o]&&!i[o]||!H0(s,qx))return null}return e}const Gw=Object.create(null);function _U(n,e){return{provider:n,prefix:e,icons:Object.create(null),missing:new Set}}function fl(n,e){const t=Gw[n]||(Gw[n]=Object.create(null));return t[e]||(t[e]=_U(n,e))}function SC(n,e){return wC(e)?bC(e,(t,i)=>{i?n.icons[t]=i:n.missing.add(t)}):[]}function bU(n,e,t){try{if(typeof t.body=="string")return n.icons[e]={...t},!0}catch{}return!1}let Ph=!1;function MC(n){return typeof n=="boolean"&&(Ph=n),Ph}function z_(n){const e=typeof n=="string"?hd(n,!0,Ph):n;if(e){const t=fl(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function V_(n,e){const t=hd(n,!0,Ph);if(!t)return!1;const i=fl(t.provider,t.prefix);return e?bU(i,t.name,e):(i.missing.add(t.name),!0)}function wU(n,e){if(typeof n!="object")return!1;if(typeof e!="string"&&(e=n.provider||""),Ph&&!e&&!n.prefix){let r=!1;return wC(n)&&(n.prefix="",bC(n,(s,o)=>{V_(s,o)&&(r=!0)})),r}const t=n.prefix;if(!Sp({prefix:t,name:"a"}))return!1;const i=fl(e,t);return!!SC(i,n)}function Xx(n){const e=z_(n);return e&&{...nu,...e}}const TC=Object.freeze({width:null,height:null}),EC=Object.freeze({...TC,...Kp}),SU=/(-?[0-9.]*[0-9]+[0-9.]*)/g,MU=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ww(n,e,t){if(e===1)return n;if(t=t||100,typeof n=="number")return Math.ceil(n*e*t)/t;if(typeof n!="string")return n;const i=n.split(SU);if(i===null||!i.length)return n;const r=[];let s=i.shift(),o=MU.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*e*t)/t)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function TU(n,e="defs"){let t="";const i=n.indexOf("<"+e);for(;i>=0;){const r=n.indexOf(">",i),s=n.indexOf("</"+e);if(r===-1||s===-1)break;const o=n.indexOf(">",s);if(o===-1)break;t+=n.slice(r+1,s).trim(),n=n.slice(0,i).trim()+n.slice(o+1)}return{defs:t,content:n}}function EU(n,e){return n?"<defs>"+n+"</defs>"+e:e}function AU(n,e,t){const i=TU(n);return EU(i.defs,e+i.content+t)}const CU=n=>n==="unset"||n==="undefined"||n==="none";function RU(n,e){const t={...nu,...n},i={...EC,...e},r={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,i].forEach(v=>{const m=[],g=v.hFlip,y=v.vFlip;let x=v.rotate;g?y?x+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):y&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let _;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:_=r.height/2+r.top,m.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:_=r.width/2+r.left,m.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}x%2===1&&(r.left!==r.top&&(_=r.left,r.left=r.top,r.top=_),r.width!==r.height&&(_=r.width,r.width=r.height,r.height=_)),m.length&&(s=AU(s,'<g transform="'+m.join(" ")+'">',"</g>"))});const o=i.width,a=i.height,l=r.width,c=r.height;let u,h;o===null?(h=a===null?"1em":a==="auto"?c:a,u=Ww(h,l/c)):(u=o==="auto"?l:o,h=a===null?Ww(u,c/l):a==="auto"?c:a);const d={},f=(v,m)=>{CU(m)||(d[v]=m.toString())};f("width",u),f("height",h);const p=[r.left,r.top,l,c];
18return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const PU=/\sid="(\S+)"/g,IU="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let NU=0;function LU(n,e=IU){const t=[];let i;for(;i=PU.exec(n);)t.push(i[1]);if(!t.length)return n;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(s=>{const o=typeof e=="function"?e(s):e+(NU++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),n=n.replace(new RegExp(r,"g"),""),n}const Yx=Object.create(null);function AC(n,e){Yx[n]=e}function Kx(n){return Yx[n]||Yx[""]}function H_(n){let e;if(typeof n.resources=="string")e=[n.resources];else if(e=n.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:n.path||"/",maxURL:n.maxURL||500,rotate:n.rotate||750,timeout:n.timeout||5e3,random:n.random===!0,index:n.index||0,dataAfterTimeout:n.dataAfterTimeout!==!1}}const bg=Object.create(null),bu=["https://api.simplesvg.com","https://api.unisvg.com"],Mp=[];for(;bu.length>0;)bu.length===1||Math.random()>.5?Mp.push(bu.shift()):Mp.push(bu.pop());bg[""]=H_({resources:["https://api.iconify.design"].concat(Mp)});function CC(n,e){const t=H_(e);return t===null?!1:(bg[n]=t,!0)}function wg(n){return bg[n]}function OU(){return Object.keys(bg)}const DU=()=>{let n;try{if(n=fetch,typeof n=="function")return n}catch{}};let Zp=DU();function kU(n){Zp=n}function FU(){return Zp}function UU(n,e){const t=wg(n);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let r=0;t.resources.forEach(o=>{r=Math.max(r,o.length)});const s=e+".json?icons=";i=t.maxURL-r-t.path.length-s.length}return i}function BU(n){return n===404}const zU=(n,e,t)=>{const i=[],r=UU(n,e),s="icons";let o={type:s,provider:n,prefix:e,icons:[]},a=0;return t.forEach((l,c)=>{a+=l.length+1,a>=r&&c>0&&(i.push(o),o={type:s,provider:n,prefix:e,icons:[]},a=l.length),o.icons.push(l)}),i.push(o),i};function VU(n){if(typeof n=="string"){const e=wg(n);if(e)return e.path}return"/"}const HU=(n,e,t)=>{if(!Zp){t("abort",424);return}let i=VU(e.provider);switch(e.type){case"icons":{const s=e.prefix,a=e.icons.join(","),l=new URLSearchParams({icons:a});i+=s+".json?"+l.toString();break}case"custom":{const s=e.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:t("abort",400);return}let r=503;Zp(n+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{t(BU(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?t("abort",s):t("next",r)});return}setTimeout(()=>{t("success",s)})}).catch(()=>{t("next",r)})},GU={prepare:zU,send:HU};function WU(n){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);n.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return n.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,l=t[s]||(t[s]=Object.create(null)),c=l[o]||(l[o]=fl(s,o));let u;a in c.icons?u=e.loaded:o===""||c.missing.has(a)?u=e.missing:u=e.pending;const h={provider:s,prefix:o,name:a};u.push(h)}),e}function RC(n,e){n.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(r=>r.id!==e))})}function $U(n){n.pendingCallbacksFlag||(n.pendingCallbacksFlag=!0,setTimeout(()=>{n.pendingCallbacksFlag=!1;const e=n.loaderCallbacks?n.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=n.provider,r=n.prefix;e.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==r)return!0;const c=l.name;if(n.icons[c])o.loaded.push({provider:i,prefix:r,name:c});else if(n.missing.has(c))o.missing.push({provider:i,prefix:r,name:c});else return t=!0,!0;return!1}),o.pending.length!==a&&(t||RC([n],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let jU=0;function qU(n,e,t){const i=jU++,r=RC.bind(null,t,i);if(!e.pending.length)return r;const s={id:i,icons:e,callback:n,abort:r};return t.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function XU(n,e=!0,t=!1){const i=[];
18return n.forEach(r=>{const s=typeof r=="string"?hd(r,e,t):r;s&&i.push(s)}),i}var YU={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function KU(n,e,t,i){const r=n.resources.length,s=n.random?Math.floor(Math.random()*r):n.index;let o;if(n.random){let S=n.resources.slice(0);for(o=[];S.length>1;){const E=Math.floor(Math.random()*S.length);o.push(S[E]),S=S.slice(0,E).concat(S.slice(E+1))}o=o.concat(S)}else o=n.resources.slice(s).concat(n.resources.slice(0,s));const a=Date.now();let l="pending",c=0,u,h=null,d=[],f=[];typeof i=="function"&&f.push(i);function p(){h&&(clearTimeout(h),h=null)}function v(){l==="pending"&&(l="aborted"),p(),d.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),d=[]}function m(S,E){E&&(f=[]),typeof S=="function"&&f.push(S)}function g(){return{startTime:a,payload:e,status:l,queriesSent:c,queriesPending:d.length,subscribe:m,abort:v}}function y(){l="failed",f.forEach(S=>{S(void 0,u)})}function x(){d.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),d=[]}function _(S,E,M){const b=E!=="success";switch(d=d.filter(w=>w!==S),l){case"pending":break;case"failed":if(b||!n.dataAfterTimeout)return;break;default:return}if(E==="abort"){u=M,y();return}if(b){u=M,d.length||(o.length?T():y());return}if(p(),x(),!n.random){const w=n.resources.indexOf(S.resource);w!==-1&&w!==n.index&&(n.index=w)}l="completed",f.forEach(w=>{w(M)})}function T(){if(l!=="pending")return;p();const S=o.shift();if(S===void 0){if(d.length){h=setTimeout(()=>{p(),l==="pending"&&(x(),y())},n.timeout);return}y();return}const E={status:"pending",resource:S,callback:(M,b)=>{_(E,M,b)}};d.push(E),c++,h=setTimeout(T,n.rotate),t(S,e,E.callback)}return setTimeout(T),g}function PC(n){const e={...YU,...n};let t=[];function i(){t=t.filter(a=>a().status==="pending")}function r(a,l,c){const u=KU(e,a,l,(h,d)=>{i(),c&&c(h,d)});return t.push(u),u}function s(a){return t.find(l=>a(l))||null}return{query:r,find:s,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:i}}function $w(){}const G0=Object.create(null);function ZU(n){if(!G0[n]){const e=wg(n);if(!e)return;const t=PC(e),i={config:e,redundancy:t};G0[n]=i}return G0[n]}function IC(n,e,t){let i,r;if(typeof n=="string"){const s=Kx(n);if(!s)return t(void 0,424),$w;r=s.send;const o=ZU(n);o&&(i=o.redundancy)}else{const s=H_(n);if(s){i=PC(s);const o=n.resources?n.resources[0]:"",a=Kx(o);a&&(r=a.send)}}return!i||!r?(t(void 0,424),$w):i.query(e,r,t)().abort}function jw(){}function JU(n){n.iconsLoaderFlag||(n.iconsLoaderFlag=!0,setTimeout(()=>{n.iconsLoaderFlag=!1,$U(n)}))}function QU(n){const e=[],t=[];return n.forEach(i=>{(i.match(yC)?e:t).push(i)}),{valid:e,invalid:t}}function wu(n,e,t){function i(){const r=n.pendingIcons;e.forEach(s=>{r&&r.delete(s),n.icons[s]||n.missing.add(s)})}if(t&&typeof t=="object")try{if(!SC(n,t).length){i();return}}catch(r){console.error(r)}i(),JU(n)}function qw(n,e){n instanceof Promise?n.then(t=>{e(t)}).catch(()=>{e(null)}):e(n)}function eB(n,e){n.iconsToLoad?n.iconsToLoad=n.iconsToLoad.concat(e).sort():n.iconsToLoad=e,n.iconsQueueFlag||(n.iconsQueueFlag=!0,setTimeout(()=>{n.iconsQueueFlag=!1;const{provider:t,prefix:i}=n,r=n.iconsToLoad;if(delete n.iconsToLoad,!r||!r.length)return;const s=n.loadIcon;if(n.loadIcons&&(r.length>1||!s)){qw(n.loadIcons(r,i,t),u=>{wu(n,r,u)});return}if(s){r.forEach(u=>{const h=s(u,i,t);qw(h,d=>{const f=d?{prefix:i,icons:{[u]:d}}:null;wu(n,[u],f)})});return}const{valid:o,invalid:a}=QU(r);if(a.length&&wu(n,a,null),!o.length)return;const l=i.match(yC)?Kx(t):null;if(!l){wu(n,o,null);return}l.prepare(t,i,o).forEach(u=>{IC(t,u,h=>{wu(n,u.icons,h)})})}))}const NC=(n,e)=>{const t=XU(n,!0,MC()),i=WU(t);if(!i.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(i.loaded,i.missing,i.pending,jw)}),()=>{l=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(l=>{const{provider:c,prefix:u}=l;if(u===a&&c===o)return;o=c,a=u,s.push(fl(c,u));const h=r[c]||(r[c]=Object.create(null));h[u]||(h[u]=[])}),i.pending.forEach(l=>{const{provider:c,prefix:u,name:h}=l,d=fl(c,u),f=d.pendingIcons||(d.pendingIcons=new Set);f.has(h)||(f.add(h),r[c][u].push(h))}
18),s.forEach(l=>{const c=r[l.provider][l.prefix];c.length&&eB(l,c)}),e?qU(e,i,s):jw},tB=n=>new Promise((e,t)=>{const i=typeof n=="string"?hd(n,!0):n;if(!i){t(n);return}NC([i||n],r=>{if(r.length&&i){const s=z_(i);if(s){e({...nu,...s});return}}t(n)})});function nB(n,e,t){fl("",e).loadIcons=n}function iB(n,e){const t={...n};for(const i in e){const r=e[i],s=typeof r;i in TC?(r===null||r&&(s==="string"||s==="number"))&&(t[i]=r):s===typeof t[i]&&(t[i]=i==="rotate"?r%4:r)}return t}const rB=/[\s,]+/;function sB(n,e){e.split(rB).forEach(t=>{switch(t.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0;break}})}function oB(n,e=0){const t=n.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(t===""){const r=parseInt(n);return isNaN(r)?0:i(r)}else if(t!==n){let r=0;switch(t){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(n.slice(0,n.length-t.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return e}function aB(n,e){let t=n.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+n+"</svg>"}function lB(n){return n.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function cB(n){return"data:image/svg+xml,"+lB(n)}function uB(n){return'url("'+cB(n)+'")'}const Xw={...EC,inline:!1},hB={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},dB={display:"inline-block"},Zx={backgroundColor:"currentColor"},LC={backgroundColor:"transparent"},Yw={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Kw={webkitMask:Zx,mask:Zx,background:LC};for(const n in Kw){const e=Kw[n];for(const t in Yw)e[n+t]=Yw[t]}const Tp={};["horizontal","vertical"].forEach(n=>{const e=n.slice(0,1)+"Flip";Tp[n+"-flip"]=e,Tp[n.slice(0,1)+"-flip"]=e,Tp[n+"Flip"]=e});function Zw(n){return n+(n.match(/^[-0-9.]+$/)?"px":"")}const Jw=(n,e)=>{const t=iB(Xw,e),i={...hB},r=e.mode||"svg",s={},o=e.style,a=typeof o=="object"&&!(o instanceof Array)?o:{};for(let v in e){const m=e[v];if(m!==void 0)switch(v){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":t[v]=m===!0||m==="true"||m===1;break;case"flip":typeof m=="string"&&sB(t,m);break;case"color":s.color=m;break;case"rotate":typeof m=="string"?t[v]=oB(m):typeof m=="number"&&(t[v]=m);break;case"ariaHidden":case"aria-hidden":m!==!0&&m!=="true"&&delete i["aria-hidden"];break;default:{const g=Tp[v];g?(m===!0||m==="true"||m===1)&&(t[g]=!0):Xw[v]===void 0&&(i[v]=m)}}}const l=RU(n,t),c=l.attributes;if(t.inline&&(s.verticalAlign="-0.125em"),r==="svg"){i.style={...s,...a},Object.assign(i,c);let v=0,m=e.id;return typeof m=="string"&&(m=m.replace(/-/g,"_")),i.innerHTML=LU(l.body,m?()=>m+"ID"+v++:"iconifyVue"),Yn("svg",i)}const{body:u,width:h,height:d}=n,f=r==="mask"||(r==="bg"?!1:u.indexOf("currentColor")!==-1),p=aB(u,{...c,width:h+"",height:d+""});return i.style={...s,"--svg":uB(p),width:Zw(c.width),height:Zw(c.height),...dB,...f?Zx:LC,...a},Yn("span",i)};MC(!0);AC("",GU);if(typeof document<"u"&&typeof window<"u"){const n=window;if(n.IconifyPreload!==void 0){const e=n.IconifyPreload,t="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!wU(i))&&console.error(t)}catch{console.error(t)}})}if(n.IconifyProviders!==void 0){const e=n.IconifyProviders;if(typeof e=="object"&&e!==null)for(let t in e){const i="IconifyProviders["+t+"] is invalid.";try{const r=e[t];if(typeof r!="object"||!r||r.resources===void 0)continue;CC(t,r)||console.error(i)}catch{console.error(i)}}}}const fB={...nu,body:""},pB=qe((n,{emit:e})=>{const t=Te(null);function i(){t.value&&(t.value.abort?.(),t.value=null)}const r=Te(!!n.ssr),s=Te(""),o=Mt(null);function a(){const c=n.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return s.value="",{data:c};let u;if(typeof c!="string"||(u=hd(c,!1,!0))===null)return null;let h=z_(u);if(!h){const p=t.value;return(!p||p.name!==c)&&(h===null?t.value={name:c}:t.value={name:c,abort:NC([u],l)}),null}i(),s.value!==c&&(s.value=c,xi(()=>{e("load",c)}));const d=n.customise;if(d){h=Object.assign({},h);const p=d(h.body,u.name,u.prefix,u.provider);typeof p=="string"&&(h.body=p)}const f=["iconify"];return u.prefix!==""&&f.push("iconify--"+u.prefix),u.provider!==""&&f.push("iconify--"+u.provider),{data:h,classes:f}}function l(){const c=a();c?c.data!==o.value?.data&&(o.value=c):o.value=null}return r.value?l():On(()=>{r.value=!0,l()}),Je(()=>n.icon,l),di(i),()=>{const c=o.value;if(!c)return Jw(fB,n);let u=n;return c.classes&&(u={...n,class:c.classes.join(" ")}),Jw({...nu,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),Qw={getAPIConfig:wg,setAPIModule:AC,sendAPIQuery:IC,setFetch:kU,getFetch:FU,listAPIProviders:OU},mB=Vs({name:"@nuxt/icon",setup(){const n=dl(),e=Ci().icon;Qw.setFetch($fetch.native);const t=[];if(e.provider==="server"){const r=n.app?.baseURL?.replace(/\/$/,"")??"";t.push(r+(e.localApiEndpoint||"/api/_nuxt_icon")),(e.fallbackToApi===!0||e.fallbackToApi==="client-only")&&t.push(e.iconifyApiEndpoint)}else e.provider==="none"?Qw.setFetch(()=>Promise.resolve(new Response)):t.push(e.iconifyApiEndpoint);async function i(r,s){try{const o=await $fetch(t[0]+"/"+s+".json",{query:{icons:r.join(",")}});if(!o||o.prefix!==s||!o.icons)throw new Error("Invalid data"+JSON.stringify(o));return o}catch(o){return console.error("Failed to load custom icons",o),null}}CC("",{resources:t});for(const r of e.customCollections||[])r&&nB(i,r)}}),gB=[$F,KF,QF,tU,nU,iU,sU,uU,mU,mB],vB={name:"カメラ設定"},xB=qe({__name:"camera",setup(n){return(e,t)=>(pe(),pt("TresGroup",vB,[...t[0]||(t[0]=[Me("TresPerspectiveCamera",{args:[45,1,.1,100],position:[-.2958695255454217,1.7241894835951193,5.52154080005775],"look-at":[-.3,0,0]},null,-1)])]))}}),yB=Object.assign(xB,{__name:"Camera"}),zn={IDLE_FRONT:"idleFront",IDLE_LEFT:"idleLeft",IDLE_RIGHT:"idleRight",IDLE_BACK:"idleBack",WALK_FRONT:"walkFront",WALK_LEFT:"walkLeft",WALK_RIGHT:"walkRight",WALK_BACK:"walkBack"},_B={[zn.IDLE_FRONT]:"0",[zn.IDLE_LEFT]:"0",[zn.IDLE_RIGHT]:"0",[zn.IDLE_BACK]:"0",[zn.WALK_FRONT]:"0,1,2,1",[zn.WALK_LEFT]:"0,1,2,1",[zn.WALK_RIGHT]:"0,1,2,1",[zn.WALK_BACK]:"0,1,2,1"},qr={MAN:"man"},Ot={BODY:"01_body",FACE:"02_face",HAIR_01:"03_hair01",HAIR_02:"04_hair02",SUB_01:"05_sub_01",SUB_02:"06_sub_02",SUB_03:"07_sub_03"},Ys={[qr.MAN]:{[Ot.BODY]:[{set:"adventurer",label:"冒険者",list:[{kind:1,type:[1]}]}],[Ot.FACE]:[{set:"zitome",label:"ジト目",list:[{kind:1,type:[1]}]},{set:"cute",label:"キュート",list:[{kind:1,type:[1,2,3,4,5]}]}],[Ot.HAIR_01]:[{set:"natural",label:"ナチュラル",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]},{kind:2,type:[1,2,3,4,5,6,7,8,9,10]},{kind:3,type:[1,2,3,4,5,6,7,8,9,10]},{kind:4,type:[1,2,3,4,5,6,7,8,9,10]},{kind:5,type:[1,2,3,4,5,6,7,8,9,10]}
18,{kind:6,type:[1,2,3,4,5,6,7,8,9,10]},{kind:7,type:[1,2,3,4,5,6,7,8,9]},{kind:8,type:[1,2,3,4,5,6,7,8,9,10,11]}]},{set:"center",label:"センター",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]},{kind:2,type:[1,2,3,4,5,6,7,8]}]},{set:"gentle",label:"紳士",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]},{kind:2,type:[1,2,3,4,5,6,7,8,9,10]},{kind:3,type:[1,2,3,4,5,6,7,8,9,10]}]},{set:"long",label:"ロング",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]}]},{set:"old",label:"オールド",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]}]},{set:"short",label:"ショート",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]},{kind:2,type:[1,2,3,4,5,6,7,8,9,10]},{kind:3,type:[1,2,3,4,5,6,7,8]},{kind:4,type:[1,2,3,4,5,6,7,8,9]}]},{set:"style",label:"スタイリッシュ",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]},{kind:2,type:[1,2,3,4,5,6,7,8]},{kind:3,type:[1,2,3,4,5,6,7,8,9,10,11]}]},{set:"wave",label:"ウェーブ",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]},{kind:2,type:[1,2,3,4,5,6,7,8,9,10]}]},{set:"afro",label:"アフロ",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10,11]}]},{set:"thinhair",label:"薄毛",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9]}]}],[Ot.HAIR_02]:[{set:"long",label:"ロング",list:[{kind:1,type:[1,2,3,4,5,6,7,8,9,10]}]}],[Ot.SUB_01]:[],[Ot.SUB_02]:[],[Ot.SUB_03]:[]}},ja={CONNECTED:"connected",JOIN:"join",LEAVE:"leave",MOVE:"move",CHAT:"chat"};const ua="181",bs={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},lo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},OC=0,Jx=1,DC=2,bB=3,wB=0,G_=1,W_=2,ys=3,Ns=0,Xn=1,Et=2,Hn=0,il=1,Qx=2,ey=3,ty=4,kC=5,jo=100,FC=101,UC=102,BC=103,zC=104,VC=200,HC=201,GC=202,WC=203,Jp=204,Qp=205,$C=206,jC=207,qC=208,XC=209,YC=210,KC=211,ZC=212,JC=213,QC=214,em=0,Ih=1,tm=2,pl=3,nm=4,im=5,rm=6,sm=7,dd=0,e3=1,t3=2,As=0,n3=1,i3=2,r3=3,$_=4,s3=5,o3=6,a3=7,ny="attached",l3="detached",Sg=300,Ls=301,ea=302,Jo=303,Nh=304,iu=306,fo=1e3,lr=1001,Lh=1002,on=1003,j_=1004,SB=1004,gc=1005,MB=1005,dn=1006,fh=1007,TB=1007,es=1008,EB=1008,Wn=1009,q_=1010,X_=1011,kc=1012,Mg=1013,Os=1014,li=1015,Gi=1016,Tg=1017,Eg=1018,ml=1020,Y_=35902,K_=35899,Z_=1021,J_=1022,Wi=1023,Fc=1026,gl=1027,Ag=1028,fd=1029,Cg=1030,Rg=1031,AB=1032,Pg=1033,ph=33776,mh=33777,gh=33778,vh=33779,om=35840,am=35841,lm=35842,cm=35843,um=36196,hm=37492,dm=37496,fm=37808,pm=37809,mm=37810,gm=37811,vm=37812,xm=37813,ym=37814,_m=37815,bm=37816,wm=37817,Sm=37818,Mm=37819,Tm=37820,Em=37821,Am=36492,Cm=36494,Rm=36495,Pm=36283,Im=36284,Nm=36285,Lm=36286,c3=2200,u3=2201,h3=2202,Oh=2300,Om=2301,Ep=2302,qa=2400,Xa=2401,Dh=2402,Ig=2500,Q_=2501,CB=0,RB=1,PB=2,Hs=3200,d3=3201,IB=3202,NB=3203,ha=0,f3=1,Zr="",Lt="srgb",_o="srgb-linear",kh="linear",rn="srgb",LB=0,za=7680,OB=7681,DB=7682,kB=7683,FB=34055,UB=34056,BB=5386,zB=512,VB=513,HB=514,GB=515,WB=516,$B=517,jB=518,iy=519,p3=512,m3=513,g3=514,eb=515,v3=516,x3=517,y3=518,_3=519,Fh=35044,qB=35048,XB=35040,YB=35045,KB=35049,ZB=35041,JB=35046,QB=35050,e4=35042,t4="100",ry="300 es",Sr=2e3,Uc=2001,n4={COMPUTE:"compute",RENDER:"render"},i4={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},r4={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function b3(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const s4={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function vc(n,e){return new s4[n](e)}function Uh(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function w3(){const n=Uh("canvas");return n.style.display="block",n}const eS={};let ta=null;function o4(n){ta=n}function a4(){return ta}function Bh(...n){const e="THREE."+n.shift();ta?ta("log",e,...n):console.log(e,...n)}function je(...n){const e="THREE."+n.shift();ta?ta("warn",e,...n):console.warn(e,...n)}function St(...n){const e="THREE."+n.shift();ta?ta("error",e,...n):console.error(e,...n)}function Bc(...n){const e=n.join(" ");e in eS||(eS[e]=!0,je(...n))}function l4(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}class Cr{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[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 i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const yi=["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
185","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 tS=1234567;const rl=Math.PI/180,zc=180/Math.PI;function Tr(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(yi[n&255]+yi[n>>8&255]+yi[n>>16&255]+yi[n>>24&255]+"-"+yi[e&255]+yi[e>>8&255]+"-"+yi[e>>16&15|64]+yi[e>>24&255]+"-"+yi[t&63|128]+yi[t>>8&255]+"-"+yi[t>>16&255]+yi[t>>24&255]+yi[i&255]+yi[i>>8&255]+yi[i>>16&255]+yi[i>>24&255]).toLowerCase()}function yt(n,e,t){return Math.max(e,Math.min(t,n))}function tb(n,e){return(n%e+e)%e}function c4(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function u4(n,e,t){return n!==e?(t-n)/(e-n):0}function xh(n,e,t){return(1-t)*n+t*e}function h4(n,e,t,i){return xh(n,e,1-Math.exp(-t*i))}function d4(n,e=1){return e-Math.abs(tb(n,e*2)-e)}function f4(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function p4(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function m4(n,e){return n+Math.floor(Math.random()*(e-n+1))}function g4(n,e){return n+Math.random()*(e-n)}function v4(n){return n*(.5-Math.random())}function x4(n){n!==void 0&&(tS=n);let e=tS+=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 y4(n){return n*rl}function _4(n){return n*zc}function b4(n){return(n&n-1)===0&&n!==0}function w4(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function S4(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function M4(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),h=s((e-i)/2),d=o((e-i)/2),f=s((i-e)/2),p=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*h,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*f,a*u,a*c);break;default:je("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function zi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Pt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const pd={DEG2RAD:rl,RAD2DEG:zc,generateUUID:Tr,clamp:yt,euclideanModulo:tb,mapLinear:c4,inverseLerp:u4,lerp:xh,damp:h4,pingpong:d4,smoothstep:f4,smootherstep:p4,randInt:m4,randFloat:g4,randFloatSpread:v4,seededRandom:x4,degToRad:y4,radToDeg:_4,isPowerOfTwo:b4,ceilPowerOfTwo:w4,floorPowerOfTwo:S4,setQuaternionFromProperEuler:M4,normalize:Pt,denormalize:zi};class de{constructor(e=0,t=0){de.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 50,411 bytes, line 18
18sub(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,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+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=yt(this.x,e.x,t.x),this.y=yt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=yt(this.x,e,t),this.y=yt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(yt(i,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 i=this.dot(e)/t;return Math.acos(yt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,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 i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ui{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],d=s[o+0],f=s[o+1],p=s[o+2],v=s[o+3];if(a<=0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h;return}if(a>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=v;return}if(h!==v||l!==d||c!==f||u!==p){let m=l*d+c*f+u*p+h*v;m<0&&(d=-d,f=-f,p=-p,v=-v,m=-m);let g=1-a;if(m<.9995){const y=Math.acos(m),x=Math.sin(y);g=Math.sin(g*y)/x,a=Math.sin(a*y)/x,l=l*g+d*a,c=c*g+f*a,u=u*g+p*a,h=h*g+v*a}else{l=l*g+d*a,c=c*g+f*a,u=u*g+p*a,h=h*g+v*a;const y=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=y,c*=y,u*=y,h*=y}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*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,i,r){return this._x=e,this._y=t,this._z=i,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 i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),d=l(i/2),f=l(r/2),p=l(s/2);switch(o){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:je("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+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=(o-r)*f}else if(i>a&&i>h){const f=2*Math.sqrt(1+i-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>h){const f=2*Math.sqrt(1+a-i-h);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(yt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);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 i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let i=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(i=-i,r=-r,s=-s,o=-o,a=-a);let l=1-t;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+o*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+o*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);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}}class z{constructor(e=0,t=0,i=0){z.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,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(nS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*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,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+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=yt(this.x,e.x,t.x),this.y=yt(this.y,e.y,t.y),this.z=yt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=yt(this.x,e,t),this.y=yt(this.y,e,t),this.z=yt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(yt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return W0.copy(this).projectOnVector(e),this.sub(W0)}reflect(e){return this.sub(W0.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 i=this.dot(e)/t;return Math.acos(yt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+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,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,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(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,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,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const W0=new z,nS=new ui;class Ct{constructor(e,t,i,r,s,o,a,l,c){Ct.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.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 i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],f=i[5],p=i[8],v=r[0],m=r[3],g=r[6],y=r[1],x=r[4],_=r[7],T=r[2],S=r[5],E=r[8];return s[0]=o*v+a*y+l*T,s[3]=o*m+a*x+l*S,s[6]=o*g+a*_+l*E,s[1]=c*v+u*y+h*T,s[4]=c*m+u*x+h*S,s[7]=c*g+u*_+h*E,s[2]=d*v+f*y+p*T,s[5]=d*m+f*x+p*S,s[8]=d*g+f*_+p*E,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],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+i*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/p;return e[0]=h*v,e[1]=(r*c-u*i)*v,e[2]=(a*i-r*o)*v,e[3]=d*v,e[4]=(u*t-r*l)*v,e[5]=(r*s-a*t)*v,e[6]=f*v,e[7]=(i*l-c*t)*v,e[8]=(o*t-i*s)*v,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,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply($0.makeScale(e,t)),this}rotate(e){return this.premultiply($0.makeRotation(-e)),this}translate(e,t){return this.premultiply($0.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),i=Math.sin(e);return this.set(t,-i,0,i,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,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const $0=new Ct,iS=new Ct().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),rS=new Ct().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function T4(){const n={enabled:!0,workingColorSpace:_o,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===rn&&(r.r=po(r.r),r.g=po(r.g),r.b=po(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===rn&&(r.r=Cc(r.r),r.g=Cc(r.g),r.b=Cc(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===Zr?kh: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,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].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 Bc("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Bc("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[_o]:{primaries:e,whitePoint:i,transfer:kh,toXYZ:iS,fromXYZ:rS,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Lt},outputColorSpaceConfig:{drawingBufferColorSpace:Lt}},[Lt]:{primaries:e,whitePoint:i,transfer:rn,toXYZ:iS,fromXYZ:rS,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Lt}}}),n}const Gt=T4();function po(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Cc(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ol;class S3{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Ol===void 0&&(Ol=Uh("canvas")),Ol.width=e.width,Ol.height=e.height;const r=Ol.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Ol}return i.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=Uh("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=po(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(po(t[i]/255)*255):t[i]=po(t[i]);return{data:t,width:e.width,height:e.height}}else return je("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let E4=0;class qo{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:E4++}),this.uuid=Tr(),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):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,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 i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(j0(r[o].image)):s.push(j0(r[o]))}else s=j0(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function j0(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?S3.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(je("Texture: Unable to serialize Texture."),{})}let A4=0;const q0=new z;class Sn extends Cr{constructor(e=Sn.DEFAULT_IMAGE,t=Sn.DEFAULT_MAPPING,i=lr,r=lr,s=dn,o=es,a=Wi,l=Wn,c=Sn.DEFAULT_ANISOTROPY,u=Zr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:A4++}),this.uuid=Tr(),this.name="",this.source=new qo(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new de(0,0),this.repeat=new de(1,1),this.center=new de(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ct,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}get width(){return this.source.getSize(q0).x}get height(){return this.source.getSize(q0).y}get depth(){return this.source.getSize(q0).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}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.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 i=e[t];if(i===void 0){je(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){je(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={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,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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Sg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fo:e.x=e.x-Math.floor(e.x);break;case lr:e.x=e.x<0?0:1;break;case Lh: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 fo:e.y=e.y-Math.floor(e.y);break;case lr:e.y=e.y<0?0:1;break;case Lh: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++}}Sn.DEFAULT_IMAGE=null;Sn.DEFAULT_MAPPING=Sg;Sn.DEFAULT_ANISOTROPY=1;class Ft{constructor(e=0,t=0,i=0,r=1){Ft.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,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,i,r){return this.x=e,this.y=t,this.z=i,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,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[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,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],v=l[2],m=l[6],g=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-v)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+v)<.1&&Math.abs(p+m)<.1&&Math.abs(c+f+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,_=(f+1)/2,T=(g+1)/2,S=(u+d)/4,E=(h+v)/4,M=(p+m)/4;return x>_&&x>T?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=S/i,s=E/i):_>T?_<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(_),i=S/r,s=M/r):T<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(T),i=E/s,r=M/s),this.set(i,r,s,t),this}let y=Math.sqrt((m-p)*(m-p)+(h-v)*(h-v)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(h-v)/y,this.z=(d-u)/y,this.w=Math.acos((c+f+g-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=yt(this.x,e.x,t.x),this.y=yt(this.y,e.y,t.y),this.z=yt(this.z,e.z,t.z),this.w=yt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=yt(this.x,e,t),this.y=yt(this.y,e,t),this.z=yt(this.z,e,t),this.w=yt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(yt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class nb extends Cr{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Ft(0,0,e,t),this.scissorTest=!1,this.viewport=new Ft(0,0,e,t);const r={width:e,height:t,depth:i.depth},s=new Sn(r);this.textures=[];const o=i.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:dn,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 i=0;i<this.textures.length;i++)this.textures[i].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,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;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=i,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,i=e.textures.length;t<i;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 qo(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}dispose(){this.dispatchEvent({type:"dispose"})}}class En extends nb{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class Ng extends Sn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=lr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class C4 extends En{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Ng(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Lg extends Sn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=lr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class R4 extends En{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new Lg(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Ai{constructor(e=new z(1/0,1/0,1/0),t=new z(-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,i=e.length;t<i;t+=3)this.expandByPoint(Hr.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Hr.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Hr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),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 i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Hr):Hr.fromBufferAttribute(s,o),Hr.applyMatrix4(e.matrixWorld),this.expandByPoint(Hr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Kd.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Kd.copy(i.boundingBox)),Kd.applyMatrix4(e.matrixWorld),this.union(Kd)}const r=e.children;for(let s=0,o=r.length;s<o;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,Hr),Hr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Su),Zd.subVectors(this.max,Su),Dl.subVectors(e.a,Su),kl.subVectors(e.b,Su),Fl.subVectors(e.c,Su),Co.subVectors(kl,Dl),Ro.subVectors(Fl,kl),ba.subVectors(Dl,Fl);let t=[0,-Co.z,Co.y,0,-Ro.z,Ro.y,0,-ba.z,ba.y,Co.z,0,-Co.x,Ro.z,0,-Ro.x,ba.z,0,-ba.x,-Co.y,Co.x,0,-Ro.y,Ro.x,0,-ba.y,ba.x,0];return!X0(t,Dl,kl,Fl,Zd)||(t=[1,0,0,0,1,0,0,0,1],!X0(t,Dl,kl,Fl,Zd))?!1:(Jd.crossVectors(Co,Ro),t=[Jd.x,Jd.y,Jd.z],X0(t,Dl,kl,Fl,Zd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Hr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Hr).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:(Ks[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ks[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ks[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ks[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ks[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ks[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ks[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ks[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ks),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 Ks=[new z,new z,new z,new z,new z,new z,new z,new z],Hr=new z,Kd=new Ai,Dl=new z,kl=new z,Fl=new z,Co=new z,Ro=new z,ba=new z,Su=new z,Zd=new z,Jd=new z,wa=new z;function X0(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){wa.fromArray(n,s);const a=r.x*Math.abs(wa.x)+r.y*Math.abs(wa.y)+r.z*Math.abs(wa.z),l=e.dot(wa),c=t.dot(wa),u=i.dot(wa);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const P4=new Ai,Mu=new z,Y0=new z;class hi{constructor(e=new z,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 i=this.center;t!==void 0?i.copy(t):P4.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.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 i=this.center.distanceToSquared(e);return t.copy(e),i>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;Mu.subVectors(e,this.center);const t=Mu.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Mu,r/i),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):(Y0.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Mu.copy(e.center).add(Y0)),this.expandByPoint(Mu.copy(e.center).sub(Y0))),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}}const Zs=new z,K0=new z,Qd=new z,Po=new z,Z0=new z,ef=new z,J0=new z;class Ds{constructor(e=new z,t=new z(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,Zs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Zs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zs.copy(this.origin).addScaledVector(this.direction,t),Zs.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){K0.copy(e).add(t).multiplyScalar(.5),Qd.copy(t).sub(e).normalize(),Po.copy(this.origin).sub(K0);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Qd),a=Po.dot(this.direction),l=-Po.dot(Qd),c=Po.lengthSq(),u=Math.abs(1-o*o);let h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){const v=1/u;h*=v,d*=v,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),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,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(K0).addScaledVector(Qd,d),f}intersectSphere(e,t){Zs.subVectors(e.center,this.origin);const i=Zs.dot(this.direction),r=Zs.dot(Zs)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,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 i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),h>=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Zs)!==null}intersectTriangle(e,t,i,r,s){Z0.subVectors(t,e),ef.subVectors(i,e),J0.crossVectors(Z0,ef);let o=this.direction.dot(J0),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Po.subVectors(this.origin,e);const l=a*this.direction.dot(ef.crossVectors(Po,ef));if(l<0)return null;const c=a*this.direction.dot(Z0.cross(Po));if(c<0||l+c>o)return null;const u=-a*Po.dot(J0);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ht{constructor(e,t,i,r,s,o,a,l,c,u,h,d,f,p,v,m){ht.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,h,d,f,p,v,m)}set(e,t,i,r,s,o,a,l,c,u,h,d,f,p,v,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=v,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ht().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Ul.setFromMatrixColumn(e,0).length(),s=1/Ul.setFromMatrixColumn(e,1).length(),o=1/Ul.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*u,f=o*h,p=a*u,v=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-v*c,t[9]=-a*l,t[2]=v-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,p=c*u,v=c*h;t[0]=d+v*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=v+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,p=c*u,v=c*h;t[0]=d-v*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=v-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,f=o*h,p=a*u,v=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+v,t[1]=l*h,t[5]=v*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,f=o*c,p=a*l,v=a*c;t[0]=l*u,t[4]=v-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-v*h}else if(e.order==="XZY"){const d=o*l,f=o*c,p=a*l,v=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+v,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=v*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(I4,e,N4)}lookAt(e,t,i){const r=this.elements;return pr.subVectors(e,t),pr.lengthSq()===0&&(pr.z=1),pr.normalize(),Io.crossVectors(i,pr),Io.lengthSq()===0&&(Math.abs(i.z)===1?pr.x+=1e-4:pr.z+=1e-4,pr.normalize(),Io.crossVectors(i,pr)),Io.normalize(),tf.crossVectors(pr,Io),r[0]=Io.x,r[4]=tf.x,r[8]=pr.x,r[1]=Io.y,r[5]=tf.y,r[9]=pr.y,r[2]=Io.z,r[6]=tf.z,r[10]=pr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5
vendor: 4,789 bytes, line 18
18],d=i[9],f=i[13],p=i[2],v=i[6],m=i[10],g=i[14],y=i[3],x=i[7],_=i[11],T=i[15],S=r[0],E=r[4],M=r[8],b=r[12],w=r[1],A=r[5],P=r[9],H=r[13],B=r[2],G=r[6],O=r[10],$=r[14],F=r[3],J=r[7],se=r[11],be=r[15];return s[0]=o*S+a*w+l*B+c*F,s[4]=o*E+a*A+l*G+c*J,s[8]=o*M+a*P+l*O+c*se,s[12]=o*b+a*H+l*$+c*be,s[1]=u*S+h*w+d*B+f*F,s[5]=u*E+h*A+d*G+f*J,s[9]=u*M+h*P+d*O+f*se,s[13]=u*b+h*H+d*$+f*be,s[2]=p*S+v*w+m*B+g*F,s[6]=p*E+v*A+m*G+g*J,s[10]=p*M+v*P+m*O+g*se,s[14]=p*b+v*H+m*$+g*be,s[3]=y*S+x*w+_*B+T*F,s[7]=y*E+x*A+_*G+T*J,s[11]=y*M+x*P+_*O+T*se,s[15]=y*b+x*H+_*$+T*be,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],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],v=e[7],m=e[11],g=e[15];return p*(+s*l*h-r*c*h-s*a*d+i*c*d+r*a*f-i*l*f)+v*(+t*l*f-t*c*d+s*o*d-r*o*f+r*c*u-s*l*u)+m*(+t*c*h-t*a*f-s*o*h+i*o*f+s*a*u-i*c*u)+g*(-r*a*u-t*l*h+t*a*d+r*o*h-i*o*d+i*l*u)}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,i){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]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=h*m*c-v*d*c+v*l*f-a*m*f-h*l*g+a*d*g,x=p*d*c-u*m*c-p*l*f+o*m*f+u*l*g-o*d*g,_=u*v*c-p*h*c+p*a*f-o*v*f-u*a*g+o*h*g,T=p*h*l-u*v*l-p*a*d+o*v*d+u*a*m-o*h*m,S=t*y+i*x+r*_+s*T;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/S;return e[0]=y*E,e[1]=(v*d*s-h*m*s-v*r*f+i*m*f+h*r*g-i*d*g)*E,e[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*g+i*l*g)*E,e[3]=(h*l*s-a*d*s-h*r*c+i*d*c+a*r*f-i*l*f)*E,e[4]=x*E,e[5]=(u*m*s-p*d*s+p*r*f-t*m*f-u*r*g+t*d*g)*E,e[6]=(p*l*s-o*m*s-p*r*c+t*m*c+o*r*g-t*l*g)*E,e[7]=(o*d*s-u*l*s+u*r*c-t*d*c-o*r*f+t*l*f)*E,e[8]=_*E,e[9]=(p*h*s-u*v*s-p*i*f+t*v*f+u*i*g-t*h*g)*E,e[10]=(o*v*s-p*a*s+p*i*c-t*v*c-o*i*g+t*a*g)*E,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*f-t*a*f)*E,e[12]=T*E,e[13]=(u*v*r-p*h*r+p*i*d-t*v*d-u*i*m+t*h*m)*E,e[14]=(p*a*r-o*v*r-p*i*l+t*v*l+o*i*m-t*a*m)*E,e[15]=(o*h*r-u*a*r+u*i*l-t*h*l-o*i*d+t*a*d)*E,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,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],i=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,i,r))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,v=o*u,m=o*h,g=a*h,y=l*c,x=l*u,_=l*h,T=i.x,S=i.y,E=i.z;return r[0]=(1-(v+g))*T,r[1]=(f+_)*T,r[2]=(p-x)*T,r[3]=0,r[4]=(f-_)*S,r[5]=(1-(d+g))*S,r[6]=(m+y)*S,r[7]=0,r[8]=(p+x)*E,r[9]=(m-y)*E,r[10]=(1-(d+v))*E,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Ul.set(r[0],r[1],r[2]).length();const o=Ul.set(r[4],r[5],r[6]).length(),a=Ul.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Gr.copy(this);const c=1/s,u=1/o,h=1/a;return Gr.elements[0]*=c,Gr.elements[1]*=c,Gr.elements[2]*=c,Gr.elements[4]*=u,Gr.elements[5]*=u,Gr.elements[6]*=u,Gr.elements[8]*=h,Gr.elements[9]*=h,Gr.elements[10]*=h,t.setFromRotationMatrix(Gr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Sr,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),f=(i+r)/(i-r);let p,v;if(l)p=s/(o-s),v=o*s/(o-s);else if(a===Sr)p=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Uc)p=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);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]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}
vendor: 27,468 bytes, line 18
18makeOrthographic(e,t,i,r,s,o,a=Sr,l=!1){const c=this.elements,u=2/(t-e),h=2/(i-r),d=-(t+e)/(t-e),f=-(i+r)/(i-r);let p,v;if(l)p=1/(o-s),v=o/(o-s);else if(a===Sr)p=-2/(o-s),v=-(o+s)/(o-s);else if(a===Uc)p=-1/(o-s),v=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);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]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Ul=new z,Gr=new ht,I4=new z(0,0,0),N4=new z(1,1,1),Io=new z,tf=new z,pr=new z,sS=new ht,oS=new ui;class ai{constructor(e=0,t=0,i=0,r=ai.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,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,i,r=this._order){return this._x=e,this._y=t,this._z=i,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,i=!0){const r=e.elements,s=r[0],o=r[4],a=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(yt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-yt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(yt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-yt(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(-o,c));break;case"YZX":this._z=Math.asin(yt(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(a,f));break;case"XZY":this._z=Math.asin(-yt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:je("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return sS.makeRotationFromQuaternion(e),this.setFromRotationMatrix(sS,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return oS.setFromEuler(this),this.setFromQuaternion(oS,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}}ai.DEFAULT_ORDER="XYZ";class md{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 L4=0;const aS=new z,Bl=new ui,Js=new ht,nf=new z,Tu=new z,O4=new z,D4=new ui,lS=new z(1,0,0),cS=new z(0,1,0),uS=new z(0,0,1),hS={type:"added"},k4={type:"removed"},zl={type:"childadded",child:null},Q0={type:"childremoved",child:null};class Dt extends Cr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:L4++}),this.uuid=Tr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Dt.DEFAULT_UP.clone();const e=new z,t=new ai,i=new ui,r=new z(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ht},normalMatrix:{value:new Ct}}),this.matrix=new ht,this.matrixWorld=new ht,this.matrixAutoUpdate=Dt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Dt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new md,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.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Bl.setFromAxisAngle(e,t),this.quaternion.multiply(Bl),this}rotateOnWorldAxis(e,t){return Bl.setFromAxisAngle(e,t),this.quaternion.premultiply(Bl),this}rotateX(e){return this.rotateOnAxis(lS,e)}rotateY(e){return this.rotateOnAxis(cS,e)}rotateZ(e){return this.rotateOnAxis(uS,e)}translateOnAxis(e,t){return aS.copy(e).applyQuaternion(this.quaternion),this.position.add(aS.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(lS,e)}translateY(e){return this.translateOnAxis(cS,e)}translateZ(e){return this.translateOnAxis(uS,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Js.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?nf.copy(e):nf.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Tu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Js.lookAt(Tu,nf,this.up):Js.lookAt(nf,Tu,this.up),this.quaternion.setFromRotationMatrix(Js),r&&(Js.extractRotation(r.matrixWorld),Bl.setFromRotationMatrix(Js),this.quaternion.premultiply(Bl.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(St("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(hS),zl.child=e,this.dispatchEvent(zl),zl.child=null):St("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(k4),Q0.child=e,this.dispatchEvent(Q0),Q0.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),Js.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Js.multiply(e.parent.matrixWorld)),e.applyMatrix4(Js),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(hS),zl.child=e,this.dispatchEvent(zl),zl.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 i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Tu,e,O4),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Tu,D4,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 i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.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 i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.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,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.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),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.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),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(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),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(a,l){return a[l.uuid]===void 0&&(a[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 a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.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 a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),u=o(e.images),h=o(e.shapes),d=o(e.skeletons),f=o(e.animations),p=o(e.nodes);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),p.length>0&&(i.nodes=p)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[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.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}Dt.DEFAULT_UP=new z(0,1,0);Dt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Dt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Wr=new z,Qs=new z,ev=new z,eo=new z,Vl=new z,Hl=new z,dS=new z,tv=new z,nv=new z,iv=new z,rv=new Ft,sv=new Ft,ov=new Ft;class Ei{constructor(e=new z,t=new z,i=new z){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),Wr.subVectors(e,t),r.cross(Wr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Wr.subVectors(r,t),Qs.subVectors(i,t),ev.subVectors(e,t);const o=Wr.dot(Wr),a=Wr.dot(Qs),l=Wr.dot(ev),c=Qs.dot(Qs),u=Qs.dot(ev),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,eo)===null?!1:eo.x>=0&&eo.y>=0&&eo.x+eo.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,eo)===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,eo.x),l.addScaledVector(o,eo.y),l.addScaledVector(a,eo.z),l)}static getInterpolatedAttribute(e,t,i,r,s,o){return rv.setScalar(0),sv.setScalar(0),ov.setScalar(0),rv.fromBufferAttribute(e,t),sv.fromBufferAttribute(e,i),ov.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(rv,s.x),o.addScaledVector(sv,s.y),o.addScaledVector(ov,s.z),o}static isFrontFacing(e,t,i,r){return Wr.subVectors(i,t),Qs.subVectors(e,t),Wr.cross(Qs).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),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 Wr.subVectors(this.c,this.b),Qs.subVectors(this.a,this.b),Wr.cross(Qs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ei.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Ei.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Vl.subVectors(r,i),Hl.subVectors(s,i),tv.subVectors(e,i);const l=Vl.dot(tv),c=Hl.dot(tv);if(l<=0&&c<=0)return t.copy(i);nv.subVectors(e,r);const u=Vl.dot(nv),h=Hl.dot(nv);if(u>=0&&h<=u)return t.copy(r);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Vl,o);iv.subVectors(e,s);const f=Vl.dot(iv),p=Hl.dot(iv);if(p>=0&&f<=p)return t.copy(s);const v=f*c-l*p;if(v<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector(Hl,a);const m=u*p-f*h;if(m<=0&&h-u>=0&&f-p>=0)return dS.subVectors(s,r),a=(h-u)/(h-u+(f-p)),t.copy(r).addScaledVector(dS,a);const g=1/(m+v+d);return o=v*g,a=d*g,t.copy(i).addScaledVector(Vl,o).addScaledVector(Hl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const M3={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},No={h:0,s:0,l:0},rf={h:0,s:0,l:0};function av(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class We{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===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,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Lt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Gt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Gt.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Gt.workingColorSpace){if(e=tb(e,1),t=yt(t,0,1),i=yt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=av(o,s,e+1/3),this.g=av(o,s,e),this.b=av(o,s,e-1/3)}return Gt.colorSpaceToWorking(this,r),this}setStyle(e,t=Lt){function i(s){s!==void 0&&parseFloat(s)<1&&je("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(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(a))return i(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(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:je("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);je("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Lt){const i=M3[e.toLowerCase()];return i!==void 0?this.setHex(i,t):je("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=po(e.r),this.g=po(e.g),this.b=po(e.b),this}copyLinearToSRGB(e){return this.r=Cc(e.r),this.g=Cc(e.g),this.b=Cc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Lt){return Gt.workingToColorSpace(_i.copy(this),e),Math.round(yt(_i.r*255,0,255))*65536+Math.round(yt(_i.g*255,0,255))*256+Math.round(yt(_i.b*255,0,255))}getHexString(e=Lt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Gt.workingColorSpace){Gt.workingToColorSpace(_i.copy(this),t);const i=_i.r,r=_i.g,s=_i.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-i)/h+2;break;case s:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Gt.workingColorSpace){return Gt.workingToColorSpace(_i.copy(this),t),e.r=_i.r,e.g=_i.g,e.b=_i.b,e}getStyle(e=Lt){Gt.workingToColorSpace(_i.copy(this),e);const t=_i.r,i=_i.g,r=_i.b;return e!==Lt?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(No),this.setHSL(No.h+e,No.s+t,No.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(No),e.getHSL(rf);const i=xh(No.h,rf.h,t),r=xh(No.s,rf.s,t),s=xh(No.l,rf.l,t);return this.setHSL(i,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,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+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 _i=new We;We.NAMES=M3;let F4=0;class si extends Cr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:F4++}),this.uuid=Tr(),this.name="",this.type="Material",this.blending=il,this.side=Ns,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Jp,this.blendDst=Qp,this.blendEquation=jo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new We(0,0,0),this.blendAlpha=0,this.depthFunc=pl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=iy,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=za,this.stencilZFail=za,this.stencilZPass=za,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 i=e[t];if(i===void 0){je(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){je(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 9,052 bytes, line 18
18i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==il&&(i.blending=this.blending),this.side!==Ns&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Jp&&(i.blendSrc=this.blendSrc),this.blendDst!==Qp&&(i.blendDst=this.blendDst),this.blendEquation!==jo&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==pl&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==iy&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==za&&(i.stencilFail=this.stencilFail),this.stencilZFail!==za&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==za&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}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 i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 6,341 bytes, line 18
18adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Gs extends si{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new We(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 ai,this.combine=dd,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 ho=U4();function U4(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=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)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function nr(n){Math.abs(n)>65504&&je("DataUtils.toHalfFloat(): Value out of range."),n=yt(n,-65504,65504),ho.floatView[0]=n;const e=ho.uint32View[0],t=e>>23&511;return ho.baseTable[t]+((e&8388607)>>ho.shiftTable[t])}function Zu(n){const e=n>>10;return ho.uint32View[0]=ho.mantissaTable[ho.offsetTable[e]+(n&1023)]+ho.exponentTable[e],ho.floatView[0]}class Ju{static toHalfFloat(e){return nr(e)}static fromHalfFloat(e){return Zu(e)}}const jn=new z,sf=new de;let B4=0;class Jt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:B4++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Fh,this.updateRanges=[],this.gpuType=li,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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)sf.fromBufferAttribute(this,t),sf.applyMatrix3(e),this.setXY(t,sf.x,sf.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)jn.fromBufferAttribute(this,t),jn.applyMatrix3(e),this.setXYZ(t,jn.x,jn.y,jn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)jn.fromBufferAttribute(this,t),jn.applyMatrix4(e),this.setXYZ(t,jn.x,jn.y,jn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)jn.fromBufferAttribute(this,t),jn.applyNormalMatrix(e),this.setXYZ(t,jn.x,jn.y,jn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)jn.fromBufferAttribute(this,t),jn.transformDirection(e),this.setXYZ(t,jn.x,jn.y,jn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=zi(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Pt(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=zi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=zi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Pt(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=zi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Pt(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=zi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array),r=Pt(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array),r=Pt(r,this.array),s=Pt(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}
vendor: 6,537 bytes, line 18
18onUpload(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!==Fh&&(e.usage=this.usage),e}}class z4 extends Jt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class V4 extends Jt{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class H4 extends Jt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class G4 extends Jt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class ib extends Jt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class W4 extends Jt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class rb extends Jt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class $4 extends Jt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=Zu(this.array[e*this.itemSize]);return this.normalized&&(t=zi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize]=nr(t),this}getY(e){let t=Zu(this.array[e*this.itemSize+1]);return this.normalized&&(t=zi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+1]=nr(t),this}getZ(e){let t=Zu(this.array[e*this.itemSize+2]);return this.normalized&&(t=zi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+2]=nr(t),this}getW(e){let t=Zu(this.array[e*this.itemSize+3]);return this.normalized&&(t=zi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+3]=nr(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array)),this.array[e+0]=nr(t),this.array[e+1]=nr(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array),r=Pt(r,this.array)),this.array[e+0]=nr(t),this.array[e+1]=nr(i),this.array[e+2]=nr(r),this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array),r=Pt(r,this.array),s=Pt(s,this.array)),this.array[e+0]=nr(t),this.array[e+1]=nr(i),this.array[e+2]=nr(r),this.array[e+3]=nr(s),this}}class it extends Jt{constructor(e,t,i){super(new Float32Array(e),t,i)}}let j4=0;const Pr=new ht,lv=new Dt,Gl=new z,mr=new Ai,Eu=new Ai,oi=new z;class At extends Cr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:j4++}),this.uuid=Tr(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(b3(e)?rb:ib)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,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}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}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 i=this.attributes.normal;if(i!==void 0){const s=new Ct().getNormalMatrix(e);i.applyNormalMatrix(s),i.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 Pr.makeRotationFromQuaternion(e),this.applyMatrix4(Pr),this}rotateX(e){return Pr.makeRotationX(e),this.applyMatrix4(Pr),this}rotateY(e){return Pr.makeRotationY(e),this.applyMatrix4(Pr),this}rotateZ(e){return Pr.makeRotationZ(e),this.applyMatrix4(Pr),this}translate(e,t,i){return Pr.makeTranslation(e,t,i),this.applyMatrix4(Pr),this}scale(e,t,i){return Pr.makeScale(e,t,i),this.applyMatrix4(Pr),this}lookAt(e){return lv.lookAt(e),lv.updateMatrix(),this.applyMatrix4(lv.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gl).negate(),this.translate(Gl.x,Gl.y,Gl.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new it(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&je("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 Ai);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){St("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new z(-1/0,-1/0,-1/0),new z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];mr.setFromBufferAttribute(s),this.morphTargetsRelative?(oi.addVectors(this.boundingBox.min,mr.min),this.boundingBox.expandByPoint(oi),oi.addVectors(this.boundingBox.max,mr.max),this.boundingBox.expandByPoint(oi)):(this.boundingBox.expandByPoint(mr.min),this.boundingBox.expandByPoint(mr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&St('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 hi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){St("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new z,1/0);return}if(e){const i=this.boundingSphere.center;if(mr.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];Eu.setFromBufferAttribute(a),this.morphTargetsRelative?(oi.addVectors(mr.min,Eu.min),mr.expandByPoint(oi),oi.addVectors(mr.max,Eu.max),mr.expandByPoint(oi)):(mr.expandByPoint(Eu.min),mr.expandByPoint(Eu.max))}mr.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;
vendor: 19,856 bytes, lines 18-22
18s++)oi.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(oi));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)oi.fromBufferAttribute(a,c),l&&(Gl.fromBufferAttribute(e,c),oi.add(Gl)),r=Math.max(r,i.distanceToSquared(oi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&St('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){St("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Jt(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let M=0;M<i.count;M++)a[M]=new z,l[M]=new z;const c=new z,u=new z,h=new z,d=new de,f=new de,p=new de,v=new z,m=new z;function g(M,b,w){c.fromBufferAttribute(i,M),u.fromBufferAttribute(i,b),h.fromBufferAttribute(i,w),d.fromBufferAttribute(s,M),f.fromBufferAttribute(s,b),p.fromBufferAttribute(s,w),u.sub(c),h.sub(c),f.sub(d),p.sub(d);const A=1/(f.x*p.y-p.x*f.y);isFinite(A)&&(v.copy(u).multiplyScalar(p.y).addScaledVector(h,-f.y).multiplyScalar(A),m.copy(h).multiplyScalar(f.x).addScaledVector(u,-p.x).multiplyScalar(A),a[M].add(v),a[b].add(v),a[w].add(v),l[M].add(m),l[b].add(m),l[w].add(m))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let M=0,b=y.length;M<b;++M){const w=y[M],A=w.start,P=w.count;for(let H=A,B=A+P;H<B;H+=3)g(e.getX(H+0),e.getX(H+1),e.getX(H+2))}const x=new z,_=new z,T=new z,S=new z;function E(M){T.fromBufferAttribute(r,M),S.copy(T);const b=a[M];x.copy(b),x.sub(T.multiplyScalar(T.dot(b))).normalize(),_.crossVectors(S,b);const A=_.dot(l[M])<0?-1:1;o.setXYZW(M,x.x,x.y,x.z,A)}for(let M=0,b=y.length;M<b;++M){const w=y[M],A=w.start,P=w.count;for(let H=A,B=A+P;H<B;H+=3)E(e.getX(H+0)),E(e.getX(H+1)),E(e.getX(H+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Jt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let d=0,f=i.count;d<f;d++)i.setXYZ(d,0,0,0);const r=new z,s=new z,o=new z,a=new z,l=new z,c=new z,u=new z,h=new z;if(e)for(let d=0,f=e.count;d<f;d+=3){const p=e.getX(d+0),v=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,p),s.fromBufferAttribute(t,v),o.fromBufferAttribute(t,m),u.subVectors(o,s),h.subVectors(r,s),u.cross(h),a.fromBufferAttribute(i,p),l.fromBufferAttribute(i,v),c.fromBufferAttribute(i,m),a.add(u),l.add(u),c.add(u),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(v,l.x,l.y,l.z),i.setXYZ(m,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),o.fromBufferAttribute(t,d+2),u.subVectors(o,s),h.subVectors(r,s),u.cross(h),i.setXYZ(d+0,u.x,u.y,u.z),i.setXYZ(d+1,u.x,u.y,u.z),i.setXYZ(d+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)oi.fromBufferAttribute(e,t),oi.normalize(),e.setXYZ(t,oi.x,oi.y,oi.z)}toNonIndexed(){function e(a,l){const c=a.array,u=a.itemSize,h=a.normalized,d=new c.constructor(l.length*u);let f=0,p=0;for(let v=0,m=l.length;v<m;v++){a.isInterleavedBufferAttribute?f=l[v]*a.data.stride+a.offset:f=l[v]*u;for(let g=0;g<u;g++)d[p++]=c[f++]}return new Jt(d,u,h)}if(this.index===null)return je("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new At,i=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,i);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let u=0,h=c.length;u<h;u++){const d=c[u],f=e(d,i);l.push(f)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];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 i=this.attributes;for(const l in i){const c=i[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 o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.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 i=e.index;i!==null&&this.setIndex(i.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 o=e.groups;for(let c=0,u=o.length;c<u;c++){const h=o[c];this.addGroup(h.start,h.count,h.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.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"})}}const fS=new ht,Sa=new Ds,of=new hi,pS=new z,af=new z,lf=new z,cf=new z,cv=new z,uf=new z,mS=new z,hf=new z;class an extends Dt{constructor(e=new At,t=new Gs){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,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){uf.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=a[l],h=s[l];u!==0&&(cv.fromBufferAttribute(h,e),o?uf.addScaledVector(cv,u):uf.addScaledVector(cv.sub(t),u))}t.add(uf)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),of.copy(i.boundingSphere),of.applyMatrix4(s),Sa.copy(e.ray).recast(e.near),!(of.containsPoint(Sa.origin)===!1&&(Sa.intersectSphere(of,pS)===null||Sa.origin.distanceToSquared(pS)>(e.far-e.near)**2))&&(fS.copy(s).invert(),Sa.copy(e.ray).applyMatrix4(fS),!(i.boundingBox!==null&&Sa.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Sa)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=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(a!==null)if(Array.isArray(o))for(let p=0,v=d.length;p<v;p++){const m=d[p],g=o[m.materialIndex],y=Math.max(m.start,f.start),x=Math.min(a.count,Math.min(m.start+m.count,f.start+f.count));for(let _=y,T=x;_<T;_+=3){const S=a.getX(_),E=a.getX(_+1),M=a.getX(_+2);r=df(this,g,e,i,c,u,h,S,E,M),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=m.materialIndex,t.push(r))}}else{const p=Math.max(0,f.start),v=Math.min(a.count,f.start+f.count);for(let m=p,g=v;m<g;m+=3){const y=a.getX(m),x=a.getX(m+1),_=a.getX(m+2);r=df(this,o,e,i,c,u,h,y,x,_),r&&(r.faceIndex=Math.floor(m/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let p=0,v=d.length;p<v;p++){const m=d[p],g=o[m.materialIndex],y=Math.max(m.start,f.start),x=Math.min(l.count,Math.min(m.start+m.count,f.start+f.count));for(let _=y,T=x;_<T;_+=3){const S=_,E=_+1,M=_+2;r=df(this,g,e,i,c,u,h,S,E,M),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=m.materialIndex,t.push(r))}}else{const p=Math.max(0,f.start),v=Math.min(l.count,f.start+f.count);for(let m=p,g=v;m<g;m+=3){const y=m,x=m+1,_=m+2;r=df(this,o,e,i,c,u,h,y,x,_),r&&(r.faceIndex=Math.floor(m/3),t.push(r))}}}}function q4(n,e,t,i,r,s,o,a){let l;if(e.side===Xn?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,e.side===Ns,a),l===null)return null;hf.copy(a),hf.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(hf);return c<t.near||c>t.far?null:{distance:c,point:hf.clone(),object:n}}function df(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,af),n.getVertexPosition(l,lf),n.getVertexPosition(c,cf);const u=q4(n,e,t,i,af,lf,cf,mS);if(u){const h=new z;Ei.getBarycoord(mS,af,lf,cf,h),r&&(u.uv=Ei.getInterpolatedAttribute(r,a,l,c,h,new de)),s&&(u.uv1=Ei.getInterpolatedAttribute(s,a,l,c,h,new de)),o&&(u.normal=Ei.getInterpolatedAttribute(o,a,l,c,h,new z),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new z,materialIndex:0};Ei.getNormal(af,lf,cf,d.normal),u.face=d,u.barycoord=h}return u}class da extends At{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,f=0;p("z","y","x",-1,-1,i,t,e,o,s,0),p("z","y","x",1,-1,i,t,-e,o,s,1),p("x","z","y",1,1,e,i,t,r,o,2),p("x","z","y",1,-1,e,i,-t,r,o,3),p("x","y","z",1,-1,e,t,i,r,s,4),p("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new it(c,3)),this.setAttribute("normal",new it(u,3)),this.setAttribute("uv",new it(h,2));function p(v,m,g,y,x,_,T,S,E,M,b){const w=_/E,A=T/M,P=_/2,H=T/2,B=S/2,G=E+1,O=M+1;let $=0,F=0;const J=new z;for(let se=0;se<O;se++){const be=se*A-H;for(let Fe=0;Fe<G;Fe++){const Le=Fe*w-P;J[v]=Le*y,J[m]=be*x,J[g]=B,c.push(J.x,J.y,J.z),J[v]=0,J[m]=0,J[g]=S>0?1:-1,u.push(J.x,J.y,J.z),h.push(Fe/E),h.push(1-se/M),$+=1}}for(let se=0;se<M;se++)for(let be=0;be<E;be++){const Fe=d+be+G*se,Le=d+be+G*(se+1),Ge=d+(be+1)+G*(se+1),ze=d+(be+1)+G*se;l.push(Fe,Le,ze),l.push(Le,Ge,ze),F+=6}a.addGroup(f,F,b),f+=F,d+=$}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new da(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Vc(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(je("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function Di(n){const e={};for(let t=0;t<n.length;t++){const i=Vc(n[t]);for(const r in i)e[r]=i[r]}return e}function X4(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function T3(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Gt.workingColorSpace}const Og={clone:Vc,merge:Di};var Y4=`void main() {
19	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
20}`,K4=`void main() {
21	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
22}`;class pn extends si{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Y4,this.fragmentShader=K4,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=Vc(e.uniforms),this.uniformsGroups=X4(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}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}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 i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Dg extends Dt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ht,this.projectionMatrix=new ht,this.projectionMatrixInverse=new ht,this.coordinateSystem=Sr,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.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Lo=new z,gS=new de,vS=new de;class xn extends Dg{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,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=zc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(rl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return zc*2*Math.atan(Math.tan(rl*.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,i){Lo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Lo.x,Lo.y).multiplyScalar(-e/Lo.z),Lo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Lo.x,Lo.y).multiplyScalar(-e/Lo.z)}getViewSize(e,t){return this.getViewBounds(e,gS,vS),t.subVectors(vS,gS)}setViewOffset(e,t,i,r,s,o){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=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(rl*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,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}}const Wl=-90,$l=1;class sb extends Dt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new xn(Wl,$l,e,t);r.layers=this.layers,this.add(r);const s=new xn(Wl,$l,e,t);s.layers=this.layers,this.add(s);const o=new xn(Wl,$l,e,t);o.layers=this.layers,this.add(o);const a=new xn(Wl,$l,e,t);a.layers=this.layers,this.add(a);const l=new xn(Wl,$l,e,t);l.layers=this.layers,this.add(l);const c=new xn(Wl,$l,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Sr)i.up.set(0,1,0),i.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),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Uc)i.up.set(0,-1,0),i.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),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.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:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=v,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class gd extends Sn{constructor(e=[],t=Ls,i,r,s,o,a,l,c,u){super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ob extends En{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new gd(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 4,580 bytes, lines 22-57
22=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`
23
24				varying vec3 vWorldDirection;
25
26				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
27
28					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
29
30				}
31
32				void main() {
33
34					vWorldDirection = transformDirection( position, modelMatrix );
35
36					#include <begin_vertex>
37					#include <project_vertex>
38
39				}
40			`,fragmentShader:`
41
42				uniform sampler2D tEquirect;
43
44				varying vec3 vWorldDirection;
45
46				#include <common>
47
48				void main() {
49
50					vec3 direction = normalize( vWorldDirection );
51
52					vec2 sampleUV = equirectUv( direction );
53
54					gl_FragColor = texture2D( tEquirect, sampleUV );
55
56				}
57			`},r=new da(5,5,5),s=new pn({name:"CubemapFromEquirect",uniforms:Vc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Xn,blending:Hn});s.uniforms.tEquirect.value=t;const o=new an(r,s),a=t.minFilter;return t.minFilter===es&&(t.minFilter=dn),new sb(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,r=!0){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}class xc extends Dt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Z4={type:"move"};class Ap{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new xc,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 xc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new xc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new z),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 i of e.hand.values())this._getHandJoint(t,i)}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,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const v of e.hand.values()){const m=t.getJointPose(v,i),g=this._getHandJoint(c,v);m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=m.radius),g.visible=m!==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,i),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));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Z4)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new xc;
vendor: 13,569 bytes, line 57
57i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class kg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new We(e),this.density=t}clone(){return new kg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Fg{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new We(e),this.near=t,this.far=i}clone(){return new Fg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class vl extends Dt{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 ai,this.environmentIntensity=1,this.environmentRotation=new ai,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class vd{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fh,this.updateRanges=[],this.version=0,this.uuid=Tr()}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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+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=Tr()),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]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}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=Tr()),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 Ni=new z;class bo{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,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,i=this.data.count;t<i;t++)Ni.fromBufferAttribute(this,t),Ni.applyMatrix4(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Ni.fromBufferAttribute(this,t),Ni.applyNormalMatrix(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Ni.fromBufferAttribute(this,t),Ni.transformDirection(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=zi(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Pt(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Pt(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=zi(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=zi(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=zi(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=zi(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array),r=Pt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pt(t,this.array),i=Pt(i,this.array),r=Pt(r,this.array),s=Pt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){Bh("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Jt(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 bo(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){Bh("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*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}}}class ab extends si{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new We(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 jl;const Au=new z,ql=new z,Xl=new z,Yl=new de,Cu=new de,E3=new ht,ff=new z,Ru=new z,pf=new z,xS=new de,uv=new de,yS=new de;let A3=class extends Dt{constructor(e=new ab){if(super(),this.isSprite=!0,this.type="Sprite",jl===void 0){jl=new At;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new vd(t,5);jl.setIndex([0,1,2,0,2,3]),jl.setAttribute("position",new bo(i,3,0,!1)),jl.setAttribute("uv",new bo(i,2,3,!1))}this.geometry=jl,this.material=e,this.center=new de(.5,.5),this.count=1}raycast(e,t){e.camera===null&&St('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ql.setFromMatrixScale(this.matrixWorld),E3.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Xl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&ql.multiplyScalar(-Xl.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;mf(ff.set(-.5,-.5,0),Xl,o,ql,r,s),mf(Ru.set(.5,-.5,0),Xl,o,ql,r,s),mf(pf.set(.5,.5,0),Xl,o,ql,r,s),xS.set(0,0),uv.set(1,0),yS.set(1,1);let a=e.ray.intersectTriangle(ff,Ru,pf,!1,Au);if(a===null&&(mf(Ru.set(-.5,.5,0),Xl,o,ql,r,s),uv.set(0,1),a=e.ray.intersectTriangle(ff,pf,Ru,!1,Au),a===null))return;const l=e.ray.origin.distanceTo(Au);l<e.near||l>e.far||t.push({distance:l,point:Au.clone(),uv:Ei.getInterpolation(Au,ff,Ru,pf,xS,uv,yS,new de),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 mf(n,e,t,i,r,s){Yl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Cu.x=s*Yl.x-r*Yl.y,Cu.y=r*Yl.x+s*Yl.y):Cu.copy(Yl),n.copy(e),n.x+=Cu.x,n.y+=Cu.y,n.applyMatrix4(E3)}const gf=new z,_S=new z;class C3 extends Dt{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 i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=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:i,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){const r=t.splice(i,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 i,r;for(i=1,r=t.length;i<r;i++){let s=t[i].distance;if(t[i].object.visible&&(s-=s*t[i].hysteresis),e<s)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){gf.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(gf);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){gf.setFromMatrixPosition(e.matrixWorld),_S.setFromMatrixPosition(this.matrixWorld);const i=gf.distanceTo(_S)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let o=t[r].distance;if(t[r].object.visible&&(o-=o*t[r].hysteresis),i>=o)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 i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const bS=new z,wS=new Ft,SS=new Ft,J4=new z,MS=new ht,vf=new z,hv=new hi,TS=new ht,dv=new Ds;class R3 extends an{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=ny,this.bindMatrix=new ht,this.bindMatrixInverse=new ht,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ai),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,vf),this.boundingBox.expandByPoint(vf)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new hi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,vf),this.boundingSphere.expandByPoint(vf)}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 i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),hv.copy(this.boundingSphere),hv.applyMatrix4(r),e.ray.intersectsSphere(hv)!==!1&&(TS.copy(r).invert(),dv.copy(e.ray).applyMatrix4(TS),!(this.boundingBox!==null&&dv.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,dv)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ft,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===ny?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===l3?this.bindMatrixInverse.copy(this.bindMatrix).invert():je("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}
vendor: 9,283 bytes, line 57
57applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;wS.fromBufferAttribute(r.attributes.skinIndex,e),SS.fromBufferAttribute(r.attributes.skinWeight,e),bS.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=SS.getComponent(s);if(o!==0){const a=wS.getComponent(s);MS.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(J4.copy(bS).applyMatrix4(MS),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class lb extends Dt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class is extends Sn{constructor(e=null,t=1,i=1,r,s,o,a,l,c=on,u=on,h,d){super(null,o,a,l,c,u,r,s,h,d),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ES=new ht,Q4=new ht;class Ug{constructor(e=[],t=[]){this.uuid=Tr(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){je("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new ht)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new ht;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:Q4;ES.multiplyMatrices(a,t[s]),ES.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Ug(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 i=new is(t,e,e,Wi,li);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;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 i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(je("Skeleton: No bone found with UUID:",s),o=new lb),this.bones.push(o),this.boneInverses.push(new ht().fromArray(e.boneInverses[i]))}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,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const a=i[r];e.boneInverses.push(a.toArray())}return e}}class Hc extends Jt{constructor(e,t,i,r=1){super(e,t,i),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 Kl=new ht,AS=new ht,xf=[],CS=new Ai,e5=new ht,Pu=new an,Iu=new hi;class P3 extends an{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Hc(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,e5)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ai),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Kl),CS.copy(e.boundingBox).applyMatrix4(Kl),this.boundingBox.union(CS)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new hi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Kl),Iu.copy(e.boundingSphere).applyMatrix4(Kl),this.boundingSphere.union(Iu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,s=i.length+1,o=e*s+1;for(let a=0;a<i.length;a++)i[a]=r[o+a]}raycast(e,t){const i=this.matrixWorld,r=this.count;if(Pu.geometry=this.geometry,Pu.material=this.material,Pu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Iu.copy(this.boundingSphere),Iu.applyMatrix4(i),e.ray.intersectsSphere(Iu)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,Kl),AS.multiplyMatrices(i,Kl),Pu.matrixWorld=AS,Pu.raycast(e,xf);for(let o=0,a=xf.length;o<a;o++){const l=xf[o];l.instanceId=s,l.object=this,t.push(l)}xf.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Hc(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new is(new Float32Array(r*this.count),r,this.count,Ag,li));const s=this.morphTexture.source.data.data;let o=0;for(let c=0;c<i.length;c++)o+=i[c];const a=this.geometry.morphTargetsRelative?1:1-o,l=r*e;s[l]=a,s.set(i,l+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const fv=new z,t5=new z,n5=new Ct;class sr{constructor(e=new z(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,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=fv.subVectors(i,t).cross(t5.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){const i=e.delta(fv),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<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 i=t||n5.getNormalMatrix(e),r=this.coplanarPoint(fv).applyMatrix4(e),s=this.normal.applyMatrix3(i).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 Ma=new hi,i5=new de(.5,.5),yf=new z;class ru{constructor(e=new sr,t=new sr,i=new sr,r=new sr,s=new sr,o=new sr){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Sr,i=!1){const r=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],h=s[5],d=s[6],f=s[7],p=s[8],v=s[9],m=s[10],g=s[11],y=s[12],x=s[13],_=s[14],T=s[15];if(r[0].setComponents(c-o,f-u,g-p,T-y).normalize(),r[1].setComponents(c+o,f+u,g+p,T+y).normalize(),r[2].setComponents(c+a,f+h,g+v,T+x).normalize(),r[3].setComponents(c-a,f-h,g-v,T-x).normalize(),i)r[4].setComponents(l,d,m,_).normalize(),r[5].setComponents(c-l,f-d,g-m,T-_).normalize();else if(r[4].setComponents(c-l,f-d,g-m,T-_).normalize(),t===Sr)r[5].setComponents(c+l,f+d,g+m,T+_).normalize();else if(t===Uc)r[5].setComponents(l,d,m,_).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(),Ma.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;
vendor: 4,883 bytes, line 57
57t.boundingSphere===null&&t.computeBoundingSphere(),Ma.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ma)}intersectsSprite(e){Ma.center.set(0,0,0);const t=i5.distanceTo(e.center);return Ma.radius=.7071067811865476+t,Ma.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ma)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(yf.x=r.normal.x>0?e.max.x:e.min.x,yf.y=r.normal.y>0?e.max.y:e.min.y,yf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(yf)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const ds=new ht,fs=new ru;class Bg{constructor(){this.coordinateSystem=Sr}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(ds.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),fs.setFromProjectionMatrix(ds,r.coordinateSystem,r.reversedDepth),fs.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(ds.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),fs.setFromProjectionMatrix(ds,r.coordinateSystem,r.reversedDepth),fs.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(ds.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),fs.setFromProjectionMatrix(ds,r.coordinateSystem,r.reversedDepth),fs.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(ds.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),fs.setFromProjectionMatrix(ds,r.coordinateSystem,r.reversedDepth),fs.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(ds.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),fs.setFromProjectionMatrix(ds,r.coordinateSystem,r.reversedDepth),fs.containsPoint(e))return!0}return!1}clone(){return new Bg}}function pv(n,e){return n-e}function r5(n,e){return n.z-e.z}function s5(n,e){return e.z-n.z}class o5{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,r){const s=this.pool,o=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const a=s[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=r}reset(){this.list.length=0,this.index=0}}const Ji=new ht,a5=new We(1,1,1),RS=new ru,l5=new Bg,_f=new Ai,Ta=new hi,Nu=new z,PS=new z,c5=new z,mv=new o5,bi=new an,bf=[];function u5(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s<r;s++)for(let o=0;o<i;o++)e.setComponent(s+t,o,n.getComponent(s,o))}else e.array.set(n.array,t*i);e.needsUpdate=!0}function Ea(n,e){if(n.constructor!==e.constructor){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)e[i]=n[i]}else{const t=Math.min(n.length,e.length);e.set(new n.constructor(n.buffer,0,t))}}class I3 extends an{constructor(e,t,i=t*2,r){super(new At,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=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,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),i=new is(t,e,e,Wi,li);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),i=new is(t,e,e,fd,Os);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),i=new is(t,e,e,Wi,li);
57i.colorSpace=Gt.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const t=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const o=e.getAttribute(s),{array:a,itemSize:l,normalized:c}=o,u=new a.constructor(i*l),h=new Jt(u,l,c);t.setAttribute(s,h)}if(e.getIndex()!==null){const s=i>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Jt(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 i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);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 Ai);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const s=t[i].geometryIndex;this.getMatrixAt(i,Ji),this.getBoundingBoxAt(s,_f).applyMatrix4(Ji),e.union(_f)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new hi);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const s=t[i].geometryIndex;this.getMatrixAt(i,Ji),this.getBoundingSphereAt(s,Ta).applyMatrix4(Ji),e.union(Ta)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(pv),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const s=this._matricesTexture;Ji.identity().toArray(s.image.data,r*16),s.needsUpdate=!0;const o=this._colorsTexture;return o&&(a5.toArray(o.image.data,r*4),o.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,i=-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 o=e.getIndex();if(o!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?o.count:i),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(pv),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 i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(r&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const h=t.getAttribute(u),d=i.getAttribute(u);u5(h,d,l);const f=h.itemSize;
57for(let p=h.count,v=c;p<v;p++){const m=l+p;for(let g=0;g<f;g++)d.setComponent(m,g,0)}d.needsUpdate=!0,d.addUpdateRange(l*f,c*f)}if(r){const u=a.indexStart,h=a.reservedIndexCount;a.indexCount=t.getIndex().count;for(let d=0;d<o.count;d++)s.setX(u+d,l+o.getX(d));for(let d=o.count,f=h;d<f;d++)s.setX(u+d,l);s.needsUpdate=!0,s.addUpdateRange(u,a.reservedIndexCount)}return a.start=r?a.indexStart:a.vertexStart,a.count=r?a.indexCount:a.vertexCount,a.boundingBox=null,t.boundingBox!==null&&(a.boundingBox=t.boundingBox.clone()),a.boundingSphere=null,t.boundingSphere!==null&&(a.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 i=this._instanceInfo;for(let r=0,s=i.length;r<s;r++)i[r].active&&i[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 i=this._geometryInfo,r=i.map((o,a)=>a).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),s=this.geometry;for(let o=0,a=i.length;o<a;o++){const l=r[o],c=i[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,v=e-h;for(let m=u;m<u+d;m++)p[m]=p[m]+v;f.array.copyWithin(t,u,u+d),f.addUpdateRange(t,d),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:v,itemSize:m}=p;v.copyWithin(e*m,u*m,(u+h)*m),p.addUpdateRange(e*m,h*m)}c.vertexStart=e}e+=c.reservedVertexCount,c.start=s.index?c.indexStart:c.vertexStart,this._nextIndexStart=s.index?c.indexStart+c.reservedIndexCount:0,this._nextVertexStart=c.vertexStart+c.reservedVertexCount}}return this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const s=new Ai,o=i.index,a=i.attributes.position;for(let l=r.start,c=r.start+r.count;l<c;l++){let u=l;o&&(u=o.getX(u)),s.expandByPoint(Nu.fromBufferAttribute(a,u))}r.boundingBox=s}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const s=new hi;this.getBoundingBoxAt(e,_f),_f.getCenter(s.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=r.start,u=r.start+r.count;c<u;c++){let h=c;o&&(h=o.getX(h)),Nu.fromBufferAttribute(a,h),l=Math.max(l,s.center.distanceToSquared(Nu))}s.radius=Math.sqrt(l),r.boundingSphere=s}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const i=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),i.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),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 i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){const t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(pv);t[t.length-1]===i.length-1;)i.pop(),t.pop();if(e<i.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);Ea(this._multiDrawCounts,r),Ea(this._multiDrawStarts,s),this._multiDrawCounts=r,this._multiDrawStarts=s,this._maxInstanceCount=e;const o=this._indirectTexture,a=this._matricesTexture,l=this._colorsTexture;o.dispose(),this._initIndirectTexture(),Ea(o.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),Ea(a.image.data,this._matricesTexture.image.data),l&&(l.dis
57pose(),this._initColorsTexture(),Ea(l.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const i=[...this._geometryInfo].filter(a=>a.active);if(Math.max(...i.map(a=>a.vertexStart+a.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(...i.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 At,this._initializeGeometry(s));const o=this.geometry;s.index&&Ea(s.index.array,o.index.array);for(const a in s.attributes)Ea(s.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,o=this.geometry;bi.material=this.material,bi.geometry.index=o.index,bi.geometry.attributes=o.attributes,bi.geometry.boundingBox===null&&(bi.geometry.boundingBox=new Ai),bi.geometry.boundingSphere===null&&(bi.geometry.boundingSphere=new hi);for(let a=0,l=i.length;a<l;a++){if(!i[a].visible||!i[a].active)continue;const c=i[a].geometryIndex,u=r[c];bi.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(a,bi.matrixWorld).premultiply(s),this.getBoundingBoxAt(c,bi.geometry.boundingBox),this.getBoundingSphereAt(c,bi.geometry.boundingSphere),bi.raycast(e,bf);for(let h=0,d=bf.length;h<d;h++){const f=bf[h];f.object=this,f.batchId=a,t.push(f)}bf.length=0}bi.material=null,bi.geometry.index=null,bi.geometry.attributes={},bi.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,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._geometryInfo,d=this.perObjectFrustumCulled,f=this._indirectTexture,p=f.image.data,v=i.isArrayCamera?l5:RS;d&&!i.isArrayCamera&&(Ji.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),RS.setFromProjectionMatrix(Ji,i.coordinateSystem,i.reversedDepth));let m=0;if(this.sortObjects){Ji.copy(this.matrixWorld).invert(),Nu.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Ji),PS.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Ji);for(let x=0,_=l.length;x<_;x++)if(l[x].visible&&l[x].active){const T=l[x].geometryIndex;
57this.getMatrixAt(x,Ji),this.getBoundingSphereAt(T,Ta).applyMatrix4(Ji);let S=!1;if(d&&(S=!v.intersectsSphere(Ta,i)),!S){const E=h[T],M=c5.subVectors(Ta.center,Nu).dot(PS);mv.push(E.start,E.count,M,x)}}const g=mv.list,y=this.customSort;y===null?g.sort(s.transparent?s5:r5):y.call(this,g,i);for(let x=0,_=g.length;x<_;x++){const T=g[x];c[m]=T.start*a,u[m]=T.count,p[m]=T.index,m++}mv.reset()}else for(let g=0,y=l.length;g<y;g++)if(l[g].visible&&l[g].active){const x=l[g].geometryIndex;let _=!1;if(d&&(this.getMatrixAt(g,Ji),this.getBoundingSphereAt(x,Ta).applyMatrix4(Ji),_=!v.intersectsSphere(Ta,i)),!_){const T=h[x];c[m]=T.start*a,u[m]=T.count,p[m]=g,m++}}f.needsUpdate=!0,this._multiDrawCount=m,this._visibilityChanged=!1}onBeforeShadow(e,t,i,r,s,o){this.onBeforeRender(e,null,r,s,o)}}class Xi extends si{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new We(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 Dm=new z,km=new z,IS=new ht,Lu=new Ds,wf=new hi,gv=new z,NS=new z;class na extends Dt{constructor(e=new At,t=new Xi){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,i=[0];for(let r=1,s=t.count;r<s;r++)Dm.fromBufferAttribute(t,r-1),km.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Dm.distanceTo(km);e.setAttribute("lineDistance",new it(i,1))}else je("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),wf.copy(i.boundingSphere),wf.applyMatrix4(r),wf.radius+=s,e.ray.intersectsSphere(wf)===!1)return;IS.copy(r).invert(),Lu.copy(e.ray).applyMatrix4(IS);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,u=i.index,d=i.attributes.position;if(u!==null){const f=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let v=f,m=p-1;v<m;v+=c){const g=u.getX(v),y=u.getX(v+1),x=Sf(this,e,Lu,l,g,y,v);x&&t.push(x)}if(this.isLineLoop){const v=u.getX(p-1),m=u.getX(f),g=Sf(this,e,Lu,l,v,m,p-1);g&&t.push(g)}}else{const f=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let v=f,m=p-1;v<m;v+=c){const g=Sf(this,e,Lu,l,v,v+1,v);g&&t.push(g)}if(this.isLineLoop){const v=Sf(this,e,Lu,l,p-1,f,p-1);v&&t.push(v)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function Sf(n,e,t,i,r,s,o){const a=n.geometry.attributes.position;if(Dm.fromBufferAttribute(a,r),km.fromBufferAttribute(a,s),t.distanceSqToSegment(Dm,km,gv,NS)>i)return;gv.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(gv);if(!(c<e.near||c>e.far))return{distance:c,point:NS.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const LS=new z,OS=new z;class Ws extends na{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,i=[];for(let r=0,s=t.count;r<s;r+=2)LS.fromBufferAttribute(t,r),OS.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+LS.distanceTo(OS);e.setAttribute("lineDistance",new it(i,1))}else je("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class N3 extends na{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class cb extends si{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new We(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 DS=new ht,sy=new Ds,Mf=new hi,Tf=new z;class L3 extends Dt{constructor(e=new At,t=new cb){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 i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Mf.copy(i.boundingSphere),Mf.applyMatrix4(r),Mf.radius+=s,e.ray.intersectsSphere(Mf)===!1)return;
57DS.copy(r).invert(),sy.copy(e.ray).applyMatrix4(DS);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=i.index,h=i.attributes.position;if(c!==null){const d=Math.max(0,o.start),f=Math.min(c.count,o.start+o.count);for(let p=d,v=f;p<v;p++){const m=c.getX(p);Tf.fromBufferAttribute(h,m),kS(Tf,m,l,r,e,t,this)}}else{const d=Math.max(0,o.start),f=Math.min(h.count,o.start+o.count);for(let p=d,v=f;p<v;p++)Tf.fromBufferAttribute(h,p),kS(Tf,p,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function kS(n,e,t,i,r,s,o){const a=sy.distanceSqToPoint(n);if(a<t){const l=new z;sy.closestPointToPoint(n,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class O3 extends Sn{constructor(e,t,i,r,s=dn,o=dn,a,l,c){super(e,t,i,r,s,o,a,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 h5 extends O3{constructor(e,t,i,r,s,o,a,l){super({},e,t,i,r,s,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class d5 extends Sn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=on,this.minFilter=on,this.generateMipmaps=!1,this.needsUpdate=!0}}class zg extends Sn{constructor(e,t,i,r,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,r,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class f5 extends zg{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=lr,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class p5 extends zg{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Ls),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class m5 extends Sn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Vg extends Sn{constructor(e,t,i=Os,r,s,o,a=on,l=on,c,u=Fc,h=1){if(u!==Fc&&u!==gl)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,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new qo(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 ub extends Sn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Hg extends At{constructor(e=1,t=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r,heightSegments:s},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const o=[],a=[],l=[],c=[],u=t/2,h=Math.PI/2*e,d=t,f=2*h+d,p=i*2+s,v=r+1,m=new z,g=new z;for(let y=0;y<=p;y++){let x=0,_=0,T=0,S=0;if(y<=i){const b=y/i,w=b*Math.PI/2;_=-u-e*Math.cos(w),T=e*Math.sin(w),S=-e*Math.cos(w),x=b*h}else if(y<=i+s){const b=(y-i)/s;_=-u+b*t,T=e,S=0,x=h+b*d}else{const b=(y-i-s)/i,w=b*Math.PI/2;_=u+e*Math.sin(w),T=e*Math.cos(w),S=e*Math.sin(w),x=h+d+b*h}const E=Math.max(0,Math.min(1,x/f));let M=0;y===0?M=.5/r:y===p&&(M=-.5/r);for(let b=0;b<=r;b++){const w=b/r,A=w*Math.PI*2,P=Math.sin(A),H=Math.cos(A);g.x=-T*H,g.y=_,g.z=T*P,a.push(g.x,g.y,g.z),m.set(-T*H,S,T*P),m.normalize(),l.push(m.x,m.y,m.z),c.push(w+M,E)}if(y>0){const b=(y-1)*v;for(let w=0;w<r;w++){const A=b+w,P=b+w+1,H=y*v+w,B=y*v+w+1;o.push(A,P,H),o.push(P,B,H)}}}this.setIndex(o),this.setAttribute("position",new it(a,3)),this.setAttribute("normal",new it(l,3)),this.setAttribute("uv",new it(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}
vendor: 2,654 bytes, line 57
57static fromJSON(e){return new Hg(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class Gg extends At{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],a=[],l=[],c=new z,u=new de;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){const f=i+h/t*r;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[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 it(o,3)),this.setAttribute("normal",new it(a,3)),this.setAttribute("uv",new it(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Gg(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class xd extends At{constructor(e=1,t=1,i=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const u=[],h=[],d=[],f=[];let p=0;const v=[],m=i/2;let g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new it(h,3)),this.setAttribute("normal",new it(d,3)),this.setAttribute("uv",new it(f,2));function y(){const _=new z,T=new z;let S=0;const E=(t-e)/i;for(let M=0;M<=s;M++){const b=[],w=M/s,A=w*(t-e)+e;for(let P=0;P<=r;P++){const H=P/r,B=H*l+a,G=Math.sin(B),O=Math.cos(B);T.x=A*G,T.y=-w*i+m,T.z=A*O,h.push(T.x,T.y,T.z),_.set(G,E,O).normalize(),d.push(_.x,_.y,_.z),f.push(H,1-w),b.push(p++)}v.push(b)}for(let M=0;M<r;M++)for(let b=0;b<s;b++){const w=v[b][M],A=v[b+1][M],P=v[b+1][M+1],H=v[b][M+1];(e>0||b!==0)&&(u.push(w,A,H),S+=3),(t>0||b!==s-1)&&(u.push(A,P,H),S+=3)}c.addGroup(g,S,0),g+=S}function x(_){const T=p,S=new de,E=new z;let M=0;const b=_===!0?e:t,w=_===!0?1:-1;for(let P=1;P<=r;P++)h.push(0,m*w,0),d.push(0,w,0),f.push(.5,.5),p++;const A=p;for(let P=0;P<=r;P++){const B=P/r*l+a,G=Math.cos(B),O=Math.sin(B);E.x=b*O,E.y=m*w,E.z=b*G,h.push(E.x,E.y,E.z),d.push(0,w,0),S.x=G*.5+.5,S.y=O*.5*w+.5,f.push(S.x,S.y),p++}for(let P=0;P<r;P++){const H=T+P,B=A+P;_===!0?u.push(B,B+1,H):u.push(B+1,B,H),M+=3}c.addGroup(g,M,_===!0?1:2),g+=M}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xd(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class yd extends xd{constructor(e=1,t=1,i=32,r=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,i,r,s,o,a),this.type="C
57oneGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new yd(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class fa extends At{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];a(r),c(i),u(),this.setAttribute("position",new it(s,3)),this.setAttribute("normal",new it(s.slice(),3)),this.setAttribute("uv",new it(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(y){const x=new z,_=new z,T=new z;for(let S=0;S<t.length;S+=3)f(t[S+0],x),f(t[S+1],_),f(t[S+2],T),l(x,_,T,y)}function l(y,x,_,T){const S=T+1,E=[];for(let M=0;M<=S;M++){E[M]=[];const b=y.clone().lerp(_,M/S),w=x.clone().lerp(_,M/S),A=S-M;for(let P=0;P<=A;P++)P===0&&M===S?E[M][P]=b:E[M][P]=b.clone().lerp(w,P/A)}for(let M=0;M<S;M++)for(let b=0;b<2*(S-M)-1;b++){const w=Math.floor(b/2);b%2===0?(d(E[M][w+1]),d(E[M+1][w]),d(E[M][w])):(d(E[M][w+1]),d(E[M+1][w+1]),d(E[M+1][w]))}}function c(y){const x=new z;for(let _=0;_<s.length;_+=3)x.x=s[_+0],x.y=s[_+1],x.z=s[_+2],x.normalize().multiplyScalar(y),s[_+0]=x.x,s[_+1]=x.y,s[_+2]=x.z}function u(){const y=new z;for(let x=0;x<s.length;x+=3){y.x=s[x+0],y.y=s[x+1],y.z=s[x+2];const _=m(y)/2/Math.PI+.5,T=g(y)/Math.PI+.5;o.push(_,1-T)}p(),h()}function h(){for(let y=0;y<o.length;y+=6){const x=o[y+0],_=o[y+2],T=o[y+4],S=Math.max(x,_,T),E=Math.min(x,_,T);S>.9&&E<.1&&(x<.2&&(o[y+0]+=1),_<.2&&(o[y+2]+=1),T<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){const _=y*3;x.x=e[_+0],x.y=e[_+1],x.z=e[_+2]}function p(){const y=new z,x=new z,_=new z,T=new z,S=new de,E=new de,M=new de;for(let b=0,w=0;b<s.length;b+=9,w+=6){y.set(s[b+0],s[b+1],s[b+2]),x.set(s[b+3],s[b+4],s[b+5]),_.set(s[b+6],s[b+7],s[b+8]),S.set(o[w+0],o[w+1]),E.set(o[w+2],o[w+3]),M.set(o[w+4],o[w+5]),T.copy(y).add(x).add(_).divideScalar(3);const A=m(T);v(S,w+0,y,A),v(E,w+2,x,A),v(M,w+4,_,A)}}function v(y,x,_,T){T<0&&y.x===1&&(o[x]=y.x-1),_.x===0&&_.z===0&&(o[x]=T/2/Math.PI+.5)}function m(y){return Math.atan2(y.z,-y.x)}function g(y){return Math.atan2(-y.y,Math.sqrt(y.x*y.x+y.z*y.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fa(e.vertices,e.indices,e.radius,e.details)}}class Wg extends fa{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,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,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[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: 11,297 bytes, line 57
5719,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Wg(e.radius,e.detail)}}const Ef=new z,Af=new z,vv=new z,Cf=new Ei;class D3 extends At{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(rl*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,c=[0,0,0],u=["a","b","c"],h=new Array(3),d={},f=[];for(let p=0;p<l;p+=3){o?(c[0]=o.getX(p),c[1]=o.getX(p+1),c[2]=o.getX(p+2)):(c[0]=p,c[1]=p+1,c[2]=p+2);const{a:v,b:m,c:g}=Cf;if(v.fromBufferAttribute(a,c[0]),m.fromBufferAttribute(a,c[1]),g.fromBufferAttribute(a,c[2]),Cf.getNormal(vv),h[0]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,h[1]=`${Math.round(m.x*r)},${Math.round(m.y*r)},${Math.round(m.z*r)}`,h[2]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let y=0;y<3;y++){const x=(y+1)%3,_=h[y],T=h[x],S=Cf[u[y]],E=Cf[u[x]],M=`${_}_${T}`,b=`${T}_${_}`;b in d&&d[b]?(vv.dot(d[b].normal)<=s&&(f.push(S.x,S.y,S.z),f.push(E.x,E.y,E.z)),d[b]=null):M in d||(d[M]={index0:c[y],index1:c[x],normal:vv.clone()})}}for(const p in d)if(d[p]){const{index0:v,index1:m}=d[p];Ef.fromBufferAttribute(a,v),Af.fromBufferAttribute(a,m),f.push(Ef.x,Ef.y,Ef.z),f.push(Af.x,Af.y,Af.z)}this.setAttribute("position",new it(f,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class cs{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){je("Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/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 i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],d=i[r+1]-u,f=(o-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 o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new de:new z);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new z,r=[],s=[],o=[],a=new z,l=new ht;for(let f=0;f<=e;f++){const p=f/e;r[f]=this.getTangentAt(p,new z)}s[0]=new z,o[0]=new z;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,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(yt(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(r[f],s[f])}if(t===!0){let f=Math.acos(yt(s[0].dot(s[e]),-1,1));f/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(r[p],f*p)),o[p].crossVectors(r[p],s[p])}return{tangents:r,normals:s,binormals:o}}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 $g extends cs{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new de){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const a=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);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 i.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 k3 extends $g{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function hb(){let n=0,e=0,t=0,i=0;function r(s,o,a,l){n=s,e=a,t=-3*s+3*o-2*a-l,i=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,c){r(o,a,c*(a-s),c*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,c,u,h){let d=(o-s)/c-(a-s)/(c+u)+(a-o)/u,f=(a-o)/u-(l-o)/(u+h)+(l-a)/h;d*=u,f*=u,r(o,a,d,f)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+i*a}}}const Rf=new z,xv=new hb,yv=new hb,_v=new hb;class F3 extends cs{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new z){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(Rf.subVectors(r[0],r[1]).add(r[0]),c=Rf);const h=r[a%s],d=r[(a+1)%s];if(this.closed||a+2<s?u=r[(a+2)%s]:(Rf.subVectors(r[s-1],r[s-2]).add(r[s-1]),u=Rf),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let p=Math.pow(c.distanceToSquared(h),f),v=Math.pow(h.distanceToSquared(d),f),m=Math.pow(d.distanceToSquared(u),f);v<1e-4&&(v=1),p<1e-4&&(p=v),m<1e-4&&(m=v),xv.initNonuniformCatmullRom(c.x,h.x,d.x,u.x,p,v,m),yv.initNonuniformCatmullRom(c.y,h.y,d.y,u.y,p,v,m),_v.initNonuniformCatmullRom(c.z,h.z,d.z,u.z,p,v,m)}else this.curveType==="catmullrom"&&(xv.initCatmullRom(c.x,h.x,d.x,u.x,this.tension),yv.initCatmullRom(c.y,h.y,d.y,u.y,this.tension),_v.initCatmullRom(c.z,h.z,d.z,u.z,this.tension));return i.set(xv.calc(l),yv.calc(l),_v.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;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,i=this.points.length;t<i;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,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new z().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function FS(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,a=n*n,l=n*a;return(2*t-2*i+s+o)*l+(-3*t+3*i-2*s-o)*a+s*n+t}function g5(n,e){const t=1-n;return t*t*e}function v5(n,e){return 2*(1-n)*n*e}function x5(n,e){return n*n*e}function yh(n,e,t,i){return g5(n,e)+v5(n,t)+x5(n,i)}function y5(n,e){const t=1-n;return t*t*t*e}function _5(n,e){const t=1-n;return 3*t*t*n*e}function b5(n,e){return 3*(1-n)*n*n*e}function w5(n,e){return n*n*n*e}function _h(n,e,t,i,r){return y5(n,e)+_5(n,t)+b5(n,i)+w5(n,r)}class db extends cs{constructor(e=new de,t=new de,i=new de,r=new de){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new de){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(_h(e,r.x,s.x,o.x,a.x),_h(e,r.y,s.y,o.y,a.y)),i}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 U3 extends cs{constructor(e=new z,t=new z,i=new z,r=new z){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new z){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(_h(e,r.x,s.x,o.x,a.x),_h(e,r.y,s.y,o.y,a.y),_h(e,r.z,s.z,o.z,a.z)),i}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 fb extends cs{constructor(e=new de,t=new de){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new de){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new de){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 B3 extends cs{constructor(e=new z,t=new z){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new z){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new z){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 pb extends cs{constructor(e=new de,t=new de,i=new de){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}
vendor: 6,649 bytes, line 57
57getPoint(e,t=new de){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(yh(e,r.x,s.x,o.x),yh(e,r.y,s.y,o.y)),i}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 mb extends cs{constructor(e=new z,t=new z,i=new z){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new z){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(yh(e,r.x,s.x,o.x),yh(e,r.y,s.y,o.y),yh(e,r.z,s.z,o.z)),i}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 gb extends cs{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new de){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(FS(a,l.x,c.x,u.x,h.x),FS(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new de().fromArray(r))}return this}}var Fm=Object.freeze({__proto__:null,ArcCurve:k3,CatmullRomCurve3:F3,CubicBezierCurve:db,CubicBezierCurve3:U3,EllipseCurve:$g,LineCurve:fb,LineCurve3:B3,QuadraticBezierCurve:pb,QuadraticBezierCurve3:mb,SplineCurve:gb});class z3 extends cs{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 i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Fm[i](t,e))}return this}getPoint(e,t){const i=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.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 i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const u=l[c];i&&i.equals(u)||(t.push(u),i=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,i=e.curves.length;t<i;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,i=this.curves.length;t<i;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,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Fm[r.type]().fromJSON(r))}return this}}class Um extends z3{constructor(e){super(),this.type="Path",this.currentPoint=new de,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;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 i=new fb(this.currentPoint.clone(),new de(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new pb(this.currentPoint.clone(),new de(e,t),new de(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const a=new db(this.currentPoint.clone(),new de(e,t),new de(i,r),new de(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new gb(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,a,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,t+u,i,r,s,o,a,l),this}absellipse(e,t,i,r,s,o,a,l){const c=new $g(e,t,i,r,s,o,a,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 sl extends Um{constructor(e){super(e),this.uuid=Tr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].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,i=e.holes.length;t<i;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,i=this.holes.length;t<i;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,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Um().fromJSON(r))}return this}}function S5(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=V3(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(i&&(s=C5(n,e,s,t)),n.length>80*t){a=n[0],l=n[1];let u=a,h=l;for(let d=t;d<r;d+=t){const f=n[d],p=n[d+1];f<a&&(a=f),p<l&&(l=p),f>u&&(u=f),p>h&&(h=p)}c=Math.max(u-a,h-l),c=c!==0?32767/c:0}
vendor: 4,985 bytes, line 57
57return zh(s,o,t,a,l,c,0),o}function V3(n,e,t,i,r){let s;if(r===B5(n,e,t,i)>0)for(let o=e;o<t;o+=i)s=US(o/i|0,n[o],n[o+1],s);else for(let o=t-i;o>=e;o-=i)s=US(o/i|0,n[o],n[o+1],s);return s&&Gc(s,s.next)&&(Hh(s),s=s.next),s}function xl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Gc(t,t.next)||Nn(t.prev,t,t.next)===0)){if(Hh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function zh(n,e,t,i,r,s,o){if(!n)return;!o&&s&&L5(n,i,r,s);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(s?T5(n,i,r,s):M5(n)){e.push(l.i,n.i,c.i),Hh(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=E5(xl(n),e),zh(n,e,t,i,r,s,2)):o===2&&A5(n,e,t,i,r,s):zh(xl(n),e,t,i,r,s,1);break}}}function M5(n){const e=n.prev,t=n,i=n.next;if(Nn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=Math.min(r,s,o),h=Math.min(a,l,c),d=Math.max(r,s,o),f=Math.max(a,l,c);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&Qu(r,a,s,l,o,c,p.x,p.y)&&Nn(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function T5(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Nn(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,d=o.y,f=Math.min(a,l,c),p=Math.min(u,h,d),v=Math.max(a,l,c),m=Math.max(u,h,d),g=oy(f,p,e,t,i),y=oy(v,m,e,t,i);let x=n.prevZ,_=n.nextZ;for(;x&&x.z>=g&&_&&_.z<=y;){if(x.x>=f&&x.x<=v&&x.y>=p&&x.y<=m&&x!==r&&x!==o&&Qu(a,u,l,h,c,d,x.x,x.y)&&Nn(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=f&&_.x<=v&&_.y>=p&&_.y<=m&&_!==r&&_!==o&&Qu(a,u,l,h,c,d,_.x,_.y)&&Nn(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=g;){if(x.x>=f&&x.x<=v&&x.y>=p&&x.y<=m&&x!==r&&x!==o&&Qu(a,u,l,h,c,d,x.x,x.y)&&Nn(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=y;){if(_.x>=f&&_.x<=v&&_.y>=p&&_.y<=m&&_!==r&&_!==o&&Qu(a,u,l,h,c,d,_.x,_.y)&&Nn(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function E5(n,e){let t=n;do{const i=t.prev,r=t.next.next;!Gc(i,r)&&G3(i,t,t.next,r)&&Vh(i,r)&&Vh(r,i)&&(e.push(i.i,t.i,r.i),Hh(t),Hh(t.next),t=n=r),t=t.next}while(t!==n);return xl(t)}function A5(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&k5(o,a)){let l=W3(o,a);o=xl(o,o.next),l=xl(l,l.next),zh(o,e,t,i,r,s,0),zh(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function C5(n,e,t,i){const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s]*i,l=s<o-1?e[s+1]*i:n.length,c=V3(n,a,l,i,!1);c===c.next&&(c.steiner=!0),r.push(D5(c))}r.sort(R5);for(let s=0;s<r.length;s++)t=P5(r[s],t);return t}function R5(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const i=(n.next.y-n.y)/(n.next.x-n.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=i-r}return t}function P5(n,e){const t=I5(n,e);if(!t)return e;const i=W3(t,n);return xl(i,i.next),xl(t,t.next)}function I5(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;if(Gc(n,t))return t;do{if(Gc(n,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<=i&&h>s&&(s=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next}while(t!==e);if(!o)return null;const a=o,l=o.x,c=o.y;let u=1/0;t=o;do{if(i>=t.x&&t.x>=l&&i!==t.x&&H3(r<c?i:s,r,l,c,r<c?s:i,r,t.x,t.y)){const h=Math.abs(r-t.y)/(i-t.x);Vh(t,n)&&(h<u||h===u&&(t.x>o.x||t.x===o.x&&N5(o,t)))&&(o=t,u=h)}t=t.next}while(t!==a);return o}function N5(n,e){return Nn(n.prev,n,e.prev)<0&&Nn(e.next,n,n.next)<0}function L5(n,e,t,i){let r=n;do r.z===0&&(r.z=oy(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,O5(r)}function O5(n){let e,t=1;do{let i=n,r;n=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c<t&&(a++,o=o.nextZ,!!o);c++);let l=t;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;i=o}s.nextZ=null,t*=2}while(e>1);return n}function oy(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function D5(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function H3(n,e,t,i,r,s,o,a){return(r-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function Qu(n,e,t,i,r,s,o,a){return!(n===o&&e===a)&&H3(n,e,t,i,r,s,o,a)}function k5(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!F5(n,e)&&(Vh(n,e)&&Vh(e,n)&&U5(n,e)&&(Nn(n.prev,n,e.prev)||Nn(n,e.prev,e))||Gc(n,e)&&Nn(n.prev,n,n.next)>0&&Nn(e.prev,e,e.next)>0)}function Nn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Gc(n,e){return n.x===e.x&&n.y===e.y}function G3(n,e,t,i){const r=If(Nn(n,e,t)),s=If(Nn(n,e,i)),o=If(Nn(t,i,n)),a=If(Nn(t,i,e));return!!(r!==s&&o!==a||r===0&&Pf(n,t,e)||s===0&&Pf(n,i,e)||o===0&&Pf(t,n,i)||a===0&&Pf(t,e,i))}function Pf(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function If(n){return n>0?1:n<0?-1:0}function F5(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&G3(t,t.next,n,e))return!0;t=t.next}
57while(t!==n);return!1}function Vh(n,e){return Nn(n.prev,n,n.next)<0?Nn(n,e,n.next)>=0&&Nn(n,n.prev,e)>=0:Nn(n,e,n.prev)<0||Nn(n,n.next,e)<0}function U5(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.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&&(i=!i),t=t.next;while(t!==n);return i}function W3(n,e){const t=ay(n.i,n.x,n.y),i=ay(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function US(n,e,t,i){const r=ay(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Hh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function ay(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function B5(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class z5{static triangulate(e,t,i=2){return S5(e,t,i)}}class ts{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ts.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];BS(e),zS(i,e);let o=e.length;t.forEach(BS);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,zS(i,t[l]);const a=z5.triangulate(i,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function BS(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function zS(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class jg extends At{constructor(e=new sl([new de(.5,.5),new de(-.5,.5),new de(-.5,-.5),new de(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new it(r,3)),this.setAttribute("uv",new it(s,2)),this.computeVertexNormals();function o(a){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,v=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3;const g=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:V5;let x,_=!1,T,S,E,M;g&&(x=g.getSpacedPoints(u),_=!0,d=!1,T=g.computeFrenetFrames(u,!1),S=new z,E=new z,M=new z),d||(m=0,f=0,p=0,v=0);const b=a.extractPoints(c);let w=b.shape;const A=b.holes;if(!ts.isClockWise(w)){w=w.reverse();for(let D=0,R=A.length;D<R;D++){const X=A[D];ts.isClockWise(X)&&(A[D]=X.reverse())}}function H(D){const X=10000000000000001e-36;let Z=D[0];for(let K=1;K<=D.length;K++){const Q=K%D.length,ae=D[Q],ee=ae.x-Z.x,te=ae.y-Z.y,k=ee*ee+te*te,C=Math.max(Math.abs(ae.x),Math.abs(ae.y),Math.abs(Z.x),Math.abs(Z.y)),Y=X*C*C;if(k<=Y){D.splice(Q,1),K--;continue}Z=ae}}H(w),A.forEach(H);const B=A.length,G=w;for(let D=0;D<B;D++){const R=A[D];w=w.concat(R)}function O(D,R,X){return R||St("ExtrudeGeometry: vec does not exist"),D.clone().addScaledVector(R,X)}const $=w.length;function F(D,R,X){let Z,K,Q;const ae=D.x-R.x,ee=D.y-R.y,te=X.x-D.x,k=X.y-D.y,C=ae*ae+ee*ee,Y=ae*k-ee*te;if(Math.abs(Y)>Number.EPSILON){const ne=Math.sqrt(C),me=Math.sqrt(te*te+k*k),le=R.x-ee/ne,De=R.y+ae/ne,Ne=X.x-k/me,Ye=X.y+te/me,Xe=((Ne-le)*k-(Ye-De)*te)/(ae*k-ee*te);Z=le+ae*Xe-D.x,K=De+ee*Xe-D.y;const Se=Z*Z+K*K;if(Se<=2)return new de(Z,K);Q=Math.sqrt(Se/2)}else{let ne=!1;ae>Number.EPSILON?te>Number.EPSILON&&(ne=!0):ae<-Number.EPSILON?te<-Number.EPSILON&&(ne=!0):Math.sign(ee)===Math.sign(k)&&(ne=!0),ne?(Z=-ee,K=ae,Q=Math.sqrt(C)):(Z=ae,K=ee,Q=Math.sqrt(C/2))}return new de(Z/Q,K/Q)}const J=[];for(let D=0,R=G.length,X=R-1,Z=D+1;D<R;D++,X++,Z++)X===R&&(X=0),Z===R&&(Z=0),J[D]=F(G[D],G[X],G[Z]);const se=[];let be,Fe=J.concat();for(let D=0,R=B;D<R;D++){const X=A[D];be=[];for(let Z=0,K=X.length,Q=K-1,ae=Z+1;Z<K;Z++,Q++,ae++)Q===K&&(Q=0),ae===K&&(ae=0),be[Z]=F(X[Z],X[Q],X[ae]);se.push(be),Fe=Fe.concat(be)}let Le;if(m===0)Le=ts.triangulateShape(G,A);else{const D=[],R=[];for(let X=0;X<m;X++){const Z=X/m,K=f*Math.cos(Z*Math.PI/2),Q=p*Math.sin(Z*Math.PI/2)+v;for(let ae=0,ee=G.length;ae<ee;ae++){const te=O(G[ae],J[ae],Q);I(te.x,te.y,-K),Z===0&&D.push(te)}for(let ae=0,ee=B;ae<ee;ae++){const te=A[ae];be=se[ae];const k=[];for(let C=0,Y=te.length;C<Y;C++){const ne=O(te[C],be[C],Q);I(ne.x,ne.y,-K),Z===0&&k.push(ne)}Z===0&&R.push(k)}}
vendor: 32,702 bytes, line 57
57Le=ts.triangulateShape(D,R)}const Ge=Le.length,ze=p+v;for(let D=0;D<$;D++){const R=d?O(w[D],Fe[D],ze):w[D];_?(E.copy(T.normals[0]).multiplyScalar(R.x),S.copy(T.binormals[0]).multiplyScalar(R.y),M.copy(x[0]).add(E).add(S),I(M.x,M.y,M.z)):I(R.x,R.y,0)}for(let D=1;D<=u;D++)for(let R=0;R<$;R++){const X=d?O(w[R],Fe[R],ze):w[R];_?(E.copy(T.normals[D]).multiplyScalar(X.x),S.copy(T.binormals[D]).multiplyScalar(X.y),M.copy(x[D]).add(E).add(S),I(M.x,M.y,M.z)):I(X.x,X.y,h/u*D)}for(let D=m-1;D>=0;D--){const R=D/m,X=f*Math.cos(R*Math.PI/2),Z=p*Math.sin(R*Math.PI/2)+v;for(let K=0,Q=G.length;K<Q;K++){const ae=O(G[K],J[K],Z);I(ae.x,ae.y,h+X)}for(let K=0,Q=A.length;K<Q;K++){const ae=A[K];be=se[K];for(let ee=0,te=ae.length;ee<te;ee++){const k=O(ae[ee],be[ee],Z);_?I(k.x,k.y+x[u-1].y,x[u-1].x+X):I(k.x,k.y,h+X)}}}he(),fe();function he(){const D=r.length/3;if(d){let R=0,X=$*R;for(let Z=0;Z<Ge;Z++){const K=Le[Z];V(K[2]+X,K[1]+X,K[0]+X)}R=u+m*2,X=$*R;for(let Z=0;Z<Ge;Z++){const K=Le[Z];V(K[0]+X,K[1]+X,K[2]+X)}}else{for(let R=0;R<Ge;R++){const X=Le[R];V(X[2],X[1],X[0])}for(let R=0;R<Ge;R++){const X=Le[R];V(X[0]+$*u,X[1]+$*u,X[2]+$*u)}}i.addGroup(D,r.length/3-D,0)}function fe(){const D=r.length/3;let R=0;ue(G,R),R+=G.length;for(let X=0,Z=A.length;X<Z;X++){const K=A[X];ue(K,R),R+=K.length}i.addGroup(D,r.length/3-D,1)}function ue(D,R){let X=D.length;for(;--X>=0;){const Z=X;let K=X-1;K<0&&(K=D.length-1);for(let Q=0,ae=u+m*2;Q<ae;Q++){const ee=$*Q,te=$*(Q+1),k=R+Z+ee,C=R+K+ee,Y=R+K+te,ne=R+Z+te;q(k,C,Y,ne)}}}function I(D,R,X){l.push(D),l.push(R),l.push(X)}function V(D,R,X){ye(D),ye(R),ye(X);const Z=r.length/3,K=y.generateTopUV(i,r,Z-3,Z-2,Z-1);N(K[0]),N(K[1]),N(K[2])}function q(D,R,X,Z){ye(D),ye(R),ye(Z),ye(R),ye(X),ye(Z);const K=r.length/3,Q=y.generateSideWallUV(i,r,K-6,K-3,K-2,K-1);N(Q[0]),N(Q[1]),N(Q[3]),N(Q[1]),N(Q[2]),N(Q[3])}function ye(D){r.push(l[D*3+0]),r.push(l[D*3+1]),r.push(l[D*3+2])}function N(D){s.push(D.x),s.push(D.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return H5(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];i.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Fm[r.type]().fromJSON(r)),new jg(i,e.options)}}const V5={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],a=e[i*3],l=e[i*3+1],c=e[r*3],u=e[r*3+1];return[new de(s,o),new de(a,l),new de(c,u)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[i*3],u=e[i*3+1],h=e[i*3+2],d=e[r*3],f=e[r*3+1],p=e[r*3+2],v=e[s*3],m=e[s*3+1],g=e[s*3+2];return Math.abs(a-u)<Math.abs(o-c)?[new de(o,1-l),new de(c,1-h),new de(d,1-p),new de(v,1-g)]:[new de(a,1-l),new de(u,1-h),new de(f,1-p),new de(m,1-g)]}};function H5(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class qg extends fa{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,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 qg(e.radius,e.detail)}}class Xg extends At{constructor(e=[new de(0,-.5),new de(.5,0),new de(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=yt(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,h=new z,d=new de,f=new z,p=new z,v=new z;let m=0,g=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:m=e[y+1].x-e[y].x,g=e[y+1].y-e[y].y,f.x=g*1,f.y=-m,f.z=g*0,v.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(v.x,v.y,v.z);break;default:m=e[y+1].x-e[y].x,g=e[y+1].y-e[y].y,f.x=g*1,f.y=-m,f.z=g*0,p.copy(f),f.x+=v.x,f.y+=v.y,f.z+=v.z,f.normalize(),l.push(f.x,f.y,f.z),v.copy(p)}for(let y=0;y<=t;y++){const x=i+y*u*r,_=Math.sin(x),T=Math.cos(x);for(let S=0;S<=e.length-1;S++){h.x=e[S].x*_,h.y=e[S].y,h.z=e[S].x*T,o.push(h.x,h.y,h.z),d.x=y/t,d.y=S/(e.length-1),a.push(d.x,d.y);const E=l[3*S+0]*_,M=l[3*S+1],b=l[3*S+0]*T;c.push(E,M,b)}}for(let y=0;y<t;y++)for(let x=0;x<e.length-1;x++){const _=x+y*e.length,T=_,S=_+e.length,E=_+e.length+1,M=_+1;s.push(T,S,M),s.push(E,M,S)}this.setIndex(s),this.setAttribute("position",new it(o,3)),this.setAttribute("uv",new it(a,2)),this.setAttribute("normal",new it(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Xg(e.points,e.segments,e.phiStart,e.phiLength)}}class _d extends fa{constructor(e=1,t=0){const i=[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(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _d(e.radius,e.detail)}}class wl extends At{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(i),l=Math.floor(r),c=a+1,u=l+1,h=e/a,d=t/l,f=[],p=[],v=[],m=[];for(let g=0;g<u;g++){const y=g*d-o;for(let x=0;x<c;x++){const _=x*h-s;p.push(_,-y,0),v.push(0,0,1),m.push(x/a),m.push(1-g/l)}}for(let g=0;g<l;g++)for(let y=0;y<a;y++){const x=y+c*g,_=y+c*(g+1),T=y+1+c*(g+1),S=y+1+c*g;f.push(x,_,S),f.push(_,T,S)}this.setIndex(f),this.setAttribute("position",new it(p,3)),this.setAttribute("normal",new it(v,3)),this.setAttribute("uv",new it(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wl(e.width,e.height,e.widthSegments,e.heightSegments)}}class Yg extends At{constructor(e=.5,t=1,i=32,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const a=[],l=[],c=[],u=[];let h=e;const d=(t-e)/r,f=new z,p=new de;for(let v=0;v<=r;v++){for(let m=0;m<=i;m++){const g=s+m/i*o;f.x=h*Math.cos(g),f.y=h*Math.sin(g),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 v=0;v<r;v++){const m=v*(i+1);for(let g=0;g<i;g++){const y=g+m,x=y,_=y+i+1,T=y+i+2,S=y+1;a.push(x,_,S),a.push(_,T,S)}}this.setIndex(a),this.setAttribute("position",new it(l,3)),this.setAttribute("normal",new it(c,3)),this.setAttribute("uv",new it(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yg(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Kg extends At{constructor(e=new sl([new de(0,.5),new de(-.5,-.5),new de(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let u=0;u<e.length;u++)c(e[u]),this.addGroup(a,l,u),a+=l,l=0;this.setIndex(i),this.setAttribute("position",new it(r,3)),this.setAttribute("normal",new it(s,3)),this.setAttribute("uv",new it(o,2));function c(u){const h=r.length/3,d=u.extractPoints(t);let f=d.shape;const p=d.holes;ts.isClockWise(f)===!1&&(f=f.reverse());for(let m=0,g=p.length;m<g;m++){const y=p[m];ts.isClockWise(y)===!0&&(p[m]=y.reverse())}const v=ts.triangulateShape(f,p);for(let m=0,g=p.length;m<g;m++){const y=p[m];f=f.concat(y)}for(let m=0,g=f.length;m<g;m++){const y=f[m];r.push(y.x,y.y,0),s.push(0,0,1),o.push(y.x,y.y)}for(let m=0,g=v.length;m<g;m++){const y=v[m],x=y[0]+h,_=y[1]+h,T=y[2]+h;i.push(x,_,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 G5(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Kg(i,e.curveSegments)}}function G5(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class su extends At{constructor(e=1,t=32,i=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const l=Math.min(o+a,Math.PI);let c=0;const u=[],h=new z,d=new z,f=[],p=[],v=[],m=[];for(let g=0;g<=i;g++){const y=[],x=g/i;let _=0;g===0&&o===0?_=.5/t:g===i&&l===Math.PI&&(_=-.5/t);for(let T=0;T<=t;T++){const S=T/t;h.x=-e*Math.cos(r+S*s)*Math.sin(o+x*a),h.y=e*Math.cos(o+x*a),h.z=e*Math.sin(r+S*s)*Math.sin(o+x*a),p.push(h.x,h.y,h.z),d.copy(h).normalize(),v.push(d.x,d.y,d.z),m.push(S+_,1-x),y.push(c++)}u.push(y)}for(let g=0;g<i;g++)for(let y=0;y<t;y++){const x=u[g][y+1],_=u[g][y],T=u[g+1][y],S=u[g+1][y+1];(g!==0||o>0)&&f.push(x,_,S),(g!==i-1||l<Math.PI)&&f.push(_,T,S)}this.setIndex(f),this.setAttribute("position",new it(p,3)),this.setAttribute("normal",new it(v,3)),this.setAttribute("uv",new it(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new su(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Zg extends fa{constructor(e=1,t=0){const i=[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(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Zg(e.radius,e.detail)}}class Jg extends At{constructor(e=1,t=.4,i=12,r=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],a=[],l=[],c=[],u=new z,h=new z,d=new z;for(let f=0;f<=i;f++)for(let p=0;p<=r;p++){const v=p/r*s,m=f/i*Math.PI*2;h.x=(e+t*Math.cos(m))*Math.cos(v),h.y=(e+t*Math.cos(m))*Math.sin(v),h.z=t*Math.sin(m),a.push(h.x,h.y,h.z),u.x=e*Math.cos(v),u.y=e*Math.sin(v),d.subVectors(h,u).normalize(),l.push(d.x,d.y,d.z),c.push(p/r),c.push(f/i)}for(let f=1;f<=i;f++)for(let p=1;p<=r;p++){const v=(r+1)*f+p-1,m=(r+1)*(f-1)+p-1,g=(r+1)*(f-1)+p,y=(r+1)*f+p;o.push(v,m,y),o.push(m,g,y)}this.setIndex(o),this.setAttribute("position",new it(a,3)),this.setAttribute("normal",new it(l,3)),this.setAttribute("uv",new it(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jg(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Qg extends At{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const a=[],l=[],c=[],u=[],h=new z,d=new z,f=new z,p=new z,v=new z,m=new z,g=new z;for(let x=0;x<=i;++x){const _=x/i*s*Math.PI*2;y(_,s,o,e,f),y(_+.01,s,o,e,p),m.subVectors(p,f),g.addVectors(p,f),v.crossVectors(m,g),g.crossVectors(v,m),v.normalize(),g.normalize();for(let T=0;T<=r;++T){const S=T/r*Math.PI*2,E=-t*Math.cos(S),M=t*Math.sin(S);h.x=f.x+(E*g.x+M*v.x),h.y=f.y+(E*g.y+M*v.y),h.z=f.z+(E*g.z+M*v.z),l.push(h.x,h.y,h.z),d.subVectors(h,f).normalize(),c.push(d.x,d.y,d.z),u.push(x/i),u.push(T/r)}}for(let x=1;x<=i;x++)for(let _=1;_<=r;_++){const T=(r+1)*(x-1)+(_-1),S=(r+1)*x+(_-1),E=(r+1)*x+_,M=(r+1)*(x-1)+_;a.push(T,S,M),a.push(S,E,M)}this.setIndex(a),this.setAttribute("position",new it(l,3)),this.setAttribute("normal",new it(c,3)),this.setAttribute("uv",new it(u,2));function y(x,_,T,S,E){const M=Math.cos(x),b=Math.sin(x),w=T/_*x,A=Math.cos(w);E.x=S*(2+A)*.5*M,E.y=S*(2+A)*b*.5,E.z=S*Math.sin(w)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Qg(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class e0 extends At{constructor(e=new mb(new z(-1,-1,0),new z(-1,1,0),new z(1,1,0)),t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new z,l=new z,c=new de;let u=new z;const h=[],d=[],f=[],p=[];v(),this.setIndex(p),this.setAttribute("position",new it(h,3)),this.setAttribute("normal",new it(d,3)),this.setAttribute("uv",new it(f,2));function v(){for(let x=0;x<t;x++)m(x);m(s===!1?t:0),y(),g()}function m(x){u=e.getPointAt(x/t,u);const _=o.normals[x],T=o.binormals[x];for(let S=0;S<=r;S++){const E=S/r*Math.PI*2,M=Math.sin(E),b=-Math.cos(E);l.x=b*_.x+M*T.x,l.y=b*_.y+M*T.y,l.z=b*_.z+M*T.z,l.normalize(),d.push(l.x,l.y,l.z),a.x=u.x+i*l.x,a.y=u.y+i*l.y,a.z=u.z+i*l.z,h.push(a.x,a.y,a.z)}}function g(){for(let x=1;x<=t;x++)for(let _=1;_<=r;_++){const T=(r+1)*(x-1)+(_-1),S=(r+1)*x+(_-1),E=(r+1)*x+_,M=(r+1)*(x-1)+_;p.push(T,S,M),p.push(S,E,M)}}function y(){for(let x=0;x<=t;x++)for(let _=0;_<=r;_++)c.x=x/t,c.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 e0(new Fm[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class $3 extends At{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new z,s=new z;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.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,v=d+f;p<v;p+=3)for(let m=0;m<3;m++){const g=a.getX(p+m),y=a.getX(p+(m+1)%3);r.fromBufferAttribute(o,g),s.fromBufferAttribute(o,y),VS(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let c=0;c<3;c++){const u=3*a+c,h=3*a+(c+1)%3;r.fromBufferAttribute(o,u),s.fromBufferAttribute(o,h),VS(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new it(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function VS(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var HS=Object.freeze({__proto__:null,BoxGeometry:da,CapsuleGeometry:Hg,CircleGeometry:Gg,ConeGeometry:yd,CylinderGeometry:xd,DodecahedronGeometry:Wg,EdgesGeometry:D3,ExtrudeGeometry:jg,IcosahedronGeometry:qg,LatheGeometry:Xg,OctahedronGeometry:_d,PlaneGeometry:wl,PolyhedronGeometry:fa,RingGeometry:Yg,ShapeGeometry:Kg,SphereGeometry:su,TetrahedronGeometry:Zg,TorusGeometry:Jg,TorusKnotGeometry:Qg,TubeGeometry:e0,WireframeGeometry:$3});class j3 extends si{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new We(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}}class q3 extends pn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class bd extends si{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new We(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 We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ha,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ai,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 X3 extends bd{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 de(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return yt(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 We(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 We(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new We(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 Y3 extends si{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new We(16777215),this.specular=new We(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ha,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ai,this.combine=dd,this.reflectivity=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.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 K3 extends si{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new We(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ha,this.normalScale=new de(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 vb extends si{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ha,this.normalScale=new de(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 Z3 extends si{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new We(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ha,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ai,this.combine=dd,this.reflectivity=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.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 xb extends si{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Hs,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 yb extends si{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 J3 extends si{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new We(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ha,this.normalScale=new de(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 Q3 extends Xi{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 Ya(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function eR(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function tR(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function ly(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function _b(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push(...o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function W5(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];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>=i)){h.push(c.times[f]);for(let v=0;v<u;++v)d.push(c.values[f*u+v])}}h.length!==0&&(c.times=Ya(h,c.times.constructor),c.values=Ya(d,c.values.constructor),o.push(c))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s}function $5(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const c=n.tracks.find(function(g){return g.name===a.name&&g.ValueTypeName===l});if(c===void 0)continue;let u=0;const h=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=h/3);let d=0;const f=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=f/3);const p=a.times.length-1;let v;if(s<=a.times[0]){const g=u,y=h-u;v=a.values.slice(g,y)}else if(s>=a.times[p]){const g=p*h+u,y=g+h-u;v=a.values.slice(g,y)}else{const g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),v=g.resultBuffer.slice(y,x)}l==="quaternion"&&new ui().fromArray(v).normalize().conjugate().toArray(v);const m=c.times.length;for(let g=0;g<m;++g){const y=g*f+d;if(l==="quaternion")ui.multiplyQuaternionsFlat(c.values,y,v,0,c.values,y);else{const x=f-d*2;for(let _=0;_<x;++_)c.values[y+_]-=v[_]}}}return n.blendMode=Q_,n}class j5{static convertArray(e,t){return Ya(e,t)}static isTypedArray(e){return eR(e)}static getKeyframeOrder(e){return tR(e)}static sortedArray(e,t,i){return ly(e,t,i)}static flattenJSON(e,t,i,r){_b(e,t,i,r)}static subclip(e,t,i,r,s=30){return W5(e,t,i,r,s)}static makeClipAdditive(e,t=0,i=e,r=30){return $5(e,t,i,r)}}class wd{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let a=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(i=2,s=a);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const a=i+o>>>1;e<t[a]?o=a:i=a+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class nR extends wd{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:qa,endingEnd:qa}}intervalChanged_(e,t,i){const r=this.parameterPositions;
vendor: 12,874 bytes, line 57
57let s=e-2,o=e+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case Xa:s=e,a=2*t-i;break;case Dh:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Xa:o=e,l=2*i-t;break;case Dh:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}const c=(i-t)*.5,u=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-i),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(i-t)/(r-t),v=p*p,m=v*p,g=-d*m+2*d*v-d*p,y=(1+d)*m+(-1.5-2*d)*v+(-.5+d)*p+1,x=(-1-f)*m+(1.5+f)*v+.5*p,_=f*m-f*v;for(let T=0;T!==a;++T)s[T]=g*o[u+T]+y*o[c+T]+x*o[l+T]+_*o[h+T];return s}}class bb extends wd{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=(i-t)/(r-t),h=1-u;for(let d=0;d!==a;++d)s[d]=o[c+d]*h+o[l+d]*u;return s}}class iR extends wd{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Br{constructor(e,t,i,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=Ya(t,this.TimeBufferType),this.values=Ya(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Ya(e.times,Array),values:Ya(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new iR(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new bb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new nR(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Oh:t=this.InterpolantFactoryMethodDiscrete;break;case Om:t=this.InterpolantFactoryMethodLinear;break;case Ep:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="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(i);return je("KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Oh;case this.InterpolantFactoryMethodLinear:return Om;case this.InterpolantFactoryMethodSmooth:return Ep}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(St("KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(St("KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){St("KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){St("KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&eR(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){St("KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Ep,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const c=e[a],u=e[a+1];if(c!==u&&(a!==1||c!==e[0]))if(r)l=!0;else{const h=a*i,d=h-i,f=h+i;for(let p=0;p!==i;++p){const v=t[h+p];if(v!==t[d+p]||v!==t[f+p]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const h=a*i,d=o*i;for(let f=0;f!==i;++f)t[d+f]=t[h+f]}++o}}if(s>0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Br.prototype.ValueTypeName="";Br.prototype.TimeBufferType=Float32Array;Br.prototype.ValueBufferType=Float32Array;Br.prototype.DefaultInterpolation=Om;class Sl extends Br{constructor(e,t,i){super(e,t,i)}}Sl.prototype.ValueTypeName="bool";Sl.prototype.ValueBufferType=Array;Sl.prototype.DefaultInterpolation=Oh;Sl.prototype.InterpolantFactoryMethodLinear=void 0;Sl.prototype.InterpolantFactoryMethodSmooth=void 0;class wb extends Br{constructor(e,t,i,r){super(e,t,i,r)}}wb.prototype.ValueTypeName="color";class Gh extends Br{constructor(e,t,i,r){super(e,t,i,r)}}Gh.prototype.ValueTypeName="number";class rR extends wd{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)ui.slerpFlat(s,0,o,c-a,o,c,l);return s}}class Sd extends Br{constructor(e,t,i,r){super(e,t,i,r)}InterpolantFactoryMethodLinear(e){return new rR(this.times,this.values,this.getValueSize(),e)}}Sd.prototype.ValueTypeName="quaternion";Sd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ml extends Br{constructor(e,t,i){super(e,t,i)}}Ml.prototype.ValueTypeName="string";Ml.prototype.ValueBufferType=Array;Ml.prototype.DefaultInterpolation=Oh;Ml.prototype.InterpolantFactoryMethodLinear=void 0;Ml.prototype.InterpolantFactoryMethodSmooth=void 0;class Wh extends Br{constructor(e,t,i,r){super(e,t,i,r)}}Wh.prototype.ValueTypeName="vector";class $h{constructor(e="",t=-1,i=[],r=Ig){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Tr(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(X5(i[o]).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=[],i=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,o=i.length;s!==o;++s)t.push(Br.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],c=[];l.push((a+s-1)%s,a,(a+1)%s),c.push(0,1,0);const u=tR(l);l=ly(l,1,u),c=ly(c,1,u),!r&&l[0]===0&&(l.push(s),c.push(c[0])),o.push(new Gh(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const c=e[a],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 o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(je("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return St("AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,f,p,v){if(f.length!==0){const m=[],g=[];_b(f,m,g,p),m.length!==0&&v.push(new h(d,m,g))}},r=[],s=e.name||"default",o=e.fps||30,a=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 v=0;v<d[p].morphTargets.length;v++)f[d[p].morphTargets[v]]=-1;for(const v in f){const m=[],g=[];for(let y=0;y!==d[p].morphTargets.length;++y){const x=d[p];m.push(x.time),g.push(x.morphTarget===v?1:0)}r.push(new Gh(".morphTargetInfluence["+v+"]",m,g))}l=f.length*o}else{const f=".bones["+t[h].name+"]";i(Wh,f+".position",d,"pos",r),i(Sd,f+".quaternion",d,"rot",r),i(Wh,f+".scale",d,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];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 i=0;i<this.tracks.length;i++)e.push(this.tracks[i].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 q5(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Gh;case"vector":case"vector2":case"vector3":case"vector4":return Wh;case"color":return wb;case"quaternion":return Sd;case"bool":case"boolean":return Sl;case"string":return Ml}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function X5(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=q5(n.type);if(n.times===void 0){const t=[],i=[];_b(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Ss={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Sb{constructor(e,t,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this._abortController=null,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(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 sR=new Sb;class hr{constructor(e){this.manager=e!==void 0?e:sR,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.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}}hr.DEFAULT_MATERIAL_NAME="__DEFAULT";const to={};class Y5 extends Error{constructor(e,t){super(e),this.response=t}}class wo extends hr{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=Ss.get(`file:${e}`);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(to[e]!==void 0){to[e].push({onLoad:t,onProgress:i,onError:r});return}to[e]=[],to[e].push({onLoad:t,onProgress:i,onError:r});const o=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}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&je("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=to[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 v=0;const m=new ReadableStream({start(g){y();function y(){h.read().then(({done:x,value:_})=>
57{if(x)g.close();else{v+=_.byteLength;const T=new ProgressEvent("progress",{lengthComputable:p,loaded:v,total:f});for(let S=0,E=u.length;S<E;S++){const M=u[S];M.onProgress&&M.onProgress(T)}g.enqueue(_),y()}},x=>{g.error(x)})}}});return new Response(m)}else throw new Y5(`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,a));case"json":return c.json();default:if(a==="")return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(p=>f.decode(p))}}}).then(c=>{Ss.add(`file:${e}`,c);const u=to[e];delete to[e];for(let h=0,d=u.length;h<d;h++){const f=u[h];f.onLoad&&f.onLoad(c)}}).catch(c=>{const u=to[e];if(u===void 0)throw this.manager.itemError(e),c;delete to[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 K5 extends hr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new wo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):St(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=$h.parse(e[i]);t.push(r)}return t}}class Z5 extends hr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],a=new zg,l=new wo(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);o[h]={width:f.width,height:f.height,format:f.format,mipmaps:f.mipmaps},c+=1,c===6&&(f.mipmapCount===1&&(a.minFilter=dn),a.image=o,a.format=f.format,a.needsUpdate=!0,t&&t(a))},i,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++){o[p]={mipmaps:[]};for(let v=0;v<d.mipmapCount;v++)o[p].mipmaps.push(d.mipmaps[p*d.mipmapCount+v]),o[p].format=d.format,o[p].width=d.width,o[p].height=d.height}a.image=o}else a.image.width=d.width,a.image.height=d.height,a.mipmaps=d.mipmaps;d.mipmapCount===1&&(a.minFilter=dn),a.format=d.format,a.needsUpdate=!0,t&&t(a)},i,r);return a}}const Zl=new WeakMap;class jh extends hr{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ss.get(`image:${e}`);if(o!==void 0){if(o.complete===!0)s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0);else{let h=Zl.get(o);h===void 0&&(h=[],Zl.set(o,h)),h.push({onLoad:t,onError:r})}return o}const a=Uh("img");function l(){u(),t&&t(this);const h=Zl.get(this)||[];for(let d=0;d<h.length;d++){const f=h[d];f.onLoad&&f.onLoad(this)}Zl.delete(this),s.manager.itemEnd(e)}function c(h){u(),r&&r(h),Ss.remove(`image:${e}`);const d=Zl.get(this)||[];for(let f=0;f<d.length;f++){const p=d[f];p.onError&&p.onError(h)}Zl.delete(this),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),Ss.add(`image:${e}`,a),s.manager.itemStart(e),a.src=e,a}}class oR extends hr{constructor(e){super(e)}load(e,t,i,r){const s=new gd;
vendor: 2,544 bytes, line 57
57s.colorSpace=Lt;const o=new jh(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(u){s.images[c]=u,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)l(c);return s}}class aR extends hr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new is,a=new wo(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(l){let c;try{c=s.parse(l)}catch(u){if(r!==void 0)r(u);else{u(u);return}}c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:lr,o.wrapT=c.wrapT!==void 0?c.wrapT:lr,o.magFilter=c.magFilter!==void 0?c.magFilter:dn,o.minFilter=c.minFilter!==void 0?c.minFilter:dn,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(o.colorSpace=c.colorSpace),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=es),c.mipmapCount===1&&(o.minFilter=dn),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c)},i,r),o}}class Mb extends hr{constructor(e){super(e)}load(e,t,i,r){const s=new Sn,o=new jh(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class pa extends Dt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new We(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class lR extends pa{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Dt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new We(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const bv=new ht,GS=new z,WS=new z;
vendor: 2,711 bytes, line 57
57class Tb{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new de(512,512),this.mapType=Wn,this.map=null,this.mapPass=null,this.matrix=new ht,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ru,this._frameExtents=new de(1,1),this._viewportCount=1,this._viewports=[new Ft(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;GS.setFromMatrixPosition(e.matrixWorld),t.position.copy(GS),WS.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(WS),t.updateMatrixWorld(),bv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(bv,t.coordinateSystem,t.reversedDepth),t.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(bv)}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}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}}class J5 extends Tb{constructor(){super(new xn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,i=zc*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class cR extends pa{constructor(e,t,i=0,r=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Dt.DEFAULT_UP),this.updateMatrix(),this.target=new Dt,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new J5}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}
vendor: 25,355 bytes, line 57
57const $S=new ht,Ou=new z,wv=new z;class Q5 extends Tb{constructor(){super(new xn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new de(4,2),this._viewportCount=6,this._viewports=[new Ft(2,1,1,1),new Ft(0,1,1,1),new Ft(3,1,1,1),new Ft(1,1,1,1),new Ft(3,0,1,1),new Ft(1,0,1,1)],this._cubeDirections=[new z(1,0,0),new z(-1,0,0),new z(0,0,1),new z(0,0,-1),new z(0,1,0),new z(0,-1,0)],this._cubeUps=[new z(0,1,0),new z(0,1,0),new z(0,1,0),new z(0,1,0),new z(0,0,1),new z(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Ou.setFromMatrixPosition(e.matrixWorld),i.position.copy(Ou),wv.copy(i.position),wv.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(wv),i.updateMatrixWorld(),r.makeTranslation(-Ou.x,-Ou.y,-Ou.z),$S.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix($S,i.coordinateSystem,i.reversedDepth)}}class uR extends pa{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Q5}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class rs extends Dg{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=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,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,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 ez extends Tb{constructor(){super(new rs(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class hR extends pa{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Dt.DEFAULT_UP),this.updateMatrix(),this.target=new Dt,this.shadow=new ez}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class dR extends pa{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class fR extends pa{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,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 pR{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new z)}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 i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-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 i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],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 i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}class mR extends pa{constructor(e=new pR,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class t0 extends hr{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new wo(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):St(l),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&je("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 We().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.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 o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new We().setHex(o.value);break;case"v2":r.uniforms[s].value=new de().fromArray(o.value);break;case"v3":r.uniforms[s].value=new z().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Ft().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Ct().fromArray(o.value);break;case"m4":r.uniforms[s].value=new ht().fromArray(o.value);break;default:r.uniforms[s].value=o.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=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(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 de().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(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=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new de().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return t0.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:j3,SpriteMaterial:ab,RawShaderMaterial:q3,ShaderMaterial:pn,PointsMaterial:cb,MeshPhysicalMaterial:X3,MeshStandardMaterial:bd,MeshPhongMaterial:Y3,MeshToonMaterial:K3,MeshNormalMaterial:vb,MeshLambertMaterial:Z3,MeshDepthMaterial:xb,MeshDistanceMaterial:yb,MeshBasicMaterial:Gs,MeshMatcapMaterial:J3,LineDashedMaterial:Q3,LineBasicMaterial:Xi,Material:si};return new t[e]}}class cy{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 gR extends At{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 vR extends hr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new wo(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):St(l),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(f,p){if(t[p]!==void 0)return t[p];const m=f.interleavedBuffers[p],g=s(f,m.buffer),y=vc(m.type,g),x=new vd(y,m.stride);return x.uuid=m.uuid,t[p]=x,x}function s(f,p){if(i[p]!==void 0)return i[p];const m=f.arrayBuffers[p],g=new Uint32Array(m).buffer;return i[p]=g,g}const o=e.isInstancedBufferGeometry?new gR:new At,a=e.data.index;if(a!==void 0){const f=vc(a.type,a.array);o.setIndex(new Jt(f,1))}const l=e.data.attributes;for(const f in l){const p=l[f];let v;if(p.isInterleavedBufferAttribute){const m=r(e.data,p.data);v=new bo(m,p.itemSize,p.offset,p.normalized)}else{const m=vc(p.type,p.array),g=p.isInstancedBufferAttribute?Hc:Jt;v=new g(m,p.itemSize,p.normalized)}p.name!==void 0&&(v.name=p.name),p.usage!==void 0&&v.setUsage(p.usage),o.setAttribute(f,v)}const c=e.data.morphAttributes;if(c)for(const f in c){const p=c[f],v=[];for(let m=0,g=p.length;m<g;m++){const y=p[m];let x;if(y.isInterleavedBufferAttribute){const _=r(e.data,y.data);x=new bo(_,y.itemSize,y.offset,y.normalized)}else{const _=vc(y.type,y.array);x=new Jt(_,y.itemSize,y.normalized)}y.name!==void 0&&(x.name=y.name),v.push(x)}o.morphAttributes[f]=v}e.data.morphTargetsRelative&&(o.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 v=h[f];o.addGroup(v.start,v.count,v.materialIndex)}const d=e.data.boundingSphere;return d!==void 0&&(o.boundingSphere=new hi().fromJSON(d)),e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class tz extends hr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?cy.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new wo(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(h){r!==void 0&&r(h),h("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)),St("ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?cy.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new wo(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(a)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),c=this.parseObject(e.object,s,l,a,i),u=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,u),this.bindLightTargets(c),t!==void 0){let h=!1;for(const d in o)if(o[d].data instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,t),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),this.bindLightTargets(l),l}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new sl().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new Ug().fromJSON(e[s],r);i[a.uuid]=a}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new vR;for(let s=0,o=e.length;s<o;s++){let a;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;default:l.type in HS?a=HS[l.type].fromJSON(l,t):je(`ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),l.userData!==void 0&&(a.userData=l.userData),i[l.uuid]=a}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new t0;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];i[l.uuid]===void 0&&(i[l.uuid]=s.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=$h.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(l){return i.manager.itemStart(l),s.load(l,function(){i.manager.itemEnd(l)},void 0,function(){i.manager.itemError(l),i.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const c=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(u)}else return l.data?{data:vc(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new Sb(t);s=new jh(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,v=d.length;p<v;p++){const m=d[p],g=a(m);g!==null&&(g instanceof HTMLImageElement?f.push(g):f.push(new is(g.data,g.width,g.height)))}r[h.uuid]=new qo(f)}else{const f=a(h.url);r[h.uuid]=new qo(f)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(l)}else return o.data?{data:vc(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new jh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],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 is(p.data,p.width,p.height)))}i[l.uuid]=new qo(u)}else{const u=await s(l.url);i[l.uuid]=new qo(u)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(je("ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&je('ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&je("ObjectLoader: Undefined image",a.image);const l=t[a.image],c=l.data;let u;Array.isArray(c)?(u=new gd,c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new is:u=new Sn,c&&(u.needsUpdate=!0)),u.source=l,u.uuid=a.uuid,a.name!==void 0&&(u.name=a.name),a.mapping!==void 0&&(u.mapping=i(a.mapping,nz)),a.channel!==void 0&&(u.channel=a.channel),a.offset!==void 0&&u.offset.fromArray(a.offset),a.repeat!==void 0&&u.repeat.fromArray(a.repeat),a.center!==void 0&&u.center.fromArray(a.center),a.rotation!==void 0&&(u.rotation=a.rotation),a.wrap!==void 0&&(u.wrapS=i(a.wrap[0],jS),u.wrapT=i(a.wrap[1],jS)),a.format!==void 0&&(u.format=a.format),a.internalFormat!==void 0&&(u.internalFormat=a.internalFormat),a.type!==void 0&&(u.type=a.type),a.colorSpace!==void 0&&(u.colorSpace=a.colorSpace),a.minFilter!==void 0&&(u.minFilter=i(a.minFilter,qS)),a.magFilter!==void 0&&(u.magFilter=i(a.magFilter,qS)),a.anisotropy!==void 0&&(u.anisotropy=a.anisotropy),a.flipY!==void 0&&(u.flipY=a.flipY),a.generateMipmaps!==void 0&&(u.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(u.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(u.compareFunction=a.compareFunction),a.userData!==void 0&&(u.userData=a.userData),r[a.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function a(d){return t[d]===void 0&&je("ObjectLoader: Undefined geometry",d),t[d]}function l(d){if(d!==void 0){if(Array.isArray(d)){const f=[];for(let p=0,v=d.length;p<v;p++){const m=d[p];i[m]===void 0&&je("ObjectLoader: Undefined material",m),f.push(i[m])}return f}return i[d]===void 0&&je("ObjectLoader: Undefined material",d),i[d]}}function c(d){return r[d]===void 0&&je("ObjectLoader: Undefined texture",d),r[d]}let u,h;switch(e.type){case"Scene":o=new vl,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new We(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Fg(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new kg(e.fog.color,e.fog.density)),e.fog.name!==""&&(o.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&o.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(o.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&o.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":o=new xn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;
vendor: 4,137 bytes, line 57
57case"OrthographicCamera":o=new rs(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new dR(e.color,e.intensity);break;case"DirectionalLight":o=new hR(e.color,e.intensity),o.target=e.target||"";break;case"PointLight":o=new uR(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new fR(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new cR(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),o.target=e.target||"";break;case"HemisphereLight":o=new lR(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new mR().fromJSON(e);break;case"SkinnedMesh":u=a(e.geometry),h=l(e.material),o=new R3(u,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":u=a(e.geometry),h=l(e.material),o=new an(u,h);break;case"InstancedMesh":u=a(e.geometry),h=l(e.material);const d=e.count,f=e.instanceMatrix,p=e.instanceColor;o=new P3(u,h,d),o.instanceMatrix=new Hc(new Float32Array(f.array),16),p!==void 0&&(o.instanceColor=new Hc(new Float32Array(p.array),p.itemSize));break;case"BatchedMesh":u=a(e.geometry),h=l(e.material),o=new I3(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,h),o.geometry=u,o.perObjectFrustumCulled=e.perObjectFrustumCulled,o.sortObjects=e.sortObjects,o._drawRanges=e.drawRanges,o._reservedRanges=e.reservedRanges,o._geometryInfo=e.geometryInfo.map(v=>{let m=null,g=null;return v.boundingBox!==void 0&&(m=new Ai().fromJSON(v.boundingBox)),v.boundingSphere!==void 0&&(g=new hi().fromJSON(v.boundingSphere)),{...v,boundingBox:m,boundingSphere:g}}),o._instanceInfo=e.instanceInfo,o._availableInstanceIds=e._availableInstanceIds,o._availableGeometryIds=e._availableGeometryIds,o._nextIndexStart=e.nextIndexStart,o._nextVertexStart=e.nextVertexStart,o._geometryCount=e.geometryCount,o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._matricesTexture=c(e.matricesTexture.uuid),o._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(o.boundingSphere=new hi().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(o.boundingBox=new Ai().fromJSON(e.boundingBox));break;case"LOD":o=new C3;break;case"Line":o=new na(a(e.geometry),l(e.material));break;case"LineLoop":o=new N3(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ws(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new L3(a(e.geometry),l(e.material));break;case"Sprite":o=new A3(l(e.material));break;case"Group":o=new xc;break;case"Bone":o=new lb;break;default:o=new Dt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f<d.length;
57f++)o.add(this.parseObject(d[f],t,i,r,s))}if(e.animations!==void 0){const d=e.animations;for(let f=0;f<d.length;f++){const p=d[f];o.animations.push(s[p])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const d=e.levels;for(let f=0;f<d.length;f++){const p=d[f],v=o.getObjectByProperty("uuid",p.object);v!==void 0&&o.addLevel(v,p.distance,p.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?je("ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const i=t.target,r=e.getObjectByProperty("uuid",i);r!==void 0?t.target=r:t.target=new Dt}})}}const nz={UVMapping:Sg,CubeReflectionMapping:Ls,CubeRefractionMapping:ea,EquirectangularReflectionMapping:Jo,EquirectangularRefractionMapping:Nh,CubeUVReflectionMapping:iu},jS={RepeatWrapping:fo,ClampToEdgeWrapping:lr,MirroredRepeatWrapping:Lh},qS={NearestFilter:on,NearestMipmapNearestFilter:j_,NearestMipmapLinearFilter:gc,LinearFilter:dn,LinearMipmapNearestFilter:fh,LinearMipmapLinearFilter:es},Sv=new WeakMap;class iz extends hr{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&je("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&je("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ss.get(`image-bitmap:${e}`);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{if(Sv.has(o)===!0)r&&r(Sv.get(o)),s.manager.itemError(e),s.manager.itemEnd(e);else return t&&t(c),s.manager.itemEnd(e),c});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,a.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Ss.add(`image-bitmap:${e}`,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Sv.set(l,c),Ss.remove(`image-bitmap:${e}`),s.manager.itemError(e),s.manager.itemEnd(e)});Ss.add(`image-bitmap:${e}`,l),s.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let Nf;class Eb{static getContext(){return Nf===void 0&&(Nf=new(window.AudioContext||window.webkitAudioContext)),Nf}static setContext(e){Nf=e}}class rz extends hr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new wo(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);Eb.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):St(l),s.manager.itemError(e)}}}const XS=new ht,YS=new ht,Aa=new ht;class sz{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new xn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new xn,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,Aa.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(rl*t.fov*.5)/t.zoom;let a,l;YS.elements[12]=-r,XS.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Aa.elements[0]=2*t.near/(l-
57a),Aa.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Aa),a=-o*t.aspect-s,l=o*t.aspect-s,Aa.elements[0]=2*t.near/(l-a),Aa.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Aa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(YS),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(XS)}}class xR extends xn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Ab{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}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}}const Ca=new z,Mv=new ui,oz=new z,Ra=new z,Pa=new z;class az extends Dt{constructor(){super(),this.type="AudioListener",this.context=Eb.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ab}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);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ca,Mv,oz),Ra.set(0,0,-1).applyQuaternion(Mv),Pa.set(0,1,0).applyQuaternion(Mv),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ca.x,i),t.positionY.linearRampToValueAtTime(Ca.y,i),t.positionZ.linearRampToValueAtTime(Ca.z,i),t.forwardX.linearRampToValueAtTime(Ra.x,i),t.forwardY.linearRampToValueAtTime(Ra.y,i),t.forwardZ.linearRampToValueAtTime(Ra.z,i),t.upX.linearRampToValueAtTime(Pa.x,i),t.upY.linearRampToValueAtTime(Pa.y,i),t.upZ.linearRampToValueAtTime(Pa.z,i)}else t.setPosition(Ca.x,Ca.y,Ca.z),t.setOrientation(Ra.x,Ra.y,Ra.z,Pa.x,Pa.y,Pa.z)}}class yR extends Dt{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){je("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){je("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()}
vendor: 4,354 bytes, line 57
57pause(){if(this.hasPlaybackControl===!1){je("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){je("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){je("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?(je("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){je("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"?(je("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 Ia=new z,KS=new ui,lz=new z,Na=new z;class cz extends yR{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,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Ia,KS,lz),Na.set(0,0,1).applyQuaternion(KS);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Ia.x,i),t.positionY.linearRampToValueAtTime(Ia.y,i),t.positionZ.linearRampToValueAtTime(Ia.z,i
vendor: 6,292 bytes, line 57
57),t.orientationX.linearRampToValueAtTime(Na.x,i),t.orientationY.linearRampToValueAtTime(Na.y,i),t.orientationZ.linearRampToValueAtTime(Na.z,i)}else t.setPosition(Ia.x,Ia.y,Ia.z),t.setOrientation(Na.x,Na.y,Na.z)}}class uz{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 i=0;i<t.length;i++)e+=t[i];return e/t.length}}class _R{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)i[s+a]=i[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(i,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(i,r,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];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 i=e;i<t;i++)this.buffer[i]=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 i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){ui.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;ui.multiplyQuaternionsFlat(e,o,e,t,e,i),ui.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const Cb="\\[\\]\\.:\\/",hz=new RegExp("["+Cb+"]","g"),Rb="[^"+Cb+"]",dz="[^"+Cb.replace("\\.","")+"]",fz=/((?:WC+[\/:])*)/.source.replace("WC",Rb),pz=/(WCOD+)?/.source.replace("WCOD",dz),mz=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Rb),gz=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Rb),vz=new RegExp("^"+fz+pz+mz+gz+"$"),xz=["material","materials","bones","map"];class yz{constructor(e,t,i){const r=i||jt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class jt{constructor(e,t,i){this.path=t,this.parsedPath=i||jt.parseTrackName(t),this.node=jt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new jt.Composite(e,t,i):new jt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(hz,"")}static parseTrackName(e){const t=vz.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);xz.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=i(a.children);if(l)return l}return null},r=i(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 i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[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 i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,165 bytes, line 57
57_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[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}_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,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=jt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){je("PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let c=t.objectIndex;switch(i){case"materials":if(!e.material){St("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){St("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){St("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){St("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){St("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[i]===void 0){St("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){St("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;St("PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?a=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){St("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){St("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=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}jt.Composite=yz;jt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};jt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};jt.prototype.GetterByBindingType=[jt.prototype._getValue_direct,jt.prototype._getValue_array,jt.prototype._getValue_arrayElement,jt.prototype._getValue_toArray];jt.prototype.SetterByBindingTypeAndVersioning=[[jt.prototype._setValue_direct,jt.prototype._setValue_direct_setNeedsUpdate,jt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[jt.prototype._setValue_array,jt.prototype._setValue_array_setNeedsUpdate,jt.prototype._setValue_array_setMatr
vendor: 4,356 bytes, line 57
57ixWorldNeedsUpdate],[jt.prototype._setValue_arrayElement,jt.prototype._setValue_arrayElement_setNeedsUpdate,jt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[jt.prototype._setValue_fromArray,jt.prototype._setValue_fromArray_setNeedsUpdate,jt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class _z{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Tr(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;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,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let a,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 v=0,m=o;v!==m;++v)s[v].push(new jt(d,i[v],r[v]))}else if(p<c){a=e[p];const v=--c,m=e[v];t[m.uuid]=p,e[p]=m,t[f]=v,e[v]=d;for(let g=0,y=o;g!==y;++g){const x=s[g],_=x[v];let T=x[p];x[p]=_,T===void 0&&(T=new jt(d,i[g],r[g])),x[v]=T}}else e[p]!==a&&St("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],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 v=i[f],m=v[h],g=v[u];v[u]=m,v[h]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h<s){const d=--s,f=e[d],p=--o,v=e[p];t[f.uuid]=h,e[h]=f,t[v.uuid]=d,e[d]=v,e.pop();for(let m=0,g=r;m!==g;++m){const y=i[m],x=y[d],_=y[p];y[h]=x,y[d]=_,y.pop()}}else{const d=--o,f=e[d];d>0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,v=r;p!==v;++p){const m=i[p];m[h]=m[d],m.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){const p=l[d];h[d]=new jt(p,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class bR{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qa,endingEnd:qa};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=u3,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}
vendor: 5,869 bytes, line 57
57fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}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,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,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,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Q_:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case Ig:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.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 i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===h3;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===c3){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,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);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,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Xa,r.endingEnd=Xa):(e?r.endingStart=this.zeroSlopeAtStart?Xa:qa:r.endingStart=Dh,t?r.endingEnd=this.zeroSlopeAtEnd?Xa:qa:r.endingEnd=Dh)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const bz=new Float32Array(1);class wz extends Cr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.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,o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}const v=t&&t._propertyBindings[h].binding.parsedPath;p=new _R(jt.create(i,f,v),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--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,i){const r=this._actions,s=this._actionsByClip;let o=s[t];
vendor: 6,447 bytes, line 57
57if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const h=a.actionByRoot,d=(e._localRoot||this._root).uuid;delete h[d],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,a=o[r],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new bb(new Float32Array(2),new Float32Array(2),1,bz),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?$h.findByName(r,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Ig),l!==void 0){const h=l.actionByRoot[s];if(h!==void 0&&h.blendMode===i)return h;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const u=new bR(this,o,t,i);return this._bindAction(u,c),this._addInactiveAction(u,a,s),u}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?$h.findByName(i,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);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,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const c=o[a];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[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class Sz extends nb{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new Lg(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Qe{constructor(e){this.value=e}clone(){return new Qe(this.value.clone===void 0?this.value:this.value.clone())}}let Mz=0;class Tz extends Cr{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Mz++}),this.name="",this.usage=Fh,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 i=0,r=t.length;i<r;i++){const s=Array.isArray(t[i])?t[i]:[t[i]];for(let o=0;o<s.length;o++)this.uniforms.push(s[o].clone())}return this}clone(){return new this.constructor().copy(this)}}class Ez extends vd{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}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 Az{constructor(e,t,i,r,s,o=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.normalized=o,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 ZS=new ht;class Pb{constructor(e,t,i=0,r=1/0){this.ray=new Ds(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new md,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):St("Raycaster: 
57Unsupported camera type: "+t.type)}setFromXRController(e){return ZS.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ZS),this}intersectObject(e,t=!0,i=[]){return uy(e,this,i,t),i.sort(JS),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r<s;r++)uy(e[r],this,i,t);return i.sort(JS),i}}function JS(n,e){return n.distance-e.distance}function uy(n,e,t,i){let r=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(r=!1),r===!0&&i===!0){const s=n.children;for(let o=0,a=s.length;o<a;o++)uy(s[o],e,t,!0)}}let Cz=class{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=Rz.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 Rz(){this._document.hidden===!1&&this.reset()}class hy{constructor(e=1,t=0,i=0){this.radius=e,this.phi=t,this.theta=i}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=yt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(yt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class Pz{constructor(e=1,t=0,i=0){this.radius=e,this.theta=t,this.y=i}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,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,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}class Ib{constructor(e,t,i,r){Ib.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=i,s[3]=r,this}}const QS=new de;class Iz{constructor(e=new de(1/0,1/0),t=new de(-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,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=QS.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),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,QS).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)}}
57const eM=new z,Lf=new z,Jl=new z,Ql=new z,Tv=new z,Nz=new z,Lz=new z;class wR{constructor(e=new z,t=new z){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){eM.subVectors(e,this.start),Lf.subVectors(this.end,this.start);const i=Lf.dot(Lf);let s=Lf.dot(eM)/i;return t&&(s=yt(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,t=Nz,i=Lz){const r=10000000000000001e-32;let s,o;const a=this.start,l=e.start,c=this.end,u=e.end;Jl.subVectors(c,a),Ql.subVectors(u,l),Tv.subVectors(a,l);const h=Jl.dot(Jl),d=Ql.dot(Ql),f=Ql.dot(Tv);if(h<=r&&d<=r)return t.copy(a),i.copy(l),t.sub(i),t.dot(t);if(h<=r)s=0,o=f/d,o=yt(o,0,1);else{const p=Jl.dot(Tv);if(d<=r)o=0,s=yt(-p/h,0,1);else{const v=Jl.dot(Ql),m=h*d-v*v;m!==0?s=yt((v*f-p*d)/m,0,1):s=0,o=(v*s+f)/d,o<0?(o=0,s=yt(-p/h,0,1)):o>1&&(o=1,s=yt((v-p)/h,0,1))}}return t.copy(a).add(Jl.multiplyScalar(s)),i.copy(l).add(Ql.multiplyScalar(o)),t.sub(i),t.dot(t)}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 tM=new z;class Oz extends Dt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new At,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 o=0,a=1,l=32;o<l;o++,a++){const c=o/l*Math.PI*2,u=a/l*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(u),Math.sin(u),1)}i.setAttribute("position",new it(r,3));const s=new Xi({fog:!1,toneMapped:!1});this.cone=new Ws(i,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),tM.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(tM),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Oo=new z,Of=new ht,Ev=new ht;class Dz extends Ws{constructor(e){const t=SR(e),i=new At,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))}i.setAttribute("position",new it(r,3)),i.setAttribute("color",new it(s,3));const o=new Xi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,o),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const a=new We(255),l=new We(65280);this.setColors(a,l)}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");Ev.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(Of.multiplyMatrices(Ev,a.matrixWorld),Oo.setFromMatrixPosition(Of),r.setXYZ(o,Oo.x,Oo.y,Oo.z),Of.multiplyMatrices(Ev,a.parent.matrixWorld),Oo.setFromMatrixPosition(Of),r.setXYZ(o+1,Oo.x,Oo.y,Oo.z),o+=2)}i.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 SR(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push(...SR(n.children[t]));return e}class kz extends an{constructor(e,t,i){const r=new su(t,4,2),s=new Gs({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.color=i,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 Fz=new z,nM=new We,iM=new We;class Uz extends Dt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new _d(t);r.rotateY(Math.PI*.5),this.material=new Gs({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Jt(o,3)),this.add(new an(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");nM.copy(this.light.color),iM.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?nM:iM;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(Fz.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Bz extends Ws{constructor(e=10,t=10,i=4473924,r=8947848){i=new We(i),r=new We(r);const s=t/2,o=e/t,a=e/2,l=[],c=[];for(let d=0,f=0,p=-a;d<=t;d++,p+=o){l.push(-a,0,p,a,0,p),l.push(p,0,-a,p,0,a);const v=d===s?i:r;v.toArray(c,f),f+=3,v.toArray(c,f),f+=3,v.toArray(c,f),f+=3,v.toArray(c,f),f+=3}const u=new At;u.setAttribute("position",new it(l,3)),u.setAttribute("color",new it(c,3));const h=new Xi({vertexColors:!0,toneMapped:!1});super(u,h),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class zz extends Ws{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new We(s),o=new We(o);const a=[],l=[];
vendor: 4,236 bytes, line 57
57if(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;a.push(0,0,0),a.push(f,0,p);const v=h&1?s:o;l.push(v.r,v.g,v.b),l.push(v.r,v.g,v.b)}for(let h=0;h<i;h++){const d=h&1?s:o,f=e-e/i*h;for(let p=0;p<r;p++){let v=p/r*(Math.PI*2),m=Math.sin(v)*f,g=Math.cos(v)*f;a.push(m,0,g),l.push(d.r,d.g,d.b),v=(p+1)/r*(Math.PI*2),m=Math.sin(v)*f,g=Math.cos(v)*f,a.push(m,0,g),l.push(d.r,d.g,d.b)}}const c=new At;c.setAttribute("position",new it(a,3)),c.setAttribute("color",new it(l,3));const u=new Xi({vertexColors:!0,toneMapped:!1});super(c,u),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const rM=new z,Df=new z,sM=new z;class Vz extends Dt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new At;r.setAttribute("position",new it([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Xi({fog:!1,toneMapped:!1});this.lightPlane=new na(r,s),this.add(this.lightPlane),r=new At,r.setAttribute("position",new it([0,0,0,0,0,1],3)),this.targetLine=new na(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),rM.setFromMatrixPosition(this.light.matrixWorld),Df.setFromMatrixPosition(this.light.target.matrixWorld),sM.subVectors(Df,rM),this.lightPlane.lookAt(Df),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(Df),this.targetLine.scale.z=sM.length()}}const kf=new z,Fn=new Dg;class Hz extends Ws{constructor(e){const t=new At,i=new Xi({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(p,v){l(p),l(v)}function l(p){r.push(0,0,0),s.push(0,0,0),o[p]===void 0&&(o[p]=[]),o[p].push(r.length/3-1)}t.setAttribute("position",new it(r,3)),t.setAttribute("color",new it(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const c=new We(16755200),u=new We(16711680),h=new We(43775),d=new We(16777215),f=new We(3355443);this.setColors(c,u,h,d,f)}setColors(e,t,i,r,s){const a=this.geometry.getAttribute("color");return a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;let s,o;
57if(Fn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)s=1,o=0;else if(this.camera.coordinateSystem===Sr)s=-1,o=1;else if(this.camera.coordinateSystem===Uc)s=0,o=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);Bn("c",t,e,Fn,0,0,s),Bn("t",t,e,Fn,0,0,o),Bn("n1",t,e,Fn,-i,-r,s),Bn("n2",t,e,Fn,i,-r,s),Bn("n3",t,e,Fn,-i,r,s),Bn("n4",t,e,Fn,i,r,s),Bn("f1",t,e,Fn,-i,-r,o),Bn("f2",t,e,Fn,i,-r,o),Bn("f3",t,e,Fn,-i,r,o),Bn("f4",t,e,Fn,i,r,o),Bn("u1",t,e,Fn,i*.7,r*1.1,s),Bn("u2",t,e,Fn,-i*.7,r*1.1,s),Bn("u3",t,e,Fn,0,r*2,s),Bn("cf1",t,e,Fn,-i,0,o),Bn("cf2",t,e,Fn,i,0,o),Bn("cf3",t,e,Fn,0,-r,o),Bn("cf4",t,e,Fn,0,r,o),Bn("cn1",t,e,Fn,-i,0,s),Bn("cn2",t,e,Fn,i,0,s),Bn("cn3",t,e,Fn,0,-r,s),Bn("cn4",t,e,Fn,0,r,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Bn(n,e,t,i,r,s,o){kf.set(r,s,o).unproject(i);const a=e[n];if(a!==void 0){const l=t.getAttribute("position");for(let c=0,u=a.length;c<u;c++)l.setXYZ(a[c],kf.x,kf.y,kf.z)}}const Ff=new Ai;class Gz extends Ws{constructor(e,t=16776960){const i=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 At;s.setIndex(new Jt(i,1)),s.setAttribute("position",new Jt(r,3)),super(s,new Xi({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&Ff.setFromObject(this.object),Ff.isEmpty())return;const e=Ff.min,t=Ff.max,i=this.geometry.attributes.position,r=i.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,i.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 Wz extends Ws{constructor(e,t=16776960){const i=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 At;s.setIndex(new Jt(i,1)),s.setAttribute("position",new it(r,3)),super(s,new Xi({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 $z extends na{constructor(e,t=1,i=16776960){const r=i,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],o=new At;o.setAttribute("position",new it(s,3)),o.computeBoundingSphere(),super(o,new Xi({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new At;l.setAttribute("position",new it(a,3)),l.computeBoundingSphere(),this.add(new an(l,new Gs({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 oM=new z;let Uf,Av;class jz extends Dt{constructor(e=new z(0,0,1),t=new z(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Uf===void 0&&(Uf=new At,Uf.setAttribute("position",new it([0,0,0,0,1,0],3)),Av=new yd(.5,1,5,1),Av.translate(0,-.5,0)),this.position.copy(t),this.line=new na(Uf,new Xi({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new an(Av,new Gs({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}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{oM.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(oM,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i
vendor: 10,770 bytes, lines 57-116
57),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 qz extends Ws{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new At;r.setAttribute("position",new it(t,3)),r.setAttribute("color",new it(i,3));const s=new Xi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new We,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(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Xz{constructor(){this.type="ShapePath",this.color=new We,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Um,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const y=[];for(let x=0,_=g.length;x<_;x++){const T=g[x],S=new sl;S.curves=T.curves,y.push(S)}return y}function i(g,y){const x=y.length;let _=!1;for(let T=x-1,S=0;S<x;T=S++){let E=y[T],M=y[S],b=M.x-E.x,w=M.y-E.y;if(Math.abs(w)>Number.EPSILON){if(w<0&&(E=y[S],b=-b,M=y[T],w=-w),g.y<E.y||g.y>M.y)continue;if(g.y===E.y){if(g.x===E.x)return!0}else{const A=w*(g.x-E.x)-b*(g.y-E.y);if(A===0)return!0;if(A<0)continue;_=!_}}else{if(g.y!==E.y)continue;if(M.x<=g.x&&g.x<=E.x||E.x<=g.x&&g.x<=M.x)return!0}}return _}const r=ts.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new sl,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const h=[],d=[];let f=[],p=0,v;d[p]=void 0,f[p]=[];for(let g=0,y=s.length;g<y;g++)a=s[g],v=a.getPoints(),o=r(v),o=e?!o:o,o?(!u&&d[p]&&p++,d[p]={s:new sl,p:v},d[p].s.curves=a.curves,u&&p++,f[p]=[]):f[p].push({h:a,p:v[0]});if(!d[0])return t(s);if(d.length>1){let g=!1,y=0;for(let x=0,_=d.length;x<_;x++)h[x]=[];for(let x=0,_=d.length;x<_;x++){const T=f[x];for(let S=0;S<T.length;S++){const E=T[S];let M=!0;for(let b=0;b<d.length;b++)i(E.p,d[b].p)&&(x!==b&&y++,M?(M=!1,h[b].push(E)):g=!0);M&&h[x].push(E)}}y>0&&g===!1&&(f=h)}let m;for(let g=0,y=d.length;g<y;g++){l=d[g].s,c.push(l),m=f[g];for(let x=0,_=m.length;x<_;x++)l.holes.push(m[x].h)}return c}}class Yz extends Cr{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){je("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function Kz(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function Zz(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function Jz(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function dy(n,e,t,i){const r=Qz(i);switch(t){case Z_:return n*e;case Ag:return n*e/r.components*r.byteLength;case fd:return n*e/r.components*r.byteLength;case Cg:return n*e*2/r.components*r.byteLength;case Rg:return n*e*2/r.components*r.byteLength;case J_:return n*e*3/r.components*r.byteLength;case Wi:return n*e*4/r.components*r.byteLength;case Pg:return n*e*4/r.components*r.byteLength;case ph:case mh:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case gh:case vh:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case am:case cm:return Math.max(n,16)*Math.max(e,8)/4;case om:case lm:return Math.max(n,8)*Math.max(e,8)/2;case um:case hm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case dm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case fm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case pm:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case mm:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case gm:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case vm:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case xm:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case ym:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case _m:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case bm:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case wm:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Sm:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Mm:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Tm:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Em:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Am:case Cm:case Rm:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Pm:case Im:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Nm:case Lm:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Qz(n){switch(n){case Wn:case q_:return{byteLength:1,components:1};case kc:case X_:case Gi:return{byteLength:2,components:1};case Tg:case Eg:return{byteLength:2,components:4};case Os:case Mg:case li:return{byteLength:4,components:1};case Y_:case K_:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class eV{static contain(e,t){return Kz(e,t)}static cover(e,t){return Zz(e,t)}static fill(e){return Jz(e)}static getByteLength(e,t,i,r){return dy(e,t,i,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ua}}));typeof window<"u"&&(window.__THREE__?je("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ua);function MR(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function tV(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=n.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)f=n.HALF_FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=n.SHORT;else if(c instanceof Uint32Array)f=n.UNSIGNED_INT;else if(c instanceof Int32Array)f=n.INT;else if(c instanceof Int8Array)f=n.BYTE;else if(c instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l.updateRanges;if(n.bindBuffer(c,a),h.length===0)n.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],v=h[f];v.start<=p.start+p.count+1?p.count=Math.max(p.count,v.start+v.count-p.start):(++d,h[d]=v)}h.length=d+1;for(let f=0,p=h.length;f<p;f++){const v=h[f];n.bufferSubData(c,v.start*u.BYTES_PER_ELEMENT,u,v.start,v.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const l=e.get(a);l&&(n.deleteBuffer(l.buffer),e.delete(a))}function o(a,l){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const u=e.get(a);(!u||u.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}const c=e.get(a);if(c===void 0)e.set(a,t(a,l));else if(c.version<a.version){if(c.size!==a.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.");i(c.buffer,a,l),c.version=a.version}}return{get:r,remove:s,update:o}}var nV=`#ifdef USE_ALPHAHASH
58	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
59#endif`,iV=`#ifdef USE_ALPHAHASH
60	const float ALPHA_HASH_SCALE = 0.05;
61	float hash2D( vec2 value ) {
62		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
63	}
64	float hash3D( vec3 value ) {
65		return hash2D( vec2( hash2D( value.xy ), value.z ) );
66	}
67	float getAlphaHashThreshold( vec3 position ) {
68		float maxDeriv = max(
69			length( dFdx( position.xyz ) ),
70			length( dFdy( position.xyz ) )
71		);
72		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
73		vec2 pixScales = vec2(
74			exp2( floor( log2( pixScale ) ) ),
75			exp2( ceil( log2( pixScale ) ) )
76		);
77		vec2 alpha = vec2(
78			hash3D( floor( pixScales.x * position.xyz ) ),
79			hash3D( floor( pixScales.y * position.xyz ) )
80		);
81		float lerpFactor = fract( log2( pixScale ) );
82		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
83		float a = min( lerpFactor, 1.0 - lerpFactor );
84		vec3 cases = vec3(
85			x * x / ( 2.0 * a * ( 1.0 - a ) ),
86			( x - 0.5 * a ) / ( 1.0 - a ),
87			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
88		);
89		float threshold = ( x < ( 1.0 - a ) )
90			? ( ( x < a ) ? cases.x : cases.y )
91			: cases.z;
92		return clamp( threshold , 1.0e-6, 1.0 );
93	}
94#endif`,rV=`#ifdef USE_ALPHAMAP
95	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
96#endif`,sV=`#ifdef USE_ALPHAMAP
97	uniform sampler2D alphaMap;
98#endif`,oV=`#ifdef USE_ALPHATEST
99	#ifdef ALPHA_TO_COVERAGE
100	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
101	if ( diffuseColor.a == 0.0 ) discard;
102	#else
103	if ( diffuseColor.a < alphaTest ) discard;
104	#endif
105#endif`,aV=`#ifdef USE_ALPHATEST
106	uniform float alphaTest;
107#endif`,lV=`#ifdef USE_AOMAP
108	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
109	reflectedLight.indirectDiffuse *= ambientOcclusion;
110	#if defined( USE_CLEARCOAT ) 
111		clearcoatSpecularIndirect *= ambientOcclusion;
112	#endif
113	#if defined( USE_SHEEN ) 
114		sheenSpecularIndirect *= ambientOcclusion;
115	#endif
116	#if defined( USE_ENVMAP ) && defined( STANDARD )
117		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
118		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
119	#endif
120#endif`,cV=`#ifdef USE_AOMAP
121	uniform sampler2D aoMap;
122	uniform float aoMapIntensity;
123#endif`,uV=`#ifdef USE_BATCHING
124	#if ! defined( GL_ANGLE_multi_draw )
125	#define gl_DrawID _gl_DrawID
126	uniform int _gl_DrawID;
127	#endif
128	uniform highp sampler2D batchingTexture;
129	uniform highp usampler2D batchingIdTexture;
130	mat4 getBatchingMatrix( const in float i ) {
131		int size = textureSize( batchingTexture, 0 ).x;
132		int j = int( i ) * 4;
133		int x = j % size;
134		int y = j / size;
135		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
136		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
137		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
138		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
139		return mat4( v1, v2, v3, v4 );
140	}
141	float getIndirectIndex( const in int i ) {
142		int size = textureSize( batchingIdTexture, 0 ).x;
143		int x = i % size;
144		int y = i / size;
145		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
146	}
147#endif
148#ifdef USE_BATCHING_COLOR
149	uniform sampler2D batchingColorTexture;
150	vec3 getBatchingColor( const in float i ) {
151		int size = textureSize( batchingColorTexture, 0 ).x;
152		int j = int( i );
153		int x = j % size;
154		int y = j / size;
155		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
156	}
157#endif`,hV=`#ifdef USE_BATCHING
158	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
159#endif`,dV=`vec3 transformed = vec3( position );
160#ifdef USE_ALPHAHASH
161	vPosition = vec3( position );
162#endif`,fV=`vec3 objectNormal = vec3( normal );
163#ifdef USE_TANGENT
164	vec3 objectTangent = vec3( tangent.xyz );
165#endif`,pV=`float G_BlinnPhong_Implicit( ) {
166	return 0.25;
167}
168float D_BlinnPhong( const in float shininess, const in float dotNH ) {
169	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
170}
171vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
172	vec3 halfDir = normalize( lightDir + viewDir );
173	float dotNH = saturate( dot( normal, halfDir ) );
174	float dotVH = saturate( dot( viewDir, halfDir ) );
175	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
176	float G = G_BlinnPhong_Implicit( );
177	float D = D_BlinnPhong( shininess, dotNH );
178	return F * ( G * D );
179} // validated`,mV=`#ifdef USE_IRIDESCENCE
180	const mat3 XYZ_TO_REC709 = mat3(
181		 3.2404542, -0.9692660,  0.0556434,
182		-1.5371385,  1.8760108, -0.2040259,
183		-0.4985314,  0.0415560,  1.0572252
184	);
185	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
186		vec3 sqrtF0 = sqrt( fresnel0 );
187		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
188	}
189	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
190		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
191	}
192	float IorToFresnel0( float transmittedIor, float incidentIor ) {
193		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
194	}
195	vec3 evalSensitivity( float OPD, vec3 shift ) {
196		float phase = 2.0 * PI * OPD * 1.0e-9;
197		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
198		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
199		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
200		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
201		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 ) );
202		xyz /= 1.0685e-7;
203		vec3 rgb = XYZ_TO_REC709 * xyz;
204		return rgb;
205	}
206	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
207		vec3 I;
208		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
209		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
210		float cosTheta2Sq = 1.0 - sinTheta2Sq;
211		if ( cosTheta2Sq < 0.0 ) {
212			return vec3( 1.0 );
213		}
214		float cosTheta2 = sqrt( cosTheta2Sq );
215		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
216		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
217		float T121 = 1.0 - R12;
218		float phi12 = 0.0;
219		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
220		float phi21 = PI - phi12;
221		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
222		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
223		vec3 phi23 = vec3( 0.0 );
224		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
225		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
226		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
227		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
228		vec3 phi = vec3( phi21 ) + phi23;
229		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
230		vec3 r123 = sqrt( R123 );
231		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
232		vec3 C0 = R12 + Rs;
233		I = C0;
234		vec3 Cm = Rs - T121;
235		for ( int m = 1; m <= 2; ++ m ) {
236			Cm *= r123;
237			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
238			I += Cm * Sm;
239		}
240		return max( I, vec3( 0.0 ) );
241	}
242#endif`,gV=`#ifdef USE_BUMPMAP
243	uniform sampler2D bumpMap;
244	uniform float bumpScale;
245	vec2 dHdxy_fwd() {
246		vec2 dSTdx = dFdx( vBumpMapUv );
247		vec2 dSTdy = dFdy( vBumpMapUv );
248		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
249		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
250		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
251		return vec2( dBx, dBy );
252	}
253	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
254		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
255		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
256		vec3 vN = surf_norm;
257		vec3 R1 = cross( vSigmaY, vN );
258		vec3 R2 = cross( vN, vSigmaX );
259		float fDet = dot( vSigmaX, R1 ) * faceDirection;
260		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
261		return normalize( abs( fDet ) * surf_norm - vGrad );
262	}
263#endif`,vV=`#if NUM_CLIPPING_PLANES > 0
264	vec4 plane;
265	#ifdef ALPHA_TO_COVERAGE
266		float distanceToPlane, distanceGradient;
267		float clipOpacity = 1.0;
268		#pragma unroll_loop_start
269		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
270			plane = clippingPlanes[ i ];
271			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
272			distanceGradient = fwidth( distanceToPlane ) / 2.0;
273			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
274			if ( clipOpacity == 0.0 ) discard;
275		}
276		#pragma unroll_loop_end
277		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
278			float unionClipOpacity = 1.0;
279			#pragma unroll_loop_start
280			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
281				plane = clippingPlanes[ i ];
282				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
283				distanceGradient = fwidth( distanceToPlane ) / 2.0;
284				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
285			}
286			#pragma unroll_loop_end
287			clipOpacity *= 1.0 - unionClipOpacity;
288		#endif
289		diffuseColor.a *= clipOpacity;
290		if ( diffuseColor.a == 0.0 ) discard;
291	#else
292		#pragma unroll_loop_start
293		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
294			plane = clippingPlanes[ i ];
295			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
296		}
297		#pragma unroll_loop_end
298		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
299			bool clipped = true;
300			#pragma unroll_loop_start
301			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
302				plane = clippingPlanes[ i ];
303				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
304			}
305			#pragma unroll_loop_end
306			if ( clipped ) discard;
307		#endif
308	#endif
309#endif`,xV=`#if NUM_CLIPPING_PLANES > 0
310	varying vec3 vClipPosition;
311	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
312#endif`,yV=`#if NUM_CLIPPING_PLANES > 0
313	varying vec3 vClipPosition;
314#endif`,_V=`#if NUM_CLIPPING_PLANES > 0
315	vClipPosition = - mvPosition.xyz;
316#endif`,bV=`#if defined( USE_COLOR_ALPHA )
317	diffuseColor *= vColor;
318#elif defined( USE_COLOR )
319	diffuseColor.rgb *= vColor;
320#endif`,wV=`#if defined( USE_COLOR_ALPHA )
321	varying vec4 vColor;
322#elif defined( USE_COLOR )
323	varying vec3 vColor;
324#endif`,SV=`#if defined( USE_COLOR_ALPHA )
325	varying vec4 vColor;
326#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
327	varying vec3 vColor;
328#endif`,MV=`#if defined( USE_COLOR_ALPHA )
329	vColor = vec4( 1.0 );
330#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
331	vColor = vec3( 1.0 );
332#endif
333#ifdef USE_COLOR
334	vColor *= color;
335#endif
336#ifdef USE_INSTANCING_COLOR
337	vColor.xyz *= instanceColor.xyz;
338#endif
339#ifdef USE_BATCHING_COLOR
340	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
341	vColor.xyz *= batchingColor.xyz;
342#endif`,TV=`#define PI 3.141592653589793
343#define PI2 6.283185307179586
344#define PI_HALF 1.5707963267948966
345#define RECIPROCAL_PI 0.3183098861837907
346#define RECIPROCAL_PI2 0.15915494309189535
347#define EPSILON 1e-6
348#ifndef saturate
349#define saturate( a ) clamp( a, 0.0, 1.0 )
350#endif
351#define whiteComplement( a ) ( 1.0 - saturate( a ) )
352float pow2( const in float x ) { return x*x; }
353vec3 pow2( const in vec3 x ) { return x*x; }
354float pow3( const in float x ) { return x*x*x; }
355float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
356float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
357float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
358highp float rand( const in vec2 uv ) {
359	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
360	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
361	return fract( sin( sn ) * c );
362}
363#ifdef HIGH_PRECISION
364	float precisionSafeLength( vec3 v ) { return length( v ); }
365#else
366	float precisionSafeLength( vec3 v ) {
367		float maxComponent = max3( abs( v ) );
368		return length( v / maxComponent ) * maxComponent;
369	}
370#endif
371struct IncidentLight {
372	vec3 color;
373	vec3 direction;
374	bool visible;
375};
376struct ReflectedLight {
377	vec3 directDiffuse;
378	vec3 directSpecular;
379	vec3 indirectDiffuse;
380	vec3 indirectSpecular;
381};
382#ifdef USE_ALPHAHASH
383	varying vec3 vPosition;
384#endif
385vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
386	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
387}
388vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
389	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
390}
391bool isPerspectiveMatrix( mat4 m ) {
392	return m[ 2 ][ 3 ] == - 1.0;
393}
394vec2 equirectUv( in vec3 dir ) {
395	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
396	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
397	return vec2( u, v );
398}
399vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
400	return RECIPROCAL_PI * diffuseColor;
401}
402vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
403	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
404	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
405}
406float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
407	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
408	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
409} // validated`,EV=`#ifdef ENVMAP_TYPE_CUBE_UV
410	#define cubeUV_minMipLevel 4.0
411	#define cubeUV_minTileSize 16.0
412	float getFace( vec3 direction ) {
413		vec3 absDirection = abs( direction );
414		float face = - 1.0;
415		if ( absDirection.x > absDirection.z ) {
416			if ( absDirection.x > absDirection.y )
417				face = direction.x > 0.0 ? 0.0 : 3.0;
418			else
419				face = direction.y > 0.0 ? 1.0 : 4.0;
420		} else {
421			if ( absDirection.z > absDirection.y )
422				face = direction.z > 0.0 ? 2.0 : 5.0;
423			else
424				face = direction.y > 0.0 ? 1.0 : 4.0;
425		}
426		return face;
427	}
428	vec2 getUV( vec3 direction, float face ) {
429		vec2 uv;
430		if ( face == 0.0 ) {
431			uv = vec2( direction.z, direction.y ) / abs( direction.x );
432		} else if ( face == 1.0 ) {
433			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
434		} else if ( face == 2.0 ) {
435			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
436		} else if ( face == 3.0 ) {
437			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
438		} else if ( face == 4.0 ) {
439			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
440		} else {
441			uv = vec2( direction.x, direction.y ) / abs( direction.z );
442		}
443		return 0.5 * ( uv + 1.0 );
444	}
445	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
446		float face = getFace( direction );
447		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
448		mipInt = max( mipInt, cubeUV_minMipLevel );
449		float faceSize = exp2( mipInt );
450		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
451		if ( face > 2.0 ) {
452			uv.y += faceSize;
453			face -= 3.0;
454		}
455		uv.x += face * faceSize;
456		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
457		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
458		uv.x *= CUBEUV_TEXEL_WIDTH;
459		uv.y *= CUBEUV_TEXEL_HEIGHT;
460		#ifdef texture2DGradEXT
461			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
462		#else
463			return texture2D( envMap, uv ).rgb;
464		#endif
465	}
466	#define cubeUV_r0 1.0
467	#define cubeUV_m0 - 2.0
468	#define cubeUV_r1 0.8
469	#define cubeUV_m1 - 1.0
470	#define cubeUV_r4 0.4
471	#define cubeUV_m4 2.0
472	#define cubeUV_r5 0.305
473	#define cubeUV_m5 3.0
474	#define cubeUV_r6 0.21
475	#define cubeUV_m6 4.0
476	float roughnessToMip( float roughness ) {
477		float mip = 0.0;
478		if ( roughness >= cubeUV_r1 ) {
479			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
480		} else if ( roughness >= cubeUV_r4 ) {
481			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
482		} else if ( roughness >= cubeUV_r5 ) {
483			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
484		} else if ( roughness >= cubeUV_r6 ) {
485			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
486		} else {
487			mip = - 2.0 * log2( 1.16 * roughness );		}
488		return mip;
489	}
490	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
491		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
492		float mipF = fract( mip );
493		float mipInt = floor( mip );
494		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
495		if ( mipF == 0.0 ) {
496			return vec4( color0, 1.0 );
497		} else {
498			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
499			return vec4( mix( color0, color1, mipF ), 1.0 );
500		}
501	}
502#endif`,AV=`vec3 transformedNormal = objectNormal;
503#ifdef USE_TANGENT
504	vec3 transformedTangent = objectTangent;
505#endif
506#ifdef USE_BATCHING
507	mat3 bm = mat3( batchingMatrix );
508	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
509	transformedNormal = bm * transformedNormal;
510	#ifdef USE_TANGENT
511		transformedTangent = bm * transformedTangent;
512	#endif
513#endif
514#ifdef USE_INSTANCING
515	mat3 im = mat3( instanceMatrix );
516	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
517	transformedNormal = im * transformedNormal;
518	#ifdef USE_TANGENT
519		transformedTangent = im * transformedTangent;
520	#endif
521#endif
522transformedNormal = normalMatrix * transformedNormal;
523#ifdef FLIP_SIDED
524	transformedNormal = - transformedNormal;
525#endif
526#ifdef USE_TANGENT
527	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
528	#ifdef FLIP_SIDED
529		transformedTangent = - transformedTangent;
530	#endif
531#endif`,CV=`#ifdef USE_DISPLACEMENTMAP
532	uniform sampler2D displacementMap;
533	uniform float displacementScale;
534	uniform float displacementBias;
535#endif`,RV=`#ifdef USE_DISPLACEMENTMAP
536	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
536placementBias );
537#endif`,PV=`#ifdef USE_EMISSIVEMAP
538	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
539	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
540		emissiveColor = sRGBTransferEOTF( emissiveColor );
541	#endif
542	totalEmissiveRadiance *= emissiveColor.rgb;
543#endif`,IV=`#ifdef USE_EMISSIVEMAP
544	uniform sampler2D emissiveMap;
545#endif`,NV="gl_FragColor = linearToOutputTexel( gl_FragColor );",LV=`vec4 LinearTransferOETF( in vec4 value ) {
546	return value;
547}
548vec4 sRGBTransferEOTF( in vec4 value ) {
549	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 );
550}
551vec4 sRGBTransferOETF( in vec4 value ) {
552	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 );
553}`,OV=`#ifdef USE_ENVMAP
554	#ifdef ENV_WORLDPOS
555		vec3 cameraToFrag;
556		if ( isOrthographic ) {
557			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
558		} else {
559			cameraToFrag = normalize( vWorldPosition - cameraPosition );
560		}
561		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
562		#ifdef ENVMAP_MODE_REFLECTION
563			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
564		#else
565			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
566		#endif
567	#else
568		vec3 reflectVec = vReflect;
569	#endif
570	#ifdef ENVMAP_TYPE_CUBE
571		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
572	#else
573		vec4 envColor = vec4( 0.0 );
574	#endif
575	#ifdef ENVMAP_BLENDING_MULTIPLY
576		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
577	#elif defined( ENVMAP_BLENDING_MIX )
578		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
579	#elif defined( ENVMAP_BLENDING_ADD )
580		outgoingLight += envColor.xyz * specularStrength * reflectivity;
581	#endif
582#endif`,DV=`#ifdef USE_ENVMAP
583	uniform float envMapIntensity;
584	uniform float flipEnvMap;
585	uniform mat3 envMapRotation;
586	#ifdef ENVMAP_TYPE_CUBE
587		uniform samplerCube envMap;
588	#else
589		uniform sampler2D envMap;
590	#endif
591#endif`,kV=`#ifdef USE_ENVMAP
592	uniform float reflectivity;
593	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
594		#define ENV_WORLDPOS
595	#endif
596	#ifdef ENV_WORLDPOS
597		varying vec3 vWorldPosition;
598		uniform float refractionRatio;
599	#else
600		varying vec3 vReflect;
601	#endif
602#endif`,FV=`#ifdef USE_ENVMAP
603	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
604		#define ENV_WORLDPOS
605	#endif
606	#ifdef ENV_WORLDPOS
607		
608		varying vec3 vWorldPosition;
609	#else
610		varying vec3 vReflect;
611		uniform float refractionRatio;
612	#endif
613#endif`,UV=`#ifdef USE_ENVMAP
614	#ifdef ENV_WORLDPOS
615		vWorldPosition = worldPosition.xyz;
616	#else
617		vec3 cameraToVertex;
618		if ( isOrthographic ) {
619			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
620		} else {
621			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
622		}
623		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
624		#ifdef ENVMAP_MODE_REFLECTION
625			vReflect = reflect( cameraToVertex, worldNormal );
626		#else
627			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
628		#endif
629	#endif
630#endif`,BV=`#ifdef USE_FOG
631	vFogDepth = - mvPosition.z;
632#endif`,zV=`#ifdef USE_FOG
633	varying float vFogDepth;
634#endif`,VV=`#ifdef USE_FOG
635	#ifdef FOG_EXP2
636		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
637	#else
638		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
639	#endif
640	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
641#endif`,HV=`#ifdef USE_FOG
642	uniform vec3 fogColor;
643	varying float vFogDepth;
644	#ifdef FOG_EXP2
645		uniform float fogDensity;
646	#else
647		uniform float fogNear;
648		uniform float fogFar;
649	#endif
650#endif`,GV=`#ifdef USE_GRADIENTMAP
651	uniform sampler2D gradientMap;
652#endif
653vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
654	float dotNL = dot( normal, lightDirection );
655	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
656	#ifdef USE_GRADIENTMAP
657		return vec3( texture2D( gradientMap, coord ).r );
658	#else
659		vec2 fw = fwidth( coord ) * 0.5;
660		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
661	#endif
662}`,WV=`#ifdef USE_LIGHTMAP
663	uniform sampler2D lightMap;
664	uniform float lightMapIntensity;
665#endif`,$V=`LambertMaterial material;
666material.diffuseColor = diffuseColor.rgb;
667material.specularStrength = specularStrength;`,jV=`varying vec3 vViewPosition;
668struct LambertMaterial {
669	vec3 diffuseColor;
670	float specularStrength;
671};
672void 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 ) {
673	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
674	vec3 irradiance = dotNL * directLight.color;
675	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
676}
677void 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 ) {
678	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
679}
680#define RE_Direct				RE_Direct_Lambert
681#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,qV=`uniform bool receiveShadow;
682uniform vec3 ambientLightColor;
683#if defined( USE_LIGHT_PROBES )
684	uniform vec3 lightProbe[ 9 ];
685#endif
686vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
687	float x = normal.x, y = normal.y, z = normal.z;
688	vec3 result = shCoefficients[ 0 ] * 0.886227;
689	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
690	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
691	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
692	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
693	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
694	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
695	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
696	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
697	return result;
698}
699vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
700	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
701	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
702	return irradiance;
703}
704vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
705	vec3 irradiance = ambientLightColor;
706	return irradiance;
707}
708float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
709	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
710	if ( cutoffDistance > 0.0 ) {
711		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
712	}
713	return distanceFalloff;
714}
715float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
716	return smoothstep( coneCosine, penumbraCosine, angleCosine );
717}
718#if NUM_DIR_LIGHTS > 0
719	struct DirectionalLight {
720		vec3 direction;
721		vec3 color;
722	};
723	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
724	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
725		light.color = directionalLight.color;
726		light.direction = directionalLight.direction;
727		light.visible = true;
728	}
729#endif
730#if NUM_POINT_LIGHTS > 0
731	struct PointLight {
732		vec3 position;
733		vec3 color;
734		float distance;
735		float decay;
736	};
737	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
738	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
739		vec3 lVector = pointLight.position - geometryPosition;
740		light.direction = normalize( lVector );
741		float lightDistance = length( lVector );
742		light.color = pointLight.color;
743		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
744		light.visible = ( light.color != vec3( 0.0 ) );
745	}
746#endif
747#if NUM_SPOT_LIGHTS > 0
748	struct SpotLight {
749		vec3 position;
750		vec3 direction;
751		vec3 color;
752		float distance;
753		float decay;
754		float coneCos;
755		float penumbraCos;
756	};
757	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
758	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
759		vec3 lVector = spotLight.position - geometryPosition;
760		light.direction = normalize( lVector );
761		float angleCos = dot( light.direction, spotLight.direction );
762		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
763		if ( spotAttenuation > 0.0 ) {
764			float lightDistance = length( lVector );
765			light.color = spotLight.color * spotAttenuation;
766			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
767			light.visible = ( light.color != vec3( 0.0 ) );
768		} else {
769			light.color = vec3( 0.0 );
770			light.visible = false;
771		}
772	}
773#endif
774#if NUM_RECT_AREA_LIGHTS > 0
775	struct RectAreaLight {
776		vec3 color;
777		vec3 position;
778		vec3 halfWidth;
779		vec3 halfHeight;
780	};
781	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
782	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
783#endif
784#if NUM_HEMI_LIGHTS > 0
785	struct HemisphereLight {
786		vec3 direction;
787		vec3 skyColor;
788		vec3 groundColor;
789	};
790	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
791	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
792		float dotNL = dot( normal, hemiLight.direction );
793		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
794		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
795		return irradiance;
796	}
797#endif`,XV=`#ifdef USE_ENVMAP
798	vec3 getIBLIrradiance( const in vec3 normal ) {
799		#ifdef ENVMAP_TYPE_CUBE_UV
800			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
801			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
802			return PI * envMapColor.rgb * envMapIntensity;
803		#else
804			return vec3( 0.0 );
805		#endif
806	}
807	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
808		#ifdef ENVMAP_TYPE_CUBE_UV
809			vec3 reflectVec = reflect( - viewDir, normal );
810			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
811			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
812			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
813			return envMapColor.rgb * envMapIntensity;
814		#else
815			return vec3( 0.0 );
816		#endif
817	}
818	#ifdef USE_ANISOTROPY
819		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
820			#ifdef ENVMAP_TYPE_CUBE_UV
821				vec3 bentNormal = cross( bitangent, viewDir );
822				bentNormal = normalize( cross( bentNormal, bitangent ) );
823				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
824				return getIBLRadiance( viewDir, bentNormal, roughness );
825			#else
826				return vec3( 0.0 );
827			#endif
828		}
829	#endif
830#endif`,YV=`ToonMaterial material;
831material.diffuseColor = diffuseColor.rgb;`,KV=`varying vec3 vViewPosition;
832struct ToonMaterial {
833	vec3 diffuseColor;
834};
835void 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 ) {
836	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
837	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
838}
839void 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 ) {
840	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
841}
842#define RE_Direct				RE_Direct_Toon
843#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,ZV=`BlinnPhongMaterial material;
844material.diffuseColor = diffuseColor.rgb;
845material.specularColor = specular;
846material.specularShininess = shininess;
847material.specularStrength = specularStrength;`,JV=`varying vec3 vViewPosition;
848struct BlinnPhongMaterial {
849	vec3 diffuseColor;
850	vec3 specularColor;
851	float specularShininess;
852	float specularStrength;
853};
854void 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 ) {
855	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
856	vec3 irradiance = dotNL * directLight.color;
857	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
858	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
859}
860void 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 ) {
861	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
862}
863#define RE_Direct				RE_Direct_BlinnPhong
864#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,QV=`PhysicalMaterial material;
865material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
866vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
867float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
868material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
869material.roughness = min( material.roughness, 1.0 );
870#ifdef IOR
871	material.ior = ior;
872	#ifdef USE_SPECULAR
873		float specularIntensityFactor = specularIntensity;
874		vec3 specularColorFactor = specularColor;
875		#ifdef USE_SPECULAR_COLORMAP
876			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
877		#endif
878		#ifdef USE_SPECULAR_INTENSITYMAP
879			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
880		#endif
881		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
882	#else
883		float specularIntensityFactor = 1.0;
884		vec3 specularColorFactor = vec3( 1.0 );
885		material.specularF90 = 1.0;
886	#endif
887	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
888#else
889	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
890	material.specularF90 = 1.0;
891#endif
892#ifdef USE_CLEARCOAT
893	material.clearcoat = clearcoat;
894	material.clearcoatRoughness = clearcoatRoughness;
895	material.clearcoatF0 = vec3( 0.04 );
896	material.clearcoatF90 = 1.0;
897	#ifdef USE_CLEARCOATMAP
898		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
899	#endif
900	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
901		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
902	#endif
903	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
904	material.clearcoatRoughness += geometryRoughness;
905	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
906#endif
907#ifdef USE_DISPERSION
908	material.dispersion = dispersion;
909#endif
910#ifdef USE_IRIDESCENCE
911	material.iridescence = iridescence;
912	material.iridescenceIOR = iridescenceIOR;
913	#ifdef USE_IRIDESCENCEMAP
914		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
915	#endif
916	#ifdef USE_IRIDESCENCE_THICKNESSMAP
917		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
918	#else
919		material.iridescenceThickness = iridescenceThicknessMaximum;
920	#endif
921#endif
922#ifdef USE_SHEEN
923	material.sheenColor = sheenColor;
924	#ifdef USE_SHEEN_COLORMAP
925		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
926	#endif
927	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
928	#ifdef USE_SHEEN_ROUGHNESSMAP
929		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
930	#endif
931#endif
932#ifdef USE_ANISOTROPY
933	#ifdef USE_ANISOTROPYMAP
934		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
935		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
936		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
937	#else
938		vec2 anisotropyV = anisotropyVector;
939	#endif
940	material.anisotropy = length( anisotropyV );
941	if( material.anisotropy == 0.0 ) {
942		anisotropyV = vec2( 1.0, 0.0 );
943	} else {
944		anisotropyV /= material.anisotropy;
945		material.anisotropy = saturate( material.anisotropy );
946	}
947	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
948	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
949	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
950#endif`,e6=`uniform sampler2D dfgLUT;
951struct PhysicalMaterial {
952	vec3 diffuseColor;
953	float roughness;
954	vec3 specularColor;
955	float specularF90;
956	float dispersion;
957	#ifdef USE_CLEARCOAT
958		float clearcoat;
959		float clearcoatRoughness;
960		vec3 clearcoatF0;
961		float clearcoatF90;
962	#endif
963	#ifdef USE_IRIDESCENCE
964		float iridescence;
965		float iridescenceIOR;
966		float iridescenceThickness;
967		vec3 iridescenceFresnel;
968		vec3 iridescenceF0;
969	#endif
970	#ifdef USE_SHEEN
971		vec3 sheenColor;
972		float sheenRoughness;
973	#endif
974	#ifdef IOR
975		float ior;
976	#endif
977	#ifdef USE_TRANSMISSION
978		float transmission;
979		float transmissionAlpha;
980		float thickness;
981		float attenuationDistance;
982		vec3 attenuationColor;
983	#endif
984	#ifdef USE_ANISOTROPY
985		float anisotropy;
986		float alphaT;
987		vec3 anisotropyT;
988		vec3 anisotropyB;
989	#endif
990};
991vec3 clearcoatSpecularDirect = vec3( 0.0 );
992vec3 clearcoatSpecularIndirect = vec3( 0.0 );
993vec3 sheenSpecularDirect = vec3( 0.0 );
994vec3 sheenSpecularIndirect = vec3(0.0 );
995vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
996    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
997    float x2 = x * x;
998    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
999    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
1000}
1001float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
1002	float a2 = pow2( alpha );
1003	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
1004	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
1005	return 0.5 / max( gv + gl, EPSILON );
1006}
1007float D_GGX( const in float alpha, const in float dotNH ) {
1008	float a2 = pow2( alpha );
1009	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1010	return RECIPROCAL_PI * a2 / pow2( denom );
1011}
1012#ifdef USE_ANISOTROPY
1013	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 ) {
1014		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1015		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1016		float v = 0.5 / ( gv + gl );
1017		return saturate(v);
1018	}
1019	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1020		float a2 = alphaT * alphaB;
1021		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1022		highp float v2 = dot( v, v );
1023		float w2 = a2 / v2;
1024		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1025	}
1026#endif
1027#ifdef USE_CLEARCOAT
1028	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1029		vec3 f0 = material.clearcoatF0;
1030		float f90 = material.clearcoatF90;
1031		float roughness = material.clearcoatRoughness;
1032		float alpha = pow2( roughness );
1033		vec3 halfDir = normalize( lightDir + viewDir );
1034		float dotNL = saturate( dot( normal, lightDir ) );
1035		float dotNV = saturate( dot( normal, viewDir ) );
1036		float dotNH = saturate( dot( normal, halfDir ) );
1037		float dotVH = saturate( dot( viewDir, halfDir ) );
1038		vec3 F = F_Schlick( f0, f90, dotVH );
1039		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1040		float D = D_GGX( alpha, dotNH );
1041		return F * ( V * D );
1042	}
1043#endif
1044vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1045	vec3 f0 = material.specularColor;
1046	float f90 = material.specularF90;
1047	float roughness = material.roughness;
1048	float alpha = pow2( roughness );
1049	vec3 halfDir = normalize( lightDir + viewDir );
1050	float dotNL = saturate( dot( normal, lightDir ) );
1051	float dotNV = saturate( dot( normal, viewDir ) );
1052	float dotNH = saturate( dot( normal, halfDir ) );
1053	float dotVH = saturate( dot( viewDir, halfDir ) );
1054	vec3 F = F_Schlick( f0, f90, dotVH );
1055	#ifdef USE_IRIDESCENCE
1056		F = mix( F, material.iridescenceFresnel, material.iridescence );
1057	#endif
1058	#ifdef USE_ANISOTROPY
1059		float dotTL = dot( material.anisotropyT, lightDir );
1060		float dotTV = dot( material.anisotropyT, viewDir );
1061		float dotTH = dot( material.anisotropyT, halfDir );
1062		float dotBL = dot( material.anisotropyB, lightDir );
1063		float dotBV = dot( material.anisotropyB, viewDir );
1064		float dotBH = dot( material.anisotropyB, halfDir );
1065		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1066		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1067	#else
1068		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1069		float D = D_GGX( alpha, dotNH );
1070	#endif
1071	return F * ( V * D );
1072}
1073vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1074	const float LUT_SIZE = 64.0;
1075	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1076	const float LUT_BIAS = 0.5 / LUT_SIZE;
1077	float dotNV = saturate( dot( N, V ) );
1078	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1079	uv = uv * LUT_SCALE + LUT_BIAS;
1080	return uv;
1081}
1082float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1083	float l = length( f );
1084	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1085}
1086vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1087	float x = dot( v1, v2 );
1088	float y = abs( x );
1089	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1090	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1091	float v = a / b;
1092	float theta_sintheta = ( x >
1092 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1093	return cross( v1, v2 ) * theta_sintheta;
1094}
1095vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1096	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1097	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1098	vec3 lightNormal = cross( v1, v2 );
1099	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1100	vec3 T1, T2;
1101	T1 = normalize( V - N * dot( V, N ) );
1102	T2 = - cross( N, T1 );
1103	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1104	vec3 coords[ 4 ];
1105	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1106	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1107	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1108	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1109	coords[ 0 ] = normalize( coords[ 0 ] );
1110	coords[ 1 ] = normalize( coords[ 1 ] );
1111	coords[ 2 ] = normalize( coords[ 2 ] );
1112	coords[ 3 ] = normalize( coords[ 3 ] );
1113	vec3 vectorFormFactor = vec3( 0.0 );
1114	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1115	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1116	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1117	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1118	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1119	return vec3( result );
1120}
1121#if defined( USE_SHEEN )
1122float D_Charlie( float roughness, float dotNH ) {
1123	float alpha = pow2( roughness );
1124	float invAlpha = 1.0 / alpha;
1125	float cos2h = dotNH * dotNH;
1126	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1127	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1128}
1129float V_Neubelt( float dotNV, float dotNL ) {
1130	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1131}
1132vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1133	vec3 halfDir = normalize( lightDir + viewDir );
1134	float dotNL = saturate( dot( normal, lightDir ) );
1135	float dotNV = saturate( dot( normal, viewDir ) );
1136	float dotNH = saturate( dot( normal, halfDir ) );
1137	float D = D_Charlie( sheenRoughness, dotNH );
1138	float V = V_Neubelt( dotNV, dotNL );
1139	return sheenColor * ( D * V );
1140}
1141#endif
1142float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1143	float dotNV = saturate( dot( normal, viewDir ) );
1144	float r2 = roughness * roughness;
1145	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
1146	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
1147	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
1148	return saturate( DG * RECIPROCAL_PI );
1149}
1150vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1151	float dotNV = saturate( dot( normal, viewDir ) );
1152	vec2 uv = vec2( roughness, dotNV );
1153	return texture2D( dfgLUT, uv ).rg;
1154}
1155vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1156	vec2 fab = DFGApprox( normal, viewDir, roughness );
1157	return specularColor * fab.x + specularF90 * fab.y;
1158}
1159#ifdef USE_IRIDESCENCE
1160void 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 ) {
1161#else
1162void 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 ) {
1163#endif
1164	vec2 fab = DFGApprox( normal, viewDir, roughness );
1165	#ifdef USE_IRIDESCENCE
1166		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1167	#else
1168		vec3 Fr = specularColor;
1169	#endif
1170	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1171	float Ess = fab.x + fab.y;
1172	float Ems = 1.0 - Ess;
1173	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1174	singleScatter += FssEss;
1175	multiScatter += Fms * Ems;
1176}
1177vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1178	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
1179	float dotNL = saturate( dot( normal, lightDir ) );
1180	float dotNV = saturate( dot( normal, viewDir ) );
1181	vec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness );
1182	vec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness );
1183	vec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y;
1184	vec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y;
1185	float Ess_V = dfgV.x + dfgV.y;
1186	float Ess_L = dfgL.x + dfgL.y;
1187	float Ems_V = 1.0 - Ess_V;
1188	float Ems_L = 1.0 - Ess_L;
1189	vec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619;
1190	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON );
1191	float compensationFactor = Ems_V * Ems_L;
1192	vec3 multiScatter = Fms * compensationFactor;
1193	return singleScatter + multiScatter;
1194}
1195#if NUM_RECT_AREA_LIGHTS > 0
1196	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 ) {
1197		vec3 normal = geometryNormal;
1198		vec3 viewDir = geometryViewDir;
1199		vec3 position = geometryPosition;
1200		vec3 lightPos = rectAreaLight.position;
1201		vec3 halfWidth = rectAreaLight.halfWidth;
1202		vec3 halfHeight = rectAreaLight.halfHeight;
1203		vec3 lightColor = rectAreaLight.color;
1204		float roughness = material.roughness;
1205		vec3 rectCoords[ 4 ];
1206		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1207		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1208		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1209		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1210		vec4 t1 = texture2D( ltc_1, uv );
1211		vec4 t2 = texture2D( ltc_2, uv );
1212		mat3 mInv = mat3(
1213			vec3( t1.x, 0, t1.y ),
1214			vec3(    0, 1,    0 ),
1215			vec3( t1.z, 0, t1.w )
1216		);
1217		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
1218		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1219		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1220	}
1221#endif
1222void 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 ) {
1223	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1224	vec3 irradiance = dotNL * directLight.color;
1225	#ifdef USE_CLEARCOAT
1226		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1227		vec3 ccIrradiance = dotNLcc * directLight.color;
1228		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1229	#endif
1230	#ifdef USE_SHEEN
1231		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1232	#endif
1233	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1234	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1235}
1236void 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 ) {
1237	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1238}
1239void 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) {
1240	#ifdef USE_CLEARCOAT
1241		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1242	#endif
1243	#ifdef USE_SHEEN
1244		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1245	#endif
1246	vec3 singleScattering = vec3( 0.0 );
1247	vec3 multiScattering = vec3( 0.0 );
1248	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1249	#ifdef USE_IRIDESCENCE
1250		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
1251	#else
1252		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
1253	#endif
1254	vec3 totalScattering = singleScattering + multiScattering;
1255	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
1256	reflectedLight.indirectSpecular += radiance * singleScattering;
1257	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
1258	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
1259}
1260#define RE_Direct				RE_Direct_Physical
1261#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1262#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1263#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1264float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1265	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1266}`,t6=`
1267vec3 geometryPosition = - vViewPosition;
1268vec3 geometryNormal = normal;
1269vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1270vec3 geometryClearcoatNormal = vec3( 0.0 );
1271#ifdef USE_CLEARCOAT
1272	geometryClearcoatNormal = clearcoatNormal;
1273#endif
1274#ifdef USE_IRIDESCENCE
1275	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1276	if ( material.iridescenceThickness == 0.0 ) {
1277		material.iridescence = 0.0;
1278	} else {
1279		material.iridescence = saturate( material.iridescence );
1280	}
1281	if ( material.iridescence > 0.0 ) {
1282		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1283		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1284	}
1285#endif
1286IncidentLight directLight;
1287#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1288	PointLight pointLight;
1289	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1290	PointLightShadow pointLightShadow;
1291	#endif
1292	#pragma unroll_loop_start
1293	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1294		pointLight = pointLights[ i ];
1295		getPointLightInfo( pointLight, geometryPosition, directLight );
1296		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
1297		pointLightShadow = pointLightShadows[ i ];
1298		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1299		#endif
1300		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1301	}
1302	#pragma unroll_loop_end
1303#endif
1304#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1305	SpotLight spotLight;
1306	vec4 spotColor;
1307	vec3 spotLightCoord;
1308	bool inSpotLightMap;
1309	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1310	SpotLightShadow spotLightShadow;
1311	#endif
1312	#pragma unroll_loop_start
1313	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1314		spotLight = spotLights[ i ];
1315		getSpotLightInfo( spotLight, geometryPosition, directLight );
1316		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1317		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1318		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1319		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1320		#else
1321		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1322		#endif
1323		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1324			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1325			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1326			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1327			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1328		#endif
1329		#undef SPOT_LIGHT_MAP_INDEX
1330		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_L
1330IGHT_SHADOWS )
1331		spotLightShadow = spotLightShadows[ i ];
1332		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1333		#endif
1334		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1335	}
1336	#pragma unroll_loop_end
1337#endif
1338#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1339	DirectionalLight directionalLight;
1340	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1341	DirectionalLightShadow directionalLightShadow;
1342	#endif
1343	#pragma unroll_loop_start
1344	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1345		directionalLight = directionalLights[ i ];
1346		getDirectionalLightInfo( directionalLight, directLight );
1347		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1348		directionalLightShadow = directionalLightShadows[ i ];
1349		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1350		#endif
1351		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1352	}
1353	#pragma unroll_loop_end
1354#endif
1355#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1356	RectAreaLight rectAreaLight;
1357	#pragma unroll_loop_start
1358	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1359		rectAreaLight = rectAreaLights[ i ];
1360		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1361	}
1362	#pragma unroll_loop_end
1363#endif
1364#if defined( RE_IndirectDiffuse )
1365	vec3 iblIrradiance = vec3( 0.0 );
1366	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1367	#if defined( USE_LIGHT_PROBES )
1368		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1369	#endif
1370	#if ( NUM_HEMI_LIGHTS > 0 )
1371		#pragma unroll_loop_start
1372		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1373			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1374		}
1375		#pragma unroll_loop_end
1376	#endif
1377#endif
1378#if defined( RE_IndirectSpecular )
1379	vec3 radiance = vec3( 0.0 );
1380	vec3 clearcoatRadiance = vec3( 0.0 );
1381#endif`,n6=`#if defined( RE_IndirectDiffuse )
1382	#ifdef USE_LIGHTMAP
1383		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1384		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1385		irradiance += lightMapIrradiance;
1386	#endif
1387	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
1388		iblIrradiance += getIBLIrradiance( geometryNormal );
1389	#endif
1390#endif
1391#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1392	#ifdef USE_ANISOTROPY
1393		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1394	#else
1395		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1396	#endif
1397	#ifdef USE_CLEARCOAT
1398		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1399	#endif
1400#endif`,i6=`#if defined( RE_IndirectDiffuse )
1401	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1402#endif
1403#if defined( RE_IndirectSpecular )
1404	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1405#endif`,r6=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1406	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1407#endif`,s6=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1408	uniform float logDepthBufFC;
1409	varying float vFragDepth;
1410	varying float vIsPerspective;
1411#endif`,o6=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1412	varying float vFragDepth;
1413	varying float vIsPerspective;
1414#endif`,a6=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1415	vFragDepth = 1.0 + gl_Position.w;
1416	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1417#endif`,l6=`#ifdef USE_MAP
1418	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1419	#ifdef DECODE_VIDEO_TEXTURE
1420		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1421	#endif
1422	diffuseColor *= sampledDiffuseColor;
1423#endif`,c6=`#ifdef USE_MAP
1424	uniform sampler2D map;
1425#endif`,u6=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1426	#if defined( USE_POINTS_UV )
1427		vec2 uv = vUv;
1428	#else
1429		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1430	#endif
1431#endif
1432#ifdef USE_MAP
1433	diffuseColor *= texture2D( map, uv );
1434#endif
1435#ifdef USE_ALPHAMAP
1436	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1437#endif`,h6=`#if defined( USE_POINTS_UV )
1438	varying vec2 vUv;
1439#else
1440	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1441		uniform mat3 uvTransform;
1442	#endif
1443#endif
1444#ifdef USE_MAP
1445	uniform sampler2D map;
1446#endif
1447#ifdef USE_ALPHAMAP
1448	uniform sampler2D alphaMap;
1449#endif`,d6=`float metalnessFactor = metalness;
1450#ifdef USE_METALNESSMAP
1451	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1452	metalnessFactor *= texelMetalness.b;
1453#endif`,f6=`#ifdef USE_METALNESSMAP
1454	uniform sampler2D metalnessMap;
1455#endif`,p6=`#ifdef USE_INSTANCING_MORPH
1456	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1457	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1458	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1459		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1460	}
1461#endif`,m6=`#if defined( USE_MORPHCOLORS )
1462	vColor *= morphTargetBaseInfluence;
1463	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1464		#if defined( USE_COLOR_ALPHA )
1465			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1466		#elif defined( USE_COLOR )
1467			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1468		#endif
1469	}
1470#endif`,g6=`#ifdef USE_MORPHNORMALS
1471	objectNormal *= morphTargetBaseInfluence;
1472	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1473		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1474	}
1475#endif`,v6=`#ifdef USE_MORPHTARGETS
1476	#ifndef USE_INSTANCING_MORPH
1477		uniform float morphTargetBaseInfluence;
1478		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1479	#endif
1480	uniform sampler2DArray morphTargetsTexture;
1481	uniform ivec2 morphTargetsTextureSize;
1482	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1483		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1484		int y = texelIndex / morphTargetsTextureSize.x;
1485		int x = texelIndex - y * morphTargetsTextureSize.x;
1486		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1487		return texelFetch( morphTargetsTexture, morphUV, 0 );
1488	}
1489#endif`,x6=`#ifdef USE_MORPHTARGETS
1490	transformed *= morphTargetBaseInfluence;
1491	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1492		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1493	}
1494#endif`,y6=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1495#ifdef FLAT_SHADED
1496	vec3 fdx = dFdx( vViewPosition );
1497	vec3 fdy = dFdy( vViewPosition );
1498	vec3 normal = normalize( cross( fdx, fdy ) );
1499#else
1500	vec3 normal = normalize( vNormal );
1501	#ifdef DOUBLE_SIDED
1502		normal *= faceDirection;
1503	#endif
1504#endif
1505#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1506	#ifdef USE_TANGENT
1507		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1508	#else
1509		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1510		#if defined( USE_NORMALMAP )
1511			vNormalMapUv
1512		#elif defined( USE_CLEARCOAT_NORMALMAP )
1513			vClearcoatNormalMapUv
1514		#else
1515			vUv
1516		#endif
1517		);
1518	#endif
1519	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1520		tbn[0] *= faceDirection;
1521		tbn[1] *= faceDirection;
1522	#endif
1523#endif
1524#ifdef USE_CLEARCOAT_NORMALMAP
1525	#ifdef USE_TANGENT
1526		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1527	#else
1528		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1529	#endif
1530	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1531		tbn2[0] *= faceDirection;
1532		tbn2[1] *= faceDirection;
1533	#endif
1534#endif
1535vec3 nonPerturbedNormal = normal;`,_6=`#ifdef USE_NORMALMAP_OBJECTSPACE
1536	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1537	#ifdef FLIP_SIDED
1538		normal = - normal;
1539	#endif
1540	#ifdef DOUBLE_SIDED
1541		normal = normal * faceDirection;
1542	#endif
1543	normal = normalize( normalMatrix * normal );
1544#elif defined( USE_NORMALMAP_TANGENTSPACE )
1545	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1546	mapN.xy *= normalScale;
1547	normal = normalize( tbn * mapN );
1548#elif defined( USE_BUMPMAP )
1549	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1550#endif`,b6=`#ifndef FLAT_SHADED
1551	varying vec3 vNormal;
1552	#ifdef USE_TANGENT
1553		varying vec3 vTangent;
1554		varying vec3 vBitangent;
1555	#endif
1556#endif`,w6=`#ifndef FLAT_SHADED
1557	varying vec3 vNormal;
1558	#ifdef USE_TANGENT
1559		varying vec3 vTangent;
1560		varying vec3 vBitangent;
1561	#endif
1562#endif`,S6=`#ifndef FLAT_SHADED
1563	vNormal = normalize( transformedNormal );
1564	#ifdef USE_TANGENT
1565		vTangent = normalize( transformedTangent );
1566		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1567	#endif
1568#endif`,M6=`#ifdef USE_NORMALMAP
1569	uniform sampler2D normalMap;
1570	uniform vec2 normalScale;
1571#endif
1572#ifdef USE_NORMALMAP_OBJECTSPACE
1573	uniform mat3 normalMatrix;
1574#endif
1575#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1576	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1577		vec3 q0 = dFdx( eye_pos.xyz );
1578		vec3 q1 = dFdy( eye_pos.xyz );
1579		vec2 st0 = dFdx( uv.st );
1580		vec2 st1 = dFdy( uv.st );
1581		vec3 N = surf_norm;
1582		vec3 q1perp = cross( q1, N );
1583		vec3 q0perp = cross( N, q0 );
1584		vec3 T = q1perp * st0.x + q0perp * st1.x;
1585		vec3 B = q1perp * st0.y + q0perp * st1.y;
1586		float det = max( dot( T, T ), dot( B, B ) );
1587		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1588		return mat3( T * scale, B * scale, N );
1589	}
1590#endif`,T6=`#ifdef USE_CLEARCOAT
1591	vec3 clearcoatNormal = nonPerturbedNormal;
1592#endif`,E6=`#ifdef USE_CLEARCOAT_NORMALMAP
1593	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1594	clearcoatMapN.xy *= clearcoatNormalScale;
1595	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1596#endif`,A6=`#ifdef USE_CLEARCOATMAP
1597	uniform sampler2D clearcoatMap;
1598#endif
1599#ifdef USE_CLEARCOAT_NORMALMAP
1600	uniform sampler2D clearcoatNormalMap;
1601	uniform vec2 clearcoatNormalScale;
1602#endif
1603#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1604	uniform sampler2D clearcoatRoughnessMap;
1605#endif`,C6=`#ifdef USE_IRIDESCENCEMAP
1606	uniform sampler2D iridescenceMap;
1607#endif
1608#ifdef USE_IRIDESCENCE_THICKNESSMAP
1609	uniform sampler2D iridescenceThicknessMap;
1610#endif`,R6=`#ifdef OPAQUE
1611diffuseColor.a = 1.0;
1612#endif
1613#ifdef USE_TRANSMISSION
1614diffuseColor.a *= material.transmissionAlpha;
1615#endif
1616gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,P6=`vec3 packNormalToRGB( const in vec3 normal ) {
1617	return normalize( normal ) * 0.5 + 0.5;
1618}
1619vec3 unpackRGBToNormal( const in vec3 rgb ) {
1620	return 2.0 * rgb.xyz - 1.0;
1621}
1622const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1623const float Inv255 = 1. / 255.;
1624const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1625const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1626const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1627const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1628vec4 packDepthToRGBA( const in float v ) {
1629	if( v <= 0.0 )
1630		return vec4( 0., 0., 0., 0. );
1631	if( v >= 1.0 )
1632		return vec4( 1., 1., 1., 1. );
1633	float vuf;
1634	float af = modf( v * PackFactors.a, vuf );
1635	float bf = modf( vuf * ShiftRight8, vuf );
1636	float gf = modf( vuf * ShiftRight8, vuf );
1637	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1638}
1639vec3 packDepthToRGB( const in float v ) {
1640	if( v <= 0.0 )
1641		return vec3( 0., 0., 0. );
1642	if( v >= 1.0 )
1643		return vec3( 1., 1., 1. );
1644	float vuf;
1645	float bf = modf( v * PackFactors.b, vuf );
1646	float gf = modf( vuf * ShiftRight8, vuf );
1647	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1648}
1649vec2 packDepthToRG( const in float v ) {
1650	if( v <= 0.0 )
1651		return vec2( 0., 0. );
1652	if( v >= 1.0 )
1653		return vec2( 1., 1. );
1654	float vuf;
1655	float gf = modf( v * 256., vuf );
1656	return vec2( vuf * Inv255, gf );
1657}
1658float unpackRGBAToDepth( const in vec4 v ) {
1659	return dot( v, UnpackFactors4 );
1660}
1661float unpackRGBToDepth( const in vec3 v ) {
1662	return dot( v, UnpackFactors3 );
1663}
1664float unpackRGToDepth( const in vec2 v ) {
1665	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1666}
1667vec4 pack2HalfToRGBA( const in vec2 v ) {
1668	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1669	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1670}
1671vec2 unpackRGBATo2Half( const in vec4 v ) {
1672	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1673}
1674float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1675	return ( viewZ + near ) / ( near - far );
1676}
1677float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1678	return depth * ( near - far ) - near;
1679}
1680float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1681	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1682}
1683float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1684	return ( near * far ) / ( ( far - near ) * depth - far );
1685}`,I6=`#ifdef PREMULTIPLIED_ALPHA
1686	gl_FragColor.rgb *= gl_FragColor.a;
1687#endif`,N6=`vec4 mvPosition = vec4( transformed, 1.0 );
1688#ifdef USE_BATCHING
1689	mvPosition = batchingMatrix * mvPosition;
1690#endif
1691#ifdef USE_INSTANCING
1692	mvPosition = instanceMatrix * mvPosition;
1693#endif
1694mvPosition = modelViewMatrix * mvPosition;
1695gl_Position = projectionMatrix * mvPosition;`,L6=`#ifdef DITHERING
1696	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1697#endif`,O6=`#ifdef DITHERING
1698	vec3 dithering( vec3 color ) {
1699		float grid_position = rand( gl_FragCoord.xy );
1700		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1701		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1702		return color + dither_shift_RGB;
1703	}
1704#endif`,D6=`float roughnessFactor = roughness;
1705#ifdef USE_ROUGHNESSMAP
1706	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1707	roughnessFactor *= texelRoughness.g;
1708#endif`,k6=`#ifdef USE_ROUGHNESSMAP
1709	uniform sampler2D roughnessMap;
1710#endif`,F6=`#if NUM_SPOT_LIGHT_COORDS > 0
1711	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1712#endif
1713#if NUM_SPOT_LIGHT_MAPS > 0
1714	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1715#endif
1716#ifdef USE_SHADOWMAP
1717	#if NUM_DIR_LIGHT_SHADOWS > 0
1718		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1719		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1720		struct DirectionalLightShadow {
1721			float shadowIntensity;
1722			float shadowBias;
1723			float shadowNormalBias;
1724			float shadowRadius;
1725			vec2 shadowMapSize;
1726		};
1727		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1728	#endif
1729	#if NUM_SPOT_LIGHT_SHADOWS > 0
1730		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1731		struct SpotLightShadow {
1732			float shadowIntensity;
1733			float shadowBias;
1734			float shadowNormalBias;
1735			float shadowRadius;
1736			vec2 shadowMapSize;
1737		};
1738		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1739	#endif
1740	#if NUM_POINT_LIGHT_SHADOWS > 0
1741		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1742		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1743		struct PointLightShadow {
1744			float shadowIntensity;
1745			float shadowBias;
1746			float shadowNormalBias;
1747			float shadowRadius;
1748			vec2 shadowMapSize;
1749			float shadowCameraNear;
1750			float shadowCameraFar;
1751		};
1752		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1753	#endif
1754	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
1755		float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
1756		#ifdef USE_REVERSED_DEPTH_BUFFER
1757			return step( depth, compare );
1758		#else
1759			return step( compare, depth );
1760		#endif
1761	}
1762	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
1763		return unpackRGBATo2Half( texture2D( shadow, uv ) );
1764	}
1765	float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {
1766		float occlusion = 1.0;
1767		vec2 distribution = texture2DDistribution( shadow, uv );
1768		#ifdef USE_REVERSED_DEPTH_BUFFER
1769			float hard_shadow = step( distribution.x, compare );
1770		#else
1771			float hard_shadow = step( compare, distribution.x );
1772		#endif
1773		if ( hard_shadow != 1.0 ) {
1774			float distance = compare - distribution.x
vendor: 6,963 bytes, lines 1774-1905
1774;
1775			float variance = max( 0.00000, distribution.y * distribution.y );
1776			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
1777		}
1778		return occlusion;
1779	}
1780	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1781		float shadow = 1.0;
1782		shadowCoord.xyz /= shadowCoord.w;
1783		shadowCoord.z += shadowBias;
1784		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1785		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1786		if ( frustumTest ) {
1787		#if defined( SHADOWMAP_TYPE_PCF )
1788			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1789			float dx0 = - texelSize.x * shadowRadius;
1790			float dy0 = - texelSize.y * shadowRadius;
1791			float dx1 = + texelSize.x * shadowRadius;
1792			float dy1 = + texelSize.y * shadowRadius;
1793			float dx2 = dx0 / 2.0;
1794			float dy2 = dy0 / 2.0;
1795			float dx3 = dx1 / 2.0;
1796			float dy3 = dy1 / 2.0;
1797			shadow = (
1798				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
1799				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
1800				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
1801				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
1802				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
1803				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
1804				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
1805				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
1806				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
1807				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
1808				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
1809				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
1810				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
1811				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
1812				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
1813				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
1814				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
1815			) * ( 1.0 / 17.0 );
1816		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
1817			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1818			float dx = texelSize.x;
1819			float dy = texelSize.y;
1820			vec2 uv = shadowCoord.xy;
1821			vec2 f = fract( uv * shadowMapSize + 0.5 );
1822			uv -= f * texelSize;
1823			shadow = (
1824				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
1825				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
1826				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
1827				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
1828				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
1829					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
1830					 f.x ) +
1831				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
1832					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
1833					 f.x ) +
1834				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
1835					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
1836					 f.y ) +
1837				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
1838					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
1839					 f.y ) +
1840				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
1841						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
1842						  f.x ),
1843					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
1844						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
1845						  f.x ),
1846					 f.y )
1847			) * ( 1.0 / 9.0 );
1848		#elif defined( SHADOWMAP_TYPE_VSM )
1849			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
1850		#else
1851			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
1852		#endif
1853		}
1854		return mix( 1.0, shadow, shadowIntensity );
1855	}
1856	vec2 cubeToUV( vec3 v, float texelSizeY ) {
1857		vec3 absV = abs( v );
1858		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
1859		absV *= scaleToCube;
1860		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
1861		vec2 planar = v.xy;
1862		float almostATexel = 1.5 * texelSizeY;
1863		float almostOne = 1.0 - almostATexel;
1864		if ( absV.z >= almostOne ) {
1865			if ( v.z > 0.0 )
1866				planar.x = 4.0 - v.x;
1867		} else if ( absV.x >= almostOne ) {
1868			float signX = sign( v.x );
1869			planar.x = v.z * signX + 2.0 * signX;
1870		} else if ( absV.y >= almostOne ) {
1871			float signY = sign( v.y );
1872			planar.x = v.x + 2.0 * signY + 2.0;
1873			planar.y = v.z * signY - 2.0;
1874		}
1875		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
1876	}
1877	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1878		float shadow = 1.0;
1879		vec3 lightToPosition = shadowCoord.xyz;
1880		
1881		float lightToPositionLength = length( lightToPosition );
1882		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
1883			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
1884			vec3 bd3D = normalize( lightToPosition );
1885			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
1886			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
1887				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
1888				shadow = (
1889					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
1890					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
1891					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
1892					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
1893					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
1894					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
1895					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
1896					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
1897					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
1898				) * ( 1.0 / 9.0 );
1899			#else
1900				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
1901			#endif
1902		}
1903		return mix( 1.0, shadow, shadowIntensity );
1904	}
1905#endif`,
1905U6=`#if NUM_SPOT_LIGHT_COORDS > 0
1906	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1907	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1908#endif
1909#ifdef USE_SHADOWMAP
1910	#if NUM_DIR_LIGHT_SHADOWS > 0
1911		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1912		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1913		struct DirectionalLightShadow {
1914			float shadowIntensity;
1915			float shadowBias;
1916			float shadowNormalBias;
1917			float shadowRadius;
1918			vec2 shadowMapSize;
1919		};
1920		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1921	#endif
1922	#if NUM_SPOT_LIGHT_SHADOWS > 0
1923		struct SpotLightShadow {
1924			float shadowIntensity;
1925			float shadowBias;
1926			float shadowNormalBias;
1927			float shadowRadius;
1928			vec2 shadowMapSize;
1929		};
1930		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1931	#endif
1932	#if NUM_POINT_LIGHT_SHADOWS > 0
1933		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1934		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1935		struct PointLightShadow {
1936			float shadowIntensity;
1937			float shadowBias;
1938			float shadowNormalBias;
1939			float shadowRadius;
1940			vec2 shadowMapSize;
1941			float shadowCameraNear;
1942			float shadowCameraFar;
1943		};
1944		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1945	#endif
1946#endif`,B6=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1947	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1948	vec4 shadowWorldPosition;
1949#endif
1950#if defined( USE_SHADOWMAP )
1951	#if NUM_DIR_LIGHT_SHADOWS > 0
1952		#pragma unroll_loop_start
1953		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1954			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
1955			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
1956		}
1957		#pragma unroll_loop_end
1958	#endif
1959	#if NUM_POINT_LIGHT_SHADOWS > 0
1960		#pragma unroll_loop_start
1961		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
1962			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
1963			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
1964		}
1965		#pragma unroll_loop_end
1966	#endif
1967#endif
1968#if NUM_SPOT_LIGHT_COORDS > 0
1969	#pragma unroll_loop_start
1970	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
1971		shadowWorldPosition = worldPosition;
1972		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1973			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
1974		#endif
1975		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1976	}
1977	#pragma unroll_loop_end
1978#endif`,z6=`float getShadowMask() {
1979	float shadow = 1.0;
1980	#ifdef USE_SHADOWMAP
1981	#if NUM_DIR_LIGHT_SHADOWS > 0
1982	DirectionalLightShadow directionalLight;
1983	#pragma unroll_loop_start
1984	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1985		directionalLight = directionalLightShadows[ i ];
1986		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1987	}
1988	#pragma unroll_loop_end
1989	#endif
1990	#if NUM_SPOT_LIGHT_SHADOWS > 0
1991	SpotLightShadow spotLight;
1992	#pragma unroll_loop_start
1993	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
1994		spotLight = spotLightShadows[ i ];
1995		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1996	}
1997	#pragma unroll_loop_end
1998	#endif
1999	#if NUM_POINT_LIGHT_SHADOWS > 0
2000	PointLightShadow pointLight;
2001	#pragma unroll_loop_start
2002	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2003		pointLight = pointLightShadows[ i ];
2004		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2005	}
2006	#pragma unroll_loop_end
2007	#endif
2008	#endif
2009	return shadow;
2010}`,V6=`#ifdef USE_SKINNING
2011	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2012	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2013	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2014	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2015#endif`,H6=`#ifdef USE_SKINNING
2016	uniform mat4 bindMatrix;
2017	uniform mat4 bindMatrixInverse;
2018	uniform highp sampler2D boneTexture;
2019	mat4 getBoneMatrix( const in float i ) {
2020		int size = textureSize( boneTexture, 0 ).x;
2021		int j = int( i ) * 4;
2022		int x = j % size;
2023		int y = j / size;
2024		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2025		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2026		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2027		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2028		return mat4( v1, v2, v3, v4 );
2029	}
2030#endif`,G6=`#ifdef USE_SKINNING
2031	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2032	vec4 skinned = vec4( 0.0 );
2033	skinned += boneMatX * skinVertex * skinWeight.x;
2034	skinned += boneMatY * skinVertex * skinWeight.y;
2035	skinned += boneMatZ * skinVertex * skinWeight.z;
2036	skinned += boneMatW * skinVertex * skinWeight.w;
2037	transformed = ( bindMatrixInverse * skinned ).xyz;
2038#endif`,W6=`#ifdef USE_SKINNING
2039	mat4 skinMatrix = mat4( 0.0 );
2040	skinMatrix += skinWeight.x * boneMatX;
2041	skinMatrix += skinWeight.y * boneMatY;
2042	skinMatrix += skinWeight.z * boneMatZ;
2043	skinMatrix += skinWeight.w * boneMatW;
2044	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2045	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2046	#ifdef USE_TANGENT
2047		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2048	#endif
2049#endif`,$6=`float specularStrength;
2050#ifdef USE_SPECULARMAP
2051	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2052	specularStrength = texelSpecular.r;
2053#else
2054	specularStrength = 1.0;
2055#endif`,j6=`#ifdef USE_SPECULARMAP
2056	uniform sampler2D specularMap;
2057#endif`,q6=`#if defined( TONE_MAPPING )
2058	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2059#endif`,X6=`#ifndef saturate
2060#define saturate( a ) clamp( a, 0.0, 1.0 )
2061#endif
2062uniform float toneMappingExposure;
2063vec3 LinearToneMapping( vec3 color ) {
2064	return saturate( toneMappingExposure * color );
2065}
2066vec3 ReinhardToneMapping( vec3 color ) {
2067	color *= toneMappingExposure;
2068	return saturate( color / ( vec3( 1.0 ) + color ) );
2069}
2070vec3 CineonToneMapping( vec3 color ) {
2071	color *= toneMappingExposure;
2072	color = max( vec3( 0.0 ), color - 0.004 );
2073	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2074}
2075vec3 RRTAndODTFit( vec3 v ) {
2076	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2077	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2078	return a / b;
2079}
2080vec3 ACESFilmicToneMapping( vec3 color ) {
2081	const mat3 ACESInputMat = mat3(
2082		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2083		vec3( 0.04823, 0.01566, 0.83777 )
2084	);
2085	const mat3 ACESOutputMat = mat3(
2086		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2087		vec3( -0.07367, -0.00605,  1.07602 )
2088	);
2089	color *= toneMappingExposure / 0.6;
2090	color = ACESInputMat * color;
2091	color = RRTAndODTFit( color );
2092	color = ACESOutputMat * color;
2093	return saturate( color );
2094}
2095const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2096	vec3( 1.6605, - 0.1246, - 0.0182 ),
2097	vec3( - 0.5876, 1.1329, - 0.1006 ),
2098	vec3( - 0.0728, - 0.0083, 1.1187 )
2099);
2100const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2101	vec3( 0.6274, 0.0691, 0.0164 ),
2102	vec3( 0.3293, 0.9195, 0.0880 ),
2103	vec3( 0.0433, 0.0113, 0.8956 )
2104);
2105vec3 agxDefaultContrastApprox( vec3 x ) {
2106	vec3 x2 = x * x;
2107	vec3 x4 = x2 * x2;
2108	return + 15.5 * x4 * x2
2109		- 40.14 * x4 * x
2110		+ 31.96 * x4
2111		- 6.868 * x2 * x
2112		+ 0.4298 * x2
2113		+ 0.1191 * x
2114		- 0.00232;
2115}
2116vec3 AgXToneMapping( vec3 color ) {
2117	const mat3 AgXInsetMatrix = mat3(
2118		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2119		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2120		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2121	);
2122	const mat3 AgXOutsetMatrix = mat3(
2123		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2124		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2125		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2126	);
2127	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2128	color *= toneMappingExposure;
2129	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2130	color = AgXInsetMatrix * color;
2131	color = max( color, 1e-10 );	color = log2( color );
2132	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2133	color = clamp( color, 0.0, 1.0 );
2134	color = agxDefaultContrastApprox( color );
2135	color = AgXOutsetMatrix * color;
2136	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2137	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2138	color = clamp( color, 0.0, 1.0 );
2139	return color;
2140}
2141vec3 NeutralToneMapping( vec3 color ) {
2142	const float StartCompression = 0.8 - 0.04;
2143	const float Desaturation = 0.15;
2144	color *= toneMappingExposure;
2145	float x = min( color.r, min( color.g, color.b ) );
2146	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2147	color -= offset;
2148	float peak = max( color.r, max( color.g, color.b ) );
2149	if ( peak < StartCompression ) return color;
2150	float d = 1. - StartCompression;
2151	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2152	color *= newPeak / peak;
2153	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2154	return mix( color, vec3( newPeak ), g );
2155}
2156vec3 CustomToneMapping( vec3 color ) { return color; }`,Y6=`#ifdef USE_TRANSMISSION
2157	material.transmission = transmission;
2158	material.transmissionAlpha = 1.0;
2159	material.thickness = thickness;
2160	material.attenuationDistance = attenuationDistance;
2161	material.attenuationColor = attenuationColor;
2162	#ifdef USE_TRANSMISSIONMAP
2163		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2164	#endif
2165	#ifdef USE_THICKNESSMAP
2166		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2167	#endif
2168	vec3 pos = vWorldPosition;
2169	vec3 v = normalize( cameraPosition - pos );
2170	vec3 n = inverseTransformDirection( normal, viewMatrix );
2171	vec4 transmitted = getIBLVolumeRefraction(
2172		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
2173		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2174		material.attenuationColor, material.attenuationDistance );
2175	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2176	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2177#endif`,K6=`#ifdef USE_TRANSMISSION
2178	uniform float transmission;
2179	uniform float thickness;
2180	uniform float attenuationDistance;
2181	uniform vec3 attenuationColor;
2182	#ifdef USE_TRANSMISSIONMAP
2183		uniform sampler2D transmissionMap;
2184	#endif
2185	#ifdef USE_THICKNESSMAP
2186		uniform sampler2D thicknessMap;
2187	#endif
2188	uniform vec2 transmissionSamplerSize;
2189	uniform sampler2D transmissionSamplerMap;
2190	uniform mat4 modelMatrix;
2191	uniform mat4 projectionMatrix;
2192	varying vec3 vWorldPosition;
2193	float w0( float a ) {
2194		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2195	}
2196	float w1( float a ) {
2197		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2198	}
2199	float w2( float a ){
2200		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2201	}
2202	float w3( float a ) {
2203		return ( 1.0 / 6.0 ) * ( a * a * a );
2204	}
2205	float g0( float a ) {
2206		return w0( a ) + w1( a );
2207	}
2208	float g1( float a ) {
2209		return w2( a ) + w3( a );
2210	}
2211	float h0( float a ) {
2212		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2213	}
2214	float h1( float a ) {
2215		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2216	}
2217	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2218		uv = uv * texelSize.zw + 0.5;
2219		vec2 iuv = floor( uv );
2220		vec2 fuv = fract( uv );
2221		float g0x = g0( fuv.x );
2222		float g1x = g1( fuv.x );
2223		float h0x = h0( fuv.x );
2224		float h1x = h1( fuv.x );
2225		float h0y = h0( fuv.y );
2226		float h1y = h1( fuv.y );
2227		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2228		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2229		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2230		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2231		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2232			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2233	}
2234	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2235		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2236		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2237		vec2 fLodSizeInv = 1.0 / fLodSize;
2238		vec2 cLodSizeInv = 1.0 / cLodSize;
2239		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2240		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2241		return mix( fSample, cSample, fract( lod ) );
2242	}
2243	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2244		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2245		vec3 modelScale;
2246		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2247		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2248		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2249		return normalize( refractionVector ) * thickness * modelScale;
2250	}
2251	float applyIorToRoughness( const in float roughness, const in float ior ) {
2252		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2253	}
2254	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2255		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2256		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2257	}
2258	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2259		if ( isinf( attenuationDistance ) ) {
2260			return vec3( 1.0 );
2261		} else {
2262			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2263			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2264		}
2265	}
2266	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2267		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2268		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2269		const in vec3 attenuationColor, const in float attenuationDistance ) {
2270		vec4 transmittedLight;
2271		vec3 transmittance;
2272		#ifdef USE_DISPERSION
2273			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2274			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2275			for ( int i = 0; i < 3; i ++ ) {
2276				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2277				vec3 refractedRayExit = position + transmissionRay;
2278				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2279				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2280				refractionCoords += 1.0;
2281				refractionCoords /= 2.0;
2282				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2283				transmittedLight[ i ] = transmissionSample[ i ];
2284				transmittedLight.a += transmissionSample.a;
2285				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2286			}
2287			transmittedLight.a /= 3.0;
2288		#else
2289			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2290			vec3 refractedRayExit = position + transmissionRay;
2291			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2292			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2293			refractionCoords += 1.0;
2294			refractionCoords /= 2.0;
2295			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2296			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2297		#endif
2298		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2299		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2300		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2301		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2302	}
2303#endif`,Z6=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2304	varying vec2 vUv;
2305#endif
2306#ifdef USE_MAP
2307	varying vec2 vMapUv;
2308#endif
2309#ifdef USE_ALPHAMAP
2310	varying vec2 vAlphaMapUv;
2311#endif
2312#ifdef USE_LIGHTMAP
2313	varying vec2 vLightMapUv;
2314#endif
2315#ifdef USE_AOMAP
2316	varying vec2 vAoMapUv;
2317#endif
2318#ifdef USE_BUMPMAP
2319	varying vec2 vBumpMapUv;
2320#endif
2321#ifdef USE_NORMALMAP
2322	varying vec2 vNormalMapUv;
2323#endif
2324#ifdef USE_EMISSIVEMAP
2325	varying vec2 vEmissiveMapUv;
2326#endif
2327#ifdef USE_METALNESSMAP
2328	varying vec2 vMetalnessMapUv;
2329#endif
2330#ifdef USE_ROUGHNESSMAP
2331	varying vec2 vRoughnessMapUv;
2332#endif
2333#ifdef USE_ANISOTROPYMAP
2334	varying vec2 vAnisotropyMapUv;
2335#endif
2336#ifdef USE_CLEARCOATMAP
2337	varying vec2 vClearcoatMapUv;
2338#endif
2339#ifdef USE_CLEARCOAT_NORMALMAP
2340	varying vec2 vClearcoatNormalMapUv;
2341#endif
2342#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2343	varying vec2 vClearcoatRoughnessMapUv;
2344#endif
2345#ifdef USE_IRIDESCENCEMAP
2346	varying vec2 vIridescenceMapUv;
2347#endif
2348#ifdef USE_IRIDESCENCE_THICKNESSMAP
2349	varying vec2 vIridescenceThicknessMapUv;
2350#endif
2351#ifdef USE_SHEEN_COLORMAP
2352	varying vec2 vSheenColorMapUv;
2353#endif
2354#ifdef USE_SHEEN_ROUGHNESSMAP
2355	varying vec2 vSheenRoughnessMapUv;
2356#endif
2357#ifdef USE_SPECULARMAP
2358	varying vec2 vSpecularMapUv;
2359#endif
2360#ifdef USE_SPECULAR_COLORMAP
2361	varying vec2 vSpecularColorMapUv;
2362#endif
2363#ifdef USE_SPECULAR_INTENSITYMAP
2364	varying vec2 vSpecularIntensityMapUv;
2365#endif
2366#ifdef USE_TRANSMISSIONMAP
2367	uniform mat3 transmissionMapTransform;
2368	varying vec2 vTransmissionMapUv;
2369#endif
2370#ifdef USE_THICKNESSMAP
2371	uniform mat3 thicknessMapTransform;
2372	varying vec2 vThicknessMapUv;
2373#endif`,J6=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2374	varying vec2 vUv;
2375#endif
2376#ifdef USE_MAP
2377	uniform mat3 mapTransform;
2378	varying vec2 vMapUv;
2379#endif
2380#ifdef USE_ALPHAMAP
2381	uniform mat3 alphaMapTransform;
2382	varying vec2 vAlphaMapUv;
2383#endif
2384#ifdef USE_LIGHTMAP
2385	uniform mat3 lightMapTransform;
2386	varying vec2 vLightMapUv;
2387#endif
2388#ifdef USE_AOMAP
2389	uniform mat3 aoMapTransform;
2390	varying vec2 vAoMapUv;
2391#endif
2392#ifdef USE_BUMPMAP
2393	uniform mat3 bumpMapTransform;
2394	varying vec2 vBumpMapUv;
2395#endif
2396#ifdef USE_NORMALMAP
2397	uniform mat3 normalMapTransform;
2398	varying vec2 vNormalMapUv;
2399#endif
2400#ifdef USE_DISPLACEMENTMAP
2401	uniform mat3 displacementMapTransform;
2402	varying vec2 vDisplacementMapUv;
2403#endif
2404#ifdef USE_EMISSIVEMAP
2405	uniform mat3 emissiveMapTransform;
2406	varying vec2 vEmissiveMapUv;
2407#endif
2408#ifdef USE_METALNESSMAP
2409	uniform mat3 metalnessMapTransform;
2410	varying vec2 vMetalnessMapUv;
2411#endif
2412#ifdef USE_ROUGHNESSMAP
2413	uniform mat3 roughnessMapTransform;
2414	varying vec2 vRoughnessMapUv;
2415#endif
2416#ifdef USE_ANISOTROPYMAP
2417	uniform mat3 anisotropyMapTransform;
2418	varying vec2 vAnisotropyMapUv;
2419#endif
2420#ifdef USE_CLEARCOATMAP
2421	uniform mat3 clearcoatMapTransform;
2422	varying vec2 vClearcoatMapUv;
2423#endif
2424#ifdef USE_CLEARCOAT_NORMALMAP
2425	uniform mat3 clearcoatNormalMapTransform;
2426	varying vec2 vClearcoatNormalMapUv;
2427#endif
2428#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2429	uniform mat3 clearcoatRoughnessMapTransform;
2430	varying vec2 vClearcoatRoughnessMapUv;
2431#endif
2432#ifdef USE_SHEEN_COLORMAP
2433	uniform mat3 sheenColorMapTransform;
2434	varying vec2 vSheenColorMapUv;
2435#endif
2436#ifdef USE_SHEEN_ROUGHNESSMAP
2437	uniform mat3 sheenRoughnessMapTransform;
2438	varying vec2 vSheenRoughnessMapUv;
2439#endif
2440#ifdef USE_IRIDESCENCEMAP
2441	uniform mat3 iridescenceMapTransform;
2442	varying vec2 vIridescenceMapUv;
2443#endif
2444#ifdef USE_IRIDESCENCE_THICKNESSMAP
2445	uniform mat3 iridescenceThicknessMapTransform;
2446	varying vec2 vIridescenceThicknessMapUv;
2447#endif
2448#ifdef USE_SPECULARMAP
2449	uniform mat3 specularMapTransform;
2450	varying vec2 vSpecularMapUv;
2451#endif
2452#ifdef USE_SPECULAR_COLORMAP
2453	uniform mat3 specularColorMapTransform;
2454	varying vec2 vSpecularColorMapUv;
2455#endif
2456#ifdef USE_SPECULAR_INTENSITYMAP
2457	uniform mat3 specularIntensityMapTransform;
2458	varying vec2 vSpecularIntensityMapUv;
2459#endif
2460#ifdef USE_TRANSMISSIONMAP
2461	uniform mat3 transmissionMapTransform;
2462	varying vec2 vTransmissionMapUv;
2463#endif
2464#ifdef USE_THICKNESSMAP
2465	uniform mat3 thicknessMapTransform;
2466	varying vec2 vThicknessMapUv;
2467#endif`,Q6=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2468	vUv = vec3( uv, 1 ).xy;
2469#endif
2470#ifdef USE_MAP
2471	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2472#endif
2473#ifdef USE_ALPHAMAP
2474	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2475#endif
2476#ifdef USE_LIGHTMAP
2477	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2478#endif
2479#ifdef USE_AOMAP
2480	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2481#endif
2482#ifdef USE_BUMPMAP
2483	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2484#endif
2485#ifdef USE_NORMALMAP
2486	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2487#endif
2488#ifdef USE_DISPLACEMENTMAP
2489	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2490#endif
2491#ifdef USE_EMISSIVEMAP
2492	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2493#endif
2494#ifdef USE_METALNESSMAP
2495	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2496#endif
2497#ifdef USE_ROUGHNESSMAP
2498	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2499#endif
2500#ifdef USE_ANISOTROPYMAP
2501	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2502#endif
2503#ifdef USE_CLEARCOATMAP
2504	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2505#endif
2506#ifdef USE_CLEARCOAT_NORMALMAP
2507	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2508#endif
2509#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2510	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2511#endif
2512#ifdef USE_IRIDESCENCEMAP
2513	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2514#endif
2515#ifdef USE_IRIDESCENCE_THICKNESSMAP
2516	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2517#endif
2518#ifdef USE_SHEEN_COLORMAP
2519	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2520#endif
2521#ifdef USE_SHEEN_ROUGHNESSMAP
2522	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2523#endif
2524#ifdef USE_SPECULARMAP
2525	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2526#endif
2527#ifdef USE_SPECULAR_COLORMAP
2528	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2529#endif
2530#ifdef USE_SPECULAR_INTENSITYMAP
2531	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2532#endif
2533#ifdef USE_TRANSMISSIONMAP
2534	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2535#endif
2536#ifdef USE_THICKNESSMAP
2537	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2538#endif`,e8=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2539	vec4 worldPosition = vec4( transformed, 1.0 );
2540	#ifdef USE_BATCHING
2541		worldPosition = batchingMatrix * worldPosition;
2542	#endif
2543	#ifdef USE_INSTANCING
2544		worldPosition = instanceMatrix * worldPosition;
2545	#endif
2546	worldPosition = modelMatrix * worldPosition;
2547#endif`;const t8=`varying vec2 vUv;
2548uniform mat3 uvTransform;
2549void main() {
2550	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2551	gl_Position = vec4( position.xy, 1.0, 1.0 );
2552}`,n8=`uniform sampler2D t2D;
2553uniform float backgroundIntensity;
2554varying vec2 vUv;
2555void main() {
2556	vec4 texColor = texture2D( t2D, vUv );
2557	#ifdef DECODE_VIDEO_TEXTURE
2558		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 );
2559	#endif
2560	texColor.rgb *= backgroundIntensity;
2561	gl_FragColor = texColor;
2562	#include <tonemapping_fragment>
2563	#include <colorspace_fragment>
2564}`,i8=`varying vec3 vWorldDirection;
2565#include <common>
2566void main() {
2567	vWorldDirection = transformDirection( position, modelMatrix );
2568	#include <begin_vertex>
2569	#include <project_vertex>
2570	gl_Position.z = gl_Position.w;
2571}`,r8=`#ifdef ENVMAP_TYPE_CUBE
2572	uniform samplerCube envMap;
2573#elif defined( ENVMAP_TYPE_CUBE_UV )
2574	uniform sampler2D envMap;
2575#endif
2576uniform float flipEnvMap;
2577uniform float backgroundBlurriness;
2578uniform float backgroundIntensity;
2579uniform mat3 backgroundRotation;
2580varying vec3 vWorldDirection;
2581#include <cube_uv_reflection_fragment>
2582void main() {
2583	#ifdef ENVMAP_TYPE_CUBE
2584		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
2585	#elif defined( ENVMAP_TYPE_CUBE_UV )
2586		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2587	#else
2588		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2589	#endif
2590	texColor.rgb *= backgroundIntensity;
2591	gl_FragColor = texColor;
2592	#include <tonemapping_fragment>
2593	#include <colorspace_fragment>
2594}`,s8=`varying vec3 vWorldDirection;
2595#include <common>
2596void main() {
2597	vWorldDirection = transformDirection( position, modelMatrix );
2598	#include <begin_vertex>
2599	#include <project_vertex>
2600	gl_Position.z = gl_Position.w;
2601}`,o8=`uniform samplerCube tCube;
2602uniform float tFlip;
2603uniform float opacity;
2604varying vec3 vWorldDirection;
2605void main() {
2606	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2607	gl_FragColor = texColor;
2608	gl_FragColor.a *= opacity;
2609	#include <tonemapping_fragment>
2610	#include <colorspace_fragment>
2611}`,a8=`#include <common>
2612#include <batching_pars_vertex>
2613#include <uv_pars_vertex>
2614#include <displacementmap_pars_vertex>
2615#include <morphtarget_pars_vertex>
2616#include <skinning_pars_vertex>
2617#include <logdepthbuf_pars_vertex>
2618#include <clipping_planes_pars_vertex>
2619varying vec2 vHighPrecisionZW;
2620void main() {
2621	#include <uv_vertex>
2622	#include <batching_vertex>
2623	#include <skinbase_vertex>
2624	#include <morphinstance_vertex>
2625	#ifdef USE_DISPLACEMENTMAP
2626		#include <beginnormal_vertex>
2627		#include <morphnormal_vertex>
2628		#include <skinnormal_vertex>
2629	#endif
2630	#include <begin_vertex>
2631	#include <morphtarget_vertex>
2632	#include <skinning_vertex>
2633	#include <displacementmap_vertex>
2634	#include <project_vertex>
2635	#include <logdepthbuf_vertex>
2636	#include <clipping_planes_vertex>
2637	vHighPrecisionZW = gl_Position.zw;
2638}`,l8=`#if DEPTH_PACKING == 3200
2639	uniform float opacity;
2640#endif
2641#include <common>
2642#include <packing>
2643#include <uv_pars_fragment>
2644#include <map_pars_fragment>
2645#include <alphamap_pars_fragment>
2646#include <alphatest_pars_fragment>
2647#include <alphahash_pars_fragment>
2648#include <logdepthbuf_pars_fragment>
2649#include <clipping_planes_pars_fragment>
2650varying vec2 vHighPrecisionZW;
2651void main() {
2652	vec4 diffuseColor = vec4( 1.0 );
2653	#include <clipping_planes_fragment>
2654	#if DEPTH_PACKING == 3200
2655		diffuseColor.a = opacity;
2656	#endif
2657	#include <map_fragment>
2658	#include <alphamap_fragment>
2659	#include <alphatest_fragment>
2660	#include <alphahash_fragment>
2661	#include <logdepthbuf_fragment>
2662	#ifdef USE_REVERSED_DEPTH_BUFFER
2663		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
2664	#else
2665		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
2666	#endif
2667	#if DEPTH_PACKING == 3200
2668		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2669	#elif DEPTH_PACKING == 3201
2670		gl_FragColor = packDepthToRGBA( fragCoordZ );
2671	#elif DEPTH_PACKING == 3202
2672		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2673	#elif DEPTH_PACKING == 3203
2674		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2675	#endif
2676}`,c8=`#define DISTANCE
2677varying vec3 vWorldPosition;
2678#include <common>
2679#include <batching_pars_vertex>
2680#include <uv_pars_vertex>
2681#include <displacementmap_pars_vertex>
2682#include <morphtarget_pars_vertex>
2683#include <skinning_pars_vertex>
2684#include <clipping_planes_pars_vertex>
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 <worldpos_vertex>
2701	#include <clipping_planes_vertex>
2702	vWorldPosition = worldPosition.xyz;
2703}`,u8=`#define DISTANCE
2704uniform vec3 referencePosition;
2705uniform float nearDistance;
2706uniform float farDistance;
2707varying vec3 vWorldPosition;
2708#include <common>
2709#include <packing>
2710#include <uv_pars_fragment>
2711#include <map_pars_fragment>
2712#include <alphamap_pars_fragment>
2713#include <alphatest_pars_fragment>
2714#include <alphahash_pars_fragment>
2715#include <clipping_planes_pars_fragment>
2716void main () {
2717	vec4 diffuseColor = vec4( 1.0 );
2718	#include <clipping_planes_fragment>
2719	#include <map_fragment>
2720	#include <alphamap_fragment>
2721	#include <alphatest_fragment>
2722	#include <alphahash_fragment>
2723	float dist = length( vWorldPosition - referencePosition );
2724	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2725	dist = saturate( dist );
2726	gl_FragColor = packDepthToRGBA( dist );
2727}`,h8=`varying vec3 vWorldDirection;
2728#include <common>
2729void main() {
2730	vWorldDirection = transformDirection( position, modelMatrix );
2731	#include <begin_vertex>
2732	#include <project_vertex>
2733}`,d8=`uniform sampler2D tEquirect;
2734varying vec3 vWorldDirection;
2735#include <common>
2736void main() {
2737	vec3 direction = normalize( vWorldDirection );
2738	vec2 sampleUV = equirectUv( direction );
2739	gl_FragColor = texture2D( tEquirect, sampleUV );
2740	#include <tonemapping_fragment>
2741	#include <colorspace_fragment>
2742}`,f8=`uniform float scale;
2743attribute float lineDistance;
2744varying float vLineDistance;
2745#include <common>
2746#include <uv_pars_vertex>
2747#include <color_pars_vertex>
2748#include <fog_pars_vertex>
2749#include <morphtarget_pars_vertex>
2750#include <logdepthbuf_pars_vertex>
2751#include <clipping_planes_pars_vertex>
2752void main() {
2753	vLineDistance = scale * lineDistance;
2754	#include <uv_vertex>
2755	#include <color_vertex>
2756	#include <morphinstance_vertex>
2757	#include <morphcolor_vertex>
2758	#include <begin_vertex>
2759	#include <morphtarget_vertex>
2760	#include <project_vertex>
2761	#include <logdepthbuf_vertex>
2762	#include <clipping_planes_vertex>
2763	#include <fog_vertex>
2764}`,p8=`uniform vec3 diffuse;
2765uniform float opacity;
2766uniform float dashSize;
2767uniform float totalSize;
2768varying float vLineDistance;
2769#include <common>
2770#include <color_pars_fragment>
2771#include <uv_pars_fragment>
2772#include <map_pars_fragment>
2773#include <fog_pars_fragment>
2774#include <logdepthbuf_pars_fragment>
2775#include <clipping_planes_pars_fragment>
2776void main() {
2777	vec4 diffuseColor = vec4( diffuse, opacity );
2778	#include <clipping_planes_fragment>
2779	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2780		discard;
2781	}
2782	vec3 outgoingLight = vec3( 0.0 );
2783	#include <logdepthbuf_fragment>
2784	#include <map_fragment>
2785	#include <color_fragment>
2786	outgoingLight = diffuseColor.rgb;
2787	#include <opaque_fragment>
2788	#include <tonemapping_fragment>
2789	#include <colorspace_fragment>
2790	#include <fog_fragment>
2791	#include <premultiplied_alpha_fragment>
2792}`,m8=`#include <common>
2793#include <batching_pars_vertex>
2794#include <uv_pars_vertex>
2795#include <envmap_pars_vertex>
2796#include <color_pars_vertex>
2797#include <fog_pars_vertex>
2798#include <morphtarget_pars_vertex>
2799#include <skinning_pars_vertex>
2800#include <logdepthbuf_pars_vertex>
2801#include <clipping_planes_pars_vertex>
2802void main() {
2803	#include <uv_vertex>
2804	#include <color_vertex>
2805	#include <morphinstance_vertex>
2806	#include <morphcolor_vertex>
2807	#include <batching_vertex>
2808	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2809		#include <beginnormal_vertex>
2810		#include <morphnormal_vertex>
2811		#include <skinbase_vertex>
2812		#include <skinnormal_vertex>
2813		#include <defaultnormal_vertex>
2814	#endif
2815	#include <begin_vertex>
2816	#include <morphtarget_vertex>
2817	#include <skinning_vertex>
2818	#include <project_vertex>
2819	#include <logdepthbuf_vertex>
2820	#include <clipping_planes_vertex>
2821	#include <worldpos_vertex>
2822	#include <envmap_vertex>
2823	#include <fog_vertex>
2824}`,g8=`uniform vec3 diffuse;
2825uniform float opacity;
2826#ifndef FLAT_SHADED
2827	varying vec3 vNormal;
2828#endif
2829#include <common>
2830#include <dithering_pars_fragment>
2831#include <color_pars_fragment>
2832#include <uv_pars_fragment>
2833#include <map_pars_fragment>
2834#include <alphamap_pars_fragment>
2835#include <alphatest_pars_fragment>
2836#include <alphahash_pars_fragment>
2837#include <aomap_pars_fragment>
2838#include <lightmap_pars_fragment>
2839#include <envmap_common_pars_fragment>
2840#include <envmap_pars_fragment>
2841#include <fog_pars_fragment>
2842#include <specularmap_pars_fragment>
2843#include <logdepthbuf_pars_fragment>
2844#include <clipping_planes_pars_fragment>
2845void main() {
2846	vec4 diffuseColor = vec4( diffuse, opacity );
2847	#include <clipping_planes_fragment>
2848	#include <logdepthbuf_fragment>
2849	#include <map_fragment>
2850	#include <color_fragment>
2851	#include <alphamap_fragment>
2852	#include <alphatest_fragment>
2853	#include <alphahash_fragment>
2854	#include <specularmap_fragment>
2855	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2856	#ifdef USE_LIGHTMAP
2857		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2858		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2859	#else
2860		reflectedLight.indirectDiffuse += vec3( 1.0 );
2861	#endif
2862	#include <aomap_fragment>
2863	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2864	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2865	#include <envmap_fragment>
2866	#include <opaque_fragment>
2867	#include <tonemapping_fragment>
2868	#include <colorspace_fragment>
2869	#include <fog_fragment>
2870	#include <premultiplied_alpha_fragment>
2871	#include <dithering_fragment>
2872}`,v8=`#define LAMBERT
2873varying vec3 vViewPosition;
2874#include <common>
2875#include <batching_pars_vertex>
2876#include <uv_pars_vertex>
2877#include <displacementmap_pars_vertex>
2878#include <envmap_pars_vertex>
2879#include <color_pars_vertex>
2880#include <fog_pars_vertex>
2881#include <normal_pars_vertex>
2882#include <morphtarget_pars_vertex>
2883#include <skinning_pars_vertex>
2884#include <shadowmap_pars_vertex>
2885#include <logdepthbuf_pars_vertex>
2886#include <clipping_planes_pars_vertex>
2887void main() {
2888	#include <uv_vertex>
2889	#include <color_vertex>
2890	#include <morphinstance_vertex>
2891	#include <morphcolor_vertex>
2892	#include <batching_vertex>
2893	#include <beginnormal_vertex>
2894	#include <morphnormal_vertex>
2895	#include <skinbase_vertex>
2896	#include <skinnormal_vertex>
2897	#include <defaultnormal_vertex>
2898	#include <normal_vertex>
2899	#include <begin_vertex>
2900	#include <morphtarget_vertex>
2901	#include <skinning_vertex>
2902	#include <displacementmap_vertex>
2903	#include <project_vertex>
2904	#include <logdepthbuf_vertex>
2905	#include <clipping_planes_vertex>
2906	vViewPosition = - mvPosition.xyz;
2907	#include <worldpos_vertex>
2908	#include <envmap_vertex>
2909	#include <shadowmap_vertex>
2910	#include <fog_vertex>
2911}`,x8=`#define LAMBERT
2912uniform vec3 diffuse;
2913uniform vec3 emissive;
2914uniform float opacity;
2915#include <common>
2916#include <packing>
2917#include <dithering_pars_fragment>
2918#include <color_pars_fragment>
2919#include <uv_pars_fragment>
2920#include <map_pars_fragment>
2921#include <alphamap_pars_fragment>
2922#include <alphatest_pars_fragment>
2923#include <alphahash_pars_fragment>
2924#include <aomap_pars_fragment>
2925#include <lightmap_pars_fragment>
2926#include <emissivemap_pars_fragment>
2927#include <envmap_common_pars_fragment>
2928#include <envmap_pars_fragment>
2929#include <fog_pars_fragment>
2930#include <bsdfs>
2931#include <lights_pars_begin>
2932#include <normal_pars_fragment>
2933#include <lights_lambert_pars_fragment>
2934#include <shadowmap_pars_fragment>
2935#include <bumpmap_pars_fragment>
2936#include <normalmap_pars_fragment>
2937#include <specularmap_pars_fragment>
2938#include <logdepthbuf_pars_fragment>
2939#include <clipping_planes_pars_fragment>
2940void main() {
2941	vec4 diffuseColor = vec4( diffuse, opacity );
2942	#include <clipping_planes_fragment>
2943	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2944	vec3 totalEmissiveRadiance = emissive;
2945	#include <logdepthbuf_fragment>
2946	#include <map_fragment>
2947	#include <color_fragment>
2948	#include <alphamap_fragment>
2949	#include <alphatest_fragment>
2950	#include <alphahash_fragment>
2951	#include <specularmap_fragment>
2952	#include <normal_fragment_begin>
2953	#include <normal_fragment_maps>
2954	#include <emissivemap_fragment>
2955	#include <lights_lambert_fragment>
2956	#include <lights_fragment_begin>
2957	#include <lights_fragment_maps>
2958	#include <lights_fragment_end>
2959	#include <aomap_fragment>
2960	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
2961	#include <envmap_fragment>
2962	#include <opaque_fragment>
2963	#include <tonemapping_fragment>
2964	#include <colorspace_fragment>
2965	#include <fog_fragment>
2966	#include <premultiplied_alpha_fragment>
2967	#include <dithering_fragment>
2968}`,y8=`#define MATCAP
2969varying vec3 vViewPosition;
2970#include <common>
2971#include <batching_pars_vertex>
2972#include <uv_pars_vertex>
2973#include <color_pars_vertex>
2974#include <displacementmap_pars_vertex>
2975#include <fog_pars_vertex>
2976#include <normal_pars_vertex>
2977#include <morphtarget_pars_vertex>
2978#include <skinning_pars_vertex>
2979#include <logdepthbuf_pars_vertex>
2980#include <clipping_planes_pars_vertex>
2981void main() {
2982	#include <uv_vertex>
2983	#include <color_vertex>
2984	#include <morphinstance_vertex>
2985	#include <morphcolor_vertex>
2986	#include <batching_vertex>
2987	#include <beginnormal_vertex>
2988	#include <morphnormal_vertex>
2989	#include <skinbase_vertex>
2990	#include <skinnormal_vertex>
2991	#include <defaultnormal_vertex>
2992	#include <normal_vertex>
2993	#include <begin_vertex>
2994	#include <morphtarget_vertex>
2995	#include <skinning_vertex>
2996	#include <displacementmap_vertex>
2997	#include <project_vertex>
2998	#include <logdepthbuf_vertex>
2999	#include <clipping_planes_vertex>
3000	#include <fog_vertex>
3001	vViewPosition = - mvPosition.xyz;
3002}`,_8=`#define MATCAP
3003uniform vec3 diffuse;
3004uniform float opacity;
3005uniform sampler2D matcap;
3006varying vec3 vViewPosition;
3007#include <common>
3008#include <dithering_pars_fragment>
3009#include <color_pars_fragment>
3010#include <uv_pars_fragment>
3011#include <map_pars_fragment>
3012#include <alphamap_pars_fragment>
3013#include <alphatest_pars_fragment>
3014#include <alphahash_pars_fragment>
3015#include <fog_pars_fragment>
3016#include <normal_pars_fragment>
3017#include <bumpmap_pars_fragment>
3018#include
3018 <normalmap_pars_fragment>
3019#include <logdepthbuf_pars_fragment>
3020#include <clipping_planes_pars_fragment>
3021void main() {
3022	vec4 diffuseColor = vec4( diffuse, opacity );
3023	#include <clipping_planes_fragment>
3024	#include <logdepthbuf_fragment>
3025	#include <map_fragment>
3026	#include <color_fragment>
3027	#include <alphamap_fragment>
3028	#include <alphatest_fragment>
3029	#include <alphahash_fragment>
3030	#include <normal_fragment_begin>
3031	#include <normal_fragment_maps>
3032	vec3 viewDir = normalize( vViewPosition );
3033	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3034	vec3 y = cross( viewDir, x );
3035	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3036	#ifdef USE_MATCAP
3037		vec4 matcapColor = texture2D( matcap, uv );
3038	#else
3039		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3040	#endif
3041	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3042	#include <opaque_fragment>
3043	#include <tonemapping_fragment>
3044	#include <colorspace_fragment>
3045	#include <fog_fragment>
3046	#include <premultiplied_alpha_fragment>
3047	#include <dithering_fragment>
3048}`,b8=`#define NORMAL
3049#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3050	varying vec3 vViewPosition;
3051#endif
3052#include <common>
3053#include <batching_pars_vertex>
3054#include <uv_pars_vertex>
3055#include <displacementmap_pars_vertex>
3056#include <normal_pars_vertex>
3057#include <morphtarget_pars_vertex>
3058#include <skinning_pars_vertex>
3059#include <logdepthbuf_pars_vertex>
3060#include <clipping_planes_pars_vertex>
3061void main() {
3062	#include <uv_vertex>
3063	#include <batching_vertex>
3064	#include <beginnormal_vertex>
3065	#include <morphinstance_vertex>
3066	#include <morphnormal_vertex>
3067	#include <skinbase_vertex>
3068	#include <skinnormal_vertex>
3069	#include <defaultnormal_vertex>
3070	#include <normal_vertex>
3071	#include <begin_vertex>
3072	#include <morphtarget_vertex>
3073	#include <skinning_vertex>
3074	#include <displacementmap_vertex>
3075	#include <project_vertex>
3076	#include <logdepthbuf_vertex>
3077	#include <clipping_planes_vertex>
3078#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3079	vViewPosition = - mvPosition.xyz;
3080#endif
3081}`,w8=`#define NORMAL
3082uniform float opacity;
3083#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3084	varying vec3 vViewPosition;
3085#endif
3086#include <packing>
3087#include <uv_pars_fragment>
3088#include <normal_pars_fragment>
3089#include <bumpmap_pars_fragment>
3090#include <normalmap_pars_fragment>
3091#include <logdepthbuf_pars_fragment>
3092#include <clipping_planes_pars_fragment>
3093void main() {
3094	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3095	#include <clipping_planes_fragment>
3096	#include <logdepthbuf_fragment>
3097	#include <normal_fragment_begin>
3098	#include <normal_fragment_maps>
3099	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
3100	#ifdef OPAQUE
3101		gl_FragColor.a = 1.0;
3102	#endif
3103}`,S8=`#define PHONG
3104varying vec3 vViewPosition;
3105#include <common>
3106#include <batching_pars_vertex>
3107#include <uv_pars_vertex>
3108#include <displacementmap_pars_vertex>
3109#include <envmap_pars_vertex>
3110#include <color_pars_vertex>
3111#include <fog_pars_vertex>
3112#include <normal_pars_vertex>
3113#include <morphtarget_pars_vertex>
3114#include <skinning_pars_vertex>
3115#include <shadowmap_pars_vertex>
3116#include <logdepthbuf_pars_vertex>
3117#include <clipping_planes_pars_vertex>
3118void main() {
3119	#include <uv_vertex>
3120	#include <color_vertex>
3121	#include <morphcolor_vertex>
3122	#include <batching_vertex>
3123	#include <beginnormal_vertex>
3124	#include <morphinstance_vertex>
3125	#include <morphnormal_vertex>
3126	#include <skinbase_vertex>
3127	#include <skinnormal_vertex>
3128	#include <defaultnormal_vertex>
3129	#include <normal_vertex>
3130	#include <begin_vertex>
3131	#include <morphtarget_vertex>
3132	#include <skinning_vertex>
3133	#include <displacementmap_vertex>
3134	#include <project_vertex>
3135	#include <logdepthbuf_vertex>
3136	#include <clipping_planes_vertex>
3137	vViewPosition = - mvPosition.xyz;
3138	#include <worldpos_vertex>
3139	#include <envmap_vertex>
3140	#include <shadowmap_vertex>
3141	#include <fog_vertex>
3142}`,M8=`#define PHONG
3143uniform vec3 diffuse;
3144uniform vec3 emissive;
3145uniform vec3 specular;
3146uniform float shininess;
3147uniform float opacity;
3148#include <common>
3149#include <packing>
3150#include <dithering_pars_fragment>
3151#include <color_pars_fragment>
3152#include <uv_pars_fragment>
3153#include <map_pars_fragment>
3154#include <alphamap_pars_fragment>
3155#include <alphatest_pars_fragment>
3156#include <alphahash_pars_fragment>
3157#include <aomap_pars_fragment>
3158#include <lightmap_pars_fragment>
3159#include <emissivemap_pars_fragment>
3160#include <envmap_common_pars_fragment>
3161#include <envmap_pars_fragment>
3162#include <fog_pars_fragment>
3163#include <bsdfs>
3164#include <lights_pars_begin>
3165#include <normal_pars_fragment>
3166#include <lights_phong_pars_fragment>
3167#include <shadowmap_pars_fragment>
3168#include <bumpmap_pars_fragment>
3169#include <normalmap_pars_fragment>
3170#include <specularmap_pars_fragment>
3171#include <logdepthbuf_pars_fragment>
3172#include <clipping_planes_pars_fragment>
3173void main() {
3174	vec4 diffuseColor = vec4( diffuse, opacity );
3175	#include <clipping_planes_fragment>
3176	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3177	vec3 totalEmissiveRadiance = emissive;
3178	#include <logdepthbuf_fragment>
3179	#include <map_fragment>
3180	#include <color_fragment>
3181	#include <alphamap_fragment>
3182	#include <alphatest_fragment>
3183	#include <alphahash_fragment>
3184	#include <specularmap_fragment>
3185	#include <normal_fragment_begin>
3186	#include <normal_fragment_maps>
3187	#include <emissivemap_fragment>
3188	#include <lights_phong_fragment>
3189	#include <lights_fragment_begin>
3190	#include <lights_fragment_maps>
3191	#include <lights_fragment_end>
3192	#include <aomap_fragment>
3193	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3194	#include <envmap_fragment>
3195	#include <opaque_fragment>
3196	#include <tonemapping_fragment>
3197	#include <colorspace_fragment>
3198	#include <fog_fragment>
3199	#include <premultiplied_alpha_fragment>
3200	#include <dithering_fragment>
3201}`,T8=`#define STANDARD
3202varying vec3 vViewPosition;
3203#ifdef USE_TRANSMISSION
3204	varying vec3 vWorldPosition;
3205#endif
3206#include <common>
3207#include <batching_pars_vertex>
3208#include <uv_pars_vertex>
3209#include <displacementmap_pars_vertex>
3210#include <color_pars_vertex>
3211#include <fog_pars_vertex>
3212#include <normal_pars_vertex>
3213#include <morphtarget_pars_vertex>
3214#include <skinning_pars_vertex>
3215#include <shadowmap_pars_vertex>
3216#include <logdepthbuf_pars_vertex>
3217#include <clipping_planes_pars_vertex>
3218void main() {
3219	#include <uv_vertex>
3220	#include <color_vertex>
3221	#include <morphinstance_vertex>
3222	#include <morphcolor_vertex>
3223	#include <batching_vertex>
3224	#include <beginnormal_vertex>
3225	#include <morphnormal_vertex>
3226	#include <skinbase_vertex>
3227	#include <skinnormal_vertex>
3228	#include <defaultnormal_vertex>
3229	#include <normal_vertex>
3230	#include <begin_vertex>
3231	#include <morphtarget_vertex>
3232	#include <skinning_vertex>
3233	#include <displacementmap_vertex>
3234	#include <project_vertex>
3235	#include <logdepthbuf_vertex>
3236	#include <clipping_planes_vertex>
3237	vViewPosition = - mvPosition.xyz;
3238	#include <worldpos_vertex>
3239	#include <shadowmap_vertex>
3240	#include <fog_vertex>
3241#ifdef USE_TRANSMISSION
3242	vWorldPosition = worldPosition.xyz;
3243#endif
3244}`,E8=`#define STANDARD
3245#ifdef PHYSICAL
3246	#define IOR
3247	#define USE_SPECULAR
3248#endif
3249uniform vec3 diffuse;
3250uniform vec3 emissive;
3251uniform float roughness;
3252uniform float metalness;
3253uniform float opacity;
3254#ifdef IOR
3255	uniform float ior;
3256#endif
3257#ifdef USE_SPECULAR
3258	uniform float specularIntensity;
3259	uniform vec3 specularColor;
3260	#ifdef USE_SPECULAR_COLORMAP
3261		uniform sampler2D specularColorMap;
3262	#endif
3263	#ifdef USE_SPECULAR_INTENSITYMAP
3264		uniform sampler2D specularIntensityMap;
3265	#endif
3266#endif
3267#ifdef USE_CLEARCOAT
3268	uniform float clearcoat;
3269	uniform float clearcoatRoughness;
3270#endif
3271#ifdef USE_DISPERSION
3272	uniform float dispersion;
3273#endif
3274#ifdef USE_IRIDESCENCE
3275	uniform float iridescence;
3276	uniform float iridescenceIOR;
3277	uniform float iridescenceThicknessMinimum;
3278	uniform float iridescenceThicknessMaximum;
3279#endif
3280#ifdef USE_SHEEN
3281	uniform vec3 sheenColor;
3282	uniform float sheenRoughness;
3283	#ifdef USE_SHEEN_COLORMAP
3284		uniform sampler2D sheenColorMap;
3285	#endif
3286	#ifdef USE_SHEEN_ROUGHNESSMAP
3287		uniform sampler2D sheenRoughnessMap;
3288	#endif
3289#endif
3290#ifdef USE_ANISOTROPY
3291	uniform vec2 anisotropyVector;
3292	#ifdef USE_ANISOTROPYMAP
3293		uniform sampler2D anisotropyMap;
3294	#endif
3295#endif
3296varying vec3 vViewPosition;
3297#include <common>
3298#include <packing>
3299#include <dithering_pars_fragment>
3300#include <color_pars_fragment>
3301#include <uv_pars_fragment>
3302#include <map_pars_fragment>
3303#include <alphamap_pars_fragment>
3304#include <alphatest_pars_fragment>
3305#include <alphahash_pars_fragment>
3306#include <aomap_pars_fragment>
3307#include <lightmap_pars_fragment>
3308#include <emissivemap_pars_fragment>
3309#include <iridescence_fragment>
3310#include <cube_uv_reflection_fragment>
3311#include <envmap_common_pars_fragment>
3312#include <envmap_physical_pars_fragment>
3313#include <fog_pars_fragment>
3314#include <lights_pars_begin>
3315#include <normal_pars_fragment>
3316#include <lights_physical_pars_fragment>
3317#include <transmission_pars_fragment>
3318#include <shadowmap_pars_fragment>
3319#include <bumpmap_pars_fragment>
3320#include <normalmap_pars_fragment>
3321#include <clearcoat_pars_fragment>
3322#include <iridescence_pars_fragment>
3323#include <roughnessmap_pars_fragment>
3324#include <metalnessmap_pars_fragment>
3325#include <logdepthbuf_pars_fragment>
3326#include <clipping_planes_pars_fragment>
3327void main() {
3328	vec4 diffuseColor = vec4( diffuse, opacity );
3329	#include <clipping_planes_fragment>
3330	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3331	vec3 totalEmissiveRadiance = emissive;
3332	#include <logdepthbuf_fragment>
3333	#include <map_fragment>
3334	#include <color_fragment>
3335	#include <alphamap_fragment>
3336	#include <alphatest_fragment>
3337	#include <alphahash_fragment>
3338	#include <roughnessmap_fragment>
3339	#include <metalnessmap_fragment>
3340	#include <normal_fragment_begin>
3341	#include <normal_fragment_maps>
3342	#include <clearcoat_normal_fragment_begin>
3343	#include <clearcoat_normal_fragment_maps>
3344	#include <emissivemap_fragment>
3345	#include <lights_physical_fragment>
3346	#include <lights_fragment_begin>
3347	#include <lights_fragment_maps>
3348	#include <lights_fragment_end>
3349	#include <aomap_fragment>
3350	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3351	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3352	#include <transmission_fragment>
3353	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3354	#ifdef USE_SHEEN
3355		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
3356		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
3357	#endif
3358	#ifdef USE_CLEARCOAT
3359		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3360		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3361		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3362	#endif
3363	#include <opaque_fragment>
3364	#include <tonemapping_fragment>
3365	#include <colorspace_fragment>
3366	#include <fog_fragment>
3367	#include <premultiplied_alpha_fragment>
3368	#include <dithering_fragment>
3369}`,A8=`#define TOON
3370varying vec3 vViewPosition;
3371#include <common>
3372#include <batching_pars_vertex>
3373#include <uv_pars_vertex>
3374#include <displacementmap_pars_vertex>
3375#include <color_pars_vertex>
3376#include <fog_pars_vertex>
3377#include <normal_pars_vertex>
3378#include <morphtarget_pars_vertex>
3379#include <skinning_pars_vertex>
3380#include <shadowmap_pars_vertex>
3381#include <logdepthbuf_pars_vertex>
3382#include <clipping_planes_pars_vertex>
3383void main() {
3384	#include <uv_vertex>
3385	#include <color_vertex>
3386	#include <morphinstance_vertex>
3387	#include <morphcolor_vertex>
3388	#include <batching_vertex>
3389	#include <beginnormal_vertex>
3390	#include <morphnormal_vertex>
3391	#include <skinbase_vertex>
3392	#include <skinnormal_vertex>
3393	#include <defaultnormal_vertex>
3394	#include <normal_vertex>
3395	#include <begin_vertex>
3396	#include <morphtarget_vertex>
3397	#include <skinning_vertex>
3398	#include <displacementmap_vertex>
3399	#include <project_vertex>
3400	#include <logdepthbuf_vertex>
3401	#include <clipping_planes_vertex>
3402	vViewPosition = - mvPosition.xyz;
3403	#include <worldpos_vertex>
3404	#include <shadowmap_vertex>
3405	#include <fog_vertex>
3406}`,C8=`#define TOON
3407uniform vec3 diffuse;
3408uniform vec3 emissive;
3409uniform float opacity;
3410#include <common>
3411#include <packing>
3412#include <dithering_pars_fragment>
3413#include <color_pars_fragment>
3414#include <uv_pars_fragment>
3415#include <map_pars_fragment>
3416#include <alphamap_pars_fragment>
3417#include <alphatest_pars_fragment>
3418#include <alphahash_pars_fragment>
3419#include <aomap_pars_fragment>
3420#include <lightmap_pars_fragment>
3421#include <emissivemap_pars_fragment>
3422#include <gradientmap_pars_fragment>
3423#include <fog_pars_fragment>
3424#include <bsdfs>
3425#include <lights_pars_begin>
3426#include <normal_pars_fragment>
3427#include <lights_toon_pars_fragment>
3428#include <shadowmap_pars_fragment>
3429#include <bumpmap_pars_fragment>
3430#include <normalmap_pars_fragment>
3431#include <logdepthbuf_pars_fragment>
3432#include <clipping_planes_pars_fragment>
3433void main() {
3434	vec4 diffuseColor = vec4( diffuse, opacity );
3435	#include <clipping_planes_fragment>
3436	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3437	vec3 totalEmissiveRadiance = emissive;
3438	#include <logdepthbuf_fragment>
3439	#include <map_fragment>
3440	#include <color_fragment>
3441	#include <alphamap_fragment>
3442	#include <alphatest_fragment>
3443	#include <alphahash_fragment>
3444	#include <normal_fragment_begin>
3445	#include <normal_fragment_maps>
3446	#include <emissivemap_fragment>
3447	#include <lights_toon_fragment>
3448	#include <lights_fragment_begin>
3449	#include <lights_fragment_maps>
3450	#include <lights_fragment_end>
3451	#include <aomap_fragment>
3452	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3453	#include <opaque_fragment>
3454	#include <tonemapping_fragment>
3455	#include <colorspace_fragment>
3456	#include <fog_fragment>
3457	#include <premultiplied_alpha_fragment>
3458	#include <dithering_fragment>
3459}`,R8=`uniform float size;
3460uniform float scale;
3461#include <common>
3462#include <color_pars_vertex>
3463#include <fog_pars_vertex>
3464#include <morphtarget_pars_vertex>
3465#include <logdepthbuf_pars_vertex>
3466#include <clipping_planes_pars_vertex>
3467#ifdef USE_POINTS_UV
3468	varying vec2 vUv;
3469	uniform mat3 uvTransform;
3470#endif
3471void main() {
3472	#ifdef USE_POINTS_UV
3473		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3474	#endif
3475	#include <color_vertex>
3476	#include <morphinstance_vertex>
3477	#include <morphcolor_vertex>
3478	#include <begin_vertex>
3479	#include <morphtarget_vertex>
3480	#include <project_vertex>
3481	gl_PointSize = size;
3482	#ifdef USE_SIZEATTENUATION
3483		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3484		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3485	#endif
3486	#include <logdepthbuf_vertex>
3487	#include <clipping_planes_vertex>
3488	#include <worldpos_vertex>
3489	#include <fog_vertex>
3490}`,P8=`uniform vec3 diffuse;
3491uniform float opacity;
3492#include <common>
3493#include <color_pars_fragment>
3494#include <map_particle_pars_fragment>
3495#include <alphatest_pars_fragment>
3496#include <alphahash_pars_fragment>
3497#include <fog_pars_fragment>
3498#include <logdepthbuf_pars_fragment>
3499#include <clipping_planes_pars_fragment>
3500void main() {
3501	vec4 diffuseColor = vec4( diffuse, opacity );
3502	#include <clipping_planes_fragment>
3503	vec3 outgoingLight = vec3( 0.0 );
3504	#include <logdepthbuf_fragment>
3505	#include <map_particle_fragment>
3506	#include <color_fragment>
3507	#include <alphatest_fragment>
3508	#include <alphahash_fragment>
3509	outgoingLight = diffuseColor.rgb;
3510	#include <opaque_fragment>
3511	#include <tonemapping_fragment>
3512	#include <colorspace_fragment>
3513	#include <fog_fragment>
3514	#include <premultiplied_alpha_fragment>
3515}`,I8=`#include <common>
3516#include <batching_pars_vertex>
3517#include <fog_pars_vertex>
3518#include <morphtarget_pars_vertex>
3519#include <skinning_pars_vertex>
3520#include <logdepthbuf_pars_vertex>
3521#include <shadowmap_pars_vertex>
3522void main() {
3523	#include <batching_vertex>
3524	#include <beginnormal_vertex>
3525	#include <morphinstance_vertex>
3526	#include <morphnormal_vertex>
3527	#include <skinbase_vertex>
3528	#include <skinnormal_vertex>
3529	#include <defaultnormal_vertex>
3530	#include <begin_vertex>
3531	#include <morphtarget_vertex>
3532	#include <skinning_vertex>
3533	#include <project_vertex>
3534	#include <logdepthbuf_vertex>
3535	#include <worldpos_vertex>
3536	#include <shadowmap_vertex>
3537	#include <fog_vertex>
3538}`,N8=`uniform vec3 color;
3539uniform float opacity;
3540#include <common>
3541#include <packing>
3542#include <fog_pars_fragment>
3543#include <bsdfs>
3544#include <lights_pars_begin>
3545#include <logdepthbuf_pars_fragment>
3546#include <shadowmap_pars_fragment>
3547#include <shadowmask_pars_fragment>
3548void main() {
3549	#include <logdepthbuf_fragment>
3550	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3551	#include <tonemapping_fragment>
3552	#include <colorspace_fragment>
3553	#include <fog_fragment>
3554}`,L8=`uniform float rotation;
3555uniform vec2 center;
3556#include <common>
3557#include <uv_pars_vertex>
3558#include <fog_pars_vertex>
3559#include <logdepthbuf_pars_vertex>
3560#include <clipping_planes_pars_vertex>
3561void main() {
3562	#include <uv_vertex>
3563	vec4 mvPosition = modelViewMatrix[ 3 ];
3564	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3565	#ifndef USE_SIZEATTENUATION
3566		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3567		if ( isPerspective ) scale *= - mvPosition.z;
3568	#endif
3569	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3570	vec2 rotatedPosition;
3571	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3572	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3573	mvPosition.xy += rotatedPosition;
3574	gl_Position = projectionMatrix * mvPosition;
3575	#include <logdepthbuf_vertex>
3576	#include <clipping_planes_vertex>
3577	#include <fog_vertex>
3578}`,O8=`uniform vec3 diffuse;
3579uniform float opacity;
3580#include <common>
3581#include <uv_pars_fragment>
3582#include <map_pars_fragment>
3583#include <alphamap_pars_fragment>
3584#include <alphatest_pars_fragment>
3585#include <alphahash_pars_fragment>
3586#include <fog_pars_fragment>
3587#include <logdepthbuf_pars_fragment>
3588#include <clipping_planes_pars_fragment>
3589void main() {
3590	vec4 diffuseColor = vec4( diffuse, opacity );
3591	#include <clipping_planes_fragment>
3592	vec3 outgoingLight = vec3( 0.0 );
3593	#include <logdepthbuf_fragment>
3594	#include <map_fragment>
3595	#include <alphamap_fragment>
3596	#include <alphatest_fragment>
3597	#include <alphahash_fragment>
3598	outgoingLight = diffuseColor.rgb;
3599	#include <opaque_fragment>
3600	#include <tonemapping_fragment>
3601	#include <colorspace_fragment>
3602	#include <fog_fragment>
3603}`,It={alphahash_fragment:nV,alphahash_pars_fragment:iV,alphamap_fragment:rV,alphamap_pars_fragment:sV,alphatest_fragment:oV,alphatest_pars_fragment:aV,aomap_fragment:lV,aomap_pars_fragment:cV,batching_pars_vertex:uV,batching_vertex:hV,begin_vertex:dV,beginnormal_vertex:fV,bsdfs:pV,iridescence_fragment:mV,bumpmap_pars_fragment:gV,clipping_planes_fragment:vV,clipping_planes_pars_fragment:xV,clipping_planes_pars_vertex:yV,clipping_planes_vertex:_V,color_fragment:bV,color_pars_fragment:wV,color_pars_vertex:SV,color_vertex:MV,common:TV,cube_uv_reflection_fragment:EV,defaultnormal_vertex:AV,displacementmap_pars_vertex:CV,displacementmap_vertex:RV,emissivemap_fragment:PV,emissivemap_pars_fragment:IV,colorspace_fragment:NV,colorspace_pars_fragment:LV,envmap_fragment:OV,envmap_common_pars_fragment:DV,envmap_pars_fragment:kV,envmap_pars_vertex:FV,envmap_physical_pars_fragment:XV,envmap_vertex:UV,fog_vertex:BV,fog_pars_vertex:zV,fog_fragment:VV,fog_pars_fragment:HV,gradientmap_pars_fragment:GV,lightmap_pars_fragment:WV,lights_lambert_fragment:$V,lights_lambert_pars_fragment:jV,lights_pars_begin:qV,lights_toon_fragment:YV,lights_toon_pars_fragment:KV,lights_phong_fragment:ZV,lights_phong_pars_fragment:JV,lights_physical_fragment:QV,lights_physical_pars_fragment:e6,lights_fragment_begin:t6,lights_fragment_maps:n6,lights_fragment_end:i6,logdepthbuf_fragment:r6,logdepthbuf_pars_fragment:s6,logdepthbuf_pars_vertex:o6,logdepthbuf_vertex:a6,map_fragment:l6,map_pars_fragment:c6,map_particle_fragment:u6,map_particle_pars_fragment:h6,metalnessmap_fragment:d6,metalnessmap_pars_fragment:f6,morphinstance_vertex:p6,morphcolor_vertex:m6,morphnormal_vertex:g6,morphtarget_pars_vertex:v6,morphtarget_vertex:x6,normal_fragment_begin:y6,normal_fragment_maps:_6,normal_pars_fragment:b6,normal_pars_vertex:w6,normal_vertex:S6,normalmap_pars_fragment:M6,clearcoat_normal_fragment_begin:T6,clearcoat_normal_fragment_maps:E6,clearcoat_pars_fragment:A6,iridescence_pars_fragment:C6,opaque_fragment:R6,packing:P6,premultiplied_alpha_fragment:I6,project_vertex:N6,dithering_fragment:L6,dithering_pars_fragment:O6,roughnessmap_fragment:D6,roughnessmap_pars_fragment:k6,shadowmap_pars_fragment:F6,shadowmap_pars_vertex:U6,shadowmap_vertex:B6,shadowmask_pars_fragment:z6,skinbase_vertex:V6,skinning_pars_vertex:H6,skinning_vertex:G6,skinnormal_vertex:W6,specularmap_fragment:$6,specularmap_pars_fragment:j6,tonemapping_fragment:q6,tonemapping_pars_fragment:X6,transmission_fragment:Y6,transmission_pars_fragment:K6,uv_pars_fragment:Z6,uv_pars_vertex:J6,uv_vertex:Q6,worldpos_vertex:e8,background_vert:t8,background_frag:n8,backgroundCube_vert:i8,backgroundCube_frag:r8,cube_vert:s8,cube_frag:o8,depth_vert:a8,depth_frag:l8,distanceRGBA_vert:c8,distanceRGBA_frag:u8,equirect_vert:h8,equirect_frag:d8,linedashed_vert:f8,linedashed_frag:p8,meshbasic_vert:m8,meshbasic_frag:g8,meshlambert_vert:v8,meshlambert_frag:x8,meshmatcap_vert:y8,meshmatcap_frag:_8,meshnormal_vert:b8,meshnormal_frag:w8,meshphong_vert:S8,meshphong_frag:M8,meshphysical_vert:T8,meshphysical_frag:E8,meshtoon_vert:A8,meshtoon_frag:C8,points_vert:R8,points_frag:P8,shadow_vert:I8,shadow_frag:N8,sprite_vert:L8,sprite_frag:O8},$e={common:{diffuse:{value:new We(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ct},alphaMap:{value:null},alphaMapTransform:{value:new Ct},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ct}},envmap:{envMap:{value:null},envMapRotation:{value:new Ct},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ct}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ct}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ct},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ct},normalScale:{value:new de(1,1)}}
vendor: 5,169 bytes, line 3603
3603,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ct},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ct}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ct}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ct}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new We(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new We(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ct},alphaTest:{value:0},uvTransform:{value:new Ct}},sprite:{diffuse:{value:new We(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ct},alphaMap:{value:null},alphaMapTransform:{value:new Ct},alphaTest:{value:0}}},Kr={basic:{uniforms:Di([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:It.meshbasic_vert,fragmentShader:It.meshbasic_frag},lambert:{uniforms:Di([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new We(0)}}]),vertexShader:It.meshlambert_vert,fragmentShader:It.meshlambert_frag},phong:{uniforms:Di([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new We(0)},specular:{value:new We(1118481)},shininess:{value:30}}]),vertexShader:It.meshphong_vert,fragmentShader:It.meshphong_frag},standard:{uniforms:Di([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new We(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:It.meshphysical_vert,fragmentShader:It.meshphysical_frag},toon:{uniforms:Di([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new We(0)}}]),vertexShader:It.meshtoon_vert,fragmentShader:It.meshtoon_frag},matcap:{uniforms:Di([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:It.meshmatcap_vert,fragmentShader:It.meshmatcap_frag},points:{uniforms:Di([$e.points,$e.fog]),vertexShader:It.points_vert,fragmentShader:It.points_frag},dashed:{uniforms:Di([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:It.linedashed_vert,fragmentShader:It.linedashed_frag},depth:{uniforms:Di([$e.common,$e.displacementmap]),vertexShader:It.depth_vert,fragmentShader:It.depth_frag},normal:{uniforms:Di([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:It.meshnormal_vert,fragmentShader:It.meshnormal_frag},sprite:{uniforms:Di([$e.sprite,$e.fog]),vertexShader:It.sprite_vert,fragmentShader:It.sprite_frag},background:{uniforms:{uvTransform:{value:new Ct},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:It.background_vert,fragmentShader:It.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ct}},vertexShader:It.backgroundCube_vert,fragmentShader:It.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:It.cube_vert,fragmentShader:It.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:It.equirect_vert,fragmentShader:It.equirect_frag},distanceRGBA:{uniforms:Di([$e.common,$e.displacementmap,{referencePosition:{value:new z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:It.distanceRGBA_vert,fragmentShader:It.distanceRGBA_frag},shadow:{uniforms:Di([$e.lights,$e.fog,{color:{value:new We(0)},opacity:{value:1}}]),vertexShader:It.shadow_vert,fragmentShader:It.shadow_frag}};
vendor: 6,273 bytes, line 3603
3603Kr.physical={uniforms:Di([Kr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ct},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ct},clearcoatNormalScale:{value:new de(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ct},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ct},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ct},sheen:{value:0},sheenColor:{value:new We(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ct},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ct},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ct},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ct},attenuationDistance:{value:0},attenuationColor:{value:new We(0)},specularColor:{value:new We(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ct},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ct},anisotropyVector:{value:new de},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ct}}]),vertexShader:It.meshphysical_vert,fragmentShader:It.meshphysical_frag};const Bf={r:0,b:0,g:0},La=new ai,D8=new ht;function k8(n,e,t,i,r,s,o){const a=new We(0);let l=s===!0?0:1,c,u,h=null,d=0,f=null;function p(x){let _=x.isScene===!0?x.background:null;return _&&_.isTexture&&(_=(x.backgroundBlurriness>0?t:e).get(_)),_}function v(x){let _=!1;const T=p(x);T===null?g(a,l):T&&T.isColor&&(g(T,1),_=!0);const S=n.xr.getEnvironmentBlendMode();S==="additive"?i.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||_)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function m(x,_){const T=p(_);T&&(T.isCubeTexture||T.mapping===iu)?(u===void 0&&(u=new an(new da(1,1,1),new pn({name:"BackgroundCubeMaterial",uniforms:Vc(Kr.backgroundCube.uniforms),vertexShader:Kr.backgroundCube.vertexShader,fragmentShader:Kr.backgroundCube.fragmentShader,side:Xn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(S,E,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),La.copy(_.backgroundRotation),La.x*=-1,La.y*=-1,La.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(La.y*=-1,La.z*=-1),u.material.uniforms.envMap.value=T,u.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(D8.makeRotationFromEuler(La)),u.material.toneMapped=Gt.getTransfer(T.colorSpace)!==rn,(h!==T||d!==T.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,h=T,d=T.version,f=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):T&&T.isTexture&&(c===void 0&&(c=new an(new wl(2,2),new pn({name:"BackgroundMaterial",uniforms:Vc(Kr.background.uniforms),vertexShader:Kr.background.vertexShader,fragmentShader:Kr.background.fragmentShader,side:Ns,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=T,c.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,c.material.toneMapped=Gt.getTransfer(T.colorSpace)!==rn,T.matrixAutoUpdate===!0&&T.updateMatrix(),c.material.uniforms.uvTransform.value.copy(T.matrix),(h!==T||d!==T.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,h=T,d=T.version,f=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function g(x,_){x.getRGB(Bf,T3(n)),i.buffers.color.setClear(Bf.r,Bf.g,Bf.b,_,o)}function y(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,_=1){a.set(x),l=_,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,g(a,l)},render:v,addToRenderList:m,dispose:y}}function F8(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=d(null);let s=r,o=!1;function a(w,A,P,H,B){let G=!1;const O=h(H,P,A);s!==O&&(s=O,c(s.object)),G=f(w,H,P,B),G&&p(w,H,P,B),B!==null&&e.update(B,n.ELEMENT_ARRAY_BUFFER),(G||o)&&(o=!1,_(w,A,P,H),B!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(B).buffer))}function l(){return n.createVertexArray()}function c(w){return n.bindVertexArray(w)}function u(w){return n.deleteVertexArray(w)}function h(w,A,P){const H=P.wireframe===!0;let B=i[w.id];B===void 0&&(B={},i[w.id]=B);let G=B[A.id];G===void 0&&(G={},B[A.id]=G);let O=G[H];return O===void 0&&(O=d(l()),G[H]=O),O}function d(w){const A=[],P=[],H=[];for(let B=0;B<t;B++)A[B]=0,P[B]=0,H[B]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:A,enabledAttributes:P,attributeDivisors:H,object:w,attributes:{},index:null}}function f(w,A,P,H){const B=s.attributes,G=A.attributes;let O=0;const $=P.getAttributes();for(const F in $)if($[F].location>=0){const se=B[F];let be=G[F];if(be===void 0&&(F==="instanceMatrix"&&w.instanceMatrix&&(be=w.instanceMatrix),F==="instanceColor"&&w.instanceColor&&(be=w.instanceColor)),se===void 0||se.attribute!==be||be&&se.data!==be.data)return!0;O++}return s.attributesNum!==O||s.index!==H}function p(w,A,P,H){const B={},G=A.attributes;let O=0;const $=P.getAttributes();for(const F in $)if($[F].location>=0){let se=G[F];se===void 0&&(F==="instanceMatrix"&&w.instanceMatrix&&(se=w.instanceMatrix),F==="instanceColor"&&w.instanceColor&&(se=w.instanceColor));const be={};
vendor: 3,420 bytes, line 3603
3603be.attribute=se,se&&se.data&&(be.data=se.data),B[F]=be,O++}s.attributes=B,s.attributesNum=O,s.index=H}function v(){const w=s.newAttributes;for(let A=0,P=w.length;A<P;A++)w[A]=0}function m(w){g(w,0)}function g(w,A){const P=s.newAttributes,H=s.enabledAttributes,B=s.attributeDivisors;P[w]=1,H[w]===0&&(n.enableVertexAttribArray(w),H[w]=1),B[w]!==A&&(n.vertexAttribDivisor(w,A),B[w]=A)}function y(){const w=s.newAttributes,A=s.enabledAttributes;for(let P=0,H=A.length;P<H;P++)A[P]!==w[P]&&(n.disableVertexAttribArray(P),A[P]=0)}function x(w,A,P,H,B,G,O){O===!0?n.vertexAttribIPointer(w,A,P,B,G):n.vertexAttribPointer(w,A,P,H,B,G)}function _(w,A,P,H){v();const B=H.attributes,G=P.getAttributes(),O=A.defaultAttributeValues;for(const $ in G){const F=G[$];if(F.location>=0){let J=B[$];if(J===void 0&&($==="instanceMatrix"&&w.instanceMatrix&&(J=w.instanceMatrix),$==="instanceColor"&&w.instanceColor&&(J=w.instanceColor)),J!==void 0){const se=J.normalized,be=J.itemSize,Fe=e.get(J);if(Fe===void 0)continue;const Le=Fe.buffer,Ge=Fe.type,ze=Fe.bytesPerElement,he=Ge===n.INT||Ge===n.UNSIGNED_INT||J.gpuType===Mg;if(J.isInterleavedBufferAttribute){const fe=J.data,ue=fe.stride,I=J.offset;if(fe.isInstancedInterleavedBuffer){for(let V=0;V<F.locationSize;V++)g(F.location+V,fe.meshPerAttribute);w.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=fe.meshPerAttribute*fe.count)}else for(let V=0;V<F.locationSize;V++)m(F.location+V);n.bindBuffer(n.ARRAY_BUFFER,Le);for(let V=0;V<F.locationSize;V++)x(F.location+V,be/F.locationSize,Ge,se,ue*ze,(I+be/F.locationSize*V)*ze,he)}else{if(J.isInstancedBufferAttribute){for(let fe=0;fe<F.locationSize;fe++)g(F.location+fe,J.meshPerAttribute);w.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let fe=0;fe<F.locationSize;fe++)m(F.location+fe);n.bindBuffer(n.ARRAY_BUFFER,Le);for(let fe=0;fe<F.locationSize;fe++)x(F.location+fe,be/F.locationSize,Ge,se,be*ze,be/F.locationSize*fe*ze,he)}}else if(O!==void 0){const se=O[$];if(se!==void 0)switch(se.length){case 2:n.vertexAttrib2fv(F.location,se);break;case 3:n.vertexAttrib3fv(F.location,se);break;case 4:n.vertexAttrib4fv(F.location,se);break;default:n.vertexAttrib1fv(F.location,se)}}}}y()}function T(){M();for(const w in i){const A=i[w];for(const P in A){const H=A[P];for(const B in H)u(H[B].object),delete H[B];delete A[P]}delete i[w]}}function S(w){if(i[w.id]===void 0)return;const A=i[w.id];for(const P in A){const H=A[P];for(const B in H)u(H[B].object),delete H[B];delete A[P]}delete i[w.id]}function E(w){for(const A in i){const P=i[A];if(P[w.id]===void 0)continue;const H=P[w.id];for(const B in H)u(H[B].object),delete H[B];delete P[w.id]}}function M(){b(),o=!0,s!==r&&(s=r,c(s.object))}function b(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:M,resetDefaultState:b,dispose:T,releaseStatesOfGeometry:S,releaseStatesOfProgram:E,initAttributes:v,enableAttribute:m,disableUnusedAttributes:y}}function U8(n,e,t){let i;function r(c){i=c}function s(c,u){n.drawArrays(i,c,u),t.update(u,i,1)}function o(c,u,h){h!==0&&(n.drawArraysInstanced(i,c,u,h),t.update(u,i,h))}function a(c,u,h){if(h===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,c,0,u,0,h);let f=0;for(let p=0;p<h;p++)f+=u[p];t.update(f,i,1)}function l(c,u,h,d){if(h===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let p=0;p<c.length;p++)o(c[p],u[p],d[p]);
vendor: 7,206 bytes, line 3603
3603else{f.multiDrawArraysInstancedWEBGL(i,c,0,u,0,d,0,h);let p=0;for(let v=0;v<h;v++)p+=u[v]*d[v];t.update(p,i,1)}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function B8(n,e,t,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const E=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(E.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(E){return!(E!==Wi&&i.convert(E)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(E){const M=E===Gi&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(E!==Wn&&i.convert(E)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&E!==li&&!M)}function l(E){if(E==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";E="mediump"}return E==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(je("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,d=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),f=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),m=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),_=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),T=p>0,S=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,reversedDepthBuffer:d,maxTextures:f,maxVertexTextures:p,maxTextureSize:v,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:y,maxVaryings:x,maxFragmentUniforms:_,vertexTextures:T,maxSamples:S}}function z8(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new sr,a=new Ct,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||i!==0||r;return r=d,i=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,v=h.clipIntersection,m=h.clipShadows,g=n.get(h);if(!r||p===null||p.length===0||s&&!m)s?u(null):c();else{const y=s?0:i,x=y*4;let _=g.clippingState||null;l.value=_,_=u(p,d,x,f);for(let T=0;T!==x;++T)_[T]=t[T];g.clippingState=_,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,f,p){const v=h!==null?h.length:0;let m=null;if(v!==0){if(m=l.value,p!==!0||m===null){const g=f+v*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length<g)&&(m=new Float32Array(g));for(let x=0,_=f;x!==v;++x,_+=4)o.copy(h[x]).applyMatrix4(y,a),o.normal.toArray(m,_),m[_+3]=o.constant}l.value=m,l.needsUpdate=!0}return e.numPlanes=v,e.numIntersection=0,m}}function V8(n){let e=new WeakMap;function t(o,a){return a===Jo?o.mapping=Ls:a===Nh&&(o.mapping=ea),o}function i(o){if(o&&o.isTexture){const a=o.mapping;if(a===Jo||a===Nh)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const c=new ob(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const Xo=4,aM=[.125,.215,.35,.446,.526,.582],Ha=20,H8=512,Du=new rs,lM=new We;let Cv=null,Rv=0,Pv=0,Iv=!1;const G8=new z;class fy{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,i=.1,r=100,s={}){const{size:o=256,position:a=G8}=s;Cv=this._renderer.getRenderTarget(),Rv=this._renderer.getActiveCubeFace(),Pv=this._renderer.getActiveMipmapLevel(),Iv=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,a),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=hM(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=uM(),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(Cv,Rv,Pv),this._renderer.xr.enabled=Iv,e.scissorTest=!1,ec(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ls||e.mapping===ea?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Cv=this._renderer.getRenderTarget(),Rv=this._renderer.getActiveCubeFace(),Pv=this._renderer.getActiveMipmapLevel(),Iv=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:dn,minFilter:dn,generateMipmaps:!1,type:Gi,format:Wi,colorSpace:_o,depthBuffer:!1},r=cM(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=cM(e,t,i);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=W8(s)),this._blurMaterial=j8(s,e,t)}return r}_compileMaterial(e){const t=new an(new At,e);this._renderer.compile(t,Du)}_sceneToCubeUV(e,t,i,r,s){const l=new xn(90,1,t,i),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(lM),h.toneMapping=As,h.autoClear=!1,h.state.buffers.depth.getReversed()&&(h.setRenderTarget(r),h.clearDepth(),h.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new an(new da,new Gs({name:"PMREM.Backgroun
3603d",side:Xn,depthWrite:!1,depthTest:!1})));const v=this._backgroundBox,m=v.material;let g=!1;const y=e.background;y?y.isColor&&(m.color.copy(y),e.background=null,g=!0):(m.color.copy(lM),g=!0);for(let x=0;x<6;x++){const _=x%3;_===0?(l.up.set(0,c[x],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[x],s.y,s.z)):_===1?(l.up.set(0,0,c[x]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[x],s.z)):(l.up.set(0,c[x],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[x]));const T=this._cubeSize;ec(r,_*T,x>2?T:0,T,T),h.setRenderTarget(r),g&&h.render(v,l),h.render(e,l)}h.toneMapping=f,h.autoClear=d,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Ls||e.mapping===ea;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=hM()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=uM());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;ec(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Du)}_applyPMREM(e){const t=this._renderer,i=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=i}_applyGGXFilter(e,t,i){const r=this._renderer,s=this._pingPongRenderTarget;if(this._ggxMaterial===null){const y=3*Math.max(this._cubeSize,16),x=4*this._cubeSize;this._ggxMaterial=$8(this._lodMax,y,x)}const o=this._ggxMaterial,a=this._lodMeshes[i];a.material=o;const l=o.uniforms,c=i/(this._lodMeshes.length-1),u=t/(this._lodMeshes.length-1),h=Math.sqrt(c*c-u*u),d=.05+c*.95,f=h*d,{_lodMax:p}=this,v=this._sizeLods[i],m=3*v*(i>p-Xo?i-p+Xo:0),g=4*(this._cubeSize-v);l.envMap.value=e.texture,l.roughness.value=f,l.mipInt.value=p-t,ec(s,m,g,3*v,2*v),r.setRenderTarget(s),r.render(a,Du),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=p-i,ec(e,m,g,3*v,2*v),r.setRenderTarget(e),r.render(a,Du)}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&St("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[i]-1,p=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*Ha-1),v=s/p,m=isFinite(s)?1+Math.floor(u*v):Ha;m>Ha&&je(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ha}`);const g=[];let y=0;for(let E=0;E<Ha;++E){const M=E/v,b=Math.exp(-M*M/2);g.push(b),E===0?y+=b:E<m&&(y+=2*b)}for(let E=0;E<g.length;E++)g[E]=g[E]/y;d.envMap.value=e.texture,d.samples.value=m,d.weights.value=g,d.latitudinal.value=o==="latitudinal",a&&(d.poleAxis.value=a);const{_lodMax:x}=this;d.dTheta.value=p,d.mipInt.value=x-i;const _=this._sizeLods[r],T=3*_*(r>x-Xo?r-x+Xo:0),S=4*(this._cubeSize-_);ec(t,T,S,3*_,2*_),l.setRenderTarget(t),l.render(h,Du)}}function W8(n){const e=[],t=[],i=[];let r=n;const s=n-Xo+1+aM.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);e.push(a);let l=1/a;o>n-Xo?l=aM[o-n+Xo-1]:o===0&&(l=0),t.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,p=6,v=3,m=2,g=1,y=new Float32Array(v*p*f),x=new Float32Array(m*p*f),_=new Float32Array(g*p*f);for(let S=0;S<f;S++){const E=S%3*2/3-1,M=S>2?0:-1,b=[E,M,0,E+2/3,M,0,E+2/3,M+1,0,E,M,0,E+2/3,M+1,0,E,M+1,0];y.set(b,v*p*S),x.set(d,m*p*S);const w=[S,S,S,S,S,S];_.set(w,g*p*S)}const T=new At;T.setAttribute("position",new Jt(y,v)),T.setAttribute("uv",new Jt(x,m)),T.setAttribute("faceIndex",new Jt(_,g)),i.push(new an(T,null)),r>Xo&&r--}return{lodMeshes:i,sizeLods:e,sigmas:t}}function cM(n,e,t){const i=new En(n,e,t);return i.texture.mapping=iu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ec(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function $8(n,e,t){return new pn({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:H8,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:n0(),fragmentShader:`
3604
3605			precision mediump float;
3606			precision mediump int;
3607
3608			varying vec3 vOutputDirection;
3609
3610			uniform sampler2D envMap;
3611			uniform float roughness;
3612			uniform float mipInt;
3613
3614			#define ENVMAP_TYPE_CUBE_UV
3615			#include <cube_uv_reflection_fragment>
3616
3617			#define PI 3.14159265359
3618
3619			// Van der Corput radical inverse
3620			float radicalInverse_VdC(uint bits) {
3621				bits = (bits << 16u) | (bits >> 16u);
3622				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3623				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3624				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3625				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3626				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3627			}
3628
3629			// Hammersley sequence
3630			vec2 hammersley(uint i, uint N) {
3631				return vec2(float(i) / float(N), radicalInverse_VdC(i));
3632			}
3633
3634			// GGX VNDF importance sampling (Eric Heitz 2018)
3635			// "Sampling the GGX Distribution of Visible Normals"
3636			// https://jcgt.org/published/0007/04/01/
3637			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
3638				float alpha = roughness * roughness;
3639
3640				// Section 3.2: Transform view direction to hemisphere configuration
3641				vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z));
3642
3643				// Section 4.1: Orthonormal basis
3644				float lensq = Vh.x * Vh.x + Vh.y * Vh.y;
3645				vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0);
3646				vec3 T2 = cross(Vh, T1);
3647
3648				// Section 4.2: Parameterization of projected area
3649				float r = sqrt(Xi.x);
3650				float phi = 2.0 * PI * Xi.y;
3651				float t1 = r * cos(phi);
3652				float t2 = r * sin(phi);
3653				float s = 0.5 * (1.0 + Vh.z);
3654				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
3655
3656				// Section 4.3: Reprojection onto hemisphere
3657				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh;
3658
3659				// Section 3.4: Transform back to ellipsoid configuration
3660				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
3661			}
3662
3663			void main() {
3664				vec3 N = normalize(vOutputDirection);
3665				vec3 V = N; // Assume view direction equals normal for pre-filtering
3666
3667				vec3 prefilteredColor = vec3(0.0);
3668				float totalWeight = 0.0;
3669
3670				// For very low roughness, just sample the environment directly
3671				if (roughness < 0.001) {
3672					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
3673					return;
3674				}
3675
3676				// Tangent space basis for VNDF sampling
3677				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
3678				vec3 tangent = normalize(cross(up, N));
3679				vec3 bitangent = cross(N, tangent);
3680
3681				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
3682					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
3683
3684					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
3685					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
3686
3687					// Transform H back to world space
3688					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
3689					vec3 L = normalize(2.0 * dot(V, H) * H - V);
3690
3691					float NdotL = max(dot(N, L), 0.0);
3692
3693					if(NdotL > 0.0) {
3694						// Sample environment at fixed mip level
3695						// VNDF importance sampling handles the distribution filtering
3696						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
3697
3698						// Weight by NdotL for the split-sum approximation
3699						// VNDF PDF naturally accounts for the visible microfacet distribution
3700						prefilteredColor += sampleColor * NdotL;
3701						totalWeight += NdotL;
3702					}
3703				}
3704
3705				if (totalWeight > 0.0) {
3706					prefilteredColor = prefilteredColor / totalWeight;
3707				}
3708
3709				gl_FragColor = vec4(prefilteredColor, 1.0);
3710			}
3711		`,blending:Hn,depthTest:!1,depthWrite:!1})}function j8(n,e,t){const i=new Float32Array(Ha),r=new z(0,1,0);return new pn({name:"SphericalGaussianBlur",defines:{n:Ha,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:n0(),fragmentShader:`
3712
3713			precision mediump float;
3714			precision mediump int;
3715
3716			varying vec3 vOutputDirection;
3717
3718			uniform sampler2D envMap;
3719			uniform int samples;
3720			uniform float weights[ n ];
3721			uniform bool latitudinal;
3722			uniform float dTheta;
3723			uniform float mipInt;
3724			uniform vec3 poleAxis;
3725
3726			#define ENVMAP_TYPE_CUBE_UV
3727			#include <cube_uv_reflection_fragment>
3728
3729			vec3 getSample( float theta, vec3 axis ) {
3730
3731				float cosTheta = cos( theta );
3732				// Rodrigues' axis-angle rotation
3733				vec3 sampleDirection = vOutputDirection * cosTheta
3734					+ cross( axis, vOutputDirection ) * sin( theta )
3735					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3736
3737				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3738
3739			}
3740
3741			void main() {
3742
3743				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3744
3745				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3746
3747					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3748
3749				}
3750
3751				axis = normalize( axis );
3752
3753				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3754				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3755
3756				for ( int i = 1; i < n; i++ ) {
3757
3758					if ( i >= samples ) {
3759
3760						break;
3761
3762					}
3763
3764					float theta = dTheta * float( i );
3765					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3766					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3767
3768				}
3769
3770			}
3771		`,blending:Hn,depthTest:!1,depthWrite:!1})}function uM(){return new pn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:n0(),fragmentShader:`
3772
3773			precision mediump float;
3774			precision mediump int;
3775
3776			varying vec3 vOutputDirection;
3777
3778			uniform sampler2D envMap;
3779
3780			#include <common>
3781
3782			void main() {
3783
3784				vec3 outputDirection = normalize( vOutputDirection );
3785				vec2 uv = equirectUv( outputDirection );
3786
3787				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3788
3789			}
3790		`,blending:Hn,depthTest:!1,depthWrite:!1})}function hM(){return new pn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:n0(),fragmentShader:`
3791
3792			precision mediump float;
3793			precision mediump int;
3794
3795			uniform float flipEnvMap;
3796
3797			varying vec3 vOutputDirection;
3798
3799			uniform samplerCube envMap;
3800
3801			void main() {
3802
3803				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3804
3805			}
3806		`,blending:Hn,depthTest:!1,depthWrite:!1})}function n0(){return`
3807
3808		precision mediump float;
3809		precision mediump int;
3810
3811		attribute float faceIndex;
3812
3813		varying vec3 vOutputDirection;
3814
3815		// RH coordinate system; PMREM face-indexing convention
3816		vec3 getDirection( vec2 uv, float face ) {
3817
3818			uv = 2.0 * uv - 1.0;
3819
3820			vec3 direction = vec3( uv, 1.0 );
3821
3822			if ( face == 0.0 ) {
3823
3824				direction = direction.zyx; // ( 1, v, u ) pos x
3825
3826			} else if ( face == 1.0 ) {
3827
3828				direction = direction.xzy;
3829				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3830
3831			} else if ( face == 2.0 ) {
3832
3833				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3834
3835			} else if ( face == 3.0 ) {
3836
3837				direction = direction.zyx;
3838				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3839
3840			} else if ( face == 4.0 ) {
3841
3842				direction = direction.xzy;
3843				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3844
3845			} else if ( face == 5.0 ) {
3846
3847				direction.z *= -1.0; // ( u, v, -1 ) neg z
3848
3849			}
3850
3851			return direction;
3852
3853		}
3854
3855		void main() {
3856
3857			vOutputDirection = getDirection( uv, faceIndex );
3858			gl_Position = vec4( position, 1.0 );
3859
3860		}
3861	`}function q8(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Jo||l===Nh,u=l===Ls||l===ea;if(c||u){let h=e.get(a);const d=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new fy(n)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const f=a.image;return c&&f&&f.height>0||u&&f&&r(f)?(t===null&&(t=new fy(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){const l=a.target;l.removeEventListener("dispose",s);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function X8(n){const e={};function t(i){if(e[i]!==void 0)return e[i];const r=n.getExtension(i);return e[i]=r,r}return{has:function(i){return t(i)!==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(i){const r=t(i);return r===null&&Bc("WebGLRenderer: "+i+" extension not supported."),r}}}function Y8(n,e,t,i){const r={},s=new WeakMap;function o(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",o),delete r[d.id];const f=s.get(d);
vendor: 5,310 bytes, line 3861
3861f&&(e.remove(f),s.delete(d)),i.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function a(h,d){return r[d.id]===!0||(d.addEventListener("dispose",o),r[d.id]=!0,t.memory.geometries++),d}function l(h){const d=h.attributes;for(const f in d)e.update(d[f],n.ARRAY_BUFFER)}function c(h){const d=[],f=h.index,p=h.attributes.position;let v=0;if(f!==null){const y=f.array;v=f.version;for(let x=0,_=y.length;x<_;x+=3){const T=y[x+0],S=y[x+1],E=y[x+2];d.push(T,S,S,E,E,T)}}else if(p!==void 0){const y=p.array;v=p.version;for(let x=0,_=y.length/3-1;x<_;x+=3){const T=x+0,S=x+1,E=x+2;d.push(T,S,S,E,E,T)}}else return;const m=new(b3(d)?rb:ib)(d,1);m.version=v;const g=s.get(h);g&&e.remove(g),s.set(h,m)}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:a,update:l,getWireframeAttribute:u}}function K8(n,e,t){let i;function r(d){i=d}let s,o;function a(d){s=d.type,o=d.bytesPerElement}function l(d,f){n.drawElements(i,f,s,d*o),t.update(f,i,1)}function c(d,f,p){p!==0&&(n.drawElementsInstanced(i,f,s,d*o,p),t.update(f,i,p))}function u(d,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,f,0,s,d,0,p);let m=0;for(let g=0;g<p;g++)m+=f[g];t.update(m,i,1)}function h(d,f,p,v){if(p===0)return;const m=e.get("WEBGL_multi_draw");if(m===null)for(let g=0;g<d.length;g++)c(d[g]/o,f[g],v[g]);else{m.multiDrawElementsInstancedWEBGL(i,f,0,s,d,0,v,0,p);let g=0;for(let y=0;y<p;y++)g+=f[y]*v[y];t.update(g,i,1)}}this.setMode=r,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=h}function Z8(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,a){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=a*(s/3);break;case n.LINES:t.lines+=a*(s/2);break;case n.LINE_STRIP:t.lines+=a*(s-1);break;case n.LINE_LOOP:t.lines+=a*s;break;case n.POINTS:t.points+=a*s;break;default:St("WebGLInfo: Unknown draw mode:",o);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:i}}function J8(n,e,t){const i=new WeakMap,r=new Ft;function s(o,a,l){const c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,h=u!==void 0?u.length:0;let d=i.get(a);if(d===void 0||d.count!==h){let b=function(){E.dispose(),i.delete(a),a.removeEventListener("dispose",b)};d!==void 0&&d.texture.dispose();const f=a.morphAttributes.position!==void 0,p=a.morphAttributes.normal!==void 0,v=a.morphAttributes.color!==void 0,m=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],y=a.morphAttributes.color||[];let x=0;f===!0&&(x=1),p===!0&&(x=2),v===!0&&(x=3);let _=a.attributes.position.count*x,T=1;_>e.maxTextureSize&&(T=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const S=new Float32Array(_*T*4*h),E=new Ng(S,_,T,h);E.type=li,E.needsUpdate=!0;const M=x*4;for(let w=0;w<h;w++){const A=m[w],P=g[w],H=y[w],B=_*T*4*w;for(let G=0;G<A.count;G++){const O=G*M;f===!0&&(r.fromBufferAttribute(A,G),S[B+O+0]=r.x,S[B+O+1]=r.y,S[B+O+2]=r.z,S[B+O+3]=0),p===!0&&(r.fromBufferAttribute(P,G),S[B+O+4]=r.x,S[B+O+5]=r.y,S[B+O+6]=r.z,S[B+O+7]=0),v===!0&&(r.fromBufferAttribute(H,G),S[B+O+8]=r.x,S[B+O+9]=r.y,S[B+O+10]=r.z,S[B+O+11]=H.itemSize===4?r.w:1)}}d={count:h,texture:E,size:new de(_,T)},i.set(a,d),a.addEventListener("dispose",b)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(n,"morphTexture",o.morphTexture,t);else{let f=0;for(let v=0;v<c.length;v++)f+=c[v];const p=a.morphTargetsRelative?1:1-f;l.getUniforms().setValue(n,"morphTargetBaseInfluence",p),l.getUniforms().setValue(n,"morphTargetInfluences",c)}l.getUniforms().setValue(n,"morphTargetsTexture",d.texture,t),l.getUniforms().setValue(n,"morphTargetsTextureSize",d.size)}return{update:s}}function Q8(n,e,t,i){let r=new WeakMap;function s(l){const c=i.render.frame,u=l.geometry,h=e.get(l,u);if(r.get(h)!==c&&(e.update(h),r.set(h,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),r.get(l)!==c&&(t.update(l.instanceMatrix,n.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,n.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const d=l.skeleton;r.get(d)!==c&&(d.update(),r.set(d,c))}return h}function o(){r=new WeakMap}function a(l){const c=l.target;c.removeEventListener("dispose",a),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}const TR=new Sn,dM=new Vg(1,1),ER=new Ng,AR=new Lg,CR=new gd,fM=[],pM=[],mM=new Float32Array(16),gM=new Float32Array(9),vM=new Float32Array(4);function ou(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=fM[r];if(s===void 0&&(s=new Float32Array(r),fM[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ii(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function ri(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function i0(n,e){let t=pM[e];t===void 0&&(t=new Int32Array(e),pM[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function eH(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function tH(n,e){const t=this.cache;
vendor: 13,469 bytes, lines 3861-3896
3861if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ii(t,e))return;n.uniform2fv(this.addr,e),ri(t,e)}}function nH(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.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)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(ii(t,e))return;n.uniform3fv(this.addr,e),ri(t,e)}}function iH(n,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)&&(n.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(ii(t,e))return;n.uniform4fv(this.addr,e),ri(t,e)}}function rH(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ii(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),ri(t,e)}else{if(ii(t,i))return;vM.set(i),n.uniformMatrix2fv(this.addr,!1,vM),ri(t,i)}}function sH(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ii(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),ri(t,e)}else{if(ii(t,i))return;gM.set(i),n.uniformMatrix3fv(this.addr,!1,gM),ri(t,i)}}function oH(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ii(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),ri(t,e)}else{if(ii(t,i))return;mM.set(i),n.uniformMatrix4fv(this.addr,!1,mM),ri(t,i)}}function aH(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function lH(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ii(t,e))return;n.uniform2iv(this.addr,e),ri(t,e)}}function cH(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ii(t,e))return;n.uniform3iv(this.addr,e),ri(t,e)}}function uH(n,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)&&(n.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(ii(t,e))return;n.uniform4iv(this.addr,e),ri(t,e)}}function hH(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function dH(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ii(t,e))return;n.uniform2uiv(this.addr,e),ri(t,e)}}function fH(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ii(t,e))return;n.uniform3uiv(this.addr,e),ri(t,e)}}function pH(n,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)&&(n.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(ii(t,e))return;n.uniform4uiv(this.addr,e),ri(t,e)}}function mH(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r);let s;this.type===n.SAMPLER_2D_SHADOW?(dM.compareFunction=eb,s=dM):s=TR,t.setTexture2D(e||s,r)}function gH(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||AR,r)}function vH(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||CR,r)}function xH(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||ER,r)}function yH(n){switch(n){case 5126:return eH;case 35664:return tH;case 35665:return nH;case 35666:return iH;case 35674:return rH;case 35675:return sH;case 35676:return oH;case 5124:case 35670:return aH;case 35667:case 35671:return lH;case 35668:case 35672:return cH;case 35669:case 35673:return uH;case 5125:return hH;case 36294:return dH;case 36295:return fH;case 36296:return pH;case 35678:case 36198:case 36298:case 36306:case 35682:return mH;case 35679:case 36299:case 36307:return gH;case 35680:case 36300:case 36308:case 36293:return vH;case 36289:case 36303:case 36311:case 36292:return xH}}function _H(n,e){n.uniform1fv(this.addr,e)}function bH(n,e){const t=ou(e,this.size,2);n.uniform2fv(this.addr,t)}function wH(n,e){const t=ou(e,this.size,3);n.uniform3fv(this.addr,t)}function SH(n,e){const t=ou(e,this.size,4);n.uniform4fv(this.addr,t)}function MH(n,e){const t=ou(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function TH(n,e){const t=ou(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function EH(n,e){const t=ou(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function AH(n,e){n.uniform1iv(this.addr,e)}function CH(n,e){n.uniform2iv(this.addr,e)}function RH(n,e){n.uniform3iv(this.addr,e)}function PH(n,e){n.uniform4iv(this.addr,e)}function IH(n,e){n.uniform1uiv(this.addr,e)}function NH(n,e){n.uniform2uiv(this.addr,e)}function LH(n,e){n.uniform3uiv(this.addr,e)}function OH(n,e){n.uniform4uiv(this.addr,e)}function DH(n,e,t){const i=this.cache,r=e.length,s=i0(t,r);ii(i,s)||(n.uniform1iv(this.addr,s),ri(i,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||TR,s[o])}function kH(n,e,t){const i=this.cache,r=e.length,s=i0(t,r);ii(i,s)||(n.uniform1iv(this.addr,s),ri(i,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||AR,s[o])}function FH(n,e,t){const i=this.cache,r=e.length,s=i0(t,r);ii(i,s)||(n.uniform1iv(this.addr,s),ri(i,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||CR,s[o])}function UH(n,e,t){const i=this.cache,r=e.length,s=i0(t,r);ii(i,s)||(n.uniform1iv(this.addr,s),ri(i,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||ER,s[o])}function BH(n){switch(n){case 5126:return _H;case 35664:return bH;case 35665:return wH;case 35666:return SH;case 35674:return MH;case 35675:return TH;case 35676:return EH;case 5124:case 35670:return AH;case 35667:case 35671:return CH;case 35668:case 35672:return RH;case 35669:case 35673:return PH;case 5125:return IH;case 36294:return NH;case 36295:return LH;case 36296:return OH;case 35678:case 36198:case 36298:case 36306:case 35682:return DH;case 35679:case 36299:case 36307:return kH;case 35680:case 36300:case 36308:case 36293:return FH;case 36289:case 36303:case 36311:case 36292:return UH}}class zH{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=yH(t.type)}}class VH{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=BH(t.type)}}class HH{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(e,t[a.id],i)}}}const Nv=/(\w+)(\])?(\[|\.)?/g;function xM(n,e){n.seq.push(e),n.map[e.id]=e}function GH(n,e,t){const i=n.name,r=i.length;for(Nv.lastIndex=0;;){const s=Nv.exec(i),o=Nv.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===r){xM(t,c===void 0?new zH(a,n,e):new VH(a,n,e));break}else{let h=t.map[a];h===void 0&&(h=new HH(a),xM(t,h)),t=h}}}class Cp{constructor(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const s=e.getActiveUniform(t,r),o=e.getUniformLocation(t,s.name);GH(s,o,this)}}setValue(e,t,i,r){const s=this.map[t];s!==void 0&&s.setValue(e,i,r)}setOptional(e,t,i){const r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,t){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in t&&i.push(o)}return i}}function yM(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}const WH=37297;let $H=0;function jH(n,e){const t=n.split(`
3862`),i=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=r;o<s;o++){const a=o+1;i.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return i.join(`
3863`)}const _M=new Ct;function qH(n){Gt._getMatrix(_M,Gt.workingColorSpace,n);const e=`mat3( ${_M.elements.map(t=>t.toFixed(4))} )`;switch(Gt.getTransfer(n)){case kh:return[e,"LinearTransferOETF"];case rn:return[e,"sRGBTransferOETF"];default:return je("WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function bM(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=(n.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return t.toUpperCase()+`
3864
3865`+s+`
3866
3867`+jH(n.getShaderSource(e),a)}else return s}function XH(n,e){const t=qH(e);return[`vec4 ${n}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
3868`)}function YH(n,e){let t;switch(e){case n3:t="Linear";break;case i3:t="Reinhard";break;case r3:t="Cineon";break;case $_:t="ACESFilmic";break;case o3:t="AgX";break;case a3:t="Neutral";break;case s3:t="Custom";break;default:je("WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const zf=new z;function KH(){Gt.getLuminanceCoefficients(zf);const n=zf.x.toFixed(4),e=zf.y.toFixed(4),t=zf.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${n}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
3869`)}function ZH(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(eh).join(`
3870`)}function JH(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
3871`)}function QH(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const s=n.getActiveAttrib(e,r),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function eh(n){return n!==""}function wM(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.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 SM(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const e9=/^[ \t]*#include +<([\w\d./]+)>/gm;function py(n){return n.replace(e9,n9)}const t9=new Map;function n9(n,e){let t=It[e];if(t===void 0){const i=t9.get(e);if(i!==void 0)t=It[i],je('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return py(t)}const i9=/#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 MM(n){return n.replace(i9,r9)}function r9(n,e,t,i){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function TM(n){let e=`precision ${n.precision} float;
3872	precision ${n.precision} int;
3873	precision ${n.precision} sampler2D;
3874	precision ${n.precision} samplerCube;
3875	precision ${n.precision} sampler3D;
3876	precision ${n.precision} sampler2DArray;
3877	precision ${n.precision} sampler2DShadow;
3878	precision ${n.precision} samplerCubeShadow;
3879	precision ${n.precision} sampler2DArrayShadow;
3880	precision ${n.precision} isampler2D;
3881	precision ${n.precision} isampler3D;
3882	precision ${n.precision} isamplerCube;
3883	precision ${n.precision} isampler2DArray;
3884	precision ${n.precision} usampler2D;
3885	precision ${n.precision} usampler3D;
3886	precision ${n.precision} usamplerCube;
3887	precision ${n.precision} usampler2DArray;
3888	`;return n.precision==="highp"?e+=`
3889#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
3890#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
3891#define LOW_PRECISION`),e}function s9(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===G_?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===W_?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===ys&&(e="SHADOWMAP_TYPE_VSM"),e}function o9(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Ls:case ea:e="ENVMAP_TYPE_CUBE";break;case iu:e="ENVMAP_TYPE_CUBE_UV";break}return e}function a9(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case ea:e="ENVMAP_MODE_REFRACTION";break}return e}function l9(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case dd:e="ENVMAP_BLENDING_MULTIPLY";break;case e3:e="ENVMAP_BLENDING_MIX";break;case t3:e="ENVMAP_BLENDING_ADD";break}return e}function c9(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:i,maxMip:t}}function u9(n,e,t,i){const r=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=s9(t),c=o9(t),u=a9(t),h=l9(t),d=c9(t),f=ZH(t),p=JH(s),v=r.createProgram();let m,g,y=t.glslVersion?"#version "+t.glslVersion+`
3892`:"";t.isRawShaderMaterial?(m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(eh).join(`
3893`),m.length>0&&(m+=`
3894`),g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(eh).join(`
3895`),g.length>0&&(g+=`
3896`)):(m=[TM(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionCl
vendor: 6,474 bytes, lines 3896-3898
3896ipCullDistance?"#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.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",`
3897`].filter(eh).join(`
3898`),g=[TM(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.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
3898IDESCENCE":"",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||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",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!==As?"#define TONE_MAPPING":"",t.toneMapping!==As?It.tonemapping_pars_fragment:"",t.toneMapping!==As?YH("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",It.colorspace_pars_fragment,XH("linearToOutputTexel",t.outputColorSpace),KH(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3899`].filter(eh).join(`
3900`)),o=py(o),o=wM(o,t),o=SM(o,t),a=py(a),a=wM(a,t),a=SM(a,t),o=MM(o),a=MM(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es
3901`,m=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3902`)+`
3903`+m,g=["#define varying in",t.glslVersion===ry?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===ry?"":"#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(`
3904`)+`
3905`+g);const x=y+m+o,_=y+g+a,T=yM(r,r.VERTEX_SHADER,x),S=yM(r,r.FRAGMENT_SHADER,_);r.attachShader(v,T),r.attachShader(v,S),t.index0AttributeName!==void 0?r.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(v,0,"position"),r.linkProgram(v);function E(A){if(n.debug.checkShaderErrors){const P=r.getProgramInfoLog(v)||"",H=r.getShaderInfoLog(T)||"",B=r.getShaderInfoLog(S)||"",G=P.trim(),O=H.trim(),$=B.trim();let F=!0,J=!0;if(r.getProgramParameter(v,r.LINK_STATUS)===!1)if(F=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,v,T,S);else{const se=bM(r,T,"vertex"),be=bM(r,S,"fragment");St("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(v,r.VALIDATE_STATUS)+`
3906
3907Material Name: `+A.name+`
3908Material Type: `+A.type+`
3909
3910Program Info Log: `+G+`
3911`+se+`
3912`+be)}else G!==""?je("WebGLProgram: Program Info Log:",G):(O===""||$==="")&&(J=!1);J&&(A.diagnostics={runnable:F,programLog:G,vertexShader:{log:O,prefix:m},fragmentShader:{log:$,prefix:g}})}r.deleteShader(T),r.deleteShader(S),M=new Cp(r,v),b=QH(r,v)}let M;this.getUniforms=function(){return M===void 0&&E(this),M};let b;this.getAttributes=function(){return b===void 0&&E(this),b};let w=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(v,WH)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=$H++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=T,this.fragmentShader=S,this}let h9=0;class d9{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.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 i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new f9(e),t.set(e,i)),i}}class f9{constructor(e){this.id=h9++,this.code=e,this.usedTimes=0}}function p9(n,e,t,i,r,s,o){const a=new md,l=new d9,c=new Set,u=[],h=r.logarithmicDepthBuffer,d=r.vertexTextures;let f=r.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(b){return c.add(b),b===0?"uv":`uv${b}`}function m(b,w,A,P,H){const B=P.fog,G=H.geometry,O=b.isMeshStandardMaterial?P.environment:null,$=(b.isMeshStandardMaterial?t:e).get(b.envMap||O),F=$&&$.mapping===iu?$.image.height:null,J=p[b.type];b.precision!==null&&(f=r.getMaxPrecision(b.precision),f!==b.precision&&je("WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const se=G.morphAttributes.position||G.morphAttributes.normal||G.morphAttributes.color,be=se!==void 0?se.length:0;let Fe=0;G.morphAttributes.position!==void 0&&(Fe=1),G.morphAttributes.normal!==void 0&&(Fe=2),G.morphAttributes.color!==void 0&&(Fe=3);let Le,Ge,ze,he;if(J){const Ht=Kr[J];Le=Ht.vertexShader,Ge=Ht.fragmentShader}else Le=b.vertexShader,Ge=b.fragmentShader,l.update(b),ze=l.getVertexShaderID(b),he=l.getFragmentShaderID(b);const fe=n.getRenderTarget(),ue=n.state.buffers.depth.getReversed(),I=H.isInstancedMesh===!0,V=H.isBatchedMesh===!0,q=!!b.map,ye=!!b.matcap,N=!!$,D=!!b.aoMap,R=!!b.lightMap,X=!!b.bumpMap,Z=!!b.normalMap,K=!!b.displacementMap,Q=!!b.emissiveMap,ae=!!b.metalnessMap,ee=!!b.roughnessMap,te=b.anisotropy>0,k=b.clearcoat>0,C=b.dispersion>0,Y=b.iridescence>0,ne=b.sheen>0,me=b.transmission>0,le=te&&!!b.anisotropyMap,De=k&&!!b.clearcoatMap,Ne=k&&!!b.clearcoatNormalMap,Ye=k&&!!b.clearcoatRoughnessMap,Xe=Y&&!!b.iridescenceMap,Se=Y&&!!b.iridescenceThicknessMap,ke=ne&&!!b.sheenColorMap,ut=ne&&!!b.sheenRoughnessMap,j=!!b.specularMap,ce=!!b.specularColorMap,Ce=!!b.specularIntensityMap,W=me&&!!b.transmissionMap,Ue=me&&!!b.thicknessMap,Oe=!!b.gradientMap,Ve=!!b.alphaMap,Pe=b.alphaTest>0,we=!!b.alphaHash,Ke=!!b.extensions;let vt=As;b.toneMapped&&(fe===null||fe.isXRRenderTarget===!0)&&(vt=n.toneMapping);const Qt={shaderID:J,shaderType:b.type,shaderName:b.name,vertexShader:Le,fragmentShader:Ge,defines:b.defines,customVertexShaderID:ze,customFragmentShaderID:he,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:V,batchingColor:V&&H._colorsTexture!==null,instancing:I,instancingColor:I&&H.instanceColor!==null,instancingMorph:I&&H.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:fe===null?n.outputColorSpace:fe.isXRRenderTarget===!0?fe.texture.colorSpace:_o,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:ye,envMap:N,envMapMode:N&&$.mapping,envMapCubeUVHeight:F,aoMap:D,lightMap:R,bumpMap:X,normalMap:Z,displacementMap:d&&K,emissiveMap:Q,normalMapObjectSpace:Z&&b.normalMapType===f3,normalMapTangentSpace:Z&&b.normalMapType===ha,metalnessMap:ae,roughnessMap:ee,anisotropy:te,anisotropyMap:le,clearcoat:k,clearcoatMap:De,clearcoatNormalMap:Ne,clearcoatRoughnessMap:Ye,dispersion:C,iridescence:Y,iridescenceMap:Xe,iridescenceThicknessMap:Se,sheen:ne,sheenColorMap:ke,sheenRoughnessMap:ut,specularMap:j,specularColorMap:ce,specularIntensityMap:Ce,transmission:me,transmissionMap:W,thicknessMap:Ue,gradientMap:Oe,opaque:b.transparent===!1&&b.blending===il&&b.alphaToCoverage===!1,alphaMap:Ve,alphaTest:Pe,alphaHash:we,combine:b.combine,mapUv:q&&v(b.map.channel),aoMapUv:D&&v(b.aoMap.channel),lightMapUv:
vendor: 4,537 bytes, line 3912
3912R&&v(b.lightMap.channel),bumpMapUv:X&&v(b.bumpMap.channel),normalMapUv:Z&&v(b.normalMap.channel),displacementMapUv:K&&v(b.displacementMap.channel),emissiveMapUv:Q&&v(b.emissiveMap.channel),metalnessMapUv:ae&&v(b.metalnessMap.channel),roughnessMapUv:ee&&v(b.roughnessMap.channel),anisotropyMapUv:le&&v(b.anisotropyMap.channel),clearcoatMapUv:De&&v(b.clearcoatMap.channel),clearcoatNormalMapUv:Ne&&v(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ye&&v(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Xe&&v(b.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&v(b.iridescenceThicknessMap.channel),sheenColorMapUv:ke&&v(b.sheenColorMap.channel),sheenRoughnessMapUv:ut&&v(b.sheenRoughnessMap.channel),specularMapUv:j&&v(b.specularMap.channel),specularColorMapUv:ce&&v(b.specularColorMap.channel),specularIntensityMapUv:Ce&&v(b.specularIntensityMap.channel),transmissionMapUv:W&&v(b.transmissionMap.channel),thicknessMapUv:Ue&&v(b.thicknessMap.channel),alphaMapUv:Ve&&v(b.alphaMap.channel),vertexTangents:!!G.attributes.tangent&&(Z||te),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!G.attributes.color&&G.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!G.attributes.uv&&(q||Ve),fog:!!B,useFog:b.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:b.flatShading===!0&&b.wireframe===!1,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,reversedDepthBuffer:ue,skinning:H.isSkinnedMesh===!0,morphTargets:G.morphAttributes.position!==void 0,morphNormals:G.morphAttributes.normal!==void 0,morphColors:G.morphAttributes.color!==void 0,morphTargetsCount:be,morphTextureStride:Fe,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&A.length>0,shadowMapType:n.shadowMap.type,toneMapping:vt,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&Gt.getTransfer(b.map.colorSpace)===rn,decodeVideoTextureEmissive:Q&&b.emissiveMap.isVideoTexture===!0&&Gt.getTransfer(b.emissiveMap.colorSpace)===rn,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Et,flipSided:b.side===Xn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Ke&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ke&&b.extensions.multiDraw===!0||V)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Qt.vertexUv1s=c.has(1),Qt.vertexUv2s=c.has(2),Qt.vertexUv3s=c.has(3),c.clear(),Qt}function g(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const A in b.defines)w.push(A),w.push(b.defines[A]);return b.isRawShaderMaterial===!1&&(y(w,b),x(w,b),w.push(n.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function y(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.pu
vendor: 8,930 bytes, line 3912
3912sh(w.numClipIntersection),b.push(w.depthPacking)}function x(b,w){a.disableAll(),w.supportsVertexTextures&&a.enable(0),w.instancing&&a.enable(1),w.instancingColor&&a.enable(2),w.instancingMorph&&a.enable(3),w.matcap&&a.enable(4),w.envMap&&a.enable(5),w.normalMapObjectSpace&&a.enable(6),w.normalMapTangentSpace&&a.enable(7),w.clearcoat&&a.enable(8),w.iridescence&&a.enable(9),w.alphaTest&&a.enable(10),w.vertexColors&&a.enable(11),w.vertexAlphas&&a.enable(12),w.vertexUv1s&&a.enable(13),w.vertexUv2s&&a.enable(14),w.vertexUv3s&&a.enable(15),w.vertexTangents&&a.enable(16),w.anisotropy&&a.enable(17),w.alphaHash&&a.enable(18),w.batching&&a.enable(19),w.dispersion&&a.enable(20),w.batchingColor&&a.enable(21),w.gradientMap&&a.enable(22),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.reversedDepthBuffer&&a.enable(4),w.skinning&&a.enable(5),w.morphTargets&&a.enable(6),w.morphNormals&&a.enable(7),w.morphColors&&a.enable(8),w.premultipliedAlpha&&a.enable(9),w.shadowMapEnabled&&a.enable(10),w.doubleSided&&a.enable(11),w.flipSided&&a.enable(12),w.useDepthPacking&&a.enable(13),w.dithering&&a.enable(14),w.transmission&&a.enable(15),w.sheen&&a.enable(16),w.opaque&&a.enable(17),w.pointsUvs&&a.enable(18),w.decodeVideoTexture&&a.enable(19),w.decodeVideoTextureEmissive&&a.enable(20),w.alphaToCoverage&&a.enable(21),b.push(a.mask)}function _(b){const w=p[b.type];let A;if(w){const P=Kr[w];A=Og.clone(P.uniforms)}else A=b.uniforms;return A}function T(b,w){let A;for(let P=0,H=u.length;P<H;P++){const B=u[P];if(B.cacheKey===w){A=B,++A.usedTimes;break}}return A===void 0&&(A=new u9(n,w,b,s),u.push(A)),A}function S(b){if(--b.usedTimes===0){const w=u.indexOf(b);u[w]=u[u.length-1],u.pop(),b.destroy()}}function E(b){l.remove(b)}function M(){l.dispose()}return{getParameters:m,getProgramCacheKey:g,getUniforms:_,acquireProgram:T,releaseProgram:S,releaseShaderCache:E,programs:u,dispose:M}}function m9(){let n=new WeakMap;function e(o){return n.has(o)}function t(o){let a=n.get(o);return a===void 0&&(a={},n.set(o,a)),a}function i(o){n.delete(o)}function r(o,a,l){n.get(o)[a]=l}function s(){n=new WeakMap}return{has:e,get:t,remove:i,update:r,dispose:s}}function g9(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function EM(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function AM(){const n=[];let e=0;const t=[],i=[],r=[];function s(){e=0,t.length=0,i.length=0,r.length=0}function o(h,d,f,p,v,m){let g=n[e];return g===void 0?(g={id:h.id,object:h,geometry:d,material:f,groupOrder:p,renderOrder:h.renderOrder,z:v,group:m},n[e]=g):(g.id=h.id,g.object=h,g.geometry=d,g.material=f,g.groupOrder=p,g.renderOrder=h.renderOrder,g.z=v,g.group=m),e++,g}function a(h,d,f,p,v,m){const g=o(h,d,f,p,v,m);f.transmission>0?i.push(g):f.transparent===!0?r.push(g):t.push(g)}function l(h,d,f,p,v,m){const g=o(h,d,f,p,v,m);f.transmission>0?i.unshift(g):f.transparent===!0?r.unshift(g):t.unshift(g)}function c(h,d){t.length>1&&t.sort(h||g9),i.length>1&&i.sort(d||EM),r.length>1&&r.sort(d||EM)}function u(){for(let h=e,d=n.length;h<d;h++){const f=n[h];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:i,transparent:r,init:s,push:a,unshift:l,finish:u,sort:c}}function v9(){let n=new WeakMap;function e(i,r){const s=n.get(i);let o;return s===void 0?(o=new AM,n.set(i,[o])):r>=s.length?(o=new AM,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function x9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new z,color:new We};break;case"SpotLight":t={position:new z,direction:new z,color:new We,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new z,color:new We,distance:0,decay:0};break;case"HemisphereLight":t={direction:new z,skyColor:new We,groundColor:new We};break;case"RectAreaLight":t={color:new We,position:new z,halfWidth:new z,halfHeight:new z};break}return n[e.id]=t,t}}}function y9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let _9=0;function b9(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function w9(n){const e=new x9,t=y9(),i={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++)i.probe.push(new z);const r=new z,s=new ht,o=new ht;function a(c){let u=0,h=0,d=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let f=0,p=0,v=0,m=0,g=0,y=0,x=0,_=0,T=0,S=0,E=0;c.sort(b9);for(let b=0,w=c.length;b<w;b++){const A=c[b],P=A.color,H=A.intensity,B=A.distance,G=A.shadow&&A.shadow.map?A.shadow.map.texture:null;if(A.isAmbientLight)u+=P.r*H,h+=P.g*H,d+=P.b*H;else if(A.isLightProbe){for(let O=0;O<9;O++)i.probe[O].addScaledVector(A.sh.coefficients[O],H);E++}else if(A.isDirectionalLight){const O=e.get(A);if(O.color.copy(A.color).multiplyScalar(A.intensity),A.castShadow){const $=A.shadow,F=t.get(A);F.shadowIntensity=$.intensity,F.shadowBias=$.bias,F.shadowNormalBias=$.normalBias,F.shadowRadius=$.radius,F.shadowMapSize=$.mapSize,i.directionalShadow[f]=F,i.directionalShadowMap[f]=G,i.directionalShadowMatrix[f]=A.shadow.matrix,y++}i.directional[f]=O,f++}else if(A.isSpotLight){const O=e.get(A);O.position.setFromMatrixPosition(A.matrixWorld),O.color.copy(P).multiplyScalar(H),O.distance=B,O.coneCos=Math.cos(A.angle),O.penumbraCos=Math.cos(A.angle*(1-A.penumbra)),O.decay=A.decay,i.spot[v]=O;const $=A.shadow;if(A.map&&(i.spotLightMap[T]=A.map,T++,$.updateMatrices(A),A.castShadow&&S++),i.spotLightMatrix[v]=$.matrix,A.castShadow){const F=t.get(A);F.shadowIntensity=$.intensity,F.shadowBias=$.bias,F.shadowNormalBias=$.normalBias,F.shadowRadius=$.radius,F.shadowMapSize=$.mapSize,i.spotShadow[v]=F,i.spotShadowMap[v]=G,_++}v++}else if(A.isRectAreaLight){const O=e.get(A);O.color.copy(P).multiplyScalar(H),O.halfWidth.set(A.width*.5,0,0),O.halfHeight.set(0,A.height*.5,0),i.rectArea[m]=O,m++}else if(A.isPointLight){const O=e.get(A);if(O.color.copy(A.color).multiplyScalar(A.intensity),O.distance=A.distance,O.decay=A.decay,A.castShadow){const $=A.shadow,F=t.get(A);F.shadowIntensity=$.intensity,F.shadowBias=$.bias,F.shadowNormalBias=$.normalBias,F.shadowRadius=$.radius,F.shadowMapSize=$.mapSize,F.shadowCameraNear=$.camera.near,F.shadowCameraFar=$.camera.far,i.pointShadow[p]=F,i.pointShadowMap[p]=G,i.pointShadowMatrix[p]=A.shadow.matrix,x++}i.point[p]=O,p++}else if(A.isHemisphereLight){const O=e.get(A);O.skyColor.copy(A.color).multiplyScalar(H),O.groundColor.copy(A.groundColor).multiplyScalar(H),i.hemi[g]=O,g++}}m>0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=$e.LTC_FLOAT_1,i.rectAreaLTC2=$e.LTC_FLOAT_2):(i.rectAreaLTC1=$e.LTC_HALF_1,i.rectAreaLTC2=$e.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const M=i.hash;(M.directionalLength!==f||M.pointLength!==p||M.spotLength!==v||M.rectAreaLength!==m||M.hemiLength!==g||M.numDirectionalShadows!==y||M.numPointShadows!==x||M.numSpotShadows!==_||M.numSpotMaps!==T||M.numLightProbes!==E)&&(i.directional.length=f,i.spot.length=v,i.rectArea.length=m,i.point.length=p,i.hemi.length=g,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=_+T-S,i.spotLightMap.length=T,i.numSpotLightShadowsWithMaps=S,i.numLightProbes=E,M.directionalLength=f,M.pointLength=p,M.spotLength=v,M.rectAreaLength=m,M.hemiLength=g,M.numDirectionalShadows=y,M.numPointShadows=x,M.numSpotShadows=_,M.numSpotMaps=T,M.numLightProbes=E,i.version=_9++)}function l(c,u){let h=0,d=0,f=0,p=0,v=0;const m=u.matrixWorldInverse;for(let g=0,y=c.length;g<y;g++){const x=c[g];
vendor: 32,876 bytes, lines 3912-3940
3912if(x.isDirectionalLight){const _=i.directional[h];_.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(m),h++}else if(x.isSpotLight){const _=i.spot[f];_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(m),_.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(m),f++}else if(x.isRectAreaLight){const _=i.rectArea[p];_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),_.halfWidth.set(x.width*.5,0,0),_.halfHeight.set(0,x.height*.5,0),_.halfWidth.applyMatrix4(o),_.halfHeight.applyMatrix4(o),p++}else if(x.isPointLight){const _=i.point[d];_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(m),d++}else if(x.isHemisphereLight){const _=i.hemi[v];_.direction.setFromMatrixPosition(x.matrixWorld),_.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:i}}function CM(n){const e=new w9(n),t=[],i=[];function r(u){c.camera=u,t.length=0,i.length=0}function s(u){t.push(u)}function o(u){i.push(u)}function a(){e.setup(t)}function l(u){e.setupView(t,u)}const c={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function S9(n){let e=new WeakMap;function t(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new CM(n),e.set(r,[a])):s>=o.length?(a=new CM(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const M9=`void main() {
3913	gl_Position = vec4( position, 1.0 );
3914}`,T9=`uniform sampler2D shadow_pass;
3915uniform vec2 resolution;
3916uniform float radius;
3917#include <packing>
3918void main() {
3919	const float samples = float( VSM_SAMPLES );
3920	float mean = 0.0;
3921	float squared_mean = 0.0;
3922	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
3923	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
3924	for ( float i = 0.0; i < samples; i ++ ) {
3925		float uvOffset = uvStart + i * uvStride;
3926		#ifdef HORIZONTAL_PASS
3927			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
3928			mean += distribution.x;
3929			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
3930		#else
3931			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
3932			mean += depth;
3933			squared_mean += depth * depth;
3934		#endif
3935	}
3936	mean = mean / samples;
3937	squared_mean = squared_mean / samples;
3938	float std_dev = sqrt( squared_mean - mean * mean );
3939	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3940}`;function E9(n,e,t){let i=new ru;const r=new de,s=new de,o=new Ft,a=new xb({depthPacking:d3}),l=new yb,c={},u=t.maxTextureSize,h={[Ns]:Xn,[Xn]:Ns,[Et]:Et},d=new pn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:M9,fragmentShader:T9}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const p=new At;p.setAttribute("position",new Jt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new an(p,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=G_;let g=this.type;this.render=function(S,E,M){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;const b=n.getRenderTarget(),w=n.getActiveCubeFace(),A=n.getActiveMipmapLevel(),P=n.state;P.setBlending(Hn),P.buffers.depth.getReversed()===!0?P.buffers.color.setClear(0,0,0,0):P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const H=g!==ys&&this.type===ys,B=g===ys&&this.type!==ys;for(let G=0,O=S.length;G<O;G++){const $=S[G],F=$.shadow;if(F===void 0){je("WebGLShadowMap:",$,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;r.copy(F.mapSize);const J=F.getFrameExtents();if(r.multiply(J),s.copy(F.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/J.x),r.x=s.x*J.x,F.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/J.y),r.y=s.y*J.y,F.mapSize.y=s.y)),F.map===null||H===!0||B===!0){const be=this.type!==ys?{minFilter:on,magFilter:on}:{};F.map!==null&&F.map.dispose(),F.map=new En(r.x,r.y,be),F.map.texture.name=$.name+".shadowMap",F.camera.updateProjectionMatrix()}n.setRenderTarget(F.map),n.clear();const se=F.getViewportCount();for(let be=0;be<se;be++){const Fe=F.getViewport(be);o.set(s.x*Fe.x,s.y*Fe.y,s.x*Fe.z,s.y*Fe.w),P.viewport(o),F.updateMatrices($,be),i=F.getFrustum(),_(E,M,F.camera,$,this.type)}F.isPointLightShadow!==!0&&this.type===ys&&y(F,M),F.needsUpdate=!1}g=this.type,m.needsUpdate=!1,n.setRenderTarget(b,w,A)};function y(S,E){const M=e.update(v);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 En(r.x,r.y)),d.uniforms.shadow_pass.value=S.map.texture,d.uniforms.resolution.value=S.mapSize,d.uniforms.radius.value=S.radius,n.setRenderTarget(S.mapPass),n.clear(),n.renderBufferDirect(E,null,M,d,v,null),f.uniforms.shadow_pass.value=S.mapPass.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,n.setRenderTarget(S.map),n.clear(),n.renderBufferDirect(E,null,M,f,v,null)}function x(S,E,M,b){let w=null;const A=M.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(A!==void 0)w=A;else if(w=M.isPointLight===!0?l:a,n.localClippingEnabled&&E.clipShadows===!0&&Array.isArray(E.clippingPlanes)&&E.clippingPlanes.length!==0||E.displacementMap&&E.displacementScale!==0||E.alphaMap&&E.alphaTest>0||E.map&&E.alphaTest>0||E.alphaToCoverage===!0){const P=w.uuid,H=E.uuid;let B=c[P];B===void 0&&(B={},c[P]=B);let G=B[H];G===void 0&&(G=w.clone(),B[H]=G,E.addEventListener("dispose",T)),w=G}if(w.visible=E.visible,w.wireframe=E.wireframe,b===ys?w.side=E.shadowSide!==null?E.shadowSide:E.side:w.side=E.shadowSide!==null?E.shadowSide:h[E.side],w.alphaMap=E.alphaMap,w.alphaTest=E.alphaToCoverage===!0?.5:E.alphaTest,w.map=E.map,w.clipShadows=E.clipShadows,w.clippingPlanes=E.clippingPlanes,w.clipIntersection=E.clipIntersection,w.displacementMap=E.displacementMap,w.displacementScale=E.displacementScale,w.displacementBias=E.displacementBias,w.wireframeLinewidth=E.wireframeLinewidth,w.linewidth=E.linewidth,M.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const P=n.properties.get(w);P.light=M}return w}function _(S,E,M,b,w){if(S.visible===!1)return;if(S.layers.test(E.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&w===ys)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,S.matrixWorld);const H=e.update(S),B=S.material;if(Array.isArray(B)){const G=H.groups;for(let O=0,$=G.length;O<$;O++){const F=G[O],J=B[F.materialIndex];if(J&&J.visible){const se=x(S,J,b,w);S.onBeforeShadow(n,S,E,M,H,se,F),n.renderBufferDirect(M,null,H,se,S,F),S.onAfterShadow(n,S,E,M,H,se,F)}}}else if(B.visible){const G=x(S,B,b,w);S.onBeforeShadow(n,S,E,M,H,G,null),n.renderBufferDirect(M,null,H,G,S,null),S.onAfterShadow(n,S,E,M,H,G,null)}}const P=S.children;for(let H=0,B=P.length;H<B;H++)_(P[H],E,M,b,w)}function T(S){S.target.removeEventListener("dispose",T);for(const M in c){const b=c[M],w=S.target.uuid;w in b&&(b[w].dispose(),delete b[w])}}}const A9={[em]:Ih,[tm]:rm,[nm]:sm,[pl]:im,[Ih]:em,[rm]:tm,[sm]:nm,[im]:pl};function C9(n,e){function t(){let W=!1;const Ue=new Ft;let Oe=null;const Ve=new Ft(0,0,0,0);return{setMask:function(Pe){Oe!==Pe&&!W&&(n.colorMask(Pe,Pe,Pe,Pe),Oe=Pe)},setLocked:function(Pe){W=Pe},setClear:function(Pe,we,Ke,vt,Qt){Qt===!0&&(Pe*=vt,we*=vt,Ke*=vt),Ue.set(Pe,we,Ke,vt),Ve.equals(Ue)===!1&&(n.clearColor(Pe,we,Ke,vt),Ve.copy(Ue))},reset:function(){W=!1,Oe=null,Ve.set(-1,0,0,0)}}}function i(){let W=!1,Ue=!1,Oe=null,Ve=null,Pe=null;return{setReversed:function(we){if(Ue!==we){const Ke=e.get("EXT_clip_control");we?Ke.clipControlEXT(Ke.LOWER_LEFT_EXT,Ke.ZERO_TO_ONE_EXT):Ke.clipControlEXT(Ke.LOWER_LEFT_EXT,Ke.NEGATIVE_ONE_TO_ONE_EXT),Ue=we;const vt=Pe;Pe=null,this.setClear(vt)}},getReversed:function(){return Ue},setTest:function(we){we?fe(n.DEPTH_TEST):ue(n.DEPTH_TEST)},setMask:function(we){Oe!==we&&!W&&(n.depthMask(we),Oe=we)},setFunc:function(we){if(Ue&&(we=A9[we]),Ve!==we){switch(we){case em:n.depthFunc(n.NEVER);break;case Ih:n.depthFunc(n.ALWAYS);break;case tm:n.depthFunc(n.LESS);break;case pl:n.depthFunc(n.LEQUAL);break;case nm:n.depthFunc(n.EQUAL);break;case im:n.depthFunc(n.GEQUAL);break;case rm:n.depthFunc(n.GREATER);break;case sm:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ve=we}},setLocked:function(we){W=we},setClear:function(we){Pe!==we&&(Ue&&(we=1-we),n.clearDepth(we),Pe=we)},reset:function(){W=!1,Oe=null,Ve=null,Pe=null,Ue=!1}}}function r(){let W=!1,Ue=null,Oe=null,Ve=null,Pe=null,we=null,Ke=null,vt=null,Qt=null;return{setTest:function(Ht){W||(Ht?fe(n.STENCIL_TEST):ue(n.STENCIL_TEST))},setMask:function(Ht){Ue!==Ht&&!W&&(n.stencilMask(Ht),Ue=Ht)},setFunc:function(Ht,Pi,Vr){(Oe!==Ht||Ve!==Pi||Pe!==Vr)&&(n.stencilFunc(Ht,Pi,Vr),Oe=Ht,Ve=Pi,Pe=Vr)},setOp:function(Ht,Pi,Vr){(we!==Ht||Ke!==Pi||vt!==Vr)&&(n.stencilOp(Ht,Pi,Vr),we=Ht,Ke=Pi,vt=Vr)},setLocked:function(Ht){W=Ht},setClear:function(Ht){Qt!==Ht&&(n.clearStencil(Ht),Qt=Ht)},reset:function(){W=!1,Ue=null,Oe=null,Ve=null,Pe=null,we=null,Ke=null,vt=null,Qt=null}}}const s=new t,o=new i,a=new r,l=new WeakMap,c=new WeakMap;let u={},h={},d=new WeakMap,f=[],p=null,v=!1,m=null,g=null,y=null,x=null,_=null,T=null,S=null,E=new We(0,0,0),M=0,b=!1,w=null,A=null,P=null,H=null,B=null;const G=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,$=0;const F=n.getParameter(n.VERSION);F.indexOf("WebGL")!==-1?($=parseFloat(/^WebGL (\d)/.exec(F)[1]),O=$>=1):F.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),O=$>=2);let J=null,se={};const be=n.getParameter(n.SCISSOR_BOX),Fe=n.getParameter(n.VIEWPORT),Le=new Ft().fromArray(be),Ge=new Ft().fromArray(Fe);function ze(W,Ue,Oe,Ve){const Pe=new Uint8Array(4),we=n.createTexture();n.bindTexture(W,we),n.texParameteri(W,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(W,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ke=0;Ke<Oe;Ke++)W===n.TEXTURE_3D||W===n.TEXTURE_2D_ARRAY?n.texImage3D(Ue,0,n.RGBA,1,1,Ve,0,n.RGBA,n.UNSIGNED_BYTE,Pe):n.texImage2D(Ue+Ke,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,Pe);return we}const he={};he[n.TEXTURE_2D]=ze(n.TEXTURE_2D,n.TEXTURE_2D,1),he[n.TEXTURE_CUBE_MAP]=ze(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),he[n.TEXTURE_2D_ARRAY]=ze(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),he[n.TEXTURE_3D]=ze(n.TEXTURE_3D,n.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),a.setClear(0),fe(n.DEPTH_TEST),o.setFunc(pl),X(!1),Z(Jx),fe(n.CULL_FACE),D(Hn);function fe(W){u[W]!==!0&&(n.enable(W),u[W]=!0)}function ue(W){u[W]!==!1&&(n.disable(W),u[W]=!1)}function I(W,Ue){return h[W]!==Ue?(n.bindFramebuffer(W,Ue),h[W]=Ue,W===n.DRAW_FRAMEBUFFER&&(h[n.FRAMEBUFFER]=Ue),W===n.FRAMEBUFFER&&(h[n.DRAW_FRAMEBUFFER]=Ue),!0):!1}function V(W,Ue){let Oe=f,Ve=!1;if(W){Oe=d.get(Ue),Oe===void 0&&(Oe=[],d.set(Ue,Oe));const Pe=W.textures;if(Oe.length!==Pe.length||Oe[0]!==n.COLOR_ATTACHMENT0){for(let we=0,Ke=Pe.length;we<Ke;we++)Oe[we]=n.COLOR_ATTACHMENT0+we;Oe.length=Pe.length,Ve=!0}}else Oe[0]!==n.BACK&&(Oe[0]=n.BACK,Ve=!0);Ve&&n.drawBuffers(Oe)}function q(W){return p!==W?(n.useProgram(W),p=W,!0):!1}const ye={[jo]:n.FUNC_ADD,[FC]:n.FUNC_SUBTRACT,[UC]:n.FUNC_REVERSE_SUBTRACT};ye[BC]=n.MIN,ye[zC]=n.MAX;const N={[VC]:n.ZERO,[HC]:n.ONE,[GC]:n.SRC_COLOR,[Jp]:n.SRC_ALPHA,[YC]:n.SRC_ALPHA_SATURATE,[qC]:n.DST_COLOR,[$C]:n.DST_ALPHA,[WC]:n.ONE_MINUS_SRC_COLOR,[Qp]:n.ONE_MINUS_SRC_ALPHA,[XC]:n.ONE_MINUS_DST_COLOR,[jC]:n.ONE_MINUS_DST_ALPHA,[KC]:n.CONSTANT_COLOR,[ZC]:n.ONE_MINUS_CONSTANT_COLOR,[JC]:n.CONSTANT_ALPHA,[QC]:n.ONE_MINUS_CONSTANT_ALPHA};function D(W,Ue,Oe,Ve,Pe,we,Ke,vt,Qt,Ht){if(W===Hn){v===!0&&(ue(n.BLEND),v=!1);return}if(v===!1&&(fe(n.BLEND),v=!0),W!==kC){if(W!==m||Ht!==b){if((g!==jo||_!==jo)&&(n.blendEquation(n.FUNC_ADD),g=jo,_=jo),Ht)switch(W){case il:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Qx:n.blendFunc(n.ONE,n.ONE);break;case ey:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case ty:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:St("WebGLState: Invalid blending: ",W);break}else switch(W){case il:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Qx:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case ey:St("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case ty:St("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:St("WebGLState: Invalid blending: ",W);break}y=null,x=null,T=null,S=null,E.set(0,0,0),M=0,m=W,b=Ht}return}Pe=Pe||Ue,we=we||Oe,Ke=Ke||Ve,(Ue!==g||Pe!==_)&&(n.blendEquationSeparate(ye[Ue],ye[Pe]),g=Ue,_=Pe),(Oe!==y||Ve!==x||we!==T||Ke!==S)&&(n.blendFuncSeparate(N[Oe],N[Ve],N[we],N[Ke]),y=Oe,x=Ve,T=we,S=Ke),(vt.equals(E)===!1||Qt!==M)&&(n.blendColor(vt.r,vt.g,vt.b,Qt),E.copy(vt),M=Qt),m=W,b=!1}function R(W,Ue){W.side===Et?ue(n.CULL_FACE):fe(n.CULL_FACE);let Oe=W.side===Xn;Ue&&(Oe=!Oe),X(Oe),W.blending===il&&W.transparent===!1?D(Hn):D(W.blending,W.blendEquation,W.blendSrc,W.blendDst,W.blendEquationAlpha,W.blendSrcAlpha,W.blendDstAlpha,W.blendColor,W.blendAlpha,W.premultipliedAlpha),o.setFunc(W.depthFunc),o.setTest(W.depthTest),o.setMask(W.depthWrite),s.setMask(W.colorWrite);const Ve=W.stencilWrite;a.setTest(Ve),Ve&&(a.setMask(W.stencilWriteMask),a.setFunc(W.stencilFunc,W.stencilRef,W.stencilFuncMask),a.setOp(W.stencilFail,W.stencilZFail,W.stencilZPass)),Q(W.polygonOffset,W.polygonOffsetFactor,W.polygonOffsetUnits),W.alphaToCoverage===!0?fe(n.SAMPLE_ALPHA_TO_COVERAGE):ue(n.SAMPLE_ALPHA_TO_COVERAGE)}function X(W){w!==W&&(W?n.frontFace(n.CW):n.frontFace(n.CCW),w=W)}function Z(W){W!==OC?(fe(n.CULL_FACE),W!==A&&(W===Jx?n.cullFace(n.BACK):W===DC?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):ue(n.CULL_FACE),A=W}function K(W){W!==P&&(O&&n.lineWidth(W),P=W)}function Q(W,Ue,Oe){W?(fe(n.POLYGON_OFFSET_FILL),(H!==Ue||B!==Oe)&&(n.polygonOffset(Ue,Oe),H=Ue,B=Oe)):ue(n.POLYGON_OFFSET_FILL)}function ae(W){W?fe(n.SCISSOR_TEST):ue(n.SCISSOR_TEST)}function ee(W){W===void 0&&(W=n.TEXTURE0+G-1),J!==W&&(n.activeTexture(W),J=W)}function te(W,Ue,Oe){Oe===void 0&&(J===null?Oe=n.TEXTURE0+G-1:Oe=J);let Ve=se[Oe];Ve===void 0&&(Ve={type:void 0,texture:void 0},se[Oe]=Ve),(Ve.type!==W||Ve.texture!==Ue)&&(J!==Oe&&(n.activeTexture(Oe),J=Oe),n.bindTexture(W,Ue||he[W]),Ve.type=W,Ve.texture=Ue)}function k(){const W=se[J];W!==void 0&&W.type!==void 0&&(n.bindTexture(W.type,null),W.type=void 0,W.texture=void 0)}function C(){try{n.compressedTexImage2D(...arguments)}catch(W){W("WebGLState:",W)}}function Y(){try{n.compressedTexImage3D(...arguments)}catch(W){W("WebGLState:",W)}}function ne(){try{n.texSubImage2D(...arguments)}catch(W){W("WebGLState:",W)}}function me(){try{n.texSubImage3D(...arguments)}catch(W){W("WebGLState:",W)}}function le(){try{n.compressedTexSubImage2D(...arguments)}catch(W){W("WebGLState:",W)}}function De(){try{n.compressedTexSubImage3D(...arguments)}catch(W){W("WebGLState:",W)}}function Ne(){try{n.texStorage2D(...arguments)}catch(W){W("WebGLState:",W)}}function Ye(){try{n.texStorage3D(...arguments)}catch(W){W("WebGLState:",W)}}function Xe(){try{n.texImage2D(...arguments)}catch(W){W("WebGLState:",W)}}function Se(){try{n.texImage3D(...arguments)}catch(W){W("WebGLState:",W)}}function ke(W){Le.equals(W)===!1&&(n.scissor(W.x,W.y,W.z,W.w),Le.copy(W))}function ut(W){Ge.equals(W)===!1&&(n.viewport(W.x,W.y,W.z,W.w),Ge.copy(W))}function j(W,Ue){let Oe=c.get(Ue);Oe===void 0&&(Oe=new WeakMap,c.set(Ue,Oe));let Ve=Oe.get(W);Ve===void 0&&(Ve=n.getUniformBlockIndex(Ue,W.name),Oe.set(W,Ve))}function ce(W,Ue){const Ve=c.get(Ue).get(W);l.get(Ue)!==Ve&&(n.uniformBlockBinding(Ue,Ve,W.__bindingPointIndex),l.set(Ue,Ve))}function Ce(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),o.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),u={},J=null,se={},h={},d=new WeakMap,f=[],p=null,v=!1,m=null,g=null,y=null,x=null,_=null,T=null,S=null,E=new We(0,0,0),M=0,b=!1,w=null,A=null,P=null,H=null,B=null,Le.set(0,0,n.canvas.width,n.canvas.height),Ge.set(0,0,n.canvas.width,n.canvas.height),s.reset(),o.reset(),a.reset()}return{buffers:{color:s,depth:o,stencil:a},enable:fe,disable:ue,bindFramebuffer:I,drawBuffers:V,useProgram:q,setBlending:D,setMaterial:R,setFlipSided:X,setCullFace:Z,setLineWidth:K,setPolygonOffset:Q,setScissorTest:ae,activeTexture:ee,bindTexture:te,unbindTexture:k,compressedTexImage2D:C,compressedTexImage3D:Y,texImage2D:Xe,texImage3D:Se,updateUBOMapping:j,uniformBlockBinding:ce,texStorage2D:Ne,texStorage3D:Ye,texSubImage2D:ne,texSubImage3D:me,compressedTexSubImage2D:le,compressedTexSubImage3D:De,scissor:ke,viewport:ut,reset:Ce}}function R9(n,e,t,i,r,s,o){const a=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 de,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(k,C){return f?new OffscreenCanvas(k,C):Uh("canvas")}function v(k,C,Y){let ne=1;const me=te(k);if((me.width>Y||me.height>Y)&&(ne=Y/Math.max(me.width,me.height)),ne<1)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap||typeof VideoFrame<"u"&&k instanceof VideoFrame){const le=Math.floor(ne*me.width),De=Math.floor(ne*me.height);h===void 0&&(h=p(le,De));const Ne=C?p(le,De):h;return Ne.width=le,Ne.height=De,Ne.getContext("2d").drawImage(k,0,0,le,De),je("WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+le+"x"+De+")."),Ne}else return"data"in k&&je("WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),k;return k}function m(k){return k.generateMipmaps}function g(k){n.generateMipmap(k)}function y(k){return k.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:k.isWebGL3DRenderTarget?n.TEXTURE_3D:k.isWebGLArrayRenderTarget||k.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function x(k,C,Y,ne,me=!1){if(k!==null){if(n[k]!==void 0)return n[k];je("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let le=C;if(C===n.RED&&(Y===n.FLOAT&&(le=n.R32F),Y===n.HALF_FLOAT&&(le=n.R16F),Y===n.UNSIGNED_BYTE&&(le=n.R8)),C===n.RED_INTEGER&&(Y===n.UNSIGNED_BYTE&&(le=n.R8UI),Y===n.UNSIGNED_SHORT&&(le=n.R16UI),Y===n.UNSIGNED_INT&&(le=n.R32UI),Y===n.BYTE&&(le=n.R8I),Y===n.SHORT&&(le=n.R16I),Y===n.INT&&(le=n.R32I)),C===n.RG&&(Y===n.FLOAT&&(le=n.RG32F),Y===n.HALF_FLOAT&&(le=n.RG16F),Y===n.UNSIGNED_BYTE&&(le=n.RG8)),C===n.RG_INTEGER&&(Y===n.UNSIGNED_BYTE&&(le=n.RG8UI),Y===n.UNSIGNED_SHORT&&(le=n.RG16UI),Y===n.UNSIGNED_INT&&(le=n.RG32UI),Y===n.BYTE&&(le=n.RG8I),Y===n.SHORT&&(le=n.RG16I),Y===n.INT&&(le=n.RG32I)),C===n.RGB_INTEGER&&(Y===n.UNSIGNED_BYTE&&(le=n.RGB8UI),Y===n.UNSIGNED_SHORT&&(le=n.RGB16UI),Y===n.UNSIGNED_INT&&(le=n.RGB32UI),Y===n.BYTE&&(le=n.RGB8I),Y===n.SHORT&&(le=n.RGB16I),Y===n.INT&&(le=n.RGB32I)),C===n.RGBA_INTEGER&&(Y===n.UNSIGNED_BYTE&&(le=n.RGBA8UI),Y===n.UNSIGNED_SHORT&&(le=n.RGBA16UI),Y===n.UNSIGNED_INT&&(le=n.RGBA32UI),Y===n.BYTE&&(le=n.RGBA8I),Y===n.SHORT&&(le=n.RGBA16I),Y===n.INT&&(le=n.RGBA32I)),C===n.RGB&&(Y===n.UNSIGNED_INT_5_9_9_9_REV&&(le=n.RGB9_E5),Y===n.UNSIGNED_INT_10F_11F_11F_REV&&(le=n.R11F_G11F_B10F)),C===n.RGBA){const De=me?kh:Gt.getTransfer(ne);Y===n.FLOAT&&(le=n.RGBA32F),Y===n.HALF_FLOAT&&(le=n.RGBA16F),Y===n.UNSIGNED_BYTE&&(le=De===rn?n.SRGB8_ALPHA8:n.RGBA8),Y===n.UNSIGNED_SHORT_4_4_4_4&&(le=n.RGBA4),Y===n.UNSIGNED_SHORT_5_5_5_1&&(le=n.RGB5_A1)}return(le===n.R16F||le===n.R32F||le===n.RG16F||le===n.RG32F||le===n.RGBA16F||le===n.RGBA32F)&&e.get("EXT_color_buffer_float"),le}function _(k,C){let Y;return k?C===null||C===Os||C===ml?Y=n.DEPTH24_STENCIL8:C===li?Y=n.DEPTH32F_STENCIL8:C===kc&&(Y=n.DEPTH24_STENCIL8,je("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Os||C===ml?Y=n.DEPTH_COMPONENT24:C===li?Y=n.DEPTH_COMPONENT32F:C===kc&&(Y=n.DEPTH_COMPONENT16),Y}function T(k,C){return m(k)===!0||k.isFramebufferTexture&&k.minFilter!==on&&k.minFilter!==dn?Math.log2(Math.max(C.width,C.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?C.mipmaps.length:1}function S(k){const C=k.target;C.removeEventListener("dispose",S),M(C),C.isVideoTexture&&u.delete(C)}function E(k){const C=k.target;C.removeEventListener("dispose",E),w(C)}function M(k){const C=i.get(k);if(C.__webglInit===void 0)return;const Y=k.source,ne=d.get(Y);if(ne){const me=ne[C.__cacheKey];me.usedTimes--,me.usedTimes===0&&b(k),Object.keys(ne).length===0&&d.delete(Y)}i.remove(k)}function b(k){const C=i.get(k);n.deleteTexture(C.__webglTexture);const Y=k.source,ne=d.get(Y);delete ne[C.__cacheKey],o.memory.textures--}function w(k){const C=i.get(k);if(k.depthTexture&&(k.depthTexture.dispose(),i.remove(k.depthTexture)),k.isWebGLCubeRenderTarget)for(let ne=0;ne<6;ne++){if(Array.isArray(C.__webglFramebuffer[ne]))for(let me=0;me<C.__webglFramebuffer[ne].length;me++)n.deleteFramebuffer(C.__webglFramebuffer[ne][me]);else n.deleteFramebuffer(C.__webglFramebuffer[ne]);C.__webglDepthbuffer&&n.deleteRenderbuffer(C.__webglDepthbuffer[ne])}else{if(Array.isArray(C.__webglFramebuffer))for(let ne=0;ne<C.__webglFramebuffer.length;ne++)n.deleteFramebuffer(C.__webglFramebuffer[ne]);else n.deleteFramebuffer(C.__webglFramebuffer);if(C.__webglDepthbuffer&&n.deleteRenderbuffer(C.__webglDepthbuffer),C.__webglMultisampledFramebuffer&&n.deleteFramebuffer(C.__webglMultisampledFramebuffer),C.__webglColorRenderbuffer)for(let ne=0;ne<C.__webglColorRenderbuffer.length;ne++)C.__webglColorRenderbuffer[ne]&&n.deleteRenderbuffer(C.__webglColorRenderbuffer[ne]);C.__webglDepthRenderbuffer&&n.deleteRenderbuffer(C.__webglDepthRenderbuffer)}const Y=k.textures;for(let ne=0,me=Y.length;ne<me;ne++){const le=i.get(Y[ne]);le.__webglTexture&&(n.deleteTexture(le.__webglTexture),o.memory.textures--),i.remove(Y[ne])}i.remove(k)}let A=0;function P(){A=0}function H(){const k=A;return k>=r.maxTextures&&je("WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+r.maxTextures),A+=1,k}function B(k){const C=[];return C.push(k.wrapS),C.push(k.wrapT),C.push(k.wrapR||0),C.push(k.magFilter),C.push(k.minFilter),C.push(k.anisotropy),C.push(k.internalFormat),C.push(k.format),C.push(k.type),C.push(k.generateMipmaps),C.push(k.premultiplyAlpha),C.push(k.flipY),C.push(k.unpackAlignment),C.push(k.colorSpace),C.join()}function G(k,C){const Y=i.get(k);if(k.isVideoTexture&&ae(k),k.isRenderTargetTexture===!1&&k.isExternalTexture!==!0&&k.version>0&&Y.__version!==k.version){const ne=k.image;if(ne===null)je("WebGLRenderer: Texture marked for update but no image data found.");else if(ne.complete===!1)je("WebGLRenderer: Texture marked for update but image is incomplete");else{he(Y,k,C);return}}else k.isExternalTexture&&(Y.__webglTexture=k.sourceTexture?k.sourceTexture:null);t.bindTexture(n.TEXTURE_2D,Y.__webglTexture,n.TEXTURE0+C)}function O(k,C){const Y=i.get(k);if(k.isRenderTargetTexture===!1&&k.version>0&&Y.__version!==k.version){he(Y,k,C);return}else k.isExternalTexture&&(Y.__webglTexture=k.sourceTexture?k.sourceTexture:null);t.bindTexture(n.TEXTURE_2D_ARRAY,Y.__webglTexture,n.TEXTURE0+C)}function $(k,C){const Y=i.get(k);if(k.isRenderTargetTexture===!1&&k.version>0&&Y.__version!==k.version){he(Y,k,C);return}t.bindTexture(n.TEXTURE_3D,Y.__webglTexture,n.TEXTURE0+C)}function F(k,C){const Y=i.get(k);if(k.version>0&&Y.__version!==k.version){fe(Y,k,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,Y.__webglTexture,n.TEXTURE0+C)}const J={[fo]:n.REPEAT,[lr]:n.CLAMP_TO_EDGE,[Lh]:n.MIRRORED_REPEAT},se={[on]:n.NEAREST,[j_]:n.NEAREST_MIPMAP_NEAREST,[gc]:n.NEAREST_MIPMAP_LINEAR,[dn]:n.LINEAR,[fh]:n.LINEAR_MIPMAP_NEAREST,[es]:n.LINEAR_MIPMAP_LINEAR},be={[p3]:n.NEVER,[_3]:n.ALWAYS,[m3]:n.LESS,[eb]:n.LEQUAL,[g3]:n.EQUAL,[y3]:n.GEQUAL,[v3]:n.GREATER,[x3]:n.NOTEQUAL};function Fe(k,C){if(C.type===li&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===dn||C.magFilter===fh||C.magFilter===gc||C.magFilter===es||C.minFilter===dn||C.minFilter===fh||C.minFilter===gc||C.minFilter===es)&&je("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(k,n.TEXTURE_WRAP_S,J[C.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,J[C.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,J[C.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,se[C.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,se[C.minFilter]),C.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,be[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===on||C.minFilter!==gc&&C.minFilter!==es||C.type===li&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");n.texParameterf(k,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function Le(k,C){let Y=!1;k.__webglInit===void 0&&(k.__webglInit=!0,C.addEventListener("dispose",S));const ne=C.source;let me=d.get(ne);me===void 0&&(me={},d.set(ne,me));const le=B(C);if(le!==k.__cacheKey){me[le]===void 0&&(me[le]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,Y=!0),me[le].usedTimes++;const De=me[k.__cacheKey];De!==void 0&&(me[k.__cacheKey].usedTimes--,De.usedTimes===0&&b(C)),k.__cacheKey=le,k.__webglTexture=me[le].texture}return Y}function Ge(k,C,Y){return Math.floor(Math.floor(k/Y)/C)}function ze(k,C,Y,ne){const le=k.updateRanges;if(le.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,C.width,C.height,Y,ne,C.data);else{le.sort((Se,ke)=>Se.start-ke.start);let De=0;for(let Se=1;Se<le.length;Se++){const ke=le[De],ut=le[Se],j=ke.start+ke.count,ce=Ge(ut.start,C.width,4),Ce=Ge(ke.start,C.width,4);ut.start<=j+1&&ce===Ce&&Ge(ut.start+ut.count-1,C.width,4)===ce?ke.count=Math.max(ke.count,ut.start+ut.count-ke.start):(++De,le[De]=ut)}le.length=De+1;const Ne=n.getParameter(n.UNPACK_ROW_LENGTH),Ye=n.getParameter(n.UNPACK_SKIP_PIXELS),Xe=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,C.width);for(let Se=0,ke=le.length;Se<ke;Se++){const ut=le[Se],j=Math.floor(ut.start/4),ce=Math.ceil(ut.count/4),Ce=j%C.width,W=Math.floor(j/C.width),Ue=ce,Oe=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ce),n.pixelStorei(n.UNPACK_SKIP_ROWS,W),t.texSubImage2D(n.TEXTURE_2D,0,Ce,W,Ue,Oe,Y,ne,C.data)}k.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,Ne),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ye),n.pixelStorei(n.UNPACK_SKIP_ROWS,Xe)}}function he(k,C,Y){let ne=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ne=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ne=n.TEXTURE_3D);const me=Le(k,C),le=C.source;t.bindTexture(ne,k.__webglTexture,n.TEXTURE0+Y);const De=i.get(le);if(le.version!==De.__version||me===!0){t.activeTexture(n.TEXTURE0+Y);const Ne=Gt.getPrimaries(Gt.workingColorSpace),Ye=C.colorSpace===Zr?null:Gt.getPrimaries(C.colorSpace),Xe=C.colorSpace===Zr||Ne===Ye?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xe);let Se=v(C.image,!1,r.maxTextureSize);Se=ee(C,Se);const ke=s.convert(C.format,C.colorSpace),ut=s.convert(C.type);let j=x(C.internalFormat,ke,ut,C.colorSpace,C.isVideoTexture);Fe(ne,C);let ce;const Ce=C.mipmaps,W=C.isVideoTexture!==!0,Ue=De.__version===void 0||me===!0,Oe=le.dataReady,Ve=T(C,Se);if(C.isDepthTexture)j=_(C.format===gl,C.type),Ue&&(W?t.texStorage2D(n.TEXTURE_2D,1,j,Se.width,Se.height):t.texImage2D(n.TEXTURE_2D,0,j,Se.width,Se.height,0,ke,ut,null));else if(C.isDataTexture)if(Ce.length>0){W&&Ue&&t.texStorage2D(n.TEXTURE_2D,Ve,j,Ce[0].width,Ce[0].height);for(let Pe=0,we=Ce.length;Pe<we;Pe++)ce=Ce[Pe],W?Oe&&t.texSubImage2D(n.TEXTURE_2D,Pe,0,0,ce.width,ce.height,ke,ut,ce.data):t.texImage2D(n.TEXTURE_2D,Pe,j,ce.width,ce.height,0,ke,ut,ce.data);C.generateMipmaps=!1}else W?(Ue&&t.texStorage2D(n.TEXTURE_2D,Ve,j,Se.width,Se.height),Oe&&ze(C,Se,ke,ut)):t.texImage2D(n.TEXTURE_2D,0,j,Se.width,Se.height,0,ke,ut,Se.data);else if(C.isCompressedTexture)if(C.isCompressedArrayTexture){W&&Ue&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ve,j,Ce[0].width,Ce[0].height,Se.depth);for(let Pe=0,we=Ce.length;Pe<we;Pe++)if(ce=Ce[Pe],C.format!==Wi)if(ke!==null)if(W){if(Oe)if(C.layerUpdates.size>0){const Ke=dy(ce.width,ce.height,C.format,C.type);for(const vt of C.layerUpdates){const Qt=ce.data.subarray(vt*Ke/ce.data.BYTES_PER_ELEMENT,(vt+1)*Ke/ce.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Pe,0,0,vt,ce.width,ce.height,1,ke,Qt)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Pe,0,0,0,ce.width,ce.height,Se.depth,ke,ce.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,Pe,j,ce.width,ce.height,Se.depth,0,ce.data,0,0);else je("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else W?Oe&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,Pe,0,0,0,ce.width,ce.height,Se.depth,ke,ut,ce.data):t.texImage3D(n.TEXTURE_2D_ARRAY,Pe,j,ce.width,ce.height,Se.depth,0,ke,ut,ce.data)}else{W&&Ue&&t.texStorage2D(n.TEXTURE_2D,Ve,j,Ce[0].width,Ce[0].height);for(let Pe=0,we=Ce.length;Pe<we;Pe++)ce=Ce[Pe],C.format!==Wi?ke!==null?W?Oe&&t.compressedTexSubImage2D(n.TEXTURE_2D,Pe,0,0,ce.width,ce.height,ke,ce.data):t.compressedTexImage2D(n.TEXTURE_2D,Pe,j,ce.width,ce.height,0,ce.data):je("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):W?Oe&&t.texSubImage2D(n.TEXTURE_2D,Pe,0,0,ce.width,ce.height,ke,ut,ce.data):t.texImage2D(n.TEXTURE_2D,Pe,j,ce.width,ce.height,0,ke,ut,ce.data)}else if(C.isDataArrayTexture)if(W){if(Ue&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ve,j,Se.width,Se.height,Se.depth),Oe)if(C.layerUpdates.size>0){const Pe=dy(Se.width,Se.height,C.format,C.type);for(const we of C.layerUpdates){const Ke=Se.data.subarray(we*Pe/Se.data.BYTES_PER_ELEMENT,(we+1)*Pe/Se.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,we,Se.width,Se.height,1,ke,ut,Ke)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Se.width,Se.height,Se.depth,ke,ut,Se.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,j,Se.width,Se.height,Se.depth,0,ke,ut,Se.data);else if(C.isData3DTexture)W?(Ue&&t.texStorage3D(n.TEXTURE_3D,Ve,j,Se.width,Se.height,Se.depth),Oe&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Se.width,Se.height,Se.depth,ke,ut,Se.data)):t.texImage3D(n.TEXTURE_3D,0,j,Se.width,Se.height,Se.depth,0,ke,ut,Se.data);else if(C.isFramebufferTexture){if(Ue)if(W)t.texStorage2D(n.TEXTURE_2D,Ve,j,Se.width,Se.height);else{let Pe=Se.width,we=Se.height;for(let Ke=0;Ke<Ve;Ke++)t.texImage2D(n.TEXTURE_2D,Ke,j,Pe,we,0,ke,ut,null),Pe>>=1,we>>=1}}else if(Ce.length>0){if(W&&Ue){const Pe=te(Ce[0]);t.texStorage2D(n.TEXTURE_2D,Ve,j,Pe.width,Pe.height)}for(let Pe=0,we=Ce.length;Pe<we;Pe++)ce=Ce[Pe],W?Oe&&t.texSubImage2D(n.TEXTURE_2D,Pe,0,0,ke,ut,ce):t.texImage2D(n.TEXTURE_2D,Pe,j,ke,ut,ce);C.generateMipmaps=!1}else if(W){if(Ue){const Pe=te(Se);t.texStorage2D(n.TEXTURE_2D,Ve,j,Pe.width,Pe.height)}Oe&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,ke,ut,Se)}else t.texImage2D(n.TEXTURE_2D,0,j,ke,ut,Se);m(C)&&g(ne),De.__version=le.version,C.onUpdate&&C.onUpdate(C)}k.__version=C.version}function fe(k,C,Y){if(C.image.length!==6)return;const ne=Le(k,C),me=C.source;t.bindTexture(n.TEXTURE_CUBE_MAP,k.__webglTexture,n.TEXTURE0+Y);const le=i.get(me);if(me.version!==le.__version||ne===!0){t.activeTexture(n.TEXTURE0+Y);
vendor: 8,571 bytes, line 3940
3940const De=Gt.getPrimaries(Gt.workingColorSpace),Ne=C.colorSpace===Zr?null:Gt.getPrimaries(C.colorSpace),Ye=C.colorSpace===Zr||De===Ne?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ye);const Xe=C.isCompressedTexture||C.image[0].isCompressedTexture,Se=C.image[0]&&C.image[0].isDataTexture,ke=[];for(let we=0;we<6;we++)!Xe&&!Se?ke[we]=v(C.image[we],!0,r.maxCubemapSize):ke[we]=Se?C.image[we].image:C.image[we],ke[we]=ee(C,ke[we]);const ut=ke[0],j=s.convert(C.format,C.colorSpace),ce=s.convert(C.type),Ce=x(C.internalFormat,j,ce,C.colorSpace),W=C.isVideoTexture!==!0,Ue=le.__version===void 0||ne===!0,Oe=me.dataReady;let Ve=T(C,ut);Fe(n.TEXTURE_CUBE_MAP,C);let Pe;if(Xe){W&&Ue&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Ve,Ce,ut.width,ut.height);for(let we=0;we<6;we++){Pe=ke[we].mipmaps;for(let Ke=0;Ke<Pe.length;Ke++){const vt=Pe[Ke];C.format!==Wi?j!==null?W?Oe&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke,0,0,vt.width,vt.height,j,vt.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke,Ce,vt.width,vt.height,0,vt.data):je("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):W?Oe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke,0,0,vt.width,vt.height,j,ce,vt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke,Ce,vt.width,vt.height,0,j,ce,vt.data)}}}else{if(Pe=C.mipmaps,W&&Ue){Pe.length>0&&Ve++;const we=te(ke[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ve,Ce,we.width,we.height)}for(let we=0;we<6;we++)if(Se){W?Oe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,ke[we].width,ke[we].height,j,ce,ke[we].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,Ce,ke[we].width,ke[we].height,0,j,ce,ke[we].data);for(let Ke=0;Ke<Pe.length;Ke++){const Qt=Pe[Ke].image[we].image;W?Oe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke+1,0,0,Qt.width,Qt.height,j,ce,Qt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke+1,Ce,Qt.width,Qt.height,0,j,ce,Qt.data)}}else{W?Oe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,j,ce,ke[we]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,Ce,j,ce,ke[we]);for(let Ke=0;Ke<Pe.length;Ke++){const vt=Pe[Ke];W?Oe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke+1,0,0,j,ce,vt.image[we]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,Ke+1,Ce,j,ce,vt.image[we])}}}m(C)&&g(n.TEXTURE_CUBE_MAP),le.__version=me.version,C.onUpdate&&C.onUpdate(C)}k.__version=C.version}function ue(k,C,Y,ne,me,le){const De=s.convert(Y.format,Y.colorSpace),Ne=s.convert(Y.type),Ye=x(Y.internalFormat,De,Ne,Y.colorSpace),Xe=i.get(C),Se=i.get(Y);if(Se.__renderTarget=C,!Xe.__hasExternalTextures){const ke=Math.max(1,C.width>>le),ut=Math.max(1,C.height>>le);me===n.TEXTURE_3D||me===n.TEXTURE_2D_ARRAY?t.texImage3D(me,le,Ye,ke,ut,C.depth,0,De,Ne,null):t.texImage2D(me,le,Ye,ke,ut,0,De,Ne,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),Q(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ne,me,Se.__webglTexture,0,K(C)):(me===n.TEXTURE_2D||me>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ne,me,Se.__webglTexture,le),t.bindFramebuffer(n.FRAMEBUFFER,null)}function I(k,C,Y){if(n.bindRenderbuffer(n.RENDERBUFFER,k),C.depthBuffer){const ne=C.depthTexture,me=ne&&ne.isDepthTexture?ne.type:null,le=_(C.stencilBuffer,me),De=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ne=K(C);Q(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ne,le,C.width,C.height):Y?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ne,le,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,le,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,De,n.RENDERBUFFER,k)}else{const ne=C.textures;for(let me=0;me<ne.length;me++){const le=ne[me],De=s.convert(le.format,le.colorSpace),Ne=s.convert(le.type),Ye=x(le.internalFormat,De,Ne,le.colorSpace),Xe=K(C);Y&&Q(C)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Xe,Ye,C.width,C.height):Q(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Xe,Ye,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,Ye,C.width,C.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function V(k,C){if(C&&C.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,k),!(C.depthTexture&&C.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ne=i.get(C.depthTexture);ne.__renderTarget=C,(!ne.__webglTexture||C.depthTexture.image.width!==C.width||C.depthTexture.image.height!==C.height)&&(C.depthTexture.image.width=C.width,C.depthTexture.image.height=C.height,C.depthTexture.needsUpdate=!0),G(C.depthTexture,0);const me=ne.__webglTexture,le=K(C);if(C.depthTexture.format===Fc)Q(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,me,0,le):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,me,0);else if(C.depthTexture.format===gl)Q(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,me,0,le):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,me,0);else throw new Error("Unknown depthTexture format")}function q(k){const C=i.get(k),Y=k.isWebGLCubeRenderTarget===!0;if(C.__boundDepthTexture!==k.depthTexture){const ne=k.depthTexture;if(C.__depthDisposeCallback&&C.__depthDisposeCallback(),ne){const me=()=>{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,ne.removeEventListener("dispose",me)};ne.addEventListener("dispose",me),C.__depthDisposeCallback=me}C.__boundDepthTexture=ne}if(k.depthTexture&&!C.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");const ne=k.texture.mipmaps;ne&&ne.length>0?V(C.__webglFramebuffer[0],k):V(C.__webglFramebuffer,k)}else if(Y){C.__webglDepthbuffer=[];for(let ne=0;ne<6;ne++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[ne]),C.__webglDepthbuffer[ne]===void 0)C.__webglDepthbuffer[ne]=n.createRenderbuffer(),I(C.__webglDepthbuffer[ne],k,!1);else{const me=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,le=C.__webglDepthbuffer[ne];n.bindRenderbuffer(n.RENDERBUFFER,le),n.framebufferRenderbuffer(n.FRAMEBUFFER,me,n.RENDERBUFFER,le)}}else{const ne=k.texture.mipmaps;if(ne&&ne.length>0?t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),I(C.__webglDepthbuffer,k,!1);else{const me=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,le=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,le),n.framebufferRenderbuffer(n.FRAMEBUFFER,me,n.RENDERBUFFER,le)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ye(k,C,Y){const ne=i.get(k);C!==void 0&&ue(ne.__webglFramebuffer,k,k.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),Y!==void 0&&q(k)}function N(k){const C=k.texture,Y=i.get(k),ne=i.get(C);k.addEventListener("dispose",E);const me=k.textures,le=k.isWebGLCubeRenderTarget===!0,De=me.length>1;if(De||(ne.__webglTexture===void 0&&(ne.__webglTexture=n.createTexture()),ne.__version=C.version,o.memory.textures++),le){Y.__webglFramebuffer=[];for(let Ne=0;Ne<6;Ne++)if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer[Ne]=[];for(let Ye=0;Ye<C.mipmaps.length;Ye++)Y.__webglFramebuffer[Ne][Ye]=n.createFramebuffer()}else Y.__webglFramebuffer[Ne]=n.createFramebuffer()}else{if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer=[];for(let Ne=0;Ne<C.mipmaps.length;Ne++)Y.__webglFramebuffer[Ne]=n.createFramebuffer()}else Y.__webglFramebuffer=n.createFramebuffer();if(De)for(let Ne=0,Ye=me.length;Ne<Ye;Ne++){const Xe=i.get(me[Ne]);Xe.__webglTexture===void 0&&(Xe.__webglTexture=n.createTexture(),o.memory.textures++)}if(k.samples>0&&Q(k)===!1){Y.__webglMultisampledFramebuffer=n.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let Ne=0;Ne<me.length;Ne++){const Ye=me[Ne];Y.__webglColorRenderbuffer[Ne]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,Y.__webglColorRenderbuffer[Ne]);const Xe=s.convert(Ye.format,Ye.colorSpace),Se=s.convert(Ye.type),ke=x(Ye.internalFormat,Xe,Se,Ye.colorSpace,k.isXRRenderTarget===!0),ut=K(k);n.renderbufferStorageMultisample(n.RENDERBUFFER,ut,ke,k.width,k.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ne,n.RENDERBUFFER,Y.__webglColorRen
vendor: 4,432 bytes, line 3940
3940derbuffer[Ne])}n.bindRenderbuffer(n.RENDERBUFFER,null),k.depthBuffer&&(Y.__webglDepthRenderbuffer=n.createRenderbuffer(),I(Y.__webglDepthRenderbuffer,k,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(le){t.bindTexture(n.TEXTURE_CUBE_MAP,ne.__webglTexture),Fe(n.TEXTURE_CUBE_MAP,C);for(let Ne=0;Ne<6;Ne++)if(C.mipmaps&&C.mipmaps.length>0)for(let Ye=0;Ye<C.mipmaps.length;Ye++)ue(Y.__webglFramebuffer[Ne][Ye],k,C,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,Ye);else ue(Y.__webglFramebuffer[Ne],k,C,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0);m(C)&&g(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(De){for(let Ne=0,Ye=me.length;Ne<Ye;Ne++){const Xe=me[Ne],Se=i.get(Xe);let ke=n.TEXTURE_2D;(k.isWebGL3DRenderTarget||k.isWebGLArrayRenderTarget)&&(ke=k.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(ke,Se.__webglTexture),Fe(ke,Xe),ue(Y.__webglFramebuffer,k,Xe,n.COLOR_ATTACHMENT0+Ne,ke,0),m(Xe)&&g(ke)}t.unbindTexture()}else{let Ne=n.TEXTURE_2D;if((k.isWebGL3DRenderTarget||k.isWebGLArrayRenderTarget)&&(Ne=k.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Ne,ne.__webglTexture),Fe(Ne,C),C.mipmaps&&C.mipmaps.length>0)for(let Ye=0;Ye<C.mipmaps.length;Ye++)ue(Y.__webglFramebuffer[Ye],k,C,n.COLOR_ATTACHMENT0,Ne,Ye);else ue(Y.__webglFramebuffer,k,C,n.COLOR_ATTACHMENT0,Ne,0);m(C)&&g(Ne),t.unbindTexture()}k.depthBuffer&&q(k)}function D(k){const C=k.textures;for(let Y=0,ne=C.length;Y<ne;Y++){const me=C[Y];if(m(me)){const le=y(k),De=i.get(me).__webglTexture;t.bindTexture(le,De),g(le),t.unbindTexture()}}}const R=[],X=[];function Z(k){if(k.samples>0){if(Q(k)===!1){const C=k.textures,Y=k.width,ne=k.height;let me=n.COLOR_BUFFER_BIT;const le=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,De=i.get(k),Ne=C.length>1;if(Ne)for(let Xe=0;Xe<C.length;Xe++)t.bindFramebuffer(n.FRAMEBUFFER,De.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xe,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,De.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xe,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,De.__webglMultisampledFramebuffer);const Ye=k.texture.mipmaps;Ye&&Ye.length>0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,De.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,De.__webglFramebuffer);for(let Xe=0;Xe<C.length;Xe++){if(k.resolveDepthBuffer&&(k.depthBuffer&&(me|=n.DEPTH_BUFFER_BIT),k.stencilBuffer&&k.resolveStencilBuffer&&(me|=n.STENCIL_BUFFER_BIT)),Ne){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,De.__webglColorRenderbuffer[Xe]);const Se=i.get(C[Xe]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,Se,0)}n.blitFramebuffer(0,0,Y,ne,0,0,Y,ne,me,n.NEAREST),l===!0&&(R.length=0,X.length=0,R.push(n.COLOR_ATTACHMENT0+Xe),k.depthBuffer&&k.resolveDepthBuffer===!1&&(R.push(le),X.push(le),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,X)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,R))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),Ne)for(let Xe=0;Xe<C.length;Xe++){t.bindFramebuffer(n.FRAMEBUFFER,De.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xe,n.RENDERBUFFER,De.__webglColorRenderbuffer[Xe]);const Se=i.get(C[Xe]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,De.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xe,n.TEXTURE_2D,Se,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,De.__webglMultisampledFramebuffer)}else if(k.depthBuffer&&k.resolveDepthBuffer===!1&&l){const C=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[C])}}}function K(k){return Math.min(r.maxSamples,k.samples)}function Q(k){const C=i.get(k);return k.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function ae(k){const C=o.render.frame;u.get(k)!==C&&(u.set(k,C),k.update())}function ee(k,C){const Y=k.colorSpace,ne=k.format,me=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||Y!==_o&&Y!==Zr&&(Gt.getTransfer(Y)===rn?(ne!==Wi||me!==Wn)&&je("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):St("WebGLTextures: Unsupported texture color space:",Y)),C}function te(k){return typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement?(c.width=k.naturalWi
vendor: 4,404 bytes, line 3940
3940dth||k.width,c.height=k.naturalHeight||k.height):typeof VideoFrame<"u"&&k instanceof VideoFrame?(c.width=k.displayWidth,c.height=k.displayHeight):(c.width=k.width,c.height=k.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=P,this.setTexture2D=G,this.setTexture2DArray=O,this.setTexture3D=$,this.setTextureCube=F,this.rebindTextures=ye,this.setupRenderTarget=N,this.updateRenderTargetMipmap=D,this.updateMultisampleRenderTarget=Z,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Q}function RR(n,e){function t(i,r=Zr){let s;const o=Gt.getTransfer(r);if(i===Wn)return n.UNSIGNED_BYTE;if(i===Tg)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Eg)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Y_)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===K_)return n.UNSIGNED_INT_10F_11F_11F_REV;if(i===q_)return n.BYTE;if(i===X_)return n.SHORT;if(i===kc)return n.UNSIGNED_SHORT;if(i===Mg)return n.INT;if(i===Os)return n.UNSIGNED_INT;if(i===li)return n.FLOAT;if(i===Gi)return n.HALF_FLOAT;if(i===Z_)return n.ALPHA;if(i===J_)return n.RGB;if(i===Wi)return n.RGBA;if(i===Fc)return n.DEPTH_COMPONENT;if(i===gl)return n.DEPTH_STENCIL;if(i===Ag)return n.RED;if(i===fd)return n.RED_INTEGER;if(i===Cg)return n.RG;if(i===Rg)return n.RG_INTEGER;if(i===Pg)return n.RGBA_INTEGER;if(i===ph||i===mh||i===gh||i===vh)if(o===rn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===ph)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===mh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===gh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===vh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===ph)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===mh)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===gh)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===vh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===om||i===am||i===lm||i===cm)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===om)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===am)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===lm)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===cm)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===um||i===hm||i===dm)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===um||i===hm)return o===rn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===dm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===fm||i===pm||i===mm||i===gm||i===vm||i===xm||i===ym||i===_m||i===bm||i===wm||i===Sm||i===Mm||i===Tm||i===Em)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===fm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===pm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===mm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===gm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===vm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===xm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===ym)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===_m)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===bm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===wm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Sm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Mm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Tm)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Em)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Am||i===Cm||i===Rm)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Am)return o===rn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Cm)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Rm)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Pm||i===Im||i===Nm||i===Lm)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Pm)return s.COMPRESSED_RED_RGT
vendor: 19,587 bytes, lines 3940-3964
3940C1_EXT;if(i===Im)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Nm)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Lm)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ml?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const P9=`
3941void main() {
3942
3943	gl_Position = vec4( position, 1.0 );
3944
3945}`,I9=`
3946uniform sampler2DArray depthColor;
3947uniform float depthWidth;
3948uniform float depthHeight;
3949
3950void main() {
3951
3952	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
3953
3954	if ( coord.x >= 1.0 ) {
3955
3956		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
3957
3958	} else {
3959
3960		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
3961
3962	}
3963
3964}`;class N9{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const i=new ub(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new pn({vertexShader:P9,fragmentShader:I9,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new an(new wl(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class L9 extends Cr{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,d=null,f=null,p=null;const v=typeof XRWebGLBinding<"u",m=new N9,g={},y=t.getContextAttributes();let x=null,_=null;const T=[],S=[],E=new de;let M=null;const b=new xn;b.viewport=new Ft;const w=new xn;w.viewport=new Ft;const A=[b,w],P=new xR;let H=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(he){let fe=T[he];return fe===void 0&&(fe=new Ap,T[he]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(he){let fe=T[he];return fe===void 0&&(fe=new Ap,T[he]=fe),fe.getGripSpace()},this.getHand=function(he){let fe=T[he];return fe===void 0&&(fe=new Ap,T[he]=fe),fe.getHandSpace()};function G(he){const fe=S.indexOf(he.inputSource);if(fe===-1)return;const ue=T[fe];ue!==void 0&&(ue.update(he.inputSource,he.frame,c||o),ue.dispatchEvent({type:he.type,data:he.inputSource}))}function O(){r.removeEventListener("select",G),r.removeEventListener("selectstart",G),r.removeEventListener("selectend",G),r.removeEventListener("squeeze",G),r.removeEventListener("squeezestart",G),r.removeEventListener("squeezeend",G),r.removeEventListener("end",O),r.removeEventListener("inputsourceschange",$);for(let he=0;he<T.length;he++){const fe=S[he];fe!==null&&(S[he]=null,T[he].disconnect(fe))}H=null,B=null,m.reset();for(const he in g)delete g[he];e.setRenderTarget(x),f=null,d=null,h=null,r=null,_=null,ze.stop(),i.isPresenting=!1,e.setPixelRatio(M),e.setSize(E.width,E.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(he){s=he,i.isPresenting===!0&&je("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(he){a=he,i.isPresenting===!0&&je("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(he){c=he},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return h===null&&v&&(h=new XRWebGLBinding(r,t)),h},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(he){if(r=he,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",G),r.addEventListener("selectstart",G),r.addEventListener("selectend",G),r.addEventListener("squeeze",G),r.addEventListener("squeezestart",G),r.addEventListener("squeezeend",G),r.addEventListener("end",O),r.addEventListener("inputsourceschange",$),y.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(E),v&&"createProjectionLayer"in XRWebGLBinding.prototype){let ue=null,I=null,V=null;y.depth&&(V=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ue=y.stencil?gl:Fc,I=y.stencil?ml:Os);const q={colorFormat:t.RGBA8,depthFormat:V,scaleFactor:s};h=this.getBinding(),d=h.createProjectionLayer(q),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),_=new En(d.textureWidth,d.textureHeight,{format:Wi,type:Wn,depthTexture:new Vg(d.textureWidth,d.textureHeight,I,void 0,void 0,void 0,void 0,void 0,void 0,ue),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const ue={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(r,t,ue),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),_=new En(f.framebufferWidth,f.framebufferHeight,{format:Wi,type:Wn,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}_.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),ze.setContext(r),ze.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function $(he){for(let fe=0;fe<he.removed.length;fe++){const ue=he.removed[fe],I=S.indexOf(ue);I>=0&&(S[I]=null,T[I].disconnect(ue))}for(let fe=0;fe<he.added.length;fe++){const ue=he.added[fe];let I=S.indexOf(ue);if(I===-1){for(let q=0;q<T.length;q++)if(q>=S.length){S.push(ue),I=q;break}else if(S[q]===null){S[q]=ue,I=q;break}if(I===-1)break}const V=T[I];V&&V.connect(ue)}}const F=new z,J=new z;function se(he,fe,ue){F.setFromMatrixPosition(fe.matrixWorld),J.setFromMatrixPosition(ue.matrixWorld);const I=F.distanceTo(J),V=fe.projectionMatrix.elements,q=ue.projectionMatrix.elements,ye=V[14]/(V[10]-1),N=V[14]/(V[10]+1),D=(V[9]+1)/V[5],R=(V[9]-1)/V[5],X=(V[8]-1)/V[0],Z=(q[8]+1)/q[0],K=ye*X,Q=ye*Z,ae=I/(-X+Z),ee=ae*-X;if(fe.matrixWorld.decompose(he.position,he.quaternion,he.scale),he.translateX(ee),he.translateZ(ae),he.matrixWorld.compose(he.position,he.quaternion,he.scale),he.matrixWorldInverse.copy(he.matrixWorld).invert(),V[10]===-1)he.projectionMatrix.copy(fe.projectionMatrix),he.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const te=ye+ae,k=N+ae,C=K-ee,Y=Q+(I-ee),ne=D*N/k*te,me=R*N/k*te;he.projectionMatrix.makePerspective(C,Y,ne,me,te,k),he.projectionMatrixInverse.copy(he.projectionMatrix).invert()}}function be(he,fe){fe===null?he.matrixWorld.copy(he.matrix):he.matrixWorld.multiplyMatrices(fe.matrixWorld,he.matrix),he.matrixWorldInverse.copy(he.matrixWorld).invert()}this.updateCamera=function(he){if(r===null)return;let fe=he.near,ue=he.far;m.texture!==null&&(m.depthNear>0&&(fe=m.depthNear),m.depthFar>0&&(ue=m.depthFar)),P.near=w.near=b.near=fe,P.far=w.far=b.far=ue,(H!==P.near||B!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),H=P.near,B=P.far),P.layers.mask=he.layers.mask|6,b.layers.mask=P.layers.mask&3,w.layers.mask=P.layers.mask&5;const I=he.parent,V=P.cameras;be(P,I);for(let q=0;q<V.length;q++)be(V[q],I);V.length===2?se(P,b,w):P.projectionMatrix.copy(b.projectionMatrix),Fe(he,P,I)};function Fe(he,fe,ue){ue===null?he.matrix.copy(fe.matrixWorld):(he.matrix.copy(ue.matrixWorld),he.matrix.invert(),he.matrix.multiply(fe.matrixWorld)),he.matrix.decompose(he.position,he.quaternion,he.scale),he.updateMatrixWorld(!0),he.projectionMatrix.copy(fe.projectionMatrix),he.projectionMatrixInverse.copy(fe.projectionMatrixInverse),he.isPerspectiveCamera&&(he.fov=zc*2*Math.atan(1/he.projectionMatrix.elements[5]),he.zoom=1)}this.getCamera=function(){return P},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(he){l=he,d!==null&&(d.fixedFoveation=he),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=he)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(P)},this.getCameraTexture=function(he){return g[he]};let Le=null;function Ge(he,fe){if(u=fe.getViewerPose(c||o),p=fe,u!==null){const ue=u.views;f!==null&&(e.setRenderTargetFramebuffer(_,f.framebuffer),e.setRenderTarget(_));let I=!1;ue.length!==P.cameras.length&&(P.cameras.length=0,I=!0);for(let N=0;N<ue.length;N++){const D=ue[N];let R=null;if(f!==null)R=f.getViewport(D);else{const Z=h.getViewSubImage(d,D);R=Z.viewport,N===0&&(e.setRenderTargetTextures(_,Z.colorTexture,Z.depthStencilTexture),e.setRenderTarget(_))}let X=A[N];X===void 0&&(X=new xn,X.layers.enable(N),X.viewport=new Ft,A[N]=X),X.matrix.fromArray(D.transform.matrix),X.matrix.decompose(X.position,X.quaternion,X.scale),X.projectionMatrix.fromArray(D.projectionMatrix),X.projectionMatrixInverse.copy(X.projectionMatrix).invert(),X.viewport.set(R.x,R.y,R.width,R.height),N===0&&(P.matrix.copy(X.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale)),I===!0&&P.cameras.push(X)}const V=r.enabledFeatures;if(V&&V.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&v){h=i.getBinding();const N=h.getDepthInformation(ue[0]);N&&N.isValid&&N.texture&&m.init(N,r.renderState)}if(V&&V.includes("camera-access")&&v){e.state.unbindTexture(),h=i.getBinding();for(let N=0;N<ue.length;N++){const D=ue[N].camera;if(D){let R=g[D];R||(R=new ub,g[D]=R);const X=h.getCameraImage(D);R.sourceTexture=X}}}}for(let ue=0;ue<T.length;ue++){const I=S[ue],V=T[ue];I!==null&&V!==void 0&&V.update(I,fe,c||o)}Le&&Le(he,fe),fe.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:fe}),p=null}const ze=new MR;ze.setAnimationLoop(Ge),this.setAnimationLoop=function(he){Le=he},this.dispose=function(){}}}const Oa=new ai,O9=new ht;function D9(n,e){function t(m,g){m.matrixAutoUpdate===!0&&m.updateMatrix(),g.value.copy(m.matrix)}function i(m,g){g.color.getRGB(m.fogColor.value,T3(n)),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function r(m,g,y,x,_){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(m,g):g.isMeshToonMaterial?(s(m,g),h(m,g)):g.isMeshPhongMaterial?(s(m,g),u(m,g)):g.isMeshStandardMaterial?(s(m,g),d(m,g),g.isMeshPhysicalMaterial&&f(m,g,_)):g.isMeshMatcapMaterial?(s(m,g),p(m,g)):g.isMeshDepthMaterial?s(m,g):g.isMeshDistanceMaterial?(s(m,g),v(m,g)):g.isMeshNormalMaterial?s(m,g):g.isLineBasicMaterial?(o(m,g),g.isLineDashedMaterial&&a(m,g)):g.isPointsMaterial?l(m,g,y,x):g.isSpriteMaterial?c(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map,t(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,t(g.alphaMap,m.alphaMapTransform)),g.bumpMap&&(m.bumpMap.value=g.bumpMap,t(g.bumpMap,m.bumpMapTransform),m.bumpScale.value=g.bumpScale,g.side===Xn&&(m.bumpScale.value*=-1)),g.normalMap&&(m.normalMap.value=g.normalMap,t(g.normalMap,m.normalMapTransform),m.normalScale.value.copy(g.normalScale),g.side===Xn&&m.normalScale.value.negate()),g.displacementMap&&(m.displacementMap.value=g.displacementMap,t(g.displacementMap,m.displacementMapTransform),m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,m.emissiveMapTransform)),g.specularMap&&(m.specularMap.value=g.specularMap,t(g.specularMap,m.specularMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);const y=e.get(g),x=y.envMap,_=y.envMapRotation;x&&(m.envMap.value=x,Oa.copy(_),Oa.x*=-1,Oa.y*=-1,Oa.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Oa.y*=-1,Oa.z*=-1),m.envMapRotation.value.setFromMatrix4(O9.makeRotationFromEuler(Oa)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap&&(m.lightMap.value=g.lightMap,m.lightMapIntensity.value=g.lightMapIntensity,t(g.lightMap,m.lightMapTransform)),g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,m.aoMapTransform))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,g.map&&(m.map.value=g.map,t(g.map,m.mapTransform))}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function l(m,g,y,x){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*y,m.scale.value=x*.5,g.map&&(m.map.value=g.map,t(g.map,m.uvTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,t(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function c(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map,t(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,t(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function u(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function h(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function d(m,g){m.metalness.value=g.metalness,g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,m.metalnessMapTransform)),m.roughness.value=g.roughness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,m.roughnessMapTransform)),g.envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function f(m,g,y){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Xn&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=y.texture,m.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,m.specularIntensityMapTransform))}function p(m,g){g.matcap&&(m.matcap.value=g.matcap)}function v(m,g){const y=e.get(g).light;m.referencePosition.value.setFromMatrixPosition(y.matrixWorld),m.nearDistance.value=y.shadow.camera.near,m.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function k9(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,x){const _=x.program;i.uniformBlockBinding(y,_)}function c(y,x){let _=r[y.id];_===void 0&&(p(y),_=u(y),r[y.id]=_,y.addEventListener("dispose",m));const T=x.program;i.updateUBOMapping(y,T);const S=e.render.frame;s[y.id]!==S&&(d(y),s[y.id]=S)}function u(y){const x=h();y.__bindingPointIndex=x;const _=n.createBuffer(),T=y.__size,S=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,_),n.bufferData(n.UNIFORM_BUFFER,T,S),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,_),_}function h(){for(let y=0;y<a;y++)if(o.indexOf(y)===-1)return o.push(y),y;return St("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){const x=r[y.id],_=y.uniforms,T=y.__cache;n.bindBuffer(n.UNIFORM_BUFFER,x);for(let S=0,E=_.length;S<E;S++){const M=Array.isArray(_[S])?_[S]:[_[S]];for(let b=0,w=M.length;b<w;b++){const A=M[b];if(f(A,S,b,T)===!0){const P=A.__offset,H=Array.isArray(A.value)?A.value:[A.value];let B=0;for(let G=0;G<H.length;G++){const O=H[G],$=v(O);typeof O=="number"||typeof O=="boolean"?(A.__data[0]=O,n.bufferSubData(n.UNIFORM_BUFFER,P+B,A.__data)):O.isMatrix3?(A.__data[0]=O.elements[0],A.__data[1]=O.elements[1],A.__data[2]=O.elements[2],A.__data[3]=0,A.__data[4]=O.elements[3],A.__data[5]=O.elements[4],A.__data[6]=O.elements[5],A.__data[7]=0,A.__data[8]=O.elements[6],A.__data[9]=O.elements[7],A.__data[10]=O.elements[8],A.__data[11]=0):(O.toArray(A.__data,B),B+=$.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,P,A.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function f(y,x,_,T){const S=y.value,E=x+"_"+_;if(T[E]===void 0)return typeof S=="number"||typeof S=="boolean"?T[E]=S:T[E]=S.clone(),!0;{const M=T[E];if(typeof S=="number"||typeof S=="boolean"){if(M!==S)return T[E]=S,!0}else if(M.equals(S)===!1)return M.copy(S),!0}return!1}function p(y){const x=y.uniforms;let _=0;const T=16;for(let E=0,M=x.length;E<M;E++){const b=Array.isArray(x[E])?x[E]:[x[E]];for(let w=0,A=b.length;w<A;w++){const P=b[w],H=Array.isArray(P.value)?P.value:[P.value];for(let B=0,G=H.length;B<G;B++){const O=H[B],$=v(O),F=_%T,J=F%$.boundary,se=F+J;_+=J,se!==0&&T-se<$.storage&&(_+=T-se),P.__data=new Float32Array($.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=_,_+=$.storage}}}const S=_%T;return S>0&&(_+=T-S),y.__size=_,y.__cache={},this}function v(y){const x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?je("WebGLRenderer: Texture samplers can not be part of an uniforms group."):je("WebGLRenderer: Unsupported uniform value type.",y),x}function m(y){const x=y.target;x.removeEventListener("dispose",m);const _=o.indexOf(x.__bindingPointIndex);o.splice(_,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function g(){for(const y in r)n.deleteBuffer(r[y]);o=[],r={},s={}}return{bind:l,update:c,dispose:g}}const F9
vendor: 11,603 bytes, line 3964
3964=new Uint16Array([11481,15204,11534,15171,11808,15015,12385,14843,12894,14716,13396,14600,13693,14483,13976,14366,14237,14171,14405,13961,14511,13770,14605,13598,14687,13444,14760,13305,14822,13066,14876,12857,14923,12675,14963,12517,14997,12379,15025,12230,15049,12023,15070,11843,15086,11687,15100,11551,15111,11433,15120,11330,15127,11217,15132,11060,15135,10922,15138,10801,15139,10695,15139,10600,13012,14923,13020,14917,13064,14886,13176,14800,13349,14666,13513,14526,13724,14398,13960,14230,14200,14020,14383,13827,14488,13651,14583,13491,14667,13348,14740,13132,14803,12908,14856,12713,14901,12542,14938,12394,14968,12241,14992,12017,15010,11822,15024,11654,15034,11507,15041,11380,15044,11269,15044,11081,15042,10913,15037,10764,15031,10635,15023,10520,15014,10419,15003,10330,13657,14676,13658,14673,13670,14660,13698,14622,13750,14547,13834,14442,13956,14317,14112,14093,14291,13889,14407,13704,14499,13538,14586,13389,14664,13201,14733,12966,14792,12758,14842,12577,14882,12418,14915,12272,14940,12033,14959,11826,14972,11646,14980,11490,14983,11355,14983,11212,14979,11008,14971,10830,14961,10675,14950,10540,14936,10420,14923,10315,14909,10204,14894,10041,14089,14460,14090,14459,14096,14452,14112,14431,14141,14388,14186,14305,14252,14130,14341,13941,14399,13756,14467,13585,14539,13430,14610,13272,14677,13026,14737,12808,14790,12617,14833,12449,14869,12303,14896,12065,14916,11845,14929,11655,14937,11490,14939,11347,14936,11184,14930,10970,14921,10783,14912,10621,14900,10480,14885,10356,14867,10247,14848,10062,14827,9894,14805,9745,14400,14208,14400,14206,14402,14198,14406,14174,14415,14122,14427,14035,14444,13913,14469,13767,14504,13613,14548,13463,14598,13324,14651,13082,14704,12858,14752,12658,14795,12483,14831,12330,14860,12106,14881,11875,14895,11675,14903,11501,14905,11351,14903,11178,14900,10953,14892,10757,14880,10589,14865,10442,14847,10313,14827,10162,14805,9965,14782,9792,14757,9642,14731,9507,14562,13883,14562,13883,14563,13877,14566,13862,14570,13830,14576,13773,14584,13689,14595,13582,14613,13461,14637,13336,14668,13120,14704,12897,14741,12695,14776,12516,14808,12358,14835,12150,14856,11910,14870,11701,14878,11519,14882,11361,14884,11187,14880,10951,14871,10748,14858,10572,14842,10418,14823,10286,14801,10099,14777,9897,14751,9722,14725,9567,14696,9430,14666,9309,14702,13604,14702,13604,14702,13600,14703,13591,14705,13570,14707,13533,14709,13477,14712,13400,14718,13305,14727,13106,14743,12907,14762,12716,14784,12539,14807,12380,14827,12190,14844,11943,14855,11727,14863,11539,14870,11376,14871,11204,14868,10960,14858,10748,14845,10565,14829,10406,14809,10269,14786,10058,14761,9852,14734,9671,14705,9512,14674,9374,14641,9253,14608,9076,14821,13366,14821,13365,14821,13364,14821,13358,14821,13344,14821,13320,14819,13252,14817,13145,14815,13011,14814,12858,14817,12698,14823,12539,14832,12389,14841,12214,14850,11968,14856,11750,14861,11558,14866,11390,14867,11226,14862,10972,14853,10754,14840,10565,14823,10401,14803,10259,14780,10032,14754,9820,14725,9635,14694,9473,14661,9333,14627,9203,14593,8988,14557,8798,14923,13014,14922,13014,14922,13012,14922,13004,14920,12987,14919,12957,14915,12907,14909,12834,14902,12738,14894,12623,14888,12498,14883,12370,14880,12203,14878,11970,14875,11759,14873,11569,14874,11401,14872,11243,14865,10986,14855,10762,14842,10568,14825,10401,14804,10255,14781,10017,14754,9799,14725,9611,14692,9445,14658,9301,14623,9139,14587,8920,14548,8729,14509,8562,15008,12672,15008,12672,15008,12671,15007,12667,15005,12656,15001,12637,14997,12605,14989,12556,14978,12490,14966,12407,14953,12313,14940,12136,14927,11934,14914,11742,14903,11563,14896,11401,14889,11247,14879,10992,14866,10767,14851,10570,14833,10400,14812,10252,14789,10007,14761,9784,14731,9592,14698,9424,14663,9279,14627,9088,14588,8868,14548,8676,14508,8508,14467,8360,15080,12386,15080,12386,15079,12385,15078,12383,15076,12378,15072,12367,15066,12347,15057,12315,15045,12253,15030,12138,15012,11998,14993,11845,14972,11685,14951,11530,14935,11383,14920,11228,14904,10981,14887,10762,14870,10567,14850,10397,14827,10248,14803,9997,14774,9771,14743,9578,14710,9407,14674,9259,14637,9048,14596,8826,14555,8632,14514,8464,14471,8317,14427,8182,15139,12008,15139,12008,15138,12008,15137,12007,15135,12003,15130,11990,15124,11969,15115,11929,15102,11872,15086,11794,15064,11693,15041,11581,15013,11459,14987,11336,14966,11170,14944,10944,14921,10738,14898,10552,14875,10387,14850,10239,14824,9983,14794,9758,14762,9563,14728,9392,14692,9244,14653,9014,14611,8791,14569,8597,14526,8427,14481,8281,14436,8110,14391,7885,15188,11617,15188,11617,15187,11617,15186,11618,15183,11617,15179,11612,15173,11601,15163,11581,15150,11546,15133,11495,15110,11427,15083,11346,15051,11246,15024,11057,14996,10868,14967,10687,14938,10517,14911,10362,14882,10206,14853,9956,14821,9737,14787,9543,14752,9375,14715,9228,14675,8980,14632,8760,14589,8565,14544,8395,14498,8248,14451,8049,14404,7824,14357,7630,15228,11298,15228,11298,15227,11299,15226,11301,15223,11303,15219,11302,15213,11299,15204,11290,15191,11271,15174,11217,15150,11129,15119,11015,15087,10886,15057,10744,15024,10599,14990,10455,14957,10318,14924,10143,14891,9911,14856,9701,14820,9516,14782,9352,14744,9200,14703,8946,14659,8725,14615,8533,14568,8366,14521,8220,14472,7992,14423,7770,14374,7578,14315,7408,15260,10819,15260,10819,15259,10822,15258,10826,15256,10832,15251,10836,15246,10841,15237,10838,15225,10821,15207,10788,15183,10734,15151,10660,15120,10571,15087,10469,15049,10359,15012,10249,14974,10041,14937,9837,14900,9647,14860,9475,14820,9320,14779,9147,14736,8902,14691,8688,14646,8499,14598,8335,14549,8189,14499,7940,14448,7720,14397,7529,14347,7363,14256,7218,15285,10410,15285,10411,15285,10413,15284,10418,15282,10425,15278,10434,15272,10442,15264,10449,15252,10445,15235,10433,15210,10403,15179,10358,15149,10301,15113,10218,15073,10059,15033,9894,14991,9726,14951,9565,14909,9413,14865,9273,14822,9073,14777,8845,14730,8641,14682,8459,14633,8300,14583,8129,14531,7883,14479,7670,14426,7482,14373,7321,14305,7176,14201,6939,15305,9939,15305,9940,15305,9945,15304,9955,15302,9967,15298,9989,15293,10010,15286,10033,15274,10044,15258,10045,15233,10022,15205,9975,15174,9903,15136,9808,15095,9697,15053,9578,15009,9451,14965,9327,14918,9198,14871,8973,14825,8766,14775,8579,14725,8408,14675,8259,14622,8058,14569,7821,14515,7615,14460,7435,14405,7276,14350,7108,14256,6866,14149,6653,15321,9444,15321,9445,15321,9448,15320,9458,15317,9470,15314,9490,15310,9515,15302,9540,15292,9562,15276,9579,15251,9577,15226,9559,15195,9519,15156,9463,15116,9389,15071,9304,15025,9208,14978,9023,14927,8838,14878,8661,14827,8496,14774,8344,14722,8206,14667,7973,14612,7749,14556,7555,14499,7382,14443,7229,14385,7025,14322,6791,14210,6588,14100,6409,15333,8920,15333,8921,15332,8927,15332,8943,15329,8965,15326,9002,15322,9048,15316,9106,15307,9162,15291,9204,15267,9221,15244,9221,15212,9196,15175,9134,15133,9043,15088,8930,15040,8801,14990,8665,14938,8526,14886,8391,14830,8261,14775,8087,14719,7866,14661,7664,14603,7482,14544,7322,14485,7178,14426,6936,14367,6713,14281,6517,14166,6348,14054,6198,15341,8360,15341,8361,15341,8366,15341,8379,15339,8399,15336,8431,15332,8473,15326,8527,15318,8585,15302,8632,15281,8670,15258,8690,15227,8690,15191,8664,15149,8612,15104,8543,15055,8456,15001,8360,14948,8259,14892,8122,14834,7923,14776,7734,14716,7558,14656,7397,14595,7250,14534,7070,14472,6835,14410,6628,14350,6443,14243,6283,14125,6135,14010,5889,15348,7715,15348,7717,15348,7725,15347,7745,15345,7780,15343,7836,15339,7905,15334,8e3,15326,8103,15310,8193,15293,8239,15270,8270,15240,8287,15204,8283,15163,8260,15118,8223,15067,8143,15014,8014,14958,7873,14899,7723,14839,7573,14778,7430,14715,7293,14652,7164,14588,6931,14524,6720,14460,6531,14396,6362,14330,6210,14207,6015,14086,5781,13969,5576,15352,7114,15352,7116,15352,7128,15352,7159,15350,7195,15348,7237,15345,7299,15340,7374,15332,7457,15317,7544,15301,7633,15280,7703,15251,7754,15216,7775,15176,7767,15131,7733,15079,7670,15026,7588,14967,7492,14906,7387,14844,7278,14779,7171,14714,6965,14648,6770,14581,6587,14515,6420,14448,6269,14382,6123,14299,5881,14172,5665,14049,5477,13929,5310,15355,6329,15355,6330,15355,6339,15355,6362,15353,6410,15351,6472,15349,6572,15344,6688,15337,6835,15323,6985,15309,7142,15287,7220,15260,7277,15226,7310,15188,7326,15142,7318,15090,7285,15036,7239,14976,7177,14914,7045,14849,6892,14782,6736,14714,6581,14645,6433,14576,6293,14506,6164,14438,5946,14369,5733,14270,5540,14140,5369,14014,5216,13892,5043,15357,5483,15357,5484,15357,5496,15357,5528,15356,5597,15354,5692,15351,5835,15347,6011,15339,6195,15328,6317,15314,6446,15293,6566,15268,6668,15235,6746,15197,6796,15152,6811,15101,6790,15046,6748,14985,6673,14921,6583,14854,6479,14785,6371,14714,6259,14643,6149,14571,5946,14499,5750,14428,5567,14358,5401,14242,5250,14109,5111,13980,4870,13856,4657,15359,4555,15359,4557,15358,4573,15358,4633,15357,4715,15355,4841,15353,5061,15349,5216,15342,5391,15331,5577,15318,5770,15299,5967,15274,6150,15243,6223,15206,6280,15161,6310,15111,6317,15055,6300,14994,6262,14928,6208,14860,6141,14788,5994,14715,5838,14641,5684,14566,5529,14492,5384,14418,5247,14346,5121,14216,4892,14079,4682,13948,4496,13822,4330,15359,3498,15359,3501,15359,3520,15359,3598,15358,3719,15356,3860,15355,4137,15351,4305,15344,4563,15334,4809,15321,5116,15303,5273,15280,5418,15250,5547,15214,5653,15170,5722,15120,5761,15064,5763,15002,5733,14935,5673,14865,5597,14792,5504,14716,5400,14640,5294,14563,5185,14486,5041,14410,4841,14335,4655,14191,4482,14051,4325,13918,4183,13790,4012,15360,2282,15360,2285,15360,2306,15360,2401,15359,2547,15357,2748,15355,3103,15352,3349,15345,3675,15336,4020,15324,4272,15307,4496,15285,4716,15255,4908,15220,5086,15178,5170,15128,5214,15072,5234,15010,5231,14943,5206,14871,5166,14796,5102,14718,4971,14639,4833,14559,4687,14480,4541,14402,4401,14315,4268,14167,4142,14025,3958,13888,3747,13759,3556,15360,923,15360,925,15360,946,15360,1052,15359,1214,15357,1494,15356,1892,15352,2274,15346,2663,15338,3099,15326,3393,15309,3679,15288,3980,15260,4183,15226,4325,15185,4437,15136,4517,15080,4570,15018,4591,14950,4581,14877,4545,14800,4485,14720,4411,14638,4325,14556,4231,14475,4136,14395,3988,14297,3803,14145,3628,13999,3465,13861,3314,13729,3177,15360,263,15360,264,15360,272,15360,325,15359,407,15358,548,15356,780,15352,1144,15347,1580,15339,2099,15328,2425,15312,2795,15292,3133,15264,3329,15232,3517,15191,3689,15143,3819,15088,3923,15025,3978,14956,3999,14882,3979,14804,3931,14722,3855,14639,3756,14554,3645,14470,3529,14388,3409,14279,3289,14124,3173,13975,3055,13834,2848,13701,2658,15360,49,15360,49,15360,52,15360,75,15359,111,15358,201,15356,283,15353,519,15348,726,15340,1045,15329,1415,15314,1795,15295,2173,15269,2410,15237,2649,15197,2866,15150,3054,15095,3140,15032,3196,14963,3228,14888,3236,14808,3224,14725,3191,14639,3146,14553,3088,14466,2976,14382,2836,14262,2692,14103,2549,13952,2409,13808,2278,13674,2154,15360,4,15360,4,15360,4,15360,13,15359,33,15358,59,15357,112,15353,199,15348,302,15341,456,15331,628,15316,827,15297,1082,15272,1332,15241,1601,15202,1851,15156,2069,15101,2172,15039,2256,14970,2314,14894,2348,14813,2358,14728,2344,14640,2311,14551,2263,14463,2203,14376,2133,14247,2059,14084,1915,13930,1761,13784,1609,13648,1464,15360,0,15360,0,15360,0,15360,3,15359,18,15358,26,15357,53,15354,80,15348,97,15341,165,15332,238,15318,326,15299,427,15275,529,15245,654,15207,771,15161,885,15108,994,15046,1089,14976,1170,14900,1229,14817,1266,14731,1284,14641,1282,14550,1260,14460,1223,14370,1174,14232,1116,14066,1050,13909,981,13761,910,13623,839]);let 
3964no=null;function U9(){return no===null&&(no=new is(F9,32,32,Cg,Gi),no.minFilter=dn,no.magFilter=dn,no.wrapS=lr,no.wrapT=lr,no.generateMipmaps=!1,no.needsUpdate=!0),no}class Nb{constructor(e={}){const{canvas:t=w3(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:d=!1}=e;
vendor: 5,217 bytes, line 3964
3964this.isWebGLRenderer=!0;let f;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=i.getContextAttributes().alpha}else f=o;const p=new Set([Pg,Rg,fd]),v=new Set([Wn,Os,kc,ml,Tg,Eg]),m=new Uint32Array(4),g=new Int32Array(4);let y=null,x=null;const _=[],T=[];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=As,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let E=!1;this._outputColorSpace=Lt;let M=0,b=0,w=null,A=-1,P=null;const H=new Ft,B=new Ft;let G=null;const O=new We(0);let $=0,F=t.width,J=t.height,se=1,be=null,Fe=null;const Le=new Ft(0,0,F,J),Ge=new Ft(0,0,F,J);let ze=!1;const he=new ru;let fe=!1,ue=!1;const I=new ht,V=new z,q=new Ft,ye={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let N=!1;function D(){return w===null?se:1}let R=i;function X(U,re){return t.getContext(U,re)}try{const U={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ua}`),t.addEventListener("webglcontextlost",Pe,!1),t.addEventListener("webglcontextrestored",we,!1),t.addEventListener("webglcontextcreationerror",Ke,!1),R===null){const re="webgl2";if(R=X(re,U),R===null)throw X(re)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(U){throw U("WebGLRenderer: "+U.message),U}let Z,K,Q,ae,ee,te,k,C,Y,ne,me,le,De,Ne,Ye,Xe,Se,ke,ut,j,ce,Ce,W,Ue;function Oe(){Z=new X8(R),Z.init(),Ce=new RR(R,Z),K=new B8(R,Z,e,Ce),Q=new C9(R,Z),K.reversedDepthBuffer&&d&&Q.buffers.depth.setReversed(!0),ae=new Z8(R),ee=new m9,te=new R9(R,Z,Q,ee,K,Ce,ae),k=new V8(S),C=new q8(S),Y=new tV(R),W=new F8(R,Y),ne=new Y8(R,Y,ae,W),me=new Q8(R,ne,Y,ae),ut=new J8(R,K,te),Xe=new z8(ee),le=new p9(S,k,C,Z,K,W,Xe),De=new D9(S,ee),Ne=new v9,Ye=new S9(Z),ke=new k8(S,k,C,Q,me,f,l),Se=new E9(S,me,K),Ue=new k9(R,ae,K,Q),j=new U8(R,Z,ae),ce=new K8(R,Z,ae),ae.programs=le.programs,S.capabilities=K,S.extensions=Z,S.properties=ee,S.renderLists=Ne,S.shadowMap=Se,S.state=Q,S.info=ae}Oe();const Ve=new L9(S,R);this.xr=Ve,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const U=Z.get("WEBGL_lose_context");U&&U.loseContext()},this.forceContextRestore=function(){const U=Z.get("WEBGL_lose_context");U&&U.restoreContext()},this.getPixelRatio=function(){return se},this.setPixelRatio=function(U){U!==void 0&&(se=U,this.setSize(F,J,!1))},this.getSize=function(U){return U.set(F,J)},this.setSize=function(U,re,ve=!0){if(Ve.isPresenting){je("WebGLRenderer: Can't change size while VR device is presenting.");return}F=U,J=re,t.width=Math.floor(U*se),t.height=Math.floor(re*se),ve===!0&&(t.style.width=U+"px",t.style.height=re+"px"),this.setViewport(0,0,U,re)},this.getDrawingBufferSize=function(U){return U.set(F*se,J*se).floor()},this.setDrawingBufferSize=function(U,re,ve){F=U,J=re,se=ve,t.width=Math.floor(U*ve),t.height=Math.floor(re*ve),this.setViewport(0,0,U,re)},this.getCurrentViewport=function(U){return U.copy(H)},this.getViewport=function(U){return U.copy(Le)},this.setViewport=function(U,re,ve,xe){U.isVector4?Le.set(U.x,U.y,U.z,U.w):Le.set(U,re,ve,xe),Q.viewport(H.copy(Le).multiplyScalar(se).round())},this.getScissor=function(U){return U.copy(Ge)},this.setScissor=function(U,re,ve,xe){U.isVector4?Ge.set(U.x,U.y,U.z,U.w):Ge.set(U,re,ve,xe),Q.scissor(B.copy(Ge).multiplyScalar(se).round())},this.getScissorTest=function(){return ze},this.setScissorTest=function(U){Q.setScissorTest(ze=U)},this.setOpaqueSort=function(U){be=U},this.setTransparentSort=function(U){Fe=U},this.getClearColor=function(U){return U.copy(ke.getClearColor())},this.setClearColor=function(){ke.setClearColor(...arguments)},this.getClearAlpha=function(){return ke.getClearAlpha()},this.setClearAlpha=function(){ke.setClearAlpha(...arguments)},this.clear=function(U=!0,re=!0,ve=!0){let xe=0;if(U){let oe=!1;if(w!==null){const He=w.texture.format;oe=p.has(He)}if(oe){const He=w.texture.type,Ze=v.has(He),at=ke.getClearColor(),rt=ke.getClearAlpha(),xt=at.r,wt=at.g,dt=at.b;Ze?(m[0]=xt,m[1]=wt,m[2]=dt,m[3]=rt,R.clearBufferuiv(R.COLOR,0,m)):(g[0]=xt,g[1]=wt,g[2]=dt,g[3]=rt,R.clearBufferiv(R.COLOR,0,g))}else xe|=R.COLOR_BUFFER_BIT}re&&(xe|=R.DEPTH_BUFFER_BIT),ve&&(xe|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(xe)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Pe,!1),t.removeEventListener("webglcontextrestored",we,!1),t.removeEventListener("webglcontextcreationerror",Ke,!1),ke.dispose(),Ne.dispose(),Ye.dispose(),ee.dispose(),k.dispose(),C.dispose(),me.dispose(),W.dispose(),Ue.dispose(),le.dispose(),Ve.dis
vendor: 8,557 bytes, line 3964
3964pose(),Ve.removeEventListener("sessionstart",U1),Ve.removeEventListener("sessionend",B1),va.stop()};function Pe(U){U.preventDefault(),Bh("WebGLRenderer: Context Lost."),E=!0}function we(){Bh("WebGLRenderer: Context Restored."),E=!1;const U=ae.autoReset,re=Se.enabled,ve=Se.autoUpdate,xe=Se.needsUpdate,oe=Se.type;Oe(),ae.autoReset=U,Se.enabled=re,Se.autoUpdate=ve,Se.needsUpdate=xe,Se.type=oe}function Ke(U){St("WebGLRenderer: A WebGL context could not be created. Reason: ",U.statusMessage)}function vt(U){const re=U.target;re.removeEventListener("dispose",vt),Qt(re)}function Qt(U){Ht(U),ee.remove(U)}function Ht(U){const re=ee.get(U).programs;re!==void 0&&(re.forEach(function(ve){le.releaseProgram(ve)}),U.isShaderMaterial&&le.releaseShaderCache(U))}this.renderBufferDirect=function(U,re,ve,xe,oe,He){re===null&&(re=ye);const Ze=oe.isMesh&&oe.matrixWorld.determinant()<0,at=lL(U,re,ve,xe,oe);Q.setMaterial(xe,Ze);let rt=ve.index,xt=1;if(xe.wireframe===!0){if(rt=ne.getWireframeAttribute(ve),rt===void 0)return;xt=2}const wt=ve.drawRange,dt=ve.attributes.position;let Bt=wt.start*xt,ln=(wt.start+wt.count)*xt;He!==null&&(Bt=Math.max(Bt,He.start*xt),ln=Math.min(ln,(He.start+He.count)*xt)),rt!==null?(Bt=Math.max(Bt,0),ln=Math.min(ln,rt.count)):dt!=null&&(Bt=Math.max(Bt,0),ln=Math.min(ln,dt.count));const Dn=ln-Bt;if(Dn<0||Dn===1/0)return;W.setup(oe,xe,at,ve,rt);let kn,hn=j;if(rt!==null&&(kn=Y.get(rt),hn=ce,hn.setIndex(kn)),oe.isMesh)xe.wireframe===!0?(Q.setLineWidth(xe.wireframeLinewidth*D()),hn.setMode(R.LINES)):hn.setMode(R.TRIANGLES);else if(oe.isLine){let gt=xe.linewidth;gt===void 0&&(gt=1),Q.setLineWidth(gt*D()),oe.isLineSegments?hn.setMode(R.LINES):oe.isLineLoop?hn.setMode(R.LINE_LOOP):hn.setMode(R.LINE_STRIP)}else oe.isPoints?hn.setMode(R.POINTS):oe.isSprite&&hn.setMode(R.TRIANGLES);if(oe.isBatchedMesh)if(oe._multiDrawInstances!==null)Bc("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),hn.renderMultiDrawInstances(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount,oe._multiDrawInstances);else if(Z.get("WEBGL_multi_draw"))hn.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else{const gt=oe._multiDrawStarts,Cn=oe._multiDrawCounts,Yt=oe._multiDrawCount,dr=rt?Y.get(rt).bytesPerElement:1,Il=ee.get(xe).currentProgram.getUniforms();for(let fr=0;fr<Yt;fr++)Il.setValue(R,"_gl_DrawID",fr),hn.render(gt[fr]/dr,Cn[fr])}else if(oe.isInstancedMesh)hn.renderInstances(Bt,Dn,oe.count);else if(ve.isInstancedBufferGeometry){const gt=ve._maxInstanceCount!==void 0?ve._maxInstanceCount:1/0,Cn=Math.min(ve.instanceCount,gt);hn.renderInstances(Bt,Dn,Cn)}else hn.render(Bt,Dn)};function Pi(U,re,ve){U.transparent===!0&&U.side===Et&&U.forceSinglePass===!1?(U.side=Xn,U.needsUpdate=!0,Bd(U,re,ve),U.side=Ns,U.needsUpdate=!0,Bd(U,re,ve),U.side=Et):Bd(U,re,ve)}this.compile=function(U,re,ve=null){ve===null&&(ve=U),x=Ye.get(ve),x.init(re),T.push(x),ve.traverseVisible(function(oe){oe.isLight&&oe.layers.test(re.layers)&&(x.pushLight(oe),oe.castShadow&&x.pushShadow(oe))}),U!==ve&&U.traverseVisible(function(oe){oe.isLight&&oe.layers.test(re.layers)&&(x.pushLight(oe),oe.castShadow&&x.pushShadow(oe))}),x.setupLights();const xe=new Set;return U.traverse(function(oe){if(!(oe.isMesh||oe.isPoints||oe.isLine||oe.isSprite))return;const He=oe.material;if(He)if(Array.isArray(He))for(let Ze=0;Ze<He.length;Ze++){const at=He[Ze];Pi(at,ve,oe),xe.add(at)}else Pi(He,ve,oe),xe.add(He)}),x=T.pop(),xe},this.compileAsync=function(U,re,ve=null){const xe=this.compile(U,re,ve);return new Promise(oe=>{function He(){if(xe.forEach(function(Ze){ee.get(Ze).currentProgram.isReady()&&xe.delete(Ze)}),xe.size===0){oe(U);return}setTimeout(He,10)}Z.get("KHR_parallel_shader_compile")!==null?He():setTimeout(He,10)})};let Vr=null;function aL(U){Vr&&Vr(U)}function U1(){va.stop()}function B1(){va.start()}const va=new MR;va.setAnimationLoop(aL),typeof self<"u"&&va.setContext(self),this.setAnimationLoop=function(U){Vr=U,Ve.setAnimationLoop(U),U===null?va.stop():va.start()},Ve.addEventListener("sessionstart",U1),Ve.addEventListener("sessionend",B1),this.render=function(U,re){if(re!==void 0&&re.isCamera!==!0){St("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;if(U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),re.parent===null&&re.matrixWorldAutoUpdate===!0&&re.updateMatrixWorld(),Ve.enabled===!0&&Ve.isPresenting===!0&&(Ve.cameraAutoUpdate===!0&&Ve.updateCamera(re),re=Ve.getCamera()),U.isScene===!0&&U.onBeforeRender(S,U,re,w),x=Ye.get(U,T.length),x.init(re),T.push(x),I.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),he.setFromProjectionMatrix(I,Sr,re.reversedDepth),ue=this.localClippingEnabled,fe=Xe.init(this.clippingPlanes,ue),y=Ne.get(U,_.length),y.init(),_.push(y),Ve.enabled===!0&&Ve.isPresenting===!0){const He=S.xr.getDepthSensingMesh();He!==null&&E0(He,re,-1/0,S.sortObjects)}E0(U,re,0,S.sortObjects),y.finish(),S.sortObjects===!0&&y.sort(be,Fe),N=Ve.enabled===!1||Ve.isPresenting===!1||Ve.hasDepthSensing()===!1,N&&ke.addToRenderList(y,U),this.info.render.frame++,fe===!0&&Xe.beginShadows();const ve=x.state.shadowsArray;Se.render(ve,U,re),fe===!0&&Xe.endShadows(),this.info.autoReset===!0&&this.info.reset();const xe=y.opaque,oe=y.transmissive;if(x.setupLights(),re.isArrayCamera){const He=re.cameras;if(oe.length>0)for(let Ze=0,at=He.length;Ze<at;Ze++){const rt=He[Ze];V1(xe,oe,U,rt)}N&&ke.render(U);for(let Ze=0,at=He.length;Ze<at;Ze++){const rt=He[Ze];z1(y,U,rt,rt.viewport)}}else oe.length>0&&V1(xe,oe,U,re),N&&ke.render(U),z1(y,U,re);w!==null&&b===0&&(te.updateMultisampleRenderTarget(w),te.updateRenderTargetMipmap(w)),U.isScene===!0&&U.onAfterRender(S,U,re),W.resetDefaultState(),A=-1,P=null,T.pop(),T.length>0?(x=T[T.length-1],fe===!0&&Xe.setGlobalState(S.clippingPlanes,x.state.camera)):x=null,_.pop(),_.length>0?y=_[_.length-1]:y=null};function E0(U,re,ve,xe){if(U.visible===!1)return;if(U.layers.test(re.layers)){if(U.isGroup)ve=U.renderOrder;else if(U.isLOD)U.autoUpdate===!0&&U.update(re);else if(U.isLight)x.pushLight(U),U.castShadow&&x.pushShadow(U);else if(U.isSprite){if(!U.frustumCulled||he.intersectsSprite(U)){xe&&q.setFromMatrixPosition(U.matrixWorld).applyMatrix4(I);const Ze=me.update(U),at=U.material;at.visible&&y.push(U,Ze,at,ve,q.z,null)}}else if((U.isMesh||U.isLine||U.isPoints)&&(!U.frustumCulled||he.intersectsObject(U))){const Ze=me.update(U),at=U.material;if(xe&&(U.boundingSphere!==void 0?(U.boundingSphere===null&&U.computeBoundingSphere(),q.copy(U.boundingSphere.center)):(Ze.boundingSphere===null&&Ze.computeBoundingSphere(),q.copy(Ze.boundingSphere.center)),q.applyMatrix4(U.matrixWorld).applyMatrix4(I)),Array.isArray(at)){const rt=Ze.groups;for(let xt=0,wt=rt.length;xt<wt;xt++){const dt=rt[xt],Bt=at[dt.materialIndex];Bt&&Bt.visible&&y.push(U,Ze,Bt,ve,q.z,dt)}}else at.visible&&y.push(U,Ze,at,ve,q.z,null)}}const He=U.children;for(let Ze=0,at=He.length;Ze<at;Ze++)E0(He[Ze],re,ve,xe)}function z1(U,re,ve,xe){const{opaque:oe,transmissive:He,transparent:Ze}=U;x.setupLightsView(ve),fe===!0&&Xe.setGlobalState(S.clippingPlanes,ve),xe&&Q.viewport(H.copy(xe)),oe.length>0&&Ud(oe,re,ve),He.length>0&&Ud(He,re,ve),Ze.length>0&&Ud(Ze,re,ve),Q.buffers.depth.setTest(!0),Q.buffers.depth.setMask(!0),Q.buffers.color.setMask(!0),Q.setPolygonOffset(!1)}function V1(U,re,ve,xe){if((ve.isScene===!0?ve.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[xe.id]===void 0&&(x.state.transmissionRenderTarget[xe.id]=new En(1,1,{generateMipmaps:!0,type:Z.has("EXT_color_buffer_half_float")||Z.has("EXT_color_buffer_float")?Gi:Wn,minFilter:es,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Gt.workingColorSpace}));const He=x.state.transmissionRenderTarget[xe.id],Ze=xe.viewport||H;He.setSize(Ze.z*S.transmissionResolutionScale,Ze.w*S.transmissionResolutionScale);const at=S.getRenderTarget(),rt=S.getActiveCubeFace(),xt=S.getActiveMipmapLevel();S.setRenderTarget(He),S.getClearColor(O),$=S.getClearAlpha(),$<1&&S.setClearColor(16777215,.5),S.clear(),N&&ke.render(ve);const wt=S.toneMapping;S.toneMapping=As;const dt=xe.viewport;if(xe.viewport!==void 0&&(xe.viewport=void 0),x.setupLightsView(xe),fe===!0&&Xe.setGlobalState(S.clippingPlanes,xe),Ud(U,ve,xe),te.updateMultisampleRenderTarget(He),te.updateRenderTargetMipmap(He),Z.has("WEBGL_multisampled_render_to_texture")===!1){let Bt=!1;for(let ln=0,Dn=re.length;ln<Dn;ln++){const kn=re[ln],{object:hn,geometry:gt,material:Cn,group:Yt}=kn;
vendor: 19,911 bytes, line 3964
3964if(Cn.side===Et&&hn.layers.test(xe.layers)){const dr=Cn.side;Cn.side=Xn,Cn.needsUpdate=!0,H1(hn,ve,xe,gt,Cn,Yt),Cn.side=dr,Cn.needsUpdate=!0,Bt=!0}}Bt===!0&&(te.updateMultisampleRenderTarget(He),te.updateRenderTargetMipmap(He))}S.setRenderTarget(at,rt,xt),S.setClearColor(O,$),dt!==void 0&&(xe.viewport=dt),S.toneMapping=wt}function Ud(U,re,ve){const xe=re.isScene===!0?re.overrideMaterial:null;for(let oe=0,He=U.length;oe<He;oe++){const Ze=U[oe],{object:at,geometry:rt,group:xt}=Ze;let wt=Ze.material;wt.allowOverride===!0&&xe!==null&&(wt=xe),at.layers.test(ve.layers)&&H1(at,re,ve,rt,wt,xt)}}function H1(U,re,ve,xe,oe,He){U.onBeforeRender(S,re,ve,xe,oe,He),U.modelViewMatrix.multiplyMatrices(ve.matrixWorldInverse,U.matrixWorld),U.normalMatrix.getNormalMatrix(U.modelViewMatrix),oe.onBeforeRender(S,re,ve,xe,U,He),oe.transparent===!0&&oe.side===Et&&oe.forceSinglePass===!1?(oe.side=Xn,oe.needsUpdate=!0,S.renderBufferDirect(ve,re,xe,oe,U,He),oe.side=Ns,oe.needsUpdate=!0,S.renderBufferDirect(ve,re,xe,oe,U,He),oe.side=Et):S.renderBufferDirect(ve,re,xe,oe,U,He),U.onAfterRender(S,re,ve,xe,oe,He)}function Bd(U,re,ve){re.isScene!==!0&&(re=ye);const xe=ee.get(U),oe=x.state.lights,He=x.state.shadowsArray,Ze=oe.state.version,at=le.getParameters(U,oe.state,He,re,ve),rt=le.getProgramCacheKey(at);let xt=xe.programs;xe.environment=U.isMeshStandardMaterial?re.environment:null,xe.fog=re.fog,xe.envMap=(U.isMeshStandardMaterial?C:k).get(U.envMap||xe.environment),xe.envMapRotation=xe.environment!==null&&U.envMap===null?re.environmentRotation:U.envMapRotation,xt===void 0&&(U.addEventListener("dispose",vt),xt=new Map,xe.programs=xt);let wt=xt.get(rt);if(wt!==void 0){if(xe.currentProgram===wt&&xe.lightsStateVersion===Ze)return W1(U,at),wt}else at.uniforms=le.getUniforms(U),U.onBeforeCompile(at,S),wt=le.acquireProgram(at,rt),xt.set(rt,wt),xe.uniforms=at.uniforms;const dt=xe.uniforms;return(!U.isShaderMaterial&&!U.isRawShaderMaterial||U.clipping===!0)&&(dt.clippingPlanes=Xe.uniform),W1(U,at),xe.needsLights=uL(U),xe.lightsStateVersion=Ze,xe.needsLights&&(dt.ambientLightColor.value=oe.state.ambient,dt.lightProbe.value=oe.state.probe,dt.directionalLights.value=oe.state.directional,dt.directionalLightShadows.value=oe.state.directionalShadow,dt.spotLights.value=oe.state.spot,dt.spotLightShadows.value=oe.state.spotShadow,dt.rectAreaLights.value=oe.state.rectArea,dt.ltc_1.value=oe.state.rectAreaLTC1,dt.ltc_2.value=oe.state.rectAreaLTC2,dt.pointLights.value=oe.state.point,dt.pointLightShadows.value=oe.state.pointShadow,dt.hemisphereLights.value=oe.state.hemi,dt.directionalShadowMap.value=oe.state.directionalShadowMap,dt.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,dt.spotShadowMap.value=oe.state.spotShadowMap,dt.spotLightMatrix.value=oe.state.spotLightMatrix,dt.spotLightMap.value=oe.state.spotLightMap,dt.pointShadowMap.value=oe.state.pointShadowMap,dt.pointShadowMatrix.value=oe.state.pointShadowMatrix),xe.currentProgram=wt,xe.uniformsList=null,wt}function G1(U){if(U.uniformsList===null){const re=U.currentProgram.getUniforms();U.uniformsList=Cp.seqWithValue(re.seq,U.uniforms)}return U.uniformsList}function W1(U,re){const ve=ee.get(U);ve.outputColorSpace=re.outputColorSpace,ve.batching=re.batching,ve.batchingColor=re.batchingColor,ve.instancing=re.instancing,ve.instancingColor=re.instancingColor,ve.instancingMorph=re.instancingMorph,ve.skinning=re.skinning,ve.morphTargets=re.morphTargets,ve.morphNormals=re.morphNormals,ve.morphColors=re.morphColors,ve.morphTargetsCount=re.morphTargetsCount,ve.numClippingPlanes=re.numClippingPlanes,ve.numIntersection=re.numClipIntersection,ve.vertexAlphas=re.vertexAlphas,ve.vertexTangents=re.vertexTangents,ve.toneMapping=re.toneMapping}function lL(U,re,ve,xe,oe){re.isScene!==!0&&(re=ye),te.resetTextureUnits();const He=re.fog,Ze=xe.isMeshStandardMaterial?re.environment:null,at=w===null?S.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:_o,rt=(xe.isMeshStandardMaterial?C:k).get(xe.envMap||Ze),xt=xe.vertexColors===!0&&!!ve.attributes.color&&ve.attributes.color.itemSize===4,wt=!!ve.attributes.tangent&&(!!xe.normalMap||xe.anisotropy>0),dt=!!ve.morphAttributes.position,Bt=!!ve.morphAttributes.normal,ln=!!ve.morphAttributes.color;let Dn=As;xe.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(Dn=S.toneMapping);const kn=ve.morphAttributes.position||ve.morphAttributes.normal||ve.morphAttributes.color,hn=kn!==void 0?kn.length:0,gt=ee.get(xe),Cn=x.state.lights;if(fe===!0&&(ue===!0||U!==P)){const Ii=U===P&&xe.id===A;Xe.setState(xe,U,Ii)}let Yt=!1;xe.version===gt.__version?(gt.needsLights&&gt.lightsStateVersion!==Cn.state.version||gt.outputColorSpace!==at||oe.isBatchedMesh&&gt.batching===!1||!oe.isBatchedMesh&&gt.batching===!0||oe.isBatchedMesh&&gt.batchingColor===!0&&oe.colorTexture===null||oe.isBatchedMesh&&gt.batchingColor===!1&&oe.colorTexture!==null||oe.isInstancedMesh&&gt.instancing===!1||!oe.isInstancedMesh&&gt.instancing===!0||oe.isSkinnedMesh&&gt.skinning===!1||!oe.isSkinnedMesh&&gt.skinning===!0||oe.isInstancedMesh&&gt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&gt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&gt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&gt.instancingMorph===!1&&oe.morphTexture!==null||gt.envMap!==rt||xe.fog===!0&&gt.fog!==He||gt.numClippingPlanes!==void 0&&(gt.numClippingPlanes!==Xe.numPlanes||gt.numIntersection!==Xe.numIntersection)||gt.vertexAlphas!==xt||gt.vertexTangents!==wt||gt.morphTargets!==dt||gt.morphNormals!==Bt||gt.morphColors!==ln||gt.toneMapping!==Dn||gt.morphTargetsCount!==hn)&&(Yt=!0):(Yt=!0,gt.__version=xe.version);let dr=gt.currentProgram;Yt===!0&&(dr=Bd(xe,re,oe));let Il=!1,fr=!1,xu=!1;const Rn=dr.getUniforms(),Ki=gt.uniforms;if(Q.useProgram(dr.program)&&(Il=!0,fr=!0,xu=!0),xe.id!==A&&(A=xe.id,fr=!0),Il||P!==U){Q.buffers.depth.getReversed()&&U.reversedDepth!==!0&&(U._reversedDepth=!0,U.updateProjectionMatrix()),Rn.setValue(R,"projectionMatrix",U.projectionMatrix),Rn.setValue(R,"viewMatrix",U.matrixWorldInverse);const Zi=Rn.map.cameraPosition;Zi!==void 0&&Zi.setValue(R,V.setFromMatrixPosition(U.matrixWorld)),K.logarithmicDepthBuffer&&Rn.setValue(R,"logDepthBufFC",2/(Math.log(U.far+1)/Math.LN2)),(xe.isMeshPhongMaterial||xe.isMeshToonMaterial||xe.isMeshLambertMaterial||xe.isMeshBasicMaterial||xe.isMeshStandardMaterial||xe.isShaderMaterial)&&Rn.setValue(R,"isOrthographic",U.isOrthographicCamera===!0),P!==U&&(P=U,fr=!0,xu=!0)}if(oe.isSkinnedMesh){Rn.setOptional(R,oe,"bindMatrix"),Rn.setOptional(R,oe,"bindMatrixInverse");const Ii=oe.skeleton;Ii&&(Ii.boneTexture===null&&Ii.computeBoneTexture(),Rn.setValue(R,"boneTexture",Ii.boneTexture,te))}oe.isBatchedMesh&&(Rn.setOptional(R,oe,"batchingTexture"),Rn.setValue(R,"batchingTexture",oe._matricesTexture,te),Rn.setOptional(R,oe,"batchingIdTexture"),Rn.setValue(R,"batchingIdTexture",oe._indirectTexture,te),Rn.setOptional(R,oe,"batchingColorTexture"),oe._colorsTexture!==null&&Rn.setValue(R,"batchingColorTexture",oe._colorsTexture,te));const Rr=ve.morphAttributes;if((Rr.position!==void 0||Rr.normal!==void 0||Rr.color!==void 0)&&ut.update(oe,ve,dr),(fr||gt.receiveShadow!==oe.receiveShadow)&&(gt.receiveShadow=oe.receiveShadow,Rn.setValue(R,"receiveShadow",oe.receiveShadow)),xe.isMeshGouraudMaterial&&xe.envMap!==null&&(Ki.envMap.value=rt,Ki.flipEnvMap.value=rt.isCubeTexture&&rt.isRenderTargetTexture===!1?-1:1),xe.isMeshStandardMaterial&&xe.envMap===null&&re.environment!==null&&(Ki.envMapIntensity.value=re.environmentIntensity),Ki.dfgLUT!==void 0&&(Ki.dfgLUT.value=U9()),fr&&(Rn.setValue(R,"toneMappingExposure",S.toneMappingExposure),gt.needsLights&&cL(Ki,xu),He&&xe.fog===!0&&De.refreshFogUniforms(Ki,He),De.refreshMaterialUniforms(Ki,xe,se,J,x.state.transmissionRenderTarget[U.id]),Cp.upload(R,G1(gt),Ki,te)),xe.isShaderMaterial&&xe.uniformsNeedUpdate===!0&&(Cp.upload(R,G1(gt),Ki,te),xe.uniformsNeedUpdate=!1),xe.isSpriteMaterial&&Rn.setValue(R,"center",oe.center),Rn.setValue(R,"modelViewMatrix",oe.modelViewMatrix),Rn.setValue(R,"normalMatrix",oe.normalMatrix),Rn.setValue(R,"modelMatrix",oe.matrixWorld),xe.isShaderMaterial||xe.isRawShaderMaterial){const Ii=xe.uniformsGroups;for(let Zi=0,A0=Ii.length;Zi<A0;Zi++){const xa=Ii[Zi];Ue.update(xa,dr),Ue.bind(xa,dr)}}return dr}function cL(U,re){U.ambientLightColor.needsUpdate=re,U.lightProbe.needsUpdate=re,U.directionalLights.needsUpdate=re,U.directionalLightShadows.needsUpdate=re,U.pointLights.needsUpdate=re,U.pointLightShadows.needsUpdate=re,U.spotLights.needsUpdate=re,U.spotLightShadows.needsUpdate=re,U.rectAreaLights.needsUpdate=re,U.hemisphereLights.needsUpdate=re}function uL(U){return U.isMeshLambertMaterial||U.isMeshToonMaterial||U.isMeshPhongMaterial||U.isMeshStandardMaterial||U.isShadowMaterial||U.isShaderMaterial&&U.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(U,re,ve){const xe=ee.get(U);xe.__autoAllocateDepthBuffer=U.resolveDepthBuffer===!1,xe.__autoAllocateDepthBuffer===!1&&(xe.__useRenderToTexture=!1),ee.get(U.texture).__webglTexture=re,ee.get(U.depthTexture).__webglTexture=xe.__autoAllocateDepthBuffer?void 0:ve,xe.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(U,re){const ve=ee.get(U);ve.__webglFramebuffer=re,ve.__useDefaultFramebuffer=re===void 0};const hL=R.createFramebuffer();this.setRenderTarget=function(U,re=0,ve=0){w=U,M=re,b=ve;let xe=!0,oe=null,He=!1,Ze=!1;if(U){const rt=ee.get(U);if(rt.__useDefaultFramebuffer!==void 0)Q.bindFramebuffer(R.FRAMEBUFFER,null),xe=!1;else if(rt.__webglFramebuffer===void 0)te.setupRenderTarget(U);else if(rt.__hasExternalTextures)te.rebindTextures(U,ee.get(U.texture).__webglTexture,ee.get(U.depthTexture).__webglTexture);else if(U.depthBuffer){const dt=U.depthTexture;if(rt.__boundDepthTexture!==dt){if(dt!==null&&ee.has(dt)&&(U.width!==dt.image.width||U.height!==dt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");te.setupDepthRenderbuffer(U)}}const xt=U.texture;(xt.isData3DTexture||xt.isDataArrayTexture||xt.isCompressedArrayTexture)&&(Ze=!0);const wt=ee.get(U).__webglFramebuffer;U.isWebGLCubeRenderTarget?(Array.isArray(wt[re])?oe=wt[re][ve]:oe=wt[re],He=!0):U.samples>0&&te.useMultisampledRTT(U)===!1?oe=ee.get(U).__webglMultisampledFramebuffer:Array.isArray(wt)?oe=wt[ve]:oe=wt,H.copy(U.viewport),B.copy(U.scissor),G=U.scissorTest}else H.copy(Le).multiplyScalar(se).floor(),B.copy(Ge).multiplyScalar(se).floor(),G=ze;if(ve!==0&&(oe=hL),Q.bindFramebuffer(R.FRAMEBUFFER,oe)&&xe&&Q.drawBuffers(U,oe),Q.viewport(H),Q.scissor(B),Q.setScissorTest(G),He){const rt=ee.get(U.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+re,rt.__webglTexture,ve)}else if(Ze){const rt=re;for(let xt=0;xt<U.textures.length;xt++){const wt=ee.get(U.textures[xt]);R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0+xt,wt.__webglTexture,ve,rt)}}else if(U!==null&&ve!==0){const rt=ee.get(U.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,rt.__webglTexture,ve)}A=-1},this.readRenderTargetPixels=function(U,re,ve,xe,oe,He,Ze,at=0){if(!(U&&U.isWebGLRenderTarget)){St("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let rt=ee.get(U).__webglFramebuffer;if(U.isWebGLCubeRenderTarget&&Ze!==void 0&&(rt=rt[Ze]),rt){Q.bindFramebuffer(R.FRAMEBUFFER,rt);try{const xt=U.textures[at],wt=xt.format,dt=xt.type;if(!K.textureFormatReadable(wt)){St("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!K.textureTypeReadable(dt)){St("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}re>=0&&re<=U.width-xe&&ve>=0&&ve<=U.height-oe&&(U.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+at),R.readPixels(re,ve,xe,oe,Ce.convert(wt),Ce.convert(dt),He))}finally{const xt=w!==null?ee.get(w).__webglFramebuffer:null;Q.bindFramebuffer(R.FRAMEBUFFER,xt)}}},this.readRenderTargetPixelsAsync=async function(U,re,ve,xe,oe,He,Ze,at=0){if(!(U&&U.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let rt=ee.get(U).__webglFramebuffer;if(U.isWebGLCubeRenderTarget&&Ze!==void 0&&(rt=rt[Ze]),rt)if(re>=0&&re<=U.width-xe&&ve>=0&&ve<=U.height-oe){Q.bindFramebuffer(R.FRAMEBUFFER,rt);const xt=U.textures[at],wt=xt.format,dt=xt.type;if(!K.textureFormatReadable(wt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!K.textureTypeReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Bt=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,Bt),R.bufferData(R.PIXEL_PACK_BUFFER,He.byteLength,R.STREAM_READ),U.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+at),R.readPixels(re,ve,xe,oe,Ce.convert(wt),Ce.convert(dt),0);const ln=w!==null?ee.get(w).__webglFramebuffer:null;Q.bindFramebuffer(R.FRAMEBUFFER,ln);const Dn=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await l4(R,Dn,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,Bt),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,He),R.deleteBuffer(Bt),R.deleteSync(Dn),He}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(U,re=null,ve=0){const xe=Math.pow(2,-ve),oe=Math.floor(U.image.width*xe),He=Math.floor(U.image.height*xe),Ze=re!==null?re.x:0,at=re!==null?re.y:0;te.setTexture2D(U,0),R.copyTexSubImage2D(R.TEXTURE_2D,ve,0,0,Ze,at,oe,He),Q.unbindTexture()};const dL=R.createFramebuffer(),fL=R.createFramebuffer();this.copyTextureToTexture=function(U,re,ve=null,xe=null,oe=0,He=null){He===null&&(oe!==0?(Bc("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),He=oe,oe=0):He=0);let Ze,at,rt,xt,wt,dt,Bt,ln,Dn;const kn=U.isCompressedTexture?U.mipmaps[He]:U.image;if(ve!==null)Ze=ve.max.x-ve.min.x,at=ve.max.y-ve.min.y,rt=ve.isBox3?ve.max.z-ve.min.z:1,xt=ve.min.x,wt=ve.min.y,dt=ve.isBox3?ve.min.z:0;else{const Rr=Math.pow(2,-oe);Ze=Math.floor(kn.width*Rr),at=Math.floor(kn.height*Rr),U.isDataArrayTexture?rt=kn.depth:U.isData3DTexture?rt=Math.floor(kn.depth*Rr):rt=1,xt=0,wt=0,dt=0}xe!==null?(Bt=xe.x,ln=xe.y,Dn=xe.z):(Bt=0,ln=0,Dn=0);const hn=Ce.convert(re.format),gt=Ce.convert(re.type);let Cn;re.isData3DTexture?(te.setTexture3D(re,0),Cn=R.TEXTURE_3D):re.isDataArrayTexture||re.isCompressedArrayTexture?(te.setTexture2DArray(re,0),Cn=R.TEXTURE_2D_ARRAY):(te.setTexture2D(re,0),Cn=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,re.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,re.unpackAlignment);const Yt=R.getParameter(R.UNPACK_ROW_LENGTH),dr=R.getParameter(R.UNPACK_IMAGE_HEIGHT),Il=R.getParameter(R.UNPACK_SKIP_PIXELS),fr=R.getParameter(R.UNPACK_SKIP_ROWS),xu=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,kn.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,kn.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,xt),R.pixelStorei(R.UNPACK_SKIP_ROWS,wt),R.pixelStorei(R.UNPACK_SKIP_IMAGES,dt);const Rn=U.isDataArrayTexture||U.isData3DTexture,Ki=re.isDataArrayTexture||re.isData3DTexture;if(U.isDepthTexture){const Rr=ee.get(U),Ii=ee.get(re),Zi=ee.get(Rr.__renderTarget),A0=ee.get(Ii.__renderTarget);Q.bindFramebuffer(R.READ_FRAMEBUFFER,Zi.__webglFramebuffer),Q.bindFramebuffer(R.DRAW_FRAMEBUFFER,A0.__webglFramebuffer);for(let xa=0;xa<rt;xa++)Rn&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ee.get(U).__webglTexture,oe,dt+xa),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ee.get(re).__webglTexture,He,Dn+xa)),R.blitFramebuffer(xt,wt,Ze,at,Bt,ln,Ze,at,R.DEPTH_BUFFER_BIT,R.NEAREST);Q.bindFramebuffer(R.READ_FRAMEBUFFER,null),Q.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(oe!==0||U.isRenderTargetTexture||ee.has(U)){const Rr=ee.get(U),Ii=ee.get(re);Q.bindFramebuffer(R.READ_FRAMEBUFFER,dL),Q.bindFramebuffer(R.DRAW_FRAMEBUFFER,fL);for(let Zi=0;Zi<rt;Zi++)Rn?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Rr.__webglTexture,oe,dt+Zi):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Rr.__webglTexture,oe),Ki?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Ii.__webglTexture,He,Dn+Zi):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Ii.__webglTexture,He),oe!==0?R.blitFramebuffer(xt,wt,Ze,at,Bt,ln,Ze,at,R.COLOR_BUFFER_BIT,R.NEAREST):Ki?R.copyTexSubImage3D(Cn,He,Bt,ln,Dn+Zi,xt,wt,Ze,at):R.copyTexSubImage2D(Cn,He,Bt,ln,xt,wt,Ze,at);Q.bindFramebuffer(R.READ_FRAMEBUFFER,null),Q.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else Ki?U.isDataTexture||U.isData3DTexture?R.texSubImage3D(Cn,He,Bt,ln,Dn,Ze,at,rt,hn,gt,kn.data):re.isCompressedArrayTexture?R.compressedTexSubImage3D(Cn,He,Bt,ln,Dn,Ze,at,rt,hn,kn.data):R.texSubImage3D(Cn,He,Bt,ln,Dn,Ze,at,rt,hn,gt,kn):U.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,He,Bt,ln,Ze,at,hn,gt,kn.data):U.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,He,Bt,ln,kn.width,kn.height,hn,kn.data):R.texSubImage2D(R.TEXTURE_2D,He,Bt,ln,Ze,at,hn,gt,kn);R.pixelStorei(R.UNPACK_ROW_LENGTH,Yt),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,dr),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Il),R.pixelStorei(R.UNPACK_SKIP_ROWS,fr),R.pixelStorei(R.UNPACK_SKIP_IMAGES,xu),He===0&&re.generateMipmaps&&R.generateMipmap(Cn),Q.unbindTexture()},this.initRenderTarget=function(U){ee.get(U).__webglFramebuffer===void 0&&te.setupRenderTarget(U)},this.initTexture=function(U){U.isCubeTexture?te.setTextureCube(U,0):U.isData3DTexture?te.setTexture3D(U,0):U.isDataArrayTexture||U.isCompressedArrayTexture?te.setTexture2DArray(U,0):te.setTexture2D(U,0),Q.unbindTexture()},this.resetState=function(){M=0,b=0,w=null,Q.reset(),W.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Sr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Gt._getDrawingBufferColorSpace(e),t.unpackColorSpace=Gt._getUnpackColorSpace()}}const B9=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:$_,AddEquation:jo,AddOperation:t3,AdditiveAnimationBlendMode:Q_,AdditiveBlending:Qx,AgXToneMapping:o3,AlphaFormat:Z_,AlwaysCompare:_3,AlwaysDepth:Ih,AlwaysStencilFunc:iy,AmbientLight:dR,AnimationAction:bR,AnimationClip:$h,AnimationLoader:K5,AnimationMixer:wz,AnimationObjectGroup:_z,AnimationUtils:j5,ArcCurve:k3,ArrayCamera:xR,ArrowHelper:jz,AttachedBindMode:ny,Audio:yR,AudioAnalyser:uz,AudioContext:Eb,AudioListener:az,AudioLoader:rz,AxesHelper:qz,BackSide:Xn,BasicDepthPacking:Hs,BasicShadowMap:wB,BatchedMesh:I3,Bone:lb,BooleanKeyframeTrack:Sl,Box2:Iz,Box3:Ai,Box3Helper:Wz,BoxGeometry:da,BoxHelper:Gz,BufferAttribute:Jt,BufferGeometry:At,BufferGeometryLoader:vR,ByteType:q_,Cache:Ss,Camera:Dg,CameraHelper:Hz,CanvasTexture:m5,CapsuleGeometry:Hg,CatmullRomCurve3:F3,CineonToneMapping:r3,CircleGeometry:Gg,ClampToEdgeWrapping:lr,Clock:Ab,Color:We,ColorKeyframeTrack:wb,ColorManagement:Gt,CompressedArrayTexture:f5,CompressedCubeTexture:p5,CompressedTexture:zg,CompressedTextureLoader:Z5,ConeGeometry:yd,ConstantAlphaFactor:JC,ConstantColorFactor:KC,Controls:Yz,CubeCamera:sb,CubeReflectionMapping:Ls,CubeRefractionMapping:ea,CubeTexture:gd,CubeTextureLoader:oR,CubeUVReflectionMapping:iu,CubicBezierCurve:db,CubicBezierCurve3:U3,CubicInterpolant:nR,CullFaceBack:Jx,CullFaceFront:DC,CullFaceFrontBack:bB,CullFaceNone:OC,Curve:cs,CurvePath:z3,CustomBlending:kC,CustomToneMapping:s3,CylinderGeometry:xd,Cyl
3964indrical:Pz,Data3DTexture:Lg,DataArrayTexture:Ng,DataTexture:is,DataTextureLoader:aR,DataUtils:Ju,DecrementStencilOp:kB,DecrementWrapStencilOp:UB,DefaultLoadingManager:sR,DepthFormat:Fc,DepthStencilFormat:gl,DepthTexture:Vg,DetachedBindMode:l3,DirectionalLight:hR,DirectionalLightHelper:Vz,DiscreteInterpolant:iR,DodecahedronGeometry:Wg,DoubleSide:Et,DstAlphaFactor:$C,DstColorFactor:qC,DynamicCopyUsage:QB,DynamicDrawUsage:qB,DynamicReadUsage:KB,EdgesGeometry:D3,EllipseCurve:$g,EqualCompare:g3,EqualDepth:nm,EqualStencilFunc:HB,EquirectangularReflectionMapping:Jo,EquirectangularRefractionMapping:Nh,Euler:ai,EventDispatcher:Cr,ExternalTexture:ub,ExtrudeGeometry:jg,FileLoader:wo,Float16BufferAttribute:$4,Float32BufferAttribute:it,FloatType:li,Fog:Fg,FogExp2:kg,FramebufferTexture:d5,FrontSide:Ns,Frustum:ru,FrustumArray:Bg,GLBufferAttribute:Az,GLSL1:t4,GLSL3:ry,GreaterCompare:v3,GreaterDepth:rm,GreaterEqualCompare:y3,GreaterEqualDepth:im,GreaterEqualStencilFunc:jB,GreaterStencilFunc:WB,GridHelper:Bz,Group:xc,HalfFloatType:Gi,HemisphereLight:lR,HemisphereLightHelper:Uz,IcosahedronGeometry:qg,ImageBitmapLoader:iz,ImageLoader:jh,ImageUtils:S3,IncrementStencilOp:DB,IncrementWrapStencilOp:FB,InstancedBufferAttribute:Hc,InstancedBufferGeometry:gR,InstancedInterleavedBuffer:Ez,InstancedMesh:P3,Int16BufferAttribute:G4,Int32BufferAttribute:W4,Int8BufferAttribute:z4,IntType:Mg,InterleavedBuffer:vd,InterleavedBufferAttribute:bo,Interpolant:wd,InterpolateDiscrete:Oh,InterpolateLinear:Om,InterpolateSmooth:Ep,InterpolationSamplingMode:r4,InterpolationSamplingType:i4,InvertStencilOp:BB,KeepStencilOp:za,KeyframeTrack:Br,LOD:C3,LatheGeometry:Xg,Layers:md,LessCompare:m3,LessDepth:tm,LessEqualCompare:eb,LessEqualDepth:pl,LessEqualStencilFunc:GB,LessStencilFunc:VB,Light:pa,LightProbe:mR,Line:na,Line3:wR,LineBasicMaterial:Xi,LineCurve:fb,LineCurve3:B3,LineDashedMaterial:Q3,LineLoop:N3,LineSegments:Ws,LinearFilter:dn,LinearInterpolant:bb,LinearMipMapLinearFilter:EB,LinearMipMapNearestFilter:TB,LinearMipmapLinearFilter:es,LinearMipmapNearestFilter:fh,LinearSRGBColorSpace:_o,LinearToneMapping:n3,LinearTransfer:kh,Loader:hr,LoaderUtils:cy,LoadingManager:Sb,LoopOnce:c3,LoopPingPong:h3,LoopRepeat:u3,MOUSE:bs,Material:si,MaterialLoader:t0,MathUtils:pd,Matrix2:Ib,Matrix3:Ct,Matrix4:ht,MaxEquation:zC,Mesh:an,MeshBasicMaterial:Gs,MeshDepthMaterial:xb,MeshDistanceMaterial:yb,MeshLambertMaterial:Z3,MeshMatcapMaterial:J3,MeshNormalMaterial:vb,MeshPhongMaterial:Y3,MeshPhysicalMaterial:X3,MeshStandardMaterial:bd,MeshToonMaterial:K3,MinEquation:BC,MirroredRepeatWrapping:Lh,MixOperation:e3,MultiplyBlending:ty,MultiplyOperation:dd,NearestFilter:on,NearestMipMapLinearFilter:MB,NearestMipMapNearestFilter:SB,NearestMipmapLinearFilter:gc,NearestMipmapNearestFilter:j_,NeutralToneMapping:a3,NeverCompare:p3,NeverDepth:em,NeverStencilFunc:zB,NoBlending:Hn,NoColorSpace:Zr,NoToneMapping:As,NormalAnimationBlendMode:Ig,NormalBlending:il,NotEqualCompare:x3,NotEqualDepth:sm,NotEqualStencilFunc:$B,NumberKeyframeTrack:Gh,Object3D:Dt,ObjectLoader:tz,ObjectSpaceNormalMap:f3,OctahedronGeometry:_d,OneFactor:HC,OneMinusConstantAlphaFactor:QC,OneMinusConstantColorFactor:ZC,OneMinusDstAlphaFactor:jC,OneMinusDstColorFactor:XC,OneMinusSrcAlphaFactor:Qp,OneMinusSrcColorFactor:WC,OrthographicCamera:rs,PCFShadowMap:G_,PCFSoftShadowMap:W_,PMREMGenerator:fy,Path:Um,PerspectiveCamera:xn,Plane:sr,PlaneGeometry:wl,PlaneHelper:$z,PointLight:uR,PointLightHelper:kz,Points:L3,PointsMaterial:cb,PolarGridHelper:zz,PolyhedronGeometry:fa,PositionalAudio:cz,PropertyBinding:jt,PropertyMixer:_R,QuadraticBezierCurve:pb,QuadraticBezierCurve3:mb,Quaternion:ui,QuaternionKeyframeTrack:Sd,QuaternionLinearInterpolant:rR,RED_GREEN_RGTC2_Format:Nm,RED_RGTC1_Format:Pm,REVISION:ua,RGBADepthPacking:d3,RGBAFormat:Wi,RGBAIntegerFormat:Pg,RGBA_ASTC_10x10_Format:Mm,RGBA_ASTC_10x5_Format:bm,RGBA_ASTC_10x6_Format:wm,RGBA_ASTC_10x8_Format:Sm,RGBA_ASTC_12x10_Format:Tm,RGBA_ASTC_12x12_Format:Em,RGBA_ASTC_4x4_Format:fm,RGBA_ASTC_5x4_Format:pm,RGBA_ASTC_5x5_Format:mm,RGBA_ASTC_6x5_Format:gm,RGBA_ASTC_6x6_Format:vm,RGBA_ASTC_8x5_Format:xm,RGBA_ASTC_8x6_Format:ym,RGBA_ASTC_8x8_Format:_m,RGBA_BPTC_Format:Am,RGBA_ETC2_EAC_Format:dm,RGBA_PVRTC_2BPPV1_Format:cm,RGBA_PVRTC_4BPPV1_Format:lm,RGBA_S3TC_DXT1_Format:mh,RGBA_S3TC_DXT3_Format:gh,RGBA_S3TC_DXT5_Format:vh,RGBDepthPacking:IB,RGBFormat:J_,RGBIntegerFormat:AB,RGB_BPTC_SIGNED_Format:Cm,RGB_BPTC_UNSIGNED_Format:Rm,RGB_ETC1_Format:um,RGB_ETC2_Format:hm,RGB_PVRTC_2BPPV1_Format:am,RGB_PVRTC_4BPPV1_Format:om,RGB_S3TC_DXT1_Format:ph,RGDepthPacking:NB,RGFormat:Cg,RGIntegerFormat:Rg,RawShaderMaterial:q3,Ray:Ds,Raycaster:Pb,RectAreaLight:fR,RedFormat:Ag,RedIntegerFormat:fd,ReinhardToneMapping:i3,RenderTarget:nb,RenderTarget3D:Sz,RepeatWrapping:fo,ReplaceStencilOp:OB,ReverseSubtractEquation:UC,RingGeometry:Yg,SIGNED_RED_GREEN_RGTC2_Format:Lm,SIGNED_RED_RGT
3964C1_Format:Im,SRGBColorSpace:Lt,SRGBTransfer:rn,Scene:vl,ShaderChunk:It,ShaderLib:Kr,ShaderMaterial:pn,ShadowMaterial:j3,Shape:sl,ShapeGeometry:Kg,ShapePath:Xz,ShapeUtils:ts,ShortType:X_,Skeleton:Ug,SkeletonHelper:Dz,SkinnedMesh:R3,Source:qo,Sphere:hi,SphereGeometry:su,Spherical:hy,SphericalHarmonics3:pR,SplineCurve:gb,SpotLight:cR,SpotLightHelper:Oz,Sprite:A3,SpriteMaterial:ab,SrcAlphaFactor:Jp,SrcAlphaSaturateFactor:YC,SrcColorFactor:GC,StaticCopyUsage:JB,StaticDrawUsage:Fh,StaticReadUsage:YB,StereoCamera:sz,StreamCopyUsage:e4,StreamDrawUsage:XB,StreamReadUsage:ZB,StringKeyframeTrack:Ml,SubtractEquation:FC,SubtractiveBlending:ey,TOUCH:lo,TangentSpaceNormalMap:ha,TetrahedronGeometry:Zg,Texture:Sn,TextureLoader:Mb,TextureUtils:eV,Timer:Cz,TimestampQuery:n4,TorusGeometry:Jg,TorusKnotGeometry:Qg,Triangle:Ei,TriangleFanDrawMode:PB,TriangleStripDrawMode:RB,TrianglesDrawMode:CB,TubeGeometry:e0,UVMapping:Sg,Uint16BufferAttribute:ib,Uint32BufferAttribute:rb,Uint8BufferAttribute:V4,Uint8ClampedBufferAttribute:H4,Uniform:Qe,UniformsGroup:Tz,UniformsLib:$e,UniformsUtils:Og,UnsignedByteType:Wn,UnsignedInt101111Type:K_,UnsignedInt248Type:ml,UnsignedInt5999Type:Y_,UnsignedIntType:Os,UnsignedShort4444Type:Tg,UnsignedShort5551Type:Eg,UnsignedShortType:kc,VSMShadowMap:ys,Vector2:de,Vector3:z,Vector4:Ft,VectorKeyframeTrack:Wh,VideoFrameTexture:h5,VideoTexture:O3,WebGL3DRenderTarget:R4,WebGLArrayRenderTarget:C4,WebGLCoordinateSystem:Sr,WebGLCubeRenderTarget:ob,WebGLRenderTarget:En,WebGLRenderer:Nb,WebGLUtils:RR,WebGPUCoordinateSystem:Uc,WebXRController:Ap,WireframeGeometry:$3,WrapAroundEnding:Dh,ZeroCurvatureEnding:qa,ZeroFactor:VC,ZeroSlopeEnding:Xa,ZeroStencilOp:LB,createCanvasElement:w3,error:St,getConsoleFunction:a4,log:Bh,setConsoleFunction:o4,warn:je,warnOnce:Bc},Symbol.toStringTag,{value:"Module"}));function ks(n){return Jc()?(cg(n),!0):!1}function qh(){const n=new Set,e=s=>{n.delete(s)};return{on:s=>{n.add(s);const o=()=>e(s);return ks(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(n).map(o=>o(...s))),clear:()=>{n.clear()}}}const Rc=new WeakMap,PR=(...n)=>{var e;const t=n[0],i=(e=Gn())==null?void 0:e.proxy;if(i==null&&!eu())throw new Error("injectLocal must be called in setup");return i&&Rc.has(i)&&t in Rc.get(i)?Rc.get(i)[t]:gi(...n)};function z9(n,e){var t;const i=(t=Gn())==null?void 0:t.proxy;if(i==null)throw new Error("provideLocal must be called in setup");Rc.has(i)||Rc.set(i,Object.create(null));const r=Rc.get(i);return r[n]=e,Mr(n,e)}function V9(n,e){const t=e?.injectionKey||Symbol(n.name||"InjectionState"),i=e?.defaultValue;return[(...o)=>{const a=n(...o);return z9(t,a),a},()=>PR(t,i)]}function Lb(n){let e=0,t,i;const r=()=>{e-=1,i&&e<=0&&(i.stop(),t=void 0,i=void 0)};return(...s)=>(e+=1,i||(i=RA(!0),t=i.run(()=>n(...s))),ks(r),t)}function H9(n){if(!Xt(n))return Mn(n);const e=new Proxy({},{get(t,i,r){return L(Reflect.get(n.value,i,r))},set(t,i,r){return Xt(n.value[i])&&!Xt(r)?n.value[i].value=r:n.value[i]=r,!0},deleteProperty(t,i){return Reflect.deleteProperty(n.value,i)},has(t,i){return Reflect.has(n.value,i)},ownKeys(){return Object.keys(n.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return Mn(e)}function IR(n){return H9(ge(n))}function G9(n,...e){const t=e.flat(),i=t[0];return IR(()=>Object.fromEntries(typeof i=="function"?Object.entries(Ar(n)).filter(([r,s])=>!i(tt(s),r)):Object.entries(Ar(n)).filter(r=>!t.includes(r[0]))))}const ol=typeof window<"u"&&typeof document<"u",RM=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,W9=Object.prototype.toString,$9=n=>W9.call(n)==="[object Object]",Fs=()=>{};function NR(...n){if(n.length!==1)return or(...n);const e=n[0];return typeof e=="function"?ss(y_(()=>({get:e,set:Fs}))):Te(e)}function Tl(n,...e){const t=e.flat(),i=t[0];return IR(()=>Object.fromEntries(typeof i=="function"?Object.entries(Ar(n)).filter(([r,s])=>i(tt(s),r)):t.map(r=>[r,NR(n,r)])))}function LR(n,e){function t(...i){return new Promise((r,s)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(s)})}return t}function j9(n,e={}){let t,i,r=Fs;const s=l=>{clearTimeout(l),r(),r=Fs};let o;return l=>{const c=tt(n),u=tt(e.maxWait);return t&&s(t),c<=0||u!==void 0&&u<=0?(i&&(s(i),i=void 0),Promise.resolve(l())):new Promise((h,d)=>{r=e.rejectOnCancel?d:h,o=l,u&&!i&&(i=setTimeout(()=>{t&&s(t),i=void 0,h(o())},u)),t=setTimeout(()=>{i&&s(i),i=void 0,h(l())},c)})}}function q9(...n){let e=0,t,i=!0,r=Fs,s,o,a,l,c;!Xt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,r(),r=Fs)};return d=>{const f=tt(o),p=Date.now()-e,v=()=>s=d();return u(),f<=0?(e=Date.now(),v()):(p>f&&(l||!i)?(e=Date.now(),v()):a&&(s=new Promise((m,g)=>{r=c?g:m,t=setTimeout(()=>{e=Date.now(),i=!0,m(v()),u()},Math.max(0,f-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,f)),i=!1,s)}}function Bm(n,e=!1,t="Timeout"){return new Promise((i,r)=>{setTimeout(e?()=>r(t):i,n)})}function PM(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function Rp(n){return Array.isArray(n)?n:[n]}function X9(n){return Gn()}function Y9(n,e=200,t={}){return LR(j9(e,t),n)}function IM(n,e=200,t={}){const i=Te(tt(n)),r=Y9(()=>{i.value=n.value},e,t);return Je(n,()=>r()),ao(i)}function K9(n,e=200,t=!1,i=!0,r=!1){return LR(q9(e,t,i,r),n)}function OR(n,e=!0,t){X9()?On(n,t):e?n():xi(n)}function my(n,e=!1){function t(h,{flush:d="sync",deep:f=!1,timeout:p,throwOnTimeout:v}={}){let m=null;const y=[new Promise(x=>{m=Je(n,_=>{h(_)!==e&&(m?m():xi(()=>m?.()),x(_))},{flush:d,deep:f,immediate:!0})})];return p!=null&&y.push(Bm(p,v).then(()=>tt(n)).finally(()=>m?.())),Promise.race(y)}function i(h,d){if(!Xt(h))return t(_=>_===h,d);const{flush:f="sync",deep:p=!1,timeout:v,throwOnTimeout:m}=d??{};let g=null;const x=[new Promise(_=>{g=Je([n,h],([T,S])=>{e!==(T===S)&&(g?g():xi(()=>g?.()),_(T))},{flush:f,deep:p,immediate:!0})})];return v!=null&&x.push(Bm(v,m).then(()=>tt(n)).finally(()=>(g?.(),tt(n)))),Promise.race(x)}function r(h){return t(d=>!!d,h)}function s(h){return i(null,h)}function o(h){return i(void 0,h)}function a(h){return t(Number.isNaN,h)}function l(h,d){return t(f=>{const p=Array.from(f);return p.includes(h)||p.includes(tt(h))},d)}function c(h){return u(1,h)}function u(h=1,d){let f=-1;return t(()=>(f+=1,f>=h),d)}
3964return Array.isArray(tt(n))?{toMatch:t,toContains:l,changed:c,changedTimes:u,get not(){return my(n,!e)}}:{toMatch:t,toBe:i,toBeTruthy:r,toBeNull:s,toBeNaN:a,toBeUndefined:o,changed:c,changedTimes:u,get not(){return my(n,!e)}}}function Z9(n){return my(n)}function DR(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t;let s=null;const o=Mt(!1);function a(){s&&(clearInterval(s),s=null)}function l(){o.value=!1,a()}function c(){const u=tt(e);u<=0||(o.value=!0,r&&n(),a(),o.value&&(s=setInterval(n,u)))}if(i&&ol&&c(),Xt(e)||typeof e=="function"){const u=Je(e,()=>{o.value&&ol&&c()});ks(u)}return ks(l),{isActive:ao(o),pause:l,resume:c}}function J9(n,e,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t,s=Mt(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&n(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,n(...u)},tt(e))}return i&&(s.value=!0,ol&&c()),ks(l),{isPending:ao(s),start:c,stop:l}}function Q9(n=1e3,e={}){const{controls:t=!1,callback:i}=e,r=J9(i??Fs,n,e),s=ge(()=>!r.isPending.value);return t?{ready:s,...r}:s}function kR(n,e,t){return Je(n,e,{...t,immediate:!0})}const ma=ol?window:void 0;function Yo(n){var e;const t=tt(n);return(e=t?.$el)!=null?e:t}function Ko(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),r=ge(()=>{const a=Rp(tt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),s=kR(()=>{var a,l;return[(l=(a=r.value)==null?void 0:a.map(c=>Yo(c)))!=null?l:[ma].filter(c=>c!=null),Rp(tt(r.value?n[1]:n[0])),Rp(L(r.value?n[2]:n[1])),tt(r.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!a?.length||!l?.length||!c?.length)return;const h=$9(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(f=>c.map(p=>i(d,f,p,h)))))},{flush:"post"}),o=()=>{s(),t()};return ks(t),o}function eG(){const n=Mt(!1),e=Gn();return e&&On(()=>{n.value=!0},e),n}function Ob(n){const e=eG();return ge(()=>(e.value,!!n()))}function Db(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:r=ma,once:s=!1}=e,o=Mt(!1),a=ge(()=>i?1e3/tt(i):null);let l=0,c=null;function u(f){if(!o.value||!r)return;l||(l=f);const p=f-l;if(a.value&&p<a.value){c=r.requestAnimationFrame(u);return}if(l=f,n({delta:p,timestamp:f}),s){o.value=!1,c=null;return}c=r.requestAnimationFrame(u)}function h(){!o.value&&r&&(o.value=!0,l=0,c=r.requestAnimationFrame(u))}function d(){o.value=!1,c!=null&&r&&(r.cancelAnimationFrame(c),c=null)}return t&&h(),ks(d),{isActive:ss(o),pause:d,resume:h}}function tG(n,e,t){var i;const{immediate:r=!0,delay:s=0,onError:o=(i=globalThis.reportError)!=null?i:Fs,onSuccess:a=Fs,resetOnExecute:l=!0,shallow:c=!0,throwError:u}=t??{},h=c?Mt(e):Te(e),d=Mt(!1),f=Mt(!1),p=Mt(void 0);async function v(y=0,...x){l&&(h.value=tt(e)),p.value=void 0,d.value=!1,f.value=!0,y>0&&await Bm(y);const _=typeof n=="function"?n(...x):n;try{const T=await _;h.value=T,d.value=!0,a(T)}catch(T){if(p.value=T,o(T),u)throw T}finally{f.value=!1}return h.value}r&&v(s);const m={state:h,isReady:d,isLoading:f,error:p,execute:v,executeImmediate:(...y)=>v(0,...y)};function g(){return new Promise((y,x)=>{Z9(f).toBe(!1).then(()=>y(m)).catch(x)})}return{...m,then(y,x){return g().then(y,x)}}}const nG=Symbol("vueuse-ssr-width");function iG(){const n=eu()?PR(nG,null):null;return typeof n=="number"?n:void 0}function FR(n,e={}){const{window:t=ma,ssrWidth:i=iG()}=e,r=Ob(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),s=Mt(typeof i=="number"),o=Mt(),a=Mt(!1),l=c=>{a.value=c.matches};return un(()=>{if(s.value){s.value=!r.value;const c=tt(n).split(",");a.value=c.some(u=>{const h=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),f=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||f);return d&&p&&(p=i>=PM(d[1])),f&&p&&(p=i<=PM(f[1])),h?!p:p});return}r.value&&(o.value=t.matchMedia(tt(n)),a.value=o.value.matches)}),Ko(o,"change",l,{passive:!0}),ge(()=>a.value)}function rG(n={}){const{window:e=ma}=n,t=Mt(1),i=FR(()=>`(resolution: ${t.value}dppx)`,n);let r=Fs;return e&&(r=kR(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:ss(t),stop:r}}function sG(n,e,t={}){const{window:i=ma,...r}=t;let s;const o=Ob(()=>i&&"ResizeObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=ge(()=>{const h=tt(n);return Array.isArray(h)?h.map(d=>Yo(d)):[Yo(h)]}),c=Je(l,h=>{if(a(),o.value&&i){s=new ResizeObserver(e);for(const d of h)d&&s.observe(d,r)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return ks(u),{isSupported:o,stop:u}}function oG(n,e={width:0,height:0},t={}){const{window:i=ma,box:r="content-box"}=t,s=ge(()=>{var h,d;return(d=(h=Yo(n))==null?void 0:h.namespaceURI)==null?void 0:d.includes("svg")}),o=Mt(e.width),a=Mt(e.height),{stop:l}=sG(n,([h])=>{const d=r==="border-box"?h.borderBoxSize:r==="content-box"?h.contentBoxSize:h.devicePixelContentBoxSize;if(i&&s.value){const f=Yo(n);if(f){const p=f.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(d){const f=Rp(d);o.value=f.reduce((p,{inlineSize:v})=>p+v,0),a.value=f.reduce((p,{blockSize:v})=>p+v,0)}else o.value=h.contentRect.width,a.value=h.contentRect.height},t);OR(()=>{const h=Yo(n);h&&(o.value="offsetWidth"in h?h.offsetWidth:e.width,a.value="offsetHeight"in h?h.offsetHeight:e.height)});const c=Je(()=>Yo(n),h=>{o.value=h?e.width:0,a.value=h?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function aG(n){var e;const t=Mt(0);if(typeof performance>"u")return t;const i=(e=n?.every)!=null?e:10;let r=performance.now(),s=0;return Db(()=>{if(s+=1,s>=i){const o=performance.now(),a=o-r;
3964t.value=Math.round(1e3/(a/s)),r=o,s=0}}),t}const lG={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function UR(n={}){const{reactive:e=!1,target:t=ma,aliasMap:i=lG,passive:r=!0,onEventFired:s=Fs}=n,o=Mn(new Set),a={toJSON(){return{}},current:o},l=e?Mn(a):a,c=new Set,u=new Set,h=new Set;function d(m,g){m in l&&(e?l[m]=g:l[m].value=g)}function f(){o.clear();for(const m of h)d(m,!1)}function p(m,g){var y,x;const _=(y=m.key)==null?void 0:y.toLowerCase(),S=[(x=m.code)==null?void 0:x.toLowerCase(),_].filter(Boolean);_&&(g?o.add(_):o.delete(_));for(const E of S)h.add(E),d(E,g);if(_==="shift"&&!g){const E=Array.from(u),M=E.indexOf("shift");E.forEach((b,w)=>{w>=M&&(o.delete(b),d(b,!1))}),u.clear()}else typeof m.getModifierState=="function"&&m.getModifierState("Shift")&&g&&[...o,...S].forEach(E=>u.add(E));_==="meta"&&!g?(c.forEach(E=>{o.delete(E),d(E,!1)}),c.clear()):typeof m.getModifierState=="function"&&m.getModifierState("Meta")&&g&&[...o,...S].forEach(E=>c.add(E))}Ko(t,"keydown",m=>(p(m,!0),s(m)),{passive:r}),Ko(t,"keyup",m=>(p(m,!1),s(m)),{passive:r}),Ko("blur",f,{passive:r}),Ko("focus",f,{passive:r});const v=new Proxy(l,{get(m,g,y){if(typeof g!="string")return Reflect.get(m,g,y);if(g=g.toLowerCase(),g in i&&(g=i[g]),!(g in l))if(/[+_-]/.test(g)){const _=g.split(/[+_-]/g).map(T=>T.trim());l[g]=ge(()=>_.map(T=>tt(v[T])).every(Boolean))}else l[g]=Mt(!1);const x=Reflect.get(m,g,y);return e?tt(x):x}});return v}function cG(n={}){const e=Te(),t=Ob(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;DR(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const NM="ping";function Lv(n){return n===!0?{}:n}function uG(n,e={}){const{onConnected:t,onDisconnected:i,onError:r,onMessage:s,immediate:o=!0,autoConnect:a=!0,autoClose:l=!0,protocols:c=[]}=e,u=Te(null),h=Mt("CLOSED"),d=Te(),f=NR(n);let p,v,m=!1,g=0,y=[],x,_;const T=()=>{if(y.length&&d.value&&h.value==="OPEN"){for(const P of y)d.value.send(P);y=[]}},S=()=>{x!=null&&(clearTimeout(x),x=void 0)},E=()=>{clearTimeout(_),_=void 0},M=(P=1e3,H)=>{S(),!(!ol&&!RM||!d.value)&&(m=!0,E(),p?.(),d.value.close(P,H),d.value=void 0)},b=(P,H=!0)=>!d.value||h.value!=="OPEN"?(H&&y.push(P),!1):(T(),d.value.send(P),!0),w=()=>{if(m||typeof f.value>"u")return;const P=new WebSocket(f.value,c);d.value=P,h.value="CONNECTING",P.onopen=()=>{h.value="OPEN",g=0,t?.(P),v?.(),T()},P.onclose=H=>{if(h.value="CLOSED",E(),p?.(),i?.(P,H),!m&&e.autoReconnect&&(d.value==null||P===d.value)){const{retries:B=-1,delay:G=1e3,onFailed:O}=Lv(e.autoReconnect);(typeof B=="function"?B:()=>typeof B=="number"&&(B<0||g<B))(g)?(g+=1,x=setTimeout(w,G)):O?.()}},P.onerror=H=>{r?.(P,H)},P.onmessage=H=>{if(e.heartbeat){E();const{message:B=NM,responseMessage:G=B}=Lv(e.heartbeat);if(H.data===tt(G))return}u.value=H.data,s?.(P,H)}};if(e.heartbeat){const{message:P=NM,interval:H=1e3,pongTimeout:B=1e3}=Lv(e.heartbeat),{pause:G,resume:O}=DR(()=>{b(tt(P),!1),_==null&&(_=setTimeout(()=>{M(),m=!1},B))},H,{immediate:!1});p=G,v=O}l&&(ol&&Ko("beforeunload",()=>M(),{passive:!0}),ks(M));const A=()=>{!ol&&!RM||(M(),m=!1,g=0,w())};return o&&A(),a&&Je(f,A),{data:u,status:h,close:M,send:b,open:A,ws:d}}function hG(n={}){const{window:e=ma,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:s=!0,type:o="inner"}=n,a=Mt(t),l=Mt(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:h,height:d,scale:f}
3964=e.visualViewport;a.value=Math.round(h*f),l.value=Math.round(d*f)}else s?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),OR(c);const u={passive:!0};if(Ko("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ko(e.visualViewport,"resize",c,u),r){const h=FR("(orientation: portrait)");Je(h,()=>c())}return{width:a,height:l}}const dG="@tresjs/core",fG="module",pG="5.1.0",mG="[email protected]",gG="Declarative ThreeJS using Vue Components",vG="Alvaro Saburido <[email protected]> (https://github.com/alvarosabu/)",xG="MIT",yG={type:"git",url:"git+https://github.com/Tresjs/tres.git",directory:"packages/core"},_G=["vue","3d","threejs","three","threejs-vue"],bG=!1,wG={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",default:"./dist/tres.js"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},SG="./dist/tres.js",MG="./dist/index.d.ts",TG=["*.d.ts","dist"],EG={access:"public"},AG={build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix",typecheck:"vue-tsc --noEmit"},CG={three:">=0.133",vue:">=3.4"},RG={"@pmndrs/pointer-events":"^6.6.17","@vue/devtools-api":"^7.7.2","@vueuse/core":"catalog:",radashi:"^12.6.2"},PG={"@tresjs/eslint-config":"workspace:*","@types/three":"catalog:","@typescript-eslint/eslint-plugin":"catalog:","@typescript-eslint/parser":"catalog:","@vitejs/plugin-vue":"catalog:","@vitest/coverage-v8":"3.2.4","@vitest/ui":"catalog:","@vue/test-utils":"catalog:",eslint:"catalog:","eslint-plugin-vue":"catalog:",jsdom:"catalog:",kolorist:"catalog:",pathe:"catalog:","rollup-plugin-analyzer":"catalog:","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"catalog:",three:"catalog:",vite:"catalog:","vite-plugin-banner":"catalog:","vite-plugin-dts":"catalog:","vite-plugin-inspect":"^11.3.3",vitest:"catalog:",vue:"catalog:","vue-demi":"^0.14.10","vue-tsc":"catalog:"},IG={implicitDependencies:["!@tresjs/core-*"]},NG={name:dG,type:fG,version:pG,packageManager:mG,description:gG,author:vG,license:xG,repository:yG,keywords:_G,sideEffects:bG,exports:wG,module:SG,types:MG,files:TG,publishConfig:EG,scripts:AG,peerDependencies:CG,dependencies:RG,devDependencies:PG,nx:IG};function LG(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const OG="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",DG=LG(OG);function LM(n){var e;const t=((e=n?.replace(/([A-Z])+/g,kG))==null?void 0:e.split(/(?=[A-Z])|[\.\-\s_]/).map(i=>i.toLowerCase()))??[];return t.length===0?"":t.length===1?t[0]:t.reduce((i,r)=>`${i}${r.charAt(0).toUpperCase()}${r.slice(1)}`)}function kG(n){if(!n||n.length===0)return"";const e=n.toLowerCase();return e.substring(0,1).toUpperCase()+e.substring(1,e.length)}function BR(n,e){if(Object.is(n,e))return!0;if(n instanceof Date&&e instanceof Date)return n.getTime()===e.getTime();if(n instanceof RegExp&&e instanceof RegExp)return n.toString()===e.toString();if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;const t=Reflect.ownKeys(n),i=Reflect.ownKeys(e);if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(!Reflect.has(e,t[r])||!BR(n[t[r]],e[t[r]]))return!1;return!0}function Ga(n){return typeof n=="function"}function zR(n){return typeof n=="number"&&!Number.isNaN(n)}function kb(n){return FG(n,"[object Object]")}function Fb(n){return typeof n=="string"}function FG(n,e){return Object.prototype.toString.call(n)===e}function gy(n){return typeof n>"u"}const zr=n=>e=>kb(e)&&n in e&&!!e[n],vy=zr("isObject3D"),VR=zr("isMesh"),HR=zr("isCamera"),UG=zr("isOrthographicCamera"),GR=zr("isPerspectiveCamera"),WR=zr("isColor"),BG=n=>Fb(n)||zR(n)||WR(n),OM=n=>n instanceof md,$R=zr("isBufferGeometry"),jR=zr("isMaterial"),zG=zr("isLight"),qR=zr("isFog"),XR=zr("isScene"),xy=n=>n!==null&&typeof n=="object"&&"set"in n&&typeof n.set=="function",VG=n=>xy(n)&&"copy"in n&&typeof n.copy=="function",HG=n=>!!n?.constructor,yc=n=>
3964HR(n)||UG(n)||GR(n),GG=n=>vy(n)||$R(n)||jR(n)||qR(n),WG=zr("isPrimitive"),$G=n=>GG(n)&&"__tres"in n,jG=(n,e)=>{let t=0;for(let i=0;i<n.length;i++)e(n[i],i)&&(n[t]=n[i],t++);return n.length=t,n},zm="[TresJS ▲ ■ ●] ";function ia(...n){typeof n[0]=="string"?n[0]=zm+n[0]:n.unshift(zm),console.error(...n)}function qG(...n){typeof n[0]=="string"?n[0]=zm+n[0]:n.unshift(zm),console.warn(...n)}function DM(n){(e=>"map"in e&&!!e.map)(n)&&n.map.dispose(),n.dispose()}function Vm(n){if(n.parent&&n.removeFromParent?.(),delete n.__tres,[...n.children].forEach(e=>Vm(e)),!(n instanceof vl)){const e=n;n&&n.dispose?.(),e.geometry&&e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach(t=>DM(t)):e.material&&DM(e.material)}}function Hm(n,e){let t=n;if(e.includes("-")){const i=e.split("-");let r=i.shift();for(;t&&i.length;)r in t?(t=t[r],r=i.shift()):r=kM(r,i.shift());return{target:t,key:kM(r,...i)}}else return{target:t,key:e}}function kM(...n){return n.map((e,t)=>t===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}function XG(n,e,t){const i=/-\d+$/;if(Fb(t)){if(i.test(t)){const o=t.replace(i,""),{target:a,key:l}=Hm(n,o);if(!Array.isArray(a[l])){const c=a[l],u=[];u.__tresDetach=()=>{u.every(h=>gy(h))&&(a[l]=c)},a[l]=u}}const{target:r,key:s}=Hm(n,t);e.__tres.previousAttach=r[s],r[s]=Wc(e)}else e.__tres.previousAttach=t(n,e)}function YG(n,e,t){if(Fb(t)){const{target:i,key:r}=Hm(n,t),s=e.__tres.previousAttach;s===void 0?delete i[r]:i[r]=s,"__tresDetach"in i&&i.__tresDetach()}else e.__tres?.previousAttach?.(n,e);delete e.__tres?.previousAttach}function Va(n,e,t){const i=n;return i.__tres={type:"unknown",root:t,memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(jR(i)?i.__tres.attach="material":$R(i)?i.__tres.attach="geometry":qR(i)&&(i.__tres.attach="fog")),i}function yy(n){const e=n?.__tres?.root;e?.renderer&&e.renderer.canBeInvalidated.value&&e.renderer.invalidate()}function KG(n,e,t,i,r){const s=[...e.__tres.objects],o=Wc(e);if(n=Wc(n),o===n)return!0;const a=Va(n,e.__tres??{},r),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of s)YR(u,r),KR(u,r);o.__tres.objects=[],i.remove(e);for(const[u,h]of Object.entries(c))i.patchProp(a,u,a[u],h);t(n),i.insert(e,l);for(const u of s)i.insert(u,e);return!0}function Wc(n){if(WG(n)){const e=n;return e.object.__tres=e.__tres,e.object}else return n}function YR(n,e){const t=n.__tres?.parent||e.scene.value;n.__tres&&(n.__tres.parent=null),t&&t.__tres&&"objects"in t.__tres&&jG(t.__tres.objects,i=>i!==n),n.__tres?.attach?YG(t,n,n.__tres.attach):(n.parent?.remove?.(Wc(n)),n.parent=null)}function KR(n,e){n.traverse?.(t=>{yc(t)&&e.camera.deregisterCamera(t)}),yc(n)&&e.camera.deregisterCamera(n),yy(n)}function ZG(n,e,t){const i=new n(t?.manager),r=Mn({loaded:0,total:0,percentage:0});t?.extensions&&t.extensions(i);const s=tt(e),o=tG(l=>new Promise((c,u)=>{const h=l||s||"";i.load(h,d=>{c(d)},d=>{r.loaded=d.loaded,r.total=d.total,r.percentage=r.loaded/r.total*100},d=>{u(d)})}),t?.initialValue??null,{...t?.asyncOptions,immediate:t?.asyncOptions?.immediate??!0}),a=Je(()=>tt(e),l=>{if(l){const c=o.state.value;c&&typeof c=="object"&&"scene"in c&&c.scene&&Vm(c.scene),o.execute(0,l)}});return di(()=>{a();const l=o.state.value;l&&typeof l=="object"&&"scene"in l&&l.scene&&Vm(l.scene)}),{...o,load:l=>{o.execute(0,l)},progress:r}}const JG=({sizes:n})=>{const e=Te([]),t=ge(()=>e.value[0]),i=o=>{const a=HR(o)?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},r=(o,a=!1)=>{e.value.some(({uuid:l})=>l===o.uuid)||(e.value.push(o),a&&i(o.uuid))},s=o=>{e.value=e.value.filter(({uuid:a})=>a!==o.uuid)};return un(()=>{n.aspectRatio.value&&e.value.forEach(o=>{GR(o)&&(o.aspect=n.aspectRatio.value,o.updateProjectionMatrix())})}),{activeCamera:t,cameras:e,registerCamera:r,deregisterCamera:s,setActiveCamera:i}};function FM(){const n=new Map,e=new Set;let t=0,i=!1;const r=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},s=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>s(o);return ks(l),i=!0,{off:l}},off:s,trigger:(...o)=>(i&&(r(),i=!1),Promise.all(Array.from(e).map(a=>a(...o)))),dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}const _y=Te({}),by=n=>Object.assign(_y.value,n),QG=(n,e,t)=>{if(!Ga(n.setPixelRatio))return;let i=0;if(t&&Array.isArray(t)&&t.length>=2){const[r,s]=t;i=pd.clamp(e,r,s)}else zR(t)?i=t:i=e;i!==n.getPixelRatio?.()&&n.setPixelRatio(i)},e7=n=>
3964{const e=new Ab,t={before:qh(),after:qh()},{pause:i,resume:r,isActive:s}=Db(()=>{const o=()=>({delta:e.getDelta(),elapsed:e.elapsedTime});t.before.trigger(o()),n(),t.after.trigger(o())},{immediate:!1});return{start:()=>{e.start(),r()},stop:()=>{e.stop(),i()},isActive:s,onBeforeLoop:t.before.on,onLoop:t.after.on}};function t7({scene:n,canvas:e,options:t,contextParts:{sizes:i,camera:r}}){const s=Ga(t.renderer)?t.renderer({sizes:i,scene:n,camera:r,canvas:e}):new Nb({...t,canvas:Yo(e)}),o=Te(tt(t.renderMode)==="manual"?0:1),a=60,l=ge(()=>tt(t.renderMode)==="on-demand"&&o.value===0),c=()=>n.value.traverse(M=>{M instanceof an&&M.material instanceof si&&(M.material.needsUpdate=!0)}),u=(M=1)=>{l.value&&(o.value=Math.min(a,o.value+M))},h=()=>{if(tt(t.renderMode)!=="manual")throw new Error("advance can only be called in manual render mode.");o.value=1},d=()=>{tt(t.renderMode)==="on-demand"&&u()},f=ge(()=>tt(t.renderMode)==="always"),p=M=>kb(M)&&"isRenderer"in M&&!!M.isRenderer,v=qh();let m=!1;p(s)&&(s.init(),v.trigger(s));const g=qh(),y=()=>{o.value=f.value?1:Math.max(0,o.value-1),g.trigger(s)};let x=M=>{r.activeCamera.value&&(s.render(n.value,r.activeCamera.value),M())};const _=M=>{x=M},T=e7(()=>{o.value&&x(y)});v.on(T.start),Je([i.width,i.height],()=>{s.setSize(i.width.value,i.height.value),!m&&s.domElement.width&&s.domElement.height&&(v.trigger(s),m=!0),d()},{immediate:!0});const{pixelRatio:S}=rG();un(()=>{QG(s,S.value,tt(t.dpr))}),tt(t.renderMode)==="on-demand"&&u(),tt(t.renderMode)==="manual"&&Q9(100,{callback:h});const E=ge(()=>{const M=tt(t.clearColor),b=tt(t.clearAlpha),w=typeof M=="string"&&M.length===9&&M.startsWith("#");return w&&b!==void 0&&qG(`clearColor with alpha (e.g. ${M}) and clearAlpha cannot both be set, using clearColor as source of truth`),w?{alpha:Number.parseInt(M.slice(7,9),16)/255,color:M.slice(0,7)}:{alpha:b,color:M}});return un(()=>{const M=E.value;M.color===void 0||M.alpha===void 0||s.setClearColor(M.color,M.alpha)}),un(()=>{const M=t.toneMapping;M&&(s.toneMapping=M)}),un(()=>{const M=t.toneMappingExposure;M&&(s.toneMappingExposure=M)}),un(()=>{const M=t.outputColorSpace;M&&(s.outputColorSpace=M)}),un(()=>{const M=t.shadows;M!==void 0&&(s.shadowMap.enabled=M,c())}),un(()=>{const M=t.shadowMapType;M!==void 0&&(s.shadowMap.type=M,c())}),di(()=>{s.dispose(),"forceContextLoss"in s&&s.forceContextLoss()}),{loop:T,instance:s,advance:h,onReady:v.on,onRender:g.on,invalidate:u,canBeInvalidated:l,mode:tt(t.renderMode),replaceRenderFunction:_}}function n7(n,e,t=10){const i=tt(n)?hG():oG(ge(()=>tt(e).parentElement)),r=ss(IM(i.width,t)),s=ss(IM(i.height,t)),o=ge(()=>r.value/s.value);return{height:s,width:r,aspectRatio:o}}class i7{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 Ov=new z;class ki extends i7{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}
3964get currentTarget(){return this.currentObject}get eventObject(){return this.currentObject}get srcElement(){return this.currentObject}_pointer;get pointer(){return this._pointer==null&&(Ov.copy(this.intersection.point).project(this.camera),this._pointer=new de(Ov.x,Ov.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 Ds(this.intersection.pointerPosition,new z(0,0,-1).applyQuaternion(this.intersection.pointerQuaternion));case"lines":return this._ray=new Ds(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 z(e.x,e.y,0).unproject(this.camera)}return this._unprojectedPoint}get stopped(){return this.propagationState.stoppedImmediate||this.prop
3964agationState.stopped}get stoppedImmediate(){return this.propagationState.stoppedImmediate}get delta(){throw new Error("not supported")}constructor(e,t,i,r,s,o,a=s.object,l=a,c={stopped:!t,stoppedImmediate:!1}){super(i),this.type=e,this.bubbles=t,this.internalPointer=r,this.intersection=s,this.camera=o,this.currentObject=a,this.object=l,this.propagationState=c}stopPropagation(){this.propagationState.stopped=!0}stopImmediatePropagation(){this.propagationState.stoppedImmediate=!0}retarget(e){return new ki(this.type,this.bubbles,this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target,this.propagationState)}}class Gm extends ki{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s,o){super("wheel",!0,e,t,i,r,s,o)}retarget(e){return new Gm(this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target)}}function Qi(n){ZR(n,n.currentObject)}function ZR(n,e){if(e==null)return;const t=s7(e,n.type);if(t!=null&&t.length>0){const i=n.retarget(e),r=t.length;for(let s=0;s<r&&!i.stoppedImmediate;s++)t[s](i)}n.stopped||ZR(n,e.parent)}const JR={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"},r7=Object.keys(JR);function s7(n,e){if(n._listeners!=null&&e in n._listeners)return n._listeners[e];let t;if(n.isVoidObject&&e==="click"&&n.parent?.__r3f!=null&&(t=n.parent.__r3f.root.getState().onPointerMissed),n.__r3f!=null&&(t=n.__r3f.handlers[JR[e]]),t!=null)return[t]}const o7=1e10,a7=new su(o7),UM=new Map;function QR(n){let e=UM.get(n);return e==null&&(e=new an(a7),e.isVoidObject=!0,e.parent=n,e.pointerEventsOrder=-1/0,UM.set(n,e)),e}function l7(n,e,t){const i=e.normal??e.face?.normal;return i==null?!1:(n.setFromNormalAndCoplanarPoint(i,e.localPoint),n.applyMatrix4(t),!0)}function c7(n,e,t){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return({id:s,type:o,state:a})=>t(s,o,a);let i,r;return"deny"in t?(r=!0,i=t.deny):(r=!1,i=t.allow),Array.isArray(i)?s=>BM(i.includes(s.type),r):s=>BM(i===s.type,r)}function BM(n,e){return e?!n:n}function eP(n,e,t,i=!1,r,s,o){const a=i||u7(n,e),l=e.pointerEvents??r,c=l??e.defaultPointerEvents??"listener",u=e.pointerEventsType??s??"all",h=e.pointerEventsOrder??o??0,d=c7(a,c,u),f=t.length;if(f===1)(d===!0||typeof d=="function"&&d(t[0]))&&Dv(t[0],e,c,u,h);else if(d===!0)for(let m=0;m<f;m++)Dv(t[m],e,c,u,h);else if(typeof d=="function")for(let m=0;m<f;m++){const g=t[m];d(g)&&Dv(g,e,c,u,h)}if(e.children.length===0||e.intersectChildren===!1)return;const p=e.interactableDescendants??e.children,v=p.length;for(let m=0;m<v;m++)eP(n,p[m],t,a,l,u,h)}function u7(n,e){if(e.ancestorsHaveListeners||n==="pointer"&&e.ancestorsHavePointerListeners||n==="wheel"&&e.ancestorsHaveWheelListeners||e.__r3f!=null&&e.__r3f?.eventCount>0&&(n==="wheel"&&e.__r3f.handlers.onWheel!=null||n==="pointer"&&Object.keys(e.__r3f.handlers).some(r=>r!="onWheel")))return!0;if(e._listeners==null)return!1;if(n==="wheel"){const r=e._listeners.wheel;return r!=null&&r.length>0}const t=Object.entries(e._listeners),i=t.length;for(let r=0;r<i;r++){const s=t[r];if(s[0]!=="wheel"&&r7.includes(s[0])&&s[1]!=null&&s[1].length>0)return!0}return!1}function Dv({intersector:n,options:e},t,i,r,s){e.filter?.(t,i,r,s)!==!1&&n.executeIntersection(t,s)}function h7(n,e,{customSort:t=d7}={},i){let r,s,o;const a=n.length;for(let l=0;l<a;l++){const c=n[l],u=e?.[l];(r==null||t(c,u,r,s)<0)&&(o=l,r=c,s=u)}return o}function d7(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const zM=1e7;function f7(n,e,t,i,r,s=0){const o=e.direction.clone().multiplyScalar(zM),a=zM;return{distance:a+s,object:QR(n),point:o,normal:e.origin.clone().sub(o).normalize(),details:t(o,a),pointerPosition:i,pointerQuaternion:r,pointOnFace:o,localPoint:o}}function p7(n,e,t){for(;t>0;)n.push(e),--t}const kv=Symbol("buttonsDownTime"),m7=Symbol("buttonsClickTime");globalThis.pointerEventspointerMap??=new Map;Dt.prototype.setPointerCapture=function(n){Ub(n)?.setCapture(this)};Dt.prototype.releasePointerCapture=function(n){const e=Ub(n);e==null||!e.hasCaptured(this)||e.setCapture(void 0)};Dt.prototype.hasPointerCapture=function(n){return Ub(n)?.hasCaptured(this)??!1};function Ub(n){return globalThis.pointerEventspointerMap?.get(n)}let g7=class{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,i,r,s,o,a,l,c={}){this.id=e,this.type=t,this.state=i,this.intersector=r,this.getCamera=s,this.onMoveCommited=o,this.parentSetPointerCapture=a,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.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),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,i=!0){this.enabled!==e&&(!e&&this.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),this.enabled=e,i&&this.commit(t,!1))}computeIntersection(e,t,i){return this.pointerCapture!=null?this.intersector.intersectPointerCapture(this.pointerCapture,i):(this.intersector.startIntersection(i),eP(e,t,[this]),this.intersector.finalizeIntersection(t))}setIntersection(e){this.intersection=e}commit(e,t){const i=this.getCamera(),r=this.prevEnabled?this.prevIntersection:void 0,s=this.enabled?this.intersection:void 0;
3964r!=null&&r.object!=s?.object&&Qi(new ki("pointerout",!0,e,this,r,i));const o=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,tP(s?.object,this.pointerEntered,o,this.pointerEnteredHelper);const a=o.length;for(let l=0;l<a;l++){const c=o[l];Qi(new ki("pointerleave",!1,e,this,r,i,c))}s!=null&&r?.object!=s.object&&Qi(new ki("pointerover",!0,e,this,s,i));for(let l=this.pointerEnteredHelper.length-1;l>=0;l--){const c=this.pointerEnteredHelper[l];Qi(new ki("pointerenter",!1,e,this,s,i,c))}if(t&&s!=null&&Qi(new ki("pointermove",!0,e,this,s,i)),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](i);this.onFirstMove.length=0}this.onMoveCommited?.(this)}move(e,t){this.intersection=this.computeIntersection("pointer",e,t),this.commit(t,!0)}emitMove(e){this.intersection!=null&&Qi(new ki("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;Qi(new ki("pointerdown",!0,e,this,this.intersection,this.getCamera()));const{object:t}=this.intersection;t[kv]??=new Map,t[kv].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:i=2,dblClickThresholdMs:r=500,clickThresholdMs:s=t??300}=this.options;this.pointerCapture=void 0;const o=v7(this.buttonsDownTime,this.intersection.object[kv],e.button,e.timeStamp,s),a=this.getCamera();if(o&&e.button===i&&Qi(new ki("contextmenu",!0,e,this,this.intersection,a)),Qi(new ki("pointerup",!0,e,this,this.intersection,a)),!o||e.button===i)return;Qi(new ki("click",!0,e,this,this.intersection,a));const{object:l}=this.intersection,c=l[m7]??=new Map,u=c.get(e.button);if(u==null||e.timeStamp-u>r){c.set(e.button,e.timeStamp);return}Qi(new ki("dblclick",!0,e,this,this.intersection,a)),c.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&Qi(new ki("pointercancel",!0,e,this,this.intersection,this.getCamera()))}}wheel(e,t,i=!1){if(!this.enabled)return;if(!this.wasMoved&&i){this.onFirstMove.push(this.wheel.bind(this,e,t,i));return}i||(this.wheelIntersection=this.computeIntersection("wheel",e,t));const r=i?this.intersection:this.wheelIntersection;r!=null&&Qi(new Gm(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 i=t?this.intersection:this.wheelIntersection;i!=null&&Qi(new Gm(e,this,i,this.getCamera()))}exit(e){this.wasMoved&&(this.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}};function tP(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),tP(n.parent,e,t,i)}function v7(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}const ku=new Ei,Fv=new Ei,VM=new de,HM=new de,GM=new de,Uv=new z,x7=new ht,Vf=new z;function y7(n,e,t){Vf.copy(e).applyMatrix4(x7.copy(t.matrixWorld).invert());const i=t.geometry.attributes.uv;if(i==null||!(i instanceof Jt))return!1;let r;return _7(t,(s,o,a)=>{t.getVertexPosition(s,ku.a),t.getVertexPosition(o,ku.b),t.getVertexPosition(a,ku.c);const l=ku.closestPointToPoint(Vf,Uv).distanceTo(Vf);r!=null&&l>=r||(r=l,Fv.copy(ku),VM.fromBufferAttribute(i,s),HM.fromBufferAttribute(i,o),GM.fromBufferAttribute(i,a))}),r==null?!1:(Fv.closestPointToPoint(Vf,Uv),Fv.getInterpolation(Uv,VM,HM,GM,n),!0)}function _7(n,e){const t=n.geometry.drawRange;if(n.geometry.index!=null){const o=n.geometry.index,a=Math.max(0,t.start),l=
3964Math.min(o.count,t.start+t.count);for(let c=a;c<l;c+=3)e(o.getX(c),o.getX(c+1),o.getX(c+2));return}const i=n.geometry.attributes.position;if(i==null)return;const r=Math.max(0,t.start),s=Math.min(i.count,t.start+t.count);for(let o=r;o<s;o+=3)e(o,o+1,o+2)}new ht;new wR;new z;new sr;new Ds;new de;new z(0,0,0),new z(0,0,1);const WM=new ht,b7=new z;new z(0,0,-1);new sr;const $M=new de,w7=new z;class S7{prepareTransformation;options;raycaster=new Pb;cameraQuaternion=new ui;fromPosition=new z;fromQuaternion=new ui;coords=new de;viewPlane=new sr;intersects=[];pointerEventsOrders=[];constructor(e,t){this.prepareTransformation=e,this.options=t}isReady(){return!0}intersectPointerCapture({intersection:e,object:t},i){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(i))return e;this.viewPlane.constant-=r.distanceViewPlane;const s=this.raycaster.ray.intersectPlane(this.viewPlane,new z);if(s==null)return e;e.object.updateWorldMatrix(!0,!1),l7(this.viewPlane,e,e.object.matrixWorld);let o=e.uv;return e.object instanceof an&&y7($M,s,e.object)&&(o=$M.clone()),{...e,details:{...r,direction:this.raycaster.ray.direction.clone(),screenPoint:this.coords.clone()},uv:o,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,b7),this.raycaster.setFromCamera(this.coords,t),this.viewPlane.setFromNormalAndCoplanarPoint(t.getWorldDirection(w7),this.raycaster.ray.origin),!0)}executeIntersection(e,t){const i=this.intersects.length;e.raycast(this.raycaster,this.intersects),p7(this.pointerEventsOrders,t,this.intersects.length-i)}finalizeIntersection(e){const t=this.fromPosition.clone(),i=this.cameraQuaternion.clone(),r=this.raycaster.ray.direction.clone(),s=h7(this.intersects,this.pointerEventsOrders,this.options),o=s==null?void 0:this.intersects[s];return this.intersects.length=0,this.pointerEventsOrders.length=0,o==null?f7(e,this.raycaster.ray,(a,l)=>({type:"screen-ray",distanceViewPlane:l,screenPoint:this.coords.clone(),direction:r}),t,i):(o.object.updateWorldMatrix(!0,!1),WM.copy(o.object.matrixWorld).invert(),Object.assign(o,{details:{type:"screen-ray",distanceViewPlane:this.viewPlane.distanceToPoint(o.point),screenPoint:this.coords.clone(),direction:r},pointOnFace:o.point,pointerPosition:t,pointerQuaternion:i,localPoint:o.point.clone().applyMatrix4(WM)}))}}new z;new de;new ht;new z;new sr;new hi;new z;new z;new z;new z(1e-4,1e-4,1e-4);new ht;let M7=23412;function T7(){return M7++}function E7(n,e,t){if(!(e instanceof globalThis.MouseEvent))return t.set(0,0);const{width:i,height:r,top:s,left:o}=n.getBoundingClientRect(),a=e.clientX-o,l=e.clientY-s;return t.set(a/i*2-1,-(l/r)*2+1)}function A7(n,e,t,i){return C7(n,typeof e=="function"?e:()=>e,t,E7.bind(null,n),n.setPointerCapture.bind(n),r=>{n.hasPointerCapture(r)&&n.releasePointerCapture(r)},{pointerTypePrefix:"screen-",...i})}function C7(n,e,t,i,r,s,o={}){const a=o?.forwardPointerCapture??!0,l=new Map,c=o.pointerTypePrefix??"forward-",u=(E,M)=>{let b=l.get(E.pointerId);return b!=null||(b=new g7(T7(),`${c}${E.pointerType}`,E.pointerState,new S7((w,A)=>(i(w,A),e()),o),e,void 0,a?r.bind(null,E.pointerId):void 0,a?s.bind(null,E.pointerId):void 0,o),M!="move"&&M!="wheel"&&(b.setIntersection(b.computeIntersection("pointer",t,E)),b.commit(E,!1)),l.set(E.pointerId,b)),b},h=new Map,d=new Map,f=[],p=[],v=(E,M,b)=>{switch(E){case"move":b.move(t,M);return;case"wheel":b.wheel(t,M);return;case"cancel":b.cancel(M);return;case"down":if(!jM(M))return;b.down(M);return;case"up":if(!jM(M))return;b.up(M);return;case"exit":d.delete(b),h.delete(b),b.exit(M);return}},m=(E,M)=>{const b=u(M,E);E==="move"&&d.set(b,M),E==="wheel"&&h.set(b,M),o.batchEvents??!0?p.push({type:E,event:M}):v(E,M,b)},g=m.bind(null,"move"),y=m.bind(null,"cancel"),x=m.bind(null,"down"),_=m.bind(null,"up"),T=m.bind(null,"wheel"),S=m.bind(null,"exit");return n.addEventListener("pointermove",g),n.addEventListener("pointercancel",
3964y),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",_),n.addEventListener("wheel",T),n.addEventListener("pointerleave",S),{destroy(){n.removeEventListener("pointermove",g),n.removeEventListener("pointercancel",y),n.removeEventListener("pointerdown",x),n.removeEventListener("pointerup",_),n.removeEventListener("wheel",T),n.removeEventListener("pointerleave",S),d.clear(),h.clear()},update(){const E=p.length;for(let M=0;M<E;M++){const{type:b,event:w}=p[M],A=u(w,b);if(b==="move"&&(f.push(A),d.get(A)!=w)){A.emitMove(w);continue}if(b==="wheel"&&h.get(A)!=w){A.emitWheel(w);continue}v(b,w,A)}if(p.length=0,o.intersectEveryFrame??!1)for(const[M,b]of d.entries())f.includes(M)||M.move(t,b);f.length=0}}}function jM(n){return n.button!=null}function R7({canvas:n,contextParts:{scene:e,camera:t,renderer:i}}){const{update:r,destroy:s}=A7(tt(n),()=>tt(t.activeCamera),e.value),{off:o}=i.loop.onLoop(r);di(s),di(o);const a=QR(e.value),l=qh();return a.addEventListener("click",l.trigger),{onPointerMissed:l.on}}const P7="useTres",[I7,N7]=V9(({scene:n,canvas:e,windowSize:t,rendererOptions:i})=>{const r=Mt(n),s=n7(t,e),o=JG({sizes:s}),a=t7({scene:r,canvas:e,options:i,contextParts:{sizes:s,camera:o}}),l=R7({canvas:e,contextParts:{scene:r,camera:o,renderer:a}}),c={sizes:s,scene:r,camera:o,renderer:a,controls:Te(null),extend:by,events:l};return c.scene.value.__tres={root:c},c},{injectionKey:"useTres"}),au=()=>{const n=N7();if(!n)throw new Error(`useTresContext must be used together with useTresContextProvider.
3965 You probably tried to use it above or on the same level as a TresCanvas component.
3966 It should be used in child components of a TresCanvas instance.`);return n};function El(){const{scene:n,renderer:e,camera:t,sizes:i,controls:r,extend:s,events:o}=au();return{scene:n,renderer:e.instance,camera:t.activeCamera,sizes:i,controls:r,extend:s,events:o,invalidate:e.invalidate,advance:e.advance}}const us=()=>{const n=El(),{renderer:e}=au(),t=FM(),i=FM();e.loop.onBeforeLoop(s=>{t.trigger({...n,...s})}),e.loop.onLoop(s=>{i.trigger({...n,...s})});const r=e.replaceRenderFunction;return{stop:e.loop.stop,start:e.loop.start,isActive:e.loop.isActive,onBeforeRender:t.on,onRender:i.on,render:r}};function L7(n,e={},t={}){let i=n;const r=a=>{i=a};let s=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){return t[l]?t[l](c,i,s,r):i[l]=c,!0}};return s=new Proxy({},o),s}const O7=["onClick","onContextmenu","onPointermove","onPointerenter","onPointerleave","onPointerover","onPointerout","onDblclick","onPointerdown","onPointerup","onPointercancel","onLostpointercapture","onWheel"],D7={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"},qM=n=>O7.includes(n),k7=n=>{const e=n.scene.value;function t(u,h,d,f){if(f||(f={}),f.args||(f.args=[]),DG(u))return null;u.includes("-")&&(u=u.replace(/-([a-z])/g,(m,g)=>g.toUpperCase()).replace(/^[a-z]/,m=>m.toUpperCase()));let p=u.replace("Tres",""),v;if(u==="primitive"){(!kb(f.object)||Xt(f.object))&&ia("Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"),p=f.object.type;const m={};v=L7(f.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>m},{object:(g,y,x,_)=>{KG(g,x,_,{patchProp:s,remove:r,insert:i},n)},__tres:g=>{Object.assign(m,g)}})}else{const m=_y.value[p];m||ia(`${p} is not defined on the THREE namespace. Use extend to add it to the catalog.`),v=new m(...f.args)}return v?(yc(v)&&(f?.position||v.position.set(3,3,3),f?.lookAt||v.lookAt(0,0,0)),v=Va(v,{...$G(v)?v.__tres:{},type:p,memoizedProps:f,primitive:u==="primitive",attach:f.attach},n),v):null}function i(u,h){if(!u)return;h=h||e;const d=u.__tres?u:Va(u,{},n),f=h.__tres?h:Va(h,{},n);u=Wc(d),h=Wc(f),yc(u)&&n.camera?.registerCamera(u),d.__tres.attach?XG(f,d,d.__tres.attach):vy(u)&&vy(f)&&(f.add(u),u.dispatchEvent({type:"added"})),d.__tres.parent=f,f.__tres.objects&&!f.__tres.objects.includes(d)&&f.__tres.objects.push(d)}function r(u,h){if(!u)return;h=gy(h)?"default":h;const d=u.__tres?.dispose;gy(d)||(d===null?h=!1:h=d);const f=u.__tres?.primitive,p=h==="default"?!f:!!h;
3966if(u.__tres&&"objects"in u.__tres&&[...u.__tres.objects].forEach(v=>r(v,h)),p&&u.children&&[...u.children].forEach(v=>r(v,h)),YR(u,n),KR(u,n),p&&!XR(u)){if(Ga(h))h(u);else if(Ga(u.dispose))try{u.dispose()}catch{}}"__tres"in u&&delete u.__tres}function s(u,h,d,f){if(!u)return;let p=u;const v=h;if(u.__tres&&(u.__tres.memoizedProps[h]=f),h==="attach"){const x=u.__tres?.parent||u.parent;r(u),Va(u,{attach:f},n),x&&i(u,x);return}if(h==="dispose"){u.__tres||(u=Va(u,{},n)),u.__tres.dispose=f;return}qM(h)&&Ga(f)&&u.addEventListener(D7[h],f);let m=LM(v),g=p?.[m];if(v==="args"){const x=u,_=d??[],T=f??[],S=u.__tres?.type||u.type;if(S&&_.length&&!BR(_,T)){const E=new _y.value[S](...f),M=Object.getOwnPropertyDescriptors(E);Object.entries(M).forEach(([b,w])=>{if(!(!w.writable&&!w.set)&&b in x)try{x[b]=E[b]}catch(A){console.warn(`Could not set property ${b} on ${S}:`,A)}}),p=x}return}if(p.type==="BufferGeometry"){if(v==="args")return;p.setAttribute(LM(v),new Jt(...f));return}if(v.includes("-")&&g===void 0){const x=Hm(p,v);if(g=x.target,p=x.target,m=x.key,g&&m){g[m]=f,yc(u)&&u.updateProjectionMatrix(),yy(u);return}}let y=f;if(y===""&&(y=!0),Ga(g)){qM(h)||(Array.isArray(y)?u[m](...y):u[m](y)),m.startsWith("on")&&Ga(y)&&(p[m]=y);return}OM(g)&&OM(y)?g.mask=y.mask:WR(g)&&BG(y)?g.set(y):VG(g)&&HG(y)&&g.constructor===y.constructor?g.copy(y):xy(g)&&Array.isArray(y)?"fromArray"in g&&typeof g.fromArray=="function"?g.fromArray(y):g.set(...y):xy(g)&&typeof y=="number"?"setScalar"in g&&typeof g.setScalar=="function"?g.setScalar(y):g.set(y):p[m]=y,yc(u)&&u.updateProjectionMatrix(),yy(u)}function o(u){return u?.__tres?.parent||null}function a(u){const h=Va(new Dt,{type:"Comment"},n);return h.name=u,h}function l(u){const h=o(u)?.__tres?.objects||[],d=h.indexOf(u);return d<0||d>=h.length-1?null:h[d+1]}const c=()=>{};return{insert:i,remove:r,createElement:t,patchProp:s,parentNode:o,createText:c,createComment:a,setText:c,setElementText:c,nextSibling:l,querySelector:c,setScopeId:c,cloneNode:c,insertStaticContent:c}},F7=["asset-load"];class U7{subscribers=new Set;messageQueue=[];maxQueueSize=100;send(e,t){const i={type:e,data:t,timestamp:Date.now()};this.subscribers.size>0?this.subscribers.forEach(r=>r(i)):F7.includes(e)&&this.queueMessage(i)}queueMessage(e){this.messageQueue.push(e),this.messageQueue.length>this.maxQueueSize&&this.messageQueue.shift()}flushQueue(){this.messageQueue.length===0||this.subscribers.size===0||(this.messageQueue.forEach(e=>{this.subscribers.forEach(t=>t(e))}),this.messageQueue=[])}subscribe(e){return this.subscribers.add(e),this.flushQueue(),()=>{this.subscribers.delete(e)}}get hasSubscribers(){return this.subscribers.size>0}get queueSize(){return this.messageQueue.length}clearQueue(){this.messageQueue=[]}}var B7=Object.create,nP=Object.defineProperty,z7=Object.getOwnPropertyDescriptor,Bb=Object.getOwnPropertyNames,V7=Object.getPrototypeOf,H7=Object.prototype.hasOwnProperty,G7=(n,e)=>function(){return n&&(e=(0,n[Bb(n)[0]])(n=0)),e},W7=(n,e)=>function(){return e||(0,n[Bb(n)[0]])((e={exports:{}}).exports,e),e.exports},$7=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bb(e))!H7.call(n,r)&&r!==t&&nP(n,r,{get:()=>e[r],enumerable:!(i=z7(e,r))||i.enumerable});return n},j7=(n,e,t)=>(t=n!=null?B7(V7(n)):{},$7(nP(t,"default",{value:n,enumerable:!0}),n)),Md=G7({"../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),q7=W7({"../../node_modules/.pnpm/[email protected]/node_modules/rfdc/index.js"(n,e){Md(),e.exports=i;function t(s){return s instanceof Buffer?Buffer.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function i(s){if(s=s||{},s.circles)return r(s);const o=new Map;if(o.set(Date,h=>new Date(h)),o.set(Map,(h,d)=>new Map(l(Array.from(h),d))),o.set(Set,(h,d)=>new Set(l(Array.from(h),d))),s.constructorHandlers)for(const h of s.constructorHandlers)o.set(h[0],h[1]);let a=null;return s.proto?u:c;function l(h,d){const f=Object.keys(h),p=new Array(f.length);for(let v=0;v<f.length;v++){const m=f[v],g=h[m];typeof g!="object"||g===null?p[m]=g:g.constructor!==Object&&(a=o.get(g.constructor))?p[m]=a(g,d):ArrayBuffer.isView(g)?p[m]=t(g):p[m]=d(g)}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&&(a=o.get(h.constructor)))return a(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&&(a=o.get(p.constructor))?d[f]=a(p,c):ArrayBuffer.isView(p)?d[f]=t(p):d[f]=c(p
3966)}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&&(a=o.get(h.constructor)))return a(h,u);const d={};for(const f in h){const p=h[f];typeof p!="object"||p===null?d[f]=p:p.constructor!==Object&&(a=o.get(p.constructor))?d[f]=a(p,u):ArrayBuffer.isView(p)?d[f]=t(p):d[f]=u(p)}return d}}function r(s){const o=[],a=[],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 v=Object.keys(f),m=new Array(v.length);for(let g=0;g<v.length;g++){const y=v[g],x=f[y];if(typeof x!="object"||x===null)m[y]=x;else if(x.constructor!==Object&&(c=l.get(x.constructor)))m[y]=c(x,p);else if(ArrayBuffer.isView(x))m[y]=t(x);else{const _=o.indexOf(x);_!==-1?m[y]=a[_]:m[y]=p(x)}}return m}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={};o.push(f),a.push(p);for(const v in f){if(Object.hasOwnProperty.call(f,v)===!1)continue;const m=f[v];if(typeof m!="object"||m===null)p[v]=m;else if(m.constructor!==Object&&(c=l.get(m.constructor)))p[v]=c(m,h);else if(ArrayBuffer.isView(m))p[v]=t(m);else{const g=o.indexOf(m);g!==-1?p[v]=a[g]:p[v]=h(m)}}return o.pop(),a.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={};o.push(f),a.push(p);for(const v in f){const m=f[v];if(typeof m!="object"||m===null)p[v]=m;else if(m.constructor!==Object&&(c=l.get(m.constructor)))p[v]=c(m,d);else if(ArrayBuffer.isView(m))p[v]=t(m);else{const g=o.indexOf(m);g!==-1?p[v]=a[g]:p[v]=d(m)}}return o.pop(),a.pop(),p}}}});Md();Md();Md();var iP=typeof navigator<"u",nt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof global<"u"?global:{};typeof nt.chrome<"u"&&nt.chrome.devtools;iP&&(nt.self,nt.top);var XM;typeof navigator<"u"&&((XM=navigator.userAgent)==null||XM.toLowerCase().includes("electron"));Md();var X7=j7(q7()),Y7=/(?:^|[-_/])(\w)/g;function K7(n,e){return e?e.toUpperCase():""}function Z7(n){return n&&`${n}`.replace(Y7,K7)}function J7(n,e){let t=n.replace(/^[a-z]:/i,"").replace(/\\/g,"/");t.endsWith(`index${e}`)&&(t=t.replace(`/index${e}`,e));const i=t.lastIndexOf("/"),r=t.substring(i+1);{const s=r.lastIndexOf(e);return r.substring(0,s)}}var YM=(0,X7.default)({circles:!0});const Q7={trailing:!0};function $c(n,e=25,t={}){if(t={...Q7,...t},!Number.isFinite(e))throw new TypeError("Expected `wait` to be a finite number");let i,r,s=[],o,a;const l=(c,u)=>(o=eW(n,c,u),o.finally(()=>{if(o=null,t.trailing&&a&&!r){const h=l(c,a);return a=null,h}}),o);return function(...c){return o?(t.trailing&&(a=c),o):new Promise(u=>{const h=!r&&t.leading;clearTimeout(r),r=setTimeout(()=>{r=null;const d=t.leading?i:l(this,c);for(const f of s)f(d);s=[]},e),h?(i=l(this,c),u(i)):s.push(u)})}}async function eW(n,e,t){return await n.apply(e,t)}function wy(n,e={},t){for(const i in n){const r=n[i],s=t?`${t}:${i}`:i;typeof r=="object"&&r!==null?wy(r,e,s):typeof r=="function"&&(e[s]=r)}return e}const tW={run:n=>n()},nW=()=>tW,rP=typeof console.createTask<"u"?console.createTask:nW;function iW(n,e){const t=e.shift(),i=rP(t);return n.reduce((r,s)=>r.then(()=>i.run(()=>s(...e))),Promise.resolve())}function rW(n,e){const t=e.shift(),i=rP(t);return Promise.all(n.map(r=>i.run(()=>r(...e))))}function Bv(n,e){for(const t of[...n])t(e)}class sW{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,i={}){if(!e||typeof t!="function")return()=>{};const r=e;let s;for(;this._deprecatedHooks[e];)s=this._deprecatedHooks[e],e=s.to;if(s&&!i.allowDeprecated){let o=s.message;o||(o=`${r} hook has been deprecated`+(s.to?`, please use ${s.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||
3966(console.warn(o),this._deprecatedMessages.add(o))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let i,r=(...s)=>(typeof i=="function"&&i(),i=void 0,r=void 0,t(...s));return i=this.hook(e,r),i}removeHook(e,t){if(this._hooks[e]){const i=this._hooks[e].indexOf(t);i!==-1&&this._hooks[e].splice(i,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const i=this._hooks[e]||[];delete this._hooks[e];for(const r of i)this.hook(e,r)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=wy(e),i=Object.keys(t).map(r=>this.hook(r,t[r]));return()=>{for(const r of i.splice(0,i.length))r()}}removeHooks(e){const t=wy(e);for(const i in t)this.removeHook(i,t[i])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(iW,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(rW,e,...t)}callHookWith(e,t,...i){const r=this._before||this._after?{name:t,args:i,context:{}}:void 0;this._before&&Bv(this._before,r);const s=e(t in this._hooks?[...this._hooks[t]]:[],i);return s instanceof Promise?s.finally(()=>{this._after&&r&&Bv(this._after,r)}):(this._after&&r&&Bv(this._after,r),s)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}}function sP(){return new sW}var oW=Object.create,oP=Object.defineProperty,aW=Object.getOwnPropertyDescriptor,zb=Object.getOwnPropertyNames,lW=Object.getPrototypeOf,cW=Object.prototype.hasOwnProperty,uW=(n,e)=>function(){return n&&(e=(0,n[zb(n)[0]])(n=0)),e},aP=(n,e)=>function(){return e||(0,n[zb(n)[0]])((e={exports:{}}).exports,e),e.exports},hW=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of zb(e))!cW.call(n,r)&&r!==t&&oP(n,r,{get:()=>e[r],enumerable:!(i=aW(e,r))||i.enumerable});return n},dW=(n,e,t)=>(t=n!=null?oW(lW(n)):{},hW(oP(t,"default",{value:n,enumerable:!0}),n)),Ee=uW({"../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),fW=aP({"../../node_modules/.pnpm/[email protected]/node_modules/speakingurl/lib/speakingurl.js"(n,e){Ee(),(function(t){var i={À:"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",
3966ޙ:"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",ẳ:"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","₸"
3966:"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"},o={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"}},a={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(v,m){var g="-",y="",x="",_=!0,T={},S,E,M,b,w,A,P,H,B,G,O,$,F,J,se="";if(typeof v!="string")return"";if(typeof m=="string"&&(g=m),P=a.en,H=o.en,typeof m=="object"){S=m.maintainCase||!1,T=m.custom&&typeof m.custom=="object"?m.custom:T,M=+m.truncate>1&&m.truncate||!1,b=m.uric||!1,w=m.uricNoSlash||!1,A=m.mark||!1,_=!(m.symbols===!1||m.lang===!1),g=m.separator||g,b&&(se+=l),w&&(se+=c),A&&(se+=u),P=m.lang&&a[m.lang]&&_?a[m.lang]:_?a.en:{},H=m.lang&&o[m.lang]?o[m.lang]:m.lang===!1||m.lang===!0?{}:o.en,m.titleCase&&typeof m.titleCase.length=="number"&&Array.prototype.toString.call(m.titleCase)?(m.titleCase.forEach(function(be){T[be+""]=be+""}),E=!0):E=!!m.titleCase,m.custom&&typeof m.custom.length=="number"&&Array.prototype.toString.call(m.custom)&&m.custom.forEach(function(be){T[be+""]=be+""}),Object.keys(T).forEach(function(be){var Fe;be.length>1?Fe=new RegExp("\\b"+f(be)+"\\b","gi"):Fe=new RegExp(f(be),"gi"),v=v.replace(Fe,T[be])});for(O in T)se+=O}for(se+=g,se=f(se),v=v.replace(/(^\s+|\s+$)/g,""),F=!1,J=!1,G=0,$=v.length;G<$;G++)O=v[G],p(O,T)?F=!1:H[O]?(O=F&&H[O].match(/[A-Za-z0-9]/)?" "+H[O]:H[O],F=!1):O in i?(G+1<$&&r.indexOf(v[G+1])>=0?(x+=O,O=""):J===!0?(O=s[x]+i[O],x=""):O=F&&i[O].match(/[A-Za-z0-9]/)?" "+i[O]:i[O],F=!1,J=!1):O in s?(x+=O,O="",G===$-1&&(O=s[x]),J=!0):P[O]&&!(b&&l.indexOf(O)!==-1)&&!(w&&c.indexOf(O)!==-1)?(O=F||y.substr(-1).match(/[A-Za-z0-9]/)?g+P[O]:P[O],O+=v[G+1]!==void 0&&v[G+1
3966].match(/[A-Za-z0-9]/)?g:"",F=!0):(J===!0?(O=s[x]+O,x="",J=!1):F&&(/[A-Za-z0-9]/.test(O)||y.substr(-1).match(/A-Za-z0-9]/))&&(O=" "+O),F=!1),y+=O.replace(new RegExp("[^\\w\\s"+se+"_-]","g"),g);return E&&(y=y.replace(/(\w)(\S*)/g,function(be,Fe,Le){var Ge=Fe.toUpperCase()+(Le!==null?Le:"");return Object.keys(T).indexOf(Ge.toLowerCase())<0?Ge:Ge.toLowerCase()})),y=y.replace(/\s+/g,g).replace(new RegExp("\\"+g+"+","g"),g).replace(new RegExp("(^\\"+g+"+|\\"+g+"+$)","g"),""),M&&y.length>M&&(B=y.charAt(M)===g,y=y.slice(0,M),B||(y=y.slice(0,y.lastIndexOf(g)))),!S&&!E&&(y=y.toLowerCase()),y},d=function(v){return function(m){return h(m,v)}},f=function(v){return v.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},p=function(v,m){for(var g in m)if(m[g]===v)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{}})(n)}}),pW=aP({"../../node_modules/.pnpm/[email protected]/node_modules/speakingurl/index.js"(n,e){Ee(),e.exports=fW()}});Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();function mW(n){var e;const t=n.name||n._componentTag||n.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||n.__name;return t==="index"&&(e=n.__file)!=null&&e.endsWith("index.vue")?"":t}function gW(n){const e=n.__file;if(e)return Z7(J7(e,".vue"))}function KM(n,e){return n.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=e,e}function Vb(n){if(n.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return n.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(n.root)return n.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function lP(n){var e,t;const i=(e=n.subTree)==null?void 0:e.type,r=Vb(n);return r?((t=r?.types)==null?void 0:t.Fragment)===i:!1}function r0(n){var e,t,i;const r=mW(n?.type||{});if(r)return r;if(n?.root===n)return"Root";for(const o in(t=(e=n.parent)==null?void 0:e.type)==null?void 0:t.components)if(n.parent.type.components[o]===n?.type)return KM(n,o);for(const o in(i=n.appContext)==null?void 0:i.components)if(n.appContext.components[o]===n?.type)return KM(n,o);return gW(n?.type||{})||"Anonymous Component"}function vW(n){var e,t,i;const r=(i=(t=(e=n?.appContext)==null?void 0:e.app)==null?void 0:t.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__)!=null?i:0,s=n===n?.root?"root":n.uid;return`${r}:${s}`}function Sy(n,e){return e=e||`${n.id}:root`,n.instanceMap.get(e)||n.instanceMap.get(":root")}function xW(){const n={top:0,bottom:0,left:0,right:0,get width(){return n.right-n.left},get height(){return n.bottom-n.top}};return n}var Hf;function yW(n){return Hf||(Hf=document.createRange()),Hf.selectNode(n),Hf.getBoundingClientRect()}function _W(n){const e=xW();if(!n.children)return e;for(let t=0,i=n.children.length;t<i;t++){const r=n.children[t];let s;if(r.component)s=yl(r.component);else if(r.el){const o=r.el;o.nodeType===1||o.getBoundingClientRect?s=o.getBoundingClientRect():o.nodeType===3&&o.data.trim()&&(s=yW(o))}s&&bW(e,s)}return e}function bW(n,e){return(!n.top||e.top<n.top)&&(n.top=e.top),(!n.bottom||e.bottom>n.bottom)&&(n.bottom=e.bottom),(!n.left||e.left<n.left)&&(n.left=e.left),(!n.right||e.right>n.right)&&(n.right=e.right),n}var ZM={top:0,left:0,right:0,bottom:0,width:0,height:0};function yl(n){const e=n.subTree.el;return typeof window>"u"?ZM:lP(n)?_W(n.subTree):e?.nodeType===1?e?.getBoundingClientRect():n.subTree.component?yl(n.subTree.component):ZM}Ee();function Hb(n){return lP(n)?wW(n.subTree):n.subTree?[n.subTree.el]:[]}function wW(n){if(!n.children)return[];const e=[];return n.children.forEach(t=>{t.component?e.push(...Hb(t.component)):t?.el&&e.push(t.el)}),e}var cP="__vue-devtools-component-inspector__",uP="__vue-devtools-component-inspector__card__",hP="__vue-devtools-component-inspector__name__",dP="__vue-devtools-component-inspector__indicator__",fP={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},SW={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)"},MW={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function lu(){return document.getElementById(cP)}function TW(){return document.getElementById(uP)}function EW(){return document.getElementById(dP)}function AW(){return document.getElementById(hP)}function Gb(n){return{left:`${Math.round(n.left*100)/100}px`,top:`${Math.round(n.top*100)/100}px`,width:`${Math.round(n.width*100)/100}px`,height:`${Math.round(n.height*100)/100}px`}}function Wb(n){var e;const t=document.createElement("div");t.id=(e=n.elementId)!=null?e:cP,Object.assign(t.style,{...fP,...Gb(n.bounds),...n.style});const i=document.createElement("span");i.id=uP,Object.assign(i.style,{...SW,top:n.bounds.top<35?0:"-35px"});const r=document.createElement("span");r.id=hP,r.innerHTML=`&lt;${n.name}&gt;&nbsp;&nbsp;`;const s=document.createElement("i");return s.id=dP,s.innerHTML=`${Math.round(n.bounds.width*100)/100} x ${Math.round(n.bounds.height*100)/100}`,Object.assign(s.style,MW),i.appendChild(r),i.appendChild(s),t.appendChild(i),document.body.appendChild(t),t}function $b(n){const e=lu(),t=TW(),i=AW(),r=EW();e&&(Object.assign(e.style,{...fP,...Gb(n.bounds)}),Object.assign(t.style,{top:n.bounds.top<35?0:"-35px"}),i.innerHTML=`&lt;${n.name}&gt;&nbsp;&nbsp;`,r.innerHTML=`${Math.round(n.bounds.width*100)/100} x ${Math.round(n.bounds.height*100)/100}`)}function CW(n){const e=yl(n);if(!e.width&&!e.height)return;const t=r0(n);lu()?$b({bounds:e,name:t}):Wb({bounds:e,name:t})}function pP(){const n=lu();n&&(n.style.display="none")}var My=null;function Ty(n){const e=n.target;if(e){const t=e.__vueParentComponent;if(t&&(My=t,t.vnode.el)){const i=yl(t),r=r0(t);lu()?$b({bounds:i,name:r}):Wb({bounds:i,name:r})}}}function RW(n,e){if(n.preventDefault(),n.stopPropagation(),My){const t=vW(My);e(t)}}var Wm=null;function PW(){pP(),window.removeEventListener("mouseover",Ty),window.removeEventListener("click",Wm,!0),Wm=null}function IW(){return window.addEventListener("mouseover",Ty),new Promise(n=>{function e(t){t.preventDefault(),t.stopPropagation(),RW(t,i=>{window.removeEventListener("click",e,!0),Wm=null,window.removeEventListener("mouseover",Ty);const r=lu();r&&(r.style.display="none"),n(JSON.stringify({id:i}))})}Wm=e,window.addEventListener("click",e,!0)})}
3966function NW(n){const e=Sy(Bi.value,n.id);if(e){const[t]=Hb(e);if(typeof t.scrollIntoView=="function")t.scrollIntoView({behavior:"smooth"});else{const i=yl(e),r=document.createElement("div"),s={...Gb(i),position:"absolute"};Object.assign(r.style,s),document.body.appendChild(r),r.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(r)},2e3)}setTimeout(()=>{const i=yl(e);if(i.width||i.height){const r=r0(e),s=lu();s?$b({...n,name:r,bounds:i}):Wb({...n,name:r,bounds:i}),setTimeout(()=>{s&&(s.style.display="none")},1500)}},1200)}}Ee();var JM;(JM=nt).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__!=null||(JM.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function LW(n){let e=0;const t=setInterval(()=>{nt.__VUE_INSPECTOR__&&(clearInterval(t),e+=30,n()),e>=5e3&&clearInterval(t)},30)}function OW(){const n=nt.__VUE_INSPECTOR__,e=n.openInEditor;n.openInEditor=async(...t)=>{n.disable(),e(...t)}}function DW(){return new Promise(n=>{function e(){OW(),n(nt.__VUE_INSPECTOR__)}nt.__VUE_INSPECTOR__?e():LW(()=>{e()})})}Ee();Ee();function kW(n){return!!(n&&n.__v_isReadonly)}function mP(n){return kW(n)?mP(n.__v_raw):!!(n&&n.__v_isReactive)}function zv(n){return!!(n&&n.__v_isRef===!0)}function th(n){const e=n&&n.__v_raw;return e?th(e):n}var FW=class{constructor(){this.refEditor=new UW}set(n,e,t,i){const r=Array.isArray(e)?e:e.split(".");for(;r.length>1;){const a=r.shift();n instanceof Map?n=n.get(a):n instanceof Set?n=Array.from(n.values())[a]:n=n[a],this.refEditor.isRef(n)&&(n=this.refEditor.get(n))}const s=r[0],o=this.refEditor.get(n)[s];i?i(n,s,t):this.refEditor.isRef(o)?this.refEditor.set(o,t):n[s]=t}get(n,e){const t=Array.isArray(e)?e:e.split(".");for(let i=0;i<t.length;i++)if(n instanceof Map?n=n.get(t[i]):n=n[t[i]],this.refEditor.isRef(n)&&(n=this.refEditor.get(n)),!n)return;return n}has(n,e,t=!1){if(typeof n>"u")return!1;const i=Array.isArray(e)?e.slice():e.split("."),r=t?2:1;for(;n&&i.length>r;){const s=i.shift();n=n[s],this.refEditor.isRef(n)&&(n=this.refEditor.get(n))}return n!=null&&Object.prototype.hasOwnProperty.call(n,i[0])}createDefaultSetCallback(n){return(e,t,i)=>{if((n.remove||n.newKey)&&(Array.isArray(e)?e.splice(t,1):th(e)instanceof Map?e.delete(t):th(e)instanceof Set?e.delete(Array.from(e.values())[t]):Reflect.deleteProperty(e,t)),!n.remove){const r=e[n.newKey||t];this.refEditor.isRef(r)?this.refEditor.set(r,i):th(e)instanceof Map?e.set(n.newKey||t,i):th(e)instanceof Set?e.add(i):e[n.newKey||t]=i}}}},UW=class{set(e,t){if(zv(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(s=>e.add(s));return}const i=Object.keys(t);if(e instanceof Map){const s=new Set(e.keys());i.forEach(o=>{e.set(o,Reflect.get(t,o)),s.delete(o)}),s.forEach(o=>e.delete(o));return}const r=new Set(Object.keys(e));i.forEach(s=>{Reflect.set(e,s,Reflect.get(t,s)),r.delete(s)}),r.forEach(s=>Reflect.deleteProperty(e,s))}}get(e){return zv(e)?e.value:e}isRef(e){return zv(e)||mP(e)}};Ee();Ee();Ee();var BW="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function zW(){if(!iP||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const n=localStorage.getItem(BW);return n?JSON.parse(n):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}Ee();Ee();Ee();var QM;(QM=nt).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS!=null||(QM.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var VW=new Proxy(nt.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(n,e,t){return Reflect.get(n,e,t)}});function HW(n,e){ei.timelineLayersState[e.id]=!1,VW.push({...n,descriptorId:e.id,appRecord:Vb(e.app)})}var eT;(eT=nt).__VUE_DEVTOOLS_KIT_INSPECTOR__!=null||(eT.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var jb=new Proxy(nt.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(n,e,t){return Reflect.get(n,e,t)}}),gP=$c(()=>{cu.hooks.callHook("sendInspectorToClient",vP())});function GW(n,e){var t,i;jb.push({options:n,descriptor:e,treeFilterPlaceholder:(t=n.treeFilterPlaceholder)!=null?t:"Search tree...",stateFilterPlaceholder:(i=n.stateFilterPlaceholder)!=null?i:"Search state...",treeFilter:"",selectedNodeId:"",appRecord:Vb(e.app)}),gP()}function vP(){return jb.filter(n=>n.descriptor.app===Bi.value.app).filter(n=>n.descriptor.id!=="components").map(n=>{var e;const t=n.descriptor,i=n.options;return{id:i.id,label:i.label,logo:t.logo,icon:`custom-ic-baseline-${(e=i?.icon)==null?void 0:e.replace(/_/g,"-")}`,packageName:t.packageName,homepage:t.homepage,pluginId:t.id}})}function Pp(n,e){return jb.find(t=>t.options.id===n&&(e?t.descriptor.app===e:!0))}function WW(){const n=sP();n.hook("addInspector",({inspector:i,plugin:r})=>{GW(i,r.descriptor)});const e=$c(async({inspectorId:i,plugin:r})=>{var s;if(!i||!((s=r?.descriptor)!=null&&s.app)||ei.highPerfModeEnabled)return;const o=Pp(i,r.descriptor.app),a={app:r.descriptor.app,inspectorId:i,filter:o?.treeFilter||"",rootNodes:[]};await new Promise(l=>{n.callHookWith(async c=>{await Promise.all(c.map(u=>u(a))),l()},"getInspectorTree")}),n.callHookWith(async l=>{await Promise.all(l.map(c=>c({inspectorId:i,rootNodes:a.rootNodes})))}
3966,"sendInspectorTreeToClient")},120);n.hook("sendInspectorTree",e);const t=$c(async({inspectorId:i,plugin:r})=>{var s;if(!i||!((s=r?.descriptor)!=null&&s.app)||ei.highPerfModeEnabled)return;const o=Pp(i,r.descriptor.app),a={app:r.descriptor.app,inspectorId:i,nodeId:o?.selectedNodeId||"",state:null},l={currentTab:`custom-inspector:${i}`};a.nodeId&&await new Promise(c=>{n.callHookWith(async u=>{await Promise.all(u.map(h=>h(a,l))),c()},"getInspectorState")}),n.callHookWith(async c=>{await Promise.all(c.map(u=>u({inspectorId:i,nodeId:a.nodeId,state:a.state})))},"sendInspectorStateToClient")},120);return n.hook("sendInspectorState",t),n.hook("customInspectorSelectNode",({inspectorId:i,nodeId:r,plugin:s})=>{const o=Pp(i,s.descriptor.app);o&&(o.selectedNodeId=r)}),n.hook("timelineLayerAdded",({options:i,plugin:r})=>{HW(i,r.descriptor)}),n.hook("timelineEventAdded",({options:i,plugin:r})=>{var s;const o=["performance","component-event","keyboard","mouse"];ei.highPerfModeEnabled||!((s=ei.timelineLayersState)!=null&&s[r.descriptor.id])&&!o.includes(i.layerId)||n.callHookWith(async a=>{await Promise.all(a.map(l=>l(i)))},"sendTimelineEventToClient")}),n.hook("getComponentInstances",async({app:i})=>{const r=i.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!r)return null;const s=r.id.toString();return[...r.instanceMap].filter(([o])=>o.split(":")[0]===s).map(([,o])=>o)}),n.hook("getComponentBounds",async({instance:i})=>yl(i)),n.hook("getComponentName",({instance:i})=>r0(i)),n.hook("componentHighlight",({uid:i})=>{const r=Bi.value.instanceMap.get(i);r&&CW(r)}),n.hook("componentUnhighlight",()=>{pP()}),n}var tT;(tT=nt).__VUE_DEVTOOLS_KIT_APP_RECORDS__!=null||(tT.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var nT;(nT=nt).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__!=null||(nT.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var iT;(iT=nt).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__!=null||(iT.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__="");var rT;(rT=nt).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__!=null||(rT.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var sT;(sT=nt).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__!=null||(sT.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var Ka="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function $W(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:zW()}}var oT;(oT=nt)[Ka]!=null||(oT[Ka]=$W());var jW=$c(n=>{cu.hooks.callHook("devtoolsStateUpdated",{state:n})});$c((n,e)=>{cu.hooks.callHook("devtoolsConnectedUpdated",{state:n,oldState:e})});var s0=new Proxy(nt.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(n,e,t){return e==="value"?nt.__VUE_DEVTOOLS_KIT_APP_RECORDS__:nt.__VUE_DEVTOOLS_KIT_APP_RECORDS__[e]}}),Bi=new Proxy(nt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(n,e,t){return e==="value"?nt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:e==="id"?nt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:nt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[e]}});function xP(){jW({...nt[Ka],appRecords:s0.value,activeAppRecordId:Bi.id,tabs:nt.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:nt.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function qW(n){nt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=n,xP()}function XW(n){nt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=n,xP()}var ei=new Proxy(nt[Ka],{get(n,e){return e==="appRecords"?s0:e==="activeAppRecordId"?Bi.id:e==="tabs"?nt.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:e==="commands"?nt.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:nt[Ka][e]},deleteProperty(n,e){return delete n[e],!0},set(n,e,t){return{...nt[Ka]},n[e]=t,nt[Ka][e]=t,!0}});function YW(n={}){var e,t,i;const{file:r,host:s,baseUrl:o=window.location.origin,line:a=0,column:l=0}=n;if(r){if(s==="chrome-extension"){const c=r.replace(/\\/g,"\\\\"),u=(t=(e=window.VUE_DEVTOOLS_CONFIG)==null?void 0:e.openInEditorHost)!=null?t:"/";fetch(`${u}__open-in-editor?file=${encodeURI(r)}`).then(h=>{if(!h.ok){const d=`Opening component ${c} failed`;console.log(`%c${d}`,"color:red")}})}else if(ei.vitePluginDetected){const c=(i=nt.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__)!=null?i:o;nt.__VUE_INSPECTOR__.openInEditor(c,r,a,l)}}}Ee();Ee();Ee();Ee();Ee();var aT;(aT=nt).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__!=null||(aT.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var qb=new Proxy(nt.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(n,e,t){return Reflect.get(n,e,t)}});function Ey(n){const e={};
3966return Object.keys(n).forEach(t=>{e[t]=n[t].defaultValue}),e}function Xb(n){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${n}__`}function KW(n){var e,t,i;return(i=((t=(e=qb.find(s=>{var o;return s[0].id===n&&!!((o=s[0])!=null&&o.settings)}))==null?void 0:e[0])!=null?t:null)?.settings)!=null?i:null}function yP(n,e){var t,i,r;const s=Xb(n);if(s){const o=localStorage.getItem(s);if(o)return JSON.parse(o)}if(n){const o=(i=(t=qb.find(a=>a[0].id===n))==null?void 0:t[0])!=null?i:null;return Ey((r=o?.settings)!=null?r:{})}return Ey(e)}function ZW(n,e){const t=Xb(n);localStorage.getItem(t)||localStorage.setItem(t,JSON.stringify(Ey(e)))}function JW(n,e,t){const i=Xb(n),r=localStorage.getItem(i),s=JSON.parse(r||"{}"),o={...s,[e]:t};localStorage.setItem(i,JSON.stringify(o)),cu.hooks.callHookWith(a=>{a.forEach(l=>l({pluginId:n,key:e,oldValue:s[e],newValue:t,settings:o}))},"setPluginSettings")}Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();var lT,cT,xr=(cT=(lT=nt).__VUE_DEVTOOLS_HOOK)!=null?cT:lT.__VUE_DEVTOOLS_HOOK=sP(),QW={vueAppInit(n){xr.hook("app:init",n)},vueAppUnmount(n){xr.hook("app:unmount",n)},vueAppConnected(n){xr.hook("app:connected",n)},componentAdded(n){return xr.hook("component:added",n)},componentEmit(n){return xr.hook("component:emit",n)},componentUpdated(n){return xr.hook("component:updated",n)},componentRemoved(n){return xr.hook("component:removed",n)},setupDevtoolsPlugin(n){xr.hook("devtools-plugin:setup",n)},perfStart(n){return xr.hook("perf:start",n)},perfEnd(n){return xr.hook("perf:end",n)}},_P={on:QW,setupDevToolsPlugin(n,e){return xr.callHook("devtools-plugin:setup",n,e)}},e$=class{constructor({plugin:n,ctx:e}){this.hooks=e.hooks,this.plugin=n}get on(){return{visitComponentTree:n=>{this.hooks.hook("visitComponentTree",n)},inspectComponent:n=>{this.hooks.hook("inspectComponent",n)},editComponentState:n=>{this.hooks.hook("editComponentState",n)},getInspectorTree:n=>{this.hooks.hook("getInspectorTree",n)},getInspectorState:n=>{this.hooks.hook("getInspectorState",n)},editInspectorState:n=>{this.hooks.hook("editInspectorState",n)},inspectTimelineEvent:n=>{this.hooks.hook("inspectTimelineEvent",n)},timelineCleared:n=>{this.hooks.hook("timelineCleared",n)},setPluginSettings:n=>{this.hooks.hook("setPluginSettings",n)}}}notifyComponentUpdate(n){var e;if(ei.highPerfModeEnabled)return;const t=vP().find(i=>i.packageName===this.plugin.descriptor.packageName);if(t?.id){if(n){const i=[n.appContext.app,n.uid,(e=n.parent)==null?void 0:e.uid,n];xr.callHook("component:updated",...i)}else xr.callHook("component:updated");this.hooks.callHook("sendInspectorState",{inspectorId:t.id,plugin:this.plugin})}}addInspector(n){this.hooks.callHook("addInspector",{inspector:n,plugin:this.plugin}),this.plugin.descriptor.settings&&ZW(n.id,this.plugin.descriptor.settings)}sendInspectorTree(n){ei.highPerfModeEnabled||this.hooks.callHook("sendInspectorTree",{inspectorId:n,plugin:this.plugin})}sendInspectorState(n){ei.highPerfModeEnabled||this.hooks.callHook("sendInspectorState",{inspectorId:n,plugin:this.plugin})}selectInspectorNode(n,e){this.hooks.callHook("customInspectorSelectNode",{inspectorId:n,nodeId:e,plugin:this.plugin})}visitComponentTree(n){return this.hooks.callHook("visitComponentTree",n)}now(){return ei.highPerfModeEnabled?0:Date.now()}addTimelineLayer(n){this.hooks.callHook("timelineLayerAdded",{options:n,plugin:this.plugin})}addTimelineEvent(n){ei.highPerfModeEnabled||this.hooks.callHook("timelineEventAdded",{options:n,plugin:this.plugin})}getSettings(n){return yP(n??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(n){return this.hooks.callHook("getComponentInstances",{app:n})}getComponentBounds(n){return this.hooks.callHook("getComponentBounds",{instance:n})}getComponentName(n){return this.hooks.callHook("getComponentName",{instance:n})}highlightElement(n){const e=n.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook("componentHighlight",{uid:e})}unhighlightElement(){return this.hooks.callHook("componentUnhighlight")}},t$=e$;Ee();Ee();Ee();Ee();var n$="__vue_devtool_undefined__",i$="__vue_devtool_infinity__",r$="__vue_devtool_negative_infinity__",s$="__vue_devtool_nan__";Ee();Ee();var o$={[n$]:"undefined",[s$]:"NaN",[i$]:"Infinity",[r$]:"-Infinity"};Object.entries(o$).reduce((n,[e,t])=>(n[t]=e,n),{});Ee();Ee();Ee();Ee();Ee();var uT;(uT=nt).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__!=null||(uT.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function a$(n,e){return _P.setupDevToolsPlugin(n,e)}function l$(n,e){const[t,i]=n;if(t.app!==e)return;const r=new t$({plugin:{setupFn:i,descriptor:t},ctx:cu});t.packageName==="vuex"&&r.on.editInspectorState(s=>{r.sendInspectorState(s.inspectorId)}),i(r)}function bP(n,e){nt.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(n)||ei.highPerfModeEnabled&&!e?.inspectingComponent||(nt.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(n),qb.forEach(t=>{l$(t,n)}
3966))}Ee();Ee();var Xh="__VUE_DEVTOOLS_ROUTER__",jc="__VUE_DEVTOOLS_ROUTER_INFO__",hT;(hT=nt)[jc]!=null||(hT[jc]={currentRoute:null,routes:[]});var dT;(dT=nt)[Xh]!=null||(dT[Xh]={});new Proxy(nt[jc],{get(n,e){return nt[jc][e]}});new Proxy(nt[Xh],{get(n,e){if(e==="value")return nt[Xh]}});function c$(n){const e=new Map;return(n?.getRoutes()||[]).filter(t=>!e.has(t.path)&&e.set(t.path,1))}function Yb(n){return n.map(e=>{let{path:t,name:i,children:r,meta:s}=e;return r?.length&&(r=Yb(r)),{path:t,name:i,children:r,meta:s}})}function u$(n){if(n){const{fullPath:e,hash:t,href:i,path:r,name:s,matched:o,params:a,query:l}=n;return{fullPath:e,hash:t,href:i,path:r,name:s,params:a,query:l,matched:Yb(o)}}return n}function h$(n,e){function t(){var i;const r=(i=n.app)==null?void 0:i.config.globalProperties.$router,s=u$(r?.currentRoute.value),o=Yb(c$(r)),a=console.warn;console.warn=()=>{},nt[jc]={currentRoute:s?YM(s):{},routes:YM(o)},nt[Xh]=r,console.warn=a}t(),_P.on.componentUpdated($c(()=>{var i;((i=e.value)==null?void 0:i.app)===n.app&&(t(),!ei.highPerfModeEnabled&&cu.hooks.callHook("routerInfoUpdated",{state:nt[jc]}))},200))}function d$(n){return{async getInspectorTree(e){const t={...e,app:Bi.value.app,rootNodes:[]};return await new Promise(i=>{n.callHookWith(async r=>{await Promise.all(r.map(s=>s(t))),i()},"getInspectorTree")}),t.rootNodes},async getInspectorState(e){const t={...e,app:Bi.value.app,state:null},i={currentTab:`custom-inspector:${e.inspectorId}`};return await new Promise(r=>{n.callHookWith(async s=>{await Promise.all(s.map(o=>o(t,i))),r()},"getInspectorState")}),t.state},editInspectorState(e){const t=new FW,i={...e,app:Bi.value.app,set:(r,s=e.path,o=e.state.value,a)=>{t.set(r,s,o,a||t.createDefaultSetCallback(e.state))}};n.callHookWith(r=>{r.forEach(s=>s(i))},"editInspectorState")},sendInspectorState(e){const t=Pp(e);n.callHook("sendInspectorState",{inspectorId:e,plugin:{descriptor:t.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return IW()},cancelInspectComponentInspector(){return PW()},getComponentRenderCode(e){const t=Sy(Bi.value,e);if(t)return typeof t?.type!="function"?t.render.toString():t.type.toString()},scrollToComponent(e){return NW({id:e})},openInEditor:YW,getVueInspector:DW,toggleApp(e,t){const i=s0.value.find(r=>r.id===e);i&&(XW(e),qW(i),h$(i,Bi),gP(),bP(i.app,t))},inspectDOM(e){const t=Sy(Bi.value,e);if(t){const[i]=Hb(t);i&&(nt.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=i)}},updatePluginSettings(e,t,i){JW(e,t,i)},getPluginSettings(e){return{options:KW(e),values:yP(e)}}}}Ee();var fT;(fT=nt).__VUE_DEVTOOLS_ENV__!=null||(fT.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var pT=WW(),mT;(mT=nt).__VUE_DEVTOOLS_KIT_CONTEXT__!=null||(mT.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:pT,get state(){return{...ei,activeAppRecordId:Bi.id,activeAppRecord:Bi.value,appRecords:s0.value}},api:d$(pT)});var cu=nt.__VUE_DEVTOOLS_KIT_CONTEXT__;Ee();dW(pW());var gT;(gT=nt).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__!=null||(gT.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set});Ee();Ee();function f$(n){ei.highPerfModeEnabled=n??!ei.highPerfModeEnabled,!n&&Bi.value&&bP(Bi.value.app)}Ee();Ee();Ee();function p$(n){ei.devtoolsClientDetected={...ei.devtoolsClientDetected,...n};const e=Object.values(ei.devtoolsClientDetected).some(Boolean);f$(!e)}var vT;(vT=nt).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__!=null||(vT.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=p$);Ee();Ee();Ee();Ee();Ee();Ee();Ee();var m$=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(n,e){this.keyToValue.set(n,e),this.valueToKey.set(e,n)}getByKey(n){return this.keyToValue.get(n)}getByValue(n){return this.valueToKey.get(n)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},wP=class{constructor(e){this.generateIdentifier=e,this.kv=new m$}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},g$=class extends wP{constructor(){super(n=>n.name),this.classToAllowedProps=new Map}register(n,e){typeof e=="object"?(e.allowProps&&this.classToAllowedProps.set(n,e.allowProps),super.register(n,e.identifier)):super.register(n,e)}getAllowedProps(n){return this.classToAllowedProps.get(n)}};Ee();Ee();function v$(n){if("values"in Object)return Object.values(n);const e=[];for(const t in n)n.hasOwnProperty(t)&&e.push(n[t]);return e}function x$(n,e){const t=v$(n);if("find"in t)return t.find(e);const i=t;for(let r=0;r<i.length;r++){const s=i[r];if(e(s))return s}}
3966function qc(n,e){Object.entries(n).forEach(([t,i])=>e(i,t))}function Ip(n,e){return n.indexOf(e)!==-1}function xT(n,e){for(let t=0;t<n.length;t++){const i=n[t];if(e(i))return i}}var y$=class{constructor(){this.transfomers={}}register(n){this.transfomers[n.name]=n}findApplicable(n){return x$(this.transfomers,e=>e.isApplicable(n))}findByName(n){return this.transfomers[n]}};Ee();Ee();var _$=n=>Object.prototype.toString.call(n).slice(8,-1),SP=n=>typeof n>"u",b$=n=>n===null,Yh=n=>typeof n!="object"||n===null||n===Object.prototype?!1:Object.getPrototypeOf(n)===null?!0:Object.getPrototypeOf(n)===Object.prototype,Ay=n=>Yh(n)&&Object.keys(n).length===0,ra=n=>Array.isArray(n),w$=n=>typeof n=="string",S$=n=>typeof n=="number"&&!isNaN(n),M$=n=>typeof n=="boolean",T$=n=>n instanceof RegExp,Kh=n=>n instanceof Map,Zh=n=>n instanceof Set,MP=n=>_$(n)==="Symbol",E$=n=>n instanceof Date&&!isNaN(n.valueOf()),A$=n=>n instanceof Error,yT=n=>typeof n=="number"&&isNaN(n),C$=n=>M$(n)||b$(n)||SP(n)||S$(n)||w$(n)||MP(n),R$=n=>typeof n=="bigint",P$=n=>n===1/0||n===-1/0,I$=n=>ArrayBuffer.isView(n)&&!(n instanceof DataView),N$=n=>n instanceof URL;Ee();var TP=n=>n.replace(/\./g,"\\."),Vv=n=>n.map(String).map(TP).join("."),bh=n=>{const e=[];let t="";for(let r=0;r<n.length;r++){let s=n.charAt(r);if(s==="\\"&&n.charAt(r+1)==="."){t+=".",r++;continue}if(s==="."){e.push(t),t="";continue}t+=s}const i=t;return e.push(i),e};Ee();function ps(n,e,t,i){return{isApplicable:n,annotation:e,transform:t,untransform:i}}var EP=[ps(SP,"undefined",()=>null,()=>{}),ps(R$,"bigint",n=>n.toString(),n=>typeof BigInt<"u"?BigInt(n):(console.error("Please add a BigInt polyfill."),n)),ps(E$,"Date",n=>n.toISOString(),n=>new Date(n)),ps(A$,"Error",(n,e)=>{const t={name:n.name,message:n.message};return e.allowedErrorProps.forEach(i=>{t[i]=n[i]}),t},(n,e)=>{const t=new Error(n.message);return t.name=n.name,t.stack=n.stack,e.allowedErrorProps.forEach(i=>{t[i]=n[i]}),t}),ps(T$,"regexp",n=>""+n,n=>{const e=n.slice(1,n.lastIndexOf("/")),t=n.slice(n.lastIndexOf("/")+1);return new RegExp(e,t)}),ps(Zh,"set",n=>[...n.values()],n=>new Set(n)),ps(Kh,"map",n=>[...n.entries()],n=>new Map(n)),ps(n=>yT(n)||P$(n),"number",n=>yT(n)?"NaN":n>0?"Infinity":"-Infinity",Number),ps(n=>n===0&&1/n===-1/0,"number",()=>"-0",Number),ps(N$,"URL",n=>n.toString(),n=>new URL(n))];function o0(n,e,t,i){return{isApplicable:n,annotation:e,transform:t,untransform:i}}var AP=o0((n,e)=>MP(n)?!!e.symbolRegistry.getIdentifier(n):!1,(n,e)=>["symbol",e.symbolRegistry.getIdentifier(n)],n=>n.description,(n,e,t)=>{const i=t.symbolRegistry.getValue(e[1]);if(!i)throw new Error("Trying to deserialize unknown symbol");return i}),L$=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((n,e)=>(n[e.name]=e,n),{}),CP=o0(I$,n=>["typed-array",n.constructor.name],n=>[...n],(n,e)=>{const t=L$[e[1]];if(!t)throw new Error("Trying to deserialize unknown typed array");return new t(n)});function RP(n,e){return n?.constructor?!!e.classRegistry.getIdentifier(n.constructor):!1}var PP=o0(RP,(n,e)=>["class",e.classRegistry.getIdentifier(n.constructor)],(n,e)=>{const t=e.classRegistry.getAllowedProps(n.constructor);if(!t)return{...n};const i={};return t.forEach(r=>{i[r]=n[r]}),i},(n,e,t)=>{const i=t.classRegistry.getValue(e[1]);if(!i)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(i.prototype),n)}),IP=o0((n,e)=>!!e.customTransformerRegistry.findApplicable(n),(n,e)=>["custom",e.customTransformerRegistry.findApplicable(n).name],(n,e)=>e.customTransformerRegistry.findApplicable(n).serialize(n),(n,e,t)=>{const i=t.customTransformerRegistry.findByName(e[1]);if(!i)throw new Error("Trying to deserialize unknown custom value");return i.deserialize(n)}),O$=[PP,AP,IP,CP],_T=(n,e)=>{const t=xT(O$,r=>r.isApplicable(n,e));if(t)return{value:t.transform(n,e),type:t.annotation(n,e)};const i=xT(EP,r=>r.isApplicable(n,e));if(i)return{value:i.transform(n,e),type:i.annotation}},NP={};EP.forEach(n=>{NP[n.annotation]=n});var D$=(n,e,t)=>{if(ra(e))switch(e[0]){case"symbol":return AP.untransform(n,e,t);case"class":return PP.untransform(n,e,t);
3966case"custom":return IP.untransform(n,e,t);case"typed-array":return CP.untransform(n,e,t);default:throw new Error("Unknown transformation: "+e)}else{const i=NP[e];if(!i)throw new Error("Unknown transformation: "+e);return i.untransform(n,t)}};Ee();var _c=(n,e)=>{if(e>n.size)throw new Error("index out of bounds");const t=n.keys();for(;e>0;)t.next(),e--;return t.next().value};function LP(n){if(Ip(n,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ip(n,"prototype"))throw new Error("prototype is not allowed as a property");if(Ip(n,"constructor"))throw new Error("constructor is not allowed as a property")}var k$=(n,e)=>{LP(e);for(let t=0;t<e.length;t++){const i=e[t];if(Zh(n))n=_c(n,+i);else if(Kh(n)){const r=+i,s=+e[++t]==0?"key":"value",o=_c(n,r);switch(s){case"key":n=o;break;case"value":n=n.get(o);break}}else n=n[i]}return n},Cy=(n,e,t)=>{if(LP(e),e.length===0)return t(n);let i=n;for(let s=0;s<e.length-1;s++){const o=e[s];if(ra(i)){const a=+o;i=i[a]}else if(Yh(i))i=i[o];else if(Zh(i)){const a=+o;i=_c(i,a)}else if(Kh(i)){if(s===e.length-2)break;const a=+o,l=+e[++s]==0?"key":"value",c=_c(i,a);switch(l){case"key":i=c;break;case"value":i=i.get(c);break}}}const r=e[e.length-1];if(ra(i)?i[+r]=t(i[+r]):Yh(i)&&(i[r]=t(i[r])),Zh(i)){const s=_c(i,+r),o=t(s);s!==o&&(i.delete(s),i.add(o))}if(Kh(i)){const s=+e[e.length-2],o=_c(i,s);switch(+r==0?"key":"value"){case"key":{const a=t(o);i.set(a,i.get(o)),a!==o&&i.delete(o);break}case"value":{i.set(o,t(i.get(o)));break}}}return n};function Ry(n,e,t=[]){if(!n)return;if(!ra(n)){qc(n,(s,o)=>Ry(s,e,[...t,...bh(o)]));return}const[i,r]=n;r&&qc(r,(s,o)=>{Ry(s,e,[...t,...bh(o)])}),e(i,t)}function F$(n,e,t){return Ry(e,(i,r)=>{n=Cy(n,r,s=>D$(s,i,t))}),n}function U$(n,e){function t(i,r){const s=k$(n,bh(r));i.map(bh).forEach(o=>{n=Cy(n,o,()=>s)})}if(ra(e)){const[i,r]=e;i.forEach(s=>{n=Cy(n,bh(s),()=>n)}),r&&qc(r,t)}else qc(e,t);return n}var B$=(n,e)=>Yh(n)||ra(n)||Kh(n)||Zh(n)||RP(n,e);function z$(n,e,t){const i=t.get(n);i?i.push(e):t.set(n,[e])}function V$(n,e){const t={};let i;return n.forEach(r=>{if(r.length<=1)return;e||(r=r.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[s,...o]=r;s.length===0?i=o.map(Vv):t[Vv(s)]=o.map(Vv)}),i?Ay(t)?[i]:[i,t]:Ay(t)?void 0:t}var OP=(n,e,t,i,r=[],s=[],o=new Map)=>{var a;const l=C$(n);if(!l){z$(n,r,e);const p=o.get(n);if(p)return i?{transformedValue:null}:p}if(!B$(n,t)){const p=_T(n,t),v=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:n};return l||o.set(n,v),v}if(Ip(s,n))return{transformedValue:null};const c=_T(n,t),u=(a=c?.value)!=null?a:n,h=ra(u)?[]:{},d={};qc(u,(p,v)=>{if(v==="__proto__"||v==="constructor"||v==="prototype")throw new Error(`Detected property ${v}. This is a prototype pollution risk, please remove it from your object.`);const m=OP(p,e,t,i,[...r,v],[...s,n],o);h[v]=m.transformedValue,ra(m.annotations)?d[v]=m.annotations:Yh(m.annotations)&&qc(m.annotations,(g,y)=>{d[TP(v)+"."+y]=g})});const f=Ay(d)?{transformedValue:h,annotations:c?[c.type]:void 0}:{transformedValue:h,annotations:c?[c.type,d]:d};return l||o.set(n,f),f};Ee();Ee();function DP(n){return Object.prototype.toString.call(n).slice(8,-1)}function bT(n){return DP(n)==="Array"}function H$(n){if(DP(n)!=="Object")return!1;const e=Object.getPrototypeOf(n);return!!e&&e.constructor===Object&&e===Object.prototype}function G$(n,e,t,i,r){const s={}.propertyIsEnumerable.call(i,e)?"enumerable":"nonenumerable";s==="enumerable"&&(n[e]=t),r&&s==="nonenumerable"&&Object.defineProperty(n,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}function Py(n,e={}){if(bT(n))return n.map(r=>Py(r,e));if(!H$(n))return n;const t=Object.getOwnPropertyNames(n),i=Object.getOwnPropertySymbols(n);return[...t,...i].reduce((r,s)=>{if(bT(e.props)&&!e.props.includes(s))return r;const o=n[s],a=Py(o,e);return G$(r,s,a,n,e.nonenumerable),r},{})}var yn=class{constructor({dedupe:e=!1}={}){this.classRegistry=new g$,this.symbolRegistry=new wP(t=>{var i;return(i=t.description)!=null?i:""}),this.customTransformerRegistry=new y$,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,i=OP(e,t,this,this.dedupe),r={json:i.transformedValue};i.annotations&&(r.meta={...r.meta,values:i.annotations});const s=V$(t,this.dedupe);return s&&(r.meta={...r.meta,referentialEqualities:s}),r}deserialize(e){const{json:t,meta:i}=e;let r=Py(t);return i?.values&&(r=F$(r,i.values,this)),i?.referentialEqualities&&(r=U$(r,i.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};yn.defaultInstance=new yn;
3966yn.serialize=yn.defaultInstance.serialize.bind(yn.defaultInstance);yn.deserialize=yn.defaultInstance.deserialize.bind(yn.defaultInstance);yn.stringify=yn.defaultInstance.stringify.bind(yn.defaultInstance);yn.parse=yn.defaultInstance.parse.bind(yn.defaultInstance);yn.registerClass=yn.defaultInstance.registerClass.bind(yn.defaultInstance);yn.registerSymbol=yn.defaultInstance.registerSymbol.bind(yn.defaultInstance);yn.registerCustom=yn.defaultInstance.registerCustom.bind(yn.defaultInstance);yn.allowErrorProps=yn.defaultInstance.allowErrorProps.bind(yn.defaultInstance);Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();Ee();var wT;(wT=nt).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__!=null||(wT.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var ST;(ST=nt).__VUE_DEVTOOLS_KIT_RPC_CLIENT__!=null||(ST.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var MT;(MT=nt).__VUE_DEVTOOLS_KIT_RPC_SERVER__!=null||(MT.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var TT;(TT=nt).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__!=null||(TT.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var ET;(ET=nt).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__!=null||(ET.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var AT;(AT=nt).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__!=null||(AT.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null);Ee();Ee();Ee();Ee();Ee();Ee();Ee();function W$(n,e){const t=`▲ ■ ●${n}`;
3966typeof CT=="function"?CT(t,e):console.log(t)}function CT(n,e){throw new Error(n+e)}function Kb(n){let e=0;return n.traverse(t=>{if(VR(t)&&t.type!=="HightlightMesh"){const i=t.geometry,r=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,s=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=r+s+o+a;e+=l}}),e}function RT(n,e,t){n.push(e),n.length>t&&n.shift()}function $$(n){return(n/1024).toFixed(2)}function j$(n){if(!n)return;typeof window<"u"&&!window.__TRES__DEVTOOLS__&&(window.__TRES__DEVTOOLS__=new U7);const e={maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},t=100,i=aG({every:t}),{isSupported:r,memory:s}=cG({interval:t}),o=160;let a=performance.now(),l=0;const c=1,u=({timestamp:d})=>{n.scene.value&&(e.memory.allocatedMem=Kb(n.scene.value)),d-a>=t&&(a=d,RT(e.fps.accumulator,i.value,o),e.fps.value=i.value,r.value&&s.value?.usedJSHeapSize&&(RT(e.memory.accumulator,s.value.usedJSHeapSize/1024/1024,o),e.memory.accumulator.length>0&&(e.memory.currentMem=e.memory.accumulator.reduce((f,p)=>f+p,0)/e.memory.accumulator.length)))},{pause:h}=Db(({delta:d})=>{window.__TRES__DEVTOOLS__&&(u({timestamp:performance.now()}),l+=d,l>=c&&(window.__TRES__DEVTOOLS__.send("context",n),window.__TRES__DEVTOOLS__.send("performance",e),l=0))},{immediate:!0});di(()=>{h()})}const kP=(n,e)=>{if(n.uuid===e)return n;for(const t of n.children){const i=kP(t,e);if(i)return i}};class q$ extends an{type="HightlightMesh";createTime;constructor(...e){super(...e),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*M
3966ath.sin(2.5*e);this.scale.set(t,t,t)}}const FP=n=>{const e={id:`scene-${n.uuid}`,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=Kb(n);return t>0&&e.tags.push({label:`${$$(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(zG(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new We(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function X$(n,e,t=""){const i=t?`${t}.${n}`:n;return{id:`context-${e}-${i}`,label:n,children:[],tags:[]}}function UP(n,e,t=""){n.children.forEac
3966h(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const r=FP(i);e.children.push(r),UP(i,r,t)})}function Iy(n,e,t=new WeakSet,i=0,r=4,s,o=""){if(i>=r||!n||t.has(n))return;const a=i===0?n?.scene?.value?.uuid||Math.random().toString(36).slice(2,11):s;t.add(n),Object.entries(n).forEach(([l,c])=>{if(l.startsWith("_")||typeof c=="function")return;const u=o?`${o}.${l}`:l,h=X$(l,a,o);l!=="scene"&&(Xt(c)?(h.tags.push({label:`Ref<${typeof c.value}>`,textColor:4372611,backgroundColor:15793395}),c.value&&typeof c.value=="object"?Iy(c.value,h,t,i+1,r,a,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}):Iy(c,h,t,i+1,r,a,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 Y$=n=>e=>{if(e.inspectorId===Jh){const t=FP(n.scene.value);UP(n.scene.value,t,e.filter);const i={id:"context-root",label:"Context",children:[],tags:[]};Iy(n,i),e.rootNodes=[t,i]}},K$=(n,{highlightMesh:e,prevInstance:t})=>i=>{if(i.inspectorId!==Jh)return;const r=new Gs({color:11003607,transparent:!0,opacity:.2,depthTest:!1,side:Et});if(i.nodeId.includes("scene")){const s=i.nodeId.match(/^scene-(.+)$/),o=s?s[1]:null;if(!o)return;const[a]=n.scene.value.getObjectsByProperty("uuid",o);if(!a)return;if(t&&e&&e.parent&&t.remove(e),VR(a)){const l=new q$(a.geometry.clone(),r);a.add(l),e=l,t=a}if(i.state={object:Object.entries(a).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")},XR(a)){const l={...i.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:Kb(a),calls:n.renderer.instance.info.render.calls,triangles:n.renderer.instance.info.render.triangles,points:n.renderer.instance.info.render.points,lines:n.renderer.instance.info.render.lines}}]};"programs"in n.renderer.instance.info&&l.state.push({key:"Programs",value:n.renderer.instance.info.programs?.map(c=>({...c,programName:c.name}))}),i.state=l}}else if(i.nodeId.includes("context")){const s=i.nodeId.match(/^context-([^-]+(?:-[^-]+)*)-(.+)$/),o=s?s[2]:"context";if(!o||o==="context"){i.state={object:Object.entries(n).filter(([c])=>!c.startsWith("_")&&c!=="parent").map(([c,u])=>({key:c,value:Xt(u)?u.value:u,editable:!1}))};return}const a=o.split(".");let l=n;for(const c of a){if(!l||typeof l!="object")break;l=Xt(l[c])?l[c].value:l[c]}l!==void 0&&(i.state={object:Object.entries(l).filter(([c])=>!c.startsWith("_")&&c!=="parent").map(([c,u])=>Xt(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})})}},Z$=(n,e,t,i)=>{const r=kP(n,e);if(!r){console.warn("Object with UUID not found in the scene.");return}let s=r;for(let a=0;a<t.length-1;a++)if(s[t[a]]!==void 0)s=s[t[a]];else{console.warn(`Property path is not valid: ${t.join(".")}`);return}const o=t[t.length-1];s[o]!==void 0?s[o]=i:console.warn(`Property path is not valid: ${t.join(".")}`)},J$=n=>e=>{if(e.inspectorId===Jh&&e.nodeId.includes("scene")){const t=e.nodeId.match(/^scene-(.+)$/),i=t?t[1]:null;if(!i)return;Z$(n.scene.value,i,e.path,e.state.value)}},Jh="tres:inspector";function Q$(n,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:n},i=null,r=null;j$(e),a$(t,s=>{typeof s.now!="function"&&W$("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:Jh,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{s.sendInspectorTree(Jh)},1e3),setInterval(()=>{s.notifyComponentUpdate()},5e3),s.on.getInspectorTree(Y$(e)),s.on.getInspectorState(K$(e,{highlightMesh:i,prevInstance:r})),s.on.editInspectorState(J$(e))})}const ej=["data-scene","data-tres"],tj=qe({__name:"TresCanvas",props:{camera:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},antialias:{type:Boolean,default:!0},stencil:{type:Boolean,default:void 0},depth:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},clearColor:{default:"#000000"},clearAlpha:{default:1},shadows:{type:Boolean,default:void 0},toneMapping:{default:$_},shadowMapType:{default:W_},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},renderer:{}},emits:["ready","pointermissed","render","beforeLoop","loop","click","contextmenu","pointermove","pointerenter","pointerleave","pointerover","pointerout","dblclick","pointerdown","pointerup","pointercancel","lostpointercapture","wheel"],setup(n,{expose:e,emit:t}){const i=n,r=t,s=la(),o=Te(),a=Mt(new vl),l=Gn();by(B9);const c=(p,v=!1)=>qe({setup(){const m=Gn()?.appContext;m&&(m.app=l?.appContext.app);const g={};function y(x){x&&(x.parent&&y(x.parent),x.provides&&Object.assign(g,x.provides))}return l?.parent&&i.enableProvideBridge&&(y(l.parent),Reflect.ownKeys(g).forEach(x=>{Mr(x,g[x])})),Mr(P7,p),Mr("extend",by),typeof window<"u"&&m?.app&&Q$(m?.app,p),()=>
3966Yn(vn,null,v?[]:s.default())}}),u=(p,v=!1)=>{const m=c(p,v),{render:g}=M2(k7(p));g(Yn(m),a.value)},h=(p,v=!1)=>{Vm(p.scene.value),v&&(p.renderer.instance.dispose(),p.renderer.instance instanceof Nb&&(p.renderer.instance.renderLists.dispose(),p.renderer.instance.forceContextLoss())),a.value.__tres={root:p}},d=Mt(null);e({context:d,dispose:()=>h(d.value,!0)});const f=()=>{h(d.value),u(d.value,!0)};return On(()=>{const p=o;d.value=I7({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i});const{camera:v,renderer:m}=d.value,{registerCamera:g,cameras:y,activeCamera:x,deregisterCamera:_}=v;u(d.value);const T=()=>{const S=new xn(45,window.innerWidth/window.innerHeight,.1,1e3);S.position.set(3,3,3),S.lookAt(0,0,0),g(S);const E=un(()=>{y.value.length>=2&&(S.removeFromParent(),_(S),E?.())})};d.value.events.onPointerMissed(S=>{r("pointermissed",S)}),Je(()=>i.camera,(S,E)=>{S&&g(tt(S),!0),E&&(tt(E).removeFromParent(),_(tt(E)))},{immediate:!0}),x.value||T(),m.onRender(()=>{d.value&&r("render",d.value)}),m.loop.onLoop(S=>{d.value&&r("loop",{...d.value,...S})}),m.loop.onBeforeLoop(S=>{d.value&&r("beforeLoop",{...d.value,...S})}),m.onReady(()=>{r("ready",d.value)})}),On(async()=>{await Bm(3e3),d.value&&(!d.value.sizes.width||!d.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.")}),di(f),(p,v)=>(pe(),pt("canvas",{ref_key:"canvasRef",ref:o,"data-scene":a.value.uuid,class:qt(p.$attrs.class),"data-tres":`tresjs ${L(NG).version}`,style:kr({display:"block",width:"100%",height:"100%",position:n.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,ej))}});function nj(n){return typeof n=="number"?[n,n,n]:n instanceof z?[n.x,n.y,n.z]:n}const ij=Te(),rj=Te({}),a0=()=>({playerId:ij,players:rj,spawnPlayer:e=>({id:e,position:[-.1,.39,0],animation:zn.IDLE_FRONT,sex:qr.MAN,parts:{[Ot.BODY]:{set:Ys[qr.MAN][Ot.BODY][0].set,kind:Ys[qr.MAN][Ot.BODY][0].list[0].kind,type:Ys[qr.MAN][Ot.BODY][0].list[0].type[0]},[Ot.FACE]:{set:Ys[qr.MAN][Ot.FACE][0].set,kind:Ys[qr.MAN][Ot.FACE][0].list[0].kind,type:Ys[qr.MAN][Ot.FACE][0].list[0].type[0]},[Ot.HAIR_01]:{set:Ys[qr.MAN][Ot.HAIR_01][0].set,kind:Ys[qr.MAN][Ot.HAIR_01][0].list[0].kind,type:Ys[qr.MAN][Ot.HAIR_01][0].list[0].type[2]},[Ot.HAIR_02]:{set:null,kind:null,type:null},[Ot.SUB_01]:{set:null,kind:null,type:null},[Ot.SUB_02]:{set:null,kind:null,type:null},[Ot.SUB_03]:{set:null,kind:null,type:null}}})}),{playerId:sj,players:Gf,spawnPlayer:PT}=a0(),{open:oj,send:aj,ws:lj,status:cj}=uG("/ws/game",{immediate:!1,onMessage(n,{data:e}){const t=JSON.parse(e);if(t.eventType===ja.CONNECTED){sj.value=t.peerId;for(const i of t.data.peerIds)Gf.value[i]=PT(i);return}if(t.eventType===ja.JOIN){Gf.value[t.peerId]=PT(t.peerId);return}if(t.eventType===ja.LEAVE){Gf.value=Object.fromEntries(Object.entries(Gf.value).filter(([i])=>i!==t.peerId));return}}}),BP=()=>{const n=ge(()=>cj.value==="OPEN");return{ws:lj,isConnected:n,open:oj,send:aj}},uj=Te([]),hj=Te(),zP=()=>({chats:uj,latestChat:hj}),dj={name:"コントローラー"},fj=qe({__name:"controller",setup(n){const{onBeforeRender:e}=us(),{playerId:t,players:i}=a0(),{left:r,right:s,up:o,down:a,a:l}=UR(),{ws:c,send:u}=BP(),{chats:h,latestChat:d}=zP(),f=ge(()=>t.value?i.value[t.value]:void 0),p=ge(()=>r?.value||s?.value||o?.value||a?.value),v=K9(()=>{if(!t.value||!f.value)return;const g={peerId:t.value,eventType:ja.MOVE,data:{position:f.value.position,animation:f.value.animation}};u(JSON.stringify(g))},30,!0);On(()=>{c.value?.addEventListener("message",g=>{const y=JSON.parse(g.data);i.value[y.peerId]&&(y.eventType===ja.MOVE&&(i.value[y.peerId].animation=y.data.animation,i.value[y.peerId].position=y.data.position),y.eventType===ja.CHAT&&(d.value={peerId:y.peerId,message:y.data.message},h.value=[...h.value,{peerId:y.peerId,message:y.data.message}]))})}),Je(f,v,{deep:!0}),Je([l],()=>{if(!t.value||!i.value[t.value]||!l?.value)return;const g={peerId:t.value,eventType:ja.CHAT,data:{message:"こんにちは〜!"}};u(JSON.stringify(g)),d.value={peerId:g.peerId,message:g.data.message}});let m=null;return Je(d,()=>{d.value&&(m&&clearTimeout(m),m=setTimeout(()=>{d.value=void 0},3e3))}),e(({delta:g,elapsed:y})=>
3966{if(t.value&&i.value[t.value]){if(p.value){let[x,_,T]=i.value[t.value].position;a?.value&&(T+=g,i.value[t.value].animation=zn.WALK_FRONT),r?.value&&(x-=g,i.value[t.value].animation=zn.WALK_LEFT),s?.value&&(x+=g,i.value[t.value].animation=zn.WALK_RIGHT),o?.value&&(T-=g,i.value[t.value].animation=zn.WALK_BACK),i.value[t.value].position=[x,_,T];return}i.value[t.value].animation=i.value[t.value].animation===zn.WALK_BACK?zn.IDLE_BACK:i.value[t.value].animation===zn.WALK_LEFT?zn.IDLE_LEFT:i.value[t.value].animation===zn.WALK_RIGHT?zn.IDLE_RIGHT:i.value[t.value].animation===zn.WALK_FRONT?zn.IDLE_FRONT:i.value[t.value].animation}}),(g,y)=>(pe(),pt("TresGroup",dj))}}),pj=Object.assign(fj,{__name:"Controller"});function mj(n){const e=gj(n),t=[];for(const{startFrame:i,endFrame:r,duration:s}of e)if(!(s<=0))if(r<0||i===r){for(let o=0;o<s;o++)t.push(i);continue}else{const o=Math.sign(r-i);for(let a=i;a!==r+o;a+=o)for(let l=0;l<s;l++)t.push(a)}return t}function gj(n){let e="START_FRAME_IN";const t=[];for(const{name:i,value:r,startI:s}of vj(n))e==="START_FRAME_IN"?i==="NUMBER"?(t.push({startFrame:r,endFrame:r,duration:1}),e="START_FRAME_OUT"):Da("number",i,n,s):e==="START_FRAME_OUT"?i==="COMMA"?e="START_FRAME_IN":i==="HYPHEN"?e="END_FRAME_IN":i==="OPEN_PAREN"?e="DURATION_IN":Da('",", "-", "("',i,n,s):e==="END_FRAME_IN"?i==="NUMBER"?(t[t.length-1].endFrame=r,e="END_FRAME_OUT"):Da("number",i,n,s):e==="END_FRAME_OUT"?i==="COMMA"?e="START_FRAME_IN":i==="OPEN_PAREN"?e="DURATION_IN":Da("',' or '('",i,n,s):e==="DURATION_IN"?i==="NUMBER"?(t[t.length-1].duration=r,e="DURATION_OUT"):Da("number",i,n,s):e==="DURATION_OUT"?i==="CLOSE_PAREN"?e="NEXT_OR_DONE":Da('"("',i,n,s):e==="NEXT_OR_DONE"&&(i==="COMMA"?e="START_FRAME_IN":Da('","',i,n,s));return t}function vj(n){const e=[];for(let t=0;t<n.length;t++){const i=n[t];if("0123456789".includes(i))e.length&&e[e.length-1].name==="NUMBER"?(e[e.length-1].value*=10,e[e.length-1].value+=Number.parseInt(i)):e.push({name:"NUMBER",value:Number.parseInt(i),startI:t});else{if(i===" ")continue;i===","?e.push({name:"COMMA",value:-1,startI:t}):i==="("?e.push({name:"OPEN_PAREN",value:-1,startI:t}):i===")"?e.push({name:"CLOSE_PAREN",value:-1,startI:t}):i==="-"?e.push({name:"HYPHEN",value:-1,startI:t}):xj("0123456789,-()",i,n,t)}}return e}function xj(n,e,t,i){ia(`Cientos AnimationDefinitionParser: Unexpected character while processing animation definition: expected ${n}, got ${e}.
3967${t}
3968${Array.from({length:i+1}).join(" ")}^`)}function Da(n,e,t,i){ia(`Cientos AnimationDefinitionParser: Syntax error while processing animation definition: expected ${n}, got ${e}.
3969${t}
3970${Array.from({length:i+1}).join(" ")}^`)}const yj=/\d*$/,_j=/_*\d*$/;function bj(n){return n.replace(_j,"")}function wj(n){const e=n.match(yj);return e?Number.parseInt(e[e.length-1]):null}async function Sj(n,e){const t=new Mb,i=new Promise((s,o)=>{t.load(n,s,void 0,o)}),r=typeof e!="string"?new Promise(s=>s(e)):fetch(e).then(s=>s.json()).catch(s=>ia(`Cientos Atlas - ${s}`));return Promise.all([i,r]).then(([s,o])=>{const a=Mj(o,s.image.width,s.image.height);return[s,a]})}function Mj(n,e,t){const i=typeof n=="number"||Array.isArray(n)?Cj(n,e,t):Tj(n,e,t);return{frames:i,animations:VP(i)}}function nh(n,e,t){let i;return typeof e=="string"?i=Pj(n,e):typeof e=="number"?i=IT(n,e,e):i=IT(n,e[0],e[1]),t?i.toReversed():i}function Zb(){return{name:"null",width:0,height:0,offsetX:0,offsetY:0,repeatX:0,repeatY:0}}function Tj(n,e,t){return Array.isArray(n.frames)?Ej(n,e,t):Aj(n,e,t)}function Ej(n,e,t){const i=1/e,r=1/t;return n.frames.map(s=>({name:s.filename,offsetX:s.frame.x*i,offsetY:1-(s.frame.y+s.frame.h)*r,repeatX:s.frame.w*i,repeatY:s.frame.h*r,width:s.frame.w,height:s.frame.h}))}function Aj(n,e,t){const i=1/e,r=1/t;return Object.entries(n.frames).map(([s,o])=>({name:s,offsetX:o.frame.x*i,offsetY:1-(o.frame.y+o.frame.h)*r,repeatX:o.frame.w*i,repeatY:o.frame.h*r,width:o.frame.w,height:o.frame.h}))}function Cj(n,e,t,i="default"){const[r,s]=Array.isArray(n)?n:[n,1],o=e/r,a=t/s,l=(r*s).toString().length,c=1/r,u=1/s,h=[];let d=0;for(let f=s-1;f>=0;f--)for(let p=0;p<r;p++)d++,h.push({name:i+String(d).padStart(l,"0"),offsetX:p*c,offsetY:f*u,repeatX:c,repeatY:u,width:o,height:a});return h}function Rj(n,e={}){const t=VP(n.frames);for(const[i,r]of Object.entries(e)){const s=nh(n,i,!1),o=mj(r);for(const a of o)(a<0||s.length<=a)&&ia(`Cientos Atlas: Attempting to access frame index ${a} in animation ${i}, but it does not exist.`);t[i]=o.map(a=>s[a])}n.animations=t}function Pj(n,e){if(!(e in n.animations)){const t=Object.keys(n.animations).map(i=>`* ${i}
3971`).join("");return ia(`Cientos Atlas: getAtlasFramesByAnimationName
3972The animation name "${e}" does not exist in this atlas.
3973Available names:
3974${t}`),[Zb()]}return n.animations[e]}function IT(n,e,t){if(e<0||n.frames.length<=e||t<0||n.frames.length<=t)return ia(`Cientos Atlas: getFramesByIndex – [${e}, ${t}] is out of bounds.`),[Zb()];const i=[],r=Math.sign(t-e);if(r===0)return[n.frames[e]];for(let s=e;s!==t+r;s+=r)i.push(n.frames[s]);return i}function VP(n){const e={};for(const t of n)if(wj(t.name)!==null){const i=bj(t.name);Object.prototype.hasOwnProperty.call(e,i)?e[i].push(t):e[i]=[t]}for(const t of Object.values(e))t.sort((i,r)=>i.name.localeCompare(r.name));return e}const Ij=["scale","position"],Nj=["map","alphaTest"],Lj=["scale","position"],Oj=["side","map","alphaTest","depthWrite","depthTest"],Wf=.01,HP=qe({__name:"component",props:{image:{},atlas:{},definitions:{},fps:{default:30},loop:{type:Boolean,default:!0},animation:{default:0},paused:{type:Boolean,default:!1},reversed:{type:Boolean,default:!1},flipX:{type:Boolean,default:!1},resetOnEnd:{type:Boolean,default:!1},asSprite:{type:Boolean,default:!0},center:{default:()=>[.5,.5]}
3974,alphaTest:{default:0},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0}},emits:["frame","end","loop"],async setup(n,{expose:e,emit:t}){let i,r;const s=n,o=t,{invalidate:a}=El();Je(s,()=>{a()});const l=Te(0),c=Te(0),u=Te(0),h=Te(0),d=Mt();e({instance:d});const[f,p]=([i,r]=zs(()=>Sj(s.image,s.atlas)),i=await i,r(),i),v=Array.isArray(f)?f[0]:f;v.matrixAutoUpdate=!1;let m=nh(p,s.animation,s.reversed),g=.5,y=.5,x=1,_=Zb(),T=null,S=0,E=!1,M=!0;us().onBeforeRender(({delta:w})=>{for(!s.paused&&!E&&(x-=w*s.fps);x<=0;)x++,S++,s.loop?(S>=m.length&&o("loop",m[m.length-1].name),S%=m.length):S>=m.length&&(E=!0,S=s.resetOnEnd?0:m.length-1,o("end",m[m.length-1].name));m[S]!==_&&(_=m[S],T=_.name,b()),M&&(M=!1,v.offset.x=_.offsetX+(s.flipX?_.repeatX:0),v.offset.y=_.offsetY,v.repeat.x=_.repeatX*(s.flipX?-1:1),v.repeat.y=_.repeatY,v.updateMatrix(),u.value=_.width*Wf,h.value=_.height*Wf,l.value=(.5-g)*_.width*Wf,c.value=(.5-y)*_.height*Wf),T&&(o("frame",T),T=null)});function b(){M=!0}return Je(()=>s.animation,(w,A)=>{JSON.stringify(w)!==JSON.stringify(A)&&(m=nh(p,s.animation,s.reversed),S=0,x=1,E=!1,b())},{immediate:!0}),Je(()=>
3974s.reversed,()=>{S=(m.length-S-1)%m.length,m=nh(p,s.animation,s.reversed),E&&(S=s.resetOnEnd?0:m.length-1),b()}),Je(()=>s.paused,()=>{E=!1}),Je(()=>s.loop,()=>{E&&s.loop&&(E=!1)}),Je(()=>s.resetOnEnd,()=>{E&&(S=s.resetOnEnd?0:m.length-1,b())}),Je(()=>s.flipX,b),Je(()=>[s.center],()=>{[g,y]=nj(s.center),b()},{immediate:!0}),Je(()=>[s.definitions],()=>{Rj(p,s.definitions),m=nh(p,s.animation,s.reversed),x=1,S=0,b()},{immediate:!0}),di(()=>{v.dispose()}),(w,A)=>(pe(),pt("TresGroup",{ref_key:"groupRef",ref:d},[s.asSprite?(pe(),pt("TresSprite",{key:0,scale:[u.value,h.value,1],position:[l.value,c.value,0]},[Me("TresSpriteMaterial",{toneMapped:!1,map:L(v),transparent:!0,alphaTest:s.alphaTest},null,8,Nj)],8,Ij)):(pe(),pt("TresMesh",{key:1,scale:[u.value,h.value,1],position:[l.value,c.value,0]},[A[0]||(A[0]=Me("TresPlaneGeometry",{args:[1,1]},null,-1)),Me("TresMeshBasicMaterial",{toneMapped:!1,side:L(Et),map:L(v),transparent:!0,alphaTest:s.alphaTest,depthWrite:s.depthWrite,depthTest:s.depthTest},null,8,Oj)],8,Lj)),lt(w.$slots,"default")],512))}});function Dj(n){return Jc()?(cg(n),!0):!1}const kj=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Fj=Object.prototype.toString,Uj=n=>Fj.call(n)==="[object Object]";function Hv(n){return Array.isArray(n)?n:[n]}function Bj(n,e,t){return Je(n,e,{...t,immediate:!0})}const zj=kj?window:void 0;function Vj(n){var e;const t=tt(n);return(e=t?.$el)!=null?e:t}function Gv(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),r=ge(()=>{const a=Hv(tt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),s=Bj(()=>{var a,l;return[(l=(a=r.value)==null?void 0:a.map(c=>Vj(c)))!=null?l:[zj].filter(c=>c!=null),Hv(tt(r.value?n[1]:n[0])),Hv(L(r.value?n[2]:n[1])),tt(r.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!a?.length||!l?.length||!c?.length)return;const h=Uj(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(f=>c.map(p=>i(d,f,p,h)))))},{flush:"post"}),o=()=>{s(),t()};return Dj(t),o}function Jb(n,e,t,i){const r=class extends pn{key="";constructor(s={}){const o=Object.entries(n);super({uniforms:o.reduce((a,[l,c])=>{const u=Og.clone({[l]:{value:c}});return{...a,...u}},{}),vertexShader:e,fragmentShader:t}),o.forEach(([a])=>Object.defineProperty(this,a,{get:()=>this.uniforms[a].value,set:l=>this.uniforms[a].value=l})),Object.assign(this,s)}};return r.key=pd.generateUUID(),r}Jb({color:new We("white"),scale:new de(1,1),imageBounds:new de(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},`
3975    varying vec2 vUv;
3976    varying vec2 vPos;
3977    void main() {
3978      gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);
3979      vUv = uv;
3980      vPos = position.xy;
3981    }
3982  `,`
3983    // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44
3984    varying vec2 vUv;
3985    varying vec2 vPos;
3986    uniform vec2 scale;
3987    uniform vec2 imageBounds;
3988    uniform float resolution;
3989    uniform vec3 color;
3990    uniform sampler2D map;
3991    uniform float radius;
3992    uniform float zoom;
3993    uniform float grayscale;
3994    uniform float opacity;
3995    const vec3 luma = vec3(.299, 0.587, 0.114);
3996    vec4 toGrayscale(vec4 color, float intensity) {
3997      return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a);
3998    }
3999    vec2 aspect(vec2 size) {
4000      return size / min(size.x, size.y);
4001    }
4002    
4003    const float PI = 3.14159265;
4004      
4005    // from https://iquilezles.org/articles/distfunctions
4006    float udRoundBox( vec2 p, vec2 b, float r ) {
4007      return length(max(abs(p)-b+r,0.0))-r;
4008    }
4009  
4010    void main() {
4011      vec2 s = aspect(scale);
4012      vec2 i = aspect(imageBounds);
4013      float rs = s.x / s.y;
4014      float ri = i.x / i.y;
4015      vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x);
4016      vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new;
4017      vec2 uv = vUv * s / new + offset;
4018      vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5);
4019  
4020      vec2 res = vec2(scale * resolution);
4021      vec2 halfRes = 0.5 * res;
4022      float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius);    
4023        vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b));
4024      gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale);
4025      
4026      #include <tonemapping_fragment>
4027      #include <colorspace_fragment>
4028    }
4029  `);function Ny(n){return ZG(Mb,n,{initialValue:new Sn})}(function(){const n=new At,e=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),t=new vd(e,5);return n.setIndex([0,1,2,0,2,3]),n.setAttribute("position",new bo(t,3,0,!1)),n.setAttribute("uv",new bo(t,2,3,!1)),n})();pd.clamp;pd.lerp;const Hj=parseInt(ua.replace(/\D+/g,""));var Td=Uint8Array,GP=Uint16Array,Gj=Uint32Array,Wj=new Td([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),$j=new Td([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),WP=function(n,e){for(var t=new GP(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];for(var r=new Gj(t[30]),i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},$P=WP(Wj,2),jj=$P[0],qj=$P[1];jj[28]=258,qj[258]=28;WP($j,0);var Xj=new GP(32768);for(var wn=0;wn<32768;++wn){var Do=(wn&43690)>>>1|(wn&21845)<<1;Do=(Do&52428)>>>2|(Do&13107)<<2,Do=(Do&61680)>>>4|(Do&3855)<<4,Xj[wn]=((Do&65280)>>>8|(Do&255)<<8)>>>1}var l0=new Td(288);for(var wn=0;wn<144;++wn)l0[wn]=8;for(var wn=144;wn<256;++wn)l0[wn]=9;for(var wn=256;wn<280;++wn)l0[wn]=7;for(var wn=280;wn<288;++wn)l0[wn]=8;var Yj=new Td(32);for(var wn=0;wn<32;++wn)Yj[wn]=5;var Kj=new Td(0),Zj=typeof TextDecoder<"u"&&new TextDecoder,Jj=0;try{Zj.decode(Kj,{stream:!0}),Jj=1}catch{}var Qj=Object.defineProperty,eq=(n,e,t)=>e in n?Qj(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,tq=(n,e,t)=>(eq(n,e+"",t),t);const NT=(()=>{const n=class extends an{constructor(t,i={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new xn;const r=this,s=i.color!==void 0?new We(i.color):new We(8355711),o=i.textureWidth||512,a=i.textureHeight||512,l=i.clipBias||0,c=i.shader||n.ReflectorShader,u=i.multisample!==void 0?i.multisample:4,h=new sr,d=new z,f=new z,p=new z,v=new ht,m=new z(0,0,-1),g=new Ft,y=new z,x=new z,_=new Ft,T=new ht,S=this.camera,E=new En(o,a,{samples:u,type:Gi}),M=new pn({uniforms:Og.clone(c.uniforms),fragmentShader:c.fragmentShader,vertexShader:c.vertexShader});M.uniforms.tDiffuse.value=E.texture,M.uniforms.color.value=s,M.uniforms.textureMatrix.value=T,this.material=M,this.onBeforeRender=function(b,w,A){if(f.setFromMatrixPosition(r.matrixWorld),p.setFromMatrixPosition(A.matrixWorld),v.extractRotation(r.matrixWorld),d.set(0,0,1),d.applyMatrix4(v),y.subVectors(f,p),y.dot(d)>0)return;y.reflect(d).negate(),y.add(f),v.extractRotation(A.matrixWorld),m.set(0,0,-1),m.a
4029pplyMatrix4(v),m.add(p),x.subVectors(f,m),x.reflect(d).negate(),x.add(f),S.position.copy(y),S.up.set(0,1,0),S.up.applyMatrix4(v),S.up.reflect(d),S.lookAt(x),S.far=A.far,S.updateMatrixWorld(),S.projectionMatrix.copy(A.projectionMatrix),T.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),T.multiply(S.projectionMatrix),T.multiply(S.matrixWorldInverse),T.multiply(r.matrixWorld),h.setFromNormalAndCoplanarPoint(d,f),h.applyMatrix4(S.matrixWorldInverse),g.set(h.normal.x,h.normal.y,h.normal.z,h.constant);const P=S.projectionMatrix;_.x=(Math.sign(g.x)+P.elements[8])/P.elements[0],_.y=(Math.sign(g.y)+P.elements[9])/P.elements[5],_.z=-1,_.w=(1+P.elements[10])/P.elements[14],g.multiplyScalar(2/g.dot(_)),P.elements[2]=g.x,P.elements[6]=g.y,P.elements[10]=g.z+1-l,P.elements[14]=g.w,r.visible=!1;const H=b.getRenderTarget(),B=b.xr.enabled,G=b.shadowMap.autoUpdate,O=b.toneMapping;let $=!1;"outputColorSpace"in b?$=b.outputColorSpace==="srgb":$=b.outputEncoding===3001,b.xr.enabled=!1,b.shadowMap.autoUpdate=!1,"outputColorSpace"in b?b.outputColorSpace="srgb-linear":b.outputEncoding=3e3,b.toneMapping=As,b.setRenderTarget(E),b.state.buffers.depth.setMask(!0),b.autoClear===!1&&b.clear(),b.render(w,S),b.xr.enabled=B,b.shadowMap.autoUpdate=G,b.toneMapping=O,"outputColorSpace"in b?b.outputColorSpace=$?"srgb":"srgb-linear":b.outputEncoding=$?3001:3e3,b.setRenderTarget(H);const F=A.viewport;F!==void 0&&b.state.viewport(F),r.visible=!0},this.getRenderTarget=function(){return E},this.dispose=function(){E.dispose(),r.material.dispose()}}};let e=n;return tq(e,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:`
4030		uniform mat4 textureMatrix;
4031		varying vec4 vUv;
4032
4033		#include <common>
4034		#include <logdepthbuf_pars_vertex>
4035
4036		void main() {
4037
4038			vUv = textureMatrix * vec4( position, 1.0 );
4039
4040			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4041
4042			#include <logdepthbuf_vertex>
4043
4044		}`,fragmentShader:`
4045		uniform vec3 color;
4046		uniform sampler2D tDiffuse;
4047		varying vec4 vUv;
4048
4049		#include <logdepthbuf_pars_fragment>
4050
4051		float blendOverlay( float base, float blend ) {
4052
4053			return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );
4054
4055		}
4056
4057		vec3 blendOverlay( vec3 base, vec3 blend ) {
4058
4059			return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );
4060
4061		}
4062
4063		void main() {
4064
4065			#include <logdepthbuf_fragment>
4066
4067			vec4 base = texture2DProj( tDiffuse, vUv );
4068			gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );
4069
4070			#include <tonemapping_fragment>
4071			#include <${Hj>=154?"colorspace_fragment":"encodings_fragment"}>
4072
4073		}`}),e})();var nq=Object.defineProperty,iq=(n,e,t)=>e in n?nq(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,rq=(n,e,t)=>(iq(n,e+"",t),t);let sq=class{constructor(){rq(this,"_listeners")}addEventListener(n,e){this._listeners===void 0&&(this._listeners={});const t=this._listeners;t[n]===void 0&&(t[n]=[]),t[n].indexOf(e)===-1&&t[n].push(e)}hasEventListener(n,e){if(this._listeners===void 0)return!1;const t=this._listeners;return t[n]!==void 0&&t[n].indexOf(e)!==-1}removeEventListener(n,e){if(this._listeners===void 0)return;const t=this._listeners[n];if(t!==void 0){const i=t.indexOf(e);i!==-1&&t.splice(i,1)}}dispatchEvent(n){if(this._listeners===void 0)return;const e=this._listeners[n.type];if(e!==void 0){n.target=this;const t=e.slice(0);for(let i=0,r=t.length;i<r;i++)t[i].call(this,n);n.target=null}}};var oq=Object.defineProperty,aq=(n,e,t)=>e in n?oq(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ft=(n,e,t)=>(aq(n,typeof e!="symbol"?e+"":e,t),t);const $f=new Ds,LT=new sr,lq=Math.cos(70*(Math.PI/180)),OT=(n,e)=>(n%e+e)%e;class cq extends sq{constructor(e,t){super(),ft(this,"object"),ft(this,"domElement"),ft(this,"enabled",!0),ft(this,"target",new z),ft(this,"minDistance",0),ft(this,"maxDistance",1/0),ft(this,"minZoom",0),ft(this,"maxZoom",1/0),ft(this,"minPolarAngle",0),ft(this,"maxPolarAngle",Math.PI),ft(this,"minAzimuthAngle",-1/0),ft(this,"maxAzimuthAngle",1/0),ft(this,"enableDamping",!1),ft(this,"dampingFactor",.05),ft(this,"enableZoom",!0),ft(this,"zoomSpeed",1),ft(this,"enableRotate",!0),ft(this,"rotateSpeed",1),ft(this,"enablePan",!0),ft(this,"panSpeed",1),ft(this,"screenSpacePanning",!0),ft(this,"keyPanSpeed",7),ft(this,"zoomToCursor",!1),ft(this,"autoRotate",!1),ft(this,"autoRotateSpeed",2),ft(this,"reverseOrbit",!1),ft(this,"reverseHorizontalOrbit",!1),ft(this,"reverseVerticalOrbit",!1),ft(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ft(this,"mouseButtons",{LEFT:bs.ROTATE,MIDDLE:bs.DOLLY,RIGHT:bs.PAN}),ft(this,"touches",{ONE:lo.ROTATE,TWO:lo.DOLLY_PAN}),ft(this,"target0"),ft(this,"position0"),ft(this,"zoom0"),ft(this,"_domElementKeyEvents",null),ft(this,"getPolarAngle"),ft(this,"getAzimuthalAngle"),ft(this,"setPolarAngle"),ft(this,"setAzimuthalAngle"),ft(this,"getDistance"),ft(this,"getZoomScale"),ft(this,"listenToKeyEvents"),ft(this,"stopListenToKeyEvents"),ft(this,"saveState"),ft(this,"reset"),ft(this,"update"),ft(this,"connect"),ft(this,"dispose"),ft(this,"dollyIn"),ft(this,"dollyOut"),ft(this,"getScale"),ft(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=j=>{let ce=OT(j,2*Math.PI),Ce=u.phi;Ce<0&&(Ce+=2*Math.PI),ce<0&&(ce+=2*Math.PI);let W=Math.abs(ce-Ce);2*Math.PI-W<W&&(ce<Ce?ce+=2*Math.PI:Ce+=2*Math.PI),h.phi=ce-Ce,i.update()},this.setAzimuthalAngle=j=>{let ce=OT(j,2*Math.PI),Ce=u.theta;Ce<0&&(Ce+=2*Math.PI),ce<0&&(ce+=2*Math.PI);let W=Math.abs(ce-Ce);2*Math.PI-W<W&&(ce<Ce?ce+=2*Math.PI:Ce+=2*Math.PI),h.theta=ce-Ce,i.update()},this.getDistance=()=>i.object.position.distanceTo(i.target),this.listenToKeyEvents=j=>{j.addEventListener("keydown",le),this._domElementKeyEvents=j},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",le),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const j=new z,ce=new z(0,1,0),Ce=new ui().setFromUnitVectors(e.up,ce),W=Ce.clone().invert(),Ue=new z,Oe=new ui,Ve=2*Math.PI;return function(){const Pe=i.object.position;Ce.setFromUnitVectors(e.up,ce),W.copy(Ce).invert(),j.copy(Pe).sub(i.target),j.applyQuaternion(Ce),u.setFromVector3(j),i.autoRotate&&l===a.NONE&&B(P()),i.enableDamping?(u.theta+=h.theta*i.dampingFactor,u.phi+=h.phi*i.dampingFactor):(u.theta+=h.theta,u.phi+=h.phi);let we=i.minAzimuthAngle,Ke=i.maxAzimuthAngle;isFinite(we)&&isFinite(Ke)&&(we<-Math.PI?we+=Ve:we>Math.PI&&(we-=Ve),Ke<-Math.PI?Ke+=Ve:Ke>Math.PI&&(Ke-=Ve),we<=Ke?u.theta=Math.max(we,Math.min(Ke,u.theta)):u.theta=u.theta>(we+Ke)/2?Math.max(we,u.theta):Math.min(Ke,u.theta)),u.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,u.phi)),u.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(f,i.dampingFactor):i.target.add(f),i.zoomToCursor&&b||i.object.isOrthographicCamera?u.radius=Le(u.radiu
4073s):u.radius=Le(u.radius*d),j.setFromSpherical(u),j.applyQuaternion(W),Pe.copy(i.target).add(j),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,f.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),f.set(0,0,0));let vt=!1;if(i.zoomToCursor&&b){let Qt=null;if(i.object instanceof xn&&i.object.isPerspectiveCamera){const Ht=j.length();Qt=Le(Ht*d);const Pi=Ht-Qt;i.object.position.addScaledVector(E,Pi),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Ht=new z(M.x,M.y,0);Ht.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/d)),i.object.updateProjectionMatrix(),vt=!0;const Pi=new z(M.x,M.y,0);Pi.unproject(i.object),i.object.position.sub(Pi).add(Ht),i.object.updateMatrixWorld(),Qt=j.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Qt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Qt).add(i.object.position):($f.origin.copy(i.object.position),$f.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot($f.direction))<lq?e.lookAt(i.target):(LT.setFromNormalAndCoplanarPoint(i.object.up,i.target),$f.intersectPlane(LT,i.target))))}else i.object instanceof rs&&i.object.isOrthographicCamera&&(vt=d!==1,vt&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/d)),i.object.updateProjectionMatrix()));return d=1,b=!1,vt||Ue.distanceToSquared(i.object.position)>c||8*(1-Oe.dot(i.object.quaternion))>c?(i.dispatchEvent(r),Ue.copy(i.object.position),Oe.copy(i.object.quaternion),vt=!1,!0):!1}})(),this.connect=j=>{i.domElement=j,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Ye),i.domElement.addEventListener("pointerdown",te),i.domElement.addEventListener("pointercancel",C),i.domElement.addEventListener("wheel",me)},this.dispose=()=>{var j,ce,Ce,W,Ue,Oe;i.domElement&&(i.domElement.style.touchAction="auto"),(j=i.domElement)==null||j.removeEventListener("contextmenu",Ye),(ce=i.domElement)==null||ce.removeEventListener("pointerdown",te),(Ce=i.domElement)==null||Ce.removeEventListener("pointercancel",C),(W=i.domElement)==null||W.removeEventListener("wheel",me),(Ue=i.domElement)==null||Ue.ownerDocument.removeEventListener("pointermove",k),(Oe=i.domElement)==null||Oe.ownerDocument.removeEventListener("pointerup",C),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",le)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const c=1e-6,u=new hy,h=new hy;let d=1;const f=new z,p=new de,v=new de,m=new de,g=new de,y=new de,x=new de,_=new de,T=new de,S=new de,E=new z,M=new de;let b=!1;const w=[],A={};function P(){return 2*Math.PI/60/60*i.autoRotateSpeed}function H(){return Math.pow(.95,i.zoomSpeed)}function B(j){i.reverseOrbit||i.reverseHorizontalOrbit?h.theta+=j:h.theta-=j}function G(j){i.reverseOrbit||i.reverseVerticalOrbit?h.phi+=j:h.phi-=j}const O=(()=>{const j=new z;return function(ce,Ce){j.setFromMatrixColumn(Ce,0),j.multiplyScalar(-ce),f.add(j)}})(),$=(()=>{const j=new z;return function(ce,Ce){i.screenSpacePanning===!0?j.setFromMatrixColumn(Ce,1):(j.setFromMatrixColumn(Ce,0),j.crossVectors(i.object.up,j)),j.multiplyScalar(ce),f.add(j)}})(),F=(()=>{const j=new z;return function(ce,Ce){const W=i.domElement;if(W&&i.object instanceof xn&&i.object.isPerspectiveCamera){const Ue=i.object.position;j.copy(Ue).sub(i.target);let Oe=j.length();Oe*=Math.tan(i.object.fov/2*Math.PI/180),O(2*ce*Oe/W.clientHeight,i.object.matrix),$(2*Ce*Oe/W.clientHeight,i.object.matrix)}else W&&i.object instanceof rs&&i.object.isOrthographicCamera?(O(ce*(i.object.right-i.object.left)/i.object.zoom/W.clientWidth,i.object.matrix),$(Ce*(i.object.top-i.object.bottom)/i.object.zoom/W.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function J(j){i.object instanceof xn&&i.object.isPerspectiveCamera||i.object instanceof rs&&i.object.isOrthographicCamera?d=j:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function se(j){J(d/j)}
4073function be(j){J(d*j)}function Fe(j){if(!i.zoomToCursor||!i.domElement)return;b=!0;const ce=i.domElement.getBoundingClientRect(),Ce=j.clientX-ce.left,W=j.clientY-ce.top,Ue=ce.width,Oe=ce.height;M.x=Ce/Ue*2-1,M.y=-(W/Oe)*2+1,E.set(M.x,M.y,1).unproject(i.object).sub(i.object.position).normalize()}function Le(j){return Math.max(i.minDistance,Math.min(i.maxDistance,j))}function Ge(j){p.set(j.clientX,j.clientY)}function ze(j){Fe(j),_.set(j.clientX,j.clientY)}function he(j){g.set(j.clientX,j.clientY)}function fe(j){v.set(j.clientX,j.clientY),m.subVectors(v,p).multiplyScalar(i.rotateSpeed);const ce=i.domElement;ce&&(B(2*Math.PI*m.x/ce.clientHeight),G(2*Math.PI*m.y/ce.clientHeight)),p.copy(v),i.update()}function ue(j){T.set(j.clientX,j.clientY),S.subVectors(T,_),S.y>0?se(H()):S.y<0&&be(H()),_.copy(T),i.update()}function I(j){y.set(j.clientX,j.clientY),x.subVectors(y,g).multiplyScalar(i.panSpeed),F(x.x,x.y),g.copy(y),i.update()}function V(j){Fe(j),j.deltaY<0?be(H()):j.deltaY>0&&se(H()),i.update()}function q(j){let ce=!1;switch(j.code){case i.keys.UP:F(0,i.keyPanSpeed),ce=!0;break;case i.keys.BOTTOM:F(0,-i.keyPanSpeed),ce=!0;break;case i.keys.LEFT:F(i.keyPanSpeed,0),ce=!0;break;case i.keys.RIGHT:F(-i.keyPanSpeed,0),ce=!0;break}ce&&(j.preventDefault(),i.update())}function ye(){if(w.length==1)p.set(w[0].pageX,w[0].pageY);else{const j=.5*(w[0].pageX+w[1].pageX),ce=.5*(w[0].pageY+w[1].pageY);p.set(j,ce)}}function N(){if(w.length==1)g.set(w[0].pageX,w[0].pageY);else{const j=.5*(w[0].pageX+w[1].pageX),ce=.5*(w[0].pageY+w[1].pageY);g.set(j,ce)}}function D(){const j=w[0].pageX-w[1].pageX,ce=w[0].pageY-w[1].pageY,Ce=Math.sqrt(j*j+ce*ce);_.set(0,Ce)}function R(){i.enableZoom&&D(),i.enablePan&&N()}function X(){i.enableZoom&&D(),i.enableRotate&&ye()}function Z(j){if(w.length==1)v.set(j.pageX,j.pageY);else{const Ce=ut(j),W=.5*(j.pageX+Ce.x),Ue=.5*(j.pageY+Ce.y);v.set(W,Ue)}m.subVectors(v,p).multiplyScalar(i.rotateSpeed);const ce=i.domElement;ce&&(B(2*Math.PI*m.x/ce.clientHeight),G(2*Math.PI*m.y/ce.clientHeight)),p.copy(v)}function K(j){if(w.length==1)y.set(j.pageX,j.pageY);else{const ce=ut(j),Ce=.5*(j.pageX+ce.x),W=.5*(j.pageY+ce.y);y.set(Ce,W)}x.subVectors(y,g).multiplyScalar(i.panSpeed),F(x.x,x.y),g.copy(y)}function Q(j){const ce=ut(j),Ce=j.pageX-ce.x,W=j.pageY-ce.y,Ue=Math.sqrt(Ce*Ce+W*W);T.set(0,Ue),S.set(0,Math.pow(T.y/_.y,i.zoomSpeed)),se(S.y),_.copy(T)}function ae(j){i.enableZoom&&Q(j),i.enablePan&&K(j)}function ee(j){i.enableZoom&&Q(j),i.enableRotate&&Z(j)}function te(j){var ce,Ce;i.enabled!==!1&&(w.length===0&&((ce=i.domElement)==null||ce.ownerDocument.addEventListener("pointermove",k),(Ce=i.domElement)==null||Ce.ownerDocument.addEventListener("pointerup",C)),Xe(j),j.pointerType==="touch"?De(j):Y(j))}function k(j){i.enabled!==!1&&(j.pointerType==="touch"?Ne(j):ne(j))}function C(j){var ce,Ce,W;Se(j),w.length===0&&((ce=i.domElement)==null||ce.releasePointerCapture(j.pointerId),(Ce=i.domElement)==null||Ce.ownerDocument.removeEventListener("pointermove",k),(W=i.domElement)==null||W.ownerDocument.removeEventListener("pointerup",C)),i.dispatchEvent(o),l=a.NONE}function Y(j){let ce;switch(j.button){case 0:ce=i.mouseButtons.LEFT;break;case 1:ce=i.mouseButtons.MIDDLE;break;case 2:ce=i.mouseButtons.RIGHT;break;default:ce=-1}switch(ce){case bs.DOLLY:if(i.enableZoom===!1)return;ze(j),l=a.DOLLY;break;case bs.ROTATE:if(j.ctrlKey||j.metaKey||j.shiftKey){if(i.enablePan===!1)return;he(j),l=a.PAN}else{if(i.enableRotate===!1)return;Ge(j),l=a.ROTATE}break;case bs.PAN:if(j.ctrlKey||j.metaKey||j.shiftKey){if(i.enableRotate===!1)return;Ge(j),l=a.ROTATE}else{if(i.enablePan===!1)return;he(j),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function ne(j){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;fe(j);break;case a.DOLLY:if(i.enableZoom===!1)return;ue(j);break;case a.PAN:if(i.enablePan===!1)return;I(j);break}}function me(j){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(j.preventDefault(),i.dispatchEvent(s),V(j),i.dispatchEvent(o))}function le(j){i.enabled===!1||i.enablePan===!1||q(j)}function De(j){switch(ke(j),w.length){case 1:switch(i.touches.ONE){case lo.ROTATE:if(i.enableRotate===!1)return;ye(),l=a.TOUCH_ROTATE;break;case lo.PAN:if(i.enablePan===!1)return;N(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case lo.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;R(),l=a.TOUCH_DOLLY_PAN;break;case lo.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;X(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ne(j){switch(ke(j),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;Z(j),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;K(j),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ae(j),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;ee(j),i.update();break;default:l=a.NONE}}function Ye(j){i.enabled!==!1&&j.preventDefault()}function Xe(j){w.push(j)}function Se(j){delete A[j.pointerId];for(let ce=0;ce<w.length;ce++)if(w[ce].pointerId==j.pointerId){w.splice(ce,1);return}}function ke(j){let ce=A[j.pointerId];ce===void 0&&(ce=new de,A[j.pointerId]=ce),ce.set(j.pageX,j.pageY)}function ut(j){const ce=j.pointerId===w[0].pointerId?w[1]:w[0];return A[ce.pointerId]}this.dollyIn=(j=H())=>{be(j),i.update()},this.dollyOut=(j=H())=>{se(j),i.update()}
vendor: 4,571 bytes, lines 4073-4103
4073,this.getScale=()=>d,this.setScale=j=>{J(j),i.update()},this.getZoomScale=()=>H(),t!==void 0&&this.connect(t),this.update()}}class uq extends aR{constructor(e){super(e),this.type=Gi}parse(e){const t=function(m,g){switch(m){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(g||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(g||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(g||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(g||""))}},i=function(m,g,y){g=g||1024;let x=m.pos,_=-1,T=0,S="",E=String.fromCharCode.apply(null,new Uint16Array(m.subarray(x,x+128)));for(;0>(_=E.indexOf(`
4074`))&&T<g&&x<m.byteLength;)S+=E,T+=E.length,x+=128,E+=String.fromCharCode.apply(null,new Uint16Array(m.subarray(x,x+128)));return-1<_?(m.pos+=T+_+1,S+E.slice(0,_)):!1},r=function(m){const g=/^#\?(\S+)/,y=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,x=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,_=/^\s*FORMAT=(\S+)\s*$/,T=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,S={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let E,M;for((m.pos>=m.byteLength||!(E=i(m)))&&t(1,"no header found"),(M=E.match(g))||t(3,"bad initial token"),S.valid|=1,S.programtype=M[1],S.string+=E+`
4075`;E=i(m),E!==!1;){if(S.string+=E+`
4076`,E.charAt(0)==="#"){S.comments+=E+`
4077`;continue}if((M=E.match(y))&&(S.gamma=parseFloat(M[1])),(M=E.match(x))&&(S.exposure=parseFloat(M[1])),(M=E.match(_))&&(S.valid|=2,S.format=M[1]),(M=E.match(T))&&(S.valid|=4,S.height=parseInt(M[1],10),S.width=parseInt(M[2],10)),S.valid&2&&S.valid&4)break}return S.valid&2||t(3,"missing format specifier"),S.valid&4||t(3,"missing image size specifier"),S},s=function(m,g,y){const x=g;if(x<8||x>32767||m[0]!==2||m[1]!==2||m[2]&128)return new Uint8Array(m);x!==(m[2]<<8|m[3])&&t(3,"wrong scanline width");const _=new Uint8Array(4*g*y);_.length||t(4,"unable to allocate buffer space");let T=0,S=0;const E=4*x,M=new Uint8Array(4),b=new Uint8Array(E);let w=y;for(;w>0&&S<m.byteLength;){S+4>m.byteLength&&t(1),M[0]=m[S++],M[1]=m[S++],M[2]=m[S++],M[3]=m[S++],(M[0]!=2||M[1]!=2||(M[2]<<8|M[3])!=x)&&t(3,"bad rgbe scanline format");let A=0,P;for(;A<E&&S<m.byteLength;){P=m[S++];const B=P>128;if(B&&(P-=128),(P===0||A+P>E)&&t(3,"bad scanline data"),B){const G=m[S++];for(let O=0;O<P;O++)b[A++]=G}else b.set(m.subarray(S,S+P),A),A+=P,S+=P}const H=x;for(let B=0;B<H;B++){let G=0;_[T]=b[B+G],G+=x,_[T+1]=b[B+G],G+=x,_[T+2]=b[B+G],G+=x,_[T+3]=b[B+G],T+=4}w--}return _},o=function(m,g,y,x){const _=m[g+3],T=Math.pow(2,_-128)/255;y[x+0]=m[g+0]*T,y[x+1]=m[g+1]*T,y[x+2]=m[g+2]*T,y[x+3]=1},a=function(m,g,y,x){const _=m[g+3],T=Math.pow(2,_-128)/255;y[x+0]=Ju.toHalfFloat(Math.min(m[g+0]*T,65504)),y[x+1]=Ju.toHalfFloat(Math.min(m[g+1]*T,65504)),y[x+2]=Ju.toHalfFloat(Math.min(m[g+2]*T,65504)),y[x+3]=Ju.toHalfFloat(1)},l=new Uint8Array(e);l.pos=0;const c=r(l),u=c.width,h=c.height,d=s(l.subarray(l.pos),u,h);let f,p,v;switch(this.type){case li:v=d.length/4;const m=new Float32Array(v*4);for(let y=0;y<v;y++)o(d,y*4,m,y*4);f=m,p=li;break;case Gi:v=d.length/4;const g=new Uint16Array(v*4);for(let y=0;y<v;y++)a(d,y*4,g,y*4);f=g,p=Gi;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:u,height:h,data:f,header:c.string,gamma:c.gamma,exposure:c.exposure,type:p}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(o,a){switch(o.type){case li:case Gi:"colorSpace"in o?o.colorSpace="srgb-linear":o.encoding=3e3,o.minFilter=dn,o.magFilter=dn,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,a)}return super.load(e,s,i,r)}}Jb({screenspace:!1,color:new We("black"),opacity:1,thickness:.05,size:new de(1,1)},`#include <common>
4078   #include <morphtarget_pars_vertex>
4079   #include <skinning_pars_vertex>
4080   uniform float thickness;
4081   uniform bool screenspace;
4082   uniform vec2 size;
4083   void main() {
4084     #if defined (USE_SKINNING)
4085       #include <beginnormal_vertex>
4086       #include <morphnormal_vertex>
4087       #include <skinbase_vertex>
4088       #include <skinnormal_vertex>
4089       #include <defaultnormal_vertex>
4090     #endif
4091     #include <begin_vertex>
4092     #include <morphtarget_vertex>
4093     #include <skinning_vertex>
4094     #include <project_vertex>
4095     vec4 tNormal = vec4(normal, 0.0);
4096     vec4 tPosition = vec4(transformed, 1.0);
4097     #ifdef USE_INSTANCING
4098       tNormal = instanceMatrix * tNormal;
4099       tPosition = instanceMatrix * tPosition;
4100     #endif
4101     if (screenspace) {
4102       vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness;
4103       gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0
4103); 
4104     } else {
4105       vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition;
4106       vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal;
4107       vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0;
4108       clipPosition.xy += offset;
4109       gl_Position = clipPosition;
4110     }
4111   }`,`uniform vec3 color;
4112   uniform float opacity;
4113   void main(){
4114     gl_FragColor = vec4(color, opacity);
4115     #include <tonemapping_fragment>
4116     #include <colorspace_fragment>
4117   }`);const hq=["args","material-uniforms-color-value"];NT.ReflectorShader;new z;new z;new z;const jf={sunset:"venice/venice_sunset_1k.hdr",studio:"studio/poly_haven_studio_1k.hdr",city:"city/canary_wharf_1k.hdr",umbrellas:"outdoor/outdoor_umbrellas_1k.hdr",night:"outdoor/satara_night_1k.hdr",forest:"outood/mossy_forest_1k.hdr",snow:"outdoor/snowy_forest_path_01_1k.hdr",dawn:"kiara/kiara_1_dawn_1k.hdr",hangar:"indoor/small_hangar_01_1k.hdr",urban:"indoor/abandoned_games_room_02_1k.hdr",modern:"city/modern_buildings_2_1k.hdr",shangai:"city/shanghai_bund_1k.hdr"},dq="https://raw.githubusercontent.com/Tresjs/assets/main/textures/hdr/";function Wv(n){return n instanceof ai?n:Array.isArray(n)?new ai(n[0],n[1],n[2]):typeof n=="number"?new ai(n,n,n):n instanceof z?new ai(n.x,n.y,n.z):typeof n=="object"&&"x"in n&&"y"in n&&"z"in n?new ai(n.x,n.y,n.z):null}function DT(n){n.traverse(e=>{e instanceof an&&e.material&&(e.material.needsUpdate=!0)})}async function fq(n,e){const{scene:t,invalidate:i}=El(),{preset:r,blur:s,files:o=Te([]),path:a=Te(""),background:l,backgroundIntensity:c=Te(1),environmentIntensity:u=Te(1),backgroundRotation:h=Te([0,0,0]),environmentRotation:d=Te([0,0,0]),syncMaterials:f=Te(!1)}=Ar(n);Je(n,()=>{i()});const p=Te(null),v=ge(()=>Array.isArray(o.value)),m=new oR,g=new uq,y=async(x,_)=>new Promise((T,S)=>{v.value?(_&&m.setPath(_),m.load(x,E=>{E.mapping=Ls,T(E)},void 0,E=>S(E))):(_&&g.setPath(_),g.load(x[0],E=>{E.mapping=Jo,T(E)},void 0,E=>S(E)))});return Je([o,a],async([x,_])=>{if(!(!x||x.length===0||r?.value))try{const T=await y(v.value?[...L(x)]:[L(x)],L(_));p.value=T}catch(T){throw new Error(`Failed to load environment map: ${T}`)}},{immediate:!0}),Je(p,x=>{t.value&&x&&(t.value.environment=x)},{immediate:!0}),Je([l,p],([x,_])=>{if(t.value){const T=e?.value?e.value.texture:_;T&&(t.value.background=x?T:null)}},{immediate:!0}),Je(()=>s?.value,x=>{t.value&&x&&(t.value.backgroundBlurriness=x)},{immediate:!0}),Je(()=>c?.value,x=>{t.value&&(t.value.backgroundIntensity=x??1)},{immediate:!0}),Je(()=>u?.value,x=>{t.value&&(t.value.environmentIntensity=x??1)},{immediate:!0}),Je(()=>h?.value,x=>{if(t.value){const _=Wv(x);_&&(t.value.backgroundRotation=_)}},{immediate:!0}),Je(()=>d?.value,x=>{if(t.value&&!f?.value){const _=Wv(x);_&&(t.value.environmentRotation=_,DT(t.value))}},{immediate:!0}),Je(()=>r?.value,async x=>{if(x&&x in jf){const _=dq,T=jf[x];try{g.setPath(_);const S=await new Promise((E,M)=>{g.load(T,b=>{b.mapping=Jo,E(b)},void 0,b=>M(b))});p.value=S,i()}catch(S){throw new Error(`Failed to load environment map: ${S}`)}p.value&&(p.value.mapping=Jo),i()}else if(x&&!(x in jf))throw new Error(`Preset must be one of: ${Object.keys(jf).join(", ")}`)},{immediate:!0}),Je([f,h],([x,_])=>{if(x&&t.value){const T=Wv(_);T&&(t.value.environmentRotation=T,DT(t.value))}},{immediate:!0}),p}var $v;/Mac/.test(($v=globalThis?.navigator)===null||$v===void 0?void 0:$v.platform);const pq=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","mouse-buttons","args"],mq=qe({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:lo.ROTATE,TWO:lo.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:bs.ROTATE,MIDDLE:bs.DOLLY,RIGHT:bs.PAN})}},emits:["change","start","end"],setup(n,{expose:e,emit:t}){const i=n,r=t,{makeDefault:s,autoRotate:o,autoRotateSpeed:a,enableDamping:l,dampingFactor:c,enablePan:u,keyPanSpeed:h,maxAzimuthAngle:d,minAzimuthAngle:f,maxPolarAngle:p,minPolarAngle:v,minDistance:m,maxDistance:g,minZoom:y,maxZoom:x,enableZoom:_,zoomSpeed:T,enableRotate:S,touches:E,rotateSpeed:M,target:b,mouseButtons:w}=Ar(i),{camera:A,renderer:P,extend:H,controls:B,invalidate:G}=El(),O=Mt(null);
4117H({OrbitControls:cq}),Je(O,J=>{$(),J&&s.value?B.value=J:B.value=null});function $(){Gv(O.value,"change",()=>{r("change",O.value),G()}),Gv(O.value,"start",()=>r("start",O.value)),Gv(O.value,"end",()=>r("end",O.value))}const{onBeforeRender:F}=us();return F(()=>{O.value&&(l.value||o.value)&&(O.value.update(),o.value)}),di(()=>{O.value&&O.value.dispose()}),e({instance:O}),(J,se)=>(n.camera||L(A))&&(n.domElement||L(P).domElement)?(pe(),pt("TresOrbitControls",{ref_key:"controlsRef",ref:O,key:(n.camera||L(A))?.uuid,target:L(b),"auto-rotate":L(o),"auto-rotate-speed":L(a),"enable-damping":L(l),"damping-factor":L(c),"enable-pan":L(u),"key-pan-speed":L(h),keys:n.keys,"max-azimuth-angle":L(d),"min-azimuth-angle":L(f),"max-polar-angle":L(p),"min-polar-angle":L(v),"min-distance":L(m),"max-distance":L(g),"min-zoom":L(y),"max-zoom":L(x),touches:L(E),"enable-zoom":L(_),"zoom-speed":L(T),"enable-rotate":L(S),"rotate-speed":L(M),"mouse-buttons":L(w),args:[n.camera||L(A),n.domElement||L(P).domElement]},null,8,pq)):en("",!0)}});function qf(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var kT={exports:{}},FT;function gq(){return FT||(FT=1,(function(n,e){(function(t){n.exports=t()})(function(){return(function t(i,r,s){function o(c,u){if(!r[c]){if(!i[c]){var h=typeof qf=="function"&&qf;if(!u&&h)return h(c,!0);if(a)return a(c,!0);throw new Error("Cannot find module '"+c+"'")}u=r[c]={exports:{}},i[c][0].call(u.exports,function(d){var f=i[c][1][d];return o(f||d)},u,u.exports,t,i,r,s)}return r[c].exports}for(var a=typeof qf=="function"&&qf,l=0;l<s.length;l++)o(s[l]);return o}
vendor: 37,725 bytes, lines 4117-4122
4117)({1:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){var p=t("crypto");function v(S,E){E=y(S,E);var M;return(M=E.algorithm!=="passthrough"?p.createHash(E.algorithm):new T).write===void 0&&(M.write=M.update,M.end=M.update),_(E,M).dispatch(S),M.update||M.end(""),M.digest?M.digest(E.encoding==="buffer"?void 0:E.encoding):(S=M.read(),E.encoding!=="buffer"?S.toString(E.encoding):S)}(r=i.exports=v).sha1=function(S){return v(S)},r.keys=function(S){return v(S,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(S){return v(S,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(S){return v(S,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var m=p.getHashes?p.getHashes().slice():["sha1","md5"],g=(m.push("passthrough"),["buffer","hex","binary","base64"]);function y(S,E){var M={};if(M.algorithm=(E=E||{}).algorithm||"sha1",M.encoding=E.encoding||"hex",M.excludeValues=!!E.excludeValues,M.algorithm=M.algorithm.toLowerCase(),M.encoding=M.encoding.toLowerCase(),M.ignoreUnknown=E.ignoreUnknown===!0,M.respectType=E.respectType!==!1,M.respectFunctionNames=E.respectFunctionNames!==!1,M.respectFunctionProperties=E.respectFunctionProperties!==!1,M.unorderedArrays=E.unorderedArrays===!0,M.unorderedSets=E.unorderedSets!==!1,M.unorderedObjects=E.unorderedObjects!==!1,M.replacer=E.replacer||void 0,M.excludeKeys=E.excludeKeys||void 0,S===void 0)throw new Error("Object argument required.");for(var b=0;b<m.length;++b)m[b].toLowerCase()===M.algorithm.toLowerCase()&&(M.algorithm=m[b]);if(m.indexOf(M.algorithm)===-1)throw new Error('Algorithm "'+M.algorithm+'"  not supported. supported values: '+m.join(", "));if(g.indexOf(M.encoding)===-1&&M.algorithm!=="passthrough")throw new Error('Encoding "'+M.encoding+'"  not supported. supported values: '+g.join(", "));return M}function x(S){if(typeof S=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(S))!=null}function _(S,E,M){M=M||[];function b(w){return E.update?E.update(w,"utf8"):E.write(w,"utf8")}return{dispatch:function(w){return this["_"+((w=S.replacer?S.replacer(w):w)===null?"null":typeof w)](w)},_object:function(w){var A,P=Object.prototype.toString.call(w),H=/\[object (.*)\]/i.exec(P);if(H=(H=H?H[1]:"unknown:["+P+"]").toLowerCase(),0<=(P=M.indexOf(w)))return this.dispatch("[CIRCULAR:"+P+"]");if(M.push(w),a!==void 0&&a.isBuffer&&a.isBuffer(w))return b("buffer:"),b(w);if(H==="object"||H==="function"||H==="asyncfunction")return P=Object.keys(w),S.unorderedObjects&&(P=P.sort()),S.respectType===!1||x(w)||P.splice(0,0,"prototype","__proto__","constructor"),S.excludeKeys&&(P=P.filter(function(B){return!S.excludeKeys(B)})),b("object:"+P.length+":"),A=this,P.forEach(function(B){A.dispatch(B),b(":"),S.excludeValues||A.dispatch(w[B]),b(",")});if(!this["_"+H]){if(S.ignoreUnknown)return b("["+H+"]");throw new Error('Unknown object type "'+H+'"')}this["_"+H](w)},_array:function(w,B){B=B!==void 0?B:S.unorderedArrays!==!1;var P=this;if(b("array:"+w.length+":"),!B||w.length<=1)return w.forEach(function(G){return P.dispatch(G)});var H=[],B=w.map(function(G){var O=new T,$=M.slice();return _(S,O,$).dispatch(G),H=H.concat($.slice(M.length)),O.read().toString()});return M=M.concat(H),B.sort(),this._array(B,!1)},_date:function(w){return b("date:"+w.toJSON())},_symbol:function(w){return b("symbol:"+w.toString())},_error:function(w){return b("error:"+w.toString())},_boolean:function(w){return b("bool:"+w.toString())},_string:function(w){b("string:"+w.length+":"),b(w.toString())},_function:function(w){b("fn:"),x(w)?this.dispatch("[native]"):this.dispatch(w.toString()),S.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(w.name)),S.respectFunctionProperties&&this._object(w)},_number:function(w){return b("number:"+w.toString())},_xml:function(w){return b("xml:"+w.toString())},_null:function(){return b("Null")},_undefined:function(){return b("Undefined")},_regexp:function(w){return b("regex:"+w.toString())},_uint8array:function(w){return b("uint8array:"),this.dispatch(Array.prototype.slice.call(w))},_uint8clampedarray:function(w){return b("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(w))},_int8array:function(w){return b("int8array:"),this.dispatch(Array.prototype.slice.call(w))},_uint16array:function(w){return b("uint16array:"),this.dispatch(Array.prototype.slice.call(w))},_int16array:function(w){return b("int16array:"),this.dispatch(Array.prototype.slice.call(w))},_uint32array:function(w){return b("uint32array:"),this.dispatch(Array.prototype.slice.call(w))},_int32array:function(w){return b("int32array:"),this.dispatch(Array.prototype.slice.call(w))},_float32array:function(w){return b("float32array:"),this.dispatch(Array.prototype.slice.call(w))},_float64array:function(w){return b("float64array:"),this.dispatch(Array.prototype.slice.call(w))},_arraybuffer:function(w){return b("arraybuffer:"),this.dispatch(new Uint8Array(w))},_url:function(w){return b("url:"+w.toString())},_map:function(w){return b("map:"),w=Array.from(w),this._array(w,S.unorderedSets!==!1)},_set:function(w){return b("set:"),w=Array.from(w),this._array(w,S.unorderedSets!==!1)},_file:function(w){return b("file:"),this.dispatch([w.name,w.size,w.type,w.lastModfied])},_blob:function(){if(S.ignoreUnknown)return b("[blob]");throw Error(`Hashing Blob objects is currently not supported
4118(see https://github.com/puleos/object-hash/issues/26)
4119Use "options.replacer" or "options.ignoreUnknown"
4120`)},_domwindow:function(){return b("domwindow")},_bigint:function(w){return b("bigint:"+w.toString())},_process:function(){return b("process")},_timer:function(){return b("timer")},_pipe:function(){return b("pipe")},_tcp:function(){return b("tcp")},_udp:function(){return b("udp")},_tty:function(){return b("tty")},_statwatcher:function(){return b("statwatcher")},_securecontext:function(){return b("securecontext")},_connection:function(){return b("connection")},_zlib:function(){return b("zlib")},_context:function(){return b("context")},_nodescript:function(){return b("nodescript")},_httpparser:function(){return b("httpparser")},_dataview:function(){return b("dataview")},_signal:function(){return b("signal")},_fsevent:function(){return b("fsevent")},_tlswrap:function(){return b("tlswrap")}}}function T(){return{buf:"",write:function(S){this.buf+=S},end:function(S){this.buf+=S},read:function(){return this.buf}}}r.writeToStream=function(S,E,M){return M===void 0&&(M=E,E={}),_(E=y(S,E),M).dispatch(S)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){(function(p){var v=typeof Uint8Array<"u"?Uint8Array:Array,m=43,g=47,y=48,x=97,_=65,T=45,S=95;function E(M){return M=M.charCodeAt(0),M===m||M===T?62:M===g||M===S?63:M<y?-1:M<y+10?M-y+26+26:M<_+26?M-_:M<x+26?M-x+26:void 0}p.toByteArray=function(M){var b,w;if(0<M.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var A=M.length,A=M.charAt(A-2)==="="?2:M.charAt(A-1)==="="?1:0,P=new v(3*M.length/4-A),H=0<A?M.length-4:M.length,B=0;function G(O){P[B++]=O}for(b=0;b<H;b+=4,0)G((16711680&(w=E(M.charAt(b))<<18|E(M.charAt(b+1))<<12|E(M.charAt(b+2))<<6|E(M.charAt(b+3))))>>16),G((65280&w)>>8),G(255&w);return A==2?G(255&(w=E(M.charAt(b))<<2|E(M.charAt(b+1))>>4)):A==1&&(G((w=E(M.charAt(b))<<10|E(M.charAt(b+1))<<4|E(M.charAt(b+2))>>2)>>8&255),G(255&w)),P},p.fromByteArray=function(M){var b,w,A,P,H=M.length%3,B="";function G(O){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O)}for(b=0,A=M.length-H;b<A;b+=3)w=(M[b]<<16)+(M[b+1]<<8)+M[b+2],B+=G((P=w)>>18&63)+G(P>>12&63)+G(P>>6&63)+G(63&P);switch(H){case 1:B=(B+=G((w=M[M.length-1])>>2))+G(w<<4&63)+"==";break;case 2:B=(B=(B+=G((w=(M[M.length-2]<<8)+M[M.length-1])>>10))+G(w>>4&63))+G(w<<2&63)+"="}return B}})(r===void 0?this.base64js={}:r)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,i,r){(function(s,o,m,l,c,u,h,d,f){var p=t("base64-js"),v=t("ieee754");function m(I,V,q){if(!(this instanceof m))return new m(I,V,q);var ye,N,D,R,X=typeof I;if(V==="base64"&&X=="string")for(I=(R=I).trim?R.trim():R.replace(/^\s+|\s+$/g,"");I.length%4!=0;)I+="=";if(X=="number")ye=F(I);else if(X=="string")ye=m.byteLength(I,V);else{if(X!="object")throw new Error("First argument needs to be a number, array or string.");ye=F(I.length)}if(m._useTypedArrays?N=m._augment(new Uint8Array(ye)):((N=this).length=ye,N._isBuffer=!0),m._useTypedArrays&&typeof I.byteLength=="number")N._set(I);else if(J(R=I)||m.isBuffer(R)||R&&typeof R=="object"&&typeof R.length=="number")for(D=0;D<ye;D++)m.isBuffer(I)?N[D]=I.readUInt8(D):N[D]=I[D];else if(X=="string")N.write(I,0,V);else if(X=="number"&&!m._useTypedArrays&&!q)for(D=0;D<ye;D++)N[D]=0;return N}function g(I,V,q,ye){return m._charsWritten=Le((function(N){for(var D=[],R=0;R<N.length;R++)D.push(255&N.charCodeAt(R));return D})(V),I,q,ye)}function y(I,V,q,ye){return m._charsWritten=Le((function(N){for(var D,R,X=[],Z=0;Z<N.length;Z++)R=N.charCodeAt(Z),D=R>>8,R=R%256,X.push(R),X.push(D);return X})(V),I,q,ye)}function x(I,V,q){var ye="";q=Math.min(I.length,q);for(var N=V;N<q;N++)ye+=String.fromCharCode(I[N]);return ye}function _(I,V,q,D){D||(ue(typeof q=="boolean","missing or invalid endian"),ue(V!=null,"missing offset"),ue(V+1<I.length,"Trying to read beyond buffer length"));var N,D=I.length;if(!(D<=V))return q?(N=I[V],V+1<D&&(N|=I[V+1]<<8)):(N=I[V]<<8,V+1<D&&(N|=I[V+1])),N}function T(I,V,q,D){D||(ue(typeof q=="boolean","missing or invalid endian"),ue(V!=null,"missing offset"),ue(V+3<I.length,"Trying to read beyond buffer length"));var N,D=I.length;if(!(D<=V))return q?(V+2<D&&(N=I[V+2]<<16),V+1<D&&(N|=I[V+1]<<8),N|=I[V],V+3<D&&(N+=I[V+3]<<24>>>0)):(V+1<D&&(N=I[V+1]<<16),V+2<D&&(N|=I[V+2]<<8),V+3<D&&(N|=I[V+3]),N+=I[V]<<24>>>0),N}function S(I,V,q,ye){if(ye||(ue(typeof q=="boolean","missing or invalid endian"),ue(V!=null,"missing offset"),ue(V+1<I.length,"Trying to read beyond buffer length")),!(I.length<=V))return ye=_(I,V,q,!0),32768&ye?-1*(65535-ye+1):ye}function E(I,V,q,ye){if(ye||(ue(typeof q=="boolean","missing or invalid endian"),ue(V!=null,"missing offset"),ue(V+3<I.length,"Trying to read beyond buffer length")),!(I.length<=V))return ye=T(I,V,q,!0),2147483648&ye?-1*(4294967295-ye+1):ye}function M(I,V,q,ye){return ye||(ue(typeof q=="boolean","missing or invalid endian"),ue(V+3<I.length,"Trying to read beyond buffer length")),v.read(I,V,q,23,4)}function b(I,V,q,ye){return ye||(ue(typeof q=="boolean","missing or invalid endian"),ue(V+7<I.length,"Trying to read beyond buffer length")),v.read(I,V,q,52,8)}function w(I,V,q,ye,N){if(N||(ue(V!=null,"missing value"),ue(typeof ye=="boolean","missing or invalid endian"),ue(q!=null,"missing offset"),ue(q+1<I.length,"trying to write beyond buffer length"),ze(V,65535)),N=I.length,!(N<=q))for(var D=0,R=Math.min(N-q,2);D<R;D++)I[q+D]=(V&255<<8*(ye?D:1-D))>>>8*(ye?D:1-D)}function A(I,V,q,ye,N){if(N||(ue(V!=null,"missing value"),ue(typeof ye=="boolean","missing or invalid endian"),ue(q!=null,"missing offset"),ue(q+3<I.length,"trying to write beyond buffer length"),ze(V,4294967295)),N=I.length,!(N<=q))for(var D=0,R=Math.min(N-q,4);D<R;D++)I[q+D]=V>>>8*(ye?D:3-D)&255}function P(I,V,q,ye,N){N||(ue(V!=null,"missing value"),ue(typeof ye=="boolean","missing or invalid endian"),ue(q!=null,"missing offset"),ue(q+1<I.length,"Trying to write beyond buffer length"),he(V,32767,-32768)),I.length<=q||w(I,0<=V?V:65535+V+1,q,ye,N)}function H(I,V,q,ye,N){N||(ue(V!=null,"missing value"),ue(typeof ye=="boolean","missing or invalid endian"),ue(q!=null,"missing offset"),ue(q+3<I.length,"Trying to write beyond buffer length"),he(V,2147483647,-2147483648)),I.length<=q||A(I,0<=V?V:4294967295+V+1,q,ye,N)}function B(I,V,q,ye,N){N||(ue(V!=null,"missing value"),ue(typeof ye=="boolean","missing or invalid endian"),ue(q!=null,"missing offset"),ue(q+3<I.length,"Trying to write beyond buffer length"),fe(V,34028234663852886e22,-34028234663852886e22)),I.length<=q||v.write(I,V,q,ye,23,4)}function G(I,V,q,ye,N){N||(ue(V!=null,"missing value"),ue(typeof ye=="boolean","missing or invalid endian"),ue(q!=null,"missing offset"),ue(q+7<I.length,"Trying to write beyond buffer length"),fe(V,17976931348623157e292,-17976931348623157e292)),I.length<=q||v.write(I,V,q,ye,52,8)}r.Buffer=m,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,m.poolSize=8192,m._useTypedArrays=(function(){try{var I=new ArrayBuffer(0),V=new Uint8Array(I);return V.foo=function(){return 42},V.foo()===42&&typeof V.subarray=="function"}catch{return!1}})(),m.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.isBuffer=function(I){return!(I==null||!I._isBuffer)},m.byteLength=function(I,V){var q;switch(I+="",V||"utf8"){case"hex":q=I.length/2;break;case"utf8":case"utf-8":q=be(I).length;break;case"ascii":case"binary":case"raw":q=I.length;break;case"base64":q=Fe(I).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":q=2*I.length;break;default:throw new Error("Unknown encoding")}return q},m.concat=function(I,V){if(ue(J(I),`Usage: Buffer.concat(list, [totalLength])
4121list should be an Array.`),I.length===0)return new m(0);if(I.length===1)return I[0];if(typeof V!="number")for(N=V=0;N<I.length;N++)V+=I[N].length;for(var q=new m(V),ye=0,N=0;N<I.length;N++){var D=I[N];D.copy(q,ye),ye+=D.length}return q},m.prototype.write=function(I,V,q,ye){isFinite(V)?isFinite(q)||(ye=q,q=void 0):(Z=ye,ye=V,V=q,q=Z),V=Number(V)||0;var N,D,R,X,Z=this.length-V;switch((!q||Z<(q=Number(q)))&&(q=Z),ye=String(ye||"utf8").toLowerCase()){case"hex":N=(function(K,Q,ae,ee){ae=Number(ae)||0;var te=K.length-ae;(!ee||te<(ee=Number(ee)))&&(ee=te),ue((te=Q.length)%2==0,"Invalid hex string"),te/2<ee&&(ee=te/2);for(var k=0;k<ee;k++){var C=parseInt(Q.substr(2*k,2),16);ue(!isNaN(C),"Invalid hex string"),K[ae+k]=C}return m._charsWritten=2*k,k})(this,I,V,q);break;case"utf8":case"utf-8":D=this,R=V,X=q,N=m._charsWritten=Le(be(I),D,R,X);break;case"ascii":case"binary":N=g(this,I,V,q);break;case"base64":D=this,R=V,X=q,N=m._charsWritten=Le(Fe(I),D,R,X);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":N=y(this,I,V,q);break;default:throw new Error("Unknown encoding")}return N},m.prototype.toString=function(I,V,q){var ye,N,D,R,X=this;if(I=String(I||"utf8").toLowerCase(),V=Number(V)||0,(q=q!==void 0?Number(q):X.length)===V)return"";switch(I){case"hex":ye=(function(Z,K,Q){var ae=Z.length;(!K||K<0)&&(K=0),(!Q||Q<0||ae<Q)&&(Q=ae);for(var ee="",te=K;te<Q;te++)ee+=se(Z[te]);return ee})(X,V,q);break;case"utf8":case"utf-8":ye=(function(Z,K,Q){var ae="",ee="";Q=Math.min(Z.length,Q);for(var te=K;te<Q;te++)Z[te]<=127?(ae+=Ge(ee)+String.fromCharCode(Z[te]),ee=""):ee+="%"+Z[te].toString(16);return ae+Ge(ee)})(X,V,q);break;case"ascii":case"binary":ye=x(X,V,q);break;case"base64":N=X,R=q,ye=(D=V)===0&&R===N.length?p.fromByteArray(N):p.fromByteArray(N.slice(D,R));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ye=(function(Z,K,Q){for(var ae=Z.slice(K,Q),ee="",te=0;te<ae.length;te+=2)ee+=String.fromCharCode(ae[te]+256*ae[te+1]);return ee})(X,V,q);break;default:throw new Error("Unknown encoding")}return ye},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},m.prototype.copy=function(I,V,q,ye){if(V=V||0,(ye=ye||ye===0?ye:this.length)!==(q=q||0)&&I.length!==0&&this.length!==0){ue(q<=ye,"sourceEnd < sourceStart"),ue(0<=V&&V<I.length,"targetStart out of bounds"),ue(0<=q&&q<this.length,"sourceStart out of bounds"),ue(0<=ye&&ye<=this.length,"sourceEnd out of bounds"),ye>this.length&&(ye=this.length);var N=(ye=I.length-V<ye-q?I.length-V+q:ye)-q;if(N<100||!m._useTypedArrays)for(var D=0;D<N;D++)I[D+V]=this[D+q];else I._set(this.subarray(q,q+N),V)}},m.prototype.slice=function(I,V){var q=this.length;if(I=$(I,q,0),V=$(V,q,q),m._useTypedArrays)return m._augment(this.subarray(I,V));for(var ye=V-I,N=new m(ye,void 0,!0),D=0;D<ye;D++)N[D]=this[D+I];return N},m.prototype.get=function(I){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(I)},m.prototype.set=function(I,V){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(I,V)},m.prototype.readUInt8=function(I,V){if(V||(ue(I!=null,"missing offset"),ue(I<this.length,"Trying to read beyond buffer length")),!(I>=this.length))return this[I]},m.prototype.readUInt16LE=function(I,V){return _(this,I,!0,V)},m.prototype.readUInt16BE=function(I,V){return _(this,I,!1,V)},m.prototype.readUInt32LE=function(I,V){return T(this,I,!0,V)},m.prototype.readUInt32BE=function(I,V){return T(this,I,!1,V)},m.prototype.readInt8=function(I,V){if(V||(ue(I!=null,"missing offset"),ue(I<this.length,"Trying to read beyond buffer length")),!(I>=this.length))return 128&this[I]?-1*(255-this[I]+1):this[I]},m.prototype.readInt16LE=function(I,V){return S(this,I,!0,V)},m.prototype.readInt16BE=function(I,V){return S(this,I,!1,V)},m.prototype.readInt32LE=function(I,V){return E(this,I,!0,V)},m.prototype.readInt32BE=function(I,V){return E(this,I,!1,V)},m.prototype.readFloatLE=function(I,V){return M(this,I,!0,V)},m.prototype.readFloatBE=function(I,V){return M(this,I,!1,V)},m.prototype.readDoubleLE=function(I,V){return b(this,I,!0,V)},m.prototype.readDoubleBE=function(I,V){return b(this,I,!1,V)},m.prototype.writeUInt8=function(I,V,q){q||(ue(I!=null,"missing value"),ue(V!=null,"missing offset"),ue(V<this.length,"trying to write beyond buffer length"),ze(I,255)),V>=this.length||(this[V]=I)},m.prototype.writeUInt16LE=function(I,V,q){w(this,I,V,!0,q)},m.prototype.writeUInt16BE=function(I,V,q){w(this,I,V,!1,q)},m.prototype.writeUInt32LE=function(I,V,q){A(this,I,V,!0,q)},m.prototype.writeUInt32BE=function(I,V,q){A(this,I,V,!1,q)},m.prototype.writeInt8=function(I,V,q){q||(ue(I!=null,"missing value"),ue(V!=null,"missing offset"),ue(V<this.length,"Trying to write beyond buffer length"),he(I,127,-128)),V>=this.length||(0<=I?this.writeUInt8(I,V,q):this.writeUInt8(255+I+1,V,q))},m.prototype.writeInt16LE=function(I,V,q){P(this,I,V,!0,q)},m.prototype.writeInt16BE=function(I,V,q){P(this,I,V,!1,q)},m.prototype.writeInt32LE=function(I,V,q){H(this,I,V,!0,q)},m.prototype.writeInt32BE=function(I,V,q){H(this,I,V,!1,q)},m.prototype.writeFloatLE=function(I,V,q){B(this,I,V,!0,q)},m.prototype.writeFloatBE=function(I,V,q){B(this,I,V,!1,q)},m.prototype.writeDoubleLE=function(I,V,q){G(this,I,V,!0,q)},m.prototype.writeDoubleBE=function(I,V,q){G(this,I,V,!1,q)},m.prototype.fill=function(I,V,q){if(V=V||0,q=q||this.length,ue(typeof(I=typeof(I=I||0)=="string"?I.charCodeAt(0):I)=="number"&&!isNaN(I),"value is not a number"),ue(V<=q,"end < start"),q!==V&&this.length!==0){ue(0<=V&&V<this.length,"start out of bounds"),ue(0<=q&&q<=this.length,"end out of bounds");for(var ye=V;ye<q;ye++)this[ye]=I}},m.prototype.inspect=function(){for(var I=[],V=this.length,q=0;q<V;q++)if(I[q]=se(this[q]),q===r.INSPECT_MAX_BYTES){I[q+1]="...";break}return"<Buffer "+I.join(" ")+">"},m.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(m._useTypedArrays)return new m(this).buffer;for(var I=new Uint8Array(this.length),V=0,q=I.length;V<q;V+=1)I[V]=this[V];return I.buffer};var O=m.prototype;function $(I,V,q){return typeof I!="number"?q:V<=(I=~~I)?V:0<=I||0<=(I+=V)?I:0}function F(I){return(I=~~Math.ceil(+I))<0?0:I}function J(I){return(Array.isArray||function(V){return Object.prototype.toString.call(V)==="[object Array]"})(I)}function se(I){return I<16?"0"+I.toString(16):I.toString(16)}function be(I){for(var V=[],q=0;q<I.length;q++){var ye=I.charCodeAt(q);if(ye<=127)V.push(I.charCodeAt(q));else for(var N=q,D=(55296<=ye&&ye<=57343&&q++,encodeURIComponent(I.slice(N,q+1)).substr(1).split("%")),R=0;R<D.length;R++)V.push(parseInt(D[R],16))}return V}function Fe(I){return p.toByteArray(I)}function Le(I,V,q,ye){for(var N=0;N<ye&&!(N+q>=V.length||N>=I.length);N++)V[N+q]=I[N];return N}function Ge(I){try{return decodeURIComponent(I)}catch{return"�"}}function ze(I,V){ue(typeof I=="number","cannot write a non-number as a number"),ue(0<=I,"specified a negative value for writing an unsigned value"),ue(I<=V,"value is larger than maximum value for type"),ue(Math.floor(I)===I,"value has a fractional component")}function he(I,V,q){ue(typeof I=="number","cannot write a non-number as a number"),ue(I<=V,"value larger than maximum allowed value"),ue(q<=I,"value smaller than minimum allowed value"),ue(Math.floor(I)===I,"value has a fractional component")}function fe(I,V,q){ue(typeof I=="number","cannot write a non-number as a number"),ue(I<=V,"value larger than maximum allowed value"),ue(q<=I,"value smaller than minimum allowed value")}function ue(I,V){if(!I)throw new Error(V||"Failed assertion")}m._augment=function(I){return I._isBuffer=!0,I._get=I.get,I._set=I.set,I.get=O.get,I.set=O.set,I.write=O.write,I.toString=O.toString,I.toLocaleString=O.toString,I.toJSON=O.toJSON,I.copy=O.copy,I.slice=O.slice,I.readUInt8=O.readUInt8,I.readUInt16LE=O.readUInt16LE,I.readUInt16BE=O.readUInt16BE,I.readUInt32LE=O.readUInt32LE,I.readUInt32BE=O.readUInt32BE,I.readInt8=O.readInt8,I.readInt16LE=O.readInt16LE,I.readInt16BE=O.readInt16BE,I.readInt32LE=O.readInt32LE,I.readInt32BE=O.readInt32BE,I.readFloatLE=O.readFloatLE,I.readFloatBE=O.readFloatBE,I.readDoubleLE=O.readDoubleLE,I.readDoubleBE=O.readDoubleBE,I.writeUInt8=O.writeUInt8,I.writeUInt16LE=O.writeUInt16LE,I.writeUInt16BE=O.writeUInt16BE,I.writeUInt32LE=O.writeUInt32LE,I.writeUInt32BE=O.writeUInt32BE,I.writeInt8=O.writeInt8,I.writeInt16LE=O.writeInt16LE,I.writeInt16BE=O.writeInt16BE,I.writeInt32LE=O.writeInt32LE,I.writeInt32BE=O.writeInt32BE,I.writeFloatLE=O.writeFloatLE,I.writeFloatBE=O.writeFloatBE,I.writeDoubleLE=O.writeDoubleLE,I.writeDoubleBE=O.writeDoubleBE,I.fill=O.fill,I.inspect=O.inspect,I.toArrayBuffer=O.toArrayBuffer,I}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,i,r){(function(s,o,p,l,c,u,h,d,f){var p=t("buffer").Buffer,v=4,m=new p(v);m.fill(0),i.exports={hash:function(g,y,x,_){for(var T=y((function(w,A){w.length%v!=0&&(P=w.length+(v-w.length%v),w=p.concat([w,m],P));for(var P,H=[],B=A?w.readInt32BE:w.readInt32LE,G=0;G<w.length;G+=v)H.push(B.call(w,G));return H})(g=p.isBuffer(g)?g:new p(g),_),8*g.length),y=_,S=new p(x),E=y?S.writeInt32BE:S.writeInt32LE,M=0;M<T.length;M++)E.call(S,T[M],4*M,!0);return S}}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(t,i,r){(function(s,o,p,l,c,u,h,d,f){var p=t("buffer").Buffer,v=t("./sha"),m=t("./sha256"),g=t("./rng"),y={sha1:v,sha256:m,md5:t("./md5")},x=64,_=new p(x);function T(w,A){var P=y[w=w||"sha1"],H=[];return P||S("algorithm:",w,"is not yet supported"),{update:function(B){return p.isBuffer(B)||(B=new p(B)),H.push(B),B.length,this},digest:function(B){var G=p.concat(H),G=A?(function(O,$,F){p.isBuffer($)||($=new p($)),p.isBuffer(F)||(F=new p(F)),$.length>x?$=O($):$.length<x&&($=p.concat([$,_],x));for(var J=new p(x),se=new p(x),be=0;be<x;be++)J[be]=54^$[be],se[be]=92^$[be];return F=O(p.concat([J,F])),O(p.concat([se,F]))})(P,A,G):P(G);return H=null,B?G.toString(B):G}}}function S(){var w=[].slice.call(arguments).join(" ");throw new Error([w,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
4122`))}_.fill(0),r.createHash=function(w){return T(w)},r.createHmac=T,r.randomBytes=function(w,A){if(!A||!A.call)return new p(g(w));try{A.call(this,void 0,new p(g(w)))}catch(P){A(P)}};var E,M=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],b=function(w){r[w]=function(){S("sorry,",w,"is not implemented yet")}};for(E in M)b(M[E])}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){var p=t("./helpers");function v(S,E){S[E>>5]|=128<<E%32,S[14+(E+64>>>9<<4)]=E;for(var M=1732584193,b=-271733879,w=-1732584194,A=271733878,P=0;P<S.length;P+=16){var H=M,B=b,G=w,O=A,M=g(M,b,w,A,S[P+0],7,-680876936),A=g(A,M,b,w,S[P+1],12,-389564586),w=g(w,A,M,b,S[P+2],17,606105819),b=g(b,w,A,M,S[P+3],22,-1044525330);M=g(M,b,w,A,S[P+4],7,-176418897),A=g(A,M,b,w,S[P+5],12,1200080426),w=g(w,A,M,b,S[P+6],17,-1473231341),b=g(b,w,A,M,S[P+7],22,-45705983),M=g(M,b,w,A,S[P+8],7,1770035416),A=g(A,M,b,w,S[P+9],12,-1958414417),w=g(w,A,M,b,S[P+10],17,-42063),b=g(b,w,A,M,S[P+11],22,-1990404162),M=g(M,b,w,A,S[P+12],7,1804603682),A=g(A,M,b,w,S[P+13],12,-40341101),w=g(w,A,M,b,S[P+14],17,-1502002290),M=y(M,b=g(b,w,A,M,S[P+15],22,1236535329),w,A,S[P+1],5,-165796510),A=y(A,M,b,w,S[P+6],9,-1069501632),w=y(w,A,M,b,S[P+11],14,643717713),b=y(b,w,A,M,S[P+0],20,-373897302),M=y(M,b,w,A,S[P+5],5,-701558691),A=y(A,M,b,w,S[P+10],9,38016083),w=y(w,A,M,b,S[P+15],14,-660478335),b=y(b,w,A,M,S[P+4],20,-405537848),M=y(M,b,w,A,S[P+9],5,568446438),A=y(A,M,b,w,S[P+14],9,-1019803690),w=y(w,A,M,b,S[P+3],14,-187363961),b=y(b,w,A,M,S[P+8],20,1163531501),M=y(M,b,w,A,S[P+13],5,-1444681467),A=y(A,M,b,w,S[P+2],9,-51403784),w=y(w,A,M,b,S[P+7],14,1735328473),M=x(M,b=y(b,w,A,M,S[P+12],20,-1926607734),w,A,S[P+5],4,-378558),A=x(A,M,b,w,S[P+8],11,-2022574463),w=x(w,A,M,b,S[P+11],16,1839030562),b=x(b,w,A,M,S[P+14],23,-35309556),M=x(M,b,w,A,S[P+1],4,-1530992060),A=x(A,M,b,w,S[P+4],11,1272893353),w=x(w,A,M,b,S[P+7],16,-155497632),b=x(b,w,A,M,S[P+10],23,-1094730640),M=x(M,b,w,A,S[P+13],4,681279174),A=x(A,M,b,w,S[P+0],11,-358537222),w=x(w,A,M,b,S[P+3],16,-722521979),b=x(b,w,A,M,S[P+6],23,76029189),M=x(M,b,w,A,S[P+9],4,-640364487),A=x(A,M,b,w,S[P+12],11,-421815835),w=x(w,A,M,b,S[P+15],16,530742520),M=_(M,b=x(b,w,A,M,S[P+2],23,-995338651),w,A,S[P+0],6,-198630844),A=_(A,M,b,w,S[P+7],10,1126891415),w=_(w,A,M,b,S[P+14],15,-1416354905),b=_(b,w,A,M,S[P+5],21,-57434055),M=_(M,b,w,A,S[P+12],6,1700485571),A=_(A,M,b,w,S[P+3],10,-1894986606),w=_(w,A,M,b,S[P+10],15,-1051523),b=_(b,w,A,M,S[P+1],21,-2054922799),M=_(M,b,w,A,S[P+8],6,1873313359),A=_(A,M,b,w,S[P+15],10,-30611744),w=_(w,A,M,b,S[P+6],15,-1560198380),b=_(b,w,A,M,S[P+13],21,1309151649),M=_(M,b,w,A,S[P+4],6,-145523070),A=_(A,M,b,w,S[P+11],10,-1120210379),w=_(w,A,M,b,S[P+2],15,718787259),b=_(b,w,A,M,S[P+9],21,-343485551),M=T(M,H),b=T(b,B),w=T(w,G),A=T(A,O)}return Array(M,b,w,A)}function m(S,E,M,b,w,A){return T((E=T(T(E,S),T(b,A)))<<w|E>>>32-w,M)}function g(S,E,M,b,w,A,P){return m(E&M|~E&b,S,E,w,A,P)}function y(S,E,M,b,w,A,P){return m(E&b|M&~b,S,E,w,A,P)}function x(S,E,M,b,w,A,P){return m(E^M^b,S,E,w,A,P)}function _(S,E,M,b,w,A,P){return m(M^(E|~b),S,E,w,A,P)}function T(S,E){var M=(65535&S)+(65535&E);return(S>>16)+(E>>16)+(M>>16)<<16|65535&M}i.exports=function(S){return p.hash(S,v,16)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){i.exports=function(p){for(var v,m=new Array(p),g=0;g<p;g++)(3&g)==0&&(v=4294967296*Math.random()),m[g]=v>>>((3&g)<<3)&255;return m}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){var p=t("./helpers");function v(y,x){y[x>>5]|=128<<24-x%32,y[15+(x+64>>9<<4)]=x;for(var _,T,S,E=Array(80),M=1732584193,b=-271733879,w=-1732584194,A=271733878,P=-1009589776,H=0;H<y.length;H+=16){for(var B=M,G=b,O=w,$=A,F=P,J=0;J<80;J++){E[J]=J<16?y[H+J]:g(E[J-3]^E[J-8]^E[J-14]^E[J-16],1);var se=m(m(g(M,5),(se=b,T=w,S=A,(_=J)<20?se&T|~se&S:!(_<40)&&_<60?se&T|se&S|T&S:se^T^S)),m(m(P,E[J]),(_=J)<20?1518500249:_<40?1859775393:_<60?-1894007588:-899497514)),P=A,A=w,w=g(b,30),b=M,M=se}M=m(M,B),b=m(b,G),w=m(w,O),A=m(A,$),P=m(P,F)}return Array(M,b,w,A,P)}function m(y,x){var _=(65535&y)+(65535&x);return(y>>16)+(x>>16)+(_>>16)<<16|65535&_}function g(y,x){return y<<x|y>>>32-x}i.exports=function(y){return p.hash(y,v,20,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){function p(x,_){var T=(65535&x)+(65535&_);return(x>>16)+(_>>16)+(T>>16)<<16|65535&T}function v(x,_){var T,S=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),E=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),M=new Array(64);x[_>>5]|=128<<24-_%32,x[15+(_+64>>9<<4)]=_;for(var b,w,A=0;A<x.length;A+=16){for(var P=E[0],H=E[1],B=E[2],G=E[3],O=E[4],$=E[5],F=E[6],J=E[7],se=0;se<64;se++)M[se]=se<16?x[se+A]:p(p(p((w=M[se-2],g(w,17)^g(w,19)^y(w,10)),M[se-7]),(w=M[se-15],g(w,7)^g(w,18)^y(w,3))),M[se-16]),T=p(p(p(p(J,g(w=O,6)^g(w,11)^g(w,25)),O&$^~O&F),S[se]),M[se]),b=p(g(b=P,2)^g(b,13)^g(b,22),P&H^P&B^H&B),J=F,F=$,$=O,O=p(G,T),G=B,B=H,H=P,P=p(T,b);E[0]=p(P,E[0]),E[1]=p(H,E[1]),E[2]=p(B,E[2]),E[3]=p(G,E[3]),E[4]=p(O,E[4]),E[5]=p($,E[5]),E[6]=p(F,E[6]),E[7]=p(J,E[7])}return E}var m=t("./helpers"),g=function(x,_){return x>>>_|x<<32-_},y=function(x,_){return x>>>_};i.exports=function(x){return m.hash(x,v,32,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){r.read=function(p,v,m,g,A){var x,_,T=8*A-g-1,S=(1<<T)-1,E=S>>1,M=-7,b=m?A-1:0,w=m?-1:1,A=p[v+b];for(b+=w,x=A&(1<<-M)-1,A>>=-M,M+=T;0<M;x=256*x+p[v+b],b+=w,M-=8);for(_=x&(1<<-M)-1,x>>=-M,M+=g;0<M;_=256*_+p[v+b],b+=w,M-=8);if(x===0)x=1-E;else{if(x===S)return _?NaN:1/0*(A?-1:1);_+=Math.pow(2,g),x-=E}return(A?-1:1)*_*Math.pow(2,x-g)},r.write=function(p,v,m,g,y,P){var _,T,S=8*P-y-1,E=(1<<S)-1,M=E>>1,b=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=g?0:P-1,A=g?1:-1,P=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(T=isNaN(v)?1:0,_=E):(_=Math.floor(Math.log(v)/Math.LN2),v*(g=Math.pow(2,-_))<1&&(_--,g*=2),2<=(v+=1<=_+M?b/g:b*Math.pow(2,1-M))*g&&(_++,g/=2),E<=_+M?(T=0,_=E):1<=_+M?(T=(v*g-1)*Math.pow(2,y),_+=M):(T=v*Math.pow(2,M-1)*Math.pow(2,y),_=0));8<=y;p[m+w]=255&T,w+=A,T/=256,y-=8);for(_=_<<y|T,S+=y;0<S;p[m+w]=255&_,w+=A,_/=256,S-=8);p[m+w-A]|=128*P}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(t,i,r){(function(s,o,a,l,c,u,h,d,f){var p,v,m;function g(){}(s=i.exports={}).nextTick=(v=typeof window<"u"&&window.setImmediate,m=typeof window<"u"&&window.postMessage&&window.addEventListener,v?function(y){return window.setImmediate(y)}:m?(p=[],window.addEventListener("message",function(y){var x=y.source;x!==window&&x!==null||y.data!=="process-tick"||(y.stopPropagation(),0<p.length&&p.shift()())},!0),function(y){p.push(y),window.postMessage("process-tick","*")}):function(y){setTimeout(y,0)}),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.on=g,s.addListener=g,s.once=g,s.off=g,s.removeListener=g,s.removeAllListeners=g,s.emit=g,s.binding=function(y){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(y){throw new Error("process.chdir is not supported")}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})})(kT)),kT.exports}gq();var UT,BT;function jP(){return BT||(BT=1,UT=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]),UT}var zT,VT;function vq(){return VT||(VT=1,zT=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),zT}var HT,GT;function qP(){return GT||(GT=1,HT=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),HT}var jv,WT;
4122function xq(){if(WT)return jv;WT=1;var n=jP();return jv=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),jv}var qv,$T;function yq(){if($T)return qv;$T=1;var n=qP();return n=n.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),qv=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),qv}var Xv,jT;function _q(){if(jT)return Xv;jT=1,Xv=_;var n=jP(),e=vq(),t=qP(),i=xq(),r=yq(),s=999,o=9999,a=0,l=1,c=2,u=3,h=4,d=5,f=6,p=7,v=8,m=9,g=10,y=11,x=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function _(T){var S=0,E=0,M=s,b,w,A=[],P=[],H=1,B=0,G=0,O=!1,$=!1,F="",J;T=T||{};var se=t,be=n;T.version==="300 es"&&(se=r,be=i);for(var Fe={},Le={},S=0;S<se.length;S++)Fe[se[S]]=!0;for(var S=0;S<be.length;S++)Le[be[S]]=!0;return function(K){return P=[],K!==null?ze(K):he()};function Ge(K){K.length&&P.push({type:x[M],data:K,position:G,line:H,column:B})}function ze(K){S=0,K.toString&&(K=K.toString()),F+=K.replace(/\r\n/g,`
4123`),J=F.length;for(var Q;b=F[S],S<J;){switch(Q=S,M){case a:S=q();break;case l:S=V();break;case c:S=I();break;case u:S=ye();break;case h:S=R();break;case y:S=D();break;case d:S=X();break;case o:S=Z();break;case m:S=ue();break;case s:S=fe();break}if(Q!==S)switch(F[Q]){case`
4124`:B=0,++H;break;default:++B;break}}return E+=S,F=F.slice(S),P}function he(K){return A.length&&Ge(A.join("")),M=g,Ge("(eof)"),P}function fe(){return A=A.length?[]:A,w==="/"&&b==="*"?(G=E+S-1,M=a,w=b,S+1):w==="/"&&b==="/"?(G=E+S-1,M=l,w=b,S+1):b==="#"?(M=c,G=E+S,S):/\s/.test(b)?(M=m,G=E+S,S):(O=/\d/.test(b),$=/[^\w_]/.test(b),G=E+S,M=O?h:$?u:o,S)}function ue(){return/[^\s]/g.test(b)?(Ge(A.join("")),M=s,S):(A.push(b),w=b,S+1)}function I(){return(b==="\r"||b===`
4125`)&&w!=="\\"?(Ge(A.join("")),M=s,S):(A.push(b),w=b,S+1)}function V(){return I()}function q(){return b==="/"&&w==="*"?(A.push(b),Ge(A.join("")),M=s,S+1):(A.push(b),w=b,S+1)}function ye(){if(w==="."&&/\d/.test(b))return M=d,S;if(w==="/"&&b==="*")return M=a,S;if(w==="/"&&b==="/")return M=l,S;if(b==="."&&A.length){for(;N(A););return M=d,S}if(b===";"||b===")"||b==="("){if(A.length)for(;N(A););return Ge(b),M=s,S+1}var K=A.length===2&&b!=="=";if(/[\w_\d\s]/.test(b)||K){for(;N(A););return M=s,S}return A.push(b),w=b,S+1}function N(K){var Q=0,ae,ee;do{if(ae=e.indexOf(K.slice(0,K.length+Q).join("")),ee=e[ae],ae===-1){if(Q--+K.length>0)continue;ee=K.slice(0,1).join("")}return Ge(ee),G+=ee.length,A=A.slice(ee.length),A.length}while(!0)}function D(){return/[^a-fA-F0-9]/.test(b)?(Ge(A.join("")),M=s,S):(A.push(b),w=b,S+1)}function R(){return b==="."||/[eE]/.test(b)?(A.push(b),M=d,w=b,S+1):b==="x"&&A.length===1&&A[0]==="0"?(M=y,A.push(b),w=b,S+1):/[^\d]/.test(b)?(Ge(A.join("")),M=s,S):(A.push(b),w=b,S+1)}function X(){return b==="f"&&(A.push(b),w=b,S+=1),/[eE]/.test(b)||(b==="-"||b==="+")&&/[eE]/.test(w)?(A.push(b),w=b,S+1):/[^\d]/.test(b)?(Ge(A.join("")),M=s,S):(A.push(b),w=b,S+1)}function Z(){if(/[^\d\w_]/.test(b)){var K=A.join("");return Le[K]?M=v:Fe[K]?M=p:M=f,Ge(A.join("")),M=s,S}return A.push(b),w=b,S+1}}return Xv}var Yv,qT;function bq(){if(qT)return Yv;qT=1;var n=_q();Yv=e;function e(t,i){var r=n(i),s=[];return s=s.concat(r(t)),s=s.concat(r(null)),s}return Yv}bq();function wq(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function Sq(n){var e=wq(n,"string");return typeof e=="symbol"?e:String(e)}function cn(n,e,t){return e=Sq(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Tt={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},er,tc;er={},cn(er,"".concat(Tt.normal),{"#include <beginnormal_vertex>":`
4126    vec3 objectNormal = `.concat(Tt.normal,`;
4127    #ifdef USE_TANGENT
4128	    vec3 objectTangent = vec3( tangent.xyz );
4129    #endif
4130    `)}),cn(er,"".concat(Tt.position),{"#include <begin_vertex>":`
4131    vec3 transformed = `.concat(Tt.position,`;
4132  `)}),cn(er,"".concat(Tt.positionRaw),{"#include <begin_vertex>":`
4133    vec4 csm_internal_positionUnprojected = `.concat(Tt.positionRaw,`;
4134    mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix;
4135    #ifdef USE_INSTANCING
4136      csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix;
4137    #endif
4138    csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected;
4139    vec3 transformed = csm_internal_positionUnprojected.xyz;
4140  `)}),cn(er,"".concat(Tt.pointSize),{"gl_PointSize = size;":`
4141    gl_PointSize = `.concat(Tt.pointSize,`;
4142    `)}),cn(er,"".concat(Tt.diffuseColor),{"#include <color_fragment>":`
4143    #include <color_fragment>
4144    diffuseColor = `.concat(Tt.diffuseColor,`;
4145  `)}),cn(er,"".concat(Tt.fragColor),{"#include <dithering_fragment>":`
4146    #include <dithering_fragment>
4147    gl_FragColor  = `.concat(Tt.fragColor,`;
4148  `)}),cn(er,"".concat(Tt.emissive),{"vec3 totalEmissiveRadiance = emissive;":`
4149    vec3 totalEmissiveRadiance = `.concat(Tt.emissive,`;
4150    `)}),cn(er,"".concat(Tt.roughness),{"#include <roughnessmap_fragment>":`
4151    #include <roughnessmap_fragment>
4152    roughnessFactor = `.concat(Tt.roughness,`;
4153    `)}),cn(er,"".concat(Tt.metalness),{"#include <metalnessmap_fragment>":`
4154    #include <metalnessmap_fragment>
4155    metalnessFactor = `.concat(Tt.metalness,`;
4156    `)}),cn(er,"".concat(Tt.ao),{"#include <aomap_fragment>":`
4157    #include <aomap_fragment>
4158    reflectedLight.indirectDiffuse *= 1. - `.concat(Tt.ao,`;
4159    `)}),cn(er,"".concat(Tt.bump),{"#include <normal_fragment_maps>":`
4160    #include <normal_fragment_maps>
4161
4162    vec3 csm_internal_orthogonal = `.concat(Tt.bump," - (dot(").concat(Tt.bump,`, normal) * normal);
4163    vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal;
4164    normal = normalize(normal - csm_internal_projectedbump);
4165    `)}),cn(er,"".concat(Tt.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":`
4166      gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * `.concat(Tt.depthAlpha,` );
4167    `),"gl_FragColor = packDepthToRGBA( fragCoordZ );":`
4168      gl_FragColor = packDepthToRGBA( fragCoordZ );
4169      gl_FragColor.a *= `.concat(Tt.depthAlpha,`;
4170    `)});tc={},cn(tc,"".concat(Tt.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":`
4171    gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(Tt.position,`, 1.0 );
4172  `)}),cn(tc,"".concat(Tt.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":`
4173    gl_Position = `.concat(Tt.position,`;
4174  `)}),cn(tc,"".concat(Tt.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":`
4175    gl_FragColor = `.concat(Tt.diffuseColor,`;
4176  `)}),cn(tc,"".concat(Tt.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":`
4177    gl_FragColor = `.concat(Tt.fragColor,`;
4178  `)});var tr;tr={},cn(tr,"".concat(Tt.position),"*"),cn(tr,"".concat(Tt.positionRaw),"*"),cn(tr,"".concat(Tt.normal),"*"),cn(tr,"".concat(Tt.pointSize),["PointsMaterial"]),cn(tr,"".concat(Tt.diffuseColor),"*"),cn(tr,"".concat(Tt.fragColor),"*"),cn(tr,"".concat(Tt.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),cn(tr,"".concat(Tt.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),cn(tr,"".concat(Tt.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),cn(tr,"".concat(Tt.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),cn(tr,"".concat(Tt.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),cn(tr,"".concat(Tt.depthAlpha),"*");const XP="180",YP=1,Mq=2,Ly=0,Qb=300,KP=301,Tq=302,XT=1e3,Xf=1001,YT=1002,Xc=1003,Oy=1006,ZP=1008,Eq=1009,Aq=1013,JP=1014,Cq=1015,Rq=1016,Pq=1023,KT=1026,Iq=1027,ZT=0,Nq=1,$m="",Yr="srgb",JT="srgb-linear",QT="linear",wh="srgb",jm=35044,Za=2e3,qm=2001;class c0{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[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 i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const wi=["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
41785","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 eE=1234567;const QP=Math.PI/180,eI=180/Math.PI;function al(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(wi[n&255]+wi[n>>8&255]+wi[n>>16&255]+wi[n>>24&255]+"-"+wi[e&255]+wi[e>>8&255]+"-"+wi[e>>16&15|64]+wi[e>>24&255]+"-"+wi[t&63|128]+wi[t>>8&255]+"-"+wi[t>>16&255]+wi[t>>24&255]+wi[i&255]+wi[i>>8&255]+wi[i>>16&255]+wi[i>>24&255]).toLowerCase()}function zt(n,e,t){return Math.max(e,Math.min(t,n))}function e1(n,e){return(n%e+e)%e}function Lq(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Oq(n,e,t){return n!==e?(t-n)/(e-n):0}function Sh(n,e,t){return(1-t)*n+t*e}function Dq(n,e,t,i){return Sh(n,e,1-Math.exp(-t*i))}function kq(n,e=1){return e-Math.abs(e1(n,e*2)-e)}function Fq(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Uq(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Bq(n,e){return n+Math.floor(Math.random()*(e-n+1))}function zq(n,e){return n+Math.random()*(e-n)}function Vq(n){return n*(.5-Math.random())}function Hq(n){n!==void 0&&(eE=n);let e=eE+=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 Gq(n){return n*QP}function Wq(n){return n*eI}function $q(n){return(n&n-1)===0&&n!==0}function jq(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function qq(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Xq(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),h=s((e-i)/2),d=o((e-i)/2),f=s((i-e)/2),p=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*h,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Jr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function sn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Yq={DEG2RAD:QP,RAD2DEG:eI,generateUUID:al,clamp:zt,euclideanModulo:e1,mapLinear:Lq,inverseLerp:Oq,lerp:Sh,damp:Dq,pingpong:kq,smoothstep:Fq,smootherstep:Uq,randInt:Bq,randFloat:zq,randFloatSpread:Vq,seededRandom:Hq,degToRad:Gq,radToDeg:Wq,isPowerOfTwo:$q,ceilPowerOfTwo:jq,floorPowerOfTwo:qq,setQuaternionFromProperEuler:Xq,normalize:sn,denormalize:Jr};class Or{constructor(e=0,t=0){Or.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 4,149 bytes, line 4178
4178sub(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,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+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=zt(this.x,e.x,t.x),this.y=zt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=zt(this.x,e,t),this.y=zt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(zt(i,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 i=this.dot(e)/t;return Math.acos(zt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,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 i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ed{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3];const d=s[o+0],f=s[o+1],p=s[o+2],v=s[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=v;return}if(h!==v||l!==d||c!==f||u!==p){let m=1-a;const g=l*d+c*f+u*p+h*v,y=g>=0?1:-1,x=1-g*g;if(x>Number.EPSILON){const T=Math.sqrt(x),S=Math.atan2(T,g*y);m=Math.sin(m*S)/T,a=Math.sin(a*S)/T}const _=a*y;if(l=l*m+d*_,c=c*m+f*_,u=u*m+p*_,h=h*m+v*_,m===1-a){const T=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=T,c*=T,u*=T,h*=T}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*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,i,r){return this._x=e,this._y=t,this._z=i,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 i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),d=l(i/2),f=l(r/2),p=l(s/2);switch(o){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*
vendor: 5,168 bytes, line 4178
4178h-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:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+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=(o-r)*f}else if(i>a&&i>h){const f=2*Math.sqrt(1+i-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>h){const f=2*Math.sqrt(1+a-i-h);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(zt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);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 i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);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}}class ct{constructor(e=0,t=0,i=0){ct.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,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}
vendor: 8,874 bytes, line 4178
4178sub(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(tE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(tE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*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,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+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=zt(this.x,e.x,t.x),this.y=zt(this.y,e.y,t.y),this.z=zt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=zt(this.x,e,t),this.y=zt(this.y,e,t),this.z=zt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(zt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Kv.copy(this).projectOnVector(e),this.sub(Kv)}reflect(e){return this.sub(Kv.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 i=this.dot(e)/t;return Math.acos(zt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+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,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,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(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,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,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Kv=new ct,tE=new Ed;class hs{constructor(e,t,i,r,s,o,a,l,c){hs.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.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 i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],f=i[5],p=i[8],v=r[0],m=r[3],g=r[6],y=r[1],x=r[4],_=r[7],T=r[2],S=r[5],E=r[8];return s[0]=o*v+a*y+l*T,s[3]=o*m+a*x+l*S,s[6]=o*g+a*_+l*E,s[1]=c*v+u*y+h*T,s[4]=c*m+u*x+h*S,s[7]=c*g+u*_+h*E,s[2]=d*v+f*y+p*T,s[5]=d*m+f*x+p*S,s[8]=d*g+f*_+p*E,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],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+i*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/p;return e[0]=h*v,e[1]=(r*c-u*i)*v,e[2]=(a*i-r*o)*v,e[3]=d*v,e[4]=(u*t-r*l)*v,e[5]=(r*s-a*t)*v,e[6]=f*v,e[7]=(i*l-c*t)*v,e[8]=(o*t-i*s)*v,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,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Zv.makeScale(e,t)),this}rotate(e){return this.premultiply(Zv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Zv.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),i=Math.sin(e);return this.set(t,-i,0,i,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,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Zv=new hs;function nE(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const iE={};function rE(n){n in iE||(iE[n]=!0,console.warn(n))}const sE=new hs().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),oE=new hs().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.20397
vendor: 27,845 bytes, line 4178
41787,1.0569715);function Kq(){const n={enabled:!0,workingColorSpace:JT,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===wh&&(r.r=mo(r.r),r.g=mo(r.g),r.b=mo(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wh&&(r.r=Pc(r.r),r.g=Pc(r.g),r.b=Pc(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===$m?QT: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,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].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 rE("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return rE("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[JT]:{primaries:e,whitePoint:i,transfer:QT,toXYZ:sE,fromXYZ:oE,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Yr},outputColorSpaceConfig:{drawingBufferColorSpace:Yr}},[Yr]:{primaries:e,whitePoint:i,transfer:wh,toXYZ:sE,fromXYZ:oE,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Yr}}}),n}const Qn=Kq();function mo(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Pc(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let nc;class Zq{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{nc===void 0&&(nc=nE("canvas")),nc.width=e.width,nc.height=e.height;const r=nc.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=nc}return i.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=nE("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=mo(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(mo(t[i]/255)*255):t[i]=mo(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Jq=0;class t1{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Jq++}),this.uuid=al(),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):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,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 i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Jv(r[o].image)):s.push(Jv(r[o]))}else s=Jv(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Jv(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Zq.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Qq=0;const Qv=new ct;class Dr extends c0{constructor(e=Dr.DEFAULT_IMAGE,t=Dr.DEFAULT_MAPPING,i=Xf,r=Xf,s=Oy,o=ZP,a=Pq,l=Eq,c=Dr.DEFAULT_ANISOTROPY,u=$m){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Qq++}),this.uuid=al(),this.name="",this.source=new t1(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new Or(0,0),this.repeat=new Or(1,1),this.center=new Or(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new hs,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}get width(){return this.source.getSize(Qv).x}get height(){return this.source.getSize(Qv).y}get depth(){return this.source.getSize(Qv).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}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.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 i=e[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={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,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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Qb)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case XT:e.x=e.x-Math.floor(e.x);break;case Xf:e.x=e.x<0?0:1;break;case YT: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 XT:e.y=e.y-Math.floor(e.y);break;case Xf:e.y=e.y<0?0:1;break;case YT: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++}}Dr.DEFAULT_IMAGE=null;Dr.DEFAULT_MAPPING=Qb;Dr.DEFAULT_ANISOTROPY=1;class Us{constructor(e=0,t=0,i=0,r=1){Us.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,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,i,r){return this.x=e,this.y=t,this.z=i,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,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[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,i,r,s;const o=e.elements,a=o[0],l=o[4],c=o[8],u=o[1],h=o[5],d=o[9],f=o[2],p=o[6],v=o[10];if(Math.abs(l-u)<.01&&Math.abs(c-f)<.01&&Math.abs(d-p)<.01){if(Math.abs(l+u)<.1&&Math.abs(c+f)<.1&&Math.abs(d+p)<.1&&Math.abs(a+h+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const g=(a+1)/2,y=(h+1)/2,x=(v+1)/2,_=(l+u)/4,T=(c+f)/4,S=(d+p)/4;return g>y&&g>x?g<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(g),r=_/i,s=T/i):y>x?y<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(y),i=_/r,s=S/r):x<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(x),i=T/s,r=S/s),this.set(i,r,s,t),this}let m=Math.sqrt((p-d)*(p-d)+(c-f)*(c-f)+(u-l)*(u-l));return Math.abs(m)<.001&&(m=1),this.x=(p-d)/m,this.y=(c-f)/m,this.z=(u-l)/m,this.w=Math.acos((a+h+v-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=zt(this.x,e.x,t.x),this.y=zt(this.y,e.y,t.y),this.z=zt(this.z,e.z,t.z),this.w=zt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=zt(this.x,e,t),this.y=zt(this.y,e,t),this.z=zt(this.z,e,t),this.w=zt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(zt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tI extends c0{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Oy,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Us(0,0,e,t),this.scissorTest=!1,this.viewport=new Us(0,0,e,t);const r={width:e,height:t,depth:i.depth},s=new Dr(r);this.textures=[];const o=i.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:Oy,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 i=0;i<this.textures.length;i++)this.textures[i].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,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;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=i,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,i=e.textures.length;t<i;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 t1(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}dispose(){this.dispatchEvent({type:"dispose"})}}class nI{constructor(e=new ct(1/0,1/0,1/0),t=new ct(-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,i=e.length;t<i;t+=3)this.expandByPoint($r.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint($r.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=$r.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),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 i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,$r):$r.fromBufferAttribute(s,o),$r.applyMatrix4(e.matrixWorld),this.expandByPoint($r);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Yf.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Yf.copy(i.boundingBox)),Yf.applyMatrix4(e.matrixWorld),this.union(Yf)}const r=e.children;for(let s=0,o=r.length;s<o;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,$r),$r.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Fu),Kf.subVectors(this.max,Fu),ic.subVectors(e.a,Fu),rc.subVectors(e.b,Fu),sc.subVectors(e.c,Fu),ko.subVectors(rc,ic),Fo.subVectors(sc,rc),ka.subVectors(ic,sc);let t=[0,-ko.z,ko.y,0,-Fo.z,Fo.y,0,-ka.z,ka.y,ko.z,0,-ko.x,Fo.z,0,-Fo.x,ka.z,0,-ka.x,-ko.y,ko.x,0,-Fo.y,Fo.x,0,-ka.y,ka.x,0];return!ex(t,ic,rc,sc,Kf)||(t=[1,0,0,0,1,0,0,0,1],!ex(t,ic,rc,sc,Kf))?!1:(Zf.crossVectors(ko,Fo),t=[Zf.x,Zf.y,Zf.z],ex(t,ic,rc,sc,Kf))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,$r).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize($r).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:(io[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),io[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),io[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),io[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),io[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),io[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),io[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),io[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(io),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 io=[new ct,new ct,new ct,new ct,new ct,new ct,new ct,new ct],$r=new ct,Yf=new nI,ic=new ct,rc=new ct,sc=new ct,ko=new ct,Fo=new ct,ka=new ct,Fu=new ct,Kf=new ct,Zf=new ct,Fa=new ct;function ex(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Fa.fromArray(n,s);const a=r.x*Math.abs(Fa.x)+r.y*Math.abs(Fa.y)+r.z*Math.abs(Fa.z),l=e.dot(Fa),c=t.dot(Fa),u=i.dot(Fa);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const eX=new nI,Uu=new ct,tx=new ct;class tX{constructor(e=new ct,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 i=this.center;t!==void 0?i.copy(t):eX.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.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 i=this.center.distanceToSquared(e);return t.copy(e),i>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;Uu.subVectors(e,this.center);const t=Uu.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Uu,r/i),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):(tx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Uu.copy(e.center).add(tx)),this.expandByPoint(Uu.copy(e.center).sub(tx))),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}}class cr{constructor(e,t,i,r,s,o,a,l,c,u,h,d,f,p,v,m){cr.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,h,d,f,p,v,m)}set(e,t,i,r,s,o,a,l,c,u,h,d,f,p,v,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=v,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new cr().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/oc.setFromMatrixColumn(e,0).length(),s=1/oc.setFromMatrixColumn(e,1).length(),o=1/oc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*u,f=o*h,p=a*u,v=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-v*c,t[9]=-a*l,t[2]=v-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,p=c*u,v=c*h;t[0]=d+v*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=v+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,p=c*u,v=c*h;t[0]=d-v*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=v-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,f=o*h,p=a*u,v=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+v,t[1]=l*h,t[5]=v*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,f=o*c,p=a*l,v=a*c;t[0]=l*u,t[4]=v-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-v*h}else if(e.order==="XZY"){const d=o*l,f=o*c,p=a*l,v=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+v,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=v*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(nX,e,iX)}lookAt(e,t,i){const r=this.elements;return gr.subVectors(e,t),gr.lengthSq()===0&&(gr.z=1),gr.normalize(),Uo.crossVectors(i,gr),Uo.lengthSq()===0&&(Math.abs(i.z)===1?gr.x+=1e-4:gr.z+=1e-4,gr.normalize(),Uo.crossVectors(i,gr)),Uo.normalize(),Jf.crossVectors(gr,Uo),r[0]=Uo.x,r[4]=Jf.x,r[8]=gr.x,r[1]=Uo.y,r[5]=Jf.y,r[9]=gr.y,r[2]=Uo.z,r[6]=Jf.z,r[10]=gr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5
vendor: 4,094 bytes, line 4178
4178],d=i[9],f=i[13],p=i[2],v=i[6],m=i[10],g=i[14],y=i[3],x=i[7],_=i[11],T=i[15],S=r[0],E=r[4],M=r[8],b=r[12],w=r[1],A=r[5],P=r[9],H=r[13],B=r[2],G=r[6],O=r[10],$=r[14],F=r[3],J=r[7],se=r[11],be=r[15];return s[0]=o*S+a*w+l*B+c*F,s[4]=o*E+a*A+l*G+c*J,s[8]=o*M+a*P+l*O+c*se,s[12]=o*b+a*H+l*$+c*be,s[1]=u*S+h*w+d*B+f*F,s[5]=u*E+h*A+d*G+f*J,s[9]=u*M+h*P+d*O+f*se,s[13]=u*b+h*H+d*$+f*be,s[2]=p*S+v*w+m*B+g*F,s[6]=p*E+v*A+m*G+g*J,s[10]=p*M+v*P+m*O+g*se,s[14]=p*b+v*H+m*$+g*be,s[3]=y*S+x*w+_*B+T*F,s[7]=y*E+x*A+_*G+T*J,s[11]=y*M+x*P+_*O+T*se,s[15]=y*b+x*H+_*$+T*be,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],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],v=e[7],m=e[11],g=e[15];return p*(+s*l*h-r*c*h-s*a*d+i*c*d+r*a*f-i*l*f)+v*(+t*l*f-t*c*d+s*o*d-r*o*f+r*c*u-s*l*u)+m*(+t*c*h-t*a*f-s*o*h+i*o*f+s*a*u-i*c*u)+g*(-r*a*u-t*l*h+t*a*d+r*o*h-i*o*d+i*l*u)}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,i){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]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=h*m*c-v*d*c+v*l*f-a*m*f-h*l*g+a*d*g,x=p*d*c-u*m*c-p*l*f+o*m*f+u*l*g-o*d*g,_=u*v*c-p*h*c+p*a*f-o*v*f-u*a*g+o*h*g,T=p*h*l-u*v*l-p*a*d+o*v*d+u*a*m-o*h*m,S=t*y+i*x+r*_+s*T;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/S;return e[0]=y*E,e[1]=(v*d*s-h*m*s-v*r*f+i*m*f+h*r*g-i*d*g)*E,e[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*g+i*l*g)*E,e[3]=(h*l*s-a*d*s-h*r*c+i*d*c+a*r*f-i*l*f)*E,e[4]=x*E,e[5]=(u*m*s-p*d*s+p*r*f-t*m*f-u*r*g+t*d*g)*E,e[6]=(p*l*s-o*m*s-p*r*c+t*m*c+o*r*g-t*l*g)*E,e[7]=(o*d*s-u*l*s+u*r*c-t*d*c-o*r*f+t*l*f)*E,e[8]=_*E,e[9]=(p*h*s-u*v*s-p*i*f+t*v*f+u*i*g-t*h*g)*E,e[10]=(o*v*s-p*a*s+p*i*c-t*v*c-o*i*g+t*a*g)*E,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*f-t*a*f)*E,e[12]=T*E,e[13]=(u*v*r-p*h*r+p*i*d-t*v*d-u*i*m+t*h*m)*E,e[14]=(p*a*r-o*v*r-p*i*l+t*v*l+o*i*m-t*a*m)*E,e[15]=(o*h*r-u*a*r+u*i*l-t*h*l-o*i*d+t*a*d)*E,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,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],i=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,i,r))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,v=o*u,m=o*h,g=a*h,y=l*c,x=l*u,_=l*h,T=i.x,S=i.y,E=i.z;return r[0]=(1-(v+g))*T,r[1]=(f+_)*T,r[2]=(p-x)*T,r[3]=0,r[4]=(f-_)*S,r[5]=(1-(d+g))*S,r[6]=(m+y)*S,r[7]=0,r[8]=(p+x)*E,r[9]=(m-y)*E,r[10]=(1-(d+v))*E,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=oc.set(r[0],r[1],r[2]).length();const o=oc.set(r[4],r[5],r[6]).length(),a=oc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],jr.copy(this);
vendor: 4,521 bytes, line 4178
4178const l=1/s,c=1/o,u=1/a;return jr.elements[0]*=l,jr.elements[1]*=l,jr.elements[2]*=l,jr.elements[4]*=c,jr.elements[5]*=c,jr.elements[6]*=c,jr.elements[8]*=u,jr.elements[9]*=u,jr.elements[10]*=u,t.setFromRotationMatrix(jr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Za,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),f=(i+r)/(i-r);let p,v;if(l)p=s/(o-s),v=o*s/(o-s);else if(a===Za)p=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===qm)p=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);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]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Za,l=!1){const c=this.elements,u=2/(t-e),h=2/(i-r),d=-(t+e)/(t-e),f=-(i+r)/(i-r);let p,v;if(l)p=1/(o-s),v=o/(o-s);else if(a===Za)p=-2/(o-s),v=-(o+s)/(o-s);else if(a===qm)p=-1/(o-s),v=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);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]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const oc=new ct,jr=new cr,nX=new ct(0,0,0),iX=new ct(1,1,1),Uo=new ct,Jf=new ct,gr=new ct,aE=new cr,lE=new Ed;class uu{constructor(e=0,t=0,i=0,r=uu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,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,i,r=this._order){return this._x=e,this._y=t,this._z=i,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,i=!0){const r=e.elements,s=r[0],o=r[4],a=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(zt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-zt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(zt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-zt(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(-o,c));break;case"YZX":this._z=Math.asin(zt(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(a,f));break;case"XZY":this._z=Math.asin(-zt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return aE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(aE,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return lE.setFromEuler(this),this.setFromQuaternion(lE,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}}uu.DEFAULT_ORDER="XYZ";class rX{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}
vendor: 5,651 bytes, line 4178
4178isEnabled(e){return(this.mask&(1<<e|0))!==0}}let sX=0;const cE=new ct,ac=new Ed,ro=new cr,Qf=new ct,Bu=new ct,oX=new ct,aX=new Ed,uE=new ct(1,0,0),hE=new ct(0,1,0),dE=new ct(0,0,1),fE={type:"added"},lX={type:"removed"},lc={type:"childadded",child:null},nx={type:"childremoved",child:null};class ll extends c0{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:sX++}),this.uuid=al(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ll.DEFAULT_UP.clone();const e=new ct,t=new uu,i=new Ed,r=new ct(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new cr},normalMatrix:{value:new hs}}),this.matrix=new cr,this.matrixWorld=new cr,this.matrixAutoUpdate=ll.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ll.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new rX,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.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ac.setFromAxisAngle(e,t),this.quaternion.multiply(ac),this}rotateOnWorldAxis(e,t){return ac.setFromAxisAngle(e,t),this.quaternion.premultiply(ac),this}rotateX(e){return this.rotateOnAxis(uE,e)}rotateY(e){return this.rotateOnAxis(hE,e)}rotateZ(e){return this.rotateOnAxis(dE,e)}translateOnAxis(e,t){return cE.copy(e).applyQuaternion(this.quaternion),this.position.add(cE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(uE,e)}translateY(e){return this.translateOnAxis(hE,e)}translateZ(e){return this.translateOnAxis(dE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ro.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Qf.copy(e):Qf.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Bu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ro.lookAt(Bu,Qf,this.up):ro.lookAt(Qf,Bu,this.up),this.quaternion.setFromRotationMatrix(ro),r&&(ro.extractRotation(r.matrixWorld),ac.setFromRotationMatrix(ro),this.quaternion.premultiply(ac.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(fE),lc.child=e,this.dispatchEvent(lc),lc.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(lX),nx.child=e,this.dispatchEvent(nx),nx.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),ro.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ro.multiply(e.parent.matrixWorld)),e.applyMatrix4(ro),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(fE),lc.child=e,this.dispatchEvent(lc),lc.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 i=0,r=this.children.length;i<r;i++){const s=this.children[i].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Bu,e,oX),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Bu,aX,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 i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 8,936 bytes, line 4178
4178):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.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,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.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),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.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),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(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),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(a,l){return a[l.uuid]===void 0&&(a[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 a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.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 a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),u=o(e.images),h=o(e.shapes),d=o(e.skeletons),f=o(e.animations),p=o(e.nodes);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),p.length>0&&(i.nodes=p)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[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.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}ll.DEFAULT_UP=new ct(0,1,0);ll.DEFAULT_MATRIX_AUTO_UPDATE=!0;ll.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const iI={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},Bo={h:0,s:0,l:0},ep={h:0,s:0,l:0};function ix(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class n1{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===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,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Yr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Qn.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Qn.workingColorSpace){return this.r=e,this.g=t,this.b=i,Qn.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Qn.workingColorSpace){if(e=e1(e,1),t=zt(t,0,1),i=zt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=ix(o,s,e+1/3),this.g=ix(o,s,e),this.b=ix(o,s,e-1/3)}
vendor: 5,047 bytes, line 4178
4178return Qn.colorSpaceToWorking(this,r),this}setStyle(e,t=Yr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(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(a))return i(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(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Yr){const i=iI[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=mo(e.r),this.g=mo(e.g),this.b=mo(e.b),this}copyLinearToSRGB(e){return this.r=Pc(e.r),this.g=Pc(e.g),this.b=Pc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Yr){return Qn.workingToColorSpace(Si.copy(this),e),Math.round(zt(Si.r*255,0,255))*65536+Math.round(zt(Si.g*255,0,255))*256+Math.round(zt(Si.b*255,0,255))}getHexString(e=Yr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Qn.workingColorSpace){Qn.workingToColorSpace(Si.copy(this),t);const i=Si.r,r=Si.g,s=Si.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-i)/h+2;break;case s:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Qn.workingColorSpace){return Qn.workingToColorSpace(Si.copy(this),t),e.r=Si.r,e.g=Si.g,e.b=Si.b,e}getStyle(e=Yr){Qn.workingToColorSpace(Si.copy(this),e);const t=Si.r,i=Si.g,r=Si.b;return e!==Yr?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Bo),this.setHSL(Bo.h+e,Bo.s+t,Bo.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Bo),e.getHSL(ep);const i=Sh(Bo.h,ep.h,t),r=Sh(Bo.s,ep.s,t),s=Sh(Bo.l,ep.l,t);return this.setHSL(i,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,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+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 Si=new n1;n1.NAMES=iI;const qn=new ct,tp=new Or;let cX=0;class uX{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:cX++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=jm,this.updateRanges=[],this.gpuType=Cq,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,i){e*=this.itemSize,i*=t.itemSize;
vendor: 4,504 bytes, line 4178
4178for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)tp.fromBufferAttribute(this,t),tp.applyMatrix3(e),this.setXY(t,tp.x,tp.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix3(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix4(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)qn.fromBufferAttribute(this,t),qn.applyNormalMatrix(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)qn.fromBufferAttribute(this,t),qn.transformDirection(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Jr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=sn(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Jr(t,this.array)),t}setX(e,t){return this.normalized&&(t=sn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Jr(t,this.array)),t}setY(e,t){return this.normalized&&(t=sn(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=Jr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=sn(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=Jr(t,this.array)),t}setW(e,t){return this.normalized&&(t=sn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=sn(t,this.array),i=sn(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=sn(t,this.array),i=sn(i,this.array),r=sn(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=sn(t,this.array),i=sn(i,this.array),r=sn(r,this.array),s=sn(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,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!==jm&&(e.usage=this.usage),e}}class hX extends Dr{constructor(e=[],t=KP,i,r,s,o,a,l,c,u){super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class dX{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=jm,this.updateRanges=[],this.version=0,this.uuid=al()}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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+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=al()),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]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}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=al()),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 Li=new ct;class i1{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}
vendor: 4,717 bytes, line 4178
4178get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Li.fromBufferAttribute(this,t),Li.applyMatrix4(e),this.setXYZ(t,Li.x,Li.y,Li.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Li.fromBufferAttribute(this,t),Li.applyNormalMatrix(e),this.setXYZ(t,Li.x,Li.y,Li.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Li.fromBufferAttribute(this,t),Li.transformDirection(e),this.setXYZ(t,Li.x,Li.y,Li.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=Jr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=sn(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=sn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=sn(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=Jr(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Jr(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Jr(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Jr(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=sn(t,this.array),i=sn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=sn(t,this.array),i=sn(i,this.array),r=sn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=sn(t,this.array),i=sn(i,this.array),r=sn(r,this.array),s=sn(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new uX(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 i1(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*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}}}const rx=new ct,fX=new ct,pX=new hs;class mX{constructor(e=new ct(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,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=rx.subVectors(i,t).cross(fX.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){const i=e.delta(rx),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;
4178const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<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 i=t||pX.getNormalMatrix(e),r=this.coplanarPoint(rx).applyMatrix4(e),s=this.normal.applyMatrix3(i).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)}}class gX extends Dr{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Xc,this.minFilter=Xc,this.generateMipmaps=!1,this.needsUpdate=!0}}let r1=class extends Dr{constructor(e,t,i=JP,r,s,o,a=Xc,l=Xc,c,u=KT,h=1){if(u!==KT&&u!==Iq)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,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new t1(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 s1{constructor(e,t,i,r){s1.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=i,s[3]=r,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:XP}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=XP);function Dy(n,e=0){let t=3735928559^e,i=1103547991^e;if(n instanceof Array)for(let r=0,s;r<n.length;r++)s=n[r],t=Math.imul(t^s,2654435761),i=Math.imul(i^s,1597334677);else for(let r=0,s;r<n.length;r++)s=n.charCodeAt(r),t=Math.imul(t^s,2654435761),i=Math.imul(i^s,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}const rI=(...n)=>Dy(n);function vX(n,e=!1){const t=[];n.isNode===!0&&t.push(n.id);for(const{property:i,childNode:r}of ky(n))t.push(Dy(i.slice(0,-4)),r.getCacheKey(e));return Dy(t)}function*ky(n,e=!1){for(const t of Object.getOwnPropertyNames(n)){if(t.startsWith("_")===!0)continue;const i=n[t];if(Array.isArray(i)===!0)for(let r=0;r<i.length;r++){const s=i[r];s&&(s.isNode===!0||e&&typeof s.toJSON=="function")&&(yield{property:t,index:r,childNode:s})}else if(i&&i.isNode===!0)yield{property:t,childNode:i};else if(i&&Object.getPrototypeOf(i)===Object.prototype)for(const r in i){if(r.startsWith("_")===!0)continue;const s=i[r];s&&(s.isNode===!0||e&&typeof s.toJSON=="function")&&(yield{property:t,index:r,childNode:s})}}}function Xm(n){if(n==null)return null;const e=typeof n;return n.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":n.isVector2===!0?"vec2":n.isVector3===!0?"vec3":n.isVector4===!0?"vec4":n.isMatrix2===!0?"mat2":n.isMatrix3===!0?"mat3":n.isMatrix4===!0?"mat4":n.isColor===!0?"color":n instanceof ArrayBuffer?"ArrayBuffer":null}function o1(n,...e){const t=n?n.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),n==="color"?new n1(...e):t==="vec2"?new Or(...e):t==="vec3"?new ct(...e):t==="vec4"?new Us(...e):t==="mat2"?new s1(...e):t==="mat3"?new hs(...e):t==="mat4"?new cr(...e):n==="bool"?e[0]||!1:n==="float"||n==="int"||n==="uint"?e[0]||0:n==="string"?e[0]||"":n==="ArrayBuffer"?yX(e[0]):null}function xX(n){let e="";const t=new Uint8Array(n);for(let i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return btoa(e)}function yX(n){return Uint8Array.from(atob(n),e=>e.charCodeAt(0)).buffer}const np={VERTEX:"vertex"},Vn={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Ad=["x","y","z","w"],_X={analyze:"setup",generate:"analyze"};let bX=0;class mt extends c0{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Vn.NONE,this.updateBeforeType=Vn.NONE,this.updateAfterType=Vn.NONE,this.uuid=Yq.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:bX++})}set needsUpdate(e){e===!0&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this),this}onFrameUpdate(e){return this.onUpdate(e,Vn.FRAME)}
4178onRenderUpdate(e){return this.onUpdate(e,Vn.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Vn.OBJECT)}onReference(e){return this.updateReference=e.bind(this),this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of ky(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return e=e||this.version!==this._cacheKeyVersion,(e===!0||this._cacheKey===null)&&(this._cacheKey=rI(vX(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}getArrayCount(){return null}setup(e){const t=e.getNodeProperties(this);let i=0;for(const r of this.getChildren())t["node"+i++]=r;return t.outputNode||null}analyze(e,t=null){const i=e.increaseUsage(this);if(this.parents===!0){const r=e.getDataFromNode(this,"any");r.stages=r.stages||{},r.stages[e.shaderStage]=r.stages[e.shaderStage]||[],r.stages[e.shaderStage].push(t)}if(i===1){const r=e.getNodeProperties(this);for(const s of Object.values(r))s&&s.isNode===!0&&s.build(e,this)}}generate(e,t){const{outputNode:i}=e.getNodeProperties(this);if(i&&i.isNode===!0)return i.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const i=this.getShared(e);if(this!==i)return i.build(e,t);const r=e.getDataFromNode(this);r.buildStages=r.buildStages||{},r.buildStages[e.buildStage]=!0;const s=_X[e.buildStage];if(s&&r.buildStages[s]!==!0){const l=e.getBuildStage();e.setBuildStage(s),this.build(e),e.setBuildStage(l)}e.addNode(this),e.addChain(this);let o=null;const a=e.getBuildStage();if(a==="setup"){this.updateReference(e);const l=e.getNodeProperties(this);if(l.initialized!==!0){l.initialized=!0,l.outputNode=this.setup(e)||l.outputNode||null;for(const c of Object.values(l))if(c&&c.isNode===!0){if(c.parents===!0){const u=e.getNodeProperties(c);u.parents=u.parents||[],u.parents.push(this)}c.build(e)}}o=l.outputNode}else if(a==="analyze")this.analyze(e,t);else if(a==="generate"){if(this.generate.length===1){const l=this.getNodeType(e),c=e.getDataFromNode(this);o=c.snippet,o===void 0?c.generated===void 0?(c.generated=!0,o=this.generate(e)||"",c.snippet=o):(console.warn("THREE.Node: Recursion detected.",this),o="/* Recursion detected. */"):c.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),o=e.format(o,l,t)}else o=this.generate(e,t)||"";o===""&&t!==null&&t!=="void"&&t!=="OutputType"&&(console.error(`THREE.TSL: Invalid generated code, expected a "${t}".`),o=e.generateConst(t))}return e.removeChain(this),e.addSequentialNode(this),o}getSerializeChildren(){return ky(this)}serialize(e){const t=this.getSerializeChildren(),i={};for(const{property:r,index:s,childNode:o}of t)s!==void 0?(i[r]===void 0&&(i[r]=Number.isInteger(s)?[]:{}),i[r][s]=o.toJSON(e.meta).uuid):i[r]=o.toJSON(e.meta).uuid;Object.keys(i).length>0&&(e.inputNodes=i)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const i in e.inputNodes)if(Array.isArray(e.inputNodes[i])){const r=[];for(const s of e.inputNodes[i])r.push(t[s]);this[i]=r}else if(typeof e.inputNodes[i]=="object"){const r={};for(const s in e.inputNodes[i]){const o=e.inputNodes[i][s];r[s]=t[o]}this[i]=r}else{const r=e.inputNodes[i];this[i]=t[r]}}}toJSON(e){const{uuid:t,type:i}=this,r=e===void 0||typeof e=="string";r&&(e={textures:{},images:{},nodes:{}});let s=e.nodes[t];s===void 0&&(s={uuid:t,type:i,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},r!==!0&&(e.nodes[s.uuid]=s),this.serialize(s),delete s.meta);function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}if(r){const a=o(e.textures),l=o(e.images),c=o(e.nodes);a.length>0&&(s.textures=a),l.length>0&&(s.images=l),c.length>0&&(s.nodes=c)}return s}}class Cd extends mt{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e),i=this.node.build(e),r=this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint");return`${i}[ ${r} ]`}}class sI extends mt{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let i=null;for(const r of this.convertTo.split("|"))(i===null||e.getTypeLength(t)===e.getTypeLength(r))&&(i=r);return i}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const i=this.node,r=this.getNodeType(e),s=i.build(e,r);return e.format(s,r,t)}}class Ri extends mt{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const i=e.getVectorType(this.getNodeType(e,t)),r=e.getDataFromNode(this);if(r.propertyName!==void 0)return e.format(r.propertyName,i,t);if(i!=="void"&&t!=="void"&&this.hasDependencies(e)){const s=super.build(e,i),o=e.getVarFromNode(this,null,i),a=e.getPropertyName(o);return e.addLineFlowCode(`${a} = ${s}`,this),r.snippet=s,r.propertyName=a,e.format(r.propertyName,i,t)}}return super.build(e,t)}}class wX extends Ri{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}
4178getNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,i)=>t+e.getTypeLength(i.getNodeType(e)),0))}generate(e,t){const i=this.getNodeType(e),r=e.getTypeLength(i),s=this.nodes,o=e.getComponentType(i),a=[];let l=0;for(const u of s){if(l>=r){console.error(`THREE.TSL: Length of parameters exceeds maximum length of function '${i}()' type.`);break}let h=u.getNodeType(e),d=e.getTypeLength(h),f;if(l+d>r&&(console.error(`THREE.TSL: Length of '${i}()' data exceeds maximum length of output type.`),d=r-l,h=e.getTypeFromLength(d)),l+=d,f=u.build(e,h),e.getComponentType(h)!==o){const p=e.getTypeFromLength(d,o);f=e.format(f,h,p)}a.push(f)}const c=`${e.getType(i)}( ${a.join(", ")} )`;return e.format(c,i,t)}}const SX=Ad.join("");class MX extends mt{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Ad.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}getScope(){return this.node.getScope()}generate(e,t){const i=this.node,r=e.getTypeLength(i.getNodeType(e));let s=null;if(r>1){let o=null;this.getVectorLength()>=r&&(o=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=i.build(e,o);this.components.length===r&&this.components===SX.slice(0,this.components.length)?s=e.format(a,o,t):s=e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else s=i.build(e,t);return s}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class TX extends Ri{static get type(){return"SetNode"}constructor(e,t,i){super(),this.sourceNode=e,this.components=t,this.targetNode=i}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:i,targetNode:r}=this,s=this.getNodeType(e),o=e.getComponentType(r.getNodeType(e)),a=e.getTypeFromLength(i.length,o),l=r.build(e,a),c=t.build(e,s),u=e.getTypeLength(s),h=[];for(let d=0;d<u;d++){const f=Ad[d];f===i[0]?(h.push(l),d+=i.length-1):h.push(c+"."+f)}return`${e.getType(s)}( ${h.join(", ")} )`}}class EX extends Ri{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:i}=this,r=this.getNodeType(e),s=i.build(e),o=e.getVarFromNode(this),a=e.getPropertyName(o);e.addLineFlowCode(a+" = "+s,this);const l=e.getTypeLength(r),c=[];let u=0;for(let h=0;h<l;h++){const d=Ad[h];d===t[u]?(c.push("1.0 - "+(a+"."+d)),u++):c.push(a+"."+d)}return`${e.getType(r)}( ${c.join(", ")} )`}}class a1 extends mt{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return this.nodeType===null?Xm(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=Xm(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=xX(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?o1(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}const pE=/float|u?int/;class $s extends a1{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const i=this.getNodeType(e);return pE.test(i)&&pE.test(t)?e.generateConst(t,this.value):e.format(this.generateConst(e),i,t)}}class AX extends mt{static get type(){return"MemberNode"}constructor(e,t){super(),this.structNode=e,this.property=t,this.isMemberNode=!0}hasMember(e){return this.structNode.isMemberNode&&this.structNode.hasMember(e)===!1?!1:this.structNode.getMemberType(e,this.property)!=="void"}getNodeType(e){return this.hasMember(e)===!1?"float":this.structNode.getMemberType(e,this.property)}getMemberType(e,t){if(this.hasMember(e)===!1)return"float";const i=this.getNodeType(e);return e.getStructTypeNode(i).getMemberType(e,t)}generate(e){if(this.hasMember(e)===!1){console.warn(`THREE.TSL: Member "${this.property}" does not exist in struct.`);const t=this.getNodeType(e);return e.generateConst(t)}return this.structNode.build(e)+"."+this.property}}let CX=null;const Fy=new Map;function _e(n,e){if(Fy.has(n)){console.warn(`THREE.TSL: Redefinition of method chaining '${n}'.`);return}if(typeof e!="function")throw new Error(`THREE.TSL: Node element ${n} is not a function`);Fy.set(n,e),n!=="assign"&&(mt.prototype[n]=function(...t){return this.isStackNode?this.add(e(...t)):e(this,...t)},mt.prototype[n+"Assign"]=function(...t){return this.isStackNode?this.assign(t[0],e(...t)):this.assign(e(this,...t))})}const RX=n=>n.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),mE=n=>RX(n).split("").sort().join("");mt.prototype.assign=function(...n){if(this.isStackNode!==!0)return console.error("THREE.TSL: No stack defined for assign operation. Make sure the assign is inside a Fn()."),this;{const e=Fy.get("assign");return this.add(e(...n))}};mt.prototype.toVarIntent=function(){return this};mt.prototype.get=function(n){return new AX(this,n)};const Mh={};function ip(n,e,t){Mh[n]=Mh[e]=Mh[t]={get(){this._cache=this._cache||{};let o=this._cache[n];return o===void 0&&(o=new MX(this,n),this._cache[n]=o),o},set(o){this[n].assign(Be(o))}};const i=n.toUpperCase(),r=e.toUpperCase(),s=t.toUpperCase();mt.prototype["set"+i]=mt.prototype["set"+r]=mt.prototype["set"+s]=function(o){const a=mE(n);return new TX(this,a,Be(o))},mt.prototype["flip"+i]=mt.prototype["flip"+r]=mt.prototype["flip"+s]=function(){const o=mE(n);return new EX(this,o)}}const ms=["x","y","z","w"],gs=["r","g","b","a"],vs=["s","t","p","q"];for(let n=0;n<4;n++){let e=ms[n],t=gs[n],i=vs[n];ip(e,t,i);for(let r=0;r<4;r++){e=ms[n]+ms[r],t=gs[n]+gs[r],i=vs[n]+vs[r],ip(e,t,i);for(let s=0;s<4;s++){e=ms[n]+ms[r]+ms[s],t=gs[n]+gs[r]+gs[s],i=vs[n]+vs[r]+vs[s],ip(e,t,i);for(let o=0;o<4;o++)e=ms[n]+ms[r]+ms[s]+ms[o],t=gs[n]+gs[r]+gs[s]+gs[o],i=vs[n]+vs[r]+vs[s]+vs[o],ip(e,t,i)}}}for(let n=0;n<32;n++)Mh[n]={get(){this._cache=this._cache||{};let e=this._cache[n];return e===void 0&&(e=new Cd(this,new $s(n,"uint")),this._cache[n]=e),e},set(e){this[n].assign(Be(e))}};Object.defineProperties(mt.prototype,Mh);const gE=new WeakMap,PX=function(n,e=null){const t=Xm(n);return t==="node"?n:e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string"?Be(Uy(n,e)):t==="shader"?n.isFn?n:Vt(n):n},IX=function(n,e=null){for(const t in n)n[t]=Be(n[t],e);return n},NX=function(n,e=null){const t=n.length;for(let i=0;i<t;i++)n[i]=Be(n[i],e);return n},oI=function(n,e=null,t=null,i=null){function r(u){return i!==null?(u=Be(Object.assign(u,i)),i.intent===!0&&(u=u.toVarIntent
4178())):u=Be(u),u}let s,o=e,a,l;function c(u){let h;return o?h=/[a-z]/i.test(o)?o+"()":o:h=n.type,a!==void 0&&u.length<a?(console.error(`THREE.TSL: "${h}" parameter length is less than minimum required.`),u.concat(new Array(a-u.length).fill(0))):l!==void 0&&u.length>l?(console.error(`THREE.TSL: "${h}" parameter length exceeds limit.`),u.slice(0,l)):u}return e===null?s=(...u)=>r(new n(...Ic(c(u)))):t!==null?(t=Be(t),s=(...u)=>r(new n(e,...Ic(c(u)),t))):s=(...u)=>r(new n(e,...Ic(c(u)))),s.setParameterLength=(...u)=>(u.length===1?a=l=u[0]:u.length===2&&([a,l]=u),s),s.setName=u=>(o=u,s),s},LX=function(n,...e){return Be(new n(...Ic(e)))};class OX extends mt{constructor(e,t){super(),this.shaderNode=e,this.rawInputs=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,rawInputs:i}=this,r=e.getNodeProperties(t),s=e.getClosestSubBuild(t.subBuilds)||"",o=s||"default";if(r[o])return r[o];const a=e.subBuildFn;e.subBuildFn=s;let l=null;if(t.layout){let c=gE.get(e.constructor);c===void 0&&(c=new WeakMap,gE.set(e.constructor,c));let u=c.get(t);u===void 0&&(u=Be(e.buildFunctionNode(t)),c.set(t,u)),e.addInclude(u);const h=i?DX(i):null;l=Be(u.call(h))}else{const c=new Proxy(e,{get:(p,v,m)=>{let g;return Symbol.iterator===v?g=function*(){yield void 0}:g=Reflect.get(p,v,m),g}}),u=i?kX(i):null,h=Array.isArray(i)?i.length>0:i!==null,d=t.jsFunc,f=h||d.length>1?d(u,c):d(c);l=Be(f)}return e.subBuildFn=a,t.once&&(r[o]=l),l}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),i=e.getSubBuildOutput(this);return t[i]=t[i]||this.setupOutput(e),t[i].subBuild=e.getClosestSubBuild(this),t[i]}build(e,t=null){let i=null;const r=e.getBuildStage(),s=e.getNodeProperties(this),o=e.getSubBuildOutput(this),a=this.getOutputNode(e);if(r==="setup"){const l=e.getSubBuildProperty("initialized",this);if(s[l]!==!0&&(s[l]=!0,s[o]=this.getOutputNode(e),s[o].build(e),this.shaderNode.subBuilds))for(const c of e.chaining){const u=e.getDataFromNode(c,"any");u.subBuilds=u.subBuilds||new Set;for(const h of this.shaderNode.subBuilds)u.subBuilds.add(h)}i=s[o]}else r==="analyze"?a.build(e,t):r==="generate"&&(i=a.build(e,t)||"");return i}}function DX(n){let e;return h1(n),n[0]&&(n[0].isNode||Object.getPrototypeOf(n[0])!==Object.prototype)?e=[...n]:e=n[0],e}function kX(n){let e=0;return h1(n),new Proxy(n,{get:(t,i,r)=>{let s;if(i==="length")return s=n.length,s;if(Symbol.iterator===i)s=function*(){for(const o of n)yield Be(o)};else{if(n.length>0)if(Object.getPrototypeOf(n[0])===Object.prototype){const o=n[0];o[i]===void 0?s=o[e++]:s=Reflect.get(o,i,r)}else n[0]instanceof mt&&(n[i]===void 0?s=n[e++]:s=Reflect.get(n,i,r));else s=Reflect.get(t,i,r);s=Be(s)}return s}})}class FX extends mt{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return Be(new OX(this,e))}setup(){return this.call()}}const UX=[!1,!0],BX=[0,1,2,3],zX=[-1,-2],aI=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],l1=new Map;for(const n of UX)l1.set(n,new $s(n));const c1=new Map;for(const n of BX)c1.set(n,new $s(n,"uint"));const u1=new Map([...c1].map(n=>new $s(n.value,"int")));for(const n of zX)u1.set(n,new $s(n,"int"));const u0=new Map([...u1].map(n=>new $s(n.value)));for(const n of aI)u0.set(n,new $s(n));for(const n of aI)u0.set(-n,new $s(-n));const h0={bool:l1,uint:c1,ints:u1,float:u0},vE=new Map([...l1,...u0]),Uy=(n,e)=>vE.has(n)?vE.get(n):n.isNode===!0?n:new $s(n,e),Kn=function(n,e=null){return(...t)=>{for(const r of t)if(r===void 0)return console.error(`THREE.TSL: Invalid parameter for the type "${n}".`),Be(new $s(0,n));if((t.length===0||!["bool","float","int","uint"].includes(n)&&t.every(r=>{const s=typeof r;return s!=="object"&&s!=="function"}))&&(t=[o1(n,...t)]),t.length===1&&e!==null&&e.has(t[0]))return rp(e.get(t[0]));if(t.length===1){const r=Uy(t[0],n);return r.nodeType===n?rp(r):rp(new sI(r,n))}const i=t.map(r=>Uy(r));return rp(new wX(i,n))}},VX=n=>n!=null?n.nodeType||n.convertTo||(typeof n=="string"?n:null):null;function HX(n,e){return new FX(n,e)}const Be=(n,e=null)=>PX(n,e),rp=(n,e=null)=>
4178Be(n,e).toVarIntent(),h1=(n,e=null)=>new IX(n,e),Ic=(n,e=null)=>new NX(n,e),$n=(n,e=null,t=null,i=null)=>new oI(n,e,t,i),Ao=(n,...e)=>new LX(n,...e),et=(n,e=null,t=null,i={})=>new oI(n,e,t,{intent:!0,...i});let GX=0;class WX extends mt{constructor(e,t=null){super();let i=null;t!==null&&(typeof t=="object"?i=t.return:(typeof t=="string"?i=t:console.error("THREE.TSL: Invalid layout type."),t=null)),this.shaderNode=new HX(e,i),t!==null&&this.setLayout(t),this.isFn=!0}setLayout(e){const t=this.shaderNode.nodeType;if(typeof e.inputs!="object"){const i={name:"fn"+GX++,type:t,inputs:[]};for(const r in e)r!=="return"&&i.inputs.push({name:r,type:e[r]});e=i}return this.shaderNode.setLayout(e),this}getNodeType(e){return this.shaderNode.getNodeType(e)||"float"}call(...e){const t=this.shaderNode.call(e);return this.shaderNode.nodeType==="void"&&t.toStack(),t.toVarIntent()}once(e=null){return this.shaderNode.once=!0,this.shaderNode.subBuilds=e,this}generate(e){const t=this.getNodeType(e);return console.error('THREE.TSL: "Fn()" was declared but not invoked. Try calling it like "Fn()( ...params )".'),e.generateConst(t)}}function Vt(n,e=null){const t=new WX(n,e);return new Proxy(()=>{},{apply(i,r,s){return t.call(...s)},get(i,r,s){return Reflect.get(t,r,s)},set(i,r,s,o){return Reflect.set(t,r,s,o)}})}const lI=(...n)=>CX.If(...n);function $X(n){return n}_e("toStack",$X);const jX=new Kn("color"),ci=new Kn("float",h0.float),Yc=new Kn("int",h0.ints),qX=new Kn("uint",h0.uint),cI=new Kn("bool",h0.bool),Rd=new Kn("vec2"),XX=new Kn("ivec2"),YX=new Kn("uvec2"),KX=new Kn("bvec2"),Kt=new Kn("vec3"),ZX=new Kn("ivec3"),JX=new Kn("uvec3"),QX=new Kn("bvec3"),go=new Kn("vec4"),eY=new Kn("ivec4"),tY=new Kn("uvec4"),nY=new Kn("bvec4"),uI=new Kn("mat2"),Pd=new Kn("mat3"),iY=new Kn("mat4");_e("toColor",jX);_e("toFloat",ci);_e("toInt",Yc);_e("toUint",qX);_e("toBool",cI);_e("toVec2",Rd);_e("toIVec2",XX);_e("toUVec2",YX);_e("toBVec2",KX);_e("toVec3",Kt);_e("toIVec3",ZX);_e("toUVec3",JX);_e("toBVec3",QX);_e("toVec4",go);_e("toIVec4",eY);_e("toUVec4",tY);_e("toBVec4",nY);_e("toMat2",uI);_e("toMat3",Pd);_e("toMat4",iY);const rY=$n(Cd).setParameterLength(2),sY=(n,e)=>Be(new sI(Be(n),e));_e("element",rY);_e("convert",sY);_e("append",n=>(console.warn("THREE.TSL: .append() has been renamed to .toStack()."),n));class d1 extends mt{static get type(){return"PropertyNode"}constructor(e,t=null,i=!1){super(e),this.name=t,this.varying=i,this.isPropertyNode=!0,this.global=!0}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const d0=(n,e)=>Be(new d1(n,e)),xE=Ao(d1,"vec4","DiffuseColor"),yE=Ao(d1,"vec4","Output");class hI extends mt{static get type(){return"UniformGroupNode"}constructor(e,t=!1,i=1){super("string"),this.name=e,this.shared=t,this.order=i,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const oY=n=>new hI(n),dI=(n,e=0)=>new hI(n,!0,e),Qr=dI("render"),aY=oY("object");class Id extends a1{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=aY}setName(e){return this.name=e,this}label(e){return console.warn('THREE.TSL: "label()" has been deprecated. Use "setName()" instead.'),this.setName(e)}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}
4178onUpdate(e,t){return e=e.bind(this),super.onUpdate(i=>{const r=e(i,this);r!==void 0&&(this.value=r)},t)}getInputType(e){let t=super.getInputType(e);return t==="bool"&&(t="uint"),t}generate(e,t){const i=this.getNodeType(e),r=this.getUniformHash(e);let s=e.getNodeFromHash(r);s===void 0&&(e.setHashNode(this,r),s=this);const o=s.getInputType(e),a=e.getUniformFromNode(s,o,e.shaderStage,this.name||e.context.nodeName),l=e.getPropertyName(a);e.context.nodeName!==void 0&&delete e.context.nodeName;let c=l;if(i==="bool"){const u=e.getDataFromNode(this);let h=u.propertyName;if(h===void 0){const d=e.getVarFromNode(this,null,"bool");h=e.getPropertyName(d),u.propertyName=h,c=e.format(l,o,i),e.addLineFlowCode(`${h} = ${c}`,this)}c=h}return e.format(c,i,t)}}const vi=(n,e)=>{const t=VX(e||n);return t===n&&(n=o1(t)),n=n&&n.isNode===!0?n.node&&n.node.value||n.value:n,Be(new Id(n,t))};class _E extends Ri{static get type(){return"ArrayNode"}constructor(e,t,i=null){super(e),this.count=t,this.values=i,this.isArrayNode=!0}getArrayCount(){return this.count}getNodeType(e){return this.nodeType===null&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const lY=(...n)=>{let e;if(n.length===1){const t=n[0];e=new _E(null,t.length,t)}else{const t=n[0],i=n[1];e=new _E(t,i)}return Be(e)};_e("toArray",(n,e)=>lY(Array(e).fill(n)));class cY extends Ri{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}getNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const i=e.getTypeLength(t.node.getNodeType(e));return Ad.join("").slice(0,i)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:i}=this,r=t.getScope(),s=e.getNodeProperties(r);s.assign=!0;const o=e.getNodeProperties(this);o.sourceNode=i,o.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:i,sourceNode:r}=e.getNodeProperties(this),s=this.needsSplitAssign(e),o=i.build(e),a=i.getNodeType(e),l=r.build(e,a),c=r.getNodeType(e),u=e.getDataFromNode(this);let h;if(u.initialized===!0)t!=="void"&&(h=o);else if(s){const d=e.getVarFromNode(this,null,a),f=e.getPropertyName(d);e.addLineFlowCode(`${f} = ${l}`,this);const p=i.node,v=p.node.context({assign:!0}).build(e);for(let m=0;m<p.components.length;m++){const g=p.components[m];e.addLineFlowCode(`${v}.${g} = ${f}[ ${m} ]`,this)}t!=="void"&&(h=o)}else h=`${o} = ${l}`,(t==="void"||c==="void")&&(e.addLineFlowCode(h,this),t!=="void"&&(h=o));return u.initialized=!0,e.format(h,a,t)}}const uY=$n(cY).setParameterLength(2);_e("assign",uY);class hY extends Ri{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}getMemberType(e,t){return this.functionNode.getMemberType(e,t)}generate(e){const t=[],i=this.functionNode,r=i.getInputs(e),s=this.parameters,o=(a,l)=>{const c=l.type,u=c==="pointer";let h;return u?h="&"+a.build(e):h=a.build(e,c),h};if(Array.isArray(s)){if(s.length>r.length)console.error("THREE.TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),s.length=r.length;else if(s.length<r.length)for(console.error("THREE.TSL: The number of provided parameters is less than the expected number of inputs in 'Fn()'.");s.length<r.length;)s.push(ci(0));for(let a=0;a<s.length;a++)t.push(o(s[a],r[a]))}else for(const a of r){const l=s[a.name];l!==void 0?t.push(o(l,a)):(console.error(`THREE.TSL: Input '${a.name}' not found in 'Fn()'.`),t.push(o(ci(0),a)))}return`${i.build(e,"property")}( ${t.join(", ")} )`}}const dY=(n,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?Ic(e):h1(e[0]),Be(new hY(Be(n),e)));_e("call",dY);const fY={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class An extends Ri{static get type(){return"OperatorNode"}constructor(e,t,i,...r){if(super(),r.length>0){let s=new An(e,t,i);for(let o=0;o<r.length-1;o++)s=new An(e,s,r[o]);t=s,i=r[r.length-1]}this.op=e,this.aNode=t,this.bNode=i,this.isOperatorNode=!0}getOperatorMethod(e,t){return e.getMethod(fY[this.op],t)}getNodeType(e,t=null){const i=this.op,r=this.aNode,s=this.bNode,o=r.getNodeType(e),a=s?s.getNodeType(e):null;if(o==="void"||a==="void")return t||"void";if(i==="%")return o;if(i==="~"||i==="&"||i==="|"||i==="^"||i===">>"||i==="<<")return e.getIntegerType(o);if(i==="!"||i==="&&"||i==="||"||i==="^^")return"bool";if(i==="=="||i==="!="||i==="<"||i===">"||i==="<="||i===">="){const l=Math.max(e.getTypeLength(o),e.getTypeLength(a));return l>1?`bvec${l}`:"bool"}else{if(e.isMatrix(o)){if(a==="float")return o;if(e.isVector(a))return e.getVectorFromMatrix(o);if(e.isMatrix(a))return o}else if(e.isMatrix(a)){if(o==="float")return a;
4178if(e.isVector(o))return e.getVectorFromMatrix(a)}return e.getTypeLength(a)>e.getTypeLength(o)?a:o}}generate(e,t){const i=this.op,{aNode:r,bNode:s}=this,o=this.getNodeType(e,t);let a=null,l=null;o!=="void"?(a=r.getNodeType(e),l=s?s.getNodeType(e):null,i==="<"||i===">"||i==="<="||i===">="||i==="=="||i==="!="?e.isVector(a)?l=a:e.isVector(l)?a=l:a!==l&&(a=l="float"):i===">>"||i==="<<"?(a=o,l=e.changeComponentType(l,"uint")):i==="%"?(a=o,l=e.isInteger(a)&&e.isInteger(l)?l:a):e.isMatrix(a)?l==="float"?l="float":e.isVector(l)?l=e.getVectorFromMatrix(a):e.isMatrix(l)||(a=l=o):e.isMatrix(l)?a==="float"?a="float":e.isVector(a)?a=e.getVectorFromMatrix(l):a=l=o:a=l=o):a=l=o;const c=r.build(e,a),u=s?s.build(e,l):null,h=e.getFunctionOperator(i);if(t!=="void"){const d=e.renderer.coordinateSystem===Za;if(i==="=="||i==="!="||i==="<"||i===">"||i==="<="||i===">=")return d?e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${c}, ${u} )`,o,t):e.format(`( ${c} ${i} ${u} )`,o,t):e.format(`( ${c} ${i} ${u} )`,o,t);if(i==="%")return e.isInteger(l)?e.format(`( ${c} % ${u} )`,o,t):e.format(`${this.getOperatorMethod(e,o)}( ${c}, ${u} )`,o,t);if(i==="!"||i==="~")return e.format(`(${i}${c})`,a,t);if(h)return e.format(`${h}( ${c}, ${u} )`,o,t);if(e.isMatrix(a)&&l==="float")return e.format(`( ${u} ${i} ${c} )`,o,t);if(a==="float"&&e.isMatrix(l))return e.format(`${c} ${i} ${u}`,o,t);{let f=`( ${c} ${i} ${u} )`;return!d&&o==="bool"&&e.isVector(a)&&e.isVector(l)&&(f=`all${f}`),e.format(f,o,t)}}else if(a!=="void")return h?e.format(`${h}( ${c}, ${u} )`,o,t):e.isMatrix(a)&&l==="float"?e.format(`${u} ${i} ${c}`,o,t):e.format(`${c} ${i} ${u}`,o,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const pY=et(An,"+").setParameterLength(2,1/0).setName("add"),By=et(An,"-").setParameterLength(2,1/0).setName("sub"),Al=et(An,"*").setParameterLength(2,1/0).setName("mul"),fI=et(An,"/").setParameterLength(2,1/0).setName("div"),f1=et(An,"%").setParameterLength(2).setName("mod"),pI=et(An,"==").setParameterLength(2).setName("equal"),mY=et(An,"!=").setParameterLength(2).setName("notEqual"),gY=et(An,"<").setParameterLength(2).setName("lessThan"),vY=et(An,">").setParameterLength(2).setName("greaterThan"),xY=et(An,"<=").setParameterLength(2).setName("lessThanEqual"),yY=et(An,">=").setParameterLength(2).setName("greaterThanEqual"),_Y=et(An,"&&").setParameterLength(2,1/0).setName("and"),bY=et(An,"||").setParameterLength(2,1/0).setName("or"),wY=et(An,"!").setParameterLength(1).setName("not"),SY=et(An,"^^").setParameterLength(2).setName("xor"),MY=et(An,"&").setParameterLength(2).setName("bitAnd"),TY=et(An,"~").setParameterLength(2).setName("bitNot"),EY=et(An,"|").setParameterLength(2).setName("bitOr"),AY=et(An,"^").setParameterLength(2).setName("bitXor"),CY=et(An,"<<").setParameterLength(2).setName("shiftLeft"),RY=et(An,">>").setParameterLength(2).setName("shiftRight"),PY=Vt(([n])=>(n.addAssign(1),n)),IY=Vt(([n])=>(n.subAssign(1),n)),NY=Vt(([n])=>{const e=Yc(n).toConst();return n.addAssign(1),e}),LY=Vt(([n])=>{const e=Yc(n).toConst();return n.subAssign(1),e});_e("add",pY);_e("sub",By);_e("mul",Al);_e("div",fI);_e("mod",f1);_e("equal",pI);_e("notEqual",mY);_e("lessThan",gY);_e("greaterThan",vY);_e("lessThanEqual",xY);_e("greaterThanEqual",yY);_e("and",_Y);_e("or",bY);_e("not",wY);_e("xor",SY);_e("bitAnd",MY);_e("bitNot",TY);_e("bitOr",EY);_e("bitXor",AY);_e("shiftLeft",CY);_e("shiftRight",RY);_e("incrementBefore",PY);_e("decrementBefore",IY);_e("increment",NY);_e("decrement",LY);const OY=(n,e)=>(console.warn('THREE.TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.'),f1(Yc(n),Yc(e)));_e("modInt",OY);class ie extends Ri{static get type(){return"MathNode"}constructor(e,t,i=null,r=null){if(super(),(e===ie.MAX||e===ie.MIN)&&arguments.length>3){let s=new ie(e,t,i);for(let o=2;o<arguments.length-1;o++)s=new ie(e,s,arguments[o]);t=s,i=arguments[arguments.length-1],r=null}this.method=e,this.aNode=t,this.bNode=i,this.cNode=r,this.isMathNode=!0}getInputType(e){const t=this.aNode.getNodeType(e),i=this.bNode?this.bNode.getNodeType(e):null,r=this.cNode?this.cNode.getNodeType(e):null,s=e.isMatrix(t)?0:e.getTypeLength(t),o=e.isMatrix(i)?0:e.getTypeLength(i),a=e.isMatrix(r)?0:e.getTypeLength(r);return s>o&&s>a?t:o>a?i:a>s?r:t}getNodeType(e){const t=this.method;return t===ie.LENGTH||t===ie.DISTANCE||t===ie.DOT?"float":t===ie.CROSS?"vec3":t===ie.ALL||t===ie.ANY?"bool":t===ie.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:i,method:r}=this;let s=null;if(r===ie.ONE_MINUS)s=By(1,t);else if(r===ie.RECIPROCAL)s=fI(1,t);else if(r===ie.DIFFERENCE)s=p1(By(t,i));else if(r===ie.TRANSFORM_DIRECTION){let o=t,a=i;e.isMatrix(o.getNodeType(e))?a=go(Kt(a),0):o=go(Kt(o),0);const l=Al(o,a).xyz;s=mI(l)}return s!==null?s:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let i=this.method;const r=this.getNodeType(e),s=this.getInputType(e),o=this.aNode,a=this.bNode,l=this.cNode,c=e.renderer.coordinateSystem;if(i===ie.NEGATE)return e.format("( - "+o.build(e,s)+" )",r,t);{const u=[];return i===ie.CROSS?u.push(o.build(e,r),a.build(e,r)):c===Za&&i===ie.STEP?u.push(o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":s),a.build(e,s)):c===Za&&
4178(i===ie.MIN||i===ie.MAX)?u.push(o.build(e,s),a.build(e,e.getTypeLength(a.getNodeType(e))===1?"float":s)):i===ie.REFRACT?u.push(o.build(e,s),a.build(e,s),l.build(e,"float")):i===ie.MIX?u.push(o.build(e,s),a.build(e,s),l.build(e,e.getTypeLength(l.getNodeType(e))===1?"float":s)):(c===qm&&i===ie.ATAN&&a!==null&&(i="atan2"),e.shaderStage!=="fragment"&&(i===ie.DFDX||i===ie.DFDY)&&(console.warn(`THREE.TSL: '${i}' is not supported in the ${e.shaderStage} stage.`),i="/*"+i+"*/"),u.push(o.build(e,s)),a!==null&&u.push(a.build(e,s)),l!==null&&u.push(l.build(e,s))),e.format(`${e.getMethod(i,r)}( ${u.join(", ")} )`,r,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}ie.ALL="all";ie.ANY="any";ie.RADIANS="radians";ie.DEGREES="degrees";ie.EXP="exp";ie.EXP2="exp2";ie.LOG="log";ie.LOG2="log2";ie.SQRT="sqrt";ie.INVERSE_SQRT="inversesqrt";ie.FLOOR="floor";ie.CEIL="ceil";ie.NORMALIZE="normalize";ie.FRACT="fract";ie.SIN="sin";ie.COS="cos";ie.TAN="tan";ie.ASIN="asin";ie.ACOS="acos";ie.ATAN="atan";ie.ABS="abs";ie.SIGN="sign";ie.LENGTH="length";ie.NEGATE="negate";ie.ONE_MINUS="oneMinus";ie.DFDX="dFdx";ie.DFDY="dFdy";ie.ROUND="round";ie.RECIPROCAL="reciprocal";ie.TRUNC="trunc";ie.FWIDTH="fwidth";ie.TRANSPOSE="transpose";ie.DETERMINANT="determinant";ie.INVERSE="inverse";ie.EQUALS="equals";ie.MIN="min";ie.MAX="max";ie.STEP="step";ie.REFLECT="reflect";ie.DISTANCE="distance";ie.DIFFERENCE="difference";ie.DOT="dot";ie.CROSS="cross";ie.POW="pow";ie.TRANSFORM_DIRECTION="transformDirection";ie.MIX="mix";ie.CLAMP="clamp";ie.REFRACT="refract";ie.SMOOTHSTEP="smoothstep";ie.FACEFORWARD="faceforward";const DY=ci(Math.PI),kY=et(ie,ie.ALL).setParameterLength(1),FY=et(ie,ie.ANY).setParameterLength(1),UY=et(ie,ie.RADIANS).setParameterLength(1),BY=et(ie,ie.DEGREES).setParameterLength(1),zY=et(ie,ie.EXP).setParameterLength(1),VY=et(ie,ie.EXP2).setParameterLength(1),HY=et(ie,ie.LOG).setParameterLength(1),GY=et(ie,ie.LOG2).setParameterLength(1),WY=et(ie,ie.SQRT).setParameterLength(1),$Y=et(ie,ie.INVERSE_SQRT).setParameterLength(1),jY=et(ie,ie.FLOOR).setParameterLength(1),qY=et(ie,ie.CEIL).setParameterLength(1),mI=et(ie,ie.NORMALIZE).setParameterLength(1),gI=et(ie,ie.FRACT).setParameterLength(1),vI=et(ie,ie.SIN).setParameterLength(1),XY=et(ie,ie.COS).setParameterLength(1),YY=et(ie,ie.TAN).setParameterLength(1),KY=et(ie,ie.ASIN).setParameterLength(1),ZY=et(ie,ie.ACOS).setParameterLength(1),xI=et(ie,ie.ATAN).setParameterLength(1,2),p1=et(ie,ie.ABS).setParameterLength(1),yI=et(ie,ie.SIGN).setParameterLength(1),JY=et(ie,ie.LENGTH).setParameterLength(1),QY=et(ie,ie.NEGATE).setParameterLength(1),eK=et(ie,ie.ONE_MINUS).setParameterLength(1),tK=et(ie,ie.DFDX).setParameterLength(1),nK=et(ie,ie.DFDY).setParameterLength(1),iK=et(ie,ie.ROUND).setParameterLength(1),rK=et(ie,ie.RECIPROCAL).setParameterLength(1),sK=et(ie,ie.TRUNC).setParameterLength(1),oK=et(ie,ie.FWIDTH).setParameterLength(1),aK=et(ie,ie.TRANSPOSE).setParameterLength(1),lK=et(ie,ie.DETERMINANT).setParameterLength(1),cK=et(ie,ie.INVERSE).setParameterLength(1),uK=(n,e)=>(console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'),pI(n,e)),hK=et(ie,ie.MIN).setParameterLength(2,1/0),dK=et(ie,ie.MAX).setParameterLength(2,1/0),fK=et(ie,ie.STEP).setParameterLength(2),pK=et(ie,ie.REFLECT).setParameterLength(2),mK=et(ie,ie.DISTANCE).setParameterLength(2),gK=et(ie,ie.DIFFERENCE).setParameterLength(2),m1=et(ie,ie.DOT).setParameterLength(2),vK=et(ie,ie.CROSS).setParameterLength(2),_I=et(ie,ie.POW).setParameterLength(2),xK=n=>Al(n,n),yK=n=>Al(n,n,n),_K=n=>Al(n,n,n,n),bK=et(ie,ie.TRANSFORM_DIRECTION).setParameterLength(2),wK=n=>Al(yI(n),_I(p1(n),1/3)),bI=n=>m1(n,n),g1=et(ie,ie.MIX).setParameterLength(3),wI=(n,e=0,t=1)=>Be(new ie(ie.CLAMP,Be(n),Be(e),Be(t))),SK=n=>wI(n),MK=et(ie,ie.REFRACT).setParameterLength(3),Qh=et(ie,ie.SMOOTHSTEP).setParameterLength(3),TK=et(ie,ie.FACEFORWARD).setParameterLength(3),EK=Vt(([n])=>{const e=43758.5453,t=m1(n.xy,Rd(12.9898,78.233)),i=f1(t,DY);return gI(vI(i).mul(e))}),AK=(n,e,t)=>g1(e,t,n),CK=(n,e,t)=>
4178Qh(e,t,n),RK=(n,e)=>fK(e,n),PK=(n,e)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),xI(n,e));_e("all",kY);_e("any",FY);_e("equals",uK);_e("radians",UY);_e("degrees",BY);_e("exp",zY);_e("exp2",VY);_e("log",HY);_e("log2",GY);_e("sqrt",WY);_e("inverseSqrt",$Y);_e("floor",jY);_e("ceil",qY);_e("normalize",mI);_e("fract",gI);_e("sin",vI);_e("cos",XY);_e("tan",YY);_e("asin",KY);_e("acos",ZY);_e("atan",xI);_e("abs",p1);_e("sign",yI);_e("length",JY);_e("lengthSq",bI);_e("negate",QY);_e("oneMinus",eK);_e("dFdx",tK);_e("dFdy",nK);_e("round",iK);_e("reciprocal",rK);_e("trunc",sK);_e("fwidth",oK);_e("atan2",PK);_e("min",hK);_e("max",dK);_e("step",RK);_e("reflect",pK);_e("distance",mK);_e("dot",m1);_e("cross",vK);_e("pow",_I);_e("pow2",xK);_e("pow3",yK);_e("pow4",_K);_e("transformDirection",bK);_e("mix",AK);_e("clamp",wI);_e("refract",MK);_e("smoothstep",CK);_e("faceForward",TK);_e("difference",gK);_e("saturate",SK);_e("cbrt",wK);_e("transpose",aK);_e("determinant",lK);_e("inverse",cK);_e("rand",EK);class IK extends mt{static get type(){return"ConditionalNode"}constructor(e,t,i=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=i}getNodeType(e){const{ifNode:t,elseNode:i}=e.getNodeProperties(this);if(t===void 0)return e.flowBuildStage(this,"setup"),this.getNodeType(e);const r=t.getNodeType(e);if(i!==null){const s=i.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(r))return s}return r}setup(e){const t=this.condNode.cache(),i=this.ifNode.cache(),r=this.elseNode?this.elseNode.cache():null,s=e.context.nodeBlock;e.getDataFromNode(i).parentNodeBlock=s,r!==null&&(e.getDataFromNode(r).parentNodeBlock=s);const o=e.context.uniformFlow,a=e.getNodeProperties(this);a.condNode=t,a.ifNode=o?i:i.context({nodeBlock:i}),a.elseNode=r?o?r:r.context({nodeBlock:r}):null}generate(e,t){const i=this.getNodeType(e),r=e.getDataFromNode(this);if(r.nodeProperty!==void 0)return r.nodeProperty;const{condNode:s,ifNode:o,elseNode:a}=e.getNodeProperties(this),l=e.currentFunctionNode,c=t!=="void",u=c?d0(i).build(e):"";r.nodeProperty=u;const h=s.build(e,"bool");if(e.context.uniformFlow&&a!==null){const f=o.build(e,i),p=a.build(e,i),v=e.getTernary(h,f,p);return e.format(v,i,t)}e.addFlowCode(`
4179${e.tab}if ( ${h} ) {
4180
4181`).addFlowTab();let d=o.build(e,i);if(d&&(c?d=u+" = "+d+";":(d="return "+d+";",l===null&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),d="// "+d))),e.removeFlowTab().addFlowCode(e.tab+"	"+d+`
4182
4183`+e.tab+"}"),a!==null){e.addFlowCode(` else {
4184
4185`).addFlowTab();let f=a.build(e,i);f&&(c?f=u+" = "+f+";":(f="return "+f+";",l===null&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),f="// "+f))),e.removeFlowTab().addFlowCode(e.tab+"	"+f+`
4186
4187`+e.tab+`}
4188
4189`)}else e.addFlowCode(`
4190
4191`);return e.format(u,i,t)}}const v1=$n(IK).setParameterLength(2,3);_e("select",v1);class NK extends mt{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}getMemberType(e,t){return this.node.getMemberType(e,t)}analyze(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}generate(e,t){const i=e.getContext();e.setContext({...e.context,...this.value});const r=this.node.build(e,t);return e.setContext(i),r}}const x1=$n(NK).setParameterLength(1,2),LK=n=>x1(n,{uniformFlow:!0}),SI=(n,e)=>x1(n,{nodeName:e});function OK(n,e){return console.warn('THREE.TSL: "label()" has been deprecated. Use "setName()" instead.'),SI(n,e)}_e("context",x1);_e("label",OK);_e("uniformFlow",LK);_e("setName",SI);class DK extends mt{static get type(){return"VarNode"}constructor(e,t=null,i=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=i,this.parents=!0,this.intent=!1}setIntent(e){return this.intent=e,this}getIntent(){return this.intent}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}getArrayCount(e){return this.node.getArrayCount(e)}build(...e){return this.intent===!0&&e[0].getNodeProperties(this).assign!==!0?this.node.build(...e):super.build(...e)}
4191generate(e){const{node:t,name:i,readOnly:r}=this,{renderer:s}=e,o=s.backend.isWebGPUBackend===!0;let a=!1,l=!1;r&&(a=e.isDeterministic(t),l=o?r:a);const c=e.getVectorType(this.getNodeType(e)),u=t.build(e,c),h=e.getVarFromNode(this,i,c,void 0,l),d=e.getPropertyName(h);let f=d;if(l)if(o)f=a?`const ${d}`:`let ${d}`;else{const p=t.getArrayCount(e);f=`const ${e.getVar(h.type,d,p)}`}return e.addLineFlowCode(`${f} = ${u}`,this),d}}const MI=$n(DK),kK=(n,e=null)=>MI(n,e).toStack(),FK=(n,e=null)=>MI(n,e,!0).toStack(),UK=n=>n;_e("toVar",kK);_e("toConst",FK);_e("toVarIntent",UK);class BK extends mt{static get type(){return"SubBuild"}constructor(e,t,i=null){super(i),this.node=e,this.name=t,this.isSubBuildNode=!0}getNodeType(e){if(this.nodeType!==null)return this.nodeType;e.addSubBuild(this.name);const t=this.node.getNodeType(e);return e.removeSubBuild(),t}build(e,...t){e.addSubBuild(this.name);const i=this.node.build(e,...t);return e.removeSubBuild(),i}}const zK=(n,e,t=null)=>Be(new BK(Be(n),e,t));class VK extends mt{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let i=t.varying;if(i===void 0){const r=this.name,s=this.getNodeType(e),o=this.interpolationType,a=this.interpolationSampling;t.varying=i=e.getVaryingFromNode(this,r,s,o,a),t.node=zK(this.node,"VERTEX")}return i.needsInterpolation||(i.needsInterpolation=e.shaderStage==="fragment"),i}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(np.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(np.VERTEX,this.node)}generate(e){const t=e.getSubBuildProperty("property",e.currentStack),i=e.getNodeProperties(this),r=this.setupVarying(e);if(i[t]===void 0){const s=this.getNodeType(e),o=e.getPropertyName(r,np.VERTEX);e.flowNodeFromShaderStage(np.VERTEX,i.node,s,o),i[t]=o}return e.getPropertyName(r)}}const Cl=$n(VK).setParameterLength(1,2),HK=n=>Cl(n);_e("toVarying",Cl);_e("toVertexStage",HK);_e("varying",(...n)=>(console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."),Cl(...n)));_e("vertexStage",(...n)=>(console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."),Cl(...n)));const GK=Vt(([n])=>{const e=n.mul(.9478672986).add(.0521327014).pow(2.4),t=n.mul(.0773993808),i=n.lessThanEqual(.04045);return g1(e,t,i)}).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),WK=Vt(([n])=>{const e=n.pow(.41666).mul(1.055).sub(.055),t=n.mul(12.92),i=n.lessThanEqual(.0031308);return g1(e,t,i)}).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),y1="WorkingColorSpace",$K="OutputColorSpace";class TI extends Ri{static get type(){return"ColorSpaceNode"}constructor(e,t,i){super("vec4"),this.colorNode=e,this.source=t,this.target=i}resolveColorSpace(e,t){return t===y1?Qn.workingColorSpace:t===$K?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,i=this.resolveColorSpace(e,this.source),r=this.resolveColorSpace(e,this.target);let s=t;return Qn.enabled===!1||i===r||!i||!r||(Qn.getTransfer(i)===wh&&(s=go(GK(s.rgb),s.a)),Qn.getPrimaries(i)!==Qn.getPrimaries(r)&&(s=go(Pd(Qn._getMatrix(new hs,i,r)).mul(s.rgb),s.a)),Qn.getTransfer(r)===wh&&(s=go(WK(s.rgb),s.a))),s}}const jK=(n,e)=>Be(new TI(Be(n),y1,e)),EI=(n,e)=>Be(new TI(Be(n),e,y1));_e("workingToColorSpace",jK);_e("colorSpaceToWorking",EI);let qK=class extends Cd{static get type(){return"ReferenceElementNode"}constructor(n,e){super(n,e),this.referenceNode=n,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(n){const e=super.generate(n),t=this.referenceNode.getNodeType(),i=this.getNodeType();return n.format(e,t,i)}};class XK extends mt{static get type(){return"ReferenceBaseNode"}constructor(e,t,i=null,r=null){super(),this.property=e,this.uniformType=t,this.object=i,this.count=r,this.properties=e.split("."),this.reference=i,this.node=null,this.group=null,this.updateType=Vn.OBJECT}setGroup(e){return this.group=e,this}element(e){return Be(new qK(this,Be(e)))}setNodeType(e){const t=vi(null,e);this.group!==null&&t.setGroup(this.group),this.node=t}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateV
4191alue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let i=e[t[0]];for(let r=1;r<t.length;r++)i=i[t[r]];return i}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}class YK extends XK{static get type(){return"RendererReferenceNode"}constructor(e,t,i=null){super(e,t,i),this.renderer=i,this.setGroup(Qr)}updateReference(e){return this.reference=this.renderer!==null?this.renderer:e.renderer,this.reference}}const KK=(n,e,t=null)=>Be(new YK(n,e,t));class ZK extends Ri{static get type(){return"ToneMappingNode"}constructor(e,t=QK,i=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=i}customCacheKey(){return rI(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,i=this.toneMapping;if(i===Ly)return t;let r=null;const s=e.renderer.library.getToneMappingFunction(i);return s!==null?r=go(s(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",i),r=t),r}}const JK=(n,e,t)=>Be(new ZK(n,Be(e),Be(t))),QK=KK("toneMappingExposure","float");_e("toneMapping",(n,e,t)=>JK(e,t,n));class eZ extends a1{static get type(){return"BufferAttributeNode"}constructor(e,t=null,i=0,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=i,this.bufferOffset=r,this.usage=jm,this.instanced=!1,this.attribute=null,this.global=!0,e&&e.isBufferAttribute===!0&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(this.bufferStride===0&&this.bufferOffset===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return this.bufferType===null&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(this.attribute!==null)return;const t=this.getNodeType(e),i=this.value,r=e.getTypeLength(t),s=this.bufferStride||r,o=this.bufferOffset,a=i.isInterleavedBuffer===!0?i:new dX(i,s),l=new i1(a,r,o);a.setUsage(this.usage),this.attribute=l,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),i=e.getBufferAttributeFromNode(this,t),r=e.getPropertyName(i);let s=null;return e.shaderStage==="vertex"||e.shaderStage==="compute"?(this.name=r,s=r):s=Cl(this).build(e,t),s}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&this.attribute.isBufferAttribute===!0&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const tZ=(n,e=null,t=0,i=0)=>Be(new eZ(n,e,t,i));_e("toAttribute",n=>tZ(n.value));class nZ extends mt{static get type(){return"ComputeNode"}constructor(e,t){super("void"),this.isComputeNode=!0,this.computeNode=e,this.workgroupSize=t,this.count=null,this.version=1,this.name="",this.updateBeforeType=Vn.OBJECT,this.onInitFunction=null}setCount(e){return this.count=e,this}getCount(){return this.count}dispose(){this.dispatchEvent({type:"dispose"})}setName(e){return this.name=e,this}label(e){return console.warn('THREE.TSL: "label()" has been deprecated. Use "setName()" instead.'),this.setName(e)}onInit(e){return this.onInitFunction=e,this}updateBefore({renderer:e}){e.compute(this)}setup(e){const t=this.computeNode.build(e);if(t){const i=e.getNodeProperties(this);i.outputComputeNode=t.outputNode,t.outputNode=null}return t}generate(e,t){const{shaderStage:i}=e;if(i==="compute"){const r=this.computeNode.build(e,"void");r!==""&&e.addLineFlowCode(r,this)}else{const r=e.getNodeProperties(this).outputComputeNode;if(r)return r.build(e,t)}}}const AI=(n,e=[64])=>{(e.length===0||e.length>3)&&console.error("THREE.TSL: compute() workgroupSize must have 1, 2, or 3 elements");for(let t=0;t<e.length;t++){const i=e[t];(typeof i!="number"||i<=0||!Number.isInteger(i))&&console.error(`THREE.TSL: compute() workgroupSize element at index [ ${t} ] must be a positive integer`)}for(;e.length<3;)e.push(1);return Be(new nZ(Be(n),e))},iZ=(n,e,t)=>AI(n,t).setCount(e);_e("compute",iZ);_e("computeKernel",AI);class rZ extends mt{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNo
4191de=!0}getNodeType(e){const t=e.getCache(),i=e.getCacheFromNode(this,this.parent);e.setCache(i);const r=this.node.getNodeType(e);return e.setCache(t),r}build(e,...t){const i=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.build(e,...t);return e.setCache(i),s}}const sZ=(n,e)=>Be(new rZ(Be(n),e));_e("cache",sZ);class oZ extends mt{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return t!==""&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const aZ=$n(oZ).setParameterLength(2);_e("bypass",aZ);class CI extends mt{static get type(){return"RemapNode"}constructor(e,t,i,r=ci(0),s=ci(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=i,this.outLowNode=r,this.outHighNode=s,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:i,outLowNode:r,outHighNode:s,doClamp:o}=this;let a=e.sub(t).div(i.sub(t));return o===!0&&(a=a.clamp()),a.mul(s.sub(r)).add(r)}}const lZ=$n(CI,null,null,{doClamp:!1}).setParameterLength(3,5),cZ=$n(CI).setParameterLength(3,5);_e("remap",lZ);_e("remapClamp",cZ);class uZ extends mt{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const i=this.getNodeType(e),r=this.snippet;if(i==="void")e.addLineFlowCode(r,this);else return e.format(r,i,t)}}const ed=$n(uZ).setParameterLength(1,2),hZ=n=>(n?v1(n,ed("discard")):ed("discard")).toStack();_e("discard",hZ);class dZ extends Ri{static get type(){return"RenderOutputNode"}constructor(e,t,i){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=i,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const i=(this.toneMapping!==null?this.toneMapping:e.toneMapping)||Ly,r=(this.outputColorSpace!==null?this.outputColorSpace:e.outputColorSpace)||$m;return i!==Ly&&(t=t.toneMapping(i)),r!==$m&&r!==Qn.workingColorSpace&&(t=t.workingToColorSpace(r)),t}}const fZ=(n,e=null,t=null)=>Be(new dZ(Be(n),e,t));_e("renderOutput",fZ);class pZ extends Ri{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,i=this.node.build(e),r="--- TSL debug - "+e.shaderStage+" shader ---",s="-".repeat(r.length);let o="";return o+="// #"+r+`#
4192`,o+=e.flow.code.replace(/^\t/mg,"")+`
4193`,o+="/* ... */ "+i+` /* ... */
4194`,o+="// #"+s+`#
4195`,t!==null?t(e,o):console.log(o),i}}const mZ=(n,e=null)=>Be(new pZ(Be(n),e)).toStack();_e("debug",mZ);class gZ extends mt{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(t===null){const i=this.getAttributeName(e);if(e.hasGeometryAttribute(i)){const r=e.geometry.getAttribute(i);t=e.getTypeFromAttribute(r)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),i=this.getNodeType(e);if(e.hasGeometryAttribute(t)===!0){const r=e.geometry.getAttribute(t),s=e.getTypeFromAttribute(r),o=e.getAttribute(t,s);return e.shaderStage==="vertex"?e.format(o.name,s,i):Cl(this).build(e,i)}else return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(i)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const f0=(n,e=null)=>Be(new gZ(n,e)),Nd=(n=0)=>f0("uv"+(n>0?n:""),"vec2");class vZ extends mt{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const i=this.textureNode.build(e,"property"),r=this.levelNode===null?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${i}, ${r} )`,this.getNodeType(e),t)}}const bE=$n(vZ).setParameterLength(1,2);class xZ extends Id{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Vn.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,i=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(i&&i.width!==void 0){const{width:r,height:s}=i;this.value=Math.log2(Math.max(r,s))}}}const yZ=$n(xZ).setParameterLength(1),RI=new Dr;class p0 extends Id{static get type(){return"TextureNode"}constructor(e=RI,t=null,i=null,r=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=i,this.biasNode=r,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.offsetNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Vn.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(t===null)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return this.value.isDepthTexture===!0?"float":this.value.type===JP?"uvec4":this.value.type===Aq?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return Nd(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return this._matrixUniform===null&&(this._matrixUniform=vi(this.value.matrix)),this._matrixUniform.mul(Kt(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?Vn.OBJECT:Vn.NONE,this}setupUV(e,t){const i=this.value;return e.isFlipY()&&(i.image instanceof ImageBitmap&&i.flipY===!0||i.isRenderTargetTexture===!0||i.isFramebufferTexture===!0||i.isDepthTexture===!0)&&(this.sampler?t=t.flipY():t=t.setY(Yc(bE(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const i=this.value;if(!i||i.isTexture!==!0)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let r=this.uvNode;(r===null||e.context.forceUVContext===!0)&&e.context.getUV&&(r=e.context.getUV(this,e)),r||(r=this.getDefaultUV()),this.updateMatrix===!0&&(r=this.getTransformedUV(r)),r=this.setupUV(e,r);let s=this.levelNode;s===null&&e.context.getTextureLevel&&(s=e.context.getTextureLevel(this)),t.uvNode=r,t.levelNode=s,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode,t.offsetNode=this.offsetNode}generateUV(e,t){return t.build(e,this.sampler===!0?"vec2":"ivec2")}generateOffset(e,t){return t.build(e,"ivec2")}generateSnippet(e,t,i,r,s,o,a,l,c){const u=this.value;let h;return r?h=e.generateTextureLevel(u,t,i,r,o,c):s?h=e.generateTextureBias(u,t,i,s,o,c):l?h=e.generateTextureGrad(u,t,i,l,o,c):a?h=e.generateTextureCompare(u,t,i,a,o,c):this.sampler===!1?h=e.generateTextureLoad(u,t,i,o,c):h=e.generateTexture(u,t,i,o,c),h}generate(e,t){const i=this.value,r=e.getNodeProperties(this),s=super.generate(e,"property");if(/^sampler/.test(t))return s+"_sampler";if(e.isReference(t))return s;{const o=e.getDataFromNode(this);let a=o.propertyName;if(a===void 0){const{uvNode:u,levelNode:h,biasNode:d,compareNode:f,depthNode:p,gradNode:v,offsetNode:m}=r,g=this.generateUV(e,u),y=h?h.build(e,"float"):null,x=d?d.build(e,"float"):null,_=p?p.build(e,"int"):null,T=f?f.build(e,"float"):null,S=v?[v[0].build(e,"vec2"),v[1].build(e,"vec2")]:null,E=m?this.generateOffset(e,m):null,M=e.getVarFromNode(this);a=e.getPropertyName(M);const b=this.generateSnippet(e,s,g,y,x,_,T,S,E);e.addLineFlowCode(`${a} = ${b}`,this),o.snippet=b,o.propertyName=a}let l=a;const c=this.getNodeType(e);return e.needsToWorkingColorSpace(i)&&(l=EI(ed(l,c),i.colorSpace).setup(e).build(e,c)),e.format(l,c,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=Be(e),t.referenceNode=this.getBase(),Be(t)}load(e){return this.sample(e).setSampler(!1)}blur(e){const t=this.clone();t.biasNode=Be(e).mul(yZ(t)),t.referenceNode=this.getBase();const i=t.value;return t.generateMipmaps===!1&&(i&&i.generateMipmaps===!1||i.minFilter===Xc||i.magFilter===Xc)&&(console.warn("THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),Be(t)}level(e){const t=this.clone();return t.levelNode=Be(e),t.referenceNode=this.getBase(),Be(t)}size(e){return bE(this,e)}bias(e){const t=this.clone();return t.biasNode=Be(e),t.referenceNode=this.getBase(),Be(t)}getBase(){return this.referenceNode?this.referenceNode.getBase():this}compare(e){const t=this.clone();return t.compareNode=Be(e),t.referenceNode=this.getBase(),Be(t)}grad(e,t){const i=this.clone();return i.gradNode=[Be(e),Be(t)],i.referenceNode=this.getBase(),Be(i)}depth(e){const t=this.clone();return t.depthNode=Be(e),t.referenceNode=this.getBase(),Be(t)}offset(e){const t=this.clone();return t.offsetNode=Be(e),t.referenceNode=this.getBase(),Be(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;t!==null&&(t.value=e.matrix),e.matrixAutoUpdate===!0&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e.offsetNode=this.offsetNode,e}}const _Z=$n(p0).setParameterLength(1,4).setName("texture"),bZ=(n=RI,e=null,t=null,i=null)=>{let r;return n&&n.isTextureNode===!0?(r=Be(n.clone()),r.referenceNode=n.getBase(),e!==null&&(r.uvNode=Be(e)),t!==null&&(r.levelNode=Be(t)),i!==null&&(r.biasNode=Be(i))):r=_Z(n,e,t,i),r};class PI extends Id{static get type(){return"BufferNode"}constructor(e,t,i=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=i}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const wZ=(n,e,t)=>Be(new PI(n,e,t));class SZ extends Cd{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),i=this.getNodeType(),r=this.node.getPaddedType();return e.format(t,r,i)}}class MZ extends PI{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=t===null?Xm(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Vn.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return e==="mat2"?t="mat2":/mat/.test(e)===!0?t="mat4":e.charAt(0)==="i"?t="ivec4":e.charAt(0)==="u"&&(t="uvec4"),t}update(){const{array:e,value:t}=this,i=this.elementType;if(i==="float"||i==="int"||i==="uint")for(let r=0;r<e.length;r++){const s=r*4;t[s]=e[r]}else if(i==="color")for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.r,t[s+1]=o.g,t[s+2]=o.b||0}else if(i==="mat2")for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.elements[0],t[s+1]=o.elements[1],t[s+2]=o.elements[2],t[s+3]=o.elements[3]}else if(i==="mat3")for(let r=0;r<e.length;r++){const s=r*16,o=e[r];t[s]=o.elements[0],t[s+1]=o.elements[1],t[s+2]=o.elements[2],t[s+4]=o.elements[3],t[s+5]=o.elements[4],t[s+6]=o.elements[5],t[s+8]=o.elements[6],t[s+9]=o.elements[7],t[s+10]=o.elements[8],t[s+1
41955]=1}else if(i==="mat4")for(let r=0;r<e.length;r++){const s=r*16,o=e[r];for(let a=0;a<o.elements.length;a++)t[s+a]=o.elements[a]}else for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.x,t[s+1]=o.y,t[s+2]=o.z||0,t[s+3]=o.w||0}}setup(e){const t=this.array.length,i=this.elementType;let r=Float32Array;const s=this.paddedType,o=e.getTypeLength(s);return i.charAt(0)==="i"&&(r=Int32Array),i.charAt(0)==="u"&&(r=Uint32Array),this.value=new r(t*o),this.bufferCount=t,this.bufferType=s,super.setup(e)}element(e){return Be(new SZ(this,Be(e)))}}const Wa=(n,e)=>Be(new MZ(n,e));class TZ extends mt{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}const II=$n(TZ).setParameterLength(1);let zu,Vu;class bn extends mt{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this._output=null,this.isViewportNode=!0}getNodeType(){return this.scope===bn.DPR?"float":this.scope===bn.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Vn.NONE;return(this.scope===bn.SIZE||this.scope===bn.VIEWPORT||this.scope===bn.DPR)&&(e=Vn.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===bn.VIEWPORT?t!==null?Vu.copy(t.viewport):(e.getViewport(Vu),Vu.multiplyScalar(e.getPixelRatio())):this.scope===bn.DPR?this._output.value=e.getPixelRatio():t!==null?(zu.width=t.width,zu.height=t.height):e.getDrawingBufferSize(zu)}setup(){const e=this.scope;let t=null;return e===bn.SIZE?t=vi(zu||(zu=new Or)):e===bn.VIEWPORT?t=vi(Vu||(Vu=new Us)):e===bn.DPR?t=vi(1):t=Rd(EZ.div(wE)),this._output=t,t}generate(e){if(this.scope===bn.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const i=e.getNodeProperties(wE).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${i}.y - ${t}.y )`}return t}return super.generate(e)}}bn.COORDINATE="coordinate";bn.VIEWPORT="viewport";bn.SIZE="size";bn.UV="uv";bn.DPR="dpr";const _1=Ao(bn,bn.UV),wE=Ao(bn,bn.SIZE),EZ=Ao(bn,bn.COORDINATE),NI=Ao(bn,bn.VIEWPORT);NI.zw;NI.xy;const AZ=vi(0,"uint").setName("u_cameraIndex").setGroup(dI("cameraIndex")).toVarying("v_cameraIndex"),Hu=vi("float").setName("cameraNear").setGroup(Qr).onRenderUpdate(({camera:n})=>n.near),Gu=vi("float").setName("cameraFar").setGroup(Qr).onRenderUpdate(({camera:n})=>n.far),Ld=Vt(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const i of n.cameras)t.push(i.matrixWorldInverse);e=Wa(t).setGroup(Qr).setName("cameraViewMatrices").element(n.isMultiViewCamera?II("gl_ViewID_OVR"):AZ).toConst("cameraViewMatrix")}else e=vi("mat4").setName("cameraViewMatrix").setGroup(Qr).onRenderUpdate(({camera:t})=>t.matrixWorldInverse);return e}).once()(),SE=new tX;class mn extends mt{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Vn.OBJECT,this.uniformNode=new Id(null)}getNodeType(){const e=this.scope;if(e===mn.WORLD_MATRIX)return"mat4";if(e===mn.POSITION||e===mn.VIEW_POSITION||e===mn.DIRECTION||e===mn.SCALE)return"vec3";if(e===mn.RADIUS)return"float"}update(e){const t=this.object3d,i=this.uniformNode,r=this.scope;if(r===mn.WORLD_MATRIX)i.value=t.matrixWorld;else if(r===mn.POSITION)i.value=i.value||new ct,i.value.setFromMatrixPosition(t.matrixWorld);else if(r===mn.SCALE)i.value=i.value||new ct,i.value.setFromMatrixScale(t.matrixWorld);else if(r===mn.DIRECTION)i.value=i.value||new ct,t.getWorldDirection(i.value);else if(r===mn.VIEW_POSITION){const s=e.camera;i.value=i.value||new ct,i.value.setFromMatrixPosition(t.matrixWorld),i.value.applyMatrix4(s.matrixWorldInverse)}else if(r===mn.RADIUS){const s=e.object.geometry;s.boundingSphere===null&&s.computeBoundingSphere(),SE.copy(s.boundingSphere).applyMatrix4(t.matrixWorld),i.value=SE.radius}}generate(e){const t=this.scope;return t===mn.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===mn.POSITION||t===mn.VIEW_POSITION||t===mn.DIRECTION||t===mn.SCALE?this.uniformNode.nodeType="vec3":t===mn.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}mn.WORLD_MATRIX="worldMatrix";mn.POSITION="position";mn.SCALE="scale";mn.VIEW_POSITION="viewPosition";mn.DIRECTION="direction";mn.RADIUS="radius";class ME extends mn{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const CZ=Ao(ME,ME.WORLD_MATRIX),RZ=vi(new hs).onObjectUpdate(({object:n},e)=>e.value.getNormalMatrix(n.matrixWorld)),PZ=Vt(n=>n.renderer.overrideNodes.modelViewMatrix||IZ).once()().toVar("modelViewMatrix"),IZ=Ld.mul(CZ),Vi=Vt(n=>n.context.setupPositionView().toVarying("v_positionView"),"vec3").once(["POSITION"])(),LI=Vi.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class NZ extends mt{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){if(e.shaderStage!=="fragment")return"true";const{material:t}=e;return t.side===YP?"false":e.getFrontFacing()}}const LZ=Ao(NZ),OI=ci(LZ).mul(2).sub(1),m0=Vt(([n],{material:e})=>{const t=e.side;return t===YP?n=n.mul(-1):t===Mq&&(n=n.mul(OI)),n}),OZ=f0("normal","vec3"),DZ=Vt(n=>n.geometry.hasAttribute("normal")===!1?(console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'),Kt(0,1,0)):OZ,"vec3").once()().toVar("normalLocal"),kZ=Vi.dFdx().cross(Vi.dFdy()).normalize().toVar("normalFlat"),FZ=Vt(n=>{let e;return n.material.flatShading===!0?e=kZ:e=DI(DZ).toVarying("v_normalViewGeometry").normalize(),e},"vec3").once()().toVar("normalViewGeometry"),Fr=Vt(({subBuildFn:n,material:e,context:t})=>{let i;return n==="NORMAL"||n==="VERTEX"?(i=FZ,e.flatShading!==!0&&(i=m0(i))):i=t.setupNormal().context({getUV:null}),i},"vec3").once(["NORMAL","VERTEX"])().toVar("normalView"),UZ=Fr.transformDirection(Ld).toVar("normalWorld"),BZ=Vt(({subBuildFn:n,context:e})=>{let t;return n==="NORMAL"||n==="VERTEX"?t=Fr:t=e.setupClearcoatNormal().context({getUV:null}),t},"vec3").once(["NORMAL","VERTEX"])().toVar("clearcoatNormalView"),DI=Vt(([n],e)=>{const t=e.renderer.overrideNodes.modelNormalViewMatrix;if(t!==null)return t.transformDirection(n);const i=RZ.mul(n);return Ld.transformDirection(i)});Vt(()=>(console.warn('THREE.TSL: "transformedNormalView" is deprecated. Use "normalView" instead.'),Fr)).once(["NORMAL","VERTEX"])();Vt(()=>(console.warn('THREE.TSL: "transformedNormalWorld" is deprecated. Use "normalWorld" instead.'),UZ)).once(["NORMAL","VERTEX"])();Vt(()=>(console.warn('THREE.TSL: "transformedClearcoatNormalView" is deprecated. Use "clearcoatNormalView" instead.'),BZ)).once(["NORMAL","VERTEX"])();const TE=new uu,sx=new cr,zZ=vi(0).onReference(({material:n})=>n).onObjectUpdate(({material:n})=>n.refractionRatio),VZ=vi(new cr).onReference(function(n){return n.material}).onObjectUpdate(function({material:n,scene:e}){const t=e.environment!==null&&n.envMap===null?e.environmentRotation:n.envMapRotation;return t?(TE.copy(t),sx.makeRotationFromEuler(TE)):sx.identity(),sx}),HZ=LI.negate().reflect(Fr),GZ=LI.negate().refract(Fr,zZ),WZ=HZ.transformDirection(Ld).toVar("reflectVector"),$Z=GZ.transformDirection(Ld).toVar("reflectVector"),jZ=new hX;class qZ extends p0{static get type(){return"CubeTextureNode"}constructor(e,t=null,i=null,r=null){super(e,t,i,r),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===KP?WZ:e.mapping===Tq?$Z:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),Kt(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const i=this.value;return(e.renderer.coordinateSystem===qm||!i.isRenderTargetTexture)&&(t=Kt(t.x.negate(),t.yz)),VZ.mul(t)}
4195generateUV(e,t){return t.build(e,"vec3")}}const XZ=$n(qZ).setParameterLength(1,4).setName("cubeTexture"),YZ=(n=jZ,e=null,t=null,i=null)=>{let r;return n&&n.isCubeTextureNode===!0?(r=Be(n.clone()),r.referenceNode=n,e!==null&&(r.uvNode=Be(e)),t!==null&&(r.levelNode=Be(t)),i!==null&&(r.biasNode=Be(i))):r=XZ(n,e,t,i),r};class KZ extends Cd{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),i=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,i,r)}}class kI extends mt{static get type(){return"ReferenceNode"}constructor(e,t,i=null,r=null){super(),this.property=e,this.uniformType=t,this.object=i,this.count=r,this.properties=e.split("."),this.reference=i,this.node=null,this.group=null,this.name=null,this.updateType=Vn.OBJECT}element(e){return Be(new KZ(this,Be(e)))}setGroup(e){return this.group=e,this}setName(e){return this.name=e,this}label(e){return console.warn('THREE.TSL: "label()" has been deprecated. Use "setName()" instead.'),this.setName(e)}setNodeType(e){let t=null;this.count!==null?t=wZ(null,e,this.count):Array.isArray(this.getValueFromReference())?t=Wa(null,e):e==="texture"?t=bZ(null):e==="cubeTexture"?t=YZ(null):t=vi(null,e),this.group!==null&&t.setGroup(this.group),this.name!==null&&t.setName(this.name),this.node=t}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let i=e[t[0]];for(let r=1;r<t.length;r++)i=i[t[r]];return i}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const Ym=(n,e,t)=>Be(new kI(n,e,t));class ZZ extends kI{static get type(){return"MaterialReferenceNode"}constructor(e,t,i=null){super(e,t,i),this.material=i,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=this.material!==null?this.material:e.material,this.reference}}const JZ=(n,e,t=null)=>Be(new ZZ(n,e,t)),FI=Nd(),QZ=Vi.dFdx(),eJ=Vi.dFdy(),UI=FI.dFdx(),BI=FI.dFdy(),zI=Fr,VI=eJ.cross(zI),HI=zI.cross(QZ),zy=VI.mul(UI.x).add(HI.mul(BI.x)),Vy=VI.mul(UI.y).add(HI.mul(BI.y)),EE=zy.dot(zy).max(Vy.dot(Vy)),GI=EE.equal(0).select(0,EE.inverseSqrt()),tJ=zy.mul(GI).toVar("tangentViewFrame"),nJ=Vy.mul(GI).toVar("bitangentViewFrame"),WI=Vt(n=>(n.geometry.hasAttribute("tangent")===!1&&n.geometry.computeTangents(),f0("tangent","vec4")))(),iJ=WI.xyz.toVar("tangentLocal"),$I=Vt(({subBuildFn:n,geometry:e,material:t})=>{let i;return n==="VERTEX"||e.hasAttribute("tangent")?i=PZ.mul(go(iJ,0)).xyz.toVarying("v_tangentView").normalize():i=tJ,t.flatShading!==!0&&(i=m0(i)),i},"vec3").once(["NORMAL","VERTEX"])().toVar("tangentView"),rJ=Vt(([n,e],{subBuildFn:t,material:i})=>{let r=n.mul(WI.w).xyz;return t==="NORMAL"&&i.flatShading!==!0&&(r=r.toVarying(e)),r}).once(["NORMAL"]),sJ=Vt(({subBuildFn:n,geometry:e,material:t})=>{let i;return n==="VERTEX"||e.hasAttribute("tangent")?i=rJ(Fr.cross($I),"v_bitangentView").normalize():i=nJ,t.flatShading!==!0&&(i=m0(i)),i},"vec3").once(["NORMAL","VERTEX"])().toVar("bitangentView"),oJ=Pd($I,sJ,Fr).toVar("TBNViewMatrix");class aJ extends Ri{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=ZT}setup({material:e}){const{normalMapType:t,scaleNode:i}=this;let r=this.node.mul(2).sub(1);if(i!==null){let o=i;e.flatShading===!0&&(o=m0(o)),r=Kt(r.xy.mul(o),r.z)}let s=null;return t===Nq?s=DI(r):t===ZT?s=oJ.mul(r).normalize():(console.error(`THREE.NodeMaterial: Unsupported normal map type: ${t}`),s=Fr),s}}const AE=$n(aJ).setParameterLength(1,2),lJ=Vt(({textureNode:n,bumpScale:e})=>{const t=r=>n.cache().context({getUV:s=>r(s.uvNode||Nd()),forceUVContext:!0}),i=ci(t(r=>r));return Rd(ci(t(r=>r.add(r.dFdx()))).sub(i),ci(t(r=>r.add(r.dFdy()))).sub(i)).mul(e)}
4195),cJ=Vt(n=>{const{surf_pos:e,surf_norm:t,dHdxy:i}=n,r=e.dFdx().normalize(),s=e.dFdy().normalize(),o=t,a=s.cross(o),l=o.cross(r),c=r.dot(a).mul(OI),u=c.sign().mul(i.x.mul(a).add(i.y.mul(l)));return c.abs().mul(t).sub(u).normalize()});class uJ extends Ri{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=this.scaleNode!==null?this.scaleNode:1,t=lJ({textureNode:this.textureNode,bumpScale:e});return cJ({surf_pos:Vi,surf_norm:Fr,dHdxy:t})}}const hJ=$n(uJ).setParameterLength(1,2),CE=new Map;let Ut=class Pn extends mt{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let i=CE.get(e);return i===void 0&&(i=JZ(e,t),CE.set(e,i)),i}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache(e==="map"?"map":e+"Map","texture")}setup(e){const t=e.context.material,i=this.scope;let r=null;if(i===Pn.COLOR){const s=t.color!==void 0?this.getColor(i):Kt();t.map&&t.map.isTexture===!0?r=s.mul(this.getTexture("map")):r=s}else if(i===Pn.OPACITY){const s=this.getFloat(i);t.alphaMap&&t.alphaMap.isTexture===!0?r=s.mul(this.getTexture("alpha")):r=s}else if(i===Pn.SPECULAR_STRENGTH)t.specularMap&&t.specularMap.isTexture===!0?r=this.getTexture("specular").r:r=ci(1);else if(i===Pn.SPECULAR_INTENSITY){const s=this.getFloat(i);t.specularIntensityMap&&t.specularIntensityMap.isTexture===!0?r=s.mul(this.getTexture(i).a):r=s}else if(i===Pn.SPECULAR_COLOR){const s=this.getColor(i);t.specularColorMap&&t.specularColorMap.isTexture===!0?r=s.mul(this.getTexture(i).rgb):r=s}else if(i===Pn.ROUGHNESS){const s=this.getFloat(i);t.roughnessMap&&t.roughnessMap.isTexture===!0?r=s.mul(this.getTexture(i).g):r=s}else if(i===Pn.METALNESS){const s=this.getFloat(i);t.metalnessMap&&t.metalnessMap.isTexture===!0?r=s.mul(this.getTexture(i).b):r=s}else if(i===Pn.EMISSIVE){const s=this.getFloat("emissiveIntensity"),o=this.getColor(i).mul(s);t.emissiveMap&&t.emissiveMap.isTexture===!0?r=o.mul(this.getTexture(i)):r=o}else if(i===Pn.NORMAL)t.normalMap?(r=AE(this.getTexture("normal"),this.getCache("normalScale","vec2")),r.normalMapType=t.normalMapType):t.bumpMap?r=hJ(this.getTexture("bump").r,this.getFloat("bumpScale")):r=Fr;else if(i===Pn.CLEARCOAT){const s=this.getFloat(i);t.clearcoatMap&&t.clearcoatMap.isTexture===!0?r=s.mul(this.getTexture(i).r):r=s}else if(i===Pn.CLEARCOAT_ROUGHNESS){const s=this.getFloat(i);t.clearcoatRoughnessMap&&t.clearcoatRoughnessMap.isTexture===!0?r=s.mul(this.getTexture(i).r):r=s}else if(i===Pn.CLEARCOAT_NORMAL)t.clearcoatNormalMap?r=AE(this.getTexture(i),this.getCache(i+"Scale","vec2")):r=Fr;else if(i===Pn.SHEEN){const s=this.getColor("sheenColor").mul(this.getFloat("sheen"));t.sheenColorMap&&t.sheenColorMap.isTexture===!0?r=s.mul(this.getTexture("sheenColor").rgb):r=s}else if(i===Pn.SHEEN_ROUGHNESS){const s=this.getFloat(i);t.sheenRoughnessMap&&t.sheenRoughnessMap.isTexture===!0?r=s.mul(this.getTexture(i).a):r=s,r=r.clamp(.07,1)}else if(i===Pn.ANISOTROPY)if(t.anisotropyMap&&t.anisotropyMap.isTexture===!0){const s=this.getTexture(i);r=uI(Wu.x,Wu.y,Wu.y.negate(),Wu.x).mul(s.rg.mul(2).sub(Rd(1)).normalize().mul(s.b))}else r=Wu;else if(i===Pn.IRIDESCENCE_THICKNESS){const s=Ym("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const o=Ym("0","float",t.iridescenceThicknessRange);r=s.sub(o).mul(this.getTexture(i).g).add(o)}else r=s}else if(i===Pn.TRANSMISSION){const s=this.getFloat(i);t.transmissionMap?r=s.mul(this.getTexture(i).r):r=s}else if(i===Pn.THICKNESS){const s=this.getFloat(i);t.thicknessMap?r=s.mul(this.getTexture(i).g):r=s}else if(i===Pn.IOR)r=this.getFloat(i);else if(i===Pn.LIGHT_MAP)r=this.getTexture(i).rgb.mul(this.getFloat("lightMapIntensity"));else if(i===Pn.AO)r=this.getTexture(i).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else if(i===Pn.LINE_DASH_OFFSET)r=t.dashOffset?this.getFloat(i):ci(0);else{const s=this.getNodeType(e);r=this.getCache(i,s)}return r}};Ut.ALPHA_TEST="alphaTest";Ut.COLOR="color";Ut.OPACITY="opacity";Ut.SHININESS="shininess";Ut.SPECULAR="specular";Ut.SPECULAR_STRENGTH="specularStrength";Ut.SPECULAR_INTENSITY="specularIntensity";Ut.SPECULAR_COLOR="specularColor";Ut.REFLECTIVITY="reflectivity";Ut.ROUGHNESS="roughness";Ut.METALNESS="metalness";Ut.NORMAL="normal";Ut.CLEARCOAT="clearcoat";Ut.CLEARCOAT_ROUGHNESS="clearcoatRoughness";Ut.CLEARCOAT_NORMAL="clearcoatNormal";Ut.EMISSIVE="emissive";Ut.ROTATION="rotation";Ut.SHEEN="sheen";Ut.SHEEN_ROUGHNESS="sheenRoughness";Ut.ANISOTROPY="anisotropy";Ut.IRIDESCENCE="iridescence";Ut.IRIDESCENCE_IOR="iridescenceIOR";Ut.IRIDESCENCE_THICKNESS="iridescenceThickness";Ut.IOR="ior";Ut.TRANSMISSION="transmission";Ut.THICKNESS="thickness";Ut.ATTENUATION_DISTANCE="attenuationDistance";Ut.ATTENUATION_COLOR="attenuationColor";Ut.LINE_SCALE="scale";Ut.LINE_DASH_SIZE="dashSize";Ut.LINE_GAP_SIZE="gapSize";Ut.LINE_WIDTH="linewidth";Ut.LINE_DASH_OFFSET="dashOffset";Ut.POINT_SIZE="size";Ut.DISPERSION="dispersion";Ut.LIGHT_MAP="light";Ut.AO="ao";const Wu=vi(new Or).onReference(function(n){return n.material}
4195).onRenderUpdate(function({material:n}){this.value.set(n.anisotropy*Math.cos(n.anisotropyRotation),n.anisotropy*Math.sin(n.anisotropyRotation))});class br extends mt{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),i=this.scope;let r;if(i===br.VERTEX)r=e.getVertexIndex();else if(i===br.INSTANCE)r=e.getInstanceIndex();else if(i===br.DRAW)r=e.getDrawIndex();else if(i===br.INVOCATION_LOCAL)r=e.getInvocationLocalIndex();else if(i===br.INVOCATION_SUBGROUP)r=e.getInvocationSubgroupIndex();else if(i===br.SUBGROUP)r=e.getSubgroupIndex();else throw new Error("THREE.IndexNode: Unknown scope: "+i);let s;return e.shaderStage==="vertex"||e.shaderStage==="compute"?s=r:s=Cl(this).build(e,t),s}}br.VERTEX="vertex";br.INSTANCE="instance";br.SUBGROUP="subgroup";br.INVOCATION_LOCAL="invocationLocal";br.INVOCATION_SUBGROUP="invocationSubgroup";br.DRAW="draw";class dJ extends mt{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode(105+e)}getProperties(e){const t=e.getNodeProperties(this);if(t.stackNode!==void 0)return t;const i={};for(let o=0,a=this.params.length-1;o<a;o++){const l=this.params[o],c=l.isNode!==!0&&l.name||this.getVarName(o),u=l.isNode!==!0&&l.type||"int";i[c]=ed(c,u)}const r=e.addStack();t.returnsNode=this.params[this.params.length-1](i,e),t.stackNode=r;const s=this.params[0];return s.isNode!==!0&&typeof s.update=="function"&&(t.updateNode=Vt(this.params[0].update)(i)),e.removeStack(),t}getNodeType(e){const{returnsNode:t}=this.getProperties(e);return t?t.getNodeType(e):"void"}setup(e){this.getProperties(e)}generate(e){const t=this.getProperties(e),i=this.params,r=t.stackNode;for(let a=0,l=i.length-1;a<l;a++){const c=i[a];let u=!1,h=null,d=null,f=null,p=null,v=null,m=null;c.isNode?c.getNodeType(e)==="bool"?(u=!0,p="bool",d=c.build(e,p)):(p="int",f=this.getVarName(a),h="0",d=c.build(e,p),v="<"):(p=c.type||"int",f=c.name||this.getVarName(a),h=c.start,d=c.end,v=c.condition,m=c.update,typeof h=="number"?h=e.generateConst(p,h):h&&h.isNode&&(h=h.build(e,p)),typeof d=="number"?d=e.generateConst(p,d):d&&d.isNode&&(d=d.build(e,p)),h!==void 0&&d===void 0?(h=h+" - 1",d="0",v=">="):d!==void 0&&h===void 0&&(h="0",v="<"),v===void 0&&(Number(h)>Number(d)?v=">=":v="<"));let g;if(u)g=`while ( ${d} )`;else{const y={start:h,end:d},x=y.start,_=y.end;let T;const S=()=>v.includes("<")?"+=":"-=";if(m!=null)switch(typeof m){case"function":T=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":T=f+" "+S()+" "+e.generateConst(p,m);break;case"string":T=f+" "+m;break;default:m.isNode?T=f+" "+S()+" "+m.build(e):(console.error("THREE.TSL: 'Loop( { update: ... } )' is not a function, string or number."),T="break /* invalid update */")}else p==="int"||p==="uint"?m=v.includes("<")?"++":"--":m=S()+" 1.",T=f+" "+m;const E=e.getVar(p,f)+" = "+x,M=f+" "+v+" "+_;g=`for ( ${E}; ${M}; ${T} )`}e.addFlowCode((a===0?`
4196`:"")+e.tab+g+` {
4197
4198`).addFlowTab()}const s=r.build(e,"void"),o=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode(`
4199`+e.tab+s);for(let a=0,l=this.params.length-1;a<l;a++)e.addFlowCode((a===0?"":e.tab)+`}
4200
4201`).removeFlowTab();return e.addFlowTab(),o}}const $u=(...n)=>Be(new dJ(Ic(n,"int"))).toStack(),cc=new Or;class fJ extends p0{static get type(){return"ViewportTextureNode"}constructor(e=_1,t=null,i=null){let r=null;i===null?(r=new gX,r.minFilter=ZP,i=r):r=i,super(i,e,t),this.generateMipmaps=!1,this.defaultFramebuffer=r,this.isOutputTextureNode=!0,this.updateBeforeType=Vn.FRAME,this._cacheTextures=new WeakMap}getTextureForReference(e=null){let t,i;if(this.referenceNode?(t=this.referenceNode.defaultFramebuffer,i=this.referenceNode._cacheTextures):(t=this.defaultFramebuffer,i=this._cacheTextures),e===null)return t;if(i.has(e)===!1){const r=t.clone();i.set(e,r)}return i.get(e)}updateReference(e){const t=e.renderer.getRenderTarget();return this.value=this.getTextureForReference(t),this.value}updateBefore(e){const t=e.renderer,i=t.getRenderTarget();i===null?t.getDrawingBufferSize(cc):cc.set(i.width,i.height);const r=this.getTextureForReference(i);(r.image.width!==cc.width||r.image.height!==cc.height)&&(r.image.width=cc.width,r.image.height=cc.height,r.needsUpdate=!0);const s=r.generateMipmaps;r.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(r),r.generateMipmaps=s}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}let sp=null;class pJ extends fJ{static get type(){return"ViewportDepthTextureNode"}constructor(e=_1,t=null){sp===null&&(sp=new r1),super(e,t,sp)}getTextureForReference(){return sp}}const mJ=$n(pJ).setParameterLength(0,2);class Nr extends mt{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Nr.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,i=this.valueNode;let r=null;if(t===Nr.DEPTH_BASE)i!==null&&(r=qI().assign(i));else if(t===Nr.DEPTH)e.isPerspectiveCamera?r=gJ(Vi.z,Hu,Gu):r=Np(Vi.z,Hu,Gu);else if(t===Nr.LINEAR_DEPTH)if(i!==null)if(e.isPerspectiveCamera){const s=jI(i,Hu,Gu);r=Np(s,Hu,Gu)}else r=i;else r=Np(Vi.z,Hu,Gu);return r}}Nr.DEPTH_BASE="depthBase";Nr.DEPTH="depth";Nr.LINEAR_DEPTH="linearDepth";const Np=(n,e,t)=>n.add(e).div(e.sub(t)),gJ=(n,e,t)=>e.add(n).mul(t).div(t.sub(e).mul(n)),jI=(n,e,t)=>e.mul(t).div(t.sub(e).mul(n).sub(t)),qI=$n(Nr,Nr.DEPTH_BASE),vJ=Ao(Nr,Nr.DEPTH);mJ();vJ.assign=n=>qI(n);class cl extends mt{static get type(){return"ClippingNode"}constructor(e=cl.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:i,unionPlanes:r}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===cl.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(i,r):this.scope===cl.HARDWARE?this.setupHardwareClipping(r,e):this.setupDefault(i,r)}setupAlphaToCoverage(e,t){return Vt(()=>{const i=ci().toVar("distanceToPlane"),r=ci().toVar("distanceToGradient"),s=ci(1).toVar("clipOpacity"),o=t.length;if(this.hardwareClipping===!1&&o>0){const l=Wa(t).setGroup(Qr);$u(o,({i:c})=>{const u=l.element(c);i.assign(Vi.dot(u.xyz).negate().add(u.w)),r.assign(i.fwidth().div(2)),s.mulAssign(Qh(r.negate(),r,i))})}const a=e.length;if(a>0){const l=Wa(e).setGroup(Qr),c=ci(1).toVar("intersectionClipOpacity");$u(a,({i:u})=>{const h=l.element(u);i.assign(Vi.dot(h.xyz).negate().add(h.w)),r.assign(i.fwidth().div(2)),c.mulAssign(Qh(r.negate(),r,i).oneMinus())}),s.mulAssign(c.oneMinus())}xE.a.mulAssign(s),xE.a.equal(0).discard()})()}setupDefault(e,t){return Vt(()=>{const i=t.length;if(this.hardwareClipping===!1&&i>0){const s=Wa(t).setGroup(Qr);$u(i,({i:o})=>
4201{const a=s.element(o);Vi.dot(a.xyz).greaterThan(a.w).discard()})}const r=e.length;if(r>0){const s=Wa(e).setGroup(Qr),o=cI(!0).toVar("clipped");$u(r,({i:a})=>{const l=s.element(a);o.assign(Vi.dot(l.xyz).greaterThan(l.w).and(o))}),o.discard()}})()}setupHardwareClipping(e,t){const i=e.length;return t.enableHardwareClipping(i),Vt(()=>{const r=Wa(e).setGroup(Qr),s=II(t.getClipDistance());$u(i,({i:o})=>{const a=r.element(o),l=Vi.dot(a.xyz).sub(a.w).negate();s.element(o).assign(l)})})()}}cl.ALPHA_TO_COVERAGE="alphaToCoverage";cl.DEFAULT="default";cl.HARDWARE="hardware";Kt(.04);ci(1);const xJ=Vt(([n,e])=>{const t=n.toVar();t.assign(Al(2,t).sub(1));const i=Kt(t,1).toVar();return lI(e.equal(0),()=>{i.assign(i.zyx)}).ElseIf(e.equal(1),()=>{i.assign(i.xzy),i.xz.mulAssign(-1)}).ElseIf(e.equal(2),()=>{i.x.mulAssign(-1)}).ElseIf(e.equal(3),()=>{i.assign(i.zyx),i.xz.mulAssign(-1)}).ElseIf(e.equal(4),()=>{i.assign(i.xzy),i.xy.mulAssign(-1)}).ElseIf(e.equal(5),()=>{i.z.mulAssign(-1)}),i}).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),ox=xJ(Nd(),f0("faceIndex")).normalize();ox.x,ox.y,ox.z;d0("vec3");d0("vec3");d0("vec3");new mX;new ct;new ct;new ct;new cr;new ct(0,0,-1);new Us;new ct;new ct;new Us;new Or;const yJ=new tI;_1.flipX();yJ.depthTexture=new r1(1,1);class td extends mt{static get type(){return"EventNode"}constructor(e,t){super("void"),this.eventType=e,this.callback=t,e===td.OBJECT?this.updateType=Vn.OBJECT:e===td.MATERIAL&&(this.updateType=Vn.RENDER)}update(e){this.callback(e)}}td.OBJECT="object";td.MATERIAL="material";const ju=new uu,ax=new cr;class Zo extends mt{static get type(){return"SceneNode"}constructor(e=Zo.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,i=this.scene!==null?this.scene:e.scene;let r;return t===Zo.BACKGROUND_BLURRINESS?r=Ym("backgroundBlurriness","float",i):t===Zo.BACKGROUND_INTENSITY?r=Ym("backgroundIntensity","float",i):t===Zo.BACKGROUND_ROTATION?r=vi("mat4").setName("backgroundRotation").setGroup(Qr).onRenderUpdate(()=>{const s=i.background;return s!==null&&s.isTexture&&s.mapping!==Qb?(ju.copy(i.backgroundRotation),ju.x*=-1,ju.y*=-1,ju.z*=-1,ax.makeRotationFromEuler(ju)):ax.identity(),ax}):console.error("THREE.SceneNode: Unknown scope:",t),r}}Zo.BACKGROUND_BLURRINESS="backgroundBlurriness";Zo.BACKGROUND_INTENSITY="backgroundIntensity";Zo.BACKGROUND_ROTATION="backgroundRotation";Vt(({texture:n,uv:e})=>{const t=Kt().toVar();return lI(e.x.lessThan(1e-4),()=>{t.assign(Kt(1,0,0))}).ElseIf(e.y.lessThan(1e-4),()=>{t.assign(Kt(0,1,0))}).ElseIf(e.z.lessThan(1e-4),()=>{t.assign(Kt(0,0,1))}).ElseIf(e.x.greaterThan(1-1e-4),()=>{t.assign(Kt(-1,0,0))}).ElseIf(e.y.greaterThan(1-1e-4),()=>{t.assign(Kt(0,-1,0))}).ElseIf(e.z.greaterThan(1-1e-4),()=>{t.assign(Kt(0,0,-1))}).Else(()=>{const i=n.sample(e.add(Kt(-.01,0,0))).r.sub(n.sample(e.add(Kt(.01,0,0))).r),r=n.sample(e.add(Kt(0,-.01,0))).r.sub(n.sample(e.add(Kt(0,.01,0))).r),s=n.sample(e.add(Kt(0,0,-.01))).r.sub(n.sample(e.add(Kt(0,0,.01))).r);t.assign(Kt(i,r,s))}),t.normalize()});const op=new Or;class _J extends p0{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class RE extends _J{static get type(){return"PassMultipleTextureNode"}constructor(e,t,i=!1){super(e,null),this.textureName=t,this.previousTexture=i}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){const e=new this.constructor(this.passNode,this.textureName,this.previousTexture);return e.uvNode=this.uvNode,e.levelNode=this.levelNode,e.biasNode=this.biasNode,e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}class g0 extends Ri{static get type(){return"PassNode"}constructor(e,t,i,r={}){super("vec4"),this.scope=e,this.scene=t,this.camera=i,this.options=r,this._pixelRatio=1,this._width=1,this._height=1;const s=new r1;s.isRenderTargetTexture=!0,s.name="depth";const o=new tI(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Rq,...r});o.texture.name="output",o.depthTexture=s,this.renderTarget=o,this._textures={output:o.texture,depth:s},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=vi(0),this._cameraFar=vi(0),this._mrt=null,this._layers=null,this._resolution=1,this._viewport=null,this._scissor=null,this.isPassNode=!0,this.updateBeforeType=Vn.FRAME,this.global=!0}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const i=this._textures[e],r=this.renderTarget.textures.indexOf(i);this.renderTarget.textures[r]=t,this._textures[e]=t,this._previousTextures[e]=i,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(t=Be(new RE(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),t=Be(ne
4201w RE(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const i=this._cameraNear,r=this._cameraFar;this._viewZNodes[e]=t=jI(this.getTextureNode(e),i,r)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const i=this._cameraNear,r=this._cameraFar,s=this.getViewZNode(e);this._linearDepthNodes[e]=t=Np(s,i,r)}return t}async compileAsync(e){const t=e.getRenderTarget(),i=e.getMRT();e.setRenderTarget(this.renderTarget),e.setMRT(this._mrt),await e.compileAsync(this.scene,this.camera),e.setRenderTarget(t),e.setMRT(i)}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,this.renderTarget.texture.type=e.getColorBufferType(),this.scope===g0.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:i}=this;let r,s;const o=t.getOutputRenderTarget();o&&o.isXRRenderTarget===!0?(s=1,r=t.xr.getCamera(),t.xr.updateCamera(r),op.set(o.width,o.height)):(r=this.camera,s=t.getPixelRatio(),t.getSize(op)),this._pixelRatio=s,this.setSize(op.width,op.height);const a=t.getRenderTarget(),l=t.getMRT(),c=r.layers.mask;this._cameraNear.value=r.near,this._cameraFar.value=r.far,this._layers!==null&&(r.layers.mask=this._layers.mask);for(const u in this._previousTextures)this.toggleTexture(u);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(i,r),t.setRenderTarget(a),t.setMRT(l),r.layers.mask=c}setSize(e,t){this._width=e,this._height=t;const i=this._width*this._pixelRatio*this._resolution,r=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(i,r),this._scissor!==null&&this.renderTarget.scissor.copy(this._scissor),this._viewport!==null&&this.renderTarget.viewport.copy(this._viewport)}setScissor(e,t,i,r){e===null?this._scissor=null:(this._scissor===null&&(this._scissor=new Us),e.isVector4?this._scissor.copy(e):this._scissor.set(e,t,i,r),this._scissor.multiplyScalar(this._pixelRatio*this._resolution).floor())}setViewport(e,t,i,r){e===null?this._viewport=null:(this._viewport===null&&(this._viewport=new Us),e.isVector4?this._viewport.copy(e):this._viewport.set(e,t,i,r),this._viewport.multiplyScalar(this._pixelRatio*this._resolution).floor())}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}g0.COLOR="color";g0.DEPTH="depth";Kt(1.6605,-.1246,-.0182),Kt(-.5876,1.1329,-.1006),Kt(-.0728,-.0083,1.1187);Kt(.6274,.0691,.0164),Kt(.3293,.9195,.088),Kt(.0433,.0113,.8956);class vr extends mt{static get type(){return"CodeNode"}constructor(e="",t=[],i=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=i}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const i=e.getCodeFromNode(this,this.getNodeType(e));return i.code=this.code,i.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}function XI(n){let e;const t=n.context.getViewZ;return t!==void 0&&(e=t(this)),(e||Vi.z).negate()}Vt(([n,e],t)=>{const i=XI(t);return Qh(n,e,i)});Vt(([n],e)=>{const t=XI(e);return n.mul(n,t,t).negate().exp().oneMinus()});Vt(([n,e])=>go(e.toFloat().mix(yE.rgb,n.toVec3()),yE.a));class bJ extends mt{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:i}=e;i.backend.isWebGLBackend===!0?e.addFlowCode(`	// ${t}Barrier 
4202`):e.addLineFlowCode(`${t}Barrier()`,this)}}$n(bJ);class js extends mt{static get type(){return"AtomicFunctionNode"}constructor(e,t,i){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=i,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),i=t.parents,r=this.method,s=this.getNodeType(e),o=this.getInputType(e),a=this.pointerNode,l=this.valueNode,c=[];c.push(`&${a.build(e,o)}`),l!==null&&c.push(l.build(e,o));const u=`${e.getMethod(r,s)}( ${c.join(", ")} )`;if(i&&i.length===1&&i[0].isStackNode===!0)e.addLineFlowCode(u,this);
4202else return t.constNode===void 0&&(t.constNode=ed(u,s).toConst()),t.constNode.build(e)}}js.ATOMIC_LOAD="atomicLoad";js.ATOMIC_STORE="atomicStore";js.ATOMIC_ADD="atomicAdd";js.ATOMIC_SUB="atomicSub";js.ATOMIC_MAX="atomicMax";js.ATOMIC_MIN="atomicMin";js.ATOMIC_AND="atomicAnd";js.ATOMIC_OR="atomicOr";js.ATOMIC_XOR="atomicXor";$n(js);class Wt extends Ri{static get type(){return"SubgroupFunctionNode"}constructor(e,t=null,i=null){super(),this.method=e,this.aNode=t,this.bNode=i}getInputType(e){const t=this.aNode?this.aNode.getNodeType(e):null,i=this.bNode?this.bNode.getNodeType(e):null,r=e.isMatrix(t)?0:e.getTypeLength(t),s=e.isMatrix(i)?0:e.getTypeLength(i);return r>s?t:i}getNodeType(e){const t=this.method;return t===Wt.SUBGROUP_ELECT?"bool":t===Wt.SUBGROUP_BALLOT?"uvec4":this.getInputType(e)}generate(e,t){const i=this.method,r=this.getNodeType(e),s=this.getInputType(e),o=this.aNode,a=this.bNode,l=[];if(i===Wt.SUBGROUP_BROADCAST||i===Wt.SUBGROUP_SHUFFLE||i===Wt.QUAD_BROADCAST){const u=a.getNodeType(e);l.push(o.build(e,r),a.build(e,u==="float"?"int":r))}else i===Wt.SUBGROUP_SHUFFLE_XOR||i===Wt.SUBGROUP_SHUFFLE_DOWN||i===Wt.SUBGROUP_SHUFFLE_UP?l.push(o.build(e,r),a.build(e,"uint")):(o!==null&&l.push(o.build(e,s)),a!==null&&l.push(a.build(e,s)));const c=l.length===0?"()":`( ${l.join(", ")} )`;return e.format(`${e.getMethod(i,r)}${c}`,r,t)}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}Wt.SUBGROUP_ELECT="subgroupElect";Wt.SUBGROUP_BALLOT="subgroupBallot";Wt.SUBGROUP_ADD="subgroupAdd";Wt.SUBGROUP_INCLUSIVE_ADD="subgroupInclusiveAdd";Wt.SUBGROUP_EXCLUSIVE_AND="subgroupExclusiveAdd";Wt.SUBGROUP_MUL="subgroupMul";Wt.SUBGROUP_INCLUSIVE_MUL="subgroupInclusiveMul";Wt.SUBGROUP_EXCLUSIVE_MUL="subgroupExclusiveMul";Wt.SUBGROUP_AND="subgroupAnd";Wt.SUBGROUP_OR="subgroupOr";Wt.SUBGROUP_XOR="subgroupXor";Wt.SUBGROUP_MIN="subgroupMin";Wt.SUBGROUP_MAX="subgroupMax";Wt.SUBGROUP_ALL="subgroupAll";Wt.SUBGROUP_ANY="subgroupAny";Wt.SUBGROUP_BROADCAST_FIRST="subgroupBroadcastFirst";Wt.QUAD_SWAP_X="quadSwapX";Wt.QUAD_SWAP_Y="quadSwapY";Wt.QUAD_SWAP_DIAGONAL="quadSwapDiagonal";Wt.SUBGROUP_BROADCAST="subgroupBroadcast";Wt.SUBGROUP_SHUFFLE="subgroupShuffle";Wt.SUBGROUP_SHUFFLE_XOR="subgroupShuffleXor";Wt.SUBGROUP_SHUFFLE_UP="subgroupShuffleUp";Wt.SUBGROUP_SHUFFLE_DOWN="subgroupShuffleDown";Wt.QUAD_BROADCAST="quadBroadcast";Vt(([n=Nd()],{renderer:e,material:t})=>{const i=bI(n.mul(2).sub(1));let r;if(t.alphaToCoverage&&e.samples>1){const s=ci(i.fwidth()).toVar();r=Qh(s.oneMinus(),s.add(1),i).oneMinus()}else r=v1(i.greaterThan(1),0,1);return r});const uc=typeof self<"u"?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4};uc&&uc.VERTEX,uc&&uc.FRAGMENT,uc&&uc.COMPUTE;new vr("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),new vr("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),new vr("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),new vr("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),new vr("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),new vr("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),new vr("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),new vr("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),new vr("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),new vr("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),new vr("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),new vr("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),new vr(`
4203fn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {
4204
4205	let res = vec2f( iRes );
4206
4207	let uvScaled = coord * res;
4208	let uvWrapping = ( ( uvScaled % res ) + res ) % res;
4209
4210	// https://www.shadertoy.com/view/WtyXRy
4211
4212	let uv = uvWrapping - 0.5;
4213	let iuv = floor( uv );
4214	let f = fract( uv );
4215
4216	let rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );
4217	let rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );
4218	let rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );
4219	let rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );
4220
4221	return mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );
4222
4223}
4224`);const wJ=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]);typeof Float16Array<"u"&&wJ.set(Float16Array,["float16"]);var SJ=`void main() {
4225  gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
4226}`,MJ=`#include <common>
4227
4228void main() {
4229  vec2 center = vec2(0., 1.);
4230  float rotation = 0.0;
4231
4232  
4233  
4234  float size = 0.03;
4235
4236  vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
4237  vec2 scale;
4238  scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
4239  scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
4240
4241  bool isPerspective = isPerspectiveMatrix( projectionMatrix );
4242  if ( isPerspective ) scale *= - mvPosition.z;
4243
4244  vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
4245  vec2 rotatedPosition;
4246  rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
4247  rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
4248  mvPosition.xy += rotatedPosition;
4249
4250  gl_Position = projectionMatrix * mvPosition;
4251}`;const Od=new z(0,0,0),b1=new z(0,0,0),TJ=new z(0,0,0);function PE(n,e,t){const i=Od.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[(Number.isNaN(i.x)?0:i.x)*r+r,-(i.y*s)+s,i.z]}function EJ(n,e){const t=Od.setFromMatrixPosition(n.matrixWorld),i=b1.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(TJ);return r.angleTo(s)>Math.PI/2}function AJ(n,e,t,i){const r=Od.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),t.setFromCamera(new de(s.x,s.y),e);const o=t.intersectObjects(i,!0);if(o.length>0){const a=o[0].distance;return r.distanceTo(t.ray.origin)<a}return!0}function CJ(n,e){if(e instanceof rs)return e.zoom;if(e instanceof xn){const t=Od.setFromMatrixPosition(n.matrixWorld),i=b1.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(i);return 1/(2*Math.tan(r/2)*s)}else return 1}function RJ(n,e,t){if(e instanceof xn||e instanceof rs){const i=Od.setFromMatrixPosition(n.matrixWorld),r=b1.setFromMatrixPosition(e.matrixWorld),s=i.distanceTo(r),o=(t[1]-t[0])/(e.far-e.near),a=t[1]-o*e.far;return Math.round(o*s+a)}}const Hy=n=>Math.abs(n)<1e-10?0:n;function YI(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=Hy(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const PJ=(n=>e=>YI(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),IJ=(n=>(e,t)=>YI(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]),NJ=["geometry","material"],bc=qe({__name:"HTML",props:{geometry:{default:new wl},material:{},as:{default:"div"},transform:{type:Boolean,default:!1},portal:{},wrapperClass:{},eps:{default:1e-4},distanceFactor:{},fullscreen:{type:Boolean},center:{type:Boolean},pointerEvents:{default:"auto"},sprite:{type:Boolean,default:!1},zIndexRange:{default:()=>[16777271,0]},occlude:{type:[Object,null,Array,Boolean,String]}},emits:["onOcclude"],setup(n,{expose:e,emit:t}){const i=n,r=t,s=la(),o=d2(),a=Te(),l=Te(),{geometry:c,material:u,as:h,transform:d,portal:f,wrapperClass:
4251p,eps:v,distanceFactor:m,fullscreen:g,center:y,pointerEvents:x,sprite:_,occlude:T,zIndexRange:S}=Ar(i),{renderer:E,scene:M,camera:b,sizes:w}=au(),A=ge(()=>document.createElement(h.value)),P=Te([0,0,0]),H=Te(0),B=Te(),G=Te(new Pb),O=ge(()=>d.value?{position:"absolute",top:0,left:0,width:`${w.width.value}px`,height:`${w.height.value}px`,transformStyle:"preserve-3d",pointerEvents:"none",zIndex:2}:{position:"absolute",transform:y.value?"translate3d(-50%,-50%,0)":"none",...g.value&&{top:-w.height.value/2,left:-w.width.value/2,width:`${w.width.value}px`,height:`${w.height.value}px`},zIndex:2,...Object.assign({},o.style)}),$=ge(()=>({position:"absolute",pointerEvents:x.value})),F=Te(null),J=Te(!1),se=ge(()=>T?.value&&T?.value!=="blending"||Array.isArray(T?.value)&&T?.value.length&&Xt(T.value[0]));Je(()=>T,({value:ze})=>{ze==="blending"?(A.value.style.zIndex=`${Math.floor(S.value[0]/2)}`,A.value.style.position="absolute",A.value.style.pointerEvents="none"):(A.value.style.zIndex=null,A.value.style.position=null,A.value.style.pointerEvents=null)}),Je(()=>[a.value,E.instance,w.width.value,w.height.value,s.default?.()],([ze,he])=>{if(ze&&he){const fe=f?.value||he.domElement;if(M.value?.updateMatrixWorld(),d.value)A.value.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ue=PE(ze,b.activeCamera.value,{width:w.width.value,height:w.height.value});A.value.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ue[0]}px,${ue[1]}px,0);transform-origin:0 0;`}fe&&!A.value.parentNode&&fe.parentNode?.appendChild(A.value),d.value?B.value=Ie("div",{id:"outer",style:O.value},[Ie("div",{id:"inner",style:$.value},[Ie("div",{key:l.value?.uuid,id:M?.value.uuid,class:o.class,style:o.style},s.default?.())])]):B.value=Ie("div",{key:l.value?.uuid,id:M?.value.uuid,style:O.value},s.default?.()),LD(B.value,A.value)}}),un(()=>{p?.value&&(A.value.className=p.value)});const be=Te(!0),{onBeforeRender:Fe}=us();Fe(()=>{if(a.value&&b.activeCamera.value&&E.instance){b.activeCamera.value?.updateMatrixWorld(),a.value.updateWorldMatrix(!0,!1);const ze=d.value?P.value:PE(a.value,b.activeCamera.value,{width:w.width.value||0,height:w.height.value||0});if(d.value||Math.abs(H.value-b.activeCamera.value.zoom)>v.value||Math.abs(P.value[0]-ze[0])>v.value||Math.abs(P.value[1]-ze[1])>v.value||Math.abs(P.value[2]-ze[2])>v.value){const he=EJ(a.value,b.activeCamera.value);let fe=!1;se.value&&(Array.isArray(T?.value)?fe=T?.value:T?.value!=="blending"&&(fe=[M.value]));const ue=be.value;if(fe){const q=AJ(a.value,b.activeCamera.value,G.value,fe);be.value=q&&!he}else be.value=!he;ue!==be.value&&(r("onOcclude",!be.value),A.value.style.display=be.value?"block":"none");const I=Math.floor(S.value[0]/2),V=T?.value?se.value?[S.value[0],I]:[I-1,0]:S.value;if(A.value.style.zIndex=`${RJ(a.value,b.activeCamera.value,V)}`,d.value){const[q,ye]=[w.width.value/2,w.height.value/2],N=b.activeCamera.value.projectionMatrix.elements[5]*ye,{isOrthographicCamera:D,top:R,left:X,bottom:Z,right:K}=b.activeCamera.value,Q=PJ(b.activeCamera.value.matrixWorldInverse),ae=D?`scale(${N})translate(${Hy(-(K+X)/2)}px,${Hy((R+Z)/2)}px)`:`translateZ(${N}px)`;let ee=a.value.matrixWorld;if(_.value&&(ee=b.activeCamera.value.matrixWorldInverse.clone().transpose().copyPosition(ee).scale(a.value.scale),ee.elements[3]=ee.elements[7]=ee.elements[11]=0,ee.elements[15]=1),A.value.style.width=`${w.width.value}px`,A.value.style.height=`${w.height.value}px`,A.value.style.perspective=D?"":`${N}px`,B.value?.el&&B.value?.children&&Array.isArray(B.value.children)){B.value.el.style.transform=`${ae}${Q}translate(${q}px,${ye}px)`;const te=B.value.children[0];te&&te.el&&(te.el.style.transform=IJ(ee,1/((m?.value||10)/400)))}}else{const q=m?.value===void 0?1:CJ(a.value,b.activeCamera.value)*m?.value;A.value.style.transform=`translate3d(${ze[0]}px,${ze[1]}px,0) scale(${q})`}}P.value=ze,H.value=b.activeCamera.value.zoom}if(!se.value&&l.value&&!J.value)if(d.value){if(B.value?.el&&B.value?.children){const ze=(B.value?.children)[0];if(ze?.clientWidth&&ze?.clientHeight){const{isOrthographicCamera:he}=b.activeCamera.value;if(he||c)o.scale&&(Array.isArray(o.scale)?o.scale instanceof z?l.value.scale.copy(o.scale.clone().divideScalar(1)):l.value.scale.set(1/o.scale[0],1/o.scale[1],1/o.scale[2]):l.value.scale.setScalar(1/o.scale));else{const fe=(m?.value||10)/400,ue=ze.clientWidth*fe,I=ze.clientHeight*fe;l.value.scale.set(ue,I,1)}J.value=!0}}}else{const ze=A.value.children[0];if(ze?.clientWidth&&ze?.clientHeight){const he=ze.clientWidth*1,fe=ze.clientHeight*1;l.value.scale.set(he,fe,1),J.value=!0}F.value.lookAt(b.activeCamera.value?.position)}});const Le=ge(()=>({vertexShader:d.value?void 0:MJ,fragmentShader:SJ})),Ge=ge(()=>{const ze=Le.value;return u.value||new pn({vertexShader:ze.vertexShader,fragmentShader:ze.fragmentShader,side:Et})});return di(()=>{Ge.value&&Ge.value.dispose(),A.value.remove()}),e({instance:a}),(ze,he)=>
4251(pe(),pt("TresGroup",{ref_key:"groupRef",ref:a},[L(T)&&!se.value?(pe(),pt("TresMesh",{key:0,ref_key:"meshRef",ref:l,geometry:L(c),material:Ge.value},null,8,NJ)):en("",!0)],512))}});var Gy={exports:{}},LJ=Gy.exports,IE;function OJ(){return IE||(IE=1,(function(n,e){(function(t,i){n.exports=i()})(LJ,function(){var t=function(){function i(f){return o.appendChild(f.dom),f}function r(f){for(var p=0;p<o.children.length;p++)o.children[p].style.display=p===f?"block":"none";s=f}var s=0,o=document.createElement("div");o.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",o.addEventListener("click",function(f){f.preventDefault(),r(++s%o.children.length)},!1);var a=(performance||Date).now(),l=a,c=0,u=i(new t.Panel("FPS","#0ff","#002")),h=i(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=i(new t.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:o,addPanel:i,showPanel:r,begin:function(){a=(performance||Date).now()},end:function(){c++;var f=(performance||Date).now();if(h.update(f-a,200),f>l+1e3&&(u.update(1e3*c/(f-l),100),l=f,c=0,d)){var p=performance.memory;d.update(p.usedJSHeapSize/1048576,p.jsHeapSizeLimit/1048576)}return f},update:function(){a=this.end()},domElement:o,setMode:r}};return t.Panel=function(i,r,s){var o=1/0,a=0,l=Math.round,c=l(window.devicePixelRatio||1),u=80*c,h=48*c,d=3*c,f=2*c,p=3*c,v=15*c,m=74*c,g=30*c,y=document.createElement("canvas");y.width=u,y.height=h,y.style.cssText="width:80px;height:48px";var x=y.getContext("2d");return x.font="bold "+9*c+"px Helvetica,Arial,sans-serif",x.textBaseline="top",x.fillStyle=s,x.fillRect(0,0,u,h),x.fillStyle=r,x.fillText(i,d,f),x.fillRect(p,v,m,g),x.fillStyle=s,x.globalAlpha=.9,x.fillRect(p,v,m,g),{dom:y,update:function(_,T){o=Math.min(o,_),a=Math.max(a,_),x.fillStyle=s,x.globalAlpha=1,x.fillRect(0,0,u,v),x.fillStyle=r,x.fillText(l(_)+" "+i+" ("+l(o)+"-"+l(a)+")",d,f),x.drawImage(y,p+c,v,m-c,g,p,v,m-c,g),x.fillRect(p+m-c,v,c,g),x.fillStyle=s,x.globalAlpha=.9,x.fillRect(p+m-c,v,c,l((1-_/T)*g))}}},t})})(Gy)),Gy.exports}OJ();new We;const DJ=["size","color","alpha-map","map","opacity","alpha-test","depth-write","transparent","size-attenuation"],kJ=["position","velocity"],FJ=qe({__name:"Precipitation",props:{size:{default:.1},area:{default:()=>[10,10,20]},color:{default:16777215},map:{},alphaMap:{},alphaTest:{default:.01},opacity:{default:.8},count:{default:5e3},speed:{default:.1},randomness:{default:.5},depthWrite:{type:Boolean,default:!1},transparent:{type:Boolean,default:!0},sizeAttenuation:{type:Boolean,default:!0}},setup(n,{expose:e}){const t=n,{size:i,area:r,color:s,alphaMap:o,map:a,opacity:l,alphaTest:c,depthWrite:u,transparent:h,sizeAttenuation:d,count:f,speed:p,randomness:v}=Ar(t),m=Mt();let g=[],y=[];const x=()=>{g=new Float32Array(f.value*3);for(let b=0;b<f.value;b++){const w=b*3;g[w]=(Math.random()-.5)*r.value[0],g[w+1]=(Math.random()-.5)*r.value[1],g[w+2]=(Math.random()-.5)*r.value[2]}},_=()=>{y=new Float32Array(f.value*2);for(let b=0;b<f.value*2;b+=2)y[b]=(Math.random()-.5)/5*p.value*v.value,y[b+1]=Math.random()/5*p.value};_(),x(),Je(p,()=>{_()}),un(()=>{p.value||x()});const T=Mt(null),S=Mt(null);un(async()=>{if(typeof o.value=="string"){const{state:b}=Ny(o.value);T.value=b.value}else T.value=o.value??null;if(typeof a.value=="string"){const{state:b}=Ny(a.value);S.value=b.value}else S.value=a.value??null});const{onBeforeRender:E}=us();E(()=>{if(m.value?.attributes.position.array&&m.value?.attributes.position.count){const b=m.value.attributes.position.array;for(let w=0;w<m.value.attributes.position.count;w++){const A=y[w*2],P=y[w*2+1];b[w*3]+=A,b[w*3+1]-=P,(b[w*3]<=-r.value[0]/2||b[w*3]>=r.value[0]/2)&&(b[w*3]=b[w*3]*-1),(b[w*3+1]<=-r.value[1]/2||b[w*3+1]>=r.value[1]/2)&&(b[w*3+1]=b[w*3+1]*-1)}m.value.attributes.position.needsUpdate=!0}});const M=Mt();return e({instance:M}),(b,w)=>(pe(),pt("TresPoints",{ref_key:"pointsRef",ref:M},[Me("TresPointsMaterial",{size:L(i),color:L(s),"alpha-map":T.value,map:S.value,opacity:L(l),"alpha-test":L(c),"depth-write":L(u),transparent:L(h),"size-attenuation":L(d)},null,8,DJ),Me("TresBufferGeometry",{ref_key:"geometryRef",ref:m,position:[L(g),3],velocity:[L(y)]},null,8,kJ)],512))}});class NE extends Dt{virtualScene=null;constructor(){super(),this.virtualScene=new vl}add(...e){for(const t of e)this.virtualScene.add(t);return this}dispose(){this.virtualScene.traverse(e=>{e instanceof an&&(e.geometry.dispose(),e.material.dispose(),e.material.map&&e.material.map.dispose(),this.virtualScene.remove(e))}),this.virtualScene=null}}const UJ=qe({__name:"component",props:{background:{type:[Boolean,String],default:!1},blur:{default:0},files:{default:()=>[]},path:{default:""}
4251,preset:{default:void 0},resolution:{default:256},near:{default:1},far:{default:1e3},frames:{default:Number.POSITIVE_INFINITY},backgroundIntensity:{default:1},backgroundRotation:{},environmentIntensity:{default:1},environmentRotation:{},syncMaterials:{type:Boolean}},async setup(n,{expose:e}){let t,i;const r=n,s=Te(null);e({texture:s});const{extend:o,renderer:a,scene:l}=au();o({EnvironmentScene:NE});let c=null;const u=Te(null);let h=null;const d=Te(null),f=([t,i]=zs(()=>fq(r,u)),t=await t,i(),t),{onBeforeRender:p}=us();let v=1;p(()=>{if(h&&d.value&&u.value&&(r.frames===Number.POSITIVE_INFINITY||v<r.frames)){const g=a.instance.autoClear;a.instance.autoClear=!0;const y=$t(d.value).virtualScene;h.update(a.instance,y),a.instance.autoClear=g,v++}},-1),Je([f,d],([g,y])=>{if(g&&y?.virtualScene){const x=$t(y).virtualScene;let _=x.children.find(T=>T instanceof an&&T.userData.isEnvironment);_||(_=new an(new da(1,1,1),new Gs({side:Xn})),_.userData.isEnvironment=!0,x.add(_)),x.background=g,x.backgroundBlurriness=r.blur}},{immediate:!0});const m=g=>{g&&c?.length?(l.value.environment=g.texture,r.background&&(l.value.background=g.texture)):f.value&&(l.value.environment=f.value,r.background&&(l.value.background=f.value))};return Je(f,()=>{u.value&&m(u.value)},{immediate:!0,deep:!0}),Je(()=>la().default,g=>{if(g&&(c=g(),Array.isArray(c)&&c.length>0)){o({EnvironmentScene:NE}),u.value=new ob(r.resolution),u.value.texture.type=Gi,h=new sb(r.near,r.far,u.value),m(u.value);return}u.value?.dispose(),u.value=null,m()},{immediate:!0,deep:!0}),s.value=f.value,di(()=>{d.value?.dispose(),u.value?.dispose()}),(g,y)=>u.value?(pe(),pt("TresEnvironmentScene",{key:0,ref_key:"environmentScene",ref:d},[lt(g.$slots,"default")],512)):en("",!0)}}),BJ={key:0,args:[0,1,64]},zJ={key:1,args:[.5,1,64]},VJ={key:2},HJ=["tone-mapped","map","side","color"];new We(16777215);var lx=1/1e3,GJ=1e3,WJ=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*lx}get fixedDelta(){return this._fixedDelta*lx}set fixedDelta(n){this._fixedDelta=n*GJ}get elapsed(){return this._elapsed*lx}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},$J=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new At;return t.setAttribute("position",new Jt(n,3)),t.setAttribute("uv",new Jt(e,2)),t})(),Yi=class Wy{static get fullscreenGeometry(){return $J}constructor(e="Pass",t=new vl,i=new rs){this.name=e,this.renderer=null,this.scene=t,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new an(Wy.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new vl),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}
vendor: 19,653 bytes, lines 4251-4295
4251setDepthTexture(e,t=Hs){}render(e,t,i,r,s){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,i){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof En||t instanceof si||t instanceof Sn||t instanceof Wy)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},jJ=class extends Yi{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,r){const s=n.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},qJ=`#ifdef COLOR_WRITE
4252#include <common>
4253#include <dithering_pars_fragment>
4254#ifdef FRAMEBUFFER_PRECISION_HIGH
4255uniform mediump sampler2D inputBuffer;
4256#else
4257uniform lowp sampler2D inputBuffer;
4258#endif
4259#endif
4260#ifdef DEPTH_WRITE
4261#include <packing>
4262#ifdef GL_FRAGMENT_PRECISION_HIGH
4263uniform highp sampler2D depthBuffer;
4264#else
4265uniform mediump sampler2D depthBuffer;
4266#endif
4267float readDepth(const in vec2 uv){
4268#if DEPTH_PACKING == 3201
4269return unpackRGBAToDepth(texture2D(depthBuffer,uv));
4270#else
4271return texture2D(depthBuffer,uv).r;
4272#endif
4273}
4274#endif
4275#ifdef USE_WEIGHTS
4276uniform vec4 channelWeights;
4277#endif
4278uniform float opacity;varying vec2 vUv;void main(){
4279#ifdef COLOR_WRITE
4280vec4 texel=texture2D(inputBuffer,vUv);
4281#ifdef USE_WEIGHTS
4282texel*=channelWeights;
4283#endif
4284gl_FragColor=opacity*texel;
4285#ifdef COLOR_SPACE_CONVERSION
4286#include <colorspace_fragment>
4287#endif
4288#include <dithering_fragment>
4289#else
4290gl_FragColor=vec4(0.0);
4291#endif
4292#ifdef DEPTH_WRITE
4293gl_FragDepth=readDepth(vUv);
4294#endif
4295}`,hu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",KI=class extends pn{constructor(){super({name:"CopyMaterial",defines:{DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new Qe(null),depthBuffer:new Qe(null),channelWeights:new Qe(null),opacity:new Qe(1)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:qJ,vertexShader:hu}),this.depthFunc=Ih}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(n){const e=n!==null;this.colorWrite!==e&&(e?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=e,this.needsUpdate=!0),this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){const e=n!==null;this.depthWrite!==e&&(e?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=e,this.depthWrite=e,this.needsUpdate=!0),this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(n){n!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=n):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},ZI=class extends Yi{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new KI,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new En(1,1,{minFilter:dn,magFilter:dn,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,r){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==Wn?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===Lt&&(this.renderTarget.texture.colorSpace=Lt))}},LE=new We,JI=class extends Yi{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,r){const s=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),l=s!==null,c=o>=0;l?(n.getClearColor(LE),n.setClearColor(s,c?o:a)):c&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),l?n.setClearColor(LE,a):c&&n.setClearAlpha(a)}},XJ=class extends Yi{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new JI(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,r){const s=n.getContext(),o=n.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(n,null):(c.render(n,e),c.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,l)):(n.setRenderTarget(e),n.render(a,l),n.setRenderTarget(t),n.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}},OE=class{constructor(n=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:i=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,r,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new ZI,this.depthTexture=null,this.passes=[],this.timer=new WJ,this.autoRenderToScreen=!0,this.setRenderer(n)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(n){const e=this.inputBuffer,t=this.multisampling;t>0&&n>0?(this.inputBuffer.samples=n,this.outputBuffer.samples=n,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==n&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,n),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(n){if(this.renderer=n,n!==null){const e=n.getSize(new de),t=n.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===Wn&&n.outputColorSpace===Lt&&(this.inputBuffer.texture.colorSpace=Lt,this.outputBuffer.texture.colorSpace=Lt,this.inputBuffer.dispose(),this.outputBuffer.dispose()),n.autoClear=!1,this.setSize(e.width,e.height);for(const r of this.passes)r.initialize(n,t,i)}}replaceRenderer(n,e=!0){const t=this.renderer,i=t.domElement.parentNode;return this.setRenderer(n),e&&i!==null&&(i.removeChild(t.domElement),i.appendChild(n.domElement)),t}createDepthTexture(){const n=this.depthTexture=new Vg;return this.inputBuffer.depthTexture=n,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(n.format=gl,n.type=ml):n.type=Os,n}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const n of this.passes)n.setDepthTexture(null)}}createBuffer(n,e,t,i){const r=this.renderer,s=r===null?new de:r.getDrawingBufferSize(new de),o={minFilter:dn,magFilter:dn,stencilBuffer:e,depthBuffer:n,type:t},a=new En(s.width,s.height,o);return i>0&&(a.samples=i),t===Wn&&r!==null&&r.outputColorSpace===Lt&&(a.texture.colorSpace=Lt),a.texture.name="EffectComposer.Buffer",a.texture.generateMipmaps=!1,a}setMainScene(n){for(const e of this.passes)e.mainScene=n}setMainCamera(n){for(const e of this.passes)e.mainCamera=n}addPass(n,e){const t=this.passes,i=this.renderer,r=i.getDrawingBufferSize(new de),s=i.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(n.setRenderer(i),n.setSize(r.width,r.height),n.initialize(i,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),n.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,n):t.push(n),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),n.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const a=this.createDepthTexture();for(n of t)n.setDepthTexture(a)}else n.setDepthTexture(this.depthTexture)}removePass(n){const e=this.passes,t=e.indexOf(n);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(n.getDepthTexture()===this.depthTexture&&n.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(n.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const n=this.passes;this.deleteDepthTexture(),n.length>0&&(this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!1),this.passes=[])}render(n){const e=this.renderer,t=this.copyPass;let i=this.inputBuffer,r=this.outputBuffer,s=!1,o,a,l;n===void 0&&(this.timer.update(),n=this.timer.getDelta());for(const c of this.passes)c.enabled&&(c.render(e,i,r,n,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,i,r,n,s),a.setFunc(o.EQUAL,1,4294967295)),l=i,i=r,r=l),c instanceof XJ?s=!0:c instanceof jJ&&(s=!1))}setSize(n,e,t){const i=this.renderer,r=i.getSize(new de);(n===void 0||e===void 0)&&(n=r.width,e=r.height),(r.width!==n||r.height!==e)&&i.setSize(n,e,t);const s=i.getDrawingBufferSize(new de);this.inputBuffer.setSize(s.width,s.height),this.outputBuffer.setSize(s.width,s.height);for(const o of this.passes)o.setSize(s.width,s.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const n of this.passes)n.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Yi.fullscreenGeometry.dispose()}},Qo={NONE:0,DEPTH:1,CONVOLUTION:2},Zt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},YJ=class{constructor(){this.shaderParts=new Map([[Zt.FRAGMENT_HEAD,null],[Zt.FRAGMENT_MAIN_UV,null],[Zt.FRAGMENT_MAIN_IMAGE,null],[Zt.VERTEX_HEAD,null],[Zt.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Qo.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=_o}},cx=!1,DE=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Et:t=this.materialsFlatShadedDoubleSide;break;case Xn:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Et:t=this.materialsDoubleSide;break;case Xn:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof pn))return n.clone();const e=n.uniforms,t=new Map;for(const r in e){const s=e[r].value;s.isRenderTargetTexture&&(e[r].value=null,t.set(r,s))}const i=n.clone();for(const r of t)e[r[0]].value=r[1],i.uniforms[r[0]].value=r[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Ns;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Xn,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Et,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Xn,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Et,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,cx){const r=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const s of r)s[0].material=s[1];this.meshCount!==r.size&&r.clear()}else{const r=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=r}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return cx}static set workaroundEnabled(n){cx=n}},zo=-1,ti=class extends Cr{constructor(n,e=zo,t=zo,i=1){super(),this.resizable=n,this.baseSize=new de(1,1),this.preferredSize=new de(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new de,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==zo?t.width=e.width:e.height!==zo?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==zo?t.height=e.height:e.width!==zo?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(zo),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return zo}},kt={ADD:0,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},KJ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),y.a*opacity);}",ZJ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),y.a*opacity);}",JJ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",QJ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),y.a*opacity);}",eQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),y.a*opacity);}",tQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),y.a*opacity);}",nQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),y.a*opacity);}",iQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),y.a*opacity);}",rQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),y.a*opacity);}",sQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),y.a*opacity);}",oQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),y.a*opacity);}",aQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),y.a*opacity);}",lQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),y.a*opacity);}",cQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),y.a*opacity);}",uQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),y.a*opacity);}",hQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.
42950,0.0,1.0),y.a),y.a*opacity);}",dQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),y.a*opacity);}",fQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}",pQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",mQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),y.a*opacity);}",gQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),y.a*opacity);}",vQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}",xQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",yQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),y.a*opacity);}",_Q="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",bQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",wQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),y.a*opacity);}",SQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),y.a*opacity);}",MQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",TQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),y.a*opacity);}",EQ="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",AQ=new Map([[kt.ADD,KJ],[kt.AVERAGE,ZJ],[kt.COLOR,JJ],[kt.COLOR_BURN,QJ],[kt.COLOR_DODGE,eQ],[kt.DARKEN,tQ],[kt.DIFFERENCE,nQ],[kt.DIVIDE,iQ],[kt.DST,null],[kt.EXCLUSION,rQ],[kt.HARD_LIGHT,sQ],[kt.HARD_MIX,oQ],[kt.HUE,aQ],[kt.INVERT,lQ],[kt.INVERT_RGB,cQ],[kt.LIGHTEN,uQ],[kt.LINEAR_BURN,hQ],[kt.LINEAR_DODGE,dQ],[kt.LINEAR_LIGHT,fQ],[kt.LUMINOSITY,pQ],[kt.MULTIPLY,mQ],[kt.NEGATION,gQ],[kt.NORMAL,vQ],[kt.OVERLAY,xQ],[kt.PIN_LIGHT,yQ],[kt.REFLECT,_Q],[kt.SATURATION,bQ],[kt.SCREEN,wQ],[kt.SOFT_LIGHT,SQ],[kt.SRC,MQ],[kt.SUBTRACT,TQ],[kt.VIVID_LIGHT,EQ]]),CQ=class extends Cr{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new Qe(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return AQ.get(this.blendFunction)}},du=class extends Cr{constructor(n,e,{attributes:t=Qo.NONE,blendFunction:i=kt.NORMAL,defines:r=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=r,this.uniforms=s,this.extensions=o,this.blendMode=new CQ(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=_o,this._outputColorSpace=Zr}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}
vendor: 10,247 bytes, lines 4295-4333
4295set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=Hs){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof En||e instanceof si||e instanceof Sn||e instanceof Yi)&&this[n].dispose()}}},v0={MEDIUM:2,LARGE:3},RQ=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4296uniform mediump sampler2D inputBuffer;
4297#else
4298uniform lowp sampler2D inputBuffer;
4299#endif
4300varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;
4301#include <colorspace_fragment>
4302}`,PQ="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",IQ=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],NQ=class extends pn{constructor(n=new Ft){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new Qe(null),texelSize:new Qe(new Ft),scale:new Qe(1),kernel:new Qe(0)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:RQ,vertexShader:PQ}),this.setTexelSize(n.x,n.y),this.kernelSize=v0.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return IQ[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,i=1/e;this.uniforms.texelSize.value.set(t,i,t*.5,i*.5)}},QI=class extends Yi{constructor({kernelSize:n=v0.MEDIUM,resolutionScale:e=.5,width:t=ti.AUTO_SIZE,height:i=ti.AUTO_SIZE,resolutionX:r=t,resolutionY:s=i}={}){super("KawaseBlurPass"),this.renderTargetA=new En(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new ti(this,r,s,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new NQ,this._blurMaterial.kernelSize=n,this.copyMaterial=new KI}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,r){const s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.blurMaterial,u=c.kernelSequence;let h=e;this.fullscreenMaterial=c;for(let d=0,f=u.length;d<f;++d){const p=(d&1)===0?a:l;c.kernel=u[d],c.inputBuffer=h.texture,n.setRenderTarget(p),n.render(s,o),h=p}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=h.texture,n.setRenderTarget(this.renderToScreen?null:t),n.render(s,o)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e);const i=t.width,r=t.height;this.renderTargetA.setSize(i,r),this.renderTargetB.setSize(i,r),this.blurMaterial.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,t!==Wn?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):n!==null&&n.outputColorSpace===Lt&&(this.renderTargetA.texture.colorSpace=Lt,this.renderTargetB.texture.colorSpace=Lt))}static get AUTO_SIZE(){return ti.AUTO_SIZE}},LQ=`#include <common>
4303#ifdef FRAMEBUFFER_PRECISION_HIGH
4304uniform mediump sampler2D inputBuffer;
4305#else
4306uniform lowp sampler2D inputBuffer;
4307#endif
4308#ifdef RANGE
4309uniform vec2 range;
4310#elif defined(THRESHOLD)
4311uniform float threshold;uniform float smoothing;
4312#endif
4313varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0;
4314#ifdef RANGE
4315float low=step(range.x,l);float high=step(l,range.y);mask=low*high;
4316#elif defined(THRESHOLD)
4317mask=smoothstep(threshold,threshold+smoothing,l);
4318#endif
4319#ifdef COLOR
4320gl_FragColor=texel*mask;
4321#else
4322gl_FragColor=vec4(l*mask);
4323#endif
4324}`,OQ=class extends pn{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:ua.replace(/\D+/g,"")},uniforms:{inputBuffer:new Qe(null),threshold:new Qe(0),smoothing:new Qe(1),range:new Qe(null)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:LQ,vertexShader:hu}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},eN=class extends Yi{constructor({renderTarget:n,luminanceRange:e,colorOutput:t,resolutionScale:i=1,width:r=ti.AUTO_SIZE,height:s=ti.AUTO_SIZE,resolutionX:o=r,resolutionY:a=s}={}){super("LuminancePass"),this.fullscreenMaterial=new OQ(t,e),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new En(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const l=this.resolution=new ti(this,o,a,i);l.addEventListener("change",c=>this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,r){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==Wn&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},DQ=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4325uniform mediump sampler2D inputBuffer;
4326#else
4327uniform lowp sampler2D inputBuffer;
4328#endif
4329#define WEIGHT_INNER 0.125
4330#define WEIGHT_OUTER 0.0555555
4331varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;
4332#include <colorspace_fragment>
4333}`,kQ="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;
4333vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",FQ=class extends pn{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new Qe(null),texelSize:new Qe(new de)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:DQ,vertexShader:kQ})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},UQ=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4334uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;
4335#else
4336uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;
4337#endif
4338uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);
4339#include <colorspace_fragment>
4340}`,BQ="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",zQ=class extends pn{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new Qe(null),supportBuffer:new Qe(null),texelSize:new Qe(new de),radius:new Qe(.85)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:UQ,vertexShader:BQ})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},VQ=class extends Yi{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new En(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new FQ,this.upsamplingMaterial=new zQ,this.resolution=new de}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t<n;++t){const i=e.clone();i.texture.name="Downsampling.Mipmap"+t,this.downsamplingMipmaps.push(i)}this.upsamplingMipmaps.push(e);for(let t=1,i=n-1;t<i;++t){const r=e.clone();r.texture.name="Upsampling.Mipmap"+t,this.upsamplingMipmaps.push(r)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(n){this.upsamplingMaterial.radius=n}render(n,e,t,i,r){const{scene:s,camera:o}=this,{downsamplingMaterial:a,upsamplingMaterial:l}=this,{downsamplingMipmaps:c,upsamplingMipmaps:u}=this;let h=e;this.fullscreenMaterial=a;for(let d=0,f=c.length;d<f;++d){const p=c[d];a.setSize(h.width,h.height),a.inputBuffer=h.texture,n.setRenderTarget(p),n.render(s,o),h=p}this.fullscreenMaterial=l;for(let d=u.length-1;d>=0;--d){const f=u[d];l.setSize(h.width,h.height),l.inputBuffer=h.texture,l.supportBuffer=c[d].texture,n.setRenderTarget(f),n.render(s,o),h=f}}setSize(n,e){const t=this.resolution;t.set(n,e);let i=t.width,r=t.height;for(let s=0,o=this.downsamplingMipmaps.length;s<o;++s)i=Math.round(i*.5),r=Math.round(r*.5),this.downsamplingMipmaps[s].setSize(i,r),s<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[s].setSize(i,r)}initialize(n,e,t){if(t!==void 0){const i=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(const r of i)r.texture.type=t;if(t!==Wn)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";
4340else if(n!==null&&n.outputColorSpace===Lt)for(const r of i)r.texture.colorSpace=Lt}}dispose(){super.dispose();for(const n of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))n.dispose()}},HQ=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4341uniform mediump sampler2D map;
4342#else
4343uniform lowp sampler2D map;
4344#endif
4345uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,max(inputColor.a,texel.a));}`,kE=class extends du{constructor({blendFunction:n=kt.SCREEN,luminanceThreshold:e=1,luminanceSmoothing:t=.03,mipmapBlur:i=!0,intensity:r=1,radius:s=.85,levels:o=8,kernelSize:a=v0.LARGE,resolutionScale:l=.5,width:c=ti.AUTO_SIZE,height:u=ti.AUTO_SIZE,resolutionX:h=c,resolutionY:d=u}={}){super("BloomEffect",HQ,{blendFunction:n,uniforms:new Map([["map",new Qe(null)],["intensity",new Qe(r)]])}),this.renderTarget=new En(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new QI({kernelSize:a}),this.luminancePass=new eN({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new VQ,this.mipmapBlurPass.enabled=i,this.mipmapBlurPass.radius=s,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=i?this.mipmapBlurPass.texture:this.renderTarget.texture;const f=this.resolution=new ti(this,h,d,l);f.addEventListener("change",p=>this.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const i=this.renderTarget,r=this.luminancePass;r.enabled?(r.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,r.renderTarget):this.blurPass.render(n,r.renderTarget,i)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,i)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,n!==null&&n.outputColorSpace===Lt&&(this.renderTarget.texture.colorSpace=Lt))}},GQ="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(color+vec3(0.5),inputColor.a);}",FE=class extends du{constructor({blendFunction:n=kt.SRC,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",GQ,{blendFunction:n,uniforms:new Map([["brightness",new Qe(e)],["contrast",new Qe(t)]])}),this.inputColorSpace=Lt}get brightness(){return this.uniforms.get("brightness").value}set brightness(n){this.uniforms.get("brightness").value=n}getBrightness(){return this.brightness}setBrightness(n){this.brightness=n}get contrast(){return this.uniforms.get("contrast").value}set contrast(n){this.uniforms.get("contrast").value=n}getContrast(){return this.contrast}setContrast(n){this.contrast=n}},WQ="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(ve
4345c3(average(inputColor.rgb)),inputColor.a);}",ux=class extends du{constructor(n){super("ColorAverageEffect",WQ,{blendFunction:n})}},tN={RED:0,GREEN:1},nN={DISCARD:0,MULTIPLY_RGB:3},$Q=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4346uniform mediump sampler2D inputBuffer;
4347#else
4348uniform lowp sampler2D inputBuffer;
4349#endif
4350#if PASS == 1
4351uniform vec4 kernel64[32];
4352#else
4353uniform vec4 kernel16[8];
4354#endif
4355uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;varying vec2 vUv;void main(){
4356#ifdef FOREGROUND
4357vec2 cocNearFar=texture2D(cocBuffer,vUv).rg*scale;float coc=cocNearFar.x;
4358#else
4359float coc=texture2D(cocBuffer,vUv).g*scale;
4360#endif
4361if(coc==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{
4362#ifdef FOREGROUND
4363vec2 step=texelSize*max(cocNearFar.x,cocNearFar.y);
4364#else
4365vec2 step=texelSize*coc;
4366#endif
4367#if PASS == 1
4368vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;
4369#else
4370vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;
4371#endif
4372}}`,ap=class extends pn{constructor(n=!1,e=!1){super({name:"BokehMaterial",defines:{PASS:n?"2":"1"},uniforms:{inputBuffer:new Qe(null),cocBuffer:new Qe(null),texelSize:new Qe(new de),kernel64:new Qe(null),kernel16:new Qe(null),scale:new Qe(1)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:$Q,vertexShader:hu}),e&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}set cocBuffer(n){this.uniforms.cocBuffer.value=n}setCoCBuffer(n){this.uniforms.cocBuffer.value=n}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(n){return this.scale}setScale(n){this.scale=n}generateKernel(){const n=2.39996323,e=new Float64Array(128),t=new Float64Array(32);let i=0,r=0;for(let s=0,o=Math.sqrt(80);s<80;++s){const a=s*n,l=Math.sqrt(s)/o,c=l*Math.cos(a),u=l*Math.sin(a);s%5===0?(t[r++]=c,t[r++]=u):(e[i++]=c,e[i++]=u)}this.uniforms.kernel64.value=e,this.uniforms.kernel16.value=t}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},jQ=`#include <common>
4373#include <packing>
4374#ifdef GL_FRAGMENT_PRECISION_HIGH
4375uniform highp sampler2D depthBuffer;
4376#else
4377uniform mediump sampler2D depthBuffer;
4378#endif
4379uniform mat4 projectionMatrix;uniform mat4 projectionMatrixInverse;uniform float cameraNear;uniform float cameraFar;uniform float focusDistance;uniform float focusRange;varying vec2 vUv;float readDepth(const in vec2 uv){
4380#if DEPTH_PACKING == 3201
4381float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
4382#else
4383float depth=texture2D(depthBuffer,uv).r;
4384#endif
4385#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
4386float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
4387#elif defined(USE_REVERSED_DEPTH_BUFFER)
4388depth=1.0-depth;
4389#endif
4390return depth;}
4391#ifdef PERSPECTIVE_CAMERA
4392#define getViewZ(depth) perspectiveDepthToViewZ(depth, cameraNear, cameraFar)
4393#else
4394#define getViewZ(depth) orthographicDepthToViewZ(depth, cameraNear, cameraFar)
4395#endif
4396vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(projectionMatrixInverse*clipPosition).xyz;}vec3 getViewPosition(const in vec2 screenPosition,const in float depth){return getViewPosition(screenPosition,depth,getViewZ(depth));}
4397#define getDistance(viewPosition) length(viewPosition)
4398void main(){float depth=readDepth(vUv);vec3 viewPosition=getViewPosition(vUv,depth);float distance=getDistance(viewPosition);float signedDistance=distance-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,qQ=class extends pn{constructor(n=null){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Qe(null),projectionMatrix:new Qe(null),projectionMatrixInverse:new Qe(null),cameraNear:new Qe(.3),cameraFar:new Qe(1e3),focusDistance:new Qe(0),focusRange:new Qe(0)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:jQ,vertexShader:hu}),this.uniforms.focalLength=this.uniforms.focusRange,n!==null&&this.copyCameraSettings(n)}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Hs){this.depthBuffer=n,this.depthPacking=e}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(n){this.uniforms.focusDistance.value=n}get worldFocusDistance(){return this.focusDistance}set worldFocusDistance(n){this.focusDistance=n}getFocusDistance(n){this.uniforms.focusDistance.value=n}setFocusDistance(n){this.uniforms.focusDistance.value=n}get focalLength(){return this.focusRange}set focalLength(n){this.focusRange=n}get focusRange(){return this.uniforms.focusRange.value}set focusRange(n){this.uniforms.focusRange.value=n}get worldFocusRange(){return this.focusRange}set worldFocusRange(n){this.focusRange=n}getFocalLength(n){return this.focusRange}setFocalLength(n){this.focusRange=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){this.uniforms.projectionMatrix.value=n.projectionMatrix,this.uniforms.projectionMatrixInverse.value=n.projectionMatrixInverse,this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far;const e=this.defines.PERSPECTIVE_CAMERA!==void 0;n instanceof xn?e||(this.defines.PERSPECTIVE_CAMERA=!0,this.needsUpdate=!0):e&&(delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},XQ=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4399uniform mediump sampler2D inputBuffer;
4400#else
4401uniform lowp sampler2D inputBuffer;
4402#endif
4403#ifdef MASK_PRECISION_HIGH
4404uniform mediump sampler2D maskTexture;
4405#else
4406uniform lowp sampler2D maskTexture;
4407#endif
4408#if MASK_FUNCTION != 0
4409uniform float strength;
4410#endif
4411varying vec2 vUv;void main(){
4412#if COLOR_CHANNEL == 0
4413float mask=texture2D(maskTexture,vUv).r;
4414#elif COLOR_CHANNEL == 1
4415float mask=texture2D(maskTexture,vUv).g;
4416#elif COLOR_CHANNEL == 2
4417float mask=texture2D(maskTexture,vUv).b;
4418#else
4419float mask=texture2D(maskTexture,vUv).a;
4420#endif
4421#if MASK_FUNCTION == 0
4422#ifdef INVERTED
4423mask=(mask>0.0)?0.0:1.0;
4424#else
4425mask=(mask>0.0)?1.0:0.0;
4426#endif
4427#else
4428mask=clamp(mask*strength,0.0,1.0);
4429#ifdef INVERTED
4430mask=1.0-mask;
4431#endif
4432#endif
4433#if MASK_FUNCTION == 3
4434vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=vec4(mask*texel.rgb,texel.a);
4435#elif MASK_FUNCTION == 2
4436gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);
4437#else
4438gl_FragColor=mask*texture2D(inputBuffer,vUv);
4439#endif
4440}`,YQ=class extends pn{constructor(n=null){super({name:"MaskMaterial",uniforms:{maskTexture:new Qe(n),inputBuffer:new Qe(null),strength:new Qe(1)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:XQ,vertexShader:hu}),this.colorChannel=tN.RED,this.maskFunction=nN.DISCARD}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}set maskTexture(n){this.uniforms.maskTexture.value=n,delete this.defines.MASK_PRECISION_HIGH,n.type!==Wn&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(n){this.maskTexture=n}set colorChannel(n){this.defines.COLOR_CHANNEL=n.toFixed(0),this.needsUpdate=!0}setColorChannel(n){this.colorChannel=n}set maskFunction(n){this.defines.MASK_FUNCTION=n.toFixed(0),this.needsUpdate=!0}setMaskFunction(n){this.maskFunction=n}get inverted(){return this.defines.INVERTED!==void 0}set inverted(n){this.inverted&&!n?delete this.defines.INVERTED:n&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(n){this.inverted=n}get strength(){return this.uniforms.strength.value}set strength(n){this.uniforms.strength.value=n}getStrength(){return this.strength}setStrength(n){this.strength=n}},hc=class extends Yi{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,i,r){const s=this.fullscreenMaterial.uniforms;e!==null&&s!==void 0&&s[this.input]!==void 0&&(s[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==Wn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},KQ=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4441uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;
4442#else
4443uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;
4444#endif
4445#if MASK_FUNCTION != 1 && MASK_FUNCTION != 2
4446uniform lowp sampler2D farCoCBuffer;
4447#endif
4448uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);
4449#if MASK_FUNCTION == 1 || MASK_FUNCTION == 2
4450vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,colorFar.a);cocNearFar.x=min(cocNearFar.x*scale,1.0);
4451#else
4452vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,texture2D(farCoCBuffer,uv).g);cocNearFar=min(cocNearFar*scale,1.0);colorFar.a*=cocNearFar.y;
4453#endif
4454vec4 result=inputColor*(1.0-cocNearFar.y)+colorFar;result=mix(result,colorNear,cocNearFar.x);outputColor=result;}`,ZQ=new z,UE=class extends du{constructor(n,{blendFunction:e,worldFocusDistance:t,worldFocusRange:i,focalLength:r,focusDistance:s=t||3,focusRange:o=i||r||2,bokehScale:a=1,resolutionScale:l=.5,width:c,height:u,resolutionX:h=c||ti.AUTO_SIZE,resolutionY:d=u||ti.AUTO_SIZE}={}){super("DepthOfFieldEffect",KQ,{blendFunction:e,attributes:Qo.DEPTH,uniforms:new Map([["nearColorBuffer",new Qe(null)],["farColorBuffer",new Qe(null)],["nearCoCBuffer",new Qe(null)],["farCoCBuffer",new Qe(null)],["scale",new Qe(1)]])}),this.camera=n,this.renderTarget=new En(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.uniforms.get("farCoCBuffer").value=this.renderTargetCoC.texture,this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new hc(new qQ(n));const f=this.cocMaterial;f.focusDistance=s,f.focusRange=o,this.blurPass=new QI({resolutionScale:l,resolutionX:h,resolutionY:d,kernelSize:v0.MEDIUM}),this.maskPass=new hc(new YQ(this.renderTargetCoC.texture));const p=this.maskPass.fullscreenMaterial;p.colorChannel=tN.GREEN,this.maskFunction=nN.MULTIPLY_RGB,this.bokehNearBasePass=new hc(new ap(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new hc(new ap(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new hc(new ap(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new hc(new ap(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null;const v=this.resolution=new ti(this,h,d,l);v.addEventListener("change",m=>this.setSize(v.baseWidth,v.baseHeight)),this.bokehScale=a}set mainCamera(n){this.camera=n,this.cocMaterial.copyCameraSettings(n)}get cocTexture(){return this.renderTargetCoC.texture}get maskFunction(){return this.maskPass.fullscreenMaterial.maskFunction}set maskFunction(n){this.maskFunction!==n&&(this.defines.set("MASK_FUNCTION",n.toFixed(0)),this.maskPass.fullscreenMaterial.maskFunction=n,this.setChanged())}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.cocMaterial}getBlurPass(){return this.blurPass}getResolution(){return this.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(n){this.bokehNearBasePass.fullscreenMaterial.scale=n,this.bokehNearFillPass.fullscreenMaterial.scale=n,this.bokehFarBasePass.fullscreenMaterial.scale=n,this.bokehFarFillPass.fullscreenMaterial.scale=n,this.maskPass.fullscreenMaterial.strength=n,this.uniforms.get("scale").value=n}getBokehScale(){return this.bokehScale}setBokehScale(n){this.bokehScale=n}getTarget(){return this.target}setTarget(n){this.target=n}calculateFocusDistance(n){return this.camera.getWorldPosition(ZQ).distanceTo(n)}setDepthTexture(n,e=Hs){this.cocMaterial.depthBuffer=n,this.cocMaterial.depthPacking=e}update(n,e,t){const i=this.renderTarget,r=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked;if(this.target!==null){const a=this.calculateFocusDistance(this.target);this.cocMaterial.focusDistance=a}this.cocPass.render(n,null,r),this.blurPass.render(n,r,s),this.maskPass.render(n,e,o),this.bokehFarBasePass.render(n,o,i),this.bokehFarFillPass.render(n,i,this.renderTargetFar),this.bokehNearBasePass.render(n,e,i),this.bokehNearFillPass.render(n,i,this.renderTargetNear)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e);
vendor: 7,470 bytes, lines 4454-4478
4454const i=t.width,r=t.height;this.cocPass.setSize(n,e),this.blurPass.setSize(n,e),this.maskPass.setSize(n,e),this.renderTargetFar.setSize(n,e),this.renderTargetCoC.setSize(n,e),this.renderTargetMasked.setSize(n,e),this.renderTarget.setSize(i,r),this.renderTargetNear.setSize(i,r),this.renderTargetCoCBlurred.setSize(i,r),this.bokehNearBasePass.fullscreenMaterial.setSize(n,e),this.bokehNearFillPass.fullscreenMaterial.setSize(n,e),this.bokehFarBasePass.fullscreenMaterial.setSize(n,e),this.bokehFarFillPass.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){this.cocPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.bokehNearBasePass.initialize(n,e,t),this.bokehNearFillPass.initialize(n,e,t),this.bokehFarBasePass.initialize(n,e,t),this.bokehFarFillPass.initialize(n,e,t),this.blurPass.initialize(n,e,Wn),n.capabilities.logarithmicDepthBuffer&&(this.cocPass.fullscreenMaterial.defines.LOG_DEPTH="1"),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t,n!==null&&n.outputColorSpace===Lt&&(this.renderTarget.texture.colorSpace=Lt,this.renderTargetNear.texture.colorSpace=Lt,this.renderTargetFar.texture.colorSpace=Lt,this.renderTargetMasked.texture.colorSpace=Lt))}},iN=class extends Yi{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new JI,this.overrideMaterialManager=t===null?null:new DE(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new DE(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,r){const s=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,c=s.background,u=n.shadowMap.autoUpdate,h=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(h),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,s,o):n.render(s,o),o.layers.mask=l,s.background=c,n.shadowMap.autoUpdate=u}},In={LINEAR:0,REINHARD:1,REINHARD2:2,REINHARD2_ADAPTIVE:3,UNCHARTED2:4,OPTIMIZED_CINEON:5,CINEON:5,ACES_FILMIC:6,AGX:7,NEUTRAL:8},qu={DEFAULT:0,ESKIL:1},JQ=`#include <packing>
4455#ifdef GL_FRAGMENT_PRECISION_HIGH
4456uniform highp sampler2D depthBuffer;
4457#else
4458uniform mediump sampler2D depthBuffer;
4459#endif
4460#ifdef DOWNSAMPLE_NORMALS
4461uniform lowp sampler2D normalBuffer;
4462#endif
4463varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){
4464#if DEPTH_PACKING == 3201
4465return unpackRGBAToDepth(texture2D(depthBuffer,uv));
4466#else
4467return texture2D(depthBuffer,uv).r;
4468#endif
4469}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d);
4470#ifdef DOWNSAMPLE_NORMALS
4471vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb;
4472#else
4473vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0);
4474#endif
4475gl_FragColor=vec4(n[index],d[index]);}`,QQ="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",eee=class extends pn{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Qe(null),normalBuffer:new Qe(null),texelSize:new Qe(new de)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:JQ,vertexShader:QQ})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Hs){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},tee=class extends Yi{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=ti.AUTO_SIZE,height:i=ti.AUTO_SIZE,resolutionX:r=t,resolutionY:s=i}={}){super("DepthDownsamplingPass");const o=new eee;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new En(1,1,{minFilter:on,magFilter:on,depthBuffer:!1,type:li}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new ti(this,r,s,e);a.addEventListener("change",l=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=Hs){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,r){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},nee=`#include <packing>
4476#define packFloatToRGBA(v) packDepthToRGBA(v)
4477#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
4478uniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;
4478uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv));
4479#if __VERSION__ < 300
4480float l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;
4481#else
4482float l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;
4483#endif
4484l0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`,iee=class extends pn{constructor(){super({name:"AdaptiveLuminanceMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{luminanceBuffer0:new Qe(null),luminanceBuffer1:new Qe(null),minLuminance:new Qe(.01),deltaTime:new Qe(0),tau:new Qe(1)},extensions:{shaderTextureLOD:!0},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:nee,vertexShader:hu})}set luminanceBuffer0(n){this.uniforms.luminanceBuffer0.value=n}setLuminanceBuffer0(n){this.uniforms.luminanceBuffer0.value=n}set luminanceBuffer1(n){this.uniforms.luminanceBuffer1.value=n}setLuminanceBuffer1(n){this.uniforms.luminanceBuffer1.value=n}set mipLevel1x1(n){this.defines.MIP_LEVEL_1X1=n.toFixed(1),this.needsUpdate=!0}setMipLevel1x1(n){this.mipLevel1x1=n}set deltaTime(n){this.uniforms.deltaTime.value=n}setDeltaTime(n){this.uniforms.deltaTime.value=n}get minLuminance(){return this.uniforms.minLuminance.value}set minLuminance(n){this.uniforms.minLuminance.value=n}getMinLuminance(){return this.uniforms.minLuminance.value}setMinLuminance(n){this.uniforms.minLuminance.value=n}get adaptationRate(){return this.uniforms.tau.value}set adaptationRate(n){this.uniforms.tau.value=n}getAdaptationRate(){return this.uniforms.tau.value}setAdaptationRate(n){this.uniforms.tau.value=n}},ree=class extends Yi{constructor(n,{minLuminance:e=.01,adaptationRate:t=1}={}){super("AdaptiveLuminancePass"),this.fullscreenMaterial=new iee,this.needsSwap=!1,this.renderTargetPrevious=new En(1,1,{minFilter:on,magFilter:on,depthBuffer:!1}),this.renderTargetPrevious.texture.name="Luminance.Previous";const i=this.fullscreenMaterial;i.luminanceBuffer0=this.renderTargetPrevious.texture,i.luminanceBuffer1=n,i.minLuminance=e,i.adaptationRate=t,this.renderTargetAdapted=this.renderTargetPrevious.clone(),this.renderTargetAdapted.texture.name="Luminance.Adapted",this.copyPass=new ZI(this.renderTargetPrevious,!1)}get texture(){return this.renderTargetAdapted.texture}getTexture(){return this.renderTargetAdapted.texture}set mipLevel1x1(n){this.fullscreenMaterial.mipLevel1x1=n}get adaptationRate(){return this.fullscreenMaterial.adaptationRate}set adaptationRate(n){this.fullscreenMaterial.adaptationRate=n}render(n,e,t,i,r){this.fullscreenMaterial.deltaTime=i,n.setRenderTarget(this.renderToScreen?null:this.renderTargetAdapted),n.render(this.scene,this.camera),this.copyPass.render(n,this.renderTargetAdapted)}},see=`#include <tonemapping_pars_fragment>
4485uniform float whitePoint;
4486#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3
4487uniform float middleGrey;
4488#if TONE_MAPPING_MODE == 3
4489uniform lowp sampler2D luminanceBuffer;
4490#else
4491uniform float averageLuminance;
4492#endif
4493vec3 Reinhard2ToneMapping(vec3 color){color*=toneMappingExposure;float l=luminance(color);
4494#if TONE_MAPPING_MODE == 3
4495float lumAvg=unpackRGBAToFloat(texture2D(luminanceBuffer,vec2(0.5)));
4496#else
4497float lumAvg=averageLuminance;
4498#endif
4499float lumScaled=(l*middleGrey)/max(lumAvg,1e-6);float lumCompressed=lumScaled*(1.0+lumScaled/(whitePoint*whitePoint));lumCompressed/=(1.0+lumScaled);return clamp(lumCompressed*color,0.0,1.0);}
4500#elif TONE_MAPPING_MODE == 4
4501#define A 0.15
4502#define B 0.50
4503#define C 0.10
4504#define D 0.20
4505#define E 0.02
4506#define F 0.30
4507vec3 Uncharted2Helper(const in vec3 x){return((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}vec3 Uncharted2ToneMapping(vec3 color){color*=toneMappingExposure;return clamp(Uncharted2Helper(color)/Uncharted2Helper(vec3(whitePoint)),0.0,1.0);}
4508#endif
4509void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){
4510#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3
4511outputColor=vec4(Reinhard2ToneMapping(inputColor.rgb),inputColor.a);
4512#elif TONE_MAPPING_MODE == 4
4513outputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a);
4514#else
4515outputColor=vec4(toneMapping(inputColor.rgb),inputColor.a);
4516#endif
4517}`,BE=class extends du{constructor({blendFunction:n=kt.SRC,adaptive:e=!1,mode:t=e?In.REINHARD2_ADAPTIVE:In.AGX,resolution:i=256,maxLuminance:r=4,whitePoint:s=r,middleGrey:o=.6,minLuminance:a=.01,averageLuminance:l=1,adaptationRate:c=1}={}){super("ToneMappingEffect",see,{blendFunction:n,uniforms:new Map([["luminanceBuffer",new Qe(null)],["maxLuminance",new Qe(r)],["whitePoint",new Qe(s)],["middleGrey",new Qe(o)],["averageLuminance",new Qe(l)]])}),this.renderTargetLuminance=new En(1,1,{minFilter:es,depthBuffer:!1}),this.renderTargetLuminance.texture.generateMipmaps=!0,this.renderTargetLuminance.texture.name="Luminance",this.luminancePass=new eN({renderTarget:this.renderTargetLuminance}),this.adaptiveLuminancePass=new ree(this.luminancePass.texture,{minLuminance:a,adaptationRate:c}),this.uniforms.get("luminanceBuffer").value=this.adaptiveLuminancePass.texture,this.resolution=i,this.mode=t}get mode(){return Number(this.defines.get("TONE_MAPPING_MODE"))}set mode(n){if(this.mode===n)return;const t=ua.replace(/\D+/g,"")>=168?"CineonToneMapping(texel)":"OptimizedCineonToneMapping(texel)";switch(this.defines.clear(),this.defines.set("TONE_MAPPING_MODE",n.toFixed(0)),n){case In.LINEAR:this.defines.set("toneMapping(texel)","LinearToneMapping(texel)");break;case In.REINHARD:this.defines.set("toneMapping(texel)","ReinhardToneMapping(texel)");break;case In.CINEON:case In.OPTIMIZED_CINEON:this.defines.set("toneMapping(texel)",t);break;case In.ACES_FILMIC:this.defines.set("toneMapping(texel)","ACESFilmicToneMapping(texel)");break;case In.AGX:this.defines.set("toneMapping(texel)","AgXToneMapping(texel)");break;case In.NEUTRAL:this.defines.set("toneMapping(texel)","NeutralToneMapping(texel)");break;default:this.defines.set("toneMapping(texel)","texel");break}this.adaptiveLuminancePass.enabled=n===In.REINHARD2_ADAPTIVE,this.setChanged()}getMode(){return this.mode}setMode(n){this.mode=n}get whitePoint(){return this.uniforms.get("whitePoint").value}set whitePoint(n){this.uniforms.get("whitePoint").value=n}get middleGrey(){return this.uniforms.get("middleGrey").value}set middleGrey(n){this.uniforms.get("middleGrey").value=n}get averageLuminance(){return this.uniforms.get("averageLuminance").value}set averageLuminance(n){this.uniforms.get("averageLuminance").value=n}get adaptiveLuminanceMaterial(){return this.adaptiveLuminancePass.fullscreenMaterial}getAdaptiveLuminanceMaterial(){return this.adaptiveLuminanceMaterial}get resolution(){return this.luminancePass.resolution.width}set resolution(n){const e=Math.max(0,Math.ceil(Math.log2(n))),t=Math.pow(2,e);this.luminancePass.resolution.setPreferredSize(t,t),this.adaptiveLuminanceMaterial.mipLevel1x1=e}getResolution(){return this.resolution}setResolution(n){this.resolution=n}get adaptive(){return this.mode===In.REINHARD2_ADAPTIVE}set adaptive(n){this.mode=n?In.REINHARD2_ADAPTIVE:In.REINHARD2}get adaptationRate(){return this.adaptiveLuminanceMaterial.adaptationRate}set adaptationRate(n){this.adaptiveLuminanceMaterial.adaptationRate=n}get distinction(){return console.warn(this.name,"distinction was removed."),1}set distinction(n){console.warn(this.name,"distinction was removed.")}update(n,e,t){this.adaptiveLuminancePass.enabled&&(this.luminancePass.render(n,e),this.adaptiveLuminancePass.render(n,null,
4517null,t))}initialize(n,e,t){this.adaptiveLuminancePass.initialize(n,e,t)}},oee=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;
4518#if VIGNETTE_TECHNIQUE == 0
4519float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));
4520#else
4521vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));
4522#endif
4523outputColor=vec4(color,inputColor.a);}`,zE=class extends du{constructor({blendFunction:n,eskil:e=!1,technique:t=e?qu.ESKIL:qu.DEFAULT,offset:i=.5,darkness:r=.5}={}){super("VignetteEffect",oee,{blendFunction:n,defines:new Map([["VIGNETTE_TECHNIQUE",t.toFixed(0)]]),uniforms:new Map([["offset",new Qe(i)],["darkness",new Qe(r)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(n){this.technique!==n&&(this.defines.set("VIGNETTE_TECHNIQUE",n.toFixed(0)),this.setChanged())}get eskil(){return this.technique===qu.ESKIL}set eskil(n){this.technique=n?qu.ESKIL:qu.DEFAULT}getTechnique(){return this.technique}setTechnique(n){this.technique=n}get offset(){return this.uniforms.get("offset").value}set offset(n){this.uniforms.get("offset").value=n}getOffset(){return this.offset}setOffset(n){this.offset=n}get darkness(){return this.uniforms.get("darkness").value}set darkness(n){this.uniforms.get("darkness").value=n}getDarkness(){return this.darkness}setDarkness(n){this.darkness=n}},aee=`#include <common>
4524#include <packing>
4525#include <dithering_pars_fragment>
4526#define packFloatToRGBA(v) packDepthToRGBA(v)
4527#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
4528#ifdef FRAMEBUFFER_PRECISION_HIGH
4529uniform mediump sampler2D inputBuffer;
4530#else
4531uniform lowp sampler2D inputBuffer;
4532#endif
4533#if DEPTH_PACKING == 3201
4534uniform lowp sampler2D depthBuffer;
4535#elif defined(GL_FRAGMENT_PRECISION_HIGH)
4536uniform highp sampler2D depthBuffer;
4537#else
4538uniform mediump sampler2D depthBuffer;
4539#endif
4540uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){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);}float readDepth(const in vec2 uv){
4541#if DEPTH_PACKING == 3201
4542float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
4543#else
4544float depth=texture2D(depthBuffer,uv).r;
4545#endif
4546#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
4547float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
4548#elif defined(USE_REVERSED_DEPTH_BUFFER)
4549depth=1.0-depth;
4550#endif
4551return depth;}float getViewZ(const in float depth){
4552#ifdef PERSPECTIVE_CAMERA
4553return perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
4554#else
4555return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4556#endif
4557}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0;
4558#ifdef ENCODE_OUTPUT
4559#include <colorspace_fragment>
4560#endif
4561#include <dithering_fragment>
4562}`,lee="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",cee=class extends pn{constructor(n,e,t,i,r=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:ua.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Qe(null),depthBuffer:new Qe(null),resolution:new Qe(new de),texelSize:new Qe(new de),cameraNear:new Qe(.3),cameraFar:new Qe(1e3),aspect:ne
vendor: 3,722 bytes, lines 4562-4565
4562w Qe(1),time:new Qe(0)},blending:Hn,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:r}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(i)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Hs){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=aee.replace(Zt.FRAGMENT_HEAD,n.get(Zt.FRAGMENT_HEAD)||"").replace(Zt.FRAGMENT_MAIN_UV,n.get(Zt.FRAGMENT_MAIN_UV)||"").replace(Zt.FRAGMENT_MAIN_IMAGE,n.get(Zt.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=lee.replace(Zt.VERTEX_HEAD,n.get(Zt.VERTEX_HEAD)||"").replace(Zt.VERTEX_MAIN_SUPPORT,n.get(Zt.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof xn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return Zt}};function VE(n,e,t){for(const i of e){const r="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),s=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(s,r))}}function uee(n,e,t){let i=e.getFragmentShader(),r=e.getVertexShader();const s=i!==void 0&&/mainImage/.test(i),o=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&(t.attributes&Qo.CONVOLUTION)!==0)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!s&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,l=t.shaderParts;let c=l.get(Zt.FRAGMENT_HEAD)||"",u=l.get(Zt.FRAGMENT_MAIN_UV)||"",h=l.get(Zt.FRAGMENT_MAIN_IMAGE)||"",d=l.get(Zt.VERTEX_HEAD)||"",f=l.get(Zt.VERTEX_MAIN_SUPPORT)||"";const p=new Set,v=new Set;if(o&&(u+=`	${n}MainUv(UV);
4563`,t.uvTransformation=!0),r!==null&&/mainSupport/.test(r)){const y=/mainSupport *\([\w\s]*?uv\s*?\)/.test(r);f+=`	${n}MainSupport(`,f+=y?`vUv);
4564`:`);
4565`;for(const x of r.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const _ of x[1].split(/\s*,\s*/))t.varyings.add(_),p.add(_),v.add(_);for(const x of r.matchAll(a))v.add(x[1])}for(const y of i.matchAll(a))v.add(y[1]);for(const y of e.defines.keys())v.add(y.replace(/\([\w\s,]*\)/g,""));for(const y of e.uniforms.keys())v.add(y);v.delete("while"),v.delete("for"),v.delete("if"),e.uniforms.forEac
4565h((y,x)=>t.uniforms.set(n+x.charAt(0).toUpperCase()+x.slice(1),y)),e.defines.forEach((y,x)=>t.defines.set(n+x.charAt(0).toUpperCase()+x.slice(1),y));const m=new Map([["fragment",i],["vertex",r]]);VE(n,v,t.defines),VE(n,v,m),i=m.get("fragment"),r=m.get("vertex");const g=e.blendMode;if(t.blendModes.set(g.blendFunction,g),s){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(h+=e.inputColorSpace===Lt?`color0 = sRGBTransferOETF(color0);
4566	`:`color0 = sRGBToLinear(color0);
4567	`),e.outputColorSpace!==Zr?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const y=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;h+=`${n}MainImage(color0, UV, `,(t.attributes&Qo.DEPTH)!==0&&y.test(i)&&(h+="depth, ",t.readDepth=!0),h+=`color1);
4568	`;const x=n+"BlendOpacity";t.uniforms.set(x,g.opacity),h+=`color0 = blend${g.blendFunction}(color0, color1, ${x});
4569
4570	`,c+=`uniform float ${x};
4571
4572`}if(c+=i+`
4573`,r!==null&&(d+=r+`
4574`),l.set(Zt.FRAGMENT_HEAD,c),l.set(Zt.FRAGMENT_MAIN_UV,u),l.set(Zt.FRAGMENT_MAIN_IMAGE,h),l.set(Zt.VERTEX_HEAD,d),l.set(Zt.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const y of e.extensions)t.extensions.add(y)}}var hee=class extends Yi{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new cee(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new YJ;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===kt.DST)n.attributes|=o.getAttributes()&Qo.DEPTH;else{if((n.attributes&o.getAttributes()&Qo.CONVOLUTION)!==0)throw new Error(`Convolution effects cannot be merged (${o.name})`);uee("e"+e++,o,n)}let t=n.shaderParts.get(Zt.FRAGMENT_HEAD),i=n.shaderParts.get(Zt.FRAGMENT_MAIN_IMAGE),r=n.shaderParts.get(Zt.FRAGMENT_MAIN_UV);const s=/\bblend\b/g;for(const o of n.blendModes.values())t+=o.getShaderCode().replace(s,`blend${o.blendFunction}`)+`
4575`;(n.attributes&Qo.DEPTH)!==0?(n.readDepth&&(i=`float depth = readDepth(UV);
4576
4577	`+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace
4577===Lt&&(i+=`color0 = sRGBToLinear(color0);
4578	`),n.uvTransformation?(r=`vec2 transformedUv = vUv;
4579`+r,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(Zt.FRAGMENT_HEAD,t),n.shaderParts.set(Zt.FRAGMENT_MAIN_IMAGE,i),n.shaderParts.set(Zt.FRAGMENT_MAIN_UV,r);for(const[o,a]of n.shaderParts)a!==null&&n.shaderParts.set(o,a.trim().replace(/^#/,`
4580#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=Hs){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,i,r){for(const s of this.effects)s.update(n,e,i);if(!this.skipRendering||this.renderToScreen){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=i*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const i of this.effects)i.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==Wn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},dee=class extends Yi{constructor(n,e,{renderTarget:t,resolutionScale:i=1,width:r=ti.AUTO_SIZE,height:s=ti.AUTO_SIZE,resolutionX:o=r,resolutionY:a=s}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new iN(n,e,new vb);const l=this.renderPass;l.ignoreBackground=!0,l.skipShadowMapUpdate=!0;const c=l.getClearPass();c.overrideClearColor=new We(7829503),c.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new En(1,1,{minFilter:on,magFilter:on}),this.renderTarget.texture.name="NormalPass.Target");const u=this.resolution=new ti(this,o,a,i);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,r){const s=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,s,s)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}};class HE{static isWebGL2Available(){try{const e=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&e.getContext("webgl2"))}catch{return!1}}static isColorSpaceAvailable(e){try{const t=document.createElement("canvas"),i=window.WebGL2RenderingContext&&t.getContext("webgl2");return i.drawingBufferColorSpace=e,i.drawingBufferColorSpace===e}catch{return!1}}static getWebGL2ErrorMessage(){return this._getErrorMessage(2)}static _getErrorMessage(e){const t={1:"WebGL",2:"WebGL 2"},i={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>';const s=document.createElement("div");return s.id="webglmessage",s.style.fontFamily="monospace",s.style.fontSize="13px",s.style.fontWeight="normal",s.style.textAlign="center",s.style.background="#fff",s.style.color="#000",s.style.padding="1.5em",s.style.width="400px",s.style.margin="5em auto 0",i[e]?r=r.replace("$0","graphics card"):r=r.replace("$0","browser"),r=r.replace("$1",t[e]),s.innerHTML=r,s}}const rN=Symbol("effectComposerPmndrs"),fee=qe({__name:"EffectComposerPmndrs",props:{enabled:{type:Boolean,default:!0},depthBuffer:{type:Boolean,default:void 0},disableNormalPass:{type:Boolean,default:!1},stencilBuffer:{type:Boolean,default:void 0},resolutionScale:{},autoClear:{type:Boolean,default:!0},multisampling:{default:0},frameBufferType:{default:Gi}},emits:["render"],setup(n,{expose:e,emit:t}){const i=n,r=t,{scene:s,camera:o,renderer:a,sizes:l}=au(),c=Mt(null);let u=null,h=null;Mr(rN,c),e({composer:c});const d=()=>{c.value&&(h=new dee(s.value,o.activeCamera.value),h.enabled=!1,c.value.addPass(h),i.resolutionScale!==void 0&&HE.isWebG
4580L2Available()&&(u=new tee({normalBuffer:h.texture,resolutionScale:i.resolutionScale}),u.enabled=!1,c.value.addPass(u)))},f=ge(()=>{const v=new OE,m={depthBuffer:i.depthBuffer!==void 0?i.depthBuffer:v.inputBuffer.depthBuffer,stencilBuffer:i.stencilBuffer!==void 0?i.stencilBuffer:v.inputBuffer.stencilBuffer,multisampling:HE.isWebGL2Available()?i.multisampling!==void 0?i.multisampling:v.multisampling:0,frameBufferType:i.frameBufferType!==void 0?i.frameBufferType:Gi};return v.dispose(),m}),p=()=>{!a.instance&&!s.value&&!o.activeCamera.value||(c.value?.dispose(),c.value=new OE(a.instance,f.value),c.value.addPass(new iN(s.value,o.activeCamera.value)),i.disableNormalPass||d())};return Je([s,o.activeCamera,()=>i.disableNormalPass],()=>{!l.width.value||!l.height.value||p()}),Je(()=>[l.width.value,l.height.value],([v,m])=>{!v&&!m||(c.value?c.value.setSize(v,m):p())},{immediate:!0}),a.replaceRenderFunction(v=>{if(i.enabled&&a.instance&&c.value&&l.width.value&&l.height.value){const m=a.instance.autoClear;a.instance.autoClear=i.autoClear,i.stencilBuffer&&!i.autoClear&&a.instance.clearStencil(),c.value.render(),r("render",c.value),a.instance.autoClear=m,v()}}),di(()=>{c.value?.dispose()}),(v,m)=>lt(v.$slots,"default")}}),fu=(n,e,t)=>{const i=gi(rN),r=Mt(null),s=Mt(null),{scene:o,camera:a,invalidate:l}=El();Je(e,()=>l());const c=()=>{r.value&&i?.value?.removePass(r.value),s.value?.dispose(),r.value?.dispose()},u=d=>{!a.value||!i?.value||!o.value||(s.value=n(),r.value=new hee(a.value,s.value),i.value.addPass(r.value,d))};t&&Je(()=>t.map(d=>e[d]),()=>{if(!i?.value)return;const d=i.value?.passes.findIndex(f=>f===r.value);~d&&(c(),u(d))}),un(()=>{!a.value||!s?.value||(s.value.mainCamera=a.value)});const h=un(()=>{!a.value||!i?.value||!o.value||(xi(()=>h()),!s.value&&u())});return di(()=>{c()}),{pass:r,effect:s}},sN=/([^[.\]])+/g,pee=(n,e)=>e?(Array.isArray(e)?e:e.match(sN))?.reduce((t,i)=>t&&t[i],n):void 0,GE=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(sN);i&&i.reduce((r,s,o)=>(r[s]===void 0&&(r[s]={}),o===i.length-1&&(r[s]=t),r[s]),n)},oN=(n,e,t,i,r={})=>Je(n,s=>{if(e.value)if(s===void 0){const o=i();GE(e.value,t,pee(o,t)),o.dispose?.()}else GE(e.value,t,n())},r),Dd=(n,e,t)=>n.map(([i,r])=>oN(i,e,r,t)),mee=qe({__name:"BloomPmndrs",props:{blendFunction:{},intensity:{},kernelSize:{},luminanceThreshold:{},luminanceSmoothing:{},mipmapBlur:{type:Boolean,default:void 0}},setup(n,{expose:e}){const t=n,{pass:i,effect:r}=fu(()=>new kE(t),t,["mipmapBlur"]);return e({pass:i,effect:r}),Dd([[()=>t.blendFunction,"blendMode.blendFunction"],[()=>t.intensity,"intensity"],[()=>t.kernelSize,"kernelSize"],[()=>t.luminanceSmoothing,"luminanceMaterial.smoothing"],[()=>t.luminanceThreshold,"luminanceMaterial.threshold"]],r,()=>new kE),()=>{}}}),gee=qe({__name:"DepthOfFieldPmndrs",props:{blendFunction:{},worldFocusDistance:{},worldFocusRange:{},focusDistance:{},focusRange:{},bokehScale:{},resolutionScale:{},resolutionX:{},resolutionY:{}},setup(n,{expose:e}){const t=n,{camera:i}=El(),{pass:r,effect:s}=fu(()=>new UE(i.value,t),t);return e({pass:r,effect:s}),Dd([[()=>t.blendFunction,"blendMode.blendFunction"],[()=>t.worldFocusDistance,"circleOfConfusionMaterial.worldFocusDistance"],[()=>t.focusDistance,"circleOfConfusionMaterial.focusDistance"],[()=>t.worldFocusRange,"circleOfConfusionMaterial.worldFocusRange"],[()=>t.focusRange,"circleOfConfusionMaterial.focusRange"],[()=>t.bokehScale,"bokehScale"],[()=>t.resolutionScale,"blurPass.resolution.scale"],[()=>t.resolutionX,"resolution.width"],[()=>t.resolutionY,"resolution.height"]],s,()=>new UE),()=>{}}}),vee=qe({__name:"VignettePmndrs",props:{technique:{},blendFunction:{},offset:{},darkness:{}},setup(n,{expose:e}){const t=n,{pass:i,effect:r}=fu(()=>new zE(t),t);return e({pass:i,effect:r}),Dd([[()=>t.blendFunction,"blendMode.blendFunction"],[()=>t.offset,"offset"],[()=>t.darkness,"darkness"],[()=>t.technique,"technique"]],r,()=>new zE),()=>{}}}),xee=qe({__name:"ToneMappingPmndrs",props:{mode:{},blendFunction:{},resolution:{},averageLuminance:{},middleGrey:{},minLuminance:{},whitePoint:{}},setup(n,{expose:e}){const t=n,{pass:i,effect:r}=fu(()=>new BE(t),t);return e({pass:i,effect:r}),Dd([[()=>t.mode,"mode"],[()=>t.blendFunction,"blendMode.blendFunction"],[()=>t.resolution,"resolution"],[()=>t.averageLuminance,"averageLuminance"],[()=>t.middleGrey,"middleGrey"],[()=>t.minLuminance,"adaptiveLuminanceMaterial.minLuminance"],[()=>t.whitePoint,"whitePoint"]],r,()=>new BE),()=>{}}}),yee=qe({__name:"ColorAveragePmndrs",props:{blendFunction:{},opacity:{}},setup(n,{expose:e}){const t=n,{pass:i,effect:r}=fu(()=>new ux(t.blendFunction),t);return e({pass:i,effect:r}),oN(()=>t.blendFunction,r,"blendMode.blendFunction",()=>new ux),Je([r,()=>t.opacity],()=>{if(r.value)if(t.opacity!==void 0)r.value?.blendMode.setOpacity(t.opacity);else{const s=new ux;r.value?.blendMode.setOpacity(s.blendMode.getOpacity()),s.dispose()}}),()=>{}}}),_ee=qe({__name:"BrightnessContrastPmndrs",props:{blendFunction:{},brightness:{},contrast:{}},setup(n,{expose:e}){const t=n,{pass:i,effect:r}=fu(()=>new FE(t),t);return e({pass:i,effect:r}),Dd([[()=>t.blendFunction,"blendMode.blendFunction"],[()=>t.brightness,"brightness"],[()=>t.contrast,"contrast"]],r,()=>new FE),()=>{}}});new rs(-1,1,1,-1,0,1);class bee extends At{constructor(){super(),this.setAttribute("position",new it([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new it([0,2,0,0,2,0],2))}}new bee;new de(1/1024,1/512);new de(1/1024,1/512);new de(1/1024,1/512);new We(0);new de(1,0);new de(0,1);const wee={DEFAULT:1,SPRITE:2};class Cs{constructor(e,t,i,r,s="div"){this.parent=e,this.object=t,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("lil-controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("lil-name"),Cs.nextNameID=Cs.nextNameID||0,this.$name.id=`lil-gui-name-${++Cs.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("lil-widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",o=>o.stopPropagation()),this.domElement.addEventListener("keyup",o=>o.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("lil-disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class See extends Cs{constructor(e,t,i){super(e,t,i,"lil-boolean","label"),this.$input
4580=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function $y(n){let e,t;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}const Mee={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:$y,toHexString:$y},nd={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},Tee={isPrimitive:!1,match:n=>Array.isArray(n)||ArrayBuffer.isView(n),fromHexString(n,e,t=1){const i=nd.fromHexString(n);e[0]=(i>>16&255)/255*t,e[1]=(i>>8&255)/255*t,e[2]=(i&255)/255*t},toHexString([n,e,t],i=1){i=255/i;const r=n*i<<16^e*i<<8^t*i<<0;return nd.toHexString(r)}},Eee={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){const i=nd.fromHexString(n);e.r=(i>>16&255)/255*t,e.g=(i>>8&255)/255*t,e.b=(i&255)/255*t},toHexString({r:n,g:e,b:t},i=1){i=255/i;const r=n*i<<16^e*i<<8^t*i<<0;return nd.toHexString(r)}},Aee=[Mee,nd,Tee,Eee];function Cee(n){return Aee.find(e=>e.match(n))}class Ree extends Cs{constructor(e,t,i,r){super(e,t,i,"lil-color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("lil-display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Cee(this.initialValue),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const s=$y(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class hx extends Cs{constructor(e,t,i){super(e,t,i,"lil-function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",r=>{r.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class Pee extends Cs{constructor(e,t,i,r,s,o){super(e,t,i,"lil-number"),this._initInput(),this.min(r),this.max(s);const a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();
4580if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;const t=()=>{let y=parseFloat(this.$input.value);isNaN(y)||(this._stepExplicit&&(y=this._snap(y)),this.setValue(this._clamp(y)))},i=y=>{const x=parseFloat(this.$input.value);isNaN(x)||(this._snapClampSetValue(x+y),this.$input.value=this.getValue())},r=y=>{y.key==="Enter"&&this.$input.blur(),y.code==="ArrowUp"&&(y.preventDefault(),i(this._step*this._arrowKeyMultiplier(y))),y.code==="ArrowDown"&&(y.preventDefault(),i(this._step*this._arrowKeyMultiplier(y)*-1))},s=y=>{this._inputFocused&&(y.preventDefault(),i(this._step*this._normalizeMouseWheel(y)))};let o=!1,a,l,c,u,h;const d=5,f=y=>{a=y.clientX,l=c=y.clientY,o=!0,u=this.getValue(),h=0,window.addEventListener("mousemove",p),window.addEventListener("mouseup",v)},p=y=>{if(o){const x=y.clientX-a,_=y.clientY-l;Math.abs(_)>d?(y.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(x)>d&&v()}if(!o){const x=y.clientY-c;h-=x*this._step*this._arrowKeyMultiplier(y),u+h>this._max?h=this._max-u:u+h<this._min&&(h=this._min-u),this._snapClampSetValue(u+h)}c=y.clientY},v=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",v)},m=()=>{this._inputFocused=!0},g=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",f),this.$input.addEventListener("focus",m),this.$input.addEventListener("blur",g)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("lil-slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("lil-fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("lil-has-slider");const e=(g,y,x,_,T)=>(g-y)/(x-y)*(T-_)+_,t=g=>{const y=this.$slider.getBoundingClientRect();let x=e(g,y.left,y.right,this._min,this._max);this._snapClampSetValue(x)},i=g=>{this._setDraggingStyle(!0),t(g.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)},r=g=>{t(g.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)};let o=!1,a,l;const c=g=>{g.preventDefault(),this._setDraggingStyle(!0),t(g.touches[0].clientX),o=!1},u=g=>{g.touches.length>1||(this._hasScrollBar?(a=g.touches[0].clientX,l=g.touches[0].clientY,o=!0):c(g),window.addEventListener("touchmove",h,{passive:!1}),window.addEventListener("touchend",d))},h=g=>{if(o){const y=g.touches[0].clientX-a,x=g.touches[0].clientY-l;Math.abs(y)>Math.abs(x)?c(g):(window.removeEventListener("touchmove",h),window.removeEventListener("touchend",d))}else g.preventDefault(),t(g.touches[0].clientX)},d=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",h),window.removeEventListener("touchend",d)},f=this._callOnFinishChange.bind(this),p=400;let v;const m=g=>{if(Math.abs(g.deltaX)<Math.abs(g.deltaY)&&this._hasScrollBar)return;g.preventDefault();const x=this._normalizeMouseWheel(g)*this._step;this._snapClampSetValue(this.getValue()+x),this.$input.value=this.getValue(),clearTimeout(v),v=setTimeout(f,p)};this.$slider.addEventListener("mousedown",i),this.$slider.addEventListener("touchstart",u,{passive:!1}),this.$slider.addEventListener("wheel",m,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("lil-active",e),document.body.classList.toggle("lil-dragging",e),document.body.classList.toggle(`lil-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}
4580_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:i}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,i=-e.wheelDelta/120,i*=this._stepExplicit?1:10),t+-i}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=0;return this._hasMin?t=this._min:this._hasMax&&(t=this._max),e-=t,e=Math.round(e/this._step)*this._step,e+=t,e=parseFloat(e.toPrecision(15)),e}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class Iee extends Cs{constructor(e,t,i,r){super(e,t,i,"lil-option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("lil-display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("lil-focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("lil-focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(r)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(t=>{const i=document.createElement("option");i.textContent=t,this.$select.appendChild(i)}),this.updateDisplay(),this}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.textContent=t===-1?e:this._names[t],this}}class Nee extends Cs{constructor(e,t,i){super(e,t,i,"lil-string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",r=>{r.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}var Lee=
vendor: 11,504 bytes, lines 4580-5001
4580`.lil-gui {
4581  font-family: var(--font-family);
4582  font-size: var(--font-size);
4583  line-height: 1;
4584  font-weight: normal;
4585  font-style: normal;
4586  text-align: left;
4587  color: var(--text-color);
4588  user-select: none;
4589  -webkit-user-select: none;
4590  touch-action: manipulation;
4591  --background-color: #1f1f1f;
4592  --text-color: #ebebeb;
4593  --title-background-color: #111111;
4594  --title-text-color: #ebebeb;
4595  --widget-color: #424242;
4596  --hover-color: #4f4f4f;
4597  --focus-color: #595959;
4598  --number-color: #2cc9ff;
4599  --string-color: #a2db3c;
4600  --font-size: 11px;
4601  --input-font-size: 11px;
4602  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
4603  --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;
4604  --padding: 4px;
4605  --spacing: 4px;
4606  --widget-height: 20px;
4607  --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);
4608  --name-width: 45%;
4609  --slider-knob-width: 2px;
4610  --slider-input-width: 27%;
4611  --color-input-width: 27%;
4612  --slider-input-min-width: 45px;
4613  --color-input-min-width: 45px;
4614  --folder-indent: 7px;
4615  --widget-padding: 0 0 0 3px;
4616  --widget-border-radius: 2px;
4617  --checkbox-size: calc(0.75 * var(--widget-height));
4618  --scrollbar-width: 5px;
4619}
4620.lil-gui, .lil-gui * {
4621  box-sizing: border-box;
4622  margin: 0;
4623  padding: 0;
4624}
4625.lil-gui.lil-root {
4626  width: var(--width, 245px);
4627  display: flex;
4628  flex-direction: column;
4629  background: var(--background-color);
4630}
4631.lil-gui.lil-root > .lil-title {
4632  background: var(--title-background-color);
4633  color: var(--title-text-color);
4634}
4635.lil-gui.lil-root > .lil-children {
4636  overflow-x: hidden;
4637  overflow-y: auto;
4638}
4639.lil-gui.lil-root > .lil-children::-webkit-scrollbar {
4640  width: var(--scrollbar-width);
4641  height: var(--scrollbar-width);
4642  background: var(--background-color);
4643}
4644.lil-gui.lil-root > .lil-children::-webkit-scrollbar-thumb {
4645  border-radius: var(--scrollbar-width);
4646  background: var(--focus-color);
4647}
4648@media (pointer: coarse) {
4649  .lil-gui.lil-allow-touch-styles, .lil-gui.lil-allow-touch-styles .lil-gui {
4650    --widget-height: 28px;
4651    --padding: 6px;
4652    --spacing: 6px;
4653    --font-size: 13px;
4654    --input-font-size: 16px;
4655    --folder-indent: 10px;
4656    --scrollbar-width: 7px;
4657    --slider-input-min-width: 50px;
4658    --color-input-min-width: 65px;
4659  }
4660}
4661.lil-gui.lil-force-touch-styles, .lil-gui.lil-force-touch-styles .lil-gui {
4662  --widget-height: 28px;
4663  --padding: 6px;
4664  --spacing: 6px;
4665  --font-size: 13px;
4666  --input-font-size: 16px;
4667  --folder-indent: 10px;
4668  --scrollbar-width: 7px;
4669  --slider-input-min-width: 50px;
4670  --color-input-min-width: 65px;
4671}
4672.lil-gui.lil-auto-place, .lil-gui.autoPlace {
4673  max-height: 100%;
4674  position: fixed;
4675  top: 0;
4676  right: 15px;
4677  z-index: 1001;
4678}
4679
4680.lil-controller {
4681  display: flex;
4682  align-items: center;
4683  padding: 0 var(--padding);
4684  margin: var(--spacing) 0;
4685}
4686.lil-controller.lil-disabled {
4687  opacity: 0.5;
4688}
4689.lil-controller.lil-disabled, .lil-controller.lil-disabled * {
4690  pointer-events: none !important;
4691}
4692.lil-controller > .lil-name {
4693  min-width: var(--name-width);
4694  flex-shrink: 0;
4695  white-space: pre;
4696  padding-right: var(--spacing);
4697  line-height: var(--widget-height);
4698}
4699.lil-controller .lil-widget {
4700  position: relative;
4701  display: flex;
4702  align-items: center;
4703  width: 100%;
4704  min-height: var(--widget-height);
4705}
4706.lil-controller.lil-string input {
4707  color: var(--string-color);
4708}
4709.lil-controller.lil-boolean {
4710  cursor: pointer;
4711}
4712.lil-controller.lil-color .lil-display {
4713  width: 100%;
4714  height: var(--widget-height);
4715  border-radius: var(--widget-border-radius);
4716  position: relative;
4717}
4718@media (hover: hover) {
4719  .lil-controller.lil-color .lil-display:hover:before {
4720    content: " ";
4721    display: block;
4722    position: absolute;
4723    border-radius: var(--widget-border-radius);
4724    border: 1px solid #fff9;
4725    top: 0;
4726    right: 0;
4727    bottom: 0;
4728    left: 0;
4729  }
4730}
4731.lil-controller.lil-color input[type=color] {
4732  opacity: 0;
4733  width: 100%;
4734  height: 100%;
4735  cursor: pointer;
4736}
4737.lil-controller.lil-color input[type=text] {
4738  margin-left: var(--spacing);
4739  font-family: var(--font-family-mono);
4740  min-width: var(--color-input-min-width);
4741  width: var(--color-input-width);
4742  flex-shrink: 0;
4743}
4744.lil-controller.lil-option select {
4745  opacity: 0;
4746  position: absolute;
4747  width: 100%;
4748  max-width: 100%;
4749}
4750.lil-controller.lil-option .lil-display {
4751  position: relative;
4752  pointer-events: none;
4753  border-radius: var(--widget-border-radius);
4754  height: var(--widget-height);
4755  line-height: var(--widget-height);
4756  max-width: 100%;
4757  overflow: hidden;
4758  word-break: break-all;
4759  padding-left: 0.55em;
4760  padding-right: 1.75em;
4761  background: var(--widget-color);
4762}
4763@media (hover: hover) {
4764  .lil-controller.lil-option .lil-display.lil-focus {
4765    background: var(--focus-color);
4766  }
4767}
4768.lil-controller.lil-option .lil-display.lil-active {
4769  background: var(--focus-color);
4770}
4771.lil-controller.lil-option .lil-display:after {
4772  font-family: "lil-gui";
4773  content: "↕";
4774  position: absolute;
4775  top: 0;
4776  right: 0;
4777  bottom: 0;
4778  padding-right: 0.375em;
4779}
4780.lil-controller.lil-option .lil-widget,
4781.lil-controller.lil-option select {
4782  cursor: pointer;
4783}
4784@media (hover: hover) {
4785  .lil-controller.lil-option .lil-widget:hover .lil-display {
4786    background: var(--hover-color);
4787  }
4788}
4789.lil-controller.lil-number input {
4790  color: var(--number-color);
4791}
4792.lil-controller.lil-number.lil-has-slider input {
4793  margin-left: var(--spacing);
4794  width: var(--slider-input-width);
4795  min-width: var(--slider-input-min-width);
4796  flex-shrink: 0;
4797}
4798.lil-controller.lil-number .lil-slider {
4799  width: 100%;
4800  height: var(--widget-height);
4801  background: var(--widget-color);
4802  border-radius: var(--widget-border-radius);
4803  padding-right: var(--slider-knob-width);
4804  overflow: hidden;
4805  cursor: ew-resize;
4806  touch-action: pan-y;
4807}
4808@media (hover: hover) {
4809  .lil-controller.lil-number .lil-slider:hover {
4810    background: var(--hover-color);
4811  }
4812}
4813.lil-controller.lil-number .lil-slider.lil-active {
4814  background: var(--focus-color);
4815}
4816.lil-controller.lil-number .lil-slider.lil-active .lil-fill {
4817  opacity: 0.95;
4818}
4819.lil-controller.lil-number .lil-fill {
4820  height: 100%;
4821  border-right: var(--slider-knob-width) solid var(--number-color);
4822  box-sizing: content-box;
4823}
4824
4825.lil-dragging .lil-gui {
4826  --hover-color: var(--widget-color);
4827}
4828.lil-dragging * {
4829  cursor: ew-resize !important;
4830}
4831.lil-dragging.lil-vertical * {
4832  cursor: ns-resize !important;
4833}
4834
4835.lil-gui .lil-title {
4836  height: var(--title-height);
4837  font-weight: 600;
4838  padding: 0 var(--padding);
4839  width: 100%;
4840  text-align: left;
4841  background: none;
4842  text-decoration-skip: objects;
4843}
4844.lil-gui .lil-title:before {
4845  font-family: "lil-gui";
4846  content: "▾";
4847  padding-right: 2px;
4848  display: inline-block;
4849}
4850.lil-gui .lil-title:active {
4851  background: var(--title-background-color);
4852  opacity: 0.75;
4853}
4854@media (hover: hover) {
4855  body:not(.lil-dragging) .lil-gui .lil-title:hover {
4856    background: var(--title-background-color);
4857    opacity: 0.85;
4858  }
4859  .lil-gui .lil-title:focus {
4860    text-decoration: underline var(--focus-color);
4861  }
4862}
4863.lil-gui.lil-root > .lil-title:focus {
4864  text-decoration: none !important;
4865}
4866.lil-gui.lil-closed > .lil-title:before {
4867  content: "▸";
4868}
4869.lil-gui.lil-closed > .lil-children {
4870  transform: translateY(-7px);
4871  opacity: 0;
4872}
4873.lil-gui.lil-closed:not(.lil-transition) > .lil-children {
4874  display: none;
4875}
4876.lil-gui.lil-transition > .lil-children {
4877  transition-duration: 300ms;
4878  transition-property: height, opacity, transform;
4879  transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);
4880  overflow: hidden;
4881  pointer-events: none;
4882}
4883.lil-gui .lil-children:empty:before {
4884  content: "Empty";
4885  padding: 0 var(--padding);
4886  margin: var(--spacing) 0;
4887  display: block;
4888  height: var(--widget-height);
4889  font-style: italic;
4890  line-height: var(--widget-height);
4891  opacity: 0.5;
4892}
4893.lil-gui.lil-root > .lil-children > .lil-gui > .lil-title {
4894  border: 0 solid var(--widget-color);
4895  border-width: 1px 0;
4896  transition: border-color 300ms;
4897}
4898.lil-gui.lil-root > .lil-children > .lil-gui.lil-closed > .lil-title {
4899  border-bottom-color: transparent;
4900}
4901.lil-gui + .lil-controller {
4902  border-top: 1px solid var(--widget-color);
4903  margin-top: 0;
4904  padding-top: var(--spacing);
4905}
4906.lil-gui .lil-gui .lil-gui > .lil-title {
4907  border: none;
4908}
4909.lil-gui .lil-gui .lil-gui > .lil-children {
4910  border: none;
4911  margin-left: var(--folder-indent);
4912  border-left: 2px solid var(--widget-color);
4913}
4914.lil-gui .lil-gui .lil-controller {
4915  border: none;
4916}
4917
4918.lil-gui label, .lil-gui input, .lil-gui button {
4919  -webkit-tap-highlight-color: transparent;
4920}
4921.lil-gui input {
4922  border: 0;
4923  outline: none;
4924  font-family: var(--font-family);
4925  font-size: var(--input-font-size);
4926  border-radius: var(--widget-border-radius);
4927  height: var(--widget-height);
4928  background: var(--widget-color);
4929  color: var(--text-color);
4930  width: 100%;
4931}
4932@media (hover: hover) {
4933  .lil-gui input:hover {
4934    background: var(--hover-color);
4935  }
4936  .lil-gui input:active {
4937    background: var(--focus-color);
4938  }
4939}
4940.lil-gui input:disabled {
4941  opacity: 1;
4942}
4943.lil-gui input[type=text],
4944.lil-gui input[type=number] {
4945  padding: var(--widget-padding);
4946  -moz-appearance: textfield;
4947}
4948.lil-gui input[type=text]:focus,
4949.lil-gui input[type=number]:focus {
4950  background: var(--focus-color);
4951}
4952.lil-gui input[type=checkbox] {
4953  appearance: none;
4954  width: var(--checkbox-size);
4955  height: var(--checkbox-size);
4956  border-radius: var(--widget-border-radius);
4957  text-align: center;
4958  cursor: pointer;
4959}
4960.lil-gui input[type=checkbox]:checked:before {
4961  font-family: "lil-gui";
4962  content: "✓";
4963  font-size: var(--checkbox-size);
4964  line-height: var(--checkbox-size);
4965}
4966@media (hover: hover) {
4967  .lil-gui input[type=checkbox]:focus {
4968    box-shadow: inset 0 0 0 1px var(--focus-color);
4969  }
4970}
4971.lil-gui button {
4972  outline: none;
4973  cursor: pointer;
4974  font-family: var(--font-family);
4975  font-size: var(--font-size);
4976  color: var(--text-color);
4977  width: 100%;
4978  border: none;
4979}
4980.lil-gui .lil-controller button {
4981  height: var(--widget-height);
4982  text-transform: none;
4983  background: var(--widget-color);
4984  border-radius: var(--widget-border-radius);
4985}
4986@media (hover: hover) {
4987  .lil-gui .lil-controller button:hover {
4988    background: var(--hover-color);
4989  }
4990  .lil-gui .lil-controller button:focus {
4991    box-shadow: inset 0 0 0 1px var(--focus-color);
4992  }
4993}
4994.lil-gui .lil-controller button:active {
4995  background: var(--focus-color);
4996}
4997
4998@font-face {
4999  font-family: "lil-gui";
5000  src: url("data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAALkAAsAAAAABtQAAAKVAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDMgqBBIEbATYCJAMUCwwABCAFhAoHgQQbHAbIDiUFEYVARAAAYQTVWNmz9MxhEgodq49wYRUFKE8GWNiUBxI2LBRaVnc51U83Gmhs0Q7JXWMiz5eteLwrKwuxHO8VFxUX9UpZBs6pa5ABRwHA+t3UxUnH20EvVknRerzQgX6xC/GH6ZUvTcAjAv122dF28OTqCXrPuyaDER30YBA1xnkVutDDo4oCi71Ca7rrV9xS8dZHbPHefsuwIyCpmT7j+MnjAH5X3984UZoFFuJ0yiZ4XEJFxjagEBeqs+e1iyK8Xf/nOuwF+vVK0ur765+vf7txotUi0m3N0m/84RGSrBCNrh8Ee5GjODjF4gnWP+dJrH/Lk9k4oT6d+gr6g/wssA2j64JJGP6cmx554vUZnpZfn6ZfX2bMwPPrlANsB86/DiHjhl0OP+c87+gaJo/gY084s3HoYL/ZkWHTRfBXvvoHnnkHvngKun4KBE/ede7tvq3/vQOxDXB1/fdNz6XbPdcr0Vhpojj9dG+owuSKFsslCi1tgEjirjXdwMiov2EioadxmqTHUCIwo8NgQaeIasAi0fTYSPTbSmwbMOFduyh9wvBrESGY0MtgRjtgQR8Q1bRPohn2UoCRZf9wyYANMXFeJTysqAe0I4mrherOekFdKMrYvJjLvOIUM9SuwYB5DVZUwwVjJJOaUnZCmcEkIZZrKqNvRGRMvmFZsmhP4VMKCSXBhSqUBxgMS7h0cZvEd71AWkEhGWaeMFcNnpqyJkyXgYL7PQ1MoSq0wDAkRtJIijkZSmqYTiSImfLiSWXIZwhRh3Rug2X0kk1Dgj+Iu43u5p98ghopcpSo0Uyc8SnjlYX59WUeaMoDqmVD2TOWD9a4pCRAzf2ECgwGcrHjPOWY9bNxq/OL3I/QjwEAAAA=") format("woff2");
5001}`;
5001function Oee(n){const e=document.createElement("style");e.innerHTML=n;const t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}let WE=!1;class w1{constructor({parent:e,autoPlace:t=e===void 0,container:i,width:r,title:s="Controls",closeFolders:o=!1,injectStyles:a=!0,touchStyles:l=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("button"),this.$title.classList.add("lil-title"),this.$title.setAttribute("aria-expanded",!0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("lil-children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("lil-root"),l&&this.domElement.classList.add("lil-allow-touch-styles"),!WE&&a&&(Oee(Lee),WE=!0),i?i.appendChild(this.domElement):t&&(this.domElement.classList.add("lil-auto-place","autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=o}add(e,t,i,r,s){if(Object(i)===i)return new Iee(this,e,t,i);const o=e[t];switch(typeof o){case"number":return new Pee(this,e,t,i,r,s);case"boolean":return new See(this,e,t);case"string":return new Nee(this,e,t);case"function":return new hx(this,e,t)}console.error(`gui.add failed
5002	property:`,t,`
5003	object:`,e,`
5004	value:`,o)}addColor(e,t,i=1){return new Ree(this,e,t,i)}addFolder(e){const t=new w1({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(i=>{i instanceof hx||i._name in e.controllers&&i.load(e.controllers[i._name])}),t&&e.folders&&this.folders.forEach(i=>{i._title in e.folders&&i.load(e.folders[i._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof hx)){if(i._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);t.controllers[i._name]=i.save()}}),e&&this.folders.forEach(i=>{if(i._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);t.folders[i._title]=i.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("lil-closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("lil-transition");const i=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("lil-transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("lil-closed",!e),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEac
5004h(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}}let Dee=new w1;const kee=()=>({gui:Dee}),Fee={name:"環境設定"},Uee=qe({__name:"environment",setup(n){const{gui:e}=kee(),t=Mn({enabled:!0,intensity:5.5,threshold:.15,smoothing:.3}),i=Mn({enabled:!0,opacity:.15}),r=Mn({enabled:!0,brightness:-.05,contrast:.15}),s=Mn({enabled:!0,darkness:.85,offset:.1}),o={LINEAR:In.LINEAR,REINHARD:In.REINHARD,REINHARD2:In.REINHARD2,REINHARD2_ADAPTIVE:In.REINHARD2_ADAPTIVE,UNCHARTED2:In.UNCHARTED2,CINEON:In.CINEON,ACES_FILMIC:In.ACES_FILMIC,AGX:In.AGX,NEUTRAL:In.NEUTRAL},a=Mn({enabled:!0,mode:o.REINHARD2,averageLuminance:.1,middleGrey:1,whitePoint:100}),l=Mn({enabled:!0,bokehScale:5,focusRange:8,focusDistance:100}),c=Mn({enabled:!0,size:.015,randomness:3,speed:.005,count:60,color:"#ffD39B"});return On(()=>{const u=e.addFolder("Effects"),h=e.addFolder("Particles");u.close(),h.close();const d=u.addFolder("Bloom");d.add(t,"enabled").name("Enabled"),d.add(t,"intensity",0,10,.01),d.add(t,"threshold",0,1,.01),d.add(t,"smoothing",0,1,.01),d.close();const f=u.addFolder("ColorAverage");f.add(i,"enabled").name("Enabled"),f.add(i,"opacity",0,1,.01),f.close();const p=u.addFolder("BrightnessContrast");p.add(r,"enabled").name("Enabled"),p.add(r,"brightness",-1,1,.01),p.add(r,"contrast",-1,1,.01),p.close();const v=u.addFolder("Vignette");v.add(s,"enabled").name("Enabled"),v.add(s,"darkness",0,1,.01),v.add(s,"offset",0,1,.01),v.close();const m=u.addFolder("ToneMapping");m.add(a,"enabled").name("Enabled"),m.add(a,"mode",o).name("Mode"),m.add(a,"averageLuminance",0,2,.01),m.add(a,"middleGrey",0,2,.01),m.add(a,"whitePoint",0,200,1),m.close();const g=u.addFolder("Depth Of Field");g.add(l,"enabled").name("Enabled"),g.add(l,"bokehScale",0,10,.1),g.add(l,"focusRange",0,20,.1),g.add(l,"focusDistance",0,300,1),g.close();const y=h.addFolder("Precipitation");y.add(c,"enabled").name("Enabled"),y.add(c,"size",0,.05,.001),y.add(c,"randomness",0,10,.1),y.add(c,"speed",0,.05,.001),y.add(c,"count",0,200,1),y.addColor(c,"color").name("Color"),y.close()}),mg(()=>{e?.destroy()}),(u,h)=>{const d=FJ,f=mee,p=yee,v=_ee,m=vee,g=xee,y=gee,x=fee;return pe(),pt("TresGroup",Fee,[(pe(),Re(yr,null,{default:Ae(()=>[Ie(L(UJ),{background:!0,files:"/skybox.hdr","background-rotation":[0,-Math.PI*.095,0]},null,8,["background-rotation"])]),_:1})),L(c).enabled?(pe(),Re(d,{key:0,size:L(c).size,randomness:L(c).randomness,speed:L(c).speed,count:L(c).count,color:L(c).color,area:[5,5,5]},null,8,["size","randomness","speed","count","color"])):en("",!0),(pe(),Re(yr,null,{default:Ae(()=>[Ie(x,null,{default:Ae(()=>[Ie(f,{intensity:L(t).enabled?L(t).intensity:0,"luminance-threshold":L(t).threshold,"luminance-smoothing":L(t).smoothing},null,8,["intensity","luminance-threshold","luminance-smoothing"]),Ie(p,{opacity:L(i).enabled?L(i).opacity:0},null,8,["opacity"]),Ie(v,{brightness:L(r).enabled?L(r).brightness:0,contrast:L(r).enabled?L(r).contrast:0},null,8,["brightness","contrast"]),Ie(m,{darkness:L(s).enabled?L(s).darkness:0,offset:L(s).offset},null,8,["darkness","offset"]),Ie(g,{mode:L(a).enabled?L(a).mode:L(In).LINEAR,"average-luminance":L(a).enabled?L(a).averageLuminance:1,"middle-grey":L(a).enabled?L(a).middleGrey:1,"white-point":L(a).enabled?L(a).whitePoint:1},null,8,["mode","average-luminance","middle-grey","white-point"]),Ie(y,{"bokeh-scale":L(l).enabled?L(l).bokehScale:0,"focus-range":L(l).focusRange,"focus-distance":L(l).focusDistance},null,8,["bokeh-scale","focus-range","focus-distance"])]),_:1})]),_:1}))])}}}),Bee=Object.assign(Uee,{__name:"Environment"}),zee=qe({__name:"sprite",props:{part:{},sex:{},set:{},kind:{},type:{},animation:{},position:{default:()=>[0,0,0]}},setup(n){const{onBeforeRender:e}=us(),t=Te(null),i=`/sprites/character/${n.sex}/${n.part}/${n.set}/${n.kind}/${n.type}.png`,r=()=>{xi(()=>{const o=t.value?.instance,a=o?.children[0],l=a?.material?.map,c=s(l);
5004!o||!a||!l||!c||(a.material=c,l.colorSpace=Lt,l.minFilter=on,l.magFilter=on,l.needsUpdate=!0,n.part===Ot.BODY&&(a.castShadow=!0),n.part===Ot.FACE&&(o.position.z=5e-4),n.part===Ot.HAIR_01&&(a.castShadow=!0,o.position.z=.001))})},s=o=>{if(!o)return null;const a=new bd({map:o,alphaTest:.5,metalness:1,roughness:1,transparent:!0,depthWrite:!0,side:Et});return a.onBeforeCompile=l=>{l.uniforms.uTime={value:0},l.vertexShader=l.vertexShader.replace("#include <common>",`
5005          #include <common>
5006          uniform float uTime;
5007        `).replace("#include <begin_vertex>",`
5008            vec3 transformed = vec3(position);
5009            float offset = sin(uTime * 3.0) * 0.01;
5010            float minY = 0.0;
5011            float maxY = 0.25;
5012            float weight = clamp((position.y - minY) / (maxY - minY), 0.0, 1.0);
5013            transformed.y += offset * weight;
5014          `),l.fragmentShader=l.fragmentShader.replace("#include <dithering_fragment>",`
5015        #include <dithering_fragment>
5016        // Bloomだけ抑える擬似テク
5017        gl_FragColor.rgb = mix(gl_FragColor.rgb, gl_FragColor.rgb * 0.1, 0.6); // 彩度維持しつつ暗めに
5018      `),a.userData.shader=l},a};return e(({elapsed:o})=>{const c=t.value?.instance?.children[0]?.material;c?.userData?.shader?.uniforms?.uTime&&(c.userData.shader.uniforms.uTime.value=o)}),(o,a)=>{const l=HP;return pe(),Re(yr,{onResolve:r},{default:Ae(()=>[Ie(l,{ref_key:"spriteRef",ref:t,image:i,atlas:"sprites/character/atlas.json",animation:n.animation,definitions:L(_B),position:n.position,fps:8,loop:!0,"as-sprite":!1},{default:Ae(()=>[lt(o.$slots,"default")]),_:3},8,["animation","definitions","position"])]),_:3})}}}),dx=Object.assign(zee,{__name:"CharacterSprite"}),Vee=["position","layers"],Hee={class:"message"},Gee=qe({__name:"index",props:{id:{},position:{},animation:{},sex:{},parts:{}},setup(n,{expose:e}){const{players:t}=a0(),{latestChat:i}=zP();return ge(()=>Object.values(t.value).findIndex(r=>
5018r.id===n.id)+1),e({animation:n.animation,position:n.position}),(r,s)=>(pe(),pt("TresGroup",{name:"キャラクターグループ",position:n.position,layers:L(wee).SPRITE},[Ie(dx,{part:L(Ot).BODY,sex:n.sex,set:n.parts[L(Ot).BODY].set,kind:n.parts[L(Ot).BODY].kind,type:n.parts[L(Ot).BODY].type,animation:n.animation},{default:Ae(()=>[Ie(dx,{part:L(Ot).FACE,sex:n.sex,set:n.parts[L(Ot).FACE].set,kind:n.parts[L(Ot).FACE].kind,type:n.parts[L(Ot).FACE].type,animation:n.animation,position:[0,0,.001]},null,8,["part","sex","set","kind","type","animation"]),Ie(dx,{part:L(Ot).HAIR_01,sex:n.sex,set:n.parts[L(Ot).HAIR_01].set,kind:n.parts[L(Ot).HAIR_01].kind,type:n.parts[L(Ot).HAIR_01].type,animation:n.animation,position:[0,0,.002]},null,8,["part","sex","set","kind","type","animation"])]),_:1},8,["part","sex","set","kind","type","animation"]),Ie(L(bc),{center:"","distance-factor":4,position:[.25,.65,0],"wrapper-class":"[&>div>div]:pointer-events-none! [&>div>div]:select-none!"},{default:Ae(()=>[Me("div",{class:qt(["fukidashi",{active:L(i)?.peerId===n.id}])},[s[0]||(s[0]=Me("p",{class:"name"}," プレイヤー ",-1)),Me("p",Hee,qi(L(i)?.message??" "),1)],2)]),_:1})],8,Vee))}}),Wee=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},$ee=Object.assign(Wee(Gee,[["__scopeId","data-v-c4c97026"]]),{__name:"Character"});function jy(n){return typeof n=="string"?`'${n}'`:new jee().serialize(n)}const jee=(function(){class n{#e=new Map;compare(t,i){const r=typeof t,s=typeof i;return r==="string"&&s==="string"?t.localeCompare(i):r==="number"&&s==="number"?t-i:String.prototype.localeCompare.call(this.serialize(t,!0),this.serialize(i,!0))}serialize(t,i){if(t===null)return"null";switch(typeof t){case"string":return i?t:`'${t}'`;case"bigint":return`${t}n`;case"object":return this.$object(t);case"function":return this.$function(t)}return String(t)}serializeObject(t){const i=Object.prototype.toString.call(t);if(i!=="[object Object]")return this.serializeBuiltInType(i.length<10?`unknown:${i}`:i.slice(8,-1),t);const r=t.constructor,s=r===Object||r===void 0?"":r.name;if(s!==""&&globalThis[s]===r)return this.serializeBuiltInType(s,t);if(typeof t.toJSON=="function"){const o=t.toJSON();return s+(o!==null&&typeof o=="object"?this.$object(o):`(${this.serialize(o)})`)}return this.serializeObjectEntries(s,Object.entries(t))}serializeBuiltInType(t,i){const r=this["$"+t];if(r)return r.call(this,i);if(typeof i?.entries=="function")return this.serializeObjectEntries(t,i.entries());throw new Error(`Cannot serialize ${t}`)}serializeObjectEntries(t,i){const r=Array.from(i).sort((o,a)=>this.compare(o[0],a[0]));let s=`${t}{`;for(let o=0;o<r.length;o++){const[a,l]=r[o];s+=`${this.serialize(a,!0)}:${this.serialize(l)}`,o<r.length-1&&(s+=",")}return s+"}"}$object(t){let i=this.#e.get(t);return i===void 0&&(this.#e.set(t,`#${this.#e.size}`),i=this.serializeObject(t),this.#e.set(t,i)),i}$function(t){const i=Function.prototype.toString.call(t);return i.slice(-15)==="[native code] }"?`${t.name||""}()[native]`:`${t.name}(${t.length})${i.replace(/\s*\n\s*/g,"")}`}$Array(t){let i="[";for(let r=0;r<t.length;r++)i+=this.serialize(t[r]),r<t.length-1&&(i+=",");return i+"]"}$Date(t){try{return`Date(${t.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(t){return`ArrayBuffer[${new Uint8Array(t).join(",")}]`}$Set(t){return`Set${this.$Array(Array.from(t).sort((i,r)=>this.compare(i,r)))}`}$Map(t){return this.serializeObjectEntries("Map",t.entries())}}for(const e of["Error","RegExp","URL"])n.prototype["$"+e]=function(t){return`${e}(${t})`};for(const e of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])n.prototype["$"+e]=function(t){return`${e}[${t.join(",")}]`};for(const e of["BigInt64Array","BigUint64Array"])n.prototype["$"+e]=function(t){return`${e}[${t.join("n,")}${t.length>0?"n":""}]`};return n})();function aN(n,e){return n===e||jy(n)===jy(e)}function ga(n,e){const t=typeof n=="string"&&!e?`${n}Context`:e,i=Symbol(t);return[o=>{const a=gi(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(n)?`one of the following components: ${n.join(", ")}`:`\`${n}\``}`)},o=>(Mr(i,o),o)]}function Kc(){let n=document.activeElement;if(n==null)return null;for(;n!=null&&n.shadowRoot!=null&&n.shadowRoot.activeElement!=null;)n=n.shadowRoot.activeElement;return n}function lN(n,e,t){const i=t.originalEvent.target,r=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),i.dispatchEvent(r)}function cN(n){return n==null}function S1(n){return n?n.flatMap(e=>e.type===vn?S1(e.children):[e]):[]}const[ele,qee]=ga("ConfigProvider");var Xee=qe({inheritAttrs:!1,__name:"ConfigProvider",props:{dir:{type:String,required:!1,default:"ltr"},locale:{type:String,required:!1,default:"en"},scrollBody:{type:[Boolean,Object],required:!1,default:!0},nonce:{type:String,required:!1,default:void 0},useId:{type:Function,required:!1,default:void 0}},setup(n){const e=n,{dir:t,locale:i,scrollBody:r,nonce:s}
5018=Ar(e);return qee({dir:t,locale:i,scrollBody:r,nonce:s,useId:e.useId}),(o,a)=>lt(o.$slots,"default")}}),Yee=Xee;function Kee(n,e){var t;const i=Mt();return un(()=>{i.value=n()},{...e,flush:(t=void 0)!=null?t:"sync"}),ss(i)}function kd(n){return Jc()?(cg(n),!0):!1}function Zee(){const n=new Set,e=s=>{n.delete(s)};return{on:s=>{n.add(s);const o=()=>e(s);return kd(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(n).map(o=>o(...s))),clear:()=>{n.clear()}}}const pu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Jee=n=>typeof n<"u",Qee=Object.prototype.toString,ete=n=>Qee.call(n)==="[object Object]",tte=()=>{};function fx(n){return Array.isArray(n)?n:[n]}function nte(n,e=1e4){return y_((t,i)=>{let r=tt(n),s;const o=()=>setTimeout(()=>{r=tt(n),i()},tt(e));return kd(()=>{clearTimeout(s)}),{get(){return t(),r},set(a){r=a,i(),clearTimeout(s),s=o()}}})}function M1(n,e,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t,s=Mt(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){s.value=!1,a()}function c(...u){r&&n(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=null,n(...u)},tt(e))}return i&&(s.value=!0,pu&&c()),kd(l),{isPending:ss(s),start:c,stop:l}}function ite(n=1e3,e={}){const{controls:t=!1,callback:i}=e,r=M1(i??tte,n,e),s=ge(()=>!r.isPending.value);return t?{ready:s,...r}:s}function rte(n,e,t){return Je(n,e,{...t,immediate:!0})}const x0=pu?window:void 0;function _l(n){var e;const t=tt(n);return(e=t?.$el)!=null?e:t}function qy(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),r=ge(()=>{const a=fx(tt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),s=rte(()=>{var a,l;return[(l=(a=r.value)==null?void 0:a.map(c=>_l(c)))!=null?l:[x0].filter(c=>c!=null),fx(tt(r.value?n[1]:n[0])),fx(L(r.value?n[2]:n[1])),tt(r.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!a?.length||!l?.length||!c?.length)return;const h=ete(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(f=>c.map(p=>i(d,f,p,h)))))},{flush:"post"}),o=()=>{s(),t()};return kd(t),o}function ste(){const n=Mt(!1),e=Gn();return e&&On(()=>{n.value=!0},e),n}function ote(n){return typeof n=="function"?n:typeof n=="string"?e=>e.key===n:Array.isArray(n)?e=>n.includes(e.key):()=>!0}function T1(...n){let e,t,i={};n.length===3?(e=n[0],t=n[1],i=n[2]):n.length===2?typeof n[1]=="object"?(e=!0,t=n[0],i=n[1]):(e=n[0],t=n[1]):(e=!0,t=n[0]);const{target:r=x0,eventName:s="keydown",passive:o=!1,dedupe:a=!1}=i,l=ote(e);return qy(r,s,u=>{u.repeat&&tt(a)||l(u)&&t(u)},o)}function uN(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:r=x0,once:s=!1}=e,o=Mt(!1),a=ge(()=>i?1e3/tt(i):null);let l=0,c=null;function u(f){if(!o.value||!r)return;l||(l=f);const p=f-l;if(a.value&&p<a.value){c=r.requestAnimationFrame(u);return}if(l=f,n({delta:p,timestamp:f}),s){o.value=!1,c=null;return}c=r.requestAnimationFrame(u)}function h(){!o.value&&r&&(o.value=!0,l=0,c=r.requestAnimationFrame(u))}function d(){o.value=!1,c!=null&&r&&(r.cancelAnimationFrame(c),c=null)}return t&&h(),kd(d),{isActive:ss(o),pause:d,resume:h}}function ate(n){return JSON.parse(JSON.stringify(n))}function Km(n,e,t,i={}){var r,s,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:h,shouldEmit:d}=i,f=Gn(),p=t||f?.emit||((r=f?.$emit)==null?void 0:r.bind(f))||((o=(s=f?.proxy)==null?void 0:s.$emit)==null?void 0:o.bind(f?.proxy));let v=c;e||(e="modelValue"),v=v||`update:${e.toString()}`;const m=x=>a?typeof a=="function"?a(x):ate(x):x,g=()=>Jee(n[e])?m(n[e]):h,y=x=>{d?d(x)&&p(v,x):p(v,x)};if(l){const x=g(),_=Te(x);let T=!1;return Je(()=>n[e],S=>{T||(T=!0,_.value=m(S),xi(()=>T=!1))}),Je(_,S=>{!T&&(S!==n[e]||u)&&y(S)},{deep:u}),_}else return ge({get(){return g()},set(x){y(x)}})}function lte(n){const e=Gn(),t=e?.type.emits,i={};return t?.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),t?.forEach(r=>{i[rh($i(r))]=(...s)=>n(r,...s)}),i}function Un(){const n=Gn(),e=Te(),t=ge(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:_l(e)),i=Object.assign({},n.exposed),r={};for(const o in n.props)Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>n.props[o]});if(Object.keys(i).length>0)for(const o in i)Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>i[o]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>n.vnode.el}),n.exposed=r;function s(o){e.value=o,o&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>o instanceof Element?o:o.$el}),n.exposed=r)}return{forwardRef:s,currentRef:e,currentElement:t}}function Rl(n){const e=Gn(),t=Object.keys(e?.type.props??{}).reduce((r,s)=>{const o=(e?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=or(n);return ge(()=>{const r={},s=e?.vnode.props??{};
5018return Object.keys(s).forEach(o=>{r[$i(o)]=s[o]}),Object.keys({...t,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function y0(n,e){const t=Rl(n),i=e?lte(e):{};return ge(()=>({...t.value,...i}))}function cte(n,e){const t=nte(!1,300),i=Te(null),r=Zee();function s(){i.value=null,t.value=!1}function o(a,l){const c=a.currentTarget,u={x:a.clientX,y:a.clientY},h=ute(u,c.getBoundingClientRect()),d=hte(u,h),f=dte(l.getBoundingClientRect()),p=pte([...d,...f]);i.value=p,t.value=!0}return un(a=>{if(n.value&&e.value){const l=u=>o(u,e.value),c=u=>o(u,n.value);n.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",c),a(()=>{n.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",c)})}}),un(a=>{if(i.value){const l=c=>{if(!i.value||!(c.target instanceof Element))return;const u=c.target,h={x:c.clientX,y:c.clientY},d=n.value?.contains(u)||e.value?.contains(u),f=!fte(h,i.value),p=!!u.closest("[data-grace-area-trigger]");d?s():(f||p)&&(s(),r.trigger())};n.value?.ownerDocument.addEventListener("pointermove",l),a(()=>n.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:t,onPointerExit:r.on}}function ute(n,e){const t=Math.abs(e.top-n.y),i=Math.abs(e.bottom-n.y),r=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,i,r,s)){case s:return"left";case r:return"right";case t:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function hte(n,e,t=5){const i=[];switch(e){case"top":i.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":i.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":i.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":i.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return i}function dte(n){const{top:e,right:t,bottom:i,left:r}=n;return[{x:r,y:e},{x:t,y:e},{x:t,y:i},{x:r,y:i}]}function fte(n,e){const{x:t,y:i}=n;let r=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,l=e[s].y,c=e[o].x,u=e[o].y;l>i!=u>i&&t<(c-a)*(i-l)/(u-l)+a&&(r=!r)}return r}function pte(n){const e=n.slice();return e.sort((t,i)=>t.x<i.x?-1:t.x>i.x?1:t.y<i.y?-1:t.y>i.y?1:0),mte(e)}function mte(n){if(n.length<=1)return n.slice();const e=[];for(let i=0;i<n.length;i++){const r=n[i];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let i=n.length-1;i>=0;i--){const r=n[i];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}function gte(n,e="reka"){return`${e}-${i2?.()}`}function vte(n){const e=Te(),t=ge(()=>e.value?.width??0),i=ge(()=>e.value?.height??0);return On(()=>{const r=_l(n);if(r){e.value={width:r.offsetWidth,height:r.offsetHeight};const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;l=h.inlineSize,c=h.blockSize}else l=r.offsetWidth,c=r.offsetHeight;e.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else e.value=void 0}),{width:t,height:i}}function xte(n,e){const t=Te(n);function i(s){return e[t.value][s]??t.value}return{state:t,dispatch:s=>{t.value=i(s)}}}function yte(n,e){const t=Te({}),i=Te("none"),r=Te(n),s=n.value?"mounted":"unmounted";let o;const a=e.value?.ownerDocument.defaultView??x0,{state:l,dispatch:c}=xte(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{if(pu){const g=new CustomEvent(m,{bubbles:!1,cancelable:!1});e.value?.dispatchEvent(g)}};Je(n,async(m,g)=>{const y=g!==m;if(await xi(),y){const x=i.value,_=lp(e.value);m?(c("MOUNT"),u("enter"),_==="none"&&u("after-enter")):_==="none"||_==="undefined"||t.value?.display==="none"?(c("UNMOUNT"),u("leave"),u("after-leave")):g&&x!==_?(c("ANIMATION_OUT"),u("leave")):(c("UNMOUNT"),u("after-leave"))}},{immediate:!0});const h=m=>{const g=lp(e.value),y=g.includes(CSS.escape(m.animationName)),x=l.value==="mounted"?"enter":"leave";if(m.target===e.value&&y&&(u(`after-${x}`),c("ANIMATION_END"),!r.value)){const _=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",o=a?.setTimeout(()=>{e.value?.style.animationFillMode==="forwards"&&(e.value.style.animationFillMode=_)})}m.target===e.value&&g==="none"&&c("ANIMATION_END")},d=m=>{m.target===e.value&&(i.value=lp(e.value))},f=Je(e,(m,g)=>{m?(t.value=getComputedStyle(m),m.addEventListener("animationstart",d),m.addEventListener("animationcancel",h),m.addEventListener("animationend",h)):(c("ANIMATION_END"),o!==void 0&&a?.clearTimeout(o),g?.removeEventListener("animationstart",d),g?.removeEventListener("animationcancel",h),g?.removeEventListener("animationend",h))},{immediate:!0}),p=Je(l,()=>{const m=lp(e.value);i.value=l.value==="mounted"?m:"none"});return di(()=>{f(),p()}),{isPresent:ge(()=>["mounted","unmountSuspended"].includes(l.value))}}function lp(n){return n&&getComputedStyle(n).animationName||"none"}var hN=qe({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(n,{slots:e,expose:t}){const{present:i,forceMount:r}
5018=Ar(n),s=Te(),{isPresent:o}=yte(i,s);t({present:o});let a=e.default({present:o.value});a=S1(a||[]);const l=Gn();if(a&&a?.length>1){const c=l?.parent?.type.name?`<${l.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for  \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>`  - ${u}`).join(`
5019`)].join(`
5020`))}return()=>r.value||i.value||o.value?Yn(e.default({present:o.value})[0],{ref:c=>{const u=_l(c);return typeof u?.hasAttribute>"u"||(u?.hasAttribute("data-reka-popper-content-wrapper")?s.value=u.firstElementChild:s.value=u),u}}):null}});const id=qe({name:"PrimitiveSlot",inheritAttrs:!1,setup(n,{attrs:e,slots:t}){return()=>{if(!t.default)return null;const i=S1(t.default()),r=i.findIndex(l=>l.type!==ur);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?Rt(e,s.props):e,a=Es({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),_te=["area","img","input"],Zn=qe({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(n,{attrs:e,slots:t}){const i=n.asChild?"template":n.as;return typeof i=="string"&&_te.includes(i)?()=>Yn(i,e):i!=="template"?()=>Yn(n.as,e,{default:t.default}):()=>Yn(id,e,{default:t.default})}});function $E(){const n=Te(),e=ge(()=>["#text","#comment"].includes(n.value?.$el.nodeName)?n.value?.$el.nextElementSibling:_l(n));return{primitiveElement:n,currentElement:e}}const bte="dismissableLayer.pointerDownOutside",wte="dismissableLayer.focusOutside";function dN(n,e){const t=e.closest("[data-dismissable-layer]"),i=n.dataset.dismissableLayer===""?n:n.querySelector("[data-dismissable-layer]"),r=Array.from(n.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&(i===t||r.indexOf(i)<r.indexOf(t)))}function Ste(n,e,t=!0){const i=e?.value?.ownerDocument??globalThis?.document,r=Te(!1),s=Te(()=>{});return un(o=>{if(!pu||!tt(t))return;const a=async c=>{const u=c.target;if(!(!e?.value||!u)){if(dN(e.value,u)){r.value=!1;return}if(c.target&&!r.value){let d=function(){lN(bte,n,h)};const h={originalEvent:c};c.pointerType==="touch"?(i.removeEventListener("click",s.value),s.value=d,i.addEventListener("click",s.value,{once:!0})):d()}else i.removeEventListener("click",s.value);r.value=!1}},l=window.setTimeout(()=>{i.addEventListener("pointerdown",a)},0);o(()=>{window.clearTimeout(l),i.removeEventListener("pointerdown",a),i.removeEventListener("click",s.value)})}),{onPointerDownCapture:()=>{tt(t)&&(r.value=!0)}}}function Mte(n,e,t=!0){const i=e?.value?.ownerDocument??globalThis?.document,r=Te(!1);return un(s=>
5020{if(!pu||!tt(t))return;const o=async a=>{if(!e?.value)return;await xi(),await xi();const l=a.target;!e.value||!l||dN(e.value,l)||a.target&&!r.value&&lN(wte,n,{originalEvent:a})};i.addEventListener("focusin",o),s(()=>i.removeEventListener("focusin",o))}),{onFocusCapture:()=>{tt(t)&&(r.value=!0)},onBlurCapture:()=>{tt(t)&&(r.value=!1)}}}const Xr=Mn({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set});var Tte=qe({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(n,{emit:e}){const t=n,i=e,{forwardRef:r,currentElement:s}=Un(),o=ge(()=>s.value?.ownerDocument??globalThis.document),a=ge(()=>Xr.layersRoot),l=ge(()=>s.value?Array.from(a.value).indexOf(s.value):-1),c=ge(()=>Xr.layersWithOutsidePointerEventsDisabled.size>0),u=ge(()=>{const p=Array.from(a.value),[v]=[...Xr.layersWithOutsidePointerEventsDisabled].slice(-1),m=p.indexOf(v);return l.value>=m}),h=Ste(async p=>{const v=[...Xr.branches].some(m=>m?.contains(p.target));!u.value||v||(i("pointerDownOutside",p),i("interactOutside",p),await xi(),p.defaultPrevented||i("dismiss"))},s),d=Mte(p=>{[...Xr.branches].some(m=>m?.contains(p.target))||(i("focusOutside",p),i("interactOutside",p),p.defaultPrevented||i("dismiss"))},s);T1("Escape",p=>{l.value===a.value.size-1&&(i("escapeKeyDown",p),p.defaultPrevented||i("dismiss"))});let f;return un(p=>{s.value&&(t.disableOutsidePointerEvents&&(Xr.layersWithOutsidePointerEventsDisabled.size===0&&(f=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),Xr.layersWithOutsidePointerEventsDisabled.add(s.value)),a.value.add(s.value),p(()=>{t.disableOutsidePointerEvents&&Xr.layersWithOutsidePointerEventsDisabled.size===1&&(o.value.body.style.pointerEvents=f)}))}),un(p=>{p(()=>{s.value&&(a.value.delete(s.value),Xr.layersWithOutsidePointerEventsDisabled.delete(s.value))})}),(p,v)=>(pe(),Re(L(Zn),{ref:L(r),"as-child":p.asChild,as:p.as,"data-dismissable-layer":"",style:kr({pointerEvents:c.value?u.value?"auto":"none":void 0}),onFocusCapture:L(d).onFocusCapture,onBlurCapture:L(d).onBlurCapture,onPointerdownCapture:L(h).onPointerDownCapture},{default:Ae(()=>[lt(p.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ete=Tte,Ate=qe({__name:"DismissableLayerBranch",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n,{forwardRef:t,currentElement:i}=Un();return On(()=>{Xr.branches.add(i.value)}),di(()=>{Xr.branches.delete(i.value)}),(r,s)=>(pe(),Re(L(Zn),Rt({ref:L(t)},e),{default:Ae(()=>[lt(r.$slots,"default")]),_:3},16))}}),Cte=Ate;function px(n,{select:e=!1}={}){const t=Kc();for(const i of n)if(Ite(i,{select:e}),Kc()!==t)return!0}function Rte(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function Pte(n){return n instanceof HTMLInputElement&&"select"in n}function Ite(n,{select:e=!1}={}){if(n&&n.focus){const t=Kc();n.focus({preventScroll:!0}),n!==t&&Pte(n)&&e&&n.select()}}var Nte=qe({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(n){const e=ste();return(t,i)=>L(e)||t.forceMount?(pe(),Re(t2,{key:0,to:t.to,disabled:t.disabled,defer:t.defer},[lt(t.$slots,"default")],8,["to","disabled","defer"])):en("v-if",!0)}}),fN=Nte;const jE="data-reka-collection-item";function E1(n={}){const{key:e="",isProvider:t=!1}=n,i=`${e}CollectionProvider`;let r;if(t){const u=Te(new Map);r={collectionRef:Te(),itemMap:u},Mr(i,r)}else r=gi(i);const s=(u=!1)=>{const h=r.collectionRef.value;if(!h)return[];const d=Array.from(h.querySelectorAll(`[${jE}]`)),p=Array.from(r.itemMap.value.values()).sort((v,m)=>d.indexOf(v.ref)-d.indexOf(m.ref));return u?p:p.filter(v=>v.ref.dataset.disabled!=="")},o=qe({name:"CollectionSlot",setup(u,{slots:h}){const{primitiveElement:d,currentElement:f}=$E();return Je(f,()=>{r.collectionRef.value=f.value}),()=>Yn(id,{ref:d},h)}}),a=qe({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:h,attrs:d}){const{primitiveElement:f,currentElement:p}=$E();return un(v=>{if(p.value){const m=x_(p.value);r.itemMap.value.set(m,{ref:p.value,value:u.value}),v(()=>r.itemMap.value.delete(m))}}),()=>Yn(id,{...d,[jE]:"",ref:f},h)}}),l=ge(()=>
5020Array.from(r.itemMap.value.values())),c=ge(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var Lte=qe({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(n){return(e,t)=>(pe(),Re(L(Zn),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:Ae(()=>[lt(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),A1=Lte;const[pN,Ote]=ga("PopperRoot");var Dte=qe({inheritAttrs:!1,__name:"PopperRoot",setup(n){const e=Te();return Ote({anchor:e,onAnchorChange:t=>e.value=t}),(t,i)=>lt(t.$slots,"default")}}),kte=Dte,Fte=qe({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n,{forwardRef:t,currentElement:i}=Un(),r=pN();return C2(()=>{r.onAnchorChange(e.reference??i.value)}),(s,o)=>(pe(),Re(L(Zn),{ref:L(t),as:s.as,"as-child":s.asChild},{default:Ae(()=>[lt(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),Ute=Fte;const Bte={key:0,d:"M0 0L6 6L12 0"},zte={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Vte=qe({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(n){const e=n;return Un(),(t,i)=>(pe(),Re(L(Zn),Rt(e,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 12 6",preserveAspectRatio:t.asChild?void 0:"none"}),{default:Ae(()=>[lt(t.$slots,"default",{},()=>[t.rounded?(pe(),pt("path",zte)):(pe(),pt("path",Bte))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Hte=Vte;function Gte(n){return n!==null}function Wte(n){return{name:"transformOrigin",options:n,fn(e){const{placement:t,rects:i,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:n.arrowWidth,l=o?0:n.arrowHeight,[c,u]=Xy(t),h={start:"0%",center:"50%",end:"100%"}[u],d=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+l/2;let p="",v="";return c==="bottom"?(p=o?h:`${d}px`,v=`${-l}px`):c==="top"?(p=o?h:`${d}px`,v=`${i.floating.height+l}px`):c==="right"?(p=`${-l}px`,v=o?h:`${f}px`):c==="left"&&(p=`${i.floating.width+l}px`,v=o?h:`${f}px`),{data:{x:p,y:v}}}}}function Xy(n){const[e,t="center"]=n.split("-");return[e,t]}const $te=["top","right","bottom","left"],sa=Math.min,wr=Math.max,Zm=Math.round,cp=Math.floor,Rs=n=>({x:n,y:n}),jte={left:"right",right:"left",bottom:"top",top:"bottom"},qte={start:"end",end:"start"};function Yy(n,e,t){return wr(n,sa(e,t))}function So(n,e){return typeof n=="function"?n(e):n}function Mo(n){return n.split("-")[0]}function mu(n){return n.split("-")[1]}function C1(n){return n==="x"?"y":"x"}function R1(n){return n==="y"?"height":"width"}const Xte=new Set(["top","bottom"]);function Ms(n){return Xte.has(Mo(n))?"y":"x"}function P1(n){return C1(Ms(n))}function Yte(n,e,t){t===void 0&&(t=!1);const i=mu(n),r=P1(n),s=R1(r);let o=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Jm(o)),[o,Jm(o)]}function Kte(n){const e=Jm(n);return[Ky(n),e,Ky(e)]}function Ky(n){return n.replace(/start|end/g,e=>qte[e])}const qE=["left","right"],XE=["right","left"],Zte=["top","bottom"],Jte=["bottom","top"];function Qte(n,e,t){switch(n){case"top":case"bottom":return t?e?XE:qE:e?qE:XE;case"left":case"right":return e?Zte:Jte;default:return[]}}function ene(n,e,t,i){const r=mu(n);let s=Qte(Mo(n),t==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(Ky)))),s}function Jm(n){return n.replace(/left|right|bottom|top/g,e=>jte[e])}function tne(n){return{top:0,right:0,bottom:0,left:0,...n}}function mN(n){return typeof n!="number"?tne(n):{top:n,right:n,bottom:n,left:n}}function Qm(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function YE(n,e,t){let{reference:i,floating:r}=n;const s=Ms(e),o=P1(e),a=R1(o),l=Mo(e),c=s==="y",u=i.x+i.width/2-r.width/2,h=i.y+i.height/2-r.height/2,d=i[a]/2-r[a]/2;let f;switch(l){case"top":f={x:u,y:i.y-r.height};break;case"bottom":f={x:u,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:h};break;case"left":f={x:i.x-r.width,y:h};break;default:f={x:i.x,y:i.y}}switch(mu(e)){case"start":f[o]-=d*(t&&c?-1:1);break;case"end":f[o]+=d*(t&&c?-1:1);break}return f}const nne=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}
vendor: 16,004 bytes, line 5020
5020=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:n,floating:e,strategy:r}),{x:u,y:h}=YE(c,i,l),d=i,f={},p=0;for(let v=0;v<a.length;v++){const{name:m,fn:g}=a[v],{x:y,y:x,data:_,reset:T}=await g({x:u,y:h,initialPlacement:i,placement:d,strategy:r,middlewareData:f,rects:c,platform:o,elements:{reference:n,floating:e}});u=y??u,h=x??h,f={...f,[m]:{...f[m],..._}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(c=T.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:r}):T.rects),{x:u,y:h}=YE(c,d,l)),v=-1)}return{x:u,y:h,placement:d,strategy:r,middlewareData:f}};async function rd(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:o,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=So(e,n),p=mN(f),m=a[d?h==="floating"?"reference":"floating":h],g=Qm(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(m)))==null||t?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=h==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),_=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},T=Qm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(g.top-T.top+p.top)/_.y,bottom:(T.bottom-g.bottom+p.bottom)/_.y,left:(g.left-T.left+p.left)/_.x,right:(T.right-g.right+p.right)/_.x}}const ine=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=So(n,e)||{};if(c==null)return{};const h=mN(u),d={x:t,y:i},f=P1(r),p=R1(f),v=await o.getDimensions(c),m=f==="y",g=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",_=s.reference[p]+s.reference[f]-d[f]-s.floating[p],T=d[f]-s.reference[f],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let E=S?S[x]:0;(!E||!await(o.isElement==null?void 0:o.isElement(S)))&&(E=a.floating[x]||s.floating[p]);const M=_/2-T/2,b=E/2-v[p]/2-1,w=sa(h[g],b),A=sa(h[y],b),P=w,H=E-v[p]-A,B=E/2-v[p]/2+M,G=Yy(P,B,H),O=!l.arrow&&mu(r)!=null&&B!==G&&s.reference[p]/2-(B<P?w:A)-v[p]/2<0,$=O?B<P?B-P:B-H:0;return{[f]:d[f]+$,data:{[f]:G,centerOffset:B-G-$,...O&&{alignmentOffset:$}},reset:O}}}),rne=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...m}=So(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const g=Mo(r),y=Ms(a),x=Mo(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=d||(x||!v?[Jm(a)]:Kte(a)),S=p!=="none";!d&&S&&T.push(...ene(a,v,p,_));const E=[a,...T],M=await rd(e,m),b=[];let w=((i=s.flip)==null?void 0:i.overflows)||[];if(u&&b.push(M[g]),h){const B=Yte(r,o,_);b.push(M[B[0]],M[B[1]])}if(w=[...w,{placement:r,overflows:b}],!b.every(B=>B<=0)){var A,P;const B=(((A=s.flip)==null?void 0:A.index)||0)+1,G=E[B];if(G&&(!(h==="alignment"?y!==Ms(G):!1)||w.every(F=>Ms(F.placement)===y?F.overflows[0]>0:!0)))return{data:{index:B,overflows:w},reset:{placement:G}};let O=(P=w.filter($=>$.overflows[0]<=0).sort(($,F)=>$.overflows[1]-F.overflows[1])[0])==null?void 0:P.placement;if(!O)switch(f){case"bestFit":{var H;const $=(H=w.filter(F=>{if(S){const J=Ms(F.placement);return J===y||J==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(J=>J>0).reduce((J,se)=>J+se,0)]).sort((F,J)=>F[1]-J[1])[0])==null?void 0:H[0];$&&(O=$);break}case"initialPlacement":O=a;break}if(r!==O)return{reset:{placement:O}}}return{}}}};function KE(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function ZE(n){return $te.some(e=>n[e]>=0)}const sne=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...r}=So(n,e);switch(i){case"referenceHidden":{const s=await rd(e,{...r,elementContext:"reference"}),o=KE(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ZE(o)}}}case"escaped":{const s=await rd(e,{...r,altBoundary:!0}),o=KE(s,t.floating);return{data:{escapedOffsets:o,escaped:ZE(o)}}}default:return{}}}}},gN=new Set(["left","top"]);async function one(n,e){const{placement:t,platform:i,elements:r}=n,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Mo(t),a=mu(t),l=Ms(t)==="y",c=gN.has(o)?-1:1,u=s&&l?-1:1,h=So(e,n);let{mainAxis:d,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:d*c}:{x:d*c,y:f*u}}const ane=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await one(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},lne=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:g,y}=m;return{x:g,y}}},...l}=So(n,e),c={x:t,y:i},u=await rd(e,l),h=Ms(Mo(r)),d=C1(h);let f=c[d],p=c[h];if(s){const m=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=f+u[m],x=f-u[g];f=Yy(y,f,x)}if(o){const m=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=p+u[m],x=p-u[g];p=Yy(y,p,x)}const v=a.fn({...e,[d]:f,[h]:p});return{...v,data:{x:v.x-t,y:v.y-i,enabled:{[d]:s,[h]:o}}}}}},cne=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=So(n,e),u={x:t,y:i},h=Ms(r),d=C1(h);let f=u[d],p=u[h];const v=So(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=d==="y"?"height":"width",_=s.reference[d]-s.floating[x]+m.mainAxis,T=s.reference[d]+s.reference[x]-m.mainAxis;f<_?f=_:f>T&&(f=T)}if(c){var g,y;const x=d==="y"?"width":"height",_=gN.has(Mo(r)),T=s.reference[h]-s.floating[x]+(_&&((g=o.offset)==null?void 0:g[h])||0)+(_?0:m.crossAxis),S=s.reference[h]+s.reference[x]+(_?0:((y=o.offset)==null?void 0:y[h])||0)-(_?m.crossAxis:0);p<T?p=T:p>S&&(p=S)}return{[d]:f,[h]:p}}}},une=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=So(n,e),u=await rd(e,c),h=Mo(r),d=mu(r),f=Ms(r)==="y",{width:p,height:v}=s.floating;let m,g;h==="top"||h==="bottom"?(m=h,g=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,m=d==="end"?"top":"bottom");const y=v-u.top-u.bottom,x=p-u.left-u.right,_=sa(v-u[m],y),T=sa(p-u[g],x),S=!e.middlewareData.shift;let E=_,M=T;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(M=x),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(E=y),S&&!d){const w=wr(u.left,0),A=wr(u.right,0),P=wr(u.top,0),H=wr(u.bottom,0);f?M=p-2*(w!==0||A!==0?w+A:wr(u.left,u.right)):E=v-2*(P!==0||H!==0?P+H:wr(u.top,u.bottom))}await l({...e,availableWidth:M,availableHeight:E});const b=await o.getDimensions(a.floating);return p!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function _0(){return typeof window<"u"}function Pl(n){return I1(n)?(n.nodeName||"").toLowerCase():"#document"}function Er(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function qs(n){var e;return(e=(I1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function I1(n){return _0()?n instanceof Node||n instanceof Er(n).Node:!1}function as(n){return _0()?n instanceof Element||n instanceof Er(n).Element:!1}function Bs(n){return _0()?n instanceof HTMLElement||n instanceof Er(n).HTMLElement:!1}function JE(n){return!_0()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Er(n).ShadowRoot}const hne=new Set(["inline","contents"]);function Fd(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=ls(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!hne.has(r)}const dne=new Set(["table","td","th"]);function fne(n){return dne.has(Pl(n))}const pne=[":popover-open",":modal"];function b0(n){return pne.some(e=>{try{return n.matches(e)}catch{return!1}})}const mne=["transform","translate","scale","rotate","perspective"],gne=["transform","translate","scale","rotate","perspective","filter"],vne=["paint","layout","strict","content"];function N1(n){const e=L1(),t=as(n)?ls(n):n;return mne.some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||gne.some(i=>(t.willChange||"").includes(i))||vne.some(i=>(t.contain||"").includes(i))}function xne(n){let e=oa(n);for(;Bs(e)&&!Zc(e);){if(N1(e))return e;if(b0(e))return null;e=oa(e)}return null}function L1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yne=new Set(["html","body","#document"]);function Zc(n){return yne.has(Pl(n))}function ls(n){return Er(n).getComputedStyle(n)}function w0(n){return as(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function oa(n){if(Pl(n)==="html")return n;const e=n.assignedSlot||n.parentNode||JE(n)&&n.host||qs(n);return JE(e)?e.host:e}function vN(n){const e=oa(n);return Zc(e)?n.ownerDocument?n.ownerDocument.body:n.body:Bs(e)&&Fd(e)?e:vN(e)}function sd(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=vN(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),o=Er(r);if(s){const a=Zy(o);return e.concat(o,o.visualViewport||[],Fd(r)?r:[],a&&t?sd(a):[])}return e.concat(r,sd(r,[],t))}function Zy(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xN(n){const e=ls(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Bs(n),s=r?n.offsetWidth:t,o=r?n.offsetHeight:i,a=Zm(t)!==s||Zm(i)!==o;return a&&(t=s,i=o),{width:t,height:i,$:a}}function O1(n){return as(n)?n:n.contextElement}function Nc(n){const e=O1(n);if(!Bs(e))return Rs(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=xN(e);let o=(s?Zm(t.width):t.width)/i,a=(s?Zm(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const _ne=Rs(0);function yN(n){const e=Er(n);return!L1()||!e.visualViewport?_ne:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bne(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Er(n)?!1:e}function bl(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),s=O1(n);let o=Rs(1);e&&(i?as(i)&&(o=Nc(i)):o=Nc(n));const a=bne(s,t,i)?yN(s):Rs(0);let l=(r.left+a.x)/o.x,c=(r.top+a.y)/o.y,u=r.width/o.x,h=r.height/o.y;if(s){const d=Er(s),f=i&&as(i)?Er(i):i;let p=d,v=Zy(p);for(;v&&i&&f!==p;){const m=Nc(v),g=v.getBoundingClientRect(),y=ls(v),x=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,_=g.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,h*=m.y,l+=x,c+=_,p=Er(v),v=Zy(p)}}return Qm({width:u,height:h,x:l,y:c})}function S0(n,e){const t=w0(n).scrollLeft;return e?e.left+t:bl(qs(n)).left+t}function _N(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-S0(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function wne(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const s=r==="fixed",o=qs(i),a=e?b0(e.floating):!1;if(i===o||a&&s)return t;let l={scrollLeft:0,scrollTop:0},c=Rs(1);const u=Rs(0),h=Bs(i);if((h||!h&&!s)&&((Pl(i)!=="body"||Fd(o))&&(l=w0(i)),Bs(i))){const f=bl(i);c=Nc(i),u.x=f.x+i.clientLeft,u.y=f.y+i.clientTop}const d=o&&!h&&!s?_N(o,l):Rs(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:t.y*c.y-l.scrollTop*c.y+u.y+d.y}}function Sne(n){return Array.from(n.getClientRects())}function Mne(n){const e=qs(n),t=w0(n),i=n.ownerDocument.body,r=wr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=wr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-t.scrollLeft+S0(n);const a=-t.scrollTop;return ls(i).direction==="rtl"&&(o+=wr(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}const QE=25;function Tne(n,e){const t=Er(n),i=qs(n),r=t.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const u=L1();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=S0(i);if(c<=0){const u=i.ownerDocument,h=u.body,d=getComputedStyle(h),f=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(i.clientWidth-h.clientWidth-f);p<=QE&&(s-=p)}else c<=QE&&(s+=c);return{width:s,height:o,x:a,y:l}}const Ene=new Set(["absolute","fixed"]);function Ane(n,e){const t=bl(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,s=Bs(n)?Nc(n):Rs(1),o=n.clientWidth*s.x,a=n.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:o,height:a,x:l,y:c}}function eA(n,e,t){let i;if(e==="viewport")i=Tne(n,t);else if(e==="document")i=Mne(qs(n));else if(as(e))i=Ane(e,t);else{const r=yN(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Qm(i)}function bN(n,e){const t=oa(n);return t===e||!as(t)||Zc(t)?!1:ls(t).position==="fixed"||bN(t,e)}function Cne(n,e){const t=e.get(n);if(t)return t;let i=sd(n,[],!1).filter(a=>as(a)&&Pl(a)!=="body"),r=null;const s=ls(n).position==="fixed";let o=s?oa(n):n;for(;as(o)&&!Zc(o);){const a=ls(o),l=N1(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&Ene.has(r.position)||Fd(o)&&!l&&bN(n,o))?i=i.filter(u=>u!==o):r=a,o=oa(o)}return e.set(n,i),i}function Rne(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const o=[...t==="clippingAncestors"?b0(e)?[]:Cne(e,this._c):[].concat(t),i],a=o[0],l=o.reduce((c,u)=>{const h=eA(e,u,r);return c.top=wr(h.top,c.top),c.right=sa(h.right,c.right),c.bottom=sa(h.bottom,c.bottom),c.left=wr(h.left,c.left),c},eA(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Pne(n){const{width:e,height:t}=xN(n);return{width:e,height:t}}function Ine(n,e,t){const i=Bs(e),r=qs(e),s=t==="fixed",o=bl(n,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Rs(0);function c(){l.x=S0(r)}if(i||!i&&!s)if((Pl(e)!=="body"||Fd(r))&&(a=w0(e)),i){const f=bl(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&c();s&&!i&&r&&c();const u=r&&!i&&!s?_N(r,a):Rs(0),h=o.left+a.scrollLeft-l.x-u.x,d=o.top+a.scrollTop-l.y-u.y;return{x:h,y:d,width:o.width,height:o.height}}function mx(n){return ls(n).position==="static"}function tA(n,e){if(!Bs(n)||ls(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return qs(n)===t&&(t=t.ownerDocument.body),t}function wN(n,e){const t=Er(n);if(b0(n))return t;if(!Bs(n)){let r=oa(n);for(;r&&!Zc(r);){if(as(r)&&!mx(r))return r;r=oa(r)}return t}let i=tA(n,e);for(;i&&fne(i)&&mx(i);)i=tA(i,e);return i&&Zc(i)&&mx(i)&&!N1(i)?t:i||xne(n)||t}const Nne=async function(n){const e=this.getOffsetParent||wN,t=this.getDimensions,i=await t(n.floating);return{reference:Ine(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Lne(n){return ls(n).direction==="rtl"}const One={convertOffsetParentRelativeRectToViewportRelativeRect:wne,getDocumentElement:qs,getClippingRect:Rne,getOffsetParent:wN,getElementRects:Nne,getClientRects:Sne,getDimensions:Pne,getScale:Nc,isElement:as,isRTL:Lne};function SN(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function Dne(n,e){let t=null,i;const r=qs(n);function s(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=n.getBoundingClientRect(),{left:u,top:h,width:d,height:f}=c;if(a||e(),!d||!f)return;
vendor: 2,047 bytes, line 5020
5020const p=cp(h),v=cp(r.clientWidth-(u+d)),m=cp(r.clientHeight-(h+f)),g=cp(u),x={rootMargin:-p+"px "+-v+"px "+-m+"px "+-g+"px",threshold:wr(0,sa(1,l))||1};let _=!0;function T(S){const E=S[0].intersectionRatio;if(E!==l){if(!_)return o();E?o(!1,E):i=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!SN(c,n.getBoundingClientRect())&&o(),_=!1}try{t=new IntersectionObserver(T,{...x,root:r.ownerDocument})}catch{t=new IntersectionObserver(T,x)}t.observe(n)}return o(!0),s}function kne(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=O1(n),u=r||s?[...c?sd(c):[],...sd(e)]:[];u.forEach(g=>{r&&g.addEventListener("scroll",t,{passive:!0}),s&&g.addEventListener("resize",t)});const h=c&&a?Dne(c,t):null;let d=-1,f=null;o&&(f=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),t()}),c&&!l&&f.observe(c),f.observe(e));let p,v=l?bl(n):null;l&&m();function m(){const g=bl(n);v&&!SN(v,g)&&t(),v=g,p=requestAnimationFrame(m)}return t(),()=>{var g;u.forEach(y=>{r&&y.removeEventListener("scroll",t),s&&y.removeEventListener("resize",t)}),h?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Fne=ane,Une=lne,nA=rne,Bne=une,zne=sne,Vne=ine,Hne=cne,Gne=(n,e,t)=>{const i=new Map,r={platform:One,...t},s={...r.platform,_c:i};return nne(n,e,{...r,platform:s})};function Wne(n){return n!=null&&typeof n=="object"&&"$el"in n}function Jy(n){if(Wne(n)){const e=n.$el;return I1(e)&&Pl(e)==="#comment"?null:e}return n}function pc(n){return typeof n=="function"?n():L(n)}function $ne(n){return{name:"arrow",options:n,fn(e){const t=Jy(pc(n.element));return t==null?{}:Vne({element:t,padding:n.padding}).fn(e)}}}function MN(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function iA(n,e){const t=MN(n);return Math.round(e*t)/t}function jne(n,e,t){t===void 0&&(t={});
5020const i=t.whileElementsMounted,r=ge(()=>{var E;return(E=pc(t.open))!=null?E:!0}),s=ge(()=>pc(t.middleware)),o=ge(()=>{var E;return(E=pc(t.placement))!=null?E:"bottom"}),a=ge(()=>{var E;return(E=pc(t.strategy))!=null?E:"absolute"}),l=ge(()=>{var E;return(E=pc(t.transform))!=null?E:!0}),c=ge(()=>Jy(n.value)),u=ge(()=>Jy(e.value)),h=Te(0),d=Te(0),f=Te(a.value),p=Te(o.value),v=Mt({}),m=Te(!1),g=ge(()=>{const E={position:f.value,left:"0",top:"0"};if(!u.value)return E;const M=iA(u.value,h.value),b=iA(u.value,d.value);return l.value?{...E,transform:"translate("+M+"px, "+b+"px)",...MN(u.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:b+"px"}});let y;function x(){if(c.value==null||u.value==null)return;const E=r.value;Gne(c.value,u.value,{middleware:s.value,placement:o.value,strategy:a.value}).then(M=>{h.value=M.x,d.value=M.y,f.value=M.strategy,p.value=M.placement,v.value=M.middlewareData,m.value=E!==!1})}function _(){typeof y=="function"&&(y(),y=void 0)}function T(){if(_(),i===void 0){x();return}if(c.value!=null&&u.value!=null){y=i(c.value,u.value,x);return}}function S(){r.value||(m.value=!1)}return Je([s,o,a,r],x,{flush:"sync"}),Je([c,u],T,{flush:"sync"}),Je(r,S,{flush:"sync"}),Jc()&&cg(_),{x:ao(h),y:ao(d),strategy:ao(f),placement:ao(p),middlewareData:ao(v),isPositioned:ao(m),floatingStyles:g,update:x}}const qne={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[Xne,Yne]=ga("PopperContent");var Kne=qe({inheritAttrs:!1,__name:"PopperContent",props:yO({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...qne}),emits:["placed"],setup(n,{emit:e}){const t=n,i=e,r=pN(),{forwardRef:s,currentElement:o}=Un(),a=Te(),l=Te(),{width:c,height:u}=vte(l),h=ge(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),d=ge(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),f=ge(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),p=ge(()=>({padding:d.value,boundary:f.value.filter(Gte),altBoundary:f.value.length>0})),v=ge(()=>({mainAxis:t.sideFlip,crossAxis:t.alignFlip})),m=Kee(()=>[Fne({mainAxis:t.sideOffset+u.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&nA({...p.value,...v.value}),t.avoidCollisions&&Une({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?Hne():void 0,...p.value}),!t.prioritizePosition&&t.avoidCollisions&&nA({...p.value,...v.value}
5020),Bne({...p.value,apply:({elements:P,rects:H,availableWidth:B,availableHeight:G})=>{const{width:O,height:$}=H.reference,F=P.floating.style;F.setProperty("--reka-popper-available-width",`${B}px`),F.setProperty("--reka-popper-available-height",`${G}px`),F.setProperty("--reka-popper-anchor-width",`${O}px`),F.setProperty("--reka-popper-anchor-height",`${$}px`)}}),l.value&&$ne({element:l.value,padding:t.arrowPadding}),Wte({arrowWidth:c.value,arrowHeight:u.value}),t.hideWhenDetached&&zne({strategy:"referenceHidden",...p.value})]),g=ge(()=>t.reference??r.anchor.value),{floatingStyles:y,placement:x,isPositioned:_,middlewareData:T}=jne(g,a,{strategy:t.positionStrategy,placement:h,whileElementsMounted:(...P)=>kne(...P,{layoutShift:!t.disableUpdateOnLayoutShift,animationFrame:t.updatePositionStrategy==="always"}),middleware:m}),S=ge(()=>Xy(x.value)[0]),E=ge(()=>Xy(x.value)[1]);C2(()=>{_.value&&i("placed")});const M=ge(()=>T.value.arrow?.centerOffset!==0),b=Te("");un(()=>{o.value&&(b.value=window.getComputedStyle(o.value).zIndex)});const w=ge(()=>T.value.arrow?.x??0),A=ge(()=>T.value.arrow?.y??0);return Yne({placedSide:S,onArrowChange:P=>l.value=P,arrowX:w,arrowY:A,shouldHideArrow:M}),(P,H)=>
5020(pe(),pt("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:kr({...L(y),transform:L(_)?L(y).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:b.value,"--reka-popper-transform-origin":[L(T).transformOrigin?.x,L(T).transformOrigin?.y].join(" "),...L(T).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[Ie(L(Zn),Rt({ref:L(s)},P.$attrs,{"as-child":t.asChild,as:P.as,"data-side":S.value,"data-align":E.value,style:{animation:L(_)?void 0:"none"}}),{default:Ae(()=>[lt(P.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Zne=Kne;const Jne={top:"bottom",right:"left",bottom:"top",left:"right"};var Qne=qe({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(n){const{forwardRef:e}=Un(),t=Xne(),i=ge(()=>Jne[t.placedSide.value]);return(r,s)=>(pe(),pt("span",{ref:o=>{L(t).onArrowChange(o)},style:kr({position:"absolute",left:L(t).arrowX?.value?`${L(t).arrowX?.value}px`:void 0,top:L(t).arrowY?.value?`${L(t).arrowY?.value}px`:void 0,[i.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[L(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[L(t).placedSide.value],visibility:L(t).shouldHideArrow.value?"hidden":void 0})},[Ie(Hte,Rt(r.$attrs,{ref:L(e),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:Ae(()=>[lt(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),eie=Qne;const od=100,[tie,nie]=ga("ProgressRoot"),eg=n=>typeof n=="number";function iie(n,e){return cN(n)||eg(n)&&!Number.isNaN(n)&&n<=e&&n>=0?n:(console.error(`Invalid prop \`value\` of value \`${n}\` supplied to \`ProgressRoot\`. The \`value\` prop must be:
5021  - a positive number
5022  - less than the value passed to \`max\` (or ${od} if no \`max\` prop is set)
5023  - \`null\`  or \`undefined\` if the progress is indeterminate.
5024
5025Defaulting to \`null\`.`),null)}function rie(n){return eg(n)&&!Number.isNaN(n)&&n>0?n:(console.error(`Invalid prop \`max\` of value \`${n}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${od}\`.`),od)}var sie=qe({__name:"ProgressRoot",props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:od},getValueLabel:{type:Function,required:!1,default:(n,e)=>eg(n)?`${Math.round(n/e*od)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue","update:max"],setup(n,{emit:e}){const t=n,i=e;Un();const r=Km(t,"modelValue",i,{passive:t.modelValue===void 0}),s=Km(t,"max",i,{passive:t.max===void 0});Je(()=>r.value,async a=>{const l=iie(a,t.max);l!==a&&(await xi(),r.value=l)},{immediate:!0}),Je(()=>t.max,a=>{const l=rie(t.max);l!==a&&(s.value=l)},{immediate:!0});const o=ge(()=>cN(r.value)?"indeterminate":r.value===s.value?"complete":"loading");return nie({modelValue:r,max:s,progressState:o}),(a,l)=>(pe(),Re(L(Zn),{"as-child":a.asChild,as:a.as,"aria-valuemax":L(s),"aria-valuemin":0,"aria-valuenow":eg(L(r))?L(r):void 0,"aria-valuetext":a.getValueText?.(L(r),L(s)),"aria-label":a.getValueLabel(L(r),L(s)),role:"progressbar","data-state":o.value,"data-value":L(r)??void 0,"data-max":L(s)},{default:Ae(()=>[lt(a.$slots,"default",{modelValue:L(r)})]),_:3},8,["as-child","as","aria-valuemax","aria-valuenow","aria-valuetext","aria-label","data-state","data-value","data-max"]))}}),oie=sie,aie=qe({__name:"ProgressIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n,t=tie();return Un(),(i,r)=>(pe(),Re(L(Zn),Rt(e,{"data-state":L(t).progressState.value,"data-value":L(t).modelValue?.value??void 0,"data-max":L(t).max.value}),{default:Ae(()=>[lt(i.$slots,"default")]),_:3},16,["data-state","data-value","data-max"]))}}),lie=aie,cie=qe({__name:"ToastAnnounceExclude",props:{altText:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){return(e,t)=>(pe(),Re(L(Zn),{as:e.as,"as-child":e.asChild,"data-reka-toast-announce-exclude":"","data-reka-toast-announce-alt":e.altText||void 0},{default:Ae(()=>[lt(e.$slots,"default")]),_:3},8,["as","as-child","data-reka-toast-announce-alt"]))}}),TN=cie;const[M0,uie]=ga("ToastProvider");var hie=qe({inheritAttrs:!1,__name:"ToastProvider",props:{label:{type:String,required:!1,default:"Notification"},duration:{type:Number,required:!1,default:5e3},disableSwipe:{type:Boolean,required:!1},swipeDirection:{type:String,required:!1,default:"right"},swipeThreshold:{type:Number,required:!1,default:50}}
5025,setup(n){const e=n,{label:t,duration:i,disableSwipe:r,swipeDirection:s,swipeThreshold:o}=Ar(e);E1({isProvider:!0});const a=Te(),l=Te(0),c=Te(!1),u=Te(!1);if(e.label&&typeof e.label=="string"&&!e.label.trim()){const h="Invalid prop `label` supplied to `ToastProvider`. Expected non-empty `string`.";throw new Error(h)}return uie({label:t,duration:i,disableSwipe:r,swipeDirection:s,swipeThreshold:o,toastCount:l,viewport:a,onViewportChange(h){a.value=h},onToastAdd(){l.value++},onToastRemove(){l.value--},isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:u}),(h,d)=>lt(h.$slots,"default")}}),die=hie,fie=qe({__name:"ToastAnnounce",setup(n){const e=M0(),t=ite(1e3),i=Te(!1);return uN(()=>{i.value=!0}),(r,s)=>L(t)||i.value?(pe(),Re(L(A1),{key:0},{default:Ae(()=>[os(qi(L(e).label.value)+" ",1),lt(r.$slots,"default")]),_:3})):en("v-if",!0)}}),pie=fie;const mie="toast.swipeStart",gie="toast.swipeMove",vie="toast.swipeCancel",xie="toast.swipeEnd",Qy="toast.viewportPause",e_="toast.viewportResume";function up(n,e,t){const i=t.originalEvent.currentTarget,r=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),i.dispatchEvent(r)}function rA(n,e,t=0){const i=Math.abs(n.x),r=Math.abs(n.y),s=i>r;return e==="left"||e==="right"?s&&i>t:!s&&r>t}function yie(n){return n.nodeType===n.ELEMENT_NODE}function EN(n){const e=[];return Array.from(n.childNodes).forEach(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent&&e.push(i.textContent),yie(i)){const r=i.ariaHidden||i.hidden||i.style.display==="none",s=i.dataset.rekaToastAnnounceExclude==="";if(!r)if(s){const o=i.dataset.rekaToastAnnounceAlt;o&&e.push(o)}else e.push(...EN(i))}}),e}const[_ie,bie]=ga("ToastRoot");var wie=qe({inheritAttrs:!1,__name:"ToastRootImpl",props:{type:{type:String,required:!1},open:{type:Boolean,required:!1,default:!1},duration:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"li"}},emits:["close","escapeKeyDown","pause","resume","swipeStart","swipeMove","swipeCancel","swipeEnd"],setup(n,{emit:e}){const t=n,i=e,{forwardRef:r,currentElement:s}=Un(),{CollectionItem:o}=E1(),a=M0(),l=Te(null),c=Te(null),u=ge(()=>typeof t.duration=="number"?t.duration:a.duration.value),h=Te(0),d=Te(u.value),f=Te(0),p=Te(u.value),v=uN(()=>{const x=new Date().getTime()-h.value;p.value=Math.max(d.value-x,0)},{fpsLimit:60});function m(x){x<=0||x===Number.POSITIVE_INFINITY||pu&&(window.clearTimeout(f.value),h.value=new Date().getTime(),f.value=window.setTimeout(g,x))}function g(x){const _=x?.pointerType==="";s.value?.contains(Kc())&&_&&a.viewport.value?.focus(),_&&(a.isClosePausedRef.value=!1),i("close")}const y=ge(()=>s.value?EN(s.value):null);if(t.type&&!["foreground","background"].includes(t.type)){const x="Invalid prop `type` supplied to `Toast`. Expected `foreground | background`.";throw new Error(x)}return un(x=>{const _=a.viewport.value;if(_){const T=()=>{m(d.value),v.resume(),i("resume")},S=()=>{const E=new Date().getTime()-h.value;d.value=d.value-E,window.clearTimeout(f.value),v.pause(),i("pause")};return _.addEventListener(Qy,S),_.addEventListener(e_,T),()=>{_.removeEventListener(Qy,S),_.removeEventListener(e_,T)}}}),Je(()=>[t.open,u.value],()=>{d.value=u.value,t.open&&!a.isClosePausedRef.value&&m(u.value)},{immediate:!0}),T1("Escape",x=>{i("escapeKeyDown",x),x.defaultPrevented||(a.isFocusedToastEscapeKeyDownRef.value=!0,g())}),On(()=>{a.onToastAdd()}),di(()=>{a.onToastRemove()}),bie({onClose:g}),(x,_)=>(pe(),pt(vn,null,[y.value?(pe(),Re(pie,{key:0,role:"alert","aria-live":x.type==="foreground"?"assertive":"polite","aria-atomic":"true"},{default:Ae(()=>[os(qi(y.value),1)]),_:1},8,["aria-live"])):en("v-if",!0),L(a).viewport.value?(pe(),Re(t2,{key:1,to:L(a).viewport.value},[Ie(L(o),null,{default:Ae(()=>[Ie(L(Zn),Rt({ref:L(r),role:"alert","aria-live":"off","aria-atomic":"true",tabindex:"0"},x.$attrs,{as:x.as,"as-child":x.asChild,"data-state":x.open?"open":"closed","data-swipe-direction":L(a).swipeDirection.value,style:L(a).disableSwipe.value?void 0:{userSelect:"none",touchAction:"none"},onPointerdown:_[0]||(_[0]=hh(T=>{L(a).disableSwipe.value||(l.value={x:T.clientX,y:T.clientY})},["left"])),onPointermove:_[1]||(_[1]=T=>{if(L(a).disableSwipe.value||!l.value)return;const S=T.clientX-l.value.x,E=T.clientY-l.value.y,M=!!c.value,b=["left","right"].includes(L(a).swipeDirection.value),w=["left","up"].includes(L(a).swipeDirection.value)?Math.min:Math.max,A=b?w(0,S):0,P=b?0:w(0,E),H=T.pointerType==="touch"?10:2,B={x:A,y:P},G={originalEvent:T,delta:B};M?(c.value=B,L(up)(L(gie),O=>i("swipeMove",O),G)):L(rA)(B,L(a).swipeDirection.value,H)?(c.value=B,L(up)(L(mie),O=>i("swipeStart",O),G),T.target.setPointerCapture(T.pointerId)):(Math.abs(S)>H||Math.abs(E)>H)&&(l.value=null)}),onPointerup:_[2]||(_[2]=T=>{if(L(a).disableSwipe.value)return;const S=c.value,E=T.target;if(E.hasPointerCapture(T.pointerId)&&E.releasePointerCapture(T.pointerId),c.value=null,l.value=null,S){const M=T.currentTarget,b={originalEvent:T,delta:S};L(rA)(S,L(a).swipeDirection.value,L(a).swipeThreshold.value)?L(up)(L(xie),w=>i("swipeEnd",w),b):L(up)(L(vie),w=>i("swipeCancel",w),b),M?.addEventListener("click",w=>w.preventDefault(),{once:!0})}})}),{default:Ae(()=>[lt(x.$slots,"default",{remaining:p.value,duration:u.value})]),_:3},16,["as","as-child","data-state","data-swipe-direction","style"])]),_:3})],8,["to"])):en("v-if",!0)],64))}}),Sie=wie,Mie=qe({__name:"ToastClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=_ie(),{forwardRef:i}=Un();return(r,s)=>(pe(),Re(TN,{"as-child":""},{default:Ae(()=>[Ie(L(Zn),Rt(e,{ref:L(i),type:r.as==="button"?"button":void 0,onClick:L(t).onClose}),{default:Ae(()=>[lt(r.$slots,"default")]),_:3},16,["type","onClick"])]),_:3}))}}),AN=Mie,Tie=qe({__name:"ToastAction",props:{altText:{type:String,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){if(!n.altText)throw new Error("Missing prop `altText` expected on `ToastAction`");const{forwardRef:t}=Un();return(i,r)=>i.altText?(pe(),Re(TN,{key:0,"alt-text":i.altText,"as-child":""},{default:Ae(()=>[Ie(AN,{ref:L(t),as:i.as,"as-child":i.asChild},{default:Ae(()=>[lt(i.$slots,"default")]),_:3},8,["as","as-child"])]),_:3},8,["alt-text"])):en("v-if",!0)}}),sA=Tie,Eie=qe({__name:"ToastDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return Un(),(t,i)=>(pe(),Re(L(Zn),ji(Ur(e)),{default:Ae(()=>[lt(t.$slots,"default")]),_:3},16))}}),Aie=Eie,Cie=qe({__name:"ToastPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(n){const e=n;return(t,i)=>(pe(),Re(L(fN),ji(Ur(e)),{default:Ae(()=>[lt(t.$slots,"default")]),_:3},16))}}),Rie=Cie,Pie=qe({__name:"ToastRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!0},forceMount:{type:Boolean,required:!1},type:{type:String,required:!1,default:"foreground"},open:{type:Boolean,required:!1,default:void 0},duration:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"li"}},emits:["escapeKeyDown","pause","resume","swipeStart","swipeMove","swipeCancel","swipeEnd","update:open"],setup(n,{emit:e}){const t=n,i=e,{forwardRef:r}=Un(),s=Km(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0});return(o,a)=>(pe(),Re(L(hN),{present:o.forceMount||L(s)},{default:Ae(()=>[Ie(Sie,Rt({ref:L(r),open:L(s),type:o.type,as:o.as,"as-child":o.asChild,duration:o.duration},o.$attrs,{onClose:a[0]||(a[0]=l=>s.value=!1),onPause:a[1]||(a[1]=l=>i("pause")),onResume:a[2]||(a[2]=l=>i("resume")),onEscapeKeyDown:a[3]||(a[3]=l=>i("escapeKeyDown",l)),onSwipeStart:a[4]||(a[4]=l=>{i("swipeStart",l),l.defaultPrevented||l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:a[5]||(a[5]=l=>{if(i("swipeMove",l),!l.defaultPrevented){const{x:c,y:u}=l.detail.delta,h=l.currentTarget;h.setAttribute("data-swipe","move"),h.style.setProperty("--reka-toast-swipe-move-x",`${c}px`),h.style.setProperty("--reka-toast-swipe-move-y",`${u}px`)}}),onSwipeCancel:a[6]||(a[6]=l=>{if(i("swipeCancel",l),!l.defaultPrevented){const c=l.currentTarget;c.setAttribute("data-swipe","cancel"),c.style.removeProperty("--reka-toast-swipe-move-x"),c.style.removeProperty("--reka-toast-swipe-move-y"),c.style.removeProperty("--reka-toast-swipe-end-x"),c.style.removeProperty("--reka-toast-swipe-end-y")}}),onSwipeEnd:a[7]||(a[7]=l=>{if(i("swipeEnd",l),!l.defaultPrevented){const{x:c,y:u}=l.detail.delta,h=l.currentTarget;h.setAttribute("data-swipe","end"),h.style.removeProperty("--reka-toast-swipe-move-x"),h.style.removeProperty("--reka-toast-swipe-move-y"),h.style.setProperty("--reka-toast-swipe-end-x",`${c}px`),h.style.setProperty("--reka-toast-swipe-end-y",`${u}px`),s.value=!1}})}),{default:Ae(({remaining:l,duration:c})=>[lt(o.$slots,"default",{remaining:l,duration:c,open:L(s)})]),_:3},16,["open","type","as","as-child","duration"])]),_:3},8,["present"]))}}
5025),Iie=Pie,Nie=qe({__name:"ToastTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return Un(),(t,i)=>(pe(),Re(L(Zn),ji(Ur(e)),{default:Ae(()=>[lt(t.$slots,"default")]),_:3},16))}}),Lie=Nie,Oie=qe({__name:"FocusProxy",emits:["focusFromOutsideViewport"],setup(n,{emit:e}){const t=e,i=M0();return(r,s)=>(pe(),Re(L(A1),{"aria-hidden":"true",tabindex:"0",style:{position:"fixed"},onFocus:s[0]||(s[0]=o=>{const a=o.relatedTarget;!L(i).viewport.value?.contains(a)&&t("focusFromOutsideViewport")})},{default:Ae(()=>[lt(r.$slots,"default")]),_:3}))}}),oA=Oie,Die=qe({inheritAttrs:!1,__name:"ToastViewport",props:{hotkey:{type:Array,required:!1,default:()=>["F8"]},label:{type:[String,Function],required:!1,default:"Notifications ({hotkey})"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"ol"}},setup(n){const e=n,{hotkey:t,label:i}=Ar(e),{forwardRef:r,currentElement:s}=Un(),{CollectionSlot:o,getItems:a}=E1(),l=M0(),c=ge(()=>l.toastCount.value>0),u=Te(),h=Te(),d=ge(()=>t.value.join("+").replace(/Key/g,"").replace(/Digit/g,""));T1(t.value,()=>{s.value.focus()}),On(()=>{l.onViewportChange(s.value)}),un(p=>{const v=s.value;if(c.value&&v){const m=()=>{if(!l.isClosePausedRef.value){const T=new CustomEvent(Qy);v.dispatchEvent(T),l.isClosePausedRef.value=!0}},g=()=>{if(l.isClosePausedRef.value){const T=new CustomEvent(e_);v.dispatchEvent(T),l.isClosePausedRef.value=!1}},y=T=>{!v.contains(T.relatedTarget)&&g()},x=()=>{v.contains(Kc())||g()},_=T=>{const S=T.altKey||T.ctrlKey||T.metaKey;if(T.key==="Tab"&&!S){const M=Kc(),b=T.shiftKey;if(T.target===v&&b){u.value?.focus();return}const P=f({tabbingDirection:b?"backwards":"forwards"}),H=P.findIndex(B=>B===M);px(P.slice(H+1))?T.preventDefault():b?u.value?.focus():h.value?.focus()}};v.addEventListener("focusin",m),v.addEventListener("focusout",y),v.addEventListener("pointermove",m),v.addEventListener("pointerleave",x),v.addEventListener("keydown",_),window.addEventListener("blur",m),window.addEventListener("focus",g),p(()=>{v.removeEventListener("focusin",m),v.removeEventListener("focusout",y),v.removeEventListener("pointermove",m),v.removeEventListener("pointerleave",x),v.removeEventListener("keydown",_),window.removeEventListener("blur",m),window.removeEventListener("focus",g)})}});function f({tabbingDirection:p}){const m=a().map(g=>g.ref).map(g=>{const y=[g,...Rte(g)];return p==="forwards"?y:y.reverse()});return(p==="forwards"?m.reverse():m).flat()}return(p,v)=>(pe(),Re(L(Cte),{role:"region","aria-label":typeof L(i)=="string"?L(i).replace("{hotkey}",d.value):L(i)(d.value),tabindex:"-1",style:kr({pointerEvents:c.value?void 0:"none"})},{default:Ae(()=>[c.value?(pe(),Re(oA,{key:0,ref:m=>{u.value=L(_l)(m)},onFocusFromOutsideViewport:v[0]||(v[0]=()=>{const m=f({tabbingDirection:"forwards"});L(px)(m)})},null,512)):en("v-if",!0),Ie(L(o),null,{default:Ae(()=>[Ie(L(Zn),Rt({ref:L(r),tabindex:"-1",as:p.as,"as-child":p.asChild},p.$attrs),{default:Ae(()=>[lt(p.$slots,"default")]),_:3},16,["as","as-child"])]),_:3}),c.value?(pe(),Re(oA,{key:1,ref:m=>{h.value=L(_l)(m)},onFocusFromOutsideViewport:v[1]||(v[1]=()=>{const m=f({tabbingDirection:"backwards"});L(px)(m)})},null,512)):en("v-if",!0)]),_:3},8,["aria-label","style"]))}}),kie=Die,Fie=qe({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(n){const e=n;return Un(),(t,i)=>(pe(),Re(L(eie),ji(Ur(e)),{default:Ae(()=>[lt(t.$slots,"default")]),_:3},16))}}),Uie=Fie;const[D1,Bie]=ga("TooltipProvider");var zie=qe({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(n){const e=n,{delayDuration:t,skipDelayDuration:i,disableHoverableContent:r,disableClosingTrigger:s,ignoreNonKeyboardFocus:o,disabled:a}=Ar(e);Un();const l=Te(!0),c=Te(!1),{start:u,stop:h}=M1(()=>{l.value=!0},i,{immediate:!1});return Bie({isOpenDelayed:l,delayDuration:t,onOpen(){h(),l.value=!1},onClose(){u()},isPointerInTransitRef:c,disableHoverableContent:r,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:o}),(d,f)=>lt(d.$slots,"default")}}),Vie=zie;const CN="tooltip.open",[T0,Hie]=ga("TooltipRoot");var Gie=qe({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(n,{emit:e}){const t=n,i=e;Un();const r=D1(),s=ge(()=>t.disableHoverableContent??r.disableHoverableContent.value),o=ge(()=>t.disableClosingTrigger??r.disableClosingTrigger.value),a=ge(()=>t.disabled??r.disabled.value),l=ge(()=>
5025t.delayDuration??r.delayDuration.value),c=ge(()=>t.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=Km(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0});Je(u,x=>{r.onClose&&(x?(r.onOpen(),document.dispatchEvent(new CustomEvent(CN))):r.onClose())});const h=Te(!1),d=Te(),f=ge(()=>u.value?h.value?"delayed-open":"instant-open":"closed"),{start:p,stop:v}=M1(()=>{h.value=!0,u.value=!0},l,{immediate:!1});function m(){v(),h.value=!1,u.value=!0}function g(){v(),u.value=!1}function y(){p()}return Hie({contentId:"",open:u,stateAttribute:f,trigger:d,onTriggerChange(x){d.value=x},onTriggerEnter(){r.isOpenDelayed.value?y():m()},onTriggerLeave(){s.value?g():v()},onOpen:m,onClose:g,disableHoverableContent:s,disableClosingTrigger:o,disabled:a,ignoreNonKeyboardFocus:c}),(x,_)=>(pe(),Re(L(kte),null,{default:Ae(()=>[lt(x.$slots,"default",{open:L(u)})]),_:3}))}}),Wie=Gie,$ie=qe({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(n,{emit:e}){const t=n,i=e,r=T0(),{forwardRef:s}=Un(),o=la(),a=ge(()=>o.default?.({})),l=ge(()=>{if(t.ariaLabel)return t.ariaLabel;let u="";function h(d){typeof d.children=="string"&&d.type!==ur?u+=d.children:Array.isArray(d.children)&&d.children.forEach(f=>h(f))}return a.value?.forEach(d=>h(d)),u}),c=ge(()=>{const{ariaLabel:u,...h}=t;return h});return On(()=>{qy(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()}),qy(window,CN,r.onClose)}),(u,h)=>(pe(),Re(L(Ete),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:h[0]||(h[0]=d=>i("escapeKeyDown",d)),onPointerDownOutside:h[1]||(h[1]=d=>{L(r).disableClosingTrigger.value&&L(r).trigger.value?.contains(d.target)&&d.preventDefault(),i("pointerDownOutside",d)}),onFocusOutside:h[2]||(h[2]=hh(()=>{},["prevent"])),onDismiss:h[3]||(h[3]=d=>L(r).onClose())},{default:Ae(()=>[Ie(L(Zne),Rt({ref:L(s),"data-state":L(r).stateAttribute.value},{...u.$attrs,...c.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:Ae(()=>[lt(u.$slots,"default"),Ie(L(A1),{id:L(r).contentId,role:"tooltip"},{default:Ae(()=>[os(qi(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),RN=$ie,jie=qe({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(n){const t=Rl(n),{forwardRef:i,currentElement:r}=Un(),{trigger:s,onClose:o}=T0(),a=D1(),{isPointerInTransit:l,onPointerExit:c}=cte(s,r);return a.isPointerInTransitRef=l,c(()=>{o()}),(u,h)=>(pe(),Re(RN,Rt({ref:L(i)},L(t)),{default:Ae(()=>[lt(u.$slots,"default")]),_:3},16))}}),qie=jie,Xie=qe({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(n,{emit:e}){const t=n,i=e,r=T0(),s=y0(t,i),{forwardRef:o}=Un();return(a,l)=>(pe(),Re(L(hN),{present:a.forceMount||L(r).open.value},{default:Ae(()=>[(pe(),Re(ws(L(r).disableHoverableContent.value?RN:qie),Rt({ref:L(o)},L(s)),{default:Ae(()=>[lt(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}
5025),Yie=Xie,Kie=qe({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(n){const e=n;return(t,i)=>(pe(),Re(L(fN),ji(Ur(e)),{default:Ae(()=>[lt(t.$slots,"default")]),_:3},16))}}),Zie=Kie,Jie=qe({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=T0(),i=D1();t.contentId||=gte(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:s}=Un(),o=Te(!1),a=Te(!1),l=ge(()=>t.disabled.value?{}:{click:v,focus:f,pointermove:h,pointerleave:d,pointerdown:u,blur:p});On(()=>{t.onTriggerChange(s.value)});function c(){setTimeout(()=>{o.value=!1},1)}function u(){t.open&&!t.disableClosingTrigger.value&&t.onClose(),o.value=!0,document.addEventListener("pointerup",c,{once:!0})}function h(m){m.pointerType!=="touch"&&!a.value&&!i.isPointerInTransitRef.value&&(t.onTriggerEnter(),a.value=!0)}function d(){t.onTriggerLeave(),a.value=!1}function f(m){o.value||t.ignoreNonKeyboardFocus.value&&!m.target.matches?.(":focus-visible")||t.onOpen()}function p(){t.onClose()}function v(){t.disableClosingTrigger.value||t.onClose()}return(m,g)=>(pe(),Re(L(Ute),{"as-child":"",reference:m.reference},{default:Ae(()=>[Ie(L(Zn),Rt({ref:L(r),"aria-describedby":L(t).open.value?L(t).contentId:void 0,"data-state":L(t).stateAttribute.value,as:m.as,"as-child":e.asChild,"data-grace-area-trigger":""},vO(l.value)),{default:Ae(()=>[lt(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Qie=Jie;const hp={meta:"",ctrl:"",alt:"",win:"⊞",command:"⌘",shift:"⇧",control:"⌃",option:"⌥",enter:"↵",delete:"⌦",backspace:"⌫",escape:"Esc",tab:"⇥",capslock:"⇪",arrowup:"↑",arrowright:"→",arrowdown:"↓",arrowleft:"←",pageup:"⇞",pagedown:"⇟",home:"↖",end:"↘"},ere=()=>{const n=ge(()=>navigator&&navigator.userAgent&&navigator.userAgent.match(/Macintosh;/)),e=Mn({meta:" ",alt:" ",ctrl:" "});On(()=>{e.meta=n.value?hp.command:"Ctrl",e.ctrl=n.value?hp.control:"Ctrl",e.alt=n.value?hp.option:"Alt"});function t(i){if(i)return["meta","alt","ctrl"].includes(i)?e[i]:hp[i]||i}return{macOS:n,getKbdKey:t}},tre=Lb(ere);var nre=/\s+/g,t_=n=>typeof n!="string"||!n?n:n.replace(nre," ").trim(),tg=(...n)=>{let e=[],t=i=>{if(!i&&i!==0&&i!==0n)return;if(Array.isArray(i)){for(let s=0,o=i.length;s<o;s++)t(i[s]);return}let r=typeof i;if(r==="string"||r==="number"||r==="bigint"){if(r==="number"&&i!==i)return;e.push(String(i))}else if(r==="object"){let s=Object.keys(i);for(let o=0,a=s.length;o<a;o++){let l=s[o];i[l]&&e.push(l)}}};for(let i=0,r=n.length;i<r;i++){let s=n[i];s!=null&&t(s)}return e.length>0?t_(e.join(" ")):void 0},aA=n=>n===!1?"false":n===!0?"true":n===0?"0":n,ir=n=>{if(!n||typeof n!="object")return!0;for(let e in n)return!1;return!0},ire=(n,e)=>{if(n===e)return!0;if(!n||!e)return!1;let t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++){let s=t[r];if(!i.includes(s)||n[s]!==e[s])return!1}return!0},lA=(n,e)=>{for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];t in n?n[t]=tg(n[t],i):n[t]=i}return n},PN=(n,e)=>{for(let t=0;t<n.length;t++){let i=n[t];Array.isArray(i)?PN(i,e):i&&e.push(i)}},IN=(...n)=>{let e=[];PN(n,e);let t=[];for(let i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},n_=(n,e)=>{let t={};for(let i in n){let r=n[i];if(i in e){let s=e[i];Array.isArray(r)||Array.isArray(s)?t[i]=IN(s,r):typeof r=="object"&&typeof s=="object"&&r&&s?t[i]=n_(r,s):t[i]=s+" "+r}else t[i]=r}for(let i in e)i in n||(t[i]=e[i]);return t},rre={twMerge:!0,twMergeConfig:{},responsiveVariants:!1};function sre(){let n=null,e={},t=!1;return{get cachedTwMerge(){return n},set cachedTwMerge(i){n=i},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(i){e=i},get didTwMergeConfigChange(){return t},set didTwMergeConfigChange(i){t=i},reset(){n=null,e={},t=!1}}}var co=sre(),ore=n=>{let e=(t,i)=>{let{extend:r=null,slots:s={},variants:o={},compoundVariants:a=[],compoundSlots:l=[],defaultVariants:c={}}=t,u={...rre,...i},h=r?.base?tg(r.base,t?.base):t?.base,d=r?.variants&&!ir(r.variants)?n_(o,r.variants):o,f=r?.defaultVariants&&!ir(r.defaultVariants)?{...r.defaultVariants,...c}:c;!ir(u.twMergeConfig)&&!ire(u.twMergeConfig,co.cachedTwMergeConfig)&&(co.didTwMergeConfigChange=!0,co.c
5025achedTwMergeConfig=u.twMergeConfig);let p=ir(r?.slots),v=ir(s)?{}:{base:tg(t?.base,p&&r?.base),...s},m=p?v:lA({...r?.slots},ir(v)?{base:t?.base}:v),g=ir(r?.compoundVariants)?a:IN(r?.compoundVariants,a),y=_=>{if(ir(d)&&ir(s)&&p)return n(h,_?.class,_?.className)(u);if(g&&!Array.isArray(g))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof g}`);if(l&&!Array.isArray(l))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof l}`);let T=(B,G,O=[],$)=>{let F=O;if(typeof G=="string"){let J=t_(G).split(" ");for(let se=0;se<J.length;se++)F.push(`${B}:${J[se]}`)}else if(Array.isArray(G))for(let J=0;J<G.length;J++)F.push(`${B}:${G[J]}`);else if(typeof G=="object"&&typeof $=="string"&&$ in G){let J=G[$];if(J&&typeof J=="string"){let se=t_(J).split(" "),be=[];for(let Fe=0;Fe<se.length;Fe++)be.push(`${B}:${se[Fe]}`);F[$]=F[$]?F[$].concat(be):be}else if(Array.isArray(J)&&J.length>0){let se=[];for(let be=0;be<J.length;be++)se.push(`${B}:${J[be]}`);F[$]=se}}return F},S=(B,G=d,O=null,$=null)=>{let F=G[B];if(!F||ir(F))return null;let J=$?.[B]??_?.[B];if(J===null)return null;let se=aA(J),be=Array.isArray(u.responsiveVariants)&&u.responsiveVariants.length>0||u.responsiveVariants===!0,Fe=f?.[B],Le=[];if(typeof se=="object"&&be)for(let[he,fe]of Object.entries(se)){let ue=F[fe];if(he==="initial"){Fe=fe;continue}Array.isArray(u.responsiveVariants)&&!u.responsiveVariants.includes(he)||(Le=T(he,ue,Le,O))}let Ge=se!=null&&typeof se!="object"?se:aA(Fe),ze=F[Ge||"false"];return typeof Le=="object"&&typeof O=="string"&&Le[O]?lA(Le,ze):Le.length>0?(Le.push(ze),O==="base"?Le.join(" "):Le):ze},E=()=>{if(!d)return null;let B=Object.keys(d),G=[];for(let O=0;O<B.length;O++){let $=S(B[O],d);$&&G.push($)}return G},M=(B,G)=>{if(!d||typeof d!="object")return null;let O=[];for(let $ in d){let F=S($,d,B,G),J=B==="base"&&typeof F=="string"?F:F&&F[B];J&&O.push(J)}return O},b={};for(let B in _){let G=_[B];G!==void 0&&(b[B]=G)}let w=(B,G)=>{let O=typeof _?.[B]=="object"?{[B]:_[B]?.initial}:{};return{...f,...b,...O,...G}},A=(B=[],G)=>{let O=[],$=B.length;for(let F=0;F<$;F++){let{class:J,className:se,...be}=B[F],Fe=!0,Le=w(null,G);for(let Ge in be){let ze=be[Ge],he=Le[Ge];if(Array.isArray(ze)){if(!ze.includes(he)){Fe=!1;break}}else{if((ze==null||ze===!1)&&(he==null||he===!1))continue;if(he!==ze){Fe=!1;break}}}Fe&&(J&&O.push(J),se&&O.push(se))}return O},P=B=>{let G=A(g,B);if(!Array.isArray(G))return G;let O={},$=n;for(let F=0;F<G.length;F++){let J=G[F];if(typeof J=="string")O.base=$(O.base,J)(u);else if(typeof J=="object")for(let se in J)O[se]=$(O[se],J[se])(u)}return O},H=B=>{if(l.length<1)return null;let G={},O=w(null,B);for(let $=0;$<l.length;$++){let{slots:F=[],class:J,className:se,...be}=l[$];if(!ir(be)){let Fe=!0;for(let Le in be){let Ge=O[Le],ze=be[Le];if(Ge===void 0||(Array.isArray(ze)?!ze.includes(Ge):ze!==Ge)){Fe=!1;break}}if(!Fe)continue}for(let Fe=0;Fe<F.length;Fe++){let Le=F[Fe];G[Le]||(G[Le]=[]),G[Le].push([J,se])}}return G};if(!ir(s)||!p){let B={};if(typeof m=="object"&&!ir(m)){let G=n;for(let O in m)B[O]=$=>{let F=P($),J=H($);return G(m[O],M(O,$),F?F[O]:void 0,J?J[O]:void 0,$?.class,$?.className)(u)}}return B}return n(h,E(),A(g),_?.class,_?.className)(u)},x=()=>{if(!(!d||typeof d!="object"))return Object.keys(d)};return y.variantKeys=x(),y.extend=r,y.base=h,y.slots=m,y.variants=d,y.defaultVariants=f,y.compoundSlots=l,y.compoundVariants=g,y};return{tv:e,createTV:t=>(i,r)=>e(i,r?n_(t,r):t)}};const k1="-",are=n=>{const e=cre(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:o=>{const a=o.split(k1);return a[0]===""&&a.length!==1&&a.shift(),NN(a,e)||lre(o)},getConflictingClassGroupIds:(o,a)=>{const l=t[o]||[];return a&&i[o]?[...l,...i[o]]:l}}},NN=(n,e)=>{if(n.length===0)return e.classGroupId;const t=n[0],i=e.nextPart.get(t),r=i?NN(n.slice(1),i):void 0;if(r)return r;if(e.validators.length===0)return;const s=n.join(k1);return e.validators.find(({validator:o})=>o(s))?.classGroupId},cA=/^\[(.+)\]$/,lre=n=>{if(cA.test(n)){const e=cA.exec(n)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},cre=n=>{const{theme:e,classGroups:t}=n,i={nextPart:new Map,validators:[]};for(const r in t)i_(t[r],i,r,e);return i},i_=(n,e,t,i)=>
vendor: 4,501 bytes, line 5025
5025{n.forEach(r=>{if(typeof r=="string"){const s=r===""?e:uA(e,r);s.classGroupId=t;return}if(typeof r=="function"){if(ure(r)){i_(r(i),e,t,i);return}e.validators.push({validator:r,classGroupId:t});return}Object.entries(r).forEach(([s,o])=>{i_(o,uA(e,s),t,i)})})},uA=(n,e)=>{let t=n;return e.split(k1).forEach(i=>{t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t},ure=n=>n.isThemeGetter,hre=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,i=new Map;const r=(s,o)=>{t.set(s,o),e++,e>n&&(e=0,i=t,t=new Map)};return{get(s){let o=t.get(s);if(o!==void 0)return o;if((o=i.get(s))!==void 0)return r(s,o),o},set(s,o){t.has(s)?t.set(s,o):r(s,o)}}},r_="!",s_=":",dre=s_.length,fre=n=>{const{prefix:e,experimentalParseClassName:t}=n;let i=r=>{const s=[];let o=0,a=0,l=0,c;for(let p=0;p<r.length;p++){let v=r[p];if(o===0&&a===0){if(v===s_){s.push(r.slice(l,p)),l=p+dre;continue}if(v==="/"){c=p;continue}}v==="["?o++:v==="]"?o--:v==="("?a++:v===")"&&a--}const u=s.length===0?r:r.substring(l),h=pre(u),d=h!==u,f=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}};if(e){const r=e+s_,s=i;i=o=>o.startsWith(r)?s(o.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const r=i;i=s=>t({className:s,parseClassName:r})}return i},pre=n=>n.endsWith(r_)?n.substring(0,n.length-1):n.startsWith(r_)?n.substring(1):n,mre=n=>{const e=Object.fromEntries(n.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const r=[];let s=[];return i.forEach(o=>{o[0]==="["||e[o]?(r.push(...s.sort(),o),s=[]):s.push(o)}),r.push(...s.sort()),r}},gre=n=>({cache:hre(n.cacheSize),parseClassName:fre(n),sortModifiers:mre(n),...are(n)}),vre=/\s+/,xre=(n,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],a=n.trim().split(vre);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:v}=t(u);if(h){l=u+(l.length>0?" "+l:l);continue}let m=!!v,g=i(m?p.substring(0,v):p);if(!g){if(!m){l=u+(l.length>0?" "+l:l);continue}if(g=i(p),!g){l=u+(l.length>0?" "+l:l);continue}m=!1}const y=s(d).join(":"),x=f?y+r_:y,_=x+g;if(o.includes(_))continue;o.push(_);const T=r(g,m);for(let S=0;S<T.length;++S){const E=T[S];o.push(x+E)}l=u+(l.length>0?" "+l:l)}return l};function yre(){let n=0,e,t,i="";for(;n<arguments.length;)(e=arguments[n++])&&(t=LN(e))&&(i&&(i+=" "),i+=t);return i}const LN=n=>{if(typeof n=="string")return n;let e,t="";for(let i=0;i<n.length;i++)n[i]&&(e=LN(n[i]))&&(t&&(t+=" "),t+=e);return t};function o_(n,...e){let t,i,r,s=o;function o(l){const c=e.reduce((u,h)=>h(u),n());return t=gre(c),i=t.cache.get,r=t.cache.set,s=a,a(l)}function a(l){const c=i(l);if(c)return c;const u=xre(l,t);return r(l,u),u}return function(){return s(yre.apply(null,arguments))}}const Jn=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},ON=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,DN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_re=/^\d+\/\d+$/,bre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wre=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Sre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dc=n=>_re.test(n),Nt=n=>!!n&&!Number.isNaN(Number(n)),Vo=n=>!!n&&Number.isInteger(Number(n)),gx=n=>n.endsWith("%")&&Nt(n.slice(0,-1)),so=n=>bre.test(n),Ere=()=>!0,Are=n=>wre.test(n)&&!Sre.test(n),kN=()=>!1,Cre=n=>Mre.test(n),Rre=n=>Tre.test(n),Pre=n=>!st(n)&&!ot(n),Ire=n=>gu(n,BN,kN),st=n=>ON.test(n),Ua=n=>gu(n,zN,Are),vx=n=>gu(n,kre,Nt),hA=n=>gu(n,FN,kN),Nre=n=>gu(n,UN,Rre),dp=n=>gu(n,VN,Cre),ot=n=>DN.test(n),Xu=n=>vu(n,zN),Lre=n=>vu(n,Fre),dA=n=>vu(n,FN),Ore=n=>vu(n,BN),Dre=n=>vu(n,UN),fp=n=>vu(n,VN,!0),gu=(n,e,t)=>{const i=ON.exec(n);return i?i[1]?e(i[1]):t(i[2]):!1},vu=(n,e,t=!1)=>{const i=DN.exec(n);return i?i[1]?e(i[1]):t:!1},FN=n=>n==="position"||n==="percentage",UN=n=>n==="image"||n==="url",BN=n=>n==="length"||n==="size"||n==="bg-size",zN=n=>n==="length",kre=n=>n==="number",Fre=n=>n==="family-name",VN=n=>n==="shadow",a_=()=>{const n=Jn("color"),e=Jn("font"),t=Jn("text"),i=Jn("font-weight"),r=Jn("tracking"),s=Jn("leading"),o=Jn("breakpoint"),a=Jn("container"),l=Jn("spacing"),c=J
vendor: 4,170 bytes, line 5025
5025n("radius"),u=Jn("shadow"),h=Jn("inset-shadow"),d=Jn("text-shadow"),f=Jn("drop-shadow"),p=Jn("blur"),v=Jn("perspective"),m=Jn("aspect"),g=Jn("ease"),y=Jn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[..._(),ot,st],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],M=()=>[ot,st,l],b=()=>[dc,"full","auto",...M()],w=()=>[Vo,"none","subgrid",ot,st],A=()=>["auto",{span:["full",Vo,ot,st]},Vo,ot,st],P=()=>[Vo,"auto",ot,st],H=()=>["auto","min","max","fr",ot,st],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...M()],$=()=>[dc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],F=()=>[n,ot,st],J=()=>[..._(),dA,hA,{position:[ot,st]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],be=()=>["auto","cover","contain",Ore,Ire,{size:[ot,st]}],Fe=()=>[gx,Xu,Ua],Le=()=>["","none","full",c,ot,st],Ge=()=>["",Nt,Xu,Ua],ze=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Nt,gx,dA,hA],ue=()=>["","none",p,ot,st],I=()=>["none",Nt,ot,st],V=()=>["none",Nt,ot,st],q=()=>[Nt,ot,st],ye=()=>[dc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[so],breakpoint:[so],color:[Ere],container:[so],"drop-shadow":[so],ease:["in","out","in-out"],font:[Pre],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[so],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[so],shadow:[so],spacing:["px",Nt],text:[so],"text-shadow":[so],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dc,st,ot,m]}],container:["container"],columns:[{columns:[Nt,st,ot,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:b()}],"inset-x":[{"inset-x":b()}],"inset-y":[{"inset-y":b()}],start:[{start:b()}],end:[{end:b()}],top:[{top:b()}],right:[{right:b()}],bottom:[{bottom:b()}],left:[{left:b()}],visibility:["visible","invisible","collapse"],z:[{z:[Vo,"auto",ot,st]}],basis:[{basis:[dc,"full","auto",a,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Nt,dc,"auto","initial","none",st]}],grow:[{grow:["",Nt,ot,st]}],shrink:[{shrink:["",Nt,ot,st]}],order:[{order:[Vo,"first","last","none",ot,st]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}
vendor: 8,786 bytes, line 5025
5025],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[a,"screen",...$()]}],"min-w":[{"min-w":[a,"screen","none",...$()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",t,Xu,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ot,vx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gx,st]}],"font-family":[{font:[Lre,st,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ot,st]}],"line-clamp":[{"line-clamp":[Nt,"none",ot,vx]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",ot,st]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ot,st]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ze(),"wavy"]}],"text-decoration-thickness":[{decoration:[Nt,"from-font","auto",ot,Ua]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Nt,"auto",ot,st]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot,st]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ot,st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:be()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vo,ot,st],radial:["",ot,st],conic:[Vo,ot,st]},Dre,Nre]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:Fe()}],"gradient-via-pos":[{via:Fe()}],"gradient-to-pos":[{to:Fe()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:Le()}],"rounded-s":[{"rounded-s":Le()}],"rounded-e":[{"rounded-e":Le()}],"rounded-t":[{"rounded-t":Le()}],"rounded-r":[{"rounded-r":Le()}],"rounded-b":[{"rounded-b":Le()}],"rounded-l":[{"rounded-l":Le()}],"rounded-ss":[{"rounded-ss":Le()}],"rounded-se":[{"rounded-se":Le()}],"rounded-ee":[{"rounded-ee":Le()}],"rounded-es":[{"rounded-es":Le()}],"rounded-tl":[{"rounded-tl":Le()}],"rounded-tr":[{"rounded-tr":Le()}],"rounded-br":[{"rounded-br":Le()}],"rounded-bl":[{"rounded-bl":Le()}],"border-w":[{border:Ge()}],"border-w-x":[{"border-x":Ge()}],"border-w-y":[{"border-y":Ge()}],"border-w-s":[{"border-s":Ge()}],"border-w-e":[{"border-e":Ge()}],"border-w-t":[{"border-t":Ge()}],"border-w-r":[{"border-r":Ge()}],"border-w-b":[{"border-b":Ge()}],"border-w-l":[{"border-l":Ge()}],"divide-x":[{"divide-x":Ge()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ge()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ze(),"hidden","none"]}],"divide-style":[{divide:[...ze(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ze(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Nt,ot,st]}],"outline-w":[{outline:["",Nt,Xu,Ua]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",u,fp,dp]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",h,fp,dp]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:Ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Nt,Ua]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":Ge()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",d,fp,dp]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Nt,ot,st]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ot,st]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:be()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ot,st]}],filter:[{filter:["","none",ot,st]}],blur:[{blur:ue()}],brightness:[{brightness:[Nt,ot,st]}],contrast:[{contrast:[Nt,ot,st]}],"drop-shadow":[{"drop-shadow":["","none",f,fp,dp]}],"drop-shadow-color":[{"drop-shadow":F()}
vendor: 6,640 bytes, line 5025
5025],grayscale:[{grayscale:["",Nt,ot,st]}],"hue-rotate":[{"hue-rotate":[Nt,ot,st]}],invert:[{invert:["",Nt,ot,st]}],saturate:[{saturate:[Nt,ot,st]}],sepia:[{sepia:["",Nt,ot,st]}],"backdrop-filter":[{"backdrop-filter":["","none",ot,st]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Nt,ot,st]}],"backdrop-contrast":[{"backdrop-contrast":[Nt,ot,st]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Nt,ot,st]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nt,ot,st]}],"backdrop-invert":[{"backdrop-invert":["",Nt,ot,st]}],"backdrop-opacity":[{"backdrop-opacity":[Nt,ot,st]}],"backdrop-saturate":[{"backdrop-saturate":[Nt,ot,st]}],"backdrop-sepia":[{"backdrop-sepia":["",Nt,ot,st]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ot,st]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Nt,"initial",ot,st]}],ease:[{ease:["linear","initial",g,ot,st]}],delay:[{delay:[Nt,ot,st]}],animate:[{animate:["none",y,ot,st]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,ot,st]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:I()}],"rotate-x":[{"rotate-x":I()}],"rotate-y":[{"rotate-y":I()}],"rotate-z":[{"rotate-z":I()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:q()}],"skew-x":[{"skew-x":q()}],"skew-y":[{"skew-y":q()}],transform:[{transform:[ot,st,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ot,st]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ot,st]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[Nt,Xu,Ua,vx]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ure=(n,{cacheSize:e,prefix:t,experimentalParseClassName:i,extend:r={},override:s={}})=>
5025(ih(n,"cacheSize",e),ih(n,"prefix",t),ih(n,"experimentalParseClassName",i),pp(n.theme,s.theme),pp(n.classGroups,s.classGroups),pp(n.conflictingClassGroups,s.conflictingClassGroups),pp(n.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ih(n,"orderSensitiveModifiers",s.orderSensitiveModifiers),mp(n.theme,r.theme),mp(n.classGroups,r.classGroups),mp(n.conflictingClassGroups,r.conflictingClassGroups),mp(n.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),HN(n,r,"orderSensitiveModifiers"),n),ih=(n,e,t)=>{t!==void 0&&(n[e]=t)},pp=(n,e)=>{if(e)for(const t in e)ih(n,t,e[t])},mp=(n,e)=>{if(e)for(const t in e)HN(n,e,t)},HN=(n,e,t)=>{const i=e[t];i!==void 0&&(n[t]=n[t]?n[t].concat(i):i)},Bre=(n,...e)=>typeof n=="function"?o_(a_,n,...e):o_(()=>Ure(a_(),n),...e),zre=o_(a_);var Vre=n=>ir(n)?zre:Bre({...n,extend:{theme:n.theme,classGroups:n.classGroups,conflictingClassGroupModifiers:n.conflictingClassGroupModifiers,conflictingClassGroups:n.conflictingClassGroups,...n.extend}}),Hre=(...n)=>e=>{let t=tg(n);return!t||!e.twMerge?t:((!co.cachedTwMerge||co.didTwMergeConfigChange)&&(co.didTwMergeConfigChange=!1,co.cachedTwMerge=Vre(co.cachedTwMergeConfig)),co.cachedTwMerge(t)||void 0)},{createTV:Gre}=ore(Hre);const Wre=xC,fi=Gre(Wre.ui?.tv),$re={base:"inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans uppercase",variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{sm:"h-4 min-w-[16px] text-[10px]",md:"h-5 min-w-[20px] text-[11px]",lg:"h-6 min-w-[24px] text-[12px]"}},compoundVariants:[{color:"primary",variant:"solid",class:"text-inverted bg-primary"},{color:"secondary",variant:"solid",class:"text-inverted bg-secondary"},{color:"success",variant:"solid",class:"text-inverted bg-success"},{color:"info",variant:"solid",class:"text-inverted bg-info"},{color:"warning",variant:"solid",class:"text-inverted bg-warning"},{color:"error",variant:"solid",class:"text-inverted bg-error"},{color:"primary",variant:"outline",class:"ring ring-inset ring-primary/50 text-primary"},{color:"secondary",variant:"outline",class:"ring ring-inset ring-secondary/50 text-secondary"},{color:"success",variant:"outline",class:"ring ring-inset ring-success/50 text-success"},{color:"info",variant:"outline",class:"ring ring-inset ring-info/50 text-info"},{color:"warning",variant:"outline",class:"ring ring-inset ring-warning/50 text-warning"},{color:"error",variant:"outline",class:"ring ring-inset ring-error/50 text-error"},{color:"primary",variant:"soft",class:"text-primary bg-primary/10"},{color:"secondary",variant:"soft",class:"text-secondary bg-secondary/10"},{color:"success",variant:"soft",class:"text-success bg-success/10"},{color:"info",variant:"soft",class:"text-info bg-info/10"},{color:"warning",variant:"soft",class:"text-warning bg-warning/10"},{color:"error",variant:"soft",class:"text-error bg-error/10"},{color:"primary",variant:"subtle",class:"text-primary ring ring-inset ring-primary/25 bg-primary/10"},{color:"secondary",variant:"subtle",class:"text-secondary ring ring-inset ring-secondary/25 bg-secondary/10"},{color:"success",variant:"subtle",class:"text-success ring ring-inset ring-success/25 bg-success/10"},{color:"info",variant:"subtle",class:"text-info ring ring-inset ring-info/25 bg-info/10"},{color:"warning",variant:"subtle",class:"text-warning ring ring-inset ring-warning/25 bg-warning/10"},{color:"error",variant:"subtle",class:"text-error ring ring-inset ring-error/25 bg-error/10"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"}],defaultVariants:{variant:"outline",color:"neutral",size:"md"}},GN={__name:"UKbd",props:{as:{type:null,required:!1,default:"kbd"},value:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},class:{type:null,required:!1}},setup(n){const e=n,{getKbdKey:t}=tre(),i=Ci(),r=ge(()=>fi({extend:fi($re),...i.ui?.kbd||{}}));return(s,o)=>(pe(),Re(L(Zn),{as:n.as,class:qt(r.value({class:e.class,color:e.color,variant:e.variant,size:e.size}))},{default:Ae(()=>[lt(s.$slots,"default",{},()=>[os(qi(L(t)(n.value)),1)])]),_:3},8,["as","class"]))}},Ln=async({map:n})=>{const{state:e}=await Ny(n);return e.value.minFilter=on,e.value.magFilter=on,e.value.colorSpace
5025=Lt,e.value.needsUpdate=!0,e},jre=["rotation"],qre=["map","normal-map"],Xre={class:"text-white text-xs scale-40 flex gap-2 w-50 justify-between"},Yre={class:"flex gap-1"},Kre={class:"flex gap-1"},Zre=qe({__name:"ground",async setup(n){let e,t;const{left:i,right:r,up:s,down:o,a}=UR(),[l,c]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/ground/grass.png"}),Ln({map:"/sprites/ground/grass_normal.png"})])),e=await e,t(),e);return l.value.wrapS=fo,l.value.wrapT=fo,l.value.repeat.set(5,5),c.value.wrapS=fo,c.value.wrapT=fo,c.value.repeat.set(5,5),(u,h)=>{const d=GN;return pe(),pt("TresMesh",{"receive-shadow":"",rotation:[-Math.PI/2,0,0]},[h[2]||(h[2]=Me("TresPlaneGeometry",{args:[8,8,8,8]},null,-1)),Me("TresMeshStandardMaterial",{map:L(l),"normal-map":L(c),"normal-scale":[.45,.45]},null,8,qre),Ie(L(bc),{center:"",position:[-.5,-2,.001],transform:"","wrapper-class":"[&>div>div]:pointer-events-none! [&>div>div]:select-none!"},{default:Ae(()=>[Me("div",Xre,[Me("div",null,[h[0]||(h[0]=Me("p",{class:"mb-1 text-[10px]"}," 移動 (キーボード) ",-1)),Me("div",Yre,[Ie(d,{value:"↑",class:qt([!L(s)&&"bg-transparent text-white"])},null,8,["class"]),Ie(d,{value:"←",class:qt([!L(i)&&"bg-transparent text-white"])},null,8,["class"]),Ie(d,{value:"↓",class:qt([!L(o)&&"bg-transparent text-white"])},null,8,["class"]),Ie(d,{value:"→",class:qt([!L(r)&&"bg-transparent text-white"])},null,8,["class"])])]),Me("div",null,[h[1]||(h[1]=Me("p",{class:"mb-1 text-[10px]"}," 挨拶 ",-1)),Me("div",Kre,[Ie(d,{value:"a",class:qt(["w-10",[!L(a)&&"bg-transparent text-white"]])},null,8,["class"])])])])]),_:1})],8,jre)}}}),Jre=Object.assign(Zre,{__name:"StageGround"}),Qre={name:"木々"},ese={position:[1.5,1.2,-.8],rotation:[0,-.55,0],"cast-shadow":"","receive-shadow":""},tse=["map","side"],nse={position:[.5,1.2,-1.5],rotation:[0,-.25,0],"cast-shadow":"","receive-shadow":""},ise=["map","side"],rse={position:[-2,1.2,-.7],rotation:[0,.55,0],"cast-shadow":"","receive-shadow":""},sse=["map","side"],ose={position:[-2.4,1.2,-.8],rotation:[0,.85,0],"cast-shadow":"","receive-shadow":""},ase=["map","side"],lse=qe({__name:"tree",async setup(n){let e,t;const[i,r]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/tree_1.png"}),Ln({map:"/sprites/object/tree_2.png"})])),e=await e,t(),e);return(s,o)=>(pe(),pt("TresGroup",Qre,[Me("TresMesh",ese,[o[0]||(o[0]=Me("TresPlaneGeometry",{args:[153*.015,162*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(i),"alpha-test":.5,metalness:.5,transparent:"",side:L(Et)},null,8,tse)]),Me("TresMesh",nse,[o[1]||(o[1]=Me("TresPlaneGeometry",{args:[153*.015,162*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,transparent:"",side:L(Et)},null,8,ise)]),Me("TresMesh",rse,[o[2]||(o[2]=Me("TresPlaneGeometry",{args:[153*.015,162*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(i),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,sse)]),Me("TresMesh",ose,[o[3]||(o[3]=Me("TresPlaneGeometry",{args:[153*.015,162*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,transparent:"",side:L(Et)},null,8,ase)])]))}}),cse=Object.assign(lse,{__name:"StageTree"}),use={name:"草むら"},hse={position:[.5,.25,-1.3],rotation:[0,-.35,0],"cast-shadow":"","receive-shadow":""},dse=["map","side"],fse={position:[1.5,.14,-.45],rotation:[0,-.65,0],"cast-shadow":"","receive-shadow":""},pse=["map","side"],mse={position:[-.2,.44,-2],rotation:[0,0,0],"cast-shadow":"","receive-shadow":""},gse=["map","side"],vse={position:[1.5,.24,-1],rotation:[0,-.7,0],"cast-shadow":"","receive-shadow":""},xse=["map","side"],yse={position:[-1.5,.25,-1.1],rotation:[0,.55,0],"cast-shadow":"","receive-shadow":""},_se=["map","side"],bse={position:[-2.4,.35,-1.27],rotation:[0,.75,0],"cast-shadow":"","receive-shadow":""},wse=["map","side"],Sse=qe({__name:"grass",async setup(n){let e,t;const[i,r]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/grass_1.png"}),Ln({map:"/sprites/object/grass_3.png"})])),e=await e,t(),e);return(s,o)=>(pe(),pt("TresGroup",use,[Me("TresMesh",hse,[o[0]||(o[0]=Me("TresPlaneGeometry",{args:[95*.015,37*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(i),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,dse)]),Me("TresMesh",fse,[o[1]||(o[1]=Me("TresPlaneGeometry",{args:[57*.01,29*.01]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,transparent:"",side:L(Et)},null,8,pse)]),Me("TresMesh",mse,[o[2]||(o[2]=Me("TresPlaneGeometry",{args:[57*.03,29*.03]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,transparent:"",side:L(Et)},null,8,gse)]),Me("TresMesh",vse,[o[3]||(o[3]=Me("TresPlaneGeometry",{args:[57*.02,29*.02]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,transparent:"",side:L(Et)},null,8,xse)]),Me("TresMesh",yse,[o[4]||(o[4]=Me("TresPlaneGeometry",{args:[95*.015,37*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(i),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,_se)]),Me("TresMesh",bse,[o[5]||(o[5]=Me("TresPlaneGeometry",{args:[95*.02,37*.02]},null,-1)),Me("TresMeshStandardMaterial",{map:L(i),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,wse)])]))}}),Mse=Object.assign(Sse,{__name:"StageGrass"}),Tse={name:"草むら"},Ese={position:[1.35,.07,-.9],"rotation-y":-.5,"cast-shadow":"","receive-shadow":""},Ase=["map","side"],Cse={position:[-1,.06,-1.3],"rotation-y":.5,"cast-shadow":"","receive-shadow":""},Rse=["map","side"],Pse={position:[-2,.075,-.2],"rotation-y":.7,"cast-shadow":"","receive-shadow":""},Ise=["map","side"],Nse={position:[-1.22,.06,.52],"rotation-y":.2,"cast-shadow":"","receive-shadow":""},Lse=["map","side"],Ose={position:[-2,.06,-.45],"rotation-y":.75,"cast-shadow":"","receive-shadow":""}
5025,Dse=["map","side"],kse=qe({__name:"wood",async setup(n){let e,t;const[i,r,s,o,a]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/wood_1.png"}),Ln({map:"/sprites/object/wood_2.png"}),Ln({map:"/sprites/object/wood_3.png"}),Ln({map:"/sprites/object/wood_4.png"}),Ln({map:"/sprites/object/wood_5.png"})])),e=await e,t(),e);return(l,c)=>(pe(),pt("TresGroup",Tse,[Me("TresMesh",Ese,[c[0]||(c[0]=Me("TresPlaneGeometry",{args:[24*.015,9*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(o),"alpha-test":.5,transparent:"",side:L(Et)},null,8,Ase)]),Me("TresMesh",Cse,[c[1]||(c[1]=Me("TresPlaneGeometry",{args:[19*.015,8*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,transparent:"",side:L(Et)},null,8,Rse)]),Me("TresMesh",Pse,[c[2]||(c[2]=Me("TresPlaneGeometry",{args:[17*.015,10*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(s),"alpha-test":.5,transparent:"",side:L(Et)},null,8,Ise)]),Me("TresMesh",Nse,[c[3]||(c[3]=Me("TresPlaneGeometry",{args:[17*.012,10*.012]},null,-1)),Me("TresMeshStandardMaterial",{map:L(s),"alpha-test":.5,transparent:"",side:L(Et)},null,8,Lse)]),Me("TresMesh",Ose,[c[4]||(c[4]=Me("TresPlaneGeometry",{args:[11*.015,7*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(i),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,Dse)])]))}}),Fse=Object.assign(kse,{__name:"StageWood"}),Use={name:"石"},Bse={"rotation-y":.15,position:[-1,.28,-1.6],"receive-shadow":"","cast-shadow":""},zse=["map","side"],Vse={position:[-1.5,.28,-1.3],"rotation-y":.3,"receive-shadow":"","cast-shadow":""},Hse=["map","side"],Gse=qe({__name:"rock",async setup(n){let e,t;const[i,r,s]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/rock_1.png"}),Ln({map:"/sprites/object/rock_2.png"}),Ln({map:"/sprites/object/rock_3.png"})])),e=await e,t(),e);return(o,a)=>(pe(),pt("TresGroup",Use,[Me("TresMesh",Bse,[a[0]||(a[0]=Me("TresPlaneGeometry",{args:[33*.03,19*.03]},null,-1)),Me("TresMeshLambertMaterial",{map:L(i),"alpha-test":.5,transparent:"","depth-write":"",side:L(Et)},null,8,zse)]),Me("TresMesh",Vse,[a[1]||(a[1]=Me("TresPlaneGeometry",{args:[21*.03,15*.03]},null,-1)),Me("TresMeshLambertMaterial",{map:L(r),"alpha-test":.5,transparent:"","depth-write":"",side:L(Et)},null,8,Hse)])]))}}),Wse=Object.assign(Gse,{__name:"StageRock"}),WN=Symbol("nuxt-ui.portal-target");function $N(n){const e=gi(WN,void 0),t=ge(()=>n.value===!0?e?.value:n.value),i=ge(()=>typeof t.value=="boolean"?!t.value:!1),r=ge(()=>typeof t.value=="boolean"?"body":t.value);return ge(()=>({to:r.value,disabled:i.value}))}const $se={slots:{content:"flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",arrow:"fill-default",text:"truncate",kbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",kbdsSize:"sm"}},jse={__name:"UTooltip",props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:["update:open"],setup(n,{emit:e}){const t=n,i=e,r=la(),s=Ci(),o=y0(Tl(t,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),i),a=$N(or(()=>t.portal)),l=or(()=>tu(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),c=or(()=>t.arrow),u=ge(()=>fi({extend:fi($se),...s.ui?.tooltip||{}})({side:l.value.side}));return(h,d)=>(pe(),Re(L(Wie),Rt(L(o),{disabled:!(n.text||n.kbds?.length||r.content)||t.disabled}),{default:Ae(({open:f})=>[r.default||n.reference?(pe(),Re(L(Qie),Rt({key:0},h.$attrs,{"as-child":"",reference:n.reference,class:t.class}),{default:Ae(()=>[lt(h.$slots,"default",{open:f})]),_:2},1040,["reference","class"])):en("",!0),Ie(L(Zie),ji(Ur(L(a))),{default:Ae(()=>[Ie(L(Yie),Rt(l.value,{class:u.value.content({class:[!r.default&&t.class,t.ui?.content]}
5025)}),{default:Ae(()=>[lt(h.$slots,"content",{ui:u.value},()=>[n.text?(pe(),pt("span",{key:0,class:qt(u.value.text({class:t.ui?.text}))},qi(n.text),3)):en("",!0),n.kbds?.length?(pe(),pt("span",{key:1,class:qt(u.value.kbds({class:t.ui?.kbds}))},[(pe(!0),pt(vn,null,ul(n.kbds,(p,v)=>(pe(),Re(GN,Rt({key:v,size:t.ui?.kbdsSize||u.value.kbdsSize()},{ref_for:!0},typeof p=="string"?{value:p}:p),null,16,["size"]))),128))],2)):en("",!0)]),n.arrow?(pe(),Re(L(Uie),Rt({key:0},c.value,{class:u.value.arrow({class:t.ui?.arrow})}),null,16,["class"])):en("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["disabled"]))}};function qse(n,e){const t=l_(n),i=l_(e);return jN(t,i)}function jN(n,e){const t=[],i=new Set([...Object.keys(n.props||{}),...Object.keys(e.props||{})]);if(n.props&&e.props)for(const r of i){const s=n.props[r],o=e.props[r];s&&o?t.push(...jN(n.props?.[r],e.props?.[r])):(s||o)&&t.push(new fA((o||s).key,s?"removed":"added",o,s))}return i.size===0&&n.hash!==e.hash&&t.push(new fA((e||n).key,"changed",e,n)),t}function l_(n,e=""){if(n&&typeof n!="object")return new pA(e,n,jy(n));const t={},i=[];for(const r in n)t[r]=l_(n[r],e?`${e}.${r}`:r),i.push(t[r].hash);return new pA(e,n,`{${i.join(":")}}`,t)}class fA{constructor(e,t,i,r){this.key=e,this.type=t,this.newValue=i,this.oldValue=r}toString(){return this.toJSON()}toJSON(){switch(this.type){case"added":return`Added   \`${this.key}\``;case"removed":return`Removed \`${this.key}\``;case"changed":return`Changed \`${this.key}\` from \`${this.oldValue?.toString()||"-"}\` to \`${this.newValue.toString()}\``}}}class pA{constructor(e,t,i,r){this.key=e,this.value=t,this.hash=i,this.props=r}toString(){return this.props?`{${Object.keys(this.props).join(",")}}`:JSON.stringify(this.value)}toJSON(){const e=this.key||".";return this.props?`${e}({${Object.keys(this.props).join(",")}})`:`${e}(${this.value})`}}function qN(n,e){const t={...n};for(const i of e)delete t[i];return t}function Xse(n,e,t){typeof e=="string"&&(e=e.split(".").map(r=>{const s=Number(r);return Number.isNaN(s)?r:s}));let i=n;for(const r of e){if(i==null)return t;i=i[r]}return i!==void 0?i:t}function ng(n,e){return!n&&!e?"":[...Array.isArray(n)?n:[n],e].filter(Boolean)}function Yse(n){return(e,t)=>Kse(e,t,L(n))}function Kse(n,e,t){return Xse(t,`messages.${n}`,n).replace(/\{(\w+)\}/g,(r,s)=>`${e?.[s]??`{${s}}`}`)}function Zse(n){const e=ge(()=>L(n).name),t=ge(()=>L(n).code),i=ge(()=>L(n).dir),r=Xt(n)?n:Te(n);return{lang:e,code:t,dir:i,locale:r,t:Yse(n)}}function Jse(n){return tu(n,{dir:"ltr"})}const mA=Jse({name:"English",code:"en",messages:{alert:{close:"Close"},authForm:{hidePassword:"Hide password",showPassword:"Show password",submit:"Continue"},banner:{close:"Close"},calendar:{nextMonth:"Next month",nextYear:"Next year",prevMonth:"Previous month",prevYear:"Previous year"},carousel:{dots:"Choose slide to display",goto:"Go to slide {slide}",next:"Next",prev:"Prev"},chatPrompt:{placeholder:"Type your message here…"},chatPromptSubmit:{label:"Send prompt"},colorMode:{dark:"Dark",light:"Light",switchToDark:"Switch to dark mode",switchToLight:"Switch to light mode",system:"System"},commandPalette:{back:"Back",close:"Close",noData:"No data",noMatch:"No matching data",placeholder:"Type a command or search…"},contentSearch:{links:"Links",theme:"Theme"},contentSearchButton:{label:"Search…"},contentToc:{title:"On this page"},dashboardSearch:{theme:"Theme"},dashboardSearchButton:{label:"Search…"},dashboardSidebarCollapse:{collapse:"Collapse sidebar",expand:"Expand sidebar"},dashboardSidebarToggle:{close:"Close sidebar",open:"Open sidebar"},error:{clear:"Back to home"},fileUpload:{removeFile:"Remove {filename}"},header:{close:"Close menu",open:"Open menu"},inputMenu:{create:'Create "{label}"',noData:"No data",noMatch:"No matching data"},inputNumber:{decrement:"Decrement",increment:"Increment"},modal:{close:"Close"},pricingTable:{caption:"Pricing plan comparison"},prose:{codeCollapse:{closeText:"Collapse",name:"code",openText:"Expand"},collapsible:{closeText:"Hide",name:"properties",openText:"Show"},pre:{copy:"Copy code to clipboard"}},selectMenu:{create:'Create "{label}"',noData:"No data",noMatch:"No matching data",search:"Search…"},slideover:{close:"Close"},table:{noData:"No data"},toast:{close:"Close"}}}),XN=Symbol.for("nuxt-ui.locale-context"),Qse=n=>{const e=n||or(gi(XN,mA));return Zse(ge(()=>e.value||mA))},YN=Lb(Qse),eoe="$s";function toe(...n){const e=typeof n[n.length-1]=="string"?n.pop():void 0;
5025typeof n[0]!="string"&&n.unshift(e);const[t,i]=n;if(!t||typeof t!="string")throw new TypeError("[nuxt] [useState] key must be a string: "+t);if(i!==void 0&&typeof i!="function")throw new Error("[nuxt] [useState] init must be a function: "+i);const r=eoe+t,s=fn(),o=or(s.payload.state,r);if(o.value===void 0&&i){const a=i();if(Xt(a))return s.payload.state[r]=a,a;o.value=a}return o}const KN=Symbol("nuxt-ui.toast-max");function noe(){const n=toe("toasts",()=>[]),e=gi(KN,void 0),t=Te(!1),i=[],r=()=>`${Date.now()}-${Math.random().toString(36).slice(2,9)}`;async function s(){if(!(t.value||i.length===0)){for(t.value=!0;i.length>0;){const u=i.shift();await xi(),n.value=[...n.value,u].slice(-(e?.value??5))}t.value=!1}}function o(u){const h={id:r(),open:!0,...u};return i.push(h),s(),h}function a(u,h){const d=n.value.findIndex(f=>f.id===u);d!==-1&&(n.value[d]={...n.value[d],...h})}function l(u){const h=n.value.findIndex(d=>d.id===u);h!==-1&&(n.value[h]={...n.value[h],open:!1}),setTimeout(()=>{n.value=n.value.filter(d=>d.id!==u)},200)}function c(){n.value=[]}return{toasts:n,add:o,update:a,remove:l,clear:c}}const ioe=Object.freeze({left:0,top:0,width:16,height:16}),ZN=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),F1=Object.freeze({...ioe,...ZN});Object.freeze({...F1,body:"",hidden:!1});function roe(n){const[e,t,i,r]=n;if(i!==r){const s=Math.max(i,r);return[e-(s-i)/2,t-(s-r)/2,s,s]}return n}const soe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ooe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function c_(n,e,t){if(e===1)return n;if(t=t||100,typeof n=="number")return Math.ceil(n*e*t)/t;if(typeof n!="string")return n;const i=n.split(soe);if(i===null||!i.length)return n;const r=[];let s=i.shift(),o=ooe.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*e*t)/t)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}const aoe=Object.freeze({width:null,height:null}),loe=Object.freeze({...aoe,...ZN});function coe(n,e="defs"){let t="";const i=n.indexOf("<"+e);for(;i>=0;){const r=n.indexOf(">",i),s=n.indexOf("</"+e);if(r===-1||s===-1)break;const o=n.indexOf(">",s);if(o===-1)break;t+=n.slice(r+1,s).trim(),n=n.slice(0,i).trim()+n.slice(o+1)}return{defs:t,content:n}}function uoe(n,e){return n?"<defs>"+n+"</defs>"+e:e}function hoe(n,e,t){const i=coe(n);return uoe(i.defs,e+i.content+t)}const doe=n=>n==="unset"||n==="undefined"||n==="none";function foe(n,e){const t={...F1,...n},i={...loe,...e},r={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,i].forEach(v=>{const m=[],g=v.hFlip,y=v.vFlip;let x=v.rotate;g?y?x+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):y&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let _;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:_=r.height/2+r.top,m.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:_=r.width/2+r.left,m.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}x%2===1&&(r.left!==r.top&&(_=r.left,r.left=r.top,r.top=_),r.width!==r.height&&(_=r.width,r.width=r.height,r.height=_)),m.length&&(s=hoe(s,'<g transform="'+m.join(" ")+'">',"</g>"))});const o=i.width,a=i.height,l=r.width,c=r.height;let u,h;o===null?(h=a===null?"1em":a==="auto"?c:a,u=c_(h,l/c)):(u=o==="auto"?l:o,h=a===null?c_(u,c/l):a==="auto"?c:a);const d={},f=(v,m)=>{doe(m)||(d[v]=m.toString())};f("width",u),f("height",h);const p=[r.left,r.top,l,c];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}function poe(n){return n.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function moe(n){return"data:image/svg+xml,"+poe(n)}function goe(n){return'url("'+moe(n)+'")'}function voe(n,e){let t=n.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+n+"</svg>"}function xoe(n){const e={display:"inline-block",width:"1em",height:"1em"},t=n.varName;switch(n.pseudoSelector&&(e.content="''"),n.mode){case"background":t&&(e["background-image"]="var(--"+t+")"),e["background-repeat"]="no-repeat",e["background-size"]="100% 100%";break;case"mask":e["background-color"]="currentColor",t&&(e["mask-image"]=e["-webkit-mask-image"]="var(--"+t+")"),e["mask-repeat"]=e["-webkit-mask-repeat"]="no-repeat",e["mask-size"]=e["-webkit-mask-size"]="100% 100%";break}return e}function yoe(n,e){const t={},i=e.varName,r=foe(n);let s=r.viewBox;s[2]!==s[3]&&(e.forceSquare?s=roe(s):t.width=c_("1em",s[2]/s[3]));const o=voe(r.body.replace(/currentColor/g,e.color||"black"),{viewBox:`${s[0]} ${s[1]} ${s[2]} ${s[3]}`,width:`${s[2]}`,height:`${s[3]}`}
5025),a=goe(o);if(i)t["--"+i]=a;else switch(e.mode){case"background":t["background-image"]=a;break;case"mask":t["mask-image"]=t["-webkit-mask-image"]=a;break}return t}const xx={selectorStart:{compressed:"{",compact:" {",expanded:" {"},selectorEnd:{compressed:"}",compact:`; }
5026`,expanded:`;
5027}
5028`},rule:{compressed:"{key}:",compact:" {key}: ",expanded:`
5029  {key}: `}};function _oe(n,e="expanded"){const t=[];for(let i=0;i<n.length;i++){const{selector:r,rules:s}=n[i];let a=(r instanceof Array?r.join(e==="compressed"?",":", "):r)+xx.selectorStart[e],l=!0;for(const c in s)l||(a+=";"),a+=xx.rule[e].replace("{key}",c)+s[c],l=!1;a+=xx.selectorEnd[e],t.push(a)}return t.join(e==="compressed"?"":`
5030`)}function boe(n,e={}){const t=e.customise?e.customise(n.body):n.body,i=e.mode||(e.color||!t.includes("currentColor")?"background":"mask");let r=e.varName;r===void 0&&i==="mask"&&(r="svg");const s={...e,mode:i,varName:r};i==="background"&&delete s.varName;const o={...e.rules,...xoe(s),...yoe({...F1,...n,body:t},s)},a=e.iconSelector||".icon";return _oe([{selector:a,rules:o}],s.format)}async function woe(n,e){if(!n)return null;const t=Xx(n);return t||(await tB(n).catch(()=>(console.warn(`[Icon] failed to load icon \`${n}\``),null)),Xx(n))}function JN(n){const e=Ci().icon,t=(e.collections||[]).sort((i,r)=>r.length-i.length);return ge(()=>{const i=n(),r=i.startsWith(e.cssSelectorPrefix)?i.slice(e.cssSelectorPrefix.length):i,s=e.aliases?.[r]||r;if(!s.includes(":")){const o=t.find(a=>s.startsWith(a+"-"));return o?o+":"+s.slice(o.length+1):s}return s})}function QN(n,e){if(n!==!1)return n===!0||n===null?e:n}let Yu;function Soe(n){return n.replace(/([^\w-])/g,"\\$1")}function Moe(){if(Yu)return Yu;Yu=new Set;const n=t=>{if(t=t.replace(/^:where\((.*)\)$/,"$1").trim(),t.startsWith("."))return t},e=t=>{if(t?.length)for(const i of t){i?.cssRules&&e(i.cssRules);const r=i?.selectorText;if(typeof r=="string"){const s=n(r);s&&Yu.add(s)}}};if(typeof document<"u")for(const t of document.styleSheets)try{const i=t.cssRules||t.rules;e(i)}catch{}return Yu}const Toe=qe({name:"NuxtIconCss",props:{name:{type:String,required:!0},customize:{type:[Function,Boolean,null],default:null,required:!1}},setup(n){const e=fn(),t=Ci().icon,i=ge(()=>n.name?t.cssSelectorPrefix+n.name:"");function r(a){if(!a)return;const l=Xx(a);if(l)return l;const c=e.payload?.data?.[a];if(c)return V_(a,c),c}const s=ge(()=>"."+Soe(i.value));function o(a,l=!0){let c=s.value;t.cssWherePseudo&&(c=`:where(${c})`);const u=boe(a,{iconSelector:c,format:"compressed",customise:QN(n.customize,t.customize)});return t.cssLayer&&l?`@layer ${t.cssLayer} { ${u} }`:u}{const a=Moe();async function l(c){if(a.has(s.value)||typeof document>"u")return;const u=document.createElement("style");u.textContent=o(c);const h=document.head.querySelector('style, link[rel="stylesheet"]');h?document.head.insertBefore(u,h):document.head.appendChild(u),a.add(s.value)}Je(()=>n.name,()=>{if(a.has(s.value))return;const c=r(n.name);c?l(c):woe(n.name).then(u=>{u&&l(u)}).catch(()=>null)},{immediate:!0})}return()=>Yn("span",{class:["iconify",i.value]})}});function Eoe(n,e=!1){if(n){if(n.nodeName==="#comment"&&n.nodeValue==="[")return eL(n,[],e);if(e){const t=n.cloneNode(!0);return t.querySelectorAll("[data-island-slot]").forEach(i=>{i.innerHTML=""}),[t.outerHTML]}return[n.outerHTML]}}function eL(n,e=[],t=!1){if(n&&n.nodeName){if(Coe(n))return e;if(!Aoe(n)){const i=n.cloneNode(!0);t&&i.querySelectorAll?.("[data-island-slot]").forEach(r=>{r.innerHTML=""}),e.push(i.outerHTML)}eL(n.nextSibling,e,t)}return e}function yx(n,e){const t=n?Eoe(n):[e];return t?eD(t.join(""),t.length):Yn("div")}function Aoe(n){return n.nodeName==="#comment"&&n.nodeValue==="["}function Coe(n){return n.nodeName==="#comment"&&n.nodeValue==="]"}const gp="<div></div>",_x=new WeakMap;function Roe(n){if(_x.has(n))return _x.get(n);const e={...n};return e.render?e.render=(t,i,r,s,o,a)=>{if(s.mounted$??t.mounted$){const l=n.render?.bind(t)(t,i,r,s,o,a);return l.children===null||typeof l.children=="string"?Es(l):Yn(l)}return yx(t._.vnode.el,gp)}:e.template&&=`
5031      <template v-if="mounted$">${n.template}</template>
5032      <template v-else>${gp}</template>
5033    `,e.setup=(t,i)=>{const r=fn(),s=Mt(r.isHydrating===!1),o=Gn();if(r.isHydrating){const l={...o.attrs},c=Poe(o);for(const u in l)delete o.attrs[u];On(()=>{Object.assign(o.attrs,l),o.vnode.dirs=c})}On(()=>{s.value=!0});const a=n.setup?.(t,i)||{};return rg(a)?Promise.resolve(a).then(l=>typeof l!="function"?(l||={},l.mounted$=s,l):(...c)=>{if(s.value||!r.isHydrating){const u=l(...c);return u.children===null||typeof u.children=="string"?Es(u):Yn(u)}return yx(o?.vnode.el,gp)}):typeof a=="function"?(...l)=>{if(s.value){const c=a(...l),u=e.inheritAttrs!==!1?i.attrs:void 0;return c.children===null||typeof c.children=="string"?Es(c,u):Yn(c,u)}return yx(o?.vnode.el,gp)}:Object.assign(a,{mounted$:s})},_x.set(n,e),e}function Poe(n){if(!n||!n.vnode.dirs)return null;const e=n.vnode.dirs;return n.vnode.dirs=null,e}const Ioe=qe({name:"NuxtIconSvg",props:{name:{type:String,required:!0},customize:{type:[Function,Boolean,null],default:null,required:!1}},setup(n,{slots:e}){const t=fn(),i=Ci().icon,r=JN(()=>n.name),s="i-"+r.value;if(r.value){const o=t.payload.data[s];o&&V_(r.value,o)}return()=>Yn(pB,{icon:r.value,ssr:!0,customise:QN(n.customize,i.customize)},e)}}),tL=qe({name:"NuxtIcon",props:{name:{type:String,required:!0},mode:{type:String,required:!1,default:null},size:{type:[Number,String],required:!1,default:null},customize:{type:[Function,Boolean,null],default:null,required:!1}},setup(n,{slots:e}){const t=fn(),i=Ci().icon,r=JN(()=>n.name),s=ge(()=>t.vueApp?.component(r.value)||((n.mode||i.mode)==="svg"?Ioe:Toe)),o=ge(()=>{const a=n.size||i.size;return a?{fontSize:Number.isNaN(+a)?a:a+"px"}:null});return()=>Yn(s.value,{...i.attrs,name:r.value,class:i.class,style:o.value,customize:n.customize},e)}}),Noe=Object.freeze(Object.defineProperty({__proto__:null,default:tL},Symbol.toStringTag,{value:"Module"})),ig={__name:"UIcon",props:{name:{type:[String,Object],required:!0},mode:{type:String,required:!1},size:{type:[String,Number],required:!1},customize:{type:Function,required:!1}},setup(n){const t=Rl(Tl(n,"name","mode","size","customize"));return(i,r)=>{const s=tL;return typeof n.name=="string"?(pe(),Re(s,ji(Rt({key:0},L(t))),null,16)):(pe(),Re(ws(n.name),{key:1}))}}},Loe="img",gA=Symbol("nuxt-ui.avatar-group");function nL(n){const e=gi(gA,void 0),t=ge(()=>n.size??e?.value.size);return Mr(gA,ge(()=>({size:t.value}))),{size:t}}const Ooe={slots:{root:"relative inline-flex items-center justify-center shrink-0",base:"rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap"},variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",info:"bg-info",warning:"bg-warning",error:"bg-error",neutral:"bg-inverted"},size:{"3xs":"h-[4px] min-w-[4px] text-[4px]","2xs":"h-[5px] min-w-[5px] text-[5px]",xs:"h-[6px] min-w-[6px] text-[6px]",sm:"h-[7px] min-w-[7px] text-[7px]",md:"h-[8px] min-w-[8px] text-[8px]",lg:"h-[9px] min-w-[9px] text-[9px]",xl:"h-[10px] min-w-[10
5033px] text-[10px]","2xl":"h-[11px] min-w-[11px] text-[11px]","3xl":"h-[12px] min-w-[12px] text-[12px]"},position:{"top-right":"top-0 right-0","bottom-right":"bottom-0 right-0","top-left":"top-0 left-0","bottom-left":"bottom-0 left-0"},inset:{false:""},standalone:{false:"absolute"}},compoundVariants:[{position:"top-right",inset:!1,class:"-translate-y-1/2 translate-x-1/2 transform"},{position:"bottom-right",inset:!1,class:"translate-y-1/2 translate-x-1/2 transform"},{position:"top-left",inset:!1,class:"-translate-y-1/2 -translate-x-1/2 transform"},{position:"bottom-left",inset:!1,class:"translate-y-1/2 -translate-x-1/2 transform"}],defaultVariants:{size:"md",color:"primary",position:"top-right"}},Doe=Object.assign({inheritAttrs:!1},{__name:"UChip",props:_O({as:{type:null,required:!1},text:{type:[String,Number],required:!1},color:{type:null,required:!1},size:{type:null,required:!1},position:{type:null,required:!1},inset:{type:Boolean,required:!1,default:!1},standalone:{type:Boolean,required:!1,default:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},{show:{type:Boolean,default:!0},showModifiers:{}}),emits:["update:show"],setup(n){const e=n,t=zO(n,"show",{type:Boolean,default:!0}),{size:i}=nL(e),r=Ci(),s=ge(()=>fi({extend:fi(Ooe),...r.ui?.chip||{}})({color:e.color,size:i.value,position:e.position,inset:e.inset,standalone:e.standalone}));return(o,a)=>(pe(),Re(L(Zn),{as:n.as,class:qt(s.value.root({class:[e.ui?.root,e.class]}))},{default:Ae(()=>[Ie(L(id),ji(Ur(o.$attrs)),{default:Ae(()=>[lt(o.$slots,"default")]),_:3},16),t.value?(pe(),pt("span",{key:0,class:qt(s.value.base({class:e.ui?.base}))},[lt(o.$slots,"content",{},()=>[os(qi(n.text),1)])],2)):en("",!0)]),_:3},8,["as","class"]))}}),koe={slots:{root:"inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated",image:"h-full w-full rounded-[inherit] object-cover",fallback:"font-medium leading-none text-muted truncate",icon:"text-muted shrink-0"},variants:{size:{"3xs":{root:"size-4 text-[8px]"},"2xs":{root:"size-5 text-[10px]"},xs:{root:"size-6 text-xs"},sm:{root:"size-7 text-sm"},md:{root:"size-8 text-base"},lg:{root:"size-9 text-lg"},xl:{root:"size-10 text-xl"},"2xl":{root:"size-11 text-[22px]"},"3xl":{root:"size-12 text-2xl"}}},defaultVariants:{size:"md"}},iL=Object.assign({inheritAttrs:!1},{__name:"UAvatar",props:{as:{type:null,required:!1},src:{type:String,required:!1},alt:{type:String,required:!1},icon:{type:[String,Object],required:!1},text:{type:String,required:!1},size:{type:null,required:!1},chip:{type:[Boolean,Object],required:!1},class:{type:null,required:!1},style:{type:null,required:!1},ui:{type:null,required:!1}},setup(n){const e=n,t=ge(()=>typeof e.as=="string"||typeof e.as?.render=="function"?{root:e.as}:tu(e.as,{root:"span"})),i=ge(()=>e.text||(e.alt||"").split(" ").map(u=>u.charAt(0)).join("").substring(0,2)),r=Ci(),{size:s}=nL(e),o=ge(()=>fi({extend:fi(koe),...r.ui?.avatar||{}})({size:s.value})),a=ge(()=>({"3xs":16,"2xs":20,xs:24,sm:28,md:32,lg:36,xl:40,"2xl":44,"3xl":48})[e.size||"md"]),l=Te(!1);Je(()=>e.src,()=>{l.value&&(l.value=!1)});function c(){l.value=!0}return(u,h)=>(pe(),Re(ws(e.chip?Doe:L(Zn)),Rt({as:t.value.root},e.chip?typeof e.chip=="object"?{inset:!0,...e.chip}:{inset:!0}:{},{class:o.value.root({class:[e.ui?.root,e.class]}),style:e.style}),{default:Ae(()=>[n.src&&!l.value?(pe(),Re(ws(t.value.img||L(Loe)),Rt({key:0,src:n.src,alt:n.alt,width:a.value,height:a.value},u.$attrs,{class:o.value.image({class:e.ui?.image}),onError:c}),null,16,["src","alt","width","height","class"])):(pe(),Re(L(id),ji(Rt({key:1},u.$attrs)),{default:Ae(()=>[lt(u.$slots,"default",{},()=>[n.icon?(pe(),Re(ig,{key:0,name:n.icon,class:qt(o.value.icon({class:e.ui?.icon}))},null,8,["name","class"])):(pe(),pt("span",{key:1,class:qt(o.value.fallback({class:e.ui?.fallback}))},qi(i.value||" "),3))])]),_:3},16))]),_:3},16,["as","class","style"]))}});function Foe(n){const e=Ci(),t=ge(()=>tt(n)),i=ge(()=>t.value.icon&&t.value.leading||t.value.icon&&!t.value.trailing||t.value.loading&&!t.value.trailing||!!t.value.leadingIcon),r=ge(()=>t.value.icon&&t.value.trailing||t.value.loading&&t.value.trailing||!!t.value.trailingIcon),s=ge(()=>t.value.loading?t.value.loadingIcon||e.ui.icons.loading:t.value.leadingIcon||t.value.icon),o=ge(()=>t.value.loading&&!i.value?t.value.loadingIcon||e.ui.icons.loading:t.value.trailingIcon||t.value.icon);return{isLeading:i,isTrailing:r,leadingIconName:s,trailingIconName:o}}const Uoe=Symbol("nuxt-ui.field-group");function Boe(n){const e=gi(Uoe,void 0);return{orientation:ge(()=>e?.value.orientation),size:ge(()=>n?.size??e?.value.size)}}const zoe=Symbol("nuxt-ui.form-loading");function Voe(n){const e=Object.keys(n),t=e.filter(s=>s.startsWith("aria-")),i=e.filter(s=>s.startsWith("data-")),r=["active","activeClass","ariaCurrentValue","as","disabled","exact","exactActiveClass","exactHash","exactQuery","external","href","download","inactiveClass","noPrefetch","noRel","prefetch","prefetchedClass","rel","replace","target","to","type","title","onClick",...t,...i];return Tl(n,...r)}function Hoe(n,e){const t=qse(n,e).reduce((s,o)=>(o.type==="added"&&s.add(o.key),s),new Set),i=Object.fromEntries(Object.entries(n).filter(([s])=>!t.has(s))),r=Object.fromEntries(Object.entries(e).filter(([s])=>!t.has(s)));return aN(i,r)}async function rL(n,e=Is()){const{path:t,matched:i}=e.resolve(n);if(!i.length||(e._routePreloaded||=new Set,e._routePreloaded.has(t)))return;const r=e._preloadPromises||=[];if(r.length>4)return Promise.all(r).then(()=>rL(n,e));e._routePreloaded.add(t);for(const s of i){const o=s.components?.default;if(typeof o!="function")continue;const a=Promise.resolve(o()).catch(()=>{}).finally(()=>r.splice(r.indexOf(a)));r.push(a)}await Promise.all(r)}const Goe=(...n)=>n.find(e=>e!==void 0);function Woe(n){const e=n.componentName||"NuxtLink";function t(s){return typeof s=="string"&&s.startsWith("#")}function i(s,o,a){const l=a??n.trailingSlash;if(!s||l!=="append"&&l!=="remove")return s;if(typeof s=="string")return vp(s,l);const c="path"in s&&s.path!==void 0?s.path:o(s).path;return{...s,name:void 0,path:vp(c,l)}}function r(s){const o=Is(),a=dl(),l=ge(()=>!!s.target&&s.target!=="_self"),c=ge(()=>{const m=s.to||s.href||"";return typeof m=="string"&&ca(m,{acceptRelative:!0})}),u=tw("RouterLink"),h=typeof u!="string"?u.useLink:void 0,d=ge(()=>{if(s.external)return!0;const m=s.to||s.href||"";return typeof m=="object"?!1:m===""||c.value}),f=ge(()=>{const m=s.to||s.href||"";return d.value?m:i(m,o.resolve,s.trailingSlash)}),p=d.value?void 0:h?.({...s,to:f}),v=ge(()=>{const m=s.trailingSlash??n.trailingSlash;if(!f.value||c.value||t(f.value))return f.value;if(d.value){const g=typeof f.value=="object"&&"path"in f.value?Gx(f.value):f.value,y=typeof g=="object"?o.resolve(g).href:g;return vp(y,m)}return typeof f.value=="object"?o.resolve(f.value)?.href??null:vp(ud(a.app.baseURL,f.value),m)});return{to:f,hasTarget:l,isAbsoluteUrl:c,isExternal:d,href:v,isActive:p?.isActive??ge(()=>f.value===o.currentRoute.value.path),isExactActive:p?.isExactActive??ge(()=>f.value===o.currentRoute.value.path),route:p?.route??ge(()=>o.resolve(f.value)),async navigate(m){await hC(v.value,{replace:s.replace,external:d.value||l.value})}}}return qe({name:e,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:r,setup(s,{slots:o}){const a=Is(),{to:l,href:c,navigate:u,isExternal:h,hasTarget:d,isAbsoluteUrl:f}=r(s),p=Mt(!1),v=Te(null),m=x=>{v.value=s.custom?x?.$el?.nextElementSibling:x?.$el};function g(x){return!p.value&&(typeof s.prefetchOn=="string"?s.prefetchOn===x:s.prefetchOn?.[x]??n.prefetchOn?.[x])&&(s.prefetch??n.prefetch)!==!1&&s.noPrefetch!==!0&&s.target!=="_blank"&&!Xoe()}async function y(x=fn()){if(p.value)return;p.value=!0;const _=typeof l.value=="string"?l.value:h.value?Gx(l.value):a.resolve(l.value).fullPath,T=h.value?new URL(_,window.location.href).href:_;await Promise.all([x.hooks.callHook("link:prefetch",T).catch(()=>{}),!h.value&&!d.value&&rL(l.value,a).catch(()=>{})])}if(g("visibility")){const x=fn();let _,T=null;On(()=>{const S=joe();_g(()=>{_=$x(()=>{v?.value?.tagName&&(T=S.observe(v.value,async()=>{T?.(),T=null,await y(x)}))})})}),mg(()=>{_&&eU(_),T?.(),T=null})}return()=>{if(!h.value&&!d.value&&!t(l.value)){const T={ref:m,to:l.value,activeClass:s.activeClass||n.activeClass,exactActiveClass:s.exactActiveClass||n.exactActiveClass,replace:s.replace,ariaCurrentValue:s.ariaCurrentValue,custom:s.custom};
5033return s.custom||(g("interaction")&&(T.onPointerenter=y.bind(null,void 0),T.onFocus=y.bind(null,void 0)),p.value&&(T.class=s.prefetchedClass||n.prefetchedClass),T.rel=s.rel||void 0),Yn(tw("RouterLink"),T,o.default)}const x=s.target||null,_=Goe(s.noRel?"":s.rel,n.externalRelAttribute,f.value||d.value?"noopener noreferrer":"")||null;return s.custom?o.default?o.default({href:c.value,navigate:u,prefetch:y,get route(){if(!c.value)return;const T=new URL(c.value,window.location.href);return{path:T.pathname,fullPath:T.pathname,get query(){return xg(T.search)},hash:T.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:c.value}},rel:_,target:x,isExternal:h.value||d.value,isActive:!1,isExactActive:!1}):null:Yn("a",{ref:v,href:c.value||null,rel:_,target:x,onClick:T=>{if(!(h.value||d.value))return T.preventDefault(),s.replace?a.replace(c.value):a.push(c.value)}},o.default?.())}}})}const $oe=Woe(Bk);function vp(n,e){const t=e==="append"?jp:I_;return ca(n)&&!n.startsWith("http")?n:t(n,!0)}function joe(){const n=fn();if(n._observer)return n._observer;let e=null;const t=new Map,i=(s,o)=>(e||=new IntersectionObserver(a=>{for(const l of a){const c=t.get(l.target);(l.isIntersecting||l.intersectionRatio>0)&&c&&c()}}),t.set(s,o),e.observe(s),()=>{t.delete(s),e?.unobserve(s),t.size===0&&(e?.disconnect(),e=null)});return n._observer={observe:i}}const qoe=/2g/;function Xoe(){const n=navigator.connection;return!!(n&&(n.saveData||qoe.test(n.effectiveType)))}const sL={__name:"ULinkBase",props:{as:{type:String,required:!1,default:"button"},type:{type:String,required:!1,default:"button"},disabled:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},href:{type:String,required:!1},navigate:{type:Function,required:!1},target:{type:[String,Object,null],required:!1},rel:{type:[String,Object,null],required:!1},active:{type:Boolean,required:!1},isExternal:{type:Boolean,required:!1}},setup(n){const e=n;function t(i){if(e.disabled){i.stopPropagation(),i.preventDefault();return}if(e.onClick)for(const r of Array.isArray(e.onClick)?e.onClick:[e.onClick])r(i);e.href&&e.navigate&&!e.isExternal&&e.navigate(i)}return(i,r)=>(pe(),Re(L(Zn),Rt(n.href?{as:"a",href:n.disabled?void 0:n.href,"aria-disabled":n.disabled?"true":void 0,role:n.disabled?"link":void 0,tabindex:n.disabled?-1:void 0}:n.as==="button"?{as:n.as,type:n.type,disabled:n.disabled}:{as:n.as},{rel:n.rel,target:n.target,onClick:t}),{default:Ae(()=>[lt(i.$slots,"default")]),_:3},16,["rel","target"]))}},Yoe={base:"focus-visible:outline-primary",variants:{active:{true:"text-primary",false:"text-muted"},disabled:{true:"cursor-not-allowed opacity-75"}},compoundVariants:[{active:!1,disabled:!1,class:["hover:text-default","transition-colors"]}]},Koe=Object.assign({inheritAttrs:!1},{__name:"ULink",props:{as:{type:null,required:!1,default:"button"},type:{type:null,required:!1,default:"button"},disabled:{type:Boolean,required:!1},active:{type:Boolean,required:!1,default:void 0},exact:{type:Boolean,required:!1},exactQuery:{type:[Boolean,String],required:!1},exactHash:{type:Boolean,required:!1},inactiveClass:{type:String,required:!1},custom:{type:Boolean,required:!1},raw:{type:Boolean,required:!1},class:{type:null,required:!1},to:{type:null,required:!1},href:{type:null,required:!1},external:{type:Boolean,required:!1},target:{type:[String,Object,null],required:!1},rel:{type:[String,Object,null],required:!1},noRel:{type:Boolean,required:!1},prefetchedClass:{type:String,required:!1},prefetch:{type:Boolean,required:!1},prefetchOn:{type:[String,Object],required:!1},noPrefetch:{type:Boolean,required:!1},activeClass:{type:String,required:!1},exactActiveClass:{type:String,required:!1},ariaCurrentValue:{type:String,required:!1,default:"page"},viewTransition:{type:Boolean,required:!1},replace:{type:Boolean,required:!1}},setup(n){const e=n,t=O_(),i=Ci(),r=Rl(G9(e,"as","type","disabled","active","exact","exactQuery","exactHash","activeClass","inactiveClass","to","href","raw","custom","class")),s=ge(()=>fi({extend:fi(Yoe),...tu({variants:{active:{true:ng(i.ui?.link?.variants?.active?.true,e.activeClass),false:ng(i.ui?.link?.variants?.active?.false,e.inactiveClass)}}},i.ui?.link||{})})),o=ge(()=>e.to??e.href);function a({route:c,isActive:u,isExactActive:h}
5033){if(e.active!==void 0)return e.active;if(e.exactQuery==="partial"){if(!Hoe(c.query,t.query))return!1}else if(e.exactQuery===!0&&!aN(c.query,t.query))return!1;return e.exactHash&&c.hash!==t.hash?!1:!!(e.exact&&h||!e.exact&&u)}function l({route:c,isActive:u,isExactActive:h}){const d=a({route:c,isActive:u,isExactActive:h});return e.raw?[e.class,d?e.activeClass:e.inactiveClass]:s.value({class:e.class,active:d,disabled:e.disabled})}return(c,u)=>{const h=$oe;return pe(),Re(h,Rt(L(r),{to:o.value,custom:""}),{default:Ae(({href:d,navigate:f,route:p,rel:v,target:m,isExternal:g,isActive:y,isExactActive:x})=>[n.custom?lt(c.$slots,"default",ji(Rt({key:0},{...c.$attrs,...n.exact&&x?{"aria-current":e.ariaCurrentValue}:{},as:n.as,type:n.type,disabled:n.disabled,href:d,navigate:f,rel:v,target:m,isExternal:g,active:a({route:p,isActive:y,isExactActive:x})}))):(pe(),Re(sL,Rt({key:1},{...c.$attrs,...n.exact&&x?{"aria-current":e.ariaCurrentValue}:{},as:n.as,type:n.type,disabled:n.disabled,href:d,navigate:f,rel:v,target:m,isExternal:g},{class:l({route:p,isActive:y,isExactActive:x})}),{default:Ae(()=>[lt(c.$slots,"default",{active:a({route:p,isActive:y,isExactActive:x})})]),_:2},1040,["class"]))]),_:3},16,["to"])}}}),Zoe={slots:{base:["rounded-md font-medium inline-flex items-center disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75","transition-colors"],label:"truncate",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailingIcon:"shrink-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:"",ghost:"",link:""},size:{xs:{base:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},block:{true:{base:"w-full justify-center",trailingIcon:"ms-auto"}},square:{true:""},leading:{true:""},trailing:{true:""},loading:{true:""},active:{true:{base:""},false:{base:""}}},compoundVariants:[{color:"primary",variant:"solid",class:"text-inverted bg-primary hover:bg-primary/75 active:bg-primary/75 disabled:bg-primary aria-disabled:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"},{color:"secondary",variant:"solid",class:"text-inverted bg-secondary hover:bg-secondary/75 active:bg-secondary/75 disabled:bg-secondary aria-disabled:bg-secondary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-secondary"},{color:"success",variant:"solid",class:"text-inverted bg-success hover:bg-success/75 active:bg-success/75 disabled:bg-success aria-disabled:bg-success focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-success"},{color:"info",variant:"solid",class:"text-inverted bg-info hover:bg-info/75 active:bg-info/75 disabled:bg-info aria-disabled:bg-info focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-info"},{color:"warning",variant:"solid",class:"text-inverted bg-warning hover:bg-warning/75 active:bg-warning/75 disabled:bg-warning aria-disabled:bg-warning focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-warning"},{color:"error",variant:"solid",class:"text-inverted bg-error hover:bg-error/75 active:bg-error/75 disabled:bg-error aria-disabled:bg-error focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-error"},{color:"primary",variant:"outline",class:"ring ring-inset ring-primary/50 text-primary hover:bg-primary/10 active:bg-primary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-primary"},{color:"secondary",variant:"outline",class:"ring ring-inset ring-secondary/50 text-secondary hover:bg-secondary/10 active:bg-secondary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-secondary"},{color:"success",variant:"outline",class:"ring ring-inset ring-success/50 text-success hover:bg-success/10 active:bg-success/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-success"},{color:"info",variant:"outline",class:"ring ring-inset ring-info/50 text-info hover:bg-info/10 active:bg-info/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-info"},{color:"warning",variant:"outline",class:"ring ring-inset ring-warning/50 text-warning hover:bg-warning/10 active:bg-warning/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-warning"},{color:"error",variant:"outline",class:"ring ring-inset ring-error/50 text-error hover:bg-error/10 active:bg-error/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-error"},{color:"primary",variant:"soft",class:"text-primary bg-primary/10 hover:bg-primary/15 active:bg-primary/15 focu
5033s:outline-none focus-visible:bg-primary/15 disabled:bg-primary/10 aria-disabled:bg-primary/10"},{color:"secondary",variant:"soft",class:"text-secondary bg-secondary/10 hover:bg-secondary/15 active:bg-secondary/15 focus:outline-none focus-visible:bg-secondary/15 disabled:bg-secondary/10 aria-disabled:bg-secondary/10"},{color:"success",variant:"soft",class:"text-success bg-success/10 hover:bg-success/15 active:bg-success/15 focus:outline-none focus-visible:bg-success/15 disabled:bg-success/10 aria-disabled:bg-success/10"},{color:"info",variant:"soft",class:"text-info bg-info/10 hover:bg-info/15 active:bg-info/15 focus:outline-none focus-visible:bg-info/15 disabled:bg-info/10 aria-disabled:bg-info/10"},{color:"warning",variant:"soft",class:"text-warning bg-warning/10 hover:bg-warning/15 active:bg-warning/15 focus:outline-none focus-visible:bg-warning/15 disabled:bg-warning/10 aria-disabled:bg-warning/10"},{color:"error",variant:"soft",class:"text-error bg-error/10 hover:bg-error/15 active:bg-error/15 focus:outline-none focus-visible:bg-error/15 disabled:bg-error/10 aria-disabled:bg-error/10"},{color:"primary",variant:"subtle",class:"text-primary ring ring-inset ring-primary/25 bg-primary/10 hover:bg-primary/15 active:bg-primary/15 disabled:bg-primary/10 aria-disabled:bg-primary/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary"},{color:"secondary",variant:"subtle",class:"text-secondary ring ring-inset ring-secondary/25 bg-secondary/10 hover:bg-secondary/15 active:bg-secondary/15 disabled:bg-secondary/10 aria-disabled:bg-secondary/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-secondary"},{color:"success",variant:"subtle",class:"text-success ring ring-inset ring-success/25 bg-success/10 hover:bg-success/15 active:bg-success/15 disabled:bg-success/10 aria-disabled:bg-success/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-success"},{color:"info",variant:"subtle",class:"text-info ring ring-inset ring-info/25 bg-info/10 hover:bg-info/15 active:bg-info/15 disabled:bg-info/10 aria-disabled:bg-info/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-info"},{color:"warning",variant:"subtle",class:"text-warning ring ring-inset ring-warning/25 bg-warning/10 hover:bg-warning/15 active:bg-warning/15 disabled:bg-warning/10 aria-disabled:bg-warning/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-warning"},{color:"error",variant:"subtle",class:"text-error ring ring-inset ring-error/25 bg-error/10 hover:bg-error/15 active:bg-error/15 disabled:bg-error/10 aria-disabled:bg-error/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-error"},{color:"primary",variant:"ghost",class:"text-primary hover:bg-primary/10 active:bg-primary/10 focus:outline-none focus-visible:bg-primary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent"},{color:"secondary",variant:"ghost",class:"text-secondary hover:bg-secondary/10 active:bg-secondary/10 focus:outline-none focus-visible:bg-secondary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent"},{color:"success",variant:"ghost",class:"text-success hover:bg-success/10 active:bg-success/10 focus:outline-none focus-visible:bg-success/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent"},{color:"info",variant:"ghost",class:"text-info hover:bg-info/10 active:bg-info/10 focus:outline-none focus-visible:bg-info/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent"},{color:"warning",variant:"ghost",class:"text-warning hover:bg-warning/10 active:bg-warning/10 focus:outline-none focus-visible:bg-warning/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent"},{color:"error",variant:"ghost",class:"text-error hover:bg-error/10 active:bg-error/10 focus:outline-none focus-visible:bg-error/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent"},{color:"primary",variant:"link",class:"text-primary hover:text-primary/75 active:text-primary/75 disabled:text-primary aria-disabled:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:"link",class:"text-secondary hover:text-secondary/75 active:text-secondary/75 disabled:text-secondary aria-disabled:text-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:"link",class:"text-success hover:text-success/75 active:text-success/75 disabled:text-success aria-disabled:text-success focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:"link",class:"text-info hover:text-info/75 active:text-info/75 disabled:text-info aria-disabled:text-info focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:"link",class:"text-warning hover:text-warning/75 active:text-warning/75 disabled:text-warning aria-disabled:text-warning focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:"link",class:"text-error hover:text-error/75 active:text-error/75 disabled:text-error aria-disabled:text-error focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted hover:bg-inverted/90 active:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default hover:bg-elevated active:bg-elevated disabled:bg-default aria-disabled:bg-default focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"},{color:"neutral",variant:"soft",class:"text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 focus:outline-none focus-visible:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"},{color:"neutral",variant:"ghost",class:"text-default hover:bg-elevated active:bg-elevated focus:outline-none focus-visible:bg-elevated hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"},{color:"neutral",variant:"link",class:"text-muted hover:text-default active:text-default disabled:text-muted aria-disabled:text-muted focus:outline-none focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-inverted"},{size:"xs",square:!0,class:"p-1"},{size:"sm",square:!0,class:"p-1.5"},{size:"md",square:!0,class:"p-1.5"},{size:"lg",square:!0,class:"p-2"},{size:"xl",square:!0,class:"p-2"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}}],defaultVariants:{color:"primary",variant:"solid",size:"md"}},bx={__name:"UButton",props:{label:{type:String,required:!1},color:{type:null,required:!1},activeColor:{type:null,required:!1},variant:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},icon:{type:[String,Object],required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:[String,Object],required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:[String,Object],required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:[String,Object],required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},active:{type:Boolean,required:!1},exact:{type:Boolean,required:!1},exactQuery:{type:[Boolean,String],required:!1},exactHash:{type:Boolean,required:!1},inactiveClass:{type:String,required:!1},to:{type:null,required:!1},href:{type:null,required:!1},external:{type:Boolean,required:!1},target:{type:[String,Object,null],required:!1},rel:{type:[String,Object,null],required:!1},noRel:{type:Boolean,required:!1},prefetchedClass:{type:String,required:!1},prefetch:{type:Boolean,required:!1},prefetchOn:{type:[String,Object],required:!1},noPrefetch:{type:Boolean,required:!1},activeClass:{type:String,required:!1},exactActiveClass:{type:String,required:!1},ariaCurrentValue:{type:String,required:!1},viewTransition:{type:Boolean,required:!1},replace:{type:Boolean,required:!1}},setup(n){const e=n,t=la(),i=Ci(),{orientation:r,size:s}=Boe(e),o=Rl(Voe(e)),a=Te(!1),l=gi(zoe,void 0);async function c(m){a.value=!0;const g=Array.isArray(e.onClick)?e.onClick:[e.onClick];try{await Promise.all(g.map(y=>y?.(m)))}finally{a.value=!1}}const u=ge(()=>e.loading||e.loadingAuto&&(a.value||l?.value&&e.type==="submit")),{isLeading:h,isTrailing:d,leadingIconName:f,trailingIconName:p}=Foe(ge(()=>({...e,loading:u.value}))),v=ge(()=>fi({extend:fi(Zoe),...tu({variants:{active:{true:{base:ng(i.ui?.button?.variants?.active?.true?.base,e.activeClass)},false:{base:ng(i.ui?.button?.variants?.active?.false?.base,e.inactiveClass)}}}},i.ui?.button||{})})({color:e.color,variant:e.variant,size:s.value,loading:u.value,block:e.block,square:e.square||!t.default&&!e.label,leading:h.value,trailing:d.value,fieldGroup:r.value}));return(m,g)=>(pe(),Re(Koe,Rt({type:n.type,disabled:n.disabled||u.value},L(qN)(L(o),["type","disabled","onClick"]),{custom:""}),{default:Ae(({active:y,...x})=>[Ie(sL,Rt(x,{class:v.value.base({class:[e.ui?.base,e.class],active:y,...y&&n.activeVariant?{variant:n.activeVariant}:{},...y&&n.activeColor?{color:n.activeColor}:{}}),onClick:c}),{default:Ae(()=>[lt(m.$slots,"leading",{ui:v.value},()=>[L(h)&&L(f)?(pe(),Re(ig,{key:0,name:L(f),class:qt(v.value.leadingIcon({class:e.ui?.leadingIcon,active:y}))},null,8,["name","class"])):n.avatar?(pe(),Re(iL,Rt({key:1,size:e.ui?.leadingAvatarSize||v.value.leadingAvatarSize()},n.avatar,{class:v.value.leadingAvatar({class:e.ui?.leadingAvatar,active:y})}),null,16,["size","class"])):en("",!0)]),lt(m.$slots,"default",{ui:v.value},()=>[n.label!==void 0&&n.label!==null?(pe(),pt("span",{key:0,class:qt(v.value.label({class:e.ui?.label,active:y}))},qi(n.label),3)):en("",!0)]),lt(m.$slots,"trailing",{ui:v.value},()=>[L(d)&&L(p)?(pe(),Re(ig,{key:0,name:L(p),class:qt(v.value.trailingIcon({class:e.ui?.trailingIcon,active:y}))},null,8,["name","class"])):en("",!0)])]),_:2},1040,["class"])]),_:3},16,["type","disabled"]))}},Joe={slots:{root:"gap-2",base:"relative overflow-hidden rounded-full bg-accented",indicator:"rounded-full size-full transition-transform duration-200 ease-out",status:"flex text-dimmed transition-[width] duration-200",steps:"grid items-end",step:"truncate text-end row-start-1 col-start-1 transition-opacity"},variants:{animation:{carousel:"","carousel-inverse":"",swing:"",elastic:""},color:{primary:{indicator:"bg-primary",steps:"text-primary"},secondary:{indicator:"bg-secondary",steps:"text-secondary"},success:{indicator:"bg-success",steps:"text-success"},info:{indicator:"bg-info",steps:"text-info"},warning:{indicator:"bg-warning",steps:"text-warning"},error:{indicator:"bg-error",steps:"text-error"},neutral:{indicator:"bg-inverted",steps:"text-inverted"}},size:{"2xs":{status:"text-xs",steps:"text-xs"},xs:{status:"text-xs",steps:"text-xs"},sm:{status:"text-sm",steps:"text-sm"},md:{status:"text-sm",steps:"text-sm"},lg:{status:"text-sm",steps:"text-sm"},xl:{status:"text-base",steps:"text-base"},"2xl":{status:"text-base",steps:"text-base"}},step:{active:{step:"opacity-100"},first:{step:"opacity-100 text-muted"},other:{step:"opacity-0"},last:{step:""}},orientation:{horizontal:{root:"w-full flex flex-col",base:"w-full",status:"flex-row items-center justify-end min-w-fit"},vertical:{root:"h-full flex flex-row-reverse",base:"h-full",status:"flex-col justify-end min-h-fit"}},inverted:{true:{status:"self-end"}}},compoundVariants:[{inverted:!0,orientation:"horizontal",class:{step:"text-start",status:"flex-row-reverse"}},{inverted:!0,orientation:"vertical",class:{steps:"items-start",status:"flex-col-reverse"}},{orientation:"horizontal",size:"2xs",class:"h-px"},{orientation:"horizontal",size:"xs",class:"h-0.5"},{orientation:"horizontal",size:"sm",class:"h-1"},{orientation:"horizontal",size:"md",class:"h-2"},{orientation:"horizontal",size:"lg",class:"h-3"},{orientation:"horizontal",size:"xl",class:"h-4"},{orientation:"horizontal",size:"2xl",class:"h-5"},{orientation:"vertical",size:"2xs",class:"w-px"},{orientation:"vertical",size:"xs",class:"w-0.5"},{orientation:"vertical",size:"sm",class:"w-1"},{orientation:"vertical",size:"md",class:"w-2"},{orientation:"vertical",size:"lg",class:"w-3"},{orientation:"vertical",size:"xl",class:"w-4"},{orientation:"vertical",size:"2xl",class:"w-5"},{orientation:"horizontal",animation:"carousel",class:{indicator:"data-[state=indeterminate]:animate-[carousel_2s_ease-in-out_infinite] data-[state=indeterminate]:rtl:animate-[carousel-rtl_2s_ease-in-out_infinite]"}},{orientation:"vertical",animation:"carousel",class:{indicator:"data-[state=indeterminate]:animate-[carousel-vertical_2s_ease-in-out_infinite]"}},{orientation:"horizontal",animation:"carousel-inverse",class:{indicator:"data-[state=indeterminate]:animate-[carousel-inverse_2s_ease-in-out_infinite] data-[state=indeterminate]:rtl:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]"}},{orientation:"vertical",animation:"carousel-inverse",class:{indicator:"data-[state=indeterminate]:animate-[carousel-inverse-vertical_2s_ease-in-out_infinite]"}},{orientation:"horizontal",animation:"swing",class:{indicator:"data-[state=indeterminate]:animate-[swing_2s_ease-in-out_infinite]"}},{orientation:"vertical",animation:"swing",class:{indicator:"data-[state=indeterminate]:animate-[swing-vertical_2s_ease-in-out_infinite]"}},{orientation:"horizontal",animation:"elastic",class:{indicator:"data-[state=indeterminate]:animate-[elastic_2s_ease-in-out_infinite]"}},{orientation:"vertical",animation:"elastic",class:{indicator:"data-[state=indeterminate]:animate-[elastic-vertical_2s_ease-in-out_infinite]"}}],defaultVariants:{animation:"carousel",color:"primary",size:"md"}},Qoe={__name:"UProgress",props:{as:{type:null,required:!1},max:{type:[Number,Array],required:!1},status:{type:Boolean,required:!1},inverted:{type:Boolean,required:!1,default:!1},size:{type:null,required:!1},color:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},animation:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},getValueLabel:{type:Function,required:!1},getValueText:{type:Function,required:!1},modelValue:{type:[Number,null],required:!1,default:null}},emits:["update:modelValue","update:max"],setup(n,{emit:e}){const t=n,i=e,r=la(),{dir:s}
5033=YN(),o=Ci(),a=y0(Tl(t,"getValueLabel","getValueText","modelValue"),i),l=ge(()=>a.value.modelValue===null),c=ge(()=>Array.isArray(t.max)),u=ge(()=>{if(!(l.value||!t.max))return Array.isArray(t.max)?t.max.length-1:Number(t.max)}),h=ge(()=>{if(!l.value)switch(!0){case a.value.modelValue<0:return 0;case a.value.modelValue>(u.value??100):return 100;default:return Math.round(a.value.modelValue/(u.value??100)*100)}}),d=ge(()=>{if(h.value!==void 0)return t.orientation==="vertical"?{transform:`translateY(${t.inverted?"":"-"}${100-h.value}%)`}:s.value==="rtl"?{transform:`translateX(${t.inverted?"-":""}${100-h.value}%)`}:{transform:`translateX(${t.inverted?"":"-"}${100-h.value}%)`}}),f=ge(()=>{const x=`${Math.max(h.value??0,0)}%`;return t.orientation==="vertical"?{height:x}:{width:x}});function p(x){return x===Number(t.modelValue)}function v(x){return x===0}function m(x){return x===u.value}function g(x){return x=Number(x),p(x)&&!v(x)?"active":v(x)&&p(x)?"first":m(x)&&p(x)?"last":"other"}const y=ge(()=>fi({extend:fi(Joe),...o.ui?.progress||{}})({animation:t.animation,size:t.size,color:t.color,orientation:t.orientation,inverted:t.inverted}));return(x,_)=>(pe(),Re(L(Zn),{as:n.as,"data-orientation":n.orientation,class:qt(y.value.root({class:[t.ui?.root,t.class]}))},{default:Ae(()=>[!l.value&&(n.status||r.status)?(pe(),pt("div",{key:0,class:qt(y.value.status({class:t.ui?.status})),style:kr(f.value)},[lt(x.$slots,"status",{percent:h.value},()=>[os(qi(h.value)+"% ",1)])],6)):en("",!0),Ie(L(oie),Rt(L(a),{max:u.value,class:y.value.base({class:t.ui?.base}),style:{transform:"translateZ(0)"}}),{default:Ae(()=>[Ie(L(lie),{class:qt(y.value.indicator({class:t.ui?.indicator})),style:kr(d.value)},null,8,["class","style"])]),_:1},16,["max","class"]),c.value?(pe(),pt("div",{key:1,class:qt(y.value.steps({class:t.ui?.steps}))},[(pe(!0),pt(vn,null,ul(n.max,(T,S)=>(pe(),pt("div",{key:S,class:qt(y.value.step({class:t.ui?.step,step:g(S)}))},[lt(x.$slots,`step-${S}`,{step:T},()=>[os(qi(T),1)])],2))),128))],2)):en("",!0)]),_:3},8,["as","data-orientation","class"]))}},eae={slots:{root:"relative group overflow-hidden bg-default shadow-lg rounded-lg ring ring-default p-4 flex gap-2.5 focus:outline-none",wrapper:"w-0 flex-1 flex flex-col",title:"text-sm font-medium text-highlighted",description:"text-sm text-muted",icon:"shrink-0 size-5",avatar:"shrink-0",avatarSize:"2xl",actions:"flex gap-1.5 shrink-0",progress:"absolute inset-x-0 bottom-0",close:"p-0"},variants:{color:{primary:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary",icon:"text-primary"},secondary:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",icon:"text-secondary"},success:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success",icon:"text-success"},info:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info",icon:"text-info"},warning:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning",icon:"text-warning"},error:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error",icon:"text-error"},neutral:{root:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted",icon:"text-highlighted"}},orientation:{horizontal:{root:"items-center",actions:"items-center"},vertical:{root:"items-start",actions:"items-start mt-2.5"}},title:{true:{description:"mt-1"}}},defaultVariants:{color:"primary"}},tae={__name:"UToast",props:{as:{type:null,required:!1},title:{type:[String,Object,Function],required:!1},description:{type:[String,Object,Function],required:!1},icon:{type:[String,Object],required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},orientation:{type:null,required:!1,default:"vertical"},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:[String,Object],required:!1},actions:{type:Array,required:!1},progress:{type:[Boolean,Object],required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},type:{type:String,required:!1},duration:{type:Number,required:!1}},emits:["escapeKeyDown","pause","resume","swipeStart","swipeMove","swipeCancel","swipeEnd","update:open"],setup(n,{expose:e,emit:t}){const i=n,r=t,s=la(),{t:o}=YN(),a=Ci(),l=y0(Tl(i,"as","defaultOpen","open","duration","type"),r),c=ge(()=>fi({extend:fi(eae),...a.ui?.toast||{}})({color:i.color,orientation:i.orientation,title:!!i.title||!!s.title})),u=Te(),h=Te(0);return On(()=>{u.value&&xi(()=>{h.value=u.value?.$el?.getBoundingClientRect()?.height})}),e({height:h}),(d,f)=>(pe(),Re(L(Iie),Rt({ref_key:"el",ref:u},L(l),{"data-orientation":n.orientation,class:c.value.root({class:[i.ui?.root,i.class]}),style:{"--height":h.value}}),{default:Ae(({remaining:p,duration:v,open:m})=>[lt(d.$slots,"leading",{ui:c.value},()=>[n.avatar?(pe(),Re(iL,Rt({key:0,size:i.ui?.avatarSize||c.value.avatarSize()},n.avatar,{class:c.value.avatar({class:i.ui?.avatar})}),null,16,["size","class"])):n.icon?(pe(),Re(ig,{key:1,name:n.icon,class:qt(c.value.icon({class:i.ui?.icon}))},null,8,["name","class"])):en("",!0)]),Me("div",{class:qt(c.value.wrapper({class:i.ui?.wrapper}))},[n.title||s.title?(pe(),Re(L(Lie),{key:0,class:qt(c.value.title({class:i.ui?.title}))},{default:Ae(()=>[lt(d.$slots,"title",{},()=>[typeof n.title=="function"?(pe(),Re(ws(n.title()),{key:0})):typeof n.title=="object"?(pe(),Re(ws(n.title),{key:1})):(pe(),pt(vn,{key:2},[os(qi(n.title),1)],64))])]),_:3},8,["class"])):en("",!0),n.description||s.description?(pe(),Re(L(Aie),{key:1,class:qt(c.value.description({class:i.ui?.description}))},{default:Ae(()=>[lt(d.$slots,"description",{},()=>[typeof n.description=="function"?(pe(),Re(ws(n.description()),{key:0})):typeof n.description=="object"?(pe(),Re(ws(n.description),{key:1})):(pe(),pt(vn,{key:2},[os(qi(n.description),1)],64))])]),_:3},8,["class"])):en("",!0),n.orientation==="vertical"&&(n.actions?.length||s.actions)?(pe(),pt("div",{key:2,class:qt(c.value.actions({class:i.ui?.actions}))},[lt(d.$slots,"actions",{},()=>[(pe(!0),pt(vn,null,ul(n.actions,(g,y)=>(pe(),Re(L(sA),{key:y,"alt-text":g.label||"Action","as-child":"",onClick:f[0]||(f[0]=hh(()=>{},["stop"]))},{default:Ae(()=>[Ie(bx,Rt({size:"xs",color:n.color},{ref_for:!0},g),null,16,["color"])]),_:2},1032,["alt-text"]))),128))])],2)):en("",!0)],2),n.orientation==="horizontal"&&(n.actions?.length||s.actions)||n.close?(pe(),pt("div",{key:0,class:qt(c.value.actions({class:i.ui?.actions,orientation:"horizontal"}))},[n.orientation==="horizontal"&&(n.actions?.length||s.actions)?lt(d.$slots,"actions",{key:0}
5033,()=>[(pe(!0),pt(vn,null,ul(n.actions,(g,y)=>(pe(),Re(L(sA),{key:y,"alt-text":g.label||"Action","as-child":"",onClick:f[1]||(f[1]=hh(()=>{},["stop"]))},{default:Ae(()=>[Ie(bx,Rt({size:"xs",color:n.color},{ref_for:!0},g),null,16,["color"])]),_:2},1032,["alt-text"]))),128))]):en("",!0),n.close||s.close?(pe(),Re(L(AN),{key:1,"as-child":""},{default:Ae(()=>[lt(d.$slots,"close",{ui:c.value},()=>[n.close?(pe(),Re(bx,Rt({key:0,icon:n.closeIcon||L(a).ui.icons.close,color:"neutral",variant:"link","aria-label":L(o)("toast.close")},typeof n.close=="object"?n.close:{},{class:c.value.close({class:i.ui?.close}),onClick:f[2]||(f[2]=hh(()=>{},["stop"]))}),null,16,["icon","aria-label","class"])):en("",!0)])]),_:3})):en("",!0)],2)):en("",!0),n.progress&&m&&p>0&&v?(pe(),Re(Qoe,Rt({key:1,"model-value":p/v*100,color:n.color},typeof n.progress=="object"?n.progress:{},{size:"sm",class:c.value.progress({class:i.ui?.progress})}),null,16,["model-value","color","class"])):en("",!0)]),_:3},16,["data-orientation","class","style"]))}},nae={slots:{viewport:"fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none",base:"pointer-events-auto absolute inset-x-0 z-(--index) transform-(--transform) data-[expanded=false]:data-[front=false]:h-(--front-height) data-[expanded=false]:data-[front=false]:*:opacity-0 data-[front=false]:*:transition-opacity data-[front=false]:*:duration-100 data-[state=closed]:animate-[toast-closed_200ms_ease-in-out] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out"},variants:{position:{"top-left":{viewport:"left-4"},"top-center":{viewport:"left-1/2 transform -translate-x-1/2"},"top-right":{viewport:"right-4"},"bottom-left":{viewport:"left-4"},"bottom-center":{viewport:"left-1/2 transform -translate-x-1/2"},"bottom-right":{viewport:"right-4"}},swipeDirection:{up:"data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]",right:"data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]",down:"data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]",left:"data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"}},compoundVariants:[{position:["top-left","top-center","top-right"],class:{viewport:"top-4",base:"top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"}},{position:["bottom-left","bottom-center","bottom-right"],class:{viewport:"bottom-4",base:"bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"}},{swipeDirection:["left","right"],class:"data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=end]:translate-x-(--reka-toast-swipe-end-x) data-[swipe=cancel]:translate-x-0"},{swipeDirection:["up","down"],class:"data-[swipe=move]:translate-y-(--reka-toast-swipe-move-y) data-[swipe=end]:translate-y-(--reka-toast-swipe-end-y) data-[swipe=cancel]:translate-y-0"}],defaultVariants:{position:"bottom-right"}},iae={name:"Toaster"},rae=Object.assign(iae,{props:{position:{type:null,required:!1},expand:{type:Boolean,required:!1,default:!0},progress:{type:Boolean,required:!1,default:!0},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},max:{type:Number,required:!1,default:5},class:{type:null,required:!1},ui:{type:null,required:!1},label:{type:String,required:!1},duration:{type:Number,required:!1,default:5e3},disableSwipe:{type:Boolean,required:!1},swipeThreshold:{type:Number,required:!1}},setup(n){const e=n,{toasts:t,remove:i}=noe(),r=Ci();Mr(KN,or(()=>e.max));const s=Rl(Tl(e,"duration","label","swipeThreshold","disableSwipe")),o=$N(or(()=>e.portal)),a=ge(()=>{switch(e.position){case"top-center":return"up";case"top-right":case"bottom-right":return"right";case"bottom-center":return"down";case"top-left":case"bottom-left":return"left"}return"right"}),l=ge(()=>fi({extend:fi(nae),...r.ui?.toaster||{}})({position:e.position,swipeDirection:a.value}));function c(m,g){m||i(g)}const u=Te(!1),h=ge(()=>e.expand||u.value),d=Te([]),f=ge(()=>d.value.reduce((m,{height:g})=>m+g+16,0)),p=ge(()=>d.value[d.value.length-1]?.height||0);function v(m){return d.value.slice(m+1).reduce((g,{height:y})=>g+y+16,0)}return(m,g)=>(pe(),Re(L(die),Rt({"swipe-direction":a.value},L(s)),{default:Ae(()=>[lt(m.$slots,"default"),(pe(!0),pt(vn,null,ul(L(t),(y,x)=>(pe(),Re(tae,Rt({key:y.id,ref_for:!0,ref_key:"refs",ref:d,progress:n.progress},{ref_for:!0},L(qN)(y,["id","close"]),{close:y.close,"data-expanded":h.value,"data-front":!h.value&&x===L(t).length-1,style:{"--index":x-L(t).length+L(t).length,"--before":L(t).length-1-x,"--offset":v(x),"--scale":h.value?"1":"calc(1 - var(--before) * var(--scale-factor))","--translate":h.value?"calc(var(--offset) * var(--translate-factor))":"
5033calc(var(--before) * var(--gap))","--transform":"translateY(var(--translate)) scale(var(--scale))"},class:l.value.base({class:[e.ui?.base,y.onClick?"cursor-pointer":void 0]}),"onUpdate:open":_=>c(_,y.id),onClick:_=>y.onClick&&y.onClick(y)}),null,16,["progress","close","data-expanded","data-front","style","class","onUpdate:open","onClick"]))),128)),Ie(L(Rie),ji(Ur(L(o))),{default:Ae(()=>[Ie(L(kie),{"data-expanded":h.value,class:qt(l.value.viewport({class:[e.ui?.viewport,e.class]})),style:kr({"--scale-factor":"0.05","--translate-factor":n.position?.startsWith("top")?"1px":"-1px","--gap":n.position?.startsWith("top")?"16px":"-16px","--front-height":`${p.value}px`,"--height":`${f.value}px`}),onMouseenter:g[0]||(g[0]=y=>u.value=!0),onMouseleave:g[1]||(g[1]=y=>u.value=!1)},null,8,["data-expanded","class","style"])]),_:1},16)]),_:3},16,["swipe-direction"]))}}),sae=Object.assign(rae,{__name:"UToaster"});function oae(){const n=$a([]),e=(c,u)=>{const{props:h,defaultOpen:d,destroyOnClose:f}=u||{},p=Mn({id:Symbol(""),isOpen:!!d,component:x_(c),isMounted:!!d,destroyOnClose:!!f,originalProps:h||{},props:{...h}});return n.push(p),{...p,open:v=>t(p.id,v),close:v=>i(p.id,v),patch:v=>o(p.id,v)}},t=(c,u)=>{const h=a(c);u?h.props={...h.originalProps,...u}:h.props={...h.originalProps},h.isOpen=!0,h.isMounted=!0;const d=new Promise(f=>h.resolvePromise=f);return Object.assign(d,{id:c,isMounted:h.isMounted,isOpen:h.isOpen,result:d})},i=(c,u)=>{const h=a(c);h.isOpen=!1,h.resolvePromise&&(h.resolvePromise(u),h.resolvePromise=void 0)},r=()=>{n.forEach(c=>i(c.id))},s=c=>{const u=a(c);if(u.isMounted=!1,u.destroyOnClose){const h=n.findIndex(d=>d.id===c);n.splice(h,1)}},o=(c,u)=>{const h=a(c);h.props={...h.props,...u}},a=c=>{const u=n.find(h=>h.id===c);if(!u)throw new Error("Overlay not found");return u};return{overlays:n,open:t,close:i,closeAll:r,create:e,patch:o,unmount:s,isOpen:c=>a(c).isOpen}}const aae=Lb(oae),lae={__name:"UOverlayProvider",setup(n){const{overlays:e,unmount:t,close:i}=aae(),r=ge(()=>e.filter(a=>a.isMounted)),s=a=>{i(a),t(a)},o=(a,l)=>{i(a,l)};return(a,l)=>(pe(!0),pt(vn,null,ul(r.value,c=>(pe(),Re(ws(c.component),Rt({key:c.id},{ref_for:!0},c.props,{open:c.isOpen,"onUpdate:open":u=>c.isOpen=u,onClose:u=>o(c.id,u),"onAfter:leave":u=>s(c.id)}),null,16,["open","onUpdate:open","onClose","onAfter:leave"]))),128))}},cae={name:"App"},uae=Object.assign(cae,{props:{tooltip:{type:Object,required:!1},toaster:{type:[Object,null],required:!1},locale:{type:Object,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:"body"},scrollBody:{type:[Boolean,Object],required:!1},nonce:{type:String,required:!1}},setup(n){const e=n,t=Rl(Tl(e,"scrollBody")),i=or(()=>e.tooltip),r=or(()=>e.toaster),s=or(()=>e.locale);Mr(XN,s);const o=or(()=>e.portal);return Mr(WN,o),(a,l)=>(pe(),Re(L(Yee),Rt({"use-id":()=>i2(),dir:s.value?.dir,locale:s.value?.code},L(t)),{default:Ae(()=>[Ie(L(Vie),ji(Ur(i.value)),{default:Ae(()=>[n.toaster!==null?(pe(),Re(sae,ji(Rt({key:0},r.value)),{default:Ae(()=>[lt(a.$slots,"default")]),_:3},16)):lt(a.$slots,"default",{key:1}),Ie(lae)]),_:3},16)]),_:3},16,["use-id","dir","locale"]))}}),oL=Object.assign(uae,{__name:"UApp"}),hae={name:"掲示板"},dae={position:[1,.45,-.75],rotation:[0,-.35,0],"cast-shadow":"","receive-shadow":""},fae=["map","side"],pae={"rotation-x":-.02,position:[0,-18*.015/2,0],"cast-shadow":"","receive-shadow":""},mae=["map","side"],gae={position:[.04,0,.001],"rotation-z":-.1,"cast-shadow":"","receive-shadow":""},vae=["map","side"],xae={position:[.3,.08,.001],"rotation-z":.05,"cast-shadow":"","receive-shadow":""},yae=["map","side"],_ae=qe({__name:"board",async setup(n){let e,t;const{onBeforeRender:i}=us(),r=Mt(),[s,o,a,l]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/board.png"}),Ln({map:"/sprites/object/board_paper_1.png"}),Ln({map:"/sprites/object/board_paper_2.png"}),Ln({map:"/sprites/object/board_paper_3.png"})])),e=await e,t(),e);return i(({delta:c,elapsed:u})=>{r.value&&(r.value.rotation.z=Math.sin(u*2)*.06)}),(c,u)=>{const h=jse,d=oL;return pe(),pt("TresGroup",hae,[Me("TresMesh",dae,[u[7]||(u[7]=Me("TresPlaneGeometry",{args:[68*.015,61*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(s),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,fae),Ie(L(bc),{center:"",transform:"","distance-factor":1,position:[.19,.32,0],scale:[.75,.75,.75],"wrapper-class":"[&>div>div]:select-none!"},{default:Ae(()=>[Ie(d,null,{default:Ae(()=>[Ie(h,{text:"会社HP","delay-duration":0,arrow:"",ui:{content:"bg-black/30 text-white ring-0 font-bold",arrow:"fill-white/10"}},{default:Ae(()=>[...u[0]||(u[0]=[Me("a",{href:"https://www.tecotec.co.jp/",target:"_blank"},[Me("div",{alt:"テコテック",class:"cursor-pointer scale-90 w-70 h-9 bg-[url('/logo.svg')]"})],-1)])]),_:1})]),_:1})]),_:1}),Me("TresGroup",{ref_key:"recruitRef",ref:r,position:[-.25,.225,.005]},[Me("TresMesh",pae,[u[2]||(u[2]=Me("TresPlaneGeometry",{args:[14*.015,18*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(o),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,mae),Ie(L(bc),{center:"",transform:"","distance-factor":1,position:[0,0,0],scale:[.75,.75,.75],"wrapper-class":"[&>div>div]:select-none!"},{default:Ae(()=>[Ie(d,null,{default:Ae(()=>[Ie(h,{text:"採用","delay-duration":0,arrow:"",ui:{content:"bg-black/30 text-white ring-0 font-bold",arrow:"fill-white/10"}},{default:Ae(()=>[...u[1]||(u[1]=[Me("a",{href:"https://www.tecotec.co.jp/recruit/",target:"_blank",class:"w-[110px] h-[140px] block hover:bg-black/10 transition-[background]"},null,-1)])]),_:1})]),_:1})]),_:1})])],512),Me("TresMesh",gae,[u[4]||(u[4]=Me("TresPlaneGeometry",{args:[11*.015,15*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(a),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,vae),Ie(L(bc),{center:"",transform:"","distance-factor":1,position:[0,0,0],scale:[.75,.75,.75],"wrapper-class":"[&>div>div]:select-none!"},{default:Ae(()=>[Ie(d,null,{default:Ae(()=>[Ie(h,{text:"プロダクト","delay-duration":0,arrow:"",ui:{content:"bg-black/30 text-white ring-0 font-bold",arrow:"fill-white/10"}},{default:Ae(()=>[...u[3]||(u[3]=[Me("a",{href:"https://www.tecotec.co.jp/works/leisure",target:"_blank",class:"w-[90px] h-[120px] block hover:bg-black/10 transition-[background]"},null,-1)])]),_:1})]),_:1})]),_:1})]),Me("TresMesh",xae,[u[6]||(u[6]=Me("TresPlaneGeometry",{args:[11*.015,15*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(l),"alpha-test":.5,metalness:1,transparent:"",side:L(Et)},null,8,yae),Ie(L(bc),{center:"",transform:"","distance-factor":1,position:[0,0,0],scale:[.75,.75,.75],"wrapper-class":"[&>div>div]:select-none!"},{default:Ae(()=>[Ie(d,null,{default:Ae(()=>[Ie(h,{text:"アドベントカレンダー","delay-duration":0,arrow:"",ui:{content:"bg-black/30 text-white ring-0 font-bold",arrow:"fill-white/10"}},{default:Ae(()=>
5033[...u[5]||(u[5]=[Me("a",{href:"https://qiita.com/advent-calendar/2025/tecotec",target:"_blank",class:"w-[90px] h-[120px] block hover:bg-black/10 transition-[background]"},null,-1)])]),_:1})]),_:1})]),_:1})])])])}}}),bae=Object.assign(_ae,{__name:"StageBoard"}),wae={name:"街灯"},Sae={position:[-.95,.735,.485],"rotation-y":.1,"cast-shadow":""},Mae=["map","side"],Tae={position:[.24,.57,0]},Eae=["map","side"],Aae=["map","side"],Cae=["map","side"],Rae=qe({__name:"streetLight",async setup(n){let e,t;const{onBeforeRender:i}=us(),{renderer:r}=au(),s=Mt(),o=Mt(),a=Mt(),[l,c,u,h]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/pillar.png"}),Ln({map:"/sprites/object/chain_1.png"}),Ln({map:"/sprites/object/chain_2.png"}),Ln({map:"/sprites/object/lamp_on.png"})])),e=await e,t(),e);return On(()=>{a.value.shadow.bias=-.001,a.value.shadow.normalBias=.001,a.value.shadow.camera.near=.1}),i(({delta:d,elapsed:f})=>{s.value&&(s.value.rotation.z=Math.sin(f*2)*.05),o.value&&(o.value.rotation.x=Math.sin(f*3)*.075)}),(d,f)=>(pe(),pt("TresGroup",wae,[Me("TresMesh",Sae,[f[3]||(f[3]=Me("TresPlaneGeometry",{args:[45*.015,97*.015]},null,-1)),Me("TresMeshStandardMaterial",{map:L(l),"alpha-test":.5,metalness:.9,roughness:1,transparent:"","depth-write":"",side:L(Et)},null,8,Mae),Me("TresMesh",Tae,[f[2]||(f[2]=Me("TresPlaneGeometry",{args:[3*.013,3*.015]},null,-1)),Me("TresMeshLambertMaterial",{map:L(c),"alpha-test":.5,transparent:"","depth-write":"",side:L(Et)},null,8,Eae),Me("TresMesh",{ref_key:"chainRef",ref:s,position:[0,-.08,0]},[f[1]||(f[1]=Me("TresPlaneGeometry",{args:[3*.013,9*.015]},null,-1)),Me("TresMeshLambertMaterial",{map:L(u),"alpha-test":.5,transparent:"","depth-write":"",side:L(Et)},null,8,Aae),Me("TresMesh",{ref_key:"lampRef",ref:o,position:[0,-.18,.009]},[f[0]||(f[0]=Me("TresPlaneGeometry",{args:[13*.0135,18*.0135]},null,-1)),Me("TresMeshStandardMaterial",{map:L(h),"alpha-test":.5,metalness:1,roughness:1,transparent:"","depth-write":"",side:L(Et)}
5033,null,8,Cae),Me("TresPointLight",{ref_key:"lightRef",ref:a,"cast-shadow":"",distance:2,position:[-.1,0,.15],intensity:14,decay:.1,color:"#FFBB4C"},null,512),Me("TresPointLight",{ref_key:"lightRef",ref:a,position:[-.1,0,1],distance:15,intensity:5.5,decay:1.25,color:"#FFD39B"},null,512)],512)],512)])])]))}}),Pae=Object.assign(Rae,{__name:"StageStreetLight"}),Lp={FIRE_START:"fireStart",FIRE_IDLE:"fireIdle",FIRE_END:"fireEnd"},Iae={[Lp.FIRE_START]:"0-5",[Lp.FIRE_IDLE]:"0-23",[Lp.FIRE_END]:"0-5"},Nae={name:"松明"},Lae={position:[1.45,.75,-.57],rotation:[0,-.35,0],"cast-shadow":"","receive-shadow":""},Oae=["map","side"],Dae={position:[.2,-.1,.3]},vA=12,kae="/sprites/object/torch/fire.png",Fae=qe({__name:"torch",async setup(n){let e,t;const{onBeforeRender:i}=us(),[r]=([e,t]=zs(()=>Promise.all([Ln({map:"/sprites/object/torch/base.png"})])),e=await e,t(),e),s=Mt(),o=Te(null),a=()=>{xi(()=>{const c=o.value?.instance,u=c?.children[0],h=u?.material?.map,d=l(h);!c||!u||!h||!d||(d.emissive=new We(16759628),d.emissiveIntensity=.2,u.material=d,h.colorSpace=Lt,h.minFilter=on,h.magFilter=on,h.needsUpdate=!0,s.value.shadow.bias=-.001,s.value.shadow.normalBias=.001,s.value.shadow.mapSize.set(2048,2048),s.value.shadow.camera.near=.1,s.value.shadow.camera.far=10,u.castShadow=!0)})},l=c=>c?new bd({map:c,alphaTest:.5,metalness:1,roughness:1,transparent:!0,depthWrite:!0,side:Et}):null;return On(()=>{}),i(({elapsed:c})=>{if(!s.value||!o.value)return;const u=c*1e3,d=1+(Math.sin(u*4)+Math.sin(u*2.1)*.5+Math.sin(u*6.3)*.2)/12*.2;s.value.intensity=vA*d;const f=Math.sin(u)*.0018,p=Math.sin(u)*.0013;s.value.position.x=o.value.instance.position.x+f,s.value.position.y=o.value.instance.position.y+p}),(c,u)=>{const h=HP;return pe(),pt("TresGroup",Nae,[Me("TresMesh",Lae,[u[0]||(u[0]=Me("TresPlaneGeometry",{args:[8*.01,24*.01]},null,-1)),Me("TresMeshStandardMaterial",{map:L(r),"alpha-test":.5,roughness:0,metalness:.35,transparent:"",side:L(Et)},null,8,Oae),(pe(),Re(yr,{onResolve:a},{default:Ae(()=>[Ie(h,{ref_key:"spriteRef",ref:o,position:[-.02,.2,.001],animation:L(Lp).FIRE_IDLE,atlas:"sprites/object/torch/atlas.json",definitions:L(Iae),image:kae,fps:20,loop:!0,"as-sprite":!1},{default:Ae(()=>[Me("TresGroup",Dae,[Me("TresPointLight",{ref_key:"lightRef",ref:s,"cast-shadow":"",distance:2.05,intensity:vA,decay:.1,color:"#FFBB4C"},null,512)])]),_:1},8,["animation","definitions"])]),_:1}))])])}}}),Uae=Object.assign(Fae,{__name:"StageTorch"}),Bae=qe({__name:"index",setup(n){const{onBeforeRender:e}=us(),t=Te(null);return e(({delta:i,elapsed:r})=>{}),(i,r)=>{const s=Jre,o=cse,a=Mse,l=Fse,c=Wse,u=bae,h=Pae,d=Uae;return pe(),pt("TresGroup",{ref_key:"stageRef",ref:t,name:"ステージ関連"},[(pe(),Re(yr,null,{default:Ae(()=>[Ie(s)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(o)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(a)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(l)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(c)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(u)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(h)]),_:1})),(pe(),Re(yr,null,{default:Ae(()=>[Ie(d)]),_:1}))],512)}}}),zae=Object.assign(Bae,{__name:"Stage"}),Vae={__name:"TresCanvas",setup(n){const e=d2();return(t,i)=>(pe(),Re(L(tj),ji(Ur(L(e))),{default:Ae(()=>[lt(t.$slots,"default")]),_:3},16))}},Hae=Roe(Vae),Gae={class:"absolute bottom-5 right-10 text-white select-none pointer-events-none text-sm"},Wae=qe({__name:"app",setup(n){const{playerId:e,players:t}=a0(),{open:i}=BP();return On(()=>i()),(r,s)=>{const o=yB,a=pj,l=mq,c=Bee,u=$ee,h=zae,d=Hae,f=oL;return pe(),Re(f,null,{default:Ae(()=>[Ie(d,{shadows:"",alpha:""},{default:Ae(()=>[Ie(o),L(e)&&L(t)[L(e)]?(pe(),Re(a,{key:0})):en("",!0),Ie(l),Ie(c),(pe(!0),pt(vn,null,ul(L(t),(p,v)=>(pe(),Re(u,{id:v,key:v,position:p.position,animation:p.animation,sex:p.sex,parts:p.parts},null,8,["id","position","animation","sex","parts"]))),128)),Ie(h)]),_:1}),Me("p",Gae," 接続人数:"+qi(Object.values(L(t)).length)+"人 ",1)]),_:1})}}}),$ae={__name:"nuxt-error-page",props:{error:Object},setup(n){const t=n.error;t.stack&&t.stack.split(`
5034`).splice(1).map(h=>({text:h.replace("webpack:/","").replace(".vue",".js").trim(),internal:h.includes("node_modules")&&!h.includes(".cache")||h.includes("internal")||h.includes("new Promise")})).map(h=>`<span class="stack${h.internal?" internal":""}">${h.text}</span>`).join(`
5035`);const i=Number(t.statusCode||500),r=i===404,s=t.statusMessage??(r?"Page Not Found":"Internal Server Error"),o=t.message||t.toString(),a=void 0,u=r?Ax(()=>jx(()=>import("./DfWXOafs.js"),__vite__mapDeps([0,1]),import.meta.url)):Ax(()=>jx(()=>import("./skG6Pv-s.js"),__vite__mapDeps([2,3]),import.meta.url));
5035return(h,d)=>(pe(),Re(L(u),ji(Ur({statusCode:L(i),statusMessage:L(s),description:L(o),stack:L(a)})),null,16))}},jae={key:0},xA={__name:"nuxt-root",setup(n){const e=()=>null,t=fn(),i=t.deferHydration();if(t.isHydrating){const c=t.hooks.hookOnce("app:error",i);Is().beforeEach(c)}const r=!1;Mr(uC,O_()),t.hooks.callHookWith(c=>c.map(u=>u()),"vue:setup");const s=D_(),o=!1,a=/bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;a2((c,u,h)=>{if(t.hooks.callHook("vue:error",c,u,h).catch(d=>console.error("[nuxt] Error in `vue:error` hook",d)),a.test(navigator.userAgent))return t.hooks.callHook("app:error",c),console.error(`[nuxt] Not rendering error page for bot with user agent \`${navigator.userAgent}\`:`,c),!1;if(rF(c)&&(c.fatal||c.unhandled))return t.runWithContext(()=>nF(c)),!1});const l=!1;return(c,u)=>(pe(),Re(yr,{onResolve:L(i)},{default:Ae(()=>[L(o)?(pe(),pt("div",jae)):L(s)?(pe(),Re(L($ae),{key:1,error:L(s)},null,8,["error"])):L(l)?(pe(),Re(L(e),{key:2,context:L(l)},null,8,["context"])):L(r)?(pe(),Re(ws(L(r)),{key:3})):(pe(),Re(L(Wae),{key:4}))]),_:1},8,["onResolve"]))}};let yA;{let n;yA=async function(){if(n)return n;const t=!!(window.__NUXT__?.serverRendered??document.getElementById("__NUXT_DATA__")?.dataset.ssr==="true"),i=t?DD(xA):OD(xA),r=Gk({vueApp:i});async function s(o){await r.callHook("app:error",o),r.payload.error||=k_(o)}i.config.errorHandler=s,r.hook("app:suspense:resolve",()=>{i.config.errorHandler===s&&(i.config.errorHandler=void 0)}),!t&&Cw.id&&r.hook("app:suspense:resolve",()=>{document.getElementById(Cw.id)?.remove()});try{await jk(r,gB)}catch(o){s(o)}try{await r.hooks.callHook("app:created",i),await r.hooks.callHook("app:beforeMount",i),i.mount(zk),await r.hooks.callHook("app:mounted",i),await xi()}catch(o){s(o)}return i},n=yA().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{Wee as _,Me as a,Ie as b,pt as c,os as d,$oe as e,pe as o,qi as t,UF as u,Ae as w};

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.