var qb=Object.defineProperty;var W_=i=>{throw TypeError(i)};var Yb=(i,e,t)=>e in i?qb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var te=(i,e,t)=>Yb(i,typeof e!="symbol"?e+"":e,t),X_=(i,e,t)=>e.has(i)||W_("Cannot "+t);var q_=(i,e,t)=>(X_(i,e,"read from private field"),t?t.call(i):e.get(i)),Y_=(i,e,t)=>e.has(i)?W_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),K_=(i,e,t,n)=>(X_(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=t(r);fetch(r.href,a)}})();/** * @vue/shared v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **//*! #__NO_SIDE_EFFECTS__ */function Kb(i){const e=Object.create(null);for(const t of i.split(","))e[t]=1;return t=>t in e}const Fd={},zc=()=>{},Lv=Object.assign,Zb=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},Jb=Object.prototype.hasOwnProperty,bh=(i,e)=>Jb.call(i,e),Vi=Array.isArray,Wo=i=>du(i)==="[object Map]",Qb=i=>du(i)==="[object Set]",Pr=i=>typeof i=="function",jb=i=>typeof i=="string",hl=i=>typeof i=="symbol",co=i=>i!==null&&typeof i=="object",$b=i=>(co(i)||Pr(i))&&Pr(i.then)&&Pr(i.catch),eA=Object.prototype.toString,du=i=>eA.call(i),tA=i=>du(i).slice(8,-1),nA=i=>du(i)==="[object Object]",Bd=i=>jb(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,ls=(i,e)=>!Object.is(i,e);let Z_;const zd=()=>Z_||(Z_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});/** * @vue/reactivity v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let ri;class iA{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ri,!e&&ri&&(this.index=(ri.scopes||(ri.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;e0)return;if(qo){let e=qo;for(qo=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let i;for(;Xo;){let e=Xo;for(Xo=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){i||(i=n)}e=t}}if(i)throw i}function Fv(i){for(let e=i.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Bv(i){let e,t=i.depsTail,n=t;for(;n;){const r=n.prevDep;n.version===-1?(n===t&&(t=r),kd(n),sA(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}i.deps=e,i.depsTail=t}function Ah(i){for(let e=i.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(zv(e.dep.computed)||e.dep.version!==e.version))return!0;return!!i._dirty}function zv(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===Qo))return;i.globalVersion=Qo;const e=i.dep;if(i.flags|=2,e.version>0&&!i.isSSR&&i.deps&&!Ah(i)){i.flags&=-3;return}const t=zt,n=Wi;zt=i,Wi=!0;try{Fv(i);const r=i.fn(i._value);(e.version===0||ls(r,i._value))&&(i._value=r,e.version++)}catch(r){throw e.version++,r}finally{zt=t,Wi=n,Bv(i),i.flags&=-3}}function kd(i,e=!1){const{dep:t,prevSub:n,nextSub:r}=i;if(n&&(n.nextSub=r,i.prevSub=void 0),r&&(r.prevSub=n,i.nextSub=void 0),t.subs===i&&(t.subs=n,!n&&t.computed)){t.computed.flags&=-5;for(let a=t.computed.deps;a;a=a.nextDep)kd(a,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function sA(i){const{prevDep:e,nextDep:t}=i;e&&(e.nextDep=t,i.prevDep=void 0),t&&(t.prevDep=e,i.nextDep=void 0)}let Wi=!0;const Hv=[];function Vd(){Hv.push(Wi),Wi=!1}function Wd(){const i=Hv.pop();Wi=i===void 0?!0:i}function J_(i){const{cleanup:e}=i;if(i.cleanup=void 0,e){const t=zt;zt=void 0;try{e()}finally{zt=t}}}let Qo=0;class aA{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 Xd{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}track(e){if(!zt||!Wi||zt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==zt)t=this.activeLink=new aA(zt,this),zt.deps?(t.prevDep=zt.depsTail,zt.depsTail.nextDep=t,zt.depsTail=t):zt.deps=zt.depsTail=t,Gv(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const n=t.nextDep;n.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=n),t.prevDep=zt.depsTail,t.nextDep=void 0,zt.depsTail.nextDep=t,zt.depsTail=t,zt.deps===t&&(zt.deps=n)}return t}trigger(e){this.version++,Qo++,this.notify(e)}notify(e){Hd();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Gd()}}}function Gv(i){if(i.dep.sc++,i.sub.flags&4){const e=i.dep.computed;if(e&&!i.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)Gv(n)}const t=i.dep.subs;t!==i&&(i.prevSub=t,t&&(t.nextSub=i)),i.dep.subs=i}}const wh=new WeakMap,Ys=Symbol(""),Rh=Symbol(""),jo=Symbol("");function Gn(i,e,t){if(Wi&&zt){let n=wh.get(i);n||wh.set(i,n=new Map);let r=n.get(t);r||(n.set(t,r=new Xd),r.map=n,r.key=t),r.track()}}function ns(i,e,t,n,r,a){const l=wh.get(i);if(!l){Qo++;return}const c=u=>{u&&u.trigger()};if(Hd(),e==="clear")l.forEach(c);else{const u=Vi(i),h=u&&Bd(t);if(u&&t==="length"){const d=Number(n);l.forEach((p,m)=>{(m==="length"||m===jo||!hl(m)&&m>=d)&&c(p)})}else switch((t!==void 0||l.has(void 0))&&c(l.get(t)),h&&c(l.get(jo)),e){case"add":u?h&&c(l.get("length")):(c(l.get(Ys)),Wo(i)&&c(l.get(Rh)));break;case"delete":u||(c(l.get(Ys)),Wo(i)&&c(l.get(Rh)));break;case"set":Wo(i)&&c(l.get(Ys));break}}Gd()}function ya(i){const e=Ot(i);return e===i?e:(Gn(e,"iterate",jo),Xi(i)?e:e.map(Ln))}function qd(i){return Gn(i=Ot(i),"iterate",jo),i}const oA={__proto__:null,[Symbol.iterator](){return Uf(this,Symbol.iterator,Ln)},concat(...i){return ya(this).concat(...i.map(e=>Vi(e)?ya(e):e))},entries(){return Uf(this,"entries",i=>(i[1]=Ln(i[1]),i))},every(i,e){return gr(this,"every",i,e,void 0,arguments)},filter(i,e){return gr(this,"filter",i,e,t=>t.map(Ln),arguments)},find(i,e){return gr(this,"find",i,e,Ln,arguments)},findIndex(i,e){return gr(this,"findIndex",i,e,void 0,arguments)},findLast(i,e){return gr(this,"findLast",i,e,Ln,arguments)},findLastIndex(i,e){return gr(this,"findLastIndex",i,e,void 0,arguments)},forEach(i,e){return gr(this,"forEach",i,e,void 0,arguments)},includes(...i){return Nf(this,"includes",i)},indexOf(...i){return Nf(this,"indexOf",i)},join(i){return ya(this).join(i)},lastIndexOf(...i){return Nf(this,"lastIndexOf",i)},map(i,e){return gr(this,"map",i,e,void 0,arguments)},pop(){return Io(this,"pop")},push(...i){return Io(this,"push",i)},reduce(i,...e){return Q_(this,"reduce",i,e)},reduceRight(i,...e){return Q_(this,"reduceRight",i,e)},shift(){return Io(this,"shift")},some(i,e){return gr(this,"some",i,e,void 0,arguments)},splice(...i){return Io(this,"splice",i)},toReversed(){return ya(this).toReversed()},toSorted(i){return ya(this).toSorted(i)},toSpliced(...i){return ya(this).toSpliced(...i)},unshift(...i){return Io(this,"unshift",i)},values(){return Uf(this,"values",Ln)}};function Uf(i,e,t){const n=qd(i),r=n[e]();return n!==i&&!Xi(i)&&(r._next=r.next,r.next=()=>{const a=r._next();return a.value&&(a.value=t(a.value)),a}),r}const lA=Array.prototype;function gr(i,e,t,n,r,a){const l=qd(i),c=l!==i&&!Xi(i),u=l[e];if(u!==lA[e]){const p=u.apply(i,a);return c?Ln(p):p}let h=t;l!==i&&(c?h=function(p,m){return t.call(this,Ln(p),m,i)}:t.length>2&&(h=function(p,m){return t.call(this,p,m,i)}));const d=u.call(l,h,n);return c&&r?r(d):d}function Q_(i,e,t,n){const r=qd(i);let a=t;return r!==i&&(Xi(i)?t.length>3&&(a=function(l,c,u){return t.call(this,l,c,u,i)}):a=function(l,c,u){return t.call(this,l,Ln(c),u,i)}),r[e](a,...n)}function Nf(i,e,t){const n=Ot(i);Gn(n,"iterate",jo);const r=n[e](...t);return(r===-1||r===!1)&&EA(t[0])?(t[0]=Ot(t[0]),n[e](...t)):r}function Io(i,e,t=[]){Vd(),Hd();const n=Ot(i)[e].apply(i,t);return Gd(),Wd(),n}const cA=Kb("__proto__,__v_isRef,__isVue"),kv=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(hl));function uA(i){hl(i)||(i=String(i));const e=Ot(this);return Gn(e,"has",i),e.hasOwnProperty(i)}class Vv{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const r=this._isReadonly,a=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return a;if(t==="__v_raw")return n===(r?a?SA:qv:a?xA:Xv).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const l=Vi(e);if(!r){let u;if(l&&(u=oA[t]))return u;if(t==="hasOwnProperty")return uA}const c=Reflect.get(e,t,qi(e)?e:n);return(hl(t)?kv.has(t):cA(t))||(r||Gn(e,"get",t),a)?c:qi(c)?l&&Bd(t)?c:c.value:co(c)?r?Yv(c):Yd(c):c}}class fA extends Vv{constructor(e=!1){super(!1,e)}set(e,t,n,r){let a=e[t];if(!this._isShallow){const u=$s(a);if(!Xi(n)&&!$s(n)&&(a=Ot(a),n=Ot(n)),!Vi(e)&&qi(a)&&!qi(n))return u?!1:(a.value=n,!0)}const l=Vi(e)&&Bd(t)?Number(t)i,hc=i=>Reflect.getPrototypeOf(i);function mA(i,e,t){return function(...n){const r=this.__v_raw,a=Ot(r),l=Wo(a),c=i==="entries"||i===Symbol.iterator&&l,u=i==="keys"&&l,h=r[i](...n),d=t?Ch:e?Ph:Ln;return!e&&Gn(a,"iterate",u?Rh:Ys),{next(){const{value:p,done:m}=h.next();return m?{value:p,done:m}:{value:c?[d(p[0]),d(p[1])]:d(p),done:m}},[Symbol.iterator](){return this}}}}function dc(i){return function(...e){return i==="delete"?!1:i==="clear"?void 0:this}}function _A(i,e){const t={get(r){const a=this.__v_raw,l=Ot(a),c=Ot(r);i||(ls(r,c)&&Gn(l,"get",r),Gn(l,"get",c));const{has:u}=hc(l),h=e?Ch:i?Ph:Ln;if(u.call(l,r))return h(a.get(r));if(u.call(l,c))return h(a.get(c));a!==l&&a.get(r)},get size(){const r=this.__v_raw;return!i&&Gn(Ot(r),"iterate",Ys),Reflect.get(r,"size",r)},has(r){const a=this.__v_raw,l=Ot(a),c=Ot(r);return i||(ls(r,c)&&Gn(l,"has",r),Gn(l,"has",c)),r===c?a.has(r):a.has(r)||a.has(c)},forEach(r,a){const l=this,c=l.__v_raw,u=Ot(c),h=e?Ch:i?Ph:Ln;return!i&&Gn(u,"iterate",Ys),c.forEach((d,p)=>r.call(a,h(d),h(p),l))}};return Lv(t,i?{add:dc("add"),set:dc("set"),delete:dc("delete"),clear:dc("clear")}:{add(r){!e&&!Xi(r)&&!$s(r)&&(r=Ot(r));const a=Ot(this);return hc(a).has.call(a,r)||(a.add(r),ns(a,"add",r,r)),this},set(r,a){!e&&!Xi(a)&&!$s(a)&&(a=Ot(a));const l=Ot(this),{has:c,get:u}=hc(l);let h=c.call(l,r);h||(r=Ot(r),h=c.call(l,r));const d=u.call(l,r);return l.set(r,a),h?ls(a,d)&&ns(l,"set",r,a):ns(l,"add",r,a),this},delete(r){const a=Ot(this),{has:l,get:c}=hc(a);let u=l.call(a,r);u||(r=Ot(r),u=l.call(a,r)),c&&c.call(a,r);const h=a.delete(r);return u&&ns(a,"delete",r,void 0),h},clear(){const r=Ot(this),a=r.size!==0,l=r.clear();return a&&ns(r,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=mA(r,i,e)}),t}function Wv(i,e){const t=_A(i,e);return(n,r,a)=>r==="__v_isReactive"?!i:r==="__v_isReadonly"?i:r==="__v_raw"?n:Reflect.get(bh(t,r)&&r in n?t:n,r,a)}const gA={get:Wv(!1,!1)},vA={get:Wv(!0,!1)},Xv=new WeakMap,xA=new WeakMap,qv=new WeakMap,SA=new WeakMap;function MA(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function yA(i){return i.__v_skip||!Object.isExtensible(i)?0:MA(tA(i))}function Yd(i){return $s(i)?i:Kv(i,!1,dA,gA,Xv)}function Yv(i){return Kv(i,!0,pA,vA,qv)}function Kv(i,e,t,n,r){if(!co(i)||i.__v_raw&&!(e&&i.__v_isReactive))return i;const a=r.get(i);if(a)return a;const l=yA(i);if(l===0)return i;const c=new Proxy(i,l===2?n:t);return r.set(i,c),c}function Hc(i){return $s(i)?Hc(i.__v_raw):!!(i&&i.__v_isReactive)}function $s(i){return!!(i&&i.__v_isReadonly)}function Xi(i){return!!(i&&i.__v_isShallow)}function EA(i){return i?!!i.__v_raw:!1}function Ot(i){const e=i&&i.__v_raw;return e?Ot(e):i}const Ln=i=>co(i)?Yd(i):i,Ph=i=>co(i)?Yv(i):i;function qi(i){return i?i.__v_isRef===!0:!1}function ci(i){return Zv(i,!1)}function TA(i){return Zv(i,!0)}function Zv(i,e){return qi(i)?i:new bA(i,e)}class bA{constructor(e,t){this.dep=new Xd,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Ot(e),this._value=t?e:Ln(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||Xi(e)||$s(e);e=n?e:Ot(e),ls(e,t)&&(this._rawValue=e,this._value=n?e:Ln(e),this.dep.trigger())}}function AA(i){return qi(i)?i.value:i}function dl(i){return Pr(i)?i():AA(i)}class wA{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Xd(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Qo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&zt!==this)return Ov(this,!0),!0}get value(){const e=this.dep.track();return zv(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function or(i,e,t=!1){let n,r;return Pr(i)?n=i:(n=i.get,r=i.set),new wA(n,r,t)}const pc={},eu=new WeakMap;let Bs;function RA(i,e=!1,t=Bs){if(t){let n=eu.get(t);n||eu.set(t,n=[]),n.push(i)}}function CA(i,e,t=Fd){const{immediate:n,deep:r,once:a,scheduler:l,augmentJob:c,call:u}=t,h=E=>r?E:Xi(E)||r===!1||r===0?is(E,1):is(E);let d,p,m,_,M=!1,S=!1;if(qi(i)?(p=()=>i.value,M=Xi(i)):Hc(i)?(p=()=>h(i),M=!0):Vi(i)?(S=!0,M=i.some(E=>Hc(E)||Xi(E)),p=()=>i.map(E=>{if(qi(E))return E.value;if(Hc(E))return h(E);if(Pr(E))return u?u(E,2):E()})):Pr(i)?e?p=u?()=>u(i,2):i:p=()=>{if(m){Vd();try{m()}finally{Wd()}}const E=Bs;Bs=d;try{return u?u(i,3,[_]):i(_)}finally{Bs=E}}:p=zc,e&&r){const E=p,N=r===!0?1/0:r;p=()=>is(E(),N)}const x=rA(),v=()=>{d.stop(),x&&Zb(x.effects,d)};if(a&&e){const E=e;e=(...N)=>{E(...N),v()}}let D=S?new Array(i.length).fill(pc):pc;const w=E=>{if(!(!(d.flags&1)||!d.dirty&&!E))if(e){const N=d.run();if(r||M||(S?N.some((U,L)=>ls(U,D[L])):ls(N,D))){m&&m();const U=Bs;Bs=d;try{const L=[N,D===pc?void 0:S&&D[0]===pc?[]:D,_];u?u(e,3,L):e(...L),D=N}finally{Bs=U}}}else d.run()};return c&&c(w),d=new Uv(p),d.scheduler=l?()=>l(w,!1):w,_=E=>RA(E,!1,d),m=d.onStop=()=>{const E=eu.get(d);if(E){if(u)u(E,4);else for(const N of E)N();eu.delete(d)}},e?n?w(!0):D=d.run():l?l(w.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}function is(i,e=1/0,t){if(e<=0||!co(i)||i.__v_skip||(t=t||new Set,t.has(i)))return i;if(t.add(i),e--,qi(i))is(i.value,e,t);else if(Vi(i))for(let n=0;n{is(n,e,t)});else if(nA(i)){for(const n in i)is(i[n],e,t);for(const n of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,n)&&is(i[n],e,t)}return i}/** * @vue/runtime-core v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function Kd(i,e,t,n){try{return n?i(...n):i()}catch(r){Qv(r,e,t)}}function Jv(i,e,t,n){if(Pr(i)){const r=Kd(i,e,t,n);return r&&$b(r)&&r.catch(a=>{Qv(a,e,t)}),r}if(Vi(i)){const r=[];for(let a=0;a>>1,r=Ai[n],a=$o(r);a=$o(t)?Ai.push(i):Ai.splice(LA(e),0,i),i.flags|=1,jv()}}function jv(){Dh||(Dh=DA.then($v))}function Lh(i){Vi(i)?Wa.push(...i):ts&&i.id===-1?ts.splice(Ba+1,0,i):i.flags&1||(Wa.push(i),i.flags|=1),jv()}function UA(i){if(Wa.length){const e=[...new Set(Wa)].sort((t,n)=>$o(t)-$o(n));if(Wa.length=0,ts){ts.push(...e);return}for(ts=e,Ba=0;Bai.id==null?i.flags&2?-1:1/0:i.id;function $v(i){try{for(Er=0;Er1)return t&&Pr(e)?e.call(n&&n.proxy):e}}const BA=GA,zA=Symbol.for("v-scx"),HA=()=>FA(zA);function j_(i,e){return e0(i,null,e)}function ds(i,e,t){return e0(i,e,t)}function e0(i,e,t=Fd){const{immediate:n,deep:r,flush:a,once:l}=t,c=Lv({},t),u=e&&n||!e&&a!=="post";let h;if(Ih){if(a==="sync"){const _=HA();h=_.__watcherHandles||(_.__watcherHandles=[])}else if(!u){const _=()=>{};return _.stop=zc,_.resume=zc,_.pause=zc,_}}const d=Zd;c.call=(_,M,S)=>Jv(_,d,M,S);let p=!1;a==="post"?c.scheduler=_=>{BA(_,d&&d.suspense)}:a!=="sync"&&(p=!0,c.scheduler=(_,M)=>{M?_():IA(_)}),c.augmentJob=_=>{e&&(_.flags|=4),p&&(_.flags|=2,d&&(_.id=d.uid,_.i=d))};const m=CA(i,e,c);return Ih&&(h?h.push(m):u&&m()),m}function GA(i,e){e&&e.pendingBranch?Vi(i)?e.effects.push(...i):e.effects.push(i):Lh(i)}let Zd=null;{const i=zd(),e=(t,n)=>{let r;return(r=i[t])||(r=i[t]=[]),r.push(n),a=>{r.length>1?r.forEach(l=>l(a)):r[0](a)}};e("__VUE_INSTANCE_SETTERS__",t=>Zd=t),e("__VUE_SSR_SETTERS__",t=>Ih=t)}let Ih=!1;const t0="Ovee.js",n0=()=>{},$_=()=>new Promise(i=>i());function kA(i,e){const t=new MutationObserver(n=>{n.forEach(r=>{const{type:a,attributeName:l}=r;a!=="attributes"||l!==i||e(r)})});return{observer:t,observe:n=>{t.observe(n,{attributes:!0,attributeFilter:[i]})},disconnect:()=>t.disconnect()}}const VA={childList:!0,subtree:!0};function eg(i,e,t){i.type==="childList"&&i[e].length>0&&t(Array.from(i[e]))}function WA(i,e,t){const n=new MutationObserver(a=>{a.forEach(l=>{eg(l,"addedNodes",e),eg(l,"removedNodes",t)})}),r=()=>{n.observe(i,VA)};return r(),{observer:n,run:r}}function tg(i){return typeof i=="function"}function Lr(i){return i==null}const XA=i=>!Lr(i);function Qa(i){const e=typeof i;return e==="string"||e==="object"&&i instanceof String}const qA={number:{get:i=>i?+i:NaN,set:i=>Lr(i)||isNaN(i)?"":`${i}`},boolean:{get:i=>!(Lr(i)||i.toLowerCase()==="false"),set:i=>i?"":null}};function Jd(i,e,t=""){try{return e()}catch(n){(Qa(t)?new Nn(t):t).error(`There was unexpected error while running ${i}`,n)}}class Yo{constructor(e){te(this,"name");te(this,"registered",new Array);this.name=e}emit(...e){const t=new Array;this.registered.forEach(n=>{Jd(this.name,()=>n.cb(...e)),n.once&&t.push(n)}),t.forEach(n=>{const r=this.registered.indexOf(n);this.remove(r)})}on(e,t=!1){this.registered.push({cb:e,once:t})}off(e){const t=this.registered.findIndex(n=>n.cb===e);this.remove(t)}remove(e){e<0||this.registered.splice(e,1)}}function i0(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase()}function YA(i){return typeof i=="function"&&i.__ovee_component_definition===!0}function KA(i){return typeof i=="function"&&i.__ovee_module_definition===!0}function ng(i){const{nodeName:e,nodeType:t}=i;return t===1&&i instanceof HTMLElement&&e.toLowerCase()!=="script"}const vs=i=>`No component context was found. Did you used '${i}' inside setup function?`;class ZA{constructor(e){te(this,"element");te(this,"connected",!1);this.element=e}connect(){this.connected||(this.connected=!0,this.observer.observe(this.element,this.observeOptions))}disconnect(){this.connected&&(this.connected=!1,this.observer.disconnect())}}function JA(i,e){const t={...i};for(const n of e)n in t&&delete t[n];return t}function r0(i,e){window.customElements&&window.customElements.define(e,i)}class ig extends Promise{constructor(){let t,n;super((r,a)=>{t=r,n=a});te(this,"resolved");te(this,"rejected");te(this,"finished");te(this,"resolve");te(this,"reject");this.resolved=!1,this.rejected=!1,this.finished=!1,this.resolve=(...r)=>{this.resolved=!0,this.finished=!0,t(...r)},this.reject=(...r)=>{this.rejected=!0,this.finished=!0,n(...r)}}static get[Symbol.species](){return Promise}get[Symbol.toStringTag](){return"Task"}}const QA=" ~ ";class Nn{constructor(e="",t=t0,n=QA){te(this,"subnamespace");te(this,"namespace");te(this,"connector");this.subnamespace=e,this.namespace=t,this.connector=n}get basePrefix(){return this.createPrefix([this.namespace,this.subnamespace])}createPrefix(e){return`[${e.filter(n=>!!n).join(this.connector)}]`}logMessage(e,t,n=[]){const r=[...t],a=console[e];if(t.length===0){a(...r);return}const l=r[0],c=Qa(l)?l:"",u=this.getMessage(c,n);Qa(l)?r[0]=u:r.unshift(u),a(...r)}getMessage(e,t=[]){const n=t.length===0?this.basePrefix:this.createPrefix([this.namespace,this.subnamespace,...t]);return e?`${n} ${e}`:n}log(...e){this.logMessage("log",e)}logSpecific(e,...t){this.logMessage("log",t,e)}warn(...e){this.logMessage("warn",e)}warnSpecific(e,...t){this.logMessage("warn",t,e)}info(...e){this.logMessage("info",e)}infoSpecific(e,...t){this.logMessage("info",t,e)}error(...e){this.logMessage("error",e)}errorSpecific(e,...t){this.logMessage("error",t,e)}}const jA=new Nn("componentContext");let tu=null;function $A(i){return tu=i,()=>{tu=null}}function xs(i=!1){return!i&&!tu&&jA.warn("No component context was found. Did you used inject inside setup function?"),tu}class ew extends CustomEvent{}function s0(i,e,t){const n=e instanceof Event?e:new ew(e,{detail:t});i.dispatchEvent(n)}const tw=new Nn("EventDelegate");class a0{constructor(e,t){te(this,"targetElement");te(this,"context");te(this,"listeners",[]);this.targetElement=e,this.context=t}on(e,t,n){const r=n?JA(n??{},["root","target","multiple"]):void 0,{targetOption:a,target:l}=this.getTarget(n),c=[];if(!l)return n0;e.split(" ").forEach(h=>{const d=(...m)=>t.apply(this.context,m),p=Array.isArray(l)?l:[l];p.forEach(m=>{m.addEventListener(h,d,r)}),c.push(()=>{p.forEach(m=>m.removeEventListener(h,d))})});const u={cleared:!1,events:e,callback:t,removeListeners:c,target:a};return this.listeners.push(u),()=>this.clearListener(u)}off(e,t,n){const{targetOption:r}=this.getTarget(n),a=this.listeners.find(l=>l.events===e&&l.callback===t&&this.areTargetsTheSame(l.target,r));a&&this.clearListener(a)}areTargetsTheSame(e,t){return Array.isArray(e)?Array.isArray(t)?e.every((n,r)=>t[r]===n):!1:e===t}getTarget(e){const t=(e==null?void 0:e.target)??this.targetElement;let n;if(Qa(t)){const r=e==null?void 0:e.root,a=e==null?void 0:e.multiple,l=r?document:this.targetElement,c=a?Array.from(l.querySelectorAll(t)):l.querySelector(t);if(!c||Array.isArray(c)&&!c.length){if(!(e!=null&&e.optional)){const u=`Could not find element${a?"s":""} with selector '${t}' ${r?"in document":"relatively to current element"}`;tw.error(u)}n=null}else n=c}else n=t;return{target:n,targetOption:t}}clearListener(e){if(e.cleared)return;e.removeListeners.forEach(n=>n()),e.cleared=!0;const t=this.listeners.findIndex(n=>n===e);t>=0&&this.listeners.splice(t,1)}emit(e,t){s0(this.targetElement,e,t)}destroy(){this.listeners=this.listeners.filter(e=>(e.removeListeners.forEach(t=>t()),!1))}}function nu(){}nu.expected="boolean";nu.validate=i=>i===!0||i===!1;function Qd(){}Qd.expected="string";Qd.validate=i=>nw(i,"string",String);function jd(){}jd.expected="function";jd.validate=i=>typeof i=="function";function $d(){return null}$d.expected="null";$d.validate=i=>i===null;function nw(i,e,t){return typeof i===e||i instanceof t}function iw(i){const e={};for(const t in i){const n=i[t],r=Array.isArray(n)||tg(n)||n===null?{type:n}:n,a=(Array.isArray(r.type)?r.type:[r.type]).map(u=>u===null?$d:u),l=n!=null&&"default"in n?tg(n.default)&&!(a.length===1&&a[0]===jd)?n.default:()=>n.default:void 0,c={...r,type:a,default:l,shouldCast:!1,shouldCastTrue:!0};if(e[t]=c,a.length>1)for(const u of a)if(u===nu){c.shouldCast=!0;break}else u===Qd&&(c.shouldCastTrue=!1);else a[0]===nu&&(c.shouldCast=!0)}return e}function rw(i,e,t,n){for(const[r,a]of Object.entries(t))a&&(e[r]=sw(a,r,i[r],r in i,n),delete i[r]);return i}function sw(i,e,t,n,r){const a=i.default,l=!!a;return l&&t===void 0&&(e in r?t=r[e]:t=r[e]=a()),i.shouldCast&&(n&&!l?t=!1:i.shouldCastTrue&&t===""&&(t=!0)),t}class o0{constructor(e,t,n,r,a,l,c){te(this,"name");te(this,"element");te(this,"app");te(this,"component");te(this,"options");te(this,"mounted",!1);te(this,"beforeMountBus",new Yo("onBeforeMount"));te(this,"mountBus",new Yo("onMounted"));te(this,"unmountBus",new Yo("onUnmounted"));te(this,"props",Yd({}));te(this,"renderPromise");te(this,"jsxSlot");te(this,"instance");te(this,"eventDelegate");te(this,"scope");te(this,"cachedPropsDefaults",{});this.name=e,this.element=t,this.app=n,this.component=r,this.options=a,this.eventDelegate=new a0(t,this),l&&(this.jsxSlot=TA(l)),c==null||c(this);const u=$A(this);this.scope=Iv(!0),this.instance=this.scope.run(()=>Jd("component setup",()=>r(t,this.componentContext,this.options))??{}),u(),this.saveInstanceOnElement(),this.scope.run(()=>this.beforeMountBus.emit())}get unmounted(){return!this.mounted}get oveeElement(){return this.element}get rawProps(){return this.component.__ovee_props}get componentContext(){return{name:this.name,app:this.app,props:this.props,emit:(...e)=>this.emit(...e),on:(...e)=>this.on(...e),off:(...e)=>this.off(...e)}}mount(){if(!this.mounted){if(this.renderPromise){this.renderPromise.then(()=>{this.renderPromise&&(this.renderPromise=void 0,this.mount())});return}this.mounted=!0,this.scope.run(()=>this.mountBus.emit())}}unmount(){this.mounted&&(this.mounted=!1,this.scope.stop(),this.unmountBus.emit(),this.eventDelegate.destroy())}saveInstanceOnElement(){const e=this;if(!this.oveeElement._OveeComponentInstances)this.oveeElement._OveeComponentInstances=[e];else{if(this.oveeElement._OveeComponentInstances.includes(e))return;this.oveeElement._OveeComponentInstances.push(e)}}on(e,t,n){return this.eventDelegate.on(e,t,n)}off(e,t,n){return this.eventDelegate.off(e,t,n)}emit(e,t){this.eventDelegate.emit(e,t)}updateProps(e){return rw(e,this.props,this.component.__ovee_props,this.cachedPropsDefaults)}}class l0 extends HTMLElement{}function aw(i,e){let t=!1;class n extends l0{constructor(){super();te(this,"_OveeInternalInstance");te(this,"_OveeComponentInstances");this._OveeInternalInstance=e(this),this._OveeComponentInstances=[this._OveeInternalInstance]}connectedCallback(){this._OveeInternalInstance.mount()}disconnectedCallback(){this._OveeInternalInstance.unmount()}}return{ComponentElement:n,register:()=>{t||(r0(n,i),t=!0)}}}const c0="ovee-anonymous";class ow extends l0{constructor(){super();te(this,"_OveeInternalInstance");te(this,"_OveeComponentInstances",[])}setup(t){this._OveeInternalInstance=t,this._OveeComponentInstances.push(t)}connectedCallback(){this._OveeInternalInstance.mount()}disconnectedCallback(){this._OveeInternalInstance.unmount()}}r0(ow,c0);let Gc=null;function lw(){return Gc}function cw(i,e){const t=Gc;Gc=i,e(),Gc=t}function uw(i,e){const t=typeof i=="function"?i:e,n=typeof i=="function"?{}:i;return t.__ovee_component_definition=!0,t.__ovee_props=iw(n),t.jsx=(r,a)=>{var m,_;const l=c0,{children:c={}}=r;let u=r;if(delete r.children,a.effectTag!=="PLACEMENT"){const M=(_=(m=a.alternate)==null?void 0:m.firstChild)==null?void 0:_.node;if(a.effectTag==="UPDATE"){const S=M._OveeInternalInstance;S&&(S.jsxSlot&&(S.jsxSlot.value=c),u=S.updateProps(u))}return{type:l,node:M,props:u}}const h=lw();if(!h)return{type:l,props:u};const d=document.createElement(l),p=new o0("anonymous",d,h.app,t,{},c,M=>{u=M.updateProps(u)});return d.setup(p),{type:l,node:d,props:u}},t}function fw(i,e,t,n){const r=n||{},a=c=>new o0(e,c,i,t,r),{register:l}=aw(e,a);return{name:e,component:t,options:r,factory:a,register:l}}const hw=new Nn("onBeforeMount");function dw(i){const e=xs(!0);if(!e){hw.warn(vs("onBeforeMount"));return}e.beforeMountBus.on(i)}class pw{constructor(e){te(this,"app");te(this,"configurator");te(this,"storedComponents",new Map);te(this,"componentsToMount",new Array);te(this,"mountTimeout",null);this.app=e,this.configurator=e.configurator,this.setupComponents()}get componentCssClass(){return`${this.configurator.config.namespace}-component`}get root(){return this.app.rootElement}run(){this.attachMutationObserver(this.root),this.registerCustomElements(),this.harvestComponents(this.root)}destroy(){this.mountTimeout&&clearTimeout(this.mountTimeout),this.destroyComponents(this.root)}setupComponents(){this.configurator.registeredComponents.forEach(({name:e,component:t,options:n})=>{const r=i0(e);this.storedComponents.set(r,fw(this.app,r,t,n))})}registerCustomElements(){this.storedComponents.forEach(e=>e.register())}attachMutationObserver(e){WA(e,t=>{t.filter(ng).forEach(n=>this.harvestComponents(n))},t=>{t.filter(ng).filter(n=>!n.parentNode).forEach(n=>this.destroyComponents(n))})}harvestComponents(e){this.forEachFoundComponent(e,(t,n)=>{this.makeComponent(t,n)})}destroyComponents(e){this.forEachFoundComponent(e,t=>{this.destroyComponent(t)})}forEachFoundComponent(e,t){this.storedComponents.forEach(n=>{const r=`[data-${n.name}]`;e.querySelectorAll(r).forEach(a=>{a instanceof HTMLElement&&t(a,n)}),e.matches(r)&&t(e,n)})}makeComponent(e,{component:t,factory:n}){var a;if((a=e._OveeComponentInstances)!=null&&a.find(l=>l.component===t))return;const r=n(e);e.classList.add(this.componentCssClass),this.addComponentsToMount(r)}destroyComponent(e){e._OveeComponentInstances&&(e._OveeComponentInstances.forEach(t=>t.unmount()),e.classList.remove(this.componentCssClass),delete e._OveeComponentInstances)}addComponentsToMount(...e){this.componentsToMount.push(...e),this.scheduleComponentsMount()}scheduleComponentsMount(){this.mountTimeout||(this.mountTimeout=setTimeout(()=>{this.mountComponents()}))}mountComponents(){this.mountTimeout=null,this.componentsToMount.forEach(e=>e.mount())}}const Of=new Nn("createApp");class mw{constructor(e){te(this,"_config");te(this,"registeredModules",new Map);te(this,"registeredComponents",new Map);this._config=e}get config(){return this._config}get document(){return this._config.document??document}updateConfig(e){return this._config={...this._config,...e},this}run(e){const t=new yw(this,e),n=()=>t.run();return this.document.readyState==="loading"?this.document.addEventListener("DOMContentLoaded",n,{once:!0}):n(),t}use(e,t,n){return this.validateModule(e,t)?(this.validateOptions(e,n)||(n=void 0),this.registeredModules.set(e,{name:e,module:t,options:n}),this):this}useMany(e){for(const[t,n]of Object.entries(e)){const[r,a]=Array.isArray(n)?n:[n];this.use(t,r,a)}return this}validateModule(e,t){return KA(t)?!0:(Of.warn(`Received value that is not a module definition under name '${e}', skipping. Did you used 'defineModule'?`),!1)}component(e,t,n){return this.validateComponent(e,t)?(this.validateOptions(e,n)||(n=void 0),this.registeredComponents.set(e,{name:e,component:t,options:n}),this):this}components(e){for(const[t,n]of Object.entries(e)){const[r,a]=Array.isArray(n)?n:[n];this.component(t,r,a)}return this}validateComponent(e,t){return YA(t)?!0:(Of.warn(`Received value that is not a component definition under name '${e}', skipping. Did you used 'defineComponent'?`),!1)}validateOptions(e,t){return Lr(t)?!0:typeof t!="object"||Array.isArray(t)?(Of.warn(`Received wrong options type under name '${e}', ignoring.`),!1):!0}}const u0={namespace:"ovee",productionTip:!1,document};function _w(i={}){return new mw({...u0,...i})}const gw=new Nn("moduleContext");let iu=null;function vw(i){return iu=i,()=>{iu=null}}function xw(i=!1){return!i&&!iu&&gw.warn("No module context was found. Did you used inject inside module's setup function?"),iu}class Sw{constructor(e,t,n){te(this,"app");te(this,"module");te(this,"options");te(this,"initialized",!1);te(this,"initBus",new Yo("onInit"));te(this,"destroyBus",new Yo("onDestroy"));te(this,"scope");te(this,"instance");this.app=e,this.module=t,this.options=n;const r=vw(this);this.scope=Iv(!0),this.instance=this.scope.run(()=>Jd("module setup",()=>t({app:e,options:n}))??{}),r()}init(){this.initialized||(this.initialized=!0,this.scope.run(()=>this.initBus.emit()))}destroy(){this.initialized&&(this.initialized=!1,this.scope.stop(),this.destroyBus.emit())}}const rg=new Nn("App");class Mw{constructor(e){te(this,"app");te(this,"configurator");te(this,"modules",new Map);this.app=e,this.configurator=e.configurator,this.createModules()}run(){this.initModules()}destroy(){this.destroyModules()}createModules(){this.configurator.registeredModules.forEach(({module:e,name:t,options:n={}})=>{this.modules.set(t,new Sw(this.app,e,n))})}initModules(){this.modules.forEach(e=>e.init())}destroyModules(){this.modules.forEach(e=>e.destroy())}getModule(e){let t="";if(Qa(e)?t=e:[t]=Array.from(this.configurator.registeredModules.entries()).find(([,r])=>r.module===e)??[""],!t)throw new Error(rg.getMessage("Couldn't find this module. Did you regitered it properly?"));const n=this.modules.get(t);if(!n)throw new Error(rg.getMessage(`Module '${t}' is not registered`));return{instance:n.instance,options:n.options}}}var fl;class yw{constructor(e,t){te(this,"configurator");te(this,"rootElement");te(this,"$eventDelegate");te(this,"componentsManager");te(this,"modulesManager");Y_(this,fl,!1);this.configurator=e,this.rootElement=t,this.$eventDelegate=new a0(this.document,this),this.componentsManager=new pw(this),this.modulesManager=new Mw(this)}get initialized(){return q_(this,fl)}get config(){return this.configurator.config}get document(){return this.config.document??document}run(){this.displayDevTip(),this.modulesManager.run(),this.componentsManager.run(),this.bindDomEvents(),K_(this,fl,!0),s0(this.document,this.eventName("initialized"))}bindDomEvents(){this.onDomUpdated=this.onDomUpdated.bind(this),this.rootElement.addEventListener(this.eventName("dom:updated"),this.onDomUpdated,{passive:!0})}onDomUpdated(e){setTimeout(()=>{e.target&&this.componentsManager.harvestComponents(e.target)})}destroy(){this.initialized&&(this.rootElement.removeEventListener(this.eventName("dom:updated"),this.onDomUpdated),this.componentsManager.destroy(),this.modulesManager.destroy())}getModule(e){return this.modulesManager.getModule(e)}$on(e,t,n){return this.$eventDelegate.on(e,t,n)}$off(e,t,n){return this.$eventDelegate.off(e,t,n)}$emit(e,t){this.$eventDelegate.emit(e,t)}displayDevTip(){const e="production".toLowerCase();e!=="production"&&e!=="test"&&this.config.productionTip!==!1&&console.info(`You are running ${t0} in development mode. Make sure to turn on production mode when deploying for production.`)}eventName(e){const t=this.config.namespace??u0.namespace;return t?`${t}:${e}`:e}}fl=new WeakMap;const Ew=new Nn("onDestroy");function Tw(i,e=!1){const t=xw(!0),n=xs(!0);if(!t&&!n){e||Ew.warn(vs("onDestroy"));return}const r=(t==null?void 0:t.destroyBus)||(n==null?void 0:n.unmountBus);r==null||r.on(i)}function uo(i){Tw(i,!0)}const bw=new Nn("onMounted");function f0(i,e=!1){const t=xs(!0);if(!t){e||bw.warn(vs("onMounted"));return}t.mountBus.on(i)}const Aw=new Nn("onUnmounted");function h0(i,e=!1){const t=xs(!0);if(!t){e||Aw.warn(vs("onUnmounted"));return}t.unmountBus.on(i)}const ww=new Nn("useDataAttr");function kc(i,e){const t=xs(!0);if(!t)return ww.warn(vs("useDataAttr")),ci(null);if(Array.isArray(i))return i.map(d=>kc(d));if(!Qa(i))return Object.entries(i).reduce((d,[p,m])=>(m?d[p]=kc(p,m):d[p]=kc(p),d),{});const n=ci(),r=typeof e=="string"?qA[e]:e,a=`data-${i0(i)}`,l=or({get(){return h(),n.value},set(d){const p=r?r.set(d):d;Lr(p)?delete t.element.dataset[i]:t.element.dataset[i]=p}}),{observe:c,disconnect:u}=kA(a,()=>h());f0(()=>{c(t.element)}),h0(()=>{u()}),h();function h(){const d=t.element.dataset[i];n.value=r?r.get(d):d}return l}const Rw=new Nn("useElementRef");function Cw(i){return xs(!0)?Lw(`[ref="${i}"]`):(Rw.warn(vs("useElementRef")),or(()=>null))}const Pw=new Nn("useQuerySelector"),Dw={subtree:!0,childList:!0};function Lw(i,e){const t=xs(!0);return t?Iw(t,i):(Pw.warn(vs("useQuerySelector")),or(()=>null))}function Iw(i,e,t){const n=i.element,r=ci(null),a=()=>n.querySelector(e),l=()=>{r.value=a()},c=ep.getInstance(i);return c.register(l),l(),f0(()=>{c.connect()}),h0(()=>{c.disconnect()}),or(()=>r.value)}const sg=new Map;class ep extends ZA{constructor(t){super(t);te(this,"connected",!1);te(this,"observer");te(this,"callbacks",[]);te(this,"observeOptions",Dw);this.observer=new MutationObserver(()=>{this.callbacks.forEach(n=>n())}),this.connect()}register(t){this.callbacks.push(t)}static getInstance(t){let n=sg.get(t);return n||(n=new ep(t.element),sg.set(t,n)),n}}const Uw="__TEXT_FIBER",d0="__FRAGMENT",Nw=i=>!!i&&i===i.toUpperCase(),ag=i=>i.startsWith("on")&&Nw(i[2]),og=i=>i!=="children",Ff=(i,e)=>t=>t in e&&!(t in i)?!0:i[t]!==e[t],Ow=(i,e)=>t=>!(t in e)||Lr(e[t])&&i[t]!==e[t],p0=i=>typeof i.type=="function",lg=(i,e)=>{const t=i&&e&&i.type===e.type;if(!t)return!1;const n=i.key,r=e.key;return!Lr(n)&&!Lr(r)?n===r:t},Vc=new Nn("JSX Renderer");class Fw{constructor(){te(this,"currentRoot",null);te(this,"wipRoot",null);te(this,"toDelete",[])}process(e,t){if(!t)return;this.wipRoot={type:"ROOT",node:t,alternate:this.currentRoot,props:{children:e?[e]:[]}},this.toDelete=[];let n=this.wipRoot;for(;n;)n=this.processFiber(n)}processFiber(e){const t=p0(e)?Bw(e):e.props.children;if(zw(e),Gw(this.toDelete,e,t),e.firstChild)return e.firstChild;let n=e;for(;n;){if(n.nextSibling)return n.nextSibling;n=n.parent}return null}render(){this.wipRoot&&(this.toDelete.forEach(e=>m0(e)),this.connectNodes(this.wipRoot.node,this.wipRoot.firstChild),this.wipRoot.prevSiblingNode=this.wipRoot.node.lastChild,this.commitWork(this.wipRoot.firstChild),this.currentRoot=this.wipRoot,this.wipRoot=null)}connectNodes(e,t){if(!t)return null;t.parentNode=e;const n=[];return _0(t,r=>{const a=this.connectNodes(t.node||e,r);a&&n.push(a)}),n.forEach((r,a)=>{const l=n[a+1],c=Array.isArray(r)?r[r.length-1]:r,u=Array.isArray(l)?l[0]:l;u&&(c.nextSiblingNode=u.node,u.prevSiblingNode=c.node)}),t.node?t:n.length?n.flat():null}commitWork(e){if(!e)return;const{parentNode:t}=e;t?e.effectTag==="PLACEMENT"?kw(e,t):e.effectTag==="UPDATE"?tp(e.node,e):Vc.error("Node to delete appeared in a tree with a work to commit"):e.type===d0?Vc.error("Fragment was used without an existing parent."):Vc.error("Unprocessed fiber was passed. Aborting"),this.commitWork(e.firstChild),this.commitWork(e.nextSibling)}}function Bw(i){return[i.type(i.props,i)]}function zw(i){p0(i)||i.type===d0||(i.node?tp(i.node,i):i.node=Hw(i))}function Hw(i){var t;const e=i.type===Uw?document.createTextNode(((t=i.props)==null?void 0:t.nodeValue)??""):document.createElement(i.type);return tp(e,i),e}function Gw(i,e,t){var d;const n=p=>{p.effectTag="DELETION",i.push(p)},r=(p,m)=>{p.node=m==null?void 0:m.node,p.parent=e,p.alternate=m,p.effectTag="UPDATE"},a=p=>{for(let m=0;m0;p++){const m=t[p];if(!m.key)continue;const _=l.findIndex(S=>lg(S,m)),M=l[_];M&&(a(l.splice(0,_+1)),r(m,M))}l.forEach(n);let h;for(let p=0;plg(S,m)),M=c[_];M?(a(c.splice(0,_+1)),r(m,M)):(m.parent=e,m.effectTag="PLACEMENT")}p===0?e.firstChild=m:h.nextSibling=m,p===t.length-1&&(e.lastChild=m),h=m}c.forEach(n)}function m0(i){if(!i||!i.parentNode)return;const{parentNode:e}=i;if(i.node)try{e.removeChild(i.node)}catch(t){Vc.error("There was a problem while removing node",i.node,t)}else _0(i,t=>m0(t))}function kw(i,e){var n;const t=i.node;if(t){if(!i.prevSiblingNode)return e.insertBefore(t,e.firstChild);if(!i.nextSiblingNode)return e.appendChild(t);e.insertBefore(t,((n=i.prevSiblingNode)==null?void 0:n.nextSibling)||null)}}function tp(i,e){var a;if(!i)return;const t=i,n=e.props,r=((a=e.alternate)==null?void 0:a.props)??{};if(t instanceof Text){t.nodeValue=n.nodeValue;return}Object.keys(r).filter(ag).filter(l=>!(l in n)||Ff(r,n)(l)).forEach(l=>{const c=l.toLowerCase().substring(2);t.removeEventListener(c,r[l])}),Object.keys(r).filter(og).filter(Ow(r,n)).forEach(l=>{t.removeAttribute(l)}),Object.keys(n).filter(og).filter(Ff(r,n)).forEach(l=>{let c=n[l];c===!0&&(c=""),!Lr(c)&&t.setAttribute(l,c)}),Object.keys(n).filter(l=>ag(l)).filter(Ff(r,n)).forEach(l=>{const c=l.toLowerCase().substring(2);t.addEventListener(c,n[l])})}function _0(i,e){let t=i==null?void 0:i.firstChild;for(;t;)e(t),t=t.nextSibling}const Vw=new Nn("useTemplate"),cg=new Map;function Ww(i){const e=xs(!0);if(!e)return Vw.warn(vs("useTemplate")),{requestUpdate:$_};let t=cg.get(e);return t||(t={renderer:new Fw,templates:[],requestUpdate:$_},t.requestUpdate=Xw(e,t),cg.set(e,t)),t.templates.push(i),{requestUpdate:t.requestUpdate}}function Xw(i,e){const t=()=>e.templates[e.templates.length-1](),n=new Uv(()=>{const d=t();cw({app:i.app},()=>{e.renderer.process(d,i.element)})},n0,()=>Lh(r)),r=d=>{(n.dirty||d)&&(n.run(),l())};let a=null;function l(){a||(a=new ig,Lh(c))}function c(){e.renderer.render(),a==null||a.resolve(),a=null}let u=null;async function h(){if(u)return u;u=new ig,r(!0),a==null||a.then(()=>{u==null||u.resolve()})}return dw(()=>{r(!0),a&&(i.renderPromise=a)}),h}function qw(i){return["string","number","boolean"].includes(typeof i)}function Yw(i){return i==null}const Kw=i=>!Yw(i),Zw="__TEXT_FIBER";function Jw(i,e={},t){if(typeof i=="string"){const r=e,a=e.children;return a&&(r.children=Qw(a)),{type:i,props:r,key:t}}return{type:i,props:e,key:t}}function Qw(i){if(Array.isArray(i))return i.flatMap(n=>Array.isArray(n)?n.map(Bf):Bf(n)).filter(Kw);const e=Bf(i);return e?[e]:[]}function Bf(i){return qw(i)?jw(i):i}function jw(i){return{type:Zw,props:{nodeValue:i}}}const $w=Jw;var za=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},eR={exports:{}};(function(i,e){(function(t,n){i.exports=n()})(za,function(){var t=function(){function n(_){return l.appendChild(_.dom),_}function r(_){for(var M=0;Mu+1e3&&(d.update(1e3*h/(_-u),100),u=_,h=0,m)){var M=performance.memory;m.update(M.usedJSHeapSize/1048576,M.jsHeapSizeLimit/1048576)}return _},update:function(){c=this.end()},domElement:l,setMode:r}};return t.Panel=function(n,r,a){var l=1/0,c=0,u=Math.round,h=u(window.devicePixelRatio||1),d=80*h,p=48*h,m=3*h,_=2*h,M=3*h,S=15*h,x=74*h,v=30*h,D=document.createElement("canvas");D.width=d,D.height=p,D.style.cssText="width:80px;height:48px";var w=D.getContext("2d");return w.font="bold "+9*h+"px Helvetica,Arial,sans-serif",w.textBaseline="top",w.fillStyle=a,w.fillRect(0,0,d,p),w.fillStyle=r,w.fillText(n,m,_),w.fillRect(M,S,x,v),w.fillStyle=a,w.globalAlpha=.9,w.fillRect(M,S,x,v),{dom:D,update:function(E,N){l=Math.min(l,E),c=Math.max(c,E),w.fillStyle=a,w.globalAlpha=1,w.fillRect(0,0,d,S),w.fillStyle=r,w.fillText(u(E)+" "+n+" ("+u(l)+"-"+u(c)+")",m,_),w.drawImage(D,M+h,S,x-h,v,M,S,x-h,v),w.fillRect(M+x-h,S,h,v),w.fillStyle=a,w.globalAlpha=.9,w.fillRect(M+x-h,S,h,u((1-E/N)*v))}}},t})})(eR);/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT */const np="170",tR=0,ug=1,nR=2,g0=1,iR=2,Tr=3,ps=0,Vn=1,wr=2,cs=0,Xa=1,fg=2,hg=3,dg=4,rR=5,ks=100,sR=101,aR=102,oR=103,lR=104,cR=200,uR=201,fR=202,hR=203,Uh=204,Nh=205,dR=206,pR=207,mR=208,_R=209,gR=210,vR=211,xR=212,SR=213,MR=214,Oh=0,Fh=1,Bh=2,ja=3,zh=4,Hh=5,Gh=6,kh=7,v0=0,yR=1,ER=2,us=0,TR=1,bR=2,AR=3,wR=4,RR=5,CR=6,PR=7,x0=300,$a=301,eo=302,Vh=303,Wh=304,pu=306,el=1e3,Ws=1001,Xh=1002,Yi=1003,DR=1004,mc=1005,nr=1006,zf=1007,Xs=1008,Ir=1009,S0=1010,M0=1011,tl=1012,ip=1013,ea=1014,Rr=1015,pl=1016,rp=1017,sp=1018,to=1020,y0=35902,E0=1021,T0=1022,Gi=1023,b0=1024,A0=1025,qa=1026,no=1027,w0=1028,ap=1029,R0=1030,op=1031,lp=1033,Wc=33776,Xc=33777,qc=33778,Yc=33779,qh=35840,Yh=35841,Kh=35842,Zh=35843,Jh=36196,Qh=37492,jh=37496,$h=37808,ed=37809,td=37810,nd=37811,id=37812,rd=37813,sd=37814,ad=37815,od=37816,ld=37817,cd=37818,ud=37819,fd=37820,hd=37821,Kc=36492,dd=36494,pd=36495,C0=36283,md=36284,_d=36285,gd=36286,LR=3200,IR=3201,UR=0,NR=1,rs="",si="srgb",fo="srgb-linear",mu="linear",Dt="srgb",Ea=7680,pg=519,OR=512,FR=513,BR=514,P0=515,zR=516,HR=517,GR=518,kR=519,mg=35044,_g="300 es",Cr=2e3,ru=2001;class ho{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let a=0,l=r.length;a>8&255]+Mn[i>>16&255]+Mn[i>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[t&63|128]+Mn[t>>8&255]+"-"+Mn[t>>16&255]+Mn[t>>24&255]+Mn[n&255]+Mn[n>>8&255]+Mn[n>>16&255]+Mn[n>>24&255]).toLowerCase()}function kn(i,e,t){return Math.max(e,Math.min(t,i))}function VR(i,e){return(i%e+e)%e}function Gf(i,e,t){return(1-t)*i+t*e}function Uo(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Hn(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}class Ft{constructor(e=0,t=0){Ft.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(kn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),a=this.x-e.x,l=this.y-e.y;return this.x=a*n-l*r+e.x,this.y=a*r+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class rt{constructor(e,t,n,r,a,l,c,u,h){rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,a,l,c,u,h)}set(e,t,n,r,a,l,c,u,h){const d=this.elements;return d[0]=e,d[1]=r,d[2]=c,d[3]=t,d[4]=a,d[5]=u,d[6]=n,d[7]=l,d[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,a=this.elements,l=n[0],c=n[3],u=n[6],h=n[1],d=n[4],p=n[7],m=n[2],_=n[5],M=n[8],S=r[0],x=r[3],v=r[6],D=r[1],w=r[4],E=r[7],N=r[2],U=r[5],L=r[8];return a[0]=l*S+c*D+u*N,a[3]=l*x+c*w+u*U,a[6]=l*v+c*E+u*L,a[1]=h*S+d*D+p*N,a[4]=h*x+d*w+p*U,a[7]=h*v+d*E+p*L,a[2]=m*S+_*D+M*N,a[5]=m*x+_*w+M*U,a[8]=m*v+_*E+M*L,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],a=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8];return t*l*d-t*c*h-n*a*d+n*c*u+r*a*h-r*l*u}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],a=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],p=d*l-c*h,m=c*u-d*a,_=h*a-l*u,M=t*p+n*m+r*_;if(M===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/M;return e[0]=p*S,e[1]=(r*h-d*n)*S,e[2]=(c*n-r*l)*S,e[3]=m*S,e[4]=(d*t-r*u)*S,e[5]=(r*a-c*t)*S,e[6]=_*S,e[7]=(n*u-h*t)*S,e[8]=(l*t-n*a)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,a,l,c){const u=Math.cos(a),h=Math.sin(a);return this.set(n*u,n*h,-n*(u*l+h*c)+l+e,-r*h,r*u,-r*(-h*l+u*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(kf.makeScale(e,t)),this}rotate(e){return this.premultiply(kf.makeRotation(-e)),this}translate(e,t){return this.premultiply(kf.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const kf=new rt;function D0(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function nl(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function WR(){const i=nl("canvas");return i.style.display="block",i}const gg={};function Ho(i){i in gg||(gg[i]=!0,console.warn(i))}function XR(i,e,t){return new Promise(function(n,r){function a(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(a,t);break;default:n()}}setTimeout(a,t)})}function qR(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function YR(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const xt={enabled:!0,workingColorSpace:fo,spaces:{},convert:function(i,e,t){return this.enabled===!1||e===t||!e||!t||(this.spaces[e].transfer===Dt&&(i.r=Dr(i.r),i.g=Dr(i.g),i.b=Dr(i.b)),this.spaces[e].primaries!==this.spaces[t].primaries&&(i.applyMatrix3(this.spaces[e].toXYZ),i.applyMatrix3(this.spaces[t].fromXYZ)),this.spaces[t].transfer===Dt&&(i.r=Ya(i.r),i.g=Ya(i.g),i.b=Ya(i.b))),i},fromWorkingColorSpace:function(i,e){return this.convert(i,this.workingColorSpace,e)},toWorkingColorSpace:function(i,e){return this.convert(i,e,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===rs?mu:this.spaces[i].transfer},getLuminanceCoefficients:function(i,e=this.workingColorSpace){return i.fromArray(this.spaces[e].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,e,t){return i.copy(this.spaces[e].toXYZ).multiply(this.spaces[t].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace}};function Dr(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ya(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}const vg=[.64,.33,.3,.6,.15,.06],xg=[.2126,.7152,.0722],Sg=[.3127,.329],Mg=new rt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),yg=new rt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);xt.define({[fo]:{primaries:vg,whitePoint:Sg,transfer:mu,toXYZ:Mg,fromXYZ:yg,luminanceCoefficients:xg,workingColorSpaceConfig:{unpackColorSpace:si},outputColorSpaceConfig:{drawingBufferColorSpace:si}},[si]:{primaries:vg,whitePoint:Sg,transfer:Dt,toXYZ:Mg,fromXYZ:yg,luminanceCoefficients:xg,outputColorSpaceConfig:{drawingBufferColorSpace:si}}});let Ta;class KR{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Ta===void 0&&(Ta=nl("canvas")),Ta.width=e.width,Ta.height=e.height;const n=Ta.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Ta}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=nl("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),a=r.data;for(let l=0;l0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==x0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case el:e.x=e.x-Math.floor(e.x);break;case Ws:e.x=e.x<0?0:1;break;case Xh: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 el:e.y=e.y-Math.floor(e.y);break;case Ws:e.y=e.y<0?0:1;break;case Xh: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++}}Un.DEFAULT_IMAGE=null;Un.DEFAULT_MAPPING=x0;Un.DEFAULT_ANISOTROPY=1;class en{constructor(e=0,t=0,n=0,r=1){en.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,a=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*r+l[12]*a,this.y=l[1]*t+l[5]*n+l[9]*r+l[13]*a,this.z=l[2]*t+l[6]*n+l[10]*r+l[14]*a,this.w=l[3]*t+l[7]*n+l[11]*r+l[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,a;const u=e.elements,h=u[0],d=u[4],p=u[8],m=u[1],_=u[5],M=u[9],S=u[2],x=u[6],v=u[10];if(Math.abs(d-m)<.01&&Math.abs(p-S)<.01&&Math.abs(M-x)<.01){if(Math.abs(d+m)<.1&&Math.abs(p+S)<.1&&Math.abs(M+x)<.1&&Math.abs(h+_+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(h+1)/2,E=(_+1)/2,N=(v+1)/2,U=(d+m)/4,L=(p+S)/4,F=(M+x)/4;return w>E&&w>N?w<.01?(n=0,r=.707106781,a=.707106781):(n=Math.sqrt(w),r=U/n,a=L/n):E>N?E<.01?(n=.707106781,r=0,a=.707106781):(r=Math.sqrt(E),n=U/r,a=F/r):N<.01?(n=.707106781,r=.707106781,a=0):(a=Math.sqrt(N),n=L/a,r=F/a),this.set(n,r,a,t),this}let D=Math.sqrt((x-M)*(x-M)+(p-S)*(p-S)+(m-d)*(m-d));return Math.abs(D)<.001&&(D=1),this.x=(x-M)/D,this.y=(p-S)/D,this.z=(m-d)/D,this.w=Math.acos((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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class QR extends ho{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new en(0,0,e,t),this.scissorTest=!1,this.viewport=new en(0,0,e,t);const r={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:nr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const a=new Un(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);a.flipY=!1,a.generateMipmaps=n.generateMipmaps,a.internalFormat=n.internalFormat,this.textures=[];const l=n.count;for(let c=0;c=0?1:-1,w=1-v*v;if(w>Number.EPSILON){const N=Math.sqrt(w),U=Math.atan2(N,v*D);x=Math.sin(x*U)/N,c=Math.sin(c*U)/N}const E=c*D;if(u=u*x+m*E,h=h*x+_*E,d=d*x+M*E,p=p*x+S*E,x===1-c){const N=1/Math.sqrt(u*u+h*h+d*d+p*p);u*=N,h*=N,d*=N,p*=N}}e[t]=u,e[t+1]=h,e[t+2]=d,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,r,a,l){const c=n[r],u=n[r+1],h=n[r+2],d=n[r+3],p=a[l],m=a[l+1],_=a[l+2],M=a[l+3];return e[t]=c*M+d*p+u*_-h*m,e[t+1]=u*M+d*m+h*p-c*_,e[t+2]=h*M+d*_+c*m-u*p,e[t+3]=d*M-c*p-u*m-h*_,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,a=e._z,l=e._order,c=Math.cos,u=Math.sin,h=c(n/2),d=c(r/2),p=c(a/2),m=u(n/2),_=u(r/2),M=u(a/2);switch(l){case"XYZ":this._x=m*d*p+h*_*M,this._y=h*_*p-m*d*M,this._z=h*d*M+m*_*p,this._w=h*d*p-m*_*M;break;case"YXZ":this._x=m*d*p+h*_*M,this._y=h*_*p-m*d*M,this._z=h*d*M-m*_*p,this._w=h*d*p+m*_*M;break;case"ZXY":this._x=m*d*p-h*_*M,this._y=h*_*p+m*d*M,this._z=h*d*M+m*_*p,this._w=h*d*p-m*_*M;break;case"ZYX":this._x=m*d*p-h*_*M,this._y=h*_*p+m*d*M,this._z=h*d*M-m*_*p,this._w=h*d*p+m*_*M;break;case"YZX":this._x=m*d*p+h*_*M,this._y=h*_*p+m*d*M,this._z=h*d*M-m*_*p,this._w=h*d*p-m*_*M;break;case"XZY":this._x=m*d*p-h*_*M,this._y=h*_*p-m*d*M,this._z=h*d*M+m*_*p,this._w=h*d*p+m*_*M;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],a=t[8],l=t[1],c=t[5],u=t[9],h=t[2],d=t[6],p=t[10],m=n+c+p;if(m>0){const _=.5/Math.sqrt(m+1);this._w=.25/_,this._x=(d-u)*_,this._y=(a-h)*_,this._z=(l-r)*_}else if(n>c&&n>p){const _=2*Math.sqrt(1+n-c-p);this._w=(d-u)/_,this._x=.25*_,this._y=(r+l)/_,this._z=(a+h)/_}else if(c>p){const _=2*Math.sqrt(1+c-n-p);this._w=(a-h)/_,this._x=(r+l)/_,this._y=.25*_,this._z=(u+d)/_}else{const _=2*Math.sqrt(1+p-n-c);this._w=(l-r)/_,this._x=(a+h)/_,this._y=(u+d)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(kn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,a=e._z,l=e._w,c=t._x,u=t._y,h=t._z,d=t._w;return this._x=n*d+l*c+r*h-a*u,this._y=r*d+l*u+a*c-n*h,this._z=a*d+l*h+n*u-r*c,this._w=l*d-n*c-r*u-a*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,a=this._z,l=this._w;let c=l*e._w+n*e._x+r*e._y+a*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=l,this._x=n,this._y=r,this._z=a,this;const u=1-c*c;if(u<=Number.EPSILON){const _=1-t;return this._w=_*l+t*this._w,this._x=_*n+t*this._x,this._y=_*r+t*this._y,this._z=_*a+t*this._z,this.normalize(),this}const h=Math.sqrt(u),d=Math.atan2(h,c),p=Math.sin((1-t)*d)/h,m=Math.sin(t*d)/h;return this._w=l*p+this._w*m,this._x=n*p+this._x*m,this._y=r*p+this._y*m,this._z=a*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),a=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(t),a*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 ${constructor(e=0,t=0,n=0){$.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Eg.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Eg.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[3]*n+a[6]*r,this.y=a[1]*t+a[4]*n+a[7]*r,this.z=a[2]*t+a[5]*n+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,a=e.elements,l=1/(a[3]*t+a[7]*n+a[11]*r+a[15]);return this.x=(a[0]*t+a[4]*n+a[8]*r+a[12])*l,this.y=(a[1]*t+a[5]*n+a[9]*r+a[13])*l,this.z=(a[2]*t+a[6]*n+a[10]*r+a[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,a=e.x,l=e.y,c=e.z,u=e.w,h=2*(l*r-c*n),d=2*(c*t-a*r),p=2*(a*n-l*t);return this.x=t+u*h+l*p-c*d,this.y=n+u*d+c*h-a*p,this.z=r+u*p+a*d-l*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r,this.y=a[1]*t+a[5]*n+a[9]*r,this.z=a[2]*t+a[6]*n+a[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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,a=e.z,l=t.x,c=t.y,u=t.z;return this.x=r*u-a*c,this.y=a*l-n*u,this.z=n*c-r*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Wf.copy(this).projectOnVector(e),this.sub(Wf)}reflect(e){return this.sub(Wf.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(kn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Wf=new $,Eg=new _l;class gl{constructor(e=new $(1/0,1/0,1/0),t=new $(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t=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,Fi),Fi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(No),gc.subVectors(this.max,No),ba.subVectors(e.a,No),Aa.subVectors(e.b,No),wa.subVectors(e.c,No),Zr.subVectors(Aa,ba),Jr.subVectors(wa,Aa),Ps.subVectors(ba,wa);let t=[0,-Zr.z,Zr.y,0,-Jr.z,Jr.y,0,-Ps.z,Ps.y,Zr.z,0,-Zr.x,Jr.z,0,-Jr.x,Ps.z,0,-Ps.x,-Zr.y,Zr.x,0,-Jr.y,Jr.x,0,-Ps.y,Ps.x,0];return!Xf(t,ba,Aa,wa,gc)||(t=[1,0,0,0,1,0,0,0,1],!Xf(t,ba,Aa,wa,gc))?!1:(vc.crossVectors(Zr,Jr),t=[vc.x,vc.y,vc.z],Xf(t,ba,Aa,wa,gc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fi).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:(vr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const vr=[new $,new $,new $,new $,new $,new $,new $,new $],Fi=new $,_c=new gl,ba=new $,Aa=new $,wa=new $,Zr=new $,Jr=new $,Ps=new $,No=new $,gc=new $,vc=new $,Ds=new $;function Xf(i,e,t,n,r){for(let a=0,l=i.length-3;a<=l;a+=3){Ds.fromArray(i,a);const c=r.x*Math.abs(Ds.x)+r.y*Math.abs(Ds.y)+r.z*Math.abs(Ds.z),u=e.dot(Ds),h=t.dot(Ds),d=n.dot(Ds);if(Math.max(-Math.max(u,h,d),Math.min(u,h,d))>c)return!1}return!0}const $R=new gl,Oo=new $,qf=new $;class cp{constructor(e=new $,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):$R.setFromPoints(e).getCenter(n);let r=0;for(let a=0,l=e.length;athis.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;Oo.subVectors(e,this.center);const t=Oo.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(Oo,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(qf.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Oo.copy(e.center).add(qf)),this.expandByPoint(Oo.copy(e.center).sub(qf))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const xr=new $,Yf=new $,xc=new $,Qr=new $,Kf=new $,Sc=new $,Zf=new $;class eC{constructor(e=new $,t=new $(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,xr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=xr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(xr.copy(this.origin).addScaledVector(this.direction,t),xr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Yf.copy(e).add(t).multiplyScalar(.5),xc.copy(t).sub(e).normalize(),Qr.copy(this.origin).sub(Yf);const a=e.distanceTo(t)*.5,l=-this.direction.dot(xc),c=Qr.dot(this.direction),u=-Qr.dot(xc),h=Qr.lengthSq(),d=Math.abs(1-l*l);let p,m,_,M;if(d>0)if(p=l*u-c,m=l*c-u,M=a*d,p>=0)if(m>=-M)if(m<=M){const S=1/d;p*=S,m*=S,_=p*(p+l*m+2*c)+m*(l*p+m+2*u)+h}else m=a,p=Math.max(0,-(l*m+c)),_=-p*p+m*(m+2*u)+h;else m=-a,p=Math.max(0,-(l*m+c)),_=-p*p+m*(m+2*u)+h;else m<=-M?(p=Math.max(0,-(-l*a+c)),m=p>0?-a:Math.min(Math.max(-a,-u),a),_=-p*p+m*(m+2*u)+h):m<=M?(p=0,m=Math.min(Math.max(-a,-u),a),_=m*(m+2*u)+h):(p=Math.max(0,-(l*a+c)),m=p>0?a:Math.min(Math.max(-a,-u),a),_=-p*p+m*(m+2*u)+h);else m=l>0?-a:a,p=Math.max(0,-(l*m+c)),_=-p*p+m*(m+2*u)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(Yf).addScaledVector(xc,m),_}intersectSphere(e,t){xr.subVectors(e.center,this.origin);const n=xr.dot(this.direction),r=xr.dot(xr)-n*n,a=e.radius*e.radius;if(r>a)return null;const l=Math.sqrt(a-r),c=n-l,u=n+l;return u<0?null:c<0?this.at(u,t):this.at(c,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,a,l,c,u;const h=1/this.direction.x,d=1/this.direction.y,p=1/this.direction.z,m=this.origin;return h>=0?(n=(e.min.x-m.x)*h,r=(e.max.x-m.x)*h):(n=(e.max.x-m.x)*h,r=(e.min.x-m.x)*h),d>=0?(a=(e.min.y-m.y)*d,l=(e.max.y-m.y)*d):(a=(e.max.y-m.y)*d,l=(e.min.y-m.y)*d),n>l||a>r||((a>n||isNaN(n))&&(n=a),(l=0?(c=(e.min.z-m.z)*p,u=(e.max.z-m.z)*p):(c=(e.max.z-m.z)*p,u=(e.min.z-m.z)*p),n>u||c>r)||((c>n||n!==n)&&(n=c),(u=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,xr)!==null}intersectTriangle(e,t,n,r,a){Kf.subVectors(t,e),Sc.subVectors(n,e),Zf.crossVectors(Kf,Sc);let l=this.direction.dot(Zf),c;if(l>0){if(r)return null;c=1}else if(l<0)c=-1,l=-l;else return null;Qr.subVectors(this.origin,e);const u=c*this.direction.dot(Sc.crossVectors(Qr,Sc));if(u<0)return null;const h=c*this.direction.dot(Kf.cross(Qr));if(h<0||u+h>l)return null;const d=-c*Qr.dot(Zf);return d<0?null:this.at(d/l,a)}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 rn{constructor(e,t,n,r,a,l,c,u,h,d,p,m,_,M,S,x){rn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,a,l,c,u,h,d,p,m,_,M,S,x)}set(e,t,n,r,a,l,c,u,h,d,p,m,_,M,S,x){const v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=a,v[5]=l,v[9]=c,v[13]=u,v[2]=h,v[6]=d,v[10]=p,v[14]=m,v[3]=_,v[7]=M,v[11]=S,v[15]=x,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 rn().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Ra.setFromMatrixColumn(e,0).length(),a=1/Ra.setFromMatrixColumn(e,1).length(),l=1/Ra.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,a=e.z,l=Math.cos(n),c=Math.sin(n),u=Math.cos(r),h=Math.sin(r),d=Math.cos(a),p=Math.sin(a);if(e.order==="XYZ"){const m=l*d,_=l*p,M=c*d,S=c*p;t[0]=u*d,t[4]=-u*p,t[8]=h,t[1]=_+M*h,t[5]=m-S*h,t[9]=-c*u,t[2]=S-m*h,t[6]=M+_*h,t[10]=l*u}else if(e.order==="YXZ"){const m=u*d,_=u*p,M=h*d,S=h*p;t[0]=m+S*c,t[4]=M*c-_,t[8]=l*h,t[1]=l*p,t[5]=l*d,t[9]=-c,t[2]=_*c-M,t[6]=S+m*c,t[10]=l*u}else if(e.order==="ZXY"){const m=u*d,_=u*p,M=h*d,S=h*p;t[0]=m-S*c,t[4]=-l*p,t[8]=M+_*c,t[1]=_+M*c,t[5]=l*d,t[9]=S-m*c,t[2]=-l*h,t[6]=c,t[10]=l*u}else if(e.order==="ZYX"){const m=l*d,_=l*p,M=c*d,S=c*p;t[0]=u*d,t[4]=M*h-_,t[8]=m*h+S,t[1]=u*p,t[5]=S*h+m,t[9]=_*h-M,t[2]=-h,t[6]=c*u,t[10]=l*u}else if(e.order==="YZX"){const m=l*u,_=l*h,M=c*u,S=c*h;t[0]=u*d,t[4]=S-m*p,t[8]=M*p+_,t[1]=p,t[5]=l*d,t[9]=-c*d,t[2]=-h*d,t[6]=_*p+M,t[10]=m-S*p}else if(e.order==="XZY"){const m=l*u,_=l*h,M=c*u,S=c*h;t[0]=u*d,t[4]=-p,t[8]=h*d,t[1]=m*p+S,t[5]=l*d,t[9]=_*p-M,t[2]=M*p-_,t[6]=c*d,t[10]=S*p+m}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(tC,e,nC)}lookAt(e,t,n){const r=this.elements;return ni.subVectors(e,t),ni.lengthSq()===0&&(ni.z=1),ni.normalize(),jr.crossVectors(n,ni),jr.lengthSq()===0&&(Math.abs(n.z)===1?ni.x+=1e-4:ni.z+=1e-4,ni.normalize(),jr.crossVectors(n,ni)),jr.normalize(),Mc.crossVectors(ni,jr),r[0]=jr.x,r[4]=Mc.x,r[8]=ni.x,r[1]=jr.y,r[5]=Mc.y,r[9]=ni.y,r[2]=jr.z,r[6]=Mc.z,r[10]=ni.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,a=this.elements,l=n[0],c=n[4],u=n[8],h=n[12],d=n[1],p=n[5],m=n[9],_=n[13],M=n[2],S=n[6],x=n[10],v=n[14],D=n[3],w=n[7],E=n[11],N=n[15],U=r[0],L=r[4],F=r[8],T=r[12],R=r[1],B=r[5],j=r[9],q=r[13],ae=r[2],oe=r[6],ee=r[10],re=r[14],K=r[3],ve=r[7],Se=r[11],Re=r[15];return a[0]=l*U+c*R+u*ae+h*K,a[4]=l*L+c*B+u*oe+h*ve,a[8]=l*F+c*j+u*ee+h*Se,a[12]=l*T+c*q+u*re+h*Re,a[1]=d*U+p*R+m*ae+_*K,a[5]=d*L+p*B+m*oe+_*ve,a[9]=d*F+p*j+m*ee+_*Se,a[13]=d*T+p*q+m*re+_*Re,a[2]=M*U+S*R+x*ae+v*K,a[6]=M*L+S*B+x*oe+v*ve,a[10]=M*F+S*j+x*ee+v*Se,a[14]=M*T+S*q+x*re+v*Re,a[3]=D*U+w*R+E*ae+N*K,a[7]=D*L+w*B+E*oe+N*ve,a[11]=D*F+w*j+E*ee+N*Se,a[15]=D*T+w*q+E*re+N*Re,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],a=e[12],l=e[1],c=e[5],u=e[9],h=e[13],d=e[2],p=e[6],m=e[10],_=e[14],M=e[3],S=e[7],x=e[11],v=e[15];return M*(+a*u*p-r*h*p-a*c*m+n*h*m+r*c*_-n*u*_)+S*(+t*u*_-t*h*m+a*l*m-r*l*_+r*h*d-a*u*d)+x*(+t*h*p-t*c*_-a*l*p+n*l*_+a*c*d-n*h*d)+v*(-r*c*d-t*u*p+t*c*m+r*l*p-n*l*m+n*u*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],a=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],p=e[9],m=e[10],_=e[11],M=e[12],S=e[13],x=e[14],v=e[15],D=p*x*h-S*m*h+S*u*_-c*x*_-p*u*v+c*m*v,w=M*m*h-d*x*h-M*u*_+l*x*_+d*u*v-l*m*v,E=d*S*h-M*p*h+M*c*_-l*S*_-d*c*v+l*p*v,N=M*p*u-d*S*u-M*c*m+l*S*m+d*c*x-l*p*x,U=t*D+n*w+r*E+a*N;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/U;return e[0]=D*L,e[1]=(S*m*a-p*x*a-S*r*_+n*x*_+p*r*v-n*m*v)*L,e[2]=(c*x*a-S*u*a+S*r*h-n*x*h-c*r*v+n*u*v)*L,e[3]=(p*u*a-c*m*a-p*r*h+n*m*h+c*r*_-n*u*_)*L,e[4]=w*L,e[5]=(d*x*a-M*m*a+M*r*_-t*x*_-d*r*v+t*m*v)*L,e[6]=(M*u*a-l*x*a-M*r*h+t*x*h+l*r*v-t*u*v)*L,e[7]=(l*m*a-d*u*a+d*r*h-t*m*h-l*r*_+t*u*_)*L,e[8]=E*L,e[9]=(M*p*a-d*S*a-M*n*_+t*S*_+d*n*v-t*p*v)*L,e[10]=(l*S*a-M*c*a+M*n*h-t*S*h-l*n*v+t*c*v)*L,e[11]=(d*c*a-l*p*a-d*n*h+t*p*h+l*n*_-t*c*_)*L,e[12]=N*L,e[13]=(d*S*r-M*p*r+M*n*m-t*S*m-d*n*x+t*p*x)*L,e[14]=(M*c*r-l*S*r-M*n*u+t*S*u+l*n*x-t*c*x)*L,e[15]=(l*p*r-d*c*r+d*n*u-t*p*u-l*n*m+t*c*m)*L,this}scale(e){const t=this.elements,n=e.x,r=e.y,a=e.z;return t[0]*=n,t[4]*=r,t[8]*=a,t[1]*=n,t[5]*=r,t[9]*=a,t[2]*=n,t[6]*=r,t[10]*=a,t[3]*=n,t[7]*=r,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),a=1-n,l=e.x,c=e.y,u=e.z,h=a*l,d=a*c;return this.set(h*l+n,h*c-r*u,h*u+r*c,0,h*c+r*u,d*c+n,d*u-r*l,0,h*u-r*c,d*u+r*l,a*u*u+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,a,l){return this.set(1,n,a,0,e,1,l,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,a=t._x,l=t._y,c=t._z,u=t._w,h=a+a,d=l+l,p=c+c,m=a*h,_=a*d,M=a*p,S=l*d,x=l*p,v=c*p,D=u*h,w=u*d,E=u*p,N=n.x,U=n.y,L=n.z;return r[0]=(1-(S+v))*N,r[1]=(_+E)*N,r[2]=(M-w)*N,r[3]=0,r[4]=(_-E)*U,r[5]=(1-(m+v))*U,r[6]=(x+D)*U,r[7]=0,r[8]=(M+w)*L,r[9]=(x-D)*L,r[10]=(1-(m+S))*L,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let a=Ra.set(r[0],r[1],r[2]).length();const l=Ra.set(r[4],r[5],r[6]).length(),c=Ra.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),e.x=r[12],e.y=r[13],e.z=r[14],Bi.copy(this);const h=1/a,d=1/l,p=1/c;return Bi.elements[0]*=h,Bi.elements[1]*=h,Bi.elements[2]*=h,Bi.elements[4]*=d,Bi.elements[5]*=d,Bi.elements[6]*=d,Bi.elements[8]*=p,Bi.elements[9]*=p,Bi.elements[10]*=p,t.setFromRotationMatrix(Bi),n.x=a,n.y=l,n.z=c,this}makePerspective(e,t,n,r,a,l,c=Cr){const u=this.elements,h=2*a/(t-e),d=2*a/(n-r),p=(t+e)/(t-e),m=(n+r)/(n-r);let _,M;if(c===Cr)_=-(l+a)/(l-a),M=-2*l*a/(l-a);else if(c===ru)_=-l/(l-a),M=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return u[0]=h,u[4]=0,u[8]=p,u[12]=0,u[1]=0,u[5]=d,u[9]=m,u[13]=0,u[2]=0,u[6]=0,u[10]=_,u[14]=M,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,n,r,a,l,c=Cr){const u=this.elements,h=1/(t-e),d=1/(n-r),p=1/(l-a),m=(t+e)*h,_=(n+r)*d;let M,S;if(c===Cr)M=(l+a)*p,S=-2*p;else if(c===ru)M=a*p,S=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return u[0]=2*h,u[4]=0,u[8]=0,u[12]=-m,u[1]=0,u[5]=2*d,u[9]=0,u[13]=-_,u[2]=0,u[6]=0,u[10]=S,u[14]=-M,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Ra=new $,Bi=new rn,tC=new $(0,0,0),nC=new $(1,1,1),jr=new $,Mc=new $,ni=new $,Tg=new rn,bg=new _l;class Ur{constructor(e=0,t=0,n=0,r=Ur.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,a=r[0],l=r[4],c=r[8],u=r[1],h=r[5],d=r[9],p=r[2],m=r[6],_=r[10];switch(t){case"XYZ":this._y=Math.asin(kn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,_),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-kn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,_),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-p,a),this._z=0);break;case"ZXY":this._x=Math.asin(kn(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,_),this._z=Math.atan2(-l,h)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-kn(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,_),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,h));break;case"YZX":this._z=Math.asin(kn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-d,h),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(c,_));break;case"XZY":this._z=Math.asin(-kn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(c,a)):(this._x=Math.atan2(-d,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Tg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Tg,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return bg.setFromEuler(this),this.setFromQuaternion(bg,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}}Ur.DEFAULT_ORDER="XYZ";class U0{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(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.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function a(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.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=a(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let h=0,d=u.length;h0){r.children=[];for(let c=0;c0){r.animations=[];for(let c=0;c0&&(n.geometries=c),u.length>0&&(n.materials=u),h.length>0&&(n.textures=h),d.length>0&&(n.images=d),p.length>0&&(n.shapes=p),m.length>0&&(n.skeletons=m),_.length>0&&(n.animations=_),M.length>0&&(n.nodes=M)}return n.object=r,n;function l(c){const u=[];for(const h in c){const d=c[h];delete d.metadata,u.push(d)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,t,n,r,a){zi.subVectors(r,t),Mr.subVectors(n,t),Qf.subVectors(e,t);const l=zi.dot(zi),c=zi.dot(Mr),u=zi.dot(Qf),h=Mr.dot(Mr),d=Mr.dot(Qf),p=l*h-c*c;if(p===0)return a.set(0,0,0),null;const m=1/p,_=(h*u-c*d)*m,M=(l*d-c*u)*m;return a.set(1-_-M,M,_)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,yr)===null?!1:yr.x>=0&&yr.y>=0&&yr.x+yr.y<=1}static getInterpolation(e,t,n,r,a,l,c,u){return this.getBarycoord(e,t,n,r,yr)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,yr.x),u.addScaledVector(l,yr.y),u.addScaledVector(c,yr.z),u)}static getInterpolatedAttribute(e,t,n,r,a,l){return th.setScalar(0),nh.setScalar(0),ih.setScalar(0),th.fromBufferAttribute(e,t),nh.fromBufferAttribute(e,n),ih.fromBufferAttribute(e,r),l.setScalar(0),l.addScaledVector(th,a.x),l.addScaledVector(nh,a.y),l.addScaledVector(ih,a.z),l}static isFrontFacing(e,t,n,r){return zi.subVectors(n,t),Mr.subVectors(e,t),zi.cross(Mr).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return zi.subVectors(this.c,this.b),Mr.subVectors(this.a,this.b),zi.cross(Mr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Hi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Hi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,a){return Hi.getInterpolation(e,this.a,this.b,this.c,t,n,r,a)}containsPoint(e){return Hi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Hi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,a=this.c;let l,c;Da.subVectors(r,n),La.subVectors(a,n),jf.subVectors(e,n);const u=Da.dot(jf),h=La.dot(jf);if(u<=0&&h<=0)return t.copy(n);$f.subVectors(e,r);const d=Da.dot($f),p=La.dot($f);if(d>=0&&p<=d)return t.copy(r);const m=u*p-d*h;if(m<=0&&u>=0&&d<=0)return l=u/(u-d),t.copy(n).addScaledVector(Da,l);eh.subVectors(e,a);const _=Da.dot(eh),M=La.dot(eh);if(M>=0&&_<=M)return t.copy(a);const S=_*h-u*M;if(S<=0&&h>=0&&M<=0)return c=h/(h-M),t.copy(n).addScaledVector(La,c);const x=d*M-_*p;if(x<=0&&p-d>=0&&_-M>=0)return Dg.subVectors(a,r),c=(p-d)/(p-d+(_-M)),t.copy(r).addScaledVector(Dg,c);const v=1/(x+S+m);return l=S*v,c=m*v,t.copy(n).addScaledVector(Da,l).addScaledVector(La,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const N0={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},$r={h:0,s:0,l:0},Ec={h:0,s:0,l:0};function rh(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class At{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=si){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,xt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=xt.workingColorSpace){return this.r=e,this.g=t,this.b=n,xt.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=xt.workingColorSpace){if(e=VR(e,1),t=kn(t,0,1),n=kn(n,0,1),t===0)this.r=this.g=this.b=n;else{const a=n<=.5?n*(1+t):n+t-n*t,l=2*n-a;this.r=rh(l,a,e+1/3),this.g=rh(l,a,e),this.b=rh(l,a,e-1/3)}return xt.toWorkingColorSpace(this,r),this}setStyle(e,t=si){function n(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const l=r[1],c=r[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(a,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=si){const n=N0[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Dr(e.r),this.g=Dr(e.g),this.b=Dr(e.b),this}copyLinearToSRGB(e){return this.r=Ya(e.r),this.g=Ya(e.g),this.b=Ya(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=si){return xt.fromWorkingColorSpace(yn.copy(this),e),Math.round(kn(yn.r*255,0,255))*65536+Math.round(kn(yn.g*255,0,255))*256+Math.round(kn(yn.b*255,0,255))}getHexString(e=si){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xt.workingColorSpace){xt.fromWorkingColorSpace(yn.copy(this),t);const n=yn.r,r=yn.g,a=yn.b,l=Math.max(n,r,a),c=Math.min(n,r,a);let u,h;const d=(c+l)/2;if(c===l)u=0,h=0;else{const p=l-c;switch(h=d<=.5?p/(l+c):p/(2-l-c),l){case n:u=(r-a)/p+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Xa&&(n.blending=this.blending),this.side!==ps&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Uh&&(n.blendSrc=this.blendSrc),this.blendDst!==Nh&&(n.blendDst=this.blendDst),this.blendEquation!==ks&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==ja&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==pg&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ea&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ea&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ea&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}if(t){const a=r(e.textures),l=r(e.images);a.length>0&&(n.textures=a),l.length>0&&(n.images=l)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let a=0;a!==r;++a)n[a]=t[a].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class O0 extends _u{static get type(){return"MeshBasicMaterial"}constructor(e){super(),this.isMeshBasicMaterial=!0,this.color=new At(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 Ur,this.combine=v0,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 tn=new $,Tc=new Ft;class rr{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=mg,this.updateRanges=[],this.gpuType=Rr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,a=this.itemSize;rt.count&&console.warn("THREE.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 gl);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new $(-1/0,-1/0,-1/0),new $(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const h in u)u[h]!==void 0&&(e[h]=u[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const u in n){const h=n[u];e.data.attributes[u]=h.toJSON(e.data)}const r={};let a=!1;for(const u in this.morphAttributes){const h=this.morphAttributes[u],d=[];for(let p=0,m=h.length;p0&&(r[u]=d,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const r=e.attributes;for(const h in r){const d=r[h];this.setAttribute(h,d.clone(t))}const a=e.morphAttributes;for(const h in a){const d=[],p=a[h];for(let m=0,_=p.length;m<_;m++)d.push(p[m].clone(t));this.morphAttributes[h]=d}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let h=0,d=l.length;h0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a(e.far-e.near)**2))&&(Lg.copy(a).invert(),Ls.copy(e.ray).applyMatrix4(Lg),!(n.boundingBox!==null&&Ls.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Ls)))}_computeIntersections(e,t,n){let r;const a=this.geometry,l=this.material,c=a.index,u=a.attributes.position,h=a.attributes.uv,d=a.attributes.uv1,p=a.attributes.normal,m=a.groups,_=a.drawRange;if(c!==null)if(Array.isArray(l))for(let M=0,S=m.length;Mt.far?null:{distance:h,point:Pc.clone(),object:i}}function Dc(i,e,t,n,r,a,l,c,u,h){i.getVertexPosition(c,Ac),i.getVertexPosition(u,wc),i.getVertexPosition(h,Rc);const d=cC(i,e,t,n,Ac,wc,Rc,Ug);if(d){const p=new $;Hi.getBarycoord(Ug,Ac,wc,Rc,p),r&&(d.uv=Hi.getInterpolatedAttribute(r,c,u,h,p,new Ft)),a&&(d.uv1=Hi.getInterpolatedAttribute(a,c,u,h,p,new Ft)),l&&(d.normal=Hi.getInterpolatedAttribute(l,c,u,h,p,new $),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const m={a:c,b:u,c:h,normal:new $,materialIndex:0};Hi.getNormal(Ac,wc,Rc,m.normal),d.face=m,d.barycoord=p}return d}class vl extends ia{constructor(e=1,t=1,n=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:a,depthSegments:l};const c=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],h=[],d=[],p=[];let m=0,_=0;M("z","y","x",-1,-1,n,t,e,l,a,0),M("z","y","x",1,-1,n,t,-e,l,a,1),M("x","z","y",1,1,e,n,t,r,l,2),M("x","z","y",1,-1,e,n,-t,r,l,3),M("x","y","z",1,-1,e,t,n,r,a,4),M("x","y","z",-1,-1,e,t,-n,r,a,5),this.setIndex(u),this.setAttribute("position",new Ks(h,3)),this.setAttribute("normal",new Ks(d,3)),this.setAttribute("uv",new Ks(p,2));function M(S,x,v,D,w,E,N,U,L,F,T){const R=E/L,B=N/F,j=E/2,q=N/2,ae=U/2,oe=L+1,ee=F+1;let re=0,K=0;const ve=new $;for(let Se=0;Se0?1:-1,d.push(ve.x,ve.y,ve.z),p.push(Ze/L),p.push(1-Se/F),re+=1}}for(let Se=0;Se0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class H0 extends ui{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new rn,this.projectionMatrix=new rn,this.projectionMatrixInverse=new rn,this.coordinateSystem=Cr}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 es=new $,Ng=new Ft,Og=new Ft;class wi extends H0{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=vd*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Hf*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return vd*2*Math.atan(Math.tan(Hf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){es.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(es.x,es.y).multiplyScalar(-e/es.z),es.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(es.x,es.y).multiplyScalar(-e/es.z)}getViewSize(e,t){return this.getViewBounds(e,Ng,Og),t.subVectors(Og,Ng)}setViewOffset(e,t,n,r,a,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Hf*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,a=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const u=l.fullWidth,h=l.fullHeight;a+=l.offsetX*r/u,t-=l.offsetY*n/h,r*=l.width/u,n*=l.height/h}const c=this.filmOffset;c!==0&&(a+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,t,t-n,e,this.far,this.coordinateSystem),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 Ua=-90,Na=1;class pC extends ui{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new wi(Ua,Na,e,t);r.layers=this.layers,this.add(r);const a=new wi(Ua,Na,e,t);a.layers=this.layers,this.add(a);const l=new wi(Ua,Na,e,t);l.layers=this.layers,this.add(l);const c=new wi(Ua,Na,e,t);c.layers=this.layers,this.add(c);const u=new wi(Ua,Na,e,t);u.layers=this.layers,this.add(u);const h=new wi(Ua,Na,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,a,l,c,u]=t;for(const h of t)this.remove(h);if(e===Cr)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===ru)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,l,c,u,h,d]=this.children,p=e.getRenderTarget(),m=e.getActiveCubeFace(),_=e.getActiveMipmapLevel(),M=e.xr.enabled;e.xr.enabled=!1;const S=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,a),e.setRenderTarget(n,1,r),e.render(t,l),e.setRenderTarget(n,2,r),e.render(t,c),e.setRenderTarget(n,3,r),e.render(t,u),e.setRenderTarget(n,4,r),e.render(t,h),n.texture.generateMipmaps=S,e.setRenderTarget(n,5,r),e.render(t,d),e.setRenderTarget(p,m,_),e.xr.enabled=M,n.texture.needsPMREMUpdate=!0}}class G0 extends Un{constructor(e,t,n,r,a,l,c,u,h,d){e=e!==void 0?e:[],t=t!==void 0?t:$a,super(e,t,n,r,a,l,c,u,h,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class mC extends ms{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new G0(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:nr}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},r=new vl(5,5,5),a=new Nr({name:"CubemapFromEquirect",uniforms:io(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Vn,blending:cs});a.uniforms.tEquirect.value=t;const l=new ki(r,a),c=t.minFilter;return t.minFilter===Xs&&(t.minFilter=nr),new pC(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e,t,n,r){const a=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,r);e.setRenderTarget(a)}}const oh=new $,_C=new $,gC=new rt;class zs{constructor(e=new $(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=oh.subVectors(n,t).cross(_C.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 n=e.delta(oh),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:t.copy(e.start).addScaledVector(n,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||gC.getNormalMatrix(e),r=this.coplanarPoint(oh).applyMatrix4(e),a=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(a),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 Is=new cp,Lc=new $;class k0{constructor(e=new zs,t=new zs,n=new zs,r=new zs,a=new zs,l=new zs){this.planes=[e,t,n,r,a,l]}set(e,t,n,r,a,l){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(r),c[4].copy(a),c[5].copy(l),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Cr){const n=this.planes,r=e.elements,a=r[0],l=r[1],c=r[2],u=r[3],h=r[4],d=r[5],p=r[6],m=r[7],_=r[8],M=r[9],S=r[10],x=r[11],v=r[12],D=r[13],w=r[14],E=r[15];if(n[0].setComponents(u-a,m-h,x-_,E-v).normalize(),n[1].setComponents(u+a,m+h,x+_,E+v).normalize(),n[2].setComponents(u+l,m+d,x+M,E+D).normalize(),n[3].setComponents(u-l,m-d,x-M,E-D).normalize(),n[4].setComponents(u-c,m-p,x-S,E-w).normalize(),t===Cr)n[5].setComponents(u+c,m+p,x+S,E+w).normalize();else if(t===ru)n[5].setComponents(c,p,S,w).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(),Is.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Is.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Is)}intersectsSprite(e){return Is.center.set(0,0,0),Is.radius=.7071067811865476,Is.applyMatrix4(e.matrixWorld),this.intersectsSphere(Is)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(n)0?e.max.x:e.min.x,Lc.y=r.normal.y>0?e.max.y:e.min.y,Lc.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Lc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function V0(){let i=null,e=!1,t=null,n=null;function r(a,l){t(a,l),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){i=a}}}function vC(i){const e=new WeakMap;function t(c,u){const h=c.array,d=c.usage,p=h.byteLength,m=i.createBuffer();i.bindBuffer(u,m),i.bufferData(u,h,d),c.onUploadCallback();let _;if(h instanceof Float32Array)_=i.FLOAT;else if(h instanceof Uint16Array)c.isFloat16BufferAttribute?_=i.HALF_FLOAT:_=i.UNSIGNED_SHORT;else if(h instanceof Int16Array)_=i.SHORT;else if(h instanceof Uint32Array)_=i.UNSIGNED_INT;else if(h instanceof Int32Array)_=i.INT;else if(h instanceof Int8Array)_=i.BYTE;else if(h instanceof Uint8Array)_=i.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)_=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:m,type:_,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version,size:p}}function n(c,u,h){const d=u.array,p=u.updateRanges;if(i.bindBuffer(h,c),p.length===0)i.bufferSubData(h,0,d);else{p.sort((_,M)=>_.start-M.start);let m=0;for(let _=1;_ 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; float clipOpacity = 1.0; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); if ( clipOpacity == 0.0 ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES float unionClipOpacity = 1.0; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); } #pragma unroll_loop_end clipOpacity *= 1.0 - unionClipOpacity; #endif diffuseColor.a *= clipOpacity; if ( diffuseColor.a == 0.0 ) discard; #else #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif #endif`,NC=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,OC=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,FC=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,BC=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,zC=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,HC=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; #endif`,GC=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; #endif`,kC=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement( a ) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } vec3 pow2( const in vec3 x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract( sin( sn ) * c ); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; #ifdef USE_ALPHAHASH varying vec3 vPosition; #endif vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); } vec3 BRDF_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } // validated`,VC=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; uv.x += filterInt * 3.0 * cubeUV_minTileSize; uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); uv.x *= CUBEUV_TEXEL_WIDTH; uv.y *= CUBEUV_TEXEL_HEIGHT; #ifdef texture2DGradEXT return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; #else return texture2D( envMap, uv ).rgb; #endif } #define cubeUV_r0 1.0 #define cubeUV_m0 - 2.0 #define cubeUV_r1 0.8 #define cubeUV_m1 - 1.0 #define cubeUV_r4 0.4 #define cubeUV_m4 2.0 #define cubeUV_r5 0.305 #define cubeUV_m5 3.0 #define cubeUV_r6 0.21 #define cubeUV_m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= cubeUV_r1 ) { mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; } else if ( roughness >= cubeUV_r4 ) { mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; } else if ( roughness >= cubeUV_r5 ) { mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; } else if ( roughness >= cubeUV_r6 ) { mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,WC=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif #ifdef USE_BATCHING mat3 bm = mat3( batchingMatrix ); transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); transformedNormal = bm * transformedNormal; #ifdef USE_TANGENT transformedTangent = bm * transformedTangent; #endif #endif #ifdef USE_INSTANCING mat3 im = mat3( instanceMatrix ); transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); transformedNormal = im * transformedNormal; #ifdef USE_TANGENT transformedTangent = im * transformedTangent; #endif #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,XC=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,qC=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,YC=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; #endif`,KC=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,ZC="gl_FragColor = linearToOutputTexel( gl_FragColor );",JC=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( 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 ); } vec4 sRGBTransferOETF( in vec4 value ) { 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 ); }`,QC=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #else vec4 envColor = vec4( 0.0 ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,jC=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,$C=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,eP=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,tP=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,nP=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,iP=`#ifdef USE_FOG varying float vFogDepth; #endif`,rP=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,sP=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,aP=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return vec3( texture2D( gradientMap, coord ).r ); #else vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif }`,oP=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,lP=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,cP=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; }; void 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 ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,uP=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; #endif vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; return irradiance; } float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if ( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; } float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { return smoothstep( coneCosine, penumbraCosine, angleCosine ); } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { light.color = directionalLight.color; light.direction = directionalLight.direction; light.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = pointLight.position - geometryPosition; light.direction = normalize( lVector ); float lightDistance = length( lVector ); light.color = pointLight.color; light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = spotLight.position - geometryPosition; light.direction = normalize( lVector ); float angleCos = dot( light.direction, spotLight.direction ); float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); if ( spotAttenuation > 0.0 ) { float lightDistance = length( lVector ); light.color = spotLight.color * spotAttenuation; light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } else { light.color = vec3( 0.0 ); light.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { float dotNL = dot( normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } #endif`,fP=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); return PI * envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 reflectVec = reflect( - viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); return envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } #ifdef USE_ANISOTROPY vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 bentNormal = cross( bitangent, viewDir ); bentNormal = normalize( cross( bentNormal, bitangent ) ); bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); return getIBLRadiance( viewDir, bentNormal, roughness ); #else return vec3( 0.0 ); #endif } #endif #endif`,hP=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,dP=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; void 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 ) { vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,pP=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,mP=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void 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 ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,_P=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; material.roughness = min( material.roughness, 1.0 ); #ifdef IOR material.ior = ior; #ifdef USE_SPECULAR float specularIntensityFactor = specularIntensity; vec3 specularColorFactor = specularColor; #ifdef USE_SPECULAR_COLORMAP specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; #endif #ifdef USE_SPECULAR_INTENSITYMAP specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; #endif material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); #else float specularIntensityFactor = 1.0; vec3 specularColorFactor = vec3( 1.0 ); material.specularF90 = 1.0; #endif material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); material.specularF90 = 1.0; #endif #ifdef USE_CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; material.clearcoatF0 = vec3( 0.04 ); material.clearcoatF90 = 1.0; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_DISPERSION material.dispersion = dispersion; #endif #ifdef USE_IRIDESCENCE material.iridescence = iridescence; material.iridescenceIOR = iridescenceIOR; #ifdef USE_IRIDESCENCEMAP material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; #else material.iridescenceThickness = iridescenceThicknessMaximum; #endif #endif #ifdef USE_SHEEN material.sheenColor = sheenColor; #ifdef USE_SHEEN_COLORMAP material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; #endif material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); #ifdef USE_SHEEN_ROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; #endif #endif #ifdef USE_ANISOTROPY #ifdef USE_ANISOTROPYMAP mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; #else vec2 anisotropyV = anisotropyVector; #endif material.anisotropy = length( anisotropyV ); if( material.anisotropy == 0.0 ) { anisotropyV = vec2( 1.0, 0.0 ); } else { anisotropyV /= material.anisotropy; material.anisotropy = saturate( material.anisotropy ); } material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; #endif`,gP=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; float specularF90; float dispersion; #ifdef USE_CLEARCOAT float clearcoat; float clearcoatRoughness; vec3 clearcoatF0; float clearcoatF90; #endif #ifdef USE_IRIDESCENCE float iridescence; float iridescenceIOR; float iridescenceThickness; vec3 iridescenceFresnel; vec3 iridescenceF0; #endif #ifdef USE_SHEEN vec3 sheenColor; float sheenRoughness; #endif #ifdef IOR float ior; #endif #ifdef USE_TRANSMISSION float transmission; float transmissionAlpha; float thickness; float attenuationDistance; vec3 attenuationColor; #endif #ifdef USE_ANISOTROPY float anisotropy; float alphaT; vec3 anisotropyT; vec3 anisotropyB; #endif }; vec3 clearcoatSpecularDirect = vec3( 0.0 ); vec3 clearcoatSpecularIndirect = vec3( 0.0 ); vec3 sheenSpecularDirect = vec3( 0.0 ); vec3 sheenSpecularIndirect = vec3(0.0 ); vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); float x2 = x * x; float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); } float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } #ifdef USE_ANISOTROPY 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 ) { float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); float v = 0.5 / ( gv + gl ); return saturate(v); } float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { float a2 = alphaT * alphaB; highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); highp float v2 = dot( v, v ); float w2 = a2 / v2; return RECIPROCAL_PI * a2 * pow2 ( w2 ); } #endif #ifdef USE_CLEARCOAT vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { vec3 f0 = material.clearcoatF0; float f90 = material.clearcoatF90; float roughness = material.clearcoatRoughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #endif vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { vec3 f0 = material.specularColor; float f90 = material.specularF90; float roughness = material.roughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); #ifdef USE_IRIDESCENCE F = mix( F, material.iridescenceFresnel, material.iridescence ); #endif #ifdef USE_ANISOTROPY float dotTL = dot( material.anisotropyT, lightDir ); float dotTV = dot( material.anisotropyT, viewDir ); float dotTH = dot( material.anisotropyT, halfDir ); float dotBL = dot( material.anisotropyB, lightDir ); float dotBV = dot( material.anisotropyB, viewDir ); float dotBH = dot( material.anisotropyB, halfDir ); float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); #else float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); #endif return F * ( V * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } #if defined( USE_SHEEN ) float D_Charlie( float roughness, float dotNH ) { float alpha = pow2( roughness ); float invAlpha = 1.0 / alpha; float cos2h = dotNH * dotNH; float sin2h = max( 1.0 - cos2h, 0.0078125 ); return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); } float V_Neubelt( float dotNV, float dotNL ) { return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); } vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float D = D_Charlie( sheenRoughness, dotNH ); float V = V_Neubelt( dotNV, dotNL ); return sheenColor * ( D * V ); } #endif float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); float r2 = roughness * roughness; float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); return saturate( DG * RECIPROCAL_PI ); } vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; return fab; } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { vec2 fab = DFGApprox( normal, viewDir, roughness ); return specularColor * fab.x + specularF90 * fab.y; } #ifdef USE_IRIDESCENCE void 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 ) { #else void 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 ) { #endif vec2 fab = DFGApprox( normal, viewDir, roughness ); #ifdef USE_IRIDESCENCE vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); #else vec3 Fr = specularColor; #endif vec3 FssEss = Fr * fab.x + specularF90 * fab.y; float Ess = fab.x + fab.y; float Ems = 1.0 - Ess; vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } #if NUM_RECT_AREA_LIGHTS > 0 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 ) { vec3 normal = geometryNormal; vec3 viewDir = geometryViewDir; vec3 position = geometryPosition; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.roughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void 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 ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifdef USE_CLEARCOAT float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = dotNLcc * directLight.color; clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); #endif #ifdef USE_SHEEN sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); #endif reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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) { #ifdef USE_CLEARCOAT clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); #endif vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); #else computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); #endif vec3 totalScattering = singleScattering + multiScattering; vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); reflectedLight.indirectSpecular += radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,vP=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); vec3 geometryClearcoatNormal = vec3( 0.0 ); #ifdef USE_CLEARCOAT geometryClearcoatNormal = clearcoatNormal; #endif #ifdef USE_IRIDESCENCE float dotNVi = saturate( dot( normal, geometryViewDir ) ); if ( material.iridescenceThickness == 0.0 ) { material.iridescence = 0.0; } else { material.iridescence = saturate( material.iridescence ); } if ( material.iridescence > 0.0 ) { material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); } #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointLightInfo( pointLight, geometryPosition, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; vec4 spotColor; vec3 spotLightCoord; bool inSpotLightMap; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotLightInfo( spotLight, geometryPosition, directLight ); #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS #else #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #endif #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; #endif #undef SPOT_LIGHT_MAP_INDEX #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalLightInfo( directionalLight, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); #if defined( USE_LIGHT_PROBES ) irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); #endif #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,xP=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getIBLIrradiance( geometryNormal ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) #ifdef USE_ANISOTROPY radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); #else radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); #endif #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif #endif`,SP=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif`,MP=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,yP=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,EP=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; #endif`,TP=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #endif`,bP=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; #endif`,AP=`#ifdef USE_MAP uniform sampler2D map; #endif`,wP=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #endif #ifdef USE_MAP diffuseColor *= texture2D( map, uv ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,RP=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,CP=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,PP=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,DP=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } #endif`,LP=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; #elif defined( USE_COLOR ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } #endif`,IP=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } #endif`,UP=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; #endif uniform sampler2DArray morphTargetsTexture; uniform ivec2 morphTargetsTextureSize; vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; int y = texelIndex / morphTargetsTextureSize.x; int x = texelIndex - y * morphTargetsTextureSize.x; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } #endif`,NP=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } #endif`,OP=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal *= faceDirection; #endif #endif #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) #ifdef USE_TANGENT mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn = getTangentFrame( - vViewPosition, normal, #if defined( USE_NORMALMAP ) vNormalMapUv #elif defined( USE_CLEARCOAT_NORMALMAP ) vClearcoatNormalMapUv #else vUv #endif ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn[0] *= faceDirection; tbn[1] *= faceDirection; #endif #endif #ifdef USE_CLEARCOAT_NORMALMAP #ifdef USE_TANGENT mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn2[0] *= faceDirection; tbn2[1] *= faceDirection; #endif #endif vec3 nonPerturbedNormal = normal;`,FP=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( USE_NORMALMAP_TANGENTSPACE ) vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,BP=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,zP=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,HP=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,GP=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef USE_NORMALMAP_OBJECTSPACE uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { vec3 q0 = dFdx( eye_pos.xyz ); vec3 q1 = dFdy( eye_pos.xyz ); vec2 st0 = dFdx( uv.st ); vec2 st1 = dFdy( uv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } #endif`,kP=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,VP=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,WP=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif`,XP=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,qP=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,YP=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; const float Inv255 = 1. / 255.; const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); vec4 packDepthToRGBA( const in float v ) { if( v <= 0.0 ) return vec4( 0., 0., 0., 0. ); if( v >= 1.0 ) return vec4( 1., 1., 1., 1. ); float vuf; float af = modf( v * PackFactors.a, vuf ); float bf = modf( vuf * ShiftRight8, vuf ); float gf = modf( vuf * ShiftRight8, vuf ); return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); } vec3 packDepthToRGB( const in float v ) { if( v <= 0.0 ) return vec3( 0., 0., 0. ); if( v >= 1.0 ) return vec3( 1., 1., 1. ); float vuf; float bf = modf( v * PackFactors.b, vuf ); float gf = modf( vuf * ShiftRight8, vuf ); return vec3( vuf * Inv255, gf * PackUpscale, bf ); } vec2 packDepthToRG( const in float v ) { if( v <= 0.0 ) return vec2( 0., 0. ); if( v >= 1.0 ) return vec2( 1., 1. ); float vuf; float gf = modf( v * 256., vuf ); return vec2( vuf * Inv255, gf ); } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors4 ); } float unpackRGBToDepth( const in vec3 v ) { return dot( v, UnpackFactors3 ); } float unpackRGToDepth( const in vec2 v ) { return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; } vec4 pack2HalfToRGBA( const in vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); } vec2 unpackRGBATo2Half( const in vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { return depth * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); }`,KP=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,ZP=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,JP=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,QP=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,jP=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,$P=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,eD=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); 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 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; bool frustumTest = inFrustum && shadowCoord.z <= 1.0; if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return mix( 1.0, shadow, shadowIntensity ); } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { float shadow = 1.0; vec3 lightToPosition = shadowCoord.xyz; float lightToPositionLength = length( lightToPosition ); if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; shadow = ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } return mix( 1.0, shadow, shadowIntensity ); } #endif`,tD=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 struct SpotLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,nD=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if defined( USE_SHADOWMAP ) #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif #if NUM_SPOT_LIGHT_COORDS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { shadowWorldPosition = worldPosition; #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; #endif vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif`,iD=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,rD=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,sD=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; mat4 getBoneMatrix( const in float i ) { int size = textureSize( boneTexture, 0 ).x; int j = int( i ) * 4; int x = j % size; int y = j / size; vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } #endif`,aD=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,oD=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,lD=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,cD=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,uD=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,fD=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return saturate( toneMappingExposure * color ); } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 CineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( vec3( 1.6605, - 0.1246, - 0.0182 ), vec3( - 0.5876, 1.1329, - 0.1006 ), vec3( - 0.0728, - 0.0083, 1.1187 ) ); const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( vec3( 0.6274, 0.0691, 0.0164 ), vec3( 0.3293, 0.9195, 0.0880 ), vec3( 0.0433, 0.0113, 0.8956 ) ); vec3 agxDefaultContrastApprox( vec3 x ) { vec3 x2 = x * x; vec3 x4 = x2 * x2; return + 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + 0.4298 * x2 + 0.1191 * x - 0.00232; } vec3 AgXToneMapping( vec3 color ) { const mat3 AgXInsetMatrix = mat3( vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) ); const mat3 AgXOutsetMatrix = mat3( vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) ); const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; color *= toneMappingExposure; color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; color = AgXInsetMatrix * color; color = max( color, 1e-10 ); color = log2( color ); color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); color = clamp( color, 0.0, 1.0 ); color = agxDefaultContrastApprox( color ); color = AgXOutsetMatrix * color; color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); color = LINEAR_REC2020_TO_LINEAR_SRGB * color; color = clamp( color, 0.0, 1.0 ); return color; } vec3 NeutralToneMapping( vec3 color ) { const float StartCompression = 0.8 - 0.04; const float Desaturation = 0.15; color *= toneMappingExposure; float x = min( color.r, min( color.g, color.b ) ); float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; color -= offset; float peak = max( color.r, max( color.g, color.b ) ); if ( peak < StartCompression ) return color; float d = 1. - StartCompression; float newPeak = 1. - d * d / ( peak + d - StartCompression ); color *= newPeak / peak; float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } vec3 CustomToneMapping( vec3 color ) { return color; }`,hD=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; material.attenuationDistance = attenuationDistance; material.attenuationColor = attenuationColor; #ifdef USE_TRANSMISSIONMAP material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; #endif #ifdef USE_THICKNESSMAP material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; #endif vec3 pos = vWorldPosition; vec3 v = normalize( cameraPosition - pos ); vec3 n = inverseTransformDirection( normal, viewMatrix ); vec4 transmitted = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); #endif`,dD=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; uniform vec3 attenuationColor; #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec3 vWorldPosition; float w0( float a ) { return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); } float w1( float a ) { return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); } float w2( float a ){ return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); } float w3( float a ) { return ( 1.0 / 6.0 ) * ( a * a * a ); } float g0( float a ) { return w0( a ) + w1( a ); } float g1( float a ) { return w2( a ) + w3( a ); } float h0( float a ) { return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); } float h1( float a ) { return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); } vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { uv = uv * texelSize.zw + 0.5; vec2 iuv = floor( uv ); vec2 fuv = fract( uv ); float g0x = g0( fuv.x ); float g1x = g1( fuv.x ); float h0x = h0( fuv.x ); float h1x = h1( fuv.x ); float h0y = h0( fuv.y ); float h1y = h1( fuv.y ); vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); } vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); vec2 fLodSizeInv = 1.0 / fLodSize; vec2 cLodSizeInv = 1.0 / cLodSize; vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); return mix( fSample, cSample, fract( lod ) ); } vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); vec3 modelScale; modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); return normalize( refractionVector ) * thickness * modelScale; } float applyIorToRoughness( const in float roughness, const in float ior ) { return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); } vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); } vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( isinf( attenuationDistance ) ) { return vec3( 1.0 ); } else { vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; } } vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, const in vec3 attenuationColor, const in float attenuationDistance ) { vec4 transmittedLight; vec3 transmittance; #ifdef USE_DISPERSION float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); for ( int i = 0; i < 3; i ++ ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); transmittedLight[ i ] = transmissionSample[ i ]; transmittedLight.a += transmissionSample.a; transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; } transmittedLight.a /= 3.0; #else vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); #endif vec3 attenuatedColor = transmittance * transmittedLight.rgb; vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } #endif`,pD=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP varying vec2 vNormalMapUv; #endif #ifdef USE_EMISSIVEMAP varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SHEEN_COLORMAP varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_SPECULARMAP varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,mD=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP uniform mat3 mapTransform; varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP uniform mat3 alphaMapTransform; varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP uniform mat3 lightMapTransform; varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP uniform mat3 aoMapTransform; varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP uniform mat3 bumpMapTransform; varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP uniform mat3 normalMapTransform; varying vec2 vNormalMapUv; #endif #ifdef USE_DISPLACEMENTMAP uniform mat3 displacementMapTransform; varying vec2 vDisplacementMapUv; #endif #ifdef USE_EMISSIVEMAP uniform mat3 emissiveMapTransform; varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP uniform mat3 metalnessMapTransform; varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP uniform mat3 roughnessMapTransform; varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP uniform mat3 anisotropyMapTransform; varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP uniform mat3 clearcoatMapTransform; varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform mat3 clearcoatNormalMapTransform; varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform mat3 clearcoatRoughnessMapTransform; varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_SHEEN_COLORMAP uniform mat3 sheenColorMapTransform; varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform mat3 sheenRoughnessMapTransform; varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP uniform mat3 iridescenceMapTransform; varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform mat3 iridescenceThicknessMapTransform; varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SPECULARMAP uniform mat3 specularMapTransform; varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP uniform mat3 specularColorMapTransform; varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform mat3 specularIntensityMapTransform; varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,_D=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; #endif #ifdef USE_ALPHAMAP vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; #endif #ifdef USE_LIGHTMAP vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; #endif #ifdef USE_AOMAP vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; #endif #ifdef USE_BUMPMAP vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; #endif #ifdef USE_NORMALMAP vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_DISPLACEMENTMAP vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; #endif #ifdef USE_EMISSIVEMAP vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; #endif #ifdef USE_METALNESSMAP vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ROUGHNESSMAP vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ANISOTROPYMAP vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOATMAP vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_NORMALMAP vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCEMAP vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_COLORMAP vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_ROUGHNESSMAP vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULARMAP vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_COLORMAP vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_INTENSITYMAP vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; #endif #ifdef USE_TRANSMISSIONMAP vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; #endif`,gD=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; #endif #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`;const vD=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,xD=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); #ifdef DECODE_VIDEO_TEXTURE 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 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,SD=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,MD=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float flipEnvMap; uniform float backgroundBlurriness; uniform float backgroundIntensity; uniform mat3 backgroundRotation; varying vec3 vWorldDirection; #include void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); #else vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,yD=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,ED=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; void main() { vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); gl_FragColor = texColor; gl_FragColor.a *= opacity; #include #include }`,TD=`#include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,bD=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { vec4 diffuseColor = vec4( 1.0 ); #include #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #elif DEPTH_PACKING == 3202 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif }`,AD=`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,wD=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include #include #include void main () { vec4 diffuseColor = vec4( 1.0 ); #include #include #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,RD=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,CD=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,PD=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include #include #include #include }`,DD=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,LD=`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,ID=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include #include #include #include #include #include #include }`,UD=`#define LAMBERT varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,ND=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,OD=`#define MATCAP varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,FD=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); #else vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; #include #include #include #include #include #include }`,BD=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif }`,zD=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,HD=`#define PHONG varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,GD=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,kD=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,VD=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef IOR uniform float ior; #endif #ifdef USE_SPECULAR uniform float specularIntensity; uniform vec3 specularColor; #ifdef USE_SPECULAR_COLORMAP uniform sampler2D specularColorMap; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform sampler2D specularIntensityMap; #endif #endif #ifdef USE_CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_DISPERSION uniform float dispersion; #endif #ifdef USE_IRIDESCENCE uniform float iridescence; uniform float iridescenceIOR; uniform float iridescenceThicknessMinimum; uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN uniform vec3 sheenColor; uniform float sheenRoughness; #ifdef USE_SHEEN_COLORMAP uniform sampler2D sheenColorMap; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform sampler2D sheenRoughnessMap; #endif #endif #ifdef USE_ANISOTROPY uniform vec2 anisotropyVector; #ifdef USE_ANISOTROPYMAP uniform sampler2D anisotropyMap; #endif #endif varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; #ifdef USE_SHEEN float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; #endif #ifdef USE_CLEARCOAT float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; #endif #include #include #include #include #include #include }`,WD=`#define TOON varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,XD=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include }`,qD=`uniform float size; uniform float scale; #include #include #include #include #include #include #ifdef USE_POINTS_UV varying vec2 vUv; uniform mat3 uvTransform; #endif void main() { #ifdef USE_POINTS_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif #include #include #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,YD=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,KD=`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,ZD=`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,JD=`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix[ 3 ]; vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`,QD=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include }`,at={alphahash_fragment:xC,alphahash_pars_fragment:SC,alphamap_fragment:MC,alphamap_pars_fragment:yC,alphatest_fragment:EC,alphatest_pars_fragment:TC,aomap_fragment:bC,aomap_pars_fragment:AC,batching_pars_vertex:wC,batching_vertex:RC,begin_vertex:CC,beginnormal_vertex:PC,bsdfs:DC,iridescence_fragment:LC,bumpmap_pars_fragment:IC,clipping_planes_fragment:UC,clipping_planes_pars_fragment:NC,clipping_planes_pars_vertex:OC,clipping_planes_vertex:FC,color_fragment:BC,color_pars_fragment:zC,color_pars_vertex:HC,color_vertex:GC,common:kC,cube_uv_reflection_fragment:VC,defaultnormal_vertex:WC,displacementmap_pars_vertex:XC,displacementmap_vertex:qC,emissivemap_fragment:YC,emissivemap_pars_fragment:KC,colorspace_fragment:ZC,colorspace_pars_fragment:JC,envmap_fragment:QC,envmap_common_pars_fragment:jC,envmap_pars_fragment:$C,envmap_pars_vertex:eP,envmap_physical_pars_fragment:fP,envmap_vertex:tP,fog_vertex:nP,fog_pars_vertex:iP,fog_fragment:rP,fog_pars_fragment:sP,gradientmap_pars_fragment:aP,lightmap_pars_fragment:oP,lights_lambert_fragment:lP,lights_lambert_pars_fragment:cP,lights_pars_begin:uP,lights_toon_fragment:hP,lights_toon_pars_fragment:dP,lights_phong_fragment:pP,lights_phong_pars_fragment:mP,lights_physical_fragment:_P,lights_physical_pars_fragment:gP,lights_fragment_begin:vP,lights_fragment_maps:xP,lights_fragment_end:SP,logdepthbuf_fragment:MP,logdepthbuf_pars_fragment:yP,logdepthbuf_pars_vertex:EP,logdepthbuf_vertex:TP,map_fragment:bP,map_pars_fragment:AP,map_particle_fragment:wP,map_particle_pars_fragment:RP,metalnessmap_fragment:CP,metalnessmap_pars_fragment:PP,morphinstance_vertex:DP,morphcolor_vertex:LP,morphnormal_vertex:IP,morphtarget_pars_vertex:UP,morphtarget_vertex:NP,normal_fragment_begin:OP,normal_fragment_maps:FP,normal_pars_fragment:BP,normal_pars_vertex:zP,normal_vertex:HP,normalmap_pars_fragment:GP,clearcoat_normal_fragment_begin:kP,clearcoat_normal_fragment_maps:VP,clearcoat_pars_fragment:WP,iridescence_pars_fragment:XP,opaque_fragment:qP,packing:YP,premultiplied_alpha_fragment:KP,project_vertex:ZP,dithering_fragment:JP,dithering_pars_fragment:QP,roughnessmap_fragment:jP,roughnessmap_pars_fragment:$P,shadowmap_pars_fragment:eD,shadowmap_pars_vertex:tD,shadowmap_vertex:nD,shadowmask_pars_fragment:iD,skinbase_vertex:rD,skinning_pars_vertex:sD,skinning_vertex:aD,skinnormal_vertex:oD,specularmap_fragment:lD,specularmap_pars_fragment:cD,tonemapping_fragment:uD,tonemapping_pars_fragment:fD,transmission_fragment:hD,transmission_pars_fragment:dD,uv_pars_fragment:pD,uv_pars_vertex:mD,uv_vertex:_D,worldpos_vertex:gD,background_vert:vD,background_frag:xD,backgroundCube_vert:SD,backgroundCube_frag:MD,cube_vert:yD,cube_frag:ED,depth_vert:TD,depth_frag:bD,distanceRGBA_vert:AD,distanceRGBA_frag:wD,equirect_vert:RD,equirect_frag:CD,linedashed_vert:PD,linedashed_frag:DD,meshbasic_vert:LD,meshbasic_frag:ID,meshlambert_vert:UD,meshlambert_frag:ND,meshmatcap_vert:OD,meshmatcap_frag:FD,meshnormal_vert:BD,meshnormal_frag:zD,meshphong_vert:HD,meshphong_frag:GD,meshphysical_vert:kD,meshphysical_frag:VD,meshtoon_vert:WD,meshtoon_frag:XD,points_vert:qD,points_frag:YD,shadow_vert:KD,shadow_frag:ZD,sprite_vert:JD,sprite_frag:QD},Ee={common:{diffuse:{value:new At(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new rt},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new rt}},envmap:{envMap:{value:null},envMapRotation:{value:new rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new rt},normalScale:{value:new Ft(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new At(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 At(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0},uvTransform:{value:new rt}},sprite:{diffuse:{value:new At(16777215)},opacity:{value:1},center:{value:new Ft(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new rt},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0}}},er={basic:{uniforms:Dn([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Dn([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new At(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Dn([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new At(0)},specular:{value:new At(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Dn([Ee.common,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.roughnessmap,Ee.metalnessmap,Ee.fog,Ee.lights,{emissive:{value:new At(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Dn([Ee.common,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.gradientmap,Ee.fog,Ee.lights,{emissive:{value:new At(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Dn([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Dn([Ee.points,Ee.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Dn([Ee.common,Ee.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Dn([Ee.common,Ee.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Dn([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,{opacity:{value:1}}]),vertexShader:at.meshnormal_vert,fragmentShader:at.meshnormal_frag},sprite:{uniforms:Dn([Ee.sprite,Ee.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:at.background_vert,fragmentShader:at.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new rt}},vertexShader:at.backgroundCube_vert,fragmentShader:at.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Dn([Ee.common,Ee.displacementmap,{referencePosition:{value:new $},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Dn([Ee.lights,Ee.fog,{color:{value:new At(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};er.physical={uniforms:Dn([er.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new rt},clearcoatNormalScale:{value:new Ft(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new rt},sheen:{value:0},sheenColor:{value:new At(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new rt},transmissionSamplerSize:{value:new Ft},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new rt},attenuationDistance:{value:0},attenuationColor:{value:new At(0)},specularColor:{value:new At(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new rt},anisotropyVector:{value:new Ft},anisotropyMap:{value:null},anisotropyMapTransform:{value:new rt}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};const Ic={r:0,b:0,g:0},Us=new Ur,jD=new rn;function $D(i,e,t,n,r,a,l){const c=new At(0);let u=a===!0?0:1,h,d,p=null,m=0,_=null;function M(D){let w=D.isScene===!0?D.background:null;return w&&w.isTexture&&(w=(D.backgroundBlurriness>0?t:e).get(w)),w}function S(D){let w=!1;const E=M(D);E===null?v(c,u):E&&E.isColor&&(v(E,1),w=!0);const N=i.xr.getEnvironmentBlendMode();N==="additive"?n.buffers.color.setClear(0,0,0,1,l):N==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(i.autoClear||w)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function x(D,w){const E=M(w);E&&(E.isCubeTexture||E.mapping===pu)?(d===void 0&&(d=new ki(new vl(1,1,1),new Nr({name:"BackgroundCubeMaterial",uniforms:io(er.backgroundCube.uniforms),vertexShader:er.backgroundCube.vertexShader,fragmentShader:er.backgroundCube.fragmentShader,side:Vn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(N,U,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),Us.copy(w.backgroundRotation),Us.x*=-1,Us.y*=-1,Us.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Us.y*=-1,Us.z*=-1),d.material.uniforms.envMap.value=E,d.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(jD.makeRotationFromEuler(Us)),d.material.toneMapped=xt.getTransfer(E.colorSpace)!==Dt,(p!==E||m!==E.version||_!==i.toneMapping)&&(d.material.needsUpdate=!0,p=E,m=E.version,_=i.toneMapping),d.layers.enableAll(),D.unshift(d,d.geometry,d.material,0,0,null)):E&&E.isTexture&&(h===void 0&&(h=new ki(new po(2,2),new Nr({name:"BackgroundMaterial",uniforms:io(er.background.uniforms),vertexShader:er.background.vertexShader,fragmentShader:er.background.fragmentShader,side:ps,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=E,h.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,h.material.toneMapped=xt.getTransfer(E.colorSpace)!==Dt,E.matrixAutoUpdate===!0&&E.updateMatrix(),h.material.uniforms.uvTransform.value.copy(E.matrix),(p!==E||m!==E.version||_!==i.toneMapping)&&(h.material.needsUpdate=!0,p=E,m=E.version,_=i.toneMapping),h.layers.enableAll(),D.unshift(h,h.geometry,h.material,0,0,null))}function v(D,w){D.getRGB(Ic,z0(i)),n.buffers.color.setClear(Ic.r,Ic.g,Ic.b,w,l)}return{getClearColor:function(){return c},setClearColor:function(D,w=1){c.set(D),u=w,v(c,u)},getClearAlpha:function(){return u},setClearAlpha:function(D){u=D,v(c,u)},render:S,addToRenderList:x}}function eL(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=m(null);let a=r,l=!1;function c(R,B,j,q,ae){let oe=!1;const ee=p(q,j,B);a!==ee&&(a=ee,h(a.object)),oe=_(R,q,j,ae),oe&&M(R,q,j,ae),ae!==null&&e.update(ae,i.ELEMENT_ARRAY_BUFFER),(oe||l)&&(l=!1,E(R,B,j,q),ae!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(ae).buffer))}function u(){return i.createVertexArray()}function h(R){return i.bindVertexArray(R)}function d(R){return i.deleteVertexArray(R)}function p(R,B,j){const q=j.wireframe===!0;let ae=n[R.id];ae===void 0&&(ae={},n[R.id]=ae);let oe=ae[B.id];oe===void 0&&(oe={},ae[B.id]=oe);let ee=oe[q];return ee===void 0&&(ee=m(u()),oe[q]=ee),ee}function m(R){const B=[],j=[],q=[];for(let ae=0;ae=0){const Se=ae[K];let Re=oe[K];if(Re===void 0&&(K==="instanceMatrix"&&R.instanceMatrix&&(Re=R.instanceMatrix),K==="instanceColor"&&R.instanceColor&&(Re=R.instanceColor)),Se===void 0||Se.attribute!==Re||Re&&Se.data!==Re.data)return!0;ee++}return a.attributesNum!==ee||a.index!==q}function M(R,B,j,q){const ae={},oe=B.attributes;let ee=0;const re=j.getAttributes();for(const K in re)if(re[K].location>=0){let Se=oe[K];Se===void 0&&(K==="instanceMatrix"&&R.instanceMatrix&&(Se=R.instanceMatrix),K==="instanceColor"&&R.instanceColor&&(Se=R.instanceColor));const Re={};Re.attribute=Se,Se&&Se.data&&(Re.data=Se.data),ae[K]=Re,ee++}a.attributes=ae,a.attributesNum=ee,a.index=q}function S(){const R=a.newAttributes;for(let B=0,j=R.length;B=0){let ve=ae[re];if(ve===void 0&&(re==="instanceMatrix"&&R.instanceMatrix&&(ve=R.instanceMatrix),re==="instanceColor"&&R.instanceColor&&(ve=R.instanceColor)),ve!==void 0){const Se=ve.normalized,Re=ve.itemSize,Ze=e.get(ve);if(Ze===void 0)continue;const St=Ze.buffer,se=Ze.type,me=Ze.bytesPerElement,Ie=se===i.INT||se===i.UNSIGNED_INT||ve.gpuType===ip;if(ve.isInterleavedBufferAttribute){const be=ve.data,Ge=be.stride,Ke=ve.offset;if(be.isInstancedInterleavedBuffer){for(let ot=0;ot0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";L="mediump"}return L==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=t.precision!==void 0?t.precision:"highp";const d=u(h);d!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",d,"instead."),h=d);const p=t.logarithmicDepthBuffer===!0,m=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),_=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),M=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),S=i.getParameter(i.MAX_TEXTURE_SIZE),x=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),v=i.getParameter(i.MAX_VERTEX_ATTRIBS),D=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),w=i.getParameter(i.MAX_VARYING_VECTORS),E=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),N=M>0,U=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:u,textureFormatReadable:l,textureTypeReadable:c,precision:h,logarithmicDepthBuffer:p,reverseDepthBuffer:m,maxTextures:_,maxVertexTextures:M,maxTextureSize:S,maxCubemapSize:x,maxAttributes:v,maxVertexUniforms:D,maxVaryings:w,maxFragmentUniforms:E,vertexTextures:N,maxSamples:U}}function iL(i){const e=this;let t=null,n=0,r=!1,a=!1;const l=new zs,c=new rt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const _=p.length!==0||m||n!==0||r;return r=m,n=p.length,_},this.beginShadows=function(){a=!0,d(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(p,m){t=d(p,m,0)},this.setState=function(p,m,_){const M=p.clippingPlanes,S=p.clipIntersection,x=p.clipShadows,v=i.get(p);if(!r||M===null||M.length===0||a&&!x)a?d(null):h();else{const D=a?0:n,w=D*4;let E=v.clippingState||null;u.value=E,E=d(M,m,w,_);for(let N=0;N!==w;++N)E[N]=t[N];v.clippingState=E,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=D}};function h(){u.value!==t&&(u.value=t,u.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(p,m,_,M){const S=p!==null?p.length:0;let x=null;if(S!==0){if(x=u.value,M!==!0||x===null){const v=_+S*4,D=m.matrixWorldInverse;c.getNormalMatrix(D),(x===null||x.length0){const h=new mC(u.height);return h.fromEquirectangularTexture(i,l),e.set(l,h),l.addEventListener("dispose",r),t(h.texture,l.mapping)}else return null}}return l}function r(l){const c=l.target;c.removeEventListener("dispose",r);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}function a(){e=new WeakMap}return{get:n,dispose:a}}class gu extends H0{constructor(e=-1,t=1,n=1,r=-1,a=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=a,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,a,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=n-e,l=n+e,c=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=h*this.view.offsetX,l=a+h*this.view.width,c-=d*this.view.offsetY,u=c-d*this.view.height}this.projectionMatrix.makeOrthographic(a,l,c,u,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ha=4,Fg=[.125,.215,.35,.446,.526,.582],Vs=20,lh=new gu,Bg=new At;let ch=null,uh=0,fh=0,hh=!1;const Hs=(1+Math.sqrt(5))/2,Oa=1/Hs,zg=[new $(-Hs,Oa,0),new $(Hs,Oa,0),new $(-Oa,0,Hs),new $(Oa,0,Hs),new $(0,Hs,-Oa),new $(0,Hs,Oa),new $(-1,1,-1),new $(1,1,-1),new $(-1,1,1),new $(1,1,1)];class Hg{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){ch=this._renderer.getRenderTarget(),uh=this._renderer.getActiveCubeFace(),fh=this._renderer.getActiveMipmapLevel(),hh=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,n,r,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Vg(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=kg(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?w:0,w,w),d.setRenderTarget(r),S&&d.render(M,c),d.render(e,c)}M.geometry.dispose(),M.material.dispose(),d.toneMapping=m,d.autoClear=p,e.background=x}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===$a||e.mapping===eo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Vg()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=kg());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new ki(this._lodPlanes[0],a),c=a.uniforms;c.envMap.value=e;const u=this._cubeSize;Uc(t,0,0,3*u,2*u),n.setRenderTarget(t),n.render(l,lh)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;aVs&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Vs}`);const v=[];let D=0;for(let L=0;Lw-Ha?r-w+Ha:0),U=4*(this._cubeSize-E);Uc(t,N,U,3*E,2*E),u.setRenderTarget(t),u.render(p,lh)}}function sL(i){const e=[],t=[],n=[];let r=i;const a=i-Ha+1+Fg.length;for(let l=0;li-Ha?u=Fg[l-i+Ha-1]:l===0&&(u=0),n.push(u);const h=1/(c-2),d=-h,p=1+h,m=[d,d,p,d,p,p,d,d,p,p,d,p],_=6,M=6,S=3,x=2,v=1,D=new Float32Array(S*M*_),w=new Float32Array(x*M*_),E=new Float32Array(v*M*_);for(let U=0;U<_;U++){const L=U%3*2/3-1,F=U>2?0:-1,T=[L,F,0,L+2/3,F,0,L+2/3,F+1,0,L,F,0,L+2/3,F+1,0,L,F+1,0];D.set(T,S*M*U),w.set(m,x*M*U);const R=[U,U,U,U,U,U];E.set(R,v*M*U)}const N=new ia;N.setAttribute("position",new rr(D,S)),N.setAttribute("uv",new rr(w,x)),N.setAttribute("faceIndex",new rr(E,v)),e.push(N),r>Ha&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function Gg(i,e,t){const n=new ms(i,e,t);return n.texture.mapping=pu,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Uc(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function aL(i,e,t){const n=new Float32Array(Vs),r=new $(0,1,0);return new Nr({name:"SphericalGaussianBlur",defines:{n:Vs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:up(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:cs,depthTest:!1,depthWrite:!1})}function kg(){return new Nr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:up(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:cs,depthTest:!1,depthWrite:!1})}function Vg(){return new Nr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:up(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:cs,depthTest:!1,depthWrite:!1})}function up(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function oL(i){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const u=c.mapping,h=u===Vh||u===Wh,d=u===$a||u===eo;if(h||d){let p=e.get(c);const m=p!==void 0?p.texture.pmremVersion:0;if(c.isRenderTargetTexture&&c.pmremVersion!==m)return t===null&&(t=new Hg(i)),p=h?t.fromEquirectangular(c,p):t.fromCubemap(c,p),p.texture.pmremVersion=c.pmremVersion,e.set(c,p),p.texture;if(p!==void 0)return p.texture;{const _=c.image;return h&&_&&_.height>0||d&&_&&r(_)?(t===null&&(t=new Hg(i)),p=h?t.fromEquirectangular(c):t.fromCubemap(c),p.texture.pmremVersion=c.pmremVersion,e.set(c,p),c.addEventListener("dispose",a),p.texture):null}}}return c}function r(c){let u=0;const h=6;for(let d=0;de.maxTextureSize&&(U=Math.ceil(N/e.maxTextureSize),N=e.maxTextureSize);const L=new Float32Array(N*U*4*p),F=new I0(L,N,U,p);F.type=Rr,F.needsUpdate=!0;const T=E*4;for(let B=0;B0)return i;const r=e*t;let a=Xg[r];if(a===void 0&&(a=new Float32Array(r),Xg[r]=a),e!==0){n.toArray(a,0);for(let l=1,c=0;l!==e;++l)c+=t,i[l].toArray(a,c)}return a}function ln(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t":" "} ${c}: ${t[l]}`)}return n.join(` `)}const jg=new rt;function o2(i){xt._getMatrix(jg,xt.workingColorSpace,i);const e=`mat3( ${jg.elements.map(t=>t.toFixed(4))} )`;switch(xt.getTransfer(i)){case mu:return[e,"LinearTransferOETF"];case Dt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function $g(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),r=i.getShaderInfoLog(e).trim();if(n&&r==="")return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const l=parseInt(a[1]);return t.toUpperCase()+` `+r+` `+a2(i.getShaderSource(e),l)}else return r}function l2(i,e){const t=o2(e);return[`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` `)}function c2(i,e){let t;switch(e){case TR:t="Linear";break;case bR:t="Reinhard";break;case AR:t="Cineon";break;case wR:t="ACESFilmic";break;case CR:t="AgX";break;case PR:t="Neutral";break;case RR:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Nc=new $;function u2(){xt.getLuminanceCoefficients(Nc);const i=Nc.x.toFixed(4),e=Nc.y.toFixed(4),t=Nc.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` `)}function f2(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Go).join(` `)}function h2(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` `)}function d2(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function xd(i){return i.replace(p2,_2)}const m2=new Map;function _2(i,e){let t=at[e];if(t===void 0){const n=m2.get(e);if(n!==void 0)t=at[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return xd(t)}const g2=/#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 nv(i){return i.replace(g2,v2)}function v2(i,e,t,n){let r="";for(let a=parseInt(e);a0&&(x+=` `),v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M].filter(Go).join(` `),v.length>0&&(v+=` `)):(x=[iv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,t.extensionClipCullDistance?"#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 "+d:"",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 "+u:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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",` `].filter(Go).join(` `),v=[iv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,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 "+h:"",t.envMap?"#define "+d:"",t.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.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_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||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 "+u:"",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_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==us?"#define TONE_MAPPING":"",t.toneMapping!==us?at.tonemapping_pars_fragment:"",t.toneMapping!==us?c2("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",at.colorspace_pars_fragment,l2("linearToOutputTexel",t.outputColorSpace),u2(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(Go).join(` `)),l=xd(l),l=ev(l,t),l=tv(l,t),c=xd(c),c=ev(c,t),c=tv(c,t),l=nv(l),c=nv(c),t.isRawShaderMaterial!==!0&&(D=`#version 300 es `,x=[_,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+x,v=["#define varying in",t.glslVersion===_g?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===_g?"":"#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(` `)+` `+v);const w=D+x+l,E=D+v+c,N=Qg(r,r.VERTEX_SHADER,w),U=Qg(r,r.FRAGMENT_SHADER,E);r.attachShader(S,N),r.attachShader(S,U),t.index0AttributeName!==void 0?r.bindAttribLocation(S,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function L(B){if(i.debug.checkShaderErrors){const j=r.getProgramInfoLog(S).trim(),q=r.getShaderInfoLog(N).trim(),ae=r.getShaderInfoLog(U).trim();let oe=!0,ee=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(oe=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,S,N,U);else{const re=$g(r,N,"vertex"),K=$g(r,U,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+` Material Name: `+B.name+` Material Type: `+B.type+` Program Info Log: `+j+` `+re+` `+K)}else j!==""?console.warn("THREE.WebGLProgram: Program Info Log:",j):(q===""||ae==="")&&(ee=!1);ee&&(B.diagnostics={runnable:oe,programLog:j,vertexShader:{log:q,prefix:x},fragmentShader:{log:ae,prefix:v}})}r.deleteShader(N),r.deleteShader(U),F=new Zc(r,S),T=d2(r,S)}let F;this.getUniforms=function(){return F===void 0&&L(this),F};let T;this.getAttributes=function(){return T===void 0&&L(this),T};let R=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=r.getProgramParameter(S,r2)),R},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=s2++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=N,this.fragmentShader=U,this}let b2=0;class A2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),a=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(a)===!1&&(l.add(a),a.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new w2(e),t.set(e,n)),n}}class w2{constructor(e){this.id=b2++,this.code=e,this.usedTimes=0}}function R2(i,e,t,n,r,a,l){const c=new U0,u=new A2,h=new Set,d=[],p=r.logarithmicDepthBuffer,m=r.vertexTextures;let _=r.precision;const M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function S(T){return h.add(T),T===0?"uv":`uv${T}`}function x(T,R,B,j,q){const ae=j.fog,oe=q.geometry,ee=T.isMeshStandardMaterial?j.environment:null,re=(T.isMeshStandardMaterial?t:e).get(T.envMap||ee),K=re&&re.mapping===pu?re.image.height:null,ve=M[T.type];T.precision!==null&&(_=r.getMaxPrecision(T.precision),_!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",_,"instead."));const Se=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,Re=Se!==void 0?Se.length:0;let Ze=0;oe.morphAttributes.position!==void 0&&(Ze=1),oe.morphAttributes.normal!==void 0&&(Ze=2),oe.morphAttributes.color!==void 0&&(Ze=3);let St,se,me,Ie;if(ve){const yt=er[ve];St=yt.vertexShader,se=yt.fragmentShader}else St=T.vertexShader,se=T.fragmentShader,u.update(T),me=u.getVertexShaderID(T),Ie=u.getFragmentShaderID(T);const be=i.getRenderTarget(),Ge=i.state.buffers.depth.getReversed(),Ke=q.isInstancedMesh===!0,ot=q.isBatchedMesh===!0,wt=!!T.map,ct=!!T.matcap,kt=!!re,H=!!T.aoMap,un=!!T.lightMap,dt=!!T.bumpMap,Qe=!!T.normalMap,ke=!!T.displacementMap,Lt=!!T.emissiveMap,He=!!T.metalnessMap,I=!!T.roughnessMap,b=T.anisotropy>0,Y=T.clearcoat>0,he=T.dispersion>0,de=T.iridescence>0,ce=T.sheen>0,Ue=T.transmission>0,xe=b&&!!T.anisotropyMap,Ce=Y&&!!T.clearcoatMap,ft=Y&&!!T.clearcoatNormalMap,_e=Y&&!!T.clearcoatRoughnessMap,Pe=de&&!!T.iridescenceMap,Ve=de&&!!T.iridescenceThicknessMap,Ye=ce&&!!T.sheenColorMap,De=ce&&!!T.sheenRoughnessMap,ut=!!T.specularMap,je=!!T.specularColorMap,Rt=!!T.specularIntensityMap,G=Ue&&!!T.transmissionMap,Te=Ue&&!!T.thicknessMap,ne=!!T.gradientMap,fe=!!T.alphaMap,we=T.alphaTest>0,Ae=!!T.alphaHash,tt=!!T.extensions;let Vt=us;T.toneMapped&&(be===null||be.isXRRenderTarget===!0)&&(Vt=i.toneMapping);const sn={shaderID:ve,shaderType:T.type,shaderName:T.name,vertexShader:St,fragmentShader:se,defines:T.defines,customVertexShaderID:me,customFragmentShaderID:Ie,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:_,batching:ot,batchingColor:ot&&q._colorsTexture!==null,instancing:Ke,instancingColor:Ke&&q.instanceColor!==null,instancingMorph:Ke&&q.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:be===null?i.outputColorSpace:be.isXRRenderTarget===!0?be.texture.colorSpace:fo,alphaToCoverage:!!T.alphaToCoverage,map:wt,matcap:ct,envMap:kt,envMapMode:kt&&re.mapping,envMapCubeUVHeight:K,aoMap:H,lightMap:un,bumpMap:dt,normalMap:Qe,displacementMap:m&&ke,emissiveMap:Lt,normalMapObjectSpace:Qe&&T.normalMapType===NR,normalMapTangentSpace:Qe&&T.normalMapType===UR,metalnessMap:He,roughnessMap:I,anisotropy:b,anisotropyMap:xe,clearcoat:Y,clearcoatMap:Ce,clearcoatNormalMap:ft,clearcoatRoughnessMap:_e,dispersion:he,iridescence:de,iridescenceMap:Pe,iridescenceThicknessMap:Ve,sheen:ce,sheenColorMap:Ye,sheenRoughnessMap:De,specularMap:ut,specularColorMap:je,specularIntensityMap:Rt,transmission:Ue,transmissionMap:G,thicknessMap:Te,gradientMap:ne,opaque:T.transparent===!1&&T.blending===Xa&&T.alphaToCoverage===!1,alphaMap:fe,alphaTest:we,alphaHash:Ae,combine:T.combine,mapUv:wt&&S(T.map.channel),aoMapUv:H&&S(T.aoMap.channel),lightMapUv:un&&S(T.lightMap.channel),bumpMapUv:dt&&S(T.bumpMap.channel),normalMapUv:Qe&&S(T.normalMap.channel),displacementMapUv:ke&&S(T.displacementMap.channel),emissiveMapUv:Lt&&S(T.emissiveMap.channel),metalnessMapUv:He&&S(T.metalnessMap.channel),roughnessMapUv:I&&S(T.roughnessMap.channel),anisotropyMapUv:xe&&S(T.anisotropyMap.channel),clearcoatMapUv:Ce&&S(T.clearcoatMap.channel),clearcoatNormalMapUv:ft&&S(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_e&&S(T.clearcoatRoughnessMap.channel),iridescenceMapUv:Pe&&S(T.iridescenceMap.channel),iridescenceThicknessMapUv:Ve&&S(T.iridescenceThicknessMap.channel),sheenColorMapUv:Ye&&S(T.sheenColorMap.channel),sheenRoughnessMapUv:De&&S(T.sheenRoughnessMap.channel),specularMapUv:ut&&S(T.specularMap.channel),specularColorMapUv:je&&S(T.specularColorMap.channel),specularIntensityMapUv:Rt&&S(T.specularIntensityMap.channel),transmissionMapUv:G&&S(T.transmissionMap.channel),thicknessMapUv:Te&&S(T.thicknessMap.channel),alphaMapUv:fe&&S(T.alphaMap.channel),vertexTangents:!!oe.attributes.tangent&&(Qe||b),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!oe.attributes.color&&oe.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!oe.attributes.uv&&(wt||fe),fog:!!ae,useFog:T.fog===!0,fogExp2:!!ae&&ae.isFogExp2,flatShading:T.flatShading===!0,sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:p,reverseDepthBuffer:Ge,skinning:q.isSkinnedMesh===!0,morphTargets:oe.morphAttributes.position!==void 0,morphNormals:oe.morphAttributes.normal!==void 0,morphColors:oe.morphAttributes.color!==void 0,morphTargetsCount:Re,morphTextureStride:Ze,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:T.dithering,shadowMapEnabled:i.shadowMap.enabled&&B.length>0,shadowMapType:i.shadowMap.type,toneMapping:Vt,decodeVideoTexture:wt&&T.map.isVideoTexture===!0&&xt.getTransfer(T.map.colorSpace)===Dt,decodeVideoTextureEmissive:Lt&&T.emissiveMap.isVideoTexture===!0&&xt.getTransfer(T.emissiveMap.colorSpace)===Dt,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===wr,flipSided:T.side===Vn,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionClipCullDistance:tt&&T.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(tt&&T.extensions.multiDraw===!0||ot)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return sn.vertexUv1s=h.has(1),sn.vertexUv2s=h.has(2),sn.vertexUv3s=h.has(3),h.clear(),sn}function v(T){const R=[];if(T.shaderID?R.push(T.shaderID):(R.push(T.customVertexShaderID),R.push(T.customFragmentShaderID)),T.defines!==void 0)for(const B in T.defines)R.push(B),R.push(T.defines[B]);return T.isRawShaderMaterial===!1&&(D(R,T),w(R,T),R.push(i.outputColorSpace)),R.push(T.customProgramCacheKey),R.join()}function D(T,R){T.push(R.precision),T.push(R.outputColorSpace),T.push(R.envMapMode),T.push(R.envMapCubeUVHeight),T.push(R.mapUv),T.push(R.alphaMapUv),T.push(R.lightMapUv),T.push(R.aoMapUv),T.push(R.bumpMapUv),T.push(R.normalMapUv),T.push(R.displacementMapUv),T.push(R.emissiveMapUv),T.push(R.metalnessMapUv),T.push(R.roughnessMapUv),T.push(R.anisotropyMapUv),T.push(R.clearcoatMapUv),T.push(R.clearcoatNormalMapUv),T.push(R.clearcoatRoughnessMapUv),T.push(R.iridescenceMapUv),T.push(R.iridescenceThicknessMapUv),T.push(R.sheenColorMapUv),T.push(R.sheenRoughnessMapUv),T.push(R.specularMapUv),T.push(R.specularColorMapUv),T.push(R.specularIntensityMapUv),T.push(R.transmissionMapUv),T.push(R.thicknessMapUv),T.push(R.combine),T.push(R.fogExp2),T.push(R.sizeAttenuation),T.push(R.morphTargetsCount),T.push(R.morphAttributeCount),T.push(R.numDirLights),T.push(R.numPointLights),T.push(R.numSpotLights),T.push(R.numSpotLightMaps),T.push(R.numHemiLights),T.push(R.numRectAreaLights),T.push(R.numDirLightShadows),T.push(R.numPointLightShadows),T.push(R.numSpotLightShadows),T.push(R.numSpotLightShadowsWithMaps),T.push(R.numLightProbes),T.push(R.shadowMapType),T.push(R.toneMapping),T.push(R.numClippingPlanes),T.push(R.numClipIntersection),T.push(R.depthPacking)}function w(T,R){c.disableAll(),R.supportsVertexTextures&&c.enable(0),R.instancing&&c.enable(1),R.instancingColor&&c.enable(2),R.instancingMorph&&c.enable(3),R.matcap&&c.enable(4),R.envMap&&c.enable(5),R.normalMapObjectSpace&&c.enable(6),R.normalMapTangentSpace&&c.enable(7),R.clearcoat&&c.enable(8),R.iridescence&&c.enable(9),R.alphaTest&&c.enable(10),R.vertexColors&&c.enable(11),R.vertexAlphas&&c.enable(12),R.vertexUv1s&&c.enable(13),R.vertexUv2s&&c.enable(14),R.vertexUv3s&&c.enable(15),R.vertexTangents&&c.enable(16),R.anisotropy&&c.enable(17),R.alphaHash&&c.enable(18),R.batching&&c.enable(19),R.dispersion&&c.enable(20),R.batchingColor&&c.enable(21),T.push(c.mask),c.disableAll(),R.fog&&c.enable(0),R.useFog&&c.enable(1),R.flatShading&&c.enable(2),R.logarithmicDepthBuffer&&c.enable(3),R.reverseDepthBuffer&&c.enable(4),R.skinning&&c.enable(5),R.morphTargets&&c.enable(6),R.morphNormals&&c.enable(7),R.morphColors&&c.enable(8),R.premultipliedAlpha&&c.enable(9),R.shadowMapEnabled&&c.enable(10),R.doubleSided&&c.enable(11),R.flipSided&&c.enable(12),R.useDepthPacking&&c.enable(13),R.dithering&&c.enable(14),R.transmission&&c.enable(15),R.sheen&&c.enable(16),R.opaque&&c.enable(17),R.pointsUvs&&c.enable(18),R.decodeVideoTexture&&c.enable(19),R.decodeVideoTextureEmissive&&c.enable(20),R.alphaToCoverage&&c.enable(21),T.push(c.mask)}function E(T){const R=M[T.type];let B;if(R){const j=er[R];B=fC.clone(j.uniforms)}else B=T.uniforms;return B}function N(T,R){let B;for(let j=0,q=d.length;j0?n.push(v):_.transparent===!0?r.push(v):t.push(v)}function u(p,m,_,M,S,x){const v=l(p,m,_,M,S,x);_.transmission>0?n.unshift(v):_.transparent===!0?r.unshift(v):t.unshift(v)}function h(p,m){t.length>1&&t.sort(p||P2),n.length>1&&n.sort(m||rv),r.length>1&&r.sort(m||rv)}function d(){for(let p=e,m=i.length;p=a.length?(l=new sv,a.push(l)):l=a[r],l}function t(){i=new WeakMap}return{get:e,dispose:t}}function L2(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new $,color:new At};break;case"SpotLight":t={position:new $,direction:new $,color:new At,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new $,color:new At,distance:0,decay:0};break;case"HemisphereLight":t={direction:new $,skyColor:new At,groundColor:new At};break;case"RectAreaLight":t={color:new At,position:new $,halfWidth:new $,halfHeight:new $};break}return i[e.id]=t,t}}}function I2(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ft};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ft};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ft,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let U2=0;function N2(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function O2(i){const e=new L2,t=I2(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)n.probe.push(new $);const r=new $,a=new rn,l=new rn;function c(h){let d=0,p=0,m=0;for(let T=0;T<9;T++)n.probe[T].set(0,0,0);let _=0,M=0,S=0,x=0,v=0,D=0,w=0,E=0,N=0,U=0,L=0;h.sort(N2);for(let T=0,R=h.length;T0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ee.LTC_FLOAT_1,n.rectAreaLTC2=Ee.LTC_FLOAT_2):(n.rectAreaLTC1=Ee.LTC_HALF_1,n.rectAreaLTC2=Ee.LTC_HALF_2)),n.ambient[0]=d,n.ambient[1]=p,n.ambient[2]=m;const F=n.hash;(F.directionalLength!==_||F.pointLength!==M||F.spotLength!==S||F.rectAreaLength!==x||F.hemiLength!==v||F.numDirectionalShadows!==D||F.numPointShadows!==w||F.numSpotShadows!==E||F.numSpotMaps!==N||F.numLightProbes!==L)&&(n.directional.length=_,n.spot.length=S,n.rectArea.length=x,n.point.length=M,n.hemi.length=v,n.directionalShadow.length=D,n.directionalShadowMap.length=D,n.pointShadow.length=w,n.pointShadowMap.length=w,n.spotShadow.length=E,n.spotShadowMap.length=E,n.directionalShadowMatrix.length=D,n.pointShadowMatrix.length=w,n.spotLightMatrix.length=E+N-U,n.spotLightMap.length=N,n.numSpotLightShadowsWithMaps=U,n.numLightProbes=L,F.directionalLength=_,F.pointLength=M,F.spotLength=S,F.rectAreaLength=x,F.hemiLength=v,F.numDirectionalShadows=D,F.numPointShadows=w,F.numSpotShadows=E,F.numSpotMaps=N,F.numLightProbes=L,n.version=U2++)}function u(h,d){let p=0,m=0,_=0,M=0,S=0;const x=d.matrixWorldInverse;for(let v=0,D=h.length;v=l.length?(c=new av(i),l.push(c)):c=l[a],c}function n(){e=new WeakMap}return{get:t,dispose:n}}class B2 extends _u{static get type(){return"MeshDepthMaterial"}constructor(e){super(),this.isMeshDepthMaterial=!0,this.depthPacking=LR,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 z2 extends _u{static get type(){return"MeshDistanceMaterial"}constructor(e){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const H2=`void main() { gl_Position = vec4( position, 1.0 ); }`,G2=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { const float samples = float( VSM_SAMPLES ); float mean = 0.0; float squared_mean = 0.0; float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); float uvStart = samples <= 1.0 ? 0.0 : - 1.0; for ( float i = 0.0; i < samples; i ++ ) { float uvOffset = uvStart + i * uvStride; #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`;function k2(i,e,t){let n=new k0;const r=new Ft,a=new Ft,l=new en,c=new B2({depthPacking:IR}),u=new z2,h={},d=t.maxTextureSize,p={[ps]:Vn,[Vn]:ps,[wr]:wr},m=new Nr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ft},radius:{value:4}},vertexShader:H2,fragmentShader:G2}),_=m.clone();_.defines.HORIZONTAL_PASS=1;const M=new ia;M.setAttribute("position",new rr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new ki(M,m),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=g0;let v=this.type;this.render=function(U,L,F){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||U.length===0)return;const T=i.getRenderTarget(),R=i.getActiveCubeFace(),B=i.getActiveMipmapLevel(),j=i.state;j.setBlending(cs),j.buffers.color.setClear(1,1,1,1),j.buffers.depth.setTest(!0),j.setScissorTest(!1);const q=v!==Tr&&this.type===Tr,ae=v===Tr&&this.type!==Tr;for(let oe=0,ee=U.length;oed||r.y>d)&&(r.x>d&&(a.x=Math.floor(d/ve.x),r.x=a.x*ve.x,K.mapSize.x=a.x),r.y>d&&(a.y=Math.floor(d/ve.y),r.y=a.y*ve.y,K.mapSize.y=a.y)),K.map===null||q===!0||ae===!0){const Re=this.type!==Tr?{minFilter:Yi,magFilter:Yi}:{};K.map!==null&&K.map.dispose(),K.map=new ms(r.x,r.y,Re),K.map.texture.name=re.name+".shadowMap",K.camera.updateProjectionMatrix()}i.setRenderTarget(K.map),i.clear();const Se=K.getViewportCount();for(let Re=0;Re0||L.map&&L.alphaTest>0){const j=R.uuid,q=L.uuid;let ae=h[j];ae===void 0&&(ae={},h[j]=ae);let oe=ae[q];oe===void 0&&(oe=R.clone(),ae[q]=oe,L.addEventListener("dispose",N)),R=oe}if(R.visible=L.visible,R.wireframe=L.wireframe,T===Tr?R.side=L.shadowSide!==null?L.shadowSide:L.side:R.side=L.shadowSide!==null?L.shadowSide:p[L.side],R.alphaMap=L.alphaMap,R.alphaTest=L.alphaTest,R.map=L.map,R.clipShadows=L.clipShadows,R.clippingPlanes=L.clippingPlanes,R.clipIntersection=L.clipIntersection,R.displacementMap=L.displacementMap,R.displacementScale=L.displacementScale,R.displacementBias=L.displacementBias,R.wireframeLinewidth=L.wireframeLinewidth,R.linewidth=L.linewidth,F.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const j=i.properties.get(R);j.light=F}return R}function E(U,L,F,T,R){if(U.visible===!1)return;if(U.layers.test(L.layers)&&(U.isMesh||U.isLine||U.isPoints)&&(U.castShadow||U.receiveShadow&&R===Tr)&&(!U.frustumCulled||n.intersectsObject(U))){U.modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,U.matrixWorld);const q=e.update(U),ae=U.material;if(Array.isArray(ae)){const oe=q.groups;for(let ee=0,re=oe.length;ee=1):K.indexOf("OpenGL ES")!==-1&&(re=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),ee=re>=2);let ve=null,Se={};const Re=i.getParameter(i.SCISSOR_BOX),Ze=i.getParameter(i.VIEWPORT),St=new en().fromArray(Re),se=new en().fromArray(Ze);function me(G,Te,ne,fe){const we=new Uint8Array(4),Ae=i.createTexture();i.bindTexture(G,Ae),i.texParameteri(G,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(G,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let tt=0;tt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new Ft,d=new WeakMap;let p;const m=new WeakMap;let _=!1;try{_=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function M(I,b){return _?new OffscreenCanvas(I,b):nl("canvas")}function S(I,b,Y){let he=1;const de=He(I);if((de.width>Y||de.height>Y)&&(he=Y/Math.max(de.width,de.height)),he<1)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap||typeof VideoFrame<"u"&&I instanceof VideoFrame){const ce=Math.floor(he*de.width),Ue=Math.floor(he*de.height);p===void 0&&(p=M(ce,Ue));const xe=b?M(ce,Ue):p;return xe.width=ce,xe.height=Ue,xe.getContext("2d").drawImage(I,0,0,ce,Ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+de.width+"x"+de.height+") to ("+ce+"x"+Ue+")."),xe}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+de.width+"x"+de.height+")."),I;return I}function x(I){return I.generateMipmaps}function v(I){i.generateMipmap(I)}function D(I){return I.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:I.isWebGL3DRenderTarget?i.TEXTURE_3D:I.isWebGLArrayRenderTarget||I.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function w(I,b,Y,he,de=!1){if(I!==null){if(i[I]!==void 0)return i[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let ce=b;if(b===i.RED&&(Y===i.FLOAT&&(ce=i.R32F),Y===i.HALF_FLOAT&&(ce=i.R16F),Y===i.UNSIGNED_BYTE&&(ce=i.R8)),b===i.RED_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ce=i.R8UI),Y===i.UNSIGNED_SHORT&&(ce=i.R16UI),Y===i.UNSIGNED_INT&&(ce=i.R32UI),Y===i.BYTE&&(ce=i.R8I),Y===i.SHORT&&(ce=i.R16I),Y===i.INT&&(ce=i.R32I)),b===i.RG&&(Y===i.FLOAT&&(ce=i.RG32F),Y===i.HALF_FLOAT&&(ce=i.RG16F),Y===i.UNSIGNED_BYTE&&(ce=i.RG8)),b===i.RG_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ce=i.RG8UI),Y===i.UNSIGNED_SHORT&&(ce=i.RG16UI),Y===i.UNSIGNED_INT&&(ce=i.RG32UI),Y===i.BYTE&&(ce=i.RG8I),Y===i.SHORT&&(ce=i.RG16I),Y===i.INT&&(ce=i.RG32I)),b===i.RGB_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ce=i.RGB8UI),Y===i.UNSIGNED_SHORT&&(ce=i.RGB16UI),Y===i.UNSIGNED_INT&&(ce=i.RGB32UI),Y===i.BYTE&&(ce=i.RGB8I),Y===i.SHORT&&(ce=i.RGB16I),Y===i.INT&&(ce=i.RGB32I)),b===i.RGBA_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ce=i.RGBA8UI),Y===i.UNSIGNED_SHORT&&(ce=i.RGBA16UI),Y===i.UNSIGNED_INT&&(ce=i.RGBA32UI),Y===i.BYTE&&(ce=i.RGBA8I),Y===i.SHORT&&(ce=i.RGBA16I),Y===i.INT&&(ce=i.RGBA32I)),b===i.RGB&&Y===i.UNSIGNED_INT_5_9_9_9_REV&&(ce=i.RGB9_E5),b===i.RGBA){const Ue=de?mu:xt.getTransfer(he);Y===i.FLOAT&&(ce=i.RGBA32F),Y===i.HALF_FLOAT&&(ce=i.RGBA16F),Y===i.UNSIGNED_BYTE&&(ce=Ue===Dt?i.SRGB8_ALPHA8:i.RGBA8),Y===i.UNSIGNED_SHORT_4_4_4_4&&(ce=i.RGBA4),Y===i.UNSIGNED_SHORT_5_5_5_1&&(ce=i.RGB5_A1)}return(ce===i.R16F||ce===i.R32F||ce===i.RG16F||ce===i.RG32F||ce===i.RGBA16F||ce===i.RGBA32F)&&e.get("EXT_color_buffer_float"),ce}function E(I,b){let Y;return I?b===null||b===ea||b===to?Y=i.DEPTH24_STENCIL8:b===Rr?Y=i.DEPTH32F_STENCIL8:b===tl&&(Y=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===ea||b===to?Y=i.DEPTH_COMPONENT24:b===Rr?Y=i.DEPTH_COMPONENT32F:b===tl&&(Y=i.DEPTH_COMPONENT16),Y}function N(I,b){return x(I)===!0||I.isFramebufferTexture&&I.minFilter!==Yi&&I.minFilter!==nr?Math.log2(Math.max(b.width,b.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?b.mipmaps.length:1}function U(I){const b=I.target;b.removeEventListener("dispose",U),F(b),b.isVideoTexture&&d.delete(b)}function L(I){const b=I.target;b.removeEventListener("dispose",L),R(b)}function F(I){const b=n.get(I);if(b.__webglInit===void 0)return;const Y=I.source,he=m.get(Y);if(he){const de=he[b.__cacheKey];de.usedTimes--,de.usedTimes===0&&T(I),Object.keys(he).length===0&&m.delete(Y)}n.remove(I)}function T(I){const b=n.get(I);i.deleteTexture(b.__webglTexture);const Y=I.source,he=m.get(Y);delete he[b.__cacheKey],l.memory.textures--}function R(I){const b=n.get(I);if(I.depthTexture&&(I.depthTexture.dispose(),n.remove(I.depthTexture)),I.isWebGLCubeRenderTarget)for(let he=0;he<6;he++){if(Array.isArray(b.__webglFramebuffer[he]))for(let de=0;de=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+r.maxTextures),B+=1,I}function ae(I){const b=[];return b.push(I.wrapS),b.push(I.wrapT),b.push(I.wrapR||0),b.push(I.magFilter),b.push(I.minFilter),b.push(I.anisotropy),b.push(I.internalFormat),b.push(I.format),b.push(I.type),b.push(I.generateMipmaps),b.push(I.premultiplyAlpha),b.push(I.flipY),b.push(I.unpackAlignment),b.push(I.colorSpace),b.join()}function oe(I,b){const Y=n.get(I);if(I.isVideoTexture&&ke(I),I.isRenderTargetTexture===!1&&I.version>0&&Y.__version!==I.version){const he=I.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{se(Y,I,b);return}}t.bindTexture(i.TEXTURE_2D,Y.__webglTexture,i.TEXTURE0+b)}function ee(I,b){const Y=n.get(I);if(I.version>0&&Y.__version!==I.version){se(Y,I,b);return}t.bindTexture(i.TEXTURE_2D_ARRAY,Y.__webglTexture,i.TEXTURE0+b)}function re(I,b){const Y=n.get(I);if(I.version>0&&Y.__version!==I.version){se(Y,I,b);return}t.bindTexture(i.TEXTURE_3D,Y.__webglTexture,i.TEXTURE0+b)}function K(I,b){const Y=n.get(I);if(I.version>0&&Y.__version!==I.version){me(Y,I,b);return}t.bindTexture(i.TEXTURE_CUBE_MAP,Y.__webglTexture,i.TEXTURE0+b)}const ve={[el]:i.REPEAT,[Ws]:i.CLAMP_TO_EDGE,[Xh]:i.MIRRORED_REPEAT},Se={[Yi]:i.NEAREST,[DR]:i.NEAREST_MIPMAP_NEAREST,[mc]:i.NEAREST_MIPMAP_LINEAR,[nr]:i.LINEAR,[zf]:i.LINEAR_MIPMAP_NEAREST,[Xs]:i.LINEAR_MIPMAP_LINEAR},Re={[OR]:i.NEVER,[kR]:i.ALWAYS,[FR]:i.LESS,[P0]:i.LEQUAL,[BR]:i.EQUAL,[GR]:i.GEQUAL,[zR]:i.GREATER,[HR]:i.NOTEQUAL};function Ze(I,b){if(b.type===Rr&&e.has("OES_texture_float_linear")===!1&&(b.magFilter===nr||b.magFilter===zf||b.magFilter===mc||b.magFilter===Xs||b.minFilter===nr||b.minFilter===zf||b.minFilter===mc||b.minFilter===Xs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(I,i.TEXTURE_WRAP_S,ve[b.wrapS]),i.texParameteri(I,i.TEXTURE_WRAP_T,ve[b.wrapT]),(I===i.TEXTURE_3D||I===i.TEXTURE_2D_ARRAY)&&i.texParameteri(I,i.TEXTURE_WRAP_R,ve[b.wrapR]),i.texParameteri(I,i.TEXTURE_MAG_FILTER,Se[b.magFilter]),i.texParameteri(I,i.TEXTURE_MIN_FILTER,Se[b.minFilter]),b.compareFunction&&(i.texParameteri(I,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(I,i.TEXTURE_COMPARE_FUNC,Re[b.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Yi||b.minFilter!==mc&&b.minFilter!==Xs||b.type===Rr&&e.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||n.get(b).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");i.texParameterf(I,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),n.get(b).__currentAnisotropy=b.anisotropy}}}function St(I,b){let Y=!1;I.__webglInit===void 0&&(I.__webglInit=!0,b.addEventListener("dispose",U));const he=b.source;let de=m.get(he);de===void 0&&(de={},m.set(he,de));const ce=ae(b);if(ce!==I.__cacheKey){de[ce]===void 0&&(de[ce]={texture:i.createTexture(),usedTimes:0},l.memory.textures++,Y=!0),de[ce].usedTimes++;const Ue=de[I.__cacheKey];Ue!==void 0&&(de[I.__cacheKey].usedTimes--,Ue.usedTimes===0&&T(b)),I.__cacheKey=ce,I.__webglTexture=de[ce].texture}return Y}function se(I,b,Y){let he=i.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(he=i.TEXTURE_2D_ARRAY),b.isData3DTexture&&(he=i.TEXTURE_3D);const de=St(I,b),ce=b.source;t.bindTexture(he,I.__webglTexture,i.TEXTURE0+Y);const Ue=n.get(ce);if(ce.version!==Ue.__version||de===!0){t.activeTexture(i.TEXTURE0+Y);const xe=xt.getPrimaries(xt.workingColorSpace),Ce=b.colorSpace===rs?null:xt.getPrimaries(b.colorSpace),ft=b.colorSpace===rs||xe===Ce?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,b.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,b.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,ft);let _e=S(b.image,!1,r.maxTextureSize);_e=Lt(b,_e);const Pe=a.convert(b.format,b.colorSpace),Ve=a.convert(b.type);let Ye=w(b.internalFormat,Pe,Ve,b.colorSpace,b.isVideoTexture);Ze(he,b);let De;const ut=b.mipmaps,je=b.isVideoTexture!==!0,Rt=Ue.__version===void 0||de===!0,G=ce.dataReady,Te=N(b,_e);if(b.isDepthTexture)Ye=E(b.format===no,b.type),Rt&&(je?t.texStorage2D(i.TEXTURE_2D,1,Ye,_e.width,_e.height):t.texImage2D(i.TEXTURE_2D,0,Ye,_e.width,_e.height,0,Pe,Ve,null));else if(b.isDataTexture)if(ut.length>0){je&&Rt&&t.texStorage2D(i.TEXTURE_2D,Te,Ye,ut[0].width,ut[0].height);for(let ne=0,fe=ut.length;ne0){const we=ov(De.width,De.height,b.format,b.type);for(const Ae of b.layerUpdates){const tt=De.data.subarray(Ae*we/De.data.BYTES_PER_ELEMENT,(Ae+1)*we/De.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,ne,0,0,Ae,De.width,De.height,1,Pe,tt)}b.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,ne,0,0,0,De.width,De.height,_e.depth,Pe,De.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,ne,Ye,De.width,De.height,_e.depth,0,De.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else je?G&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,ne,0,0,0,De.width,De.height,_e.depth,Pe,Ve,De.data):t.texImage3D(i.TEXTURE_2D_ARRAY,ne,Ye,De.width,De.height,_e.depth,0,Pe,Ve,De.data)}else{je&&Rt&&t.texStorage2D(i.TEXTURE_2D,Te,Ye,ut[0].width,ut[0].height);for(let ne=0,fe=ut.length;ne0){const ne=ov(_e.width,_e.height,b.format,b.type);for(const fe of b.layerUpdates){const we=_e.data.subarray(fe*ne/_e.data.BYTES_PER_ELEMENT,(fe+1)*ne/_e.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,fe,_e.width,_e.height,1,Pe,Ve,we)}b.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,_e.width,_e.height,_e.depth,Pe,Ve,_e.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Ye,_e.width,_e.height,_e.depth,0,Pe,Ve,_e.data);else if(b.isData3DTexture)je?(Rt&&t.texStorage3D(i.TEXTURE_3D,Te,Ye,_e.width,_e.height,_e.depth),G&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,_e.width,_e.height,_e.depth,Pe,Ve,_e.data)):t.texImage3D(i.TEXTURE_3D,0,Ye,_e.width,_e.height,_e.depth,0,Pe,Ve,_e.data);else if(b.isFramebufferTexture){if(Rt)if(je)t.texStorage2D(i.TEXTURE_2D,Te,Ye,_e.width,_e.height);else{let ne=_e.width,fe=_e.height;for(let we=0;we>=1,fe>>=1}}else if(ut.length>0){if(je&&Rt){const ne=He(ut[0]);t.texStorage2D(i.TEXTURE_2D,Te,Ye,ne.width,ne.height)}for(let ne=0,fe=ut.length;ne0&&Te++;const fe=He(Pe[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,Te,ut,fe.width,fe.height)}for(let fe=0;fe<6;fe++)if(_e){je?G&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,0,0,Pe[fe].width,Pe[fe].height,Ye,De,Pe[fe].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,ut,Pe[fe].width,Pe[fe].height,0,Ye,De,Pe[fe].data);for(let we=0;we>ce),Ve=Math.max(1,b.height>>ce);de===i.TEXTURE_3D||de===i.TEXTURE_2D_ARRAY?t.texImage3D(de,ce,Ce,Pe,Ve,b.depth,0,Ue,xe,null):t.texImage2D(de,ce,Ce,Pe,Ve,0,Ue,xe,null)}t.bindFramebuffer(i.FRAMEBUFFER,I),Qe(b)?c.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,he,de,_e.__webglTexture,0,dt(b)):(de===i.TEXTURE_2D||de>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&de<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,he,de,_e.__webglTexture,ce),t.bindFramebuffer(i.FRAMEBUFFER,null)}function be(I,b,Y){if(i.bindRenderbuffer(i.RENDERBUFFER,I),b.depthBuffer){const he=b.depthTexture,de=he&&he.isDepthTexture?he.type:null,ce=E(b.stencilBuffer,de),Ue=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,xe=dt(b);Qe(b)?c.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,xe,ce,b.width,b.height):Y?i.renderbufferStorageMultisample(i.RENDERBUFFER,xe,ce,b.width,b.height):i.renderbufferStorage(i.RENDERBUFFER,ce,b.width,b.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ue,i.RENDERBUFFER,I)}else{const he=b.textures;for(let de=0;de{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,he.removeEventListener("dispose",de)};he.addEventListener("dispose",de),b.__depthDisposeCallback=de}b.__boundDepthTexture=he}if(I.depthTexture&&!b.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");Ge(b.__webglFramebuffer,I)}else if(Y){b.__webglDepthbuffer=[];for(let he=0;he<6;he++)if(t.bindFramebuffer(i.FRAMEBUFFER,b.__webglFramebuffer[he]),b.__webglDepthbuffer[he]===void 0)b.__webglDepthbuffer[he]=i.createRenderbuffer(),be(b.__webglDepthbuffer[he],I,!1);else{const de=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ce=b.__webglDepthbuffer[he];i.bindRenderbuffer(i.RENDERBUFFER,ce),i.framebufferRenderbuffer(i.FRAMEBUFFER,de,i.RENDERBUFFER,ce)}}else if(t.bindFramebuffer(i.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=i.createRenderbuffer(),be(b.__webglDepthbuffer,I,!1);else{const he=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,de=b.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,de),i.framebufferRenderbuffer(i.FRAMEBUFFER,he,i.RENDERBUFFER,de)}t.bindFramebuffer(i.FRAMEBUFFER,null)}function ot(I,b,Y){const he=n.get(I);b!==void 0&&Ie(he.__webglFramebuffer,I,I.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),Y!==void 0&&Ke(I)}function wt(I){const b=I.texture,Y=n.get(I),he=n.get(b);I.addEventListener("dispose",L);const de=I.textures,ce=I.isWebGLCubeRenderTarget===!0,Ue=de.length>1;if(Ue||(he.__webglTexture===void 0&&(he.__webglTexture=i.createTexture()),he.__version=b.version,l.memory.textures++),ce){Y.__webglFramebuffer=[];for(let xe=0;xe<6;xe++)if(b.mipmaps&&b.mipmaps.length>0){Y.__webglFramebuffer[xe]=[];for(let Ce=0;Ce0){Y.__webglFramebuffer=[];for(let xe=0;xe0&&Qe(I)===!1){Y.__webglMultisampledFramebuffer=i.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let xe=0;xe0)for(let Ce=0;Ce0)for(let Ce=0;Ce0){if(Qe(I)===!1){const b=I.textures,Y=I.width,he=I.height;let de=i.COLOR_BUFFER_BIT;const ce=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ue=n.get(I),xe=b.length>1;if(xe)for(let Ce=0;Ce0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function ke(I){const b=l.render.frame;d.get(I)!==b&&(d.set(I,b),I.update())}function Lt(I,b){const Y=I.colorSpace,he=I.format,de=I.type;return I.isCompressedTexture===!0||I.isVideoTexture===!0||Y!==fo&&Y!==rs&&(xt.getTransfer(Y)===Dt?(he!==Gi||de!==Ir)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Y)),b}function He(I){return typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement?(h.width=I.naturalWidth||I.width,h.height=I.naturalHeight||I.height):typeof VideoFrame<"u"&&I instanceof VideoFrame?(h.width=I.displayWidth,h.height=I.displayHeight):(h.width=I.width,h.height=I.height),h}this.allocateTextureUnit=q,this.resetTextureUnits=j,this.setTexture2D=oe,this.setTexture2DArray=ee,this.setTexture3D=re,this.setTextureCube=K,this.rebindTextures=ot,this.setupRenderTarget=wt,this.updateRenderTargetMipmap=ct,this.updateMultisampleRenderTarget=un,this.setupDepthRenderbuffer=Ke,this.setupFrameBufferTexture=Ie,this.useMultisampledRTT=Qe}function Y2(i,e){function t(n,r=rs){let a;const l=xt.getTransfer(r);if(n===Ir)return i.UNSIGNED_BYTE;if(n===rp)return i.UNSIGNED_SHORT_4_4_4_4;if(n===sp)return i.UNSIGNED_SHORT_5_5_5_1;if(n===y0)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===S0)return i.BYTE;if(n===M0)return i.SHORT;if(n===tl)return i.UNSIGNED_SHORT;if(n===ip)return i.INT;if(n===ea)return i.UNSIGNED_INT;if(n===Rr)return i.FLOAT;if(n===pl)return i.HALF_FLOAT;if(n===E0)return i.ALPHA;if(n===T0)return i.RGB;if(n===Gi)return i.RGBA;if(n===b0)return i.LUMINANCE;if(n===A0)return i.LUMINANCE_ALPHA;if(n===qa)return i.DEPTH_COMPONENT;if(n===no)return i.DEPTH_STENCIL;if(n===w0)return i.RED;if(n===ap)return i.RED_INTEGER;if(n===R0)return i.RG;if(n===op)return i.RG_INTEGER;if(n===lp)return i.RGBA_INTEGER;if(n===Wc||n===Xc||n===qc||n===Yc)if(l===Dt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(n===Wc)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Xc)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===qc)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Yc)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(n===Wc)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Xc)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===qc)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Yc)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===qh||n===Yh||n===Kh||n===Zh)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(n===qh)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Yh)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Kh)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Zh)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Jh||n===Qh||n===jh)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(n===Jh||n===Qh)return l===Dt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(n===jh)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===$h||n===ed||n===td||n===nd||n===id||n===rd||n===sd||n===ad||n===od||n===ld||n===cd||n===ud||n===fd||n===hd)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(n===$h)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ed)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===td)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===nd)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===id)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===rd)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===sd)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ad)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===od)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ld)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===cd)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ud)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===fd)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===hd)return l===Dt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Kc||n===dd||n===pd)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(n===Kc)return l===Dt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===dd)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===pd)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===C0||n===md||n===_d||n===gd)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(n===Kc)return a.COMPRESSED_RED_RGTC1_EXT;if(n===md)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===_d)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===gd)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===to?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}class K2 extends wi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Ga extends ui{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Z2={type:"move"};class ph{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ga,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 Ga,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new $,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new $),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ga,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new $,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new $),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,a=null,l=null;const c=this._targetRay,u=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){l=!0;for(const S of e.hand.values()){const x=t.getJointPose(S,n),v=this._getHandJoint(h,S);x!==null&&(v.matrix.fromArray(x.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=x.radius),v.visible=x!==null}const d=h.joints["index-finger-tip"],p=h.joints["thumb-tip"],m=d.position.distanceTo(p.position),_=.02,M=.005;h.inputState.pinching&&m>_+M?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&m<=_-M&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,n),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&a!==null&&(r=a),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(Z2)))}return c!==null&&(c.visible=r!==null),u!==null&&(u.visible=a!==null),h!==null&&(h.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Ga;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const J2=` void main() { gl_Position = vec4( position, 1.0 ); }`,Q2=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; void main() { vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); if ( coord.x >= 1.0 ) { gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; } else { gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; } }`;class j2{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const r=new Un,a=e.properties.get(r);a.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Nr({vertexShader:J2,fragmentShader:Q2,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ki(new po(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class $2 extends ho{constructor(e,t){super();const n=this;let r=null,a=1,l=null,c="local-floor",u=1,h=null,d=null,p=null,m=null,_=null,M=null;const S=new j2,x=t.getContextAttributes();let v=null,D=null;const w=[],E=[],N=new Ft;let U=null;const L=new wi;L.viewport=new en;const F=new wi;F.viewport=new en;const T=[L,F],R=new K2;let B=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let me=w[se];return me===void 0&&(me=new ph,w[se]=me),me.getTargetRaySpace()},this.getControllerGrip=function(se){let me=w[se];return me===void 0&&(me=new ph,w[se]=me),me.getGripSpace()},this.getHand=function(se){let me=w[se];return me===void 0&&(me=new ph,w[se]=me),me.getHandSpace()};function q(se){const me=E.indexOf(se.inputSource);if(me===-1)return;const Ie=w[me];Ie!==void 0&&(Ie.update(se.inputSource,se.frame,h||l),Ie.dispatchEvent({type:se.type,data:se.inputSource}))}function ae(){r.removeEventListener("select",q),r.removeEventListener("selectstart",q),r.removeEventListener("selectend",q),r.removeEventListener("squeeze",q),r.removeEventListener("squeezestart",q),r.removeEventListener("squeezeend",q),r.removeEventListener("end",ae),r.removeEventListener("inputsourceschange",oe);for(let se=0;se=0&&(E[be]=null,w[be].disconnect(Ie))}for(let me=0;me=E.length){E.push(Ie),be=Ke;break}else if(E[Ke]===null){E[Ke]=Ie,be=Ke;break}if(be===-1)break}const Ge=w[be];Ge&&Ge.connect(Ie)}}const ee=new $,re=new $;function K(se,me,Ie){ee.setFromMatrixPosition(me.matrixWorld),re.setFromMatrixPosition(Ie.matrixWorld);const be=ee.distanceTo(re),Ge=me.projectionMatrix.elements,Ke=Ie.projectionMatrix.elements,ot=Ge[14]/(Ge[10]-1),wt=Ge[14]/(Ge[10]+1),ct=(Ge[9]+1)/Ge[5],kt=(Ge[9]-1)/Ge[5],H=(Ge[8]-1)/Ge[0],un=(Ke[8]+1)/Ke[0],dt=ot*H,Qe=ot*un,ke=be/(-H+un),Lt=ke*-H;if(me.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(Lt),se.translateZ(ke),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),Ge[10]===-1)se.projectionMatrix.copy(me.projectionMatrix),se.projectionMatrixInverse.copy(me.projectionMatrixInverse);else{const He=ot+ke,I=wt+ke,b=dt-Lt,Y=Qe+(be-Lt),he=ct*wt/I*He,de=kt*wt/I*He;se.projectionMatrix.makePerspective(b,Y,he,de,He,I),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function ve(se,me){me===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(me.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(r===null)return;let me=se.near,Ie=se.far;S.texture!==null&&(S.depthNear>0&&(me=S.depthNear),S.depthFar>0&&(Ie=S.depthFar)),R.near=F.near=L.near=me,R.far=F.far=L.far=Ie,(B!==R.near||j!==R.far)&&(r.updateRenderState({depthNear:R.near,depthFar:R.far}),B=R.near,j=R.far),L.layers.mask=se.layers.mask|2,F.layers.mask=se.layers.mask|4,R.layers.mask=L.layers.mask|F.layers.mask;const be=se.parent,Ge=R.cameras;ve(R,be);for(let Ke=0;Ke0&&(x.alphaTest.value=v.alphaTest);const D=e.get(v),w=D.envMap,E=D.envMapRotation;w&&(x.envMap.value=w,Ns.copy(E),Ns.x*=-1,Ns.y*=-1,Ns.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Ns.y*=-1,Ns.z*=-1),x.envMapRotation.value.setFromMatrix4(eI.makeRotationFromEuler(Ns)),x.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=v.reflectivity,x.ior.value=v.ior,x.refractionRatio.value=v.refractionRatio),v.lightMap&&(x.lightMap.value=v.lightMap,x.lightMapIntensity.value=v.lightMapIntensity,t(v.lightMap,x.lightMapTransform)),v.aoMap&&(x.aoMap.value=v.aoMap,x.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,x.aoMapTransform))}function l(x,v){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,v.map&&(x.map.value=v.map,t(v.map,x.mapTransform))}function c(x,v){x.dashSize.value=v.dashSize,x.totalSize.value=v.dashSize+v.gapSize,x.scale.value=v.scale}function u(x,v,D,w){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,x.size.value=v.size*D,x.scale.value=w*.5,v.map&&(x.map.value=v.map,t(v.map,x.uvTransform)),v.alphaMap&&(x.alphaMap.value=v.alphaMap,t(v.alphaMap,x.alphaMapTransform)),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest)}function h(x,v){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,x.rotation.value=v.rotation,v.map&&(x.map.value=v.map,t(v.map,x.mapTransform)),v.alphaMap&&(x.alphaMap.value=v.alphaMap,t(v.alphaMap,x.alphaMapTransform)),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest)}function d(x,v){x.specular.value.copy(v.specular),x.shininess.value=Math.max(v.shininess,1e-4)}function p(x,v){v.gradientMap&&(x.gradientMap.value=v.gradientMap)}function m(x,v){x.metalness.value=v.metalness,v.metalnessMap&&(x.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,x.metalnessMapTransform)),x.roughness.value=v.roughness,v.roughnessMap&&(x.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,x.roughnessMapTransform)),v.envMap&&(x.envMapIntensity.value=v.envMapIntensity)}function _(x,v,D){x.ior.value=v.ior,v.sheen>0&&(x.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),x.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(x.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,x.sheenColorMapTransform)),v.sheenRoughnessMap&&(x.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,x.sheenRoughnessMapTransform))),v.clearcoat>0&&(x.clearcoat.value=v.clearcoat,x.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(x.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,x.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(x.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Vn&&x.clearcoatNormalScale.value.negate())),v.dispersion>0&&(x.dispersion.value=v.dispersion),v.iridescence>0&&(x.iridescence.value=v.iridescence,x.iridescenceIOR.value=v.iridescenceIOR,x.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(x.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,x.iridescenceMapTransform)),v.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),v.transmission>0&&(x.transmission.value=v.transmission,x.transmissionSamplerMap.value=D.texture,x.transmissionSamplerSize.value.set(D.width,D.height),v.transmissionMap&&(x.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,x.transmissionMapTransform)),x.thickness.value=v.thickness,v.thicknessMap&&(x.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=v.attenuationDistance,x.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(x.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(x.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=v.specularIntensity,x.specularColor.value.copy(v.specularColor),v.specularColorMap&&(x.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,x.specularColorMapTransform)),v.specularIntensityMap&&(x.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,x.specularIntensityMapTransform))}function M(x,v){v.matcap&&(x.matcap.value=v.matcap)}function S(x,v){const D=e.get(v).light;x.referencePosition.value.setFromMatrixPosition(D.matrixWorld),x.nearDistance.value=D.shadow.camera.near,x.farDistance.value=D.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function nI(i,e,t,n){let r={},a={},l=[];const c=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function u(D,w){const E=w.program;n.uniformBlockBinding(D,E)}function h(D,w){let E=r[D.id];E===void 0&&(M(D),E=d(D),r[D.id]=E,D.addEventListener("dispose",x));const N=w.program;n.updateUBOMapping(D,N);const U=e.render.frame;a[D.id]!==U&&(m(D),a[D.id]=U)}function d(D){const w=p();D.__bindingPointIndex=w;const E=i.createBuffer(),N=D.__size,U=D.usage;return i.bindBuffer(i.UNIFORM_BUFFER,E),i.bufferData(i.UNIFORM_BUFFER,N,U),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,w,E),E}function p(){for(let D=0;D0&&(E+=N-U),D.__size=E,D.__cache={},this}function S(D){const w={boundary:0,storage:0};return typeof D=="number"||typeof D=="boolean"?(w.boundary=4,w.storage=4):D.isVector2?(w.boundary=8,w.storage=8):D.isVector3||D.isColor?(w.boundary=16,w.storage=12):D.isVector4?(w.boundary=16,w.storage=16):D.isMatrix3?(w.boundary=48,w.storage=48):D.isMatrix4?(w.boundary=64,w.storage=64):D.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",D),w}function x(D){const w=D.target;w.removeEventListener("dispose",x);const E=l.indexOf(w.__bindingPointIndex);l.splice(E,1),i.deleteBuffer(r[w.id]),delete r[w.id],delete a[w.id]}function v(){for(const D in r)i.deleteBuffer(r[D]);l=[],r={},a={}}return{bind:u,update:h,dispose:v}}class iI{constructor(e={}){const{canvas:t=WR(),context:n=null,depth:r=!0,stencil:a=!1,alpha:l=!1,antialias:c=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:h=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:p=!1,reverseDepthBuffer:m=!1}=e;this.isWebGLRenderer=!0;let _;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=n.getContextAttributes().alpha}else _=l;const M=new Uint32Array(4),S=new Int32Array(4);let x=null,v=null;const D=[],w=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=si,this.toneMapping=us,this.toneMappingExposure=1;const E=this;let N=!1,U=0,L=0,F=null,T=-1,R=null;const B=new en,j=new en;let q=null;const ae=new At(0);let oe=0,ee=t.width,re=t.height,K=1,ve=null,Se=null;const Re=new en(0,0,ee,re),Ze=new en(0,0,ee,re);let St=!1;const se=new k0;let me=!1,Ie=!1;const be=new rn,Ge=new rn,Ke=new $,ot=new en,wt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ct=!1;function kt(){return F===null?K:1}let H=n;function un(C,W){return t.getContext(C,W)}try{const C={alpha:!0,depth:r,stencil:a,antialias:c,premultipliedAlpha:u,preserveDrawingBuffer:h,powerPreference:d,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${np}`),t.addEventListener("webglcontextlost",fe,!1),t.addEventListener("webglcontextrestored",we,!1),t.addEventListener("webglcontextcreationerror",Ae,!1),H===null){const W="webgl2";if(H=un(W,C),H===null)throw un(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let dt,Qe,ke,Lt,He,I,b,Y,he,de,ce,Ue,xe,Ce,ft,_e,Pe,Ve,Ye,De,ut,je,Rt,G;function Te(){dt=new lL(H),dt.init(),je=new Y2(H,dt),Qe=new nL(H,dt,e,je),ke=new W2(H,dt),Qe.reverseDepthBuffer&&m&&ke.buffers.depth.setReversed(!0),Lt=new fL(H),He=new C2,I=new q2(H,dt,ke,He,Qe,je,Lt),b=new rL(E),Y=new oL(E),he=new vC(H),Rt=new eL(H,he),de=new cL(H,he,Lt,Rt),ce=new dL(H,de,he,Lt),Ye=new hL(H,Qe,I),_e=new iL(He),Ue=new R2(E,b,Y,dt,Qe,Rt,_e),xe=new tI(E,He),Ce=new D2,ft=new F2(dt),Ve=new $D(E,b,Y,ke,ce,_,u),Pe=new k2(E,ce,Qe),G=new nI(H,Lt,Qe,ke),De=new tL(H,dt,Lt),ut=new uL(H,dt,Lt),Lt.programs=Ue.programs,E.capabilities=Qe,E.extensions=dt,E.properties=He,E.renderLists=Ce,E.shadowMap=Pe,E.state=ke,E.info=Lt}Te();const ne=new $2(E,H);this.xr=ne,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){const C=dt.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=dt.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return K},this.setPixelRatio=function(C){C!==void 0&&(K=C,this.setSize(ee,re,!1))},this.getSize=function(C){return C.set(ee,re)},this.setSize=function(C,W,Z=!0){if(ne.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ee=C,re=W,t.width=Math.floor(C*K),t.height=Math.floor(W*K),Z===!0&&(t.style.width=C+"px",t.style.height=W+"px"),this.setViewport(0,0,C,W)},this.getDrawingBufferSize=function(C){return C.set(ee*K,re*K).floor()},this.setDrawingBufferSize=function(C,W,Z){ee=C,re=W,K=Z,t.width=Math.floor(C*Z),t.height=Math.floor(W*Z),this.setViewport(0,0,C,W)},this.getCurrentViewport=function(C){return C.copy(B)},this.getViewport=function(C){return C.copy(Re)},this.setViewport=function(C,W,Z,J){C.isVector4?Re.set(C.x,C.y,C.z,C.w):Re.set(C,W,Z,J),ke.viewport(B.copy(Re).multiplyScalar(K).round())},this.getScissor=function(C){return C.copy(Ze)},this.setScissor=function(C,W,Z,J){C.isVector4?Ze.set(C.x,C.y,C.z,C.w):Ze.set(C,W,Z,J),ke.scissor(j.copy(Ze).multiplyScalar(K).round())},this.getScissorTest=function(){return St},this.setScissorTest=function(C){ke.setScissorTest(St=C)},this.setOpaqueSort=function(C){ve=C},this.setTransparentSort=function(C){Se=C},this.getClearColor=function(C){return C.copy(Ve.getClearColor())},this.setClearColor=function(){Ve.setClearColor.apply(Ve,arguments)},this.getClearAlpha=function(){return Ve.getClearAlpha()},this.setClearAlpha=function(){Ve.setClearAlpha.apply(Ve,arguments)},this.clear=function(C=!0,W=!0,Z=!0){let J=0;if(C){let V=!1;if(F!==null){const ge=F.texture.format;V=ge===lp||ge===op||ge===ap}if(V){const ge=F.texture.type,Me=ge===Ir||ge===ea||ge===tl||ge===to||ge===rp||ge===sp,Oe=Ve.getClearColor(),Fe=Ve.getClearAlpha(),Je=Oe.r,$e=Oe.g,Ne=Oe.b;Me?(M[0]=Je,M[1]=$e,M[2]=Ne,M[3]=Fe,H.clearBufferuiv(H.COLOR,0,M)):(S[0]=Je,S[1]=$e,S[2]=Ne,S[3]=Fe,H.clearBufferiv(H.COLOR,0,S))}else J|=H.COLOR_BUFFER_BIT}W&&(J|=H.DEPTH_BUFFER_BIT),Z&&(J|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H.clear(J)},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",fe,!1),t.removeEventListener("webglcontextrestored",we,!1),t.removeEventListener("webglcontextcreationerror",Ae,!1),Ce.dispose(),ft.dispose(),He.dispose(),b.dispose(),Y.dispose(),ce.dispose(),Rt.dispose(),G.dispose(),Ue.dispose(),ne.dispose(),ne.removeEventListener("sessionstart",sa),ne.removeEventListener("sessionend",Sl),Li.stop()};function fe(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function we(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1;const C=Lt.autoReset,W=Pe.enabled,Z=Pe.autoUpdate,J=Pe.needsUpdate,V=Pe.type;Te(),Lt.autoReset=C,Pe.enabled=W,Pe.autoUpdate=Z,Pe.needsUpdate=J,Pe.type=V}function Ae(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function tt(C){const W=C.target;W.removeEventListener("dispose",tt),Vt(W)}function Vt(C){sn(C),He.remove(C)}function sn(C){const W=He.get(C).programs;W!==void 0&&(W.forEach(function(Z){Ue.releaseProgram(Z)}),C.isShaderMaterial&&Ue.releaseShaderCache(C))}this.renderBufferDirect=function(C,W,Z,J,V,ge){W===null&&(W=wt);const Me=V.isMesh&&V.matrixWorld.determinant()<0,Oe=Al(C,W,Z,J,V);ke.setMaterial(J,Me);let Fe=Z.index,Je=1;if(J.wireframe===!0){if(Fe=de.getWireframeAttribute(Z),Fe===void 0)return;Je=2}const $e=Z.drawRange,Ne=Z.attributes.position;let mt=$e.start*Je,Ct=($e.start+$e.count)*Je;ge!==null&&(mt=Math.max(mt,ge.start*Je),Ct=Math.min(Ct,(ge.start+ge.count)*Je)),Fe!==null?(mt=Math.max(mt,0),Ct=Math.min(Ct,Fe.count)):Ne!=null&&(mt=Math.max(mt,0),Ct=Math.min(Ct,Ne.count));const It=Ct-mt;if(It<0||It===1/0)return;Rt.setup(V,J,Oe,Z,Fe);let gn,Mt=De;if(Fe!==null&&(gn=he.get(Fe),Mt=ut,Mt.setIndex(gn)),V.isMesh)J.wireframe===!0?(ke.setLineWidth(J.wireframeLinewidth*kt()),Mt.setMode(H.LINES)):Mt.setMode(H.TRIANGLES);else if(V.isLine){let ze=J.linewidth;ze===void 0&&(ze=1),ke.setLineWidth(ze*kt()),V.isLineSegments?Mt.setMode(H.LINES):V.isLineLoop?Mt.setMode(H.LINE_LOOP):Mt.setMode(H.LINE_STRIP)}else V.isPoints?Mt.setMode(H.POINTS):V.isSprite&&Mt.setMode(H.TRIANGLES);if(V.isBatchedMesh)if(V._multiDrawInstances!==null)Mt.renderMultiDrawInstances(V._multiDrawStarts,V._multiDrawCounts,V._multiDrawCount,V._multiDrawInstances);else if(dt.get("WEBGL_multi_draw"))Mt.renderMultiDraw(V._multiDrawStarts,V._multiDrawCounts,V._multiDrawCount);else{const ze=V._multiDrawStarts,di=V._multiDrawCounts,vt=V._multiDrawCount,An=Fe?he.get(Fe).bytesPerElement:1,Br=He.get(J).currentProgram.getUniforms();for(let vn=0;vn{function ge(){if(J.forEach(function(Me){He.get(Me).currentProgram.isReady()&&J.delete(Me)}),J.size===0){V(C);return}setTimeout(ge,10)}dt.get("KHR_parallel_shader_compile")!==null?ge():setTimeout(ge,10)})};let Zn=null;function Di(C){Zn&&Zn(C)}function sa(){Li.stop()}function Sl(){Li.start()}const Li=new V0;Li.setAnimationLoop(Di),typeof self<"u"&&Li.setContext(self),this.setAnimationLoop=function(C){Zn=C,ne.setAnimationLoop(C),C===null?Li.stop():Li.start()},ne.addEventListener("sessionstart",sa),ne.addEventListener("sessionend",Sl),this.render=function(C,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(N===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),ne.enabled===!0&&ne.isPresenting===!0&&(ne.cameraAutoUpdate===!0&&ne.updateCamera(W),W=ne.getCamera()),C.isScene===!0&&C.onBeforeRender(E,C,W,F),v=ft.get(C,w.length),v.init(W),w.push(v),Ge.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),se.setFromProjectionMatrix(Ge),Ie=this.localClippingEnabled,me=_e.init(this.clippingPlanes,Ie),x=Ce.get(C,D.length),x.init(),D.push(x),ne.enabled===!0&&ne.isPresenting===!0){const ge=E.xr.getDepthSensingMesh();ge!==null&&_o(ge,W,-1/0,E.sortObjects)}_o(C,W,0,E.sortObjects),x.finish(),E.sortObjects===!0&&x.sort(ve,Se),ct=ne.enabled===!1||ne.isPresenting===!1||ne.hasDepthSensing()===!1,ct&&Ve.addToRenderList(x,C),this.info.render.frame++,me===!0&&_e.beginShadows();const Z=v.state.shadowsArray;Pe.render(Z,C,W),me===!0&&_e.endShadows(),this.info.autoReset===!0&&this.info.reset();const J=x.opaque,V=x.transmissive;if(v.setupLights(),W.isArrayCamera){const ge=W.cameras;if(V.length>0)for(let Me=0,Oe=ge.length;Me0&&yl(J,V,C,W),ct&&Ve.render(C),Ml(x,C,W);F!==null&&(I.updateMultisampleRenderTarget(F),I.updateRenderTargetMipmap(F)),C.isScene===!0&&C.onAfterRender(E,C,W),Rt.resetDefaultState(),T=-1,R=null,w.pop(),w.length>0?(v=w[w.length-1],me===!0&&_e.setGlobalState(E.clippingPlanes,v.state.camera)):v=null,D.pop(),D.length>0?x=D[D.length-1]:x=null};function _o(C,W,Z,J){if(C.visible===!1)return;if(C.layers.test(W.layers)){if(C.isGroup)Z=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(W);else if(C.isLight)v.pushLight(C),C.castShadow&&v.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||se.intersectsSprite(C)){J&&ot.setFromMatrixPosition(C.matrixWorld).applyMatrix4(Ge);const Me=ce.update(C),Oe=C.material;Oe.visible&&x.push(C,Me,Oe,Z,ot.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||se.intersectsObject(C))){const Me=ce.update(C),Oe=C.material;if(J&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),ot.copy(C.boundingSphere.center)):(Me.boundingSphere===null&&Me.computeBoundingSphere(),ot.copy(Me.boundingSphere.center)),ot.applyMatrix4(C.matrixWorld).applyMatrix4(Ge)),Array.isArray(Oe)){const Fe=Me.groups;for(let Je=0,$e=Fe.length;Je<$e;Je++){const Ne=Fe[Je],mt=Oe[Ne.materialIndex];mt&&mt.visible&&x.push(C,Me,mt,Z,ot.z,Ne)}}else Oe.visible&&x.push(C,Me,Oe,Z,ot.z,null)}}const ge=C.children;for(let Me=0,Oe=ge.length;Me0&&aa(V,W,Z),ge.length>0&&aa(ge,W,Z),Me.length>0&&aa(Me,W,Z),ke.buffers.depth.setTest(!0),ke.buffers.depth.setMask(!0),ke.buffers.color.setMask(!0),ke.setPolygonOffset(!1)}function yl(C,W,Z,J){if((Z.isScene===!0?Z.overrideMaterial:null)!==null)return;v.state.transmissionRenderTarget[J.id]===void 0&&(v.state.transmissionRenderTarget[J.id]=new ms(1,1,{generateMipmaps:!0,type:dt.has("EXT_color_buffer_half_float")||dt.has("EXT_color_buffer_float")?pl:Ir,minFilter:Xs,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xt.workingColorSpace}));const ge=v.state.transmissionRenderTarget[J.id],Me=J.viewport||B;ge.setSize(Me.z,Me.w);const Oe=E.getRenderTarget();E.setRenderTarget(ge),E.getClearColor(ae),oe=E.getClearAlpha(),oe<1&&E.setClearColor(16777215,.5),E.clear(),ct&&Ve.render(Z);const Fe=E.toneMapping;E.toneMapping=us;const Je=J.viewport;if(J.viewport!==void 0&&(J.viewport=void 0),v.setupLightsView(J),me===!0&&_e.setGlobalState(E.clippingPlanes,J),aa(C,Z,J),I.updateMultisampleRenderTarget(ge),I.updateRenderTargetMipmap(ge),dt.has("WEBGL_multisampled_render_to_texture")===!1){let $e=!1;for(let Ne=0,mt=W.length;Ne0),Ne=!!Z.morphAttributes.position,mt=!!Z.morphAttributes.normal,Ct=!!Z.morphAttributes.color;let It=us;J.toneMapped&&(F===null||F.isXRRenderTarget===!0)&&(It=E.toneMapping);const gn=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,Mt=gn!==void 0?gn.length:0,ze=He.get(J),di=v.state.lights;if(me===!0&&(Ie===!0||C!==R)){const wn=C===R&&J.id===T;_e.setState(J,C,wn)}let vt=!1;J.version===ze.__version?(ze.needsLights&&ze.lightsStateVersion!==di.state.version||ze.outputColorSpace!==Oe||V.isBatchedMesh&&ze.batching===!1||!V.isBatchedMesh&&ze.batching===!0||V.isBatchedMesh&&ze.batchingColor===!0&&V.colorTexture===null||V.isBatchedMesh&&ze.batchingColor===!1&&V.colorTexture!==null||V.isInstancedMesh&&ze.instancing===!1||!V.isInstancedMesh&&ze.instancing===!0||V.isSkinnedMesh&&ze.skinning===!1||!V.isSkinnedMesh&&ze.skinning===!0||V.isInstancedMesh&&ze.instancingColor===!0&&V.instanceColor===null||V.isInstancedMesh&&ze.instancingColor===!1&&V.instanceColor!==null||V.isInstancedMesh&&ze.instancingMorph===!0&&V.morphTexture===null||V.isInstancedMesh&&ze.instancingMorph===!1&&V.morphTexture!==null||ze.envMap!==Fe||J.fog===!0&&ze.fog!==ge||ze.numClippingPlanes!==void 0&&(ze.numClippingPlanes!==_e.numPlanes||ze.numIntersection!==_e.numIntersection)||ze.vertexAlphas!==Je||ze.vertexTangents!==$e||ze.morphTargets!==Ne||ze.morphNormals!==mt||ze.morphColors!==Ct||ze.toneMapping!==It||ze.morphTargetsCount!==Mt)&&(vt=!0):(vt=!0,ze.__version=J.version);let An=ze.currentProgram;vt===!0&&(An=oa(J,W,V));let Br=!1,vn=!1,Ki=!1;const Pt=An.getUniforms(),pi=ze.uniforms;if(ke.useProgram(An.program)&&(Br=!0,vn=!0,Ki=!0),J.id!==T&&(T=J.id,vn=!0),Br||R!==C){ke.buffers.depth.getReversed()?(be.copy(C.projectionMatrix),qR(be),YR(be),Pt.setValue(H,"projectionMatrix",be)):Pt.setValue(H,"projectionMatrix",C.projectionMatrix),Pt.setValue(H,"viewMatrix",C.matrixWorldInverse);const mi=Pt.map.cameraPosition;mi!==void 0&&mi.setValue(H,Ke.setFromMatrixPosition(C.matrixWorld)),Qe.logarithmicDepthBuffer&&Pt.setValue(H,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(J.isMeshPhongMaterial||J.isMeshToonMaterial||J.isMeshLambertMaterial||J.isMeshBasicMaterial||J.isMeshStandardMaterial||J.isShaderMaterial)&&Pt.setValue(H,"isOrthographic",C.isOrthographicCamera===!0),R!==C&&(R=C,vn=!0,Ki=!0)}if(V.isSkinnedMesh){Pt.setOptional(H,V,"bindMatrix"),Pt.setOptional(H,V,"bindMatrixInverse");const wn=V.skeleton;wn&&(wn.boneTexture===null&&wn.computeBoneTexture(),Pt.setValue(H,"boneTexture",wn.boneTexture,I))}V.isBatchedMesh&&(Pt.setOptional(H,V,"batchingTexture"),Pt.setValue(H,"batchingTexture",V._matricesTexture,I),Pt.setOptional(H,V,"batchingIdTexture"),Pt.setValue(H,"batchingIdTexture",V._indirectTexture,I),Pt.setOptional(H,V,"batchingColorTexture"),V._colorsTexture!==null&&Pt.setValue(H,"batchingColorTexture",V._colorsTexture,I));const zr=Z.morphAttributes;if((zr.position!==void 0||zr.normal!==void 0||zr.color!==void 0)&&Ye.update(V,Z,An),(vn||ze.receiveShadow!==V.receiveShadow)&&(ze.receiveShadow=V.receiveShadow,Pt.setValue(H,"receiveShadow",V.receiveShadow)),J.isMeshGouraudMaterial&&J.envMap!==null&&(pi.envMap.value=Fe,pi.flipEnvMap.value=Fe.isCubeTexture&&Fe.isRenderTargetTexture===!1?-1:1),J.isMeshStandardMaterial&&J.envMap===null&&W.environment!==null&&(pi.envMapIntensity.value=W.environmentIntensity),vn&&(Pt.setValue(H,"toneMappingExposure",E.toneMappingExposure),ze.needsLights&&yu(pi,Ki),ge&&J.fog===!0&&xe.refreshFogUniforms(pi,ge),xe.refreshMaterialUniforms(pi,J,K,re,v.state.transmissionRenderTarget[C.id]),Zc.upload(H,Tl(ze),pi,I)),J.isShaderMaterial&&J.uniformsNeedUpdate===!0&&(Zc.upload(H,Tl(ze),pi,I),J.uniformsNeedUpdate=!1),J.isSpriteMaterial&&Pt.setValue(H,"center",V.center),Pt.setValue(H,"modelViewMatrix",V.modelViewMatrix),Pt.setValue(H,"normalMatrix",V.normalMatrix),Pt.setValue(H,"modelMatrix",V.matrixWorld),J.isShaderMaterial||J.isRawShaderMaterial){const wn=J.uniformsGroups;for(let mi=0,Zi=wn.length;mi0&&I.useMultisampledRTT(C)===!1?V=He.get(C).__webglMultisampledFramebuffer:Array.isArray($e)?V=$e[Z]:V=$e,B.copy(C.viewport),j.copy(C.scissor),q=C.scissorTest}else B.copy(Re).multiplyScalar(K).floor(),j.copy(Ze).multiplyScalar(K).floor(),q=St;if(ke.bindFramebuffer(H.FRAMEBUFFER,V)&&J&&ke.drawBuffers(C,V),ke.viewport(B),ke.scissor(j),ke.setScissorTest(q),ge){const Fe=He.get(C.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+W,Fe.__webglTexture,Z)}else if(Me){const Fe=He.get(C.texture),Je=W||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,Fe.__webglTexture,Z||0,Je)}T=-1},this.readRenderTargetPixels=function(C,W,Z,J,V,ge,Me){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Oe=He.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Me!==void 0&&(Oe=Oe[Me]),Oe){ke.bindFramebuffer(H.FRAMEBUFFER,Oe);try{const Fe=C.texture,Je=Fe.format,$e=Fe.type;if(!Qe.textureFormatReadable(Je)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Qe.textureTypeReadable($e)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=C.width-J&&Z>=0&&Z<=C.height-V&&H.readPixels(W,Z,J,V,je.convert(Je),je.convert($e),ge)}finally{const Fe=F!==null?He.get(F).__webglFramebuffer:null;ke.bindFramebuffer(H.FRAMEBUFFER,Fe)}}},this.readRenderTargetPixelsAsync=async function(C,W,Z,J,V,ge,Me){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Oe=He.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Me!==void 0&&(Oe=Oe[Me]),Oe){const Fe=C.texture,Je=Fe.format,$e=Fe.type;if(!Qe.textureFormatReadable(Je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Qe.textureTypeReadable($e))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(W>=0&&W<=C.width-J&&Z>=0&&Z<=C.height-V){ke.bindFramebuffer(H.FRAMEBUFFER,Oe);const Ne=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,Ne),H.bufferData(H.PIXEL_PACK_BUFFER,ge.byteLength,H.STREAM_READ),H.readPixels(W,Z,J,V,je.convert(Je),je.convert($e),0);const mt=F!==null?He.get(F).__webglFramebuffer:null;ke.bindFramebuffer(H.FRAMEBUFFER,mt);const Ct=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);return H.flush(),await XR(H,Ct,4),H.bindBuffer(H.PIXEL_PACK_BUFFER,Ne),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,ge),H.deleteBuffer(Ne),H.deleteSync(Ct),ge}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(C,W=null,Z=0){C.isTexture!==!0&&(Ho("WebGLRenderer: copyFramebufferToTexture function signature has changed."),W=arguments[0]||null,C=arguments[1]);const J=Math.pow(2,-Z),V=Math.floor(C.image.width*J),ge=Math.floor(C.image.height*J),Me=W!==null?W.x:0,Oe=W!==null?W.y:0;I.setTexture2D(C,0),H.copyTexSubImage2D(H.TEXTURE_2D,Z,0,0,Me,Oe,V,ge),ke.unbindTexture()},this.copyTextureToTexture=function(C,W,Z=null,J=null,V=0){C.isTexture!==!0&&(Ho("WebGLRenderer: copyTextureToTexture function signature has changed."),J=arguments[0]||null,C=arguments[1],W=arguments[2],V=arguments[3]||0,Z=null);let ge,Me,Oe,Fe,Je,$e,Ne,mt,Ct;const It=C.isCompressedTexture?C.mipmaps[V]:C.image;Z!==null?(ge=Z.max.x-Z.min.x,Me=Z.max.y-Z.min.y,Oe=Z.isBox3?Z.max.z-Z.min.z:1,Fe=Z.min.x,Je=Z.min.y,$e=Z.isBox3?Z.min.z:0):(ge=It.width,Me=It.height,Oe=It.depth||1,Fe=0,Je=0,$e=0),J!==null?(Ne=J.x,mt=J.y,Ct=J.z):(Ne=0,mt=0,Ct=0);const gn=je.convert(W.format),Mt=je.convert(W.type);let ze;W.isData3DTexture?(I.setTexture3D(W,0),ze=H.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(I.setTexture2DArray(W,0),ze=H.TEXTURE_2D_ARRAY):(I.setTexture2D(W,0),ze=H.TEXTURE_2D),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,W.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,W.unpackAlignment);const di=H.getParameter(H.UNPACK_ROW_LENGTH),vt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),An=H.getParameter(H.UNPACK_SKIP_PIXELS),Br=H.getParameter(H.UNPACK_SKIP_ROWS),vn=H.getParameter(H.UNPACK_SKIP_IMAGES);H.pixelStorei(H.UNPACK_ROW_LENGTH,It.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,It.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,Fe),H.pixelStorei(H.UNPACK_SKIP_ROWS,Je),H.pixelStorei(H.UNPACK_SKIP_IMAGES,$e);const Ki=C.isDataArrayTexture||C.isData3DTexture,Pt=W.isDataArrayTexture||W.isData3DTexture;if(C.isRenderTargetTexture||C.isDepthTexture){const pi=He.get(C),zr=He.get(W),wn=He.get(pi.__renderTarget),mi=He.get(zr.__renderTarget);ke.bindFramebuffer(H.READ_FRAMEBUFFER,wn.__webglFramebuffer),ke.bindFramebuffer(H.DRAW_FRAMEBUFFER,mi.__webglFramebuffer);for(let Zi=0;Zi0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const lv={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class rI{constructor(e,t,n){const r=this;let a=!1,l=0,c=0,u;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,a===!1&&r.onStart!==void 0&&r.onStart(d,l,c),a=!0},this.itemEnd=function(d){l++,r.onProgress!==void 0&&r.onProgress(d,l,c),l===c&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(d){r.onError!==void 0&&r.onError(d)},this.resolveURL=function(d){return u?u(d):d},this.setURLModifier=function(d){return u=d,this},this.addHandler=function(d,p){return h.push(d,p),this},this.removeHandler=function(d){const p=h.indexOf(d);return p!==-1&&h.splice(p,2),this},this.getHandler=function(d){for(let p=0,m=h.length;p"u"},ar=function(e){return typeof e=="object"},Wn=function(e){return e!==!1},mp=function(){return typeof window<"u"},Oc=function(e){return Jt(e)||pn(e)},j0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},bn=Array.isArray,Md=/(?:-?\.?\d|\.)+/gi,$0=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ka=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,mh=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ex=/[+-]=-?[.\d]+/,tx=/[^,'"\[\]\s]+/gi,hI=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Yt,$i,yd,_p,hi={},su={},nx,ix=function(e){return(su=ta(e,hi))&&Kn},gp=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},il=function(e,t){return!t&&console.warn(e)},rx=function(e,t){return e&&(hi[e]=t)&&su&&(su[e]=t)||hi},rl=function(){return 0},dI={suppressEvents:!0,isStart:!0,kill:!1},Jc={suppressEvents:!0,kill:!1},pI={suppressEvents:!0},vp={},fs=[],Ed={},sx,ai={},_h={},uv=30,Qc=[],xp="",Sp=function(e){var t=e[0],n,r;if(ar(t)||Jt(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(r=Qc.length;r--&&!Qc[r].targetTest(t););n=Qc[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new Cx(e[r],n)))||e.splice(r,1);return e},Zs=function(e){return e._gsap||Sp(Ci(e))[0]._gsap},ax=function(e,t,n){return(n=e[t])&&Jt(n)?e[t]():pp(n)&&e.getAttribute&&e.getAttribute(t)||n},Xn=function(e,t){return(e=e.split(",")).forEach(t)||e},$t=function(e){return Math.round(e*1e5)/1e5||0},dn=function(e){return Math.round(e*1e7)/1e7||0},Ka=function(e,t){var n=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),n==="+"?e+r:n==="-"?e-r:n==="*"?e*r:e/r},mI=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++rc;)l=l._prev;return l?(t._next=l._next,l._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=l,t.parent=t._dp=e,t},xu=function(e,t,n,r){n===void 0&&(n="_first"),r===void 0&&(r="_last");var a=t._prev,l=t._next;a?a._next=l:e[n]===t&&(e[n]=l),l?l._prev=a:e[r]===t&&(e[r]=a),t._next=t._prev=t.parent=null},_s=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Js=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},vI=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Td=function(e,t,n,r){return e._startAt&&(Tn?e._startAt.revert(Jc):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},xI=function i(e){return!e||e._ts&&i(e.parent)},hv=function(e){return e._repeat?so(e._tTime,e=e.duration()+e._rDelay)*e:0},so=function(e,t){var n=Math.floor(e/=t);return e&&n===e?n-1:n},lu=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Su=function(e){return e._end=dn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Ht)||0))},Mu=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=dn(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Su(e),n._dirty||Js(n,e)),e},fx=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._startHt)&&t.render(n,!0)),Js(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-Ht}},tr=function(e,t,n,r){return t.parent&&_s(t),t._start=dn((Or(n)?n:n||e!==Yt?bi(e,n,t):e._time)+t._delay),t._end=dn(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),ux(e,t,"_first","_last",e._sort?"_start":0),bd(t)||(e._recent=t),r||fx(e,t),e._ts<0&&Mu(e,e._tTime),e},hx=function(e,t){return(hi.ScrollTrigger||gp("scrollTrigger",t))&&hi.ScrollTrigger.create(t,e)},dx=function(e,t,n,r,a){if(yp(e,t,a),!e._initted)return 1;if(!n&&e._pt&&!Tn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&sx!==oi.frame)return fs.push(e),e._lazy=[a,r],1},SI=function i(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||i(t))},bd=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},MI=function(e,t,n,r){var a=e.ratio,l=t<0||!t&&(!e._start&&SI(e)&&!(!e._initted&&bd(e))||(e._ts<0||e._dp._ts<0)&&!bd(e))?0:1,c=e._rDelay,u=0,h,d,p;if(c&&e._repeat&&(u=xl(0,e._tDur,t),d=so(u,c),e._yoyo&&d&1&&(l=1-l),d!==so(e._tTime,c)&&(a=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==a||Tn||r||e._zTime===Ht||!t&&e._zTime){if(!e._initted&&dx(e,t,r,n,u))return;for(p=e._zTime,e._zTime=t||(n?Ht:0),n||(n=t&&!p),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=u,h=e._pt;h;)h.r(l,h.d),h=h._next;t<0&&Td(e,t,n,!0),e._onUpdate&&!n&&li(e,"onUpdate"),u&&e._repeat&&!n&&e.parent&&li(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&_s(e,1),!n&&!Tn&&(li(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},yI=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if(r.data==="isPause"&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(r.data==="isPause"&&r._start0&&!r&&Mu(e,e._tTime=e._tDur*c),e.parent&&Su(e),n||Js(e.parent,e),e},dv=function(e){return e instanceof In?Js(e):ao(e,e._dur)},EI={_start:0,endTime:rl,totalDuration:rl},bi=function i(e,t,n){var r=e.labels,a=e._recent||EI,l=e.duration()>=Ri?a.endTime(!1):e._dur,c,u,h;return pn(t)&&(isNaN(t)||t in r)?(u=t.charAt(0),h=t.substr(-1)==="%",c=t.indexOf("="),u==="<"||u===">"?(c>=0&&(t=t.replace(/=/,"")),(u==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(t.substr(1))||0)*(h?(c<0?a:n).totalDuration()/100:1)):c<0?(t in r||(r[t]=l),r[t]):(u=parseFloat(t.charAt(c-1)+t.substr(c+1)),h&&n&&(u=u/100*(bn(n)?n[0]:n).totalDuration()),c>1?i(e,t.substr(0,c-1),n)+u:l+u)):t==null?l:+t},Zo=function(e,t,n){var r=Or(t[1]),a=(r?2:1)+(e<2?0:1),l=t[a],c,u;if(r&&(l.duration=t[1]),l.parent=n,e){for(c=l,u=n;u&&!("immediateRender"in c);)c=u.vars.defaults||{},u=Wn(u.vars.inherit)&&u.parent;l.immediateRender=Wn(c.immediateRender),e<2?l.runBackwards=1:l.startAt=t[a-1]}return new nn(t[0],l,t[a+1])},Ss=function(e,t){return e||e===0?t(e):t},xl=function(e,t,n){return nt?t:n},En=function(e,t){return!pn(e)||!(t=hI.exec(e))?"":t[1]},TI=function(e,t,n){return Ss(n,function(r){return xl(e,t,r)})},Ad=[].slice,px=function(e,t){return e&&ar(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&ar(e[0]))&&!e.nodeType&&e!==$i},bI=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(r){var a;return pn(r)&&!t||px(r,1)?(a=n).push.apply(a,Ci(r)):n.push(r)})||n},Ci=function(e,t,n){return Xt&&!t&&Xt.selector?Xt.selector(e):pn(e)&&!n&&(yd||!oo())?Ad.call((t||_p).querySelectorAll(e),0):bn(e)?bI(e,n):px(e)?Ad.call(e,0):e?[e]:[]},wd=function(e){return e=Ci(e)[0]||il("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return Ci(t,n.querySelectorAll?n:n===e?il("Invalid scope")||_p.createElement("div"):e)}},mx=function(e){return e.sort(function(){return .5-Math.random()})},_x=function(e){if(Jt(e))return e;var t=ar(e)?e:{each:e},n=Qs(t.ease),r=t.from||0,a=parseFloat(t.base)||0,l={},c=r>0&&r<1,u=isNaN(r)||c,h=t.axis,d=r,p=r;return pn(r)?d=p={center:.5,edges:.5,end:1}[r]||0:!c&&u&&(d=r[0],p=r[1]),function(m,_,M){var S=(M||t).length,x=l[S],v,D,w,E,N,U,L,F,T;if(!x){if(T=t.grid==="auto"?0:(t.grid||[1,Ri])[1],!T){for(L=-Ri;L<(L=M[T++].getBoundingClientRect().left)&&TL&&(L=N),NS?S-1:h?h==="y"?S/T:T:Math.max(T,S/T))||0)*(r==="edges"?-1:1),x.b=S<0?a-S:a,x.u=En(t.amount||t.each)||0,n=n&&S<0?Ax(n):n}return S=(x[m]-x.min)/x.max||0,dn(x.b+(n?n(S):S)*x.v)+x.u}},Rd=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var r=dn(Math.round(parseFloat(n)/e)*e*t);return(r-r%1)/t+(Or(n)?0:En(n))}},gx=function(e,t){var n=bn(e),r,a;return!n&&ar(e)&&(r=n=e.radius||Ri,e.values?(e=Ci(e.values),(a=!Or(e[0]))&&(r*=r)):e=Rd(e.increment)),Ss(t,n?Jt(e)?function(l){return a=e(l),Math.abs(a-l)<=r?a:l}:function(l){for(var c=parseFloat(a?l.x:l),u=parseFloat(a?l.y:0),h=Ri,d=0,p=e.length,m,_;p--;)a?(m=e[p].x-c,_=e[p].y-u,m=m*m+_*_):m=Math.abs(e[p]-c),mr?a-l:l)})},sl=function(e){for(var t=0,n="",r,a,l,c;~(r=e.indexOf("random(",t));)l=e.indexOf(")",r),c=e.charAt(r+7)==="[",a=e.substr(r+7,l-r-7).match(c?tx:Md),n+=e.substr(t,r-t)+vx(c?a:+a[0],c?0:+a[1],+a[2]||1e-5),t=l+1;return n+e.substr(t,e.length-t)},Sx=function(e,t,n,r,a){var l=t-e,c=r-n;return Ss(a,function(u){return n+((u-e)/l*c||0)})},DI=function i(e,t,n,r){var a=isNaN(e+t)?0:function(_){return(1-_)*e+_*t};if(!a){var l=pn(e),c={},u,h,d,p,m;if(n===!0&&(r=1)&&(n=null),l)e={p:e},t={p:t};else if(bn(e)&&!bn(t)){for(d=[],p=e.length,m=p-2,h=1;h(c=Math.abs(c))&&(u=l,a=c);return u},li=function(e,t,n){var r=e.vars,a=r[t],l=Xt,c=e._ctx,u,h,d;if(a)return u=r[t+"Params"],h=r.callbackScope||e,n&&fs.length&&au(),c&&(Xt=c),d=u?a.apply(h,u):a.call(h),Xt=l,d},ko=function(e){return _s(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Tn),e.progress()<1&&li(e,"onInterrupt"),e},Va,Mx=[],yx=function(e){if(e)if(e=!e.name&&e.default||e,mp()||e.headless){var t=e.name,n=Jt(e),r=t&&!n&&e.init?function(){this._props=[]}:e,a={init:rl,render:bp,add:Mp,kill:YI,modifier:qI,rawVars:0},l={targetTest:0,get:0,getSetter:Tp,aliases:{},register:0};if(oo(),e!==r){if(ai[t])return;Pi(r,Pi(ou(e,a),l)),ta(r.prototype,ta(a,ou(e,l))),ai[r.prop=t]=r,e.targetTest&&(Qc.push(r),vp[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}rx(t,r),e.register&&e.register(Kn,r,qn)}else Mx.push(e)},Nt=255,Vo={aqua:[0,Nt,Nt],lime:[0,Nt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Nt],navy:[0,0,128],white:[Nt,Nt,Nt],olive:[128,128,0],yellow:[Nt,Nt,0],orange:[Nt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Nt,0,0],pink:[Nt,192,203],cyan:[0,Nt,Nt],transparent:[Nt,Nt,Nt,0]},gh=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*Nt+.5|0},Ex=function(e,t,n){var r=e?Or(e)?[e>>16,e>>8&Nt,e&Nt]:0:Vo.black,a,l,c,u,h,d,p,m,_,M;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Vo[e])r=Vo[e];else if(e.charAt(0)==="#"){if(e.length<6&&(a=e.charAt(1),l=e.charAt(2),c=e.charAt(3),e="#"+a+a+l+l+c+c+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&Nt,r&Nt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&Nt,e&Nt]}else if(e.substr(0,3)==="hsl"){if(r=M=e.match(Md),!t)u=+r[0]%360/360,h=+r[1]/100,d=+r[2]/100,l=d<=.5?d*(h+1):d+h-d*h,a=d*2-l,r.length>3&&(r[3]*=1),r[0]=gh(u+1/3,a,l),r[1]=gh(u,a,l),r[2]=gh(u-1/3,a,l);else if(~e.indexOf("="))return r=e.match($0),n&&r.length<4&&(r[3]=1),r}else r=e.match(Md)||Vo.transparent;r=r.map(Number)}return t&&!M&&(a=r[0]/Nt,l=r[1]/Nt,c=r[2]/Nt,p=Math.max(a,l,c),m=Math.min(a,l,c),d=(p+m)/2,p===m?u=h=0:(_=p-m,h=d>.5?_/(2-p-m):_/(p+m),u=p===a?(l-c)/_+(le||v<0)&&(n+=v-t),r+=v,N=r-n,w=N-l,(w>0||D)&&(U=++p.frame,m=N-p.time*1e3,p.time=N=N/1e3,l+=w+(w>=a?4:a-w),E=1),D||(u=h(S)),E)for(_=0;_=v&&_--},_listeners:c},p}(),oo=function(){return!al&&oi.wake()},gt={},II=/^[\d.\-M][\d.\-,\s]/,UI=/["']/g,NI=function(e){for(var t={},n=e.substr(1,e.length-3).split(":"),r=n[0],a=1,l=n.length,c,u,h;a1&&n.config?n.config.apply(null,~e.indexOf("{")?[NI(t[1])]:OI(e).split(",").map(lx)):gt._CE&&II.test(e)?gt._CE("",e):n},Ax=function(e){return function(t){return 1-e(1-t)}},wx=function i(e,t){for(var n=e._first,r;n;)n instanceof In?i(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?i(n.timeline,t):(r=n._ease,n._ease=n._yEase,n._yEase=r,n._yoyo=t)),n=n._next},Qs=function(e,t){return e&&(Jt(e)?e:gt[e]||FI(e))||t},ra=function(e,t,n,r){n===void 0&&(n=function(u){return 1-t(1-u)}),r===void 0&&(r=function(u){return u<.5?t(u*2)/2:1-t((1-u)*2)/2});var a={easeIn:t,easeOut:n,easeInOut:r},l;return Xn(e,function(c){gt[c]=hi[c]=a,gt[l=c.toLowerCase()]=n;for(var u in a)gt[l+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=gt[c+"."+u]=a[u]}),a},Rx=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},vh=function i(e,t,n){var r=t>=1?t:1,a=(n||(e?.3:.45))/(t<1?t:1),l=a/Sd*(Math.asin(1/r)||0),c=function(d){return d===1?1:r*Math.pow(2,-10*d)*fI((d-l)*a)+1},u=e==="out"?c:e==="in"?function(h){return 1-c(1-h)}:Rx(c);return a=Sd/a,u.config=function(h,d){return i(e,h,d)},u},xh=function i(e,t){t===void 0&&(t=1.70158);var n=function(l){return l?--l*l*((t+1)*l+t)+1:0},r=e==="out"?n:e==="in"?function(a){return 1-n(1-a)}:Rx(n);return r.config=function(a){return i(e,a)},r};Xn("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,e){var t=e<5?e+1:e;ra(i+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})});gt.Linear.easeNone=gt.none=gt.Linear.easeIn;ra("Elastic",vh("in"),vh("out"),vh());(function(i,e){var t=1/e,n=2*t,r=2.5*t,a=function(c){return c0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},e.totalDuration=function(n){return arguments.length?(this._dirty=0,ao(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(n,r){if(oo(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(Mu(this,n),!a._dp||a.parent||fx(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n0||!this._tDur&&!n)&&tr(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===Ht||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),ox(this,n,r)),this},e.time=function(n,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+hv(this))%(this._dur+this._rDelay)||(n?this._dur:0),r):this._time},e.totalProgress=function(n,r){return arguments.length?this.totalTime(this.totalDuration()*n,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(n,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+hv(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(n,r){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*a,r):this._repeat?so(this._tTime,a)+1:1},e.timeScale=function(n,r){if(!arguments.length)return this._rts===-Ht?0:this._rts;if(this._rts===n)return this;var a=this.parent&&this._ts?lu(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-Ht?0:this._rts,this.totalTime(xl(-Math.abs(this._delay),this._tDur,a),r!==!1),Su(this),vI(this)},e.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(oo(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ht&&(this._tTime-=Ht)))),this):this._ps},e.startTime=function(n){if(arguments.length){this._start=n;var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&tr(r,this,n-this._delay),this}return this._start},e.endTime=function(n){return this._start+(Wn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(n){var r=this.parent||this._dp;return r?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?lu(r.rawTime(n),this):this._tTime:this._tTime},e.revert=function(n){n===void 0&&(n=pI);var r=Tn;return Tn=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),Tn=r,this},e.globalTime=function(n){for(var r=this,a=arguments.length?n:r.rawTime();r;)a=r._start+a/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(n):a},e.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,dv(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(n){if(arguments.length){var r=this._time;return this._rDelay=n,dv(this),r?this.time(r):this}return this._rDelay},e.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},e.seek=function(n,r){return this.totalTime(bi(this,n),Wn(r))},e.restart=function(n,r){return this.play().totalTime(n?-this._delay:0,Wn(r))},e.play=function(n,r){return n!=null&&this.seek(n,r),this.reversed(!1).paused(!1)},e.reverse=function(n,r){return n!=null&&this.seek(n||this.totalDuration(),r),this.reversed(!0).paused(!1)},e.pause=function(n,r){return n!=null&&this.seek(n,r),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-Ht:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ht,this},e.isActive=function(){var n=this.parent||this._dp,r=this._start,a;return!!(!n||this._ts&&this._initted&&n.isActive()&&(a=n.rawTime(!0))>=r&&a1?(r?(l[n]=r,a&&(l[n+"Params"]=a),n==="onUpdate"&&(this._onUpdate=r)):delete l[n],this):l[n]},e.then=function(n){var r=this;return new Promise(function(a){var l=Jt(n)?n:cx,c=function(){var h=r.then;r.then=null,Jt(l)&&(l=l(r))&&(l.then||l===r)&&(r.then=h),a(l),r.then=h};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?c():r._prom=c})},e.kill=function(){ko(this)},i}();Pi(ol.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ht,_prom:0,_ps:!1,_rts:1});var In=function(i){J0(e,i);function e(n,r){var a;return n===void 0&&(n={}),a=i.call(this,n)||this,a.labels={},a.smoothChildTiming=!!n.smoothChildTiming,a.autoRemoveChildren=!!n.autoRemoveChildren,a._sort=Wn(n.sortChildren),Yt&&tr(n.parent||Yt,br(a),r),n.reversed&&a.reverse(),n.paused&&a.paused(!0),n.scrollTrigger&&hx(br(a),n.scrollTrigger),a}var t=e.prototype;return t.to=function(r,a,l){return Zo(0,arguments,this),this},t.from=function(r,a,l){return Zo(1,arguments,this),this},t.fromTo=function(r,a,l,c){return Zo(2,arguments,this),this},t.set=function(r,a,l){return a.duration=0,a.parent=this,Ko(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new nn(r,a,bi(this,l),1),this},t.call=function(r,a,l){return tr(this,nn.delayedCall(0,r,a),l)},t.staggerTo=function(r,a,l,c,u,h,d){return l.duration=a,l.stagger=l.stagger||c,l.onComplete=h,l.onCompleteParams=d,l.parent=this,new nn(r,l,bi(this,u)),this},t.staggerFrom=function(r,a,l,c,u,h,d){return l.runBackwards=1,Ko(l).immediateRender=Wn(l.immediateRender),this.staggerTo(r,a,l,c,u,h,d)},t.staggerFromTo=function(r,a,l,c,u,h,d,p){return c.startAt=l,Ko(c).immediateRender=Wn(c.immediateRender),this.staggerTo(r,a,c,u,h,d,p)},t.render=function(r,a,l){var c=this._time,u=this._dirty?this.totalDuration():this._tDur,h=this._dur,d=r<=0?0:dn(r),p=this._zTime<0!=r<0&&(this._initted||!h),m,_,M,S,x,v,D,w,E,N,U,L;if(this!==Yt&&d>u&&r>=0&&(d=u),d!==this._tTime||l||p){if(c!==this._time&&h&&(d+=this._time-c,r+=this._time-c),m=d,E=this._start,w=this._ts,v=!w,p&&(h||(c=this._zTime),(r||!a)&&(this._zTime=r)),this._repeat){if(U=this._yoyo,x=h+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(x*100+r,a,l);if(m=dn(d%x),d===u?(S=this._repeat,m=h):(S=~~(d/x),S&&S===d/x&&(m=h,S--),m>h&&(m=h)),N=so(this._tTime,x),!c&&this._tTime&&N!==S&&this._tTime-N*x-this._dur<=0&&(N=S),U&&S&1&&(m=h-m,L=1),S!==N&&!this._lock){var F=U&&N&1,T=F===(U&&S&1);if(S=c&&r>=0)for(_=this._first;_;){if(M=_._next,(_._act||m>=_._start)&&_._ts&&D!==_){if(_.parent!==this)return this.render(r,a,l);if(_.render(_._ts>0?(m-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(m-_._start)*_._ts,a,l),m!==this._time||!this._ts&&!v){D=0,M&&(d+=this._zTime=-Ht);break}}_=M}else{_=this._last;for(var R=r<0?r:m;_;){if(M=_._prev,(_._act||R<=_._end)&&_._ts&&D!==_){if(_.parent!==this)return this.render(r,a,l);if(_.render(_._ts>0?(R-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(R-_._start)*_._ts,a,l||Tn&&(_._initted||_._startAt)),m!==this._time||!this._ts&&!v){D=0,M&&(d+=this._zTime=R?-Ht:Ht);break}}_=M}}if(D&&!a&&(this.pause(),D.render(m>=c?0:-Ht)._zTime=m>=c?1:-1,this._ts))return this._start=E,Su(this),this.render(r,a,l);this._onUpdate&&!a&&li(this,"onUpdate",!0),(d===u&&this._tTime>=this.totalDuration()||!d&&c)&&(E===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((r||!h)&&(d===u&&this._ts>0||!d&&this._ts<0)&&_s(this,1),!a&&!(r<0&&!c)&&(d||c||!u)&&(li(this,d===u&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(d0)&&this._prom())))}return this},t.add=function(r,a){var l=this;if(Or(a)||(a=bi(this,a,r)),!(r instanceof ol)){if(bn(r))return r.forEach(function(c){return l.add(c,a)}),this;if(pn(r))return this.addLabel(r,a);if(Jt(r))r=nn.delayedCall(0,r);else return this}return this!==r?tr(this,r,a):this},t.getChildren=function(r,a,l,c){r===void 0&&(r=!0),a===void 0&&(a=!0),l===void 0&&(l=!0),c===void 0&&(c=-Ri);for(var u=[],h=this._first;h;)h._start>=c&&(h instanceof nn?a&&u.push(h):(l&&u.push(h),r&&u.push.apply(u,h.getChildren(!0,a,l)))),h=h._next;return u},t.getById=function(r){for(var a=this.getChildren(1,1,1),l=a.length;l--;)if(a[l].vars.id===r)return a[l]},t.remove=function(r){return pn(r)?this.removeLabel(r):Jt(r)?this.killTweensOf(r):(xu(this,r),r===this._recent&&(this._recent=this._last),Js(this))},t.totalTime=function(r,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=dn(oi.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),i.prototype.totalTime.call(this,r,a),this._forcing=0,this):this._tTime},t.addLabel=function(r,a){return this.labels[r]=bi(this,a),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,a,l){var c=nn.delayedCall(0,a||rl,l);return c.data="isPause",this._hasPause=1,tr(this,c,bi(this,r))},t.removePause=function(r){var a=this._first;for(r=bi(this,r);a;)a._start===r&&a.data==="isPause"&&_s(a),a=a._next},t.killTweensOf=function(r,a,l){for(var c=this.getTweensOf(r,l),u=c.length;u--;)ss!==c[u]&&c[u].kill(r,a);return this},t.getTweensOf=function(r,a){for(var l=[],c=Ci(r),u=this._first,h=Or(a),d;u;)u instanceof nn?mI(u._targets,c)&&(h?(!ss||u._initted&&u._ts)&&u.globalTime(0)<=a&&u.globalTime(u.totalDuration())>a:!a||u.isActive())&&l.push(u):(d=u.getTweensOf(c,a)).length&&l.push.apply(l,d),u=u._next;return l},t.tweenTo=function(r,a){a=a||{};var l=this,c=bi(l,r),u=a,h=u.startAt,d=u.onStart,p=u.onStartParams,m=u.immediateRender,_,M=nn.to(l,Pi({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:c,overwrite:"auto",duration:a.duration||Math.abs((c-(h&&"time"in h?h.time:l._time))/l.timeScale())||Ht,onStart:function(){if(l.pause(),!_){var x=a.duration||Math.abs((c-(h&&"time"in h?h.time:l._time))/l.timeScale());M._dur!==x&&ao(M,x,0,1).render(M._time,!0,!0),_=1}d&&d.apply(M,p||[])}},a));return m?M.render(0):M},t.tweenFromTo=function(r,a,l){return this.tweenTo(a,Pi({startAt:{time:bi(this,r)}},l))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),pv(this,bi(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),pv(this,bi(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+Ht)},t.shiftChildren=function(r,a,l){l===void 0&&(l=0);for(var c=this._first,u=this.labels,h;c;)c._start>=l&&(c._start+=r,c._end+=r),c=c._next;if(a)for(h in u)u[h]>=l&&(u[h]+=r);return Js(this)},t.invalidate=function(r){var a=this._first;for(this._lock=0;a;)a.invalidate(r),a=a._next;return i.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var a=this._first,l;a;)l=a._next,this.remove(a),a=l;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),Js(this)},t.totalDuration=function(r){var a=0,l=this,c=l._last,u=Ri,h,d,p;if(arguments.length)return l.timeScale((l._repeat<0?l.duration():l.totalDuration())/(l.reversed()?-r:r));if(l._dirty){for(p=l.parent;c;)h=c._prev,c._dirty&&c.totalDuration(),d=c._start,d>u&&l._sort&&c._ts&&!l._lock?(l._lock=1,tr(l,c,d-c._delay,1)._lock=0):u=d,d<0&&c._ts&&(a-=d,(!p&&!l._dp||p&&p.smoothChildTiming)&&(l._start+=d/l._ts,l._time-=d,l._tTime-=d),l.shiftChildren(-d,!1,-1/0),u=0),c._end>a&&c._ts&&(a=c._end),c=h;ao(l,l===Yt&&l._time>a?l._time:a,1,1),l._dirty=0}return l._tDur},e.updateRoot=function(r){if(Yt._ts&&(ox(Yt,lu(r,Yt)),sx=oi.frame),oi.frame>=uv){uv+=fi.autoSleep||120;var a=Yt._first;if((!a||!a._ts)&&fi.autoSleep&&oi._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||oi.sleep()}}},e}(ol);Pi(In.prototype,{_lock:0,_hasPause:0,_forcing:0});var BI=function(e,t,n,r,a,l,c){var u=new qn(this._pt,e,t,0,1,Nx,null,a),h=0,d=0,p,m,_,M,S,x,v,D;for(u.b=n,u.e=r,n+="",r+="",(v=~r.indexOf("random("))&&(r=sl(r)),l&&(D=[n,r],l(D,e,t),n=D[0],r=D[1]),m=n.match(mh)||[];p=mh.exec(r);)M=p[0],S=r.substring(h,p.index),_?_=(_+1)%5:S.substr(-5)==="rgba("&&(_=1),M!==m[d++]&&(x=parseFloat(m[d-1])||0,u._pt={_next:u._pt,p:S||d===1?S:",",s:x,c:M.charAt(1)==="="?Ka(x,M)-x:parseFloat(M)-x,m:_&&_<4?Math.round:0},h=mh.lastIndex);return u.c=h")}),E.duration();else{U={};for(F in M)F==="ease"||F==="easeEach"||kI(F,M[F],U,M.easeEach);for(F in U)for(q=U[F].sort(function(ee,re){return ee.t-re.t}),j=0,N=0;Nu-Ht&&!d?u:rh&&(m=h)),v=this._yoyo&&M&1,v&&(E=this._yEase,m=h-m),x=so(this._tTime,S),m===c&&!l&&this._initted&&M===x)return this._tTime=p,this;M!==x&&(w&&this._yEase&&wx(w,v),this.vars.repeatRefresh&&!v&&!this._lock&&this._time!==S&&this._initted&&(this._lock=l=1,this.render(dn(S*M),!0).invalidate()._lock=0))}if(!this._initted){if(dx(this,d?r:m,l,a,p))return this._tTime=0,this;if(c!==this._time&&!(l&&this.vars.repeatRefresh&&M!==x))return this;if(h!==this._dur)return this.render(r,a,l)}if(this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=D=(E||this._ease)(m/h),this._from&&(this.ratio=D=1-D),m&&!c&&!a&&!M&&(li(this,"onStart"),this._tTime!==p))return this;for(_=this._pt;_;)_.r(D,_.d),_=_._next;w&&w.render(r<0?r:w._dur*w._ease(m/this._dur),a,l)||this._startAt&&(this._zTime=r),this._onUpdate&&!a&&(d&&Td(this,r,a,l),li(this,"onUpdate")),this._repeat&&M!==x&&this.vars.onRepeat&&!a&&this.parent&&li(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(d&&!this._onUpdate&&Td(this,r,!0,!0),(r||!h)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&_s(this,1),!a&&!(d&&!c)&&(p||c||v)&&(li(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),i.prototype.invalidate.call(this,r)},t.resetTo=function(r,a,l,c,u){al||oi.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),d;return this._initted||yp(this,h),d=this._ease(h/this._dur),HI(this,r,a,l,c,d,h,u)?this.resetTo(r,a,l,c,1):(Mu(this,0),this.parent||ux(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,a){if(a===void 0&&(a="all"),!r&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?ko(this):this;if(this.timeline){var l=this.timeline.totalDuration();return this.timeline.killTweensOf(r,a,ss&&ss.vars.overwrite!==!0)._first||ko(this),this.parent&&l!==this.timeline.totalDuration()&&ao(this,this._dur*this.timeline._tDur/l,0,1),this}var c=this._targets,u=r?Ci(r):c,h=this._ptLookup,d=this._pt,p,m,_,M,S,x,v;if((!a||a==="all")&&gI(c,u))return a==="all"&&(this._pt=0),ko(this);for(p=this._op=this._op||[],a!=="all"&&(pn(a)&&(S={},Xn(a,function(D){return S[D]=1}),a=S),a=GI(c,a)),v=c.length;v--;)if(~u.indexOf(c[v])){m=h[v],a==="all"?(p[v]=a,M=m,_={}):(_=p[v]=p[v]||{},M=a);for(S in M)x=m&&m[S],x&&((!("kill"in x.d)||x.d.kill(S)===!0)&&xu(this,x,"_pt"),delete m[S]),_!=="all"&&(_[S]=1)}return this._initted&&!this._pt&&d&&ko(this),this},e.to=function(r,a){return new e(r,a,arguments[2])},e.from=function(r,a){return Zo(1,arguments)},e.delayedCall=function(r,a,l,c){return new e(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:a,onReverseComplete:a,onCompleteParams:l,onReverseCompleteParams:l,callbackScope:c})},e.fromTo=function(r,a,l){return Zo(2,arguments)},e.set=function(r,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new e(r,a)},e.killTweensOf=function(r,a,l){return Yt.killTweensOf(r,a,l)},e}(ol);Pi(nn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Xn("staggerTo,staggerFrom,staggerFromTo",function(i){nn[i]=function(){var e=new In,t=Ad.call(arguments,0);return t.splice(i==="staggerFromTo"?5:4,0,0),e[i].apply(e,t)}});var Ep=function(e,t,n){return e[t]=n},Ix=function(e,t,n){return e[t](n)},VI=function(e,t,n,r){return e[t](r.fp,n)},WI=function(e,t,n){return e.setAttribute(t,n)},Tp=function(e,t){return Jt(e[t])?Ix:pp(e[t])&&e.setAttribute?WI:Ep},Ux=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},XI=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Nx=function(e,t){var n=t._pt,r="";if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},bp=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},qI=function(e,t,n,r){for(var a=this._pt,l;a;)l=a._next,a.p===r&&a.modifier(e,t,n),a=l},YI=function(e){for(var t=this._pt,n,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?xu(this,t,"_pt"):t.dep||(n=1),t=r;return!n},KI=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},Ox=function(e){for(var t=e._pt,n,r,a,l;t;){for(n=t._next,r=a;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:l)?t._prev._next=t:a=t,(t._next=r)?r._prev=t:l=t,t=n}e._pt=a},qn=function(){function i(t,n,r,a,l,c,u,h,d){this.t=n,this.s=a,this.c=l,this.p=r,this.r=c||Ux,this.d=u||this,this.set=h||Ep,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=i.prototype;return e.modifier=function(n,r,a){this.mSet=this.mSet||this.set,this.set=KI,this.m=n,this.mt=a,this.tween=r},i}();Xn(xp+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(i){return vp[i]=1});hi.TweenMax=hi.TweenLite=nn;hi.TimelineLite=hi.TimelineMax=In;Yt=new In({sortChildren:!1,defaults:ro,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});fi.stringFilter=bx;var js=[],jc={},ZI=[],_v=0,JI=0,Sh=function(e){return(jc[e]||ZI).map(function(t){return t()})},Pd=function(){var e=Date.now(),t=[];e-_v>2&&(Sh("matchMediaInit"),js.forEach(function(n){var r=n.queries,a=n.conditions,l,c,u,h;for(c in r)l=$i.matchMedia(r[c]).matches,l&&(u=1),l!==a[c]&&(a[c]=l,h=1);h&&(n.revert(),u&&t.push(n))}),Sh("matchMediaRevert"),t.forEach(function(n){return n.onMatch(n,function(r){return n.add(null,r)})}),_v=e,Sh("matchMedia"))},Fx=function(){function i(t,n){this.selector=n&&wd(n),this.data=[],this._r=[],this.isReverted=!1,this.id=JI++,t&&this.add(t)}var e=i.prototype;return e.add=function(n,r,a){Jt(n)&&(a=r,r=n,n=Jt);var l=this,c=function(){var h=Xt,d=l.selector,p;return h&&h!==l&&h.data.push(l),a&&(l.selector=wd(a)),Xt=l,p=r.apply(l,arguments),Jt(p)&&l._r.push(p),Xt=h,l.selector=d,l.isReverted=!1,p};return l.last=c,n===Jt?c(l,function(u){return l.add(null,u)}):n?l[n]=c:c},e.ignore=function(n){var r=Xt;Xt=null,n(this),Xt=r},e.getTweens=function(){var n=[];return this.data.forEach(function(r){return r instanceof i?n.push.apply(n,r.getTweens()):r instanceof nn&&!(r.parent&&r.parent.data==="nested")&&n.push(r)}),n},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(n,r){var a=this;if(n?function(){for(var c=a.getTweens(),u=a.data.length,h;u--;)h=a.data[u],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(d){return c.splice(c.indexOf(d),1)}));for(c.map(function(d){return{g:d._dur||d._delay||d._sat&&!d._sat.vars.immediateRender?d.globalTime(0):-1/0,t:d}}).sort(function(d,p){return p.g-d.g||-1/0}).forEach(function(d){return d.t.revert(n)}),u=a.data.length;u--;)h=a.data[u],h instanceof In?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof nn)&&h.revert&&h.revert(n);a._r.forEach(function(d){return d(n,a)}),a.isReverted=!0}():this.data.forEach(function(c){return c.kill&&c.kill()}),this.clear(),r)for(var l=js.length;l--;)js[l].id===this.id&&js.splice(l,1)},e.revert=function(n){this.kill(n||{})},i}(),QI=function(){function i(t){this.contexts=[],this.scope=t,Xt&&Xt.data.push(this)}var e=i.prototype;return e.add=function(n,r,a){ar(n)||(n={matches:n});var l=new Fx(0,a||this.scope),c=l.conditions={},u,h,d;Xt&&!l.selector&&(l.selector=Xt.selector),this.contexts.push(l),r=l.add("onMatch",r),l.queries=n;for(h in n)h==="all"?d=1:(u=$i.matchMedia(n[h]),u&&(js.indexOf(l)<0&&js.push(l),(c[h]=u.matches)&&(d=1),u.addListener?u.addListener(Pd):u.addEventListener("change",Pd)));return d&&r(l,function(p){return l.add(null,p)}),this},e.revert=function(n){this.kill(n||{})},e.kill=function(n){this.contexts.forEach(function(r){return r.kill(n,!0)})},i}(),cu={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){var r=e.map(function(d){return Kn.quickSetter(d,t,n)}),a=r.length;return function(d){for(var p=a;p--;)r[p](d)}}e=e[0]||{};var l=ai[t],c=Zs(e),u=c.harness&&(c.harness.aliases||{})[t]||t,h=l?function(d){var p=new l;Va._pt=0,p.init(e,n?d+n:d,Va,0,[e]),p.render(1,p),Va._pt&&bp(1,Va)}:c.set(e,u);return l?h:function(d){return h(e,u,n?d+n:d,c,1)}},quickTo:function(e,t,n){var r,a=Kn.to(e,ta((r={},r[t]="+=0.1",r.paused=!0,r),n||{})),l=function(u,h,d){return a.resetTo(t,u,h,d)};return l.tween=a,l},isTweening:function(e){return Yt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Qs(e.ease,ro.ease)),fv(ro,e||{})},config:function(e){return fv(fi,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,a=e.defaults,l=e.extendTimeline;(r||"").split(",").forEach(function(c){return c&&!ai[c]&&!hi[c]&&il(t+" effect requires "+c+" plugin.")}),_h[t]=function(c,u,h){return n(Ci(c),Pi(u||{},a),h)},l&&(In.prototype[t]=function(c,u,h){return this.add(_h[t](c,ar(u)?u:(h=u)&&{},this),h)})},registerEase:function(e,t){gt[e]=Qs(t)},parseEase:function(e,t){return arguments.length?Qs(e,t):gt},getById:function(e){return Yt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new In(e),r,a;for(n.smoothChildTiming=Wn(e.smoothChildTiming),Yt.remove(n),n._dp=0,n._time=n._tTime=Yt._time,r=Yt._first;r;)a=r._next,(t||!(!r._dur&&r instanceof nn&&r.vars.onComplete===r._targets[0]))&&tr(n,r,r._start-r._delay),r=a;return tr(Yt,n,0),n},context:function(e,t){return e?new Fx(e,t):Xt},matchMedia:function(e){return new QI(e)},matchMediaRefresh:function(){return js.forEach(function(e){var t=e.conditions,n,r;for(r in t)t[r]&&(t[r]=!1,n=1);n&&e.revert()})||Pd()},addEventListener:function(e,t){var n=jc[e]||(jc[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=jc[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},utils:{wrap:CI,wrapYoyo:PI,distribute:_x,random:vx,snap:gx,normalize:RI,getUnit:En,clamp:TI,splitColor:Ex,toArray:Ci,selector:wd,mapRange:Sx,pipe:AI,unitize:wI,interpolate:DI,shuffle:mx},install:ix,effects:_h,ticker:oi,updateRoot:In.updateRoot,plugins:ai,globalTimeline:Yt,core:{PropTween:qn,globals:rx,Tween:nn,Timeline:In,Animation:ol,getCache:Zs,_removeLinkedListItem:xu,reverting:function(){return Tn},context:function(e){return e&&Xt&&(Xt.data.push(e),e._ctx=Xt),Xt},suppressOverwrites:function(e){return dp=e}}};Xn("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return cu[i]=nn[i]});oi.add(In.updateRoot);Va=cu.to({},{duration:0});var jI=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},$I=function(e,t){var n=e._targets,r,a,l;for(r in t)for(a=n.length;a--;)l=e._ptLookup[a][r],l&&(l=l.d)&&(l._pt&&(l=jI(l,r)),l&&l.modifier&&l.modifier(t[r],e,n[a],r))},Mh=function(e,t){return{name:e,rawVars:1,init:function(r,a,l){l._onInit=function(c){var u,h;if(pn(a)&&(u={},Xn(a,function(d){return u[d]=1}),a=u),t){u={};for(h in a)u[h]=t(a[h]);a=u}$I(c,a)}}}},Kn=cu.registerPlugin({name:"attr",init:function(e,t,n,r,a){var l,c,u;this.tween=n;for(l in t)u=e.getAttribute(l)||"",c=this.add(e,"setAttribute",(u||0)+"",t[l],r,a,0,0,l),c.op=l,c.b=u,this._props.push(l)},render:function(e,t){for(var n=t._pt;n;)Tn?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},Mh("roundProps",Rd),Mh("modifiers"),Mh("snap",gx))||cu;nn.version=In.version=Kn.version="3.12.5";nx=1;mp()&&oo();gt.Power0;gt.Power1;gt.Power2;gt.Power3;gt.Power4;gt.Linear;gt.Quad;gt.Cubic;gt.Quart;gt.Quint;gt.Strong;gt.Elastic;gt.Back;gt.SteppedEase;gt.Bounce;gt.Sine;gt.Expo;gt.Circ;/*! * CSSPlugin 3.12.5 * https://gsap.com * * Copyright 2008-2024, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com */var gv,as,Za,Ap,qs,vv,wp,eU=function(){return typeof window<"u"},Fr={},Gs=180/Math.PI,Ja=Math.PI/180,Fa=Math.atan2,xv=1e8,Rp=/([A-Z])/g,tU=/(left|right|width|margin|padding|x)/i,nU=/[\s,\(]\S/,ir={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Dd=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},iU=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},rU=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},sU=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},Bx=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},zx=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},aU=function(e,t,n){return e.style[t]=n},oU=function(e,t,n){return e.style.setProperty(t,n)},lU=function(e,t,n){return e._gsap[t]=n},cU=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},uU=function(e,t,n,r,a){var l=e._gsap;l.scaleX=l.scaleY=n,l.renderTransform(a,l)},fU=function(e,t,n,r,a){var l=e._gsap;l[t]=n,l.renderTransform(a,l)},Kt="transform",Yn=Kt+"Origin",hU=function i(e,t){var n=this,r=this.target,a=r.style,l=r._gsap;if(e in Fr&&a){if(this.tfm=this.tfm||{},e!=="transform")e=ir[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Ar(r,c)}):this.tfm[e]=l.x?l[e]:Ar(r,e),e===Yn&&(this.tfm.zOrigin=l.zOrigin);else return ir.transform.split(",").forEach(function(c){return i.call(n,c,t)});if(this.props.indexOf(Kt)>=0)return;l.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Yn,t,"")),e=Kt}(a||t)&&this.props.push(e,t,a[e])},Hx=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},dU=function(){var e=this.props,t=this.target,n=t.style,r=t._gsap,a,l;for(a=0;a=0?Sv[l]:"")+e},Id=function(){eU()&&window.document&&(gv=window,as=gv.document,Za=as.documentElement,qs=Ld("div")||{style:{}},Ld("div"),Kt=lo(Kt),Yn=Kt+"Origin",qs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",kx=!!lo("perspective"),wp=Kn.core.reverting,Ap=1)},yh=function i(e){var t=Ld("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,r=this.nextSibling,a=this.style.cssText,l;if(Za.appendChild(t),t.appendChild(this),this.style.display="block",e)try{l=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=i}catch{}else this._gsapBBox&&(l=this._gsapBBox());return n&&(r?n.insertBefore(this,r):n.appendChild(this)),Za.removeChild(t),this.style.cssText=a,l},Mv=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},Vx=function(e){var t;try{t=e.getBBox()}catch{t=yh.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===yh||(t=yh.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+Mv(e,["x","cx","x1"])||0,y:+Mv(e,["y","cy","y1"])||0,width:0,height:0}:t},Wx=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Vx(e))},na=function(e,t){if(t){var n=e.style,r;t in Fr&&t!==Yn&&(t=Kt),n.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),n.removeProperty(r==="--"?t:t.replace(Rp,"-$1").toLowerCase())):n.removeAttribute(t)}},os=function(e,t,n,r,a,l){var c=new qn(e._pt,t,n,0,1,l?zx:Bx);return e._pt=c,c.b=r,c.e=a,e._props.push(n),c},yv={deg:1,rad:1,turn:1},pU={grid:1,flex:1},gs=function i(e,t,n,r){var a=parseFloat(n)||0,l=(n+"").trim().substr((a+"").length)||"px",c=qs.style,u=tU.test(t),h=e.tagName.toLowerCase()==="svg",d=(h?"client":"offset")+(u?"Width":"Height"),p=100,m=r==="px",_=r==="%",M,S,x,v;if(r===l||!a||yv[r]||yv[l])return a;if(l!=="px"&&!m&&(a=i(e,t,n,"px")),v=e.getCTM&&Wx(e),(_||l==="%")&&(Fr[t]||~t.indexOf("adius")))return M=v?e.getBBox()[u?"width":"height"]:e[d],$t(_?a/M*p:a/100*M);if(c[u?"width":"height"]=p+(m?l:r),S=~t.indexOf("adius")||r==="em"&&e.appendChild&&!h?e:e.parentNode,v&&(S=(e.ownerSVGElement||{}).parentNode),(!S||S===as||!S.appendChild)&&(S=as.body),x=S._gsap,x&&_&&x.width&&u&&x.time===oi.time&&!x.uncache)return $t(a/x.width*p);if(_&&(t==="height"||t==="width")){var D=e.style[t];e.style[t]=p+r,M=e[d],D?e.style[t]=D:na(e,t)}else(_||l==="%")&&!pU[sr(S,"display")]&&(c.position=sr(e,"position")),S===e&&(c.position="static"),S.appendChild(qs),M=qs[d],S.removeChild(qs),c.position="absolute";return u&&_&&(x=Zs(S),x.time=oi.time,x.width=S[d]),$t(m?M*a/p:M&&a?p/M*a:0)},Ar=function(e,t,n,r){var a;return Ap||Id(),t in ir&&t!=="transform"&&(t=ir[t],~t.indexOf(",")&&(t=t.split(",")[0])),Fr[t]&&t!=="transform"?(a=cl(e,r),a=t!=="transformOrigin"?a[t]:a.svg?a.origin:fu(sr(e,Yn))+" "+a.zOrigin+"px"):(a=e.style[t],(!a||a==="auto"||r||~(a+"").indexOf("calc("))&&(a=uu[t]&&uu[t](e,t,n)||sr(e,t)||ax(e,t)||(t==="opacity"?1:0))),n&&!~(a+"").trim().indexOf(" ")?gs(e,t,a,n)+n:a},mU=function(e,t,n,r){if(!n||n==="none"){var a=lo(t,e,1),l=a&&sr(e,a,1);l&&l!==n?(t=a,n=l):t==="borderColor"&&(n=sr(e,"borderTopColor"))}var c=new qn(this._pt,e.style,t,0,1,Nx),u=0,h=0,d,p,m,_,M,S,x,v,D,w,E,N;if(c.b=n,c.e=r,n+="",r+="",r==="auto"&&(S=e.style[t],e.style[t]=r,r=sr(e,t)||r,S?e.style[t]=S:na(e,t)),d=[n,r],bx(d),n=d[0],r=d[1],m=n.match(ka)||[],N=r.match(ka)||[],N.length){for(;p=ka.exec(r);)x=p[0],D=r.substring(u,p.index),M?M=(M+1)%5:(D.substr(-5)==="rgba("||D.substr(-5)==="hsla(")&&(M=1),x!==(S=m[h++]||"")&&(_=parseFloat(S)||0,E=S.substr((_+"").length),x.charAt(1)==="="&&(x=Ka(_,x)+E),v=parseFloat(x),w=x.substr((v+"").length),u=ka.lastIndex-w.length,w||(w=w||fi.units[t]||E,u===r.length&&(r+=w,c.e+=w)),E!==w&&(_=gs(e,t,S,w)||0),c._pt={_next:c._pt,p:D||h===1?D:",",s:_,c:v-_,m:M&&M<4||t==="zIndex"?Math.round:0});c.c=u-1;)c=a[h],Fr[c]&&(u=1,c=c==="transformOrigin"?Yn:Kt),na(n,c);u&&(na(n,Kt),l&&(l.svg&&n.removeAttribute("transform"),cl(n,1),l.uncache=1,Hx(r)))}},uu={clearProps:function(e,t,n,r,a){if(a.data!=="isFromStart"){var l=e._pt=new qn(e._pt,t,n,0,0,gU);return l.u=r,l.pr=-10,l.tween=a,e._props.push(n),1}}},ll=[1,0,0,1,0,0],Xx={},qx=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Tv=function(e){var t=sr(e,Kt);return qx(t)?ll:t.substr(7).match($0).map($t)},Cp=function(e,t){var n=e._gsap||Zs(e),r=e.style,a=Tv(e),l,c,u,h;return n.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,a=[u.a,u.b,u.c,u.d,u.e,u.f],a.join(",")==="1,0,0,1,0,0"?ll:a):(a===ll&&!e.offsetParent&&e!==Za&&!n.svg&&(u=r.display,r.display="block",l=e.parentNode,(!l||!e.offsetParent)&&(h=1,c=e.nextElementSibling,Za.appendChild(e)),a=Tv(e),u?r.display=u:na(e,"display"),h&&(c?l.insertBefore(e,c):l?l.appendChild(e):Za.removeChild(e))),t&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},Ud=function(e,t,n,r,a,l){var c=e._gsap,u=a||Cp(e,!0),h=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,m=c.yOffset||0,_=u[0],M=u[1],S=u[2],x=u[3],v=u[4],D=u[5],w=t.split(" "),E=parseFloat(w[0])||0,N=parseFloat(w[1])||0,U,L,F,T;n?u!==ll&&(L=_*x-M*S)&&(F=E*(x/L)+N*(-S/L)+(S*D-x*v)/L,T=E*(-M/L)+N*(_/L)-(_*D-M*v)/L,E=F,N=T):(U=Vx(e),E=U.x+(~w[0].indexOf("%")?E/100*U.width:E),N=U.y+(~(w[1]||w[0]).indexOf("%")?N/100*U.height:N)),r||r!==!1&&c.smooth?(v=E-h,D=N-d,c.xOffset=p+(v*_+D*S)-v,c.yOffset=m+(v*M+D*x)-D):c.xOffset=c.yOffset=0,c.xOrigin=E,c.yOrigin=N,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!n,e.style[Yn]="0px 0px",l&&(os(l,c,"xOrigin",h,E),os(l,c,"yOrigin",d,N),os(l,c,"xOffset",p,c.xOffset),os(l,c,"yOffset",m,c.yOffset)),e.setAttribute("data-svg-origin",E+" "+N)},cl=function(e,t){var n=e._gsap||new Cx(e);if("x"in n&&!t&&!n.uncache)return n;var r=e.style,a=n.scaleX<0,l="px",c="deg",u=getComputedStyle(e),h=sr(e,Yn)||"0",d,p,m,_,M,S,x,v,D,w,E,N,U,L,F,T,R,B,j,q,ae,oe,ee,re,K,ve,Se,Re,Ze,St,se,me;return d=p=m=S=x=v=D=w=E=0,_=M=1,n.svg=!!(e.getCTM&&Wx(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(r[Kt]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[Kt]!=="none"?u[Kt]:"")),r.scale=r.rotate=r.translate="none"),L=Cp(e,n.svg),n.svg&&(n.uncache?(K=e.getBBox(),h=n.xOrigin-K.x+"px "+(n.yOrigin-K.y)+"px",re=""):re=!t&&e.getAttribute("data-svg-origin"),Ud(e,re||h,!!re||n.originIsAbsolute,n.smooth!==!1,L)),N=n.xOrigin||0,U=n.yOrigin||0,L!==ll&&(B=L[0],j=L[1],q=L[2],ae=L[3],d=oe=L[4],p=ee=L[5],L.length===6?(_=Math.sqrt(B*B+j*j),M=Math.sqrt(ae*ae+q*q),S=B||j?Fa(j,B)*Gs:0,D=q||ae?Fa(q,ae)*Gs+S:0,D&&(M*=Math.abs(Math.cos(D*Ja))),n.svg&&(d-=N-(N*B+U*q),p-=U-(N*j+U*ae))):(me=L[6],St=L[7],Se=L[8],Re=L[9],Ze=L[10],se=L[11],d=L[12],p=L[13],m=L[14],F=Fa(me,Ze),x=F*Gs,F&&(T=Math.cos(-F),R=Math.sin(-F),re=oe*T+Se*R,K=ee*T+Re*R,ve=me*T+Ze*R,Se=oe*-R+Se*T,Re=ee*-R+Re*T,Ze=me*-R+Ze*T,se=St*-R+se*T,oe=re,ee=K,me=ve),F=Fa(-q,Ze),v=F*Gs,F&&(T=Math.cos(-F),R=Math.sin(-F),re=B*T-Se*R,K=j*T-Re*R,ve=q*T-Ze*R,se=ae*R+se*T,B=re,j=K,q=ve),F=Fa(j,B),S=F*Gs,F&&(T=Math.cos(F),R=Math.sin(F),re=B*T+j*R,K=oe*T+ee*R,j=j*T-B*R,ee=ee*T-oe*R,B=re,oe=K),x&&Math.abs(x)+Math.abs(S)>359.9&&(x=S=0,v=180-v),_=$t(Math.sqrt(B*B+j*j+q*q)),M=$t(Math.sqrt(ee*ee+me*me)),F=Fa(oe,ee),D=Math.abs(F)>2e-4?F*Gs:0,E=se?1/(se<0?-se:se):0),n.svg&&(re=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!qx(sr(e,Kt)),re&&e.setAttribute("transform",re))),Math.abs(D)>90&&Math.abs(D)<270&&(a?(_*=-1,D+=S<=0?180:-180,S+=S<=0?180:-180):(M*=-1,D+=D<=0?180:-180)),t=t||n.uncache,n.x=d-((n.xPercent=d&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-d)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+l,n.y=p-((n.yPercent=p&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+l,n.z=m+l,n.scaleX=$t(_),n.scaleY=$t(M),n.rotation=$t(S)+c,n.rotationX=$t(x)+c,n.rotationY=$t(v)+c,n.skewX=D+c,n.skewY=w+c,n.transformPerspective=E+l,(n.zOrigin=parseFloat(h.split(" ")[2])||!t&&n.zOrigin||0)&&(r[Yn]=fu(h)),n.xOffset=n.yOffset=0,n.force3D=fi.force3D,n.renderTransform=n.svg?xU:kx?Yx:vU,n.uncache=0,n},fu=function(e){return(e=e.split(" "))[0]+" "+e[1]},Eh=function(e,t,n){var r=En(t);return $t(parseFloat(t)+parseFloat(gs(e,"x",n+"px",r)))+r},vU=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Yx(e,t)},Os="0deg",zo="0px",Fs=") ",Yx=function(e,t){var n=t||this,r=n.xPercent,a=n.yPercent,l=n.x,c=n.y,u=n.z,h=n.rotation,d=n.rotationY,p=n.rotationX,m=n.skewX,_=n.skewY,M=n.scaleX,S=n.scaleY,x=n.transformPerspective,v=n.force3D,D=n.target,w=n.zOrigin,E="",N=v==="auto"&&e&&e!==1||v===!0;if(w&&(p!==Os||d!==Os)){var U=parseFloat(d)*Ja,L=Math.sin(U),F=Math.cos(U),T;U=parseFloat(p)*Ja,T=Math.cos(U),l=Eh(D,l,L*T*-w),c=Eh(D,c,-Math.sin(U)*-w),u=Eh(D,u,F*T*-w+w)}x!==zo&&(E+="perspective("+x+Fs),(r||a)&&(E+="translate("+r+"%, "+a+"%) "),(N||l!==zo||c!==zo||u!==zo)&&(E+=u!==zo||N?"translate3d("+l+", "+c+", "+u+") ":"translate("+l+", "+c+Fs),h!==Os&&(E+="rotate("+h+Fs),d!==Os&&(E+="rotateY("+d+Fs),p!==Os&&(E+="rotateX("+p+Fs),(m!==Os||_!==Os)&&(E+="skew("+m+", "+_+Fs),(M!==1||S!==1)&&(E+="scale("+M+", "+S+Fs),D.style[Kt]=E||"translate(0, 0)"},xU=function(e,t){var n=t||this,r=n.xPercent,a=n.yPercent,l=n.x,c=n.y,u=n.rotation,h=n.skewX,d=n.skewY,p=n.scaleX,m=n.scaleY,_=n.target,M=n.xOrigin,S=n.yOrigin,x=n.xOffset,v=n.yOffset,D=n.forceCSS,w=parseFloat(l),E=parseFloat(c),N,U,L,F,T;u=parseFloat(u),h=parseFloat(h),d=parseFloat(d),d&&(d=parseFloat(d),h+=d,u+=d),u||h?(u*=Ja,h*=Ja,N=Math.cos(u)*p,U=Math.sin(u)*p,L=Math.sin(u-h)*-m,F=Math.cos(u-h)*m,h&&(d*=Ja,T=Math.tan(h-d),T=Math.sqrt(1+T*T),L*=T,F*=T,d&&(T=Math.tan(d),T=Math.sqrt(1+T*T),N*=T,U*=T)),N=$t(N),U=$t(U),L=$t(L),F=$t(F)):(N=p,F=m,U=L=0),(w&&!~(l+"").indexOf("px")||E&&!~(c+"").indexOf("px"))&&(w=gs(_,"x",l,"px"),E=gs(_,"y",c,"px")),(M||S||x||v)&&(w=$t(w+M-(M*N+S*L)+x),E=$t(E+S-(M*U+S*F)+v)),(r||a)&&(T=_.getBBox(),w=$t(w+r/100*T.width),E=$t(E+a/100*T.height)),T="matrix("+N+","+U+","+L+","+F+","+w+","+E+")",_.setAttribute("transform",T),D&&(_.style[Kt]=T)},SU=function(e,t,n,r,a){var l=360,c=pn(a),u=parseFloat(a)*(c&&~a.indexOf("rad")?Gs:1),h=u-r,d=r+h+"deg",p,m;return c&&(p=a.split("_")[1],p==="short"&&(h%=l,h!==h%(l/2)&&(h+=h<0?l:-l)),p==="cw"&&h<0?h=(h+l*xv)%l-~~(h/l)*l:p==="ccw"&&h>0&&(h=(h-l*xv)%l-~~(h/l)*l)),e._pt=m=new qn(e._pt,t,n,r,h,iU),m.e=d,m.u="deg",e._props.push(n),m},bv=function(e,t){for(var n in t)e[n]=t[n];return e},MU=function(e,t,n){var r=bv({},n._gsap),a="perspective,force3D,transformOrigin,svgOrigin",l=n.style,c,u,h,d,p,m,_,M;r.svg?(h=n.getAttribute("transform"),n.setAttribute("transform",""),l[Kt]=t,c=cl(n,1),na(n,Kt),n.setAttribute("transform",h)):(h=getComputedStyle(n)[Kt],l[Kt]=t,c=cl(n,1),l[Kt]=h);for(u in Fr)h=r[u],d=c[u],h!==d&&a.indexOf(u)<0&&(_=En(h),M=En(d),p=_!==M?gs(n,u,h,M):parseFloat(h),m=parseFloat(d),e._pt=new qn(e._pt,c,u,p,m-p,Dd),e._pt.u=M||0,e._props.push(u));bv(c,r)};Xn("padding,margin,Width,Radius",function(i,e){var t="Top",n="Right",r="Bottom",a="Left",l=(e<3?[t,n,r,a]:[t+a,t+n,r+n,r+a]).map(function(c){return e<2?i+c:"border"+c+i});uu[e>1?"border"+i:i]=function(c,u,h,d,p){var m,_;if(arguments.length<4)return m=l.map(function(M){return Ar(c,M,h)}),_=m.join(" "),_.split(m[0]).length===5?m[0]:_;m=(d+"").split(" "),_={},l.forEach(function(M,S){return _[M]=m[S]=m[S]||m[(S-1)/2|0]}),c.init(u,_,p)}});var Kx={name:"css",register:Id,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,a){var l=this._props,c=e.style,u=n.vars.startAt,h,d,p,m,_,M,S,x,v,D,w,E,N,U,L,F;Ap||Id(),this.styles=this.styles||Gx(e),F=this.styles.props,this.tween=n;for(S in t)if(S!=="autoRound"&&(d=t[S],!(ai[S]&&Px(S,t,n,r,e,a)))){if(_=typeof d,M=uu[S],_==="function"&&(d=d.call(n,r,e,a),_=typeof d),_==="string"&&~d.indexOf("random(")&&(d=sl(d)),M)M(this,e,S,d,n)&&(L=1);else if(S.substr(0,2)==="--")h=(getComputedStyle(e).getPropertyValue(S)+"").trim(),d+="",hs.lastIndex=0,hs.test(h)||(x=En(h),v=En(d)),v?x!==v&&(h=gs(e,S,h,v)+v):x&&(d+=x),this.add(c,"setProperty",h,d,r,a,0,0,S),l.push(S),F.push(S,0,c[S]);else if(_!=="undefined"){if(u&&S in u?(h=typeof u[S]=="function"?u[S].call(n,r,e,a):u[S],pn(h)&&~h.indexOf("random(")&&(h=sl(h)),En(h+"")||h==="auto"||(h+=fi.units[S]||En(Ar(e,S))||""),(h+"").charAt(1)==="="&&(h=Ar(e,S))):h=Ar(e,S),m=parseFloat(h),D=_==="string"&&d.charAt(1)==="="&&d.substr(0,2),D&&(d=d.substr(2)),p=parseFloat(d),S in ir&&(S==="autoAlpha"&&(m===1&&Ar(e,"visibility")==="hidden"&&p&&(m=0),F.push("visibility",0,c.visibility),os(this,c,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),S!=="scale"&&S!=="transform"&&(S=ir[S],~S.indexOf(",")&&(S=S.split(",")[0]))),w=S in Fr,w){if(this.styles.save(S),E||(N=e._gsap,N.renderTransform&&!t.parseTransform||cl(e,t.parseTransform),U=t.smoothOrigin!==!1&&N.smooth,E=this._pt=new qn(this._pt,c,Kt,0,1,N.renderTransform,N,0,-1),E.dep=1),S==="scale")this._pt=new qn(this._pt,N,"scaleY",N.scaleY,(D?Ka(N.scaleY,D+p):p)-N.scaleY||0,Dd),this._pt.u=0,l.push("scaleY",S),S+="X";else if(S==="transformOrigin"){F.push(Yn,0,c[Yn]),d=_U(d),N.svg?Ud(e,d,0,U,0,this):(v=parseFloat(d.split(" ")[2])||0,v!==N.zOrigin&&os(this,N,"zOrigin",N.zOrigin,v),os(this,c,S,fu(h),fu(d)));continue}else if(S==="svgOrigin"){Ud(e,d,1,U,0,this);continue}else if(S in Xx){SU(this,N,S,m,D?Ka(m,D+d):d);continue}else if(S==="smoothOrigin"){os(this,N,"smooth",N.smooth,d);continue}else if(S==="force3D"){N[S]=d;continue}else if(S==="transform"){MU(this,d,e);continue}}else S in c||(S=lo(S)||S);if(w||(p||p===0)&&(m||m===0)&&!nU.test(d)&&S in c)x=(h+"").substr((m+"").length),p||(p=0),v=En(d)||(S in fi.units?fi.units[S]:x),x!==v&&(m=gs(e,S,h,v)),this._pt=new qn(this._pt,w?N:c,S,m,(D?Ka(m,D+p):p)-m,!w&&(v==="px"||S==="zIndex")&&t.autoRound!==!1?sU:Dd),this._pt.u=v||0,x!==v&&v!=="%"&&(this._pt.b=h,this._pt.r=rU);else if(S in c)mU.call(this,e,S,h,D?D+d:d);else if(S in e)this.add(e,S,h||e[S],D?D+d:d,r,a);else if(S!=="parseTransform"){gp(S,d);continue}w||(S in c?F.push(S,0,c[S]):F.push(S,1,h||e[S])),l.push(S)}}L&&Ox(this)},render:function(e,t){if(t.tween._time||!wp())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:Ar,aliases:ir,getSetter:function(e,t,n){var r=ir[t];return r&&r.indexOf(",")<0&&(t=r),t in Fr&&t!==Yn&&(e._gsap.x||Ar(e,"x"))?n&&vv===n?t==="scale"?cU:lU:(vv=n||{})&&(t==="scale"?uU:fU):e.style&&!pp(e.style[t])?aU:~t.indexOf("-")?oU:Tp(e,t)},core:{_removeProperty:na,_getMatrix:Cp}};Kn.utils.checkPrefix=lo;Kn.core.getStyleSaver=Gx;(function(i,e,t,n){var r=Xn(i+","+e+","+t,function(a){Fr[a]=1});Xn(e,function(a){fi.units[a]="deg",Xx[a]=1}),ir[r[13]]=i+","+e,Xn(n,function(a){var l=a.split(":");ir[l[1]]=r[l[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Xn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){fi.units[i]="px"});Kn.registerPlugin(Kx);var Nd=Kn.registerPlugin(Kx)||Kn;Nd.core.Tween;var hu={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */hu.exports;(function(i,e){(function(){var t,n="4.17.21",r=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,d="__lodash_placeholder__",p=1,m=2,_=4,M=1,S=2,x=1,v=2,D=4,w=8,E=16,N=32,U=64,L=128,F=256,T=512,R=30,B="...",j=800,q=16,ae=1,oe=2,ee=3,re=1/0,K=9007199254740991,ve=17976931348623157e292,Se=NaN,Re=4294967295,Ze=Re-1,St=Re>>>1,se=[["ary",L],["bind",x],["bindKey",v],["curry",w],["curryRight",E],["flip",T],["partial",N],["partialRight",U],["rearg",F]],me="[object Arguments]",Ie="[object Array]",be="[object AsyncFunction]",Ge="[object Boolean]",Ke="[object Date]",ot="[object DOMException]",wt="[object Error]",ct="[object Function]",kt="[object GeneratorFunction]",H="[object Map]",un="[object Number]",dt="[object Null]",Qe="[object Object]",ke="[object Promise]",Lt="[object Proxy]",He="[object RegExp]",I="[object Set]",b="[object String]",Y="[object Symbol]",he="[object Undefined]",de="[object WeakMap]",ce="[object WeakSet]",Ue="[object ArrayBuffer]",xe="[object DataView]",Ce="[object Float32Array]",ft="[object Float64Array]",_e="[object Int8Array]",Pe="[object Int16Array]",Ve="[object Int32Array]",Ye="[object Uint8Array]",De="[object Uint8ClampedArray]",ut="[object Uint16Array]",je="[object Uint32Array]",Rt=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Te=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ne=/&(?:amp|lt|gt|quot|#39);/g,fe=/[&<>"']/g,we=RegExp(ne.source),Ae=RegExp(fe.source),tt=/<%-([\s\S]+?)%>/g,Vt=/<%([\s\S]+?)%>/g,sn=/<%=([\s\S]+?)%>/g,yt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zn=/^\w*$/,Di=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sa=/[\\^$.*+?()[\]{}|]/g,Sl=RegExp(sa.source),Li=/^\s+/,_o=/\s/,Ml=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,yl=/\{\n\/\* \[wrapped with (.+)\] \*/,aa=/,? & /,El=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oa=/[()=,{}\[\]\/\s]/,Tl=/\\(\\)?/g,bl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Al=/\w*$/,yu=/^[-+]0x[0-9a-f]+$/i,Eu=/^0b[01]+$/i,C=/^\[object .+?Constructor\]$/,W=/^0o[0-7]+$/i,Z=/^(?:0|[1-9]\d*)$/,J=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,V=/($^)/,ge=/['\n\r\u2028\u2029\\]/g,Me="\\ud800-\\udfff",Oe="\\u0300-\\u036f",Fe="\\ufe20-\\ufe2f",Je="\\u20d0-\\u20ff",$e=Oe+Fe+Je,Ne="\\u2700-\\u27bf",mt="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="\\xac\\xb1\\xd7\\xf7",It="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gn="\\u2000-\\u206f",Mt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ze="A-Z\\xc0-\\xd6\\xd8-\\xde",di="\\ufe0e\\ufe0f",vt=Ct+It+gn+Mt,An="['’]",Br="["+Me+"]",vn="["+vt+"]",Ki="["+$e+"]",Pt="\\d+",pi="["+Ne+"]",zr="["+mt+"]",wn="[^"+Me+vt+Pt+Ne+mt+ze+"]",mi="\\ud83c[\\udffb-\\udfff]",Zi="(?:"+Ki+"|"+mi+")",go="[^"+Me+"]",Tu="(?:\\ud83c[\\udde6-\\uddff]){2}",bu="[\\ud800-\\udbff][\\udc00-\\udfff]",la="["+ze+"]",Pp="\\u200d",Dp="(?:"+zr+"|"+wn+")",Zx="(?:"+la+"|"+wn+")",Lp="(?:"+An+"(?:d|ll|m|re|s|t|ve))?",Ip="(?:"+An+"(?:D|LL|M|RE|S|T|VE))?",Up=Zi+"?",Np="["+di+"]?",Jx="(?:"+Pp+"(?:"+[go,Tu,bu].join("|")+")"+Np+Up+")*",Qx="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jx="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Op=Np+Up+Jx,$x="(?:"+[pi,Tu,bu].join("|")+")"+Op,eS="(?:"+[go+Ki+"?",Ki,Tu,bu,Br].join("|")+")",tS=RegExp(An,"g"),nS=RegExp(Ki,"g"),Au=RegExp(mi+"(?="+mi+")|"+eS+Op,"g"),iS=RegExp([la+"?"+zr+"+"+Lp+"(?="+[vn,la,"$"].join("|")+")",Zx+"+"+Ip+"(?="+[vn,la+Dp,"$"].join("|")+")",la+"?"+Dp+"+"+Lp,la+"+"+Ip,jx,Qx,Pt,$x].join("|"),"g"),rS=RegExp("["+Pp+Me+$e+di+"]"),sS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,aS=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oS=-1,Gt={};Gt[Ce]=Gt[ft]=Gt[_e]=Gt[Pe]=Gt[Ve]=Gt[Ye]=Gt[De]=Gt[ut]=Gt[je]=!0,Gt[me]=Gt[Ie]=Gt[Ue]=Gt[Ge]=Gt[xe]=Gt[Ke]=Gt[wt]=Gt[ct]=Gt[H]=Gt[un]=Gt[Qe]=Gt[He]=Gt[I]=Gt[b]=Gt[de]=!1;var Bt={};Bt[me]=Bt[Ie]=Bt[Ue]=Bt[xe]=Bt[Ge]=Bt[Ke]=Bt[Ce]=Bt[ft]=Bt[_e]=Bt[Pe]=Bt[Ve]=Bt[H]=Bt[un]=Bt[Qe]=Bt[He]=Bt[I]=Bt[b]=Bt[Y]=Bt[Ye]=Bt[De]=Bt[ut]=Bt[je]=!0,Bt[wt]=Bt[ct]=Bt[de]=!1;var lS={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},cS={"&":"&","<":"<",">":">",'"':""","'":"'"},uS={"&":"&","<":"<",">":">",""":'"',"'":"'"},fS={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hS=parseFloat,dS=parseInt,Fp=typeof za=="object"&&za&&za.Object===Object&&za,pS=typeof self=="object"&&self&&self.Object===Object&&self,mn=Fp||pS||Function("return this")(),wu=e&&!e.nodeType&&e,Ms=wu&&!0&&i&&!i.nodeType&&i,Bp=Ms&&Ms.exports===wu,Ru=Bp&&Fp.process,_i=function(){try{var k=Ms&&Ms.require&&Ms.require("util").types;return k||Ru&&Ru.binding&&Ru.binding("util")}catch{}}(),zp=_i&&_i.isArrayBuffer,Hp=_i&&_i.isDate,Gp=_i&&_i.isMap,kp=_i&&_i.isRegExp,Vp=_i&&_i.isSet,Wp=_i&&_i.isTypedArray;function Jn(k,ie,Q){switch(Q.length){case 0:return k.call(ie);case 1:return k.call(ie,Q[0]);case 2:return k.call(ie,Q[0],Q[1]);case 3:return k.call(ie,Q[0],Q[1],Q[2])}return k.apply(ie,Q)}function mS(k,ie,Q,Le){for(var et=-1,Et=k==null?0:k.length;++et-1}function Cu(k,ie,Q){for(var Le=-1,et=k==null?0:k.length;++Le-1;);return Q}function jp(k,ie){for(var Q=k.length;Q--&&ca(ie,k[Q],0)>-1;);return Q}function TS(k,ie){for(var Q=k.length,Le=0;Q--;)k[Q]===ie&&++Le;return Le}var bS=Iu(lS),AS=Iu(cS);function wS(k){return"\\"+fS[k]}function RS(k,ie){return k==null?t:k[ie]}function ua(k){return rS.test(k)}function CS(k){return sS.test(k)}function PS(k){for(var ie,Q=[];!(ie=k.next()).done;)Q.push(ie.value);return Q}function Fu(k){var ie=-1,Q=Array(k.size);return k.forEach(function(Le,et){Q[++ie]=[et,Le]}),Q}function $p(k,ie){return function(Q){return k(ie(Q))}}function kr(k,ie){for(var Q=-1,Le=k.length,et=0,Et=[];++Q-1}function gM(s,o){var f=this.__data__,g=Wl(f,s);return g<0?(++this.size,f.push([s,o])):f[g][1]=o,this}lr.prototype.clear=dM,lr.prototype.delete=pM,lr.prototype.get=mM,lr.prototype.has=_M,lr.prototype.set=gM;function cr(s){var o=-1,f=s==null?0:s.length;for(this.clear();++o=o?s:o)),s}function Si(s,o,f,g,y,P){var O,z=o&p,X=o&m,le=o&_;if(f&&(O=y?f(s,g,y,P):f(s)),O!==t)return O;if(!qt(s))return s;var ue=nt(s);if(ue){if(O=My(s),!z)return On(s,O)}else{var pe=Sn(s),ye=pe==ct||pe==kt;if(Kr(s))return Nm(s,z);if(pe==Qe||pe==me||ye&&!y){if(O=X||ye?{}:e_(s),!z)return X?uy(s,IM(O,s)):cy(s,fm(O,s))}else{if(!Bt[pe])return y?s:{};O=yy(s,pe,z)}}P||(P=new Ui);var Be=P.get(s);if(Be)return Be;P.set(s,O),C_(s)?s.forEach(function(qe){O.add(Si(qe,o,f,qe,s,P))}):w_(s)&&s.forEach(function(qe,ht){O.set(ht,Si(qe,o,f,ht,s,P))});var Xe=le?X?uf:cf:X?Bn:fn,st=ue?t:Xe(s);return gi(st||s,function(qe,ht){st&&(ht=qe,qe=s[ht]),To(O,ht,Si(qe,o,f,ht,s,P))}),O}function UM(s){var o=fn(s);return function(f){return hm(f,s,o)}}function hm(s,o,f){var g=f.length;if(s==null)return!g;for(s=Ut(s);g--;){var y=f[g],P=o[y],O=s[y];if(O===t&&!(y in s)||!P(O))return!1}return!0}function dm(s,o,f){if(typeof s!="function")throw new vi(l);return Do(function(){s.apply(t,f)},o)}function bo(s,o,f,g){var y=-1,P=wl,O=!0,z=s.length,X=[],le=o.length;if(!z)return X;f&&(o=Wt(o,Qn(f))),g?(P=Cu,O=!1):o.length>=r&&(P=vo,O=!1,o=new Ts(o));e:for(;++yy?0:y+f),g=g===t||g>y?y:it(g),g<0&&(g+=y),g=f>g?0:D_(g);f0&&f(z)?o>1?_n(z,o-1,f,g,y):Gr(y,z):g||(y[y.length]=z)}return y}var Wu=Gm(),_m=Gm(!0);function Ji(s,o){return s&&Wu(s,o,fn)}function Xu(s,o){return s&&_m(s,o,fn)}function ql(s,o){return Hr(o,function(f){return pr(s[f])})}function As(s,o){o=qr(o,s);for(var f=0,g=o.length;s!=null&&fo}function FM(s,o){return s!=null&&bt.call(s,o)}function BM(s,o){return s!=null&&o in Ut(s)}function zM(s,o,f){return s>=xn(o,f)&&s=120&&ue.length>=120)?new Ts(O&&ue):t}ue=s[0];var pe=-1,ye=z[0];e:for(;++pe-1;)z!==s&&Fl.call(z,X,1),Fl.call(s,X,1);return s}function wm(s,o){for(var f=s?o.length:0,g=f-1;f--;){var y=o[f];if(f==g||y!==P){var P=y;dr(y)?Fl.call(s,y,1):tf(s,y)}}return s}function ju(s,o){return s+Hl(om()*(o-s+1))}function jM(s,o,f,g){for(var y=-1,P=on(zl((o-s)/(f||1)),0),O=Q(P);P--;)O[g?P:++y]=s,s+=f;return O}function $u(s,o){var f="";if(!s||o<1||o>K)return f;do o%2&&(f+=s),o=Hl(o/2),o&&(s+=s);while(o);return f}function lt(s,o){return gf(i_(s,o,zn),s+"")}function $M(s){return um(Ma(s))}function ey(s,o){var f=Ma(s);return ic(f,bs(o,0,f.length))}function Ro(s,o,f,g){if(!qt(s))return s;o=qr(o,s);for(var y=-1,P=o.length,O=P-1,z=s;z!=null&&++yy?0:y+o),f=f>y?y:f,f<0&&(f+=y),y=o>f?0:f-o>>>0,o>>>=0;for(var P=Q(y);++g>>1,O=s[P];O!==null&&!$n(O)&&(f?O<=o:O=r){var le=o?null:py(s);if(le)return Cl(le);O=!1,y=vo,X=new Ts}else X=o?[]:z;e:for(;++g=g?s:Mi(s,o,f)}var Um=XS||function(s){return mn.clearTimeout(s)};function Nm(s,o){if(o)return s.slice();var f=s.length,g=nm?nm(f):new s.constructor(f);return s.copy(g),g}function af(s){var o=new s.constructor(s.byteLength);return new Nl(o).set(new Nl(s)),o}function sy(s,o){var f=o?af(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.byteLength)}function ay(s){var o=new s.constructor(s.source,Al.exec(s));return o.lastIndex=s.lastIndex,o}function oy(s){return Eo?Ut(Eo.call(s)):{}}function Om(s,o){var f=o?af(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.length)}function Fm(s,o){if(s!==o){var f=s!==t,g=s===null,y=s===s,P=$n(s),O=o!==t,z=o===null,X=o===o,le=$n(o);if(!z&&!le&&!P&&s>o||P&&O&&X&&!z&&!le||g&&O&&X||!f&&X||!y)return 1;if(!g&&!P&&!le&&s=z)return X;var le=f[g];return X*(le=="desc"?-1:1)}}return s.index-o.index}function Bm(s,o,f,g){for(var y=-1,P=s.length,O=f.length,z=-1,X=o.length,le=on(P-O,0),ue=Q(X+le),pe=!g;++z1?f[y-1]:t,O=y>2?f[2]:t;for(P=s.length>3&&typeof P=="function"?(y--,P):t,O&&Cn(f[0],f[1],O)&&(P=y<3?t:P,y=1),o=Ut(o);++g-1?y[P?o[O]:O]:t}}function Wm(s){return hr(function(o){var f=o.length,g=f,y=xi.prototype.thru;for(s&&o.reverse();g--;){var P=o[g];if(typeof P!="function")throw new vi(l);if(y&&!O&&tc(P)=="wrapper")var O=new xi([],!0)}for(g=O?g:f;++g1&&_t.reverse(),ue&&Xz))return!1;var le=P.get(s),ue=P.get(o);if(le&&ue)return le==o&&ue==s;var pe=-1,ye=!0,Be=f&S?new Ts:t;for(P.set(s,o),P.set(o,s);++pe1?"& ":"")+o[g],o=o.join(f>2?", ":" "),s.replace(Ml,`{ /* [wrapped with `+o+`] */ `)}function Ty(s){return nt(s)||Cs(s)||!!(sm&&s&&s[sm])}function dr(s,o){var f=typeof s;return o=o??K,!!o&&(f=="number"||f!="symbol"&&Z.test(s))&&s>-1&&s%1==0&&s0){if(++o>=j)return arguments[0]}else o=0;return s.apply(t,arguments)}}function ic(s,o){var f=-1,g=s.length,y=g-1;for(o=o===t?g:o;++f1?s[o-1]:t;return f=typeof f=="function"?(s.pop(),f):t,m_(s,f)});function __(s){var o=A(s);return o.__chain__=!0,o}function NE(s,o){return o(s),s}function rc(s,o){return o(s)}var OE=hr(function(s){var o=s.length,f=o?s[0]:0,g=this.__wrapped__,y=function(P){return Vu(P,s)};return o>1||this.__actions__.length||!(g instanceof pt)||!dr(f)?this.thru(y):(g=g.slice(f,+f+(o?1:0)),g.__actions__.push({func:rc,args:[y],thisArg:t}),new xi(g,this.__chain__).thru(function(P){return o&&!P.length&&P.push(t),P}))});function FE(){return __(this)}function BE(){return new xi(this.value(),this.__chain__)}function zE(){this.__values__===t&&(this.__values__=P_(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function HE(){return this}function GE(s){for(var o,f=this;f instanceof Vl;){var g=c_(f);g.__index__=0,g.__values__=t,o?y.__wrapped__=g:o=g;var y=g;f=f.__wrapped__}return y.__wrapped__=s,o}function kE(){var s=this.__wrapped__;if(s instanceof pt){var o=s;return this.__actions__.length&&(o=new pt(this)),o=o.reverse(),o.__actions__.push({func:rc,args:[vf],thisArg:t}),new xi(o,this.__chain__)}return this.thru(vf)}function VE(){return Lm(this.__wrapped__,this.__actions__)}var WE=Jl(function(s,o,f){bt.call(s,f)?++s[f]:ur(s,f,1)});function XE(s,o,f){var g=nt(s)?Xp:NM;return f&&Cn(s,o,f)&&(o=t),g(s,We(o,3))}function qE(s,o){var f=nt(s)?Hr:mm;return f(s,We(o,3))}var YE=Vm(u_),KE=Vm(f_);function ZE(s,o){return _n(sc(s,o),1)}function JE(s,o){return _n(sc(s,o),re)}function QE(s,o,f){return f=f===t?1:it(f),_n(sc(s,o),f)}function g_(s,o){var f=nt(s)?gi:Wr;return f(s,We(o,3))}function v_(s,o){var f=nt(s)?_S:pm;return f(s,We(o,3))}var jE=Jl(function(s,o,f){bt.call(s,f)?s[f].push(o):ur(s,f,[o])});function $E(s,o,f,g){s=Fn(s)?s:Ma(s),f=f&&!g?it(f):0;var y=s.length;return f<0&&(f=on(y+f,0)),uc(s)?f<=y&&s.indexOf(o,f)>-1:!!y&&ca(s,o,f)>-1}var eT=lt(function(s,o,f){var g=-1,y=typeof o=="function",P=Fn(s)?Q(s.length):[];return Wr(s,function(O){P[++g]=y?Jn(o,O,f):Ao(O,o,f)}),P}),tT=Jl(function(s,o,f){ur(s,f,o)});function sc(s,o){var f=nt(s)?Wt:Mm;return f(s,We(o,3))}function nT(s,o,f,g){return s==null?[]:(nt(o)||(o=o==null?[]:[o]),f=g?t:f,nt(f)||(f=f==null?[]:[f]),bm(s,o,f))}var iT=Jl(function(s,o,f){s[f?0:1].push(o)},function(){return[[],[]]});function rT(s,o,f){var g=nt(s)?Pu:Zp,y=arguments.length<3;return g(s,We(o,4),f,y,Wr)}function sT(s,o,f){var g=nt(s)?gS:Zp,y=arguments.length<3;return g(s,We(o,4),f,y,pm)}function aT(s,o){var f=nt(s)?Hr:mm;return f(s,lc(We(o,3)))}function oT(s){var o=nt(s)?um:$M;return o(s)}function lT(s,o,f){(f?Cn(s,o,f):o===t)?o=1:o=it(o);var g=nt(s)?PM:ey;return g(s,o)}function cT(s){var o=nt(s)?DM:ny;return o(s)}function uT(s){if(s==null)return 0;if(Fn(s))return uc(s)?fa(s):s.length;var o=Sn(s);return o==H||o==I?s.size:Zu(s).length}function fT(s,o,f){var g=nt(s)?Du:iy;return f&&Cn(s,o,f)&&(o=t),g(s,We(o,3))}var hT=lt(function(s,o){if(s==null)return[];var f=o.length;return f>1&&Cn(s,o[0],o[1])?o=[]:f>2&&Cn(o[0],o[1],o[2])&&(o=[o[0]]),bm(s,_n(o,1),[])}),ac=qS||function(){return mn.Date.now()};function dT(s,o){if(typeof o!="function")throw new vi(l);return s=it(s),function(){if(--s<1)return o.apply(this,arguments)}}function x_(s,o,f){return o=f?t:o,o=s&&o==null?s.length:o,fr(s,L,t,t,t,t,o)}function S_(s,o){var f;if(typeof o!="function")throw new vi(l);return s=it(s),function(){return--s>0&&(f=o.apply(this,arguments)),s<=1&&(o=t),f}}var Sf=lt(function(s,o,f){var g=x;if(f.length){var y=kr(f,xa(Sf));g|=N}return fr(s,g,o,f,y)}),M_=lt(function(s,o,f){var g=x|v;if(f.length){var y=kr(f,xa(M_));g|=N}return fr(o,g,s,f,y)});function y_(s,o,f){o=f?t:o;var g=fr(s,w,t,t,t,t,t,o);return g.placeholder=y_.placeholder,g}function E_(s,o,f){o=f?t:o;var g=fr(s,E,t,t,t,t,t,o);return g.placeholder=E_.placeholder,g}function T_(s,o,f){var g,y,P,O,z,X,le=0,ue=!1,pe=!1,ye=!0;if(typeof s!="function")throw new vi(l);o=Ei(o)||0,qt(f)&&(ue=!!f.leading,pe="maxWait"in f,P=pe?on(Ei(f.maxWait)||0,o):P,ye="trailing"in f?!!f.trailing:ye);function Be(jt){var Oi=g,_r=y;return g=y=t,le=jt,O=s.apply(_r,Oi),O}function Xe(jt){return le=jt,z=Do(ht,o),ue?Be(jt):O}function st(jt){var Oi=jt-X,_r=jt-le,V_=o-Oi;return pe?xn(V_,P-_r):V_}function qe(jt){var Oi=jt-X,_r=jt-le;return X===t||Oi>=o||Oi<0||pe&&_r>=P}function ht(){var jt=ac();if(qe(jt))return _t(jt);z=Do(ht,st(jt))}function _t(jt){return z=t,ye&&g?Be(jt):(g=y=t,O)}function ei(){z!==t&&Um(z),le=0,g=X=y=z=t}function Pn(){return z===t?O:_t(ac())}function ti(){var jt=ac(),Oi=qe(jt);if(g=arguments,y=this,X=jt,Oi){if(z===t)return Xe(X);if(pe)return Um(z),z=Do(ht,o),Be(X)}return z===t&&(z=Do(ht,o)),O}return ti.cancel=ei,ti.flush=Pn,ti}var pT=lt(function(s,o){return dm(s,1,o)}),mT=lt(function(s,o,f){return dm(s,Ei(o)||0,f)});function _T(s){return fr(s,T)}function oc(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new vi(l);var f=function(){var g=arguments,y=o?o.apply(this,g):g[0],P=f.cache;if(P.has(y))return P.get(y);var O=s.apply(this,g);return f.cache=P.set(y,O)||P,O};return f.cache=new(oc.Cache||cr),f}oc.Cache=cr;function lc(s){if(typeof s!="function")throw new vi(l);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function gT(s){return S_(2,s)}var vT=ry(function(s,o){o=o.length==1&&nt(o[0])?Wt(o[0],Qn(We())):Wt(_n(o,1),Qn(We()));var f=o.length;return lt(function(g){for(var y=-1,P=xn(g.length,f);++y=o}),Cs=vm(function(){return arguments}())?vm:function(s){return Zt(s)&&bt.call(s,"callee")&&!rm.call(s,"callee")},nt=Q.isArray,IT=zp?Qn(zp):GM;function Fn(s){return s!=null&&cc(s.length)&&!pr(s)}function Qt(s){return Zt(s)&&Fn(s)}function UT(s){return s===!0||s===!1||Zt(s)&&Rn(s)==Ge}var Kr=KS||Lf,NT=Hp?Qn(Hp):kM;function OT(s){return Zt(s)&&s.nodeType===1&&!Lo(s)}function FT(s){if(s==null)return!0;if(Fn(s)&&(nt(s)||typeof s=="string"||typeof s.splice=="function"||Kr(s)||Sa(s)||Cs(s)))return!s.length;var o=Sn(s);if(o==H||o==I)return!s.size;if(Po(s))return!Zu(s).length;for(var f in s)if(bt.call(s,f))return!1;return!0}function BT(s,o){return wo(s,o)}function zT(s,o,f){f=typeof f=="function"?f:t;var g=f?f(s,o):t;return g===t?wo(s,o,t,f):!!g}function yf(s){if(!Zt(s))return!1;var o=Rn(s);return o==wt||o==ot||typeof s.message=="string"&&typeof s.name=="string"&&!Lo(s)}function HT(s){return typeof s=="number"&&am(s)}function pr(s){if(!qt(s))return!1;var o=Rn(s);return o==ct||o==kt||o==be||o==Lt}function A_(s){return typeof s=="number"&&s==it(s)}function cc(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=K}function qt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function Zt(s){return s!=null&&typeof s=="object"}var w_=Gp?Qn(Gp):WM;function GT(s,o){return s===o||Ku(s,o,hf(o))}function kT(s,o,f){return f=typeof f=="function"?f:t,Ku(s,o,hf(o),f)}function VT(s){return R_(s)&&s!=+s}function WT(s){if(wy(s))throw new et(a);return xm(s)}function XT(s){return s===null}function qT(s){return s==null}function R_(s){return typeof s=="number"||Zt(s)&&Rn(s)==un}function Lo(s){if(!Zt(s)||Rn(s)!=Qe)return!1;var o=Ol(s);if(o===null)return!0;var f=bt.call(o,"constructor")&&o.constructor;return typeof f=="function"&&f instanceof f&&Ll.call(f)==kS}var Ef=kp?Qn(kp):XM;function YT(s){return A_(s)&&s>=-K&&s<=K}var C_=Vp?Qn(Vp):qM;function uc(s){return typeof s=="string"||!nt(s)&&Zt(s)&&Rn(s)==b}function $n(s){return typeof s=="symbol"||Zt(s)&&Rn(s)==Y}var Sa=Wp?Qn(Wp):YM;function KT(s){return s===t}function ZT(s){return Zt(s)&&Sn(s)==de}function JT(s){return Zt(s)&&Rn(s)==ce}var QT=ec(Ju),jT=ec(function(s,o){return s<=o});function P_(s){if(!s)return[];if(Fn(s))return uc(s)?Ii(s):On(s);if(xo&&s[xo])return PS(s[xo]());var o=Sn(s),f=o==H?Fu:o==I?Cl:Ma;return f(s)}function mr(s){if(!s)return s===0?s:0;if(s=Ei(s),s===re||s===-re){var o=s<0?-1:1;return o*ve}return s===s?s:0}function it(s){var o=mr(s),f=o%1;return o===o?f?o-f:o:0}function D_(s){return s?bs(it(s),0,Re):0}function Ei(s){if(typeof s=="number")return s;if($n(s))return Se;if(qt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=qt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=Jp(s);var f=Eu.test(s);return f||W.test(s)?dS(s.slice(2),f?2:8):yu.test(s)?Se:+s}function L_(s){return Qi(s,Bn(s))}function $T(s){return s?bs(it(s),-K,K):s===0?s:0}function Tt(s){return s==null?"":jn(s)}var e1=ga(function(s,o){if(Po(o)||Fn(o)){Qi(o,fn(o),s);return}for(var f in o)bt.call(o,f)&&To(s,f,o[f])}),I_=ga(function(s,o){Qi(o,Bn(o),s)}),fc=ga(function(s,o,f,g){Qi(o,Bn(o),s,g)}),t1=ga(function(s,o,f,g){Qi(o,fn(o),s,g)}),n1=hr(Vu);function i1(s,o){var f=_a(s);return o==null?f:fm(f,o)}var r1=lt(function(s,o){s=Ut(s);var f=-1,g=o.length,y=g>2?o[2]:t;for(y&&Cn(o[0],o[1],y)&&(g=1);++f1),P}),Qi(s,uf(s),f),g&&(f=Si(f,p|m|_,my));for(var y=o.length;y--;)tf(f,o[y]);return f});function y1(s,o){return N_(s,lc(We(o)))}var E1=hr(function(s,o){return s==null?{}:JM(s,o)});function N_(s,o){if(s==null)return{};var f=Wt(uf(s),function(g){return[g]});return o=We(o),Am(s,f,function(g,y){return o(g,y[0])})}function T1(s,o,f){o=qr(o,s);var g=-1,y=o.length;for(y||(y=1,s=t);++go){var g=s;s=o,o=g}if(f||s%1||o%1){var y=om();return xn(s+y*(o-s+hS("1e-"+((y+"").length-1))),o)}return ju(s,o)}var N1=va(function(s,o,f){return o=o.toLowerCase(),s+(f?B_(o):o)});function B_(s){return Af(Tt(s).toLowerCase())}function z_(s){return s=Tt(s),s&&s.replace(J,bS).replace(nS,"")}function O1(s,o,f){s=Tt(s),o=jn(o);var g=s.length;f=f===t?g:bs(it(f),0,g);var y=f;return f-=o.length,f>=0&&s.slice(f,y)==o}function F1(s){return s=Tt(s),s&&Ae.test(s)?s.replace(fe,AS):s}function B1(s){return s=Tt(s),s&&Sl.test(s)?s.replace(sa,"\\$&"):s}var z1=va(function(s,o,f){return s+(f?"-":"")+o.toLowerCase()}),H1=va(function(s,o,f){return s+(f?" ":"")+o.toLowerCase()}),G1=km("toLowerCase");function k1(s,o,f){s=Tt(s),o=it(o);var g=o?fa(s):0;if(!o||g>=o)return s;var y=(o-g)/2;return $l(Hl(y),f)+s+$l(zl(y),f)}function V1(s,o,f){s=Tt(s),o=it(o);var g=o?fa(s):0;return o&&g>>0,f?(s=Tt(s),s&&(typeof o=="string"||o!=null&&!Ef(o))&&(o=jn(o),!o&&ua(s))?Yr(Ii(s),0,f):s.split(o,f)):[]}var J1=va(function(s,o,f){return s+(f?" ":"")+Af(o)});function Q1(s,o,f){return s=Tt(s),f=f==null?0:bs(it(f),0,s.length),o=jn(o),s.slice(f,f+o.length)==o}function j1(s,o,f){var g=A.templateSettings;f&&Cn(s,o,f)&&(o=t),s=Tt(s),o=fc({},o,g,Zm);var y=fc({},o.imports,g.imports,Zm),P=fn(y),O=Ou(y,P),z,X,le=0,ue=o.interpolate||V,pe="__p += '",ye=Bu((o.escape||V).source+"|"+ue.source+"|"+(ue===sn?bl:V).source+"|"+(o.evaluate||V).source+"|$","g"),Be="//# sourceURL="+(bt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oS+"]")+` `;s.replace(ye,function(qe,ht,_t,ei,Pn,ti){return _t||(_t=ei),pe+=s.slice(le,ti).replace(ge,wS),ht&&(z=!0,pe+=`' + __e(`+ht+`) + '`),Pn&&(X=!0,pe+=`'; `+Pn+`; __p += '`),_t&&(pe+=`' + ((__t = (`+_t+`)) == null ? '' : __t) + '`),le=ti+qe.length,qe}),pe+=`'; `;var Xe=bt.call(o,"variable")&&o.variable;if(!Xe)pe=`with (obj) { `+pe+` } `;else if(oa.test(Xe))throw new et(c);pe=(X?pe.replace(Rt,""):pe).replace(G,"$1").replace(Te,"$1;"),pe="function("+(Xe||"obj")+`) { `+(Xe?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(z?", __e = _.escape":"")+(X?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+pe+`return __p }`;var st=G_(function(){return Et(P,Be+"return "+pe).apply(t,O)});if(st.source=pe,yf(st))throw st;return st}function $1(s){return Tt(s).toLowerCase()}function eb(s){return Tt(s).toUpperCase()}function tb(s,o,f){if(s=Tt(s),s&&(f||o===t))return Jp(s);if(!s||!(o=jn(o)))return s;var g=Ii(s),y=Ii(o),P=Qp(g,y),O=jp(g,y)+1;return Yr(g,P,O).join("")}function nb(s,o,f){if(s=Tt(s),s&&(f||o===t))return s.slice(0,em(s)+1);if(!s||!(o=jn(o)))return s;var g=Ii(s),y=jp(g,Ii(o))+1;return Yr(g,0,y).join("")}function ib(s,o,f){if(s=Tt(s),s&&(f||o===t))return s.replace(Li,"");if(!s||!(o=jn(o)))return s;var g=Ii(s),y=Qp(g,Ii(o));return Yr(g,y).join("")}function rb(s,o){var f=R,g=B;if(qt(o)){var y="separator"in o?o.separator:y;f="length"in o?it(o.length):f,g="omission"in o?jn(o.omission):g}s=Tt(s);var P=s.length;if(ua(s)){var O=Ii(s);P=O.length}if(f>=P)return s;var z=f-fa(g);if(z<1)return g;var X=O?Yr(O,0,z).join(""):s.slice(0,z);if(y===t)return X+g;if(O&&(z+=X.length-z),Ef(y)){if(s.slice(z).search(y)){var le,ue=X;for(y.global||(y=Bu(y.source,Tt(Al.exec(y))+"g")),y.lastIndex=0;le=y.exec(ue);)var pe=le.index;X=X.slice(0,pe===t?z:pe)}}else if(s.indexOf(jn(y),z)!=z){var ye=X.lastIndexOf(y);ye>-1&&(X=X.slice(0,ye))}return X+g}function sb(s){return s=Tt(s),s&&we.test(s)?s.replace(ne,US):s}var ab=va(function(s,o,f){return s+(f?" ":"")+o.toUpperCase()}),Af=km("toUpperCase");function H_(s,o,f){return s=Tt(s),o=f?t:o,o===t?CS(s)?FS(s):SS(s):s.match(o)||[]}var G_=lt(function(s,o){try{return Jn(s,t,o)}catch(f){return yf(f)?f:new et(f)}}),ob=hr(function(s,o){return gi(o,function(f){f=ji(f),ur(s,f,Sf(s[f],s))}),s});function lb(s){var o=s==null?0:s.length,f=We();return s=o?Wt(s,function(g){if(typeof g[1]!="function")throw new vi(l);return[f(g[0]),g[1]]}):[],lt(function(g){for(var y=-1;++yK)return[];var f=Re,g=xn(s,Re);o=We(o),s-=Re;for(var y=Nu(g,o);++f0||o<0)?new pt(f):(s<0?f=f.takeRight(-s):s&&(f=f.drop(s)),o!==t&&(o=it(o),f=o<0?f.dropRight(-o):f.take(o-s)),f)},pt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},pt.prototype.toArray=function(){return this.take(Re)},Ji(pt.prototype,function(s,o){var f=/^(?:filter|find|map|reject)|While$/.test(o),g=/^(?:head|last)$/.test(o),y=A[g?"take"+(o=="last"?"Right":""):o],P=g||/^find/.test(o);y&&(A.prototype[o]=function(){var O=this.__wrapped__,z=g?[1]:arguments,X=O instanceof pt,le=z[0],ue=X||nt(O),pe=function(ht){var _t=y.apply(A,Gr([ht],z));return g&&ye?_t[0]:_t};ue&&f&&typeof le=="function"&&le.length!=1&&(X=ue=!1);var ye=this.__chain__,Be=!!this.__actions__.length,Xe=P&&!ye,st=X&&!Be;if(!P&&ue){O=st?O:new pt(this);var qe=s.apply(O,z);return qe.__actions__.push({func:rc,args:[pe],thisArg:t}),new xi(qe,ye)}return Xe&&st?s.apply(this,z):(qe=this.thru(pe),Xe?g?qe.value()[0]:qe.value():qe)})}),gi(["pop","push","shift","sort","splice","unshift"],function(s){var o=Pl[s],f=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);A.prototype[s]=function(){var y=arguments;if(g&&!this.__chain__){var P=this.value();return o.apply(nt(P)?P:[],y)}return this[f](function(O){return o.apply(nt(O)?O:[],y)})}}),Ji(pt.prototype,function(s,o){var f=A[o];if(f){var g=f.name+"";bt.call(ma,g)||(ma[g]=[]),ma[g].push({name:o,func:f})}}),ma[Ql(t,v).name]=[{name:"wrapper",func:t}],pt.prototype.clone=sM,pt.prototype.reverse=aM,pt.prototype.value=oM,A.prototype.at=OE,A.prototype.chain=FE,A.prototype.commit=BE,A.prototype.next=zE,A.prototype.plant=GE,A.prototype.reverse=kE,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=VE,A.prototype.first=A.prototype.head,xo&&(A.prototype[xo]=HE),A},ha=BS();Ms?((Ms.exports=ha)._=ha,wu._=ha):mn._=ha}).call(za)})(hu,hu.exports);var yU=hu.exports;const Av=1/60;class EU{constructor(e,t){te(this,"af",null);te(this,"scene");te(this,"camera");te(this,"renderer");te(this,"clock",new hp);te(this,"delta",0);te(this,"fps",Av);te(this,"attached",!1);te(this,"autoStart",!0);te(this,"isDestroyed",!1);this.canvas=e,this.config=t,this.tick=this.tick.bind(this),t.fps&&t.fps>0&&t.fps<=Av&&(this.fps=1/t.fps),this.init(this.autoStart)}get size(){const{size:e}=this.config;return yU.isFunction(e)?e():e}get pixelRatio(){return Math.max(2,devicePixelRatio)}beforeInit(){}async init(e=!0){this.beforeInit(),await this.initScene(),e&&this.attachTicker()}destroy(){var e,t;this.isDestroyed=!0,this.cancelRenderer(),this.detachTicker(),(e=this.renderer)==null||e.dispose(),(t=this.renderer)==null||t.forceContextLoss()}async initScene(){const{canvas:e}=this,{background:t}=this.config;this.scene=new Z0,this.camera=this.initCamera(),this.renderer=this.initRenderer(e),t&&(this.scene.background=new At(t))}initCamera(){const{width:e,height:t}=this.size;return new wi(75,e/t,.1,1e3)}initRenderer(e){const{width:t,height:n}=this.size,{background:r}=this.config,a=new iI({antialias:!0,alpha:!r,canvas:e,depth:!0,stencil:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance"});return a.shadowMap.enabled=!1,a.setSize(t,n),a.setPixelRatio(this.pixelRatio),a.outputColorSpace=si,a}getPixelRatio(){return this.pixelRatio}scheduleRender(e=!1){this.af||this.isDestroyed||this.attached||(this.af=requestAnimationFrame(()=>{this.af=null,this.tick(),e&&this.scheduleRender()}))}tick(){if(this.delta+=this.clock.getDelta(),this.deltathis.cleanupObjects(t)),e instanceof ki&&e.geometry.dispose()}render(e=!1){this.beforeRender(e),e||this.renderer.render(this.scene,this.camera)}cancelRenderer(){this.af&&(cancelAnimationFrame(this.af),this.af=null)}onResize(){const{width:e,height:t}=this.size;this.renderer&&(this.renderer.setSize(e,t),this.renderer.setPixelRatio(this.getPixelRatio()),requestAnimationFrame(()=>this.render()))}}function TU(i,e,t){return(1-t)*i+t*e}function Od(i){return i.isVideoTexture?[i.image.videoWidth,i.image.videoHeight]:[i.image.naturalWidth,i.image.naturalHeight]}let Fc=null;function bU(){return Fc!==null||(Fc=!!document.createElement("canvas").getContext("webgl2")),Fc}async function wv(i){return new Promise((e,t)=>{new oI().load(i,r=>{r.wrapS=el,r.wrapT=el,e(r)},void 0,t)})}class AU{constructor(e,t){te(this,"scene");te(this,"camera");te(this,"uniforms");this.size=e,this.config=t,this.scene=this.initializeScene(t),this.camera=this.initializeCamera(t),this.uniforms=this.initializeUniforms(t),this.scene.matrixAutoUpdate=!1,this.scene.matrixWorldAutoUpdate=!1,t.autoInit!==!1&&this.init()}initializeCamera(e){return new gu(-1,1,1,-1,0,1)}initializeScene(e){return new Z0}getCamera(){return this.camera}getScene(){return this.scene}resize(e){this.size=e,this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this.scene.updateMatrix(),this.scene.updateMatrixWorld(),this.uniforms.uResolution.value=[e.width*this.pixelRatio,e.height*this.pixelRatio],this.uniforms.uAspect.value=e.height>0?e.width/e.height:1,this.onResize()}render(e){this.doRender(e)}get pixelRatio(){return Math.max(1,devicePixelRatio)}set timestamp(e){this.uniforms.uTimestamp.value=e}get timestamp(){return this.uniforms.uTimestamp.value}destroy(){}async init(){}onResize(){}initializeBaseUniforms(){return{uResolution:{value:[this.size.width*this.pixelRatio,this.size.height*this.pixelRatio]},uAspect:{value:this.size.height>0?this.size.width/this.size.height:1},uTimestamp:{value:0}}}}class wU extends AU{constructor(t,n){super(t,n);te(this,"fbo");this.fbo=new ms(t.width*this.pixelRatio,t.height*this.pixelRatio,this.fbpOptions)}get pixelRatio(){return Math.max(1,devicePixelRatio)}get fbpOptions(){const{samples:t}=this.config;return{depthBuffer:!1,stencilBuffer:!1,samples:t}}get out(){return this.fbo}get outTexture(){return this.out.texture}resize(t){super.resize(t),this.fbo.setSize(t.width*this.pixelRatio,t.height*this.pixelRatio)}render(t){super.render(t)}renderToBuffer(t){t.setRenderTarget(this.out),t.render(this.scene,this.camera),t.setRenderTarget(null)}}class Rv{constructor(e,t,n){te(this,"lastTs");te(this,"_value");te(this,"targetValue");te(this,"_last");te(this,"_lastMul",1);te(this,"tolerance",.001);te(this,"fps",60);te(this,"customInterpolation");te(this,"autoTick",!1);te(this,"_wasSettled",!1);this.initial=e,this.speedFactor=t,this.options=n,this._value=e,this.targetValue=e,this._last=e,this.tolerance=(n==null?void 0:n.tolerance)??this.tolerance,this.fps=(n==null?void 0:n.fps)??this.fps,this.autoTick=(n==null?void 0:n.autoTick)??this.autoTick,this.customInterpolation=(n==null?void 0:n.customInterpolation)??this.customInterpolation}get value(){return this._value}get target(){return this.targetValue}get last(){return this._last}get lastMul(){return this._lastMul}get isSettled(){return this._value===this.targetValue}get wasSettled(){return this._wasSettled}to(e,t=!1){if(t||this.isInToleranceRange(e)){this.targetValue=e,this._value=e,this._last=e,this.lastTs=null;return}this.targetValue=e,this.lastTs||(this.lastTs=Date.now()),this.autoTick&&this.tick()}set(e){this.to(e,!0)}reset(){this.set(this.initial)}bump(e){this._value+=e,this.autoTick&&this.tick()}isInToleranceRange(e){return Math.abs(this._value-e)0);this.isSettled?(this._last=this.value,this.lastTs=null):this.lastTs=t}}async function RU(){return new Promise(i=>requestAnimationFrame(i))}var CU=`precision mediump float; #define PI 3.14159265359 uniform sampler2D uTexture; uniform vec2 uTextureSize; uniform vec2 uViewportSize; uniform vec2 uParallax; uniform vec2 uPointer; uniform float uOpacity; uniform float uTimestamp; uniform float uAspect; uniform sampler2D uNoiseTexture; uniform sampler2D uGradientmapTexture; uniform vec2 uScreenSize; uniform bool uBallEnabled; varying vec2 vUv; float dotSize = 1.0; float gapSize = 9.0; vec3 borderColor = vec3(0. / 255., 0. / 255., 22. / 255.); float uWaveSpeed = .1; float uWaveFrequency = 4.; float uWaveTraslate = .4; float uParallaxAmt = 1.2; mat2 rotate2d(float angle) { return mat2( cos(angle), -sin(angle), sin(angle), cos(angle) ); } float pow2(float v) { return pow(v, 2.); } float pow3(float v) { return pow(v, 3.); } vec2 scaleV2(vec2 uv, vec2 scale) { return (uv - vec2(0.5)) * scale + vec2(0.5); } vec2 waveFloat(vec2 uv) { return uv; } float smooth_blob(float x) { float amt1 = smoothstep(0., 1., x); float amt2 = sqrt(1. - pow(1. - x, 2.)); return mix(amt1, amt2, x); } float smooth_blob_derivative(float x) { float eps = 1e-4; return (smooth_blob(x + eps) - smooth_blob(x - eps)) / (2.0 * eps); } float smooth_blob_refract_displacement(float x, float n1, float n2) { float nx = -smooth_blob_derivative(x); float norm = sqrt(pow(nx, 2.) + 1.); nx /= norm; float displacement = nx * (1.0 - n1 / n2); return displacement; } vec4 blend_overlay(vec4 base, vec4 blend) { vec3 rgb = mix( 2.0 * base.rgb * blend.rgb, 1.0 - 2.0 * (1.0 - base.rgb) * (1.0 - blend.rgb), step(0.5, base.rgb) ); return vec4(rgb, base.a); } vec4 blend_dot_pattern(vec2 uv, vec4 color, vec2 offset, float opacity) { vec2 screenPos = uv * uScreenSize; offset *= uScreenSize.x; offset += mod(uScreenSize, gapSize) * 0.5; float xModulo = mod(screenPos.x - offset.x, gapSize); float yModulo = mod(screenPos.y - offset.y, gapSize); if (xModulo < dotSize && yModulo < dotSize) { return mix(color, blend_overlay(color, vec4(1.0)), opacity); } return color; } vec2 apply_parallax(vec2 uv, vec2 amt) { return uv + (uParallax * -1. * vec2(1., uAspect)) * amt * uParallaxAmt; } vec2 cartesian_to_polar(vec2 cartesian, vec2 center) { vec2 offset = cartesian - center; float r = length(offset); float theta = atan(offset.y, offset.x); return vec2(r, theta); } vec2 polar_to_cartesian(vec2 polar, vec2 center) { float x = polar.x * cos(polar.y); float y = polar.x * sin(polar.y); return vec2(x, y) + center; } vec4 process_waves(vec2 uv, vec2 scale) { if (uAspect > 1.) { uv *= rotate2d(PI * -.08); } else { uWaveTraslate *= -1.; } vec2 modifiedUv = waveFloat(scaleV2(uv, 1.2 * scale)) * vec2(1., 1./uAspect); vec2 modifiedUv2 = waveFloat(scaleV2(uv, 1.1 + vec2(0.8) * scale) * rotate2d(-.3)) * vec2(1., 1./uAspect); vec2 modifiedUv3 = waveFloat(scaleV2(uv, .5 * scale)) * vec2(1., 1./uAspect); float wave = cos((modifiedUv.x + modifiedUv.y * .8) * uWaveFrequency + sin(-1.5 + uTimestamp * .1 * uWaveSpeed) + modifiedUv.y * 5.) + uWaveTraslate * .7 * -uTimestamp; float wave2 = cos((modifiedUv2.x + modifiedUv2.y * .5) * uWaveFrequency * 1.8 + (1. + sin(-2.5 - uTimestamp * 0.2 * uWaveSpeed) + modifiedUv2.y * 3.)) + uWaveTraslate * .5 * -uTimestamp; float wave3 = sin((modifiedUv3.x + modifiedUv3.y * 2.2) * uWaveFrequency * .5 + .1 * sin(-.1 - uTimestamp * 0.25 * uWaveSpeed) + modifiedUv3.y * 5.) + uWaveTraslate * 1.1 * -uTimestamp; float intensity1 = mix(0., 1., wave); float intensity2 = mix(0., 1., wave2); float intensity3 = mix(0., 1., wave3); float intensity = mix(0., 1., 0.5 + 0.5 * sin(.8 * (sin(intensity1 * 3.5) * .6 + .5 * pow2(sin(intensity1 * 4.5) * .5 + .5) + -6.5 * sin(intensity2 * 1.7) * -.2 * (sin(intensity3 * 5.8) * 1.4)) + pow3(sin(intensity3 * 4.8) * 1.1) * 0.2)); vec3 color = texture2D(uGradientmapTexture, vec2(0., (1. - pow2(intensity))) * .98 + vec2(.01)).rgb; return vec4(color, 1.0); } float plot(vec2 uv, float pct) { return smoothstep(pct - 0.005, pct, uv.y) - smoothstep(pct, pct + 0.005, uv.y); } float smooth_blob_scaled(float x, float progress, float heightScale) { float amt1 = smoothstep(0.0, 1.0, 1. - x); float amt2 = sqrt(1.0 - pow(x, 2.0)); return heightScale * mix(amt1, amt2, 1. - x * x) * 0.9 + heightScale * amt1 * 0.1; } float derivative(float x, float progress, float heightScale) { float eps = 1e-4; return (smooth_blob_scaled(x + eps, progress + eps, heightScale) - smooth_blob_scaled(x - eps, progress - eps, heightScale)) / (2.0 * eps); } float compute_ball_intersection(float x, float heightScale, float radius) { if (x > radius || x < 0.) { return 0.; } float nx = x / (1. - radius / 2.); float progress = nx; float slope = derivative(nx, progress, heightScale); vec2 normal = normalize(vec2(-slope, 1.0)); vec2 point = vec2(x, smooth_blob_scaled(x / radius, x / radius, heightScale) * (1. - radius / 2.)); float m = normal.y / normal.x; float b = point.y - m * point.x; float intersectionX = -b / m; return (intersectionX - x); } vec2 apply_mouse(vec2 uv) { vec2 ptr = (uParallax) * vec2(1., -1.) + vec2(.5); vec2 newUv = scaleV2(uv, vec2(1. - pow(length(uv - ptr) * .2, 2.) * 1.1)); return newUv; } vec2 compute_ball_displacement(vec2 uv, vec2 center, float radius, float heightScale, out float tintAmt, out float borderAmt, out bool isInside) { center = apply_parallax(center, vec2(.1, -.1)); vec2 polar = cartesian_to_polar(uv * vec2(1., 1./uAspect), center * vec2(1., 1./uAspect)); float deltaX = compute_ball_intersection(polar.x, heightScale, radius * 1.2); tintAmt = 1. - polar.x / radius; isInside = polar.x < radius; polar.x += deltaX; if (!isInside) { polar.x += compute_ball_intersection(polar.x, heightScale + .1, radius * 1.1); } vec2 newUv = polar_to_cartesian(polar, center * vec2(1., 1./uAspect)) / vec2(1., 1./uAspect); vec2 borderUv = (uv - center) * vec2(1., 1./uAspect); float borderWidth = 2.5 / uScreenSize.x; borderAmt = 1.0 - smoothstep(0.0, borderWidth, abs(radius + borderWidth * .1 - sqrt(dot(borderUv, borderUv)))); borderAmt = pow2(borderAmt); return newUv; } void main() { vec2 scale = (vec2(1., 1.2) - (sin(uTimestamp * .5) + 1.) * .2) * rotate2d(.15) * .6; bool isInsideGlassBall = false; float tintAmt = 0.; float borderAmt = 0.; vec2 bgUv = vUv; float radius = 420./uScreenSize.x; vec2 waveScale = vec2(1.); if (uAspect < 1.) { radius = 250./uScreenSize.x; } if (uAspect < 1.) { waveScale = vec2(.3); } else if (uAspect < 1.4) { waveScale = vec2(.5); } radius = min(.4, radius); if (uBallEnabled) { bgUv = compute_ball_displacement(vUv, vec2(0.5), radius, .5, tintAmt, borderAmt, isInsideGlassBall); } gl_FragColor = process_waves(bgUv * waveScale, scale); if (borderAmt > 0.) { gl_FragColor = mix(gl_FragColor, vec4(borderColor, 1.), borderAmt * .05); } gl_FragColor = blend_dot_pattern(bgUv, gl_FragColor, vec2(0.), .7); }`,PU=`varying vec3 vNormal; varying vec2 vUv; void main() { vNormal = normal; vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`;const Cv=.02;class DU{constructor(e,t){te(this,"geometry",new po(2,2));te(this,"group",new Ga);te(this,"isMobile");te(this,"uniforms");te(this,"material");te(this,"mesh");te(this,"parallaxX");te(this,"parallaxY");te(this,"clock",new hp);this.size=e,this.config=t,this.isMobile=t.isMobile,this.uniforms=this.initializeUniforms(),this.parallaxX=new Rv(0,Cv,{autoTick:!1}),this.parallaxY=new Rv(0,Cv,{autoTick:!1}),this.material=new Nr({uniforms:this.uniforms,vertexShader:PU,fragmentShader:CU}),this.mesh=new ki(this.geometry,this.material),this.group.add(this.mesh)}get pixelRatio(){return Math.max(2,devicePixelRatio)}setSize(e){this.size=e,this.onResize()}onResize(){const{size:e}=this;this.uniforms.uScreenSize.value=[e.width,e.height],this.uniforms.uAspect.value=e.height>0?e.width/e.height:1,this.uniforms.uPixelRatio.value=this.pixelRatio}setIsMobile(e){this.isMobile=e}setMousePosition(e){this.parallaxX.to((e.x-this.size.width*.5)/this.size.width),this.parallaxY.to((e.y-this.size.height*.5)/this.size.height),this.uniforms.uPointer.value[0]=e.x/this.size.width,this.uniforms.uPointer.value[1]=1-e.y/this.size.height}setMouseActive(e){}setTouchPosition(e){}setTouchActive(e){}onRender(){this.parallaxX.tick(),this.parallaxY.tick(),this.uniforms.uTimestamp.value+=this.clock.getDelta(),this.uniforms.uParallax.value[0]=this.parallaxX.value,this.uniforms.uParallax.value[1]=this.parallaxY.value}destroy(){this.geometry.dispose()}initializeUniforms(){const{noiseTexture:e,gradientmapTexture:t}=this.config,{size:n}=this;return{uNoiseSize:{value:Od(e)},uNoiseTexture:{value:e},uGradientmapSize:{value:Od(t)},uGradientmapTexture:{value:t},uScreenSize:{value:[n.width,n.height]},uPixelRatio:{value:this.pixelRatio},uBallEnabled:{value:this.config.ballEnabled},uAspect:{value:n.height>0?n.width/n.height:1},uTimestamp:{value:0},uParallax:{value:[0,0]},uPointer:{value:[0,0]}}}}class LU extends wU{constructor(t,n){super(t,n);te(this,"geometry",new po(2,2));te(this,"materials",[]);te(this,"group");te(this,"_isMobile",!1);te(this,"waves");te(this,"renderToScreen",!0);te(this,"_active",0);te(this,"visibleActive",null);this.waves=new DU(t,n);const{isMobile:r}=n;this.isMobile=r;const a=new Ga;a.position.set(0,0,0),this.group=a,this.scene.add(a),a.add(this.waves.group),this.camera.matrixAutoUpdate=!1,this.init=this.init.bind(this)}get fbpOptions(){return{...super.fbpOptions,depthBuffer:!0,stencilBuffer:!1}}async init(){await RU(),this.scene.updateWorldMatrix(!0,!0)}setMousePosition(t){this.waves.setMousePosition(t)}setMouseActive(t){this.waves.setMouseActive(t)}setTouchPosition(t){this.waves.setTouchPosition(t)}setTouchActive(t){this.waves.setTouchActive(t)}get pixelRatio(){return Math.max(2,devicePixelRatio)}get isMobile(){return this._isMobile}setTimestamp(t){this.timestamp=t}set isMobile(t){var n;this._isMobile=t,(n=this.waves)==null||n.setIsMobile(t)}initializeCamera(){return new gu(-1,1,1,-1,0,1)}doRender(t){this.waves.onRender(),this.renderToScreen?(t.setRenderTarget(null),t.render(this.scene,this.camera)):(this.renderToBuffer(t),t.render(this.scene,this.camera))}initializeUniforms(){const{noiseTexture:t}=this.config;return{...this.initializeBaseUniforms(),uNoiseSize:{value:Od(t)},uNoiseTexture:{value:t},uScreenSize:{value:[this.size.width,this.size.height]}}}resize(t){this.size=t,this.out.setSize(t.width*this.pixelRatio,t.height*this.pixelRatio),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.camera.updateProjectionMatrix(),this.uniforms.uScreenSize.value=[t.width,t.height],this.uniforms.uResolution.value=[t.width*this.pixelRatio,t.height*this.pixelRatio],this.uniforms.uAspect.value=t.height>0?t.width/t.height:1,this.waves.setSize(t),this.scene.updateMatrix(),this.scene.updateMatrixWorld(),this.onResize()}destroy(){super.destroy(),this.geometry.dispose(),this.materials.forEach(t=>t.dispose())}}class IU extends EU{constructor(){super(...arguments);te(this,"autoStart",!1);te(this,"activeSlide",0);te(this,"currentTexture");te(this,"nextTexture");te(this,"slideTextures",[]);te(this,"uniforms");te(this,"geometry");te(this,"material");te(this,"active");te(this,"hovered",null);te(this,"clicked",null);te(this,"_mouseActive",!1);te(this,"_touchActive",!1);te(this,"passes",[]);te(this,"renderPass");te(this,"isWebgl2Supported",bU());te(this,"isMobile",!1);te(this,"isMenuOpen",!1);te(this,"stats");te(this,"timestampClock",new hp);te(this,"timestamp",0)}get mouseActive(){return this._mouseActive}get touchActive(){return this._touchActive}get pixelRatio(){return Math.max(2,devicePixelRatio)}initCamera(){return new gu(-1,1,1,-1,0,1)}detachTicker(){super.detachTicker()}updateTimestamp(){var t;this.timestamp+=this.timestampClock.getDelta(),(t=this.passes)==null||t.forEach(n=>n.timestamp=this.timestamp)}async initScene(){var t,n;this.render=this.render.bind(this),await super.initScene(),this.isMobile=this.config.isMobile(),this.initStats(),await this.initMultipass(),this.updateAspect(),this.updateTextureUniforms(),(n=(t=this.config).onReady)==null||n.call(t,this)}initStats(){}async initMultipass(){const{isMobile:t}=this,{ballEnabled:n}=this.config,r=await wv(this.config.noise),a=await wv(this.config.gradientmap),l=new LU(this.size,{noiseTexture:r,gradientmapTexture:a,isMobile:t,ballEnabled:n,autoInit:!1});this.passes=[l],this.renderPass=l,this.renderPass.renderToScreen=!0,await l.init()}onResize(){super.onResize(),this.isMobile=this.config.isMobile(),this.updateAspect(),this.updateTextureUniforms(),this.passes.forEach(t=>t.resize(this.size)),this.renderPass&&(this.renderPass.isMobile=this.isMobile),this.render()}beforeRender(){}render(t=!1){var n,r,a,l;(n=this.stats)==null||n.begin(),this.beforeRender(),this.updateTimestamp(),(r=this.renderPass)==null||r.setTimestamp(this.timestamp),t||(a=this.renderPass)==null||a.render(this.renderer),(l=this.stats)==null||l.end()}setMousePosition(t){var n;(n=this.renderPass)==null||n.setMousePosition(t)}setMouseActive(t){var n;this._mouseActive=t,(n=this.renderPass)==null||n.setMouseActive(t)}setTouchPosition(t){var n;(n=this.renderPass)==null||n.setTouchPosition(t)}setTouchActive(t){var n;this._touchActive=t,(n=this.renderPass)==null||n.setTouchActive(t)}destroy(){var t,n;super.destroy(),(t=this.geometry)==null||t.dispose(),(n=this.material)==null||n.dispose(),this.passes.forEach(r=>r.destroy())}updateTextureUniforms(){this.uniforms}updateAspect(){if(!this.uniforms)return;const{width:t,height:n}=this.size;this.uniforms.uAspect.value=n>0?t/n:1,this.uniforms.uViewportSize.value=[t,n]}}function ul(i){const e=dl(i);return(e==null?void 0:e.element)??e}function UU(i,e,t={}){let n;const r=or(()=>{const u=dl(i);return Array.isArray(u)?u.map(h=>ul(h)):[ul(u)]}),a=ds(r,u=>{l(),n=new ResizeObserver(e),u.forEach(h=>h&&n.observe(h,t))},{immediate:!0,flush:"post"});function l(){n==null||n.disconnect(),n=void 0}function c(){l(),a()}return uo(c),c}function NU(i){const e=or(()=>ul(i)),t=ci(0),n=ci(0),r=UU(e,c=>{t.value=c[0].borderBoxSize[0].inlineSize,n.value=c[0].borderBoxSize[0].blockSize}),a=ds(e,c=>{const u=c==null?void 0:c.getBoundingClientRect();t.value=(u==null?void 0:u.width)??0,n.value=(u==null?void 0:u.height)??0},{immediate:!0});function l(){r(),a()}return uo(l),{width:t,height:n,stop:l}}function OU(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}function Bc(...i){let e,t,n,r;if(typeof i[0]=="string"||Array.isArray(i[0])?([t,n,r]=i,e=window):[e,t,n,r]=i,!e)return()=>{};Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},c=(d,p,m,_)=>(d.addEventListener(p,m,_),()=>d.removeEventListener(p,m,_)),u=ds(()=>[ul(e),dl(r)],([d,p])=>{if(l(),!d)return;const m=OU(p)?{...p}:p;a.push(...t.flatMap(_=>n.map(M=>c(d,_,M,m))))},{immediate:!0,flush:"post"}),h=()=>{u(),l()};return uo(h),h}const $c=new Map,Pv=()=>{};function FU(i,e,t={}){let n=Pv;const{root:r=null,rootMargin:a="0px 0px 0px 0px",threshold:l=0}=t;$c.has(r)||$c.set(r,new Map);const c=$c.get(r),u=BU(a,l);c.has(u)||c.set(u,new zU(u,{root:r,rootMargin:a,threshold:l}));const h=c.get(u),d=or(()=>{const _=dl(i);return Array.isArray(_)?_:(Array.isArray(_)?_:[_]).filter(XA)}),p=ds(d,_=>{n(),_.forEach(M=>{h.observe(M,e)}),n=()=>{_.forEach(M=>{h.unobserve(M)}),n=Pv}},{immediate:!0,flush:"post"}),m=()=>{n(),p()};return uo(m),m}function BU(i,e){const t=Array.isArray(e)?e.join(","):`${e}`;return`${i}|${t}`}class zU{constructor(e,t){te(this,"callbacks",new Map);te(this,"observer");this.key=e,this.options=t,this.observer=new IntersectionObserver(n=>{for(const r of n)this.callbacks.has(r.target)&&this.callbacks.get(r.target)(r)},t)}observe(e,t){this.callbacks.has(e)||(this.observer.observe(e),this.callbacks.set(e,t))}unobserve(e){this.observer.unobserve(e),this.callbacks.delete(e),this.tryToDestroy()}tryToDestroy(){var e;this.callbacks.size>0||(this.observer.disconnect(),(e=$c.get(this.options.root))==null||e.delete(this.key))}}const HU={threshold:.5,directional:!0,once:!1,rootMargin:"0px"};function Th(i,e){const{directional:t,threshold:n,rootMargin:r}=e;if(!t)return!1;const a=ul(i);if(!a)return!1;const l=a.getBoundingClientRect(),c=GU(r),u={top:-c.top,bottom:window.innerHeight+c.bottom,left:-c.left,right:window.innerWidth+c.right},h=Math.min(l.bottom,u.bottom)-Math.max(l.top,u.top),d=Math.min(l.right,u.right)-Math.max(l.left,u.left),p=l.width*l.height;return Math.max(0,h)*Math.max(0,d)/p>=n}function GU(i){const[e,t=e,n=e,r=t]=i.split(/\s+/).map(a=>parseInt(a.replace("px",""),10)||0);return{top:e,right:t,bottom:n,left:r}}function kU(i,e={}){const t={...HU,...e},n=ci(Th(i,t)),r=ci(0);qi(i)&&ds(i,l=>{n.value=Th(l,t),n.value&&(r.value=0)},{flush:"pre"});const a=FU(i,({isIntersecting:l,intersectionRatio:c,boundingClientRect:u})=>{l&&c>Math.min(.1,t.threshold)?(n.value=!0,r.value=u.top/window.innerHeight,t.once&&a()):!l&&c<=0&&(!t.directional||(u==null?void 0:u.top)>0)&&(n.value=!1)},{threshold:[0,t.threshold,1],rootMargin:t.rootMargin});return uo(a),{isInViewport:or(()=>n.value),update:()=>{n.value=Th(i,t),n.value&&(r.value=0)},stop:a}}function VU(i){const e=ci(!1);let t;const n=or(()=>dl(i));function r(u){e.value=u.matches}const a=ds(n,u=>{l(),t=window.matchMedia(u),t.addEventListener("change",r)});function l(){t==null||t.removeEventListener("change",r),t=void 0}function c(){a(),l()}return uo(c),{matches:e,stop:c}}const WU={page:i=>[i.pageX,i.pageY],client:i=>[i.clientX,i.clientY],screen:i=>[i.screenX,i.screenY],movement:i=>i instanceof Touch?null:[i.movementX,i.movementY]};function XU(i={}){const{type:e="page",touch:t=!0,resetOnTouchEnds:n=!1,initialValue:r={x:0,y:0},target:a=window,scroll:l=!0}=i;let c=null;const u=ci(r.x),h=ci(r.y),d=ci(null),p=typeof e=="function"?e:WU[e],m=x=>{const v=p(x);c=x,v&&([u.value,h.value]=v,d.value="mouse")},_=x=>{if(x.touches.length>0){const v=p(x.touches[0]);v&&([u.value,h.value]=v,d.value="touch")}},M=()=>{if(!c||!window)return;const x=p(c);c instanceof MouseEvent&&x&&(u.value=x[0]+window.scrollX,h.value=x[1]+window.scrollY)},S=()=>{u.value=r.x,h.value=r.y};if(a){const x={passive:!0};Bc(a,["mousemove","dragover"],m,x),t&&e!=="movement"&&(Bc(a,["touchstart","touchmove"],_,x),n&&Bc(a,"touchend",S,x)),l&&e==="page"&&Bc(window,"scroll",M,{passive:!0})}return{x:u,y:h,sourceType:d}}const qU="data:image/webp;base64,UklGRgQEAABXRUJQVlA4IPgDAAAQFwCdASoKAKEEAAAAJaWqf+FVvusPT+ruknJzo8wL+mXWx/Jt6fnwikaEGsufjoZ/88P/B1be15mW8Bjf9l1nR/8Oz/COJNVtCJMFk0SWI7WgnsvgC0Y+ZI9d6ct5PoVj5fhDxkA8tenxCQhdUuq2C/vDVwR6bEskfbsWE8+hKVdhm9L+iPlNgvZfXtOVYNI+1/iu3mI6AcfKBPbiVoapg09pLYxgXOA5qcsVMJalzhqD2ZoDhjpgFWMU5nMw689wAP7++EVKXH/yz/6BRr13XbmMm4JlWRHkjEmh7bTzWA0gq7XK9f8W/NNozy6l5NK9jz1LsZI+B80JQmlzbFpYw0zeMRYQ5ai9sxo0bFRmxaTEbW7X+f01m9UD1m61bZz9UaBy1STmWObRiydLsHALlwebA23vFTklFHOyZK16nv+5l8EQMdOaIH6E4CUkBCRGKj2yq/j8Eyr7fbQKoY7/goFrSevLtENuYmPAeR3Li6zCiSt6fQ+pbI6DhnOIPicRgfuWvhgs4MNnHeUYUdSnHuZS9ucNNWGgzPQYUaT98eQpwgALrqeZwzpXpWdEDvq1nVHLkS32w9Rm1kVgshaDxJwjUQVZM7eaSCZevIjvZr7Bv5ssEnw16UwEHtr4gsG2xbVxAlnRbqG9c6vtqgG0rVgJzuxfFwmzZ9xPF74DIZcjYwbQyQ2WaQVV8cYCZkgB5e1p3+Ibhin8/jiTnONn6wYm3LpYC/M/p7Zs9UNEWBWK49+09wtqVfvf2Ct+bofBduOjvoHgR1qGG2oUCtGBRPWjvUbFUBGYJX00XUEy+4n57karfibhHdBluMM5F7V1CyU0q9n9DC5LC4I147qnmFMMB12yBBssGAJOj9j4Sp1ztARCehIPEle2KsDoCSfh2+nKdod8xgv6PtKEoY7KxpHaBXLViZMEhC5IAVInZvYioD6k2j8ZRrHkOwVvxumguPytCMlt8SxhxiNcYTXM1ZbCesbRviC2Dyqdof1xMfd14pqJQpL6LYFBnhVUFbxY4iOMj9OV9Xm2tsJFehhhLP5pBCZ/H8JEJcqSs3gDnHLGT5tm0mO5oH6TAkgIQfZcpsfauatzvocrABqwKfxdExgElk7cwqK+6JL7ArZR4ESCjEJ4PHmgSVuJrE//PSdJ2N7KyeOKG253TOIfO9bp4IG8KzJ7ElNfQbQx8GgRgmSFJReykGjCoywHEQLm+4UZtWvlvdP/PX/+dpisZeBz4WYl4furGnVICzuziuvDg8kP/bx1/W3mHutDLEdrn0lGj/bzHbi5DnqDaEXuk/7IgheGkO/wyrpcASgJgejrLWaOqYkx/CnDeAYKnNtBmfQE0DEpsAAAAA==",YU="_heroBackground_1di6i_1",KU="_canvas_1di6i_11",Dv={heroBackground:YU,canvas:KU},ZU="data:image/webp;base64,UklGRmwoAABXRUJQVlA4IGAoAAAw8QGdASoAAgACAQAAJaWbpmSX//uzzwzoN+PlVURCr/zxtaL5cshTC265EqJwkXvWSNQPrN2gPAGLQdxYgB4I/NLmMeh9+i/7Hoafq31D50Opmx/v/Z7Svh38t/9v+n56/jXv//6Prr//+L/4r//9Kf51/3sx3/954/gP/97D0n+//i/t/2DgV5kzl7HjpNvNiLBN4AtivONgNRQsq5VUv0cNTAUXIT6lCTQr4Z0nGNEtH1rhJhBy6Ba18IoJvmIGU58cZ3b6m4VH+w3tmvwHhwRdgGFz6M5x/l//nTo1Nd2p6G4sD9kThbW0Jclc9dnnfYvdO5m7jbM+SZzbdUM9s3Kb+x9I9Ghojp62Lq9kfBItXtoTqhpI6DsqpKNWpfav8NzY+X9B714+H16N7SjOsFOgS0xp83uIjKGQaHIuq+9KWvWPWRMra1JP8gOE3/7rdbwgDDLg8OzV0ikB9usANjFdNOGRim9TBFGCTLj/JIZTP5D9jTGd91/jQEPPkeFAqjW5piQ2PUAlLX0ilgdXEL6RK1MLvqh0hBmRgPUm5AgVcgDLX6mpHI5BZQ+NbMoS2ZvVAogoFLZITCjWSJQd3kGhCmNFwd3JauT1dcGkKcgH4S54d1YJPtEDKXBZ1vJNM3pIHQpMga7ram8XL+hEvU/eUtpPEmPV1MzKOx0NdhbTjVTLhF49caVuPazgzy9ET12zj77KnAOkklj1nl3X3H6shzWg79nKpt/w5ae6naYjz6NlvamaAyTOIzxD4X2H+GlGJ6ajObhmZ5kiEvPmAlspNlRdoPdwZRVASY4V/Sbjga6myyelSI7PmWTFLPI1XgiYpwT3r9xdxABLZZXL95ONVwCiJ9sMVvuXdtlchhIM1qHHr7hnyrNBm1mwdZZ0hza3mVXWuZv66ui5kDu/Tr761404wC2nr49Cur2mbj012TxfgK01QiojuiTRnbzRch5Se+cPxEZv5kc8LwEhucGnaor393kwY/6DJXiHdq1y5t9vCDHrVrlIVOkwHtM50hFTgbUeSdYchEfaQmvbK7FLXLryMEUE4HLuQA/8QT4DA2iOZZjITBbM7sJvEc0V5K/wvVf/uD9z15wvszmLjZm6pz+xH8ormI40uy5ipJB8FEOAbu/M7/D3hQ0FYu/2Bumlx/Br4+rJIt6Z/NZFyi5pcoo5f/0jFkatq9u48HUzaPX9KgW9qvv7YHiIzTqT4/InQYpM5vGo87PZnyyz/fwZYE8a/x/YDBNL3uPgXVys+/R8nIlU8ar+NvNj1SFLg4pg7mv6vY6TvfoY/Pt3nYxSr30XY3atOW5I/IaatW8SyJwSG0BEv7hkttEv3od3/4lmvimTpDZNPWfr1nJxQVDQIorIk66sgShC4tFHCbSEbisxdnFYpSG5DpfiOgO6HzQHZvKVYwmSJJBQlT/oO15xXGasUJbRXC2UD4KPcYmC1t2O8evSrk1omNRu1IgWUTEnDakAfR7Y8e8jwSnMhpz+n7kS8Cc6JrndVjn5mjVftOh7yOJEJu8J4t7N8QBNj0fFP6r/boVuaPKmZBc013hARDxFljSKXE2eMoVRjIkG5iuDuvot+FfM3zhgnSMa9G2INlCG0XjQ5/lxXL45v+G91Sj1UCFdOF3iJ5lHmk+2oWj22E8EQO3sM0yBljMLxKDXnQhwQKsQTueYrEqFNB+6SJeK5a45kG4DhyxynBlJyfsS08I334rF0BjaidKJT8tLSbvaPNtikmeMHm2Fk/KjgfgIZI8ugI+8xQo6P/E58aeiWaLfjh3E5jEE6O5KKFy3XycvFsShDxPB18sRosQYE9kGH+Bhf8xirkUXXVMYPlcLjgBnskq4piw+yCmuFPe43xmOsvbfNNhTUfAteNIiJwfuRv0qaIJzZBB209xkuoamFvYiGycjDW6E40ltl9S5WTD91WyEZh/9If61h/opWecCW1zI6YQWNiYOmkI8jihJl/h8MeJL58/JGXCOfJuvsBWJkJiSOpaInWDz8TT4TCQJXoeKkT7sCcEdV6DlB0zWh78xmlkDyhLiMmUl2Lyi794OS/Xr+wDS1agcs6TM0NjG/76ljBhIM2SF2iVWtCqzpgKoWycvaiUTvgs4BQQDSK1885FVe1jSVmKe+1QrbA/i3wpZYTtLDZuwuk104bwPZ0bb5ySx2/qhyLXpXx9P/PLhH1EnhpDX2F8iYXDndgWJPWF1yrwVhNwPWtjd3Utu+y2zJLILStoQEuZxEL4Tt+f2Mjj6yO2lHxypLbfpjZas552jNrHH4N9d1aRL6HShMiIY4c2Uc5z8qDX1fD4gE1KiIyYMOehLo4XTdpfSFwD9vHmb7qX30NldkDZ55v0zfO2dItQJNTI+g6MLFL8JdQv476oLZ/Kus0AfbiyuRYiBE4GBOe6iqnM/NasdzxudHFlShFfh1suSdUM0fEgV3eVK4pKz4oPiJpHdB3CKETABOto4Y/GB8w4+Uhjv87VrHvMolZcFQnxKyVw1dYJHCOzDUI8ZOFQhF7erGpuk1HLw87wImjCfcAw2qZky1hTVvf6lAlk5OMIt1a6q7qLHLtjCfPed5pxE/4UCfFGMkzv5xLVSv8XDgGYxkXgKGGkCimSUAaxn0GC0jL6FSC+jHW9Z+16/Z3iHsA55cb1b92VRCoDiQzkibfO+096i5ATgv4PGrv5yuy+SnhG/BvLf5vOS+pardaWb/NTDi+PXEJa8eKoKmqEWGB6pA+Gk/41C4iMWTrpN6MO0AkzmCww4w47f2ANgb9ZGLSbv6j/fh8sajyDR9WJEkNHM0I8DPivUR6XUyjee6GZ9NXHGfq5jsBDf5h8GG+6Fom1cBKI7LxX+tzo8ichdfq5ZbA8k2l2930X4s1P1+u9o5SNTFnwxsWRoidkOtulhsxQoz2g+gZfJA61Dduo7ID7d3hujidmq8DvJcLs8iPYcB+6r8NoEC+Pc286GDgKQxV8g/uyPQeqdqLtfiWIg5XFUlx7Jxyoe4LgsYW/pfqu0raNpyh5M2SMtvDxKtht9ntqfO5rwSyhhURMR2LjMInjkT/szjgJZvW8cB25BQtuoxIowXQmgttnhYL93DooU0TLlfn8Yawz1y9Nib05llVMAk5lJnL8c11KF+Aobs+fM0vDEFYpjws2cq/+51OqDlCRe8zO3EbTbBahXQ/L+oxhhpuWhHQ36gRDNpfFKA90Lt+Lkx9gDEiqMPd7yC9sKosX9hTsU6TilaLNEtDX3fQd4xYzoppvufhq12oz4VNss9OVZUskpvUB6WwFHskBWn8W20Cn9M+0JmJQRadhAGrZt1xNMpL682TfD8cKjfE32of59OixdVxceZNY0D8AEHbUUa6bN46XrnSZb098PBVe4WkIDRXDHJaJILemO129gyrfINyk7f87l33k022gKcUK7bv3i8W4J8sVG735PnmfyS1KMDRn3HRexpXpYBwyEwpUCsZLc94FTvrfYJoLUBH4wnMI0OOB/IcBGtTky/NvNjItidFwfWmD9uob7xInyRvALVP4Qbq3D8jYiZCnsGa7l8BV1mSGq/TypFTGf88EZNodOGSVz8OoflWOB3DgnkCT28yekPRyvQDwKLczeMRj9pYfT1kBCET5RPp6WDoWtWiU7d+oG+fWfs0yKA3nWkyfUYQRwYSLRsjYO0cMOXQNMvqB9hWT6yhJszEKeSCsQ0d5NaB5QrvNCiWl6yJD+kai2KhzL8oIlTXc7q+KO3YidpYMlFkD4R76zrBJuVeV26vUIfXcD/5t8IVMkJ+T7URwXm0uo2BAHSKb9FandFX513I2i2TZytFkvLj+uMQUwnM3JVhEgEcRlwRl66RN9DK4TcUQF2DS0nForJeqgskLvXzV7HcSTOpB1g9c4y/kQfgYZMbOLRVcuUvOOnkG8U8c8BNNgtBqiD857QCR3dma+XZAdzZqjncqpAI0J7YULwQcK2Pv2qd+/tqB9F4yRo6rqKkFx+uea8Uv6luBoonG3A39oUf5sDGyhT7wS//4M1uSkoYu7MqQRqic7OknaZ3fXyBmAuDQ0KFkK1KRm92+aOol4iA0iQqfay9DF8+65KsSaId3G38EKKzE6k5VDqgqTxa1lZngj4mW7/5JcltwJB44AAuhg4TRhfklugKJK9b5luZM8zoYbWJnjcwl93w9PmEEv3MaVsexPZOzgNL+IY2goMg8wUpoQv1/zJHf5tACsBChy3AADbm/0f7YbsyCFSNtn4c1pqoxSmnaeTl8NT0M39E9ajiHaS2TdxZh2LZxDS3erhx1NOR+oXXmgWyHqqGRoW7CzbLgxTr8uY6492Gg1JZLfXiH5GU8CcsnOuZEiwqfmHqICL/rhfVgdEbrwCcPiw/gqvdsQ0ec5ToTS7CCLD6xdhc/20KkehORCUfDwxyT4xqLdylxW9IS0rfWRx7VNZ8PpZ+djhehSasLI4jg7jSZNFzNBJ+A3/EHoxyrAVh8fJg+SIaCsQpLrEEl9QShQxAKjgXGIoLoGpcZKt9Zp1oHEM1Ij2ZErZBH5dBu3a6RtW4T/3Qsl+cdIf99x8cqP73nrKP5qNOiRSyAfNFd8c1ikaqkMG9R5hYYVIo9/e+SmE1OnOGqxCVAdvQ7xSlVh1YXEQLAWyrEq7iFslHERS7kHXLKJyQcbXE7q+h4Sh1Km32iRiONrvCtWmXldzXQgodZH6peYDW7JCjgbKOlbWg5rU6GtZSjv0Yys3j0xTsq5zGgLrCtvAaF6Y/0waenygo1mP/NRFQeU+rUw3n/sP+yPghwN2KljfsJb1fjVkV7wWEXh6Dwapxxj5hfS2DhMzQwdTwI9GGG18t78SiSYhVLwBBjumRam+85l4ZNwTF1JB3ZU87erJMjuOiGObZkiqy3RNziS6s09OAs5b9v2FU9rPthU27KMebcAAQIsapp6Tbprs0E1UWfB4aR1v9NpIEjiC1348km/o4grfEnS5BCyLNPldihHzzbXTGXPIgPfPrQU/IrwJs91WKQZbkaFvuOtj6mdLx3UlHhjTGfPiTKZWD9AvIK6XBJobS1xC0ZKH8ysSvQud/mwHwyspIiGzY2qetbEZzuhi0a5rCq5YtOEdpP7OgNHGj06qQqyBt6Rdj/AZj3gWDWGK5J6gsue1AEA19P9widLB0rzxmNEuR/lJs2XVJA5BzPbKZ4EEPyra6Zd+2k6hXm5KnfQrz23hEaqn5vqoS1+IzoEeIdGOuU2CMYF8MJain7E5rtgDzsJW+EEmA6y5dS3L2NGf4G1zRRwZM9exdvOMNsT6ufjbJ+Pc3FVbugIxdjybkt5F6fpKemxYVBkdzOX/qiFAAD+//+Z1pjM/eU3IuncG+l+pm2+8vIIItAyGYdGnzpwjKkEMwjPcCVzQBKKotAkzn9+iZnEgtD5HepKWySWUO+QqEQWEI0c52exybISNwtcPqX8nn8YzfQ2co7v+8Mef+jp8RdRYP6WiwxfGnPZSSGwe82UKduYUuCDDwg0Faw+JFbnzMTiF1/490jTqEjI4xTaXcHdRZQUwymh56JUcjKF9MD6xH8+NvC33E+b9Ulw19smeYvyh3UCZ1j8doOrmAy+Mz3jHUqRw692xeudsbKzGhOSPqG6Wk/q1zsT8IlHYkYxXVgT3DNkEeBvpowmZZAqH6qWl5hxnCCnl1Ia/dGQL0n0TIysTKq6n2jVTgJucfwzcADYjhILVl4y/RrFRW8Gy6jfZ0RgNtcykashBAUvUGmmPNT+xQOr6pmMWo9quBJBAKBSZfXUqu2AXq0WdI7BtTTLu+HyNDqYQMxbQEw0VarsLx1cgmmupsTnn0HaPhK4RsC1hSZiWJYAAl6tvJxu5yuhRQZj1lutcI41eRQb0GvDUUOxYBXMroQK8RHRY5oRl4kSBG/iY7R3bY554HC15FMSX1RI0jbKddtM/OgJ2Z0GPUDFhWyMxa1k1aUMRpgF44n0rqOq2YDkfOpHbcTHi48PUzGebqoUHgdm2mNr/QSFMvtKW3Bn+MAfVubZk7ePM04ih5RXK9OGbQQ9iiI48GUwMQlQWbnyoUMAJTAe8B+hm11/9iGEACJpOS1WU3Hd/Kfa2nbzJVowf1F53QwPTmJ9WnI+gDMO4vysSkiJ1J3vJiA+mpHwQasc+3xJi//BUSictXESUTgEyMJY4cLO3yqWTVMSZAsL201+JhzgSPB5hwyPXYhiE2BArH/+Nu2/9grqnYao5PlcC67krFAlox6uZUebfbUvHzmi1/1cW8usz0r1qr+1MsMN+PyRo1U4kXkvrdR7jXS0od+XdH4BCqK1tV1NkV7jTzfYPOsHyFyq3YusXxmzPdkztbdXKSnjnhIMxrTo+6SsAB+eNKXhqYmUcR+DbCh0y51A6NlZXyoMEdHE+ueL6ZxLnC6x0uWPTEClqjm6WBYSw9UHgF/L4JhB8iOliPKZIahBdLym4Oiq/oedfzkSAW9B9lajn/Qb8KfHwyqLe7jsLYgkholNos28IW0Um50RhUacI+wh8dUmOMYePLOjy4SmdciOZNqhTXJg1Z4L0gwsFWuRLgoT51LYPlkcvHUSGEn4zpLxm76so3zJvp6KNXucRylzvCYFxUGwWlrOMSdWEocTZUAa5bjvYQKkMmJu+oWuq4s6HGU6V4y/72bv3t/coKrdfHIJ+8YNmMKZ4GbOtnwJvMVk4eVy9J3LboKrwDFYYYtAJB8vPRd8IT5wNYXB7iiFoiNXeqPDIm27MZBaRrHJUCuXfMCfOEUo6iOLvBYoAPttIQegWbvTuIVzlC5BZsv4S5rRz3t2bvbWqzCJXEgAOcIQP8950TAWXncQsLYMbSGKrhIIGlbozQl7cOSCC7r2uWZkChgh1enD3VCgiN5kBYxKwu1STSTh/UIAMK3dui7GQXyuCnuCJtFbifXMoScY0vkbALs57mpjuroOLKCGh7DTVmk4rx4U+NgLgaarMGE6X4xEx3JYik2qgOfS20CF2Gd6cnMKF5i/mtf4VgGqqdoIzwmZyzPBnpEDhVJygkJhBK4p+JA5rawI6j9GJy8xY+Spo0uyyXCcD3lOg3A6bWnbac2EcpiIggzpt+++SWxKxpXuo0eo4PcNzXPbQUL5O9zB4rkIZxZLnboH6hkWGjtLXOwR76diFvLlpQ/L+PNdaD4Y0TXjG7HT5wxSLjnE5pD7WJgBOS1jsUizCeS/3w++XCGIFA4bIhrCH9RtqPYUHIUAmDIpLSbESlhyJfW7wnhtzfLLUwia+otfL/Ri2QJ4EqgriefP4txDaRvYj/dvejRtdd+4MAVfL9+aGT27Br24cQnrAmxleHi+dHDk3i1CN0GqOFfgkJTB+z2xoXdD4jBS0ltEyrztX2uFM96R3+J9i6n1yoiYDmauC1Zz3Y/6zZ/NDIQNrEYUqpz3BezEpKIL+5qZhcP3szylrwvFb2a+TiVRqjzyFIIrT7xV3uI6UwqAAAtM37nKySL6ZJWRk+x5pkSYLpFUvBgJ8gxUf6T0XtjPKtd0yPGfkFMHDcN/wvnIuuSasboADPWJ0cUTlXVZOr7GuxRxvbpJTW0cPG6/sGS2Z+LcD0helxwQZB+f7NSWyFJJyeLG1Qysj5nP6nGSrAslyNjkGdsB5ww64MD7VG+qUc8UbydP9YZDx8eUu1/Mx55lVzpZFuEvFYDIQ1xGJPK3AN81jJ2wXKaaAwBaTdg2pfXUgxbvvTF/ZSLbxkJHcwsQ0kjiRknVQ9KQAGaQvZZDnSiTn0oqKS3CYMXP85+WP/xo0U2o00/CeLa/Z1yulrpxVJhLkmng9fbW2I2WiemoYT404LLA7MrrDqq9HcXLn1gpS2xgmVCy0YINpkzrDWOJPXCcSkJ7gZwnjtzOsURpYbTxhblhTYDkzq1tWsSAaImI2CgW5q2aZsEZiCieIu2G8W8xpwX2qiU1ofu/qthpH/abWoLBNQJSPX/f0tzCKj/WYO36WHn89w/RO30qXEC3O0G6vh1mZ2raLfT/FzZsXiJIT2VskTYQ7L2WEtfzYqh1jLX5j7jAixZQ5l4BbHWeAJ7JEDHe9/HFsTz/zFzpH/PqPhbJBrRDcQmkj6zWN9BDTHbjcSvB6deEL20BSYAaz60FH2q3P45fOszD1MqbRx5/pL67uML7n0otDgvBFd6w5vn8wsHx9yYHPCrOzPH6y+JLYknneXxF2MDPduQEBHHsbtXYwWRtf3SXSfLeQgxF9EESWYQdxwvHk146r+MTtYWFbMpCKPW2uIs8YVlsY6m/2ZijpNKwzZHQgwyx4DXfDyi5DSV6DQPQTOc938uEMo0C7OAZEgTPyAOXxCJv9WeZa0/pBRhk5eZDepu6MA2JF0+y3ixNimBIpnwVPLnNqcoe0mbUwHytMvp1jh7uO134+j3WNdMaWqTM9p5eEBH/2fXkgdoRIQSyi9KayiSIqhirnoQ+sFxWNrb5VZf+9LXtRyIXsDOcb5bVL9zlQCdspeFPddbEPkmHc3FIwe1pe3TSnIiW42+qqdCbNMfcOlRyv/vmWDSdCX0z/kRfbbJHaLapjW+HO2U5nT+wNiUWlDZPVhEG48op6BgxKwZ+4Q1PHZPx9E+xpaeARCXphlGI3a5XYBHz55aZpW3MiTCbfO8NdfxuQWicRx2tqJjPzstPG9b63VGlBbhTmJcYvvnreO6mIYqKo+mHIbAaIT0VUJv8LkMrTyMQARtGZ9SJ2q4VmZTXurITKDbxC1f1aquzmYjUAN2spFDbIkXtt9OuSph/BQtAqXvt+qyJUEHDpa0mnlBdYzc6u7SCghmIRrtp5mtpwNBrNZe0G2uyCvDVgiUtEBQtbQwo2YSX+jOJN7B6ujjSsFAH8vKGgvXuNCpl/hmcbmPoZmPiaJi+I7MZGQlT5qCHJ6O7vUeIn07IwEfJ22bKTNz7jiqYOvNf1+/xzYeeGKxop4DoCvaOd2DkrIz1E8USd8KRLIE1MtIrNQTN7WHjBfpAyo2+ZN/Ukkl7nD0XPGTjWdGQ9ag0lrXexv4VdNfr7anRgRuQiKSXkJ2QMtyxkvbRvClhlLObxe5D5rhD2KVGe6H+bu189QzyjHnmRGwuySulUvULXoDNpk27njL+8HcGfBeKucFNfT5oLEKA0Vzc6VM6gFzzMM0xdYGkpGjFMXf18G8b6sHIfvNtAv1dfh8a8KVxI5s2Emla67wyV6WrwWSe7BIFtJnmgwEUpC+irOqDc9SlgYUuVWFV6oMU60lyZ04FbqCD143WOMqY/AIRvralpH6dBZcGYd3EC+gOsqva+sZeUsRpR36U4Im4LveF/VYkRsw2wkD74WhsbWKvYoI+Z2i8eYEOkPdtPRsTg1TzY8xt6eokATOEgwhSD+9HQQpMrGUhHFEG2+PqA6oMim3sLN7YNu64W6FptZROB78v75HIFfhltaD+jkRZwRqroYfE2z3ecnEyRBwZmhjxKkmBlC5qbJhYyNqAe5ltA3PUtP5QBS/GglNkgikiZ9mdiJDsuaULvg0olnDOCVmdStlv0BCPzKvBz6QaQIDIWRxjatJIQfGkp56DuVNTncLS5sc+Ar7kuuhNB+mPswuiXKDFlzbiXYWbL/2SMojL+0fHwYfIMHvH14Nn/QfShrusiugKwD6N7awqUS40/IMKegHLGlHlWdBV4mZ3g2Ka8TJKGYrOtI2x+CprY3ndnKqkIhA3EVb69YKLJB3el41tbiRYg7bPxdnc+WvrI8ggbtgXPdjU77nE27Blrc9MT8csDl2twRyouoVUUdXGrpT7DTyAhyaTdluCH7JBcTrBsTmGUzsqnUC4Xp8mial57OUGzqLg4RUEd3zMKRPwQyob/JjGbpSbB1A8md/g9uJ5gzQk1M4258dtC9jlAfvNqLbU9MMkYyE7HkTcw5R1vbGnO18F1KcqthoHksKI0AEsk3wPYLyVBOgOOdZLu4WlDN22Q9Q247aDufGPSFk1HwOekJ3sFUjT7B2AeW2B69yVtJdIUoqWUwMF5rOZSMP7NVNTWPVqrTi+7HrP9d1NY0WXa80BtoT9qjilJT+DowByWgIPQ+MdRb/cmAB0AvagNDerFvYlhIdRCDbxquiLi+gmJ5IHhI3NlXU7ZLnMNPKcdtdl0urBkpDP3qdGqlszQSghrBoQYepSPpyUvUBOm4VD9IRNb3hAVfXIJybrjTxixyjVkEwfn05/JqgX96j3XfRfUIalnv/92rrzcMsYT8890igBOufdDaNnsTPfdVWiWKxNyzrwnpSMJ23SEIoL+ukjDy4iHnqsKYf15AJzf0CtgVEx9DfVYtqe0RdiUzf+JurtAvV+4O7WuXhSW0xK70yNiNZPTi5IOv6HwIfL7vhQpLz5ZENKeNXEkK/8mGx8/IjvDIRxcmD3WZ73rJkgJn8EusJTKQrs2Gy+r1Ooc4aWp7acxIlmoNdvIDQ0dRF0FK7N3DNyYnMyPiMsny1jyYroU7C2jup2hz9GIhq2XiFRY0RncuzewD+WB5veFFEd+PZMrs8z22riJB4bzLGTKPLIAKdtao6X4rPeA+Y1ESltDL4oOoJoU92sgVMrR9lVUEofh09pFK/ii/z/V57YCMWfEUISEDsKyQh+FWyMNyn1yxEFnwLuF/TE4IEq62J4sDRlkLXRf7/dOUyeS1M5UWw+w/LInjCH8P7iHIDryLY4jPhl2hoGQjOrWyBr/OG0mcfdmqpWlDDfKuqogqG6riBbG+HYvGXDd186szDUkFLAYC57tVfYFj2xihO9MOe7iheO9/vRMxCOB9ePDpE2h/n3iFOmKiJ//JdJn+hJYeUKiAmZpT2qlxTCGyjlsBoYoaniE20oDjtb8Na0Ekzwhs9w0naxHG+uBbpUW5181rmvbDDhKFjLui1NFcoygAs1Eodwn34/CT+dHszqK8iQCA6dqM3oAs/J+W4o0a63ADvcuCvJVnfyLiyT+GWpUBznJ3BE6xo9au6e7LLx1DtW757bBFs6E+a0YAvEmZkW5u7hLaAuCjTugASXPZLjyhRqVbYdJjOybmTBT1lmiVXLIiq1x/7rINlCPTZTiNxIMgWYT+rdHsJ0AuZ2BaqftX7aav2TKHTzqQRo8hyZBuNYf1d4zaOSKqcuQ/4ei5ZDqdtQK+jvXlBr9cLDL7m6k3wBIHeVno0H5YGS2zduvpwuvZL8562XReA/JLT74NMtFeI58huDyeAQIxTNuPtHq5jMqi4uYfqElQXMSZR/4QPbX8Cb7hgBHzn/deNJdd81Xqm0a3DEuSZJRG//KktPOh+TLpOmRxZjZ9jxcf0KMaX/clVx3UdsEe7jHNrEeIFREC7v0TjXLD672Iwc3bnYdow9di3uctOlCE+AcHBRNbMa4iZc93eLrAJH4wbL7SsKXX8t6btuZjb2Rf9P9Wa9ucyI0vXPSKrOXCqvVIIcXqHkChM4RPrDAuZWSdT5dWDJ3gXQTaAhl1e9/AqKrDp5M5mvXDQ+07fgONXdQcrAM/6YsoEVkFyK3h76AAl1bbdRfdsF9ZlOS9Z8kRur+JCNQmhu8gqXB1NmSeEbV2tZwjbzUyDyZB/ei3bjxZD3G4ELPoYHf93ki4m6FyrPzt2Fz4zbVYEdMjk8n9G9IlaoAGHasIMrGbqYim7NZRwpKOClHBWB6sf3utpsq3auS0L8uPYXyA79lFujmr3OKRCTjWMscIMILVj8Qt2TSWExIcgS2N3w/xtXb4jXzSYpvdZTVlusyGKyAF/lFLybMVdG/4JaswNOV3BEGBJmNBufdZdfI1awZYT36Sx8TfMELWlKDFNmp+4u3IO37apjBAZJdgLid2hxa3MTHnFDZV3DQyWG0cdCUTMQJ4g7mt6hABiecRaKdG1WgU5b6f9m3rqtFu3sK3epwN3FOLXtN5+4IsotWpdWLeryk/Yym40S8YPNaBvL7GC9nWdU17Zr4AK4mFRe0a7U92h9faKhL0G5zRYL0QWqfcuR3q8N375DT1A+HF6x3pHJVjjtMkivABbCe2u3rtn9nDgu+qBRbYNO+qhWOvFyMGcaEUn5ldNyVVUBch3G1C6AHibhAeZNEMthxrWLVBrAv6fqSAcS4btXxLv30yynnL0vpSxXzmSrBcxoP3Z2pPi8SshbCX8GPyRphHek0Cim0s1cTp9X2LNXOeS5iV3BHeaqDpgH2dkfK+9jhjH4JdsVKOEX1nP1mO4nqRI3Vot+09adTwkqEtnxu3EMma+/KBYLkHjL547E2tRbHw7u6i9QG5RYuBm298zP9tY6xgK0jEWa2sVQYTLDhd50mtkcUjcwJAVzx9+8ocxlpiSAwJrvBVZR+f1gPRApx470QoUcwzjKCUbilGVoW9Wv0pPPojbZlJ1q7aVGi6pK924TJro4nBjLPjsI7LnfAgA122VMeQUXmgdm3K7/SBSMExdvrxNNHOWHvA97Ru31p28852LhVA+jnh4Hu+fuh9DaOhBYMPkWLn8GuQAzJwAOQyYzZuAdTbU3ns+q1BASXvAL23YF5MA9JuiiqtYGug3/K/Iihp1uhj6wHzYndTbtnTt4Z1hMBYVu7CrS6VR1V+54pw6WOFVWra2UIMDlsagG0j8dYazs+Sxk2bXSMSnNytd15jRWl/y+AgLTk3pEyqb8Eai5K3aFX/F+xV7OEvr6GCZSrXlSeXOYMkediJsGbQRY7R7KBlO74FWAm8VUuD/3B/CqzXsELau+J4evN+L4yGbEoOM9Lwe983BocTCiGwH8daxXlkoabSZ9ZQu6R8omEUz+h5IwV9f5mO/wcXs921mwpUmkwZAlHKoJxZdHodHt+JHxpUNhItI8Hpqil+d70hHAXNiJflPtDptYiqJi4HqwugcS7w8Ik02Lafz1kn83arCbp25mJgcRg3mzhoXmm5u4mhDW4h7LEjITWSti/8+kLHt6WVpD8SXeaEbgKie4i919BEcWL2ZPuoHsuXL3rMqxYF4Hm0ud22WfFT8UWOiWuP5q8y+WJDMlhtGcfhZsZ/QAEUQp2XPKHHGUaZBScZ8sKSnk22FUa21X7gZiliwtDZnqkRMZzX9VJxJoiAXgmsi/kKEwQGq+kuWbSOeUm0P1A0tVE2nHFL+4PbUO70v7ea8j/PBtjv8CiyuYE+Fw9LYLM4Jw9t8xnuGrFEFp8rxqT7Zyy854A300kgVb5oo1NjWUISoyu6i3Lm+0sfxeyR6toonZVShn7QYka1srMzIYPK9ncxEZc3j6F+WCefyhSNeEVXtqSjC3FjOSmGgzIrlPSZPCq/RbjOfc1KmMTll5NK4e25IUcoFyCtYbPy/cQLzZVZ3L/vVjAJARif670LGs4/3I17zAG2dlwMtD+Hs4WMthA6+LDzdlZU9XC51/93nVtp2eBkCM32TgNnTpreF6VdsTJS71rRGgVDP/R+UJ0Zrb0Jfmzgg00MarNyt3Gv9BNlLHi6QT6q9e7F+RsfMbC//b74vk0xXmRhE7dGCKKZLHT9YLrItQTdIzYUgoQZWMsnanYGf0+PpLQ+vD53POw2ka78xqZuS8H7XP6Ot9MHYcmXC6W2xY8QcTI0NIus5oimFEF7UcjTyy/bQNLhmPQmF82oDEnNVdRktw4k3NRULQnx8X27ayTKb1OUiJad9Dc07gQP4YW1R6ZchPnZbhW58eBK1C6yyURKRW8LDMXGILfjxN/8mSWuTGcvd9w7FryS0tPZQWMhhxIuc5vL+twKho4KXBSPm50EXXgbk7iRf6e8FwJmyFd/YbGrQhpm30xWTU8yyY84ZBgNeu60XrYJtv7MJfAfDS0WIwuX6+7l0vOSemjSFKvsBvTAgOwMhtZaiYUWYYRM8C4fO3h0Q4BYodBvTpqgFoAAAA",JU=uw(i=>{const e=kc("ballEnabled"),t=or(()=>e.value==="true"||e.value==="1"),n=Cw("canvasEl"),r=ci(),a=ci(!1),{isInViewport:l}=kU(i,{threshold:0,directional:!1});i.classList.add("sqd-hero-background"),i.classList.add(Dv.heroBackground);const{width:c,height:u}=NU(i),{matches:h}=VU("(max-width: 767px)"),{x:d,y:p,sourceType:m}=XU({target:document.body,type:"client"});Ww(()=>$w("canvas",{ref:"canvasEl",className:Dv.canvas})),j_(()=>{r.value||!n.value||(r.value=new IU(n.value,{noise:ZU,gradientmap:qU,ballEnabled:t.value,isMobile:()=>h.value,size:()=>({width:c.value,height:u.value}),onReady:()=>{a.value=!0}}))}),ds([c,u,h],()=>{var _;return(_=r.value)==null?void 0:_.onResize()},{flush:"sync"}),ds([d,p,m],([_,M])=>{r.value&&(r.value.setMousePosition({x:_,y:M}),r.value.setMouseActive(!0))},{flush:"sync",immediate:!0}),j_(()=>{!a.value||!r.value||(l.value?r.value.attachTicker():r.value.detachTicker())})}),QU={HeroBackground:JU};_w().components(QU).run(document.body);