1/*! For license information please see 37.5b88a93e.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[37],{926(e,t,n){n.d(t,{B:()=>R,C:()=>ae,D:()=>se,E:()=>P,a:()=>A,b:()=>E,c:()=>Be,d:()=>Ve,e:()=>Me,f:()=>lt,i:()=>w,j:()=>Xe,k:()=>qe,u:()=>C});var i=n(986),r=n(544),a=n(379),s=n(43),o=n.t(s,2),l=n(435),c=n(408),u=n(443);const h=e=>{let t;const n=new Set,i=(e,i)=>{const r="function"===typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=i?i:"object"!==typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,a={setState:i,getState:r,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(i,r,a);return a},d=u.useSyncExternalStoreWithSelector,p=e=>e;const f=(e,t)=>{const n=(e=>e?h(e):h)(e),i=function(e){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,n=arguments.length>2?arguments[2]:void 0;const i=d(e.subscribe,e.getState,e.getInitialState,t,n);return s.useDebugValue(i),i}(n,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t)};return Object.assign(i,n),i},m=[];function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;if(e===t)return!0;if(!e||!t)return!1;const i=e.length;if(t.length!==i)return!1;for(let r=0;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};null===t&&(t=[e]);for(const s of m)if(g(t,s.keys,s.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return i.lifespan&&i.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!n)throw s.promise}const r={keys:t,equal:i.equal,remove:()=>{const e=m.indexOf(r);-1!==e&&m.splice(e,1)},promise:(a=e,"object"===typeof a&&"function"===typeof a.then?e:e(...t)).then(e=>{r.response=e,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(e=>r.error=e)};var a;if(m.push(r),!n)throw r.promise}var _=n(853),y=n(579),x=n(689);const b=["params"];function S(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}o.act;const M=e=>e&&e.isOrthographicCamera,w=e=>e&&e.hasOwnProperty("current"),T=e=>null!=e&&("string"===typeof e||"number"===typeof e||e.isColor),E=((e,t)=>"undefined"!==typeof window&&((null==(e=window.document)?void 0:e.createElement)||"ReactNative"===(null==(t=window.navigator)?void 0:t.product)))()?s.useLayoutEffect:s.useEffect;function A(e){const t=s.useRef(e);return E(()=>{t.current=e},[e]),t}function C(){const e=(0,x.u5)(),t=(0,x.y3)();return s.useMemo(()=>n=>{let i=n.children;const r=!!(0,x.Nz)(e,!0,e=>e.type===s.StrictMode)?s.StrictMode:s.Fragment;return(0,y.jsx)(r,{children:(0,y.jsx)(t,{children:i})})},[e,t])}function R(e){let t=e.set;return E(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const P=(e=>(e=class extends s.Component{constructor(){super(...arguments),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}},e.getDerivedStateFromError=()=>({error:!0}),e))();function I(e){var t;const n="undefined"!==typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],n),e[1]):e}function L(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}const N={obj:e=>e===Object(e)&&!N.arr(e)&&"function"!==typeof e,fun:e=>"function"===typeof e,str:e=>"string"===typeof e,num:e=>"number"===typeof e,boo:e=>"boolean"===typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.arrays,r=void 0===i?"shallow":i,a=n.objects,s=void 0===a?"reference":a,o=n.strict,l=void 0===o||o;if(typeof e!==typeof t||!!e!==!!t)return!1;if(N.str(e)||N.num(e)||N.boo(e))return e===t;const c=N.obj(e);if(c&&"reference"===s)return e===t;const u=N.arr(e);if(u&&"reference"===r)return e===t;if((u||c)&&e===t)return!0;let h;for(h in e)if(!(h in t))return!1;if(c&&"shallow"===r&&"shallow"===s){for(h in l?t:e)if(!N.equ(e[h],t[h],{strict:l,objects:"reference"}))return!1}else for(h in l?t:e)if(e[h]!==t[h])return!1;if(N.und(h)){if(u&&0===e.length&&0===t.length)return!0;
2if(c&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}};function U(e){const t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}const D=["children","key","ref"];function O(e){const t={};for(const n in e)D.includes(n)||(t[n]=e[n]);return t}function F(e,t,n,i){const r=e;let a=null==r?void 0:r.__r3f;return a||(a={root:t,type:n,parent:null,children:[],props:O(i),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=a)),a}function z(e,t){if(!t.includes("-"))return{root:e,key:t,target:e[t]};if(t in e)return{root:e,key:t,target:e[t]};let n=e;const i=t.split("-");for(const r of i){if("object"!==typeof n||null===n){if(void 0!==n){return{root:n,key:i.slice(i.indexOf(r)).join("-"),target:void 0}}return{root:e,key:t,target:void 0}}e=n,n=n[t=r]}return{root:e,key:t,target:n}}const B=/-\d+$/;function k(e,t){if(N.str(t.props.attach)){if(B.test(t.props.attach)){const n=t.props.attach.replace(B,""),i=z(e.object,n),r=i.root,a=i.key;Array.isArray(r[a])||(r[a]=[])}const n=z(e.object,t.props.attach),i=n.root,r=n.key;t.previousAttach=i[r],i[r]=t.object}else N.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function V(e,t){if(N.str(t.props.attach)){const n=z(e.object,t.props.attach),i=n.root,r=n.key,a=t.previousAttach;void 0===a?delete i[r]:i[r]=a}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}const H=[...D,"args","dispose","attach","object","onUpdate","dispose"],G=new Map;function W(e){let t=G.get(e.constructor);try{t||(t=new e.constructor,G.set(e.constructor,t))}catch(n){}return t}const j=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],X=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function q(e,t){var n;const i=e.__r3f,r=i&&S(i).getState(),s=null==i?void 0:i.eventCount;for(const c in t){let n=t[c];if(H.includes(c))continue;if(i&&X.test(c)){"function"===typeof n?i.handlers[c]=n:delete i.handlers[c],i.eventCount=Object.keys(i.handlers).length;continue}if(void 0===n)continue;let s=z(e,c),u=s.root,h=s.key,d=s.target;if(void 0===d&&("object"!==typeof u||null===u))throw Error('R3F: Cannot set "'.concat(c,'". Ensure it is an object before setting "').concat(h,'".'));if(d instanceof l.zgK&&n instanceof l.zgK)d.mask=n.mask;else if(d instanceof l.Q1f&&T(n))d.set(n);else if(null!==d&&"object"===typeof d&&"function"===typeof d.set&&"function"===typeof d.copy&&null!=n&&n.constructor&&d.constructor===n.constructor)d.copy(n);else if(null!==d&&"object"===typeof d&&"function"===typeof d.set&&Array.isArray(n))"function"===typeof d.fromArray?d.fromArray(n):d.set(...n);else if(null!==d&&"object"===typeof d&&"function"===typeof d.set&&"number"===typeof n)"function"===typeof d.setScalar?d.setScalar(n):d.set(n);else if(u instanceof l.BKk&&"uniforms"===h&&N.obj(n)){N.obj(u.uniforms)||(u.uniforms={});const e=u.uniforms,t=n;for(const n in t){const i=t[n],r=e[n];r?Object.assign(r,i):e[n]=(0,a.A)({},i)}}else{var o;u[h]=n,r&&!r.linear&&j.includes(h)&&null!=(o=u[h])&&o.isTexture&&u[h].format===l.GWd&&u[h].type===l.OUM&&(u[h].colorSpace
2=l.er$)}}if(null!=i&&i.parent&&null!=r&&r.internal&&null!=(n=i.object)&&n.isObject3D&&s!==i.eventCount){const e=i.object,t=r.internal.interaction.indexOf(e);t>-1&&r.internal.interaction.splice(t,1),i.eventCount&&null!==e.raycast&&r.internal.interaction.push(e)}return i&&void 0===i.props.attach&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&Y(i),e}function Y(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);const n=null==(t=e.root)||null==t.getState?void 0:t.getState();n&&0===n.internal.frames&&n.invalidate()}function Z(e,t){e.manual||(M(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix())}const J=e=>null==e?void 0:e.isObject3D;function K(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function Q(e,t,n,i){const r=n.get(t);r&&(n.delete(t),0===n.size&&(e.delete(i),r.target.releasePointerCapture(i)))}function $(e,t,n){const i=e.getState().internal;for(let r=0;r<i.interaction.length;r++)i.interaction[r]===t&&(i.interaction[r]=n);for(let r=0;r<i.initialHits.length;r++)i.initialHits[r]===t&&(i.initialHits[r]=n);i.hovered.forEach((e,r)=>{if(e.eventObject===t||e.object===t){i.hovered.delete(r);const s=(0,a.A)((0,a.A)({},e),{},{eventObject:e.eventObject===t?n:e.eventObject,object:e.object===t?n:e.object});i.hovered.set(K(s),s)}}),i.capturedMap.forEach(e=>{const i=e.get(t);i&&(e.delete(t),e.set(n,i))})}function ee(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))}function n(t){const n=e.getState().internal;for(const e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){const i=e.eventObject.__r3f;if(n.hovered.delete(K(e)),null!=i&&i.eventCount){const n=i.handlers,r=(0,a.A)((0,a.A)({},e),{},{intersections:t});null==n.onPointerOut||n.onPointerOut(r),null==n.onPointerLeave||n.onPointerLeave(r)}}}function i(e,t){for(let n=0;n<t.length;n++){const i=t[n].__r3f;null==i||null==i.handlers.onPointerMissed||i.handlers.onPointerMissed(e)}}return{handlePointer:function(r){switch(r){case"onPointerLeave":case"onPointerCancel":return()=>n([]);case"onLostPointerCapture":return t=>{const i=e.getState().internal;"pointerId"in t&&i.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{i.capturedMap.has(t.pointerId)&&(i.capturedMap.delete(t.pointerId),n([]))})}}return function(s){const o=e.getState(),c=o.onPointerMissed,u=o.internal;u.lastEvent.current=s;const h="onPointerMove"===r,d="onClick"===r||"onContextMenu"===r||"onDoubleClick"===r,p=function(t,n){const i=e.getState(),r=new Set,s=[],o=n?n(i.internal.interaction):i.internal.interaction;for(let e=0;e<o.length;e++){const t=L(o[e]);t&&(t.raycaster.camera=void 0)}i.previousRoot||null==i.events.compute||i.events.compute(t,i);let l=o.flatMap(function(e){const n=L(e);return n&&n.events.enabled&&null!==n.raycaster.camera?(void 0===n.raycaster.camera&&(null==n.events.compute||n.events.compute(t,n,null==(i=n.previousRoot)?void 0:i.getState()),void 0===n.raycaster.camera&&(n.raycaster.camera=null)),n.raycaster.camera?n.raycaster.intersectObject(e,!0):[]):[];var i}).sort((e,t)=>{const n=L(e.object),i=L(t.object);return n&&i&&i.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{const t=K(e);return!r.has(t)&&(r.add(t),!0)});i.events.filter&&(l=i.events.filter(l,i));for(const e of l){let t=e.object;for(;t;){var c;null!=(c=t.__r3f)&&c.eventCount&&s.push((0,a.A)((0,a.A)({},e),{},{eventObject:t})),t=t.parent}}if("pointerId"in t&&i.internal.capturedMap.has(t.pointerId))for(let e of i.internal.capturedMap.get(t.pointerId).values())r.has(K(e.intersection))||s.push(e.intersection);return s}(s,h?t:void 0),f=d?function(t){const n=e.getState().internal,i=t.offsetX-n.initialClick[0],r=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(i*i+r*r))}(s):0;"onPointerDown"===r&&(u.initialClick=[s.offsetX,s.offsetY],u.initialHits=p.map(e=>e.eventObject)),d&&!p.length&&f<=2&&(i(s,u.interaction),c&&c(s)),h&&n(p),function(e,t,i,r){if(e.length){const s={stopped:!1};for(const o of e){let c=L(o.object);if(c||o.object.traverseAncestors(e=>{const t=L(e);if(t)return c=t,!1}),c){const u=c,h=u.raycaster,d=u.pointer,p=u.camera,f=u.internal,m=new l.Pq0(d.x,d.y,0).unproject(p),g=e=>{var t,n;return null!=(t=null==(n=f.capturedMap.get(e))?void 0:n.has(o.eventObject))&&t},v=e=>{const n={intersection:o,target:t.target};f.capturedMap.has(e)?f.capturedMap.get(e).set(o.eventObject,n):f.capturedMap.set(e,new Map([[o.eventObject,n]])),t.target.setPointerCapture(e)},_=e=>{const t=f.capturedMap.get(e);t&&Q(f.capturedMap,o.eventObject,t,e)};let y={};for(let e in t){let n=t[e];"function"!==typeof n&&(y[e]=n)}let x=(0,a.A)((0,a.A)((0,a.A)({},o),y),{},{pointer:d,intersections:e,stopped:s.stopped,delta:i,unprojectedPoint:m,ray:h.ray,camera:p,stopPropagation(){const i="pointerId"in t&&f.capturedMap.get(t.pointerId);(!i||i.has(o.eventObject))&&(x.stopped=s.stopped=!0,f.hovered.size&&Array.from(f.hovered.values()).find(e=>e.eventObject===o.eventObject))&&n([...e.slice(0,e.indexOf(o)),o])},target:{hasPointerCapture:g,setPointerCapture:v,releasePointerCapture:_},currentTarget:{hasPointerCapture:g,setPointerCapture:v,releasePointerCapture:_},nativeEvent:t});if(r(x),!0===s.stopped)break}}}}(p,s,f,function(e){const t=e.eventObject,n=t.__r3f;if(null==n||!n.eventCount)return;const a=n.handlers;if(h){if(a.onPointerOver||a.onPointerEnter||a.onPointerOut||a.onPointerLeave){const t=K(e),n=u.hovered.get(t);n?n.stopped&&e.stopPropagation():(u.hovered.set(t,e),null==a.onPointerOver||a.onPointerOver(e),null==a.onPointerEnter||a.onPointerEnter(e))}null==a.onPointerMove||a.onPointerMove(e)}else{const n=a[r];n?d&&!u.initialHits.includes(t)||(i(s,u.interaction.filter(e=>!u.initialHits.includes(e))),n(e)):d&&u.initialHits.includes(t)&&i(s,u.interaction.filter(e=>!u.initialHits.includes(e)))}})}}}}const te=e=>!(null==e||!e.render),ne=s.createContext(null),ie=(e,t)=>{const n=(i=(n,i)=>{const r=new l.Pq0,o=new l.Pq0,c=new l.Pq0;function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i().camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i().size;const a=n.width,s=n.height,l=n.top,u=n.left,h=a/s;t.isVector3?c.copy(t):c.set(...t);const d=e.getWorldPosition(r).distanceTo(c);if(M(e))return{width:a/e.zoom,height:s/e.zoom,top:l,left:u,factor:1,distance:d,aspect:h};{const t=e.fov*Math.PI/180,n=2*Math.tan(t/2)*d,i=n*(a/s);return{width:i,height:n,top:l,left:u,factor:a/i,distance:d,aspect:h}}}let h;const d=e=>n(t=>({performance:(0,a.A)((0,a.A)({},t.performance),{},{current:e})})),p=new l.I9Y,f={set:n,get:i,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1}
2,scene:null,xr:null,invalidate:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e(i(),t)},advance:(e,n)=>t(e,n,i()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new l.zD7,pointer:p,mouse:p,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const e=i();h&&clearTimeout(h),e.performance.current!==e.performance.min&&d(e.performance.min),h=setTimeout(()=>d(i().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:u},setEvents:e=>n(t=>(0,a.A)((0,a.A)({},t),{},{events:(0,a.A)((0,a.A)({},t.events),e)})),setSize:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const l=i().camera,c={width:e,height:t,top:r,left:s};n(e=>({size:c,viewport:(0,a.A)((0,a.A)({},e.viewport),u(l,o,c))}))},setDpr:e=>n(t=>{const n=I(e);return{viewport:(0,a.A)((0,a.A)({},t.viewport),{},{dpr:n,initialDpr:t.viewport.initialDpr||n})}}),setFrameloop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always";const t=i().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),n(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:s.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{const r=i().internal;return r.priority=r.priority+(t>0?1:0),r.subscribers.push({ref:e,priority:t,store:n}),r.subscribers=r.subscribers.sort((e,t)=>e.priority-t.priority),()=>{const n=i().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(t>0?1:0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}};return f},i?f(i,r):f);var i,r;const o=n.getState();let c=o.size,u=o.viewport.dpr,h=o.camera;return n.subscribe(()=>{const e=n.getState(),t=e.camera,i=e.size,r=e.viewport,s=e.gl,o=e.set;if(i.width!==c.width||i.height!==c.height||r.dpr!==u){c=i,u=r.dpr,Z(t,i),r.dpr>0&&s.setPixelRatio(r.dpr);const e="undefined"!==typeof HTMLCanvasElement&&s.domElement instanceof HTMLCanvasElement;s.setSize(i.width,i.height,e)}t!==h&&(h=t,o(e=>({viewport:(0,a.A)((0,a.A)({},e.viewport),e.viewport.getCurrentViewport(t))})))}),n.subscribe(t=>e(t)),n};function re(){const e=s.useContext(ne);if(!e)throw new Error("R3F: Hooks can only be used within the Canvas component!");return e}function ae(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e,t=arguments.length>1?arguments[1]:void 0;return re()(e,t)}function se(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=re(),i=n.getState().internal.subscribe,r=A(e);return E(()=>i(r,t,n),[t,i,n]),null}const oe=new WeakMap;function le(e,t){return function(n){let i;(e=>{var t;return"function"===typeof e&&(null==e||null==(t=e.prototype)?void 0:t.constructor)===e})(n)?(i=oe.get(n),i||(i=new n,oe.set(n,i))):i=n,e&&e(i);for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return Promise.all(a.map(e=>new Promise((n,r)=>i.load(e,e=>{J(null==e?void 0:e.scene)&&Object.assign(e,U(e.scene)),n(e)},t,t=>r(new Error("Could not load ".concat(e,": ").concat(null==t?void 0:t.message)))))))}}function ce(e,t,n,i){const r=Array.isArray(t)?t:[t],a=((e,t,n)=>v(e,t,!1,n))(le(n,i),[e,...r],{equal:N.equ});return Array.isArray(t)?a:a[0]}ce.preload=function(e,t,n){const i=Array.isArray(t)?t:[t];return((e,t,n)=>{v(e,t,!0,n)})(le(n),[e,...i])},ce.clear=function(e,t){return(e=>{if(void 0===e||0===e.length)m.splice(0,m.length);else{const t=m.find(t=>g(e,t.keys,t.equal));t&&t.remove()}})([e,...Array.isArray(t)?t:[t]])};var ue,he={exports:{}},de={exports:{}};function pe(){return ue||(ue=1,(e=de).exports=function(e){function t(e,t,n,i){return new Vr(e,t,n,i)}function n(){}function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function a(e){if(r(e)!==e)throw Error(i(188))}function o(e){var t=e.alternate;if(!t){if(null===(t=r(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,s=t;;){var o=n.return;if(null===o)break;var l=o.alternate;if(null===l){if(null!==(s=o.return)){n=s;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return a(o),e;if(l===s)return a(o),t;l=l.sibling}throw Error(i(188))}if(n.return!==s.return)n=o,s=l;else{for(var c=!1,u=o.child;u;){if(u===n){c=!0,n=o,s=l;break}if(u===s){c=!0,s=o,n=l;break}u=u.sibling}if(!c){for(u=l.child;u;){if(u===n){c=!0,n=l,s=o;break}if(u===s){c=!0,s=l,n=o;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==s)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}function l(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=l(e)))return t;e=e.sibling}return null}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(4!==e.tag&&null!==(t=c(e)))return t;e=e.sibling}return null}function u(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=Sa&&e[Sa]||e["@@iterator"])?e:null}function h(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===Ma?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ua:return"Fragment";case da:return"Profiler";case ha:return"StrictMode";case ga:return"Suspense";case va:return"SuspenseList";case xa:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case ca:return"Portal";case fa:return e.displayName||"Context";case pa:return(e._context.displayName||"Context")+".Consumer";case ma:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case _a:return null!==(t=e.displayName||null)?t:h(e.type)||"Memo";case ya:t=e._payload,e=e._init;try{return h(e(t))}catch(n){}}return null}function d(e){return{current:e}}function p(e){0>qo||(e.current=Xo[qo],Xo[qo]=null,qo--)}function f(e,t){qo++,Xo[qo]=e.current,e.current=t}function m(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;
2case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function g(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=134217727&i;return 0!==o?0!==(i=o&~a)?r=m(i):0!==(s&=o)?r=m(s):n||0!==(n=o&~e)&&(r=m(n)):0!==(o=i&~a)?r=m(o):0!==s?r=m(s):n||0!==(n=i&~e)&&(r=m(n)),0===r?0:0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(n=t&-t)||32===a&&0!==(4194048&n))?t:r}function v(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function y(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function x(){var e=el;return 0===(62914560&(el<<=1))&&(el=4194304),e}function b(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function S(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function M(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Zo(t);e.entangledLanes|=t,e.entanglements[i]=1073741824|e.entanglements[i]|261930&n}function w(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Zo(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function T(e,t){var n=t&-t;return 0!==((n=0!==(42&n)?1:E(n))&(e.suspendedLanes|t))?0:n}function E(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function A(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function C(e){if("function"==typeof ul&&hl(e),pl&&"function"==typeof pl.setStrictMode)try{pl.setStrictMode(dl,e)}catch(t){}}function R(e){if(void 0===So)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);So=t&&t[1]||"",Mo=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+So+e+Mo}function P(e,t){if(!e||vl)return"";vl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(r){var i=r}Reflect.construct(e,[],n)}
2else{try{n.call()}catch(r){i=r}e.call(n.prototype)}}else{try{throw Error()}catch(r){i=r}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(r){if(r&&i&&"string"==typeof r.stack)return[r.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split("\n"),c=o.split("\n");for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(1!==i||1!==r)do{if(i--,0>--r||l[i]!==c[r]){var u="\n"+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=i&&0<=r);break}}}finally{vl=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?R(n):""}function I(e,t){switch(e.tag){case 26:case 27:case 5:return R(e.type);case 16:return R("Lazy");case 13:return e.child!==t&&null!==t?R("Suspense Fallback"):R("Suspense");case 19:return R("SuspenseList");case 0:case 15:return P(e.type,!1);case 11:return P(e.type.render,!1);case 1:return P(e.type,!0);case 31:return R("Activity");default:return""}}function L(e){try{var t="",n=null;do{t+=I(e,n),n=e,e=e.return}while(e);return t}catch(i){return"\nError generating stack: "+i.message+"\n"+i.stack}}function N(e,t){if("object"==typeof e&&null!==e){var n=_l.get(e);return void 0!==n?n:(t={value:e,source:t,stack:L(t)},_l.set(e,t),t)}return{value:e,source:t,stack:L(t)}}function U(e,t){yl[xl++]=Sl,yl[xl++]=bl,bl=e,Sl=t}function D(e,t,n){Ml[wl++]=El,Ml[wl++]=Al,Ml[wl++]=Tl,Tl=e;var i=El;e=Al;var r=32-Zo(i)-1;i&=~(1<<r),n+=1;var a=32-Zo(t)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,El=1<<32-Zo(t)+r|n<<r|i,Al=a+e}else El=1<<a|n<<r|i,Al=e}function O(e){null!==e.return&&(U(e,1),D(e,1,0))}function F(e){for(;e===bl;)bl=yl[--xl],yl[xl]=null,Sl=yl[--xl],yl[xl]=null;for(;e===Tl;)Tl=Ml[--wl],Ml[wl]=null,Al=Ml[--wl],Ml[wl]=null,El=Ml[--wl],Ml[wl]=null}function z(e,t){Ml[wl++]=El,Ml[wl++]=Al,Ml[wl++]=Tl,El=t.id,Al=t.overflow,Tl=e}function B(e,t){f(Pl,t),f(Rl,e),f(Cl,null),e=Pa(t),p(Cl),f(Cl,e)}function k(){p(Cl),p(Rl),p(Pl)}function V(e){null!==e.memoizedState&&f(Il,e);var t=Cl.current,n=Ia(t,e.type);t!==n&&(f(Rl,e),f(Cl,n))}function H(e){Rl.current===e&&(p(Cl),p(Rl)),Il.current===e&&(p(Il),Ha?os._currentValue=ss:os._currentValue2=ss)}function G(e){throw Z(N(Error(i(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),Fl}function W(e,t){if(!ja)throw Error(i(175));ro(e.stateNode,e.type,e.memoizedProps,t,e)||G(e,!0)}function j(e){for(Ll=e.return;Ll;)switch(Ll.tag){case 5:case 31:case 13:return void(Ol=!1);case 27:case 3:return void(Ol=!0);default:Ll=Ll.return}}function X(e){if(!ja||e!==Ll)return!1;if(!Ul)return j(e),Ul=!0,!1;var t=e.tag;if(ko?3!==t&&27!==t&&(5!==t||bo(e.type)&&!Fa(e.type,e.memoizedProps))&&Nl&&G(e):3!==t&&(5!==t||bo(e.type)&&!Fa(e.type,e.memoizedProps))&&Nl&&G(e),j(e),13===t){if(!ja)throw Error(i(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));Nl=co(e)}else if(31===t){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));Nl=lo(e)}else Nl=ko&&27===t?Ys(e.type,Nl):Ll?qs(e.stateNode):null;return!0}
2function q(){ja&&(Nl=Ll=null,Ul=!1)}function Y(){var e=Dl;return null!==e&&(null===bu?bu=e:bu.push.apply(bu,e),Dl=null),e}function Z(e){null===Dl?Dl=[e]:Dl.push(e)}function J(e,t,n){Ha?(f(zl,t._currentValue),t._currentValue=n):(f(zl,t._currentValue2),t._currentValue2=n)}function K(e){var t=zl.current;Ha?e._currentValue=t:e._currentValue2=t,p(zl)}function Q(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function $(e,t,n,r){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var s=a.dependencies;if(null!==s){var o=a.child;s=s.firstContext;e:for(;null!==s;){var l=s;s=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Q(s.return,n,e),r||(o=null);break e}s=l.next}}else if(18===a.tag){if(null===(o=a.return))throw Error(i(341));o.lanes|=n,null!==(s=o.alternate)&&(s.lanes|=n),Q(o,n,e),o=null}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===e){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}}function ee(e,t,n,r){e=null;for(var a=t,s=!1;null!==a;){if(!s)if(0!==(524288&a.flags))s=!0;else if(0!==(262144&a.flags))break;if(10===a.tag){var o=a.alternate;if(null===o)throw Error(i(387));if(null!==(o=o.memoizedProps)){var l=a.type;fl(a.pendingProps.value,o.value)||(null!==e?e.push(l):e=[l])}}else if(a===Il.current){if(null===(o=a.alternate))throw Error(i(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(os):e=[os])}a=a.return}null!==e&&$(t,e,n,r),t.flags|=262144}function te(e){for(e=e.firstContext;null!==e;){var t=e.context;if(!fl(Ha?t._currentValue:t._currentValue2,e.memoizedValue))return!0;e=e.next}return!1}
vendor: 21,251 bytes, line 2
2function ne(e){Bl=e,kl=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function ie(e){return ae(Bl,e)}function re(e,t){return null===Bl&&ne(e),ae(e,t)}function ae(e,t){var n=Ha?t._currentValue:t._currentValue2;if(t={context:t,memoizedValue:n,next:null},null===kl){if(null===e)throw Error(i(308));kl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else kl=kl.next=t;return n}function se(){return{controller:new Vl,data:new Map,refCount:0}}function oe(e){e.refCount--,0===e.refCount&&Hl(Gl,function(){e.controller.abort()})}function le(){}function ce(e){e!==Xl&&null===e.next&&(null===Xl?jl=Xl=e:Xl=Xl.next=e),Yl=!0,ql||(ql=!0,cs?us(function(){0!==(6&ru)?tl(sl,he):de()}):tl(sl,he))}function ue(e,t){if(!Zl&&Yl){Zl=!0;do{for(var n=!1,i=jl;null!==i;){if(!t)if(0!==e){var r=i.pendingLanes;if(0===r)var a=0;else{var s=i.suspendedLanes,o=i.pingedLanes;a=(1<<31-Zo(42|e)+1)-1,a=201326741&(a&=r&~(s&~o))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,me(i,a))}else a=ou,0===(3&(a=g(i,i===au?a:0,null!==i.cancelPendingCommit||i.timeoutHandle!==Va)))||v(i,a)||(n=!0,me(i,a));i=i.next}}while(n);Zl=!1}}function he(){de()}function de(){Yl=ql=!1;var e=0;0!==Jl&&Ka()&&(e=Jl);for(var t=al(),n=null,i=jl;null!==i;){var r=i.next,a=pe(i,t);0===a?(i.next=null,null===n?jl=r:n.next=r,null===r&&(Xl=n)):(n=i,(0!==e||0!==(3&a))&&(Yl=!0)),i=r}0!==Cu&&5!==Cu||ue(e,!1),0!==Jl&&(Jl=0)}function pe(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var s=31-Zo(a),o=1<<s,l=r[s];-1===l?(0===(o&n)||0!==(o&i))&&(r[s]=y(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}if(n=ou,n=g(e,e===(t=au)?n:0,null!==e.cancelPendingCommit||e.timeoutHandle!==Va),i=e.callbackNode,0===n||e===t&&(2===lu||9===lu)||null!==e.cancelPendingCommit)return null!==i&&null!==i&&nl(i),e.callbackNode=null,e.callbackPriority=0;if(0===(3&n)||v(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==i&&nl(i),A(n)){case 2:case 8:n=ol;break;case 32:default:n=ll;break;case 268435456:n=cl}return i=fe.bind(null,e),n=tl(n,i),e.callbackPriority=t,e.callbackNode=n,t}return null!==i&&null!==i&&nl(i),e.callbackPriority=2,e.callbackNode=null,2}function fe(e,t){if(0!==Cu&&5!==Cu)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Lr()&&e.callbackNode!==n)return null;var i=ou;return 0===(i=g(e,e===au?i:0,null!==e.cancelPendingCommit||e.timeoutHandle!==Va))?null:(or(e,i,t),pe(e,al()),null!=e.callbackNode&&e.callbackNode===n?fe.bind(null,e):null)}function me(e,t){if(Lr())return null;or(e,t,!0)}function ge(){if(0===Jl){var e=$l;0===e&&(e=Qo,0===(261888&(Qo<<=1))&&(Qo=256)),Jl=e}return Jl}function ve(){if(0===--Ql&&null!==Kl){null!==ec&&(ec.status="fulfilled");var e=Kl;Kl=null,$l=0,ec=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _e(){var e=nc.current;return null!==e?e:au.pooledCache}function ye(e,t){f(nc,null===t?nc.current:t.pool)}function xe(){var e=_e();return null===e?null:{parent:Ha?Wl._currentValue:Wl._currentValue2,pool:e}}function be(e,t){if(fl(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!gl.call(t,r)||!fl(e[r],t[r]))return!1}return!0}function Se(e){return"fulfilled"===(e=e.status)||"rejected"===e}function Me(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(le,le),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw Ee(e=t.reason),e;default:if("string"==typeof t.status)t.then(le,le);else{if(null!==(e=au)&&100<e.shellSuspendCounter)throw Error(i(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw Ee(e=t.reason),e}throw oc=t,ic}}function we(e){try{return(0,e._init)(e._payload)}catch(t){throw null!==t&&"object"==typeof t&&"function"==typeof t.then?(oc=t,ic):t}}function Te(){if(null===oc)throw Error(i(459));var e=oc;return oc=null,e}function Ee(e){if(e===ic||e===ac)throw Error(i(483))}function Ae(e){var t=cc;return cc+=1,null===lc&&(lc=[]),Me(lc,e,t)}function Ce(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Re(e,t){throw t.$$typeof===oa?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Pe(e){function n(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function r(t,i){if(!e)return null;for(;null!==i;)n(t,i),i=i.sibling;return null}function a(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function s(e,t){return(e=Gr(e,t)).index=0,e.sibling=null,e}function o(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=67108866,n):i:(t.flags|=67108866,n):(t.flags|=1048576,n)}function l(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function c(e,t,n,i){return null===t||6!==t.tag?((t=qr(n,e.mode,i)).return=e,t):((t=s(t,n)).return=e,t)}function h(e,t,n,i){var r=n.type;return r===ua?p(e,t,n.props.children,i,n.key):null!==t&&(t.elementType===r||"object"==typeof r&&null!==r&&r.$$typeof===ya&&we(r)===t.type)?(Ce(t=s(t,n.props),n),t.return=e,t):(Ce(t=jr(n.type,n.key,n.props,null,e.mode,i),n),t.return=e,t)}function d(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Zr(n,e.mode,i)).return=e,t):((t=s(t,n.children||[])).return=e,t)}function p(e,t,n,i,r){return null===t||7!==t.tag?((t=Xr(n,e.mode,i,r)).return=e,t):((t=s(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=qr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case la:return Ce(n=jr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case ca:return(t=Zr(t,e.mode,n)).return=e,t;case ya:return f(e,t=we(t),n)}if(wa(t)||u(t))return(t=Xr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return f(e,Ae(t),n);if(t.$$typeof===fa)return f(e,re(e,t),n);Re(e,t)}return null}function m(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==r?null:c(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case la:return n.key===r?h(e,t,n,i):null;case ca:return n.key===r?d(e,t,n,i):null;case ya:return m(e,t,n=we(n),i)}if(wa(n)||u(n))return null!==r?null:p(e,t,n,i,null);if("function"==typeof n.then)return m(e,t,Ae(n),i);if(n.$$typeof===fa)return m(e,t,re(e,n),i);Re(e,n)}return null}function g(e,t,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i||"bigint"==typeof i)return c(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case la:return h(t,e=e.get(null===i.key?n:i.key)||null,i,r);case ca:return d(t,e=e.get(null===i.key?n:i.key)||null,i,r);case ya:return g(e,t,n,i=we(i),r)}if(wa(i)||u(i))return p(t,e=e.get(n)||null,i,r,null);if("function"==typeof i.then)return g(e,t,n,Ae(i),r);if(i.$$typeof===fa)return g(e,t,n,re(t,i),r);Re(t,i)}return null}function v(t,c,h,d){if("object"==typeof h&&null!==h&&h.type===ua&&null===h.key&&(h=h.props.children),"object"==typeof h&&null!==h){switch(h.$$typeof){case la:e:{for(var p=h.key;null!==c;){if(c.key===p){if((p=h.type)===ua){if(7===c.tag){r(t,c.sibling),(d=s(c,h.props.children)).return=t,t=d;break e}}else if(c.elementType===p||"object"==typeof p&&null!==p&&p.$$typeof===ya&&we(p)===c.type){r(t,c.sibling),Ce(d=s(c,h.props),h),d.return=t,t=d;break e}r(t,c);break}n(t,c),c=c.sibling}h.type===ua?((d=Xr(h.props.children,t.mode,d,h.key)).return=t,t=d):(Ce(d=jr(h.type,h.key,h.props,null,t.mode,d),h),d.return=t,t=d)}return l(t);case ca:e:{for(p=h.key;null!==c;){if(c.key===p){if(4===c.tag&&c.stateNode.containerInfo===h.containerInfo&&c.stateNode.implementation===h.implementation){r(t,c.sibling),(d=s(c,h.children||[])).return=t,t=d;break e}r(t,c);break}n(t,c),c=c.sibling}(d=Zr(h,t.mode,d)).return=t,t=d}return l(t);case ya:return v(t,c,h=we(h),d)}if(wa(h))return function(t,i,s,l){for(var c=null,u=null,h=i,d=i=0,p=null;null!==h&&d<s.length;d++){h.index>d?(p=h,h=null):p=h.sibling;var v=m(t,h,s[d],l);if(null===v){null===h&&(h=p);break}e&&h&&null===v.alternate&&n(t,h),i=o(v,i,d),null===u?c=v:u.sibling=v,u=v,h=p}if(d===s.length)return r(t,h),Ul&&U(t,d),c;if(null===h){for(;d<s.length;d++)null!==(h=f(t,s[d],l))&&(i=o(h,i,d),null===u?c=h:u.sibling=h,u=h);return Ul&&U(t,d),c}for(h=a(h);d<s.length;d++)null!==(p=g(h,t,d,s[d],l))&&(e&&null!==p.alternate&&h.delete(null===p.key?d:p.key),i=o(p,i,d),null===u?c=p:u.sibling=p,u=p);return e&&h.forEach(function(e){return n(t,e)}),Ul&&U(t,d),c}(t,c,h,d);if(u(h)){if("function"!=typeof(p=u(h)))throw Error(i(150));return function(t,s,l,c){if(null==l)throw Error(i(151));for(var u=null,h=null,d=s,p=s=0,v=null,_=l.next();null!==d&&!_.done;p++,_=l.next()){d.index>p?(v=d,d=null):v=d.sibling;var y=m(t,d,_.value,c);if(null===y){null===d&&(d=v);break}e&&d&&null===y.alternate&&n(t,d),s=o(y,s,p),null===h?u=y:h.sibling=y,h=y,d=v}if(_.done)return r(t,d),Ul&&U(t,p),u;if(null===d){for(;!_.done;p++,_=l.next())null!==(_=f(t,_.value,c))&&(s=o(_,s,p),null===h?u=_:h.sibling=_,h=_);return Ul&&U(t,p),u}for(d=a(d);!_.done;p++,_=l.next())null!==(_=g(d,t,p,_.value,c))&&(e&&null!==_.alternate&&d.delete(null===_.key?p:_.key),s=o(_,s,p),null===h?u=_:h.sibling=_,h=_);return e&&d.forEach(function(e){return n(t,e)}),Ul&&U(t,p),u}(t,c,h=p.call(h),d)}if("function"==typeof h.then)return v(t,c,Ae(h),d);if(h.$$typeof===fa)return v(t,c,re(t,h),d);Re(t,h)}return"string"==typeof h&&""!==h||"number"==typeof h||"bigint"==typeof h?(h=""+h,null!==c&&6===c.tag?(r(t,c.sibling),(d=s(c,h)).return=t,t=d):(r(t,c),(d=qr(h,t.mode,d)).return=t,t=d),l(t)):r(t,c)}return function(e,n,i,r){try{cc=0;var a=v(e,n,i,r);return lc=null,a}catch(o){if(o===ic||o===ac)throw o;var s=t(29,o,null,e.mode);return s.lanes=r,s.return=e,s}}}function Ie(){for(var e=pc,t=fc=pc=0;t<e;){var n=dc[t];dc[t++]=null;var i=dc[t];dc[t++]=null;var r=dc[t];dc[t++]=null;var a=dc[t];if(dc[t++]=null,null!==i&&null!==r){var s=i.pending;null===s?r.next=r:(r.next=s.next,s.next=r),i.pending=r}0!==a&&De(n,r,a)}}function Le(e,t,n,i){dc[pc++]=e,dc[pc++]=t,dc[pc++]=n,dc[pc++]=i,fc|=i,e.lanes|=i,null!==(e=e.alternate)&&(e.lanes|=i)}function Ne(e,t,n,i){return Le(e,t,n,i),Oe(e)}function Ue(e,t){return Le(e,null,null,t),Oe(e)}function De(e,t,n){e.lanes|=n;var i=e.alternate;null!==i&&(i.lanes|=n);for(var r=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(i=a.alternate)&&(i.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(r=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,r&&null!==t&&(r=31-Zo(n),null===(i=(e=a.hiddenUpdates)[r])?e[r]=[t]:i.push(t),t.lane=536870912|n),a):null}function Oe(e){if(50<Du)throw Du=0,Ou=null,Error(i(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}function Fe(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ze(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Be(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ke(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,0!==(2&ru)){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=Oe(e),De(e,null,n),t}return Le(e,i,t,n),Oe(e)}function Ve(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194048&n))){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,w(e,n)}}function He(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?r=a=s:a=a.next=s,n=n.next}while(null!==n);null===a?r=a=t:a=a.next=t}else r=a=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ge(){if(gc&&null!==ec)throw ec}function We(e,t,n,i){gc=!1;var r=e.updateQueue;mc=!1;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,o=r.shared.pending;if(null!==o){r.shared.pending=null;var l=o,c=l.next;l.next=null,null===s?a=c:s.next=c,s=l;var u=e.alternate;null!==u&&(o=(u=u.updateQueue).lastBaseUpdate)!==s&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l)}if(null!==a){var h=r.baseState;for(s=0,u=c=l=null,o=a;;){var d=-536870913&o.lane,p=d!==o.lane;if(p?(ou&d)===d:(i&d)===d){0!==d&&d===$l&&(gc=!0),null!==u&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var f=e,m=o;d=t;var g=n;switch(m.tag){case 1:if("function"==typeof(f=m.payload)){h=f.call(g,h,d);break e}h=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null==(d="function"==typeof(f=m.payload)?f.call(g,h,d):f))break e;h=sa({},h,d);break e;case 2:mc=!0}}null!==(d=o.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=r.callbacks)?r.callbacks=[d]:p.push(d))}else p={lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=p,l=h):u=u.next=p,s|=d;if(null===(o=o.next)){if(null===(o=r.shared.pending))break;o=(p=o).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}null===u&&(l=h),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,null===a&&(r.shared.lanes=0),mu|=s,e.lanes=s,e.memoizedState=h}}function je(e,t){if("function"!=typeof e)throw Error(i(191,e));e.call(t)}function Xe(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)je(n[e],t)}function qe(e,t){f(_c,e=pu),f(vc,t),pu=e|t.baseLanes}function Ye(){f(_c,pu),f(vc,vc.current)}function Ze(){pu=_c.current,p(vc),p(_c)}function Je(e){var t=e.alternate;f(bc,1&bc.current),f(yc,e),null===xc&&(null===t||null!==vc.current||null!==t.memoizedState)&&(xc=e)}function Ke(e){f(bc,bc.current),f(yc,e),null===xc&&(xc=e)}function Qe(e){22===e.tag?(f(bc,bc.current),f(yc,e),null===xc&&(xc=e)):$e()}function $e(){f(bc,bc.current),f(yc,yc.current)}function et(e){p(yc),xc===e&&(xc=null),p(bc)}function tt(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Vs(n)||Hs(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(0!==(128&t.flags))return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function nt(){throw Error(i(321))}function it(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fl(e[n],t[n]))return!1;return!0}function rt(e,t,n,i,r,a){return Sc=a,Mc=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ta.H=null===e||null===e.memoizedState?Uc:Dc,Cc=!1,a=n(i,r),Cc=!1,Ac&&(a=st(t,n,i,r)),at(e),a}function at(e){Ta.H=Nc;var t=null!==wc&&null!==wc.next;if(Sc=0,Tc=wc=Mc=null,Ec=!1,Pc=0,Ic=null,t)throw Error(i(300));null===e||Bc||null!==(e=e.dependencies)&&te(e)&&(Bc=!0)}function st(e,t,n,r){Mc=e;var a=0;do{if(Ac&&(Ic=null),Pc=0,Ac=!1,25<=a)throw Error(i(301));if(a+=1,Tc=wc=null,null!=e.updateQueue){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,null!=s.memoCache&&(s.memoCache.index=0)}Ta.H=Oc,s=t(n,r)}while(Ac);return s}function ot(){var e=Ta.H,t=e.useState()[0];return t="function"==typeof t.then?pt(t):t,e=e.useState()[0],(null!==wc?wc.memoizedState:null)!==e&&(Mc.flags|=1024),t}function lt(){var e=0!==Rc;return Rc=0,e}function ct(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ut(e){if(Ec){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Ec=!1}Sc=0,Tc=wc=Mc=null,Ac=!1,Pc=Rc=0,Ic=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Tc?Mc.memoizedState=Tc=e:Tc=Tc.next=e,Tc}function dt(){if(null===wc){var e=Mc.alternate;e=null!==e?e.memoizedState:null}else e=wc.next;var t=null===Tc?Mc.memoizedState:Tc.next;if(null!==t)Tc=t,wc=e;else{if(null===e)throw null===Mc.alternate?Error(i(467)):Error(i(310));e={memoizedState:(wc=e).memoizedState,baseState:wc.baseState,baseQueue:wc.baseQueue,queue:wc.queue,next:null},null===Tc?Mc.memoizedState=Tc=e:Tc=Tc.next=e}return Tc}function pt(e){var t=Pc;return Pc+=1,null===Ic&&(Ic=[]),e=Me(Ic,e,t),t=Mc,null===(null===Tc?t.memoizedState:Tc.next)&&(t=t.alternate,Ta.H=null===t||null===t.memoizedState?Uc:Dc),e}function ft(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return pt(e);if(e.$$typeof===fa)return ie(e)}throw Error(i(438,String(e)))}function mt(e){var t=null,n=Mc.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var i=Mc.alternate;null!==i&&null!==(i=i.updateQueue)&&null!=(i=i.memoCache)&&(t={data:i.data.map(function(e){return e.slice()}),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},Mc.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=ba;return t.index++,n}function gt(e,t){return"function"==typeof t?t(e):t}function vt(e){return _t(dt(),wc,e)}function _t(e,t,n){var r=e.queue;if(null===r)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,s=r.pending;if(null!==s){if(null!==a){var o=a.next;a.next=s.next,s.next=o}t.baseQueue=a=s,r.pending=null}if(s=e.baseState,null===a)e.memoizedState=s;else{var l=o=null,c=null,u=t=a.next,h=!1;do{var d=-536870913&u.lane;if(d!==u.lane?(ou&d)===d:(Sc&d)===d){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===$l&&(h=!0);else{if((Sc&p)===p){u=u.next,p===$l&&(h=!0);continue}d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=d,o=s):c=c.next=d,Mc.lanes|=p,mu|=p}d=u.action,Cc&&n(s,d),s=u.hasEagerState?u.eagerState:n(s,d)}else p={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,o=s):c=c.next=p,Mc.lanes|=d,mu|=d;u=u.next}while(null!==u&&u!==t);if(null===c?o=s:c.next=l,!fl(s,e.memoizedState)&&(Bc=!0,h&&null!==(n=ec)))throw n;e.memoizedState=s,e.baseState=o,e.baseQueue=c,r.lastRenderedState=s}return null===a&&(r.lanes=0),[e.memoizedState,r.dispatch]}function yt(e){var t=dt(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,s=t.memoizedState;if(null!==a){n.pending=null;var o=a=a.next;do{s=e(s,o.action),o=o.next}while(o!==a);fl(s,t.memoizedState)||(Bc=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function xt(e,t,n){var r=Mc,a=dt(),s=Ul;if(s){if(void 0===n)throw Error(i(407));n=n()}else n=t();var o=!fl((wc||a).memoizedState,n);if(o&&(a.memoizedState=n,Bc=!0),a=a.queue,jt(Mt.bind(null,r,a,e),[e]),a.getSnapshot!==t||o||null!==Tc&&1&Tc.memoizedState.tag){if(r.flags|=2048,kt(9,{destroy:void 0},St.bind(null,r,a,n,t),null),null===au)throw Error(i(349));s||0!==(127&Sc)||bt(r,t,n)}return n}function bt(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Mc.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Mc.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function St(e,t,n,i){t.value=n,t.getSnapshot=i,wt(t)&&Tt(e)}function Mt(e,t,n){return n(function(){wt(t)&&Tt(e)})}function wt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fl(e,n)}catch(i){return!0}}function Tt(e){var t=Ue(e,2);null!==t&&sr(t,0,2)}function Et(e){var t=ht();if("function"==typeof e){var n=e;if(e=n(),Cc){C(!0);try{n()}finally{C(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gt,lastRenderedState:e},t}function At(e,t,n,i){return e.baseState=n,_t(e,wc,"function"==typeof i?i:gt)}function Ct(e,t,n,r,a){if(pn(e))throw Error(i(485));if(null!==(e=t.action)){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){s.listeners.push(e)}};null!==Ta.T?n(!0):s.isTransition=!1,r(s),null===(n=t.pending)?(s.next=t.pending=s,Rt(t,s)):(s.next=n.next,t.pending=n.next=s)}}function Rt(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var a=Ta.T,s={};Ta.T=s;try{var o=n(r,i),l=Ta.S;null!==l&&l(s,o),Pt(e,t,o)}catch(c){Lt(e,t,c)}finally{null!==a&&null!==s.types&&(a.types=s.types),Ta.T=a}}else try{Pt(e,t,a=n(r,i))}catch(c){Lt(e,t,c)}}function Pt(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){It(e,t,n)},function(n){return Lt(e,t,n)}):It(e,t,n)}function It(e,t,n){t.status="fulfilled",t.value=n,Nt(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Rt(e,n)))}function Lt(e,t,n){var i=e.pending;if(e.pending=null,null!==i){i=i.next;do{t.status="rejected",t.reason=n,Nt(t),t=t.next}
2while(t!==i)}e.action=null}function Nt(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ut(e,t){return t}function Dt(e,t){if(Ul){var n=au.formState;if(null!==n){e:{var i=Mc;if(Ul){if(Nl){var r=js(Nl,Ol);if(r){Nl=qs(r),i=Xs(r);break e}}G(i)}i=!1}i&&(t=n[0])}}(n=ht()).memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ut,lastRenderedState:t},n.queue=i,n=un.bind(null,Mc,i),i.dispatch=n,i=Et(!1);var a=dn.bind(null,Mc,!1,i.queue);return r={state:t,dispatch:null,action:e,pending:null},(i=ht()).queue=r,n=Ct.bind(null,Mc,r,a,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function Ot(e){return Ft(dt(),wc,e)}function Ft(e,t,n){if(t=_t(e,t,Ut)[0],e=vt(gt)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var i=pt(t)}catch(s){throw s===ic?ac:s}else i=t;var r=(t=dt()).queue,a=r.dispatch;return n!==t.memoizedState&&(Mc.flags|=2048,kt(9,{destroy:void 0},zt.bind(null,r,n),null)),[i,a,e]}function zt(e,t){e.action=t}function Bt(e){var t=dt(),n=wc;if(null!==n)return Ft(t,n,e);dt(),t=t.memoizedState;var i=(n=dt()).queue.dispatch;return n.memoizedState=e,[t,i,!1]}function kt(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},null===(t=Mc.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Mc.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Vt(){return dt().memoizedState}function Ht(e,t,n,i){var r=ht();Mc.flags|=e,r.memoizedState=kt(1|t,{destroy:void 0},n,void 0===i?null:i)}function Gt(e,t,n,i){var r=dt();i=void 0===i?null:i;var a=r.memoizedState.inst;null!==wc&&null!==i&&it(i,wc.memoizedState.deps)?r.memoizedState=kt(t,a,n,i):(Mc.flags|=e,r.memoizedState=kt(1|t,a,n,i))}function Wt(e,t){Ht(8390656,8,e,t)}function jt(e,t){Gt(2048,8,e,t)}function Xt(e){var t=dt().memoizedState;return function(e){Mc.flags|=4;var t=Mc.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},Mc.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(0!==(2&ru))throw Error(i(440));return t.impl.apply(void 0,arguments)}}function qt(e,t){return Gt(4,2,e,t)}function Yt(e,t){return Gt(4,4,e,t)}function Zt(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Jt(e,t,n){n=null!=n?n.concat([e]):null,Gt(4,4,Zt.bind(null,t,e),n)}function Kt(){}function Qt(e,t){var n=dt();t=void 0===t?null:t;var i=n.memoizedState;return null!==t&&it(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function $t(e,t){var n=dt();t=void 0===t?null:t;var i=n.memoizedState;if(null!==t&&it(t,i[1]))return i[0];if(i=e(),Cc){C(!0);try{e()}finally{C(!1)}}return n.memoizedState=[i,t],i}function en(e,t,n){return void 0===n||0!==(1073741824&Sc)&&0===(261930&ou)?e.memoizedState=t:(e.memoizedState=n,e=ar(),Mc.lanes|=e,mu|=e,n)}function tn(e,t,n,i){return fl(n,t)?n:null!==vc.current?(e=en(e,n,i),fl(e,t)||(Bc=!0),e):0===(42&Sc)||0!==(1073741824&Sc)&&0===(261930&ou)?(Bc=!0,e.memoizedState=n):(e=ar(),Mc.lanes|=e,mu|=e,t)}function nn(e,t,n,i,r){var a=Za();Ya(0!==a&&8>a?a:8);var s=Ta.T,o={};Ta.T=o,dn(e,!1,t,n);try{var l=r(),c=Ta.S;if(null!==c&&c(o,l),null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=function(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(i.status="rejected",i.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),i}(l,i);hn(e,t,u,rr())}else hn(e,t,i,rr())}catch(h){hn(e,t,{then:function(){},status:"rejected",reason:h},rr())}finally{Ya(a),null!==s&&null!==o.types&&(s.types=o.types),Ta.T=s}}function rn(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:ss,baseState:ss,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gt,lastRenderedState:ss},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gt,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function an(){return ie(os)}function sn(){return dt().memoizedState}function on(){return dt().memoizedState}function ln(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=rr(),i=ke(t,e=Be(n),n);return null!==i&&(sr(i,0,n),Ve(i,t,n)),t={cache:se()},void(e.payload=t)}t=t.return}}function cn(e,t,n){var i=rr();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null}
vendor: 9,039 bytes, line 2
2,pn(e)?fn(t,n):null!==(n=Ne(e,t,n,i))&&(sr(n,0,i),mn(n,t,i))}function un(e,t,n){hn(e,t,n,rr())}function hn(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pn(e))fn(t,r);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,o=a(s,n);if(r.hasEagerState=!0,r.eagerState=o,fl(o,s))return Le(e,t,r,0),null===au&&Ie(),!1}catch(l){}if(null!==(n=Ne(e,t,r,i)))return sr(n,0,i),mn(n,t,i),!0}return!1}function dn(e,t,n,r){if(r={lane:2,revertLane:ge(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pn(e)){if(t)throw Error(i(479))}else null!==(t=Ne(e,n,r,2))&&sr(t,0,2)}function pn(e){var t=e.alternate;return e===Mc||null!==t&&t===Mc}function fn(e,t){Ac=Ec=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mn(e,t,n){if(0!==(4194048&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,w(e,n)}}function gn(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:sa({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}function vn(e,t,n,i,r,a,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,a,s):!t.prototype||!t.prototype.isPureReactComponent||!be(n,i)||!be(r,a)}function _n(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Fc.enqueueReplaceState(t,t.state,null)}function yn(e,t){var n=t;if("ref"in t)for(var i in n={},t)"ref"!==i&&(n[i]=t[i]);if(e=e.defaultProps)for(var r in n===t&&(n=sa({},n)),e)void 0===n[r]&&(n[r]=e[r]);return n}function xn(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function bn(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Sn(e,t,n){return(n=Be(n)).tag=3,n.payload={element:null},n.callback=function(){xn(e,t)},n}function Mn(e){return(e=Be(e)).tag=3,e}function wn(e,t,n,i){var r=n.type.getDerivedStateFromError;if("function"==typeof r){var a=i.value;e.payload=function(){return r(a)},e.callback=function(){bn(t,n,i)}}var s=n.stateNode;null!==s&&"function"==typeof s.componentDidCatch&&(e.callback=function(){bn(t,n,i),"function"!=typeof r&&(null===Au?Au=new Set([this]):Au.add(this));var e=i.stack;this.componentDidCatch(i.value,{componentStack:null!==e?e:""})})}function Tn(e,t,n,i){t.child=null===e?hc(t,null,n,i):uc(t,e.child,n,i)}function En(e,t,n,i,r){n=n.render;var a=t.ref;if("ref"in i){var s={};for(var o in i)"ref"!==o&&(s[o]=i[o])}else s=i;return ne(t),i=rt(e,t,n,s,a,r),o=lt(),null===e||Bc?(Ul&&o&&O(t),t.flags|=1,Tn(e,t,i,r),t.child):(ct(e,t,r),Yn(e,t,r))}function An(e,t,n,i,r){if(null===e){var a=n.type;return"function"!=typeof a||Hr(a)||void 0!==a.defaultProps||null!==n.compare?((e=jr(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Cn(e,t,a,i,r))}if(a=e.child,!Zn(e,r)){var s=a.memoizedProps;if((n=null!==(n=n.compare)?n:be)(s,i)&&e.ref===t.ref)return Yn(e,t,r)}return t.flags|=1,(e=Gr(a,i)).ref=t.ref,e.return=t,t.child=e}function Cn(e,t,n,i,r){if(null!==e){var a=e.memoizedProps;if(be(a,i)&&e.ref===t.ref){if(Bc=!1,t.pendingProps=i=a,!Zn(e,r))return t.lanes=e.lanes,Yn(e,t,r);0!==(131072&e.flags)&&(Bc=!0)}}return Dn(e,t,n,i,r)}function Rn(e,t,n,i){var r=i.children,a=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===i.mode){if(0!==(128&t.flags)){if(a=null!==a?a.baseLanes|n:n,null!==e){for(i=t.child=e.child,r=0;null!==i;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a}else i=0,t.child=null;return In(e,t,a,n,i)}if(0===(536870912&n))return i=t.lanes=536870912,In(e,t,null!==a?a.baseLanes|n:n,n,i);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&ye(0,null!==a?a.cachePool:null),null!==a?qe(t,a):Ye(),Qe(t)}else null!==a?(ye(0,a.cachePool),qe(t,a),$e(),t.memoizedState=null):(null!==e&&ye(0,null),Ye(),$e());return Tn(e,t,r,n),t.child}function Pn(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function In(e,t,n,i,r){var a=_e();return a=null===a?null:{parent:Ha?Wl._currentValue:Wl._currentValue2,pool:a},t.memoizedState={baseLanes:n,cachePool:a},null!==e&&ye(0,null),Ye(),Qe(t),null!==e&&ee(e,t,i,!0),t.childLanes=r,null}function Ln(e,t){return(t=Gn({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function Nn(e,t,n){return uc(t,e.child,null,n),(e=Ln(t,t.pendingProps)).flags|=2,et(t),t.memoizedState=null,e}function Un(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(i(284));(null===e||e.ref!==n)&&(t.flags|=4194816)}}function Dn(e,t,n,i,r){return ne(t),n=rt(e,t,n,i,void 0,r),i=lt(),null===e||Bc?(Ul&&i&&O(t),t.flags|=1,Tn(e,t,n,r),t.child):(ct(e,t,r),Yn(e,t,r))}function On(e,t,n,i,r,a){return ne(t),t.updateQueue=null,n=st(t,i,n,r),at(e),i=lt(),null===e||Bc?(Ul&&i&&O(t),t.flags|=1,Tn(e,t,n,a),t.child):(ct(e,t,a),Yn(e,t,a))}function Fn(e,t,n,i,r){if(ne(t),null===t.stateNode){var a=Yo,s=n.contextType;"object"==typeof s&&null!==s&&(a=ie(s)),a=new n(i,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=Fc,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=i,a.state=t.memoizedState,a.refs={},Fe(t),s=n.contextType,a.context="object"==typeof s&&null!==s?ie(s):Yo,a.state=t.memoizedState,"function"==typeof(s=n.getDerivedStateFromProps)&&(gn(t,n,s,i),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(s=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),s!==a.state&&Fc.enqueueReplaceState(a,a.state,null),We(t,i,a,r),Ge(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),i=!0}else if(null===e){a=t.stateNode;var o=t.memoizedProps,l=yn(n,o);a.props=l;var c=a.context,u=n.contextType;s=Yo,"object"==typeof u&&null!==u&&(s=ie(u));var h=n.getDerivedStateFromProps;u="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate,o=t.pendingProps!==o,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o||c!==s)&&_n(t,a,i,s),mc=!1;var d=t.memoizedState;a.state=d,We(t,i,a,r),Ge(),c=t.memoizedState,o||d!==c||mc?("function"==typeof h&&(gn(t,n,h,i),c=t.memoizedState),(l=mc||vn(t,n,l,i,d,c,s))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),a.props=i,a.state=c,a.context=s,i=l):("function"==typeof a.componentDidMount&&(t.flags|=4194308),i=!1)}else{a=t.stateNode,ze(e,t),u=yn(n,s=t.memoizedProps),a.props=u,h=t.pendingProps,d=a.context,c=n.contextType,l=Yo,"object"==typeof c&&null!==c&&(l=ie(c)),(c="function"==typeof(o=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==h||d!==l)&&_n(t,a,i,l),mc=!1,d=t.memoizedState,a.state=d,We(t,i,a,r),Ge();var p=t.memoizedState;s!==h||d!==p||mc||null!==e&&null!==e.dependencies&&te(e.dependencies)?("function"==typeof o&&(gn(t,n,o,i),p=t.memoizedState),(u=mc||vn(t,n,u,i,d,p,l)||null!==e&&null!==e.dependencies&&te(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=p),a.props=i,a.state=p,a.context=l,i=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),i=!1)}return a=i,Un(e,t),i=0!==(128&t.flags),a||i?(a=t.stateNode,n=i&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&i?(t.child=uc(t,e.child,null,r),t.child=uc(t,null,n,r)):T
2n(e,t,n,r),t.memoizedState=a.state,e=t.child):e=Yn(e,t,r),e}function zn(e,t,n,i){return q(),t.flags|=256,Tn(e,t,n,i),t.child}function Bn(e){return{baseLanes:e,cachePool:xe()}}function kn(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=_u),e}function Vn(e,t,n){var r,a=t.pendingProps,s=!1,o=0!==(128&t.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&0!==(2&bc.current)),r&&(s=!0,t.flags&=-129),r=0!==(32&t.flags),t.flags&=-33,null===e){if(Ul){if(s?Je(t):$e(),(e=Nl)?null!==(e=io(e,Ol))&&(t.memoizedState={dehydrated:e,treeContext:null!==Tl?{id:El,overflow:Al}:null,retryLane:536870912,hydrationErrors:null},(n=Yr(e)).return=t,t.child=n,Ll=t,Nl=null):e=null,null===e)throw G(t);return Hs(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;return a=a.fallback,s?($e(),l=Gn({mode:"hidden",children:l},s=t.mode),a=Xr(a,s,n,null),l.return=t,a.return=t,l.sibling=a,t.child=l,(a=t.child).memoizedState=Bn(n),a.childLanes=kn(e,r,n),t.memoizedState=kc,Pn(null,a)):(Je(t),Hn(t,l))}var c=e.memoizedState;if(null!==c&&null!==(l=c.dehydrated)){if(o)256&t.flags?(Je(t),t.flags&=-257,t=Wn(e,t,n
vendor: 4,325 bytes, line 2
2)):null!==t.memoizedState?($e(),t.child=e.child,t.flags|=128,t=null):($e(),l=a.fallback,s=t.mode,a=Gn({mode:"visible",children:a.children},s),(l=Xr(l,s,n,null)).flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,uc(t,e.child,null,n),(a=t.child).memoizedState=Bn(n),a.childLanes=kn(e,r,n),t.memoizedState=kc,t=Pn(null,a));else if(Je(t),Hs(l))r=Gs(l).digest,(a=Error(i(419))).stack="",a.digest=r,Z({value:a,source:null,stack:null}),t=Wn(e,t,n);else if(Bc||ee(e,t,n,!1),r=0!==(n&e.childLanes),Bc||r){if(null!==(r=au)&&0!==(a=T(r,n))&&a!==c.retryLane)throw c.retryLane=a,Ue(e,a),sr(r,0,a),zc;Vs(l)||_r(),t=Wn(e,t,n)}else Vs(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,ja&&(Nl=Qs(l),Ll=t,Ul=!0,Dl=null,Ol=!1,null!==e&&z(t,e)),(t=Hn(t,a.children)).flags|=4096);return t}return s?($e(),l=a.fallback,s=t.mode,o=(c=e.child).sibling,(a=Gr(c,{mode:"hidden",children:a.children})).subtreeFlags=65011712&c.subtreeFlags,null!==o?l=Gr(o,l):(l=Xr(l,s,n,null)).flags|=2,l.return=t,a.return=t,a.sibling=l,t.child=a,Pn(null,a),a=t.child,null===(l=e.child.memoizedState)?l=Bn(n):(null!==(s=l.cachePool)?(c=Ha?Wl._currentValue:Wl._currentValue2,s=s.parent!==c?{parent:c,pool:c}:s):s=xe(),l={baseLanes:l.baseLanes|n,cachePool:s}),a.memoizedState=l,a.childLanes=kn(e,r,n),t.memoizedState=kc,Pn(e.child,a)):(Je(t),e=(n=e.child).sibling,(n=Gr(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Hn(e,t){return(t=Gn({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Gn(e,n){return(e=t(22,e,null,n)).lanes=0,e}function Wn(e,t,n){return uc(t,e.child,null,n),(e=Hn(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function jn(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),Q(e.return,t,n)}function Xn(e,t,n,i,r,a){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r,s.treeForkCount=a)}function qn(e,t,n){var i=t.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var s=bc.current,o=0!==(2&s);if(o?(s=1&s|2,t.flags|=128):s&=1,f(bc,s),Tn(e,t,i,n),i=Ul?Sl:0,!o&&null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&jn(e,n,t);else if(19===e.tag)jn(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===tt(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Xn(t,!1,r,n,a,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===tt(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Xn(t,!0,n,null,a,i);break;case"together":Xn(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Yn(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),mu|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(ee(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Gr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Gr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Zn(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!te(e))}function Jn(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Bc=!0;else{if(!Zn(e,n)&&0===(128&t.flags))return Bc=!1,function(e,t,n){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),J(0,Wl,e.memoizedState.cache),q();break;case 27:case 5:V(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:J(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Ke(t),null;break;case 13:var i=t.memoizedState;if(null!==i)return null!==i.dehydrated?(Je(t),t.flags|=128,null):0!==(n&t.child.childLanes)?Vn(e,t,n):(Je(t),null!==(e=Yn(e,t,n))?e.sibling:null);Je(t);break;case 19:var r=0!==(128&e.flags);if((i=0!==(n&t.childLanes))||(ee(e,t,n,!1),i=0!==(n&t.childLanes)),r){if(i)return qn(e,t,n
2);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),f(bc,bc.current),i)break;return null;case 22:return t.lanes=0,Rn(e,t,n,t.pendingProps);case 24:J(0,Wl,e.memoizedState.cache)}return Yn(e,t,n)}(e,t,n);Bc=0!==(131072&e.flags)}else Bc=!1,Ul&&0!==(1048576&t.flags)&&D(t,Sl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=we(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var a=e.$$typeof;if(a===ma){t.tag=11,t=En(null,t,e,r,n);break e}if(a===_a){t.tag=14,t=An(null,t,e,r,n);break e}}throw t=h(e)||e,Error(i(306,t,""))}Hr(e)?(r=yn(e,r),t.tag=1,t=Fn(null,t,e,r,n)):(t.tag=0,t=Dn(null,t,e,r,n))}return t;case 0:return Dn(e,t,t.type,t.pendingProps,n);case 1:return Fn(e,t,r=t.type,a=yn(r,t.pendingProps),n);case 3:e:{if(B(t,t.stateNode.containerInfo),null===e)throw Error(i(387));var s=t.pendingProps;r=(a=t.memoizedState).element,ze(e,t),We(t,s,null,n);var o=t.memoizedState;if(s=o.cache,J(0,Wl,s),s!==a.cache&&$(t,[Wl],n,!0),Ge(),s=o.element,ja&&a.isDehydrated){if(a={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=zn(e,t,s,n);break e}if(s!==r){Z(r=N(Error(i(424)),t)),t=zn(e,t,s,n);break e}for(ja&&(Nl=Js(t.stateNode.containerInfo),Ll=t,Ul=!0,Dl=null,Ol=!0),n=hc(t,null,s,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(q(),s===r){t=Yn(e,t,n);break e}Tn(e,t,s,n)}t=t.child}return t;case 26:if(Eo)return Un(e,t),null===e?(n=Ro(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ul||(t.stateNode=Do(t.type,t.pendingProps,Pl.current,t)):t.memoizedState=Ro(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:if(ko)return V(t),null===e&&ko&&Ul&&(r=t.stateNode=Vo(t.type,t.pendingProps,Pl.current,Cl.current,!1),Ll=t,Ol=!0,Nl=$s(t.type,r,Nl)),Tn(e,t,t.pendingProps.children,n),Un(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&Ul&&(wo(t.type,t.pendingProps,Cl.current),(a=r=Nl)&&(null!==(r=eo(r,t.type,t.pendingProps,Ol))?(t.stateNode=r,Ll=t,Nl=Zs(r),Ol=!1,a=!0):a=!1),a||G(t)),V(t),a=t.type,s=t.pendingProps,o=null!==e?e.memoizedProps:null,r=s.children,Fa(a,s)?r=null:null!==o&&Fa(a,o)&&(t.flags|=32),null!==t.memoizedState&&(a=rt(e,t,ot,null,null,n),Ha?os._currentValue=a:os._currentValue2=a),Un(e,t),Tn(e,t,r,n),t.child;case 6:return null===e&&Ul&&(To(t.pendingProps,Cl.current),(e=n=Nl)&&(null!==(n=to(n,t.pendingProps,Ol))?(t.stateNode=n,Ll=t,Nl=null,e=!0):e=!1),e||G(t)),null;case 13:return Vn(e,t,n);case 4:return B(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=uc(t,null,r,n):Tn(e,t,r,n),t.child;case 11:return En(e,t,t.type,t.pendingProps,n);case 7:return Tn(e,t,t.pendingProps,n),t.child;case 8:case 12:return Tn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,J(0,t.type,r.value),Tn(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ne(t),r=r(a=ie(a)),t.flags|=1,Tn(e,t,r,n),t.child;case 14:return An(e,t,t.type,t.pendingProps,n);case 15:return Cn(e,t,t.type,t.pendingProps,n);case 19:return qn(e,t,n);case 31:return function(e,t,n){var r=t.pendingProps,a=0!==(128&t.flags);if(t.flags&=-129,null===e){if(Ul){if("hidden"===r.mode)return e=Ln(t,r),t.lanes=536870912,Pn(null,e);if(Ke(t),(e=Nl)?null!==(e=no(e,Ol))&&(t.memoizedState={dehydrated:e,treeContext:null!==Tl?{id:El,overflow:Al}:null,retryLane:536870912,hydrationErrors:null},(n=Yr(e)).return=t,t.child=n,Ll=t,Nl=null):e=null,null===e)throw G(t);return t.lanes=536870912,null}return Ln(t,r)}var s=e.memoizedState;if(null!==s){var o=s.dehydrated;if(Ke(t),a)if(256&t.flags)t.flags&=-257,t=Nn(e,t,n);else{if(null===t.memoizedState)throw Error(i(558));t.child=e.child,t.flags|=128,t=null}else if(Bc||ee(e,t,n,!1),a=0!==(n&e.childLanes),Bc||a){if(null!==(r=au)&&0!==(o=T(r,n))&&o!==s.retryLane)throw s.retryLane=o,Ue(e,o),sr(r,0,o),zc;_r(),t=Nn(e,t,n)}else e=s.treeContext,ja&&(Nl=Ks(o),Ll=t,Ul=!0,Dl=null,Ol=!1,null!==e&&z(t,e)),(t=Ln(t,r)).flags|=4096;return t}return(e=Gr(e.child,{mode:r.mode,children:r.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Rn(e,t,n,t.pendingProps);case 24:return ne(t),r=ie(Wl),null===e?(null===(a=_e())&&(a=au,s=se(),a.pooledCache=s,s.refCount++,null!==s&&(a.pooledCacheLanes|=n),a=s),t.memoizedState={parent:r,cache:a},Fe(t),J(0,Wl,a)):(0!==(e.lanes&n)&&(ze(e,t),We(t,null,null,n),Ge()),a=e.memoizedState,s=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),J(0,Wl,r)):(r=s.cache,J(0,Wl,r),r!==a.cache&&$(t,[Wl],n,!0))),Tn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Kn(e){e.flags|=4}function Qn(e){Wa&&(e.flags|=8)}function $n(e,t){if(null!==e&&e.child===t.child)return!1;if(0!==(16&t.flags))return!0;for(e=t.child;null!==e;){if(0!==(8218&e.flags)||0!==(8218&e.subtreeFlags))return!0;e=e.sibling}return!1}function ei(e,t,n,i){if(Ga)for(n=t.child;null!==n;){if(5===n.tag||6===n.tag)Da(e,n.stateNode);else if(!(4===n.tag||ko&&27===n.tag)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else if(Wa)for(var r=t.child;null!==r;){if(5===r.tag){var a=r.stateNode;n&&i&&(a=Bs(a,r.type,r.memoizedProps)),Da(e,a)}else if(6===r.tag)a=r.stateNode,n&&i&&(a=ks(a,r.memoizedProps)),Da(e,a);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(a=r.child)&&(a.return=r),ei(e,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function ti(e,t,n,i){var r=!1;if(Wa)for(var a=t.child;null!==a;){if(5===a.tag){var s=a.stateNode;n&&i&&(s=Bs(s,a.type,a.memoizedProps)),Os(e,s)}else if(6===a.tag)s=a.stateNode,n&&i&&(s=ks(s,a.memoizedProps)),Os(e,s);else if(4!==a.tag)if(22===a.tag&&null!==a.memoizedState)null!==(r=a.child)&&(r.return=a),ti(e,a,!0,!0),r=!0;else if(null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return r;a=a.return}a.sibling.return=a.return,a=a.sibling}return r}function ni(e,t){if(Wa&&$n(e,t)){var n=(e=t.stateNode).containerInfo,i=Ds();ti(i,t,!1,!1),e.pendingChildren=i,Kn(t),Fs(n,i)}}function ii(e,t,n,i){if(Ga)e.memoizedProps!==i&&Kn(t);else if(Wa){var r=e.stateNode,a=e.memoizedProps;if((e=$n(e,t))||a!==i){var s=Cl.current;(a=Us(r,n,a,i,!e,null))===r?t.stateNode=r:(Qn(t),Oa(a,n,i,s)&&Kn(t),t.stateNode=a,e&&ei(a,t,!1,!1))}else t.stateNode=r}}function ri(e,t,n,i,r){if(0!==(32&e.mode)&&(null===n?$a(t,i):es(t,n,i))){if(e.flags|=16777216,(335544128&r)===r||ts(t,i))if(ns(e.stateNode,t,i))e.flags|=8192;else{if(!mr())throw oc=sc,rc;e.flags|=8192}}else e.flags&=-16777217}function ai(e,t){if(Fo(t)){if(e.flags|=16777216,!zo(t)){if(!mr())throw oc=sc,rc;e.flags|=8192}}else e.flags&=-16777217}function si(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?x():536870912,e.lanes|=t,yu|=t)}function oi(e,t){if(!Ul)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function li(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=65011712&r.subtreeFlags,i|=65011712&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function ci(e,t,n){var r=t.pendingProps;switch(F(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return li(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),K(Wl),k(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(null===e||null===e.child)&&(X(t)?Kn(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,Y())),ni(e,t),li(t),null;case 26:if(Eo){var a=t.type,s=t.memoizedState;return null===e?(Kn(t),null!==s?(li(t),ai(t,s)):(li(t),ri(t,a,null,r,n))):s?s!==e.memoizedState?(Kn(t),li(t),ai(t,s)):(li(t),t.flags&=-16777217):(s=e.memoizedProps,Ga?s!==r&&Kn(t):ii(e,t,a,r),li(t),ri(t,a,s,r,n
2)),null}case 27:if(ko){if(H(t),n=Pl.current,a=t.type,null!==e&&null!=t.stateNode)Ga?e.memoizedProps!==r&&Kn(t):ii(e,t,a,r);else{if(!r){if(null===t.stateNode)throw Error(i(166));return li(t),null}e=Cl.current,X(t)?W(t,e):(e=Vo(a,r,n,e,!0),t.stateNode=e,Kn(t))}return li(t),null}case 5:if(H(t),a=t.type,null!==e&&null!=t.stateNode)ii(e,t,a,r);else{if(!r){if(null===t.stateNode)throw Error(i(166));return li(t),null}if(s=Cl.current,X(t))W(t,s),mo(t.stateNode,a,r,s)&&(t.flags|=64);else{var o=Ua(a,r,Pl.current,s,t);Qn(t),ei(o,t,!1,!1),t.stateNode=o,Oa(o,a,r,s)&&Kn(t)}}return li(t),ri(t,t.type,null===e?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)n=e.memoizedProps,Ga?n!==r&&Kn(t):Wa&&(n!==r?(e=Pl.current,n=Cl.current,Qn(t),t.stateNode=za(r,e,n,t)):t.stateNode=e.stateNode);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=Pl.current,n=Cl.current,X(t)){if(!ja)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(a=Ll))switch(a.tag){case 27:case 5:r=a.memoizedProps}ao(e,n,t,r)||G(t,!0)}else Qn(t),t.stateNode=za(r,e,n,t)}return li(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=X(t),null!==n){if(null===e){if(!r)throw Error(i(318));if(!ja)throw Error(i(556));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(i(557));so(e,t)}else q(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;li(t),e=!1}else n=Y(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(et(t),t):(et(t),null);if(0!==(128&t.flags))throw Error(i(558))}return li(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=X(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!ja)throw Error(i(344));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));oo(a,t)}else q(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;li(t),a=!1}else a=Y(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(et(t),t):(et(t),null)}return et(t),0!==(128&t.flags)?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(a=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(a=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),si(t,t.updateQueue),li(t),null);case 4:return k(),ni(e,t),null===e&&qa(t.stateNode.containerInfo),li(t),null;case 10:return K(t.type),li(t),null;case 19:if(p(bc),null===(r=t.memoizedState))return li(t),null;if(a=0!==(128&t.flags),null===(s=r.rendering))if(a)oi(r,!1);else{if(0!==fu||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(s=tt(e))){for(t.flags|=128,oi(r,!1),e=s.updateQueue,t.updateQueue=e,si(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Wr(n,e),n=n.sibling;return f(bc,1&bc.current|2),Ul&&U(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&al()>Tu&&(t.flags|=128,a=!0,oi(r,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=tt(s))){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,si(t,e),oi(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!Ul)return li(t),null}else 2*al()-r.renderingStartTime>Tu&&536870912!==n&&(t.flags|=128,a=!0,oi(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=al(),e.sibling=null,n=bc.current,f(bc,a?1&n|2:1&n),Ul&&U(t,r.treeForkCount),e):(li(t),null);case 22:case 23:return et(t),Ze(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!==(536870912&n)&&0===(128&t.flags)&&(li(t),6&t.subtreeFlags&&(t.flags|=8192)):li(t),null!==(n=t.updateQueue)&&si(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&p(nc),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),K(Wl),li(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}function ui(e,t){switch(F(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return K(Wl),k(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return H(t),null;case 31:if(null!==t.memoizedState){if(et(t),null===t.alternate)throw Error(i(340));q()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(et(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));q()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return p(bc),null;case 4:return k(),null;case 10:return K(t.type),null;case 22:case 23:return et(t),Ze(),null!==e&&p(nc),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return K(Wl),null;default:return null}}function hi(e,t){switch(F(t),t.tag){case 3:K(Wl),k();break;case 26:case 27:case 5:H(t);break;case 4:k();break;case 31:null!==t.memoizedState&&et(t);break;case 13:et(t);break;case 19:p(bc);break;case 10:K(t.type);break;case 22:case 23:et(t),Ze(),null!==e&&p(nc);break;case 24:K(Wl)}}function di(e,t){try{var n=t.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var a=n.create,s=n.inst;i=a(),s.destroy=i}n=n.next}while(n!==r)}}catch(o){Dr(t,t.return,o)}}function pi(e,t,n){try{var i=t.updateQueue,r=null!==i?i.lastEffect:null;
2if(null!==r){var a=r.next;i=a;do{if((i.tag&e)===e){var s=i.inst,o=s.destroy;if(void 0!==o){s.destroy=void 0,r=t;var l=n,c=o;try{c()}catch(u){Dr(r,l,u)}}}i=i.next}while(i!==a)}}catch(u){Dr(t,t.return,u)}}function fi(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Xe(t,n)}catch(i){Dr(e,e.return,i)}}}function mi(e,t,n){n.props=yn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Dr(e,t,i)}}function gi(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var i=Ra(e.stateNode);break;default:i=e.stateNode}"function"==typeof n?e.refCleanup=n(i):n.current=i}}catch(r){Dr(e,t,r)}}function vi(e,t){var n=e.ref,i=e.refCleanup;if(null!==n)if("function"==typeof i)try{i()}catch(r){Dr(e,t,r)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(r){Dr(e,t,r)}else n.current=null}function _i(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{Ss(i,t,n,e)}catch(r){Dr(e,e.return,r)}}function yi(e,t,n){try{Ms(e.stateNode,e.type,n,t,e)}catch(i){Dr(e,e.return,i)}}function xi(e){return 5===e.tag||3===e.tag||!!Eo&&26===e.tag||!!ko&&27===e.tag&&jo(e.type)||4===e.tag}function bi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||xi(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(ko&&27===e.tag&&jo(e.type)||2&e.flags||null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Si(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?Ts(n,e,t):xs(n,e);else if(4!==i&&(ko&&27===i&&jo(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Si(e,t,n),e=e.sibling;null!==e;)Si(e,t,n),e=e.sibling}function Mi(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?ws(n,e,t):ys(n,e);else if(4!==i&&(ko&&27===i&&jo(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}function wi(e,t,n){e=e.containerInfo;try{zs(e,n)}catch(i){Dr(t,t.return,i)}}function Ti(e){var t=e.stateNode,n=e.memoizedProps;try{Ho(e.type,n,t,e)}catch(i){Dr(e,e.return,i)}}function Ei(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Fi(e,n),4&i&&di(5,n);break;case 1:if(Fi(e,n),4&i)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(s){Dr(n,n.return,s)}else{var r=yn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Dr(n,n.return,s)}}64&i&&fi(n),512&i&&gi(n,n.return);break;case 3:if(Fi(e,n),64&i&&null!==(i=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 27:case 5:e=Ra(n.child.stateNode);break;case 1:e=n.child.stateNode}try{Xe(i,e)}catch(s){Dr(n,n.return,s)}}break;case 27:ko&&null===t&&4&i&&Ti(n);case 26:case 5:if(Fi(e,n),null===t)if(4&i)_i(n);else if(64&i){e=n.type,t=n.memoizedProps,r=n.stateNode;try{uo(r,e,t,n)}catch(s){Dr(n,n.return,s)}}512&i&&gi(n,n.return);break;case 12:Fi(e,n);break;case 31:Fi(e,n),4&i&&Pi(e,n);break;case 13:Fi(e,n),4&i&&Ii(e,n),64&i&&null!==(i=n.memoizedState)&&null!==(i=i.dehydrated)&&(n=Br.bind(null,n),Ws(i,n));break;case 22:if(!(i=null!==n.memoizedState||Vc)){t=null!==t&&null!==t.memoizedState||Hc,r=Vc;var a=Hc;Vc=i,(Hc=t)&&!a?Bi(e,n,0!==(8772&n.subtreeFlags)):Fi(e,n),Vc=r,Hc=a}break;case 30:break;default:Fi(e,n)}}function Ai(e){var t=e.alternate;null!==t&&(e.alternate=null,Ai(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Qa(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ci(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(pl&&"function"==typeof pl.onCommitFiberUnmount)try{pl.onCommitFiberUnmount(dl,n)}catch(a){}switch(n.tag){case 26:if(Eo){Hc||vi(n,t),Ci(e,t,n),n.memoizedState?Io(n.memoizedState):n.stateNode&&Uo(n.stateNode);break}case 27:if(ko){Hc||vi(n,t);var i=Xc,r=qc;jo(n.type)&&(Xc=n.stateNode,qc=!1),Ci(e,t,n),Go(n.stateNode),Xc=i,qc=r;break}case 5:Hc||vi(n,t);case 6:if(Ga){if(i=Xc,r=qc,Xc=null,Ci(e,t,n),qc=r,null!==(Xc=i))if(qc)try{As(Xc,n.stateNode)}
2catch(s){Dr(n,t,s)}else try{Es(Xc,n.stateNode)}catch(s){Dr(n,t,s)}}else Ci(e,t,n);break;case 18:Ga&&null!==Xc&&(qc?_o(Xc,n.stateNode):vo(Xc,n.stateNode));break;case 4:Ga?(i=Xc,r=qc,Xc=n.stateNode.containerInfo,qc=!0,Ci(e,t,n),Xc=i,qc=r):(Wa&&wi(n.stateNode,n,Ds()),Ci(e,t,n));break;case 0:case 11:case 14:case 15:pi(2,n,t),Hc||pi(4,n,t),Ci(e,t,n);break;case 1:Hc||(vi(n,t),"function"==typeof(i=n.stateNode).componentWillUnmount&&mi(n,t,i)),Ci(e,t,n);break;case 21:Ci(e,t,n);break;case 22:Hc=(i=Hc)||null!==n.memoizedState,Ci(e,t,n),Hc=i;break;default:Ci(e,t,n)}}function Pi(e,t){if(ja&&null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{po(e)}catch(n){Dr(t,t.return,n)}}}function Ii(e,t){if(ja&&null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{fo(e)}catch(n){Dr(t,t.return,n)}}function Li(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Wc),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Wc),t;default:throw Error(i(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var i=kr.bind(null,e,t);t.then(i,i)}})}function Ni(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r],s=e,o=t;if(Ga){var l=o;e:for(;null!==l;){switch(l.tag){case 27:if(ko){if(jo(l.type)){Xc=l.stateNode,qc=!1;break e}break}case 5:Xc=l.stateNode,qc=!1;break e;case 3:case 4:Xc=l.stateNode.containerInfo,qc=!0;break e}l=l.return}if(null===Xc)throw Error(i(160));Ri(s,o,a),Xc=null,qc=!1}else Ri(s,o,a);null!==(s=a.alternate)&&(s.return=null),a.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Ui(t,e),t=t.sibling}function Ui(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ni(t,e),Di(e),4&r&&(pi(3,e,e.return),di(3,e),pi(5,e,e.return));break;case 1:Ni(t,e),Di(e),512&r&&(Hc||null===n||vi(n,n.return)),64&r&&Vc&&null!==(e=e.updateQueue)&&null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r));break;case 26:if(Eo){var a=Yc;if(Ni(t,e),Di(e),512&r&&(Hc||null===n||vi(n,n.return)),4&r){r=null!==n?n.memoizedState:null;var s=e.memoizedState;null===n?null===s?null===e.stateNode?e.stateNode=Lo(a,e.type,e.memoizedProps,e):No(a,e.type,e.stateNode):e.stateNode=Po(a,s,e.memoizedProps):r!==s?(null===r?null!==n.stateNode&&Uo(n.stateNode):Io(r),null===s?No(a,e.type,e.stateNode):Po(a,s,e.memoizedProps)):null===s&&null!==e.stateNode&&yi(e,e.memoizedProps,n.memoizedProps)}break}case 27:if(ko){Ni(t,e),Di(e),512&r&&(Hc||null===n||vi(n,n.return)),null!==n&&4&r&&yi(e,e.memoizedProps,n.memoizedProps);break}case 5:if(Ni(t,e),Di(e),512&r&&(Hc||null===n||vi(n,n.return)),Ga){if(32&e.flags){a=e.stateNode;try{Cs(a)}catch(d){Dr(e,e.return,d)}}4&r&&null!=e.stateNode&&yi(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&r&&(Gc=!0)}else Wa&&null!==e.alternate&&(e.alternate.stateNode=e.stateNode);break;case 6:if(Ni(t,e),Di(e),4&r&&Ga){if(null===e.stateNode)throw Error(i(162));r=e.memoizedProps,n=null!==n?n.memoizedProps:r,a=e.stateNode;try{bs(a,n,r)}catch(d){Dr(e,e.return,d)}}break;case 3:if(Eo?(Oo(),a=Yc,Yc=Co(t.containerInfo),Ni(t,e),Yc=a):Ni(t,e),Di(e),4&r){if(Ga&&ja&&null!==n&&n.memoizedState.isDehydrated)try{ho(t.containerInfo)}catch(d){Dr(e,e.return,d)}if(Wa){r=t.containerInfo,n=t.pendingChildren;try{zs(r,n)}catch(d){Dr(e,e.return,d)}}}Gc&&(Gc=!1,Oi(e));break;case 4:Eo?(n=Yc,Yc=Co(e.stateNode.containerInfo),Ni(t,e),Di(e),Yc=n):(Ni(t,e),Di(e)),4&r&&Wa&&wi(e.stateNode,e,e.stateNode.pendingChildren);break;case 12:Ni(t,e),Di(e);break;case 31:Ni(t,e),Di(e),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,Li(e,r));break;case 13:Ni(t,e),Di(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Mu=al()),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,Li(e,r));break;case 22:a=null!==e.memoizedState;var o=null!==n&&null!==n.memoizedState,l=Vc,c=Hc;if(Vc=l||a,Hc=c||o,Ni(t,e),Hc=c,Vc=l,Di(e),8192&r&&((t=e.stateNode)._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||o||Vc||Hc||zi(e)),Ga))e:if(n=null,Ga)for(t=e;;){if(5===t.tag||Eo&&26===t.tag){if(null===n){o=n=t;try{s=o.stateNode,a?Rs(s):Is(o.stateNode,o.memoizedProps)}catch(d){Dr(o,o.return,d)}}}else if(6===t.tag){if(null===n){o=t;try{var u=o.stateNode;a?Ps(u):Ls(u,o.memoizedProps)}catch(d){Dr(o,o.return,d)}}}else if(18===t.tag){if(null===n){o=t;try{var h=o.stateNode;a?yo(h):xo(o.stateNode)}catch(d){Dr(o,o.return,d)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&null!==(r=e.updateQueue)&&null!==(n=r.retryQueue)&&(r.retryQueue=null,Li(e,n));break;case 19:Ni(t,e),Di(e),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,Li(e,r));break;case 30:case 21:break;default:Ni(t,e),Di(e)}}function Di(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(xi(r)){n=r;break}r=r.return}if(Ga){if(null==n)throw Error(i(160));switch(n.tag){case 27:if(ko){var a=n.stateNode;Mi(e,bi(e),a);break}case 5:var s=n.stateNode;32&n.flags&&(Cs(s),n.flags&=-33),Mi(e,bi(e),s);break;case 3:case 4:var o=n.stateNode.containerInfo;Si(e,bi(e),o);break;default:throw Error(i(161))}}}catch(l){Dr(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Oi(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Oi(t),5===t.tag&&1024&t.flags&&ls(t.stateNode),e=e.sibling}}function Fi(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Ei(e,t.alternate,t),t=t.sibling}function zi(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pi(4,t,t.return),zi(t);break;case 1:vi(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&mi(t,t.return,n),zi(t);break;case 27:ko&&Go(t.stateNode);case 26:case 5:vi(t,t.return),zi(t);break;case 22:null===t.memoizedState&&zi(t);break;default:zi(t)}e=e.sibling}}function Bi(e,t,n){for(n=n&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var i=t.alternate,r=e,a=t,s=a.flags;switch(a.tag){case 0:case 11:case 15:Bi(r,a,n),di(4,a);break;case 1:if(Bi(r,a,n),"function"==typeof(r=(i=a).stateNode).componentDidMount)try{r.componentDidMount()}catch(c){Dr(i,i.return,c)}if(null!==(r=(i=a).updateQueue)){var o=i.stateNode;try{var l=r.shared.hiddenCallbacks;
2if(null!==l)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)je(l[r],o)}catch(c){Dr(i,i.return,c)}}n&&64&s&&fi(a),gi(a,a.return);break;case 27:ko&&Ti(a);case 26:case 5:Bi(r,a,n),n&&null===i&&4&s&&_i(a),gi(a,a.return);break;case 12:Bi(r,a,n);break;case 31:Bi(r,a,n),n&&4&s&&Pi(r,a);break;case 13:Bi(r,a,n),n&&4&s&&Ii(r,a);break;case 22:null===a.memoizedState&&Bi(r,a,n),gi(a,a.return);break;case 30:break;default:Bi(r,a,n)}t=t.sibling}}function ki(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&oe(n))}function Vi(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&oe(e))}function Hi(e,t,n,i){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)Gi(e,t,n,i),t=t.sibling}function Gi(e,t,n,i){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Hi(e,t,n,i),2048&r&&di(9,t);break;case 1:case 31:case 13:default:Hi(e,t,n,i);break;case 3:Hi(e,t,n,i),2048&r&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&oe(e)));break;case 12:if(2048&r){Hi(e,t,n,i),e=t.stateNode;try{var a=t.memoizedProps,s=a.id,o=a.onPostCommit;"function"==typeof o&&o(s,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Dr(t,t.return,l)}}else Hi(e,t,n,i);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,null!==t.memoizedState?2&a._visibility?Hi(e,t,n,i):ji(e,t):2&a._visibility?Hi(e,t,n,i):(a._visibility|=2,Wi(e,t,n,i,0!==(10256&t.subtreeFlags)||!1)),2048&r&&ki(s,t);break;case 24:Hi(e,t,n,i),2048&r&&Vi(t.alternate,t)}}function Wi(e,t,n,i,r){for(r=r&&(0!==(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var a=e,s=t,o=n,l=i,c=s.flags;switch(s.tag){case 0:case 11:case 15:Wi(a,s,o,l,r),di(8,s);break;case 23:break;case 22:var u=s.stateNode;null!==s.memoizedState?2&u._visibility?Wi(a,s,o,l,r):ji(a,s):(u._visibility|=2,Wi(a,s,o,l,r)),r&&2048&c&&ki(s.alternate,s);break;case 24:Wi(a,s,o,l,r),r&&2048&c&&Vi(s.alternate,s);break;default:Wi(a,s,o,l,r)}t=t.sibling}}function ji(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:ji(n,i),2048&r&&ki(i.alternate,i);break;case 24:ji(n,i),2048&r&&Vi(i.alternate,i);break;default:ji(n,i)}t=t.sibling}}function Xi(e,t,n){if(e.subtreeFlags&Zc)for(e=e.child;null!==e;)qi(e,t,n),e=e.sibling}function qi(e,t,n){switch(e.tag){case 26:if(Xi(e,t,n),e.flags&Zc)if(null!==e.memoizedState)Bo(n,Yc,e.memoizedState,e.memoizedProps);else{var i=e.stateNode,r=e.type;e=e.memoizedProps,((335544128&t)===t||ts(r,e))&&rs(n,i,r,e)}break;case 5:Xi(e,t,n),e.flags&Zc&&(i=e.stateNode,r=e.type,e=e.memoizedProps,((335544128&t)===t||ts(r,e))&&rs(n,i,r,e));break;case 3:case 4:Eo?(i=Yc,Yc=Co(e.stateNode.containerInfo),Xi(e,t,n),Yc=i):Xi(e,t,n);break;case 22:null===e.memoizedState&&(null!==(i=e.alternate)&&null!==i.memoizedState?(i=Zc,Zc=16777216,Xi(e,t,n),Zc=i):Xi(e,t,n));break;default:Xi(e,t,n)}}function Yi(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function Zi(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];jc=i,Qi(i,e)}Yi(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Ji(e),e=e.sibling}function Ji(e){switch(e.tag){case 0:case 11:case 15:Zi(e),2048&e.flags&&pi(9,e,e.return);break;case 3:case 12:default:Zi(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Ki(e)):Zi(e)}}function Ki(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];jc=i,Qi(i,e)}Yi(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:pi(8,t,t.return),Ki(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Ki(t));break;default:Ki(t)}e=e.sibling}}function Qi(e,t){for(;null!==jc;){var n=jc;switch(n.tag){case 0:case 11:case 15:pi(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var i=n.memoizedState.cachePool.pool;null!=i&&i.refCount++}break;case 24:oe(n.memoizedState.cache)}if(null!==(i=n.child))i.return=n,jc=i;else e:for(n=e;null!==jc;){var r=(i=jc).sibling,a=i.return;if(Ai(i),i===n){jc=null;break e}if(null!==r){r.return=a,jc=r;break e}jc=a}}}function $i(e){var t=Xa(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(i(364));return t}if(null===(e=ds(e)))throw Error(i(362));return e.stateNode.current}function er(e,t){var n=e.tag;switch(t.$$typeof){case Kc:if(e.type===t.value)return!0;break;case Qc:e:{for(t=t.value,e=[e,0],n=0;n<e.length;){var r=e[n++],a=r.tag,s=e[n++],o=t[s];if(5!==a&&26!==a&&27!==a||!ms(r)){for(;null!=o&&er(r,o);)o=t[++s];if(s===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,s),r=r.sibling}}t=!1}return t;case $c:if((5===n||26===n||27===n)&&gs(e.stateNode,t.value))return!0;break;case tu:if((5===n||6===n||26===n||27===n)&&null!==(e=fs(e))&&0<=e.indexOf(t.value))return!0;break;case eu:if((5===n||26===n||27===n)&&"string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase())return!0;break;default:throw Error(i(365))}return!1}function tr(e){switch(e.$$typeof){case Kc:return"<"+(h(e.value)||"Unknown")+">";case Qc:return":has("+(tr(e)||"")+")";case $c:return'[role="'+e.value+'"]';
2case tu:return'"'+e.value+'"';case eu:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function nr(e,t){var n=[];e=[e,0];for(var i=0;i<e.length;){var r=e[i++],a=r.tag,s=e[i++],o=t[s];if(5!==a&&26!==a&&27!==a||!ms(r)){for(;null!=o&&er(r,o);)o=t[++s];if(s===t.length)n.push(r);else for(r=r.child;null!==r;)e.push(r,s),r=r.sibling}}return n}function ir(e,t){if(!hs)throw Error(i(363));e=nr(e=$i(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++],a=r.tag;if(5===a||26===a||27===a)ms(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}function rr(){return 0!==(2&ru)&&0!==ou?ou&-ou:null!==Ta.T?ge():Ja()}function ar(){if(0===_u)if(0===(536870912&ou)||Ul){var e=$o;0===(3932160&($o<<=1))&&($o=262144),_u=e}else _u=536870912;return null!==(e=yc.current)&&(e.flags|=32),_u}function sr(e,t,n){(e===au&&(2===lu||9===lu)||null!==e.cancelPendingCommit)&&(pr(e,0),ur(e,ou,_u,!1)),S(e,n),(0===(2&ru)||e!==au)&&(e===au&&(0===(2&ru)&&(gu|=n),4===fu&&ur(e,ou,_u,!1)),ce(e))}function or(e,t,n){if(0!==(6&ru))throw Error(i(327));for(var r=!n&&0===(127&t)&&0===(t&e.expiredLanes)||v(e,t),a=r?function(e,t){var n=ru;ru|=2;var r=gr(),a=vr();au!==e||ou!==t?(Eu=null,Tu=al()+500,pr(e,t)):hu=v(e,t);e:for(;;)try{if(0!==lu&&null!==su){t=su;var s=cu;t:switch(lu){case 1:lu=0,cu=null,wr(e,t,s,1);break;case 2:case 9:if(Se(s)){lu=0,cu=null,Mr(t);break}t=function(){2!==lu&&9!==lu||au!==e||(lu=7),ce(e)},s.then(t,t);break e;case 3:lu=7;break e;case 4:lu=5;break e;case 7:Se(s)?(lu=0,cu=null,Mr(t)):(lu=0,cu=null,wr(e,t,s,7));break;case 5:var o=null;switch(su.tag){case 26:o=su.memoizedState;case 5:case 27:var l=su,c=l.type,u=l.pendingProps;if(o?zo(o):ns(l.stateNode,c,u)){lu=0,cu=null;var h=l.sibling;if(null!==h)su=h;else{var d=l.return;null!==d?(su=d,Tr(d)):su=null}break t}}lu=0,cu=null,wr(e,t,s,5);break;case 6:lu=0,cu=null,wr(e,t,s,6);break;case 8:dr(),fu=6;break e;default:throw Error(i(462))}}br();break}catch(p){fr(e,p)}return kl=Bl=null,Ta.H=r,Ta.A=a,ru=n,null!==su?0:(au=null,ou=0,Ie(),fu)}(e,t):yr(e,t,!0),s=r;;){if(0===a){hu&&!r&&ur(e,t,0,!1);break}if(n=e.current.alternate,!s||cr(n)){if(2===a){if(s=t,e.errorRecoveryDisabledLanes&s)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){t=o;e:{var l=e;a=xu;var c=ja&&l.current.memoizedState.isDehydrated;if(c&&(pr(l,o).flags|=256),2!==(o=yr(l,o,!1))){if(du&&!c){l.errorRecoveryDisabledLanes|=s,gu|=s,a=4;break e}s=bu,bu=a,null!==s&&(null===bu?bu=s:bu.push.apply(bu,s))}a=o}if(s=!1,2!==a)continue}}if(1===a){pr(e,0),ur(e,t,0,!0);break}e:{switch(r=e,s=a){case 0:case 1:throw Error(i(345));case 4:if((4194048&t)!==t)break;case 6:ur(r,t,_u,!uu);break e;case 2:bu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((62914560&t)===t&&10<(a=Mu+300-al())){if(ur(r,t,_u,!uu),0!==g(r,0,!0))break e;Iu=t,r.timeoutHandle=Ba(lr.bind(null,r,n,bu,Eu,Su,t,_u,gu,yu,uu,s,"Throttled",-0,0),a)}else lr(r,n,bu,Eu,Su,t,_u,gu,yu,uu,s,null,-0,0)}break}a=yr(e,t,!1),s=!1}ce(e)}function lr(e,t,n,i,r,a,s,o,l,c,u,h,d,p){if(e.timeoutHandle=Va,8192&(h=t.subtreeFlags)||16785408===(16785408&h)){qi(t,a,h=is());var f=(62914560&a)===a?Mu-al():(4194048&a)===a?wu-al():0;if(null!==(f=as(h,f)))return Iu=a,e.cancelPendingCommit=f(Ar.bind(null,e,t,a,n,i,r,s,o,l,u,h,null,d,p)),void ur(e,a,s,!c)}Ar(e,t,a,n,i,r,s,o,l)}function cr(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!fl(a(),r))return!1}catch(s){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ur(e,t,n,i){t&=~vu,t&=~gu,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var a=31-Zo(r),s=1<<a;i[a]=-1,r&=~s}0!==n&&M(e,n,t)}function hr(){return 0!==(6&ru)||(ue(0,!1),!1)}function dr(){if(null!==su){if(0===lu)var e=su.return;else kl=Bl=null,ut(e=su),lc=null,cc=0,e=su;for(;null!==e;)hi(e.alternate,e),e=e.return;su=null}}function pr(e,t){var n=e.timeoutHandle;n!==Va&&(e.timeoutHandle=Va,ka(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Iu=0,dr(),au=e,su=n=Gr(e.current,null),ou=t,lu=0,cu=null,uu=!1,hu=v(e,t),du=!1,yu=_u=vu=gu=mu=fu=0,bu=xu=null,Su=!1,0!==(8&t)&&(t|=32&t);var i=e.entangledLanes;if(0!==i)for(e=e.entanglements,i&=t;0<i;){var r=31-Zo(i),a=1<<r;t|=e[r],i&=~a}return pu=t,Ie(),n}function fr(e,t){Mc=null,Ta.H=Nc,t===ic||t===ac?(t=Te(),lu=3):t===rc?(t=Te(),lu=4):lu=t===zc?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,cu=t,null===su&&(fu=1,xn(e,N(t,e.current)))}function mr(){var e=yc.current;return null===e||((4194048&ou)===ou?null===xc:((62914560&ou)===ou||0!==(536870912&ou))&&e===xc)}function gr(){var e=Ta.H;return Ta.H=Nc,null===e?Nc:e}function vr(){var e=Ta.A;return Ta.A=Jc,e}function _r(){fu=4,uu||(4194048&ou)!==ou&&null!==yc.current||(hu=!0),0===(134217727&mu)&&0===(134217727&gu)||null===au||ur(au,ou,_u,!1)}function yr(e,t,n){var i=ru;ru|=2;var r=gr(),a=vr();(au!==e||ou!==t)&&(Eu=null,pr(e,t)),t=!1;var s=fu;e:for(;;)try{if(0!==lu&&null!==su){var o=su,l=cu;switch(lu){case 8:dr(),s=6;break e;case 3:case 2:case 9:case 6:null===yc.current&&(t=!0);var c=lu;if(lu=0,cu=null,wr(e,o,l,c),n&&hu){s=0;break e}break;default:c=lu,lu=0,cu=null,wr(e,o,l,c)}}xr(),s=fu;break}catch(u){fr(e,u)}return t&&e.shellSuspendCounter++,kl=Bl=null,ru=i,Ta.H=r,Ta.A=a,null===su&&(au=null,ou=0,Ie()),s}function xr(){for(;null!==su;)Sr(su)}function br(){for(;null!==su&&!il();)Sr(su)}function Sr(e){var t=Jn(e.alternate,e,pu);e.memoizedProps=e.pendingProps,null===t?Tr(e):su=t}function Mr(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=On(n,t,t.pendingProps,t.type,void 0,ou);break;case 11:t=On(n,t,t.pendingProps,t.type.render,t.ref,ou);break;case 5:ut(t);default:hi(n,t),t=Jn(n,t=su=Wr(t,pu),pu)}e.memoizedProps=e.pendingProps,null===t?Tr(e):su=t}function wr(e,t,n,r){kl=Bl=null,ut(t),lc=null,cc=0;var a=t.return;try{if(function(e,t,n,r,a){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&ee(t,n,a,!0),null!==(n=yc.current)){switch(n.tag){case 31:case 13:return null===xc?_r():null===n.alternate&&0===fu&&(fu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===sc?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),Or(e,r,a)),!1;case 22:return n.flags|=65536,r===sc?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),Or(e,r,a)),!1}throw Error(i(435,n.tag))}return Or(e,r,a),_r(),!1}if(Ul)return null!==(t=yc.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fl&&Z(N(e=Error(i(422),{cause:r}),n))):(r!==Fl&&Z(N(t=Error(i(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,r=N(r,n),He(e,a=Sn(e.stateNode,r,a)),4!==fu&&(fu=2)),!1;var s=Error(i(520),{cause:r});if(s=N(s,n),null===xu?xu=[s]:xu.push(s),4!==fu&&(fu=2),null===t)return!0;r=N(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,He(n,e=Sn(n.stateNode,r,e)),!1;case 1:if(t=n.type,s=n.stateNode,0===(128&n.flags)&&("function"==typeof t.getDerivedStateFromError||null!==s&&"function"==typeof s.componentDidCatch&&(null===Au||!Au.has(s))))return n.flags|=65536,a&=-a,n.lanes|=a,wn(a=Mn(a),e,n,r),He(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,ou))return fu=1,xn(e,N(n,e.current)),void(su=null)}catch(s){if(null!==a)throw su=a,s;return fu=1,xn(e,N(n,e.current)),void(su=null)}32768&t.flags?(Ul||1===r?e=!0:hu||0!==(536870912&ou)?e=!1:(uu=e=!0,(2===r||9===r||3===r||6===r)&&null!==(r=yc.current)&&13===r.tag&&(r.flags|=16384)),Er(t,e)):Tr(t)}function Tr(e){var t=e;do{if(0!==(32768&t.flags))return void Er(t,uu);e=t.return;var n=ci(t.alternate,t,pu);if(null!==n)return void(su=n);if(null!==(t=t.sibling))return void(su=t);su=t=e}while(null!==t);0===fu&&(fu=5)}function Er(e,t){do{var n=ui(e.alternate,e);if(null!==n)return n.flags&=32767,void(su=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deleti
2ons=null),!t&&null!==(e=e.sibling))return void(su=e);su=e=n}while(null!==e);fu=6,su=null}function Ar(e,t,n,r,a,s,o,l,c){e.cancelPendingCommit=null;do{Lr()}while(0!==Cu);if(0!==(6&ru))throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(s=t.lanes|t.childLanes,function(e,t,n,i,r,a){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=s&~n;0<n;){var u=31-Zo(n),h=1<<u;o[u]=0,l[u]=-1;var d=c[u];if(null!==d)for(c[u]=null,u=0;u<d.length;u++){var p=d[u];null!==p&&(p.lane&=-536870913)}n&=~h}0!==i&&M(e,i,0),0!==a&&0===r&&0!==e.tag&&(e.suspendedLanes|=a&~(s&~t))}(e,n,s|=fc,o,l,c),e===au&&(su=au=null,ou=0),Pu=t,Ru=e,Iu=n,Lu=s,Nu=a,Uu=r,0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,function(e,t){tl(e,t)}(ll,function(){return Nr(),null})):(e.callbackNode=null,e.callbackPriority=0),r=0!==(13878&t.flags),0!==(13878&t.subtreeFlags)||r){r=Ta.T,Ta.T=null,a=Za(),Ya(2),o=ru,ru|=4;try{!function(e,t){for(La(e.containerInfo),jc=t;null!==jc;)if(t=(e=jc).child,0!==(1028&e.subtreeFlags)&&null!==t)t.return=e,jc=t;else for(;null!==jc;){var n=(e=jc).alternate;switch(t=e.flags,e.tag){case 0:if(0!==(4&t)&&null!==(t=null!==(t=e.updateQueue)?t.events:null))for(var r=0;r<t.length;r++){var a=t[r];a.ref.impl=a.nextImpl}break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&t)&&null!==n){t=void 0,r=e,a=n.memoizedProps,n=n.memoizedState;var s=r.stateNode;try{var o=yn(r.type,a);t=s.getSnapshotBeforeUpdate(o,n),s.__reactInternalSnapshotBeforeUpdate=t}catch(l){Dr(r,r.return,l)}}break;case 3:0!==(1024&t)&&Ga&&Ns(e.stateNode.containerInfo);break;default:if(0!==(1024&t))throw Error(i(163))}if(null!==(t=e.sibling)){t.return=e.return,jc=t;break}jc=e.return}}(e,t)}finally{ru=o,Ya(a),Ta.T=r}}Cu=1,Cr(),Rr(),Pr()}}function Cr(){if(1===Cu){Cu=0;var e=Ru,t=Pu,n=0!==(13878&t.flags);if(0!==(13878&t.subtreeFlags)||n){n=Ta.T,Ta.T=null;var i=Za();Ya(2);var r=ru;ru|=4;try{Ui(t,e),Na(e.containerInfo)}finally{ru=r,Ya(i),Ta.T=n}}e.current=t,Cu=2}}function Rr(){if(2===Cu){Cu=0;var e=Ru,t=Pu,n=0!==(8772&t.flags);if(0!==(8772&t.subtreeFlags)||n){n=Ta.T,Ta.T=null;var i=Za();Ya(2);var r=ru;ru|=4;try{Ei(e,t.alternate,t)}finally{ru=r,Ya(i),Ta.T=n}}Cu=3}}function Pr(){if(4===Cu||3===Cu){Cu=0,rl();var e=Ru,t=Pu,n=Iu,i=Uu;0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?Cu=5:(Cu=0,Pu=Ru=null,Ir(e,e.pendingLanes));var r=e.pendingLanes;if(0===r&&(Au=null),A(n),t=t.stateNode,pl&&"function"==typeof pl.onCommitFiberRoot)try{pl.onCommitFiberRoot(dl,t,void 0,128===(128&t.current.flags))}catch(l){}if(null!==i){t=Ta.T,r=Za(),Ya(2),Ta.T=null;try{for(var a=e.onRecoverableError,s=0;s<i.length;s++){var o=i[s];a(o.value,{componentStack:o.stack})}}finally{Ta.T=t,Ya(r)}}0!==(3&Iu)&&Lr(),ce(e),r=e.pendingLanes,0!==(261930&n)&&0!==(42&r)?e===Ou?Du++:(Du=0,Ou=e):Du=0,ja&&go(),ue(0,!1)}}function Ir(e,t){0===(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,oe(t))}function Lr(){return Cr(),Rr(),Pr(),Nr()}function Nr(){if(5!==Cu)return!1;var e=Ru,t=Lu;Lu=0;var n=A(Iu),r=32>n?32:n;n=Ta.T;var a=Za();try{Ya(r),Ta.T=null,r=Nu,Nu=null;var s=Ru,o=Iu;if(Cu=0,Pu=Ru=null,Iu=0,0!==(6&ru))throw Error(i(331));var l=ru;if(ru|=4,Ji(s.current),Gi(s,s.current,o,r),ru=l,ue(0,!1),pl&&"function"==typeof pl.onPostCommitFiberRoot)try{pl.onPostCommitFiberRoot(dl,s)}catch(c){}return!0}finally{Ya(a),Ta.T=n,Ir(e,t)}}function Ur(e,t,n){t=N(n,t),null!==(e=ke(e,t=Sn(e.stateNode,t,2),2))&&(S(e,2),ce(e))}function Dr(e,t,n){if(3===e.tag)Ur(e,e,n);else for(;null!==t;){if(3===t.tag){Ur(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Au||!Au.has(i))){e=N(n,e),null!==(i=ke(t,n=Mn(2),2))&&(wn(n,i,t,e),S(i,2),ce(i));break}}t=t.return}}function Or(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new iu;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(du=!0,r.add(n),e=Fr.bind(null,e,t,n),t.then(e,e))}function Fr(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,au===e&&(ou&n)===n&&(4===fu||3===fu&&(62914560&ou)===ou&&300>al()-Mu?0===(2&ru)&&pr(e,0):vu|=n,yu===ou&&(yu=0)),ce(e)}function zr(e,t){0===t&&(t=x()),null!==(e=Ue(e,t))&&(S(e,t),ce(e))}function Br(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),zr(e,n)}function kr(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),zr(e,n)}function Vr(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.t
2ype=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Gr(e,n){var i=e.alternate;return null===i?((i=t(e.tag,n,e.key,e.mode)).elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=65011712&e.flags,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Wr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function jr(e,n,r,a,s,o){var l=0;if(a=e,"function"==typeof e)Hr(e)&&(l=1);else if("string"==typeof e)l=Eo&&ko?Ao(e,r,Cl.current)?26:Wo(e)?27:5:Eo?Ao(e,r,Cl.current)?26:5:ko&&Wo(e)?27:5;else e:switch(e){case xa:return(e=t(31,r,n,s)).elementType=xa,e.lanes=o,e;case ua:return Xr(r.children,s,o,n);case ha:l=8,s|=24;break;case da:return(e=t(12,r,n,2|s)).elementType=da,e.lanes=o,e;case ga:return(e=t(13,r,n,s)).elementType=ga,e.lanes=o,e;case va:return(e=t(19,r,n,s)).elementType=va,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case fa:l=10;break e;case pa:l=9;break e;case ma:l=11;break e;case _a:l=14;break e;case ya:l=16,a=null;break e}l=29,r=Error(i(130,null===e?"null":typeof e,"")),a=null}return(n=t(l,r,n,s)).elementType=e,n.type=a,n.lanes=o,n}function Xr(e,n,i,r){return(e=t(7,e,r,n)).lanes=i,e}function qr(e,n,i){return(e=t(6,e,null,n)).lanes=i,e}function Yr(e){var n=t(18,null,null,0);return n.stateNode=e,n}function Zr(e,n,i){return(n=t(4,null!==e.children?e.children:[],e.key,n)).lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Jr(e,t,n,i,r,a,s,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Va,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=b(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=b(0),this.hiddenUpdates=b(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function Kr(e,n,i,r,a,s,o,l,c,u,h,d){return e=new Jr(e,n,i,o,c,u,h,d,l),n=1,!0===s&&(n|=24),s=t(3,null,null,n),e.current=s,s.stateNode=e,(n=se()).refCount++,e.pooledCache=n,n.refCount++,s.memoizedState={element:r,isDehydrated:i,cache:n},Fe(s),e}function Qr(e){return e?e=Yo:Yo}function $r(e){var t=e._reactInternals;if(void 0===t)throw"function"==typeof e.render?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return null===(e=null!==(e=o(t))?l(e):null)?null:Ra(e.stateNode)}function ea(e,t,n,i,r,a){r=Qr(r),null===i.context?i.context=r:i.pendingContext=r,(i=Be(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(i.callback=a),null!==(n=ke(e,i,t))&&(sr(n,0,t),Ve(n,e,t))}function ta(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function na(e,t){ta(e,t),(e=e.alternate)&&ta(e,t)}var ia={},ra=s,aa=_,sa=Object.assign,oa=Symbol.for("react.element"),la=Symbol.for("react.transitional.element"),ca=Symbol.for("react.portal"),ua=Symbol.for("react.fragment"),ha=Symbol.for("react.strict_mode"),da=Symbol.for("react.profiler"),pa=Symbol.for("react.consumer"),fa=Symbol.for("react.context"),ma=Symbol.for("react.forward_ref"),ga=Symbol.for("react.suspense"),va=Symbol.for("react.suspense_list"),_a=Symbol.for("react.memo"),ya=Symbol.for("react.lazy"),xa=Symbol.for("react.activity"),ba=Symbol.for("react.memo_cache_sentinel"),Sa=Symbol.iterator,Ma=Symbol.for("react.client.reference"),wa=Array.isArray,Ta=ra.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ea=e.rendererVersion,Aa=e.rendererPackageName,Ca=e.extraDevToolsConfig,Ra=e.getPublicInstance,Pa=e.getRootHostContext,Ia=e.getChildHostContext,La=e.prepareForCommit,Na=e.resetAfterCommit,Ua=e.createInstance;e.cloneMutableInstance;var Da=e.appendInitialChild,Oa=e.finalizeInitialChildren,Fa=e.shouldSetTextContent,za=e.createTextInstance;e.cloneMutableTextInstance;
2var Ba=e.scheduleTimeout,ka=e.cancelTimeout,Va=e.noTimeout,Ha=e.isPrimaryRenderer;e.warnsIfNotActing;var Ga=e.supportsMutation,Wa=e.supportsPersistence,ja=e.supportsHydration,Xa=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var qa=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Ya=e.setCurrentUpdatePriority,Za=e.getCurrentUpdatePriority,Ja=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var Ka=e.shouldAttemptEagerTransition,Qa=e.detachDeletedInstance;e.requestPostPaintCallback;var $a=e.maySuspendCommit,es=e.maySuspendCommitOnUpdate,ts=e.maySuspendCommitInSyncRender,ns=e.preloadInstance,is=e.startSuspendingCommit,rs=e.suspendInstance;e.suspendOnActiveViewTransition;var as=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ss=e.NotPendingTransition,os=e.HostTransitionContext,ls=e.resetFormInstance;e.bindToConsole;var cs=e.supportsMicrotasks,us=e.scheduleMicrotask,hs=e.supportsTestSelectors,ds=e.findFiberRoot,ps=e.getBoundingRect,fs=e.getTextContent,ms=e.isHiddenSubtree,gs=e.matchAccessibilityRole,vs=e.setFocusIfFocusable,_s=e.setupIntersectionObserver,ys=e.appendChild,xs=e.appendChildToContainer,bs=e.commitTextUpdate,Ss=e.commitMount,Ms=e.commitUpdate,ws=e.insertBefore,Ts=e.insertInContainerBefore,Es=e.removeChild,As=e.removeChildFromContainer,Cs=e.resetTextContent,Rs=e.hideInstance,Ps=e.hideTextInstance,Is=e.unhideInstance,Ls=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var Ns=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Us=e.cloneInstance,Ds=e.createContainerChildSet,Os=e.appendChildToContainerChildSet,Fs=e.finalizeContainerChildren,zs=e.replaceContainerChildren,Bs=e.cloneHiddenInstance,ks=e.cloneHiddenTextInstance,Vs=e.isSuspenseInstancePending,Hs=e.isSuspenseInstanceFallback,Gs=e.getSuspenseInstanceFallbackErrorDetails,Ws=e.registerSuspenseInstanceRetry,js=e.canHydrateFormStateMarker,Xs=e.isFormStateMarkerMatching,qs=e.getNextHydratableSibling,Ys=e.getNextHydratableSiblingAfterSingleton,Zs=e.getFirstHydratableChild,Js=e.getFirstHydratableChildWithinContainer,Ks=e.getFirstHydratableChildWithinActivityInstance,Qs=e.getFirstHydratableChildWithinSuspenseInstance,$s=e.getFirstHydratableChildWithinSingleton,eo=e.canHydrateInstance,to=e.canHydrateTextInstance,no=e.canHydrateActivityInstance,io=e.canHydrateSuspenseInstance,ro=e.hydrateInstance,ao=e.hydrateTextInstance,so=e.hydrateActivityInstance,oo=e.hydrateSuspenseInstance,lo=e.getNextHydratableInstanceAfterActivityInstance,co=e.getNextHydratableInstanceAfterSuspenseInstance,uo=e.commitHydratedInstance,ho=e.commitHydratedContainer,po=e.commitHydratedActivityInstance,fo=e.commitHydratedSuspenseInstance,mo=e.finalizeHydratedChildren,go=e.flushHydrationEvents;e.clearActivityBoundary;var vo=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var _o=e.clearSuspenseBoundaryFromContainer,yo=e.hideDehydratedBoundary,xo=e.unhideDehydratedBoundary,bo=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var So,Mo,wo=e.validateHydratableInstance,To=e.validateHydratableTextInstance,Eo=e.supportsResources,Ao=e.isHostHoistableType,Co=e.getHoistableRoot,Ro=e.getResource,Po=e.acquireResource,Io=e.releaseResource,Lo=e.hydrateHoistable,No=e.mountHoistable,Uo=e.unmountHoistable,Do=e.createHoistableInstance,Oo=e.prepareToCommitHoistables,Fo=e.mayResourceSuspendCommit,zo=e.preloadResource,Bo=e.suspendResource,ko=e.supportsSingletons,Vo=e.resolveSingletonInstance,Ho=e.acquireSingletonInstance,Go=e.releaseSingletonInstance,Wo=e.isHostSingletonType,jo=e.isSingletonScope,Xo=[],qo=-1,Yo={},Zo=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(Jo(e)/Ko|0)|0},Jo=Math.log,Ko=Math.LN2,Qo=256,$o=262144,el=4194304,tl=aa.unstable_scheduleCallback,nl=aa.unstable_cancelCallback,il=aa.unstable_shouldYield,rl=aa.unstable_requestPaint,al=aa.unstable_now,sl=aa.unstable_ImmediatePriority,ol=aa.unstable_UserBlockingPriority,ll=a
2a.unstable_NormalPriority,cl=aa.unstable_IdlePriority,ul=aa.log,hl=aa.unstable_setDisableYieldValue,dl=null,pl=null,fl="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},ml="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},gl=Object.prototype.hasOwnProperty,vl=!1,_l=new WeakMap,yl=[],xl=0,bl=null,Sl=0,Ml=[],wl=0,Tl=null,El=1,Al="",Cl=d(null),Rl=d(null),Pl=d(null),Il=d(null),Ll=null,Nl=null,Ul=!1,Dl=null,Ol=!1,Fl=Error(i(519)),zl=d(null),Bl=null,kl=null,Vl=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Hl=aa.unstable_scheduleCallback,Gl=aa.unstable_NormalPriority,Wl={$$typeof:fa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},jl=null,Xl=null,ql=!1,Yl=!1,Zl=!1,Jl=0,Kl=null,Ql=0,$l=0,ec=null,tc=Ta.S;Ta.S=function(e,t){wu=al(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Kl){var n=Kl=[];Ql=0,$l=ge(),ec={status:"pending",value:void 0,then:function(e){n.push(e)}}}Ql++,t.then(ve,ve)}(0,t),null!==tc&&tc(e,t)};var nc=d(null),ic=Error(i(460)),rc=Error(i(474)),ac=Error(i(542)),sc={then:function(){}},oc=null,lc=null,cc=0,uc=Pe(!0),hc=Pe(!1),dc=[],pc=0,fc=0,mc=!1,gc=!1,vc=d(null),_c=d(0),yc=d(null),xc=null,bc=d(0),Sc=0,Mc=null,wc=null,Tc=null,Ec=!1,Ac=!1,Cc=!1,Rc=0,Pc=0,Ic=null,Lc=0,Nc={readContext:ie,use:ft,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useLayoutEffect:nt,useInsertionEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useSyncExternalStore:nt,useId:nt,useHostTransitionStatus:nt,useFormState:nt,useActionState:nt,useOptimistic:nt,useMemoCache:nt,useCacheRefresh:nt};Nc.useEffectEvent=nt;var Uc={readContext:ie,use:ft,useCallback:function(e,t){return ht().memoizedState=[e,void 0===t?null:t],e},useContext:ie,useEffect:Wt,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Ht(4194308,4,Zt.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ht(4194308,4,e,t)},useInsertionEffect:function(e,t){Ht(4,2,e,t)},useMemo:function(e,t){var n=ht();t=void 0===t?null:t;var i=e();if(Cc){C(!0);try{e()}finally{C(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=ht();if(void 0!==n){var r=n(t);if(Cc){C(!0);try{n(t)}finally{C(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=cn.bind(null,Mc,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},ht().memoizedState=e},useState:function(e){var t=(e=Et(e)).queue,n=un.bind(null,Mc,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Kt,useDeferredValue:function(e,t){return en(ht(),e,t)},useTransition:function(){var e=Et(!1);return e=nn.bind(null,Mc,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Mc,a=ht();if(Ul){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===au)throw Error(i(349));0!==(127&ou)||bt(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,Wt(Mt.bind(null,r,s,e),[e]),r.flags|=2048,kt(9,{destroy:void 0},St.bind(null,r,s,n,t),null),n},useId:function(){var e=ht(),t=au.identifierPrefix;if(Ul){var n=Al;t="_"+t+"R_"+(n=(El&~(1<<32-Zo(El)-1)).toString(32)+n),0<(n=Rc++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=Lc++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:an,useFormState:Dt,useActionState:Dt,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dn.bind(null,Mc,!0,n),n.dispatch=t,[e,t]},useMemoCache:mt,useCacheRefresh:function(){return ht().memoizedState=ln.bind(null,Mc)},useEffectEvent:function(e){var t=ht(),n={impl:e};return t.memoizedState=n,function(){if(0!==(2&ru))throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Dc={readContext:ie,use:ft,useCallback:Qt,useContext:ie,useEffect:jt,useImperativeHandle:Jt,useInsertionEffect:qt,useLayoutEffect:Yt,useMemo:$t,useReducer:vt,useRef:Vt,useState:function(){return vt(gt)},useDebugValue:Kt,useDeferredValue:function(e,t){return tn(dt(),wc.memoizedState,e,t)},useTransition:function(){var e=vt(gt)[0],t=dt().memoizedState;return["boolean"==typeof e?e:pt(e),t]},useSyncExternalStore:xt,useId:sn,useHostTransitionStatus:an,useFormState:Ot,useActionState:Ot,useOptimistic:function(e,t){return At(dt(),0,e,t)},useMemoCache:mt,useCacheRefresh:on};Dc.useEffectEvent=Xt;var Oc={readContext:ie,use:ft,useCallback:Qt,useContext:ie,useEffect:jt,useImperativeHandle:Jt,useInsertionEffect:qt,useLayoutEffect:Yt,useMemo:$t,useReducer:yt,useRef:Vt,useState:function(){return yt(gt)},useDebugValue:Kt,useDeferredValue:function(e,t){var n=dt();return null===wc?en(n,e,t):tn(n,wc.memoizedState,e,t)},useTransition:function(){var e=yt(gt)[0],t=dt().memoizedState;return["boolean"==typeof e?e:pt(e),t]},useSyncExternalStore:xt,useId:sn,useHostTransitionStatus:an,useFormState:Bt,useActionState:Bt,useOptimistic:function(e,t){var n=dt();return null!==wc?At(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mt,useCacheRefresh:on};Oc.useEffectEvent=Xt;var Fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=rr(),r=Be(i);
2r.payload=t,null!=n&&(r.callback=n),null!==(t=ke(e,r,i))&&(sr(t,0,i),Ve(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=rr(),r=Be(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=ke(e,r,i))&&(sr(t,0,i),Ve(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rr(),i=Be(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=ke(e,i,n))&&(sr(t,0,n),Ve(t,e,n))}},zc=Error(i(461)),Bc=!1,kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Vc=!1,Hc=!1,Gc=!1,Wc="function"==typeof WeakSet?WeakSet:Set,jc=null,Xc=null,qc=!1,Yc=null,Zc=8192,Jc={getCacheForType:function(e){var t=ie(Wl),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ie(Wl).controller.signal}},Kc=0,Qc=1,$c=2,eu=3,tu=4;if("function"==typeof Symbol&&Symbol.for){var nu=Symbol.for;Kc=nu("selector.component"),Qc=nu("selector.has_pseudo_class"),$c=nu("selector.role"),eu=nu("selector.test_id"),tu=nu("selector.text")}var iu="function"==typeof WeakMap?WeakMap:Map,ru=0,au=null,su=null,ou=0,lu=0,cu=null,uu=!1,hu=!1,du=!1,pu=0,fu=0,mu=0,gu=0,vu=0,_u=0,yu=0,xu=null,bu=null,Su=!1,Mu=0,wu=0,Tu=1/0,Eu=null,Au=null,Cu=0,Ru=null,Pu=null,Iu=0,Lu=0,Nu=null,Uu=null,Du=0,Ou=null;return ia.attemptContinuousHydration=function(e){if(13===e.tag||31===e.tag){var t=Ue(e,67108864);null!==t&&sr(t,0,67108864),na(e,67108864)}},ia.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag||31===e.tag){var t=rr(),n=Ue(e,t=E(t));null!==n&&sr(n,0,t),na(e,t)}},ia.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if((e=e.stateNode).current.memoizedState.isDehydrated){var t=m(e.pendingLanes);if(0!==t){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-Zo(t);e.entanglements[1]|=n,t&=~n}ce(e),0===(6&ru)&&(Tu=al()+500,ue(0,!1))}}break;case 31:case 13:null!==(t=Ue(e,2))&&sr(t,0,2),hr(),na(e,2)}},ia.batchedUpdates=function(e,t){return e(t)},ia.createComponentSelector=function(e){return{$$typeof:Kc,value:e}},ia.createContainer=function(e,t,n,i,r,a,s,o,l,c){return Kr(e,t,!1,null,0,i,a,null,s,o,l,c)},ia.createHasPseudoClassSelector=function(e){return{$$typeof:Qc,value:e}},ia.createHydrationContainer=function(e,t,n,i,r,a,s,o,l,c,u,h,d,p){var f;return(e=Kr(n,i,!0,e,0,a,o,p,l,c,u,h)).context=Qr(null),n=e.current,(r=Be(i=E(i=rr()))).callback=null!=(f=t)?f:null,ke(n,r,i),t=i,e.current.lanes=t,S(e,t),ce(e),e},ia.createPortal=function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:ca,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}},ia.createRoleSelector=function(e){return{$$typeof:$c,value:e}},ia.createTestNameSelector=function(e){return{$$typeof:eu,value:e}},ia.createTextSelector=function(e){return{$$typeof:tu,value:e}},ia.defaultOnCaughtError=function(e){console.error(e)},ia.defaultOnRecoverableError=function(e){ml(e)},ia.defaultOnUncaughtError=function(e){ml(e)},ia.deferredUpdates=function(e){var t=Ta.T,n=Za();try{return Ya(32),Ta.T=null,e()}finally{Ya(n),Ta.T=t}},ia.discreteUpdates=function(e,t,n,i,r){var a=Ta.T,s=Za();try{return Ya(2),Ta.T=null,e(t,n,i,r)}finally{Ya(s),Ta.T=a,0===ru&&(Tu=al()+500)}},ia.findAllNodes=ir,ia.findBoundingRects=function(e,t){if(!hs)throw Error(i(363));t=ir(e,t),e=[];for(var n=0;n<t.length;n++)e.push(ps(t[n]));for(t=e.length-1;0<t;t--)for(var r=(n=e[t]).x,a=r+n.width,s=n.y,o=s+n.height,l=t-1;0<=l;l--)if(t!==l){var c=e[l],u=c.x,h=u+c.width,d=c.y,p=d+c.height;if(r>=u&&s>=d&&a<=h&&o<=p){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||p<s||d>o)){d>s&&(c.height+=d-s,c.y=s),p<o&&(c.height=o-d),e.splice(t,1);break}if(!(s!==d||n.height!==c.height||h<r||u>a)){u>r&&(c.width+=u-r,c.x=r),h<a&&(c.width=a-u),e.splice(t,1);break}}return e},ia.findHostInstance=$r,ia.findHostInstanceWithNoPortals=function(e){return null===(e=null!==(e=o(e))?c(e):null)?null:Ra(e.stateNode)},ia.findHostInstanceWithWarning=function(e){return $r(e)},ia.flushPassiveEffects=Lr,ia.flushSyncFromReconciler=function(e){var t=ru;ru|=1;var n=Ta.T,i=Za();try{if(Ya(2),Ta.T=null,e)return e()}finally{Ya(i),Ta.T=n,0===(6&(ru=t))&&ue(0,!1)}},ia.flushSyncWork=hr,ia.focusWithin=function(e,t){if(!hs)throw Error(i(363));for(t=nr(e=$i(e),t),t=Array.from(t),e=0;e<t.length;){var n=t[e++],r=n.tag;if(!ms(n)){if((5===r||26===r||27===r)&&vs(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},ia.getFindAllNodesFailureDescription=function(e,t){if(!hs)throw Error(i(363));var n=0,r=[];e=[$i(e),0];for(var a=0;a<e.length;){var s=e[a++],o=s.tag,l=e[a++],c=t[l];
2if((5!==o&&26!==o&&27!==o||!ms(s))&&(er(s,c)&&(r.push(tr(c)),++l>n&&(n=l)),l<t.length))for(s=s.child;null!==s;)e.push(s,l),s=s.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(tr(t[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},ia.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return Ra(e.child.stateNode);default:return e.child.stateNode}},ia.injectIntoDevTools=function(){var e={bundleType:0,version:Ea,rendererPackageName:Aa,currentDispatcherRef:Ta,reconcilerVersion:"19.2.0"};if(null!==Ca&&(e.rendererConfig=Ca),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{dl=t.inject(e),pl=t}catch(n){}e=!!t.checkDCE}}return e},ia.isAlreadyRendering=function(){return 0!==(6&ru)},ia.observeVisibleRects=function(e,t,n,r){if(!hs)throw Error(i(363));e=ir(e,t);var a=_s(e,n,r).disconnect;return{disconnect:function(){a()}}},ia.shouldError=function(){return null},ia.shouldSuspend=function(){return!1},ia.startHostTransition=function(e,t,r,a){if(5!==e.tag)throw Error(i(476));var s=rn(e).queue;nn(e,s,t,ss,null===r?n:function(){var t=rn(e);return null===t.next&&(t=e.alternate.memoizedState),hn(e,t.next.queue,{},rr()),r(a)})},ia.updateContainer=function(e,t,n,i){var r=t.current,a=rr();return ea(r,a,e,t,n,i),a},ia.updateContainerSync=function(e,t,n,i){return ea(t.current,2,e,t,n,i),2},ia},e.exports.default=e.exports,Object.defineProperty(e.exports,"__esModule",{value:!0})),de.exports;var e}var fe;var me=(fe||(fe=1,he.exports=pe()),he.exports);const ge=(ve=me)&&ve.__esModule&&Object.prototype.hasOwnProperty.call(ve,"default")?ve.default:ve;var ve;function _e(e){const t=ge(e);return t.injectIntoDevTools(),t}const ye={},xe=/^three(?=[A-Z])/,be=e=>"".concat(e[0].toUpperCase()).concat(e.slice(1));let Se=0;function Me(e){if("function"===typeof e){const t="".concat(Se++);return ye[t]=e,t}Object.assign(ye,e)}function we(e,t){const n=be(e),i=ye[n];if("primitive"!==e&&!i)throw new Error("R3F: ".concat(n," is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively"));if("primitive"===e&&!t.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw new Error("R3F: The args prop must be an array!")}function Te(e){var t;e.isHidden&&(e.props.attach&&null!=(t=e.parent)&&t.object?k(e.parent,e):J(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,Y(e))}function Ee(e,t,n){const i=t.root.getState();if(e.parent||e.object===i.scene){if(!t.object){var r,a;const e=ye[be(t.type)];t.object=null!=(r=t.props.object)?r:new e(...null!=(a=t.props.args
2)?a:[]),t.object.__r3f=t}if(q(t.object,t.props),t.props.attach)k(e,t);else if(J(t.object)&&J(e.object)){const i=e.object.children.indexOf(null==n?void 0:n.object);if(n&&-1!==i){const n=e.object.children.indexOf(t.object);if(-1!==n){e.object.children.splice(n,1);const r=n<i?i-1:i;e.object.children.splice(r,0,t.object)}else t.object.parent=e.object,e.object.children.splice(i,0,t.object),t.object.dispatchEvent({type:"added"}),e.object.dispatchEvent({type:"childadded",child:t.object})}else e.object.add(t.object)}for(const e of t.children)Ee(t,e);Y(t)}}function Ae(e,t){if(t){if(t.parent===e){const n=e.children.indexOf(t);-1!==n&&e.children.splice(n,1)}t.parent=e,e.children.push(t),Ee(e,t)}}function Ce(e,t,n){if(!t||!n)return;if(t.parent===e){const n=e.children.indexOf(t);-1!==n&&e.children.splice(n,1)}t.parent=e;const i=e.children.indexOf(n);-1!==i?e.children.splice(i,0,t):e.children.push(t),Ee(e,t,n)}function Re(e){if("function"===typeof e.dispose){const t=()=>{try{e.dispose()}catch(t){}};"undefined"!==typeof IS_REACT_ACT_ENVIRONMENT?t():(0,_.unstable_scheduleCallback)(_.unstable_IdlePriority,t)}}function Pe(e,t,n){if(!t)return;t.parent=null;const i=e.children.indexOf(t);-1!==i&&e.children.splice(i,1),t.props.attach?V(e,t):J(t.object)&&J(e.object)&&(e.object.remove(t.object),function(e,t){const n=e.getState().internal;n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,i)=>{e.eventObject!==t&&e.object!==t||n.hovered.delete(i)}),n.capturedMap.forEach((e,i)=>{Q(n.capturedMap,t,e,i)})}(S(t),t.object));const r=null!==t.props.dispose&&!1!==n;for(let a=t.children.length-1;a>=0;a--){Pe(t,t.children[a],r)}t.children.length=0,delete t.object.__r3f,r&&"primitive"!==t.type&&"Scene"!==t.object.type&&Re(t.object),void 0===n&&Y(t)}function Ie(e,t){for(const n of[e,e.alternate])if(null!==n)if("function"===typeof n.ref){null==n.refCleanup||n.refCleanup();const e=n.ref(t);"function"===typeof e&&(n.refCleanup=e)}else n.ref&&(n.ref.current=t)}const Le=[];const Ne=()=>{},Ue={};let De=0;const Oe=_e({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,n){var i;return we(e=be(e)in ye?e:e.replace(xe,""),t),"primitive"===e&&null!=(i=t.object)&&i.__r3f&&delete t.object.__r3f,F(t.object,n,e,t)},removeChild:Pe,appendChild:Ae,appendInitialChild:Ae,insertBefore:Ce,appendChildToContainer(e,t){const n=e.getState().scene.__r3f;t&&n&&Ae(n,t)},removeChildFromContainer(e,t){const n=e.getState().scene.__r3f;t&&n&&Pe(n,t)},insertInContainerBefore(e,t,n){const i=e.getState().scene.__r3f;t&&n&&i&&Ce(i,t,n)},getRootHostContext:()=>Ue,getChildHostContext:()=>Ue,commitUpdate(e,t,n,i,r){var a,s,o;we(t,i);let l=!1;if(("primitive"===e.type&&n.object!==i.object||(null==(a=i.args)?void 0:a.length)!==(null==(s=n.args)?void 0:s.length)||null!=(o=i.args)&&o.some((e,t)=>{var i;return e!==(null==(i=n.args)?void 0:i[t])}))&&(l=!0),l)Le.push([e,O(i),r]);else{const t=function(e,t){const n={};for(const i in t)if(!H.includes(i)&&!N.equ(t[i],e.props[i])){n[i]=t[i];for(const e in t)e.startsWith("".concat(i,"-"))&&(n[e]=t[e])}for(const i in e.props){if(H.includes(i)||t.hasOwnProperty(i))continue;const r=z(e.object,i),a=r.root,s=r.key;if(a.constructor&&0===a.constructor.length){const e=W(a);N.und(e)||(n[i]=e[s])}else n[i]=0}return n}(e,i),n=e.props.attach;e.props=O(i),void 0!==n?e.props.attach=n:delete e.props.attach,Object.keys(t).length&&q(e.object,t)}},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>F(e.getState().scene,e,"",{}),resetAfterCommit:function(){if(0!==Le.length)try{!function(){for(const i of Le){const e=(0,r.A)(i,1)[0],t=e.parent;if(t){e.props.attach?V(t,e):J(e.object)&&J(t.object)&&t.object.remove(e.object);for(const t of e.children)t.props.attach?V(e,t):J(t.object)&&J(e.object)&&e.object.remove(t.object)}e.isHidden&&Te(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&Re(e.object)}for(const i of Le){var e=(0,r.A)(i,3);const a=e[0],s=e[1],o=e[2];a.props=s;const l=a.parent;if(l){var t,n;const e=ye[be(a.type)],i=a.object;a.object=null!=(t=a.props.object)?t:new e(...null!=(n=a.props.args
2)?n:[]),a.object.__r3f=a,Ie(o,a.object),$(S(a),i,a.object),q(a.object,a.props),a.props.attach?k(l,a):J(a.object)&&J(l.object)&&l.object.add(a.object);for(const t of a.children)t.props.attach?k(a,t):J(t.object)&&J(a.object)&&a.object.add(t.object);Y(a)}}}()}finally{Le.length=0}},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){var t;e.isHidden||(e.props.attach&&null!=(t=e.parent)&&t.object?V(e.parent,e):J(e.object)&&(e.object.visible=!1),e.isHidden=!0,Y(e))},unhideInstance:Te,createTextInstance:Ne,hideTextInstance:Ne,unhideTextInstance:Ne,supportsMicrotasks:!0,scheduleMicrotask:function(e){"function"===typeof queueMicrotask?queueMicrotask(e):"undefined"!==typeof Promise?Promise.resolve().then(e).catch(e=>{setTimeout(()=>{throw e})}):setTimeout(e)},scheduleTimeout:"function"===typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"===typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:s.createContext(null),setCurrentUpdatePriority(e){De=e},getCurrentUpdatePriority:()=>De,resolveUpdatePriority(){var e;if(0!==De)return De;const t="undefined"!==typeof window?null==(e=window.event)?void 0:e.type:void 0;return void 0===t?32:function(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch((0,_.unstable_getCurrentPriorityLevel)()){case _.unstable_ImmediatePriority:return 2;case _.unstable_UserBlockingPriority:return 8;case _.unstable_NormalPriority:case _.unstable_LowPriority:return 32;case _.unstable_IdlePriority:return 268435456;default:return 32}default:return 32}}(t)},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:"9.7.0",applyViewTransitionName(e,t,n){},restoreViewTransitionName(e,t){},cancelViewTransitionName(e,t,n){},cancelRootViewTransitionName(e){},restoreRootViewTransitionName(e){},InstanceMeasurement:null,measureInstance:e=>null,wasInstanceInViewport:e=>!0,hasInstanceChanged:(e,t)=>!1,hasInstanceAffectedParent:(e,t)=>!1,suspendOnActiveViewTransition(e,t){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(e){},createViewTransitionInstance:e=>null,getCurrentGestureOffset(e){throw new Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance:(e,t)=>e,cloneMutableTextInstance:e=>e,cloneRootViewTransitionContainer(e){throw new Error("Not implemented.")},removeRootViewTransitionClone(e,t){throw new Error("Not implemented.")},createFragmentInstance:e=>null,updateFragmentInstanceFiber(e,t){},commitNewChildToFragmentInstance(e,t){},deleteChildFromFragmentInstance(e,t){},measureClonedInstance:e=>null,maySuspendCommitOnUpdate:(e,t,n)=>!1,maySuspendCommitInSyncRender:(e,t)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(e,t)=>null}),Fe=new Map,ze={objects:"shallow",strict:!1};function Be(e){const t=Fe.get(e),n=null==t?void 0:t.fiber,r=null==t?void 0:t.store;t&&console.warn("R3F.createRoot should only be called once!");const s="function"===typeof reportError?reportError:console.error,o=r||ie(at,st),u=n||Oe.createContainer(o,1,null,!1,null,"",s,s,s,null);let h,d;t||Fe.set(e,{fiber:u,store:o});let p=!1,f=null;return{async configure(){let t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f=new Promise(e=>t=e);let r=n.gl,s=n.size,u=n.scene,m=n.events,g=n.onCreated,v=n.shadows,_=void 0!==v&&v,y=n.linear,x=void 0!==y&&y,S=n.flat,M=void 0!==S&&S,w=n.legacy,T=void 0!==w&&w,E=n.orthographic,A=void 0!==E&&E,C=n.frameloop,R=void 0===C?"always":C,P=n.dpr,L=void 0===P?[1,2]:P,U=n.performance,D=n.raycaster,O=n.camera,z=n.onPointerMissed,B=o.getState(),k=B.gl;if(!B.gl){const t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},n="function"===typeof r?await r(t):r;k=te(n)?n:new c.WebGLRenderer((0,a.A)((0,a.A)({},t),r)),B.set({gl:k})}let V=B.raycaster;V||B.set({raycaster:V=new l.tBo});const H=D||{},G=H.params,W=(0,i.A)(H,b);if(N.equ(W,V,ze)||q(V,(0,a.A)({},W)),N.equ(G,V.params,ze)||q(V,{params:(0,a.A)((0,a.A)({},V.params),G)}
2),!B.camera||B.camera===d&&!N.equ(d,O,ze)){d=O;const e=null==O?void 0:O.isCamera,t=e?O:A?new l.qUd(0,0,0,0,.1,1e3):new l.ubm(75,0,.1,1e3);e||(t.position.z=5,O&&(q(t,O),t.manual||("aspect"in O||"left"in O||"right"in O||"bottom"in O||"top"in O)&&(t.manual=!0,t.updateProjectionMatrix())),B.camera||null!=O&&O.rotation||t.lookAt(0,0,0)),B.set({camera:t}),V.camera=t}if(!B.scene){let e;null!=u&&u.isScene?(e=u,F(e,o,"",{})):(e=new l.Z58,F(e,o,"",{}),u&&q(e,u)),B.set({scene:e})}m&&!B.events.handlers&&B.set({events:m(o)});const j=function(e,t){if(!t&&"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){const t=e.parentElement.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}return!t&&"undefined"!==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:(0,a.A)({width:0,height:0,top:0,left:0},t)}(e,s);if(N.equ(j,B.size,ze)||B.setSize(j.width,j.height,j.top,j.left),L&&B.viewport.dpr!==I(L)&&B.setDpr(L),B.frameloop!==R&&B.setFrameloop(R),B.onPointerMissed||B.set({onPointerMissed:z}),U&&!N.equ(U,B.performance,ze)&&B.set(e=>({performance:(0,a.A)((0,a.A)({},e.performance),U)})),!B.xr){var X;const e=(e,t)=>{const n=o.getState();"never"!==n.frameloop&&st(e,!0,n,t)},t=()=>{const t=o.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||at(t)},n={connect(){const e=o.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){const e=o.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"===typeof(null==(X=k.xr)?void 0:X.addEventListener)&&n.connect(),B.set({xr:n})}if(k.shadowMap){const e=k.shadowMap.enabled,t=k.shadowMap.type;if(k.shadowMap.enabled=!!_,N.boo(_))k.shadowMap.type=l.Wk7;else if(N.str(_)){var Y;const e={basic:l.bTm,percentage:l.QP0,soft:l.Wk7,variance:l.RyA};k.shadowMap.type=null!=(Y=e[_])?Y:l.Wk7}else N.obj(_)&&Object.assign(k.shadowMap,_);e===k.shadowMap.enabled&&t===k.shadowMap.type||(k.shadowMap.needsUpdate=!0)}return l.ppV.enabled=!T,p||(k.outputColorSpace=x?l.Zr2:l.er$,k.toneMapping=M?l.y_p:l.FV),B.legacy!==T&&B.set(()=>({legacy:T})),B.linear!==x&&B.set(()=>({linear:x})),B.flat!==M&&B.set(()=>({flat:M})),!r||N.fun(r)||te(r)||N.equ(r,k,ze)||q(k,r),h=g,p=!0,t(),this},render(t){return p||f||this.configure(),f.then(()=>{Oe.updateContainer((0,y.jsx)(ke,{store:o,children:t,onCreated:h,rootElement:e}),u,null,()=>{})}),o},unmount(){Ve(e)}}}function ke(e){let t=e.store,n=e.children,i=e.onCreated,r=e.rootElement;return E(()=>{const e=t.getState();e.set(e=>({internal:(0,a.A)((0,a.A)({},e.internal),{},{active:!0})})),i&&i(e),t.getState().events.connected||null==e.events.connect||e.events.connect(r)},[]),(0,y.jsx)(ne.Provider,{value:t,children:n})}function Ve(e,t){const n=Fe.get(e),i=null==n?void 0:n.fiber;if(i){const r=null==n?void 0:n.store.getState();r&&(r.internal.active=!1),Oe.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var n,i,a,s;null==r.events.disconnect||r.events.disconnect(),null==(n=r.gl)||null==(i=n.renderLists)||null==i.dispose||i.dispose(),null==(a=r.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(s=r.gl)&&s.xr&&r.xr.disconnect(),function(e){"Scene"!==e.type&&(null==e.dispose||e.dispose());for(const t in e){const n=e[t];"Scene"!==(null==n?void 0:n.type)&&(null==n||null==n.dispose||n.dispose())}}(r.scene),Fe.delete(e),t&&t(e)}catch(o){}},500)})}}function He(e,t){const n={callback:e};return t.add(n),()=>{t.delete(n)}}const Ge=new Set,We=new Set,je=new Set,Xe=e=>He(e,Ge),qe=e=>He(e,We);function Ye(e,t){if(e.size)for(const n of e.values()){(0,n.callback)(t)}}function Ze(e,t){switch(e){case"before":return Ye(Ge,t);case"after":return Ye(We,t);case"tail":return Ye(je,t)}}let Je,Ke;function Qe(e,t,n){let i=t.clock.getDelta();"never"===t.frameloop&&"number"===typeof e&&(i=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),Je=t.internal.subscribers;for(let r=0;r<Je.length;r++)Ke=Je[r],Ke.ref.current(Ke.store.getState(),i,n);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}let $e,et,tt,nt=!1,it=!1;function rt(e){et=requestAnimationFrame(rt),nt=!0,$e=0,Ze("before",e),it=!0;for(const n of Fe.values()){var t;tt=n.store.getState(),!tt.internal.active||!("always"===tt.frameloop||tt.internal.frames>0)||null!=(t=tt.gl.xr)&&t.isPresenting||($e+=Qe(e,tt))}if(it=!1,Ze("after",e),0===$e)return Ze("tail",e),nt=!1,cancelAnimationFrame(et)}function at(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;var n;
2if(!e)return Fe.forEach(e=>at(e.store.getState(),t));null!=(n=e.gl.xr)&&n.isPresenting||!e.internal.active||"never"===e.frameloop||(e.internal.frames=t>1?Math.min(60,e.internal.frames+t):it?2:1,nt||(nt=!0,requestAnimationFrame(rt)))}function st(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(t&&Ze("before",e),n)Qe(e,n,i);else for(const r of Fe.values())Qe(e,r.store.getState());t&&Ze("after",e)}const ot={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function lt(e){const t=ee(e).handlePointer;return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-e.offsetY/t.size.height*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(ot).reduce((e,n)=>(0,a.A)((0,a.A)({},e),{},{[n]:t(n)}),{}),update:()=>{var t;const n=e.getState(),i=n.events,r=n.internal;null!=(t=r.lastEvent)&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{const n=e.getState(),i=n.set,s=n.events;if(null==s.disconnect||s.disconnect(),i(e=>({events:(0,a.A)((0,a.A)({},e.events),{},{connected:t})})),s.handlers)for(const e in s.handlers){const n=s.handlers[e],i=(0,r.A)(ot[e],2),a=i[0],o=i[1];t.addEventListener(a,n,{passive:o})}},disconnect:()=>{const t=e.getState(),n=t.set,i=t.events;if(i.connected){if(i.handlers)for(const e in i.handlers){const t=i.handlers[e],n=(0,r.A)(ot[e],1)[0];i.connected.removeEventListener(n,t)}n(e=>({events:(0,a.A)((0,a.A)({},e.events),{},{connected:void 0})}))}}}}},37(e,t,n){n.d(t,{Hl:()=>_});var i=n(379),r=n(544),a=n(986),s=n(926),o=n(43),l=n(408);function c(e,t){let n;return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debounce:0,scroll:!1,offsetSize:!1},t=e.debounce,n=e.scroll,i=e.polyfill,a=e.offsetSize;const s=i||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const l=(0,o.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=(0,r.A)(l,2),d=u[0],f=u[1],m=(0,o.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:d,orientationHandler:null}),g=t?"number"==typeof t?t:t.scroll:null,v=t?"number"==typeof t?t:t.resize:null,_=(0,o.useRef)(!1);(0,o.useEffect)(()=>(_.current=!0,()=>{_.current=!1}));const y=(0,o.useMemo)(()=>{const e=()=>{if(!m.current.element)return;const e=m.current.element.getBoundingClientRect(),t={left:e.left,top:e.top,width:e.width,height:e.height,bottom:e.bottom,right:e.right,x:e.x,y:e.y};m.current.element instanceof HTMLElement&&a&&(t.height=m.current.element.offsetHeight,t.width=m.current.element.offsetWidth),Object.freeze(t),_.current&&!p(m.current.lastBounds,t)&&f(m.current.lastBounds=t)};return[e,v?c(e,v):e,g?c(e,g):e]},[f,a,g,v]),x=(0,r.A)(y,3),b=x[0],S=x[1],M=x[2];function w(){m.current.scrollContainers&&(m.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",M,!0)),m.current.scrollContainers=null),m.current.resizeObserver&&(m.current.resizeObserver.disconnect(),m.current.resizeObserver=null),m.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",m.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",m.current.orientationHandler))}function T(){m.current.element&&(m.current.resizeObserver=new s(M),m.current.resizeObserver.observe(m.current.element),n&&m.current.scrollContainers&&m.current.scrollContainers.forEach(e
2=>e.addEventListener("scroll",M,{capture:!0,passive:!0})),m.current.orientationHandler=()=>{M()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",m.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",m.current.orientationHandler))}return function(e,t){(0,o.useEffect)(()=>{if(t){const t=e;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",t,!0)}}},[e,t])}(M,!!n),function(e){(0,o.useEffect)(()=>{const t=e;return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e])}(S),(0,o.useEffect)(()=>{w(),T()},[n,M,S]),(0,o.useEffect)(()=>w,[]),[e=>{!e||e===m.current.element||(w(),m.current.element=e,m.current.scrollContainers=h(e),T())},d,b]}function h(e){const t=[];if(!e||e===document.body)return t;const n=window.getComputedStyle(e);return[n.overflow,n.overflowX,n.overflowY].some(e=>"auto"===e||"scroll"===e)&&t.push(e),[...t,...h(e.parentElement)]}const d=["x","y","top","bottom","left","right","width","height"],p=(e,t)=>d.every(n=>e[n]===t[n]);var f=n(689),m=n(579);n(853);const g=["ref","children","fallback","resize","style","gl","events","eventSource","eventPrefix","shadows","linear","flat","legacy","orthographic","frameloop","dpr","performance","raycaster","camera","scene","onPointerMissed","onCreated"];function v(e){let t=e.ref,n=e.children,c=e.fallback,h=e.resize,d=e.style,p=e.gl,f=e.events,v=void 0===f?s.f:f,_=e.eventSource,y=e.eventPrefix,x=e.shadows,b=e.linear,S=e.flat,M=e.legacy,w=e.orthographic,T=e.frameloop,E=e.dpr,A=e.performance,C=e.raycaster,R=e.camera,P=e.scene,I=e.onPointerMissed,L=e.onCreated,N=(0,a.A)(e,g);o.useMemo(()=>(0,s.e)(l),[]);const U=(0,s.u)(),D=u((0,i.A)({scroll:!0,debounce:{scroll:50,resize:0}},h)),O=(0,r.A)(D,2),F=O[0],z=O[1],B=o.useRef(null),k=o.useRef(null);o.useImperativeHandle(t,()=>B.current);const V=(0,s.a)(I),H=o.useState(!1),G=(0,r.A)(H,2),W=G[0],j=G[1],X=o.use
2State(!1),q=(0,r.A)(X,2),Y=q[0],Z=q[1];if(W)throw W;if(Y)throw Y;const J=o.useRef(null);(0,s.b)(()=>{const e=B.current;if(z.width>0&&z.height>0&&e){async function t(){await J.current.configure({gl:p,scene:P,events:v,shadows:x,linear:b,flat:S,legacy:M,orthographic:w,frameloop:T,dpr:E,performance:A,raycaster:C,camera:R,size:z,onPointerMissed:function(){return null==V.current?void 0:V.current(...arguments)},onCreated:e=>{null==e.events.connect||e.events.connect(_?(0,s.i)(_)?_.current:_:k.current),y&&e.setEvents({compute:(e,t)=>{const n=e[y+"X"],i=e[y+"Y"];t.pointer.set(n/t.size.width*2-1,-i/t.size.height*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==L||L(e)}}),J.current.render((0,m.jsx)(U,{children:(0,m.jsx)(s.E,{set:Z,children:(0,m.jsx)(o.Suspense,{fallback:(0,m.jsx)(s.B,{set:j}),children:null!=n?n:null})})}))}J.current||(J.current=(0,s.c)(e)),t()}}),o.useEffect(()=>{const e=B.current;if(e)return()=>(0,s.d)(e)},[]);const K=_?"none":"auto";return(0,m.jsx)("div",(0,i.A)((0,i.A)({ref:k,style:(0,i.A)({position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:K},d)},N),{},{children:(0,m.jsx)("div",{ref:F,style:{width:"100%",height:"100%"},children:(0,m.jsx)("canvas",{ref:B,style:{display:"block"},children:c})})}))}function _(e){return(0,m.jsx)(f.Af,{children:(0,m.jsx)(v,(0,i.A)({},e))})}},717(e,t,n){var i=n(43),r=n(461);var a="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},s=r.useSyncExternalStore,o=i.useRef,l=i.useEffect,c=i.useMemo,u=i.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var h=o(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=c(function(){function e(e){if(!l){if(l=!0,s=e,e=i(e),void 0!==r&&d.hasValue){var t=d.value;if(r(t,e))return o=t}return o=e}if(t=o,a(s,e))return t;var n=i(e);return void 0!==r&&r(t,n)?(s=e,t):(s=e,o=n)}var s,o,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,i,r]);var p=s(e,h[0],h[1]);return l(function(){d.hasValue=!0,d.value=p},[p]),u(p),p}},443(e,t,n){e.exports=n(717)},689(e,t,n){n.d(t,{Af:()=>c,Nz:()=>s,u5:()=>u,y3:()=>p});var i=n(379),r=n(544),a=n(43);(()=>{var e,t;return"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||"ReactNative"===(null==(t=window.navigator)?void 0:t.product))})()?a.useLayoutEffect:a.useEffect;function s(e,t,n){if(!e)return;if(!0===n(e))return e;let i=t?e.return:e.child;for(;i;){const e=s(i,t,n);if(e)return e;i=t?null:i.sibling}}function o(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}const l=o(a.createContext(null));class c extends a.Component{render(){return a.createElement(l.Provider,{value:this._reactInternals},this.props.children)}}function u(){const e=a.useContext(l);if(null===e)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=a.useId();return a.useMemo(()=>{for(const n of[e,null==e?void 0:e.alternate]){if(!n)continue;const e=s(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}const h=Symbol.for("react.context"),d=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===h;function p(){const e=function(){const e=u(),t=a.useState(()=>new Map),n=(0,r.A)(t,1)[0];n.clear();let i=e;for(;i;){const e=i.type;d(e)&&e!==l&&!n.has(e)&&n.set(e,a.use(o(e))),i=i.return}return n}();return a.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>a.createElement(t,null,a.createElement(n.Provider,(0,i.A)((0,i.A)({},r),{},{value:e.get(n)}))),e=>a.createElement(c,(0,i.A)({},e))),[e])}},435(e,t,n){n.d(t,{$EB:()=>_,$Ed:()=>Bo,$Kf:()=>Js,$NF:()=>Hu,$O9:()=>we,$Yl:()=>G,$_I:()=>Pe,$ei:()=>P,$p8:()=>ph,A$4:()=>Ia,A76:()=>ci,AKb:()=>mu,ALV:()=>nr,AZd:()=>hn,Am1:()=>Ih,B69:()=>Pr,B6O:()=>kl,BER:()=>he,BH$:()=>el,BKk:()=>$c,BND:()=>sp,BRH:()=>Wu,BVL:()=>pt,BXX:()=>at,B_h:()=>_t,CR7:()=>Tn,CSG:()=>ou,CV9:()=>Zl,CVz:()=>ut,CWW:()=>Ft,Cfg:()=>Te,CmU:()=>xh,CwR:()=>$h,D$Q:()=>eu,DAe:()=>Zt,DXC:()=>Qo,Df:()=>ru,Dmk:()=>Ge,E0M:()=>hp,EAD:()=>eo,EQC:()=>Gt,EZo:()=>b,EdD:()=>M,F1T:()=>Fh,F1l:()=>Gd,FCc:()=>$o,FFZ:()=>Fn,FNr:()=>cu,FV:()=>oe,FXf:()=>A,FZo:()=>gh,Fn:()=>It,Fpm:()=>Fd,FtX:()=>ml,FvD:()=>ul,Fvi:()=>de,Fvt:()=>uu,G3T:()=>zt,G4u:()=>Qn,GBG:()=>Tu,GJx:()=>ye,GOR:()=>fl,GWd:()=>qe,GYF:()=>Ks,GZZ:()=>Xl,G_z:()=>su,Gc6:()=>vl,Gu$:()=>Bc,Gwm:()=>K,GxU:()=>Sa,H23:()=>Lt,H2z:()=>fp,HIg:()=>Xe,HLH:()=>vn,HO_:()=>Ot,HPb:()=>Sn,HXV:()=>lt,HgN:()=>Gi,HiM:()=>ch,Hit:()=>wu,Ho_:()=>Sl,Hrb:()=>Pa,Hrq:()=>Wn,I46:()=>Zs,I9Y:()=>Ri,IE4:()=>nt,IUQ:()=>Ji,IWo:()=>ap,Iit:()=>Zc,IjV:()=>dn,Ipv:()=>Il,Iw4:()=>hd,IzY:()=>dp,Jnc:()=>u,K52:()=>Q,KDk:()=>dt,KLL:()=>un,KPJ:()=>Nu,KRh:()=>te,Ke9:()=>Yt,Kef:()=>Ut,Ktl:()=>kn,Kwu:()=>S,Kzg:()=>Ch,LAk:()=>ce,Ld9:()=>pp,LiQ:()=>U,LlO:()=>Qc,LoY:()=>qa,LuO:()=>gd,M4G:()=>Bh,MBL:()=>Eu,MOq:()=>jn,MSw:()=>zc,MW4:()=>Na,Mjd:()=>ae,N1A:()=>Yo,N2s:()=>ed,N5j:()=>en,NRn:()=>ia,NTi:()=>x,NZq:()=>Ie,Nex:()=>mp,Nt7:()=>
2z,Nv2:()=>ol,Nwf:()=>od,Nz6:()=>it,O0B:()=>Ki,O3Y:()=>Vc,O49:()=>Kt,O9p:()=>pr,ONl:()=>al,OUM:()=>Le,Oax:()=>Ua,Om:()=>_e,OtU:()=>mt,OuU:()=>O,P5j:()=>ld,PFK:()=>$d,PJ3:()=>Ht,PPD:()=>_o,PTz:()=>Pi,Pdi:()=>vu,Pem:()=>cl,Pf$:()=>Xh,Pq0:()=>Ii,Q1f:()=>zr,QCA:()=>Ic,QP0:()=>p,Qev:()=>vi,Qrf:()=>bt,R1W:()=>qd,R3r:()=>Nr,R8M:()=>di,RJ4:()=>Jt,ROr:()=>_n,RQf:()=>ze,RcT:()=>En,RiT:()=>Cu,Riy:()=>ht,Rkk:()=>$t,RlV:()=>Ts,Rm2:()=>ui,RoJ:()=>es,RrE:()=>H,Ru$:()=>yn,RyA:()=>m,S$4:()=>Pt,S20:()=>Ll,SUR:()=>bh,SYV:()=>ll,ScU:()=>Gu,T6I:()=>Mu,TDQ:()=>Pl,THS:()=>Ea,TM5:()=>$n,TMh:()=>Cn,Tap:()=>ju,TdN:()=>Zn,TiK:()=>Nn,TkQ:()=>$e,U3G:()=>J,UJ6:()=>bu,UPV:()=>Hc,UTZ:()=>pe,UZu:()=>li,Ufg:()=>Dc,UpK:()=>vs,UtB:()=>Ad,UtX:()=>Ph,V3x:()=>He,V9B:()=>Es,VCu:()=>gl,VGF:()=>et,VT0:()=>Je,VVr:()=>mn,Vb5:()=>c,VnP:()=>ql,Vnu:()=>Bn,Vwu:()=>gp,VxR:()=>cn,W9U:()=>Nt,WBB:()=>Nc,WNZ:()=>l,WTh:()=>np,Wdf:()=>Yn,Wew:()=>ke,Wk7:()=>f,Wyr:()=>qn,XG_:()=>Dt,XIg:()=>y,XJ7:()=>Wc,XMJ:()=>dd,XTe:()=>Mh,XrR:()=>ne,Y1n:()=>xu,Y9S:()=>zu,YHV:()=>Md,YJl:()=>Ir,YOZ:()=>Su,YRT:()=>ku,Yhb:()=>yu,Yuy:()=>Oe,Z0B:()=>Wl,Z58:()=>Hr,ZLX:()=>co,ZM4:()=>op,ZQM:()=>Ke,Zcv:()=>fo,Zpd:()=>kc,Zr2:()=>ln,ZyN:()=>dh,_4j:()=>tu,_QJ:()=>wt,_Ut:()=>Kc,_xc:()=>Vd,a$r:()=>Ee,a55:()=>bi,a5J:()=>Mt,aEY:()=>k,aHM:()=>Du,aJ8:()=>ue,aMy:()=>Bt,aVO:()=>lu,agE:()=>zn,amv:()=>Pn,b4q:()=>pl,bC7:()=>At,bCz:()=>w,bI3:()=>rn,bTm:()=>d,baL:()=>Ca,bdM:()=>Oc,bkx:()=>Fe,brA:()=>Y,bw0:()=>$,c5h:()=>dl,c90:()=>tt,cHt:()=>De,cRK:()=>kr,cZY:()=>Dd,caT:()=>ee,cj9:()=>Ci,czI:()=>yt,dAo:()=>Yl,dJg:()=>Wt,dYF:()=>tr,dcC:()=>Ze,dhZ:()=>qt,dth:()=>qu,dwI:()=>Ui,dzP:()=>md,e0p:()=>W,eB$:()=>Ya,eHc:()=>X,eHs:()=>Ja,eaF:()=>zs,eoi:()=>Un,er$:()=>on,ezk:()=>_u,f4X:()=>N,fBL:()=>Ue,fJr:()=>xn,fP5:()=>qh,fTw:()=>Yd,fc6:()=>Ra,g7M:()=>le,gJ2:()=>Ve,gO9:()=>E,gPd:()=>Zi,gWB:()=>On,gZr:()=>ft,ghU:()=>xe,h2z:()=>Xt,hB5:()=>g,hIf:()=>Hn,hZF:()=>Au,h_9:()=>Uu,hdd:()=>F,hgQ:()=>V,hjs:()=>wd,hsX:()=>v,hxR:()=>Se,hy7:()=>fe,hzE:()=>Zd,i7d:()=>th,i7u:()=>Jn,iNn:()=>yl,iOZ:()=>hl,iUH:()=>Re,ibB:()=>Nl,ie2:()=>D,imn:()=>$a,ix0:()=>Be,iyt:()=>Ba,j6:()=>Gc,jGm:()=>Ql,jR7:()=>rt,jSS:()=>gt,jUj:()=>Vr,jej:()=>mi,jf0:()=>sn,jsO:()=>wn,jut:()=>_h,jzd:()=>Dn,k6Q:()=>st,k6q:()=>Ae,k8v:()=>nn,kBv:()=>s,kEx:()=>Bu,kG0:()=>gn,kLi:()=>ji,kO0:()=>Ln,kRr:()=>Ce,kTW:()=>be,kTp:()=>ot,kYr:()=>Mn,k_V:()=>Td,keZ:()=>Dh,klZ:()=>An,kn4:()=>ir,kqe:()=>fn,kxk:()=>ps,kyO:()=>re,l2R:()=>Iu,lGu:()=>q,lGw:()=>gu,lMl:()=>na,lPF:()=>ai,lc7:()=>kt,ljd:()=>Vt,lxW:()=>Yc,lyL:()=>Et,mcG:()=>fi,mrM:()=>ko,nCl:()=>oh,nEu:()=>Tl,nNL:()=>se,nST:()=>C,nWS:()=>Qi,nZQ:()=>zh,nc$:()=>pd,nzx:()=>Uc,oVO:()=>bn,oh6:()=>vd,ojh:()=>I,ojs:()=>Rt,ov9:()=>j,pBf:()=>ct,pCc:()=>T,pFK:()=>wl,pHI:()=>Me,pO5:()=>pn,pPE:()=>cd,paN:()=>Qe,ppV:()=>Bi,psI:()=>St,q2:()=>qc,qBx:()=>au,qFE:()=>Ml,qU7:()=>xl,qUd:()=>uh,qa3:()=>vt,qad:()=>L,qq$:()=>ri,qtW:()=>Da,r6x:()=>yh,rFo:()=>$i,rKP:()=>Fc,rOG:()=>Xn,rQf:()=>jt,rSH:()=>xt,rYR:()=>Qt,ri6:()=>gi,rjZ:()=>_l,s0K:()=>jl,sKt:()=>Rn,sPf:()=>a,tBo:()=>yd,tJf:()=>Ne,tXL:()=>iu,tcD:()=>bl,tz3:()=>Ru,uB5:()=>Tt,uSd:()=>nu,uV5:()=>ve,uWO:()=>to,uXQ:()=>Vn,ubm:()=>ah,uf3:()=>xo,uov:()=>Gn,ure:()=>fh,v9J:()=>Kn,veJ:()=>Xu,vim:()=>In,vmz:()=>La,vyJ:()=>an,wAk:()=>$l,wTz:()=>tn,wfO:()=>ge,wn6:()=>B,wrO:()=>je,wtR:()=>o,wvS:()=>Aa,x$Y:()=>ei,xFO:()=>me,xJ6:()=>Cc,xOk:()=>mh,xSv:()=>Z,xZx:()=>Qh,xfg:()=>Jl,y3Z:()=>Ct,y9J:()=>er,yT7:()=>We,y_p:()=>ie,ypk:()=>ec,ywQ:()=>h,z3S:()=>pi,zD7:()=>Sd,zdS:()=>Ye,zgK:()=>fr,znC:()=>R});var i=n(544),r=n(379);
2const a="185",s={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},l=0,c=1,u=2,h=3,d=0,p=1,f=2,m=3,g=0,v=1,_=2,y=0,x=1,b=2,S=3,M=4,w=5,T=6,E=100,A=101,C=102,R=103,P=104,I=200,L=201,N=202,U=203,D=204,O=205,F=206,z=207,B=208,k=209,V=210,H=211,G=212,W=213,j=214,X=0,q=1,Y=2,Z=3,J=4,K=5,Q=6,$=7,ee=0,te=1,ne=2,ie=0,re=1,ae=2,se=3,oe=4,le=5,ce=6,ue=7,he="attached",de="detached",pe=300,fe=301,me=302,ge=303,ve=304,_e=306,ye=1e3,xe=1001,be=1002,Se=1003,Me=1004,we=1004,Te=1005,Ee=1005,Ae=1006,Ce=1007,Re=1007,Pe=1008,Ie=1008,Le=1009,Ne=1010,Ue=1011,De=1012,Oe=1013,Fe=1014,ze=1015,Be=1016,ke=1017,Ve=1018,He=1020,Ge=35902,We=35899,je=1021,Xe=1022,qe=1023,Ye=1026,Ze=1027,Je=1028,Ke=1029,Qe=1030,$e=1031,et=1032,tt=1033,nt=33776,it=33777,rt=33778,at=33779,st=35840,ot=35841,lt=35842,ct=35843,ut=36196,ht=37492,dt=37496,pt=37488,ft=37489,mt=37490,gt=37491,vt=37808,_t=37809,yt=37810,xt=37811,bt=37812,St=37813,Mt=37814,wt=37815,Tt=37816,Et=37817,At=37818,Ct=37819,Rt=37820,Pt=37821,It=36492,Lt=36494,Nt=36495,Ut=36283,Dt=36284,Ot=36285,Ft=36286,zt=2200,Bt=2201,kt=2202,Vt=2300,Ht=2301,Gt=2302,Wt=2303,jt=2400,Xt=2401,qt=2402,Yt=2500,Zt=2501,Jt=0,Kt=1,Qt=2,$t=3200,en=3201,tn=3202,nn=3203,rn=0,an=1,sn="",on="srgb",ln="srgb-linear",cn="linear",un="srgb",hn="",dn="rg",pn="ga",fn=0,mn=7680,gn=7681,vn=7682,_n=7683,yn=34055,xn=34056,bn=5386,Sn=512,Mn=513,wn=514,Tn=515,En=516,An=517,Cn=518,Rn=519,Pn=512,In=513,Ln=514,Nn=515,Un=516,Dn=517,On=518,Fn=519,zn=35044,Bn=35048,kn=35040,Vn=35045,Hn=35049,Gn=35041,Wn=35046,jn=35050,Xn=35042,qn="100",Yn="300 es",Zn=2e3,Jn=2001,Kn={COMPUTE:"compute",RENDER:"render"},Qn={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},$n={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},ei={TEXTURE_COMPARE:"depthTextureCompare"};const ti={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ni(e,t){return new ti[e](t)}function ii(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ri(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function ai(){const e=ri("canvas");return e.style.display="block",e}const si={};let oi=null;function li(e){oi=e}function ci(){return oi}function ui(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i="THREE."+t.shift();oi?oi("log",i,...t):console.log(i,...t)}function hi(e){const t=e[0];if("string"===typeof t&&t.startsWith("TSL:")){const t=e[1];t&&t.isStackTrace?e[0]+=" "+t.getLocation():e[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return e}function di(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i="THREE."+(t=hi(t)).shift();if(oi)oi("warn",i,...t);else{const e=t[0];e&&e.isStackTrace?console.warn(e.getError(i)):console.warn(i,...t)}}function pi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i="THREE."+(t=hi(t)).shift();if(oi)oi("error",i,...t);else{const e=t[0];e&&e.isStackTrace?console.error(e.getError(i)):console.error(i,...t)}}function fi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.join(" ");i in si||(si[i]=!0,di(...t))}function mi(e,t,n){return new Promise(function(i,r){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}},n)})}const gi={[X]:q,[Y]:Q,[J]:$,[Z]:K,[q]:X,[Q]:Y,[$]:J,[K]:Z};class vi{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return void 0!==n&&(void 0!==n[e]&&-1!==n[e].indexOf(t))}removeEventListener(e,t){const n=this._listeners;if(void 0===n)return;const i=n[e];if(void 0!==i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){const t=this._listeners;if(void 0===t)return;const n=t[e.type];if(void 0!==n){e.target=this;const t=n.slice(0);for(let n=0,i=t.length;n<i;n++)t[n].call(this,e);e.target=null}}}const _i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
25","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let yi=1234567;const xi=Math.PI/180,bi=180/Math.PI;function Si(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(_i[255&e]+_i[e>>8&255]+_i[e>>16&255]+_i[e>>24&255]+"-"+_i[255&t]+_i[t>>8&255]+"-"+_i[t>>16&15|64]+_i[t>>24&255]+"-"+_i[63&n|128]+_i[n>>8&255]+"-"+_i[n>>16&255]+_i[n>>24&255]+_i[255&i]+_i[i>>8&255]+_i[i>>16&255]+_i[i>>24&255]).toLowerCase()}function Mi(e,t,n){return Math.max(t,Math.min(n,e))}function wi(e,t){return(e%t+t)%t}function Ti(e,t,n){return(1-n)*e+n*t}function Ei(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Ai(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const Ci={DEG2RAD:xi,RAD2DEG:bi,generateUUID:Si,clamp:Mi,euclideanModulo:wi,mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Ti,damp:function(e,t,n,i){return Ti(e,t,1-Math.exp(-n*i))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(wi(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(yi=e);let t=yi+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*xi},radToDeg:function(e){return e*bi},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){const a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),c=a((t+i)/2),u=s((t+i)/2),h=a((t-i)/2),d=s((t-i)/2),p=a((i-t)/2),f=s((i-t)/2);switch(r){case"XYX":e.set(o*u,l*h,l*d,o*c);break;case"YZY":e.set(l*d,o*u,l*h,o*c);break;case"ZXZ":e.set(l*h,l*d,o*u,o*c);break;case"XZX":e.set(o*u,l*f,l*p,o*c);break;case"YXY":e.set(l*p,o*u,l*f,o*c);break;case"ZYZ":e.set(l*f,l*p,o*u,o*c);break;default:di("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Ai,denormalize:Ei};class Ri{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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("THREE.Vector2: 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("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 10,763 bytes, line 2
2sub(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,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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=Mi(this.x,e.x,t.x),this.y=Mi(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Mi(this.x,e,t),this.y=Mi(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Mi(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mi(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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Ri.prototype.isVector2=!0;class Pi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3],h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(u!==f||o!==h||l!==d||c!==p){let e=o*h+l*d+c*p+u*f;e<0&&(h=-h,d=-d,p=-p,f=-f,e=-e);let t=1-s;if(e<.9995){const n=Math.acos(e),i=Math.sin(n);t=Math.sin(t*n)/i,o=o*t+h*(s=Math.sin(s*n)/i),l=l*t+d*s,c=c*t+p*s,u=u*t+f*s}else{o=o*t+h*s,l=l*t+d*s,c=c*t+p*s,u=u*t+f*s;const e=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,a){const s=n[i],o=n[i+1],l=n[i+2],c=n[i+3],u=r[a],h=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+c*u+o*d-l*h,e[t+1]=o*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-o*u,e[t+3]=c*p-s*u-o*h-l*d,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,i){return this._x=e,this._y=t,this._z=n,this._w=i,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){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e._x,i=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),c=s(i/2),u=s(r/2),h=o(n/2),d=o(i/2),p=o(r/2);switch(a){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:di("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=n+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>u){const e=2*Math.sqrt(1+n-s-u);this._w=(c-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-n-u);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+u-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Mi(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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 0===e?(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,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+a*s+i*l-r*o,this._y=i*c+a*o+r*s-n*l,this._z=r*c+a*l+n*o-i*s,this._w=a*c-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let o=1-t;if(s<.9995){const e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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 Ii{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(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("THREE.Vector3: 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("THREE.Vector3: 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(Ni.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ni.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}
vendor: 8,517 bytes, line 2
2applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),c=2*(s*t-r*i),u=2*(r*n-a*t);return this.x=t+o*l+a*u-s*c,this.y=n+o*c+s*l-r*u,this.z=i+o*u+r*c-a*l,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,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,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=Mi(this.x,e.x,t.x),this.y=Mi(this.y,e.y,t.y),this.z=Mi(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Mi(this.x,e,t),this.y=Mi(this.y,e,t),this.z=Mi(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Mi(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Li.copy(this).projectOnVector(e),this.sub(Li)}reflect(e){return this.sub(Li.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mi(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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 i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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=2*Math.random()-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}}Ii.prototype.isVector3=!0;const Li=new Ii,Ni=new Pi;class Ui{constructor(e,t,n,i,r,a,s,o,l){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=r,c[5]=o,c[6]=n,c[7]=a,c[8]=l,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,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],b=i[5],S=i[8];return r[0]=a*f+s*v+o*x,r[3]=a*m+s*_+o*b,r[6]=a*g+s*y+o*S,r[1]=l*f+c*v+u*x,r[4]=l*m+c*_+u*b,r[7]=l*g+c*y+u*S,r[2]=h*f+d*v+p*x,r[5]=h*m+d*_+p*b,r[8]=h*g+d*y+p*S,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],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-n*r*c+n*s*o+i*r*l-i*a*o}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=c*a-s*l,h=s*o-c*r,d=l*r-a*o,p=t*u+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(i*l-c*n)*f,e[2]=(s*n-i*a)*f,e[3]=h*f,e[4]=(c*t-i*o)*f,e[5]=(i*r-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*r)*f,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,i,r,a,s){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return fi("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Di.makeScale(e,t)),this}rotate(e){return fi("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Di.makeRotation(-e)),this}translate(e,t){return fi("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Di.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 i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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)}}Ui.prototype.isMatrix3=!0;const Di=new Ui,Oi=(new Ui).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fi=(new Ui).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function zi(){const e={enabled:!0,workingColorSpace:ln,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n?(this.spaces[t].transfer===un&&
2(e.r=ki(e.r),e.g=ki(e.g),e.b=ki(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===un&&(e.r=Vi(e.r),e.g=Vi(e.g),e.b=Vi(e.b)),e):e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===sn?cn:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.workingColorSpace;return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return fi("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return fi("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return e.define({[ln]:{primaries:t,whitePoint:i,transfer:cn,toXYZ:Oi,fromXYZ:Fi,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:on},outputColorSpaceConfig:{drawingBufferColorSpace:on}},[on]:{primaries:t,whitePoint:i,transfer:un,toXYZ:Oi,fromXYZ:Fi,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:on}}}),e}const Bi=zi();function ki(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Vi(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Hi;class Gi{static getDataURL(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(e.src))return e.src;if("undefined"===typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Hi&&(Hi=ri("canvas")),Hi.width=e.width,Hi.height=e.height;const n=Hi.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Hi}return t.toDataURL(n)}static sRGBToLinear(e){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){const t=ri("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e<r.length;e++)r[e]=255*ki(r[e]/255);return n.putImageData(i,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*ki(t[e]/255)):t[e]=ki(t[e]);return{data:t,width:e.width,height:e.height}}return di("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Wi=0;class ji{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isSource=!0,Object.defineProperty(this,"id",{value:Wi++}),this.uuid=Si(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return"undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"undefined"!==typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(Xi(i[t].image)):e.push(Xi(i[t]))}else e=Xi(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function Xi(e){return"undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap?Gi.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(di("Texture: Unable to serialize Texture."),{})}let qi=0;const Yi=new Ii;class Zi extends vi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zi.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zi.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:xe,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xe,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ae,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Pe,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:qe,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Le,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Zi.DEFAULT_ANISOTROPY,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:sn;super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:qi++}),this.uuid=Si(),this.name="",this.source=new ji(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new Ri(0,0),this.repeat=new Ri(1,1),this.center=new Ri(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ui,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
vendor: 5,043 bytes, line 2
2=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Yi).x}get height(){return this.source.getSize(Yi).y}get depth(){return this.source.getSize(Yi).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(void 0===n){di("Texture.setValues(): parameter '".concat(t,"' has value of undefined."));continue}const i=this[t];void 0!==i?i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n:di("Texture.setValues(): property '".concat(t,"' does not exist."))}}toJSON(e){const t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==pe)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ye:e.x=e.x-Math.floor(e.x);break;case xe:e.x=e.x<0?0:1;break;case be:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ye:e.y=e.y-Math.floor(e.y);break;case xe:e.y=e.y<0?0:1;break;case be:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Zi.DEFAULT_IMAGE=null,Zi.DEFAULT_MAPPING=pe,Zi.DEFAULT_ANISOTROPY=1;class Ji{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.x=e,this.y=t,this.z=n,this.w=i}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,i){return this.x=e,this.y=t,this.z=n,this.w=i,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("THREE.Vector4: 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("THREE.Vector4: 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=void 0!==e.w?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}
vendor: 6,032 bytes, line 2
2sub(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,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,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,i,r;const a=.01,s=.1,o=e.elements,l=o[0],c=o[4],u=o[8],h=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-h)<a&&Math.abs(u-f)<a&&Math.abs(p-m)<a){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,v=(g+1)/2,_=(c+h)/4,y=(u+f)/4,x=(p+m)/4;return e>o&&e>v?e<a?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=_/n,r=y/n):o>v?o<a?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=_/i,r=x/i):v<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=y/r,i=x/r),this.set(n,i,r,t),this}let v=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(u-f)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Mi(this.x,e.x,t.x),this.y=Mi(this.y,e.y,t.y),this.z=Mi(this.z,e.z,t.z),this.w=Mi(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Mi(this.x,e,t),this.y=Mi(this.y,e,t),this.z=Mi(this.z,e,t),this.w=Mi(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Mi(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}}Ji.prototype.isVector4=!0;class Ki extends vi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ae,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Ji(0,0,e,t),this.scissorTest=!1,this.viewport=new Ji(0,0,e,t),this.textures=[];const i={width:e,height:t,depth:n.depth},r=new Zi(i),a=n.count;for(let s=0;s<a;s++)this.textures[s]=r.clone(),this.textures[s].isRenderTargetTexture=!0,this.textures[s].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={minFilter:Ae,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace
vendor: 6,313 bytes, line 2
2=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++){this.textures[n].setValues(t)}}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const n=Object.assign({},e.textures[t].image);this.textures[t].source=new ji(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Qi extends Ki{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.isWebGLRenderTarget=!0}}class $i extends Zi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Se,this.minFilter=Se,this.wrapR=xe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class er extends Qi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new $i(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class tr extends Zi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Se,this.minFilter=Se,this.wrapR=xe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nr extends Qi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new tr(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class ir{constructor(e,t,n,i,r,a,s,o,l,c,u,h,d,p,f,m){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l,c,u,h,d,p,f,m)}set(e,t,n,i,r,a,s,o,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ir).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 0===this.determinantAffine()?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinantAffine())return this.identity();const t=this.elements,n=e.elements,i=1/rr.setFromMatrixColumn(e,0).length(),r=1/rr.setFromMatrixColumn(e,1).length(),a=1/rr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){const e=a*c,n=a*u,i=s*c,r=s*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){const e=o*c,n=o*u,i=l*c,r=l*u;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){const e=o*c,n=o*u,i=l*c,r=l*u;t[0]=e-r*s,t[4]=-a*u,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*c,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){const e=a*c,n=a*u,i=s*c,r=s*u;t[0]=o*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*u,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}
vendor: 5,731 bytes, line 2
2else if("YZX"===e.order){const e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=r-e*u,t[8]=i*u+n,t[1]=u,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=n*u+i,t[10]=e-r*u}else if("XZY"===e.order){const e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+r,t[5]=a*c,t[9]=n*u-i,t[2]=i*u-n,t[6]=s*c,t[10]=r*u+e}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(sr,e,or)}lookAt(e,t,n){const i=this.elements;return ur.subVectors(e,t),0===ur.lengthSq()&&(ur.z=1),ur.normalize(),lr.crossVectors(n,ur),0===lr.lengthSq()&&(1===Math.abs(n.z)?ur.x+=1e-4:ur.z+=1e-4,ur.normalize(),lr.crossVectors(n,ur)),lr.normalize(),cr.crossVectors(ur,lr),i[0]=lr.x,i[4]=cr.x,i[8]=ur.x,i[1]=lr.y,i[5]=cr.y,i[9]=ur.y,i[2]=lr.z,i[6]=cr.z,i[10]=ur.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],b=i[0],S=i[4],M=i[8],w=i[12],T=i[1],E=i[5],A=i[9],C=i[13],R=i[2],P=i[6],I=i[10],L=i[14],N=i[3],U=i[7],D=i[11],O=i[15];return r[0]=a*b+s*T+o*R+l*N,r[4]=a*S+s*E+o*P+l*U,r[8]=a*M+s*A+o*I+l*D,r[12]=a*w+s*C+o*L+l*O,r[1]=c*b+u*T+h*R+d*N,r[5]=c*S+u*E+h*P+d*U,r[9]=c*M+u*A+h*I+d*D,r[13]=c*w+u*C+h*L+d*O,r[2]=p*b+f*T+m*R+g*N,r[6]=p*S+f*E+m*P+g*U,r[10]=p*M+f*A+m*I+g*D,r[14]=p*w+f*C+m*L+g*O,r[3]=v*b+_*T+y*R+x*N,r[7]=v*S+_*E+y*P+x*U,r[11]=v*M+_*A+y*I+x*D,r[15]=v*w+_*C+y*L+x*O,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],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15],v=o*d-l*h,_=s*d-l*u,y=s*h-o*u,x=a*d-l*c,b=a*h-o*c,S=a*u-s*c;return t*(f*v-m*_+g*y)-n*(p*v-m*x+g*b)+i*(p*_-f*x+g*S)-r*(p*y-f*b+m*S)}determinantAffine(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[1],a=e[5],s=e[9],o=e[2],l=e[6],c=e[10];return t*(a*c-s*l)-n*(r*c-s*o)+i*(r*l-a*o)}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 i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=t*s-n*a,_=t*o-i*a,y=t*l-r*a,x=n*o-i*s,b=n*l-r*s,S=i*l-r*o,M=c*f-u*p,w=c*m-h*p,T=c*g-d*p,E=u*m-h*f,A=u*g-d*f,C=h*g-d*m,R=v*C-_*A+y*E+x*T-b*w+S*M;if(0===R)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/R;return e[0]=(s*C-o*A+l*E)*P,e[1]=(i*A-n*C-r*E)*P,e[2]=(f*S-m*b+g*x)*P,e[3]=(h*b-u*S-d*x)*P,e[4]=(o*T-a*C-l*w)*P,e[5]=(t*C-i*T+r*w)*P,e[6]=(m*y-p*S-g*_)*P,e[7]=(c*S-h*y+d*_)*P,e[8]=(a*A-s*T+l*M)*P,e[9]=(n*T-t*A-r*M)*P,e[10]=(p*b-f*y+g*v)*P,e[11]=(u*y-c*b-d*v)*P,e[12]=(s*w-a*E-o*M)*P,e[13]=(t*E-n*w+i*M)*P,e[14]=(f*_-p*x-m*v)*P,e[15]=(c*x-u*_+h*v)*P,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}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),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,c=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,c*s+n,c*o-i*a,0,l*o-i*s,c*o+i*a,r*o*o+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,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,c=a+a,u=s+s,h=r*l,d=r*c,p=r*u,f=a*c,m=a*u,g=s*u,v=o*l,_=o*c,y=o*u,x=n.x,b=n.y,S=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+_)*S,i[9]=(m-v)*S,i[10]=(1-(h+f))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];const r=this.determinantAffine();if(0===r)return n.set(1,1,1),t.identity(),this;let a=rr.set(i[0],i[1],i[2]).length();const s=rr.set(i[4],i[5],i[6]).length(),o=rr.set(i[8],i[9],i[10]).length();r<0&&(a=-a),ar.copy(this);const l=1/a,c=1/s,u=1/o;return ar.elements[0]*=l,ar.elements[1]*=l,ar.elements[2]*=l,ar.elements[4]*=c,ar.elements[5]*=c,ar.elements[6]*=c,ar.elements[8]*=u,ar.elements[9]*=u,ar.elements[10]*=u,t.setFromRotationMatrix(ar),n.x=a,n.y=s,n.z=o,this}makePerspective(e,t,n,i,r,a){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Zn,o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const l=this.elements,c=2*r/(t-e),u=2*r/(n-i),h=(t+e)/(t-e),d=(n+i)/(n-i);let p,f;if(o)p=r/(a-r),f=a*r/(a-r);else if(s===Zn)p=-(a+r)/(a-r),f=-2*a*r/(a-r);else{if(s!==Jn)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);p=-a/(a-r),f=-a*r/(a-r)}return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10
2]=p,l[14]=f,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,r,a){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Zn,o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const l=this.elements,c=2/(t-e),u=2/(n-i),h=-(t+e)/(t-e),d=-(n+i)/(n-i);let p,f;if(o)p=1/(a-r),f=a/(a-r);else if(s===Zn)p=-2/(a-r),f=-(a+r)/(a-r);else{if(s!==Jn)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);p=-1/(a-r),f=-r/(a-r)}return l[0]=c,l[4]=0,l[8]=0,l[12]=h,l[1]=0,l[5]=u,l[9]=0,l[13]=d,l[2]=0,l[6]=0,l[10]=p,l[14]=f,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}}ir.prototype.isMatrix4=!0;const rr=new Ii,ar=new ir,sr=new Ii(0,0,0),or=new Ii(1,1,1),lr=new Ii,cr=new Ii,ur=new Ii,hr=new ir,dr=ne
vendor: 5,197 bytes, line 2
2w Pi;class pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pr.DEFAULT_ORDER;this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=i,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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=e.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],c=i[9],u=i[2],h=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(Mi(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Mi(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Mi(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-Mi(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Mi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-Mi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:di("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return hr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(hr,t,n)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return dr.setFromEuler(this),this.setFromQuaternion(dr,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],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}}pr.DEFAULT_ORDER="XYZ";class fr{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return 0!==(this.mask&e.mask)}isEnabled(e){return 0!==(this.mask&1<<e)}}let mr=0;const gr=new Ii,vr=new Pi,_r=new ir,yr=new Ii,xr=new Ii,br=new Ii,Sr=new Pi,Mr=new Ii(1,0,0),wr=new Ii(0,1,0),Tr=new Ii(0,0,1),Er={type:"added"},Ar={type:"removed"},Cr={type:"childadded",child:null},Rr={type:"childremoved",child:null};class Pr extends vi{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:mr++}),this.uuid=Si(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pr.DEFAULT_UP.clone();const e=new Ii,t=new pr,n=new Pi,i=new Ii(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new ir},normalMatrix:{value:new Ui}}),this.matrix=new ir,this.matrixWorld=new ir,this.matrixAutoUpdate=Pr.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Pr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new fr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 16,303 bytes, line 2
2setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return vr.setFromAxisAngle(e,t),this.quaternion.multiply(vr),this}rotateOnWorldAxis(e,t){return vr.setFromAxisAngle(e,t),this.quaternion.premultiply(vr),this}rotateX(e){return this.rotateOnAxis(Mr,e)}rotateY(e){return this.rotateOnAxis(wr,e)}rotateZ(e){return this.rotateOnAxis(Tr,e)}translateOnAxis(e,t){return gr.copy(e).applyQuaternion(this.quaternion),this.position.add(gr.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Mr,e)}translateY(e){return this.translateOnAxis(wr,e)}translateZ(e){return this.translateOnAxis(Tr,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_r.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?yr.copy(e):yr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),xr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_r.lookAt(xr,yr,this.up):_r.lookAt(yr,xr,this.up),this.quaternion.setFromRotationMatrix(_r),i&&(_r.extractRotation(i.matrixWorld),vr.setFromRotationMatrix(_r),this.quaternion.premultiply(vr.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(pi("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Er),Cr.child=e,this.dispatchEvent(Cr),Cr.child=null):pi("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Ar),Rr.child=e,this.dispatchEvent(Rr),Rr.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),_r.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),_r.multiply(e.parent.matrixWorld)),e.applyMatrix4(_r),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Er),Cr.child=e,this.dispatchEvent(Cr),Cr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(xr,e,br),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(xr,Sr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(null!==e){const t=e.x,n=e.y,i=e.z,r=this.matrix.elements;r[12]+=t-r[0]*t-r[4]*n-r[8]*i,r[13]+=n-r[1]*t-r[5]*n-r[9]*i,r[14]+=i-r[2]*t-r[6]*n-r[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++){t[n].updateMatrixWorld(e)}}updateWorldMatrix(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),!0===t){const e=this.children;for(let t=0,i=e.length;t<i;t++){e[t].updateWorldMatrix(!1,!0,n)}}}toJSON(e){const t=void 0===e||"string"===typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};function a(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),!1!==this.static&&(i.static=this.static),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),null!==this.pivot&&(i.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(e=>(0,r.A)((0,r.A)({},e),{},{boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>(0,r.A)({},e)),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=a(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const i=n[t];a(e.shapes,i)}else a(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(a(e.materials,this.material[n]));i.material=t}else i.material=a(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];i.animations.push(a(e.animations,n))}}if(t){const t=s(e.geometries),i=s(e.materials),r=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),c=s(e.animations),u=s(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function s(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=null!==e.pivot?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let n=0;n<e.children.length;n++){const t=e.children[n];this.add(t.clone())}return this}}Pr.DEFAULT_UP=new Ii(0,1,0),Pr.DEFAULT_MATRIX_AUTO_UPDATE=!0,Pr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Ir extends Pr{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Lr={type:"move"};class Nr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Ir,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Ir,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ii,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ii),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Ir,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ii,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ii,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&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}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const a of e.hand.values()){const e=t.getJointPose(a,n),i=this._getHandJoint(l,a);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,o.eventsEnabled&&o.dispatchEvent({type:"gripUpdated",data:e,target:this})));null!==s&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Lr)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new Ir;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const Ur={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},Dr={h:0,s:0,l:0},Or={h:0,s:0,l:0};function Fr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}
2class zr{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(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Bi.colorSpaceToWorking(this,t),this}setRGB(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bi.workingColorSpace;return this.r=e,this.g=t,this.b=n,Bi.colorSpaceToWorking(this,i),this}setHSL(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bi.workingColorSpace;if(e=wi(e,1),t=Mi(t,0,1),n=Mi(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=Fr(r,i,e+1/3),this.g=Fr(r,i,e),this.b=Fr(r,i,e-1/3)}return Bi.colorSpaceToWorking(this,i),this}setStyle(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on;function i(t){void 0!==t&&parseFloat(t)<1&&di("Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=t[1],s=t[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,n);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,n);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,n);break;default:di("Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=t[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,n);if(6===r)return this.setHex(parseInt(i,16),n);di("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on;const n=Ur[e.toLowerCase()];return void 0!==n?this.setHex(n,t):di("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=ki(e.r),this.g=ki(e.g),this.b=ki(e.b),this}copyLinearToSRGB(e){return this.r=Vi(e.r),this.g=Vi(e.g),this.b=Vi(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:on;return Bi.workingToColorSpace(Br.copy(this),e),65536*Math.round(Mi(255*Br.r,0,255))+256*Math.round(Mi(255*Br.g,0,255))+Math.round(Mi(255*Br.b,0,255))}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:on;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bi.workingColorSpace;Bi.workingToColorSpace(Br.copy(this),t);const n=Br.r,i=Br.g,r=Br.b,a=Math.max(n,i,r),s=Math.min(n,i,r);let o,l;const c=(s+a)/2;if(s===a)o=0,l=0;else{const e=a-s;switch(l=c<=.5?e/(a+s):e/(2-a-s),a){case n:o=(i-r)/e+(i<r?6:0);break;case i:o=(r-n)/e+2;break;case r:o=(n-i)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bi.workingColorSpace;return Bi.workingToColorSpace(Br.copy(this),t),e.r=Br.r,e.g=Br.g,e.b=Br.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:on;Bi.workingToColorSpace(Br.copy(this),e);const t=Br.r,n=Br.g,i=Br.b;return e!==on?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(n.toFixed(3)," ").concat(i.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*n),",").concat(Math.round(255*i),")")}offsetHSL(e,t,n){return this.getHSL(Dr),this.setHSL(Dr.h+e,Dr.s+t,Dr.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
2lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Dr),e.getHSL(Or);const n=Ti(Dr.h,Or.h,t),i=Ti(Dr.s,Or.s,t),r=Ti(Dr.l,Or.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Br=new zr;zr.NAMES=Ur;class kr{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25e-5;this.isFogExp2=!0,this.name="",this.color=new zr(e),this.density=t}clone(){return new kr(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Vr{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.isFog=!0,this.name="",this.color=new zr(e),this.near=t,this.far=n}clone(){return new Vr(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Hr extends Pr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pr,this.environmentIntensity=1,this.environmentRotation=new pr,this.overrideMaterial=null,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const Gr=new Ii,Wr=new Ii,jr=new Ii,Xr=new Ii,qr=new Ii,Yr=new Ii,Zr=new Ii,Jr=new Ii,Kr=new Ii,Qr=new Ii,$r=new Ji,ea=new Ji,ta=new Ji;class na{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ii;this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Gr.subVectors(e,t),i.cross(Gr);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Gr.subVectors(i,t),Wr.subVectors(n,t),jr.subVectors(e,t);const a=Gr.dot(Gr),s=Gr.dot(Wr),o=Gr.dot(jr),l=Wr.dot(Wr),c=Wr.dot(jr),u=a*l-s*s;if(0===u)return r.set(0,0,0),null;const h=1/u,d=(l*o-s*c)*h,p=(a*c-s*o)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,Xr)&&(Xr.x>=0&&Xr.y>=0&&Xr.x+Xr.y<=1)}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,Xr)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,Xr.x),o.addScaledVector(a,Xr.y),o.addScaledVector(s,Xr.z),o)}static getInterpolatedAttribute(e,t,n,i,r,a){return $r.setScalar(0),ea.setScalar(0),ta.setScalar(0),$r.fromBufferAttribute(e,t),ea.fromBufferAttribute(e,n),ta.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector($r,r.x),a.addScaledVector(ea,r.y),a.addScaledVector(ta,r.z),a}static isFrontFacing(e,t,n,i){return Gr.subVectors(n,t),Wr.subVectors(e,t),Gr.cross(Wr).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 Gr.subVectors(this.c,this.b),Wr.subVectors(this.a,this.b),.5*Gr.cross(Wr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return na.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return na.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return na.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return na.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return na.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,s;qr.subVectors(i,n),Yr.subVectors(r,n),Jr.subVectors(e,n);const o=qr.dot(Jr),l=Yr.dot(Jr);if(o<=0&&l<=0)return t.copy(n);Kr.subVectors(e,i);
vendor: 4,144 bytes, line 2
2const c=qr.dot(Kr),u=Yr.dot(Kr);if(c>=0&&u<=c)return t.copy(i);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return a=o/(o-c),t.copy(n).addScaledVector(qr,a);Qr.subVectors(e,r);const d=qr.dot(Qr),p=Yr.dot(Qr);if(p>=0&&d<=p)return t.copy(r);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(n).addScaledVector(Yr,s);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return Zr.subVectors(r,i),s=(u-c)/(u-c+(d-p)),t.copy(i).addScaledVector(Zr,s);const g=1/(m+f+h);return a=f*g,s=h*g,t.copy(n).addScaledVector(qr,a).addScaledVector(Yr,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class ia{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii(-1/0,-1/0,-1/0);this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(aa.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(aa.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=aa.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,n=i.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,aa):aa.fromBufferAttribute(i,t),aa.applyMatrix4(e.matrixWorld),this.expandByPoint(aa);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),sa.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),sa.copy(n.boundingBox)),sa.applyMatrix4(e.matrixWorld),this.union(sa)}const i=e.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,aa),aa.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(pa),fa.subVectors(this.max,pa),oa.subVectors(e.a,pa),la.subVectors(e.b,pa),ca.subVectors(e.c,pa),ua.subVectors(la,oa),ha.subVectors(ca,la),da.subVectors(oa,ca);
vendor: 4,249 bytes, line 2
2let t=[0,-ua.z,ua.y,0,-ha.z,ha.y,0,-da.z,da.y,ua.z,0,-ua.x,ha.z,0,-ha.x,da.z,0,-da.x,-ua.y,ua.x,0,-ha.y,ha.x,0,-da.y,da.x,0];return!!va(t,oa,la,ca,fa)&&(t=[1,0,0,0,1,0,0,0,1],!!va(t,oa,la,ca,fa)&&(ma.crossVectors(ua,ha),t=[ma.x,ma.y,ma.z],va(t,oa,la,ca,fa)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,aa).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(aa).length()),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()||(ra[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ra[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ra[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ra[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ra[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ra[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ra[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ra[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ra)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ra=[new Ii,new Ii,new Ii,new Ii,new Ii,new Ii,new Ii,new Ii],aa=new Ii,sa=new ia,oa=new Ii,la=new Ii,ca=new Ii,ua=new Ii,ha=new Ii,da=new Ii,pa=new Ii,fa=new Ii,ma=new Ii,ga=new Ii;function va(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){ga.fromArray(e,a);const s=r.x*Math.abs(ga.x)+r.y*Math.abs(ga.y)+r.z*Math.abs(ga.z),o=t.dot(ga),l=n.dot(ga),c=i.dot(ga);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}const _a=ya();function ya(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const e=l-127;e<-27?(i[l]=0,i[256|l]=32768,r[l]=24,r[256|l]=24):e<-14?(i[l]=1024>>-e-14,i[256|l]=1024>>-e-14|32768,r[l]=-e-1,r[256|l]=-e-1):e<=15?(i[l]=e+15<<10,i[256|l]=e+15<<10|32768,r[l]=13,r[256|l]=13):e<128?(i[l]=31744,i[256|l]=64512,r[l]=24,r[256|l]=24):(i[l]=31744,i[256|l]=64512,r[l]=13,r[256|l]=13)}const a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;0===(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,a[l]=e|t}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(o[l]=1024);return{floatView:t,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}function xa(e){Math.abs(e)>65504&&di("DataUtils.toHalfFloat(): Value out of range."),e=Mi(e,-65504,65504),_a.floatView[0]=e;const t=_a.uint32View[0],n=t>>23&511;return _a.baseTable[n]+((8388607&t)>>_a.shiftTable[n])}function ba(e){const t=e>>10;return _a.uint32View[0]=_a.mantissaTable[_a.offsetTable[t]+(1023&e)]+_a.exponentTable[t],_a.floatView[0]}class Sa{static toHalfFloat(e){return xa(e)}static fromHalfFloat(e){return ba(e)}}const Ma=new Ii,wa=new Ri;let Ta=0;class Ea extends vi{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Ta++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=zn,this.updateRanges=[],this.gpuType=ze,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&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;
vendor: 2,799 bytes, line 2
2for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)wa.fromBufferAttribute(this,t),wa.applyMatrix3(e),this.setXY(t,wa.x,wa.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Ma.fromBufferAttribute(this,t),Ma.applyMatrix3(e),this.setXYZ(t,Ma.x,Ma.y,Ma.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ma.fromBufferAttribute(this,t),Ma.applyMatrix4(e),this.setXYZ(t,Ma.x,Ma.y,Ma.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ma.fromBufferAttribute(this,t),Ma.applyNormalMatrix(e),this.setXYZ(t,Ma.x,Ma.y,Ma.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ma.fromBufferAttribute(this,t),Ma.transformDirection(e),this.setXYZ(t,Ma.x,Ma.y,Ma.z);return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Ei(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ai(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ei(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ei(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ei(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ei(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array),i=Ai(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array),i=Ai(i,this.array),r=Ai(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==zn&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}
vendor: 21,989 bytes, line 2
2class Aa extends Ea{constructor(e,t,n){super(new Int8Array(e),t,n)}}class Ca extends Ea{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class Ra extends Ea{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class Pa extends Ea{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Ia extends Ea{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class La extends Ea{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Na extends Ea{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Ua extends Ea{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=ba(this.array[e*this.itemSize]);return this.normalized&&(t=Ei(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize]=xa(t),this}getY(e){let t=ba(this.array[e*this.itemSize+1]);return this.normalized&&(t=Ei(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize+1]=xa(t),this}getZ(e){let t=ba(this.array[e*this.itemSize+2]);return this.normalized&&(t=Ei(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize+2]=xa(t),this}getW(e){let t=ba(this.array[e*this.itemSize+3]);return this.normalized&&(t=Ei(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ai(t,this.array)),this.array[e*this.itemSize+3]=xa(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array)),this.array[e+0]=xa(t),this.array[e+1]=xa(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array),i=Ai(i,this.array)),this.array[e+0]=xa(t),this.array[e+1]=xa(n),this.array[e+2]=xa(i),this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array),i=Ai(i,this.array),r=Ai(r,this.array)),this.array[e+0]=xa(t),this.array[e+1]=xa(n),this.array[e+2]=xa(i),this.array[e+3]=xa(r),this}}class Da extends Ea{constructor(e,t,n){super(new Float32Array(e),t,n)}}const Oa=new ia,Fa=new Ii,za=new Ii;class Ba{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-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;void 0!==t?n.copy(t):Oa.setFromPoints(e).getCenter(n);let i=0;for(let r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Fa.subVectors(e,this.center);const t=Fa.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Fa,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(za.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Fa.copy(e.center).add(za)),this.expandByPoint(Fa.copy(e.center).sub(za))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let ka=0;const Va=new ir,Ha=new Pr,Ga=new Ii,Wa=new ia,ja=new ia,Xa=new Ii;class qa extends vi{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ka++}),this.uuid=Si(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(function(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}(e)?Na:Ia)(e,1):this.index=e,this}setIndirect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Ui).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Va.makeRotationFromQuaternion(e),this.applyMatrix4(Va),this}rotateX(e){return Va.makeRotationX(e),this.applyMatrix4(Va),this}rotateY(e){return Va.makeRotationY(e),this.applyMatrix4(Va),this}rotateZ(e){return Va.makeRotationZ(e),this.applyMatrix4(Va),this}translate(e,t,n){return Va.makeTranslation(e,t,n),this.applyMatrix4(Va),this}scale(e,t,n){return Va.makeScale(e,t,n),this.applyMatrix4(Va),this}lookAt(e){return Ha.lookAt(e),Ha.updateMatrix(),this.applyMatrix4(Ha.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ga).negate(),this.translate(Ga.x,Ga.y,Ga.z),this}setFromPoints(e){const t=this.getAttribute("position");if(void 0===t){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];t.push(i.x,i.y,i.z||0)}this.setAttribute("position",new Da(t,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const n=e[i];t.setXYZ(i,n.x,n.y,n.z||0)}e.length>t.count&&di("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ia);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return pi("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Ii(-1/0,-1/0,-1/0),new Ii(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const e=t[n];Wa.setFromBufferAttribute(e),this.morphTargetsRelative?(Xa.addVectors(this.boundingBox.min,Wa.min),this.boundingBox.expandByPoint(Xa),Xa.addVectors(this.boundingBox.max,Wa.max),this.boundingBox.expandByPoint(Xa)):(this.boundingBox.expandByPoint(Wa.min),this.boundingBox.expandByPoint(Wa.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&pi('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Ba);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return pi("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Ii,1/0);if(e){const n=this.boundingSphere.center;if(Wa.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){const n=t[e];ja.setFromBufferAttribute(n),this.morphTargetsRelative?(Xa.addVectors(Wa.min,ja.min),Wa.expandByPoint(Xa),Xa.addVectors(Wa.max,ja.max),Wa.expandByPoint(Xa)):(Wa.expandByPoint(ja.min),Wa.expandByPoint(ja.max))}Wa.getCenter(n);let i=0;for(let t=0,r=e.count;t<r;t++)Xa.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(Xa));if(t)for(let r=0,a=t.length;r<a;r++){const a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)Xa.fromBufferAttribute(a,t),s&&(Ga.fromBufferAttribute(e,t),Xa.add(Ga)),i=Math.max(i,n.distanceToSquared(Xa))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&pi('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void pi("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.position,i=t.normal,r=t.uv;let a=this.getAttribute("tangent");void 0!==a&&a.count===n.count||(a=new Ea(new Float32Array(4*n.count),4),this.setAttribute("tangent",a));const s=[],o=[];for(let M=0;M<n.count;M++)s[M]=new Ii,o[M]=new Ii;const l=new Ii,c=new Ii,u=new Ii,h=new Ri,d=new Ri,p=new Ri,f=new Ii,m=new Ii;function g(e,t,i){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,i),h.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),p.fromBufferAttribute(r,i),c.sub(l),u.sub(l),d.sub(h),p.sub(h);const a=1/(d.x*p.y-p.x*d.y);isFinite(a)&&(f.copy(c).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(a),m.copy(u).multiplyScalar(d.x).addScaledVector(c,-p.x).multiplyScalar(a),s[e].add(f),s[t].add(f),s[i].add(f),o[e].add(m),o[t].add(m),o[i].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:e.count}]);for(let M=0,w=v.length;M<w;++M){const t=v[M],n=t.start;for(let i=n,r=n+t.count;i<r;i+=3)g(e.getX(i+0),e.getX(i+1),e.getX(i+2))}const _=new Ii,y=new Ii,x=new Ii,b=new Ii;function S(e){x.fromBufferAttribute(i,e),b.copy(x);const t=s[e];_.copy(t),_.sub(x.multiplyScalar(x.dot(t))).normalize(),y.crossVectors(b,t);const n=y.dot(o[e])<0?-1:1;a.setXYZW(e,_.x,_.y,_.z,n)}for(let M=0,w=v.length;M<w;++M){const t=v[M],n=t.start;for(let i=n,r=n+t.count;i<r;i+=3)S(e.getX(i+0)),S(e.getX(i+1)),S(e.getX(i+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n||n.count!==t.count)n=new Ea(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const i=new Ii,r=new Ii,a=new Ii,s=new Ii,o=new Ii,l=new Ii,c=new Ii,u=new Ii;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),f=e.getX(h+2);i.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),s.fromBufferAttribute(n,d),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),s.add(c),o.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,h=t.count;e<h;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Xa.fromBufferAttribute(e,t),Xa.normalize(),e.setXYZ(t,Xa.x,Xa.y,Xa.z)}toNonIndexed(){function e(e,t){const n=e.array,i=e.itemSize,r=e.normalized,a=new n.constructor(t.length*i);let s=0,o=0;for(let l=0,c=t.length;l<c;l++){s=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*i;for(let e=0;e<i;e++)a[o++]=n[s++]}return new Ea(a,i,r)}if(null===this.index)return di("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new qa,n=this.index.array,i=this.attributes;for(const s in i){const r=e(i[s],n);t.setAttribute(s,r)}const r=this.morphAttributes;for(const s in r){const i=[],a=r[s];for(let t=0,r=a.length;t<r;t++){const r=e(a[t],n);i.push(r)}t.morphAttributes[s]=i}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let s=0,o=a.length;s<o;s++){const e=a[s];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const o in n){const t=n[o];e.data.attributes[o]=t.toJSON(e.data)}const i={};let r=!1;for(const o in this.morphAttributes){const t=this.morphAttributes[o],n=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];n.push(r.toJSON(e.data))}n.length>0&&(i[o]=n,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone());const i=e.attributes;for(const l in i){const e=i[l];this.setAttribute(l,e.clone(t))}const r=e.morphAttributes;for(const l in r){const e=[],n=r[l];for(let i=0,r=n.length;i<r;i++)e.push(n[i].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,c=a.length;l<c;l++){const e=a[l];this.addGroup(e.start,e.count,e.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ya{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=zn,this.updateRanges=[],this.version=0,this.uuid=Si()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Si()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Si()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Za=new Ii;class Ja{constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Za.fromBufferAttribute(this,t),Za.applyMatrix4(e),this.setXYZ(t,Za.x,Za.y,Za.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Za.fromBufferAttribute(this,t),Za.applyNormalMatrix(e),this.setXYZ(t,Za.x,Za.y,Za.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Za.fromBufferAttribute(this,t),Za.transformDirection(e),this.setXYZ(t,Za.x,Za.y,Za.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ei(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ai(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Ai(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ai(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ai(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ai(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ei(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ei(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ei(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ei(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array),i=Ai(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ai(t,this.array),n=Ai(n,this.array),i=Ai(i,this.array),r=Ai(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(void 0===e){ui("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Ea(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ja(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){ui("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let Ka,Qa=0;class $a extends vi{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Qa++}),this.uuid=Si(),this.name="",this.type="Material",this.blending=x,this.side=g,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=D,this.blendDst=O,this.blendEquation=E,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new zr(0,0,0),this.blendAlpha=0,this.depthFunc=Z,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Rn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=mn,this.stencilZFail=mn,this.stencilZPass=mn,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!==e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){di("Material: parameter '".concat(t,"' has value of undefined."));continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector2&&n&&n.isVector2||i&&i.isEuler&&n&&n.isEuler||i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:di("Material: '".concat(t,"' is not a property of THREE.").concat(this.t
vendor: 5,904 bytes, line 2
2ype,"."))}}toJSON(e){const t=void 0===e||"string"===typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(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),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(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,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==x&&(n.blending=this.blending),this.side!==g&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==D&&(n.blendSrc=this.blendSrc),this.blendDst!==O&&(n.blendDst=this.blendDst),this.blendEquation!==E&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
vendor: 10,920 bytes, line 2
2(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Z&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Rn&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==mn&&(n.stencilFail=this.stencilFail),this.stencilZFail!==mn&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==mn&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}fromJSON(e,t){if(void 0!==e.uuid&&(this.uuid=e.uuid),void 0!==e.name&&(this.name=e.name),void 0!==e.color&&void 0!==this.color&&this.color.setHex(e.color),void 0!==e.roughness&&(this.roughness=e.roughness),void 0!==e.metalness&&(this.metalness=e.metalness),void 0!==e.sheen&&(this.sheen=e.sheen),void 0!==e.sheenColor&&(this.sheenColor=(new zr).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(this.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==this.emissive&&this.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==this.specular&&this.specular.setHex(e.specular),void 0!==e.specularIntensity&&(this.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(this.shininess=e.shininess),void 0!==e.clearcoat&&(this.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(this.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(this.dispersion=e.dispersion),void 0!==e.iridescence&&(this.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(this.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(this.transmission=e.transmission),void 0!==e.thickness&&(this.thickness=e.thickness),void 0!==e.attenuationDistance&&(this.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(this.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(this.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(this.fog=e.fog),void 0!==e.flatShading&&(this.flatShading=e.flatShading),void 0!==e.blending&&(this.blending=e.blending),void 0!==e.combine&&(this.combine=e.combine),void 0!==e.side&&(this.side=e.side),void 0!==e.shadowSide&&(this.shadowSide=e.shadowSide),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.transparent&&(this.transparent=e.transparent),void 0!==e.alphaTest&&(this.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(this.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(this.depthFunc=e.depthFunc),void 0!==e.depthTest&&(this.depthTest=e.depthTest),void 0!==e.depthWrite&&(this.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(this.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(this.blendSrc=e.blendSrc),void 0!==e.blendDst&&(this.blendDst=e.blendDst),void 0!==e.blendEquation&&(this.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(this.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(this.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(this.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(this.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(this.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(this.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(this.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(this.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(this.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(this.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(this.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(this.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(this.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(this.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(this.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(this.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(this.rotation=e.rotation),void 0!==e.linewidth&&(this.linewidth=e.linewidth),void 0!==e.dashSize&&(this.dashSize=e.dashSize),void 0!==e.gapSize&&(this.gapSize=e.gapSize),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.polygonOffset&&(this.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(this.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(this.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(this.dithering=e.dithering),void 0!==e.alphaToCoverage&&(this.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(this.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(this.forceSinglePass=e.forceSinglePass),void 0!==e.allowOverride&&(this.allowOverride=e.allowOverride),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.toneMapped&&(this.toneMapped=e.toneMapped),void 0!==e.userData&&(this.userData=e.userData),void 0!==e.vertexColors&&("number"===typeof e.vertexColors?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),void 0!==e.size&&(this.size=e.size),void 0!==e.sizeAttenuation&&(this.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(this.map=t[e.map]||null),void 0!==e.matcap&&(this.matcap=t[e.matcap]||null),void 0!==e.alphaMap&&(this.alphaMap=t[e.alphaMap]||null),void 0!==e.bumpMap&&(this.bumpMap=t[e.bumpMap]||null),void 0!==e.bumpScale&&(this.bumpScale=e.bumpScale),void 0!==e.normalMap&&(this.normalMap=t[e.normalMap]||null),void 0!==e.normalMapType&&(this.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),this.normalScale=(new Ri).fromArray(t)}return void 0!==e.displacementMap&&(this.displacementMap=t[e.displacementMap]||null),void 0!==e.displacementScale&&(this.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(this.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(this.roughnessMap=t[e.roughnessMap]||null),void 0!==e.metalnessMap&&(this.metalnessMap=t[e.metalnessMap]||null),void 0!==e.emissiveMap&&(this.emissiveMap=t[e.emissiveMap]||null),void 0!==e.emissiveIntensity&&(this.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(this.specularMap=t[e.specularMap]||null),void 0!==e.specularIntensityMap&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),void 0!==e.specularColorMap&&(this.specularColorMap=t[e.specularColorMap]||null),void 0!==e.envMap&&(this.envMap=t[e.envMap]||null),void 0!==e.envMapRotation&&this.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(this.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(this.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(this.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(this.lightMap=t[e.lightMap]||null),void 0!==e.lightMapIntensity&&(this.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(this.aoMap=t[e.aoMap]||null),void 0!==e.aoMapIntensity&&(this.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(this.gradientMap=t[e.gradientMap]||null),void 0!==e.clearcoatMap&&(this.clearcoatMap=t[e.clearcoatMap]||null),void 0!==e.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),void 0!==e.clearcoatNormalMap&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),void 0!==e.clearcoatNormalScale&&(this.clearcoatNormalScale=(new Ri).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(this.iridescenceMap=t[e.iridescenceMap]||null),void 0!==e.iridescenceThicknessMap&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),void 0!==e.transmissionMap&&(this.transmissionMap=t[e.transmissionMap]||null),void 0!==e.thicknessMap&&(this.thicknessMap=t[e.thicknessMap]||null),void 0!==e.anisotropyMap&&(this.anisotropyMap=t[e.anisotropyMap]||null),void 0!==e.sheenColorMap&&(this.sheenColorMap=t[e.sheenColorMap]||null),void 0!==e.sheenRoughnessMap&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 4,531 bytes, line 2
2adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class es extends $a{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new zr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const ts=new Ii,ns=new Ii,is=new Ii,rs=new Ri,as=new Ri,ss=new ir,os=new Ii,ls=new Ii,cs=new Ii,us=new Ri,hs=new Ri,ds=new Ri;class ps extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new es;if(super(),this.isSprite=!0,this.type="Sprite",void 0===Ka){Ka=new qa;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Ya(e,5);Ka.setIndex([0,1,2,0,2,3]),Ka.setAttribute("position",new Ja(t,3,0,!1)),Ka.setAttribute("uv",new Ja(t,2,3,!1))}this.geometry=Ka,this.material=e,this.center=new Ri(.5,.5),this.count=1}raycast(e,t){null===e.camera&&pi('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ns.setFromMatrixScale(this.matrixWorld),ss.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),is.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ns.multiplyScalar(-is.z);const n=this.material.rotation;let i,r;0!==n&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;fs(os.set(-.5,-.5,0),is,a,ns,i,r),fs(ls.set(.5,-.5,0),is,a,ns,i,r),fs(cs.set(.5,.5,0),is,a,ns,i,r),us.set(0,0),hs.set(1,0),ds.set(1,1);let s=e.ray.intersectTriangle(os,ls,cs,!1,ts);if(null===s&&(fs(ls.set(-.5,.5,0),is,a,ns,i,r),hs.set(0,1),s=e.ray.intersectTriangle(os,cs,ls,!1,ts),null===s))return;const o=e.ray.origin.distanceTo(ts);o<e.near||o>e.far||t.push({distance:o,point:ts.clone(),uv:na.getInterpolation(ts,os,ls,cs,us,hs,ds,new Ri),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function fs(e,t,n,i,r,a){rs.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(as.x=a*rs.x-r*rs.y,as.y=r*rs.x+a*rs.y):as.copy(rs),e.copy(t),e.x+=as.x,e.y+=as.y,e.applyMatrix4(ss)}const ms=new Ii,gs=new Ii;class vs extends Pr{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const e=t[n];this.addLevel(e.object.clone(),e.distance,e.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const e=t.splice(n,1);return this.remove(e[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let i=t[n].distance;if(t[n].object.visible&&(i-=i*t[n].hysteresis),e<i)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){ms.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(ms);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ms.setFromMatrixPosition(e.matrixWorld),gs.setFromMatrixPosition(this.matrixWorld);const n=ms.distanceTo(gs)/e.zoom;let i,r;for(t[0].object.visible=!0,i=1,r=t.length;i<r;i++){let e=t[i].distance;if(t[i].object.visible&&(e-=e*t[i].hysteresis),!(n>=e))break;t[i-1].object.visible=!1,t[i].object.visible=!0}for(this._currentLevel=i-1;
2i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const e=n[i];t.object.levels.push({object:e.object.uuid,distance:e.distance,hysteresis:e.hysteresis})}return t}}const _s=new Ii,ys=new Ii,xs=new Ii,bs=new Ii,Ss=new Ii,Ms=new Ii,ws=new Ii;class Ts{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii(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,_s)),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=_s.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_s.copy(this.origin).addScaledVector(this.direction,t),_s.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){ys.copy(e).add(t).multiplyScalar(.5),xs.copy(t).sub(e).normalize(),bs.copy(this.origin).sub(ys);const r=.5*e.distanceTo(t),a=-this.direction.dot(xs),s=bs.dot(this.direction),o=-bs.dot(xs),l=bs.lengthSq(),c=Math.abs(1-a*a);let u,h,d,p;
vendor: 5,983 bytes, line 2
2if(c>0)if(u=a*o-s,h=a*s-o,p=r*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+a*h+2*s)+h*(a*u+h+2*o)+l}else h=r,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;else h=-r,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;else h<=-p?(u=Math.max(0,-(-a*r+s)),h=u>0?-r:Math.min(Math.max(-r,-o),r),d=-u*u+h*(h+2*o)+l):h<=p?(u=0,h=Math.min(Math.max(-r,-o),r),d=h*(h+2*o)+l):(u=Math.max(0,-(a*r+s)),h=u>0?r:Math.min(Math.max(-r,-o),r),d=-u*u+h*(h+2*o)+l);else h=a>0?-r:r,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(ys).addScaledVector(xs,h),d}intersectSphere(e,t){_s.subVectors(e.center,this.origin);const n=_s.dot(this.direction),i=_s.dot(_s)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?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 null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,s,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),c>=0?(r=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(r=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),n>a||r>i?null:((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(s=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),n>o||s>i?null:((s>n||n!==n)&&(n=s),(o<i||i!==i)&&(i=o),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,_s)}intersectTriangle(e,t,n,i,r){Ss.subVectors(t,e),Ms.subVectors(n,e),ws.crossVectors(Ss,Ms);let a,s=this.direction.dot(ws);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}bs.subVectors(this.origin,e);const o=a*this.direction.dot(Ms.crossVectors(bs,Ms));if(o<0)return null;const l=a*this.direction.dot(Ss.cross(bs));if(l<0)return null;if(o+l>s)return null;const c=-a*bs.dot(ws);return c<0?null:this.at(c/s,r)}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 Es extends $a{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new zr(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 pr,this.combine=ee,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 As=new ir,Cs=new Ts,Rs=new Ba,Ps=new Ii,Is=new Ii,Ls=new Ii,Ns=new Ii,Us=new Ii,Ds=new Ii,Os=new Ii,Fs=new Ii;class zs extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qa,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Es;super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const s=this.morphTargetInfluences;if(r&&s){Ds.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=s[n],o=r[n];0!==i&&(Us.fromBufferAttribute(o,e),a?Ds.addScaledVector(Us,i):Ds.addScaledVector(Us.sub(t),i))}t.add(Ds)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),Rs.copy(n.boundingSphere),Rs.applyMatrix4(r),Cs.copy(e.ray).recast(e.near),!1===Rs.containsPoint(Cs.origin)){if(null===Cs.intersectSphere(Rs,Ps))return;if(Cs.origin.distanceToSquared(Ps)>(e.far-e.near)**2)return}As.copy(r).invert(),Cs.copy(e.ray).applyMatrix4(As),null!==n.boundingBox&&!1===Cs.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,Cs)}}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,u=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let p=0,f=h.length;p<f;p++){const r=h[p],o=a[r.materialIndex];for(let a=Math.max(r.start,d.start),h=Math.min(s.count,Math.min(r.start+r.count,d.start+d.count));a<h;
vendor: 4,350 bytes, line 2
2a+=3){i=Bs(this,o,e,n,l,c,u,s.getX(a),s.getX(a+1),s.getX(a+2)),i&&(i.faceIndex=Math.floor(a/3),i.face.materialIndex=r.materialIndex,t.push(i))}}else{for(let r=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);r<o;r+=3){i=Bs(this,a,e,n,l,c,u,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}else if(void 0!==o)if(Array.isArray(a))for(let p=0,f=h.length;p<f;p++){const r=h[p],s=a[r.materialIndex];for(let a=Math.max(r.start,d.start),h=Math.min(o.count,Math.min(r.start+r.count,d.start+d.count));a<h;a+=3){i=Bs(this,s,e,n,l,c,u,a,a+1,a+2),i&&(i.faceIndex=Math.floor(a/3),i.face.materialIndex=r.materialIndex,t.push(i))}}else{for(let r=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);r<s;r+=3){i=Bs(this,a,e,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}}}function Bs(e,t,n,i,r,a,s,o,l,c){e.getVertexPosition(o,Is),e.getVertexPosition(l,Ls),e.getVertexPosition(c,Ns);const u=function(e,t,n,i,r,a,s,o){let l;if(l=t.side===v?i.intersectTriangle(s,a,r,!0,o):i.intersectTriangle(r,a,s,t.side===g,o),null===l)return null;Fs.copy(o),Fs.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(Fs);return c<n.near||c>n.far?null:{distance:c,point:Fs.clone(),object:e}}(e,t,n,i,Is,Ls,Ns,Os);if(u){const e=new Ii;na.getBarycoord(Os,Is,Ls,Ns,e),r&&(u.uv=na.getInterpolatedAttribute(r,o,l,c,e,new Ri)),a&&(u.uv1=na.getInterpolatedAttribute(a,o,l,c,e,new Ri)),s&&(u.normal=na.getInterpolatedAttribute(s,o,l,c,e,new Ii),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const t={a:o,b:l,c:c,normal:new Ii,materialIndex:0};na.getNormal(Is,Ls,Ns,t.normal),u.face=t,u.barycoord=e}return u}const ks=new Ji,Vs=new Ji,Hs=new Ji,Gs=new Ji,Ws=new ir,js=new Ii,Xs=new Ba,qs=new ir,Ys=new Ts;class Zs extends zs{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=he,this.bindMatrix=new ir,this.bindMatrixInverse=new ir,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new ia),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,js),this.boundingBox.expandByPoint(js)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new Ba),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,js),this.boundingSphere.expandByPoint(js)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),Xs.copy(this.boundingSphere),Xs.applyMatrix4(i),!1!==e.ray.intersectsSphere(Xs)&&(qs.copy(i).invert(),Ys.copy(e.ray).applyMatrix4(qs),null!==this.boundingBox&&!1===Ys.intersectsBox(this.boundingBox)||this._computeIntersections(e,t,Ys)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ji,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===he?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===de?this.bindMatrixInverse.copy(this.bindMatrix).invert():di("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Vs.fromBufferAttribute(i.attributes.skinIndex,e),Hs.fromBufferAttribute(i.attributes.skinWeight,e),t.isVector4?(ks.copy(t),t.set(0,0,0,0)):(ks.set(...t,1),t.set(0,0,0)),ks.applyMatrix4(this.bindMatrix);for(let r=0;r<4;r++){const e=Hs.getComponent(r);if(0!==e){const i=Vs.getComponent(r);Ws.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(Gs.c
2opy(ks).applyMatrix4(Ws),e)}}return t.isVector4&&(t.w=ks.w),t.applyMatrix4(this.bindMatrixInverse)}}class Js extends Pr{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ks extends Zi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(null,arguments.length>5?arguments[5]:void 0,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:Se,arguments.length>9&&void 0!==arguments[9]?arguments[9]:Se,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>10?arguments[10]:void 0,arguments.length>11?arguments[11]:void 0),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Qs=new ir,$s=new ir;class eo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=Si(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){di("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new ir)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new ir;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const i=e[r]?e[r].matrixWorld:$s;Qs.multiplyMatrices(i,t[r]),Qs.toArray(n,16*r)}null!==i&&(i.needsUpdate=!0)}clone(){return new eo(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Ks(t,e,e,qe,ze);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const i=e.bones[n];let r=t[i];void 0===r&&(di("Skeleton: No bone found with UUID:",i),r=new Js),this.bones.push(r),this.boneInverses.push((new ir).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const r=t[i];e.bones.push(r.uuid);const a=n[i];e.boneInverses.push(a.toArray())}return e}}class to extends Ea{constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const no=new ir,io=new ir,ro=[],ao=new ia,so=new ir,oo=new zs,lo=new Ba;class co extends zs{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new to(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,so)}computeBoundingBox(){const e=this.geometry,t=this.count;
vendor: 4,226 bytes, line 2
2null===this.boundingBox&&(this.boundingBox=new ia),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,no),ao.copy(e.boundingBox).applyMatrix4(no),this.boundingBox.union(ao)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new Ba),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,no),lo.copy(e.boundingSphere).applyMatrix4(no),this.boundingSphere.union(lo)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return null===this.instanceColor?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,r=e*(n.length+1)+1;for(let a=0;a<n.length;a++)n[a]=i[r+a]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(oo.geometry=this.geometry,oo.material=this.material,void 0!==oo.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),lo.copy(this.boundingSphere),lo.applyMatrix4(n),!1!==e.ray.intersectsSphere(lo)))for(let r=0;r<i;r++){this.getMatrixAt(r,no),io.multiplyMatrices(n,no),oo.matrixWorld=io,oo.raycast(e,ro);for(let e=0,n=ro.length;e<n;e++){const n=ro[e];n.instanceId=r,n.object=this,t.push(n)}ro.length=0}}setColorAt(e,t){return null===this.instanceColor&&(this.instanceColor=new to(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),t.toArray(this.instanceColor.array,3*e),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,16*e),this}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;null===this.morphTexture&&(this.morphTexture=new Ks(new Float32Array(i*this.count),i,this.count,Je,ze));const r=this.morphTexture.source.data.data;let a=0;for(let l=0;l<n.length;l++)a+=n[l];const s=this.geometry.morphTargetsRelative?1:1-a,o=i*e;return r[o]=s,r.set(n,o+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}const uo=new Ii,ho=new Ii,po=new Ui;class fo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii(1,0,0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=uo.subVectors(n,t).cross(ho.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=e.delta(uo),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return!0===n&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(i,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||po.getNormalMatrix(e),i=this.coplanarPoint(uo).applyMatrix4(e),r=this.normal.applyM
2atrix3(n).normalize();return this.constant=-i.dot(r),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 mo=new Ba,go=new Ri(.5,.5),vo=new Ii;class _o{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fo,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fo,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new fo,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fo,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new fo,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new fo;this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zn,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=this.planes,r=e.elements,a=r[0],s=r[1],o=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],p=r[8],f=r[9],m=r[10],g=r[11],v=r[12],_=r[13],y=r[14],x=r[15];if(i[0].setComponents(l-a,d-c,g-p,x-v).normalize(),i[1].setComponents(l+a,d+c,g+p,x+v).normalize(),i[2].setComponents(l+s,d+u,g+f,x+_).normalize(),i[3].setComponents(l-s,d-u,g-f,x-_).normalize(),n)i[4].setComponents(o,h,m,y).normalize(),i[5].setComponents(l-o,d-h,g-m,x-y).normalize();else if(i[4].setComponents(l-o,d-h,g-m,x-y).normalize(),t===Zn)i[5].setComponents(l+o,d+h,g+m,x+y).normalize();else{if(t!==Jn)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);i[5].setComponents(o,h,m,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),mo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),mo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(mo)}intersectsSprite(e){mo.center.set(0,0,0);const t=go.distanceTo(e.center);return mo.radius=.7071067811865476+t,mo.applyMatrix4(e.matrixWorld),this.intersectsSphere(mo)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let r=0;r<6;r++){if(t[r].distanceToPoint(n)<i)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(vo.x=i.normal.x>0?e.max.x:e.min.x,vo.y=i.normal.y>0?e.max.y:e.min.y,vo.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(vo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}const yo=new ir;class xo{constructor(){this.coordinateSystem=Zn,this._frustums=[],this._count=0}setFromArrayCamera(e){const t=e.cameras,n=this._frustums;for(let i=0;i<t.length;i++){const e=t[i];yo.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),void 0===n[i]&&(n[i]=new _o),n[i].setFromProjectionMatrix(yo,e.coordinateSystem,e.reversedDepth)}return this._count=t.length,this}intersectsObject(e){const t=this._frustums;for(let n=0;n<this._count;n++)if(t[n].intersectsObject(e))return!0;return!1}intersectsSprite(e){const t=this._frustums;for(let n=0;n<this._count;n++)if(t[n].intersectsSprite(e))return!0;return!1}intersectsSphere(e){const t=this._frustums;for(let n=0;n<this._count;n++)if(t[n].intersectsSphere(e))return!0;return!1}intersectsBox(e){const t=this._frustums;for(let n=0;n<this._count;n++)if(t[n].intersectsBox(e))return!0;return!1}containsPoint(e){const t=this._frustums;for(let n=0;n<this._count;n++)if(t[n].containsPoint(e))return!0;return!1}copy(e){this.coordinateSystem=e.coordinateSystem;const t=this._frustums,n=e._frustums;for(let i=0;i<e._count;i++)void 0===t[i]&&(t[i]=new _o),t[i].copy(n[i]);return this._count=e._count,this}clone(){return(new xo).copy(this)}}function bo(e,t){return e-t}function So(e,t){return e.z-t.z}function Mo(e,t){return t.z-e.z}class wo{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,i){const r=this.pool,a=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const s=r[this.index];a.push(s),this.index++,s.start=e,s.count=t,s.z=n,s.index=i}reset(){this.list.length=0,this.index=0}}const To=new ir,Eo=new zr(1,1,1),Ao=new _o,Co=new xo,Ro=new ia,Po=new Ba,Io=new Ii,Lo=new Ii,No=new Ii,Uo=new wo,Do=new zs,Oo=[];function Fo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const r=e.count;for(let a=0;a<r;a++)for(let r=0;r<i;r++)t.setComponent(a+n,r,e.getComponent(a,r))}else t.array.set(e.array,n*i);t.needsUpdate=!0}function zo(e,t){if(e.constructor!==t.constructor){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)t[i]=e[i]}else{const n=Math.min(e.length,t.length);t.set(new e.constructor(e.buffer,0,n))}}class Bo extends zs{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2*t,i=arguments.length>3?arguments[3]:void 0;super(new qa,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(4*this._maxInstanceCount);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new Ks(t,e,e,qe,ze);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new Ks(t,e,e,Ke,Fe);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new Ks(t,e,e,qe,ze);
2n.colorSpace=Bi.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(const i in e.attributes){const r=e.getAttribute(i),a=r.array,s=r.itemSize,o=r.normalized,l=new a.constructor(n*s),c=new Ea(l,s,o);t.setAttribute(i,c)}if(null!==e.getIndex()){const e=n>65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new Ea(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error('THREE.BatchedMesh: Added geometry missing "'.concat(n,'". All geometries must have consistent attributes.'));const i=e.getAttribute(n),r=t.getAttribute(n);if(i.itemSize!==r.itemSize||i.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw new Error("THREE.BatchedMesh: Invalid instanceId ".concat(e,". Instance is either out of range or has been deleted."))}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw new Error("THREE.BatchedMesh: Invalid geometryId ".concat(e,". Geometry is either out of range or has been deleted."))}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ia);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(!1===t[n].active)continue;const i=t[n].geometryIndex;this.getMatrixAt(n,To),this.getBoundingBoxAt(i,Ro).applyMatrix4(To),e.union(Ro)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Ba);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(!1===t[n].active)continue;const i=t[n].geometryIndex;this.getMatrixAt(n,To),this.getBoundingSphereAt(i,Po).applyMatrix4(To),e.union(Po)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const t={visible:!0,active:!0,geometryIndex:e};let n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(bo),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));const i=this._matricesTexture;To.identity().toArray(i.image.data,16*n),i.needsUpdate=!0;const r=this._colorsTexture;return r&&(Eo.toArray(r.image.data,4*n),r.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=-1===t?e.getAttribute("position").count:t;const a=e.getIndex();if(null!==a&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=-1===n?a.count:n),-1!==i.indexStart&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let s;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(bo),s=this._availableGeometryIds.shift(),r[s]=i):(s=this._geometryCount,this._geometryCount++,r.push(i)),this.setGeometryAt(s,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,s}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=null!==n.getIndex(),r=n.getIndex(),a=t.getIndex(),s=this._geometryInfo[e];if(i&&a.count>s.reservedIndexCount||t.attributes.position.count>s.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const o=s.vertexStart,l=s.reservedVertexCount;s.vertexCount=t.getAttribute("position").count;for(const c in n.attributes){const e=t.getAttribute(c),i=n.getAttribute(c);Fo(e,i,o);const r=e.itemSize;
2for(let t=e.count,n=l;t<n;t++){const e=o+t;for(let t=0;t<r;t++)i.setComponent(e,t,0)}i.needsUpdate=!0,i.addUpdateRange(o*r,l*r)}if(i){const e=s.indexStart,n=s.reservedIndexCount;s.indexCount=t.getIndex().count;for(let t=0;t<a.count;t++)r.setX(e+t,o+a.getX(t));for(let t=a.count,i=n;t<i;t++)r.setX(e+t,o);r.needsUpdate=!0,r.addUpdateRange(e,s.reservedIndexCount)}return s.start=i?s.indexStart:s.vertexStart,s.count=i?s.indexCount:s.vertexCount,s.boundingBox=null,null!==t.boundingBox&&(s.boundingBox=t.boundingBox.clone()),s.boundingSphere=null,null!==t.boundingSphere&&(s.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||!1===t[e].active)return this;const n=this._instanceInfo;for(let i=0,r=n.length;i<r;i++)n[i].active&&n[i].geometryIndex===e&&this.deleteInstance(i);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,i=n.map((e,t)=>t).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),r=this.geometry;for(let a=0,s=n.length;a<s;a++){const s=i[a],o=n[s];if(!1!==o.active){if(null!==r.index){if(o.indexStart!==t){const n=o.indexStart,i=o.vertexStart,a=o.reservedIndexCount,s=r.index,l=s.array,c=e-i;for(let e=n;e<n+a;e++)l[e]=l[e]+c;s.array.copyWithin(t,n,n+a),s.addUpdateRange(t,a),s.needsUpdate=!0,o.indexStart=t}t+=o.reservedIndexCount}if(o.vertexStart!==e){const t=o.vertexStart,n=o.reservedVertexCount,i=r.attributes;for(const r in i){const a=i[r],s=a.array,o=a.itemSize;s.copyWithin(e*o,t*o,(t+n)*o),a.addUpdateRange(e*o,n*o),a.needsUpdate=!0}o.vertexStart=e}e+=o.reservedVertexCount,o.start=r.index?o.indexStart:o.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(null===i.boundingBox){const e=new ia,t=n.index,r=n.attributes.position;for(let n=i.start,a=i.start+i.count;n<a;n++){let i=n;t&&(i=t.getX(i)),e.expandByPoint(Io.fromBufferAttribute(r,i))}i.boundingBox=e}return t.copy(i.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(null===i.boundingSphere){const t=new Ba;this.getBoundingBoxAt(e,Ro),Ro.getCenter(t.center);const r=n.index,a=n.attributes.position;let s=0;for(let e=i.start,n=i.start+i.count;e<n;e++){let n=e;r&&(n=r.getX(n)),Io.fromBufferAttribute(a,n),s=Math.max(s,t.center.distanceToSquared(Io))}t.radius=Math.sqrt(s),i.boundingSphere=t}return t.copy(i.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,i=this._matricesTexture.image.data;return t.toArray(i,16*e),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,16*e)}setColorAt(e,t){return this.validateInstanceId(e),null===this._colorsTexture&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,4*e),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),null===this._colorsTexture?t.isVector4?t.set(1,1,1,1):t.setRGB(1,1,1):t.fromArray(this._colorsTexture.image.data,4*e)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t||(this._instanceInfo[e].visible=t,this._visibilityChanged=!0),this}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(bo);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error("THREE.BatchedMesh: Instance ids outside the range ".concat(e," are being used. Cannot shrink instance count."));const i=new Int32Array(e),r=new Int32Array(e);zo(this._multiDrawCounts,i),zo(this._multiDrawStarts,r),this._multiDrawCounts=i,this._multiDrawStarts=r,this._maxInstanceCount=e;const a=this._indirectTexture,s=this._matricesTexture,o=this._colorsTexture;a.dispose(),this._initIndirectTexture(),zo(a.image.data,this._indirectTexture.image.data),s.dispose(),this._initMatricesTexture(),zo(s.image.data,this._matricesTexture.image.data),o&&(o.dispose(),this._initColorsTexture(),zo(o.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(e=>e.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw new Error("THREE.BatchedMesh: Geometry vertex values are being used outside the range ".concat(t,". Cannot shrink further."));if(this.geometry.index){if(Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw new Error("THREE.BatchedMesh: Geometry index values are being used outside the range ".concat(t,". Cannot shrink further."))}const i=this.geometry;i.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new qa,this._initializeGeometry(i));const r=this.geometry;i.index&&zo(i.index.array,r.index.array);for(const a in i.attributes)zo(i.attributes[a].array,r.attributes[a].array)}raycast(e,t){const n=this._instanceInfo,i=this._geometryInfo,r=this.matrixWorld,a=this.geometry;Do.material=this.material,Do.geometry.index=a.index,Do.geometry.attributes=a.attributes,null===Do.geometry.boundingBox&&
2(Do.geometry.boundingBox=new ia),null===Do.geometry.boundingSphere&&(Do.geometry.boundingSphere=new Ba);for(let s=0,o=n.length;s<o;s++){if(!n[s].visible||!n[s].active)continue;const a=n[s].geometryIndex,o=i[a];Do.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(s,Do.matrixWorld).premultiply(r),this.getBoundingBoxAt(a,Do.geometry.boundingBox),this.getBoundingSphereAt(a,Do.geometry.boundingSphere),Do.raycast(e,Oo);for(let e=0,n=Oo.length;e<n;e++){const n=Oo[e];n.object=this,n.batchId=s,t.push(n)}Oo.length=0}Do.material=null,Do.geometry.index=null,Do.geometry.attributes={},Do.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=null!==e.boundingBox?e.boundingBox.clone():null,this.boundingSphere=null!==e.boundingSphere?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(e=>(0,r.A)((0,r.A)({},e),{},{boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(e=>(0,r.A)({},e)),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,i,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=i.getIndex();let s=null===a?1:a.array.BYTES_PER_ELEMENT,o=1;r.wireframe&&(o=2,s=i.attributes.position.count>65535?4:2);const l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._geometryInfo,d=this.perObjectFrustumCulled,p=this._indirectTexture,f=p.image.data,m=n.isArrayCamera?Co:Ao;d&&(n.isArrayCamera?m.setFromArrayCamera(n):(To.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),m.setFromProjectionMatrix(To,n.coordinateSystem,n.reversedDepth)));let g=0;if(this.sortObjects){To.copy(this.matrixWorld).invert(),Io.setFromMatrixPosition(n.matrixWorld).applyMatrix4(To),Lo.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(To);for(let n=0,i=l.length;n<i;n++)if(l[n].visible&&l[n].active){const e=l[n].geometryIndex;this.getMatrixAt(n,To),this.getBoundingSphereAt(e,Po).applyMatrix4(To);let t=!1;if(d&&(t=!m.intersectsSphere(Po)),!t){const t=h[e],i=No.subVectors(Po.center,Io).dot(Lo);Uo.push(t.start,t.count,i,n)}}const e=Uo.list,t=this.customSort;null===t?e.sort(r.transparent?Mo:So):t.call(this,e,n);for(let n=0,i=e.length;n<i;n++){const t=e[n];c[g]=t.start*s*o,u[g]=t.count*o,f[g]=t.index,g++}Uo.reset()}else for(let v=0,_=l.length;v<_;v++)if(l[v].visible&&l[v].active){const e=l[v].geometryIndex;let t=!1;if(d&&(this.getMatrixAt(v,To),this.getBoundingSphereAt(e,Po).applyMatrix4(To),t=!m.intersectsSphere(Po)),!t){const t=h[e];c[g]=t.start*s*o,u[g]=t.count*o,f[g]=v,g++}}p.needsUpdate=!0,this._multiDrawCount=g,this._visibilityChanged=!1}onBeforeShadow(e,t,n,i,r,a){this.onBeforeRender(e,null,i,r,a)}}class ko extends $a{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new zr(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Vo=new Ii,Ho=new Ii,Go=new ir,Wo=new Ts,jo=new Ba,Xo=new Ii,qo=new Ii;class Yo extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qa,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ko;super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,i=t.count;e<i;e++)Vo.fromBufferAttribute(t,e-1),Ho.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Vo.distanceTo(H
vendor: 3,454 bytes, line 2
2o);e.setAttribute("lineDistance",new Da(n,1))}else di("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),jo.copy(n.boundingSphere),jo.applyMatrix4(i),jo.radius+=r,!1===e.ray.intersectsSphere(jo))return;Go.copy(i).invert(),Wo.copy(e.ray).applyMatrix4(Go);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=this.isLineSegments?2:1,c=n.index,u=n.attributes.position;if(null!==c){const n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=l){const n=c.getX(r),i=c.getX(r+1),a=Zo(this,e,Wo,o,n,i,r);a&&t.push(a)}if(this.isLineLoop){const r=c.getX(i-1),a=c.getX(n),s=Zo(this,e,Wo,o,r,a,i-1);s&&t.push(s)}}else{const n=Math.max(0,a.start),i=Math.min(u.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=l){const n=Zo(this,e,Wo,o,r,r+1,r);n&&t.push(n)}if(this.isLineLoop){const r=Zo(this,e,Wo,o,i-1,n,i-1);r&&t.push(r)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function Zo(e,t,n,i,r,a,s){const o=e.geometry.attributes.position;Vo.fromBufferAttribute(o,r),Ho.fromBufferAttribute(o,a);if(n.distanceSqToSegment(Vo,Ho,Xo,qo)>i)return;Xo.applyMatrix4(e.matrixWorld);const l=t.ray.origin.distanceTo(Xo);return l<t.near||l>t.far?void 0:{distance:l,point:qo.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}const Jo=new Ii,Ko=new Ii;class Qo extends Yo{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;e<i;e+=2)Jo.fromBufferAttribute(t,e),Ko.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Jo.distanceTo(Ko);e.setAttribute("lineDistance",new Da(n,1))}else di("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class $o extends Yo{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class el extends $a{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new zr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const tl=new ir,nl=new Ts,il=new Ba,rl=new Ii;class al extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qa,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new el;super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),il.copy(n.boundingSphere),il.applyM
2atrix4(i),il.radius+=r,!1===e.ray.intersectsSphere(il))return;tl.copy(i).invert(),nl.copy(e.ray).applyMatrix4(tl);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);n<r;n++){const r=l.getX(n);rl.fromBufferAttribute(c,r),sl(rl,r,o,i,e,t,this)}}else{for(let n=Math.max(0,a.start),r=Math.min(c.count,a.start+a.count);n<r;n++)rl.fromBufferAttribute(c,n),sl(rl,n,o,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function sl(e,t,n,i,r,a,s){const o=nl.distanceSqToPoint(e);if(o<n){const n=new Ii;nl.closestPointToPoint(e,n),n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class ol extends Zi{constructor(e,t,n,i){super(e,t,n,i,arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ae,arguments.length>5&&void 0!==arguments[5]?arguments[5]:Ae,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const r=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){r.needsUpdate=!0,r._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class ll extends ol{constructor(e,t,n,i,r,a,s,o){super({},e,t,n,i,r,a,s,o),this.isVideoFrameTexture=!0}update(){}clone(){return(new this.constructor).copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class cl extends Zi{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Se,this.minFilter=Se,this.generateMipmaps=!1,this.needsUpdate=!0}}class ul extends Zi{constructor(e,t,n,i,r,a,s,o,l,c,u,h){super(null,a,s,o,l,c,i,r,u,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class hl extends ul{constructor(e,t,n,i,r,a){super(e,t,n,r,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=xe,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class dl extends ul{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,fe),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pl extends Zi{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe,arguments.length>2?arguments[2]:void 0,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>5?arguments[5]:void 0,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0,arguments.length>9?arguments[9]:void 0),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class fl extends Zi{constructor(e,t,n,i,r,a,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ml extends Zi{constructor(e,t,n,i,r,a,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;const c=e?e.parentNode:null;null!==c&&"requestPaint"in c&&(c.onpaint=()=>{this.needsUpdate=!0},c.requestPaint())}dispose(){const e=this.image?this.image.parentNode:null;null!==e&&"onpaint"in e&&(e.onpaint=null),super.dispose()}}class gl extends Zi{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Fe,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Se,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Se,l=arguments.length>8?arguments[8]:void 0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Ye,u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1;if(c!==Ye&&c!==Ze)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:u},i,r,a,s,o,c,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ji(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class vl extends gl{constructor(e){const t={width:e,height:e,depth:1},n=[t,t,t,t,t,t];super(e,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fe,arguments.length>2&&void 0!==arguments[2]?arguments[2]:fe,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>5&&void 0!==arguments[5]?arguments[5]:Se,arguments.length>6&&void 0!==arguments[6]?arguments[6]:Se,arguments.length>7?arguments[7]:void 0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:Ye),this.image=n,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class _l extends Zi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class yl extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const o=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,n,i,r,a,p,f,m,g,v){const _=a/m,y=p/g,x=a/2,b=p/2,S=f/2,M=m+1,w=g+1;let T=0,E=0;const A=new Ii;for(let s=0;s<w;s++){const a=s*y-b;for(let o=0;o<M;o++){const h=o*_-x;A[e]=h*i,A[t]=a*r,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=f>0?1:-1,c.push(A.x,A.y,A.z),u.push(o/m),u.push(1-s/g),T+=1}}for(let s=0;s<g;s++)for(let e=0;e<m;e++){const t=h+e+M*s,n=h+e+M*(s+1),i=h+(e+1)+M*(s+1),r=h+(e+1)+M*s;o.push(t,n,r),o.push(n,i,r),E+=6}s.addGroup(d,E,v),d+=E,h+=T}p("z","y","x",-1,-1,n,t,e,a,r,0),p("z","y","x",1,-1,n,t,-e,a,r,1),p("x","z","y",1,1,e,n,t,i,a,2),p("x","z","y",1,-1,e,n,-t,i,a,3),p("x","y","z",1,-1,e,t,n,i,r,4),p("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new Da(l,3)),this.setAttribute("normal",new Da(c,3)),this.setAttribute("uv",new Da(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yl(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xl extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;
vendor: 4,259 bytes, line 2
2super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i,heightSegments:r},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),i=Math.max(3,Math.floor(i)),r=Math.max(1,Math.floor(r));const a=[],s=[],o=[],l=[],c=t/2,u=Math.PI/2*e,h=t,d=2*u+h,p=2*n+r,f=i+1,m=new Ii,g=new Ii;for(let v=0;v<=p;v++){let _=0,y=0,x=0,b=0;if(v<=n){const t=v/n,i=t*Math.PI/2;y=-c-e*Math.cos(i),x=e*Math.sin(i),b=-e*Math.cos(i),_=t*u}else if(v<=n+r){const i=(v-n)/r;y=i*t-c,x=e,b=0,_=u+i*h}else{const t=(v-n-r)/n,i=t*Math.PI/2;y=c+e*Math.sin(i),x=e*Math.cos(i),b=e*Math.sin(i),_=u+h+t*u}const S=Math.max(0,Math.min(1,_/d));let M=0;0===v?M=.5/i:v===p&&(M=-.5/i);for(let e=0;e<=i;e++){const t=e/i,n=t*Math.PI*2,r=Math.sin(n),a=Math.cos(n);g.x=-x*a,g.y=y,g.z=x*r,s.push(g.x,g.y,g.z),m.set(-x*a,b,x*r),m.normalize(),o.push(m.x,m.y,m.z),l.push(t+M,S)}if(v>0){const e=(v-1)*f;for(let t=0;t<i;t++){const n=e+t,i=e+t+1,r=v*f+t,s=v*f+t+1;a.push(n,i,r),a.push(i,s,r)}}}this.setIndex(a),this.setAttribute("position",new Da(s,3)),this.setAttribute("normal",new Da(o,3)),this.setAttribute("uv",new Da(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xl(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class bl extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const r=[],a=[],s=[],o=[],l=new Ii,c=new Ri;a.push(0,0,0),s.push(0,0,1),o.push(.5,.5);for(let u=0,h=3;u<=t;u++,h+=3){const r=n+u/t*i;l.x=e*Math.cos(r),l.y=e*Math.sin(r),a.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(a[h]/e+1)/2,c.y=(a[h+1]/e+1)/2,o.push(c.x,c.y)}for(let u=1;u<=t;u++)r.push(u,u+1,0);this.setIndex(r),this.setAttribute("position",new Da(a,3)),this.setAttribute("normal",new Da(s,3)),this.setAttribute("uv",new Da(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bl(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Sl extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:s,thetaLength:o};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],u=[],h=[],d=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const r=p,a=new Ri,f=new Ii;let v=0;const _=!0===n?e:t,y=!0===n?1:-1;for(let e=1;e<=i;e++)u.push(0,m*y,0),h.push(0,y,0),d.push(.5,.5),p++;const x=p;for(let e=0;e<=i;e++){const t=e/i*o+s,n=Math.cos(t),r=Math.sin(t);f.x=_*r,f.y=m*y,f.z=_*n,u.push(f.x,f.y,f.z),h.push(0,y,0),a.x=.5*n+.5,a.y=.5*r*y+.5,d.push(a.x,a.y),p++}for(let e=0;e<i;e++){const t=r+e,i=x+e;!0===n?c.push(i,i+1,t):c.push(i+1,i,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const a=new Ii,v=new Ii;let _=0;const y=(t-e)/n;for(let l=0;l<=r;l++){const c=[],g=l/r,_=g*(t-e)+e;for(let e=0;e<=i;e++){const t=e/i,r=t*o+s,l=Math.sin(r),f=Math.cos(r);v.x=_*l,v.y=-g*n+m,v.z=_*f,u.push(v.x,v.y,v.z),a.set(l,y,f).normalize(),h.push(a.x,a.y,a.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let n=0;n<i;n++)for(let i=0;i<r;i++){const a=f[i][n],s=f[i+1][n],o=f[i+1][n+1],l=f[i][n+1];(e>0||0!==i)&&(c.push(a,s,l),_+=3),(t>0||i!==r-1)&&(c.push(s,o,l),_+=3)}l.addGroup(g,_,0),g+=_}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Da(u,3)),this.setAttribute("normal",new Da(h,3)),this.setAttribute("uv",new Da(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}
2static fromJSON(e){return new Sl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ml extends Sl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(0,e,t,n,i,r,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:s}}static fromJSON(e){return new Ml(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class wl extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],a=[];function s(e,t,n,i){const r=i+1,a=[];for(let s=0;s<=r;s++){a[s]=[];const i=e.clone().lerp(n,s/r),o=t.clone().lerp(n,s/r),l=r-s;for(let e=0;e<=l;e++)a[s][e]=0===e&&s===r?i:i.clone().lerp(o,e/l)}for(let s=0;s<r;s++)for(let e=0;e<2*(r-s)-1;e++){const t=Math.floor(e/2);e%2===0?(o(a[s][t+1]),o(a[s+1][t]),o(a[s][t])):(o(a[s][t+1]),o(a[s+1][t+1]),o(a[s+1][t]))}}function o(e){r.push(e.x,e.y,e.z)}function l(t,n){const i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function c(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){const n=new Ii,i=new Ii,r=new Ii;for(let a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],i),l(t[a+2],r),s(n,i,r,e)}(i),function(e){const t=new Ii;for(let n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){const e=new Ii;for(let t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];const n=u(e)/2/Math.PI+.5,i=h(e)/Math.PI+.5;a.push(n,1-i)}(function(){const e=new Ii,t=new Ii,n=new Ii,i=new Ii,s=new Ri,o=new Ri,l=new Ri;for(let h=0,d=0;h<r.length;h+=9,d+=6){e.set(r[h+0],r[h+1],r[h+2]),t.set(r[h+3],r[h+4],r[h+5]),n.set(r[h+6],r[h+7],r[h+8]),s.set(a[d+0],a[d+1]),o.set(a[d+2],a[d+3]),l.set(a[d+4],a[d+5]),i.copy(e).add(t).add(n).divideScalar(3);const p=u(i);c(s,d+0,e,p),c(o,d+2,t,p),c(l,d+4,n,p)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],n=a[e+2],i=a[e+4],r=Math.max(t,n,i),s=Math.min(t,n,i);r>.9&&s<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new Da(r,3)),this.setAttribute("normal",new Da(r.slice(),3)),this.setAttribute("uv",new Da(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wl(e.vertices,e.indices,e.radius,e.detail)}}class Tl extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
219,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Tl(e.radius,e.detail)}}const El=new Ii,Al=new Ii,Cl=new Ii,Rl=new na;class Pl extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,i=Math.pow(10,n),r=Math.cos(xi*t),a=e.getIndex(),s=e.getAttribute("position"),o=a?a.count:s.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},d=[];for(let e=0;e<o;e+=3){a?(l[0]=a.getX(e),l[1]=a.getX(e+1),l[2]=a.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const t=Rl.a,n=Rl.b,o=Rl.c;if(t.fromBufferAttribute(s,l[0]),n.fromBufferAttribute(s,l[1]),o.fromBufferAttribute(s,l[2]),Rl.getNormal(Cl),u[0]="".concat(Math.round(t.x*i),",").concat(Math.round(t.y*i),",").concat(Math.round(t.z*i)),u[1]="".concat(Math.round(n.x*i),",").concat(Math.round(n.y*i),",").concat(Math.round(n.z*i)),u[2]="".concat(Math.round(o.x*i),",").concat(Math.round(o.y*i),",").concat(Math.round(o.z*i)),u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],i=u[t],a=Rl[c[e]],s=Rl[c[t]],o="".concat(n,"_").concat(i),p="".concat(i,"_").concat(n);p in h&&h[p]?(Cl.dot(h[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(s.x,s.y,s.z)),h[p]=null):o in h||(h[o]={index0:l[e],index1:l[t],normal:Cl.clone()})}}for(const e in h)if(h[e]){const t=h[e],n=t.index0,i=t.index1;El.fromBufferAttribute(s,n),Al.fromBufferAttribute(s,i),d.push(El.x,El.y,El.z),d.push(Al.x,Al.y,Al.z)}this.setAttribute("position",new Da(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Il{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){di("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.getLengths();let i=0;const r=n.length;let a;a=t||e*n[r-1];let s,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),s=n[i]-a,s<0)o=i+1;else{if(!(s>0)){l=i;break}l=i-1}if(i=l,n[i]===a)return i/(r-1);const c=n[i];return(i+(a-c)/(n[i+1]-c))/(r-1)}getTangent(e,t){const n=1e-4;let i=e-n,r=e+n;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),s=this.getPoint(r),o=t||(a.isVector2?new Ri:new Ii);return o.copy(s).sub(a).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=new Ii,i=[],r=[],a=[],s=new Ii,o=new ir;for(let d=0;d<=e;d++){const t=d/e;i[d]=this.getTangentAt(t,new Ii)}r[0]=new Ii,a[0]=new Ii;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),a[0].crossVectors(i[0],r[0]);for(let d=1;d<=e;d++){if(r[d]=r[d-1].clone(),a[d]=a[d-1].clone(),s.crossVectors(i[d-1],i[d]),s.length()>Number.EPSILON){s.normalize();const e=Math.acos(Mi(i[d-1].dot(i[d]),-1,1));r[d].applyMatrix4(o.makeRotationAxis(s,e))}a[d].crossVectors(i[d],r[d])}if(!0===t){let t=Math.acos(Mi(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],t*n)),a[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.t
vendor: 6,333 bytes, line 2
2ype,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ll extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri,n=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const r=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=r?0:n),!0!==this.aClockwise||r||(i===n?i=-n:i-=n);const a=this.aStartAngle+e*i;let s=this.aX+this.xRadius*Math.cos(a),o=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,i=o-this.aY;s=n*e-i*t+this.aX,o=n*t+i*e+this.aY}return t.set(s,o)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Nl extends Ll{constructor(e,t,n,i,r,a){super(e,t,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Ul(){let e=0,t=0,n=0,i=0;function r(r,a,s,o){e=r,t=s,n=-3*r+3*a-2*s-o,i=2*r-2*a+s+o}return{initCatmullRom:function(e,t,n,i,a){r(t,n,a*(n-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,a,s,o){let l=(t-e)/a-(n-e)/(a+s)+(n-t)/s,c=(n-t)/s-(i-t)/(s+o)+(i-n)/o;l*=s,c*=s,r(t,n,l,c)},calc:function(r){const a=r*r;return e+t*r+n*a+i*(a*r)}}}const Dl=new Ii,Ol=new Ii,Fl=new Ul,zl=new Ul,Bl=new Ul;class kl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii,n=this.points,i=n.length,r=(i-(this.closed?0:1))*e;let a,s,o=Math.floor(r),l=r-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:0===l&&o===i-1&&(o=i-2,l=1),this.closed||o>0?a=n[(o-1)%i]:(Ol.subVectors(n[0],n[1]).add(n[0]),a=Ol);const c=n[o%i],u=n[(o+1)%i];if(this.closed||o+2<i?s=n[(o+2)%i]:(Dl.subVectors(n[i-1],n[i-2]).add(n[i-1]),s=Dl),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(u),e),i=Math.pow(u.distanceToSquared(s),e);n<1e-4&&(n=1),t<1e-4&&(t=n),i<1e-4&&(i=n),Fl.initNonuniformCatmullRom(a.x,c.x,u.x,s.x,t,n,i),zl.initNonuniformCatmullRom(a.y,c.y,u.y,s.y,t,n,i),Bl.initNonuniformCatmullRom(a.z,c.z,u.z,s.z,t,n,i)}else"catmullrom"===this.curveType&&(Fl.initCatmullRom(a.x,c.x,u.x,s.x,this.tension),zl.initCatmullRom(a.y,c.y,u.y,s.y,this.tension),Bl.initCatmullRom(a.z,c.z,u.z,s.z,this.tension));return t.set(Fl.calc(l),zl.calc(l),Bl.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Ii).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Vl(e,t,n,i,r){const a=.5*(i-t),s=.5*(r-n),o=e*e;return(2*n-2*i+a+s)*(e*o)+(-3*n+3*i-2*a-s)*o+a*e+n}function Hl(e,t,n,i){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,i)}function Gl(e,t,n,i,r){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,i)+function(e,t){return e*e*e*t}(e,r)}class Wl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ri,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ri,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ri;super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri,n=this.v0,i=this.v1,r=this.v2,a=this.v3;return t.set(Gl(e,n.x,i.x,r.x,a.x),Gl(e,n.y,i.y,r.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class jl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ii,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ii;
2super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii,n=this.v0,i=this.v1,r=this.v2,a=this.v3;return t.set(Gl(e,n.x,i.x,r.x,a.x),Gl(e,n.y,i.y,r.y,a.y),Gl(e,n.z,i.z,r.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Xl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ri,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri;super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri).subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ql extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii;
2super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii).subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Yl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ri,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ri;super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri,n=this.v0,i=this.v1,r=this.v2;return t.set(Hl(e,n.x,i.x,r.x),Hl(e,n.y,i.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Zl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ii;super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii,n=this.v0,i=this.v1,r=this.v2;return t.set(Hl(e,n.x,i.x,r.x),Hl(e,n.y,i.y,r.y),Hl(e,n.z,i.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Jl extends Il{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri,n=this.points,i=(n.length-1)*e,r=Math.floor(i),a=i-r,s=n[0===r?r:r-1],o=n[r],l=n[r>n.length-2?n.length-1:r+1],c=n[r>n.length-3?n.length-1:r+2];return t.set(Vl(a,s.x,o.x,l.x,c.x),Vl(a,s.y,o.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Ri).fromArray(n))}return this}}var Kl=Object.freeze({__proto__:null,ArcCurve:Nl,CatmullRomCurve3:kl,CubicBezierCurve:Wl,CubicBezierCurve3:jl,EllipseCurve:Ll,LineCurve:Xl,LineCurve3:ql,QuadraticBezierCurve:Yl,QuadraticBezierCurve3:Zl,SplineCurve:Jl});class Ql extends Il{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Kl[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const e=i[r]-n,a=this.curves[r],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;const t=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const a=r[i],s=a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isS
vendor: 8,726 bytes, line 2
2plineCurve?e*a.points.length:e,o=a.getPoints(s);for(let e=0;e<o.length;e++){const i=o[e];n&&n.equals(i)||(t.push(i),n=i)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new Kl[n.type]).fromJSON(n))}return this}}class $l extends Ql{constructor(e){super(),this.type="Path",this.currentPoint=new Ri,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new Xl(this.currentPoint.clone(),new Ri(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const r=new Yl(this.currentPoint.clone(),new Ri(e,t),new Ri(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,r,a){const s=new Wl(this.currentPoint.clone(),new Ri(e,t),new Ri(n,i),new Ri(r,a));return this.curves.push(s),this.currentPoint.set(r,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Jl(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,r,a){const s=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+s,t+o,n,i,r,a),this}absarc(e,t,n,i,r,a){return this.absellipse(e,t,n,n,i,r,a),this}ellipse(e,t,n,i,r,a,s,o){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,i,r,a,s,o),this}absellipse(e,t,n,i,r,a,s,o){const l=new Ll(e,t,n,i,r,a,s,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class ec extends $l{constructor(e){super(e),this.uuid=Si(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new $l).fromJSON(n))}return this}}function tc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const i=t&&t.length,r=i?t[0]*n:e.length;let a=nc(e,0,r,n,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,c;if(i&&(a=function(e,t,n,i){const r=[];for(let a=0,s=t.length;a<s;a++){const n=nc(e,t[a]*i,a<s-1?t[a+1]*i:e.length,i,!1);n===n.next&&(n.steiner=!0),r.push(pc(n))}r.sort(cc);for(let a=0;a<r.length;a++)n=uc(r[a],n);return n}(e,t,a,n)),e.length>80*n){o=e[0],l=e[1];let t=o,i=l;for(let a=n;a<r;a+=n){const n=e[a],r=e[a+1];n<o&&(o=n),r<l&&(l=r),n>t&&(t=n),r>i&&(i=r)}c=Math.max(t-o,i-l),c=0!==c?32767/c:0}return rc(a,s,n,o,l,c,0),s}function nc(e,t,n,i,r){let a;if(r===function(e,t,n,i){let r=0;for(let a=t,s=n-i;a<n;a+=i)r+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return r}(e,t,n,i)>0)for(let s=t;s<n;s+=i)a=wc(s/i|0,e[s],e[s+1],a);else for(let s=n-i;s>=t;s-=i)a=wc(s/i|0,e[s],e[s+1],a);return a&&_c(a,a.next)&&(Tc(a),a=a.next),a}function ic(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!_c(i,i.next)&&0!==vc(i.prev,i,i.next))i=i.next;else{if(Tc(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function rc(e,t,n,i,r,a,s){if(!e)return;!s&&a&&function(e,t,n,i){let r=e;do{0===r.z&&(r.z=dc(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,n=1;do{let i,r=e;e=null;let a=null;for(t=0;r;){t++;let s=r,o=0;for(let e=0;e<n&&(o++,s=s.nextZ,s);e++);let l=n;for(;o>0||l>0&&s;)0!==o&&(0===l||!s||r.z<=s.z)?(i=r,r=r.nextZ,o--):(i=s,s=s.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=s}a.nextZ=null,n*=2}while(t>1)}(r)}(e,i,r,a);let o=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(a?sc(e,i,r,a):ac(e))t.push(l.i,e.i,c.i),Tc(e),e=c.next,o=c.next;else if((e=c)===o){s?1===s?rc(e=oc(ic(e),t),t,n,i,r,a,2):2===s&&lc(e,t,n,i,r,a):rc(ic(e),t,n,i,r,a,1);break}}}function ac(e){const t=e.prev,n=e,i=e.next;if(vc(t,n,i)>=0)return!1;const r=t.x,a=n.x,s=i.x,o=t.y,l=n.y,c=i.y,u=Math.min(r,a,s),h=Math.min(o,l,c),d=Math.max(r,a,s),p=Math.max(o,l,c);let f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&mc(r,o,a,l,s,c,f.x,f.y)&&vc(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function sc(e,t,n,i){const r=e.prev,a=e,s=e.next;if(vc(r,a,s)>=0)return!1;const o=r.x,l=a.x,c=s.x,u=r.y,h=a.y,d=s.y,p=Math.min(o,l,c),f=Math.min(u,h,d),m=Math.max(o,l,c),g=Math.max(u,h,d),v=dc(p,f,t,n,i),_=dc(m,g,t,n,i);let y=e.prevZ,x=e.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==s&&mc(o,u,l,h,c,d,y.x,y.y)&&vc(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==s&&mc(o,u,l,h,c,d,x.x,x.y)&&vc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==s&&mc(o,u,l,h,c,d,y.x,y.y)&&vc(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==s&&mc(o,u,l,h,c,d,x.x,x.y)&&vc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function oc(e,t){let n=e;do{const i=n.prev,r=n.next.next;!_c(i,r)&&yc(i,n,n.next,r)&&Sc(i,r)&&Sc(r,i)&&(t.push(i.i,n.i,r.i),Tc(n),Tc(n.next),n=e=r),n=n.next}while(n!==e);return ic(n)}function lc(e,t,n,i,r,a){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&gc(s,e)){let o=Mc(s,e);return s=ic(s,s.next),o=ic(o,o.next),rc(s,t,n,i,r,a,0),void rc(o,t,n,i,r,a,0)}e=e.next}s=s.next}while(s!==e)}function cc(e,t){let n=e.x-t.x;if(0===n&&(n=e.y-t.y,0===n)){n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}return n}function uc(e,t){const n=function(e,t){let n=t;const i=e.x,r=e.y;let a,s=-1/0;if(_c(e,n))return n;do{if(_c(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const e=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>s&&(s=e,a=n.x<n.next.x?n:n.next,e===i))return a}n=n.next}while(n!==t);if(!a)return null;const o=a,l=a.x,c=a.y;let u=1/0;n=a;do{if(i>=n.x&&n.x>=l&&i!==n.x&&fc(r<c?i:s,r,l,c,r<c?s:i,r,n.x,n.y)){const t=Math.abs(r-n.y)/(i-n.x);Sc(n,e)&&(t<u||t===u&&(n.x>a.x||n.x===a.x&&hc(a,n)))&&(a=n,u=t)}n=n.next}while(n!==o);return a}(e,t);if(!n)return t;const i=Mc(n,e);return ic(i,i.next),ic(n,n.next)}function hc(e,t){return vc(e.prev,e,t.prev)<0&&vc(t.next,e,e.next)<0}function dc(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function pc(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function fc(e,t,n,i,r,a,s,o){return(r-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(n-s)*(t-o)&&(n-s)*(a-o)>=(r-s)*(i-o)}function mc(e,t,n,i,r,a,s,o){return!(e===s&&t===o)&&fc(e,t,n,i,r,a,s,o)}function gc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&yc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Sc(e,t)&&Sc(t,e)&&function(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!==n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(vc(e.prev,e,t.prev)||vc(e,t.prev,t))||_c(e,t)&&vc(e.prev,e,e.next)>0&&vc(t.prev,t,t.next)>0)}function vc(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function _c(e,t){return e.x===t.x&&e.y===t.y}function yc(e,t,n,i){const r=bc(vc(e,t,n)),a=bc(vc(e,t,i)),s=bc(vc(n,i,e)),o=bc(vc(n,i,t));return r!==a&&s!==o||(!(0!==r||!xc(e,n,t))||(!(0!==a||!xc(e,i,t))||(!(0!==s||!xc(n,e,i))||!(0!==o||!xc(n,t,i)))))}function xc(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function bc(e){return e>0?1:e<0?-1:0}
vendor: 4,963 bytes, line 2
2function Sc(e,t){return vc(e.prev,e,e.next)<0?vc(e,t,e.next)>=0&&vc(e,e.prev,t)>=0:vc(e,t,e.prev)<0||vc(e,e.next,t)<0}function Mc(e,t){const n=Ec(e.i,e.x,e.y),i=Ec(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function wc(e,t,n,i){const r=Ec(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Tc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ec(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class Ac{static triangulate(e,t){return tc(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:2)}}class Cc{static area(e){const t=e.length;let n=0;for(let i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n}static isClockWise(e){return Cc.area(e)<0}static triangulateShape(e,t){const n=[],i=[],r=[];Rc(e),Pc(n,e);let a=e.length;t.forEach(Rc);for(let o=0;o<t.length;o++)i.push(a),a+=t[o].length,Pc(n,t[o]);const s=Ac.triangulate(n,i);for(let o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}}function Rc(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Pc(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class Ic extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ec([new Ri(.5,.5),new Ri(-.5,.5),new Ri(-.5,-.5),new Ri(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],r=[];for(let s=0,o=e.length;s<o;s++){a(e[s])}function a(e){const a=[],s=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,h=void 0!==t.bevelSize?t.bevelSize:u-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:Lc;let g,v,_,y,x,b=!1;if(f){g=f.getSpacedPoints(o),b=!0,c=!1;const e=!!f.isCatmullRomCurve3&&f.closed;v=f.computeFrenetFrames(o,e),_=new Ii,y=new Ii,x=new Ii}c||(p=0,u=0,h=0,d=0);const S=e.extractPoints(s);let M=S.shape;const w=S.holes;if(!Cc.isClockWise(M)){M=M.reverse();for(let e=0,t=w.length;e<t;e++){const t=w[e];Cc.isClockWise(t)&&(w[e]=t.reverse())}}function T(e){const t=1e-10*1e-10;let n=e[0];for(let i=1;i<=e.length;i++){const r=i%e.length,a=e[r],s=a.x-n.x,o=a.y-n.y,l=s*s+o*o,c=Math.max(Math.abs(a.x),Math.abs(a.y),Math.abs(n.x),Math.abs(n.y));l<=t*c*c?(e.splice(r,1),i--):n=a}}T(M),w.forEach(T);const E=w.length,A=M;for(let t=0;t<E;t++){const e=w[t];M=M.concat(e)}function C(e,t,n){return t||pi("ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}const R=M.length;function P(e,t,n){let i,r,a;const s=e.x-t.x,o=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=s*s+o*o,h=s*c-o*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-o/h,f=t.y+s/h,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(s*c-o*l);i=p+s*m-e.x,r=f+o*m-e.y;const g=i*i+r*r;if(g<=2)return new Ri(i,r);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(c)&&(e=!0),e?(i=-o,r=s,a=Math.sqrt(u)):(i=s,r=o,a=Math.sqrt(u/2))}return new Ri(i/a,r/a)}const I=[];for(let t=0,n=A.length,i=n-1,r=t+1;t<n;t++,i++,r++)i===n&&(i=0),r===n&&(r=0),I[t]=P(A[t],A[i],A[r]);const L=[];let N,U,D=I.concat();for(let t=0,n=E;t<n;t++){const e=w[t];N=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++)i===n&&(i=0),r===n&&(r=0),N[t]=P(e[t],e[i],e[r]);L.push(N),D=D.concat(N)}if(0===p)U=Cc.triangulateShape(A,w);else{const e=[],t=[];for(let n=0;n<p;n++){const i=n/p,r=u*Math.cos(i*Math.PI/2),a=h*Math.sin(i*Math.PI/2)+d;for(let t=0,n=A.length;t<n;t++){const n=C(A[t],I[t],a);B(n.x,n.y,-r),0===i&&e.push(n)}for(let e=0,n=E;e<n;e++){const n=w[e];N=L[e];const s=[];for(let e=0,t=n.length;e<t;e++){const t=C(n[e],N[e],a);B(t.x,t.y,-r),0===i&&s.push(t)}0===i&&t.push(s)}}U=Cc.triangulateShape(e,t)}const O=U.length,F=h+d;for(let t=0;t<R;t++){const e=c?C(M[t],D[t],F):M[t];b?(y.copy(v.normals[0]).multiplyScalar(e.x),_.copy(v.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(y).add(_),B(x.x,x.y,x.z)):B(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<R;e++){const n=c?C(M[e],D[e],F):M[e];b?(y.copy(v.normals[t]).multiplyScalar(n.x),_.copy(v.binormals[t]).multiplyScalar(n.y),x.copy(g[t]).add(y).add(_),B(x.x,x.y,x.z)):B(n.x,n.y,l/o*t)}for(let t=p-1;t>=0;t--){const e=t/p,n=u*Math.cos(e*Math.PI/2),i=h*Math.sin(e*Math.PI/2)+d;for(let t=0,r=A.length;t<r;t++){const e=C(A[t],I[t],i);B(e.x,e.y,l+n)}for(let t=0,r=w.length;t<r;t++){const e=w[t];N=L[t];for(let t=0,r=e.length;t<r;t++){const r=C(e[t],N[t],i);b?B(r.x,r.y+g[o-1].y,g[o-1].x+n):B(r.x,r.y,l+n)}}}function z(e,t){let n=e.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=e.length-1);for(let e=0,n=o+2*p;
vendor: 8,945 bytes, line 2
2e<n;e++){const n=R*e,a=R*(e+1);V(t+i+n,t+r+n,t+r+a,t+i+a)}}}function B(e,t,n){a.push(e),a.push(t),a.push(n)}function k(e,t,r){H(e),H(t),H(r);const a=i.length/3,s=m.generateTopUV(n,i,a-3,a-2,a-1);G(s[0]),G(s[1]),G(s[2])}function V(e,t,r,a){H(e),H(t),H(a),H(t),H(r),H(a);const s=i.length/3,o=m.generateSideWallUV(n,i,s-6,s-3,s-2,s-1);G(o[0]),G(o[1]),G(o[3]),G(o[1]),G(o[2]),G(o[3])}function H(e){i.push(a[3*e+0]),i.push(a[3*e+1]),i.push(a[3*e+2])}function G(e){r.push(e.x),r.push(e.y)}!function(){const e=i.length/3;if(c){let e=0,t=R*e;for(let n=0;n<O;n++){const e=U[n];k(e[2]+t,e[1]+t,e[0]+t)}e=o+2*p,t=R*e;for(let n=0;n<O;n++){const e=U[n];k(e[0]+t,e[1]+t,e[2]+t)}}else{for(let e=0;e<O;e++){const t=U[e];k(t[2],t[1],t[0])}for(let e=0;e<O;e++){const t=U[e];k(t[0]+R*o,t[1]+R*o,t[2]+R*o)}}n.addGroup(e,i.length/3-e,0)}(),function(){const e=i.length/3;let t=0;z(A,t),t+=A.length;for(let n=0,i=w.length;n<i;n++){const e=w[n];z(e,t),t+=e.length}n.addGroup(e,i.length/3-e,1)}()}this.setAttribute("position",new Da(i,3)),this.setAttribute("uv",new Da(r,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let i=0,r=e.length;i<r;i++){const t=e[i];n.shapes.push(t.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,a=e.shapes.length;r<a;r++){const i=t[e.shapes[r]];n.push(i)}const i=e.options.extrudePath;return void 0!==i&&(e.options.extrudePath=(new Kl[i.type]).fromJSON(i)),new Ic(n,e.options)}}const Lc={generateTopUV:function(e,t,n,i,r){const a=t[3*n],s=t[3*n+1],o=t[3*i],l=t[3*i+1],c=t[3*r],u=t[3*r+1];return[new Ri(a,s),new Ri(o,l),new Ri(c,u)]},generateSideWallUV:function(e,t,n,i,r,a){const s=t[3*n],o=t[3*n+1],l=t[3*n+2],c=t[3*i],u=t[3*i+1],h=t[3*i+2],d=t[3*r],p=t[3*r+1],f=t[3*r+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(o-u)<Math.abs(s-c)?[new Ri(s,1-l),new Ri(c,1-h),new Ri(d,1-f),new Ri(m,1-v)]:[new Ri(o,1-l),new Ri(u,1-h),new Ri(p,1-f),new Ri(g,1-v)]}};class Nc extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Nc(e.radius,e.detail)}}class Uc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new Ri(0,-.5),new Ri(.5,0),new Ri(0,.5)],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=Mi(i,0,2*Math.PI);const r=[],a=[],s=[],o=[],l=[],c=1/t,u=new Ii,h=new Ri,d=new Ii,p=new Ii,f=new Ii;let m=0,g=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let v=0;v<=t;v++){const r=n+v*c*i,d=Math.sin(r),p=Math.cos(r);for(let n=0;n<=e.length-1;n++){u.x=e[n].x*d,u.y=e[n].y,u.z=e[n].x*p,a.push(u.x,u.y,u.z),h.x=v/t,h.y=n/(e.length-1),s.push(h.x,h.y);const i=o[3*n+0]*d,r=o[3*n+1],c=o[3*n+0]*p;l.push(i,r,c)}}for(let v=0;v<t;v++)for(let t=0;t<e.length-1;t++){const n=t+v*e.length,i=n,a=n+e.length,s=n+e.length+1,o=n+1;r.push(i,a,o),r.push(s,o,a)}this.setIndex(r),this.setAttribute("position",new Da(a,3)),this.setAttribute("uv",new Da(s,2)),this.setAttribute("normal",new Da(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Uc(e.points,e.segments,e.phiStart,e.phiLength)}}class Dc extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Dc(e.radius,e.detail)}}class Oc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,s=Math.floor(n),o=Math.floor(i),l=s+1,c=o+1,u=e/s,h=t/o,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const e=g*h-a;for(let t=0;t<l;t++){const n=t*u-r;p.push(n,-e,0),f.push(0,0,1),m.push(t/s),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let e=0;e<s;e++){const t=e+l*g,n=e+l*(g+1),i=e+1+l*(g+1),r=e+1+l*g;d.push(t,n,r),d.push(n,i,r)}this.setIndex(d),this.setAttribute("position",new Da(p,3)),this.setAttribute("normal",new Da(f,3)),this.setAttribute("uv",new Da(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Oc(e.width,e.height,e.widthSegments,e.heightSegments)}}class Fc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},n=Math.max(3,n),i=Math.max(1,i);const s=[],o=[],l=[],c=[];let u=e;const h=(t-e)/i,d=new Ii,p=new Ri;for(let f=0;f<=i;f++){for(let e=0;e<=n;e++){const i=r+e/n*a;d.x=u*Math.cos(i),d.y=u*Math.sin(i),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,c.push(p.x,p.y)}u+=h}for(let f=0;f<i;f++){const e=f*(n+1);for(let t=0;t<n;t++){const i=t+e,r=i,a=i+n+1,o=i+n+2,l=i+1;s.push(r,a,l),s.push(a,o,l)}}this.setIndex(s),this.setAttribute("position",new Da(o,3)),this.setAttribute("normal",new Da(l,3)),this.setAttribute("uv",new Da(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class zc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ec([new Ri(0,.5),new Ri(-.5,-.5),new Ri(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],r=[],a=[];let s=0,o=0;if(!1===Array.isArray(e))l(e);else for(let c=0;c<e.length;c++)l(e[c]),this.addGroup(s,o,c),s+=o,o=0;function l(e){const s=i.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===Cc.isClockWise(c)&&(c=c.reverse());for(let t=0,n=u.length;t<n;t++){const e=u[t];!0===Cc.isClockWise(e)&&(u[t]=e.reverse())}const h=Cc.triangulateShape(c,u);for(let t=0,n=u.length;t<n;t++){const e=u[t];c=c.concat(e)}for(let t=0,n=c.length;t<n;t++){const e=c[t];i.push(e.x,e.y,0),r.push(0,0,1),a.push(e.x,e.y)}for(let t=0,i=h.length;t<i;t++){const e=h[t],i=e[0]+s,r=e[1]+s,a=e[2]+s;n.push(i,r,a),o+=3}}this.setIndex(n),this.setAttribute("position",new Da(i,3)),this.setAttribute("normal",new Da(r,3)),this.setAttribute("uv",new Da(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,i=e.length;n<i;n++){const i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let i=0,r=e.shapes.length;i<r;i++){const r=t[e.shapes[i]];n.push(r)}return new zc(n,e.curveSegments)}}class Bc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;
2super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:s},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(a+s,Math.PI);let l=0;const c=[],u=new Ii,h=new Ii,d=[],p=[],f=[],m=[];for(let g=0;g<=n;g++){const d=[],v=g/n,_=a+v*s,y=e*Math.cos(_),x=Math.sqrt(e*e-y*y);let b=0;0===g&&0===a?b=.5/t:g===n&&o===Math.PI&&(b=-.5/t);for(let e=0;e<=t;e++){const n=e/t,a=i+n*r;u.x=-x*Math.cos(a),u.y=y,u.z=x*Math.sin(a),p.push(u.x,u.y,u.z),h.copy(u).normalize(),f.push(h.x,h.y,h.z),m.push(n+b,1-v),d.push(l++)}c.push(d)}for(let g=0;g<n;g++)for(let e=0;e<t;e++){const t=c[g][e+1],i=c[g][e],r=c[g+1][e],s=c[g+1][e+1];(0!==g||a>0)&&d.push(t,i,s),(g!==n-1||o<Math.PI)&&d.push(i,r,s)}this.setIndex(d),this.setAttribute("position",new Da(p,3)),this.setAttribute("normal",new Da(f,3)),this.setAttribute("uv",new Da(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class kc extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new kc(e.radius,e.detail)}}class Vc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r,thetaStart:a,thetaLength:s},n=Math.floor(n),i=Math.floor(i);const o=[],l=[],c=[],u=[],h=new Ii,d=new Ii,p=new Ii;for(let f=0;f<=n;f++){const o=a+f/n*s;for(let a=0;a<=i;a++){const s=a/i*r;d.x=(e+t*Math.cos(o))*Math.cos(s),d.y=(e+t*Math.cos(o))*Math.sin(s),d.z=t*Math.sin(o),l.push(d.x,d.y,d.z),h.x=e*Math.cos(s),h.y=e*Math.sin(s),p.subVectors(d,h).normalize(),c.push(p.x,p.y,p.z),u.push(a/i),u.push(f/n)}}for(let f=1;f<=n;f++)for(let e=1;e<=i;
vendor: 4,324 bytes, line 2
2e++){const t=(i+1)*f+e-1,n=(i+1)*(f-1)+e-1,r=(i+1)*(f-1)+e,a=(i+1)*f+e;o.push(t,n,a),o.push(n,r,a)}this.setIndex(o),this.setAttribute("position",new Da(l,3)),this.setAttribute("normal",new Da(c,3)),this.setAttribute("uv",new Da(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Vc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Hc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},n=Math.floor(n),i=Math.floor(i);const s=[],o=[],l=[],c=[],u=new Ii,h=new Ii,d=new Ii,p=new Ii,f=new Ii,m=new Ii,g=new Ii;for(let _=0;_<=n;++_){const s=_/n*r*Math.PI*2;v(s,r,a,e,d),v(s+.01,r,a,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=i;++e){const r=e/i*Math.PI*2,a=-t*Math.cos(r),s=t*Math.sin(r);u.x=d.x+(a*g.x+s*f.x),u.y=d.y+(a*g.y+s*f.y),u.z=d.z+(a*g.z+s*f.z),o.push(u.x,u.y,u.z),h.subVectors(u,d).normalize(),l.push(h.x,h.y,h.z),c.push(_/n),c.push(e/i)}}for(let _=1;_<=n;_++)for(let e=1;e<=i;e++){const t=(i+1)*(_-1)+(e-1),n=(i+1)*_+(e-1),r=(i+1)*_+e,a=(i+1)*(_-1)+e;s.push(t,n,a),s.push(n,r,a)}function v(e,t,n,i,r){const a=Math.cos(e),s=Math.sin(e),o=n/t*e,l=Math.cos(o);r.x=i*(2+l)*.5*a,r.y=i*(2+l)*s*.5,r.z=i*Math.sin(o)*.5}this.setIndex(s),this.setAttribute("position",new Da(o,3)),this.setAttribute("normal",new Da(l,3)),this.setAttribute("uv",new Da(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hc(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Gc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Zl(new Ii(-1,-1,0),new Ii(-1,1,0),new Ii(1,1,0)),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const s=new Ii,o=new Ii,l=new Ri;let c=new Ii;const u=[],h=[],d=[],p=[];function f(r){c=e.getPointAt(r/t,c);const l=a.normals[r],d=a.binormals[r];for(let e=0;e<=i;e++){const t=e/i*Math.PI*2,r=Math.sin(t),a=-Math.cos(t);o.x=a*l.x+r*d.x,o.y=a*l.y+r*d.y,o.z=a*l.z+r*d.z,o.normalize(),h.push(o.x,o.y,o.z),s.x=c.x+n*o.x,s.y=c.y+n*o.y,s.z=c.z+n*o.z,u.push(s.x,s.y,s.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===r?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=i;n++)l.x=e/t,l.y=n/i,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=i;t++){const n=(i+1)*(e-1)+(t-1),r=(i+1)*e+(t-1),a=(i+1)*e+t,s=(i+1)*(e-1)+t;p.push(n,r,s),p.push(r,a,s)}}()}(),this.setIndex(p),this.setAttribute("position",new Da(u,3)),this.setAttribute("normal",new Da(h,3)),this.setAttribute("uv",new Da(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Gc((new Kl[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Wc extends qa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,i=new Ii,r=new Ii;if(null!==e.index){const a=e.attributes.position,s=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let l=0;l<3;l++){const o=s.getX(e+l),c=s.getX(e+(l+1)%3);i.fromBufferAttribute(a,o),r.fromBufferAttribute(a,c),!0===jc(i,r,n)&&(t.push(i.x,i.y,i.z),t.pu
vendor: 17,579 bytes, line 2
2sh(r.x,r.y,r.z))}}}else{const a=e.attributes.position;for(let e=0,s=a.count/3;e<s;e++)for(let o=0;o<3;o++){const s=3*e+o,l=3*e+(o+1)%3;i.fromBufferAttribute(a,s),r.fromBufferAttribute(a,l),!0===jc(i,r,n)&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new Da(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function jc(e,t,n){const i="".concat(e.x,",").concat(e.y,",").concat(e.z,"-").concat(t.x,",").concat(t.y,",").concat(t.z),r="".concat(t.x,",").concat(t.y,",").concat(t.z,"-").concat(e.x,",").concat(e.y,",").concat(e.z);return!0!==n.has(i)&&!0!==n.has(r)&&(n.add(i),n.add(r),!0)}var Xc=Object.freeze({__proto__:null,BoxGeometry:yl,CapsuleGeometry:xl,CircleGeometry:bl,ConeGeometry:Ml,CylinderGeometry:Sl,DodecahedronGeometry:Tl,EdgesGeometry:Pl,ExtrudeGeometry:Ic,IcosahedronGeometry:Nc,LatheGeometry:Uc,OctahedronGeometry:Dc,PlaneGeometry:Oc,PolyhedronGeometry:wl,RingGeometry:Fc,ShapeGeometry:zc,SphereGeometry:Bc,TetrahedronGeometry:kc,TorusGeometry:Vc,TorusKnotGeometry:Hc,TubeGeometry:Gc,WireframeGeometry:Wc});class qc extends $a{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new zr(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}function Yc(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const r=e[n][i];if(Jc(r))r.isRenderTargetTexture?(di("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=r.clone();else if(Array.isArray(r))if(Jc(r[0])){const e=[];for(let t=0,n=r.length;t<n;t++)e[t]=r[t].clone();t[n][i]=e}else t[n][i]=r.slice();else t[n][i]=r}}return t}function Zc(e){const t={};for(let n=0;n<e.length;n++){const i=Yc(e[n]);for(const e in i)t[e]=i[e]}return t}function Jc(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function Kc(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:Bi.workingColorSpace}const Qc={clone:Yc,merge:Zc};class $c extends $a{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Yc(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)!0===this.extensions[i]&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),void 0!==e.uniforms)for(const n in e.uniforms){const i=e.uniforms[n];switch(this.uniforms[n]={},i.type){case"t":this.uniforms[n].value=t[i.value]||null;break;case"c":this.uniforms[n].value=(new zr).setHex(i.value);break;case"v2":this.uniforms[n].value=(new Ri).fromArray(i.value);break;case"v3":this.uniforms[n].value=(new Ii).fromArray(i.value);break;case"v4":this.uniforms[n].value=(new Ji).fromArray(i.value);break;case"m3":this.uniforms[n].value=(new Ui).fromArray(i.value);break;case"m4":this.uniforms[n].value=(new ir).fromArray(i.value);break;default:this.uniforms[n].value=i.value}}if(void 0!==e.defines&&(this.defines=e.defines),void 0!==e.vertexShader&&(this.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(this.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(this.glslVersion=e.glslVersion),void 0!==e.extensions)for(const n in e.extensions)this.extensions[n]=e.extensions[n];return void 0!==e.lights&&(this.lights=e.lights),void 0!==e.clipping&&(this.clipping=e.clipping),this}}class eu extends $c{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class tu extends $a{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new zr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new zr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Ri(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pr,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class nu extends tu{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ri(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mi(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new zr(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new zr(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new zr(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!==e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!==e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!==e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!==e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!==e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!==e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class iu extends $a{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new zr(16777215),this.specular=new zr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new zr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Ri(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pr,this.combine=ee,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ru extends $a{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new zr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new zr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Ri(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class au extends $a{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Ri(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class su extends $a{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new zr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new zr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Ri(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pr,this.combine=ee,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ou extends $a{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=$t,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 lu extends $a{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}
vendor: 15,463 bytes, line 2
2class cu extends $a{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new zr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Ri(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class uu extends ko{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function hu(e,t){return e&&e.constructor!==t?"number"===typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function du(e){const t=e.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(function(t,n){return e[t]-e[n]}),n}function pu(e,t,n){const i=e.length,r=new e.constructor(i);for(let a=0,s=0;s!==i;++a){const i=n[a]*t;for(let n=0;n!==t;++n)r[s++]=e[i+n]}return r}function fu(e,t,n,i){let r=1,a=e[0];for(;void 0!==a&&void 0===a[i];)a=e[r++];if(void 0===a)return;let s=a[i];if(void 0!==s)if(Array.isArray(s))do{s=a[i],void 0!==s&&(t.push(a.time),n.push(...s)),a=e[r++]}while(void 0!==a);else if(void 0!==s.toArray)do{s=a[i],void 0!==s&&(t.push(a.time),s.toArray(n,n.length)),a=e[r++]}while(void 0!==a);else do{s=a[i],void 0!==s&&(t.push(a.time),n.push(s)),a=e[r++]}while(void 0!==a)}class mu{static convertArray(e,t){return hu(e,t)}static isTypedArray(e){return ii(e)}static getKeyframeOrder(e){return du(e)}static sortedArray(e,t,n){return pu(e,t,n)}static flattenJSON(e,t,n,i){fu(e,t,n,i)}static subclip(e,t,n,i){return function(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;const a=e.clone();a.name=t;const s=[];for(let l=0;l<a.tracks.length;++l){const e=a.tracks[l],t=e.getValueSize(),o=[],c=[];for(let a=0;a<e.times.length;++a){const s=e.times[a]*r;if(!(s<n||s>=i)){o.push(e.times[a]);for(let n=0;n<t;++n)c.push(e.values[a*t+n])}}0!==o.length&&(e.times=hu(o,e.times.constructor),e.values=hu(c,e.values.constructor),s.push(e))}a.tracks=s;let o=1/0;for(let l=0;l<a.tracks.length;++l)o>a.tracks[l].times[0]&&(o=a.tracks[l].times[0]);for(let l=0;l<a.tracks.length;++l)a.tracks[l].shift(-1*o);return a.resetDuration(),a}(e,t,n,i,arguments.length>4&&void 0!==arguments[4]?arguments[4]:30)}static makeClipAdditive(e){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;i<=0&&(i=30);const r=n.tracks.length,a=t/i;for(let s=0;s<r;++s){const t=n.tracks[s],i=t.ValueTypeName;if("bool"===i||"string"===i)continue;const r=e.tracks.find(function(e){return e.name===t.name&&e.ValueTypeName===i});if(void 0===r)continue;let o=0;const l=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let c=0;const u=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=t.times.length-1;let d;if(a<=t.times[0]){const e=o,n=l-o;d=t.values.slice(e,n)}else if(a>=t.times[h]){const e=h*l+o,n=e+l-o;d=t.values.slice(e,n)}else{const e=t.createInterpolant(),n=o,i=l-o;e.evaluate(a),d=e.resultBuffer.slice(n,i)}"quaternion"===i&&(new Pi).fromArray(d).normalize().conjugate().toArray(d);const p=r.times.length;for(let e=0;e<p;++e){const t=e*u+c;if("quaternion"===i)Pi.multiplyQuaternionsFlat(r.values,t,d,0,r.values,t);else{const e=u-2*c;for(let n=0;n<e;++n)r.values[t+n]-=d[n]}}}return e.blendMode=Zt,e}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:30)}}class gu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<i)){for(let a=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=i,i=t[++n],e<i)break t}a=t.length;break n}if(!(e>=r)){const s=t[1];e<s&&(n=2,r=s);for(let a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(i=r,r=t[--n-1],e>=r)break t}a=n,n=0;break n}break e}for(;n<a;){const i=n+a>>>1;e<t[i]?a=i:n=i+1}if(i=t[n],r=t[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let a=0;a!==i;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}}class vu extends gu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:jt,endingEnd:jt}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,s=i[r],o=i[a];if(void 0===s)switch(this.getSettings_().endingStart){case Xt:r=e,s=2*t-n;break;case qt:r=i.length-2,s=t+i[r]-i[r+1];break;default:r=e,s=n}if(void 0===o)switch(this.getSettings_().endingEnd){case Xt:a=e,o=2*n-t;break;case qt:a=1,o=n+i[1]-i[0];break;default:a=e-1,o=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-n),this._offsetPrev=r*c,this._offsetNext=a*c}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(i-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,_=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let x=0;x!==s;++x)r[x]=g*a[c+x]+v*a[l+x]+_*a[o+x]+y*a[u+x];return r}}class _u extends gu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(n-t)/(i-t),u=1-c;for(let h=0;h!==s;++h)r[h]=a[l+h]*u+a[o+h]*c;return r}}class yu extends gu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class xu extends gu{interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this.inTangents,u=this.outTangents;if(!c||!u){const e=(n-t)/(i-t),c=1-e;for(let t=0;t!==s;++t)r[t]=a[l+t]*c+a[o+t]*e;return r}const h=2*s,d=e-1;for(let p=0;p!==s;++p){const s=a[l+p],f=a[o+p],m=d*h+2*p,g=u[m],v=u[m+1],_=e*h+2*p,y=c[_],x=c[_+1];let b,S,M,w,T,E=(n-t)/(i-t);for(let e=0;e<8;e++){b=E*E,S=b*E,M=1-E,w=M*M,T=w*M;const e=T*t+3*w*E*g+3*M*b*y+S*i-n;if(Math.abs(e)<1e-10)break;const r=3*w*(g-t)+6*M*E*(y-g)+3*b*(i-y);if(Math.abs(r)<1e-10)break;E-=e/r,E=Math.max(0,Math.min(1,E))}r[p]=T*s+3*w*E*v+3*M*b*x+S*f}return r}}class bu{constructor(e,t,n,i){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=hu(t,this.TimeBufferType),this.values=hu(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:hu(e.times,Array),values:hu(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new yu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _u(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new vu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){const t=new xu(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case Vt:t=this.InterpolantFactoryMethodDiscrete;break;case Ht:t=this.InterpolantFactoryMethodLinear;break;case Gt:t=this.InterpolantFactoryMethodSmooth;break;case Wt:t=this.InterpolantFactoryMethodBezier}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return di("KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Vt;case this.InterpolantFactoryMethodLinear:return Ht;case this.InterpolantFactoryMethodSmooth:return Gt;case this.InterpolantFactoryMethodBezier:return Wt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const e=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(pi("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;0===r&&(pi("KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==r;s++){const t=n[s];if("number"===typeof t&&isNaN(t)){pi("KeyframeTrack: Time is not a valid number.",this,s,t),e=!1;break}if(null!==a&&a>t){pi("KeyframeTrack: Out of order keys.",this,s,t,a),e=!1;break}a=t}if(void 0!==i&&ii(i))for(let s=0,o=i.length;s!==o;++s){const t=i[s];if(isNaN(t)){pi("KeyframeTrack: Value is not a valid number.",this,s,t),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Gt,r=e.length-1;let a=1;for(let s=1;s<r;++s){let r=!1;const o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(i)r=!0;else{const e=s*n,i=e-n,a=e+n;for(let s=0;s!==n;++s){const n=t[e+s];if(n!==t[i+s]||n!==t[a+s]){r=!0;break}}}if(r){if(s!==a){e[a]=e[s];const i=s*n,r=a*n;for(let e=0;e!==n;++e)t[r+e]=t[i+e]}++a}}if(r>0){e[a]=e[r];for(let e=r*n,i=a*n,s=0;s!==n;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}bu.prototype.ValueTypeName="",bu.prototype.TimeBufferType=Float32Array,bu.prototype.ValueBufferType=Float32Array,bu.prototype.DefaultInterpolation=Ht;class Su extends bu{constructor(e,t,n){super(e,t,n)}}Su.prototype.ValueTypeName="bool",Su.prototype.ValueBufferType=Array,Su.prototype.DefaultInterpolation=Vt,Su.prototype.InterpolantFactoryMethodLinear=void 0,Su.prototype.InterpolantFactoryMethodSmooth=void 0;class Mu extends bu{constructor(e,t,n,i){super(e,t,n,i)}}Mu.prototype.ValueTypeName="color";class wu extends bu{constructor(e,t,n,i){super(e,t,n,i)}}wu.prototype.ValueTypeName="number";class Tu extends gu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(i-t);let l=e*s;for(let c=l+s;l!==c;l+=4)Pi.slerpFlat(r,0,a,l-s,a,l,o);return r}}class Eu extends bu{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new Tu(this.times,this.values,this.getValueSize(),e)}}Eu.prototype.ValueTypeName="quaternion",Eu.prototype.InterpolantFactoryMethodSmooth=void 0;class Au extends bu{constructor(e,t,n){super(e,t,n)}}Au.prototype.ValueTypeName="string",Au.prototype.ValueBufferType=Array,Au.prototype.DefaultInterpolation=Vt,Au.prototype.InterpolantFactoryMethodLinear=void 0,Au.prototype.InterpolantFactoryMethodSmooth=void 0;class Cu extends bu{constructor(e,t,n,i){super(e,t,n,i)}}Cu.prototype.ValueTypeName="vector";class Ru{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yt;this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Si(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,s=n.length;a!==s;++a)t.push(Pu(n[a]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let r=0,a=n.length;r!==a;++r)t.push(bu.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,a=[];for(let s=0;s<r;s++){let e=[],o=[];e.push((s+r-1)%r,s,(s+1)%r),o.push(0,1,0);const l=du(e);e=pu(e,1,l),o=pu(o,1,l),i||0!==e[0]||(e.push(r),o.push(o[0])),a.push(new wu(".morphTargetInfluences["+t[s].name+"]",e,o).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,o=e.length;s<o;s++){const t=e[s],n=t.name.match(r);if(n&&n.length>1){const e=n[1];let r=i[e];r||(i[e]=r=[]),r.push(t)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],t,n));return a}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function Pu(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return wu;
2case"vector":case"vector2":case"vector3":case"vector4":return Cu;case"color":return Mu;case"quaternion":return Eu;case"bool":case"boolean":return Su;case"string":return Au}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];fu(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Iu={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(Lu(e)||(this.files[e]=t))},get:function(e){if(!1!==this.enabled&&!Lu(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function Lu(e){try{const t=e.slice(e.indexOf(":")+1);return"blob:"===new URL(t).protocol}catch(t){return!1}}class Nu{constructor(e,t,n){const i=this;let r,a=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,!1===a&&void 0!==i.onStart&&i.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==i.onProgress&&i.onProgress(e,s,o),s===o&&(a=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return e=e.normalize("NFC"),r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],i=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return i}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const Uu=new Nu;class Du{constructor(e){this.manager=void 0!==e?e:Uu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Du.DEFAULT_MATERIAL_NAME="__DEFAULT";const Ou={};class Fu extends Error{constructor(e,t){super(e),this.response=t}}class zu extends Du{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=Iu.get("file:".concat(e));if(void 0!==r)return this.manager.itemStart(e),void setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0);if(void 0!==Ou[e])return void Ou[e].push({onLoad:t,onProgress:n,onError:i});Ou[e]=[],Ou[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"===typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,o=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&di("FileLoader: HTTP Status 0 received."),"undefined"===typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=Ou[e],i=t.body.getReader(),r=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=r?parseInt(r):0,s=0!==a;let o=0;const l=new ReadableStream({start(e){!function t(){i.read().then(i=>{let r=i.done,l=i.value;if(r)e.close();else{o+=l.byteLength;const i=new ProgressEvent("progress",{lengthComputable:s,loaded:o,total:a});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(i)}e.enqueue(l),t()}},t=>{e.error(t)})}()}});return new Response(l)}throw new Fu('fetch for "'.concat(t.url,'" responded with ').concat(t.status,": ").concat(t.statusText),t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>(new DOMParser).parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(s),n=t&&t[1]?t[1].toLowerCase():void 0,i=new TextDecoder(n);return e.arrayBuffer().then(e=>i.decode(e))}}}).then(t=>{Iu.add("file:".concat(e),t);const n=Ou[e];delete Ou[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];i.onLoad&&i.onLoad(t)}}).catch(t=>{const n=Ou[e];if(void 0===n)throw this.manager.itemError(e),t;delete Ou[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];i.onError&&i.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class Bu extends Du{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new zu(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(a){i?i(a):pi(a),r.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Ru.parse(e[n]);t.push(i)}return t}}class ku extends Du{constructor(e){super(e)}load(e,t,n,i){const r=this,a=[],s=new ul,o=new zu(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;function c(c){o.load(e[c],function(e){const n=r.parse(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(s.minFilter=Ae),s.image=a,s.format=n.format,s.needsUpdate=!0,t&&t(s))},n,i)}if(Array.isArray(e))for(let u=0,h=e.length;u<h;++u)c(u);else o.load(e,function(e){const n=r.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)a[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),a[t].format=n.format,a[t].width=n.width,a[t].height=n.height}s.image=a}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=Ae),s.format=n.format,s.needsUpdate=!0,t&&t(s)},n,i);return s}}const Vu=new WeakMap;class Hu extends Du{constructor(e){super(e)}load(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Iu.get("image:".concat(e));if(void 0!==a){if(!0===a.complete)r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0);else{let e=Vu.get(a);void 0===e&&(e=[],Vu.set(a,e)),e.push({onLoad:t,onError:i})}return a}const s=ri("img");function o(){c(),t&&t(this);const n=Vu.get(this)||[];for(let e=0;e<n.length;e++){const t=n[e];t.onLoad&&t.onLoad(this)}Vu.delete(this),r.manager.itemEnd(e)}function l(t){c(),i&&i(t),Iu.remove("image:".concat(e));const n=Vu.get(this)||[];for(let e=0;e<n.length;e++){const i=n[e];i.onError&&i.onError(t)}Vu.delete(this),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),Iu.add("image:".concat(e),s),r.manager.itemStart(e),s.src=e,s}}class Gu extends Du{constructor(e){super(e)}load(e,t,n,i){const r=new pl;
2r.colorSpace=on;const a=new Hu(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let s=0;function o(n){a.load(e[n],function(e){r.images[n]=e,s++,6===s&&(r.needsUpdate=!0,t&&t(r))},void 0,i)}for(let l=0;l<e.length;++l)o(l);return r}}class Wu extends Du{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new Ks,s=new zu(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(r.withCredentials),s.load(e,function(e){let n;try{n=r.parse(e)}catch(s){return void(void 0!==i?i(s):pi(s))}r._applyTexData(a,n),t&&t(a,n)},n,i),a}createDataTexture(e){const t=new Ks;return this._applyTexData(t,this.parse(e)),t}_applyTexData(e,t){void 0!==t.image?e.image=t.image:void 0!==t.data&&(e.image.width=t.width,e.image.height=t.height,e.image.data=t.data),e.wrapS=void 0!==t.wrapS?t.wrapS:xe,e.wrapT=void 0!==t.wrapT?t.wrapT:xe,e.magFilter=void 0!==t.magFilter?t.magFilter:Ae,e.minFilter=void 0!==t.minFilter?t.minFilter:Ae,e.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.mipmaps&&(e.mipmaps=t.mipmaps,e.minFilter=Pe),1===t.mipmapCount&&(e.minFilter=Ae),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),e.needsUpdate=!0}}class ju extends Du{constructor(e){super(e)}load(e,t,n,i){const r=new Zi,a=new Hu(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)},n,i),r}}class Xu extends Pr{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.isLight=!0,this.type="Light",this.color=new zr(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class qu extends Xu{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Pr.DEFAULT_UP),this.updateMatrix(),this.groundColor=new zr(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const Yu=new ir,Zu=new Ii,Ju=new Ii;class Ku{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ri(512,512),this.mapType=Le,this.map=null,this.mapPass=null,this.matrix=new ir,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new _o,this._frameExtents=new Ri(1,1),this._viewportCount=1,this._viewports=[new Ji(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Zu.setFromMatrixPosition(e.matrixWorld),t.position.copy(Zu),Ju.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ju),t.updateMatrixWorld(),Yu.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yu,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===Jn||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Yu)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const Qu=new Ii,$u=new Pi,eh=new Ii;class th extends Pr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ir,this.projectionMatrix=new ir,this.projectionMatrixInverse=new ir,this.coordinateSystem=Zn,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(Qu,$u,eh),1===eh.x&&1===eh.y&&1===eh.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Qu,$u,eh.set(1,1,1)).invert()}updateWorldMatrix(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(Qu,$u,eh),1===eh.x&&1===eh.y&&1===eh.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Qu,$u,eh.set(1,1,1)).invert()}clone(){return(new this.constructor).copy(this)}}const nh=new Ii,ih=new Ri,rh=new Ri;class ah extends th{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*bi*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*xi*this.fov);return.5*this.getFilmHeight()/e}
vendor: 4,404 bytes, line 2
2getEffectiveFOV(){return 2*bi*Math.atan(Math.tan(.5*xi*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){nh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(nh.x,nh.y).multiplyScalar(-e/nh.z),nh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(nh.x,nh.y).multiplyScalar(-e/nh.z)}getViewSize(e,t){return this.getViewBounds(e,ih,rh),t.subVectors(rh,ih)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*xi*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}const s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class sh extends Ku{constructor(){super(new ah(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=2*bi*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class oh extends Xu{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Pr.DEFAULT_UP),this.updateMatrix(),this.target=new Pr,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new sh}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class lh extends Ku{constructor(){super(new ah(90,1,.5,500)),this.isPointLightShadow=!0}}class ch extends Xu{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new lh}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class uh extends th{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;
2super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){null===this.view&&(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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(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,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,s=i+t,o=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}class hh extends Ku{constructor(){super(new uh(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class dh extends Xu{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Pr.DEFAULT_UP),this.updateMatrix(),this.target=new Pr,this.shadow=new hh}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class ph extends Xu{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class fh extends Xu{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class mh{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Ii)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*i),t.addScaledVector(a[2],.488603*r),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*i*1.092548),t.addScaledVector(a[5],i*r*1.092548),t.addScaledVector(a[6],.315392*(3*r*r-1)),t.addScaledVector(a[7],n*r*1.092548),t.addScaledVector(a[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*i),t.addScaledVector(a[2],1.023328*r),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*i),t.addScaledVector(a[5],.858086*i*r),t.addScaledVector(a[6],.743125*r*r-.247708),t.addScaledVector(a[7],.858086*n*r),t.addScaledVector(a[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}static getBasisAt(e,t){const n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}class gh extends Xu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new mh;super(void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}const vh={};class _h extends Du{constructor(e){super(e),this.textures={}}load(e,t,n,i){const r=this,a=new zu(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(a){i?i(a):pi(a),r.manager.itemError(e)}},n,i)}parse(e){const t=this.createMaterialFromType(e.type);return t.fromJSON(e,this.textures),t}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return _h.createMaterialFromType(e)}static createMaterialFromType(e){const t=(0,r.A)({ShadowMaterial:qc,SpriteMaterial:es,RawShaderMaterial:eu,ShaderMaterial:$c,PointsMaterial:el,MeshPhysicalMaterial:nu,MeshStandardMaterial:tu,MeshPhongMaterial:iu,MeshToonMaterial:ru,MeshNormalMaterial:au,Me
2shLambertMaterial:su,MeshDepthMaterial:ou,MeshDistanceMaterial:lu,MeshBasicMaterial:Es,MeshMatcapMaterial:cu,LineDashedMaterial:uu,LineBasicMaterial:ko,Material:$a},vh)[e];let n;return void 0===t?(fi('MaterialLoader: Unknown material type "'.concat(e,'". Use .registerMaterial() before starting the deserialization process.')),n=new $a):n=new t,n}static registerMaterial(e,t){vh[e]=t}}class yh{static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!==typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class xh extends qa{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class bh extends Du{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new zu(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(a){i?i(a):pi(a),r.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(e,i){if(void 0!==t[i])return t[i];const r=e.interleavedBuffers[i],a=function(e,t){if(void 0!==n[t])return n[t];const i=e.arrayBuffers,r=i[t],a=new Uint32Array(r).buffer;return n[t]=a,a}(e,r.buffer),s=ni(r.type,a),o=new Ya(s,r.stride);return o.uuid=r.uuid,t[i]=o,o}const r=e.isInstancedBufferGeometry?new xh:new qa,a=e.data.index;if(void 0!==a){const e=ni(a.type,a.array);r.setIndex(new Ea(e,1))}const s=e.data.attributes;for(const u in s){const t=s[u];let n;if(t.isInterleavedBufferAttribute){const r=i(e.data,t.data);n=new Ja(r,t.itemSize,t.offset,t.normalized)}else{const e=ni(t.type,t.array);n=new(t.isInstancedBufferAttribute?to:Ea)(e,t.itemSize,t.normalized)}void 0!==t.name&&(n.name=t.name),void 0!==t.usage&&n.setUsage(t.usage),r.setAttribute(u,n)}const o=e.data.morphAttributes;if(o)for(const u in o){const t=o[u],n=[];for(let r=0,a=t.length;r<a;r++){const a=t[r];let s;if(a.isInterleavedBufferAttribute){const t=i(e.data,a.data);s=new Ja(t,a.itemSize,a.offset,a.normalized)}else{const e=ni(a.type,a.array);s=new Ea(e,a.itemSize,a.normalized)}void 0!==a.name&&(s.name=a.name),n.push(s)}r.morphAttributes[u]=n}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let u=0,h=l.length;u!==h;++u){const e=l[u];r.addGroup(e.start,e.count,e.materialIndex)}const c=e.data.boundingSphere;return void 0!==c&&(r.boundingSphere=(new Ba).fromJSON(c)),e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}}const Sh={};class Mh extends Du{constructor(e){super(e)}load(e,t,n,i){const r=this,a=""===this.path?yh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const s=new zu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){let a=null;try{a=JSON.parse(n)}catch(o){return void 0!==i&&i(o),void pi("ObjectLoader: Can't parse "+e+".",o.message)}const s=a.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())return void 0!==i&&i(new Error("THREE.ObjectLoader: Can't load "+e)),void pi("ObjectLoader: Can't load "+e);r.parse(a,t)},n,i)}async loadAsync(e,t){const n=""===this.path?yh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const i=new zu(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const r=await i.loadAsync(e,t);let a;try{a=JSON.parse(r)}catch(o){throw new Error("THREE.ObjectLoader: Can't parse "+e+". "+o.message)}const s=a.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(a)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),a=this.parseImages(e.images,function(){void 0!==t&&t(l)}),s=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,r,o,s,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),this.bindLightTargets(l),void 0!==t){let e=!1;for(const t in a)if(a[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),r=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,r),s=this.parseMaterials(e.materials,a),o=this.parseObject(e.object,i,s,a,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),this.bindLightTargets(o),o}static registerGeometry(e,t){Sh[e]=t}parseShapes(e){const t={};if(void 0!==e)for(let n=0,i=e.length;n<i;n++){const i=(new ec).fromJSON(e[n]);t[i.uuid]=i}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(e){e.isBone&&(i[e.uuid]=e)}),void 0!==e)for(let r=0,a=e.length;r<a;r++){const t=(new eo).fromJSON(e[r],i);n[t.uuid]=t}return n}parseGeometries(e,t){const n={};if(void 0!==e){const i=new bh;for(let r=0,a=e.length;r<a;r++){let a;const s=e[r];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(s);break;default:s.type in Xc?a=Xc[s.type].fromJSON(s,t):s.type in Sh?a=Sh[s.type].fromJSON(s,t):di('ObjectLoader: Unknown geometry type "'.concat(s.type,'". Use .registerGeometry() before starting the deserialization process.'))}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}}return n}parseMaterials(e,t){const n={},i={};if(void 0!==e){const r=new _h;r.setTextures(t);for(let t=0,a=e.length;t<a;t++){const a=e[t];void 0===n[a.uuid]&&(n[a.uuid]=r.parse(a)),i[a.uuid]=n[a.uuid]}}return i}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const i=e[n],r=Ru.parse(i);t[r.uuid]=r}return t}parseImages(e,t){const n=this,i={};let r;function a(e){if("string"===typeof e){const t=e;return function(e){return e=n.manager.resolveURL(e),n.manager.itemStart(e),r.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:ni(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new Nu(t);r=new Hu(n),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const n=e[t],r=n.url;if(Array.isArray(r)){const e=[];for(let t=0,n=r.length;t<n;t++){const n=a(r[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new Ks(n.data,n.width,n.height)))}i[n.uuid]=new ji(e)}else{const e=a(n.url);i[n.uuid]=new ji(e)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function r(e){if("string"===typeof e){const n=e,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await i.loadAsync(r)}return e.data?{data:ni(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){i=new Hu(this.manager),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const i=e[t],a=i.url;if(Array.isArray(a)){const e=[];for(let t=0,n=a.length;t<n;t++){const n=a[t],i=await r(n);null!==i&&(i instanceof HTMLImageElement?e.push(i):e.push(new Ks(i.data,i.width,i.height)))}n[i.uuid]=new ji(e)}else{const e=await r(i.url);n[i.uuid]=new ji(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"===typeof e?e:(di("ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const i={};if(void 0!==e)for(let r=0,a=e.length;r<a;r++){const a=e[r];void 0===a.image&&di('ObjectLoader: No "image" specified for',a.uuid),void 0===t[a.image]&&di("ObjectLoader: Undefined image",a.image);const s=t[a.image],o=s.data;let l;Array.isArray(o)?(l=new pl,6===o.length&&(l.needsUpdate=!0)):(l=o&&o.data?new Ks:new Zi,o&&(l.needsUpdate=!0)),l.source=s,l.uuid=a.uuid,void 0!==a.name&&(l.name=a.name),void 0!==a.mapping&&(l.mapping=n(a.mapping,wh)),void 0!==a.channel&&(l.channel=a.channel),void 0!==a.offset&&l.offset.fromArray(a.offset),void 0!==a.repeat&&l.repeat.fromArray(a.repeat),void 0!==a.center&&l.center.fromArray(a.center),void 0!==a.rotation&&(l.rotation=a.rotation),void 0!==a.wrap&&(l.wrapS=n(a.wrap[0],Th),l.wrapT=n(a.wrap[1],Th)),void 0!==a.format&&(l.format=a.format),void 0!==a.internalFormat&&(l.internalFormat=a.internalFormat),void 0!==a.type&&(l.type=a.type),void 0!==a.colorSpace&&(l.colorSpace
vendor: 4,427 bytes, line 2
2=a.colorSpace),void 0!==a.minFilter&&(l.minFilter=n(a.minFilter,Eh)),void 0!==a.magFilter&&(l.magFilter=n(a.magFilter,Eh)),void 0!==a.anisotropy&&(l.anisotropy=a.anisotropy),void 0!==a.flipY&&(l.flipY=a.flipY),void 0!==a.generateMipmaps&&(l.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(l.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(l.unpackAlignment=a.unpackAlignment),void 0!==a.compareFunction&&(l.compareFunction=a.compareFunction),void 0!==a.normalized&&(l.normalized=a.normalized),void 0!==a.userData&&(l.userData=a.userData),i[a.uuid]=l}return i}parseObject(e,t,n,i,a){let s,o,l;function c(e){return void 0===t[e]&&di("ObjectLoader: Undefined geometry",e),t[e]}function u(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let i=0,r=e.length;i<r;i++){const r=e[i];void 0===n[r]&&di("ObjectLoader: Undefined material",r),t.push(n[r])}return t}return void 0===n[e]&&di("ObjectLoader: Undefined material",e),n[e]}}function h(e){return void 0===i[e]&&di("ObjectLoader: Undefined texture",e),i[e]}switch(e.type){case"Scene":s=new Hr,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new zr(e.background):s.background=h(e.background)),void 0!==e.environment&&(s.environment=h(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Vr(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new kr(e.fog.color,e.fog.density)),""!==e.fog.name&&(s.fog.name=e.fog.name)),void 0!==e.backgroundBlurriness&&(s.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(s.backgroundIntensity=e.backgroundIntensity),void 0!==e.backgroundRotation&&s.backgroundRotation.fromArray(e.backgroundRotation),void 0!==e.environmentIntensity&&(s.environmentIntensity=e.environmentIntensity),void 0!==e.environmentRotation&&s.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":s=new ah(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new uh(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new ph(e.color,e.intensity);break;case"DirectionalLight":s=new dh(e.color,e.intensity),s.target=e.target||"";break;case"PointLight":s=new ch(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new fh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new oh(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),s.target=e.target||"";break;case"HemisphereLight":s=new qu(e.color,e.groundColor,e.intensity);break;case"LightProbe":const t=(new mh).fromArray(e.sh);s=new gh(t,e.intensity);break;case"SkinnedMesh":o=c(e.geometry),l=u(e.material),s=new Zs(o,l),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":o=c(e.geometry),l=u(e.material),s=new zs(o,l);break;case"InstancedMesh":o=c(e.geometry),l=u(e.material);const n=e.count,i=e.instanceMatrix,a=e.instanceColor;s=new co(o,l,n),s.instanceMatrix=new to(new Float32Array(i.array),16),void 0!==a&&(s.instanceColor=new to(new Float32Array(a.array),a.itemSize));break;case"BatchedMesh":o=c(e.geometry),l=u(e.material),s=new Bo(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,l),s.geometry=o,s.perObjectFrustumCulled=e.perObjectFrustumCulled,s.sortObjects=e.sortObjects,s._drawRanges=e.drawRanges,s._reservedRanges=e.reservedRanges,s._geometryInfo=e.geometryInfo.map(e=>{let t=null,n=null;return void 0!==e.boundingBox&&(t=(new ia).fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(n=(new Ba).fromJSON(e.boundingSphere)),(0,r.A)((0,r.A)({},e),{},{boundingBox:t,boundingSphere:n})}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=h(e.matricesTexture.uuid),s._indirectTexture=h(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(s._c
2olorsTexture=h(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(s.boundingSphere=(new Ba).fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(s.boundingBox=(new ia).fromJSON(e.boundingBox));break;case"LOD":s=new vs;break;case"Line":s=new Yo(c(e.geometry),u(e.material));break;case"LineLoop":s=new $o(c(e.geometry),u(e.material));break;case"LineSegments":s=new Qo(c(e.geometry),u(e.material));break;case"PointCloud":case"Points":s=new al(c(e.geometry),u(e.material));break;case"Sprite":s=new ps(u(e.material));break;case"Group":s=new Ir;break;case"Bone":s=new Js;break;default:s=new Pr}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.pivot&&(s.pivot=(new Ii).fromArray(e.pivot)),void 0!==e.morphTargetDictionary&&(s.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),void 0!==e.morphTargetInfluences&&(s.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(s.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.static&&(s.static=e.static),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const r=e.children;for(let e=0;e<r.length;e++)s.add(this.parseObject(r[e],t,n,i,a))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];s.animations.push(a[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],i=s.getObjectByProperty("uuid",n.object);void 0!==i&&s.addLevel(i,n.distance,n.hysteresis)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse(function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?di("ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,i=e.getObjectByProperty("uuid",n);t.target=void 0!==i?i:new Pr}})}}const wh={UVMapping:pe,CubeReflectionMapping:fe,CubeRefractionMapping:me,EquirectangularReflectionMapping:ge,EquirectangularRefractionMapping:ve,CubeUVReflectionMapping:_e},Th={RepeatWrapping:ye,ClampToEdgeWrapping:xe,MirroredRepeatWrapping:be},Eh={NearestFilter:Se,NearestMipmapNearestFilter:Me,NearestMipmapLinearFilter:Te,LinearFilter:Ae,LinearMipmapNearestFilter:Ce,LinearMipmapLinearFilter:Pe},Ah=new WeakMap;class Ch extends Du{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"===typeof createImageBitmap&&di("ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&di("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Iu.get("image-bitmap:".concat(e));if(void 0!==a)return r.manager.itemStart(e),a.then?void a.then(n=>{!0===Ah.has(a)?(i&&i(Ah.get(a)),r.manager.itemError(e),r.manager.itemEnd(e)):(t&&t(n),r.manager.itemEnd(e))}):void setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0);const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,s.signal="function"===typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const o=fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(n){Iu.add("image-bitmap:".concat(e),n),t&&t(n),r.manager.itemEnd(e)}).catch(function(t){i&&i(t),Ah.set(o,t),Iu.remove("image-bitmap:".concat(e)),r.manager.itemError(e),r.manager.itemEnd(e)});Iu.add("image-bitmap:".concat(e),o),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let Rh;class Ph{static getContext(){return void 0===Rh&&(Rh=new(window.AudioContext||window.webkitAudioContext)),Rh}static setContext(e){Rh=e}}class Ih extends Du{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new zu(this.manager);function s(t){i?i(t):pi(t),r.manager.itemError(e)}
2a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{const i=n.slice(0),a=Ph.getContext(),o=e+"#decode";r.manager.itemStart(o),a.decodeAudioData(i,function(e){t(e),r.manager.itemEnd(o)}).catch(function(e){s(e),r.manager.itemEnd(o)})}catch(i){s(i)}},n,i)}}const Lh=new ir,Nh=new ir,Uh=new ir;class Dh{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ah,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ah,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Uh.copy(e.projectionMatrix);const n=t.eyeSep/2,i=n*t.near/t.focus,r=t.near*Math.tan(xi*t.fov*.5)/t.zoom;let a,s;Nh.elements[12]=-n,Lh.elements[12]=n,a=-r*t.aspect+i,s=r*t.aspect+i,Uh.elements[0]=2*t.near/(s-a),Uh.elements[8]=(s+a)/(s-a),this.cameraL.projectionMatrix.copy(Uh),a=-r*t.aspect-i,s=r*t.aspect-i,Uh.elements[0]=2*t.near/(s-a),Uh.elements[8]=(s+a)/(s-a),this.cameraR.projectionMatrix.copy(Uh)}this.cameraL.matrix.copy(e.matrixWorld).multiply(Nh),this.cameraL.matrixWorldNeedsUpdate=!0,this.cameraR.matrix.copy(e.matrixWorld).multiply(Lh),this.cameraR.matrixWorldNeedsUpdate=!0}}const Oh=-90;class Fh extends Pr{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ah(Oh,1,e,t);i.layers=this.layers,this.add(i);const r=new ah(Oh,1,e,t);r.layers=this.layers,this.add(r);const a=new ah(Oh,1,e,t);a.layers=this.layers,this.add(a);const s=new ah(Oh,1,e,t);s.layers=this.layers,this.add(s);const o=new ah(Oh,1,e,t);o.layers=this.layers,this.add(o);const l=new ah(Oh,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),n=(0,i.A)(t,6),r=n[0],a=n[1],s=n[2],o=n[3],l=n[4],c=n[5];for(const i of t)this.remove(i);if(e===Zn)r.up.set(0,1,0),r.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else{if(e!==Jn)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);r.up.set(0,-1,0),r.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1)}for(const i of t)this.add(i),i.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,r=this.activeMipmapLevel;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const a=(0,i.A)(this.children,6),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4],h=a[5],d=e.getRenderTarget(),p=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let v=!1;v=!0===e.isWebGLRenderer?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),v&&!1===e.autoClear&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,1,r),v&&!1===e.autoClear&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,2,r),v&&!1===e.autoClear&&e.clearDepth(),e.render(t,l),e.setRenderTarget(n,3,r),v&&!1===e.autoClear&&e.clearDepth(),e.render(t,c),e.setRenderTarget(n,4,r),v&&!1===e.autoClear&&e.clearDepth(),e.render(t,u),n.texture.generateMipmaps=g,e.setRenderTarget(n,5,r),v&&!1===e.autoClear&&e.clearDepth(),e.render(t,h),e.setRenderTarget(d,p,f),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class zh extends ah{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Bh{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,void 0!==e.hidden&&(this._pageVisibilityHandler=kh.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==e?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function kh(){!1===this._document.hidden&&this.reset()}const Vh=new Ii,Hh=new Pi,Gh=new Ii,Wh=new Ii,jh=new Ii;class Xh extends Pr{constructor(){super(),this.type="AudioListener",this.context=Ph.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new Bh}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this._timer.update(
vendor: 9,518 bytes, line 2
2);const t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(Vh,Hh,Gh),Wh.set(0,0,-1).applyQuaternion(Hh),jh.set(0,1,0).applyQuaternion(Hh),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Vh.x,e),t.positionY.linearRampToValueAtTime(Vh.y,e),t.positionZ.linearRampToValueAtTime(Vh.z,e),t.forwardX.linearRampToValueAtTime(Wh.x,e),t.forwardY.linearRampToValueAtTime(Wh.y,e),t.forwardZ.linearRampToValueAtTime(Wh.z,e),t.upX.linearRampToValueAtTime(jh.x,e),t.upY.linearRampToValueAtTime(jh.y,e),t.upZ.linearRampToValueAtTime(jh.z,e)}else t.setPosition(Vh.x,Vh.y,Vh.z),t.setOrientation(Wh.x,Wh.y,Wh.z,jh.x,jh.y,jh.z)}}class qh extends Pr{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void di("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void di("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;di("Audio: this Audio has no playback control.")}stop(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this;di("Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;di("Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return!1===this.hasPlaybackControl?(di("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;di("Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),"buffer"!==e.sourceType?(di("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const Yh=new Ii,Zh=new Pi,Jh=new Ii,Kh=new Ii;class Qh extends qh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Yh,Zh,Jh),Kh.set(0,0,1).applyQuaternion(Zh);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Yh.x,e),t.positionY.linearRampToValueAtTime(Yh.y,e),t.positionZ.linearRampToValueAtTime(Yh.z,e),t.orientationX.linearRampToValueAtTime(Kh.x,e),t.orientationY.linearRampToValueAtTime(Kh.y,e),t.orientationZ.linearRampToValueAtTime(Kh.z,e)}else t.setPosition(Yh.x,Yh.y,Yh.z),t.setOrientation(Kh.x,Kh.y,Kh.z)}}class $h{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class ed{constructor(e,t,n){let i,r,a;switch(this.binding=e,this.valueSize=n,t){case"quaternion":i=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,r=e*i+i;let a=this.cumulativeWeight;if(0===a){for(let e=0;e!==i;++e)n[r+e]=n[e];a=t}else{a+=t;const e=t/a;this._mixBufferRegion(n,r,0,e,i)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const e=t*this._origIndex;this._mixBufferRegion(n,i,e,1-r,t)}a>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let o=t,l=t+t;o!==l;++o)if(n[o]!==n[o+t]){s.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let r=n,a=i;r!==a;++r)t[r]=t[i+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;
vendor: 4,374 bytes, line 2
2for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,r){if(i>=.5)for(let a=0;a!==r;++a)e[t+a]=e[n+a]}_slerp(e,t,n,i){Pi.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,r){const a=this._workIndex*r;Pi.multiplyQuaternionsFlat(e,a,e,t,e,n),Pi.slerpFlat(e,t,e,t,e,a,i)}_lerp(e,t,n,i,r){const a=1-i;for(let s=0;s!==r;++s){const r=t+s;e[r]=e[r]*a+e[n+s]*i}}_lerpAdditive(e,t,n,i,r){for(let a=0;a!==r;++a){const r=t+a;e[r]=e[r]+e[n+a]*i}}}const td="\\[\\]\\.:\\/",nd=new RegExp("["+td+"]","g"),id="[^"+td+"]",rd="[^"+td.replace("\\.","")+"]",ad=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",id)+/(WCOD+)?/.source.replace("WCOD",rd)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",id)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",id)+"$"),sd=["material","materials","bones","map"];class od{constructor(e,t,n){this.path=t,this.parsedPath=n||od.parseTrackName(t),this.node=od.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new od.Composite(e,t,n):new od(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nd,"")}static parseTrackName(e){const t=ad.exec(e);if(null===t)throw new Error("THREE.PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=n.nodeName.substring(i+1);-1!==sd.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let i=0;i<e.length;i++){const r=e[i];if(r.name===t||r.uuid===t)return r;const a=n(r.children);if(a)return a}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let r=t.propertyIndex;if(e||(e=od.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void di("PropertyBinding: No target node found for track: "+this.path+".");if(n){let i=t.objectIndex;switch(n){case"materials":if(!e.material)return void pi("PropertyBinding: Can not bind to material as no
2de does not have a material.",this);if(!e.material.materials)return void pi("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void pi("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===i){i=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void pi("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void pi("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void pi("PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==i){if(void 0===e[i])return void pi("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[i]}}const a=e[i];if(void 0===a){return void pi("PropertyBinding: Trying to update property for track: "+t.nodeName+"."+i+" but it wasn't found.",e)}let s=this.Versioning.None;this.targetObject=e,!0===e.isMaterial?s=this.Versioning.NeedsUpdate:!0===e.isObject3D&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void pi("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void pi("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}od.Composite=class{constructor(e,t,n){const i=n||od.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},od.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},od.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},od.prototype.GetterByBindingType=[od.prototype._getValue_direct,od.prototype._getValue_array,od.prototype._getValue_arrayElement,od.prototype._getValue_toArray],od.prototype.SetterByBindingTypeAndVersioning=[[od.prototype._setValue_direct,od.prototype._setValue_direct_setNeedsUpdate,od.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[od.prototype._setValue_array,od.prototype._setValue_array_setNeedsUpdate,od.prototype._setValue_array_setMatrixWorldNeedsUpdate],[od.prototype._setValue_arrayElement,od.prototype._setValue_arrayElement_setNeedsUpdate,od.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[od.prototype._setValue_fromArray,od.prototype._setValue_fromArray_setNeedsUpdate,od.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class ld{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Si(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,a=r.length;let s,o=e.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],h=u.uuid;let d=t[h];if(void 0===d){d=o++,t[h]=d,e.push(u);for(let e=0,t=a;e!==t;++e)r[e].push(new od(u,n[e],i[e]))}else if(d<l){s=e[d];const o=--l,c=e[o];t[c.uuid]=d,e[d]=c,t[h]=o,e[o]=u;for(let e=0,t=a;e!==t;++e){const t=r[e],a=t[o];let s=t[d];t[d]=a,void 0===s&&(s=new od(u,n[e],i[e])),t[o]=s}}else e[d]!==s&&pi("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastru
2cture when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let a=0,s=arguments.length;a!==s;++a){const s=arguments[a],o=s.uuid,l=t[o];if(void 0!==l&&l>=r){const a=r++,c=e[a];t[c.uuid]=l,e[l]=c,t[o]=a,e[a]=s;for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[a],r=t[l];t[l]=i,t[a]=r}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s].uuid,l=t[o];if(void 0!==l)if(delete t[o],l<r){const s=--r,o=e[s],c=--a,u=e[c];t[o.uuid]=l,e[l]=o,t[u.uuid]=s,e[s]=u,e.pop();for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[s],r=t[c];t[l]=i,t[s]=r,t.pop()}}else{const r=--a,s=e[r];r>0&&(t[s.uuid]=l),e[l]=s,e.pop();for(let e=0,t=i;e!==t;++e){const t=n[e];t[l]=t[r],t.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const r=this._bindings;if(void 0!==i)return r[i];const a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,u=new Array(l);i=r.length,n[e]=i,a.push(e),s.push(t),r.push(u);for(let h=c,d=o.length;h!==d;++h){const n=o[h];u[h]=new od(n,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const i=this._paths,r=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=n,a[n]=o,a.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}}class cd{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.blendMode;this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const r=t.tracks,a=r.length,s=new Array(a),o={endingStart:jt,endingEnd:jt};for(let l=0;l!==a;++l){const e=r[l].createInterpolant(null);s[l]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._restoreTimeScale=null,this._weightInterpolant=null,this.loop=Bt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.fadeOut(t),this.fadeIn(t),!0===n){const n=this._clip.duration,i=e._clip.duration,r=i/n,a=n/i;e._restoreTimeScale=e.timeScale,this._restoreTimeScale=this.timeScale,e.warp(1,r,t),this.warp(a,1,t)}return this}crossFadeTo(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,r=i.time,a=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const o=s.parameterPositions,l=s.sampleValues;return o[0]=r,o[1]=r+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this._restoreTimeScale=null,this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);const r=this._startTime;if(null!==r){const i=(e-r)*n;i<0||0===n?t=0:(this._startTime=null,t=n*i)}t*=this._updateTimeScale(e);const a=this._updateTime(t),s=this._updateWeight(e);if(s>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Zt)for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulateAdditive(s);else for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulate(i,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(0===t?this.paused=!0:(null!==this._restoreTimeScale&&(t=this._restoreTimeScale),this.timeScale=t),this.stopWarping())}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,r=this._loopCount;const a=n===kt;if(0===e)return-1===r?i:a&&1===(1&r)?t-i:i;if(n===zt){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i>=t||i<0){const n=Math.floor(i/t);i-=t*n,r+=Math.abs(n);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this._loopCount=r,this.time=i;if(a&&1===(1&r))return t-i}return i}
vendor: 9,480 bytes, line 2
2_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Xt,i.endingEnd=Xt):(i.endingStart=e?this.zeroSlopeAtStart?Xt:jt:qt,i.endingEnd=t?this.zeroSlopeAtEnd?Xt:jt:qt)}_scheduleFading(e,t,n){const i=this._mixer,r=i.time;let a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);const s=a.parameterPositions,o=a.sampleValues;return s[0]=r,o[0]=t,s[1]=r+e,o[1]=n,this}}const ud=new Float32Array(1);class hd extends vi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,s=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let u=0;u!==r;++u){const e=i[u],r=e.name;let l=c[r];if(void 0!==l)++l.referenceCount,a[u]=l;else{if(l=a[u],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,o,r));continue}const i=t&&t._propertyBindings[u].binding.parsedPath;l=new ed(od.create(n,r,i),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,o,r),a[u]=l}s[u].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0===n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,r=this._actionsByClip;let a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{const t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,a=this._actionsByClip,s=a[r],o=s.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null;delete s.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete a[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const e=t[n];0===--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,r=this._bindings;let a=i[t];void 0===a&&(a={},i[t]=a),a[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,s=a[i],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete s[r],0===Object.keys(s).length&&delete a[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new _u(new Float32Array(2),new Float32Array(2),1,ud),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){const i=t||this._root,r=i.uuid;let a="string"===typeof e?Ru.findByName(i,e):e;const s=null!==a?a.uuid:e,o=this._actionsByClip[s];let l=null;if(void 0===n&&(n=null!==a?a.blendMode:Yt),void 0!==o){const e=o.actionByRoot[r];if(void 0!==e&&e.blendMode===n)return e;l=o.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;const c=new cd(this,a,t,n);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c}existingAction(e,t){const n=t||this._root,i=n.uuid,r="string"===typeof e?Ru.findByName(n,e):e,a=r?r.uuid:e,s=this._actionsByClip[a];return void 0!==s&&s.actionByRoot[i]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==n;++l){t[l]._update(i,e,r,a)}const s=this._bindings,o=this._nActiveBindings;for(let l=0;l!==o;++l)s[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){const e=r.knownActions;for(let n=0,i=e.length;n!==i;++n){const i=e[n];this._deactivateAction(i);const r=i._cacheIndex,a=t[t.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,a._cacheIndex=r,t[r]=a,t.pop(),this._removeInactiveBindingsForAction(i)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const r in n){const e=n[r].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}const i=this._bindingsByRootAndName[t];if(void 0!==i)for(const r in i){const e=i[r];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class dd extends Ki{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(e,t,i),this.isRenderTarget3D=!0,this.depth=n,this.texture=new tr(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class pd{constructor(e){this.value=e}clone(){return new pd(void 0===this.value.clone?this.value:this.value.clone())}}let fd=0;class md extends vi{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:fd++}),this.name="",this.usage=zn,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,i=t.length;n<i;n++){const e=Array.isArray(t[n])?t[n]:[t[n]];for(let t=0;t<e.length;t++)this.uniforms.push(e[t].clone())}return this}clone(){return(new this.constructor).copy(this)}}class gd extends Ya{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class vd{constructor(e,t,n,i,r){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=r,this.normalized=a,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const _d=new ir;class yd{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;this.ray=new Ts(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new fr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,t.projectionMatrix.elements[14]).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):pi("Raycaster:
2Unsupported camera type: "+t.type)}setFromXRController(e){return _d.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(_d),this}intersectObject(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return bd(e,this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),t.sort(xd),t}intersectObjects(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let i=0,r=e.length;i<r;i++)bd(e[i],this,n,t);return n.sort(xd),n}}function xd(e,t){return e.distance-t.distance}function bd(e,t,n,i){let r=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,n)&&(r=!1)}if(!0===r&&!0===i){const i=e.children;for(let e=0,r=i.length;e<r;e++)bd(i[e],t,n,!0)}}class Sd{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,di("Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}class Md{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Mi(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Mi(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class wd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}class Td{constructor(e,t,n,i){this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const r=this.elements;return r[0]=e,r[2]=t,r[1]=n,r[3]=i,this}}Td.prototype.isMatrix2=!0;const Ed=new Ri;class Ad{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ri(1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ri(-1/0,-1/0);this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Ed.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ed).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Cd=new Ii,Rd=new Ii,Pd=new Ii,Id=new Ii,Ld=new Ii,Nd=new Ii,Ud=new Ii;class Dd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii;this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Cd.subVectors(e,this.start),Rd.subVectors(this.end,this.start);const n=Rd.dot(Rd);if(0===n)return 0;let i=Rd.dot(Cd)/n;return t&&(i=Mi(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}distanceSqToLine3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nd,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ud;const i=1e-8*1e-8;let r,a;const s=this.start,o=e.start,l=this.end,c=e.end;Pd.subVectors(l,s),Id.subVectors(c,o),Ld.subVectors(s,o);const u=Pd.dot(Pd),h=Id.dot(Id),d=Id.dot(Ld);if(u<=i&&h<=i)return t.copy(s),n.copy(o),t.sub(n),t.dot(t);if(u<=i)r=0,a=d/h,a=Mi(a,0,1);else{const e=Pd.dot(Ld);if(h<=i)a=0,r=Mi(-e/u,0,1);else{const t=Pd.dot(Id),n=u*h-t*t;r=0!==n?Mi((t*d-e*h)/n,0,1):0,a=(t*r+d)/h,a<0?(a=0,r=Mi(-e/u,0,1)):a>1&&(a=1,r=Mi((t-e)/u,0,1))}}return t.copy(s).addScaledVector(Pd,r),n.copy(o).addScaledVector(Id,a),t.distanceToSquared(n)}
vendor: 10,354 bytes, line 2
2applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const Od=new Ii;class Fd extends Pr{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new qa,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,s=1,o=32;a<o;a++,s++){const e=a/o*Math.PI*2,t=s/o*Math.PI*2;i.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}n.setAttribute("position",new Da(i,3));const r=new ko({fog:!1,toneMapped:!1});this.cone=new Qo(n,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorldNeedsUpdate=!0;const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Od.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Od),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const zd=new Ii,Bd=new ir,kd=new ir;class Vd extends Qo{constructor(e){const t=Hd(e),n=new qa,i=[],r=[];for(let o=0;o<t.length;o++){const e=t[o];e.parent&&e.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(0,0,0),r.push(0,0,0))}n.setAttribute("position",new Da(i,3)),n.setAttribute("color",new Da(r,3));super(n,new ko({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const a=new zr(255),s=new zr(65280);this.setColors(a,s)}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");kd.copy(this.root.matrixWorld).invert();for(let r=0,a=0;r<t.length;r++){const e=t[r];e.parent&&e.parent.isBone&&(Bd.multiplyMatrices(kd,e.matrixWorld),zd.setFromMatrixPosition(Bd),i.setXYZ(a,zd.x,zd.y,zd.z),Bd.multiplyMatrices(kd,e.parent.matrixWorld),zd.setFromMatrixPosition(Bd),i.setXYZ(a+1,zd.x,zd.y,zd.z),a+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){const n=this.geometry.getAttribute("color");for(let i=0;i<n.count;i+=2)n.setXYZ(i,e.r,e.g,e.b),n.setXYZ(i+1,t.r,t.g,t.b);return n.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function Hd(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push(...Hd(e.children[n]));return t}class Gd extends zs{constructor(e,t,n){super(new Bc(t,4,2),new Es({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Wd=new Ii,jd=new zr,Xd=new zr;class qd extends Pr{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new Dc(t);i.rotateY(.5*Math.PI),this.material=new Es({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new Ea(a,3)),this.add(new zs(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");jd.copy(this.light.color),Xd.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const i=e<n/2?jd:Xd;t.setXYZ(e,i.r,i.g,i.b)}t.needsUpdate=!0}this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),e.lookAt(Wd.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Yd extends Qo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;n=new zr(n),i=new zr(i);const r=t/2,a=e/t,s=e/2,o=[],l=[];for(let u=0,h=0,d=-s;u<=t;u++,d+=a){o.push(-s,0,d,s,0,d),o.push(d,0,-s,d,0,s);const e=u===r?n:i;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const c=new qa;c.setAttribute("position",new Da(o,3)),c.setAttribute("color",new Da(l,3));super(c,new ko({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Zd extends Qo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;r=new zr(r),a=new zr(a);const s=[],o=[];if(t>1)for(let c=0;c<t;c++){const n=c/t*(2*Math.PI),i=Math.sin(n)*e,l=Math.cos(n)*e;s.push(0,0,0),s.push(i,0,l);const u=1&c?r:a;o.push(u.r,u.g,u.b),o.push(u.r,u.g,u.b)}for(let c=0;c<n;c++){const t=1&c?r:a,l=e-e/n*c;for(let e=0;e<i;e++){let n=e/i*(2*Math.PI),r=Math.sin(n)*l,a=Math.cos(n)*l;s.push(r,0,a),o.push(t.r,t.g,t.b),n=(e+1)/i*(2*Math.PI),r=Math.sin(n)*l,a=Math.cos(n)*l,s.push(r,0,a),o.push(t.r,t.g,t.b)}}const l=new qa;l.setAttribute("position",new Da(s,3)),l.setAttribute("color",new Da(o,3));super(l,new ko({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Jd=new Ii,Kd=new Ii,Qd=new Ii;class $d extends Pr{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===t&&(t=1);let i=new qa;i.setAttribute("position",new Da([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const r=new ko({fog:!1,toneMapped:!1});this.lightPlane=new Yo(i,r),this.add(this.lightPlane),i=new qa,i.setAttribute("position",new Da([0,0,0,0,0,1],3)),this.targetLine=new Yo(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Jd.setFromMatrixPosition(this.light.matrixWorld),Kd.setFromMatrixPosition(this.light.target.matrixWorld),Qd.subVectors(Kd,Jd),this.lightPlane.lookAt(Kd),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Kd),this.targetLine.scale.z=Qd.length()}}const ep=new Ii,tp=new th;class np extends Qo{constructor(e){const t=new qa,n=new ko({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],a={};function s(e,t){o(e),o(t)}function o(e){i.push(0,0,0),r.push(0,0,0),void 0===a[e]&&(a[e]=[]),a[e].push(i.length/3-1)}s("n1","n2"),s("n2","n4"),s("n4","n3"),s("n3","n1"),s("f1","f2"),s("f2","f4"),s("f4","f3"),s("f3","f1"),s("n1","f1"),s("n2","f2"),s("n3","f3"),s("n4","f4"),s("p","n1"),s("p","n2"),s("p","n3"),s("p","n4"),s("u1","u2"),s("u2","u3"),s("u3","u1"),s("c","t"),s("p","c"),s("cn1","cn2"),s("cn3","cn4"),s("cf1","cf2"),s("cf3","cf4"),t.setAttribute("position",new Da(i,3)),t.setAttribute("color",new Da(r,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const l=new zr(16755200),c=new zr(16711680),u=new zr(43775),h=new zr(16777215),d=new zr(3355443);this.setColors(l,c,u,h,d)}setColors(e,t,n,i,r){const a=this.geometry.getAttribute("color");return a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,n.r,n.g,n.b),a.setXYZ(33,n.r,n.g,n.b),a.setXYZ(34,n.r,n.g,n.b),a.setXYZ(35,n.r,n.g,n.b),a.setXYZ(36,n.r,n.g,n.b),a.setXYZ(37,n.r,n.g,n.b),a.setXYZ(38,i.r,i.g,i.b),a.setXYZ(39,i.r,i.g,i.b),a.setXYZ(40,r.r,r.g,r.b),a.setXYZ(41,r.r,r.g,r.b),a.setXYZ(42,r.r,r.g,r.b),a.setXYZ(43,r.r,r.g,r.b),a.setXYZ(44,r.r,r.g,r.b),a.setXYZ(45,r.r,r.g,r.b),a.setXYZ(46,r.r,r.g,r.b),a.setXYZ(47,r.r,r.g,r.b),a.setXYZ(48,r.r,r.g,r.b),a.setXYZ(49,r.r,r.g,r.b),a.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap;let n,i;if(tp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)n=1,i=0;else if(this.camera.coordinateSystem===Zn)n=-1,i=1;else{if(this.camera.coordinateSystem!==Jn)throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);n=0,i=1}ip("c",t,e,tp,0,0,n),ip("t",t,e,tp,0,0,i),ip("n1",t,e,tp,-1,-1,n),ip("n2",t,e,tp,1,-1,n),ip("n3",t,e,tp,-1,1,n),ip("n4",t,e,tp,1,1,n),ip("f1",t,e,tp,-1,-1,i),ip("f2",t,e,tp,1,-1,i),ip("f3",t,e,tp,-1,1,i),ip("f4",t,e,tp,1,1,i),ip("u1",t,e,tp,.7,1.1,n),ip("u2",t,e,tp,-.7,1.1,n),ip("u3",t,e,tp,0,2,n),ip("cf1",t,e,tp,-1,0,i),ip("cf2",t,e,tp,1,0,i),ip("cf3",t,e,tp,0,-1,i),ip("cf4",t,e,tp,
20,1,i),ip("cn1",t,e,tp,-1,0,n),ip("cn2",t,e,tp,1,0,n),ip("cn3",t,e,tp,0,-1,n),ip("cn4",t,e,tp,0,1,n),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ip(e,t,n,i,r,a,s){ep.set(r,a,s).unproject(i);const o=t[e];if(void 0!==o){const e=n.getAttribute("position");for(let t=0,n=o.length;t<n;t++)e.setXYZ(o[t],ep.x,ep.y,ep.z)}}const rp=new ia;class ap extends Qo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new qa;r.setIndex(new Ea(n,1)),r.setAttribute("position",new Ea(i,3)),super(r,new ko({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(void 0!==this.object&&rp.setFromObject(this.object),rp.isEmpty())return;const e=rp.min,t=rp.max,n=this.geometry.attributes.position,i=n.array;i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=e.x,i[4]=t.y,i[5]=t.z,i[6]=e.x,i[7]=e.y,i[8]=t.z,i[9]=t.x,i[10]=e.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=e.z,i[15]=e.x,i[16]=t.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=t.x,i[22]=e.y,i[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class sp extends Qo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new qa;i.setIndex(new Ea(n,1)),i.setAttribute("position",new Da([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new ko({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class op extends Yo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960,i=new qa;i.setAttribute("position",new Da([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new ko({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const r=new qa;r.setAttribute("position",new Da([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new zs(r,new Es({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const lp=new Ii;let cp,up;class hp extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ii(0,0,1),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii(0,0,0),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16776960,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2*n,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.2*r;super(),this.type="ArrowHelper",void 0===cp&&(cp=new qa,cp.setAttribute("position",new Da([0,0,0,0,1,0],3)),up=new Ml(.5,1,5,1),up.translate(0,-.5,0)),this.position.copy(t),this.line=new Yo(cp,new ko({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new zs(up,new Es({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{lp.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(lp,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class dp extends Qo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new qa;n.setAttribute("position",new Da(t,3)),n.setAttribute("color",new Da([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new ko({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}
2setColors(e,t,n){const i=new zr,r=this.geometry.attributes.color.array;return i.set(e),i.toArray(r,0),i.toArray(r,3),i.set(t),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class pp{constructor(){this.type="ShapePath",this.color=new zr,this.subPaths=[],this.currentPath=null,this.userData={}}moveTo(e,t){return this.currentPath=new $l,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(){function e(e,t){let n=!1;const i=t.length;for(let r=0,a=i-1;r<i;a=r++){const i=t[r],s=t[a];i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function t(t,n){const i=n.getCenter(new Ri);if(e(i,t))return i;const r=i.y,a=[],s=t.length;for(let e=0;e<s;e++){const n=t[e],i=t[(e+1)%s];if(n.y>r!==i.y>r){const e=n.x+(r-n.y)*(i.x-n.x)/(i.y-n.y);a.push(e)}}return a.length>1&&(a.sort((e,t)=>e-t),i.x=(a[0]+a[1])/2),i}let n=this.userData.style&&this.userData.style.fillRule||"nonzero";"nonzero"!==n&&"evenodd"!==n&&(di('Fill-rule "'+n+'" is not supported, falling back to "nonzero".'),n="nonzero");const i="nonzero"===n?e=>0!==e:e=>0!==(1&e),r=[];for(const o of this.subPaths){const e=o.getPoints();if(e.length<3)continue;const n=Cc.area(e);if(0===n)continue;const i=new Ad;for(let t=0;t<e.length;t++)i.expandByPoint(e[t]);r.push({subPath:o,points:e,boundingBox:i,interiorPoint:t(e,i),absArea:Math.abs(n),winding:n<0?-1:1,container:null,exclude:!1,role:null})}r.sort((e,t)=>t.absArea-e.absArea);for(let o=0;o<r.length;o++){const t=r[o];let n=0;for(let i=o-1;i>=0;i--){const a=r[i];if(a.boundingBox.containsBox(t.boundingBox)&&e(t.interiorPoint,a.points)){t.container=a.exclude?a.container:a,n=a.winding,t.winding+=n;break}}i(t.winding)===i(n)&&(t.exclude=!0)}for(const o of r)o.exclude||(o.role=null===o.container||"hole"===o.container.role?"outer":"hole");const a=[],s=new Map;for(const o of r){if(o.exclude||"outer"!==o.role)continue;const e=new ec;e.curves=o.subPath.curves,a.push(e),s.set(o,e)}for(const o of r){if(o.exclude||"hole"!==o.role)continue;const e=s.get(o.container);if(!e)continue;const t=new $l;t.curves=o.subPath.curves,e.holes.push(t)}return a}}class fp extends vi{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){void 0!==e?(null!==this.domElement&&this.disconnect(),this.domElement=e):di("Controls: connect() now requires an element.")}disconnect(){}dispose(){}update(){}}function mp(e,t,n,i){const r=function(e){switch(e){case Le:case Ne:return{byteLength:1,components:1};case De:case Ue:case Be:return{byteLength:2,components:1};case ke:case Ve:return{byteLength:2,components:4};case Fe:case Oe:case ze:return{byteLength:4,components:1};case Ge:case We:return{byteLength:4,components:3}}throw new Error("THREE.TextureUtils: Unknown texture type ".concat(e,"."))}(i);switch(n){case je:return e*t;case Je:case Ke:return e*t/r.components*r.byteLength;case Qe:case $e:return e*t*2/r.components*r.byteLength;case Xe:return e*t*3/r.components*r.byteLength;case qe:case tt:return e*t*4/r.components*r.byteLength;case nt:case it:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case rt:case at:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case ot:case ct:return Math.max(e,16)*Math.max(t,8)/4;case st:case lt:return Math.max(e,8)*Math.max(t,8)/2;case ut:case ht:case pt:case ft:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case dt:case mt:case gt:case vt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case _t:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case yt:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case xt:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case bt:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case St:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Mt:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case wt:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case Tt:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Et:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case At:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case Ct:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Rt:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Pt:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case It:case Lt:case Nt:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Ut:case Dt:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Ot:case Ft:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error("Unable to determine texture byte length for ".concat(n," format."))}class gp{static contain(e,t){return function(e,t){const n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}(e,t)}static cover(e,t){return function(e,t){const n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}(e,t)}static fill(e){return function(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}(e)}static getByteLength(e,t,n,i){return mp(e,t,n,i)}}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:a}})),"undefined"!==typeof window&&(window.__THREE__?di("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=a)},408(e,t,n){n.r(t),n.d(t,{ACESFilmicToneMapping:()=>i.FV,AddEquation:()=>i.gO9,AddOperation:()=>i.XrR,AdditiveAnimationBlendMode:()=>i.DAe,AdditiveBlending:()=>i.EZo,AgXToneMapping:()=>
2i.LAk,AlphaFormat:()=>i.wrO,AlwaysCompare:()=>i.FFZ,AlwaysDepth:()=>i.lGu,AlwaysStencilFunc:()=>i.sKt,AmbientLight:()=>i.$p8,AnimationAction:()=>i.pPE,AnimationClip:()=>i.tz3,AnimationLoader:()=>i.kEx,AnimationMixer:()=>i.Iw4,AnimationObjectGroup:()=>i.P5j,AnimationUtils:()=>i.AKb,ArcCurve:()=>i.ibB,ArrayCamera:()=>i.nZQ,ArrowHelper:()=>i.E0M,AttachedBindMode:()=>i.BER,Audio:()=>i.fP5,AudioAnalyser:()=>i.CwR,AudioContext:()=>i.UtX,AudioListener:()=>i.Pf$,AudioLoader:()=>i.Am1,AxesHelper:()=>i.IzY,BackSide:()=>i.hsX,BasicDepthPacking:()=>i.Rkk,BasicShadowMap:()=>i.bTm,BatchedMesh:()=>i.$Ed,BezierInterpolant:()=>i.Y1n,Bone:()=>i.$Kf,BooleanKeyframeTrack:()=>i.YOZ,Box2:()=>i.UtB,Box3:()=>i.NRn,Box3Helper:()=>i.BND,BoxGeometry:()=>i.iNn,BoxHelper:()=>i.IWo,BufferAttribute:()=>i.THS,BufferGeometry:()=>i.LoY,BufferGeometryLoader:()=>i.SUR,ByteType:()=>i.tJf,Cache:()=>i.l2R,Camera:()=>i.i7d,CameraHelper:()=>i.WTh,CanvasTexture:()=>i.GOR,CapsuleGeometry:()=>i.qU7,CatmullRomCurve3:()=>i.B6O,CineonToneMapping:()=>i.nNL,CircleGeometry:()=>i.tcD,ClampToEdgeWrapping:()=>i.ghU,Clock:()=>i.zD7,Color:()=>i.Q1f,ColorKeyframeTrack:()=>i.T6I,ColorManagement:()=>i.ppV,Compatibility:()=>i.x$Y,CompressedArrayTexture:()=>i.iOZ,CompressedCubeTexture:()=>i.c5h,CompressedTexture:()=>i.FvD,CompressedTextureLoader:()=>i.YRT,ConeGeometry:()=>i.qFE,ConstantAlphaFactor:()=>i.e0p,ConstantColorFactor:()=>i.RrE,Controls:()=>i.H2z,CubeCamera:()=>i.F1T,CubeDepthTexture:()=>i.Gc6,CubeReflectionMapping:()=>i.hy7,CubeRefractionMapping:()=>i.xFO,CubeTexture:()=>i.b4q,CubeTextureLoader:()=>i.ScU,CubeUVReflectionMapping:()=>i.Om,CubicBezierCurve:()=>i.Z0B,CubicBezierCurve3:()=>i.s0K,CubicInterpolant:()=>i.Pdi,CullFaceBack:()=>i.Vb5,CullFaceFront:()=>i.Jnc,CullFaceFrontBack:()=>i.ywQ,CullFaceNone:()=>i.WNZ,Curve:()=>i.Ipv,CurvePath:()=>i.jGm,CustomBlending:()=>i.bCz,CustomToneMapping:()=>i.g7M,CylinderGeometry:()=>i.Ho_,Cylindrical:()=>i.hjs,Data3DTexture:()=>i.dYF,DataArrayTexture:()=>i.rFo,DataTexture:()=>i.GYF,DataTextureLoader:()=>i.BRH,DataUtils:()=>i.GxU,DecrementStencilOp:()=>i.ROr,DecrementWrapStencilOp:()=>i.fJr,DefaultLoadingManager:()=>i.h_9,DepthFormat:()=>i.zdS,DepthStencilFormat:()=>i.dcC,DepthTexture:()=>i.VCu,DetachedBindMode:()=>i.Fvi,DirectionalLight:()=>i.ZyN,DirectionalLightHelper:()=>i.PFK,DiscreteInterpolant:()=>i.Yhb,DodecahedronGeometry:()=>i.nEu,DoubleSide:()=>i.$EB,DstAlphaFactor:()=>i.hdd,DstColorFactor:()=>i.wn6,DynamicCopyUsage:()=>i.MOq,DynamicDrawUsage:()=>i.Vnu,DynamicReadUsage:()=>i.hIf,EdgesGeometry:()=>i.TDQ,EllipseCurve:()=>i.S20,EqualCompare:()=>i.kO0,EqualDepth:()=>i.U3G,EqualStencilFunc:()=>i.jsO,EquirectangularReflectionMapping:()=>i.wfO,EquirectangularRefractionMapping:()=>i.uV5,Euler:()=>i.O9p,EventDispatcher:()=>i.Qev,ExternalTexture:()=>i.rjZ,ExtrudeGeometry:()=>i.QCA,FileLoader:()=>i.Y9S,Float16BufferAttribute:()=>i.Oax,Float32BufferAttribute:()=>i.qtW,FloatType:()=>i.RQf,Fog:()=>i.jUj,FogExp2:()=>i.cRK,FramebufferTexture:()=>i.Pem,FrontSide:()=>i.hB5,Frustum:()=>i.PPD,FrustumArray:()=>i.uf3,GLBufferAttribute:()=>i.oh6,GLSL1:()=>i.Wyr,GLSL3:()=>i.Wdf,GreaterCompare:()=>i.eoi,GreaterDepth:()=>i.K52,GreaterEqualCompare:()=>i.gWB,GreaterEqualDepth:()=>i.Gwm,GreaterEqualStencilFunc:()=>i.TMh,GreaterStencilFunc:()=>i.RcT,GridHelper:()=>i.fTw,Group:()=>i.YJl,HTMLTexture:()=>i.FtX,HalfFloatType:()=>i.ix0,HemisphereLight:()=>i.dth,HemisphereLightHelper:()=>i.R1W,IcosahedronGeometry:()=>i.WBB,ImageBitmapLoader:()=>i.Kzg,ImageLoader:()=>i.$NF,ImageUtils:()=>i.HgN,IncrementStencilOp:()=>i.HLH,IncrementWrapStencilOp:()=>i.Ru$,InstancedBufferAttribute:()=>i.uWO,InstancedBufferGeometry:()=>i.CmU,InstancedInterleavedBuffer:()=>i.LuO,InstancedMesh:()=>i.ZLX,Int16BufferAttribute:()=>i.Hrb,Int32BufferAttribute:()=>i.vmz,Int8BufferAttribute:()=>i.wvS,IntType:()=>i.Yuy,InterleavedBuffer:()=>i.eB$,InterleavedBufferAttribute:()=>i.eHs,Interpolant:()=>i.lGw,InterpolateBezier:()=>i.dJg,InterpolateDiscrete:()=>i.ljd,InterpolateLinear:()=>i.PJ3,InterpolateSmooth:()=>i.EQC,InterpolationSamplingMode:()=>i.TM5,InterpolationSamplingType:()=>i.G4u,InvertStencilOp:()=>i.oVO,KeepStencilOp:()=>i.VVr,KeyframeTrack:()=>i.UJ6,LOD:()=>i.UpK,LatheGeometry:()=>i.nzx,Layers:()=>i.zgK,LessCompare:()=>i.vim,LessDepth:()=>i.brA,LessEqualCompare:()=>i.TiK,LessEqualDepth:()=>i.xSv,LessEqualStencilFunc:()=>i.CR7,LessStencilFunc:()=>i.kYr,Light:()=>i.veJ,LightProbe:()=>i.FZo,Line:()=>i.N1A,Line3:()=>i.cZY,LineBasicMaterial:()=>i.mrM,LineCurve:()=>i.GZZ,LineCurve3:()=>
2i.VnP,LineDashedMaterial:()=>i.Fvt,LineLoop:()=>i.FCc,LineSegments:()=>i.DXC,LinearFilter:()=>i.k6q,LinearInterpolant:()=>i.ezk,LinearMipMapLinearFilter:()=>i.NZq,LinearMipMapNearestFilter:()=>i.iUH,LinearMipmapLinearFilter:()=>i.$_I,LinearMipmapNearestFilter:()=>i.kRr,LinearSRGBColorSpace:()=>i.Zr2,LinearToneMapping:()=>i.kyO,LinearTransfer:()=>i.VxR,Loader:()=>i.aHM,LoaderUtils:()=>i.r6x,LoadingManager:()=>i.KPJ,LoopOnce:()=>i.G3T,LoopPingPong:()=>i.lc7,LoopRepeat:()=>i.aMy,MOUSE:()=>i.kBv,Material:()=>i.imn,MaterialBlending:()=>i.pCc,MaterialLoader:()=>i.jut,MathUtils:()=>i.cj9,Matrix2:()=>i.k_V,Matrix3:()=>i.dwI,Matrix4:()=>i.kn4,MaxEquation:()=>i.$ei,Mesh:()=>i.eaF,MeshBasicMaterial:()=>i.V9B,MeshDepthMaterial:()=>i.CSG,MeshDistanceMaterial:()=>i.aVO,MeshLambertMaterial:()=>i.G_z,MeshMatcapMaterial:()=>i.FNr,MeshNormalMaterial:()=>i.qBx,MeshPhongMaterial:()=>i.tXL,MeshPhysicalMaterial:()=>i.uSd,MeshStandardMaterial:()=>i._4j,MeshToonMaterial:()=>i.Df,MinEquation:()=>i.znC,MirroredRepeatWrapping:()=>i.kTW,MixOperation:()=>i.KRh,MultiplyBlending:()=>i.EdD,MultiplyOperation:()=>i.caT,NearestFilter:()=>i.hxR,NearestMipMapLinearFilter:()=>i.a$r,NearestMipMapNearestFilter:()=>i.$O9,NearestMipmapLinearFilter:()=>i.Cfg,NearestMipmapNearestFilter:()=>i.pHI,NeutralToneMapping:()=>i.aJ8,NeverCompare:()=>i.amv,NeverDepth:()=>i.eHc,NeverStencilFunc:()=>i.HPb,NoBlending:()=>i.XIg,NoColorSpace:()=>i.jf0,NoNormalPacking:()=>i.AZd,NoToneMapping:()=>i.y_p,NormalAnimationBlendMode:()=>i.Ke9,NormalBlending:()=>i.NTi,NormalGAPacking:()=>i.pO5,NormalRGPacking:()=>i.IjV,NotEqualCompare:()=>i.jzd,NotEqualDepth:()=>i.bw0,NotEqualStencilFunc:()=>i.klZ,NumberKeyframeTrack:()=>i.Hit,Object3D:()=>i.B69,ObjectLoader:()=>i.XTe,ObjectSpaceNormalMap:()=>i.vyJ,OctahedronGeometry:()=>i.Ufg,OneFactor:()=>i.qad,OneMinusConstantAlphaFactor:()=>i.ov9,OneMinusConstantColorFactor:()=>i.$Yl,OneMinusDstAlphaFactor:()=>i.Nt7,OneMinusDstColorFactor:()=>i.aEY,OneMinusSrcAlphaFactor:()=>i.OuU,OneMinusSrcColorFactor:()=>
2i.LiQ,OrthographicCamera:()=>i.qUd,PCFShadowMap:()=>i.QP0,PCFSoftShadowMap:()=>i.Wk7,PMREMGenerator:()=>E,Path:()=>i.wAk,PerspectiveCamera:()=>i.ubm,Plane:()=>i.Zcv,PlaneGeometry:()=>i.bdM,PlaneHelper:()=>i.ZM4,PointLight:()=>i.HiM,PointLightHelper:()=>i.F1l,Points:()=>i.ONl,PointsMaterial:()=>i.BH$,PolarGridHelper:()=>i.hzE,PolyhedronGeometry:()=>i.pFK,PositionalAudio:()=>i.xZx,PropertyBinding:()=>i.Nwf,PropertyMixer:()=>i.N2s,QuadraticBezierCurve:()=>i.dAo,QuadraticBezierCurve3:()=>i.CV9,Quaternion:()=>i.PTz,QuaternionKeyframeTrack:()=>i.MBL,QuaternionLinearInterpolant:()=>i.GBG,R11_EAC_Format:()=>i.BVL,RED_GREEN_RGTC2_Format:()=>i.HO_,RED_RGTC1_Format:()=>i.Kef,REVISION:()=>i.sPf,RG11_EAC_Format:()=>i.OtU,RGBADepthPacking:()=>i.N5j,RGBAFormat:()=>i.GWd,RGBAIntegerFormat:()=>i.c90,RGBA_ASTC_10x10_Format:()=>i.y3Z,RGBA_ASTC_10x5_Format:()=>i.uB5,RGBA_ASTC_10x6_Format:()=>i.lyL,RGBA_ASTC_10x8_Format:()=>i.bC7,RGBA_ASTC_12x10_Format:()=>i.ojs,RGBA_ASTC_12x12_Format:()=>i.S$4,RGBA_ASTC_4x4_Format:()=>i.qa3,RGBA_ASTC_5x4_Format:()=>i.B_h,RGBA_ASTC_5x5_Format:()=>i.czI,RGBA_ASTC_6x5_Format:()=>i.rSH,RGBA_ASTC_6x6_Format:()=>i.Qrf,RGBA_ASTC_8x5_Format:()=>i.psI,RGBA_ASTC_8x6_Format:()=>i.a5J,RGBA_ASTC_8x8_Format:()=>i._QJ,RGBA_BPTC_Format:()=>i.Fn,RGBA_ETC2_EAC_Format:()=>i.KDk,RGBA_PVRTC_2BPPV1_Format:()=>i.pBf,RGBA_PVRTC_4BPPV1_Format:()=>i.HXV,RGBA_S3TC_DXT1_Format:()=>i.Nz6,RGBA_S3TC_DXT3_Format:()=>i.jR7,RGBA_S3TC_DXT5_Format:()=>i.BXX,RGBDepthPacking:()=>i.wTz,RGBFormat:()=>i.HIg,RGBIntegerFormat:()=>i.VGF,RGB_BPTC_SIGNED_Format:()=>i.H23,RGB_BPTC_UNSIGNED_Format:()=>i.W9U,RGB_ETC1_Format:()=>i.CVz,RGB_ETC2_Format:()=>i.Riy,RGB_PVRTC_2BPPV1_Format:()=>i.kTp,RGB_PVRTC_4BPPV1_Format:()=>i.k6Q,RGB_S3TC_DXT1_Format:()=>i.IE4,RGDepthPacking:()=>i.k8v,RGFormat:()=>i.paN,RGIntegerFormat:()=>i.TkQ,RawShaderMaterial:()=>i.D$Q,Ray:()=>i.RlV,Raycaster:()=>i.tBo,RectAreaLight:()=>i.ure,RedFormat:()=>i.VT0,RedIntegerFormat:()=>i.ZQM,ReinhardToneMapping:()=>i.Mjd,RenderTarget:()=>i.O0B,RenderTarget3D:()=>i.XMJ,RepeatWrapping:()=>i.GJx,ReplaceStencilOp:()=>i.kG0,ReverseSubtractEquation:()=>i.nST,RingGeometry:()=>i.rKP,SIGNED_R11_EAC_Format:()=>i.gZr,SIGNED_RED_GREEN_RGTC2_Format:()=>i.CWW,SIGNED_RED_RGTC1_Format:()=>i.XG_,SIGNED_RG11_EAC_Format:()=>i.jSS,SRGBColorSpace:()=>i.er$,SRGBTransfer:()=>i.KLL,Scene:()=>i.Z58,ShaderChunk:()=>s,ShaderLib:()=>l,ShaderMaterial:()=>i.BKk,ShadowMaterial:()=>i.q2,Shape:()=>i.ypk,ShapeGeometry:()=>i.MSw,ShapePath:()=>i.Ld9,ShapeUtils:()=>i.xJ6,ShortType:()=>i.fBL,Skeleton:()=>i.EAD,SkeletonHelper:()=>i._xc,SkinnedMesh:()=>i.I46,Source:()=>i.kLi,Sphere:()=>i.iyt,SphereGeometry:()=>i.Gu$,Spherical:()=>i.YHV,SphericalHarmonics3:()=>i.xOk,SplineCurve:()=>i.xfg,SpotLight:()=>i.nCl,SpotLightHelper:()=>i.Fpm,Sprite:()=>i.kxk,SpriteMaterial:()=>i.RoJ,SrcAlphaFactor:()=>i.ie2,SrcAlphaSaturateFactor:()=>i.hgQ,SrcColorFactor:()=>i.f4X,StaticCopyUsage:()=>i.Hrq,StaticDrawUsage:()=>i.agE,StaticReadUsage:()=>i.uXQ,StereoCamera:()=>i.keZ,StreamCopyUsage:()=>i.rOG,StreamDrawUsage:()=>i.Ktl,StreamReadUsage:()=>i.uov,StringKeyframeTrack:()=>i.hZF,SubtractEquation:()=>i.FXf,SubtractiveBlending:()=>i.Kwu,TOUCH:()=>i.wtR,TangentSpaceNormalMap:()=>i.bI3,TetrahedronGeometry:()=>i.Zpd,Texture:()=>i.gPd,TextureLoader:()=>i.Tap,TextureUtils:()=>i.Vwu,Timer:()=>i.M4G,TimestampQuery:()=>i.v9J,TorusGeometry:()=>i.O3Y,TorusKnotGeometry:()=>i.UPV,Triangle:()=>i.lMl,TriangleFanDrawMode:()=>i.rYR,TriangleStripDrawMode:()=>i.O49,TrianglesDrawMode:()=>i.RJ4,TubeGeometry:()=>i.j6,UVMapping:()=>i.UTZ,Uint16BufferAttribute:()=>i.A$4,Uint32BufferAttribute:()=>i.MW4,Uint8BufferAttribute:()=>i.baL,Uint8ClampedBufferAttribute:()=>i.fc6,Uniform:()=>i.nc$,UniformsGroup:()=>i.dzP,UniformsLib:()=>o,UniformsUtils:()=>i.LlO,UnsignedByteType:()=>i.OUM,UnsignedInt101111Type:()=>i.yT7,UnsignedInt248Type:()=>i.V3x,UnsignedInt5999Type:()=>i.Dmk,UnsignedIntType:()=>i.bkx,UnsignedShort4444Type:()=>i.Wew,UnsignedShort5551Type:()=>i.gJ2,UnsignedShortType:()=>i.cHt,VSMShadowMap:()=>i.RyA,Vector2:()=>i.I9Y,Vector3:()=>i.Pq0,Vector4:()=>i.IUQ,VectorKeyframeTrack:()=>i.RiT,VideoFrameTexture:()=>i.SYV,VideoTexture:()=>i.Nv2,WebGL3DRenderTarget:()=>i.ALV,WebGLArrayRenderTarget:()=>i.y9J,WebGLCoordinateSystem:()=>
vendor: 2,834 bytes, line 2
2i.TdN,WebGLCubeRenderTarget:()=>I,WebGLRenderTarget:()=>i.nWS,WebGLRenderer:()=>Zt,WebGLUtils:()=>kt,WebGPUCoordinateSystem:()=>i.i7u,WebXRController:()=>i.R3r,WireframeGeometry:()=>i.XJ7,WrapAroundEnding:()=>i.dhZ,ZeroCurvatureEnding:()=>i.rQf,ZeroFactor:()=>i.ojh,ZeroSlopeEnding:()=>i.h2z,ZeroStencilOp:()=>i.kqe,createCanvasElement:()=>i.lPF,error:()=>i.z3S,getConsoleFunction:()=>i.A76,log:()=>i.Rm2,setConsoleFunction:()=>i.UZu,warn:()=>i.R8M,warnOnce:()=>i.mcG});var i=n(435);function r(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==n&&null!==e&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){null!==e&&e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function a(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const r=t.get(n);if(void 0===r)t.set(n,function(t,n){const i=t.array,r=t.usage,a=i.byteLength,s=e.createBuffer();let o;if(e.bindBuffer(n,s),e.bufferData(n,i,r),t.onUploadCallback(),i instanceof Float32Array)o=e.FLOAT;else if("undefined"!==typeof Float16Array&&i instanceof Float16Array)o=e.HALF_FLOAT;else if(i instanceof Uint16Array)o=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=e.SHORT;else if(i instanceof Uint32Array)o=e.UNSIGNED_INT;else if(i instanceof Int32Array)o=e.INT;else if(i instanceof Int8Array)o=e.BYTE;else if(i instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=e.UNSIGNED_BYTE}return{buffer:s,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:a}}(n,i));else if(r.version<n.version){if(r.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,i){const r=n.array,a=n.updateRanges;if(e.bindBuffer(i,t),0===a.length)e.bufferSubData(i,0,r);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){const n=a[t],i=a[e];i.start<=n.start+n.count+1?n.count=Math.max(n.count,i.start+i.count-n.start):(++t,a[t]=i)}a.length=t+1;for(let n=0,s=a.length;n<s;n++){const t=a[n];e.bufferSubData(i,t.start*r.BYTES_PER_ELEMENT,r,t.start,t.count)}n.clearUpdateRanges()}n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}const s
vendor: 18,548 bytes, line 2
2={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec4 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec4 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec4( 1.0 );\n#endif\n#ifdef USE_COLOR_ALPHA\n\tvColor *= color;\n#elif defined( USE_COLOR )\n\tvColor.rgb *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.rgb *= instanceColor.rgb;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\n#define inverseTransformDirection transformDirectionByInverseViewMatrix\nvec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {\n\treturn normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );\n}\nvec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );
vendor: 132,683 bytes, line 2
2\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn 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 );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * reflectVec );\n\t\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t\t#endif\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n\t\t\treflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif\n#include <lightprobes_pars_fragment>",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid 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 ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = metalnessFactor;\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = vec3( 0.04 );\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tvec3 diffuseContribution;\n\tvec3 specularColor;\n\tvec3 specularColorBlended;\n\tfloat roughness;\n\tfloat metalness;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t\tvec3 iridescenceFresnelDielectric;\n\t\tvec3 iridescenceFresnelMetallic;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat 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 ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\treturn 0.5 / max( gv + gl, EPSILON );\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColorBlended;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat rInv = 1.0 / ( roughness + 0.1 );\n\tfloat a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n\tfloat b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n\tfloat DG = exp( a * dotNV + b );\n\treturn saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid 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 ) {\n#else\nvoid 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 ) {\n#endif\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n\tvec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n\tvec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n\tvec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n\tfloat Ess_V = dfgV.x + dfgV.y;\n\tfloat Ess_L = dfgL.x + dfgL.y;\n\tfloat Ems_V = 1.0 - Ess_V;\n\tfloat Ems_L = 1.0 - Ess_L;\n\tvec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n\tvec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n\tfloat compensationFactor = Ems_V * Ems_L;\n\tvec3 multiScatter = Fms * compensationFactor;\n\treturn singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid 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 ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t\t#ifdef USE_CLEARCOAT\n\t\t\tvec3 Ncc = geometryClearcoatNormal;\n\t\t\tvec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\n\t\t\tvec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\n\t\t\tvec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\n\t\t\tmat3 mInvClearcoat = mat3(\n\t\t\t\tvec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\n\t\t\t\tvec3( 0, 1, 0 ),\n\t\t\t\tvec3( t1Clearcoat.z, 0, t1Clearcoat.w )\n\t\t\t);\n\t\t\tvec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\n\t\t\tclearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\n\t\t#endif\n\t}\n#endif\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n \n \t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n \t\tfloat sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n \t\tfloat sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n \t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n \t\tirradiance *= sheenEnergyComp;\n \n \t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid 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 ) {\n\tvec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n\t#ifdef USE_SHEEN\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n\t\tdiffuse *= sheenEnergyComp;\n\t#endif\n\treflectedLight.indirectDiffuse += diffuse;\n}\nvoid 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) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n \t#endif\n\tvec3 singleScatteringDielectric = vec3( 0.0 );\n\tvec3 multiScatteringDielectric = vec3( 0.0 );\n\tvec3 singleScatteringMetallic = vec3( 0.0 );\n\tvec3 multiScatteringMetallic = vec3( 0.0 );\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n\t#endif\n\tvec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n\tvec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n\tvec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n\tvec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tvec3 indirectSpecular = radiance * singleScattering;\n\tindirectSpecular += multiScattering * cosineWeightedIrradiance;\n\tvec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n\t\tindirectSpecular *= sheenEnergyComp;\n\t\tindirectDiffuse *= sheenEnergyComp;\n\t#endif\n\treflectedLight.indirectSpecular += indirectSpecular;\n\treflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n\t\tmaterial.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#ifdef USE_LIGHT_PROBES_GRID\n\t\tvec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;\n\t\tvec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );\n\t\tirradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\t#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\n\t\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t\t#endif\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\t#if defined( LAMBERT ) || defined( PHONG )\n\t\tirradiance += iblIrradiance;\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",lightprobes_pars_fragment:"#ifdef USE_LIGHT_PROBES_GRID\nuniform highp sampler3D probesSH;\nuniform vec3 probesMin;\nuniform vec3 probesMax;\nuniform vec3 probesResolution;\nvec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {\n\tvec3 res = probesResolution;\n\tvec3 gridRange = probesMax - probesMin;\n\tvec3 resMinusOne = res - 1.0;\n\tvec3 probeSpacing = gridRange / resMinusOne;\n\tvec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;\n\tvec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );\n\tuvw = uvw * resMinusOne / res + 0.5 / res;\n\tfloat nz = res.z;\n\tfloat paddedSlices = nz + 2.0;\n\tfloat atlasDepth = 7.0 * paddedSlices;\n\tfloat uvZBase = uvw.z * nz + 1.0;\n\tvec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) );\n\tvec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) );\n\tvec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) );\n\tvec3 c0 = s0.xyz;\n\tvec3 c1 = vec3( s0.w, s1.xy );\n\tvec3 c2 = vec3( s1.zw, s2.x );\n\tvec3 c3 = s2.yzw;\n\tvec3 c4 = s3.xyz;\n\tvec3 c5 = vec3( s3.w, s4.xy );\n\tvec3 c6 = vec3( s4.zw, s5.x );\n\tvec3 c7 = s5.yzw;\n\tvec3 c8 = s6.xyz;\n\tfloat x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;\n\tvec3 result = c0 * 0.886227;\n\tresult += c1 * 2.0 * 0.511664 * y;\n\tresult += c2 * 2.0 * 0.511664 * z;\n\tresult += c3 * 2.0 * 0.511664 * x;\n\tresult += c4 * 2.0 * 0.429043 * x * y;\n\tresult += c5 * 2.0 * 0.429043 * y * z;\n\tresult += c6 * ( 0.743125 * z * z - 0.247708 );\n\tresult += c7 * 2.0 * 0.429043 * x * z;\n\tresult += c8 * 0.429043 * ( x * x - y * y );\n\treturn max( result, vec3( 0.0 ) );\n}\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#if defined( USE_PACKED_NORMALMAP )\n\t\tmapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );\n\t#endif\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t\t#ifdef FLIP_SIDED\n\t\t\tvBitangent = - vBitangent;\n\t\t#endif\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\n\t\treturn depth * ( far - near ) - far;\n\t#else\n\t\treturn depth * ( near - far ) - near;\n\t#endif\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\treturn ( near * far ) / ( ( near - far ) * depth - near );\n\t#else\n\t\treturn ( near * far ) / ( ( far - near ) * depth - far );\n\t#endif\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tuniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\t#else\n\t\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\t#endif\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tuniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\t#else\n\t\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\t#endif\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tuniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\t#elif defined( SHADOWMAP_TYPE_BASIC )\n\t\t\tuniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\t#endif\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\tfloat interleavedGradientNoise( vec2 position ) {\n\t\t\treturn fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n\t\t}\n\t\tvec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n\t\t\tconst float goldenAngle = 2.399963229728653;\n\t\t\tfloat r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n\t\t\tfloat theta = float( sampleIndex ) * goldenAngle + phi;\n\t\t\treturn vec2( cos( theta ), sin( theta ) ) * r;\n\t\t}\n\t#endif\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\tfloat getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\t\tfloat shadow = 1.0;\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\t\tshadowCoord.z += shadowBias;\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\t\tif ( frustumTest ) {\n\t\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\t\tfloat radius = shadowRadius * texelSize.x;\n\t\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n\t\t\t\t) * 0.2;\n\t\t\t}\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t\t}\n\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\t\tfloat shadow = 1.0;\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tshadowCoord.z -= shadowBias;\n\t\t\t#else\n\t\t\t\tshadowCoord.z += shadowBias;\n\t\t\t#endif\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\t\tif ( frustumTest ) {\n\t\t\t\tvec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n\t\t\t\tfloat mean = distribution.x;\n\t\t\t\tfloat variance = distribution.y * distribution.y;\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\t\tfloat hard_shadow = step( mean, shadowCoord.z );\n\t\t\t\t#else\n\t\t\t\t\tfloat hard_shadow = step( shadowCoord.z, mean );\n\t\t\t\t#endif\n\t\t\t\t\n\t\t\t\tif ( hard_shadow == 1.0 ) {\n\t\t\t\t\tshadow = 1.0;\n\t\t\t\t} else {\n\t\t\t\t\tvariance = max( variance, 0.0000001 );\n\t\t\t\t\tfloat d = shadowCoord.z - mean;\n\t\t\t\t\tfloat p_max = variance / ( variance + d * d );\n\t\t\t\t\tp_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n\t\t\t\t\tshadow = max( hard_shadow, p_max );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t\t}\n\t#else\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\t\tfloat shadow = 1.0;\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tshadowCoord.z -= shadowBias;\n\t\t\t#else\n\t\t\t\tshadowCoord.z += shadowBias;\n\t\t\t#endif\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\t\tif ( frustumTest ) {\n\t\t\t\tfloat depth = texture2D( shadowMap, shadowCoord.xy ).r;\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\t\tshadow = step( depth, shadowCoord.z );\n\t\t\t\t#else\n\t\t\t\t\tshadow = step( shadowCoord.z, depth );\n\t\t\t\t#endif\n\t\t\t}\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\tfloat getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tvec3 absVec = abs( lightToPosition );\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tfloat dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n\t\t\t\tdp -= shadowBias;\n\t\t\t#else\n\t\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n\t\t\t\tdp += shadowBias;\n\t\t\t#endif\n\t\t\tfloat texelSize = shadowRadius / shadowMapSize.x;\n\t\t\tvec3 absDir = abs( bd3D );\n\t\t\tvec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n\t\t\ttangent = normalize( cross( bd3D, tangent ) );\n\t\t\tvec3 bitangent = cross( bd3D, tangent );\n\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n\t\t\tvec2 sample0 = vogelDiskSample( 0, 5, phi );\n\t\t\tvec2 sample1 = vogelDiskSample( 1, 5, phi );\n\t\t\tvec2 sample2 = vogelDiskSample( 2, 5, phi );\n\t\t\tvec2 sample3 = vogelDiskSample( 3, 5, phi );\n\t\t\tvec2 sample4 = vogelDiskSample( 4, 5, phi );\n\t\t\tshadow = (\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\n\t\t\t) * 0.2;\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\t#elif defined( SHADOWMAP_TYPE_BASIC )\n\tfloat getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 absVec = abs( lightToPosition );\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tfloat depth = textureCube( shadowMap, bd3D ).r;\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tdepth = 1.0 - depth;\n\t\t\t#endif\n\t\t\tshadow = step( dp, depth );\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\t#endif\n\t#endif\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#ifdef HAS_NORMAL\n\t\tvec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );\n\t#else\n\t\tvec3 shadowWorldNormal = vec3( 0.0 );\n\t#endif\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = 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 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n\t#else\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n\t#endif\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distance_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n \n\t\toutgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\n \n \t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},
vendor: 7,918 bytes, line 2
2o={common:{diffuse:{value:new i.Q1f(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new i.dwI},alphaMap:{value:null},alphaMapTransform:{value:new i.dwI},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new i.dwI}},envmap:{envMap:{value:null},envMapRotation:{value:new i.dwI},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new i.dwI}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new i.dwI}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new i.dwI},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new i.dwI},normalScale:{value:new i.I9Y(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new i.dwI},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new i.dwI}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new i.dwI}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new i.dwI}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new i.Q1f(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new i.Pq0},probesMax:{value:new i.Pq0},probesResolution:{value:new i.Pq0}},points:{diffuse:{value:new i.Q1f(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new i.dwI},alphaTest:{value:0},uvTransform:{value:new i.dwI}},sprite:{diffuse:{value:new i.Q1f(16777215)},opacity:{value:1},center:{value:new i.I9Y(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new i.dwI},alphaMap:{value:null},alphaMapTransform:{value:new i.dwI},alphaTest:{value:0}}},l={basic:{uniforms:(0,i.Iit)([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.fog]),vertexShader:s.meshbasic_vert,fragmentShader:s.meshbasic_frag},lambert:{uniforms:(0,i.Iit)([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.fog,o.lights,{emissive:{value:new i.Q1f(0)},envMapIntensity:{value:1}}]),vertexShader:s.meshlambert_vert,fragmentShader:s.meshlambert_frag},phong:{uniforms:(0,i.Iit)([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.fog,o.lights,{emissive:{value:new i.Q1f(0)},specular:{value:new i.Q1f(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:s.meshphong_vert,fragmentShader:s.meshphong_frag},standard:{uniforms:(0,i.Iit)([o.common,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.roughnessmap,o.metalnessmap,o.fog,o.lights,{emissive:{value:new i.Q1f(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:s.meshphysical_vert,fragmentShader:s.meshphysical_frag},toon:{uniforms:(0,i.Iit)([o.common,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.gradientmap,o.fog,o.lights,{emissive:{value:new i.Q1f(0)}}]),vertexShader:s.meshtoon_vert,fragmentShader:s.meshtoon_frag},matcap:{uniforms:(0,i.Iit)([o.common,o.bumpmap,o.normalmap,o.displacementmap,o.fog,{matcap:{value:null}}]),vertexShader:s.meshmatcap_vert,fragmentShader:s.meshmatcap_frag},points:{uniforms:(0,i.Iit)([o.points,o.fog]),vertexShader:s.points_vert,fragmentShader:s.points_frag},dashed:{uniforms:(0,i.Iit)([o.common,o.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:s.linedashed_vert,fragmentShader:s.linedashed_frag},depth:{uniforms:(0,i.Iit)([o.common,o.displacementmap]),vertexShader:s.depth_vert,fragmentShader:s.depth_frag},normal:{uniforms:(0,i.Iit)([o.common,o.bumpmap,o.normalmap,o.displacementmap,{opacity:{value:1}}]),vertexShader:s.meshnormal_vert,fragmentShader:s.meshnormal_frag},sprite:{uniforms:(0,i.Iit)([o.sprite,o.fog]),vertexShader:s.sprite_vert,fragmentShader:s.sprite_frag},background:{uniforms:{uvTransform:{value:new i.dwI},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:s.background_vert,fragmentShader:s.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new i.dwI}},vertexShader:s.backgroundCube_vert,fragmentShader:s.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:s.cube_vert,fragmentShader:s.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:s.equirect_vert,fragmentShader:s.equirect_frag},distance:{uniforms:(0,i.Iit)([o.common,o.displacementmap,{referencePosition:{value:new i.Pq0},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:s.distance_vert,fragmentShader:s.distance_frag},shadow:{uniforms:(0,i.Iit)([o.lights,o.fog,{color:{value:new i.Q1f(0)},opacity:{value:1}}]),vertexShader:s.shadow_vert,fragmentShader:s.shadow_frag}};l.physical={uniforms:(0,i.Iit)([l.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new i.dwI},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new i.dwI},clearcoatNormalScale:{value:new i.I9Y(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new i.dwI},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new i.dwI},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new i.dwI},sheen:{value:0},sheenColor:{value:new i.Q1f(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new i.dwI},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new i.dwI},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new i.dwI},transmissionSamplerSize:{value:new i.I9Y},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new i.dwI},attenuationDistance:{value:0},attenuationColor:{value:new i.Q1f(0)},specularColor:{value:new i.Q1f(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new i.dwI},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new i.dwI},anisotropyVector:{value:new i.I9Y},anisotropyMap:{value:null},anisotropyMapTransform:{value:new i.dwI}}]),vertexShader:s.meshphysical_vert,fragmentShader:s.meshphysical_frag};const c={r:0,b:0,g:0},u=new i.kn4,h=new i.dwI;function d(e,t,n,r,a,s){const o=new i.Q1f(0);let d,p,f=!0===a?0:1,m=null,g=0,v=null;function _(e){let n=!0===e.isScene?e.background:null;if(n&&n.isTexture){const i=e.backgroundBlurriness>0;
vendor: 21,205 bytes, line 2
2n=t.get(n,i)}return n}function y(t,r){t.getRGB(c,(0,i._Ut)(e)),n.buffers.color.setClear(c.r,c.g,c.b,r,s)}return{getClearColor:function(){return o},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;o.set(e),f=t,y(o,f)},getClearAlpha:function(){return f},setClearAlpha:function(e){f=e,y(o,f)},render:function(t){let i=!1;const r=_(t);null===r?y(o,f):r&&r.isColor&&(y(r,1),i=!0);const a=e.xr.getEnvironmentBlendMode();"additive"===a?n.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===a&&n.buffers.color.setClear(0,0,0,0,s),(e.autoClear||i)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){const a=_(n);a&&(a.isCubeTexture||a.mapping===i.Om)?(void 0===p&&(p=new i.eaF(new i.iNn(1,1,1),new i.BKk({name:"BackgroundCubeMaterial",uniforms:(0,i.lxW)(l.backgroundCube.uniforms),vertexShader:l.backgroundCube.vertexShader,fragmentShader:l.backgroundCube.fragmentShader,side:i.hsX,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),p.material.uniforms.envMap.value=a,p.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(u.makeRotationFromEuler(n.backgroundRotation)).transpose(),a.isCubeTexture&&!1===a.isRenderTargetTexture&&p.material.uniforms.backgroundRotation.value.premultiply(h),p.material.toneMapped=i.ppV.getTransfer(a.colorSpace)!==i.KLL,m===a&&g===a.version&&v===e.toneMapping||(p.material.needsUpdate=!0,m=a,g=a.version,v=e.toneMapping),p.layers.enableAll(),t.unshift(p,p.geometry,p.material,0,0,null)):a&&a.isTexture&&(void 0===d&&(d=new i.eaF(new i.bdM(2,2),new i.BKk({name:"BackgroundMaterial",uniforms:(0,i.lxW)(l.background.uniforms),vertexShader:l.background.vertexShader,fragmentShader:l.background.fragmentShader,side:i.hB5,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=a,d.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,d.material.toneMapped=i.ppV.getTransfer(a.colorSpace)!==i.KLL,!0===a.matrixAutoUpdate&&a.updateMatrix(),d.material.uniforms.uvTransform.value.copy(a.matrix),m===a&&g===a.version&&v===e.toneMapping||(d.material.needsUpdate=!0,m=a,g=a.version,v=e.toneMapping),d.layers.enableAll(),t.unshift(d,d.geometry,d.material,0,0,null))},dispose:function(){void 0!==p&&(p.geometry.dispose(),p.material.dispose(),p=void 0),void 0!==d&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}}}function p(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},a=u(null);let s=a,o=!1;function l(t){return e.bindVertexArray(t)}function c(t){return e.deleteVertexArray(t)}function u(e){const t=[],i=[],r=[];for(let a=0;a<n;a++)t[a]=0,i[a]=0,r[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function h(){const e=s.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function d(e){p(e,0)}function p(t,n){const i=s.newAttributes,r=s.enabledAttributes,a=s.attributeDivisors;i[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),a[t]!==n&&(e.vertexAttribDivisor(t,n),a[t]=n)}function f(){const t=s.newAttributes,n=s.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function m(t,n,i,r,a,s,o){!0===o?e.vertexAttribIPointer(t,n,i,a,s):e.vertexAttribPointer(t,n,i,r,a,s)}function g(){v(),o=!0,s!==a&&(s=a,l(s.object))}function v(){a.geometry=null,a.program=null,a.wireframe=!1}return{setup:function(n,a,c,g,v){let _=!1;const y=function(t,n,i,a){const s=!0===a.wireframe;let o=r[n.id];void 0===o&&(o={},r[n.id]=o);const l=!0===t.isInstancedMesh?t.id:0;let c=o[l];void 0===c&&(c={},o[l]=c);let h=c[i.id];void 0===h&&(h={},c[i.id]=h);let d=h[s];void 0===d&&(d=u(e.createVertexArray()),h[s]=d);return d}(n,g,c,a);s!==y&&(s=y,l(s.object)),_=function(e,t,n,i){const r=s.attributes,a=t.attributes;let o=0;const l=n.getAttributes();for(const s in l){if(l[s].location>=0){const t=r[s];let n=a[s];if(void 0===n&&("instanceMatrix"===s&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===s&&e.instanceColor&&(n=e.instanceColor)),void 0===t)return!0;if(t.attribute!==n)return!0;if(n&&t.data!==n.data)return!0;o++}}return s.attributesNum!==o||s.index!==i}(n,g,c,v),_&&function(e,t,n,i){const r={},a=t.attributes;let o=0;const l=n.getAttributes();for(const s in l){if(l[s].location>=0){let t=a[s];void 0===t&&("instanceMatrix"===s&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===s&&e.instanceColor&&(t=e.instanceColor));const n={};n.attribute=t,t&&t.data&&(n.data=t.data),r[s]=n,o++}}s.attributes=r,s.attributesNum=o,s.index=i}(n,g,c,v),null!==v&&t.update(v,e.ELEMENT_ARRAY_BUFFER),(_||o)&&(o=!1,function(n,r,a,s){h();const o=s.attributes,l=a.getAttributes(),c=r.defaultAttributeValues;for(const u in l){const r=l[u];if(r.location>=0){let a=o[u];if(void 0===a&&("instanceMatrix"===u&&n.instanceMatrix&&(a=n.instanceMatrix),"instanceColor"===u&&n.instanceColor&&(a=n.instanceColor)),void 0!==a){const o=a.normalized,l=a.itemSize,c=t.get(a);if(void 0===c)continue;const u=c.buffer,h=c.type,f=c.bytesPerElement,g=h===e.INT||h===e.UNSIGNED_INT||a.gpuType===i.Yuy;if(a.isInterleavedBufferAttribute){const t=a.data,i=t.stride,c=a.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)p(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<r.locationSize;e++)m(r.location+e,l/r.locationSize,h,o,i*f,(c+l/r.locationSize*e)*f,g)}else{if(a.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)p(r.location+e,a.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=a.meshPerAttribute*a.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<r.locationSize;e++)m(r.location+e,l/r.locationSize,h,o,l*f,l/r.locationSize*e*f,g)}}else if(void 0!==c){const t=c[u];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}f()}(n,a,c,g),null!==v&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(v).buffer))},reset:g,resetDefaultState:v,dispose:function(){g();for(const e in r){const t=r[e];for(const e in t){const n=t[e];for(const e in n){const t=n[e];for(const e in t)c(t[e].object),delete t[e];delete n[e]}}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;const t=r[e.id];for(const n in t){const e=t[n];for(const t in e){const n=e[t];for(const e in n)c(n[e].object),delete n[e];delete e[t]}}delete r[e.id]},releaseStatesOfObject:function(e){for(const t in r){const n=r[t],i=!0===e.isInstancedMesh?e.id:0,a=n[i];if(void 0!==a){for(const e in a){const t=a[e];for(const e in t)c(t[e].object),delete t[e];delete a[e]}delete n[i],0===Object.keys(n).length&&delete r[t]}}},releaseStatesOfProgram:function(e){for(const t in r){const n=r[t];for(const t in n){const i=n[t];if(void 0===i[e.id])continue;const r=i[e.id];for(const e in r)c(r[e].object),delete r[e];delete i[e.id]}}},initAttributes:h,enableAttribute:d,disableUnusedAttributes:f}}function f(e,t,n){let i;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(t,r,a){0!==a&&(e.drawArraysInstanced(i,t,r,a),n.update(r,i,a))},this.renderMultiDraw=function(e,r,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,e,0,r,0,a);let s=0;for(let t=0;t<a;t++)s+=r[t];n.update(s,i,1)}}function m(e,t,n,r){let a;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==n.precision?n.precision:"highp";const l=s(o);l!==o&&((0,i.R8M)("WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const c=!0===n.logarithmicDepthBuffer,u=!0===n.reversedDepthBuffer&&t.has("EXT_clip_control");!0===n.reversedDepthBuffer&&!1===u&&(0,i.R8M)("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==a)return a;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");a=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else a=0;return a},getMaxPrecision:s,textureFormatReadable:function(t){return t===i.GWd||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const a=n===i.ix0&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==i.OUM&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==i.RQf&&!a)},precision:o,logarithmicDepthBuffer:c,reversedDepthBuffer:u,maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function g(e){const t=this;let n=null,r=0,a=!1,s=!1;const o=new i.Zcv,l=new i.dwI,c={value:null,needsUpdate:!1};function u(e,n,i,r){const a=null!==e?e.length:0;let s=null;if(0!==a){if(s=c.value,!0!==r||null===s){const t=i+4*a,r=n.matrixWorldInverse;l.getNormalMatrix(r),(null===s||s.length<t)&&(s=new Float32Array(t));for(let n=0,c=i;n!==a;++n,c+=4)o.copy(e[n]).applyMatrix4(r,l),o.normal.toArray(s,c),s[c+3]=o.constant}c.value=s,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,s}this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||a;return a=t,r=e.length,n},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(i,o,l){const h=i.clippingPlanes,d=i.clipIntersection,p=i.clipShadows,f=e.get(i);if(!a||null===h||0===h.length||s&&!p)s?u(null):function(){c.value!==n&&(c.value=n,c.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=s?0:r,t=4*e;let i=f.clippingState||null;c.value=i,i=u(h,o,t,l);for(let r=0;r!==t;++r)i[r]=n[r];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}h.set(-1,0,0,0,1,0,0,0,1);const v=[.125,.215,.35,.446,.526,.582],_=20,y=new i.qUd,x=new i.Q1f;let b=null,S=0,M=0,w=!1;const T=new i.Pq0;class E{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const a=r.size,s=void 0===a?256:a,o=r.position,l=void 0===o?T:o;b=this._renderer.getRenderTarget(),S=this._renderer.getActiveCubeFace(),M=this._renderer.getActiveMipmapLevel(),w=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,n,i,c,l),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=P(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=R(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._ggxMaterial&&this._ggxMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(b,S,M),this._renderer.xr.enabled=w,e.scissorTest=!1,C(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===i.hy7||e.mapping===i.xFO?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),b=this._renderer.getRenderTarget(),S=this._renderer.getActiveCubeFace(),M=this._renderer.getActiveMipmapLevel(),w=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:i.k6q,minFilter:i.k6q,generateMipmaps:!1,type:i.ix0,format:i.GWd,colorSpace:i.Zr2,depthBuffer:!1},r=A(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=A(e,t,n);const r=this._lodMax;var a=function(e){const t=[],n=[],r=[];let a=e;const s=e-4+1+v.length;for(let o=0;o<s;o++){const s=Math.pow(2,a);t.push(s);let l=1/s;o>e-4?l=v[o-e+4-1]:0===o&&(l=0),n.push(l);const c=1/(s-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],p=6,f=6,m=3,g=2,_=1,y=new Float32Array(m*f*p),x=new Float32Array(g*f*p),b=new Float32Array(_*f*p);for(let e=0;e<p;e++){const t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];y.set(i,m*f*e),x.set(d,g*f*e);const r=[e,e,e,e,e,e];b.set(r,_*f*e)}const S=new i.LoY;S.setAttribute("position",new i.THS(y,m)),S.setAttribute("uv",new i.THS(x,g)),S.setAttribute("faceIndex",new i.THS(b,_)),r.push(new i.eaF(S,null)),a>4&&a--}return{lodMeshes:r,sizeLods:t,sigmas:n}}(r);this._lodMeshes=a.lodMeshes,this._sizeLods=a.sizeLods,this._sigmas=a.sigmas,this._blurMaterial=function(e,t,n){const r=new Float32Array(_),a=new i.Pq0(0,1,0),s=new i.BKk({name:"SphericalGaussianBlur",defines:{n:_,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:"".concat(e,".0")},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:i.XIg,depthTest:!1,depthWrite:!1});return s}(r,e,t),this._ggxMaterial=function(e,t,n){const r=new i.BKk({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:"".concat(e,".0")},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:'\n\n\t\t\tprecision highp float;\n\t\t\tprecision highp int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform float roughness;\n\t\t\tuniform float mipInt;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\t#define PI 3.14159265359\n\n\t\t\t// Van der Corput radical inverse\n\t\t\tfloat radicalInverse_VdC(uint bits) {\n\t\t\t\tbits = (bits << 16u) | (bits >> 16u);\n\t\t\t\tbits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n\t\t\t\tbits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n\t\t\t\tbits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n\t\t\t\tbits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n\t\t\t\treturn float(bits) * 2.3283064365386963e-10; // / 0x100000000\n\t\t\t}\n\n\t\t\t// Hammersley sequence\n\t\t\tvec2 hammersley(uint i, uint N) {\n\t\t\t\treturn vec2(float(i) / float(N), radicalInverse_VdC(i));\n\t\t\t}\n\n\t\t\t// GGX VNDF importance sampling (Eric Heitz 2018)\n\t\t\t// "Sampling the GGX Distribution of Visible Normals"\n\t\t\t// https://jcgt.org/published/0007/04/01/\n\t\t\tvec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {\
2n\t\t\t\tfloat alpha = roughness * roughness;\n\n\t\t\t\t// Section 4.1: Orthonormal basis\n\t\t\t\tvec3 T1 = vec3(1.0, 0.0, 0.0);\n\t\t\t\tvec3 T2 = cross(V, T1);\n\n\t\t\t\t// Section 4.2: Parameterization of projected area\n\t\t\t\tfloat r = sqrt(Xi.x);\n\t\t\t\tfloat phi = 2.0 * PI * Xi.y;\n\t\t\t\tfloat t1 = r * cos(phi);\n\t\t\t\tfloat t2 = r * sin(phi);\n\t\t\t\tfloat s = 0.5 * (1.0 + V.z);\n\t\t\t\tt2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;\n\n\t\t\t\t// Section 4.3: Reprojection onto hemisphere\n\t\t\t\tvec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;\n\n\t\t\t\t// Section 3.4: Transform back to ellipsoid configuration\n\t\t\t\treturn normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\tvec3 N = normalize(vOutputDirection);\n\t\t\t\tvec3 V = N; // Assume view direction equals normal for pre-filtering\n\n\t\t\t\tvec3 prefilteredColor = vec3(0.0);\n\t\t\t\tfloat totalWeight = 0.0;\n\n\t\t\t\t// For very low roughness, just sample the environment directly\n\t\t\t\tif (roughness < 0.001) {\n\t\t\t\t\tgl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Tangent space basis for VNDF sampling\n\t\t\t\tvec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n\t\t\t\tvec3 tangent = normalize(cross(up, N));\n\t\t\t\tvec3 bitangent = cross(N, tangent);\n\n\t\t\t\tfor(uint i = 0u; i < uint(GGX_SAMPLES); i++) {\n\t\t\t\t\tvec2 Xi = hammersley(i, uint(GGX_SAMPLES));\n\n\t\t\t\t\t// For PMREM, V = N, so in tangent space V is always (0, 0, 1)\n\t\t\t\t\tvec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);\n\n\t\t\t\t\t// Transform H back to world space\n\t\t\t\t\tvec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);\n\t\t\t\t\tvec3 L = normalize(2.0 * dot(V, H) * H - V);\n\n\t\t\t\t\tfloat NdotL = max(dot(N, L), 0.0);\n\n\t\t\t\t\tif(NdotL > 0.0) {\n\t\t\t\t\t\t// Sample environment at fixed mip level\n\t\t\t\t\t\t// VNDF importance sampling handles the distribution filtering\n\t\t\t\t\t\tvec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);\n\n\t\t\t\t\t\t// Weight by NdotL for the split-sum approximation\n\t\t\t\t\t\t// VNDF PDF naturally accounts for the visible microfacet distribution\n\t\t\t\t\t\tprefilteredColor += sampleColor * NdotL;\n\t\t\t\t\t\ttotalWeight += NdotL;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (totalWeight > 0.0) {\n\t\t\t\t\tprefilteredColor = prefilteredColor / totalWeight;\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = vec4(prefilteredColor, 1.0);\n\t\t\t}\n\t\t',blending:i.XIg,depthTest:!1,depthWrite:!1});return r}(r,e,t)}return r}_compileMaterial(e){const t=new i.eaF(new i.LoY,e);this._renderer.compile(t,y)}_sceneToCubeUV(e,t,n,r,a){const s=new i.ubm(90,1,t,n),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],c=this._renderer,u=c.autoClear,h=c.toneMapping;c.getClearColor(x),c.toneMapping=i.y_p,c.autoClear=!1;c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new i.eaF(new i.iNn,new i.V9B({name:"PMREM.Backgroun
2d",side:i.hsX,depthWrite:!1,depthTest:!1})));const d=this._backgroundBox,p=d.material;let f=!1;const m=e.background;m?m.isColor&&(p.color.copy(m),e.background=null,f=!0):(p.color.copy(x),f=!0);for(let i=0;i<6;i++){const t=i%3;0===t?(s.up.set(0,o[i],0),s.position.set(a.x,a.y,a.z),s.lookAt(a.x+l[i],a.y,a.z)):1===t?(s.up.set(0,0,o[i]),s.position.set(a.x,a.y,a.z),s.lookAt(a.x,a.y+l[i],a.z)):(s.up.set(0,o[i],0),s.position.set(a.x,a.y,a.z),s.lookAt(a.x,a.y,a.z+l[i]));const n=this._cubeSize;C(r,t*n,i>2?n:0,n,n),c.setRenderTarget(r),f&&c.render(d,s),c.render(e,s)}c.toneMapping=h,c.autoClear=u,e.background=m}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===i.hy7||e.mapping===i.xFO;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=P()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=R());const a=r?this._cubemapMaterial:this._equirectMaterial,s=this._lodMeshes[0];s.material=a;a.uniforms.envMap.value=e;const o=this._cubeSize;C(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(s,y)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let r=1;r<i;r++)this._applyGGXFilter(e,r-1,r);t.autoClear=n}_applyGGXFilter(e,t,n){const i=this._renderer,r=this._pingPongRenderTarget,a=this._ggxMaterial,s=this._lodMeshes[n];s.material=a;const o=a.uniforms,l=n/(this._lodMeshes.length-1),c=t/(this._lodMeshes.length-1),u=Math.sqrt(l*l-c*c)*(0+1.25*l),h=this._lodMax,d=this._sizeLods[n],p=3*d*(n>h-4?n-h+4:0),f=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=u,o.mipInt.value=h-t,C(r,p,f,3*d,2*d),i.setRenderTarget(r),i.render(s,y),o.envMap.value=r.texture,o.roughness.value=0,o.mipInt.value=h-n,C(e,p,f,3*d,2*d),i.setRenderTarget(e),i.render(s,y)}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,r,a,s,o){const l=this._renderer,c=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&(0,i.z3S)("blur direction must be either latitudinal or longitudinal!");const u=this._lodMeshes[r];u.material=c;const h=c.uniforms,d=this._sizeLods[n]-1,p=isFinite(a)?Math.PI/(2*d):2*Math.PI/39,f=a/p,m=isFinite(a)?1+Math.floor(3*f):_;m>_&&(0,i.R8M)("sigmaRadians, ".concat(a,", is too large and will clip, as it requested ").concat(m," samples when the maximum is set to ").concat(_));const g=[];let v=0;for(let i=0;i<_;++i){const e=i/f,t=Math.exp(-e*e/2);g.push(t),0===i?v+=t:i<m&&(v+=2*t)}for(let i=0;i<g.length;i++)g[i]=g[i]/v;h.envMap.value=e.texture,h.samples.value=m,h.weights.value=g,h.latitudinal.value="latitudinal"===s,o&&(h.poleAxis.value=o);const x=this._lodMax;h.dTheta.value=p,h.mipInt.value=x-n;const b=this._sizeLods[r];C(t,3*b*(r>x-4?r-x+4:0),4*(this._cubeSize-b),3*b,2*b),l.setRenderTarget(t),l.render(u,y)}}function A(e,t,n){const r=new i.nWS(e,t,n);return r.texture.mapping=i.Om,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function C(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function R(){return new i.BKk({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );
2\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:i.XIg,depthTest:!1,depthWrite:!1})}function P(){return new i.BKk({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:i.XIg,depthTest:!1,depthWrite:!1})}class I extends i.nWS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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 i.b4q(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",a="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new i.iNn(5,5,5),o=new i.BKk({name:"CubemapFromEquirect",uniforms:(0,i.lxW)(n),vertexShader:r,fragmentShader:a,side:i.hsX,blending:i.XIg});o.uniforms.tEquirect.value=t;const l=new i.eaF(s,o),c=t.minFilter;t.minFilter===i.$_I&&(t.minFilter=i.k6q);return new i.F1T(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(r)}}function L(e){let t=new WeakMap,n=new WeakMap,r=null;function a(e,t){return t===i.wfO?e.mapping=i.hy7:t===i.uV5&&(e.mapping=i.xFO),e}function s(e){const n=e.target;n.removeEventListener("dispose",s);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}function o(e){const t=e.target;t.removeEventListener("dispose",o);const i=n.get(t);void 0!==i&&(n.delete(t),i.dispose())}return{get:function(l){return null===l||void 0===l?null:arguments.length>1&&void 0!==arguments[1]&&arguments[1]?function(t){if(t&&t.isTexture){const a=t.mapping,s=a===i.wfO||a===i.uV5,l=a===i.hy7||a===i.xFO;if(s||l){let i=n.get(t);const a=void 0!==i?i.texture.pmremVersion:0;if(t.isRenderTargetTexture&&t.pmremVersion!==a)return null===r&&(r=new E(e)),i=s?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(void 0!==i)return i.texture;{const a=t.image;return s&&a&&a.height>0||l&&a&&function(e){let t=0;const n=6;for(let i=0;i<n;i++)void 0!==e[i]&&t++;return t===n}(a)?(null===r&&(r=new E(e)),i=s?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener("dispose",o),i.texture):null}}}return t}(l):function(n){if(n&&n.isTexture){const r=n.mapping;if(r===i.wfO||r===i.uV5){if(t.has(n)){return a(t.get(n).texture,n.mapping)}{const i=n.image;if(i&&i.height>0){const r=new I(i.height);return r.fromEquirectangularTexture(e,n),t.set(n,r),n.addEventListener("dispose",s),a(r.texture,n.mapping)}return null}}}return n}(l)},dispose:function(){t=new WeakMap,n=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function N(e){const t={};
vendor: 12,044 bytes, line 2
2function n(n){if(void 0!==t[n])return t[n];const i=e.getExtension(n);return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){const t=n(e);return null===t&&(0,i.mcG)("WebGLRenderer: "+e+" extension not supported."),t}}}function U(e,t,n,r){const a={},s=new WeakMap;function o(e){const i=e.target;null!==i.index&&t.remove(i.index);for(const n in i.attributes)t.remove(i.attributes[n]);i.removeEventListener("dispose",o),delete a[i.id];const l=s.get(i);l&&(t.remove(l),s.delete(i)),r.releaseStatesOfGeometry(i),!0===i.isInstancedBufferGeometry&&delete i._maxInstanceCount,n.memory.geometries--}function l(e){const n=[],r=e.index,a=e.attributes.position;let o=0;if(void 0===a)return;if(null!==r){const e=r.array;o=r.version;for(let t=0,i=e.length;t<i;t+=3){const i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{const e=a.array;o=a.version;for(let t=0,i=e.length/3-1;t<i;t+=3){const e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}const l=new(a.count>=65535?i.MW4:i.A$4)(n,1);l.version=o;const c=s.get(e);c&&t.remove(c),s.set(e,l)}return{get:function(e,t){return!0===a[t.id]||(t.addEventListener("dispose",o),a[t.id]=!0,n.memory.geometries++),t},update:function(n){const i=n.attributes;for(const r in i)t.update(i[r],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&l(e)}else l(e);return s.get(e)}}}function D(e,t,n){let i,r,a;this.setMode=function(e){i=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,s){e.drawElements(i,s,r,t*a),n.update(s,i,1)},this.renderInstances=function(t,s,o){0!==o&&(e.drawElementsInstanced(i,s,r,t*a,o),n.update(s,i,o))},this.renderMultiDraw=function(e,a,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,a,0,r,e,0,s);let o=0;for(let t=0;t<s;t++)o+=a[t];n.update(o,i,1)}}function O(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,a){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=a*(n/3);break;case e.LINES:t.lines+=a*(n/2);break;case e.LINE_STRIP:t.lines+=a*(n-1);break;case e.LINE_LOOP:t.lines+=a*n;break;case e.POINTS:t.points+=a*n;break;default:(0,i.z3S)("WebGLInfo: Unknown draw mode:",r)}}}}function F(e,t,n){const r=new WeakMap,a=new i.IUQ;return{update:function(s,o,l){const c=s.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,h=void 0!==u?u.length:0;let d=r.get(o);if(void 0===d||d.count!==h){void 0!==d&&d.texture.dispose();const p=void 0!==o.morphAttributes.position,f=void 0!==o.morphAttributes.normal,m=void 0!==o.morphAttributes.color,g=o.morphAttributes.position||[],v=o.morphAttributes.normal||[],_=o.morphAttributes.color||[];let y=0;!0===p&&(y=1),!0===f&&(y=2),!0===m&&(y=3);let x=o.attributes.position.count*y,b=1;x>t.maxTextureSize&&(b=Math.ceil(x/t.maxTextureSize),x=t.maxTextureSize);const S=new Float32Array(x*b*4*h),M=new i.rFo(S,x,b,h);M.type=i.RQf,M.needsUpdate=!0;const w=4*y;for(let E=0;E<h;E++){const A=g[E],C=v[E],R=_[E],P=x*b*4*E;for(let I=0;I<A.count;I++){const L=I*w;!0===p&&(a.fromBufferAttribute(A,I),S[P+L+0]=a.x,S[P+L+1]=a.y,S[P+L+2]=a.z,S[P+L+3]=0),!0===f&&(a.fromBufferAttribute(C,I),S[P+L+4]=a.x,S[P+L+5]=a.y,S[P+L+6]=a.z,S[P+L+7]=0),!0===m&&(a.fromBufferAttribute(R,I),S[P+L+8]=a.x,S[P+L+9]=a.y,S[P+L+10]=a.z,S[P+L+11]=4===R.itemSize?a.w:1)}}function T(){M.dispose(),r.delete(o),o.removeEventListener("dispose",T)}d={count:h,texture:M,size:new i.I9Y(x,b)},r.set(o,d),o.addEventListener("dispose",T)}if(!0===s.isInstancedMesh&&null!==s.morphTexture)l.getUniforms().setValue(e,"morphTexture",s.morphTexture,n);else{let N=0;for(let D=0;D<c.length;D++)N+=c[D];const U=o.morphTargetsRelative?1:1-N;l.getUniforms().setValue(e,"morphTargetBaseInfluence",U),l.getUniforms().setValue(e,"morphTargetInfluences",c)}l.getUniforms().setValue(e,"morphTargetsTexture",d.texture,n),l.getUniforms().setValue(e,"morphTargetsTextureSize",d.size)}}}function z(e,t,n,i,r){let a=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),i.releaseStatesOfObject(t),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(i){const o=r.render.frame,l=i.geometry,c=t.get(i,l);if(a.get(c)!==o&&(t.update(c),a.set(c,o)),i.isInstancedMesh&&(!1===i.hasEventListener("dispose",s)&&i.addEventListener("dispose",s),a.get(i)!==o&&(n.update(i.instanceMatrix,e.ARRAY_BUFFER),null!==i.instanceColor&&n.update(i.instanceColor,e.ARRAY_BUFFER),a.set(i,o))),i.isSkinnedMesh){const e=i.skeleton;a.get(e)!==o&&(e.update(),a.set(e,o))}return c},dispose:function(){a=new WeakMap}}}const B={[i.kyO]:"LINEAR_TONE_MAPPING",[i.Mjd]:"REINHARD_TONE_MAPPING",[i.nNL]:"CINEON_TONE_MAPPING",[i.FV]:"ACES_FILMIC_TONE_MAPPING",[i.LAk]:"AGX_TONE_MAPPING",[i.aJ8]:"NEUTRAL_TONE_MAPPING",[i.g7M]:"CUSTOM_TONE_MAPPING"};function k(e,t,n,r,a,s){const o=new i.nWS(t,n,{type:e,depthBuffer:a,stencilBuffer:s,samples:r?4:0,depthTexture:a?new i.VCu(t,n):void 0}),l=new i.nWS(t,n,{type:i.ix0,depthBuffer:!1,stencilBuffer:!1}),c=new i.LoY;c.setAttribute("position",new i.qtW([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute("uv",new i.qtW([0,2,0,0,2,0],2));const u=new i.D$Q({uniforms:{tDiffuse:{value:null}},vertexShader:"\n\t\t\tprecision highp float;\n\n\t\t\tuniform mat4 modelViewMatrix;\n\t\t\tuniform mat4 projectionMatrix;\n\n\t\t\tattribute vec3 position;\n\t\t\tattribute vec2 uv;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}",fragmentShader:"\n\t\t\tprecision highp float;\n\n\t\t\tuniform sampler2D tDiffuse;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\t#include <tonemapping_pars_fragment>\n\t\t\t#include <colorspace_pars_fragment>\n\n\t\t\tvoid main() {\n\t\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\n\n\t\t\t\t#ifdef LINEAR_TONE_MAPPING\n\t\t\t\t\tgl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( REINHARD_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( CINEON_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( ACES_FILMIC_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( AGX_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( NEUTRAL_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( CUSTOM_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef SRGB_TRANSFER\n\t\t\t\t\tgl_FragColor = sRGBTransferOETF( gl_FragColor );\n\t\t\t\t#endif\n\t\t\t}",depthTest:!1,depthWrite:!1}),h=new i.eaF(c,u),d=new i.qUd(-1,1,1,-1,0,1);let p,f=null,m=null,g=!1,v=null,_=[],y=!1;this.setSize=function(e,t){o.setSize(e,t),l.setSize(e,t);for(let n=0;n<_.length;n++){const i=_[n];i.setSize&&i.setSize(e,t)}},this.setEffects=function(e){_=e,y=_.length>0&&!0===_[0].isRenderPass;const t=o.width,n=o.height;for(let i=0;i<_.length;i++){const e=_[i];e.setSize&&e.setSize(t,n)}},this.begin=function(e,t){if(g)return!1;if(e.toneMapping===i.y_p&&0===_.length)return!1;if(v=t,null!==t){const e=t.width,n=t.height;o.width===e&&o.height===n||this.setSize(e,n)}return!1===y&&e.setRenderTarget(o),p=e.toneMapping,e.toneMapping=i.y_p,!0},this.hasRenderPass=function(){return y},this.end=function(e,t){e.toneMapping=p,g=!0;let n=o,r=l;for(let i=0;i<_.length;i++){const a=_[i];if(!1!==a.enabled&&(a.render(e,r,n,t),!1!==a.needsSwap)){const e=n;n=r,r=e}}if(f!==e.outputColorSpace||m!==e.toneMapping){f=e.outputColorSpace,m=e.toneMapping,u.defines={},i.ppV.getTransfer(f)===i.KLL&&(u.defines.SRGB_TRANSFER="");const t=B[m];t&&(u.defines[t]=""),u.needsUpdate=!0}u.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(v),e.render(h,d),v=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),l.dispose(),c.dispose(),u.dispose()}}const V=new i.gPd,H=new i.VCu(1,1),G=new i.rFo,W=new i.dYF,j=new i.b4q,X=[],q=[],Y=new Float32Array(16),Z=new Float32Array(9),J=new Float32Array(4);function K(e,t,n){const i=e[0];if(i<=0||i>0)return e;const r=t*n;let a=X[r];if(void 0===a&&(a=new Float32Array(r),X[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function Q(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function $(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function ee(e,t){let n=q[t];void 0===n&&(n=new Int32Array(t),q[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function te(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function ne(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Q(n,t))return;e.uniform2fv(this.addr,t),$(n,t)}}function ie(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Q(n,t))return;e.uniform3fv(this.addr,t),$(n,t)}}function re(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Q(n,t))return;e.uniform4fv(this.addr,t),$(n,t)}}function ae(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Q(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),$(n,t)}else{if(Q(n,i))return;J.set(i),e.uniformMatrix2fv(this.addr,!1,J),$(n,i)}}function se(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Q(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),$(n,t)}else{if(Q(n,i))return;Z.set(i),e.uniformMatrix3fv(this.addr,!1,Z),$(n,i)}}function oe(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Q(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),$(n,t)}else{if(Q(n,i))return;Y.set(i),e.uniformMatrix4fv(this.addr,!1,Y),$(n,i)}}function le(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function ce(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Q(n,t))return;e.uniform2iv(this.addr,t),$(n,t)}}function ue(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Q(n,t))return;e.uniform3iv(this.addr,t),$(n,t)}}function he(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Q(n,t))return;e.uniform4iv(this.addr,t),$(n,t)}}function de(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function pe(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Q(n,t))return;e.uniform2uiv(this.addr,t),$(n,t)}}function fe(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Q(n,t))return;e.uniform3uiv(this.addr,t),$(n,t)}}function me(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Q(n,t))return;e.uniform4uiv(this.addr,t),$(n,t)}}function ge(e,t,n){const r=this.cache,a=n.allocateTextureUnit();let s;r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),this.type===e.SAMPLER_2D_SHADOW?(H.c
2ompareFunction=n.isReversedDepthBuffer()?i.gWB:i.TiK,s=H):s=V,n.setTexture2D(t||s,a)}function ve(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||W,r)}function _e(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(t||j,r)}function ye(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||G,r)}function xe(e,t){e.uniform1fv(this.addr,t)}function be(e,t){const n=K(t,this.size,2);e.uniform2fv(this.addr,n)}function Se(e,t){const n=K(t,this.size,3);e.uniform3fv(this.addr,n)}function Me(e,t){const n=K(t,this.size,4);e.uniform4fv(this.addr,n)}function we(e,t){const n=K(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Te(e,t){const n=K(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Ee(e,t){const n=K(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Ae(e,t){e.uniform1iv(this.addr,t)}function Ce(e,t){e.uniform2iv(this.addr,t)}function Re(e,t){e.uniform3iv(this.addr,t)}function Pe(e,t){e.uniform4iv(this.addr,t)}function Ie(e,t){e.uniform1uiv(this.addr,t)}function Le(e,t){e.uniform2uiv(this.addr,t)}function Ne(e,t){e.uniform3uiv(this.addr,t)}function Ue(e,t){e.uniform4uiv(this.addr,t)}function De(e,t,n){const i=this.cache,r=t.length,a=ee(n,r);let s;Q(i,a)||(e.uniform1iv(this.addr,a),$(i,a)),s=this.type===e.SAMPLER_2D_SHADOW?H:V;for(let o=0;o!==r;++o)n.setTexture2D(t[o]||s,a[o])}function Oe(e,t,n){const i=this.cache,r=t.length,a=ee(n,r);Q(i,a)||(e.uniform1iv(this.addr,a),$(i,a));for(let s=0;s!==r;++s)n.setTexture3D(t[s]||W,a[s])}function Fe(e,t,n){const i=this.cache,r=t.length,a=ee(n,r);Q(i,a)||(e.uniform1iv(this.addr,a),$(i,a));for(let s=0;s!==r;++s)n.setTextureCube(t[s]||j,a[s])}function ze(e,t,n){const i=this.cache,r=t.length,a=ee(n,r);Q(i,a)||(e.uniform1iv(this.addr,a),$(i,a));for(let s=0;s!==r;++s)n.setTexture2DArray(t[s]||G,a[s])}class Be{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return te;case 35664:return ne;case 35665:return ie;case 35666:return re;case 35674:return ae;case 35675:return se;case 35676:return oe;case 5124:case 35670:return le;case 35667:case 35671:return ce;case 35668:case 35672:return ue;case 35669:case 35673:return he;case 5125:return de;case 36294:return pe;case 36295:return fe;case 36296:return me;case 35678:case 36198:case 36298:case 36306:case 35682:return ge;case 35679:case 36299:case 36307:return ve;case 35680:case 36300:case 36308:case 36293:return _e;case 36289:case 36303:case 36311:case 36292:return ye}}(t.type)}}class ke{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return xe;case 35664:return be;case 35665:return Se;case 35666:return Me;case 35674:return we;case 35675:return Te;case 35676:return Ee;case 5124:case 35670:return Ae;case 35667:case 35671:return Ce;case 35668:case 35672:return Re;case 35669:case 35673:return Pe;case 5125:return Ie;case 36294:return Le;case 36295:return Ne;case 36296:return Ue;case 35678:case 36198:case 36298:case 36306:case 35682:return De;case 35679:case 36299:case 36307:return Oe;case 35680:case 36300:case 36308:case 36293:return Fe;case 36289:case 36303:case 36311:case 36292:return ze}}(t.type)}}class Ve{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const a=i[r];a.setValue(e,t[a.id],n)}}}const He=/(\w+)(\])?(\[|\.)?/g;function Ge(e,t){e.seq.push(t),e.map[t.id]=t}function We(e,t,n){const i=e.name,r=i.length;for(He.lastIndex=0;;){const a=He.exec(i),s=He.lastIndex;let o=a[1];const l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===r){Ge(n,void 0===c?new Be(o,e,t):new ke(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new Ve(o),Ge(n,e)),n=e}}}class je{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){const n=e.getActiveUniform(t,a);We(n,e.getUniformLocation(t,n.name),this)}const i=[],r=[];for(const a of this.seq)a.type===e.SAMPLER_2D_SHADOW||a.type===e.SAMPLER_CUBE_SHADOW||a.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(a):r.push(a);i.length>0&&(this.seq=i.concat(r))}setValue(e,t,n,i){const r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const a=t[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const r=e[i];r.id in t&&n.push(r)}return n}}function Xe(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}let qe=0;const Ye=new i.dwI;function Ze(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),r=(e.getShaderInfoLog(t)||"").trim();if(i&&""===r)return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){const n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let s=r;s<a;s++){const e=s+1;i.push("".concat(e===t?">":" "," ").concat(e,": ").concat(n[s]))}return i.join("\n")}(e.getShaderSource(t),i)}return r}function Je(e,t){const n=function(e){i.ppV._getMatrix(Ye,i.ppV.workingColorSpace,e);const t="mat3( ".concat(Ye.elements.map(e=>e.toFixed(4))," )");switch(i.ppV.getTransfer(e)){case i.VxR:return[t,"LinearTransferOETF"];case i.KLL:return[t,"sRGBTransferOETF"];default:return(0,i.R8M)("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(t);return["vec4 ".concat(e,"( vec4 value ) {"),"\treturn ".concat(n[1],"( vec4( value.rgb * ").concat(n[0],", value.a ) );"),"}"].join("\n")}const Ke={[i.kyO]:"Linear",[i.Mjd]:"Reinhard",[i.nNL]:"Cineon",[i.FV]:"ACESFilmic",[i.LAk]:"AgX",[i.aJ8]:"Neutral",[i.g7M]:"Custom"};function Qe(e,t){const n=Ke[t];return void 0===n?((0,i.R8M)("WebGLProgram: Unsupported toneMapping:",t),"vec3 "+e+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const $e=new i.Pq0;function et(){i.ppV.getLuminanceCoefficients($e);const e=$e.x.toFixed(4),t=$e.y.toFixed(4),n=$e.z.toFixed(4);return["float luminance( const in vec3 rgb ) {","\tconst vec3 weights = vec3( ".concat(e,", ").concat(t,", ").concat(n," );"),"\treturn dot( weights, rgb );","}"].join("\n")}function tt(e){return""!==e}function nt(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_L
vendor: 4,123 bytes, line 2
2IGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function it(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const rt=/^[ \t]*#include +<([\w\d./]+)>/gm;function at(e){return e.replace(rt,ot)}const st=new Map;function ot(e,t){let n=s[t];if(void 0===n){const e=st.get(t);if(void 0===e)throw new Error("THREE.WebGLProgram: Can not resolve #include <"+t+">");n=s[e],(0,i.R8M)('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return at(n)}const lt=/#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 ct(e){return e.replace(lt,ut)}function ut(e,t,n,i){let r="";for(let a=parseInt(t);a<parseInt(n);a++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function ht(e){let t="precision ".concat(e.precision," float;\n\tprecision ").concat(e.precision," int;\n\tprecision ").concat(e.precision," sampler2D;\n\tprecision ").concat(e.precision," samplerCube;\n\tprecision ").concat(e.precision," sampler3D;\n\tprecision ").concat(e.precision," sampler2DArray;\n\tprecision ").concat(e.precision," sampler2DShadow;\n\tprecision ").concat(e.precision," samplerCubeShadow;\n\tprecision ").concat(e.precision," sampler2DArrayShadow;\n\tprecision ").concat(e.precision," isampler2D;\n\tprecision ").concat(e.precision," isampler3D;\n\tprecision ").concat(e.precision," isamplerCube;\n\tprecision ").concat(e.precision," isampler2DArray;\n\tprecision ").concat(e.precision," usampler2D;\n\tprecision ").concat(e.precision," usampler3D;\n\tprecision ").concat(e.precision," usamplerCube;\n\tprecision ").concat(e.precision," usampler2DArray;\n\t");return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}const dt={[i.QP0]:"SHADOWMAP_TYPE_PCF",[i.RyA]:"SHADOWMAP_TYPE_VSM"};const pt={[i.hy7]:"ENVMAP_TYPE_CUBE",[i.xFO]:"ENVMAP_TYPE_CUBE",[i.Om]:"ENVMAP_TYPE_CUBE_UV"};const ft={[i.xFO]:"ENVMAP_MODE_REFRACTION"};const mt={[i.caT]:"ENVMAP_BLENDING_MULTIPLY",[i.KRh]:"ENVMAP_BLENDING_MIX",[i.XrR]:"ENVMAP_BLENDING_ADD"};function gt(e,t,n,r){const a=e.getContext(),o=n.defines;let l=n.vertexShader,c=n.fragmentShader;const u=function(e){return dt[e.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}(n),h=function(e){return!1===e.envMap?"ENVMAP_TYPE_CUBE":pt[e.envMapMode]||"ENVMAP_TYPE_CUBE"}(n),d=function(e){return!1===e.envMap?"ENVMAP_MODE_REFLECTION":ft[e.envMapMode]||"ENVMAP_MODE_REFLECTION"}(n),p=function(e){return!1===e.envMap?"ENVMAP_BLENDING_NONE":mt[e.combine]||"ENVMAP_BLENDING_NONE"}(n),f=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),m=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(tt).join("\n")}(n),g=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(o),v=a.createProgram();let _,y,x=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(_=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(tt).join("\n"),_.length>0&&(_+="\n"),y=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(tt).join("\n"),y.length>0&&(y+="\n")):(_=[ht(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionCl
vendor: 5,498 bytes, line 2
2ipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexNormals?"#define HAS_NORMAL":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(tt).join("\n"),y=[ht(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alph
vendor: 4,165 bytes, line 2
2aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",n.envMap?"#define "+p:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas||n.batchingColor?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==i.y_p?"#define TONE_MAPPING":"",n.toneMapping!==i.y_p?s.tonemapping_pars_fragment:"",n.toneMapping!==i.y_p?Qe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",s.colorspace_pars_fragment,Je("linearToOutputTexel",n.outputColorSpace),et(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(tt).join("\n")),l=at(l),l=nt(l,n),l=it(l,n),c=at(c),c=nt(c,n),c=it(c,n),l=ct(l),c=ct(c),!0!==n.isRawShaderMaterial&&(x="#version 300 es\n",_=[m,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,y=["#define varying in",n.glslVersion===i.Wdf?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===i.Wdf?"":"#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("\n")+"\n"+y);const b=x+_+l,S=x+y+c,M=Xe(a,a.VERTEX_SHADER,b),w=Xe(a,a.FRAGMENT_SHADER,S);
vendor: 4,450 bytes, line 2
2function T(t){if(e.debug.checkShaderErrors){const n=a.getProgramInfoLog(v)||"",r=a.getShaderInfoLog(M)||"",s=a.getShaderInfoLog(w)||"",o=n.trim(),l=r.trim(),c=s.trim();let u=!0,h=!0;if(!1===a.getProgramParameter(v,a.LINK_STATUS))if(u=!1,"function"===typeof e.debug.onShaderError)e.debug.onShaderError(a,v,M,w);else{const e=Ze(a,M,"vertex"),n=Ze(a,w,"fragment");(0,i.z3S)("WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(v,a.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+o+"\n"+e+"\n"+n)}else""!==o?(0,i.R8M)("WebGLProgram: Program Info Log:",o):""!==l&&""!==c||(h=!1);h&&(t.diagnostics={runnable:u,programLog:o,vertexShader:{log:l,prefix:_},fragmentShader:{log:c,prefix:y}})}a.deleteShader(M),a.deleteShader(w),E=new je(a,v),A=function(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r),a=i.name;let s=1;i.type===e.FLOAT_MAT2&&(s=2),i.type===e.FLOAT_MAT3&&(s=3),i.type===e.FLOAT_MAT4&&(s=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:s}}return n}(a,v)}let E,A;a.attachShader(v,M),a.attachShader(v,w),void 0!==n.index0AttributeName?a.bindAttribLocation(v,0,n.index0AttributeName):!0===n.hasPositionAttribute&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),this.getUniforms=function(){return void 0===E&&T(this),E},this.getAttributes=function(){return void 0===A&&T(this),A};let C=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===C&&(C=a.getProgramParameter(v,37297)),C},this.destroy=function(){r.releaseStatesOfProgram(this),a.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=qe++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=M,this.fragmentShader=w,this}let vt=0;class _t{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){const i=this._getShaderCacheForMaterial(e);return!1===i.has(t)&&(i.add(t),t.usedTimes++),!1===i.has(n)&&(i.add(n),n.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new yt(e),t.set(e,n)),n}}class yt{constructor(e){this.id=vt++,this.code=e,this.usedTimes=0}}function xt(e,t,n,r,a,s){const o=new i.zgK,c=new _t,u=new Set,h=[],d=new Map,p=r.logarithmicDepthBuffer;let f=r.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(e){return u.add(e),0===e?"uv":"uv".concat(e)}return{getParameters:function(a,o,h,d,v,_){const y=d.fog,x=v.geometry,b=a.isMeshStandardMaterial||a.isMeshLambertMaterial||a.isMeshPhongMaterial?d.environment:null,S=a.isMeshStandardMaterial||a.isMeshLambertMaterial&&!a.envMap||a.isMeshPhongMaterial&&!a.envMap,M=t.get(a.envMap||b,S),w=M&&M.mapping===i.Om?M.image.height:null,T=m[a.type];null!==a.precision&&(f=r.getMaxPrecision(a.precision),f!==a.precision&&(0,i.R8M)("WebGLProgram.getParameters:",a.precision,"not supported, using",f,"instead."));const E=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,A=void 0!==E?E.length:0;let C,R,P,I,L=0;if(void 0!==x.morphAttributes.position&&(L=1),void 0!==x.morphAttributes.normal&&(L=2),void 0!==x.morphAttributes.color&&(L=3),T){const e=l[T];C=e.vertexShader,R=e.fragmentShader}else{C=a.vertexShader,R=a.fragmentShader;const e=c.getVertexShaderStage(a),t=c.getFragmentShaderStage(a);c.update(a,e,t),P=e.id,I=t.id}const N=e.getRenderTarget(),U=e.state.buffers.depth.getReversed(),D=!0===v.isInstancedMesh,O=!0===v.isBatchedMesh,F=!!a.map,z=!!a.matcap,B=!!M,k=!!a.aoMap,V=!!a.lightMap,H=!!a.bumpMap&&
vendor: 5,065 bytes, line 2
2!1===a.wireframe,G=!!a.normalMap,W=!!a.displacementMap,j=!!a.emissiveMap,X=!!a.metalnessMap,q=!!a.roughnessMap,Y=a.anisotropy>0,Z=a.clearcoat>0,J=a.dispersion>0,K=a.iridescence>0,Q=a.sheen>0,$=a.transmission>0,ee=Y&&!!a.anisotropyMap,te=Z&&!!a.clearcoatMap,ne=Z&&!!a.clearcoatNormalMap,ie=Z&&!!a.clearcoatRoughnessMap,re=K&&!!a.iridescenceMap,ae=K&&!!a.iridescenceThicknessMap,se=Q&&!!a.sheenColorMap,oe=Q&&!!a.sheenRoughnessMap,le=!!a.specularMap,ce=!!a.specularColorMap,ue=!!a.specularIntensityMap,he=$&&!!a.transmissionMap,de=$&&!!a.thicknessMap,pe=!!a.gradientMap,fe=!!a.alphaMap,me=a.alphaTest>0,ge=!!a.alphaHash,ve=!!a.extensions;let _e=i.y_p;a.toneMapped&&(null!==N&&!0!==N.isXRRenderTarget||(_e=e.toneMapping));const ye={shaderID:T,shaderType:a.type,shaderName:a.name,vertexShader:C,fragmentShader:R,defines:a.defines,customVertexShaderID:P,customFragmentShaderID:I,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:f,batching:O,batchingColor:O&&null!==v._colorsTexture,instancing:D,instancingColor:D&&null!==v.instanceColor,instancingMorph:D&&null!==v.morphTexture,outputColorSpace:null===N?e.outputColorSpace:!0===N.isXRRenderTarget?N.texture.colorSpace:i.ppV.workingColorSpace,alphaToCoverage:!!a.alphaToCoverage,map:F,matcap:z,envMap:B,envMapMode:B&&M.mapping,envMapCubeUVHeight:w,aoMap:k,lightMap:V,bumpMap:H,normalMap:G,displacementMap:W,emissiveMap:j,normalMapObjectSpace:G&&a.normalMapType===i.vyJ,normalMapTangentSpace:G&&a.normalMapType===i.bI3,packedNormalMap:G&&a.normalMapType===i.bI3&&(xe=a.normalMap.format,xe===i.paN||xe===i.OtU||xe===i.HO_),metalnessMap:X,roughnessMap:q,anisotropy:Y,anisotropyMap:ee,clearcoat:Z,clearcoatMap:te,clearcoatNormalMap:ne,clearcoatRoughnessMap:ie,dispersion:J,iridescence:K,iridescenceMap:re,iridescenceThicknessMap:ae,sheen:Q,sheenColorMap:se,sheenRoughnessMap:oe,specularMap:le,specularColorMap:ce,specularIntensityMap:ue,transmission:$,transmissionMap:he,thicknessMap:de,gradientMap:pe,opaque:!1===a.transparent&&a.blending===i.NTi&&!1===a.alphaToCoverage,alphaMap:fe,alphaTest:me,alphaHash:ge,combine:a.combine,mapUv:F&&g(a.map.channel),aoMapUv:k&&g(a.aoMap.channel),lightMapUv:V&&g(a.lightMap.channel),bumpMapUv:H&&g(a.bumpMap.channel),normalMapUv:G&&g(a.normalMap.channel),displacementMapUv:W&&g(a.displacementMap.channel),emissiveMapUv:j&&g(a.emissiveMap.channel),metalnessMapUv:X&&g(a.metalnessMap.channel),roughnessMapUv:q&&g(a.roughnessMap.channel),anisotropyMapUv:ee&&g(a.anisotropyMap.channel),clearcoatMapUv:te&&g(a.clearcoatMap.channel),clearcoatNormalMapUv:ne&&g(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ie&&g(a.clearcoatRoughnessMap.channel),iridescenceMapUv:re&&g(a.iridescenceMap.channel),iridescenceThicknessMapUv:ae&&g(a.iridescenceThicknessMap.channel),sheenColorMapUv:se&&g(a.sheenColorMap.channel),sheenRoughnessMapUv:oe&&g(a.sheenRoughnessMap.channel),specularMapUv:le&&g(a.specularMap.channel),specularColorMapUv:ce&&g(a.specularColorMap.channel),specularIntensityMapUv:ue&&g(a.specularIntensityMap.channel),transmissionMapUv:he&&g(a.transmissionMap.channel),thicknessMapUv:de&&g(a.thicknessMap.channel),alphaMapUv:fe&&g(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(G||Y),vertexNormals:!!x.attributes.normal,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!x.attributes.uv&&(F||fe),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!1===a.wireframe&&(!0===a.flatShading||void 0===x.attributes.normal&&!1===G&&(a.isMeshLambertMaterial||a.isMeshPhongMaterial||a.isMeshStandardMaterial||a.isMeshPhysicalMaterial)),sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:p,reversedDepthBuffer:U,skinning:!0===v.isSkinnedMesh,hasPositionAttribute:void 0!==x.attributes.position,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:A,morphTextureStride:L,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:_.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&h.length>0,shadowMapType:e.shadowMap.type,toneMapping:_e,decodeVideoTexture:F&&!0===a.map.isVideoTexture&&i.ppV.getTransfer(a.map.colorSpace)===i.KLL,decodeVideoTextureEmissive:j&&!0===a.emissiveMap.isVideoTexture&&i.ppV.getTransfer(a.emissiveMap.colorSpace)===i.KLL,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===i.$EB,flipSided:a.side===i.hsX,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionCl
vendor: 5,454 bytes, line 2
2ipCullDistance:ve&&!0===a.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ve&&!0===a.extensions.multiDraw||O)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};var xe;return ye.vertexUv1s=u.has(1),ye.vertexUv2s=u.has(2),ye.vertexUv3s=u.has(3),u.clear(),ye},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){o.disableAll(),t.instancing&&o.enable(0);t.instancingColor&&o.enable(1);t.instancingMorph&&o.enable(2);t.matcap&&o.enable(3);t.envMap&&o.enable(4);t.normalMapObjectSpace&&o.enable(5);t.normalMapTangentSpace&&o.enable(6);t.clearcoat&&o.enable(7);t.iridescence&&o.enable(8);t.alphaTest&&o.enable(9);t.vertexColors&&o.enable(10);t.vertexAlphas&&o.enable(11);t.vertexUv1s&&o.enable(12);t.vertexUv2s&&o.enable(13);t.vertexUv3s&&o.enable(14);t.vertexTangents&&o.enable(15);t.anisotropy&&o.enable(16);t.alphaHash&&o.enable(17);t.batching&&o.enable(18);t.dispersion&&o.enable(19);t.batchingColor&&o.enable(20);t.gradientMap&&o.enable(21);t.packedNormalMap&&o.enable(22);t.vertexNormals&&o.enable(23);e.push(o.mask),o.disableAll(),t.fog&&o.enable(0);t.useFog&&o.enable(1);t.flatShading&&o.enable(2);t.logarithmicDepthBuffer&&o.enable(3);t.reversedDepthBuffer&&o.enable(4);t.skinning&&o.enable(5);t.morphTargets&&o.enable(6);t.morphNormals&&o.enable(7);t.morphColors&&o.enable(8);t.premultipliedAlpha&&o.enable(9);t.shadowMapEnabled&&o.enable(10);t.doubleSided&&o.enable(11);t.flipSided&&o.enable(12);t.useDepthPacking&&o.enable(13);t.dithering&&o.enable(14);t.transmission&&o.enable(15);t.sheen&&o.enable(16);t.opaque&&o.enable(17);t.pointsUvs&&o.enable(18);t.decodeVideoTexture&&o.enable(19);t.decodeVideoTextureEmissive&&o.enable(20);t.alphaToCoverage&&o.enable(21);t.numLightProbeGrids>0&&o.enable(22);t.hasPositionAttribute&&o.enable(23);e.push(o.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=m[e.type];let n;if(t){const e=l[t];n=i.LlO.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i=d.get(n);return void 0!==i?++i.usedTimes:(i=new gt(e,n,t,a),h.push(i),d.set(n,i)),i},releaseProgram:function(e){if(0===--e.usedTimes){const t=h.indexOf(e);h[t]=h[h.length-1],h.pop(),d.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){c.remove(e)},programs:h,dispose:function(){c.dispose()}}}function bt(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function St(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.materialVariant!==t.materialVariant?e.materialVariant-t.materialVariant:e.z!==t.z?e.z-t.z:e.id-t.id}function Mt(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function wt(){const e=[];let t=0;const n=[],i=[],r=[];function a(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,i,r,s,o,l){let c=e[t];return void 0===c?(c={id:n.id,object:n,geometry:i,material:r,materialVariant:a(n),groupOrder:s,renderOrder:n.renderOrder,z:o,group:l},e[t]=c):(c.id=n.id,c.object=n,c.geometry=i,c.material=r,c.materialVariant=a(n),c.groupOrder=s,c.renderOrder=n.renderOrder,c.z=o,c.group=l),t++,c}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,a,o,l,c){const u=s(e,t,a,o,l,c);a.transmission>0?i.push(u):!0===a.transparent?r.push(u):n.push(u)},unshift:function(e,t,a,o,l,c){const u=s(e,t,a,o,l,c);a.transmission>0?i.unshift(u):!0===a.transparent?r.unshift(u):n.unshift(u)},finish:function(){for(let n=t,i=e.length;n<i;
vendor: 24,687 bytes, line 2
2n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t,a){n.length>1&&n.sort(e||St),i.length>1&&i.sort(t||Mt),r.length>1&&r.sort(t||Mt),a&&(n.reverse(),i.reverse(),r.reverse())}}}function Tt(){let e=new WeakMap;return{get:function(t,n){const i=e.get(t);let r;return void 0===i?(r=new wt,e.set(t,[r])):n>=i.length?(r=new wt,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function Et(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new i.Pq0,color:new i.Q1f};break;case"SpotLight":n={position:new i.Pq0,direction:new i.Pq0,color:new i.Q1f,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new i.Pq0,color:new i.Q1f,distance:0,decay:0};break;case"HemisphereLight":n={direction:new i.Pq0,skyColor:new i.Q1f,groundColor:new i.Q1f};break;case"RectAreaLight":n={color:new i.Q1f,position:new i.Pq0,halfWidth:new i.Pq0,halfHeight:new i.Pq0}}return e[t.id]=n,n}}}let At=0;function Ct(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Rt(e){const t=new Et,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new i.I9Y};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new i.I9Y,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={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 o=0;o<9;o++)r.probe.push(new i.Pq0);const a=new i.Pq0,s=new i.kn4,l=new i.kn4;return{setup:function(a){let s=0,l=0,c=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let u=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0;a.sort(Ct);for(let e=0,o=a.length;e<o;e++){const o=a[e],b=o.color,S=o.intensity,M=o.distance;let w=null;if(o.shadow&&o.shadow.map&&(w=o.shadow.map.texture.format===i.paN?o.shadow.map.texture:o.shadow.map.depthTexture||o.shadow.map.texture),o.isAmbientLight)s+=b.r*S,l+=b.g*S,c+=b.b*S;else if(o.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(o.sh.coefficients[e],S);x++}else if(o.isDirectionalLight){const e=t.get(o);if(e.color.copy(o.color).multiplyScalar(o.intensity),o.castShadow){const e=o.shadow,t=n.get(o);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[u]=t,r.directionalShadowMap[u]=w,r.directionalShadowMatrix[u]=o.shadow.matrix,m++}r.directional[u]=e,u++}else if(o.isSpotLight){const e=t.get(o);e.position.setFromMatrixPosition(o.matrixWorld),e.color.copy(b).multiplyScalar(S),e.distance=M,e.coneCos=Math.cos(o.angle),e.penumbraCos=Math.cos(o.angle*(1-o.penumbra)),e.decay=o.decay,r.spot[d]=e;const i=o.shadow;if(o.map&&(r.spotLightMap[_]=o.map,_++,i.updateMatrices(o),o.castShadow&&y++),r.spotLightMatrix[d]=i.matrix,o.castShadow){const e=n.get(o);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[d]=e,r.spotShadowMap[d]=w,v++}d++}else if(o.isRectAreaLight){const e=t.get(o);e.color.copy(b).multiplyScalar(S),e.halfWidth.set(.5*o.width,0,0),e.halfHeight.set(0,.5*o.height,0),r.rectArea[p]=e,p++}else if(o.isPointLight){const e=t.get(o);if(e.color.copy(o.color).multiplyScalar(o.intensity),e.distance=o.distance,e.decay=o.decay,o.castShadow){const e=o.shadow,t=n.get(o);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[h]=t,r.pointShadowMap[h]=w,r.pointShadowMatrix[h]=o.shadow.matrix,g++}r.point[h]=e,h++}else if(o.isHemisphereLight){const e=t.get(o);e.skyColor.copy(o.color).multiplyScalar(S),e.groundColor.copy(o.groundColor).multiplyScalar(S),r.hemi[f]=e,f++}}p>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=o.LTC_FLOAT_1,r.rectAreaLTC2=o.LTC_FLOAT_2):(r.rectAreaLTC1=o.LTC_HALF_1,r.rectAreaLTC2=o.LTC_HALF_2)),r.ambient[0]=s,r.ambient[1]=l,r.ambient[2]=c;const b=r.hash;b.directionalLength===u&&b.pointLength===h&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===g&&b.numSpotShadows===v&&b.numSpotMaps===_&&b.numLightProbes===x||(r.directional.length=u,r.spot.length=d,r.rectArea.length=p,r.point.length=h,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,r.numLightProbes=x,b.directionalLength=u,b.pointLength=h,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=v,b.numSpotMaps=_,b.numLightProbes=x,r.version=At++)},setupView:function(e,t){let n=0,i=0,o=0,c=0,u=0;const h=t.matrixWorldInverse;for(let d=0,p=e.length;d<p;d++){const t=e[d];if(t.isDirectionalLight){const e=r.directional[n];e.direction.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),n++}else if(t.isSpotLight){const e=r.spot[o];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),o++}else if(t.isRectAreaLight){const e=r.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),l.identity(),s.copy(t.matrixWorld),s.premultiply(h),l.extractRotation(s),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(l),e.halfHeight.applyMatrix4(l),c++}else if(t.isPointLight){const e=r.point[i];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),i++}else if(t.isHemisphereLight){const e=r.hemi[u];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(h),u++}}},state:r}}function Pt(e){const t=new Rt(e),n=[],i=[],r=[];const a={lightsArray:n,shadowsArray:i,lightProbeGridArray:r,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init:function(e){a.camera=e,n.length=0,i.length=0,r.length=0},state:a,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)},pushLightProbeGrid:function(e){r.push(e)}}}function It(e){let t=new WeakMap;return{get:function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=t.get(n);let a;return void 0===r?(a=new Pt(e),t.set(n,[a])):i>=r.length?(a=new Pt(e),r.push(a)):a=r[i],a},dispose:function(){t=new WeakMap}}}const Lt=[new i.Pq0(1,0,0),new i.Pq0(-1,0,0),new i.Pq0(0,1,0),new i.Pq0(0,-1,0),new i.Pq0(0,0,1),new i.Pq0(0,0,-1)],Nt=[new i.Pq0(0,-1,0),new i.Pq0(0,-1,0),new i.Pq0(0,0,1),new i.Pq0(0,0,-1),new i.Pq0(0,-1,0),new i.Pq0(0,-1,0)],Ut=new i.kn4,Dt=new i.Pq0,Ot=new i.Pq0;function Ft(e,t,n){let r=new i.PPD;const a=new i.I9Y,s=new i.I9Y,o=new i.IUQ,l=new i.CSG,c=new i.aVO,u={},h=n.maxTextureSize,d={[i.hB5]:i.hsX,[i.hsX]:i.hB5,[i.$EB]:i.$EB},p=new i.BKk({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new i.I9Y},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n\tgl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}"}),f=p.clone();f.defines.HORIZONTAL_PASS=1;const m=new i.LoY;m.setAttribute("position",new i.THS(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new i.eaF(m,p),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=i.QP0;let _=this.type;function y(n,r){const s=t.update(g);p.defines.VSM_SAMPLES!==n.blurSamples&&(p.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,p.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new i.nWS(a.x,a.y,{format:i.paN,type:i.ix0})),p.uniforms.shadow_pass.value=n.map.depthTexture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,s,p,g,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,s,f,g,null)}function x(t,n,r,a){let s=null;const o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===r.isPointLight?c:l,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){const e=s.uuid,t=n.uuid;let i=u[e];void 0===i&&(i={},u[e]=i);let r=i[t];void 0===r&&(r=s.clone(),i[t]=r,n.addEventListener("dispose",S)),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,a===i.RyA?s.side=null!==n.shadowSide?n.shadowSide:n.side:s.side=null!==n.shadowSide?n.shadowSide:d[n.side],s.alphaMap=n.alphaMap,s.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===r.isPointLight&&!0===s.isMeshDistanceMaterial){e.properties.get(s).light=r}return s}function b(n,a,s,o,l){if(!1===n.visible)return;if(n.layers.test(a.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===i.RyA)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=t.update(n),r=n.material;if(Array.isArray(r)){const t=i.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],h=r[u.materialIndex];if(h&&h.visible){const t=x(n,h,o,l);n.onBeforeShadow(e,n,a,s,i,t,u),e.renderBufferDirect(s,null,i,t,n,u),n.onAfterShadow(e,n,a,s,i,t,u)}}}else if(r.visible){const t=x(n,r,o,l);n.onBeforeShadow(e,n,a,s,i,t,null),e.renderBufferDirect(s,null,i,t,n,null),n.onAfterShadow(e,n,a,s,i,t,null)}}const c=n.children;for(let e=0,t=c.length;e<t;e++)b(c[e],a,s,o,l)}function S(e){e.target.removeEventListener("dispose",S);for(const t in u){const n=u[t],i=e.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(t,n,l){if(!1===v.enabled)return;if(!1===v.autoUpdate&&!1===v.needsUpdate)return;if(0===t.length)return;this.type===i.Wk7&&((0,i.R8M)("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=i.QP0);const c=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.state;p.setBlending(i.XIg),!0===p.buffers.depth.getReversed()?p.buffers.color.setClear(0,0,0,0):p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);const f=_!==this.type;f&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let m=0,g=t.length;m<g;m++){const c=t[m],u=c.shadow;if(void 0===u){(0,i.R8M)("WebGLShadowMap:",c,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;a.copy(u.mapSize);const d=u.getFrameExtents();a.multiply(d),s.copy(u.mapSize),(a.x>h||a.y>h)&&(a.x>h&&(s.x=Math.floor(h/d.x),a.x=s.x*d.x,u.mapSize.x=s.x),a.y>h&&(s.y=Math.floor(h/d.y),a.y=s.y*d.y,u.mapSize.y=s.y));const g=e.state.buffers.depth.getReversed();if(u.camera._reversedDepth=g,null===u.map||!0===f){if(null!==u.map&&(null!==u.map.depthTexture&&(u.map.depthTexture.dispose(),u.map.depthTexture=null),u.map.dispose()),this.type===i.RyA){if(c.isPointLight){(0,i.R8M)("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}u.map=new i.nWS(a.x,a.y,{format:i.paN,type:i.ix0,minFilter:i.k6q,magFilter:i.k6q,generateMipmaps:!1}),u.map.texture.name=c.name+".shadowMap",u.map.depthTexture=new i.VCu(a.x,a.y,i.RQf),u.map.depthTexture.name=c.name+".shadowMapDepth",u.map.depthTexture.format=i.zdS,u.map.depthTexture.compareFunction=null,u.map.depthTexture.minFilter=i.hxR,u.map.depthTexture.magFilter=i.hxR}else c.isPointLight?(u.map=new I(a.x),u.map.depthTexture=new i.Gc6(a.x,i.bkx)):(u.map=new i.nWS(a.x,a.y),u.map.depthTexture=new i.VCu(a.x,a.y,i.bkx)),u.map.depthTexture.name=c.name+".shadowMap",u.map.depthTexture.format=i.zdS,this.type===i.QP0?(u.map.depthTexture.compareFunction=g?i.gWB:i.TiK,u.map.depthTexture.minFilter=i.k6q,u.map.depthTexture.magFilter=i.k6q):(u.map.depthTexture.compareFunction=null,u.map.depthTexture.minFilter=i.hxR,u.map.depthTexture.magFilter=i.hxR);u.camera.updateProjectionMatrix()}const v=u.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<v;t++){if(u.map.isWebGLCubeRenderTarget)e.setRenderTarget(u.map,t),e.clear();else{0===t&&(e.setRenderTarget(u.map),e.clear());const n=u.getViewport(t);o.set(s.x*n.x,s.y*n.y,s.x*n.z,s.y*n.w),p.viewport(o)}if(c.isPointLight){const e=u.camera,n=u.matrix,i=c.distance||e.far;i!==e.far&&(e.far=i,e.updateProjectionMatrix()),Dt.setFromMatrixPosition(c.matrixWorld),e.position.copy(Dt),Ot.copy(e.position),Ot.add(Lt[t]),e.up.copy(Nt[t]),e.lookAt(Ot),e.updateMatrixWorld(),n.makeTranslation(-Dt.x,-Dt.y,-Dt.z),Ut.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),u._frustum.setFromProjectionMatrix(Ut,e.coordinateSystem,e.reversedDepth)}else u.updateMatrices(c);r=u.getFrustum(),b(n,l,u.camera,c,this.type)}!0!==u.isPointLightShadow&&this.type===i.RyA&&y(u,l),u.needsUpdate=!1}_=this.type,v.needsUpdate=!1,e.setRenderTarget(c,u,d)}}function zt(e,t){const n=new function(){let t=!1;const n=new i.IUQ;let r=null;const a=new i.IUQ(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,i,r,s,o){!0===o&&(t*=s,i*=s,r*=s),n.set(t,i,r,s),!1===a.equals(n)&&(e.clearColor(t,i,r,s),a.copy(n))},reset:function(){t=!1,r=null,a.set(-1,0,0,0)}}},r=new function(){let n=!1,r=!1,a=null,s=null,o=null;return{setReversed:function(e){if(r!==e){const n=t.get("EXT_clip_control");e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;const i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?H(e.DEPTH_TEST):G(e.DEPTH_TEST)},setMask:function(t){a===t||n||(e.depthMask(t),a=t)},setFunc:function(t){if(r&&(t=i.ri6[t]),s!==t){switch(t){case i.eHc:e.depthFunc(e.NEVER);break;case i.lGu:e.depthFunc(e.ALWAYS);break;case i.brA:e.depthFunc(e.LESS);break;case i.xSv:e.depthFunc(e.LEQUAL);break;case i.U3G:e.depthFunc(e.EQUAL);break;case i.Gwm:e.depthFunc(e.GEQUAL);break;case i.K52:e.depthFunc(e.GREATER);break;case i.bw0:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}s=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(o=t,r&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,a=null,s=null,o=null,r=!1}}},a=new function(){let t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(n){t||(n?H(e.STENCIL_TEST):G(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,s){i===t&&r===n&&a===s||(e.stencilFunc(t,n,s),i=t,r=n,a=s)},setOp:function(t,n,i){s===t&&o===n&&l===i||(e.stencilOp(t,n,i),s=t,o=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null}}},s=new WeakMap,o=new WeakMap;let l={},c={},u={},h=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,_=null,y=null,x=null,b=null,S=new i.Q1f(0,0,0),M=0,w=!1,T=null,E=null,A=null,C=null,R=null;const P=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let I=!1,L=0;const N=e.getParameter(e.VERSION);-1!==N.indexOf("WebGL")?(L=parseFloat(/^WebGL (\d)/.exec(N)[1]),I=L>=1):-1!==N.indexOf("OpenGL ES")&&(L=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),I=L>=2);let U=null,D={};const O=e.getParameter(e.SCISSOR_BOX),F=e.getParameter(e.VIEWPORT),z=(new i.IUQ).fromArray(O),B=(new i.IUQ).fromArray(F);function k(t,n,i,r){const a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<i;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return s}const V={};function H(t){!0!==l[t]&&(e.enable(t),l[t]=!0)}function G(t){!1!==l[t]&&(e.disable(t),l[t]=!1)}V[e.TEXTURE_2D]=k(e.TEXTURE_2D,e.TEXTURE_2D,1),V[e.TEXTURE_CUBE_MAP]=k(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),V[e.TEXTURE_2D_ARRAY]=k(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),V[e.TEXTURE_3D]=k(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),r.setClear(1),a.setClear(0),H(e.DEPTH_TEST),r.setFunc(i.xSv),q(!1),Y(i.Vb5),H(e.CULL_FACE),X(i.XIg);const W={[i.gO9]:e.FUNC_ADD,[i.FXf]:e.FUNC_SUBTRACT,[i.nST]:e.FUNC_REVERSE_SUBTRACT};W[i.znC]=e.MIN,W[i.$ei]=e.MAX;const j={[i.ojh]:e.ZERO,[i.qad]:e.ONE,[i.f4X]:e.SRC_COLOR,[i.ie2]:e.SRC_ALPHA,[i.hgQ]:e.SRC_ALPHA_SATURATE,[i.wn6]:e.DST_COLOR,[i.hdd]:e.DST_ALPHA,[i.LiQ]:e.ONE_MINUS_SRC_COLOR,[i.OuU]:e.ONE_MINUS_SRC_ALPHA,[i.aEY]:e.ONE_MINUS_DST_COLOR,[i.Nt7]:e.ONE_MINUS_DST_ALPHA,[i.RrE]:e.CONSTANT_COLOR,[i.$Yl]:e.ONE_MINUS_CONSTANT_COLOR,[i.e0p]:e.CONSTANT_ALPHA,[i.ov9]:e.ONE_MINUS_CONSTANT_ALPHA};function X(t,n,r,a,s,o,l,c,u,h){if(t!==i.XIg){if(!1===f&&(H(e.BLEND),f=!0),t===i.bCz)s=s||n,o=o||r,l=l||a,n===g&&s===y||(e.blendEquationSeparate(W[n],W[s]),g=n,y=s),r===v&&a===_&&o===x&&l===b||(e.blendFuncSeparate(j[r],j[a],j[o],j[l]),v=r,_=a,x=o,b=l),!1!==c.equals(S)&&u===M||(e.blendColor(c.r,c.g,c.b,u),S.copy(c),M=u),m=t,w=!1;else if(t!==m||h!==w){if(g===i.gO9&&y===i.gO9||(e.blendEquation(e.FUNC_ADD),g=i.gO9,y=i.gO9),h)switch(t){case i.NTi:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case i.EZo:e.blendFunc(e.ONE,e.ONE);break;case i.Kwu:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case i.EdD:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:(0,i.z3S)("WebGLState: Invalid blending: ",t)}else switch(t){case i.NTi:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case i.EZo:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case i.Kwu:(0,i.z3S)("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case i.EdD:(0,i.z3S)("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:(0,i.z3S)("WebGLState: Invalid blending: ",t)}v=null,_=null,x=null,b=null,S.set(0,0,0),M=0,m=t,w=h}}else!0===f&&(G(e.BLEND),f=!1)}function q(t){T!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),T=t)}function Y(t){t!==i.WNZ?(H(e.CULL_FACE),t!==E&&(t===i.Vb5?e.cullFace(e.BACK):t===i.Jnc?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):G(e.CULL_FACE),E=t}function Z(t,n,i){t?(H(e.POLYGON_OFFSET_FILL),C===n&&R===i||(C=n,R=i,r.getReversed()&&(n=-n),e.polygonOffset(n,i))):G(e.POLYGON_OFFSET_FILL)}return{buffers:{color:n,depth:r,stencil:a},enable:H,disable:G,bindFramebuffer:function(t,n){return u[t]!==n&&(e.bindFramebuffer(t,n),u[t]=n,t===e.DRAW_FRAMEBUFFER&&(u[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(u[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let i=d,r=!1;if(t){i=h.get(n),void 0===i&&(i=[],h.set(n,i));const a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,r=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,r=!0);r&&e.drawBuffers(i)},useProgram:function(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending:X,setMaterial:function(t,s){t.side===i.$EB?G(e.CULL_FACE):H(e.CULL_FACE);let o=t.side===i.hsX;s&&(o=!o),q(o),t.blending===i.NTi&&!1===t.transparent?X(i.XIg):X(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),n.setMask(t.colorWrite);const l=t.stencilWrite;a.setTest(l),l&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?H(e.SAMPLE_ALPHA_TO_COVERAGE):G(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:q,setCullFace:Y,setLineWidth:function(t){t!==A&&(I&&e.lineWidth(t),A=t)},setPolygonOffset:Z,setScissorTest:function(t){t?H(e.SCISSOR_TEST):G(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+P-1),U!==t&&(e.activeTexture(t),U=t)},bindTexture:function(t,n,i){void 0===i&&(i=null===U?e.TEXTURE0+P-1:U);let r=D[i];void 0===r&&(r={type:void 0,texture:void 0},D[i]=r),r.type===t&&r.texture===n||(U!==i&&(e.activeTexture(i),U=i),e.bindTexture(t,n||V[t]),r.type=t,r.texture=n)},unbindTexture:function(){const t=D[U];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},compressedTexImage3D:function(){try{e.compressedTexImage3D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},texImage2D:function(){try{e.texImage2D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},texImage3D:function(){try{e.texImage3D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},pixelStorei:function(t,n){c[t]!==n&&(e.pixelStorei(t,n),c[t]=n)},getParameter:function(t){return void 0!==c[t]?c[t]:e.getParameter(t)},updateUBOMapping:function(t,n){let i=o.get(n);void 0===i&&(i=new WeakMap,o.set(n,i));let r=i.get(t);void 0===r&&(r=e.getUniformBlockIndex(n,t.name),i.set(t,r))},uniformBlockBinding:function(t,n){const i=o.get(n).get(t);s.get(n)!==i&&(e.uniformBlockBinding(n,i,t.__bindingPointIndex),s.set(n,i))},texStorage2D:function(){try{e.texStorage2D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},texStorage3D:function(){try{e.texStorage3D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},texSubImage2D:function(){try{e.texSubImage2D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},texSubImage3D:function(){try{e.texSubImage3D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D(...arguments)}catch(t){(0,i.z3S)("WebGLState:",t)}},scissor:function(t){!1===z.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),z.copy(t))},viewport:function(t){!1===B.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor
2(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),r.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.pixelStorei(e.PACK_ROW_LENGTH,0),e.pixelStorei(e.PACK_SKIP_PIXELS,0),e.pixelStorei(e.PACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_ROW_LENGTH,0),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_PIXELS,0),e.pixelStorei(e.UNPACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),l={},c={},U=null,D={},u={},h=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,_=null,y=null,x=null,b=null,S=new i.Q1f(0,0,0),M=0,w=!1,T=null,E=null,A=null,C=null,R=null,z.set(0,0,e.canvas.width,e.canvas.height),B.set(0,0,e.canvas.width,e.canvas.height),n.reset(),r.reset(),a.reset()}}}function Bt(e,t,n,r,a,s,o){const l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,c="undefined"!==typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new i.I9Y,h=new WeakMap,d=new Set;let p;const f=new WeakMap;let m=!1;try{m="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(X){}function g(e,t){return m?new OffscreenCanvas(e,t):(0,i.qq$)("canvas")}function v(e,t,n){let r=1;const a=j(e);if((a.width>n||a.height>n)&&(r=n/Math.max(a.width,a.height)),r<1){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!==typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(r*a.width),s=Math.floor(r*a.height);void 0===p&&(p=g(n,s));const o=t?g(n,s):p;o.width=n,o.height=s;return o.getContext("2d").drawImage(e,0,0,n,s),(0,i.R8M)("WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+n+"x"+s+")."),o}return"data"in e&&(0,i.R8M)("WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+")."),e}return e}function _(e){return e.generateMipmaps}function y(t){e.generateMipmap(t)}function x(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function b(n,r,a,s,o){let l,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(null!==n){if(void 0!==e[n])return e[n];(0,i.R8M)("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}s&&(l=t.get("EXT_texture_norm16"),l||(0,i.R8M)("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let u=r;if(r===e.RED&&(a===e.FLOAT&&(u=e.R32F),a===e.HALF_FLOAT&&(u=e.R16F),a===e.UNSIGNED_BYTE&&(u=e.R8),a===e.UNSIGNED_SHORT&&l&&(u=l.R16_EXT),a===e.SHORT&&l&&(u=l.R16_SNORM_EXT)),r===e.RED_INTEGER&&(a===e.UNSIGNED_BYTE&&(u=e.R8UI),a===e.UNSIGNED_SHORT&&(u=e.R16UI),a===e.UNSIGNED_INT&&(u=e.R32UI),a===e.BYTE&&(u=e.R8I),a===e.SHORT&&(u=e.R16I),a===e.INT&&(u=e.R32I)),r===e.RG&&(a===e.FLOAT&&(u=e.RG32F),a===e.HALF_FLOAT&&(u=e.RG16F),a===e.UNSIGNED_BYTE&&(u=e.RG8),a===e.UNSIGNED_SHORT&&l&&(u=l.RG16_EXT),a===e.SHORT&&l&&(u=l.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(a===e.UNSIGNED_BYTE&&(u=e.RG8UI),a===e.UNSIGNED_SHORT&&(u=e.RG16UI),a===e.UNSIGNED_INT&&(u=e.RG32UI),a===e.BYTE&&(u=e.RG8I),a===e.SHORT&&(u=e.RG16I),a===e.INT&&(u=e.RG32I)),r===e.RGB_INTEGER&&(a===e.UNSIGNED_BYTE&&(u=e.RGB8UI),a===e.UNSIGNED_SHORT&&(u=e.RGB16UI),a===e.UNSIGNED_INT&&(u=e.RGB32UI),a===e.BYTE&&(u=e.RGB8I),a===e.SHORT&&(u=e.RGB16I),a===e.INT&&(u=e.RGB32I)),r===e.RGBA_INTEGER&&(a===e.UNSIGNED_BYTE&&(u=e.RGBA8UI),a===e.UNSIGNED_SHORT&&(u=e.RGBA16UI),a===e.UNSIGNED_INT&&(u=e.RGBA32UI),a===e.BYTE&&(u=e.RGBA8I),a===e.SHORT&&(u=e.RGBA16I),a===e.INT&&(u=e.RGBA32I)),r===e.RGB&&(a===e.UNSIGNED_SHORT&&l&&(u=l.RGB16_EXT),a===e.SHORT&&l&&(u=l.RGB16_SNORM_EXT),a===e.UNSIGNED_INT_5_9_9_9_REV&&(u=e.RGB9_E5),a===e.UNSIGNED_INT_10F_11F_11F_REV&&(u=e.R11F_G11F_B10F)),r===e.RGBA){const t=c?i.VxR:i.ppV.getTransfer(o);a===e.FLOAT&&(u=e.RGBA32F),a===e.HALF_FLOAT&&(u=e.RGBA16F),a===e.UNSIGNED_BYTE&&(u=t===i.KLL?e.SRGB8_ALPHA8:e.RGBA8),a===e.UNSIGNED_SHORT&&l&&(u=l.RGBA16_EXT),a===e.SHORT&&l&&(u=l.RGBA16_SNORM_EXT),a===e.UNSIGNED_SHORT_4_4_4_4&&(u=e.RGBA4),a===e.UNSIGNED_SHORT_5_5_5_1&&(u=e.RGB5_A1)}return u!==e.R16F&&u!==e.R32F&&u!==e.RG16F&&u!==e.RG32F&&u!==e.RGBA16F&&u!==e.RGBA32F||t.get("EXT_color_buffer_float"),u}function S(t,n){let r;return t?null===n||n===i.bkx||n===i.V3x?r=e.DEPTH24_STENCIL8:n===i.RQf?r=e.DEPTH32F_STENCIL8:n===i.cHt&&(r=e.DEPTH24_STENCIL8,(0,i.R8M)("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===i.bkx||n===i.V3x?r=e.DEPTH_COMPONENT24:n===i.RQf?r=e.DEPTH_COMPONENT32F:n===i.cHt&&(r=e.DEPTH_COMPONENT16),r}function M(e,t){return!0===_(e)||e.isFramebufferTexture&&e.minFilter!==i.hxR&&e.minFilter!==i.k6q?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function w(e){const t=e.target;t.removeEventListener("dispose",w),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=f.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&E(e),0===Object.keys(i).length&&f.delete(n)}r.remove(e)}(t),t.isVideoTexture&&h.delete(t),t.isHTMLTexture&&d.delete(t)}function T(t){const n=t.target;n.removeEventListener("dispose",T),function(t){const n=r.get(t);t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture));
vendor: 7,255 bytes, line 2
2if(t.isWebGLCubeRenderTarget)for(let r=0;r<6;r++){if(Array.isArray(n.__webglFramebuffer[r]))for(let t=0;t<n.__webglFramebuffer[r].length;t++)e.deleteFramebuffer(n.__webglFramebuffer[r][t]);else e.deleteFramebuffer(n.__webglFramebuffer[r]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[r])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=t.textures;for(let a=0,s=i.length;a<s;a++){const t=r.get(i[a]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),o.memory.textures--),r.remove(i[a])}r.remove(t)}(n)}function E(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete f.get(i)[n.__cacheKey],o.memory.textures--}let A=0;function C(t,a){const s=r.get(t);if(t.isVideoTexture&&function(e){const t=o.render.frame;h.get(e)!==t&&(h.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&!0!==t.isExternalTexture&&t.version>0&&s.__version!==t.version){const e=t.image;if(null===e)(0,i.R8M)("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void D(s,t,a);(0,i.R8M)("WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(s.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+a)}const R={[i.GJx]:e.REPEAT,[i.ghU]:e.CLAMP_TO_EDGE,[i.kTW]:e.MIRRORED_REPEAT},P={[i.hxR]:e.NEAREST,[i.pHI]:e.NEAREST_MIPMAP_NEAREST,[i.Cfg]:e.NEAREST_MIPMAP_LINEAR,[i.k6q]:e.LINEAR,[i.kRr]:e.LINEAR_MIPMAP_NEAREST,[i.$_I]:e.LINEAR_MIPMAP_LINEAR},I={[i.amv]:e.NEVER,[i.FFZ]:e.ALWAYS,[i.vim]:e.LESS,[i.TiK]:e.LEQUAL,[i.kO0]:e.EQUAL,[i.gWB]:e.GEQUAL,[i.eoi]:e.GREATER,[i.jzd]:e.NOTEQUAL};function L(n,s){if(s.type!==i.RQf||!1!==t.has("OES_texture_float_linear")||s.magFilter!==i.k6q&&s.magFilter!==i.kRr&&s.magFilter!==i.Cfg&&s.magFilter!==i.$_I&&s.minFilter!==i.k6q&&s.minFilter!==i.kRr&&s.minFilter!==i.Cfg&&s.minFilter!==i.$_I||(0,i.R8M)("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,R[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,R[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,R[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,P[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,P[s.minFilter]),s.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,I[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===i.hxR)return;if(s.minFilter!==i.Cfg&&s.minFilter!==i.$_I)return;if(s.type===i.RQf&&!1===t.has("OES_texture_float_linear"))return;if(s.anisotropy>1||r.get(s).__currentAnisotropy){const i=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,a.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy}}}function N(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let a=f.get(r);void 0===a&&(a={},f.set(r,a));const s=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,i=!0),a[s].usedTimes++;const r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&E(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return i}function U(e,t,n){return Math.floor(Math.floor(e/n)/t)}function D(t,o,l){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);const u=N(t,o),h=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+l);const p=r.get(h);if(h.version!==p.__version||!0===u){n.activeTexture(e.TEXTURE0+l);if(!1===("undefined"!==typeof ImageBitmap&&o.image instanceof ImageBitmap)){const t=i.ppV.getPrimaries(i.ppV.workingColorSpace),r=o.colorSpace===i.jf0?null:i.ppV.getPrimaries(o.colorSpace),a=o.colorSpace===i.jf0||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,a)}n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment);let t=v(o.image,!1,a.maxTextureSize);t=W(o,t);const r=s.convert(o.format,o.colorSpace),f=s.convert(o.type);let m,g=b(o.internalFormat,r,f,o.normalized,o.colorSpace,o.isVideoTexture);L(c,o);const x=o.mipmaps,w=!0!==o.isVideoTexture,T=void 0===p.__version||!0===u,E=h.dataReady,A=M(o,t);if(o.isDepthTexture)g=S(o.format===i.dcC,o.type),T&&(w?n.texStorage2D(e.TEXTURE_2D,1,g,t.width,t.height):n.texImage2D(e.TEXTURE_2D,0,g,t.width,t.height,0,r,f,null));else if(o.isDataTexture)if(x.length>0){w&&T&&n.texStorage2D(e.TEXTURE_2D,A,g,x[0].width,x[0].height);for(let t=0,i=x.length;t<i;t++)m=x[t],w?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,r,f,m.data):n.texImage2D(e.TEXTURE_2D,t,g,m.width,m.height,0,r,f,m.data);o.generateMipmaps=!1}else w?(T&&n.texStorage2D(e.TEXTURE_2D,A,g,t.width,t.height),E&&function(t,i,r,a){const s=t.updateRanges;if(0===s.length)n.texSubImage2D(e.TEXTURE_2D,0,0,0,i.width,i.height,r,a,i.data);else{s.sort((e,t)=>e.start-t.start);let o=0;for(let e=1;e<s.length;e++){const t=s[o],n=s[e],r=t.start+t.count,a=U(n.start,i.width,4),l=U(t.start,i.width,4);n.start<=r+1&&a===l&&U(n.start+n.count-1,i.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++o,s[o]=n)}s.length=o+1;const l=n.getParameter(e.UNPACK_ROW_LENGTH),c=n.getParameter(e.UNPACK_SKIP_PIXELS),u=n.getParameter(e.UNPACK_SKIP_ROWS);n.pixelStorei(e.UNPACK_ROW_LENGTH,i.width);for(let t=0,h=s.length;t<h;t++){const o=s[t],l=Math.floor(o.start/4),c=Math.ceil(o.count/4),u=l%i.width,h=Math.floor(l/i.width),d=c,p=1;n.pixelStorei(e.UNPACK_SKIP_PIXELS,u),n.pixelStorei(e.UNPACK_SKIP_ROWS,h),n.texSubImage2D(e.TEXTURE_2D,0,u,h,d,p,r,a,i.data)}t.clearUpdateRanges(),n.pixelStorei(e.UNPACK_ROW_LENGTH,l),n.pixelStorei(e.UNPACK_SKIP_PIXELS,c),n.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}(o,t,r,f)):n.texImage2D(e.TEXTURE_2D,0,g,t.width,t.height,0,r,f,t.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){w&&T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,A,g,x[0].width,x[0].height,t.depth);for(let a=0,s=x.length;a<s;a++)if(m=x[a],o.format!==i.GWd)if(null!==r)if(w){if(E)if(o.layerUpdates.size>0){const t=(0,i.Nex)(m.width,m.height,o.format,o.type);for(const i of o.layerUpdates){const s=m.data.subarray(i*t/m.data.BYTES_PER_ELEMENT,(i+1)
2*t/m.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,a,0,0,i,m.width,m.height,1,r,s)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,a,0,0,0,m.width,m.height,t.depth,r,m.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,a,g,m.width,m.height,t.depth,0,m.data,0,0);else(0,i.R8M)("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else w?E&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,a,0,0,0,m.width,m.height,t.depth,r,f,m.data):n.texImage3D(e.TEXTURE_2D_ARRAY,a,g,m.width,m.height,t.depth,0,r,f,m.data)}else{w&&T&&n.texStorage2D(e.TEXTURE_2D,A,g,x[0].width,x[0].height);for(let t=0,a=x.length;t<a;t++)m=x[t],o.format!==i.GWd?null!==r?w?E&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,r,m.data):n.compressedTexImage2D(e.TEXTURE_2D,t,g,m.width,m.height,0,m.data):(0,i.R8M)("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,r,f,m.data):n.texImage2D(e.TEXTURE_2D,t,g,m.width,m.height,0,r,f,m.data)}else if(o.isDataArrayTexture)if(w){if(T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,A,g,t.width,t.height,t.depth),E)if(o.layerUpdates.size>0){const a=(0,i.Nex)(t.width,t.height,o.format,o.type);for(const i of o.layerUpdates){const s=t.data.subarray(i*a/t.data.BYTES_PER_ELEMENT,(i+1)
vendor: 5,074 bytes, line 2
2*a/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,i,t.width,t.height,1,r,f,s)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,f,t.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,g,t.width,t.height,t.depth,0,r,f,t.data);else if(o.isData3DTexture)w?(T&&n.texStorage3D(e.TEXTURE_3D,A,g,t.width,t.height,t.depth),E&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,f,t.data)):n.texImage3D(e.TEXTURE_3D,0,g,t.width,t.height,t.depth,0,r,f,t.data);else if(o.isFramebufferTexture){if(T)if(w)n.texStorage2D(e.TEXTURE_2D,A,g,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t<A;t++)n.texImage2D(e.TEXTURE_2D,t,g,i,a,0,r,f,null),i>>=1,a>>=1}}else if(o.isHTMLTexture){if("texElementImage2D"in e){const n=e.canvas;if(n.hasAttribute("layoutsubtree")||n.setAttribute("layoutsubtree","true"),t.parentNode!==n)return n.appendChild(t),d.add(o),n.onpaint=e=>{const t=e.changedElements;for(const n of d)t.includes(n.image)&&(n.needsUpdate=!0)},void n.requestPaint();if(3===e.texElementImage2D.length)e.texElementImage2D(e.TEXTURE_2D,e.RGBA8,t);else{const n=0,i=e.RGBA,r=e.RGBA,a=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,n,i,r,a,t)}e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(x.length>0){if(w&&T){const t=j(x[0]);n.texStorage2D(e.TEXTURE_2D,A,g,t.width,t.height)}for(let t=0,i=x.length;t<i;t++)m=x[t],w?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,r,f,m):n.texImage2D(e.TEXTURE_2D,t,g,r,f,m);o.generateMipmaps=!1}else if(w){if(T){const i=j(t);n.texStorage2D(e.TEXTURE_2D,A,g,i.width,i.height)}E&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,r,f,t)}else n.texImage2D(e.TEXTURE_2D,0,g,r,f,t);_(o)&&y(c),p.__version=h.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function O(t,i,a,o,c,u){const h=s.convert(a.format,a.colorSpace),d=s.convert(a.type),p=b(a.internalFormat,h,d,a.normalized,a.colorSpace),f=r.get(i),m=r.get(a);if(m.__renderTarget=i,!f.__hasExternalTextures){const t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,u,p,t,r,i.depth,0,h,d,null):n.texImage2D(c,u,p,t,r,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),G(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,c,m.__webglTexture,0,H(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,c,m.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function F(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,s=S(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;G(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,H(n),s,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,H(n),s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{const t=n.textures;for(let r=0;r<t.length;r++){const a=t[r],o=s.convert(a.format,a.colorSpace),c=s.convert(a.type),u=b(a.internalFormat,o,c,a.normalized,a.colorSpace);G(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,H(n),u,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,H(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function z(t,a,o){const c=!0===a.isWebGLCubeRenderTarget;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!a.depthTexture||!a.depthTexture.isDepthTexture)throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const u=r.get(a.depthTexture);if(u.__renderTarget=a,u.__webglTexture&&a.depthTexture.image.width===a.width&&a.depthTexture.image.height===a.height||(a.depthTexture.image.width=a.width,a.depthTexture.image.height=a.height,a.depthTexture.needsUpdate=!0),c){if(void 0===u.__webglInit&&(u.__webglInit=!0,a.depthTexture.addEventListener("dispose",w)),void 0===u.__webglTexture){u.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,u.__webglTexture),L(e.TEXTURE_CUBE_MAP,a.depthTexture);const t=s.convert(a.depthTexture.format),r=s.convert(a.depthTexture.type);let o;a.depthTexture.format===i.zdS?o=e.DEPTH_COMPONENT24:a.depthTexture.format===i.dcC&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,a.width,a.height,0,t,r,null)}}else C(a.depthTexture,0);const h=u.__webglTexture,d=H(a),p=c?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,f=a.depthTexture.format===i.dcC?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(a.depthTexture.format===i.zdS)G(a)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,f,p,h,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,f,p,h,0);else{if(a.depthTexture.format!==i.dcC)throw new Error("THREE.WebGLTextures: Unknown depthTexture format.");G(a)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,f,p,h,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,f,p,h,0)}}
vendor: 26,202 bytes, line 2
2function B(t){const i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(i.__boundDepthTexture!==t.depthTexture){const e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){const t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)z(i.__webglFramebuffer[e],t,e);else{const e=t.texture.mipmaps;e&&e.length>0?z(i.__webglFramebuffer[0],t,0):z(i.__webglFramebuffer,t,0)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),void 0===i.__webglDepthbuffer[r])i.__webglDepthbuffer[r]=e.createRenderbuffer(),F(i.__webglDepthbuffer[r],t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{const r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),F(i.__webglDepthbuffer,t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}const k=[],V=[];function H(e){return Math.min(a.maxSamples,e.samples)}function G(e){const n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function W(e,t){const n=e.colorSpace,r=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==i.Zr2&&n!==i.jf0&&(i.ppV.getTransfer(n)===i.KLL?r===i.GWd&&a===i.OUM||(0,i.R8M)("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):(0,i.z3S)("WebGLTextures: Unsupported texture color space:",n)),t}function j(e){return"undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):"undefined"!==typeof VideoFrame&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=function(){const e=A;return e>=a.maxTextures&&(0,i.R8M)("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+a.maxTextures),A+=1,e},this.resetTextureUnits=function(){A=0},this.getTextureUnits=function(){return A},this.setTextureUnits=function(e){A=e},this.setTexture2D=C,this.setTexture2DArray=function(t,i){const a=r.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?D(a,t,i):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i))},this.setTexture3D=function(t,i){const a=r.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?D(a,t,i):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){const l=r.get(t);!0!==t.isCubeDepthTexture&&t.version>0&&l.__version!==t.version?function(t,o,l){if(6!==o.image.length)return;const c=N(t,o),u=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+l);const h=r.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(e.TEXTURE0+l);const t=i.ppV.getPrimaries(i.ppV.workingColorSpace),r=o.colorSpace===i.jf0?null:i.ppV.getPrimaries(o.colorSpace),d=o.colorSpace===i.jf0||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)m[e]=p||f?f?o.image[e].image:o.image[e]:v(o.image[e],!0,a.maxCubemapSize),m[e]=W(o,m[e]);const g=m[0],x=s.convert(o.format,o.colorSpace),S=s.convert(o.type),w=b(o.internalFormat,x,S,o.normalized,o.colorSpace),T=!0!==o.isVideoTexture,E=void 0===h.__version||!0===c,A=u.dataReady;let C,R=M(o,g);if(L(e.TEXTURE_CUBE_MAP,o),p){T&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,R,w,g.width,g.height);for(let t=0;t<6;t++){C=m[t].mipmaps;for(let r=0;r<C.length;r++){const a=C[r];o.format!==i.GWd?null!==x?T?A&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,a.width,a.height,x,a.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,w,a.width,a.height,0,a.data):(0,i.R8M)("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,a.width,a.height,x,S,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,w,a.width,a.height,0,x,S,a.data)}}}else{if(C=o.mipmaps,T&&E){C.length>0&&R++;const t=j(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,R,w,t.width,t.height)}for(let t=0;t<6;t++)if(f){T?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,x,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,m[t].width,m[t].height,0,x,S,m[t].data);for(let i=0;i<C.length;i++){const r=C[i].image[t].image;T?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,r.width,r.height,x,S,r.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,w,r.width,r.height,0,x,S,r.data)}}else{T?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,x,S,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,x,S,m[t]);for(let i=0;i<C.length;i++){const r=C[i];T?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,x,S,r.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,w,x,S,r.image[t])}}}_(o)&&y(e.TEXTURE_CUBE_MAP),h.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(l,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,i){const a=r.get(t);void 0!==n&&O(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&B(t)},this.setupRenderTarget=function(t){const i=t.texture,a=r.get(t),l=r.get(i);t.addEventListener("dispose",T);const c=t.textures,u=!0===t.isWebGLCubeRenderTarget,h=c.length>1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),u){a.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){a.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)a.__webglFramebuffer[t][n]=e.createFramebuffer()}else a.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){a.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)a.__webglFramebuffer[t]=e.createFramebuffer()}else a.__webglFramebuffer=e.createFramebuffer();if(h)for(let t=0,n=c.length;t<n;t++){const n=r.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===G(t)){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,a.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const i=c[n];a.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,a.__webglColorRenderbuffer[n]);const r=s.convert(i.format,i.colorSpace),o=s.convert(i.type),l=b(i.internalFormat,r,o,i.normalized,i.colorSpace,!0===t.isXRRenderTarget),u=H(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,a.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(a.__webglDepthRenderbuffer=e.createRenderbuffer(),F(a.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),L(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)O(a.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else O(a.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);_(i)&&y(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let i=0,s=c.length;i<s;i++){const s=c[i],o=r.get(s);let l=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(l,o.__webglTexture),L(l,s),O(a.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+i,l,0),_(s)&&y(l)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,l.__webglTexture),L(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)O(a.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else O(a.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);_(i)&&y(r),n.unbindTexture()}t.depthBuffer&&B(t)},this.updateRenderTargetMipmap=function(e){const t=e.textures;for(let i=0,a=t.length;i<a;i++){const a=t[i];if(_(a)){const t=x(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),y(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===G(t)){const i=t.textures,a=t.width,s=t.height;let o=e.COLOR_BUFFER_BIT;const l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),h=i.length>1;if(h)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);const d=t.texture.mipmaps;d&&d.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),h){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,e.NEAREST),!0===c&&(k.length=0,V.length=0,k.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(k.push(l),V.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,V)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,k))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&c){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=B,this.setupFrameBufferTexture=O,this.useMultisampledRTT=G,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function kt(e,t){return{convert:function(n){let r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.jf0;const s=i.ppV.getTransfer(a);if(n===i.OUM)return e.UNSIGNED_BYTE;if(n===i.Wew)return e.UNSIGNED_SHORT_4_4_4_4;if(n===i.gJ2)return e.UNSIGNED_SHORT_5_5_5_1;if(n===i.Dmk)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===i.yT7)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===i.tJf)return e.BYTE;if(n===i.fBL)return e.SHORT;if(n===i.cHt)return e.UNSIGNED_SHORT;if(n===i.Yuy)return e.INT;if(n===i.bkx)return e.UNSIGNED_INT;if(n===i.RQf)return e.FLOAT;if(n===i.ix0)return e.HALF_FLOAT;if(n===i.wrO)return e.ALPHA;if(n===i.HIg)return e.RGB;if(n===i.GWd)return e.RGBA;if(n===i.zdS)return e.DEPTH_COMPONENT;if(n===i.dcC)return e.DEPTH_STENCIL;if(n===i.VT0)return e.RED;if(n===i.ZQM)return e.RED_INTEGER;if(n===i.paN)return e.RG;if(n===i.TkQ)return e.RG_INTEGER;if(n===i.c90)return e.RGBA_INTEGER;if(n===i.IE4||n===i.Nz6||n===i.jR7||n===i.BXX)if(s===i.KLL){if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===i.IE4)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===i.Nz6)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===i.jR7)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===i.BXX)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===i.IE4)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===i.Nz6)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===i.jR7)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===i.BXX)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===i.k6Q||n===i.kTp||n===i.HXV||n===i.pBf){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(n===i.k6Q)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===i.kTp)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===i.HXV)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===i.pBf)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===i.CVz||n===i.Riy||n===i.KDk||n===i.BVL||n===i.gZr||n===i.OtU||n===i.jSS){if(r=t.get("WEBGL_compressed_texture_etc"),null===r)return null;if(n===i.CVz||n===i.Riy)return s===i.KLL?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===i.KDk)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC;if(n===i.BVL)return r.COMPRESSED_R11_EAC;if(n===i.gZr)return r.COMPRESSED_SIGNED_R11_EAC;if(n===i.OtU)return r.COMPRESSED_RG11_EAC;if(n===i.jSS)return r.COMPRESSED_SIGNED_RG11_EAC}if(n===i.qa3||n===i.B_h||n===i.czI||n===i.rSH||n===i.Qrf||n===i.psI||n===i.a5J||n===i._QJ||n===i.uB5||n===i.lyL||n===i.bC7||n===i.y3Z||n===i.ojs||n===i.S$4){if(r=t.get("WEBGL_compressed_texture_astc"),null===r)return null;if(n===i.qa3)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===i.B_h)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===i.czI)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===i.rSH)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===i.Qrf)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===i.psI)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===i.a5J)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===i._QJ)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===i.uB5)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===i.lyL)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===i.bC7)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===i.y3Z)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===i.ojs)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===i.S$4)return s===i.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===i.Fn||n===i.H23||n===i.W9U){if(r=t.get("EXT_texture_compression_bptc"),null===r)return null;if(n===i.Fn)return s===i.KLL?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===i.H23)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===i.W9U)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===i.Kef||n===i.XG_||n===i.HO_||n===i.CWW){if(r=t.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===i.Kef)return r.COMPRESSED_RED_RGTC1_EXT;if(n===i.XG_)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===i.HO_)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===i.CWW)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===i.V3x?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class Vt{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){const n=new i.rjZ(e.texture);e.depthNear===t.depthNear&&e.depthFar===t.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new i.BKk({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new i.eaF(new i.bdM(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Ht extends i.Qev{constructor(e,t){super();const n=this;let a=null,s=1,o=null,l="local-floor",c=1,u=null,h=null,d=null,p=null,f=null,m=null;const g="undefined"!==typeof XRWebGLBinding,v=new Vt,_={},y=t.getContextAttributes();let x=null,b=null;const S=[],M=[],w=new i.I9Y;let T=null;const E=new i.ubm;E.viewport=new i.IUQ;const A=new i.ubm;A.viewport=new i.IUQ;const C=[E,A],R=new i.nZQ;let P=null,I=null;function L(e){const t=M.indexOf(e.inputSource);if(-1===t)return;const n=S[t];void 0!==n&&(n.update(e.inputSource,e.frame,u||o),n.dispatchEvent({type:e.type,data:e.inputSource}))}function N(){a.removeEventListener("select",L),a.removeEventListener("selectstart",L),a.removeEventListener("selectend",L),a.removeEventListener("squeeze",L),a.removeEventListener("squeezestart",L),a.removeEventListener("squeezeend",L),a.removeEventListener("end",N),a.removeEventListener("inputsourceschange",U);for(let e=0;e<S.length;e++){const t=M[e];null!==t&&(M[e]=null,S[e].disconnect(t))}P=null,I=null,v.reset();for(const e in _)delete _[e];e.setRenderTarget(x),f=null,p=null,d=null,a=null,b=null,B.stop(),n.isPresenting=!1,e.setPixelRatio(T),e.setSize(w.width,w.height,!1),n.dispatchEvent({type:"sessionend"})}function U(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],i=M.indexOf(n);i>=0&&(M[i]=null,S[i].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let i=M.indexOf(n);if(-1===i){for(let e=0;e<S.length;e++){if(e>=M.length){M.push(n),i=e;break}if(null===M[e]){M[e]=n,i=e;break}}if(-1===i)break}const r=S[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=S[e];return void 0===t&&(t=new i.R3r,S[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=S[e];return void 0===t&&(t=new i.R3r,S[e]=t),t.getGripSpace()},this.getHand=function(e){let t=S[e];return void 0===t&&(t=new i.R3r,S[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){s=e,!0===n.isPresenting&&(0,i.R8M)("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){l=e,!0===n.isPresenting&&(0,i.R8M)("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(e){u=e},this.getBaseLayer=function(){return null!==p?p:f},this.getBinding=function(){return null===d&&g&&(d=new XRWebGLBinding(a,t)),d},this.getFrame=function(){return m},this.getSession=function(){return a},this.setSession=async function(r){if(a=r,null!==a){x=e.getRenderTarget(),a.addEventListener("select",L),a.addEventListener("selectstart",L),a.addEventListener("selectend",L),a.addEventListener("squeeze",L),a.addEventListener("squeezestart",L),a.addEventListener("squeezeend",L),a.addEventListener("end",N),a.addEventListener("inputsourceschange",U),!0!==y.xrCompatible&&await t.makeXRCompatible(),T=e.getPixelRatio(),e.getSize(w);if(g&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,r=null,o=null;y.depth&&(o=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=y.stencil?i.dcC:i.zdS,r=y.stencil?i.V3x:i.bkx);const l={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:s};d=this.getBinding(),p=d.createProjectionLayer(l),a.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),b=new i.nWS(p.textureWidth,p.textureHeight,{format:i.GWd,type:i.OUM,depthTexture:new i.VCu(p.textureWidth,p.textureHeight,r,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:!1===p.ignoreDepthValues,resolveStencilBuffer:!1===p.ignoreDepthValues})}else{const n={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(a,t,n),a.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),b=new i.nWS(f.framebufferWidth,f.framebufferHeight,{format:i.GWd,type:i.OUM,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:!1===f.ignoreDepthValues,resolveStencilBuffer:!1===f.ignoreDepthValues})}b.isXRRenderTarget=!0,this.setFoveation(c),u=null,o=await a.requestReferenceSpace(l),B.setContext(a),B.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==a)return a.environmentBlendMode},this.getDepthTexture=function(){return v.getDepthTexture()};const D=new i.Pq0,O=new i.Pq0;function F(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===a)return;let t=e.near,n=e.far;null!==v.texture&&(v.depthNear>0&&(t=v.depthNear),v.depthFar>0&&(n=v.depthFar)),R.near=A.near=E.near=t,R.far=A.far=E.far=n,P===R.near&&I===R.far||(a.updateRenderState({depthNear:R.near,depthFar:R.far}),P=R.near,I=R.far),R.layers.mask=6|e.layers.mask,E.layers.mask=-5&R.layers.mask,A.layers.mask=-3&R.layers.mask;const r=e.parent,s=R.cameras;F(R,r);for(let i=0;i<s.length;i++)F(s[i],r);2===s.length?function(e,t,n){D.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(n.matrixWorld);const i=D.distanceTo(O),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],d=s*u,p=s*h,f=i/(-u+h),m=f*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===r[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{const t=s+f,n=o+f,r=d-m,a=p+(i-m),u=l*o/n*t,h=c*o/n*t;e.projectionMatrix.makePerspective(r,a,u,h,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(R,E,A):R.projectionMatrix.copy(E.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*i.a55*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,R,r)},this.getCamera=function(){return R},this.getFoveation=function(){if(null!==p||null!==f)return c},this.setFoveation=function(e){c=e,null!==p&&(p.fixedFoveation=e),null!==f&&void 0!==f.fixedFoveation&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==v.texture},this.getDepthSensingMesh=function(){return v.getMesh(R)},this.getCameraTexture=function(e){return _[e]};let z=null;const B=new r;B.setAnimationLoop(function(t,r){if(h=r.getViewerPose(u||o),m=r,null!==h){const t=h.views;null!==f&&(e.setRenderTargetFramebuffer(b,f.framebuffer),e.setRenderTarget(b));let r=!1;t.length!==R.cameras.length&&(R.cameras.length=0,r=!0);for(let n=0;n<t.length;n++){const a=t[n];let s=null;if(null!==f)s=f.getViewport(a);else{const t=d.getViewSubImage(p,a);s=t.viewport,0===n&&(e.setRenderTargetTextures(b,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(b))}let o=C[n];void 0===o&&(o=new i.ubm,o.layers.enable(n),o.viewport=new i.IUQ,C[n]=o),o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(a.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(s.x,s.y,s.width,s.height),0===n&&(R.matrix.copy(o.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),!0===r&&R.cameras.push(o)}const s=a.enabledFeatures;if(s&&s.includes("depth-sensing")&&"gpu-optimized"==a.depthUsage&&g){d=n.getBinding();const e=d.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&v.init(e,a.renderState)}if(s&&s.includes("camera-access")&&g){e.state.unbindTexture(),d=n.getBinding();for(let e=0;e<t.length;e++){const n=t[e].camera;if(n){let e=_[n];e||(e=new i.rjZ,_[n]=e);const t=d.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<S.length;e++){const t=M[e],n=S[e];null!==t&&void 0!==n&&n.update(t,r,u||o)}z&&z(t,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),m=null}),this.setAnimationLoop=function(e){z=e},this.dispose=function(){}}}const Gt=new i.kn4,Wt=new i.dwI;function jt(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===i.hsX&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.
vendor: 4,699 bytes, line 2
2normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===i.hsX&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);const a=t.get(r),s=a.envMap,o=a.envMapRotation;s&&(e.envMap.value=s,e.envMapRotation.value.setFromMatrix4(Gt.makeRotationFromEuler(o)).transpose(),s.isCubeTexture&&!1===s.isRenderTargetTexture&&e.envMapRotation.value.premultiply(Wt),e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,(0,i._Ut)(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,a,s,o,l){a.isNodeMaterial?a.uniformsNeedUpdate=!1:a.isMeshBasicMaterial?r(e,a):a.isMeshLambertMaterial?(r(e,a),a.envMap&&(e.envMapIntensity.value=a.envMapIntensity)):a.isMeshToonMaterial?(r(e,a),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,a)):a.isMeshPhongMaterial?(r(e,a),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,a),a.envMap&&(e.envMapIntensity.value=a.envMapIntensity)):a.isMeshStandardMaterial?(r(e,a),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform));e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform));t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,a),a.isMeshPhysicalMaterial&&function(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===i.hsX&&e.clearcoatNormalScale.value.negate()));t.dispersion>0&&(e.dispersion.value=t.dispersion);t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}
vendor: 5,343 bytes, line 2
2(e,a,l)):a.isMeshMatcapMaterial?(r(e,a),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,a)):a.isMeshDepthMaterial?r(e,a):a.isMeshDistanceMaterial?(r(e,a),function(e,n){const i=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),e.nearDistance.value=i.shadow.camera.near,e.farDistance.value=i.shadow.camera.far}(e,a)):a.isMeshNormalMaterial?r(e,a):a.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,a),a.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,a)):a.isPointsMaterial?function(e,t,i,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*r,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,a,s,o):a.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,a):a.isShadowMaterial?(e.color.value.copy(a.color),e.opacity.value=a.opacity):a.isShaderMaterial&&(a.uniformsNeedUpdate=!1)}}}function Xt(e,t,n,r){let a={},s={},o=[];const l=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(t,n,i,r){if(!0===function(e,t,n,i){const r=e.value,a=t+"_"+n;if(void 0===i[a])return"number"===typeof r||"boolean"===typeof r?i[a]=r:ArrayBuffer.isView(r)?i[a]=r.slice():i[a]=r.clone(),!0;{const e=i[a];if("number"===typeof r||"boolean"===typeof r){if(e!==r)return i[a]=r,!0}else{if(ArrayBuffer.isView(r))return!0;if(!1===e.equals(r))return e.copy(r),!0}}return!1}(t,n,i,r)){const n=t.__offset,i=t.value;if(Array.isArray(i)){let e=0;for(let n=0;n<i.length;n++){const r=i[n],a=h(r);u(r,t.__data,e),"number"===typeof r||"boolean"===typeof r||r.isMatrix3||ArrayBuffer.isView(r)||(e+=a.storage/Float32Array.BYTES_PER_ELEMENT)}}else u(i,t.__data,0);e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}function u(e,t,n){"number"===typeof e||"boolean"===typeof e?t[0]=e:e.isMatrix3?(t[0]=e.elements[0],t[1]=e.elements[1],t[2]=e.elements[2],t[3]=0,t[4]=e.elements[3],t[5]=e.elements[4],t[6]=e.elements[5],t[7]=0,t[8]=e.elements[6],t[9]=e.elements[7],t[10]=e.elements[8],t[11]=0):ArrayBuffer.isView(e)?t.set(new e.constructor(e.buffer,e.byteOffset,t.length)):e.toArray(t,n)}function h(e){const t={boundary:0,storage:0};return"number"===typeof e||"boolean"===typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?(0,i.R8M)("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):(0,i.R8M)("WebGLRenderer: Unsupported uniform value type.",e),t}function d(t){const n=t.target;n.removeEventListener("dispose",d);const i=o.indexOf(n.__bindingPointIndex);o.splice(i,1),e.deleteBuffer(a[n.id]),delete a[n.id],delete s[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,u){let p=a[n.id];void 0===p&&(!function(e){const t=e.uniforms;let n=0;const i=16;for(let a=0,s=t.length;a<s;a++){const e=Array.isArray(t[a])?t[a]:[t[a]];for(let t=0,r=e.length;t<r;t++){const r=e[t],a=Array.isArray(r.value)?r.value:[r.value];for(let e=0,t=a.length;e<t;e++){const t=h(a[e]),s=n%i,o=s%t.boundary,l=s+o;n+=o,0!==l&&i-l<t.storage&&(n+=i-l),r.__data=new Float32Array(t.storage/Float32Array.BYTES_PER_ELEMENT),r.__offset=n,n+=t.storage}}}const r=n%i;r>0&&(n+=i-r);e.__size=n,e.__cache={}}(n),p=function(t){const n=function(){for(let e=0;e<l;e++)if(-1===o.indexOf(e))return o.push(e),e;return(0,i.z3S)("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),a=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,a,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),a[n.id]=p,n.addEventListener("dispose",d));const f=u.program;r.updateUBOMapping(n,f);const m=t.render.frame;s[n.id]!==m&&(!function(t){const n=a[t.id],i=t.uniforms,r=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let e=0,a=i.length;e<a;e++){const t=i[e];if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)c(t[n],e,n,r);else c(t,e,0,r)}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),s[n.id]=m)},dispose:function(){for(const t in a)e.deleteBuffer(a[t]);o=[],a={},s={}}}}Wt.set(-1,0,0,0,1,0,0,0,1);const qt=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10
2751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Yt=null;class Zt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.canvas,n=void 0===t?(0,i.lPF)():t,s=e.context,o=void 0===s?null:s,l=e.depth,c=void 0===l||l,u=e.stencil,h=void 0!==u&&u,v=e.alpha,_=void 0!==v&&v,y=e.antialias,x=void 0!==y&&y,b=e.premultipliedAlpha,S=void 0===b||b,M=e.preserveDrawingBuffer,w=void 0!==M&&M,T=e.powerPreference,E=void 0===T?"default":T,A=e.failIfMajorPerformanceCaveat,C=void 0!==A&&A,R=e.reversedDepthBuffer,P=void 0!==R&&R,I=e.outputBufferType,B=void 0===I?i.OUM:I;let V;if(this.isWebGLRenderer=!0,null!==o){if("undefined"!==typeof WebGLRenderingContext&&o instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");V=o.getContextAttributes().alpha}else V=_;const H=B,G=new Set([i.c90,i.TkQ,i.ZQM]),W=new Set([i.OUM,i.bkx,i.cHt,i.V3x,i.Wew,i.gJ2]),j=new Uint32Array(4),X=new Int32Array(4),q=new i.Pq0;let Y=null,Z=null;const J=[],K=[];let Q=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=i.y_p,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const $=this;let ee=!1,te=null,ne=null,ie=null,re=null;this._outputColorSpace=i.er$;let ae=0,se=0,oe=null,le=-1,ce=null;const ue=new i.IUQ,he=new i.IUQ;let de=null;const pe=new i.Q1f(0);let fe=0,me=n.width,ge=n.height,ve=1,_e=null,ye=null;const xe=new i.IUQ(0,0,me,ge),be=new i.IUQ(0,0,me,ge);let Se=!1;const Me=new i.PPD;let we=!1,Te=!1;const Ee=new i.kn4,Ae=new i.Pq0,Ce=new i.IUQ,Re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Pe=!1;function Ie(){return null===oe?ve:1}let Le,Ne,Ue,De,Oe,Fe,ze,Be,ke,Ve,He,Ge,We,Xe,qe,Ye,Ze,Je,Ke,Qe,$e,et,tt,nt=o;function it(e,t){return n.getContext(e,t)}try{const e={alpha:!0,depth:c,stencil:h,antialias:x,premultipliedAlpha:S,preserveDrawingBuffer:w,powerPreference:E,failIfMajorPerformanceCaveat:C};if("setAttribute"in n&&n.setAttribute("data-engine","three.js r".concat(i.sPf)),n.addEventListener("webglcontextlost",st,!1),n.addEventListener("webglcontextrestored",ot,!1),n.addEventListener("webglcontextcreationerror",lt,!1),null===nt){const t="webgl2";if(nt=it(t,e),null===nt)throw it(t)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(Et){throw(0,i.z3S)("WebGLRenderer: "+Et.message),Et}function rt(){Le=new N(nt),Le.init(),$e=new kt(nt,Le),Ne=new m(nt,Le,e,$e),Ue=new zt(nt,Le),Ne.reversedDepthBuffer&&P&&Ue.buffers.depth.setReversed(!0),ne=nt.createFramebuffer(),ie=nt.createFramebuffer(),re=nt.createFramebuffer(),De=new O(nt),Oe=ne
2w bt,Fe=new Bt(nt,Le,Ue,Oe,Ne,$e,De),ze=new L($),Be=new a(nt),et=new p(nt,Be),ke=new U(nt,Be,De,et),Ve=new z(nt,ke,Be,et,De),Je=new F(nt,Ne,Fe),qe=new g(Oe),He=new xt($,ze,Le,Ne,et,qe),Ge=new jt($,Oe),We=new Tt,Xe=new It(Le),Ze=new d($,ze,Ue,Ve,V,S),Ye=new Ft($,Ve,Ne),tt=new Xt(nt,De,Ne,Ue),Ke=new f(nt,Le,De),Qe=new D(nt,Le,De),De.programs=He.programs,$.capabilities=Ne,$.extensions=Le,$.properties=Oe,$.renderLists=We,$.shadowMap=Ye,$.state=Ue,$.info=De}rt(),H!==i.OUM&&(Q=new k(H,n.width,n.height,x,c,h));const at=new Ht($,nt);function st(e){e.preventDefault(),(0,i.Rm2)("WebGLRenderer: Context Lost."),ee=!0}function ot(){(0,i.Rm2)("WebGLRenderer: Context Restored."),ee=!1;const e=De.autoReset,t=Ye.enabled,n=Ye.autoUpdate,r=Ye.needsUpdate,a=Ye.type;rt(),De.autoReset=e,Ye.enabled=t,Ye.autoUpdate=n,Ye.needsUpdate=r,Ye.type=a}function lt(e){(0,i.z3S)("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function ct(e){const t=e.target;t.removeEventListener("dispose",ct),function(e){(function(e){const t=Oe.get(e).programs;void 0!==t&&(t.forEach(function(e){He.releaseProgram(e)}),e.isShaderMaterial&&He.releaseShaderCache(e))})(e),Oe.remove(e)}(t)}function ut(e,t,n){!0===e.transparent&&e.side===i.$EB&&!1===e.forceSinglePass?(e.side=i.hsX,e.needsUpdate=!0,St(e,t,n),e.side=i.hB5,e.needsUpdate=!0,St(e,t,n),e.side=i.$EB):St(e,t,n)}this.xr=at,this.getContext=function(){return nt},this.getContextAttributes=function(){return nt.getContextAttributes()},this.forceContextLoss=function(){const e=Le.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=Le.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ve},this.setPixelRatio=function(e){void 0!==e&&(ve=e,this.setSize(me,ge,!1))},this.getSize=function(e){return e.set(me,ge)},this.setSize=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];at.isPresenting?(0,i.R8M)("WebGLRenderer: Can't change size while VR device is presenting."):(me=e,ge=t,n.width=Math.floor(e*ve),n.height=Math.floor(t*ve),!0===r&&(n.style.width=e+"px",n.style.height=t+"px"),null!==Q&&Q.setSize(n.width,n.height),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(me*ve,ge*ve).floor()},this.setDrawingBufferSize=function(e,t,i){me=e,ge=t,ve=i,n.width=Math.floor(e*i),n.height=Math.floor(t*i),this.setViewport(0,0,e,t)},this.setEffects=function(e){if(H!==i.OUM){if(e)for(let t=0;t<e.length;t++)if(!0===e[t].isOutputPass){(0,i.R8M)("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}Q.setEffects(e||[])}else(0,i.z3S)("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.")},this.getCurrentViewport=function(e){return e.copy(ue)},this.getViewport=function(e){return e.copy(xe)},this.setViewport=function(e,t,n,i){e.isVector4?xe.set(e.x,e.y,e.z,e.w):xe.set(e,t,n,i),Ue.viewport(ue.copy(xe).multiplyScalar(ve).round())},this.getScissor=function(e){return e.copy(be)},this.setScissor=function(e,t,n,i){e.isVector4?be.set(e.x,e.y,e.z,e.w):be.set(e,t,n,i),Ue.scissor(he.copy(be).multiplyScalar(ve).round())},this.getScissorTest=function(){return Se},this.setScissorTest=function(e){Ue.setScissorTest(Se=e)},this.setOpaqueSort=function(e){_e=e},this.setTransparentSort=function(e){ye=e},this.getClearColor=function(e){return e.copy(Ze.getClearColor())},this.setClearColor=function(){Ze.setClearColor(...arguments)},this.getClearAlpha=function(){return Ze.getClearAlpha()},this.setClearAlpha=function(){Ze.setClearAlpha(...arguments)},this.clear=function(){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=0;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){let e=!1;if(null!==oe){const t=oe.texture.format;e=G.has(t)}if(e){const e=oe.texture.type,t=W.has(e),n=Ze.getClearColor(),i=Ze.getClearAlpha(),r=n.r,a=n.g,s=n.b;t?(j[0]=r,j[1]=a,j[2]=s,j[3]=i,nt.clearBufferuiv(nt.COLOR,0,j)):(X[0]=r,X[1]=a,X[2]=s,X[3]=i,nt.clearBufferiv(nt.COLOR,0,X))}else n|=nt.COLOR_BUFFER_BIT}e&&(n|=nt.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),t&&(n|=nt.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),0!==n&&nt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(e){e.setRenderer(this),te=e},this.dispose=function(){n.removeEventListener("webglcontextlost",st,!1),n.removeEventListener("webglcontextrestored",ot,!1),n.removeEventListener("webglcontextcreationerror",lt,!1),Ze.dispose(),We.dispose(),Xe.dis
vendor: 6,964 bytes, line 2
2pose(),Oe.dispose(),ze.dispose(),Ve.dispose(),et.dispose(),tt.dispose(),He.dispose(),at.dispose(),at.removeEventListener("sessionstart",dt),at.removeEventListener("sessionend",pt),ft.stop()},this.renderBufferDirect=function(e,t,n,r,a,s){null===t&&(t=Re);const o=a.isMesh&&a.matrixWorld.determinantAffine()<0,l=function(e,t,n,r,a){!0!==t.isScene&&(t=Re);Fe.resetTextureUnits();const s=t.fog,o=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?t.environment:null,l=null===oe?$.outputColorSpace:!0===oe.isXRRenderTarget?oe.texture.colorSpace:i.ppV.workingColorSpace,c=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,u=ze.get(r.envMap||o,c),h=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,d=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),p=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,m=!!n.morphAttributes.color;let g=i.y_p;r.toneMapped&&(null!==oe&&!0!==oe.isXRRenderTarget||(g=$.toneMapping));const v=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=void 0!==v?v.length:0,y=Oe.get(r),x=Z.state.lights;if(!0===we&&(!0===Te||e!==ce)){const t=e===ce&&r.id===le;qe.setState(r,e,t)}let b=!1;r.version===y.__version?y.needsLights&&y.lightsStateVersion!==x.state.version||y.outputColorSpace!==l||a.isBatchedMesh&&!1===y.batching?b=!0:a.isBatchedMesh||!0!==y.batching?a.isBatchedMesh&&!0===y.batchingColor&&null===a.colorTexture||a.isBatchedMesh&&!1===y.batchingColor&&null!==a.colorTexture||a.isInstancedMesh&&!1===y.instancing?b=!0:a.isInstancedMesh||!0!==y.instancing?a.isSkinnedMesh&&!1===y.skinning?b=!0:a.isSkinnedMesh||!0!==y.skinning?a.isInstancedMesh&&!0===y.instancingColor&&null===a.instanceColor||a.isInstancedMesh&&!1===y.instancingColor&&null!==a.instanceColor||a.isInstancedMesh&&!0===y.instancingMorph&&null===a.morphTexture||a.isInstancedMesh&&!1===y.instancingMorph&&null!==a.morphTexture||y.envMap!==u||!0===r.fog&&y.fog!==s?b=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===qe.numPlanes&&y.numIntersection===qe.numIntersection?(y.vertexAlphas!==h||y.vertexTangents!==d||y.morphTargets!==p||y.morphNormals!==f||y.morphColors!==m||y.toneMapping!==g||y.morphTargetsCount!==_||!!y.lightProbeGrid!==Z.state.lightProbeGridArray.length>0)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,y.__version=r.version);let S=y.currentProgram;!0===b&&(S=St(r,t,a),te&&r.isNodeMaterial&&te.onUpdateProgram(r,S,y));let M=!1,w=!1,T=!1;const E=S.getUniforms(),A=y.uniforms;Ue.useProgram(S.program)&&(M=!0,w=!0,T=!0);r.id!==le&&(le=r.id,w=!0);if(y.needsLights){const e=function(e,t){if(0===e.length)return null;if(1===e.length)return null!==e[0].texture?e[0]:null;q.setFromMatrixPosition(t.matrixWorld);for(let n=0,i=e.length;n<i;n++){const t=e[n];if(null!==t.texture&&t.boundingBox.containsPoint(q))return t}return null}(Z.state.lightProbeGridArray,a);y.lightProbeGrid!==e&&(y.lightProbeGrid=e,w=!0)}if(M||ce!==e){Ue.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),E.setValue(nt,"projectionMatrix",e.projectionMatrix),E.setValue(nt,"viewMatrix",e.matrixWorldInverse);const t=E.map.cameraPosition;void 0!==t&&t.setValue(nt,Ae.setFromMatrixPosition(e.matrixWorld)),Ne.logarithmicDepthBuffer&&E.setValue(nt,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&E.setValue(nt,"isOrthographic",!0===e.isOrthographicCamera),ce!==e&&(ce=e,w=!0,T=!0)}y.needsLights&&(x.state.directionalShadowMap.length>0&&E.setValue(nt,"directionalShadowMap",x.state.directionalShadowMap,Fe),x.state.spotShadowMap.length>0&&E.setValue(nt,"spotShadowMap",x.state.spotShadowMap,Fe),x.state.pointShadowMap.length>0&&E.setValue(nt,"pointShadowMap",x.state.pointShadowMap,Fe));if(a.isSkinnedMesh){E.setOptional(nt,a,"bindMatrix"),E.setOptional(nt,a,"bindMatrixInverse");const e=a.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),E.setValue(nt,"boneTexture",e.boneTexture,Fe))}a.isBatchedMesh&&(E.setOptional(nt,a,"batchingTexture"),E.setValue(nt,"batchingTexture",a._matricesTexture,Fe),E.setOptional(nt,a,"batchingIdTexture"),E.setValue(nt,"batchingIdTexture",a._indirectTexture,Fe),E.setOptional(nt,a,"batchingColorTexture"),null!==a._colorsTexture&&E.setValue(nt,"batchingColorTexture",a._colorsTexture,Fe));const C=n.morphAttributes;void 0===C.position&&void 0===C.normal&&void 0===C.color||Je.update(a,n,S);(w||y.receiveShadow!==a.receiveShadow)&&(y.receiveShadow=a.receiveShadow,E.setValue(nt,"receiveShadow",a.receiveShadow));(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&null===r.envMap&&null!==t.environment&&(A.envMapIntensity.value=t.environmentIntensity);void 0!==A.dfgLUT&&(A.dfgLUT.value=(null===Yt&&(Yt=new i.GYF(qt,16,16,i.paN,i.ix0),Yt.name="DFG_LUT",Yt.minFilter=i.k6q,Yt.magFilter=i.k6q,Yt.wrapS=i.ghU,Yt.wrapT=i.ghU,Yt.generateMipmaps=!1,Yt.needsUpdate=!0),Yt));if(w){if(E.setValue(nt,"toneMappingExposure",$.toneMappingExposure),y.needsLights&&(P=T,(R=A).ambientLightColor.needsUpdate=P,R.lightProbe.needsUpdate=P,R.directionalLights.needsUpdate=P,R.directionalLightShadows.needsUpdate=P,R.pointLights.needsUpdate=P,R.pointLightShadows.needsUpdate=P,R.spotLights.needsUpdate=P,R.spotLightShadows.needsUpdate=P,R.rectAreaLights.needsUpdate=P,R.hemisphereLights.needsUpdate=P),s&&!0===r.fog&&Ge.refreshFogUniforms(A,s),Ge.refreshMaterialUniforms(A,r,ve,ge,Z.state.transmissionRenderTarget[e.id]),y.needsLights&&y.lightProbeGrid){const e=y.lightProbeGrid;A.probesSH.value=e.texture,A.probesMin.value.copy(e.boundingBox.min),A.probesMax.value.copy(e.boundingBox.max),A.probesResolution.value.copy(e.resolution)}je.upload(nt,Mt(y),A,Fe)}var R,P;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(je.upload(nt,Mt(y),A,Fe),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&E.setValue(nt,"center",a.center);if(E.setValue(nt,"modelViewMatrix",a.modelViewMatrix),E.setValue(nt,"normalMatrix",a.normalMatrix),E.setValue(nt,"modelMatrix",a.matrixWorld),void 0!==r.uniformsGroups){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];tt.update(n,S),tt.bind(n,S)}}return S}(e,t,n,r,a);Ue.setMaterial(r,o);let c=n.index,u=1;if(!0===r.wireframe){if(c=ke.getWireframeAttribute(n),void 0===c)return;u=2}const h=n.drawRange,d=n.attributes.position;let p=h.start*u,f=(h.start+h.count)*u;null!==s&&(p=Math.max(p,s.start*u),f=Math.min(f,(s.start+s.count)*u)),null!==c?(p=Math.max(p,0),f=Math.min(f,c.count)):void 0!==d&&null!==d&&(p=Math.max(p,0),f=Math.min(f,d.count));const m=f-p;if(m<0||m===1/0)return;let g;et.setup(a,r,l,n,c);let v=Ke;if(null!==c&&(g=Be.get(c),v=Qe,v.setIndex(g)),a.isMesh)!0===r.wireframe?(Ue.setLineWidth(r.wireframeLinewidth*Ie()),v.setMode(nt.LINES)):v.setMode(nt.TRIANGLES);else if(a.isLine){let e=r.linewidth;void 0===e&&(e=1),Ue.setLineWidth(e*Ie()),a.isLineSegments?v.setMode(nt.LINES):a.isLine
vendor: 12,065 bytes, line 2
2Loop?v.setMode(nt.LINE_LOOP):v.setMode(nt.LINE_STRIP)}else a.isPoints?v.setMode(nt.POINTS):a.isSprite&&v.setMode(nt.TRIANGLES);if(a.isBatchedMesh)if(Le.get("WEBGL_multi_draw"))v.renderMultiDraw(a._multiDrawStarts,a._multiDrawCounts,a._multiDrawCount);else{const e=a._multiDrawStarts,t=a._multiDrawCounts,n=a._multiDrawCount,i=c?Be.get(c).bytesPerElement:1,s=Oe.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)s.setValue(nt,"_gl_DrawID",r),v.render(e[r]/i,t[r])}else if(a.isInstancedMesh)v.renderInstances(p,m,a.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(p,m,t)}else v.render(p,m)},this.compile=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=e),Z=Xe.get(n),Z.init(t),K.push(Z),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(Z.pushLight(e),e.castShadow&&Z.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(Z.pushLight(e),e.castShadow&&Z.pushShadow(e))}),Z.setupLights();const i=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;const t=e.material;if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++){const a=t[r];ut(a,n,e),i.add(a)}else ut(t,n,e),i.add(t)}),Z=K.pop(),i},this.compileAsync=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=this.compile(e,t,n);return new Promise(t=>{function n(){i.forEach(function(e){Oe.get(e).currentProgram.isReady()&&i.delete(e)}),0!==i.size?setTimeout(n,10):t(e)}null!==Le.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)})};let ht=null;function dt(){ft.stop()}function pt(){ft.start()}const ft=new r;function mt(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLightProbeGrid)Z.pushLightProbeGrid(e);else if(e.isLight)Z.pushLight(e),e.castShadow&&Z.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Me.intersectsSprite(e)){i&&Ce.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ee);const t=Ve.update(e),r=e.material;r.visible&&Y.push(e,t,r,n,Ce.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||Me.intersectsObject(e))){const t=Ve.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),Ce.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),Ce.copy(t.boundingSphere.center)),Ce.applyMatrix4(e.matrixWorld).applyMatrix4(Ee)),Array.isArray(r)){const i=t.groups;for(let a=0,s=i.length;a<s;a++){const s=i[a],o=r[s.materialIndex];o&&o.visible&&Y.push(e,t,o,n,Ce.z,s)}}else r.visible&&Y.push(e,t,r,n,Ce.z,null)}const r=e.children;for(let a=0,s=r.length;a<s;a++)mt(r[a],t,n,i)}function gt(e,t,n,i){const r=e.opaque,a=e.transmissive,s=e.transparent;Z.setupLightsView(n),!0===we&&qe.setGlobalState($.clippingPlanes,n),i&&Ue.viewport(ue.copy(i)),r.length>0&&_t(r,t,n),a.length>0&&_t(a,t,n),s.length>0&&_t(s,t,n),Ue.buffers.depth.setTest(!0),Ue.buffers.depth.setMask(!0),Ue.buffers.color.setMask(!0),Ue.setPolygonOffset(!1)}function vt(e,t,n,r){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;if(void 0===Z.state.transmissionRenderTarget[r.id]){const e=Le.has("EXT_color_buffer_half_float")||Le.has("EXT_color_buffer_float");Z.state.transmissionRenderTarget[r.id]=new i.nWS(1,1,{generateMipmaps:!0,type:e?i.ix0:i.OUM,minFilter:i.$_I,samples:Math.max(4,Ne.samples),stencilBuffer:h,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:i.ppV.workingColorSpace})}const a=Z.state.transmissionRenderTarget[r.id],s=r.viewport||ue;a.setSize(s.z*$.transmissionResolutionScale,s.w*$.transmissionResolutionScale);const o=$.getRenderTarget(),l=$.getActiveCubeFace(),c=$.getActiveMipmapLevel();$.setRenderTarget(a),$.getClearColor(pe),fe=$.getClearAlpha(),fe<1&&$.setClearColor(16777215,.5),$.clear(),Pe&&Ze.render(n);const u=$.toneMapping;$.toneMapping=i.y_p;const d=r.viewport;if(void 0!==r.viewport&&(r.viewport=void 0),Z.setupLightsView(r),!0===we&&qe.setGlobalState($.clippingPlanes,r),_t(e,n,r),Fe.updateMultisampleRenderTarget(a),Fe.updateRenderTargetMipmap(a),!1===Le.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let a=0,s=t.length;a<s;a++){const s=t[a],o=s.object,l=s.geometry,c=s.material,u=s.group;if(c.side===i.$EB&&o.layers.test(r.layers)){const t=c.side;c.side=i.hsX,c.needsUpdate=!0,yt(o,n,r,l,c,u),c.side=t,c.needsUpdate=!0,e=!0}}!0===e&&(Fe.updateMultisampleRenderTarget(a),Fe.updateRenderTargetMipmap(a))}$.setRenderTarget(o,l,c),$.setClearColor(pe,fe),void 0!==d&&(r.viewport=d),$.toneMapping=u}function _t(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){const a=e[r],s=a.object,o=a.geometry,l=a.group;let c=a.material;!0===c.allowOverride&&null!==i&&(c=i),s.layers.test(n.layers)&&yt(s,t,n,o,c,l)}}function yt(e,t,n,r,a,s){e.onBeforeRender($,t,n,r,a,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),a.onBeforeRender($,t,n,r,e,s),!0===a.transparent&&a.side===i.$EB&&!1===a.forceSinglePass?(a.side=i.hsX,a.needsUpdate=!0,$.renderBufferDirect(n,t,r,a,e,s),a.side=i.hB5,a.needsUpdate=!0,$.renderBufferDirect(n,t,r,a,e,s),a.side=i.$EB):$.renderBufferDirect(n,t,r,a,e,s),e.onAfterRender($,t,n,r,a,s)}function St(e,t,n){!0!==t.isScene&&(t=Re);const i=Oe.get(e),r=Z.state.lights,a=Z.state.shadowsArray,s=r.state.version,o=He.getParameters(e,r.state,a,t,n,Z.state.lightProbeGridArray),l=He.getProgramCacheKey(o);let c=i.programs;i.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,i.fog=t.fog;const u=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;i.envMap=ze.get(e.envMap||i.environment,u),i.envMapRotation=null!==i.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",ct),c=new Map,i.programs=c);let h=c.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===s)return wt(e,o),h}else o.uniforms=He.getUniforms(e),null!==te&&e.isNodeMaterial&&te.build(e,n,o),e.onBeforeCompile(o,$),h=He.acquireProgram(o,l),c.set(l,h),i.uniforms=o.uniforms;const d=i.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=qe.uniform),wt(e,o),i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=s,i.needsLights&&(d.ambientLightColor.value=r.state.ambient,d.lightProbe.value=r.state.probe,d.directionalLights.value=r.state.directional,d.directionalLightShadows.value=r.state.directionalShadow,d.spotLights.value=r.state.spot,d.spotLightShadows.value=r.state.spotShadow,d.rectAreaLights.value=r.state.rectArea,d.ltc_1.value=r.state.rectAreaLTC1,d.ltc_2.value=r.state.rectAreaLTC2,d.pointLights.value=r.state.point,d.pointLightShadows.value=r.state.pointShadow,d.hemisphereLights.value=r.state.hemi,d.directionalShadowMatrix.value=r.state.directionalShadowMatrix,d.spotLightMatrix.value=r.state.spotLightMatrix,d.spotLightMap.value=r.state.spotLightMap,d.pointShadowMatrix.value=r.state.pointShadowMatrix),i.lightProbeGrid=Z.state.lightProbeGridArray.length>0,i.currentProgram=h,i.uniformsList=null,h}function Mt(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=je.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function wt(e,t){const n=Oe.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}ft.setAnimationLoop(function(e){ht&&ht(e)}),"undefined"!==typeof self&&ft.setContext(self),this.setAnimationLoop=function(e){ht=e,at.setAnimationLoop(e),null===e?ft.stop():ft.start()},at.addEventListener("sessionstart",dt),at.addEventListener("sessionend",pt),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void(0,i.z3S)("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===ee)return;null!==te&&te.renderStart(e,t);const n=!0===at.enabled&&!0===at.isPresenting,r=null!==Q&&(null===oe||n)&&Q.begin($,oe);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0!==at.enabled||!0!==at.isPresenting||null!==Q&&!1!==Q.isCompositing()||(!0===at.cameraAutoUpdate&&at.updateCamera(t),t=at.getCamera()),!0===e.isScene&&e.onBeforeRender($,e,t,oe),Z=Xe.get(e,K.length),Z.init(t),Z.state.textureUnits=Fe.getTextureUnits(),K.push(Z),Ee.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Me.setFromProjectionMatrix(Ee,i.TdN,t.reversedDepth),Te=this.localClippingEnabled,we=qe.init(this.clippingPlanes,Te),Y=We.get(e,J.length),Y.init(),J.push(Y),!0===at.enabled&&!0===at.isPresenting){const e=$.xr.getDepthSensingMesh();null!==e&&mt(e,t,-1/0,$.sortObjects)}mt(e,t,0,$.sortObjects),Y.finish(),!0===$.sortObjects&&Y.sort(_e,ye,t.reversedDepth),Pe=!1===at.enabled||!1===at.isPresenting||!1===at.hasDepthSensing(),Pe&&Ze.addToRenderList(Y,e),this.info.render.frame++,!0===this.info.autoReset&&this.info.reset(),!0===we&&qe.beginShadows();const a=Z.state.shadowsArray;Ye.render(a,e,t),!0===we&&qe.endShadows();if(!1===(r&&Q.hasRenderPass())){const n=Y.opaque,i=Y.transmissive;if(Z.setupLights(),t.isArrayCamera){const r=t.cameras;if(i.length>0)for(let t=0,a=r.length;t<a;t++){vt(n,i,e,r[t])}Pe&&Ze.render(e);for(let t=0,n=r.length;t<n;t++){const n=r[t];gt(Y,e,n,n.viewport)}}else i.length>0&&vt(n,i,e,t),Pe&&Ze.render(e),gt(Y,e,t)}null!==oe&&0===se&&(Fe.updateMultisampleRenderTarget(oe),Fe.updateRenderTargetMipmap(oe)),r&&Q.end($),!0===e.isScene&&e.onAfterRender($,e,t),et.resetDefaultState(),le=-1,ce=null,K.pop(),K.length>0?(Z=K[K.length-1],Fe.setTextureUnits(Z.state.textureUnits),!0===we&&qe.setGlobalState($.clippingPlanes,Z.state.camera)):Z=null,J.pop(),Y=J.length>0?J[J.length-1]:null,null!==te&&te.renderEnd()},this.getActiveCubeFace=function(){return ae},this.getActiveMipmapLevel=function(){return se},this.getRenderTarget=function(){return oe},this.setRenderTargetTextures=function(e,t,n){const i=Oe.get(e);i.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===i.__autoAllocateDepthBuffer&&(i.__useRenderToTexture=!1),Oe.get(e.texture).__webglTexture=t,Oe.get(e.depthTexture).__webglTexture=i.__autoAllocateDepthBuffer?void 0:n,i.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){const n=Oe.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;oe=e,ae=t,se=n;let i=null,r=!1,a=!1;if(e){const s=Oe.get(e);if(void 0!==s.__useDefaultFramebuffer)return Ue.bindFramebuffer(nt.FRAMEBUFFER,s.__webglFramebuffer),ue.copy(e.viewport),he.copy(e.scissor),de=e.scissorTest,Ue.viewport(ue),Ue.scissor(he),Ue.setScissorTest(de),void(le=-1);if(void 0===s.__webglFramebuffer)Fe.setupRenderTarget(e);else if(s.__hasExternalTextures)Fe.rebindTextures(e,Oe.get(e.texture).__webglTexture,Oe.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){const t=e.depthTexture;if(s.__boundDepthTexture!==t){if(null!==t&&Oe.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");Fe.setupDepthRenderbuffer(e)}}const o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=Oe.get(e).__webglFramebuffer;
2e.isWebGLCubeRenderTarget?(i=Array.isArray(l[t])?l[t][n]:l[t],r=!0):i=e.samples>0&&!1===Fe.useMultisampledRTT(e)?Oe.get(e).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,ue.copy(e.viewport),he.copy(e.scissor),de=e.scissorTest}else ue.copy(xe).multiplyScalar(ve).floor(),he.copy(be).multiplyScalar(ve).floor(),de=Se;0!==n&&(i=ne);if(Ue.bindFramebuffer(nt.FRAMEBUFFER,i)&&Ue.drawBuffers(e,i),Ue.viewport(ue),Ue.scissor(he),Ue.setScissorTest(de),r){const i=Oe.get(e.texture);nt.framebufferTexture2D(nt.FRAMEBUFFER,nt.COLOR_ATTACHMENT0,nt.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(a){const i=t;for(let t=0;t<e.textures.length;t++){const r=Oe.get(e.textures[t]);nt.framebufferTextureLayer(nt.FRAMEBUFFER,nt.COLOR_ATTACHMENT0+t,r.__webglTexture,n,i)}}else if(null!==e&&0!==n){const t=Oe.get(e.texture);nt.framebufferTexture2D(nt.FRAMEBUFFER,nt.COLOR_ATTACHMENT0,nt.TEXTURE_2D,t.__webglTexture,n)}le=-1},this.readRenderTargetPixels=function(e,t,n,r,a,s,o){let l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(!e||!e.isWebGLRenderTarget)return void(0,i.z3S)("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let c=Oe.get(e).__webglFramebuffer;
2if(e.isWebGLCubeRenderTarget&&void 0!==o&&(c=c[o]),c){Ue.bindFramebuffer(nt.FRAMEBUFFER,c);try{const o=e.textures[l],c=o.format,u=o.type;if(e.textures.length>1&&nt.readBuffer(nt.COLOR_ATTACHMENT0+l),!Ne.textureFormatReadable(c))return void(0,i.z3S)("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!Ne.textureTypeReadable(u))return void(0,i.z3S)("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-a&&nt.readPixels(t,n,r,a,$e.convert(c),$e.convert(u),s)}finally{const e=null!==oe?Oe.get(oe).__webglFramebuffer:null;Ue.bindFramebuffer(nt.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,a,s,o){let l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let c=Oe.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(c=c[o]
vendor: 5,838 bytes, line 2
2),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-a){Ue.bindFramebuffer(nt.FRAMEBUFFER,c);const o=e.textures[l],u=o.format,h=o.type;if(e.textures.length>1&&nt.readBuffer(nt.COLOR_ATTACHMENT0+l),!Ne.textureFormatReadable(u))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ne.textureTypeReadable(h))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const d=nt.createBuffer();nt.bindBuffer(nt.PIXEL_PACK_BUFFER,d),nt.bufferData(nt.PIXEL_PACK_BUFFER,s.byteLength,nt.STREAM_READ),nt.readPixels(t,n,r,a,$e.convert(u),$e.convert(h),0);const p=null!==oe?Oe.get(oe).__webglFramebuffer:null;Ue.bindFramebuffer(nt.FRAMEBUFFER,p);const f=nt.fenceSync(nt.SYNC_GPU_COMMANDS_COMPLETE,0);return nt.flush(),await(0,i.jej)(nt,f,4),nt.bindBuffer(nt.PIXEL_PACK_BUFFER,d),nt.getBufferSubData(nt.PIXEL_PACK_BUFFER,0,s),nt.deleteBuffer(d),nt.deleteSync(f),s}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),s=null!==t?t.x:0,o=null!==t?t.y:0;Fe.setTexture2D(e,0),nt.copyTexSubImage2D(nt.TEXTURE_2D,n,0,0,s,o,r,a),Ue.unbindTexture()},this.copyTextureToTexture=function(e,t){let n,i,r,a,s,o,l,c,u,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const m=e.isCompressedTexture?e.mipmaps[f]:e.image;if(null!==h)n=h.max.x-h.min.x,i=h.max.y-h.min.y,r=h.isBox3?h.max.z-h.min.z:1,a=h.min.x,s=h.min.y,o=h.isBox3?h.min.z:0;else{const t=Math.pow(2,-p);n=Math.floor(m.width*t),i=Math.floor(m.height*t),r=e.isDataArrayTexture?m.depth:e.isData3DTexture?Math.floor(m.depth*t):1,a=0,s=0,o=0}null!==d?(l=d.x,c=d.y,u=d.z):(l=0,c=0,u=0);const g=$e.convert(t.format),v=$e.convert(t.type);let _;t.isData3DTexture?(Fe.setTexture3D(t,0),_=nt.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(Fe.setTexture2DArray(t,0),_=nt.TEXTURE_2D_ARRAY):(Fe.setTexture2D(t,0),_=nt.TEXTURE_2D),Ue.activeTexture(nt.TEXTURE0),Ue.pixelStorei(nt.UNPACK_FLIP_Y_WEBGL,t.flipY),Ue.pixelStorei(nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),Ue.pixelStorei(nt.UNPACK_ALIGNMENT,t.unpackAlignment);const y=Ue.getParameter(nt.UNPACK_ROW_LENGTH),x=Ue.getParameter(nt.UNPACK_IMAGE_HEIGHT),b=Ue.getParameter(nt.UNPACK_SKIP_PIXELS),S=Ue.getParameter(nt.UNPACK_SKIP_ROWS),M=Ue.getParameter(nt.UNPACK_SKIP_IMAGES);Ue.pixelStorei(nt.UNPACK_ROW_LENGTH,m.width),Ue.pixelStorei(nt.UNPACK_IMAGE_HEIGHT,m.height),Ue.pixelStorei(nt.UNPACK_SKIP_PIXELS,a),Ue.pixelStorei(nt.UNPACK_SKIP_ROWS,s),Ue.pixelStorei(nt.UNPACK_SKIP_IMAGES,o);const w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){const h=Oe.get(e),d=Oe.get(t),m=Oe.get(h.__renderTarget),g=Oe.get(d.__renderTarget);Ue.bindFramebuffer(nt.READ_FRAMEBUFFER,m.__webglFramebuffer),Ue.bindFramebuffer(nt.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let v=0;v<r;v++)w&&(nt.framebufferTextureLayer(nt.READ_FRAMEBUFFER,nt.COLOR_ATTACHMENT0,Oe.get(e).__webglTexture,p,o+v),nt.framebufferTextureLayer(nt.DRAW_FRAMEBUFFER,nt.COLOR_ATTACHMENT0,Oe.get(t).__webglTexture,f,u+v)),nt.blitFramebuffer(a,s,n,i,l,c,n,i,nt.DEPTH_BUFFER_BIT,nt.NEAREST);Ue.bindFramebuffer(nt.READ_FRAMEBUFFER,null),Ue.bindFramebuffer(nt.DRAW_FRAMEBUFFER,null)}else if(0!==p||e.isRenderTargetTexture||Oe.has(e)){const h=Oe.get(e),d=Oe.get(t);Ue.bindFramebuffer(nt.READ_FRAMEBUFFER,ie),Ue.bindFramebuffer(nt.DRAW_FRAMEBUFFER,re);for(let e=0;e<r;e++)w?nt.framebufferTextureLayer(nt.READ_FRAMEBUFFER,nt.COLOR_ATTACHMENT0,h.__webglTexture,p,o+e):nt.framebufferTexture2D(nt.READ_FRAMEBUFFER,nt.COLOR_ATTACHMENT0,nt.TEXTURE_2D,h.__webglTexture,p),T?nt.framebufferTextureLayer(nt.DRAW_FRAMEBUFFER,nt.COLOR_ATTACHMENT0,d.__webglTexture,f,u+e):nt.framebufferTexture2D(nt.DRAW_FRAMEBUFFER,nt.COLOR_ATTACHMENT0,nt.TEXTURE_2D,d.__webglTexture,f),0!==p?nt.blitFramebuffer(a,s,n,i,l,c,n,i,nt.COLOR_BUFFER_BIT,nt.NEAREST):T?nt.copyTexSubImage3D(_,f,l,c,u+e,a,s,n,i):nt.copyTexSubImage2D(_,f,l,c,a,s,n,i);Ue.bindFramebuffer(nt.READ_FRAMEBUFFER,null),Ue.bindFramebuffer(nt.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?nt.texSubImage3D(_,f,l,c,u,n,i,r,g,v,m.data):t.isCompressedArrayTexture?nt.compressedTexSubImage3D(_,f,l,c,u,n,i,r,g,m.data):nt.texSubImage3D(_,f,l,c,u,n,i,r,g,v,m):e.isDataTexture?nt.texSubImage2D(nt.TEXTURE_2D,f,l,c,n,i,g,v,m.data):e.isCompressedTexture?nt.compressedTexSubImage2D(nt.TEXTURE_2D,f,l,c,m.width,m.height,g,m.data):nt.texSubImage2D(nt.TEXTURE_2D,f,l,c,n,i,g,v,m);Ue.pixelStorei(nt.UNPACK_ROW_LENGTH,y),Ue.pixelStorei(nt.UNPACK_IMAGE_HEIGHT,x),Ue.pixelStorei(nt.UNPACK_SKIP_PIXELS,b),Ue.pixelStorei(nt.UNPACK_SKIP_ROWS,S),Ue.pixelStorei(nt.UNPACK_SKIP_IMAGES,M),0===f&&t.generateMipmaps&&nt.generateMipmap(_),Ue.unbindTexture()},this.initRenderTarget=function(e){void 0===Oe.get(e).__webglFramebuffer&&Fe.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?Fe.setTextureCube(e,0):e.isData3DTexture?Fe.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Fe.setTexture2DArray(e,0):Fe.setTexture2D(e,0),Ue.unbindTexture()},this.resetState=function(){ae=0,se=0,oe=null,Ue.reset(),et.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return i.TdN}get outputColorSpace(){return this._outputColorSpace}
2set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=i.ppV._getDrawingBufferColorSpace(e),t.unpackColorSpace=i.ppV._getUnpackColorSpace()}}}}]); 3//# sourceMappingURL=37.5b88a93e.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.