From ae866e7a765dfac8b7d0150ad5558367e6392665 Mon Sep 17 00:00:00 2001 From: ericjansenrpm <152877805+ericjansenrpm@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:08:27 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20github-pages=20from=20@=20read?= =?UTF-8?q?yplayerme/visage@087e618e2f28cda53e6be665c17a17c57f7047ec=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/130.278c1a30.iframe.bundle.js | 1 - docs/130.7b335b46.iframe.bundle.js | 1 + docs/135.78107015.iframe.bundle.js | 2 - docs/135.c0b7df5b.iframe.bundle.js | 2 + ...135.c0b7df5b.iframe.bundle.js.LICENSE.txt} | 6 + docs/140.a6128e7c.iframe.bundle.js | 2 + .../140.a6128e7c.iframe.bundle.js.LICENSE.txt | 6 + docs/152.00429889.iframe.bundle.js | 1 + docs/152.ecb11f02.iframe.bundle.js | 1 - docs/207.bf2802c1.iframe.bundle.js | 2 - ...bundle.js => 40.66397977.iframe.bundle.js} | 2 +- docs/576.ad2dabc8.iframe.bundle.js | 2 + ...576.ad2dabc8.iframe.bundle.js.LICENSE.txt} | 2 +- docs/62.769d6ab3.iframe.bundle.js | 2 - docs/62.769d6ab3.iframe.bundle.js.LICENSE.txt | 6 - ...undle.js => 690.995a3e10.iframe.bundle.js} | 6 +- ...690.995a3e10.iframe.bundle.js.LICENSE.txt} | 0 ....map => 690.995a3e10.iframe.bundle.js.map} | 2 +- docs/742.b7cddfe9.iframe.bundle.js | 1 - docs/742.e2a138b6.iframe.bundle.js | 1 + ...Examples-stories.732420ab.iframe.bundle.js | 1 - ...Examples-stories.e8a4cd74.iframe.bundle.js | 1 + docs/iframe.html | 6 +- docs/main.68bd106a.iframe.bundle.js | 1 + docs/main.bb8c43d0.iframe.bundle.js | 1 - docs/project.json | 2 +- docs/runtime~main.7afafff2.iframe.bundle.js | 1 - docs/runtime~main.8bbe4013.iframe.bundle.js | 1 + docs/sb-addons/storybook-7/manager-bundle.js | 1553 ++++++++++------- .../storybook-7/manager-bundle.js.LEGAL.txt | 24 +- .../storybook-7/manager-bundle.js.map | 8 +- 31 files changed, 957 insertions(+), 690 deletions(-) delete mode 100644 docs/130.278c1a30.iframe.bundle.js create mode 100644 docs/130.7b335b46.iframe.bundle.js delete mode 100644 docs/135.78107015.iframe.bundle.js create mode 100644 docs/135.c0b7df5b.iframe.bundle.js rename docs/{135.78107015.iframe.bundle.js.LICENSE.txt => 135.c0b7df5b.iframe.bundle.js.LICENSE.txt} (85%) create mode 100644 docs/140.a6128e7c.iframe.bundle.js create mode 100644 docs/140.a6128e7c.iframe.bundle.js.LICENSE.txt create mode 100644 docs/152.00429889.iframe.bundle.js delete mode 100644 docs/152.ecb11f02.iframe.bundle.js delete mode 100644 docs/207.bf2802c1.iframe.bundle.js rename docs/{40.86116377.iframe.bundle.js => 40.66397977.iframe.bundle.js} (68%) create mode 100644 docs/576.ad2dabc8.iframe.bundle.js rename docs/{207.bf2802c1.iframe.bundle.js.LICENSE.txt => 576.ad2dabc8.iframe.bundle.js.LICENSE.txt} (96%) delete mode 100644 docs/62.769d6ab3.iframe.bundle.js delete mode 100644 docs/62.769d6ab3.iframe.bundle.js.LICENSE.txt rename docs/{690.214bb020.iframe.bundle.js => 690.995a3e10.iframe.bundle.js} (99%) rename docs/{690.214bb020.iframe.bundle.js.LICENSE.txt => 690.995a3e10.iframe.bundle.js.LICENSE.txt} (100%) rename docs/{690.214bb020.iframe.bundle.js.map => 690.995a3e10.iframe.bundle.js.map} (99%) delete mode 100644 docs/742.b7cddfe9.iframe.bundle.js create mode 100644 docs/742.e2a138b6.iframe.bundle.js delete mode 100644 docs/components-Avatar-Examples-stories.732420ab.iframe.bundle.js create mode 100644 docs/components-Avatar-Examples-stories.e8a4cd74.iframe.bundle.js create mode 100644 docs/main.68bd106a.iframe.bundle.js delete mode 100644 docs/main.bb8c43d0.iframe.bundle.js delete mode 100644 docs/runtime~main.7afafff2.iframe.bundle.js create mode 100644 docs/runtime~main.8bbe4013.iframe.bundle.js diff --git a/docs/130.278c1a30.iframe.bundle.js b/docs/130.278c1a30.iframe.bundle.js deleted file mode 100644 index 129a6dfc..00000000 --- a/docs/130.278c1a30.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[130],{"./node_modules/@react-three/drei/core/Sparkles.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{P:function(){return Sparkles}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js");const SparklesImplMaterial=function shaderMaterial(uniforms,vertexShader,fragmentShader,onInit){const material=class material extends three_module.ShaderMaterial{constructor(parameters={}){const entries=Object.entries(uniforms);super({uniforms:entries.reduce(((acc,[name,value])=>({...acc,...three_module.UniformsUtils.clone({[name]:{value:value}})})),{}),vertexShader:vertexShader,fragmentShader:fragmentShader}),this.key="",entries.forEach((([name])=>Object.defineProperty(this,name,{get:()=>this.uniforms[name].value,set:v=>this.uniforms[name].value=v}))),Object.assign(this,parameters),onInit&&onInit(this)}};return material.key=three_module.MathUtils.generateUUID(),material}({time:0,pixelRatio:1}," uniform float pixelRatio;\n uniform float time;\n attribute float size; \n attribute float speed; \n attribute float opacity;\n attribute vec3 noise;\n attribute vec3 color;\n varying vec3 vColor;\n varying float vOpacity;\n void main() {\n vec4 modelPosition = modelMatrix * vec4(position, 1.0);\n modelPosition.y += sin(time * speed + modelPosition.x * noise.x * 100.0) * 0.2;\n modelPosition.z += cos(time * speed + modelPosition.x * noise.y * 100.0) * 0.2;\n modelPosition.x += cos(time * speed + modelPosition.x * noise.z * 100.0) * 0.2;\n vec4 viewPosition = viewMatrix * modelPosition;\n vec4 projectionPostion = projectionMatrix * viewPosition;\n gl_Position = projectionPostion;\n gl_PointSize = size * 25. * pixelRatio;\n gl_PointSize *= (1.0 / - viewPosition.z);\n vColor = color;\n vOpacity = opacity;\n }"," varying vec3 vColor;\n varying float vOpacity;\n void main() {\n float distanceToCenter = distance(gl_PointCoord, vec2(0.5));\n float strength = 0.05 / distanceToCenter - 0.1;\n gl_FragColor = vec4(vColor, strength * vOpacity);\n #include \n #include \n }"),isFloat32Array=def=>def&&def.constructor===Float32Array,isVector=v=>v instanceof three_module.Vector2||v instanceof three_module.Vector3||v instanceof three_module.Vector4,normalizeVector=v=>Array.isArray(v)?v:isVector(v)?v.toArray():[v,v,v];function usePropAsIsOrAsAttribute(count,prop,setDefault){return react.useMemo((()=>{if(void 0!==prop){if(isFloat32Array(prop))return prop;if(prop instanceof three_module.Color){const a=Array.from({length:3*count},(()=>{return[(v=prop).r,v.g,v.b];var v})).flat();return Float32Array.from(a)}if(isVector(prop)||Array.isArray(prop)){const a=Array.from({length:3*count},(()=>normalizeVector(prop))).flat();return Float32Array.from(a)}return Float32Array.from({length:count},(()=>prop))}return Float32Array.from({length:count},setDefault)}),[prop])}const Sparkles=react.forwardRef((({noise:noise=1,count:count=100,speed:speed=1,opacity:opacity=1,scale:scale=1,size:size,color:color,children:children,...props},forwardRef)=>{react.useMemo((()=>(0,index_673ef987_esm.e)({SparklesImplMaterial:SparklesImplMaterial})),[]);const ref=react.useRef(null),dpr=(0,index_673ef987_esm.z)((state=>state.viewport.dpr)),_scale=normalizeVector(scale),positions=react.useMemo((()=>Float32Array.from(Array.from({length:count},(()=>_scale.map(three_module.MathUtils.randFloatSpread))).flat())),[count,..._scale]),sizes=usePropAsIsOrAsAttribute(count,size,Math.random),opacities=usePropAsIsOrAsAttribute(count,opacity),speeds=usePropAsIsOrAsAttribute(count,speed),noises=usePropAsIsOrAsAttribute(3*count,noise),colors=usePropAsIsOrAsAttribute(void 0===color?3*count:count,isFloat32Array(color)?color:new three_module.Color(color),(()=>1));return(0,index_673ef987_esm.A)((state=>{ref.current&&ref.current.material&&(ref.current.material.time=state.clock.elapsedTime)})),react.useImperativeHandle(forwardRef,(()=>ref.current),[]),react.createElement("points",(0,esm_extends.Z)({key:`particle-${count}-${JSON.stringify(scale)}`},props,{ref:ref}),react.createElement("bufferGeometry",null,react.createElement("bufferAttribute",{attach:"attributes-position",args:[positions,3]}),react.createElement("bufferAttribute",{attach:"attributes-size",args:[sizes,1]}),react.createElement("bufferAttribute",{attach:"attributes-opacity",args:[opacities,1]}),react.createElement("bufferAttribute",{attach:"attributes-speed",args:[speeds,1]}),react.createElement("bufferAttribute",{attach:"attributes-color",args:[colors,3]}),react.createElement("bufferAttribute",{attach:"attributes-noise",args:[noises,3]})),children||react.createElement("sparklesImplMaterial",{transparent:!0,pixelRatio:dpr,depthWrite:!1}))}))},"./src/components/Avatar/Avatar.stories.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Animated:function(){return Animated},HalfBody:function(){return HalfBody},Showcase:function(){return Showcase},Static:function(){return Static},_DragNDrop:function(){return _DragNDrop},__namedExportsOrder:function(){return __namedExportsOrder}});var _Static$parameters,_Static$parameters2,_Static$parameters2$d,_Showcase$parameters,_Showcase$parameters2,_Showcase$parameters3,_Animated$parameters,_Animated$parameters2,_Animated$parameters3,_HalfBody$parameters,_HalfBody$parameters2,_HalfBody$parameters3,_DragNDrop$parameters,_DragNDrop$parameters2,_DragNDrop$parameters3,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),src_services__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/services/index.ts"),_react_three_drei__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@react-three/drei/core/Sparkles.js"),src_components_FileDropper_FileDropper_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/FileDropper/FileDropper.component.tsx"),src_services_Environment_service__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/services/Environment.service.ts"),src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/services/Stories.service.ts"),_index__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/Avatar/index.ts"),_Lights_Lights_component__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/Lights/Lights.component.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Avatar=function Avatar(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_index__WEBPACK_IMPORTED_MODULE_5__.q,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args),{},{children:args.children}))},Sparkles=function Sparkles(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_react_three_drei__WEBPACK_IMPORTED_MODULE_9__.P,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args))},Template=function Template(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args))},Static=Template.bind({});Static.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("female.glb"),animationSrc:void 0,poseSrc:void 0,environment:"soft",scale:1,shadows:!0,idleRotation:!1,headMovement:!1,fov:50,cameraZoomTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.ZOOM_TARGET,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.FEMALE,bloom:{luminanceThreshold:1,luminanceSmoothing:1,mipmapBlur:!0,kernelSize:1,intensity:.1,materialIntensity:3.3},background:{color:"rgb(9,20,26)"},style:{},onLoaded:function onLoaded(){return console.info("EVENT: static avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading static avatar")}},_Lights_Lights_component__WEBPACK_IMPORTED_MODULE_6__.E.defaultProps),Static.argTypes={headMovement:{control:!1},halfBody:{control:!1},animationSrc:{control:!1},poseSrc:{control:!1},fov:{control:{type:"range",min:30,max:100,step:1}}};var Showcase=function Showcase(args){var _args$bloom,_useState=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null===(_args$bloom=args.bloom)||void 0===_args$bloom?void 0:_args$bloom.materialIntensity),_useState2=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__.Z)(_useState,2),currentValue=_useState2[0],setCurrentValue=_useState2[1],_useState3=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!0),_useState4=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__.Z)(_useState3,2),increasing=_useState4[0],setIncreasing=_useState4[1],pulsatingBloom=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args.bloom),{},{intensity:1,materialIntensity:currentValue});return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){var animationInterval=setInterval((function(){null!=args&&args.ambientOcclusion||setCurrentValue(increasing?function(prevValue){var newValue=prevValue+.3;return newValue>=9?(setIncreasing(!1),9):newValue}:function(prevValue){var newValue=prevValue-.3;return newValue<=1?(setIncreasing(!0),1):newValue})}),60);return function(){return clearInterval(animationInterval)}}),[currentValue,increasing,1,9,null==args?void 0:args.ambientOcclusion]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args),{},{effects:{ambientOcclusion:null==args?void 0:args.ambientOcclusion,bloom:pulsatingBloom},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Sparkles,{color:"white",count:50,opacity:.9,scale:5,size:.5,speed:.35})}))};Showcase.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,modelSrc:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.HI.one,animationSrc:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.jb.one,scale:1,bloom:{luminanceThreshold:1,luminanceSmoothing:1,mipmapBlur:!0,kernelSize:1,intensity:1,materialIntensity:1},background:{color:"#282038"},dpr:2,environment:"soft",shadows:!1,emotion:{jawOpen:.1,mouthSmileLeft:.2,mouthSmileRight:.1,mouthPressLeft:.1,cheekSquintLeft:.3,eyeLookOutLeft:.6,eyeLookInRight:.6,mouthDimpleLeft:.3},ambientOcclusion:!1},_Lights_Lights_component__WEBPACK_IMPORTED_MODULE_6__.E.defaultProps),Showcase.argTypes=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.nx),{},{modelSrc:{options:Object.values(src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.HI),control:{type:"select"}},animationSrc:{options:Object.values(src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.jb),control:{type:"select"}},environment:{table:{disable:!0}},keyLightIntensity:{table:{disable:!0}},keyLightColor:{table:{disable:!0}},fillLightIntensity:{table:{disable:!0}},fillLightColor:{table:{disable:!0}},fillLightPosition:{table:{disable:!0}},backLightIntensity:{table:{disable:!0}},backLightColor:{table:{disable:!0}},backLightPosition:{table:{disable:!0}},lightTarget:{table:{disable:!0}},fov:{table:{disable:!0}}});var Animated=Template.bind({});Animated.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.args),{},{modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("male-emissive.glb"),animationSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("male-idle.glb"),cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.MALE,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,emotion:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.idle,onLoaded:function onLoaded(){return console.info("EVENT: animated avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading animated avatar")}}),Animated.argTypes={poseSrc:{control:!1},emotion:{options:{idle:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.idle,angry:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.angry,smile:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.smile,sad:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.sad},defaultValue:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.idle,control:{type:"select"}},fov:{control:{type:"range",min:30,max:100,step:1}}};var HalfBody=Template.bind({});HalfBody.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.args),{},{modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("half-body.glb"),halfBody:!0,cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.HALF_BODY,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.INITIAL_DISTANCE.HALF_BODY,onLoaded:function onLoaded(){return console.info("EVENT: half body avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading half body avatar")}});var _DragNDrop=function DropTemplate(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(src_components_FileDropper_FileDropper_component__WEBPACK_IMPORTED_MODULE_2__.s,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args))})}.bind({});_DragNDrop.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.args),{},{modelSrc:void 0,animationSrc:void 0,poseSrc:"",environment:"soft",cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,onLoaded:function onLoaded(){return console.info("EVENT: binary file loaded")},onLoading:function onLoading(){return console.info("EVENT: loading avatar from binary file")}}),_DragNDrop.argTypes={modelSrc:{control:!1},animationSrc:{control:!1},headMovement:{control:!1},environment:{control:{type:"text"}}},__webpack_exports__.default={title:"Components/Avatar",component:Avatar,argTypes:{keyLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},keyLightColor:{control:"color"},fillLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},fillLightColor:{control:"color"},backLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},backLightColor:{control:"color"},cameraTarget:{control:{type:"range",min:0,max:10,step:.01}},scale:{control:{type:"range",min:.01,max:10,step:.01}},cameraInitialDistance:{control:{type:"range",min:0,max:2.5,step:.01}},onLoaded:{control:!1},environment:{options:Object.keys(src_services_Environment_service__WEBPACK_IMPORTED_MODULE_3__.s$),control:{type:"select"}},fov:{control:{type:"range",min:30,max:100,step:1}}}},Static.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_Static$parameters=Static.parameters)||void 0===_Static$parameters?void 0:_Static$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => "},null===(_Static$parameters2=Static.parameters)||void 0===_Static$parameters2||null===(_Static$parameters2$d=_Static$parameters2.docs)||void 0===_Static$parameters2$d?void 0:_Static$parameters2$d.source)})}),Showcase.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Showcase.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_Showcase$parameters=Showcase.parameters)||void 0===_Showcase$parameters?void 0:_Showcase$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:'(args: AvatarProps & {\n ambientOcclusion?: boolean;\n}) => {\n const [currentValue, setCurrentValue] = useState(args.bloom?.materialIntensity);\n const [increasing, setIncreasing] = useState(true);\n const pulsatingBloom = {\n ...args.bloom,\n intensity: 1.0,\n materialIntensity: currentValue\n };\n useEffect(() => {\n const animationInterval = setInterval(() => {\n if (args?.ambientOcclusion) {\n return;\n }\n if (increasing) {\n setCurrentValue(prevValue => {\n const newValue = prevValue! + stepSize;\n if (newValue >= maxValue) {\n setIncreasing(false);\n return maxValue;\n }\n return newValue;\n });\n } else {\n setCurrentValue(prevValue => {\n const newValue = prevValue! - stepSize;\n if (newValue <= initialValue) {\n setIncreasing(true);\n return initialValue;\n }\n return newValue;\n });\n }\n }, animationUpdateStepMs);\n return () => clearInterval(animationInterval);\n }, [currentValue, increasing, initialValue, maxValue, args?.ambientOcclusion]);\n return \n \n ;\n}'},null===(_Showcase$parameters2=Showcase.parameters)||void 0===_Showcase$parameters2||null===(_Showcase$parameters3=_Showcase$parameters2.docs)||void 0===_Showcase$parameters3?void 0:_Showcase$parameters3.source)})}),Animated.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Animated.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_Animated$parameters=Animated.parameters)||void 0===_Animated$parameters?void 0:_Animated$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => "},null===(_Animated$parameters2=Animated.parameters)||void 0===_Animated$parameters2||null===(_Animated$parameters3=_Animated$parameters2.docs)||void 0===_Animated$parameters3?void 0:_Animated$parameters3.source)})}),HalfBody.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},HalfBody.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_HalfBody$parameters=HalfBody.parameters)||void 0===_HalfBody$parameters?void 0:_HalfBody$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => "},null===(_HalfBody$parameters2=HalfBody.parameters)||void 0===_HalfBody$parameters2||null===(_HalfBody$parameters3=_HalfBody$parameters2.docs)||void 0===_HalfBody$parameters3?void 0:_HalfBody$parameters3.source)})}),_DragNDrop.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},_DragNDrop.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_DragNDrop$parameters=_DragNDrop.parameters)||void 0===_DragNDrop$parameters?void 0:_DragNDrop$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => \n \n "},null===(_DragNDrop$parameters2=_DragNDrop.parameters)||void 0===_DragNDrop$parameters2||null===(_DragNDrop$parameters3=_DragNDrop$parameters2.docs)||void 0===_DragNDrop$parameters3?void 0:_DragNDrop$parameters3.source)})});var __namedExportsOrder=["Static","Showcase","Animated","HalfBody","_DragNDrop"];Showcase.__docgenInfo={description:"",methods:[],displayName:"Showcase",props:{ambientOcclusion:{required:!1,tsType:{name:"boolean"},description:""}}}},"./src/components/FileDropper/FileDropper.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{s:function(){return FileDropper}});var regeneratorRuntime=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),react=__webpack_require__("./node_modules/react/index.js"),FileDropper_module_fileDropContainer="FileDropper_fileDropContainer__-KZmt",FileDropper_module_placeholder="FileDropper_placeholder__zVZlo",jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),FileDropper=function FileDropper(_ref){var children=_ref.children,_ref$placeholder=_ref.placeholder,placeholder=void 0===_ref$placeholder?"Drag n' Drop a .glb model here, then Drop an animation .glb or .fbx":_ref$placeholder,ref=(0,react.useRef)(null),_useState=(0,react.useState)(""),_useState2=(0,slicedToArray.Z)(_useState,2),modelSrc=_useState2[0],setModelSrc=_useState2[1],_useState3=(0,react.useState)(""),_useState4=(0,slicedToArray.Z)(_useState3,2),animationSrc=_useState4[0],setAnimationSrc=_useState4[1],getBase64=function getBase64(file){return new Promise((function(resolve,reject){var reader=new FileReader;reader.readAsDataURL(file),reader.onload=function(){return resolve(reader.result)},reader.onerror=function(error){return reject(error)}}))},handleDrag=function handleDrag(e){e.preventDefault(),e.stopPropagation()},handleDragIn=function handleDragIn(e){e.preventDefault(),e.stopPropagation()},handleDragOut=function handleDragOut(e){e.preventDefault(),e.stopPropagation()},handleDrop=function(){var _ref2=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(e){var _e$dataTransfer,_name,_name2,file;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(e.preventDefault(),e.stopPropagation(),"file"!==(null===(_e$dataTransfer=e.dataTransfer)||void 0===_e$dataTransfer?void 0:_e$dataTransfer.items[0].kind)){_context.next=18;break}if(file=e.dataTransfer.items[0].getAsFile(),null!==(_name=file.name)&&void 0!==_name&&_name.endsWith(".glb")||null!==(_name2=file.name)&&void 0!==_name2&&_name2.endsWith(".fbx")){_context.next=6;break}return _context.abrupt("return");case 6:if(""!==modelSrc){_context.next=12;break}return _context.t0=setModelSrc,_context.next=10,getBase64(file);case 10:_context.t1=_context.sent,(0,_context.t0)(_context.t1);case 12:if(""===modelSrc){_context.next=18;break}return _context.t2=setAnimationSrc,_context.next=16,getBase64(file);case 16:_context.t3=_context.sent,(0,_context.t2)(_context.t3);case 18:case"end":return _context.stop()}}),_callee)})));return function handleDrop(_x){return _ref2.apply(this,arguments)}}();return(0,react.useEffect)((function(){var element=ref.current;return element.addEventListener("dragenter",handleDragIn),element.addEventListener("dragleave",handleDragOut),element.addEventListener("dragover",handleDrag),element.addEventListener("drop",handleDrop),function(){element.removeEventListener("dragenter",handleDragIn),element.removeEventListener("dragleave",handleDragOut),element.removeEventListener("dragover",handleDrag),element.removeEventListener("drop",handleDrop)}})),(0,jsx_runtime.jsx)("div",{className:FileDropper_module_fileDropContainer,ref:ref,children:modelSrc.length<1?(0,jsx_runtime.jsx)("div",{className:FileDropper_module_placeholder,children:placeholder}):react.Children.map(react.Children.toArray(children),(function(child){return(0,react.cloneElement)(child,{modelSrc:modelSrc,animationSrc:animationSrc})}))})};FileDropper.__docgenInfo={description:"This component is only for using in Storybook for showcasing drag'n'drop functionality.",methods:[],displayName:"FileDropper",props:{placeholder:{defaultValue:{value:"`Drag n' Drop a .glb model here, then Drop an animation .glb or .fbx`",computed:!1},required:!1}}}},"./src/services/Stories.service.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{HI:function(){return modelPresets},eE:function(){return emotions},jb:function(){return animationPresets},nx:function(){return ignoreArgTypesOnExamples}});var _Models_service__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/services/Models.service.tsx"),disableTable={table:{disable:!0}},ignoreArgTypesOnExamples=["modelSrc","animationSrc","poseSrc","halfBody","shadows","cameraTarget","cameraInitialDistance","style","idleRotation","emotion","background","capture","loader","dpr","className","headMovement","cameraZoomTarget","bloom","onLoadedEffect","onLoadedAnimation","children","environment","ambientLightColor","dirLightColor","spotLightColor","ambientLightIntensity","dirLightIntensity","spotLightIntensity","spotLightAngle","onLoaded","onLoading","fov","spotLightPosition","dirLightPosition","scale"].reduce((function(acc,key){return acc[key]=disableTable,acc}),{}),modelPresets={one:"https://models.readyplayer.me/64d61e9e17883fd73ebe5eb7.glb?morphTargets=ARKit,Eyes Extra&textureAtlas=none&lod=0",two:"https://models.readyplayer.me/64d61f67f0367d07504924be.glb?morphTargets=ARKit,Eyes Extra&textureAtlas=none&lod=0",three:"https://models.readyplayer.me/64d62255f0367d0750492913.glb?lod=0&morphTargets=ARKit,Eyes Extra&textureAtlas=none",five:"https://models.readyplayer.me/64d6235e2d3bea6e4267b01d.glb?lod=0&morphTargets=ARKit,Eyes Extra&textureAtlas=none",six:"https://models.readyplayer.me/64d5d4eb651a0d350005c672.glb?lod=0&morphTargets=ARKit,Eyes Extra&textureAtlas=none",seven:"https://models.readyplayer.me/64e3055495439dfcf3f0b665.glb?morphTargets=ARKit,Eyes%20Extra&textureAtlas=none"},animationPresets={one:(0,_Models_service__WEBPACK_IMPORTED_MODULE_0__.gT)("male-idle-1.fbx"),two:(0,_Models_service__WEBPACK_IMPORTED_MODULE_0__.gT)("male-idle-2.fbx"),three:(0,_Models_service__WEBPACK_IMPORTED_MODULE_0__.gT)("male-idle-3.fbx")},emotions={idle:{},angry:{mouthDimpleLeft:.48,mouthShrugLower:.385,eyeSquintLeft:.63,eyeSquintRight:.614,browDownLeft:.842,browDownRight:.56,noseSneerLeft:.3,noseSneerRight:.3},smile:{eyeSquintLeft:.4,eyeSquintRight:.2,mouthSmileLeft:.37,mouthSmileRight:.36,mouthShrugUpper:.27,browInnerUp:.3,browOuterUpLeft:.37,browOuterUpRight:.49},sad:{eyeWideLeft:.5,eyeWideRight:.4,mouthPucker:.19,mouthFrownLeft:.6,mouthFrownRight:.6,mouthRollLower:.33,mouthRollUpper:.02,mouthShrugLower:.4,browInnerUp:.78,noseSneerLeft:.115,noseSneerRight:.1}}}}]); \ No newline at end of file diff --git a/docs/130.7b335b46.iframe.bundle.js b/docs/130.7b335b46.iframe.bundle.js new file mode 100644 index 00000000..503852d8 --- /dev/null +++ b/docs/130.7b335b46.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[130],{"./node_modules/@react-three/drei/core/Sparkles.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{P:function(){return Sparkles}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js");function shaderMaterial(uniforms,vertexShader,fragmentShader,onInit){const material=class material extends three_module.ShaderMaterial{constructor(parameters={}){const entries=Object.entries(uniforms);super({uniforms:entries.reduce(((acc,[name,value])=>({...acc,...three_module.UniformsUtils.clone({[name]:{value:value}})})),{}),vertexShader:vertexShader,fragmentShader:fragmentShader}),this.key="",entries.forEach((([name])=>Object.defineProperty(this,name,{get:()=>this.uniforms[name].value,set:v=>this.uniforms[name].value=v}))),Object.assign(this,parameters),onInit&&onInit(this)}};return material.key=three_module.MathUtils.generateUUID(),material}const SparklesImplMaterial=shaderMaterial({time:0,pixelRatio:1}," uniform float pixelRatio;\n uniform float time;\n attribute float size; \n attribute float speed; \n attribute float opacity;\n attribute vec3 noise;\n attribute vec3 color;\n varying vec3 vColor;\n varying float vOpacity;\n void main() {\n vec4 modelPosition = modelMatrix * vec4(position, 1.0);\n modelPosition.y += sin(time * speed + modelPosition.x * noise.x * 100.0) * 0.2;\n modelPosition.z += cos(time * speed + modelPosition.x * noise.y * 100.0) * 0.2;\n modelPosition.x += cos(time * speed + modelPosition.x * noise.z * 100.0) * 0.2;\n vec4 viewPosition = viewMatrix * modelPosition;\n vec4 projectionPostion = projectionMatrix * viewPosition;\n gl_Position = projectionPostion;\n gl_PointSize = size * 25. * pixelRatio;\n gl_PointSize *= (1.0 / - viewPosition.z);\n vColor = color;\n vOpacity = opacity;\n }",` varying vec3 vColor;\n varying float vOpacity;\n void main() {\n float distanceToCenter = distance(gl_PointCoord, vec2(0.5));\n float strength = 0.05 / distanceToCenter - 0.1;\n gl_FragColor = vec4(vColor, strength * vOpacity);\n #include \n #include <${__webpack_require__("./node_modules/@react-three/drei/helpers/constants.js").i>=154?"colorspace_fragment":"encodings_fragment"}>\n }`),isFloat32Array=def=>def&&def.constructor===Float32Array,isVector=v=>v instanceof three_module.Vector2||v instanceof three_module.Vector3||v instanceof three_module.Vector4,normalizeVector=v=>Array.isArray(v)?v:isVector(v)?v.toArray():[v,v,v];function usePropAsIsOrAsAttribute(count,prop,setDefault){return react.useMemo((()=>{if(void 0!==prop){if(isFloat32Array(prop))return prop;if(prop instanceof three_module.Color){const a=Array.from({length:3*count},(()=>{return[(v=prop).r,v.g,v.b];var v})).flat();return Float32Array.from(a)}if(isVector(prop)||Array.isArray(prop)){const a=Array.from({length:3*count},(()=>normalizeVector(prop))).flat();return Float32Array.from(a)}return Float32Array.from({length:count},(()=>prop))}return Float32Array.from({length:count},setDefault)}),[prop])}const Sparkles=react.forwardRef((({noise:noise=1,count:count=100,speed:speed=1,opacity:opacity=1,scale:scale=1,size:size,color:color,children:children,...props},forwardRef)=>{react.useMemo((()=>(0,index_99983b2d_esm.e)({SparklesImplMaterial:SparklesImplMaterial})),[]);const ref=react.useRef(null),dpr=(0,index_99983b2d_esm.A)((state=>state.viewport.dpr)),_scale=normalizeVector(scale),positions=react.useMemo((()=>Float32Array.from(Array.from({length:count},(()=>_scale.map(three_module.MathUtils.randFloatSpread))).flat())),[count,..._scale]),sizes=usePropAsIsOrAsAttribute(count,size,Math.random),opacities=usePropAsIsOrAsAttribute(count,opacity),speeds=usePropAsIsOrAsAttribute(count,speed),noises=usePropAsIsOrAsAttribute(3*count,noise),colors=usePropAsIsOrAsAttribute(void 0===color?3*count:count,isFloat32Array(color)?color:new three_module.Color(color),(()=>1));return(0,index_99983b2d_esm.C)((state=>{ref.current&&ref.current.material&&(ref.current.material.time=state.clock.elapsedTime)})),react.useImperativeHandle(forwardRef,(()=>ref.current),[]),react.createElement("points",(0,esm_extends.Z)({key:`particle-${count}-${JSON.stringify(scale)}`},props,{ref:ref}),react.createElement("bufferGeometry",null,react.createElement("bufferAttribute",{attach:"attributes-position",args:[positions,3]}),react.createElement("bufferAttribute",{attach:"attributes-size",args:[sizes,1]}),react.createElement("bufferAttribute",{attach:"attributes-opacity",args:[opacities,1]}),react.createElement("bufferAttribute",{attach:"attributes-speed",args:[speeds,1]}),react.createElement("bufferAttribute",{attach:"attributes-color",args:[colors,3]}),react.createElement("bufferAttribute",{attach:"attributes-noise",args:[noises,3]})),children||react.createElement("sparklesImplMaterial",{transparent:!0,pixelRatio:dpr,depthWrite:!1}))}))},"./node_modules/@react-three/drei/helpers/constants.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{i:function(){return version}});var three__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/three/build/three.module.js");const version=(()=>parseInt(three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,"")))()},"./src/components/Avatar/Avatar.stories.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Animated:function(){return Animated},HalfBody:function(){return HalfBody},Showcase:function(){return Showcase},Static:function(){return Static},_DragNDrop:function(){return _DragNDrop},__namedExportsOrder:function(){return __namedExportsOrder}});var _Static$parameters,_Static$parameters2,_Static$parameters2$d,_Showcase$parameters,_Showcase$parameters2,_Showcase$parameters3,_Animated$parameters,_Animated$parameters2,_Animated$parameters3,_HalfBody$parameters,_HalfBody$parameters2,_HalfBody$parameters3,_DragNDrop$parameters,_DragNDrop$parameters2,_DragNDrop$parameters3,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),src_services__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/services/index.ts"),_react_three_drei__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@react-three/drei/core/Sparkles.js"),src_components_FileDropper_FileDropper_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/FileDropper/FileDropper.component.tsx"),src_services_Environment_service__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/services/Environment.service.ts"),src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/services/Stories.service.ts"),_index__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/Avatar/index.ts"),_Lights_Lights_component__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/Lights/Lights.component.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Avatar=function Avatar(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_index__WEBPACK_IMPORTED_MODULE_5__.q,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args),{},{children:args.children}))},Sparkles=function Sparkles(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_react_three_drei__WEBPACK_IMPORTED_MODULE_9__.P,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args))},Template=function Template(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args))},Static=Template.bind({});Static.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("female.glb"),animationSrc:void 0,poseSrc:void 0,environment:"soft",scale:1,shadows:!0,idleRotation:!1,headMovement:!1,fov:50,cameraZoomTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.ZOOM_TARGET,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.FEMALE,bloom:{luminanceThreshold:1,luminanceSmoothing:1,mipmapBlur:!0,kernelSize:1,intensity:1,materialIntensity:1},background:{color:"rgb(9,20,26)"},style:{},onLoaded:function onLoaded(){return console.info("EVENT: static avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading static avatar")}},_Lights_Lights_component__WEBPACK_IMPORTED_MODULE_6__.E.defaultProps),Static.argTypes={headMovement:{control:!1},halfBody:{control:!1},animationSrc:{control:!1},poseSrc:{control:!1},fov:{control:{type:"range",min:30,max:100,step:1}}};var Showcase=function Showcase(args){var _args$bloom,_useState=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null===(_args$bloom=args.bloom)||void 0===_args$bloom?void 0:_args$bloom.materialIntensity),_useState2=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__.Z)(_useState,2),currentValue=_useState2[0],setCurrentValue=_useState2[1],_useState3=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!0),_useState4=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_10__.Z)(_useState3,2),increasing=_useState4[0],setIncreasing=_useState4[1],pulsatingBloom=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args.bloom),{},{intensity:1,materialIntensity:currentValue});return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){var animationInterval=setInterval((function(){null!=args&&args.ambientOcclusion||setCurrentValue(increasing?function(prevValue){var newValue=prevValue+.3;return newValue>=9?(setIncreasing(!1),9):newValue}:function(prevValue){var newValue=prevValue-.3;return newValue<=1?(setIncreasing(!0),1):newValue})}),60);return function(){return clearInterval(animationInterval)}}),[currentValue,increasing,1,9,null==args?void 0:args.ambientOcclusion]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args),{},{effects:{ambientOcclusion:null==args?void 0:args.ambientOcclusion,bloom:pulsatingBloom},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Sparkles,{color:"white",count:50,opacity:.9,scale:5,size:.5,speed:.35})}))};Showcase.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,modelSrc:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.HI.one,animationSrc:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.jb.one,scale:1,bloom:{luminanceThreshold:1,luminanceSmoothing:1,mipmapBlur:!0,kernelSize:1,intensity:1,materialIntensity:1},background:{color:"#282038"},dpr:2,environment:"soft",shadows:!1,emotion:{jawOpen:.1,mouthSmileLeft:.2,mouthSmileRight:.1,mouthPressLeft:.1,cheekSquintLeft:.3,eyeLookOutLeft:.6,eyeLookInRight:.6,mouthDimpleLeft:.3},ambientOcclusion:!1},_Lights_Lights_component__WEBPACK_IMPORTED_MODULE_6__.E.defaultProps),Showcase.argTypes=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.nx),{},{modelSrc:{options:Object.values(src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.HI),control:{type:"select"}},animationSrc:{options:Object.values(src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.jb),control:{type:"select"}},environment:{table:{disable:!0}},keyLightIntensity:{table:{disable:!0}},keyLightColor:{table:{disable:!0}},fillLightIntensity:{table:{disable:!0}},fillLightColor:{table:{disable:!0}},fillLightPosition:{table:{disable:!0}},backLightIntensity:{table:{disable:!0}},backLightColor:{table:{disable:!0}},backLightPosition:{table:{disable:!0}},lightTarget:{table:{disable:!0}},fov:{table:{disable:!0}}});var Animated=Template.bind({});Animated.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.args),{},{modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("male-emissive.glb"),animationSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("male-idle.glb"),cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.MALE,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,emotion:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.idle,onLoaded:function onLoaded(){return console.info("EVENT: animated avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading animated avatar")}}),Animated.argTypes={poseSrc:{control:!1},emotion:{options:{idle:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.idle,angry:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.angry,smile:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.smile,sad:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.sad},defaultValue:src_services_Stories_service__WEBPACK_IMPORTED_MODULE_4__.eE.idle,control:{type:"select"}},fov:{control:{type:"range",min:30,max:100,step:1}}};var HalfBody=Template.bind({});HalfBody.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.args),{},{modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("half-body.glb"),halfBody:!0,cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.HALF_BODY,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.INITIAL_DISTANCE.HALF_BODY,onLoaded:function onLoaded(){return console.info("EVENT: half body avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading half body avatar")}});var _DragNDrop=function DropTemplate(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(src_components_FileDropper_FileDropper_component__WEBPACK_IMPORTED_MODULE_2__.s,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},args))})}.bind({});_DragNDrop.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.args),{},{modelSrc:void 0,animationSrc:void 0,poseSrc:"",environment:"soft",cameraTarget:_index__WEBPACK_IMPORTED_MODULE_5__.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:_index__WEBPACK_IMPORTED_MODULE_5__.b.CONTROLS.FULL_BODY.MAX_DISTANCE,onLoaded:function onLoaded(){return console.info("EVENT: binary file loaded")},onLoading:function onLoading(){return console.info("EVENT: loading avatar from binary file")}}),_DragNDrop.argTypes={modelSrc:{control:!1},animationSrc:{control:!1},headMovement:{control:!1},environment:{control:{type:"text"}}},__webpack_exports__.default={title:"Components/Avatar",component:Avatar,argTypes:{keyLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},keyLightColor:{control:"color"},fillLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},fillLightColor:{control:"color"},backLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},backLightColor:{control:"color"},cameraTarget:{control:{type:"range",min:0,max:10,step:.01}},scale:{control:{type:"range",min:.01,max:10,step:.01}},cameraInitialDistance:{control:{type:"range",min:0,max:2.5,step:.01}},onLoaded:{control:!1},environment:{options:Object.keys(src_services_Environment_service__WEBPACK_IMPORTED_MODULE_3__.s$),control:{type:"select"}},fov:{control:{type:"range",min:30,max:100,step:1}}}},Static.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Static.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_Static$parameters=Static.parameters)||void 0===_Static$parameters?void 0:_Static$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => "},null===(_Static$parameters2=Static.parameters)||void 0===_Static$parameters2||null===(_Static$parameters2$d=_Static$parameters2.docs)||void 0===_Static$parameters2$d?void 0:_Static$parameters2$d.source)})}),Showcase.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Showcase.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_Showcase$parameters=Showcase.parameters)||void 0===_Showcase$parameters?void 0:_Showcase$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:'(args: AvatarProps & {\n ambientOcclusion?: boolean;\n}) => {\n const [currentValue, setCurrentValue] = useState(args.bloom?.materialIntensity);\n const [increasing, setIncreasing] = useState(true);\n const pulsatingBloom = {\n ...args.bloom,\n intensity: 1.0,\n materialIntensity: currentValue\n };\n useEffect(() => {\n const animationInterval = setInterval(() => {\n if (args?.ambientOcclusion) {\n return;\n }\n if (increasing) {\n setCurrentValue(prevValue => {\n const newValue = prevValue! + stepSize;\n if (newValue >= maxValue) {\n setIncreasing(false);\n return maxValue;\n }\n return newValue;\n });\n } else {\n setCurrentValue(prevValue => {\n const newValue = prevValue! - stepSize;\n if (newValue <= initialValue) {\n setIncreasing(true);\n return initialValue;\n }\n return newValue;\n });\n }\n }, animationUpdateStepMs);\n return () => clearInterval(animationInterval);\n }, [currentValue, increasing, initialValue, maxValue, args?.ambientOcclusion]);\n return \n \n ;\n}'},null===(_Showcase$parameters2=Showcase.parameters)||void 0===_Showcase$parameters2||null===(_Showcase$parameters3=_Showcase$parameters2.docs)||void 0===_Showcase$parameters3?void 0:_Showcase$parameters3.source)})}),Animated.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},Animated.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_Animated$parameters=Animated.parameters)||void 0===_Animated$parameters?void 0:_Animated$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => "},null===(_Animated$parameters2=Animated.parameters)||void 0===_Animated$parameters2||null===(_Animated$parameters3=_Animated$parameters2.docs)||void 0===_Animated$parameters3?void 0:_Animated$parameters3.source)})}),HalfBody.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},HalfBody.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_HalfBody$parameters=HalfBody.parameters)||void 0===_HalfBody$parameters?void 0:_HalfBody$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => "},null===(_HalfBody$parameters2=HalfBody.parameters)||void 0===_HalfBody$parameters2||null===(_HalfBody$parameters3=_HalfBody$parameters2.docs)||void 0===_HalfBody$parameters3?void 0:_HalfBody$parameters3.source)})}),_DragNDrop.parameters=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},_DragNDrop.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},null===(_DragNDrop$parameters=_DragNDrop.parameters)||void 0===_DragNDrop$parameters?void 0:_DragNDrop$parameters.docs),{},{source:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({originalSource:"args => \n \n "},null===(_DragNDrop$parameters2=_DragNDrop.parameters)||void 0===_DragNDrop$parameters2||null===(_DragNDrop$parameters3=_DragNDrop$parameters2.docs)||void 0===_DragNDrop$parameters3?void 0:_DragNDrop$parameters3.source)})});var __namedExportsOrder=["Static","Showcase","Animated","HalfBody","_DragNDrop"];Showcase.__docgenInfo={description:"",methods:[],displayName:"Showcase",props:{ambientOcclusion:{required:!1,tsType:{name:"boolean"},description:""}}}},"./src/components/FileDropper/FileDropper.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{s:function(){return FileDropper}});var regeneratorRuntime=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),react=__webpack_require__("./node_modules/react/index.js"),FileDropper_module_fileDropContainer="FileDropper_fileDropContainer__-KZmt",FileDropper_module_placeholder="FileDropper_placeholder__zVZlo",jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),FileDropper=function FileDropper(_ref){var children=_ref.children,_ref$placeholder=_ref.placeholder,placeholder=void 0===_ref$placeholder?"Drag n' Drop a .glb model here, then Drop an animation .glb or .fbx":_ref$placeholder,ref=(0,react.useRef)(null),_useState=(0,react.useState)(""),_useState2=(0,slicedToArray.Z)(_useState,2),modelSrc=_useState2[0],setModelSrc=_useState2[1],_useState3=(0,react.useState)(""),_useState4=(0,slicedToArray.Z)(_useState3,2),animationSrc=_useState4[0],setAnimationSrc=_useState4[1],getBase64=function getBase64(file){return new Promise((function(resolve,reject){var reader=new FileReader;reader.readAsDataURL(file),reader.onload=function(){return resolve(reader.result)},reader.onerror=function(error){return reject(error)}}))},handleDrag=function handleDrag(e){e.preventDefault(),e.stopPropagation()},handleDragIn=function handleDragIn(e){e.preventDefault(),e.stopPropagation()},handleDragOut=function handleDragOut(e){e.preventDefault(),e.stopPropagation()},handleDrop=function(){var _ref2=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(e){var _e$dataTransfer,_name,_name2,file;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(e.preventDefault(),e.stopPropagation(),"file"!==(null===(_e$dataTransfer=e.dataTransfer)||void 0===_e$dataTransfer?void 0:_e$dataTransfer.items[0].kind)){_context.next=18;break}if(file=e.dataTransfer.items[0].getAsFile(),null!==(_name=file.name)&&void 0!==_name&&_name.endsWith(".glb")||null!==(_name2=file.name)&&void 0!==_name2&&_name2.endsWith(".fbx")){_context.next=6;break}return _context.abrupt("return");case 6:if(""!==modelSrc){_context.next=12;break}return _context.t0=setModelSrc,_context.next=10,getBase64(file);case 10:_context.t1=_context.sent,(0,_context.t0)(_context.t1);case 12:if(""===modelSrc){_context.next=18;break}return _context.t2=setAnimationSrc,_context.next=16,getBase64(file);case 16:_context.t3=_context.sent,(0,_context.t2)(_context.t3);case 18:case"end":return _context.stop()}}),_callee)})));return function handleDrop(_x){return _ref2.apply(this,arguments)}}();return(0,react.useEffect)((function(){var element=ref.current;return element.addEventListener("dragenter",handleDragIn),element.addEventListener("dragleave",handleDragOut),element.addEventListener("dragover",handleDrag),element.addEventListener("drop",handleDrop),function(){element.removeEventListener("dragenter",handleDragIn),element.removeEventListener("dragleave",handleDragOut),element.removeEventListener("dragover",handleDrag),element.removeEventListener("drop",handleDrop)}})),(0,jsx_runtime.jsx)("div",{className:FileDropper_module_fileDropContainer,ref:ref,children:modelSrc.length<1?(0,jsx_runtime.jsx)("div",{className:FileDropper_module_placeholder,children:placeholder}):react.Children.map(react.Children.toArray(children),(function(child){return(0,react.cloneElement)(child,{modelSrc:modelSrc,animationSrc:animationSrc})}))})};FileDropper.__docgenInfo={description:"This component is only for using in Storybook for showcasing drag'n'drop functionality.",methods:[],displayName:"FileDropper",props:{placeholder:{defaultValue:{value:"`Drag n' Drop a .glb model here, then Drop an animation .glb or .fbx`",computed:!1},required:!1}}}},"./src/services/Stories.service.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{HI:function(){return modelPresets},eE:function(){return emotions},jb:function(){return animationPresets},nx:function(){return ignoreArgTypesOnExamples}});var _Models_service__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/services/Models.service.tsx"),disableTable={table:{disable:!0}},ignoreArgTypesOnExamples=["modelSrc","animationSrc","poseSrc","halfBody","shadows","cameraTarget","cameraInitialDistance","style","idleRotation","emotion","background","capture","loader","dpr","className","headMovement","cameraZoomTarget","bloom","onLoadedEffect","onLoadedAnimation","children","environment","ambientLightColor","dirLightColor","spotLightColor","ambientLightIntensity","dirLightIntensity","spotLightIntensity","spotLightAngle","onLoaded","onLoading","fov","spotLightPosition","dirLightPosition","scale"].reduce((function(acc,key){return acc[key]=disableTable,acc}),{}),modelPresets={one:"https://models.readyplayer.me/64d61e9e17883fd73ebe5eb7.glb?morphTargets=ARKit,Eyes Extra&textureAtlas=none&lod=0",two:"https://models.readyplayer.me/64d61f67f0367d07504924be.glb?morphTargets=ARKit,Eyes Extra&textureAtlas=none&lod=0",three:"https://models.readyplayer.me/64d62255f0367d0750492913.glb?lod=0&morphTargets=ARKit,Eyes Extra&textureAtlas=none",five:"https://models.readyplayer.me/64d6235e2d3bea6e4267b01d.glb?lod=0&morphTargets=ARKit,Eyes Extra&textureAtlas=none",six:"https://models.readyplayer.me/64d5d4eb651a0d350005c672.glb?lod=0&morphTargets=ARKit,Eyes Extra&textureAtlas=none",seven:"https://models.readyplayer.me/64e3055495439dfcf3f0b665.glb?morphTargets=ARKit,Eyes%20Extra&textureAtlas=none"},animationPresets={one:(0,_Models_service__WEBPACK_IMPORTED_MODULE_0__.gT)("male-idle-1.fbx"),two:(0,_Models_service__WEBPACK_IMPORTED_MODULE_0__.gT)("male-idle-2.fbx"),three:(0,_Models_service__WEBPACK_IMPORTED_MODULE_0__.gT)("male-idle-3.fbx")},emotions={idle:{},angry:{mouthDimpleLeft:.48,mouthShrugLower:.385,eyeSquintLeft:.63,eyeSquintRight:.614,browDownLeft:.842,browDownRight:.56,noseSneerLeft:.3,noseSneerRight:.3},smile:{eyeSquintLeft:.4,eyeSquintRight:.2,mouthSmileLeft:.37,mouthSmileRight:.36,mouthShrugUpper:.27,browInnerUp:.3,browOuterUpLeft:.37,browOuterUpRight:.49},sad:{eyeWideLeft:.5,eyeWideRight:.4,mouthPucker:.19,mouthFrownLeft:.6,mouthFrownRight:.6,mouthRollLower:.33,mouthRollUpper:.02,mouthShrugLower:.4,browInnerUp:.78,noseSneerLeft:.115,noseSneerRight:.1}}}}]); \ No newline at end of file diff --git a/docs/135.78107015.iframe.bundle.js b/docs/135.78107015.iframe.bundle.js deleted file mode 100644 index 7e3d31aa..00000000 --- a/docs/135.78107015.iframe.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 135.78107015.iframe.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[135],{"./node_modules/@react-three/drei/core/StatsGl.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{G:function(){return StatsGl}});var react=__webpack_require__("./node_modules/react/index.js"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js");class Stats{constructor({logsPerSecond:logsPerSecond=20,samplesLog:samplesLog=100,samplesGraph:samplesGraph=10,precision:precision=2,minimal:minimal=!1,horizontal:horizontal=!0,mode:mode=0}={}){this.mode=mode,this.horizontal=horizontal,this.container=document.createElement("div"),this.container.style.cssText="position:fixed;top:0;left:0;opacity:0.9;z-index:10000;",minimal&&(this.container.style.cssText+="cursor:pointer"),this.canvasGpu=null,this.gl=null,this.query=null,this.minimal=minimal,this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.frames=0,this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.queryCreated=!1,this.fpsPanel=this.addPanel(new Stats.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new Stats.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=samplesLog,this.samplesGraph=samplesGraph,this.precision=precision,this.logsPerSecond=logsPerSecond,this.minimal?(this.container.addEventListener("click",(event=>{event.preventDefault(),this.showPanel(++this.mode%this.container.children.length)}),!1),this.mode=mode,this.showPanel(this.mode)):window.addEventListener("resize",(()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2)}))}resizePanel(panel,offset){panel.canvas.style.position="absolute",this.minimal?panel.canvas.style.display="none":(panel.canvas.style.display="block",this.horizontal?(panel.canvas.style.top="0px",panel.canvas.style.left=offset*panel.WIDTH/panel.PR+"px"):(panel.canvas.style.left="0px",panel.canvas.style.top=offset*panel.HEIGHT/panel.PR+"px"))}addPanel(panel,offset){return panel.canvas&&(this.container.appendChild(panel.canvas),this.resizePanel(panel,offset)),panel}showPanel(id){for(let i=0;i=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=time),time>=this.prevTime+1e3){const fps=1e3*this.frames/(time-this.prevTime);this.fpsPanel.update(fps,fps,100,100,0),this.prevTime=time,this.frames=0}return time}addToAverage(value,averageArray){averageArray.logs.push(value),averageArray.logs.length>this.samplesLog&&averageArray.logs.shift(),averageArray.graph.push(value),averageArray.graph.length>this.samplesGraph&&averageArray.graph.shift()}beginProfiling(marker){window.performance&&window.performance.mark(marker)}endProfiling(startMarker,endMarker,measureName,averageArray){if(window.performance&&endMarker){window.performance.mark(endMarker);const cpuMeasure=performance.measure(measureName,startMarker,endMarker);this.addToAverage(cpuMeasure.duration,averageArray)}}updatePanel(panel,averageArray){if(averageArray.logs.length>0){let sumLog=0,max=.01;for(let i=0;imax&&(max=averageArray.logs[i]);let sumGraph=0,maxGraph=.01;for(let i=0;imaxGraph&&(maxGraph=averageArray.graph[i]);panel&&panel.update(sumLog/Math.min(averageArray.logs.length,this.samplesLog),sumGraph/Math.min(averageArray.graph.length,this.samplesGraph),max,maxGraph,this.precision)}}}function StatsGl({className:className,parent:parent,...props}){const gl=(0,index_673ef987_esm.z)((state=>state.gl)),stats=react.useMemo((()=>{const stats=new Stats({...props});return stats.init(gl.domElement),stats}),[gl]);return react.useEffect((()=>{if(stats){const node=parent&&parent.current||document.body;null==node||node.appendChild(stats.container),className&&stats.container.classList.add(...className.split(" ").filter((cls=>cls)));const begin=(0,index_673ef987_esm.n)((()=>stats.begin())),end=(0,index_673ef987_esm.o)((()=>stats.end()));return()=>{null==node||node.removeChild(stats.container),begin(),end()}}}),[parent,stats,className]),null}Stats.Panel=class Panel{constructor(name,fg,bg){this.name=name,this.fg=fg,this.bg=bg,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=90*this.PR,this.canvas.height=48*this.PR,this.canvas.style.width="90px",this.canvas.style.position="absolute",this.canvas.style.height="48px",this.canvas.style.cssText="width:90px;height:48px",this.context=this.canvas.getContext("2d"),this.context&&(this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(value,valueGraph,maxValue,maxGraph,decimals=0){let min=1/0,max=0;this.context&&(min=Math.min(min,value),max=Math.max(maxValue,value),maxGraph=Math.max(maxGraph,valueGraph),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(value.toFixed(decimals)+" "+this.name+" ("+min.toFixed(decimals)+"-"+parseFloat(max.toFixed(decimals))+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,(1-valueGraph/maxGraph)*this.GRAPH_HEIGHT))}}},"./node_modules/eventemitter3/index.js":function(module){var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function addListener(emitter,event,fn,context,once){if("function"!=typeof fn)throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){0==--emitter._eventsCount?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function eventNames(){var events,name,names=[];if(0===this._eventsCount)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names},EventEmitter.prototype.listeners=function listeners(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i{let state;const listeners=new Set,setState=(partial,replace)=>{const nextState="function"==typeof partial?partial(state):partial;if(!Object.is(nextState,state)){const previousState=state;state=(null!=replace?replace:"object"!=typeof nextState)?nextState:Object.assign({},state,nextState),listeners.forEach((listener=>listener(state,previousState)))}},getState=()=>state,api={setState:setState,getState:getState,subscribe:listener=>(listeners.add(listener),()=>listeners.delete(listener)),destroy:()=>listeners.clear()};return state=createState(setState,getState,api),api};var with_selector=__webpack_require__("./node_modules/use-sync-external-store/shim/with-selector.js");const{useSyncExternalStoreWithSelector:useSyncExternalStoreWithSelector}=with_selector;const createImpl=createState=>{const api="function"==typeof createState?(createState=>createState?createStoreImpl(createState):createStoreImpl)(createState):createState,useBoundStore=(selector,equalityFn)=>function useStore(api,selector=api.getState,equalityFn){const slice=useSyncExternalStoreWithSelector(api.subscribe,api.getState,api.getServerState||api.getState,selector,equalityFn);return(0,react.useDebugValue)(slice),slice}(api,selector,equalityFn);return Object.assign(useBoundStore,api),useBoundStore};function shallow(objA,objB){if(Object.is(objA,objB))return!0;if("object"!=typeof objA||null===objA||"object"!=typeof objB||null===objB)return!1;if(objA instanceof Map&&objB instanceof Map){if(objA.size!==objB.size)return!1;for(const[key,value]of objA)if(!Object.is(value,objB.get(key)))return!1;return!0}if(objA instanceof Set&&objB instanceof Set){if(objA.size!==objB.size)return!1;for(const value of objA)if(!objB.has(value))return!1;return!0}const keysA=Object.keys(objA);if(keysA.length!==Object.keys(objB).length)return!1;for(let i=0;i({log:null,paused:!1,triggerProgramsUpdate:0,startTime:0,customData:0,fpsLimit:60,overclockingFps:!1,accumulated:{totalFrames:0,gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0},max:{gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0}}},chart:{data:{fps:[],cpu:[],gpu:[],mem:[]},circularId:0},gl:void 0,objectWithMaterials:null,scene:void 0,programs:new Map,sceneLength:void 0,tab:"infos",getReport:function getReport(){var _a;const{accumulated:accumulated,startTime:startTime,infos:infos}=get(),maxMemory=null==(_a=get().log)?void 0:_a.maxMemory,{totalFrames:totalFrames,log:log,gl:gl,max:max}=accumulated,glAverage={calls:gl.calls/totalFrames,triangles:gl.triangles/totalFrames,points:gl.points/totalFrames,lines:gl.lines/totalFrames},logAverage={gpu:log.gpu/totalFrames,cpu:log.cpu/totalFrames,mem:log.mem/totalFrames,fps:log.fps/totalFrames};return{sessionTime:(window.performance.now()-startTime)/1e3,infos:infos,log:logAverage,gl:glAverage,max:max,maxMemory:maxMemory,totalFrames:totalFrames}}}))?createImpl(createState):createImpl;var createState;const usePerf=sel=>usePerfImpl(sel,shallow);Object.assign(usePerf,usePerfImpl);const{getState:getPerf,setState:setPerf}=usePerfImpl,overLimitFps={value:0,fpsLimit:60,isOverLimit:0},average=arr=>(null==arr?void 0:arr.reduce(((a,b)=>a+b),0))/arr.length;class GLPerf{constructor(settings={}){this.names=[""],this.finished=[],this.paused=!1,this.overClock=!1,this.queryHasResult=!1,this.queryCreated=!1,this.isWebGL2=!0,this.memAccums=[],this.gpuAccums=[],this.activeAccums=[],this.logsAccums={mem:[],gpu:[],cpu:[],fps:[],fpsFixed:[]},this.fpsChart=[],this.gpuChart=[],this.cpuChart=[],this.memChart=[],this.paramLogger=()=>{},this.glFinish=()=>{},this.chartLogger=()=>{},this.chartLen=60,this.logsPerSecond=10,this.maxMemory=1500,this.chartHz=10,this.startCpuProfiling=!1,this.lastCalculateFixed=0,this.chartFrame=0,this.gpuTimeProcess=0,this.chartTime=0,this.activeQueries=0,this.circularId=0,this.detected=0,this.frameId=0,this.rafId=0,this.idleCbId=0,this.checkQueryId=0,this.uuid=void 0,this.currentCpu=0,this.currentMem=0,this.paramFrame=0,this.paramTime=0,this.now=()=>{},this.t0=0,window.GLPerf=window.GLPerf||{},Object.assign(this,settings),this.fpsChart=new Array(this.chartLen).fill(0),this.gpuChart=new Array(this.chartLen).fill(0),this.cpuChart=new Array(this.chartLen).fill(0),this.memChart=new Array(this.chartLen).fill(0),this.now=()=>window.performance&&window.performance.now?window.performance.now():Date.now(),this.initGpu(),this.is120hz()}initGpu(){this.uuid=three_module.MathUtils.generateUUID(),this.gl&&(this.isWebGL2=!0,this.extension||(this.extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")),null===this.extension&&(this.isWebGL2=!1))}is120hz(){let n=0;const loop=t=>{++n<20?this.rafId=window.requestAnimationFrame(loop):(this.detected=Math.ceil(1e3*n/(t-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=t)};this.rafId=window.requestAnimationFrame(loop)}addUI(name){-1===this.names.indexOf(name)&&(this.names.push(name),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(d){const goal=1e3/60,elapsed=goal-d.timeRemaining(),fps=goal*overLimitFps.fpsLimit/10/elapsed;fps<0||(overLimitFps.value=fps,overLimitFps.isOverLimit<25?overLimitFps.isOverLimit++:setPerf({overclockingFps:!0}))}nextFrame(now){this.frameId++;const t=now||this.now();let duration=t-this.paramTime,gpu=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=t;else if(t>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const frameCount=this.frameId-this.paramFrame,fpsFixed=1e3*frameCount/duration,fps=getPerf().overclockingFps?overLimitFps.value:fpsFixed;if(gpu=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/duration,this.isWebGL2?this.gpuAccums[0]=0:Promise.all(this.finished).then((()=>{this.gpuAccums[0]=0,this.finished=[]})),this.currentMem=Math.round(window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize/1048576:0),window.performance&&this.startCpuProfiling){window.performance.mark("cpu-finished");const cpuMeasure=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=cpuMeasure.duration,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(fpsFixed),this.logsAccums.fps.push(fps),this.logsAccums.gpu.push(gpu),this.overClock&&void 0!==window.requestIdleCallback&&(overLimitFps.isOverLimit>0&&fps>fpsFixed?overLimitFps.isOverLimit--:getPerf().overclockingFps&&setPerf({overclockingFps:!1})),t>=this.paramTime+1e3/this.logsPerSecond&&(this.paramLogger({cpu:average(this.logsAccums.cpu),gpu:average(this.logsAccums.gpu),mem:average(this.logsAccums.mem),fps:average(this.logsAccums.fps),duration:Math.round(duration),maxMemory:this.maxMemory,frameCount:frameCount}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=t),this.overClock&&t-this.lastCalculateFixed>=2e3&&(this.lastCalculateFixed=now,overLimitFps.fpsLimit=100*Math.round(average(this.logsAccums.fpsFixed)/10),setPerf({fpsLimit:overLimitFps.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=t)}if(this.detected&&this.chartFrame){const timespan=t-this.chartTime;let hz=this.chartHz*timespan/1e3;for(;--hz>0&&this.detected;){const fpsFixed=(this.frameId-this.chartFrame)/timespan*1e3,fps=getPerf().overclockingFps?overLimitFps.value:fpsFixed;this.fpsChart[this.circularId%this.chartLen]=fps;const memS=1e3/this.currentMem,cpuS=this.currentCpu,gpuS=(this.isWebGL2?2*this.gpuAccums[1]:Math.round(this.gpuAccums[1]/duration*100))+4;gpuS>0&&(this.gpuChart[this.circularId%this.chartLen]=gpuS),cpuS>0&&(this.cpuChart[this.circularId%this.chartLen]=cpuS),memS>0&&(this.memChart[this.circularId%this.chartLen]=memS);for(let i=0;i0&&(disjoint||this.activeAccums.forEach(((_active,i)=>{this.gpuAccums[i]=ms})))}}!available&&this.query||(this.queryCreated=!0,this.query=gl.createQuery(),gl.beginQuery(ext.TIME_ELAPSED_EXT,this.query))}}endGpu(){const ext=this.extension,gl=this.gl;this.isWebGL2&&this.queryCreated&&gl.getQuery(ext.TIME_ELAPSED_EXT,gl.CURRENT_QUERY)&&gl.endQuery(ext.TIME_ELAPSED_EXT)}begin(name){this.startGpu(),this.updateAccums(name)}end(name){this.endGpu(),this.updateAccums(name)}updateAccums(name){let nameId=this.names.indexOf(name);-1===nameId&&(nameId=this.names.length,this.addUI(name));const t=this.now();this.activeAccums[nameId]=!this.activeAccums[nameId],this.t0=t}}var eventemitter3=__webpack_require__("./node_modules/eventemitter3/index.js");const eventEmitter=new(__webpack_require__.n(eventemitter3)());const updateMatrixWorldTemp=three_module.Object3D.prototype.updateMatrixWorld,updateWorldMatrixTemp=three_module.Object3D.prototype.updateWorldMatrix,updateMatrixTemp=three_module.Object3D.prototype.updateMatrix,maxGl=["calls","triangles","points","lines"],maxLog=["gpu","cpu","mem","fps"];let matriceWorldCount={value:0},matriceCount={value:0};const addMuiPerfID=(material,currentObjectWithMaterials)=>{material.defines||(material.defines={}),material.defines&&!material.defines.muiPerf&&(material.defines=Object.assign(material.defines||{},{muiPerf:material.uuid}));const uuid=material.uuid;return currentObjectWithMaterials[uuid]||(currentObjectWithMaterials[uuid]={meshes:{},material:material},material.needsUpdate=!0),material.needsUpdate=!1,uuid},getMUIIndex=muid=>"muiPerf"===muid,PerfHeadless=({overClock:overClock,logsPerSecond:logsPerSecond,chart:chart,deepAnalyze:deepAnalyze,matrixUpdate:matrixUpdate})=>{const{gl:gl,scene:scene}=(0,index_673ef987_esm.z)();setPerf({gl:gl,scene:scene});const PerfLib=(0,react.useMemo)((()=>{const PerfLib2=new GLPerf({trackGPU:!0,overClock:overClock,chartLen:chart?chart.length:120,chartHz:chart?chart.hz:60,logsPerSecond:logsPerSecond||10,gl:gl.getContext(),chartLogger:chart2=>{setPerf({chart:chart2})},paramLogger:logger=>{const log={maxMemory:logger.maxMemory,gpu:logger.gpu,cpu:logger.cpu,mem:logger.mem,fps:logger.fps,totalTime:logger.duration,frameCount:logger.frameCount};setPerf({log:log});const{accumulated:accumulated}=getPerf(),glRender=gl.info.render;accumulated.totalFrames++,accumulated.gl.calls+=glRender.calls,accumulated.gl.triangles+=glRender.triangles,accumulated.gl.points+=glRender.points,accumulated.gl.lines+=glRender.lines,accumulated.log.gpu+=logger.gpu,accumulated.log.cpu+=logger.cpu,accumulated.log.mem+=logger.mem,accumulated.log.fps+=logger.fps;for(let i=0;iaccumulated.max.gl[key]&&(accumulated.max.gl[key]=value)}for(let i=0;iaccumulated.max.log[key]&&(accumulated.max.log[key]=value)}setPerf({accumulated:accumulated}),function emitEvent(eventName,payload){eventEmitter.emit(eventName,payload)}("log",[log,gl])}}),ctx=gl.getContext();let glRenderer=null,glVendor=null;const rendererInfo=ctx.getExtension("WEBGL_debug_renderer_info"),glVersion=ctx.getParameter(ctx.VERSION);null!=rendererInfo&&(glRenderer=ctx.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL),glVendor=ctx.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL)),glVendor||(glVendor="Unknown vendor"),glRenderer||(glRenderer=ctx.getParameter(ctx.RENDERER)),setPerf({startTime:window.performance.now(),infos:{version:glVersion,renderer:glRenderer,vendor:glVendor}});const callbacks=new Map,callbacksAfter=new Map;return Object.defineProperty(three_module.Scene.prototype,"onBeforeRender",{get(){return(...args)=>{var _a;PerfLib2&&PerfLib2.begin("profiler"),null==(_a=callbacks.get(this))||_a(...args)}},set(callback){callbacks.set(this,callback)},configurable:!0}),Object.defineProperty(three_module.Scene.prototype,"onAfterRender",{get(){return(...args)=>{var _a;PerfLib2&&PerfLib2.end("profiler"),null==(_a=callbacksAfter.get(this))||_a(...args)}},set(callback){callbacksAfter.set(this,callback)},configurable:!0}),PerfLib2}),[]);return(0,react.useEffect)((()=>{PerfLib&&(PerfLib.overClock=overClock||!1,!1===overClock&&(setPerf({overclockingFps:!1}),overLimitFps.value=0,overLimitFps.isOverLimit=0),PerfLib.chartHz=(null==chart?void 0:chart.hz)||60,PerfLib.chartLen=(null==chart?void 0:chart.length)||120)}),[overClock,PerfLib,null==chart?void 0:chart.length,null==chart?void 0:chart.hz]),(0,react.useEffect)((()=>{matrixUpdate&&(three_module.Object3D.prototype.updateMatrixWorld=function(){(this.matrixWorldNeedsUpdate||arguments[0])&&matriceWorldCount.value++,updateMatrixWorldTemp.apply(this,arguments)},three_module.Object3D.prototype.updateWorldMatrix=function(){matriceWorldCount.value++,updateWorldMatrixTemp.apply(this,arguments)},three_module.Object3D.prototype.updateMatrix=function(){matriceCount.value++,updateMatrixTemp.apply(this,arguments)}),gl.info.autoReset=!1;let effectSub=null,afterEffectSub=null;if(gl.info)return effectSub=(0,index_673ef987_esm.n)((function preRafR3FPerf(){getPerf().paused&&setPerf({paused:!1}),window.performance&&(window.performance.mark("cpu-started"),PerfLib.startCpuProfiling=!0),matriceCount.value-=1,matriceWorldCount.value=0,matriceCount.value=0,gl.info&&gl.info.reset()})),afterEffectSub=(0,index_673ef987_esm.o)((function postRafR3FPerf(){var _a,_b;if(PerfLib&&!PerfLib.paused&&(PerfLib.nextFrame(window.performance.now()),overClock&&void 0!==window.requestIdleCallback&&(PerfLib.idleCbId=requestIdleCallback(PerfLib.nextFps))),deepAnalyze){const currentObjectWithMaterials={},programs=new Map;scene.traverse((function deepAnalyzeR3FPerf(object){if((object instanceof three_module.Mesh||object instanceof three_module.Points)&&object.material){let uuid=object.material.uuid;const isTroika=Array.isArray(object.material)&&object.material.length>1;uuid=addMuiPerfID(isTroika?object.material[1]:object.material,currentObjectWithMaterials),currentObjectWithMaterials[uuid].meshes[object.uuid]=object}})),null==(_b=null==(_a=null==gl?void 0:gl.info)?void 0:_a.programs)||_b.forEach((program=>{const cacheKeySplited=program.cacheKey.split(","),muiPerfTracker=cacheKeySplited[cacheKeySplited.findIndex(getMUIIndex)+1];if((uuid=>{let s=""+uuid;return s=s.match("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"),null!==s})(muiPerfTracker)&¤tObjectWithMaterials[muiPerfTracker]){const{material:material,meshes:meshes}=currentObjectWithMaterials[muiPerfTracker];programs.set(muiPerfTracker,{program:program,material:material,meshes:meshes,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}})),programs.size!==getPerf().programs.size&&((programs=>{programs.forEach(((program,_pkey)=>{const{meshes:meshes}=program;if(!meshes)return;let drawCounts2={total:0,type:"Triangle",data:[]};Object.keys(meshes).forEach((key=>{const mesh=meshes[key],{geometry:geometry,material:material}=mesh;let index=geometry.index;const position=geometry.attributes.position;if(!position)return;let rangeFactor=1;!0===material.wireframe&&(rangeFactor=0);const dataCount=null!==index?index.count:position.count,rangeStart=geometry.drawRange.start*rangeFactor,rangeCount=geometry.drawRange.count*rangeFactor,drawStart=rangeStart,drawEnd=Math.min(dataCount,rangeStart+rangeCount)-1;let countInstanceRatio=1;const instanceCount=mesh.count||1;let type="Triangle",mostDrawCalls=0;mesh.isMesh?!0===material.wireframe?(type="Line",countInstanceRatio/=2):(type="Triangle",countInstanceRatio/=3):mesh.isLine?(type="Line",mesh.isLineSegments?countInstanceRatio/=2:mesh.isLineLoop||(countInstanceRatio-=1)):mesh.isPoints?type="Point":mesh.isSprite&&(type="Triangle",countInstanceRatio/=3);const drawCount=Math.round(Math.max(0,drawEnd-drawStart+1)*(countInstanceRatio*instanceCount));drawCount>mostDrawCalls&&(mostDrawCalls=drawCount,drawCounts2.type=type),drawCounts2.total+=drawCount,drawCounts2.data.push({drawCount:drawCount,type:type}),mesh.userData.drawCount={type:type,count:drawCount}})),program.drawCounts=drawCounts2}))})(programs),setPerf({programs:programs,triggerProgramsUpdate:getPerf().triggerProgramsUpdate++}))}})),()=>{PerfLib&&(void 0!==window.cancelIdleCallback&&window.cancelIdleCallback(PerfLib.idleCbId),window.cancelAnimationFrame(PerfLib.rafId),window.cancelAnimationFrame(PerfLib.checkQueryId)),matrixUpdate&&(three_module.Object3D.prototype.updateMatrixWorld=updateMatrixTemp),effectSub(),afterEffectSub()}}),[PerfLib,gl,chart,matrixUpdate]),(0,react.useEffect)((()=>{const unsub=(0,index_673ef987_esm.p)((function postRafTailR3FPerf(){return PerfLib&&(PerfLib.paused=!0,matriceCount.value=0,matriceWorldCount.value=0,setPerf({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1}));return()=>{unsub()}}),[]),null};var X,e="colors",t="sizes",r="space",n={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:e,backgroundColor:e,backgroundImage:e,borderImage:e,border:e,borderBlock:e,borderBlockEnd:e,borderBlockStart:e,borderBottom:e,borderBottomColor:e,borderColor:e,borderInline:e,borderInlineEnd:e,borderInlineStart:e,borderLeft:e,borderLeftColor:e,borderRight:e,borderRightColor:e,borderTop:e,borderTopColor:e,caretColor:e,color:e,columnRuleColor:e,fill:e,outline:e,outlineColor:e,stroke:e,textDecorationColor:e,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t,minBlockSize:t,maxBlockSize:t,inlineSize:t,minInlineSize:t,maxInlineSize:t,width:t,minWidth:t,maxWidth:t,height:t,minHeight:t,maxHeight:t,flexBasis:t,gridTemplateColumns:t,gridTemplateRows:t,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,o=()=>{const e=Object.create(null);return(t,r,...n)=>{const o=(e=>JSON.stringify(e,i))(t);return o in e?e[o]:e[o]=r(t,...n)}},l=Symbol.for("sxs.internal"),s=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),a=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:c}=Object.prototype,d=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),g=/\s+(?![^()]*\))/,p=e=>t=>e(..."string"==typeof t?String(t).split(g):[t]),u={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:p(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:p(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:p(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:p(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:p(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:p(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},h=/([\d.]+)([^]*)/,f=(e,t)=>e.length?e.reduce(((e,r)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(e)?`:is(${r})`:r):r+" "+e))),e)),[]):t,m=(e,t)=>e in b&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,r,n,i)=>r+("stretch"===n?`-moz-available${i};${d(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${d(e)}:${r}fit-content`)+i)):String(t),b={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S=e=>e?e+"-":"",k=(e,t,r)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((e,n,i,o,l)=>"$"==o==!!i?e:(n||"--"==o?"calc(":"")+"var(--"+("$"===o?S(t)+(l.includes("$")?"":S(r))+l.replace(/\$/g,"-"):l)+")"+(n||"--"==o?"*"+(n||"")+(i||"1")+")":""))),y=/\s*,\s*(?![^()]*\))/,B=Object.prototype.toString,$=(e,t,r,n,i)=>{let o,l,s;const a=(e,t,r)=>{let c,g;const p=e=>{for(c in e){const R=64===c.charCodeAt(0),z=R&&Array.isArray(e[c])?e[c]:[e[c]];for(g of z){const e=/[A-Z]/.test($=c)?$:$.replace(/-[^]/g,(e=>e[1].toUpperCase())),z="object"==typeof g&&g&&g.toString===B&&(!n.utils[e]||!t.length);if(e in n.utils&&!z){const t=n.utils[e];if(t!==l){l=t,p(t(g)),l=null;continue}}else if(e in u){const t=u[e];if(t!==s){s=t,p(t(g)),s=null;continue}}if(R&&(b=c.slice(1)in n.media?"@media "+n.media[c.slice(1)]:c,c=b.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,r,n,i,o)=>{const l=h.test(t),s=.0625*(l?-1:1),[a,c]=l?[n,t]:[t,n];return"("+("="===r[0]?"":">"===r[0]===l?"max-":"min-")+a+":"+("="!==r[0]&&1===r.length?c.replace(h,((e,t,n)=>Number(t)+s*(">"===r?1:-1)+n)):c)+(i?") and ("+(">"===i[0]?"min-":"max-")+a+":"+(1===i.length?o.replace(h,((e,t,r)=>Number(t)+s*(">"===i?-1:1)+r)):o):"")+")"}))),z){const e=R?r.concat(c):[...r],n=R?[...t]:f(t,c.split(y));void 0!==o&&i(x(...o)),o=void 0,a(g,n,e)}else void 0===o&&(o=[[],t,r]),c=R||36!==c.charCodeAt(0)?c:`--${S(n.prefix)}${c.slice(1).replace(/\$/g,"-")}`,g=z?g:"number"==typeof g?g&&e in I?String(g)+"px":String(g):k(m(e,null==g?"":g),n.prefix,n.themeMap[e]),o[0].push(`${R?`${c} `:`${d(c)}:`}${g}`)}}var b,$};p(e),void 0!==o&&i(x(...o)),o=void 0};a(e,t,r)},x=(e,t,r)=>`${r.map((e=>`${e}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(r.length?r.length+1:0).join("}")}`,I={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R=e=>String.fromCharCode(e+(e>25?39:97)),z=e=>(e=>{let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=R(t%52)+r;return R(t%52)+r})(((e,t)=>{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e})(5381,JSON.stringify(e))>>>0),W=["themed","global","styled","onevar","resonevar","allvar","inline"],j=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(e){return!1}},E=e=>{let t;const r=()=>{const{cssRules:e}=t.sheet;return[].map.call(e,((r,n)=>{const{cssText:i}=r;let o="";if(i.startsWith("--sxs"))return"";if(e[n-1]&&(o=e[n-1].cssText).startsWith("--sxs")){if(!r.cssRules.length)return"";for(const e in t.rules)if(t.rules[e].group===r)return`--sxs{--sxs:${[...t.rules[e].cache].join(" ")}}${i}`;return r.cssRules.length?`${o}${i}`:""}return i})).join("")},n=()=>{if(t){const{rules:e,sheet:r}=t;if(!r.deleteRule){for(;3===Object(Object(r.cssRules)[0]).type;)r.cssRules.splice(0,1);r.cssRules=[]}for(const t in e)delete e[t]}const i=Object(e).styleSheets||[];for(const e of i)if(j(e)){for(let i=0,o=e.cssRules;o[i];++i){const l=Object(o[i]);if(1!==l.type)continue;const s=Object(o[i+1]);if(4!==s.type)continue;++i;const{cssText:a}=l;if(!a.startsWith("--sxs"))continue;const c=a.slice(14,-3).trim().split(/\s+/),d=W[c[0]];d&&(t||(t={sheet:e,reset:n,rules:{},toString:r}),t.rules[d]={group:s,index:i,cache:new Set(c)})}if(t)break}if(!t){const i=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,i(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,(e=>e.cssText)).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:i("","text/css"),rules:{},reset:n,toString:r}}const{sheet:o,rules:l}=t;for(let e=W.length-1;e>=0;--e){const t=W[e];if(!l[t]){const r=W[e+1],n=l[r]?l[r].index:o.cssRules.length;o.insertRule("@media{}",n),o.insertRule(`--sxs{--sxs:${e}}`,n),l[t]={group:o.cssRules[n+1],index:n,cache:new Set([e])}}v(l[t])}};return n(),t},v=e=>{const t=e.group;let r=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,r),++r}catch(e){}}},T=Symbol(),w=o(),M=(e,t)=>w(e,(()=>(...r)=>{let n={type:null,composers:new Set};for(const t of r)if(null!=t)if(t[l]){null==n.type&&(n.type=t[l].type);for(const e of t[l].composers)n.composers.add(e)}else t.constructor!==Object||t.$$typeof?null==n.type&&(n.type=t):n.composers.add(C(t,e));return null==n.type&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),P(e,n,t)})),C=({variants:e,compoundVariants:t,defaultVariants:r,...n},i)=>{const o=`${S(i.prefix)}c-${z(n)}`,l=[],s=[],d=Object.create(null),g=[];for(const e in r)d[e]=String(r[e]);if("object"==typeof e&&e)for(const t in e){p=d,u=t,c.call(p,u)||(d[t]="undefined");const r=e[t];for(const e in r){const n={[t]:String(e)};"undefined"===String(e)&&g.push(t);const i=r[e],o=[n,i,!a(i)];l.push(o)}}var p,u;if("object"==typeof t&&t)for(const e of t){let{css:t,...r}=e;t="object"==typeof t&&t||{};for(const e in r)r[e]=String(r[e]);const n=[r,t,!a(t)];s.push(n)}return[o,n,l,s,d,g]},P=(e,t,r)=>{const[n,i,o,a]=L(t.composers),c="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let r=0;rt.rules[e]={apply:r=>t[T].push([e,r])})),t})(r):null,d=(c||r).rules,g=`.${n}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,p=l=>{l="object"==typeof l&&l||A;const{css:s,...p}=l,u={};for(const e in o)if(delete p[e],e in l){let t=l[e];"object"==typeof t&&t?u[e]={"@initial":o[e],...t}:(t=String(t),u[e]="undefined"!==t||a.has(e)?t:o[e])}else u[e]=o[e];const h=new Set([...i]);for(const[n,i,o,l]of t.composers){r.rules.styled.cache.has(n)||(r.rules.styled.cache.add(n),$(i,[`.${n}`],[],e,(e=>{d.styled.apply(e)})));const t=O(o,u,e.media),s=O(l,u,e.media,!0);for(const i of t)if(void 0!==i)for(const[t,o,l]of i){const i=`${n}-${z(o)}-${t}`;h.add(i);const s=(l?r.rules.resonevar:r.rules.onevar).cache,a=l?d.resonevar:d.onevar;s.has(i)||(s.add(i),$(o,[`.${i}`],[],e,(e=>{a.apply(e)})))}for(const t of s)if(void 0!==t)for(const[i,o]of t){const t=`${n}-${z(o)}-${i}`;h.add(t),r.rules.allvar.cache.has(t)||(r.rules.allvar.cache.add(t),$(o,[`.${t}`],[],e,(e=>{d.allvar.apply(e)})))}}if("object"==typeof s&&s){const t=`${n}-i${z(s)}-css`;h.add(t),r.rules.inline.cache.has(t)||(r.rules.inline.cache.add(t),$(s,[`.${t}`],[],e,(e=>{d.inline.apply(e)})))}for(const e of String(l.className||"").trim().split(/\s+/))e&&h.add(e);const f=p.className=[...h].join(" ");return{type:t.type,className:f,selector:g,props:p,toString:()=>f,deferredInjector:c}};return s(p,{className:n,selector:g,[l]:t,toString:()=>(r.rules.styled.cache.has(n)||p(),n)})},L=e=>{let t="";const r=[],n={},i=[];for(const[o,,,,l,s]of e){""===t&&(t=o),r.push(o),i.push(...s);for(const e in l){const t=l[e];(void 0===n[e]||"undefined"!==t||s.includes(t))&&(n[e]=t)}}return[t,r,n,new Set(i)]},O=(e,t,r,n)=>{const i=[];e:for(let[o,l,s]of e){if(s)continue;let e,a=0,c=!1;for(e in o){const n=o[e];let i=t[e];if(i!==n){if("object"!=typeof i||!i)continue e;{let e,t,o=0;for(const l in i){if(n===String(i[l])){if("@initial"!==l){const e=l.slice(1);(t=t||[]).push(e in r?r[e]:l.replace(/^@media ?/,"")),c=!0}a+=o,e=!0}++o}if(t&&t.length&&(l={["@media "+t.join(", ")]:l}),!e)continue e}}}(i[a]=i[a]||[]).push([n?"cv":`${e}-${o[e]}`,l,c])}return i},A={},N=o(),D=(e,t)=>N(e,(()=>(...r)=>{const n=()=>{for(let n of r){n="object"==typeof n&&n||{};let r=z(n);if(!t.rules.global.cache.has(r)){if(t.rules.global.cache.add(r),"@import"in n){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let r of[].concat(n["@import"]))r=r.includes('"')||r.includes("'")?r:`"${r}"`,t.sheet.insertRule(`@import ${r};`,e++);delete n["@import"]}$(n,[],[],e,(e=>{t.rules.global.apply(e)}))}}return""};return s(n,{toString:n})})),H=o(),V=(e,t)=>H(e,(()=>r=>{const n=`${S(e.prefix)}k-${z(r)}`,i=()=>{if(!t.rules.global.cache.has(n)){t.rules.global.cache.add(n);const i=[];$(r,[],[],e,(e=>i.push(e)));const o=`@keyframes ${n}{${i.join("")}}`;t.rules.global.apply(o)}return n};return s(i,{get name(){return i()},toString:i})})),G=class{constructor(e,t,r,n){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==r?"":String(r),this.prefix=null==n?"":String(n)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S(this.prefix)+S(this.scale)+this.token}toString(){return this.computedValue}},F=o(),J=(e,t)=>F(e,(()=>(r,n)=>{n="object"==typeof r&&r||Object(n);const i=`.${r=(r="string"==typeof r?r:"")||`${S(e.prefix)}t-${z(n)}`}`,o={},l=[];for(const t in n){o[t]={};for(const r in n[t]){const i=`--${S(e.prefix)}${t}-${r}`,s=k(String(n[t][r]),e.prefix,t);o[t][r]=new G(r,s,t,e.prefix),l.push(`${i}:${s}`)}}const s=()=>{if(l.length&&!t.rules.themed.cache.has(r)){t.rules.themed.cache.add(r);const i=`${n===e.theme?":root,":""}.${r}{${l.join(";")}}`;t.rules.themed.apply(i)}return r};return{...o,get className(){return s()},selector:i,toString:s}})),U=o(),Y=o(),K=()=>X||(X=(e=>{const t=(e=>{let t=!1;const r=U(e,(e=>{t=!0;const r="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",i="object"==typeof e.media&&e.media||{},o="object"==typeof e.root?e.root||null:globalThis.document||null,l="object"==typeof e.theme&&e.theme||{},s={prefix:r,media:i,theme:l,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...n},utils:"object"==typeof e.utils&&e.utils||{}},a=E(o),c={css:M(s,a),globalCss:D(s,a),keyframes:V(s,a),createTheme:J(s,a),reset(){a.reset(),c.theme.toString()},theme:{},sheet:a,config:s,prefix:r,getCssText:a.toString,toString:a.toString};return String(c.theme=c.createTheme(l)),c}));return t||r.reset(),r})(e);return t.styled=(({config:e,sheet:t})=>Y(e,(()=>{const r=M(e,t);return(...e)=>{const t=r(...e),n=t[l].type,i=react.forwardRef(((e,r)=>{const i=e&&e.as||n,{props:o,deferredInjector:l}=t(e);return delete o.as,o.ref=r,l?react.createElement(react.Fragment,null,react.createElement(i,o),react.createElement(l,null)):react.createElement(i,o)}));return i.className=t.className,i.displayName=`Styled.${n.displayName||n.name||n}`,i.selector=t.selector,i.toString=()=>t.selector,i[l]=t[l],i}})))(t),t})()),re=(...e)=>K().styled(...e);const PerfS=re("div",{position:"fixed",top:0,right:0,zIndex:9999,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif",backgroundColor:"rgba(36, 36, 36, .9)",color:"#fff",margin:0,minHeight:"100px",padding:"4px 0","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale",userSelect:"none","&.top-left":{right:"initial",left:0},"&.bottom-left":{right:"initial",top:"initial",bottom:0,left:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.bottom-right":{top:"initial",bottom:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.minimal":{backgroundColor:"rgba(36, 36, 36, .75)"},"*":{margin:"0",padding:"0",border:"0",fontSize:"100%",lineHeight:"1",verticalAlign:"baseline"}}),PerfSmallI=re("small",{position:"absolute",right:0,fontSize:"10px"}),PerfI=re("div",{display:"inline-flex",fontStyle:"normal",padding:0,lineHeight:"13px",fontSize:"14px",width:"62px",position:"relative",pointerEvents:"auto",cursor:"default",fontWeight:500,letterSpacing:"0px",textAlign:"left",height:"29px",whiteSpace:"nowrap",justifyContent:"space-evenly",fontVariantNumeric:"tabular-nums",small:{paddingLeft:"12px"},svg:{padding:0,color:"rgba(145, 145, 145, 0.3)",fontSize:"40px",position:"absolute",zIndex:1,maxHeight:"20px",left:" 50%",marginLeft:"-23px",top:"4px"}}),PerfB=re("span",{verticalAlign:"bottom",position:"absolute",bottom:"5px",color:"rgba(101, 197, 188, 1)",textAlign:"right",letterSpacing:"1px",fontSize:"8px",fontWeight:"500",width:"60px"}),PerfIContainer=re("div",{display:"flex"}),ProgramHeader=re("div",{backgroundColor:"#404040",padding:"6px",display:"block",fontSize:"12px",marginBottom:"6px",cursor:"pointer","*":{cursor:"pointer !important"},"> span":{},small:{fontSize:"9px"},"> b":{marginRight:"4px",cursor:"pointer"}}),Graph=re("div",{height:"66px",overflow:"hidden",position:"absolute",pointerEvents:"none",display:"flex",top:"0px",justifyContent:"center",width:"100%",minWidth:"310px",margin:"0 auto",canvas:{background:"transparent !important",position:"absolute !important"}}),Graphpc=re("div",{textAlign:"center",fontWeight:700,fontSize:"12px",lineHeight:"12px",display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"middle",color:"#f1f1f1",padding:"7px",width:"100%",backgroundColor:"rgba(36, 36, 37, 0.8)",zIndex:1,position:"absolute",height:"100%"}),Toggle=re("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),ToggleVisible=re("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",float:"right",backgroundColor:"rgb(41, 43, 45)",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),ProgramGeo=re("div",{padding:"4px 6px",fontSize:"12px",pointerEvents:"auto"}),ProgramTitle=re("span",{fontWeight:"bold",letterSpacing:"0.08em",maxWidth:"145px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"middle",fontSize:"11px",marginRight:"10px"}),ContainerScroll=re("div",{maxHeight:"50vh",overflowY:"auto",marginTop:"38px"}),ProgramsContainer=re("div",{marginTop:"0"}),ProgramsULHeader=re("div",{display:"flex",position:"relative",fontWeight:"bold",color:"#fff",lineHeight:"14px",svg:{marginRight:"4px",display:"inline-block"}}),ProgramsUL=re("ul",{display:"block",position:"relative",paddingLeft:"10px",margin:"6px 6px",img:{maxHeight:"60px",maxWidth:"100%",margin:"6px auto",display:"block"},"&:after":{content:"",position:"absolute",left:"0px",top:"0px",width:"1px",height:"100%",backgroundColor:"grey",transform:"translateX(-50%)",maxHeight:"50vh",overflowY:"auto"},li:{borderBottom:"1px solid #313131",display:"block",padding:"4px",margin:0,lineHeight:1,verticalAlign:"middle",height:"24px"},b:{fontWeight:"bold"},small:{textAlign:"revert",letterSpacing:"1px",fontSize:"10px",fontWeight:"500",marginLeft:"2px",color:"rgb(101, 197, 188)"}}),ProgramConsole=re("button",{fontWeight:"bold",letterSpacing:"0.02em",backgroundColor:"rgb(41, 43, 45)",color:"rgb(211, 211, 211)",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"block",verticalAlign:"middle",fontSize:"11px",padding:"5px",margin:"4px auto"}),ToggleContainer=re("div",{display:"flex",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0 auto",color:"rgba(145, 145, 145, 1)",textAlign:"center",position:"absolute",right:0,bottom:" -20px",svg:{width:"12px",height:"12px",float:"left"}}),ProgramsGeoLi=re("li",{display:"flex !important",height:"auto !important",span:{height:"40px",display:"block",position:"relative"},b:{paddingLeft:"12px"}});function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}var _excluded$1=["color"],ActivityLogIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M0 1.5C0 1.22386 0.223858 1 0.5 1H2.5C2.77614 1 3 1.22386 3 1.5C3 1.77614 2.77614 2 2.5 2H0.5C0.223858 2 0 1.77614 0 1.5ZM4 1.5C4 1.22386 4.22386 1 4.5 1H14.5C14.7761 1 15 1.22386 15 1.5C15 1.77614 14.7761 2 14.5 2H4.5C4.22386 2 4 1.77614 4 1.5ZM4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5C12 4.77614 11.7761 5 11.5 5H4.5C4.22386 5 4 4.77614 4 4.5ZM0 7.5C0 7.22386 0.223858 7 0.5 7H2.5C2.77614 7 3 7.22386 3 7.5C3 7.77614 2.77614 8 2.5 8H0.5C0.223858 8 0 7.77614 0 7.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H4.5C4.22386 11 4 10.7761 4 10.5ZM0 13.5C0 13.2239 0.223858 13 0.5 13H2.5C2.77614 13 3 13.2239 3 13.5C3 13.7761 2.77614 14 2.5 14H0.5C0.223858 14 0 13.7761 0 13.5ZM4 13.5C4 13.2239 4.22386 13 4.5 13H14.5C14.7761 13 15 13.2239 15 13.5C15 13.7761 14.7761 14 14.5 14H4.5C4.22386 14 4 13.7761 4 13.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$o=["color"],BarChartIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$o);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$H=["color"],ButtonIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2 5H13C13.5523 5 14 5.44772 14 6V9C14 9.55228 13.5523 10 13 10H2C1.44772 10 1 9.55228 1 9V6C1 5.44772 1.44772 5 2 5ZM0 6C0 4.89543 0.895431 4 2 4H13C14.1046 4 15 4.89543 15 6V9C15 10.1046 14.1046 11 13 11H2C0.89543 11 0 10.1046 0 9V6ZM4.5 6.75C4.08579 6.75 3.75 7.08579 3.75 7.5C3.75 7.91421 4.08579 8.25 4.5 8.25C4.91421 8.25 5.25 7.91421 5.25 7.5C5.25 7.08579 4.91421 6.75 4.5 6.75ZM6.75 7.5C6.75 7.08579 7.08579 6.75 7.5 6.75C7.91421 6.75 8.25 7.08579 8.25 7.5C8.25 7.91421 7.91421 8.25 7.5 8.25C7.08579 8.25 6.75 7.91421 6.75 7.5ZM10.5 6.75C10.0858 6.75 9.75 7.08579 9.75 7.5C9.75 7.91421 10.0858 8.25 10.5 8.25C10.9142 8.25 11.25 7.91421 11.25 7.5C11.25 7.08579 10.9142 6.75 10.5 6.75Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$1w=["color"],CubeIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1w);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.28856 0.796908C7.42258 0.734364 7.57742 0.734364 7.71144 0.796908L13.7114 3.59691C13.8875 3.67906 14 3.85574 14 4.05V10.95C14 11.1443 13.8875 11.3209 13.7114 11.4031L7.71144 14.2031C7.57742 14.2656 7.42258 14.2656 7.28856 14.2031L1.28856 11.4031C1.11252 11.3209 1 11.1443 1 10.95V4.05C1 3.85574 1.11252 3.67906 1.28856 3.59691L7.28856 0.796908ZM2 4.80578L7 6.93078V12.9649L2 10.6316V4.80578ZM8 12.9649L13 10.6316V4.80578L8 6.93078V12.9649ZM7.5 6.05672L12.2719 4.02866L7.5 1.80176L2.72809 4.02866L7.5 6.05672Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$1H=["color"],DotIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.5 9.125C8.39746 9.125 9.125 8.39746 9.125 7.5C9.125 6.60254 8.39746 5.875 7.5 5.875C6.60254 5.875 5.875 6.60254 5.875 7.5C5.875 8.39746 6.60254 9.125 7.5 9.125ZM7.5 10.125C8.94975 10.125 10.125 8.94975 10.125 7.5C10.125 6.05025 8.94975 4.875 7.5 4.875C6.05025 4.875 4.875 6.05025 4.875 7.5C4.875 8.94975 6.05025 10.125 7.5 10.125Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$1W=["color"],DropdownMenuIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1W);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.49999 3.09998C7.27907 3.09998 7.09999 3.27906 7.09999 3.49998C7.09999 3.72089 7.27907 3.89998 7.49999 3.89998H14.5C14.7209 3.89998 14.9 3.72089 14.9 3.49998C14.9 3.27906 14.7209 3.09998 14.5 3.09998H7.49999ZM7.49998 5.1C7.27907 5.1 7.09998 5.27908 7.09998 5.5C7.09998 5.72091 7.27907 5.9 7.49998 5.9H14.5C14.7209 5.9 14.9 5.72091 14.9 5.5C14.9 5.27908 14.7209 5.1 14.5 5.1H7.49998ZM7.1 7.5C7.1 7.27908 7.27909 7.1 7.5 7.1H14.5C14.7209 7.1 14.9 7.27908 14.9 7.5C14.9 7.72091 14.7209 7.9 14.5 7.9H7.5C7.27909 7.9 7.1 7.72091 7.1 7.5ZM7.49998 9.1C7.27907 9.1 7.09998 9.27908 7.09998 9.5C7.09998 9.72091 7.27907 9.9 7.49998 9.9H14.5C14.7209 9.9 14.9 9.72091 14.9 9.5C14.9 9.27908 14.7209 9.1 14.5 9.1H7.49998ZM7.09998 11.5C7.09998 11.2791 7.27907 11.1 7.49998 11.1H14.5C14.7209 11.1 14.9 11.2791 14.9 11.5C14.9 11.7209 14.7209 11.9 14.5 11.9H7.49998C7.27907 11.9 7.09998 11.7209 7.09998 11.5ZM2.5 9.25003L5 6.00003H0L2.5 9.25003Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$25=["color"],EyeNoneIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$25);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$26=["color"],EyeOpenIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$26);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2C=["color"],ImageIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2C);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2H=["color"],LapTimerIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L12.058 2.05806C12.3021 1.81398 12.6978 1.81398 12.9419 2.05806C13.186 2.30214 13.186 2.69786 12.9419 2.94194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13361 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.49998 8.49998V4.09998C5.06992 4.09998 3.09998 6.06992 3.09998 8.49998C3.09998 10.93 5.06992 12.9 7.49998 12.9C8.715 12.9 9.815 12.4075 10.6112 11.6112L7.49998 8.49998Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2J=["color"],LayersIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2J);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.75432 0.819537C7.59742 0.726821 7.4025 0.726821 7.24559 0.819537L1.74559 4.06954C1.59336 4.15949 1.49996 4.32317 1.49996 4.5C1.49996 4.67683 1.59336 4.84051 1.74559 4.93046L7.24559 8.18046C7.4025 8.27318 7.59742 8.27318 7.75432 8.18046L13.2543 4.93046C13.4066 4.84051 13.5 4.67683 13.5 4.5C13.5 4.32317 13.4066 4.15949 13.2543 4.06954L7.75432 0.819537ZM7.49996 7.16923L2.9828 4.5L7.49996 1.83077L12.0171 4.5L7.49996 7.16923ZM1.5695 7.49564C1.70998 7.2579 2.01659 7.17906 2.25432 7.31954L7.49996 10.4192L12.7456 7.31954C12.9833 7.17906 13.2899 7.2579 13.4304 7.49564C13.5709 7.73337 13.4921 8.03998 13.2543 8.18046L7.75432 11.4305C7.59742 11.5232 7.4025 11.5232 7.24559 11.4305L1.74559 8.18046C1.50786 8.03998 1.42901 7.73337 1.5695 7.49564ZM1.56949 10.4956C1.70998 10.2579 2.01658 10.1791 2.25432 10.3195L7.49996 13.4192L12.7456 10.3195C12.9833 10.1791 13.2899 10.2579 13.4304 10.4956C13.5709 10.7334 13.4921 11.04 13.2543 11.1805L7.75432 14.4305C7.59742 14.5232 7.4025 14.5232 7.24559 14.4305L1.74559 11.1805C1.50785 11.04 1.42901 10.7334 1.56949 10.4956Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2Q=["color"],LightningBoltIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2Q);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M8.69667 0.0403541C8.90859 0.131038 9.03106 0.354857 8.99316 0.582235L8.0902 6.00001H12.5C12.6893 6.00001 12.8625 6.10701 12.9472 6.27641C13.0319 6.4458 13.0136 6.6485 12.8999 6.80001L6.89997 14.8C6.76167 14.9844 6.51521 15.0503 6.30328 14.9597C6.09135 14.869 5.96888 14.6452 6.00678 14.4178L6.90974 9H2.49999C2.31061 9 2.13748 8.893 2.05278 8.72361C1.96809 8.55422 1.98636 8.35151 2.09999 8.2L8.09997 0.200038C8.23828 0.0156255 8.48474 -0.0503301 8.69667 0.0403541ZM3.49999 8.00001H7.49997C7.64695 8.00001 7.78648 8.06467 7.88148 8.17682C7.97648 8.28896 8.01733 8.43723 7.99317 8.5822L7.33027 12.5596L11.5 7.00001H7.49997C7.353 7.00001 7.21347 6.93534 7.11846 6.8232C7.02346 6.71105 6.98261 6.56279 7.00678 6.41781L7.66968 2.44042L3.49999 8.00001Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$34=["color"],MarginIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$34);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M1.49988 2.00012C1.77602 2.00012 1.99988 1.77626 1.99988 1.50012C1.99988 1.22398 1.77602 1.00012 1.49988 1.00012C1.22374 1.00012 0.999878 1.22398 0.999878 1.50012C0.999878 1.77626 1.22374 2.00012 1.49988 2.00012ZM4.49988 2.00012C4.77602 2.00012 4.99988 1.77626 4.99988 1.50012C4.99988 1.22398 4.77602 1.00012 4.49988 1.00012C4.22374 1.00012 3.99988 1.22398 3.99988 1.50012C3.99988 1.77626 4.22374 2.00012 4.49988 2.00012ZM7.99988 1.50012C7.99988 1.77626 7.77602 2.00012 7.49988 2.00012C7.22374 2.00012 6.99988 1.77626 6.99988 1.50012C6.99988 1.22398 7.22374 1.00012 7.49988 1.00012C7.77602 1.00012 7.99988 1.22398 7.99988 1.50012ZM10.4999 2.00012C10.776 2.00012 10.9999 1.77626 10.9999 1.50012C10.9999 1.22398 10.776 1.00012 10.4999 1.00012C10.2237 1.00012 9.99988 1.22398 9.99988 1.50012C9.99988 1.77626 10.2237 2.00012 10.4999 2.00012ZM13.9999 1.50012C13.9999 1.77626 13.776 2.00012 13.4999 2.00012C13.2237 2.00012 12.9999 1.77626 12.9999 1.50012C12.9999 1.22398 13.2237 1.00012 13.4999 1.00012C13.776 1.00012 13.9999 1.22398 13.9999 1.50012ZM1.49988 14.0001C1.77602 14.0001 1.99988 13.7763 1.99988 13.5001C1.99988 13.224 1.77602 13.0001 1.49988 13.0001C1.22374 13.0001 0.999878 13.224 0.999878 13.5001C0.999878 13.7763 1.22374 14.0001 1.49988 14.0001ZM1.99988 10.5001C1.99988 10.7763 1.77602 11.0001 1.49988 11.0001C1.22374 11.0001 0.999878 10.7763 0.999878 10.5001C0.999878 10.224 1.22374 10.0001 1.49988 10.0001C1.77602 10.0001 1.99988 10.224 1.99988 10.5001ZM1.49988 8.00012C1.77602 8.00012 1.99988 7.77626 1.99988 7.50012C1.99988 7.22398 1.77602 7.00012 1.49988 7.00012C1.22374 7.00012 0.999878 7.22398 0.999878 7.50012C0.999878 7.77626 1.22374 8.00012 1.49988 8.00012ZM1.99988 4.50012C1.99988 4.77626 1.77602 5.00012 1.49988 5.00012C1.22374 5.00012 0.999878 4.77626 0.999878 4.50012C0.999878 4.22398 1.22374 4.00012 1.49988 4.00012C1.77602 4.00012 1.99988 4.22398 1.99988 4.50012ZM13.4999 11.0001C13.776 11.0001 13.9999 10.7763 13.9999 10.5001C13.9999 10.224 13.776 10.0001 13.4999 10.0001C13.2237 10.0001 12.9999 10.224 12.9999 10.5001C12.9999 10.7763 13.2237 11.0001 13.4999 11.0001ZM13.9999 7.50012C13.9999 7.77626 13.776 8.00012 13.4999 8.00012C13.2237 8.00012 12.9999 7.77626 12.9999 7.50012C12.9999 7.22398 13.2237 7.00012 13.4999 7.00012C13.776 7.00012 13.9999 7.22398 13.9999 7.50012ZM13.4999 5.00012C13.776 5.00012 13.9999 4.77626 13.9999 4.50012C13.9999 4.22398 13.776 4.00012 13.4999 4.00012C13.2237 4.00012 12.9999 4.22398 12.9999 4.50012C12.9999 4.77626 13.2237 5.00012 13.4999 5.00012ZM4.99988 13.5001C4.99988 13.7763 4.77602 14.0001 4.49988 14.0001C4.22374 14.0001 3.99988 13.7763 3.99988 13.5001C3.99988 13.224 4.22374 13.0001 4.49988 13.0001C4.77602 13.0001 4.99988 13.224 4.99988 13.5001ZM7.49988 14.0001C7.77602 14.0001 7.99988 13.7763 7.99988 13.5001C7.99988 13.224 7.77602 13.0001 7.49988 13.0001C7.22374 13.0001 6.99988 13.224 6.99988 13.5001C6.99988 13.7763 7.22374 14.0001 7.49988 14.0001ZM10.9999 13.5001C10.9999 13.7763 10.776 14.0001 10.4999 14.0001C10.2237 14.0001 9.99988 13.7763 9.99988 13.5001C9.99988 13.224 10.2237 13.0001 10.4999 13.0001C10.776 13.0001 10.9999 13.224 10.9999 13.5001ZM13.4999 14.0001C13.776 14.0001 13.9999 13.7763 13.9999 13.5001C13.9999 13.224 13.776 13.0001 13.4999 13.0001C13.2237 13.0001 12.9999 13.224 12.9999 13.5001C12.9999 13.7763 13.2237 14.0001 13.4999 14.0001ZM3.99988 5.00012C3.99988 4.44784 4.44759 4.00012 4.99988 4.00012H9.99988C10.5522 4.00012 10.9999 4.44784 10.9999 5.00012V10.0001C10.9999 10.5524 10.5522 11.0001 9.99988 11.0001H4.99988C4.44759 11.0001 3.99988 10.5524 3.99988 10.0001V5.00012ZM4.99988 5.00012H9.99988V10.0001H4.99988V5.00012Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$37=["color"],MinusIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$37);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$3m=["color"],PauseIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$3m);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M6.04995 2.74998C6.04995 2.44623 5.80371 2.19998 5.49995 2.19998C5.19619 2.19998 4.94995 2.44623 4.94995 2.74998V12.25C4.94995 12.5537 5.19619 12.8 5.49995 12.8C5.80371 12.8 6.04995 12.5537 6.04995 12.25V2.74998ZM10.05 2.74998C10.05 2.44623 9.80371 2.19998 9.49995 2.19998C9.19619 2.19998 8.94995 2.44623 8.94995 2.74998V12.25C8.94995 12.5537 9.19619 12.8 9.49995 12.8C9.80371 12.8 10.05 12.5537 10.05 12.25V2.74998Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$3H=["color"],RocketIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$3H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M6.85357 3.85355L7.65355 3.05353C8.2981 2.40901 9.42858 1.96172 10.552 1.80125C11.1056 1.72217 11.6291 1.71725 12.0564 1.78124C12.4987 1.84748 12.7698 1.97696 12.8965 2.10357C13.0231 2.23018 13.1526 2.50125 13.2188 2.94357C13.2828 3.37086 13.2779 3.89439 13.1988 4.44801C13.0383 5.57139 12.591 6.70188 11.9464 7.34645L7.49999 11.7929L6.35354 10.6465C6.15827 10.4512 5.84169 10.4512 5.64643 10.6465C5.45117 10.8417 5.45117 11.1583 5.64643 11.3536L7.14644 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L8.40073 12.3064L9.57124 14.2572C9.65046 14.3893 9.78608 14.4774 9.9389 14.4963C10.0917 14.5151 10.2447 14.4624 10.3535 14.3536L12.3535 12.3536C12.4648 12.2423 12.5172 12.0851 12.495 11.9293L12.0303 8.67679L12.6536 8.05355C13.509 7.19808 14.0117 5.82855 14.1887 4.58943C14.2784 3.9618 14.2891 3.33847 14.2078 2.79546C14.1287 2.26748 13.9519 1.74482 13.6035 1.39645C13.2552 1.04809 12.7325 0.871332 12.2045 0.792264C11.6615 0.710945 11.0382 0.721644 10.4105 0.8113C9.17143 0.988306 7.80189 1.491 6.94644 2.34642L6.32322 2.96968L3.07071 2.50504C2.91492 2.48278 2.75773 2.53517 2.64645 2.64646L0.646451 4.64645C0.537579 4.75533 0.484938 4.90829 0.50375 5.0611C0.522563 5.21391 0.61073 5.34954 0.742757 5.42876L2.69364 6.59928L2.14646 7.14645C2.0527 7.24022 2.00002 7.3674 2.00002 7.50001C2.00002 7.63261 2.0527 7.75979 2.14646 7.85356L3.64647 9.35356C3.84173 9.54883 4.15831 9.54883 4.35357 9.35356C4.54884 9.1583 4.54884 8.84172 4.35357 8.64646L3.20712 7.50001L3.85357 6.85356L6.85357 3.85355ZM10.0993 13.1936L9.12959 11.5775L11.1464 9.56067L11.4697 11.8232L10.0993 13.1936ZM3.42251 5.87041L5.43935 3.85356L3.17678 3.53034L1.80638 4.90074L3.42251 5.87041ZM2.35356 10.3535C2.54882 10.1583 2.54882 9.8417 2.35356 9.64644C2.1583 9.45118 1.84171 9.45118 1.64645 9.64644L0.646451 10.6464C0.451188 10.8417 0.451188 11.1583 0.646451 11.3535C0.841713 11.5488 1.1583 11.5488 1.35356 11.3535L2.35356 10.3535ZM3.85358 11.8536C4.04884 11.6583 4.04885 11.3417 3.85359 11.1465C3.65833 10.9512 3.34175 10.9512 3.14648 11.1465L1.14645 13.1464C0.95119 13.3417 0.951187 13.6583 1.14645 13.8535C1.34171 14.0488 1.65829 14.0488 1.85355 13.8536L3.85358 11.8536ZM5.35356 13.3535C5.54882 13.1583 5.54882 12.8417 5.35356 12.6464C5.1583 12.4512 4.84171 12.4512 4.64645 12.6464L3.64645 13.6464C3.45119 13.8417 3.45119 14.1583 3.64645 14.3535C3.84171 14.5488 4.1583 14.5488 4.35356 14.3535L5.35356 13.3535ZM9.49997 6.74881C10.1897 6.74881 10.7488 6.1897 10.7488 5.5C10.7488 4.8103 10.1897 4.25118 9.49997 4.25118C8.81026 4.25118 8.25115 4.8103 8.25115 5.5C8.25115 6.1897 8.81026 6.74881 9.49997 6.74881Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$3L=["color"],RulerHorizontalIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$3L);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M0.5 4C0.223858 4 0 4.22386 0 4.5V10.5C0 10.7761 0.223858 11 0.5 11H14.5C14.7761 11 15 10.7761 15 10.5V4.5C15 4.22386 14.7761 4 14.5 4H0.5ZM1 10V5H2.075V7.5C2.075 7.73472 2.26528 7.925 2.5 7.925C2.73472 7.925 2.925 7.73472 2.925 7.5V5H4.075V6.5C4.075 6.73472 4.26528 6.925 4.5 6.925C4.73472 6.925 4.925 6.73472 4.925 6.5V5H6.075V6.5C6.075 6.73472 6.26528 6.925 6.5 6.925C6.73472 6.925 6.925 6.73472 6.925 6.5V5H8.075V7.5C8.075 7.73472 8.26528 7.925 8.5 7.925C8.73472 7.925 8.925 7.73472 8.925 7.5V5H10.075V6.5C10.075 6.73472 10.2653 6.925 10.5 6.925C10.7347 6.925 10.925 6.73472 10.925 6.5V5H12.075V6.5C12.075 6.73472 12.2653 6.925 12.5 6.925C12.7347 6.925 12.925 6.73472 12.925 6.5V5H14V10H1Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$4q=["color"],TextAlignJustifyIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4q);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$4H=["color"],TriangleDownIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:color}))})),_excluded$4K=["color"],TriangleUpIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4K);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:color}))})),_excluded$4R=["color"],VercelLogoIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4R);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.49998 1L6.92321 2.00307L1.17498 12L0.599976 13H1.7535H13.2464H14.4L13.825 12L8.07674 2.00307L7.49998 1ZM7.49998 3.00613L2.3285 12H12.6714L7.49998 3.00613Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),react_three_fiber_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"),esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");__webpack_require__("./node_modules/process/browser.js");function workerBootstrap(){var modules=Object.create(null);function registerModule(ref,callback){var id=ref.id,name=ref.name,dependencies=ref.dependencies;void 0===dependencies&&(dependencies=[]);var init=ref.init;void 0===init&&(init=function(){});var getTransferables=ref.getTransferables;if(void 0===getTransferables&&(getTransferables=null),!modules[id])try{dependencies=dependencies.map((function(dep){return dep&&dep.isWorkerModule&&(registerModule(dep,(function(depResult){if(depResult instanceof Error)throw depResult})),dep=modules[dep.id].value),dep})),init=rehydrate("<"+name+">.init",init),getTransferables&&(getTransferables=rehydrate("<"+name+">.getTransferables",getTransferables));var value=null;"function"==typeof init?value=init.apply(void 0,dependencies):console.error("worker module init function failed to rehydrate"),modules[id]={id:id,value:value,getTransferables:getTransferables},callback(value)}catch(err){err&&err.noLog||console.error(err),callback(err)}}function rehydrate(name,str){var result=void 0;self.troikaDefine=function(r){return result=r};var url=URL.createObjectURL(new Blob(["/** "+name.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+str+"\n)"],{type:"application/javascript"}));try{importScripts(url)}catch(err){console.error(err)}return URL.revokeObjectURL(url),delete self.troikaDefine,result}self.addEventListener("message",(function(e){var ref=e.data,messageId=ref.messageId,action=ref.action,data=ref.data;try{"registerModule"===action&®isterModule(data,(function(result){result instanceof Error?postMessage({messageId:messageId,success:!1,error:result.message}):postMessage({messageId:messageId,success:!0,result:{isCallable:"function"==typeof result}})})),"callModule"===action&&function callModule(ref,callback){var ref$1,id=ref.id,args=ref.args;modules[id]&&"function"==typeof modules[id].value||callback(new Error("Worker module "+id+": not found or its 'init' did not return a function"));try{var result=(ref$1=modules[id]).value.apply(ref$1,args);result&&"function"==typeof result.then?result.then(handleResult,(function(rej){return callback(rej instanceof Error?rej:new Error(""+rej))})):handleResult(result)}catch(err){callback(err)}function handleResult(result){try{var tx=modules[id].getTransferables&&modules[id].getTransferables(result);tx&&Array.isArray(tx)&&tx.length||(tx=void 0),callback(result,tx)}catch(err){console.error(err),callback(err)}}}(data,(function(result,transferables){result instanceof Error?postMessage({messageId:messageId,success:!1,error:result.message}):postMessage({messageId:messageId,success:!0,result:result},transferables||void 0)}))}catch(err){postMessage({messageId:messageId,success:!1,error:err.stack})}}))}var supportsWorkers=function(){var supported=!1;if("undefined"!=typeof window&&void 0!==window.document)try{new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"}))).terminate(),supported=!0}catch(err){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+err.message+"]")}return supportsWorkers=function(){return supported},supported},_workerModuleId=0,_messageId=0,_allowInitAsString=!1,workers=Object.create(null),registeredModules=Object.create(null),openRequests=Object.create(null);function defineWorkerModule(options){if(!(options&&"function"==typeof options.init||_allowInitAsString))throw new Error("requires `options.init` function");var dependencies=options.dependencies,init=options.init,getTransferables=options.getTransferables,workerId=options.workerId;if(!supportsWorkers())return function defineMainThreadModule(options){var moduleFunc=function(){for(var args=[],len=arguments.length;len--;)args[len]=arguments[len];return moduleFunc._getInitResult().then((function(initResult){if("function"==typeof initResult)return initResult.apply(void 0,args);throw new Error("Worker module function was called but `init` did not return a callable function")}))};return moduleFunc._getInitResult=function(){var dependencies=options.dependencies,init=options.init;dependencies=Array.isArray(dependencies)?dependencies.map((function(dep){return dep&&dep._getInitResult?dep._getInitResult():dep})):[];var initPromise=Promise.all(dependencies).then((function(deps){return init.apply(null,deps)}));return moduleFunc._getInitResult=function(){return initPromise},initPromise},moduleFunc}(options);null==workerId&&(workerId="#default");var id="workerModule"+ ++_workerModuleId,name=options.name||id,registrationPromise=null;function moduleFunc(){for(var args=[],len=arguments.length;len--;)args[len]=arguments[len];if(!registrationPromise){registrationPromise=callWorker(workerId,"registerModule",moduleFunc.workerModuleData);var unregister=function(){registrationPromise=null,registeredModules[workerId].delete(unregister)};(registeredModules[workerId]||(registeredModules[workerId]=new Set)).add(unregister)}return registrationPromise.then((function(ref){if(ref.isCallable)return callWorker(workerId,"callModule",{id:id,args:args});throw new Error("Worker module function was called but `init` did not return a callable function")}))}return dependencies=dependencies&&dependencies.map((function(dep){return"function"!=typeof dep||dep.workerModuleData||(_allowInitAsString=!0,dep=defineWorkerModule({workerId:workerId,name:"<"+name+"> function dependency: "+dep.name,init:"function(){return (\n"+stringifyFunction(dep)+"\n)}"}),_allowInitAsString=!1),dep&&dep.workerModuleData&&(dep=dep.workerModuleData),dep})),moduleFunc.workerModuleData={isWorkerModule:!0,id:id,name:name,dependencies:dependencies,init:stringifyFunction(init),getTransferables:getTransferables&&stringifyFunction(getTransferables)},moduleFunc}function stringifyFunction(fn){var str=fn.toString();return!/^function/.test(str)&&/^\w+\s*\(/.test(str)&&(str="function "+str),str}function callWorker(workerId,action,data){return new Promise((function(resolve,reject){var messageId=++_messageId;openRequests[messageId]=function(response){response.success?resolve(response.result):reject(new Error("Error in worker "+action+" call: "+response.error))},function getWorker(workerId){var worker=workers[workerId];if(!worker){var bootstrap=stringifyFunction(workerBootstrap);(worker=workers[workerId]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+workerId.replace(/\*/g,"")+" **/\n\n;("+bootstrap+")()"],{type:"application/javascript"})))).onmessage=function(e){var response=e.data,msgId=response.messageId,callback=openRequests[msgId];if(!callback)throw new Error("WorkerModule response with empty or unknown messageId");delete openRequests[msgId],callback(response)}}return worker}(workerId).postMessage({messageId:messageId,action:action,data:data})}))}function SDFGenerator(){var exports=function(exports){function pointOnQuadraticBezier(x0,y0,x1,y1,x2,y2,t,pointOut){var t2=1-t;pointOut.x=t2*t2*x0+2*t2*t*x1+t*t*x2,pointOut.y=t2*t2*y0+2*t2*t*y1+t*t*y2}function pointOnCubicBezier(x0,y0,x1,y1,x2,y2,x3,y3,t,pointOut){var t2=1-t;pointOut.x=t2*t2*t2*x0+3*t2*t2*t*x1+3*t2*t*t*x2+t*t*t*x3,pointOut.y=t2*t2*t2*y0+3*t2*t2*t*y1+3*t2*t*t*y2+t*t*t*y3}function forEachPathCommand(pathString,commandCallback){for(var match,firstX,firstY,prevX,prevY,segmentRE=/([MLQCZ])([^MLQCZ]*)/g;match=segmentRE.exec(pathString);){var args=match[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map((function(v){return parseFloat(v)}));switch(match[1]){case"M":prevX=firstX=args[0],prevY=firstY=args[1];break;case"L":args[0]===prevX&&args[1]===prevY||commandCallback("L",prevX,prevY,prevX=args[0],prevY=args[1]);break;case"Q":commandCallback("Q",prevX,prevY,prevX=args[2],prevY=args[3],args[0],args[1]);break;case"C":commandCallback("C",prevX,prevY,prevX=args[4],prevY=args[5],args[0],args[1],args[2],args[3]);break;case"Z":prevX===firstX&&prevY===firstY||commandCallback("L",prevX,prevY,firstX,firstY)}}}function pathToLineSegments(pathString,segmentCallback,curvePoints){void 0===curvePoints&&(curvePoints=16);var tempPoint={x:0,y:0};forEachPathCommand(pathString,(function(command,startX,startY,endX,endY,ctrl1X,ctrl1Y,ctrl2X,ctrl2Y){switch(command){case"L":segmentCallback(startX,startY,endX,endY);break;case"Q":for(var prevCurveX=startX,prevCurveY=startY,i=1;i0;)values[len]=arguments[len+2];var uniformLoc=uniforms[name]||(uniforms[name]=gl.getUniformLocation(program,name));gl["uniform"+type].apply(gl,[uniformLoc].concat(values))},setAttribute:function setAttribute(name,size,usage,instancingDivisor,data){var attr=attributes[name];attr||(attr=attributes[name]={buf:gl.createBuffer(),loc:gl.getAttribLocation(program,name),data:null}),gl.bindBuffer(gl.ARRAY_BUFFER,attr.buf),gl.vertexAttribPointer(attr.loc,size,gl.FLOAT,!1,0,0),gl.enableVertexAttribArray(attr.loc),isWebGL2?gl.vertexAttribDivisor(attr.loc,instancingDivisor):getExtension("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(attr.loc,instancingDivisor),data!==attr.data&&(gl.bufferData(gl.ARRAY_BUFFER,data,usage),attr.data=data)}})}}}programs[name].transaction(func)}function withTexture(name,func){textureUnit++;try{gl.activeTexture(gl.TEXTURE0+textureUnit);var texture=textures[name];texture||(texture=textures[name]=gl.createTexture(),gl.bindTexture(gl.TEXTURE_2D,texture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST)),gl.bindTexture(gl.TEXTURE_2D,texture),func(texture,textureUnit)}finally{textureUnit--}}function withTextureFramebuffer(texture,textureUnit,func){var framebuffer=gl.createFramebuffer();framebufferStack.push(framebuffer),gl.bindFramebuffer(gl.FRAMEBUFFER,framebuffer),gl.activeTexture(gl.TEXTURE0+textureUnit),gl.bindTexture(gl.TEXTURE_2D,texture),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,texture,0);try{func(framebuffer)}finally{gl.deleteFramebuffer(framebuffer),gl.bindFramebuffer(gl.FRAMEBUFFER,framebufferStack[--framebufferStack.length-1]||null)}}function handleContextLoss(){extensions={},programs={},textures={},textureUnit=-1,framebufferStack.length=0}gl.canvas.addEventListener("webglcontextlost",(function(e){handleContextLoss(),e.preventDefault()}),!1),cache.set(gl,wrapper={gl:gl,isWebGL2:isWebGL2,getExtension:getExtension,withProgram:withProgram,withTexture:withTexture,withTextureFramebuffer:withTextureFramebuffer,handleContextLoss:handleContextLoss})}callback(wrapper)}function renderImageData(glOrCanvas,imageData,x,y,width,height,channels,framebuffer){void 0===channels&&(channels=15),void 0===framebuffer&&(framebuffer=null),withWebGLContext(glOrCanvas,(function(ref){var gl=ref.gl,withProgram=ref.withProgram;(0,ref.withTexture)("copy",(function(tex,texUnit){gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,width,height,0,gl.RGBA,gl.UNSIGNED_BYTE,imageData),withProgram("copy",viewportQuadVertex,copyTexFragment,(function(ref){var setUniform=ref.setUniform;(0,ref.setAttribute)("aUV",2,gl.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),setUniform("1i","image",texUnit),gl.bindFramebuffer(gl.FRAMEBUFFER,framebuffer||null),gl.disable(gl.BLEND),gl.colorMask(8&channels,4&channels,2&channels,1&channels),gl.viewport(x,y,width,height),gl.scissor(x,y,width,height),gl.drawArrays(gl.TRIANGLES,0,3)}))}))}))}var webglUtils=Object.freeze({__proto__:null,withWebGLContext:withWebGLContext,renderImageData:renderImageData,resizeWebGLCanvasWithoutClearing:function resizeWebGLCanvasWithoutClearing(canvas,newWidth,newHeight){var width=canvas.width,height=canvas.height;withWebGLContext(canvas,(function(ref){var gl=ref.gl,data=new Uint8Array(width*height*4);gl.readPixels(0,0,width,height,gl.RGBA,gl.UNSIGNED_BYTE,data),canvas.width=newWidth,canvas.height=newHeight,renderImageData(gl,data,0,0,width,height)}))}});function generate$2(sdfWidth,sdfHeight,path,viewBox,maxDistance,sdfExponent){void 0===sdfExponent&&(sdfExponent=1);var textureData=new Uint8Array(sdfWidth*sdfHeight),viewBoxWidth=viewBox[2]-viewBox[0],viewBoxHeight=viewBox[3]-viewBox[1],segments=[];pathToLineSegments(path,(function(x1,y1,x2,y2){segments.push({x1:x1,y1:y1,x2:x2,y2:y2,minX:Math.min(x1,x2),minY:Math.min(y1,y2),maxX:Math.max(x1,x2),maxY:Math.max(y1,y2)})})),segments.sort((function(a,b){return a.maxX-b.maxX}));for(var sdfX=0;sdfXseg.minX&&y-closestDistseg.minY){var distSq=absSquareDistanceToLineSegment(x,y,seg.x1,seg.y1,seg.x2,seg.y2);distSqy!=seg.y2>y&&x<(seg.x2-seg.x1)*(y-seg.y1)/(seg.y2-seg.y1)+seg.x1&&(winding+=seg.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function parseCharacterMap(encodedString,includeReverse){var prevPair,lastCode=0,map=new Map,reverseMap=includeReverse&&new Map;return encodedString.split(",").forEach((function visit(entry){if(-1!==entry.indexOf("+"))for(var i=+entry;i--;)visit(prevPair);else{prevPair=entry;var ref=entry.split(">"),a=ref[0],b=ref[1];a=String.fromCodePoint(lastCode+=parseInt(a,36)),b=String.fromCodePoint(lastCode+=parseInt(b,36)),map.set(a,b),includeReverse&&reverseMap.set(b,a)}})),{map:map,reverseMap:reverseMap}}function parse$1(){if(!openToClose){var ref=parseCharacterMap(data$1.pairs,!0),map=ref.map,reverseMap=ref.reverseMap;openToClose=map,closeToOpen=reverseMap,canonical=parseCharacterMap(data$1.canonical,!1).map}}function openingToClosingBracket(char){return parse$1(),openToClose.get(char)||null}function closingToOpeningBracket(char){return parse$1(),closeToOpen.get(char)||null}function getCanonicalBracket(char){return parse$1(),canonical.get(char)||null}var TYPE_L=TYPES.L,TYPE_R=TYPES.R,TYPE_EN=TYPES.EN,TYPE_ES=TYPES.ES,TYPE_ET=TYPES.ET,TYPE_AN=TYPES.AN,TYPE_CS=TYPES.CS,TYPE_B=TYPES.B,TYPE_S=TYPES.S,TYPE_ON=TYPES.ON,TYPE_BN=TYPES.BN,TYPE_NSM=TYPES.NSM,TYPE_AL=TYPES.AL,TYPE_LRO=TYPES.LRO,TYPE_RLO=TYPES.RLO,TYPE_LRE=TYPES.LRE,TYPE_RLE=TYPES.RLE,TYPE_PDF=TYPES.PDF,TYPE_LRI=TYPES.LRI,TYPE_RLI=TYPES.RLI,TYPE_FSI=TYPES.FSI,TYPE_PDI=TYPES.PDI;var mirrorMap,data="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1";function getMirroredCharacter(char){return function parse(){if(!mirrorMap){var ref=parseCharacterMap(data,!0),map=ref.map;ref.reverseMap.forEach((function(value,key){map.set(key,value)})),mirrorMap=map}}(),mirrorMap.get(char)||null}function getReorderSegments(string,embeddingLevelsResult,start,end){var strLen=string.length;start=Math.max(0,null==start?0:+start),end=Math.min(strLen-1,null==end?strLen-1:+end);var segments=[];return embeddingLevelsResult.paragraphs.forEach((function(paragraph){var lineStart=Math.max(start,paragraph.start),lineEnd=Math.min(end,paragraph.end);if(lineStart=lineStart&&getBidiCharType(string[i])&TRAILING_TYPES;i--)lineLevels[i]=paragraph.level;for(var maxLevel=paragraph.level,minOddLevel=1/0,i$1=0;i$1maxLevel&&(maxLevel=level),level=minOddLevel;lvl--)for(var i$2=0;i$2=lvl){for(var segStart=i$2;i$2+1=lvl;)i$2++;i$2>segStart&&segments.push([segStart+lineStart,i$2+lineStart])}}})),segments}function getReorderedIndices(string,embedLevelsResult,start,end){for(var segments=getReorderSegments(string,embedLevelsResult,start,end),indices=[],i=0;i0)overflowIsolateCount--;else if(validIsolateCount>0){for(overflowEmbeddingCount=0;!statusStack[statusStack.length-1]._isolate;)statusStack.pop();var isolInitIndex=statusStack[statusStack.length-1]._isolInitIndex;null!=isolInitIndex&&(isolationPairs.set(isolInitIndex,i$2),isolationPairs.set(i$2,isolInitIndex)),statusStack.pop(),validIsolateCount--}stackTop=statusStack[statusStack.length-1],embedLevels[i$2]=stackTop._level,stackTop._override&&changeCharType(i$2,stackTop._override)}else charType&TYPE_PDF?(0===overflowIsolateCount&&(overflowEmbeddingCount>0?overflowEmbeddingCount--:!stackTop._isolate&&statusStack.length>1&&(statusStack.pop(),stackTop=statusStack[statusStack.length-1])),embedLevels[i$2]=stackTop._level):charType&TYPE_B&&(embedLevels[i$2]=paragraph.level);else embedLevels[i$2]=stackTop._level,stackTop._override&&charType!==TYPE_BN&&changeCharType(i$2,stackTop._override)}for(var levelRuns=[],currentRun=null,i$3=paragraph.start;i$3<=paragraph.end;i$3++){var charType$1=charTypes[i$3];if(!(charType$1&BN_LIKE_TYPES)){var lvl=embedLevels[i$3],isIsolInit=charType$1&ISOLATE_INIT_TYPES,isPDI=charType$1===TYPE_PDI;currentRun&&lvl===currentRun._level?(currentRun._end=i$3,currentRun._endsWithIsolInit=isIsolInit):levelRuns.push(currentRun={_start:i$3,_end:i$3,_level:lvl,_startsWithPDI:isPDI,_endsWithIsolInit:isIsolInit})}}for(var isolatingRunSeqs=[],runIdx=0;runIdx=0;i$6--)if(!(charTypes[i$6]&BN_LIKE_TYPES)){prevLevel=embedLevels[i$6];break}var lastIndex=seqIndices[seqIndices.length-1],lastLevel=embedLevels[lastIndex],nextLevel=paragraph.level;if(!(charTypes[lastIndex]&ISOLATE_INIT_TYPES))for(var i$7=lastIndex+1;i$7<=paragraph.end;i$7++)if(!(charTypes[i$7]&BN_LIKE_TYPES)){nextLevel=embedLevels[i$7];break}isolatingRunSeqs.push({_seqIndices:seqIndices,_sosType:Math.max(prevLevel,firstLevel)%2?TYPE_R:TYPE_L,_eosType:Math.max(nextLevel,lastLevel)%2?TYPE_R:TYPE_L})}}for(var seqIdx=0;seqIdx=0;sj--)if(!(charTypes[seqIndices$1[sj]]&BN_LIKE_TYPES)){prevType=charTypes[seqIndices$1[sj]];break}changeCharType(i$8,prevType&(ISOLATE_INIT_TYPES|TYPE_PDI)?TYPE_ON:prevType)}}if(charTypeCounts.get(TYPE_EN))for(var si$1=0;si$1=-1;sj$1--){var prevCharType=-1===sj$1?sosType:charTypes[seqIndices$1[sj$1]];if(prevCharType&STRONG_TYPES){prevCharType===TYPE_AL&&changeCharType(i$9,TYPE_AN);break}}}if(charTypeCounts.get(TYPE_AL))for(var si$2=0;si$2=0&&(prevType$1=charTypes[seqIndices$1[sj$2]])&BN_LIKE_TYPES;sj$2--);for(var sj$3=si$3+1;sj$3=0&&charTypes[seqIndices$1[sj$4]]&(TYPE_ET|BN_LIKE_TYPES);sj$4--)changeCharType(seqIndices$1[sj$4],TYPE_EN);for(si$4++;si$4=0&&charTypes[seqIndices$1[sj$5]]&BN_LIKE_TYPES;sj$5--)changeCharType(seqIndices$1[sj$5],TYPE_ON);for(var sj$6=si$5+1;sj$6=0;stackIdx--){var stackChar=openerStack[stackIdx].char;if(stackChar===oppositeBracket||stackChar===closingToOpeningBracket(getCanonicalBracket(char))||openingToClosingBracket(getCanonicalBracket(stackChar))===char){bracketPairs.push([openerStack[stackIdx].seqIndex,si$7]),openerStack.length=stackIdx;break}}}bracketPairs.sort((function(a,b){return a[0]-b[0]}));for(var pairIdx=0;pairIdx=0;si$9--){var i$16=seqIndices$1[si$9];if(charTypes[i$16]&STRONG_TYPES_FOR_N_STEPS){var lr$1=charTypes[i$16]&R_TYPES_FOR_N_STEPS?TYPE_R:TYPE_L;useStrongType=lr$1!==embedDirection?lr$1:embedDirection;break}}}if(useStrongType){if(charTypes[seqIndices$1[openSeqIdx]]=charTypes[seqIndices$1[closeSeqIdx]]=useStrongType,useStrongType!==embedDirection)for(var si$10=openSeqIdx+1;si$10=0;si2--){if(!(charTypes[seqIndices$1[si2]]&BN_LIKE_TYPES)){prevType$2=charTypes[seqIndices$1[si2]]&R_TYPES_FOR_N_STEPS?TYPE_R:TYPE_L;break}niRunStart=si2}for(var nextType$1=eosType,si2$1=si$12+1;si2$1=0&&getBidiCharType(string[j$1])&TRAILING_TYPES;j$1--)embedLevels[j$1]=paragraph.level}}return{levels:embedLevels,paragraphs:paragraphs};function determineAutoEmbedLevel(start,isFSI){for(var i=start;i/gm,(function replace(match,include){let chunk=three_module.ShaderChunk[include];return chunk?expandShaderIncludes(chunk):match}))}const _lut=[];for(let i=0;i<256;i++)_lut[i]=(i<16?"0":"")+i.toString(16);const troika_three_utils_esm_assign=Object.assign||function(){let target=arguments[0];for(let i=1,len=arguments.length;i/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n")));if(customRewriter){let res=customRewriter({vertexShader:vertexShader,fragmentShader:fragmentShader});vertexShader=res.vertexShader,fragmentShader=res.fragmentShader}if(fragmentColorTransform){let postChunks=[];fragmentShader=fragmentShader.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(match=>(postChunks.push(match),""))),fragmentMainOutro=`${fragmentColorTransform}\n${postChunks.join("\n")}\n${fragmentMainOutro}`}if(timeUniform){const code=`\nuniform float ${timeUniform};\n`;vertexDefs=code+vertexDefs,fragmentDefs=code+fragmentDefs}vertexTransform&&(vertexDefs=`${vertexDefs}\nvoid troikaVertexTransform${key}(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ${vertexTransform}\n}\n`,vertexMainIntro=`\ntroika_position_${key} = vec3(position);\ntroika_normal_${key} = vec3(normal);\ntroika_uv_${key} = vec2(uv);\ntroikaVertexTransform${key}(troika_position_${key}, troika_normal_${key}, troika_uv_${key});\n${vertexMainIntro}\n`,vertexShader=(vertexShader=`vec3 troika_position_${key};\nvec3 troika_normal_${key};\nvec2 troika_uv_${key};\n${vertexShader}\n`).replace(/\b(position|normal|uv)\b/g,((match,match1,index,fullStr)=>/\battribute\s+vec[23]\s+$/.test(fullStr.substr(0,index))?match1:`troika_${match1}_${key}`)),material.map&&material.map.channel>0||(vertexShader=vertexShader.replace(/\bMAP_UV\b/g,`troika_uv_${key}`)));return vertexShader=injectIntoShaderCode(vertexShader,key,vertexDefs,vertexMainIntro,vertexMainOutro),fragmentShader=injectIntoShaderCode(fragmentShader,key,fragmentDefs,fragmentMainIntro,fragmentMainOutro),{vertexShader:vertexShader,fragmentShader:fragmentShader}}(this,shaderInfo,options,optionsKey);upgradedShaders=SHADER_UPGRADE_CACHE[cacheKey]=upgraded}shaderInfo.vertexShader=upgradedShaders.vertexShader,shaderInfo.fragmentShader=upgradedShaders.fragmentShader,troika_three_utils_esm_assign(shaderInfo.uniforms,this.uniforms),options.timeUniform&&(shaderInfo.uniforms[options.timeUniform]={get value(){return Date.now()-epoch}}),this[privateBeforeCompileProp]&&this[privateBeforeCompileProp](shaderInfo)},DerivedMaterial=function DerivedMaterial(){return derive(options.chained?baseMaterial:baseMaterial.clone())},derive=function(base){const derived=Object.create(base,descriptor);return Object.defineProperty(derived,"baseMaterial",{value:baseMaterial}),Object.defineProperty(derived,"id",{value:materialInstanceId++}),derived.uuid=function generateUUID(){const d0=4294967295*Math.random()|0,d1=4294967295*Math.random()|0,d2=4294967295*Math.random()|0,d3=4294967295*Math.random()|0;return(_lut[255&d0]+_lut[d0>>8&255]+_lut[d0>>16&255]+_lut[d0>>24&255]+"-"+_lut[255&d1]+_lut[d1>>8&255]+"-"+_lut[d1>>16&15|64]+_lut[d1>>24&255]+"-"+_lut[63&d2|128]+_lut[d2>>8&255]+"-"+_lut[d2>>16&255]+_lut[d2>>24&255]+_lut[255&d3]+_lut[d3>>8&255]+_lut[d3>>16&255]+_lut[d3>>24&255]).toUpperCase()}(),derived.uniforms=troika_three_utils_esm_assign({},base.uniforms,options.uniforms),derived.defines=troika_three_utils_esm_assign({},base.defines,options.defines),derived.defines[`TROIKA_DERIVED_MATERIAL_${optionsKey}`]="",derived.extensions=troika_three_utils_esm_assign({},base.extensions,options.extensions),derived._listeners=void 0,derived},descriptor={constructor:{value:DerivedMaterial},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return baseMaterial.customProgramCacheKey()+"|"+optionsKey}},onBeforeCompile:{get(){return onBeforeCompile},set(fn){this[privateBeforeCompileProp]=fn}},copy:{writable:!0,configurable:!0,value:function(source){return baseMaterial.copy.call(this,source),baseMaterial.isShaderMaterial||baseMaterial.isDerivedMaterial||(troika_three_utils_esm_assign(this.extensions,source.extensions),troika_three_utils_esm_assign(this.defines,source.defines),troika_three_utils_esm_assign(this.uniforms,three_module.UniformsUtils.clone(source.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const newBase=new baseMaterial.constructor;return derive(newBase).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let depthMaterial=this._depthMaterial;return depthMaterial||(depthMaterial=this._depthMaterial=createDerivedMaterial(baseMaterial.isDerivedMaterial?baseMaterial.getDepthMaterial():new three_module.MeshDepthMaterial({depthPacking:three_module.RGBADepthPacking}),options),depthMaterial.defines.IS_DEPTH_MATERIAL="",depthMaterial.uniforms=this.uniforms),depthMaterial}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let distanceMaterial=this._distanceMaterial;return distanceMaterial||(distanceMaterial=this._distanceMaterial=createDerivedMaterial(baseMaterial.isDerivedMaterial?baseMaterial.getDistanceMaterial():new three_module.MeshDistanceMaterial,options),distanceMaterial.defines.IS_DISTANCE_MATERIAL="",distanceMaterial.uniforms=this.uniforms),distanceMaterial}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:_depthMaterial,_distanceMaterial:_distanceMaterial}=this;_depthMaterial&&_depthMaterial.dispose(),_distanceMaterial&&_distanceMaterial.dispose(),baseMaterial.dispose.call(this)}}};return ctorsByDerivation[optionsKey]=DerivedMaterial,new DerivedMaterial}function injectIntoShaderCode(shaderCode,id,defs,intro,outro){return(intro||outro||defs)&&(shaderCode=shaderCode.replace(voidMainRegExp,`\n${defs}\nvoid troikaOrigMain${id}() {`),shaderCode+=`\nvoid main() {\n ${intro}\n troikaOrigMain${id}();\n ${outro}\n}`),shaderCode}function optionsJsonReplacer(key,value){return"uniforms"===key?void 0:"function"==typeof value?value.toString():value}let _idCtr=0;const optionsHashesToIds=new Map;three_module.DoubleSide;const now=()=>(self.performance||Date).now(),mainThreadGenerator=SDFGenerator();let warned;const queue=[];let timer=0;function nextChunk(){const start=now();for(;queue.length&&now()-start<5;)queue.shift()();timer=queue.length?setTimeout(nextChunk,0):0}const generateSDF_GL=(...args)=>new Promise(((resolve,reject)=>{queue.push((()=>{const start=now();try{mainThreadGenerator.webgl.generateIntoCanvas(...args),resolve({timing:now()-start})}catch(err){reject(err)}})),timer||(timer=setTimeout(nextChunk,0))})),threadCount=4,idleTimeout=2e3,threads={};let callNum=0;function generateSDF_JS_Worker(width,height,path,viewBox,distance,exponent,canvas,x,y,channel){const workerId="TroikaTextSDFGenerator_JS_"+callNum++%threadCount;let thread=threads[workerId];return thread||(thread=threads[workerId]={workerModule:defineWorkerModule({name:workerId,workerId:workerId,dependencies:[SDFGenerator,now],init(_createSDFGenerator,now){const generate=_createSDFGenerator().javascript.generate;return function(...args){const start=now();return{textureData:generate(...args),timing:now()-start}}},getTransferables(result){return[result.textureData.buffer]}}),requests:0,idleTimer:null}),thread.requests++,clearTimeout(thread.idleTimer),thread.workerModule(width,height,path,viewBox,distance,exponent).then((({textureData:textureData,timing:timing})=>{const start=now(),imageData=new Uint8Array(4*textureData.length);for(let i=0;i{!function terminateWorker(workerId){registeredModules[workerId]&®isteredModules[workerId].forEach((function(unregister){unregister()})),workers[workerId]&&(workers[workerId].terminate(),delete workers[workerId])}(workerId)}),idleTimeout)),{timing:timing}}))}const resizeWebGLCanvasWithoutClearing=mainThreadGenerator.webglUtils.resizeWebGLCanvasWithoutClearing;const workerModule=defineWorkerModule({name:"Typr Font Parser",dependencies:[function typrFactory(){return"undefined"==typeof window&&(self.window=self),function(r){var e={parse:function(r){var t=e._bin,a=new Uint8Array(r);if("ttcf"==t.readASCII(a,0,4)){var n=4;t.readUshort(a,n),n+=2,t.readUshort(a,n),n+=2;var o=t.readUint(a,n);n+=4;for(var s=[],i=0;i>>t&1)&&e++;return e},e._lctf.readClassDef=function(r,t){var a=e._bin,n=[],o=a.readUshort(r,t);if(t+=2,1==o){var s=a.readUshort(r,t);t+=2;var i=a.readUshort(r,t);t+=2;for(var h=0;h0&&(o.featureParams=n+s);var i=a.readUshort(r,t);t+=2,o.tab=[];for(var h=0;h255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[t])},e.CFF.readEncoding=function(r,t,a){e._bin;var n=[".notdef"],o=r[t];if(t++,0!=o)throw"error: unknown encoding format: "+o;var s=r[t];t++;for(var i=0;i>4,p=15&v;if(15!=c&&l.push(c),15!=p&&l.push(p),15==p)break}for(var U="",g=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],S=0;S=s.xMax||s.yMin>=s.yMax)return null;if(s.noc>0){s.endPts=[];for(var i=0;i=1&&i.fmt<=2){f=o.readUshort(r,a),a+=2;var u=o.readUshort(r,a);a+=2,d=e._lctf.numOfOnes(f);var l=e._lctf.numOfOnes(u);if(1==i.fmt){i.pairsets=[];var v=o.readUshort(r,a);a+=2;for(var c=0;c=1&&i.fmt<=2){if(1==i.fmt)i.delta=o.readShort(r,a),a+=2;else if(2==i.fmt){var f=o.readUshort(r,a);a+=2,i.newg=o.readUshorts(r,a,f),a+=2*i.newg.length}}else if(4==t){i.vals=[],f=o.readUshort(r,a),a+=2;for(var d=0;d>>8;if(0!=(u&=15))throw"unknown kern table format: "+u;t=e.kern.readFormat0(r,t,h)}return h},e.kern.parseV1=function(r,t,a,n){var o=e._bin;o.readFixed(r,t),t+=4;var s=o.readUint(r,t);t+=4;for(var i={glyph1:[],rval:[]},h=0;h>>8;if(0!=(d&=15))throw"unknown kern table format: "+d;t=e.kern.readFormat0(r,t,i)}return i},e.kern.readFormat0=function(r,t,a){var n=e._bin,o=-1,s=n.readUshort(r,t);t+=2,n.readUshort(r,t),t+=2,n.readUshort(r,t),t+=2,n.readUshort(r,t),t+=2;for(var i=0;i=n.map.length?0:n.map[e];if(4==n.format){for(var o=-1,s=0;se?0:65535&(0!=n.idRangeOffset[o]?n.glyphIdArray[e-n.startCount[o]+(n.idRangeOffset[o]>>1)-(n.idRangeOffset.length-o)]:e+n.idDelta[o])}if(12==n.format){if(e>n.groups[n.groups.length-1][1])return 0;for(s=0;s-1?e.U._simpleGlyph(n,a):e.U._compoGlyph(n,t,a))},e.U._simpleGlyph=function(r,t){for(var a=0;ao)){for(var v=!0,c=0,p=0;po)){for(v=!0,p=0;p>1,s.length=0,h=!0;else if("o3"==x||"o23"==x)s.length%2!=0&&!h&&(f=s.shift()+n.nominalWidthX),i+=s.length>>1,s.length=0,h=!0;else if("o4"==x)s.length>1&&!h&&(f=s.shift()+n.nominalWidthX,h=!0),d&&e.U.P.closePath(o),v+=s.pop(),e.U.P.moveTo(o,l,v),d=!0;else if("o5"==x)for(;s.length>0;)l+=s.shift(),v+=s.shift(),e.U.P.lineTo(o,l,v);else if("o6"==x||"o7"==x)for(var P=s.length,I="o6"==x,w=0;wMath.abs(y-v)?l=b+s.shift():v=y+s.shift(),e.U.P.curveTo(o,c,p,U,g,F,_),e.U.P.curveTo(o,S,m,b,y,l,v));else if("o14"==x){if(s.length>0&&!h&&(f=s.shift()+a.nominalWidthX,h=!0),4==s.length){var k=s.shift(),G=s.shift(),D=s.shift(),B=s.shift(),L=e.CFF.glyphBySE(a,D),R=e.CFF.glyphBySE(a,B);e.U._drawCFF(a.CharStrings[L],t,a,n,o),t.x=k,t.y=G,e.U._drawCFF(a.CharStrings[R],t,a,n,o)}d&&(e.U.P.closePath(o),d=!1)}else if("o19"==x||"o20"==x)s.length%2!=0&&!h&&(f=s.shift()+n.nominalWidthX),i+=s.length>>1,s.length=0,h=!0,u+=i+7>>3;else if("o21"==x)s.length>2&&!h&&(f=s.shift()+n.nominalWidthX,h=!0),v+=s.pop(),l+=s.pop(),d&&e.U.P.closePath(o),e.U.P.moveTo(o,l,v),d=!0;else if("o22"==x)s.length>1&&!h&&(f=s.shift()+n.nominalWidthX,h=!0),l+=s.pop(),d&&e.U.P.closePath(o),e.U.P.moveTo(o,l,v),d=!0;else if("o25"==x){for(;s.length>6;)l+=s.shift(),v+=s.shift(),e.U.P.lineTo(o,l,v);c=l+s.shift(),p=v+s.shift(),U=c+s.shift(),g=p+s.shift(),l=U+s.shift(),v=g+s.shift(),e.U.P.curveTo(o,c,p,U,g,l,v)}else if("o26"==x)for(s.length%2&&(l+=s.shift());s.length>0;)c=l,p=v+s.shift(),l=U=c+s.shift(),v=(g=p+s.shift())+s.shift(),e.U.P.curveTo(o,c,p,U,g,l,v);else if("o27"==x)for(s.length%2&&(v+=s.shift());s.length>0;)p=v,U=(c=l+s.shift())+s.shift(),g=p+s.shift(),l=U+s.shift(),v=g,e.U.P.curveTo(o,c,p,U,g,l,v);else if("o10"==x||"o29"==x){var A="o10"==x?n:a;if(0==s.length)console.debug("error: empty stack");else{var W=s.pop(),M=A.Subrs[W+A.Bias];t.x=l,t.y=v,t.nStems=i,t.haveWidth=h,t.width=f,t.open=d,e.U._drawCFF(M,t,a,n,o),l=t.x,v=t.y,i=t.nStems,h=t.haveWidth,f=t.width,d=t.open}}else if("o30"==x||"o31"==x){var V=s.length,N=(T=0,"o31"==x);for(T+=V-(P=-3&V);T>>1|(21845&g)<<1;h=(61680&(h=(52428&h)>>>2|(13107&h)<<2))>>>4|(3855&h)<<4,c[g]=((65280&h)>>>8|(255&h)<<8)>>>1}var w=function(r,e,t){for(var a=r.length,i=0,o=new n(e);i>>v]=s}else for(f=new n(a),i=0;i>>15-r[i]);return f},d=new e(288);for(g=0;g<144;++g)d[g]=8;for(g=144;g<256;++g)d[g]=9;for(g=256;g<280;++g)d[g]=7;for(g=280;g<288;++g)d[g]=8;var m=new e(32);for(g=0;g<32;++g)m[g]=5;var b=w(d,9,1),p=w(m,5,1),y=function(r){for(var e=r[0],n=1;ne&&(e=r[n]);return e},L=function(r,e,n){var t=e/8|0;return(r[t]|r[t+1]<<8)>>(7&e)&n},U=function(r,e){var n=e/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(7&e)},k=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],T=function(r,e,n){var t=new Error(e||k[r]);if(t.code=r,Error.captureStackTrace&&Error.captureStackTrace(t,T),!n)throw t;return t},O=function(r,f,u){var s=r.length;if(!s||u&&!u.l&&s<5)return f||new e(0);var c=!f||u,g=!u||u.i;u||(u={}),f||(f=new e(3*s));var h,d=function(r){var n=f.length;if(r>n){var t=new e(Math.max(2*n,r));t.set(f),f=t}},m=u.f||0,k=u.p||0,O=u.b||0,A=u.l,x=u.d,E=u.m,D=u.n,M=8*s;do{if(!A){u.f=m=L(r,k,1);var S=L(r,k+1,3);if(k+=3,!S){var V=r[(I=((h=k)/8|0)+(7&h&&1)+4)-4]|r[I-3]<<8,_=I+V;if(_>s){g&&T(0);break}c&&d(O+V),f.set(r.subarray(I,_),O),u.b=O+=V,u.p=k=8*_;continue}if(1==S)A=b,x=p,E=9,D=5;else if(2==S){var j=L(r,k,31)+257,z=L(r,k+10,15)+4,C=j+L(r,k+5,31)+1;k+=14;for(var F=new e(C),P=new e(19),q=0;q>>4)<16)F[q++]=I;else{var K=0,N=0;for(16==I?(N=3+L(r,k,3),k+=2,K=F[q-1]):17==I?(N=3+L(r,k,7),k+=3):18==I&&(N=11+L(r,k,127),k+=7);N--;)F[q++]=K}}var Q=F.subarray(0,j),R=F.subarray(j);E=y(Q),D=y(R),A=w(Q,E,1),x=w(R,D,1)}else T(1);if(k>M){g&&T(0);break}}c&&d(O+131072);for(var W=(1<>>4;if((k+=15&K)>M){g&&T(0);break}if(K||T(2),Z<256)f[O++]=Z;else{if(256==Z){Y=k,A=null;break}var $=Z-254;if(Z>264){var rr=a[q=Z-257];$=L(r,k,(1<>>4;if(er||T(3),k+=15&er,R=l[nr],nr>3&&(rr=i[nr],R+=U(r,k)&(1<M){g&&T(0);break}c&&d(O+131072);for(var tr=O+$;Or.length)&&(i=r.length);var o=new(r instanceof n?n:r instanceof t?t:e)(i-a);return o.set(r.subarray(a,i)),o}(f,0,O)},A=new e(0),x="undefined"!=typeof TextDecoder&&new TextDecoder;try{x.decode(A,{stream:!0})}catch(r){}return r.convert_streams=function(r){var e=new DataView(r),n=0;function t(){var r=e.getUint16(n);return n+=2,r}function a(){var r=e.getUint32(n);return n+=4,r}function i(r){m.setUint16(b,r),b+=2}function o(r){m.setUint32(b,r),b+=4}for(var f={signature:a(),flavor:a(),length:a(),numTables:t(),reserved:t(),totalSfntSize:a(),majorVersion:t(),minorVersion:t(),metaOffset:a(),metaLength:a(),metaOrigLength:a(),privOffset:a(),privLength:a()},u=0;Math.pow(2,u)<=f.numTables;)u++;u--;for(var v=16*Math.pow(2,u),s=16*f.numTables-v,l=12,c=[],g=0;g{let[skip,step]=range.split("+");skip=parseInt(skip,36),step=step?parseInt(step,36):0,joiningTypeMap.set(lastCode+=skip,m[type]);for(let i=step;i--;)joiningTypeMap.set(++lastCode,m[type])}))}}return joiningTypeMap.get(ch)||JT_NON_JOINING}const ISOL=1,INIT=2,FINA=3,MEDI=4,formsToFeatures=[null,"isol","init","fina","medi"];function detectJoiningForms(str){const joiningForms=new Uint8Array(str.length);let prevJoiningType=JT_NON_JOINING,prevForm=ISOL,prevIndex=-1;for(let i=0;i65535&&i++)}return joiningForms}function firstNum(...args){for(let i=0;i65535&&i++,glyphIds.push(Typr.U.codeToGlyph(font,cc))}const gsub=font.GSUB;if(gsub){const{lookupList:lookupList,featureList:featureList}=gsub;let joiningForms;const supportedFeatures=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,usedLookups=[];featureList.forEach((feature=>{if(supportedFeatures.test(feature.tag))for(let ti=0;ti{if(-1!==glyphIndex){let glyphObj=glyphMap[glyphIndex];if(!glyphObj){const{cmds:cmds,crds:crds}=Typr.U.glyphToPath(typrFont,glyphIndex);let xMin,yMin,xMax,yMax,path="",crdsIdx=0;for(let i=0,len=cmds.length;i1?",":"")+crds[crdsIdx++]}if(crds.length){xMin=yMin=1/0,xMax=yMax=-1/0;for(let i=0,len=crds.length;ixMax&&(xMax=x),y>yMax&&(yMax=y)}}else xMin=xMax=yMin=yMax=0;glyphObj=glyphMap[glyphIndex]={index:glyphIndex,advanceWidth:typrFont.hmtx.aWidth[glyphIndex],xMin:xMin,yMin:yMin,xMax:xMax,yMax:yMax,path:path,pathCommandCount:cmds.length}}-1!==prevGlyphIndex&&(glyphX+=Typr.U.getPairAdjustment(typrFont,prevGlyphIndex,glyphIndex)*fontScale),callback.call(null,glyphObj,glyphX,charIndex),glyphObj.advanceWidth&&(glyphX+=glyphObj.advanceWidth*fontScale),letterSpacing&&(glyphX+=letterSpacing*fontSize),prevGlyphIndex=glyphIndex}charIndex+=text.codePointAt(charIndex)>65535?2:1})),glyphX}};return fontObj}return function parse(buffer){const peek=new Uint8Array(buffer,0,4),tag=Typr._bin.readASCII(peek,0,4);if("wOFF"===tag)buffer=woff2otf(buffer);else if("wOF2"===tag)throw new Error("woff2 fonts not supported");return wrapFontObj(Typr.parse(buffer)[0])}}],init(typrFactory,woff2otfFactory,parserFactory){return parserFactory(typrFactory(),woff2otfFactory())}}),CONFIG={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},tempColor=new three_module.Color;let hasRequested=!1;function now$1(){return(self.performance||Date).now()}const atlases=Object.create(null);function getTextRenderInfo(args,callback){hasRequested=!0,args=troika_three_text_esm_assign({},args);const totalStart=now$1();if(args.font=function toAbsoluteURL(path){linkEl||(linkEl="undefined"==typeof document?{}:document.createElement("a"));return linkEl.href=path,linkEl.href}(args.font||CONFIG.defaultFontURL),args.text=""+args.text,args.sdfGlyphSize=args.sdfGlyphSize||CONFIG.sdfGlyphSize,null!=args.colorRanges){let colors={};for(let key in args.colorRanges)if(args.colorRanges.hasOwnProperty(key)){let val=args.colorRanges[key];"number"!=typeof val&&(val=tempColor.set(val).getHex()),colors[key]=val}args.colorRanges=colors}Object.freeze(args);const{textureWidth:textureWidth,sdfExponent:sdfExponent}=CONFIG,{sdfGlyphSize:sdfGlyphSize}=args,glyphsPerRow=textureWidth/sdfGlyphSize*4;let atlas=atlases[sdfGlyphSize];if(!atlas){const canvas=document.createElement("canvas");canvas.width=textureWidth,canvas.height=256*sdfGlyphSize/glyphsPerRow,atlas=atlases[sdfGlyphSize]={glyphCount:0,sdfGlyphSize:sdfGlyphSize,sdfCanvas:canvas,sdfTexture:new three_module.Texture(canvas,void 0,void 0,void 0,three_module.LinearFilter,three_module.LinearFilter),contextLost:!1,glyphsByFont:new Map},atlas.sdfTexture.generateMipmaps=!1,function initContextLossHandling(atlas){const canvas=atlas.sdfCanvas;canvas.addEventListener("webglcontextlost",(event=>{console.log("Context Lost",event),event.preventDefault(),atlas.contextLost=!0})),canvas.addEventListener("webglcontextrestored",(event=>{console.log("Context Restored",event),atlas.contextLost=!1;const promises=[];atlas.glyphsByFont.forEach((glyphMap=>{glyphMap.forEach((glyph=>{promises.push(generateGlyphSDF(glyph,atlas,!0))}))})),Promise.all(promises).then((()=>{safariPre15Workaround(atlas),atlas.sdfTexture.needsUpdate=!0}))}))}(atlas)}const{sdfTexture:sdfTexture,sdfCanvas:sdfCanvas}=atlas;let fontGlyphs=atlas.glyphsByFont.get(args.font);fontGlyphs||atlas.glyphsByFont.set(args.font,fontGlyphs=new Map),typesetInWorker(args).then((result=>{const{glyphIds:glyphIds,glyphPositions:glyphPositions,fontSize:fontSize,unitsPerEm:unitsPerEm,timings:timings}=result,neededSDFs=[],glyphBounds=new Float32Array(4*glyphIds.length),fontSizeMult=fontSize/unitsPerEm;let boundsIdx=0,positionsIdx=0;const quadsStart=now$1();glyphIds.forEach(((glyphId,i)=>{let glyphInfo=fontGlyphs.get(glyphId);if(!glyphInfo){const{path:path,pathBounds:pathBounds}=result.glyphData[glyphId],fontUnitsMargin=Math.max(pathBounds[2]-pathBounds[0],pathBounds[3]-pathBounds[1])/sdfGlyphSize*(CONFIG.sdfMargin*sdfGlyphSize+.5),atlasIndex=atlas.glyphCount++,sdfViewBox=[pathBounds[0]-fontUnitsMargin,pathBounds[1]-fontUnitsMargin,pathBounds[2]+fontUnitsMargin,pathBounds[3]+fontUnitsMargin];fontGlyphs.set(glyphId,glyphInfo={path:path,atlasIndex:atlasIndex,sdfViewBox:sdfViewBox}),neededSDFs.push(glyphInfo)}const{sdfViewBox:sdfViewBox}=glyphInfo,posX=glyphPositions[positionsIdx++],posY=glyphPositions[positionsIdx++];glyphBounds[boundsIdx++]=posX+sdfViewBox[0]*fontSizeMult,glyphBounds[boundsIdx++]=posY+sdfViewBox[1]*fontSizeMult,glyphBounds[boundsIdx++]=posX+sdfViewBox[2]*fontSizeMult,glyphBounds[boundsIdx++]=posY+sdfViewBox[3]*fontSizeMult,glyphIds[i]=glyphInfo.atlasIndex})),timings.quads=(timings.quads||0)+(now$1()-quadsStart);const sdfStart=now$1();timings.sdf={};const currentHeight=sdfCanvas.height,neededRows=Math.ceil(atlas.glyphCount/glyphsPerRow),neededHeight=Math.pow(2,Math.ceil(Math.log2(neededRows*sdfGlyphSize)));neededHeight>currentHeight&&(console.info(`Increasing SDF texture size ${currentHeight}->${neededHeight}`),resizeWebGLCanvasWithoutClearing(sdfCanvas,textureWidth,neededHeight),sdfTexture.dispose()),Promise.all(neededSDFs.map((glyphInfo=>generateGlyphSDF(glyphInfo,atlas,args.gpuAccelerateSDF).then((({timing:timing})=>{timings.sdf[glyphInfo.atlasIndex]=timing}))))).then((()=>{neededSDFs.length&&!atlas.contextLost&&(safariPre15Workaround(atlas),sdfTexture.needsUpdate=!0),timings.sdfTotal=now$1()-sdfStart,timings.total=now$1()-totalStart,callback(Object.freeze({parameters:args,sdfTexture:sdfTexture,sdfGlyphSize:sdfGlyphSize,sdfExponent:sdfExponent,glyphBounds:glyphBounds,glyphAtlasIndices:glyphIds,glyphColors:result.glyphColors,caretPositions:result.caretPositions,caretHeight:result.caretHeight,chunkedBounds:result.chunkedBounds,ascender:result.ascender,descender:result.descender,lineHeight:result.lineHeight,capHeight:result.capHeight,xHeight:result.xHeight,topBaseline:result.topBaseline,blockBounds:result.blockBounds,visibleBounds:result.visibleBounds,timings:result.timings}))}))})),Promise.resolve().then((()=>{atlas.contextLost||function warmUpSDFCanvas(canvas){canvas._warm||(mainThreadGenerator.webgl.isSupported(canvas),canvas._warm=!0)}(sdfCanvas)}))}function generateGlyphSDF({path:path,atlasIndex:atlasIndex,sdfViewBox:sdfViewBox},{sdfGlyphSize:sdfGlyphSize,sdfCanvas:sdfCanvas,contextLost:contextLost},useGPU){if(contextLost)return Promise.resolve({timing:-1});const{textureWidth:textureWidth,sdfExponent:sdfExponent}=CONFIG,maxDist=Math.max(sdfViewBox[2]-sdfViewBox[0],sdfViewBox[3]-sdfViewBox[1]),squareIndex=Math.floor(atlasIndex/4);return function generateSDF(width,height,path,viewBox,distance,exponent,canvas,x,y,channel,useWebGL=!0){return useWebGL?generateSDF_GL(width,height,path,viewBox,distance,exponent,canvas,x,y,channel).then(null,(err=>(warned||(console.warn("WebGL SDF generation failed, falling back to JS",err),warned=!0),generateSDF_JS_Worker(width,height,path,viewBox,distance,exponent,canvas,x,y,channel)))):generateSDF_JS_Worker(width,height,path,viewBox,distance,exponent,canvas,x,y,channel)}(sdfGlyphSize,sdfGlyphSize,path,sdfViewBox,maxDist,sdfExponent,sdfCanvas,squareIndex%(textureWidth/sdfGlyphSize)*sdfGlyphSize,Math.floor(squareIndex/(textureWidth/sdfGlyphSize))*sdfGlyphSize,atlasIndex%4,useGPU)}function troika_three_text_esm_assign(toObj,fromObj){for(let key in fromObj)fromObj.hasOwnProperty(key)&&(toObj[key]=fromObj[key]);return toObj}let linkEl;function safariPre15Workaround(atlas){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:sdfCanvas,sdfTexture:sdfTexture}=atlas,{width:width,height:height}=sdfCanvas,gl=atlas.sdfCanvas.getContext("webgl");let pixels=sdfTexture.image.data;pixels&&pixels.length===width*height*4||(pixels=new Uint8Array(width*height*4),sdfTexture.image={width:width,height:height,data:pixels},sdfTexture.flipY=!1,sdfTexture.isDataTexture=!0),gl.readPixels(0,0,width,height,gl.RGBA,gl.UNSIGNED_BYTE,pixels)}}const typesetterWorkerModule=defineWorkerModule({name:"Typesetter",dependencies:[CONFIG,workerModule,function createTypesetter(fontParser,bidi,config){const{defaultFontURL:defaultFontURL}=config,fonts=Object.create(null),INF=1/0,DEFAULT_IGNORABLE_CHARS=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,lineBreakingWhiteSpace="[^\\S\\u00A0]",BREAK_AFTER_CHARS=new RegExp(`${lineBreakingWhiteSpace}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function loadFont(fontUrl,callback){fontUrl||(fontUrl=defaultFontURL);let font=fonts[fontUrl];font?font.pending?font.pending.push(callback):callback(font):(fonts[fontUrl]={pending:[callback]},function doLoadFont(url,callback){!function tryLoad(){const onError=err=>{console.error(`Failure loading font ${url}${url===defaultFontURL?"":"; trying fallback"}`,err),url!==defaultFontURL&&(url=defaultFontURL,tryLoad())};try{const request=new XMLHttpRequest;request.open("get",url,!0),request.responseType="arraybuffer",request.onload=function(){if(request.status>=400)onError(new Error(request.statusText));else if(request.status>0)try{const fontObj=fontParser(request.response);callback(fontObj)}catch(e){onError(e)}},request.onerror=onError,request.send()}catch(err){onError(err)}}()}(fontUrl,(fontObj=>{let callbacks=fonts[fontUrl].pending;fonts[fontUrl]=fontObj,callbacks.forEach((cb=>cb(fontObj)))})))}function typeset({text:text="",font:font=defaultFontURL,sdfGlyphSize:sdfGlyphSize=64,fontSize:fontSize=1,letterSpacing:letterSpacing=0,lineHeight:lineHeight="normal",maxWidth:maxWidth=INF,direction:direction,textAlign:textAlign="left",textIndent:textIndent=0,whiteSpace:whiteSpace="normal",overflowWrap:overflowWrap="normal",anchorX:anchorX=0,anchorY:anchorY=0,includeCaretPositions:includeCaretPositions=!1,chunkedBoundsSize:chunkedBoundsSize=8192,colorRanges:colorRanges=null},callback,metricsOnly=!1){const mainStart=now(),timings={fontLoad:0,typesetting:0};text.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),text=text.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),fontSize=+fontSize,letterSpacing=+letterSpacing,maxWidth=+maxWidth,lineHeight=lineHeight||"normal",textIndent=+textIndent,loadFont(font,(fontObj=>{const hasMaxWidth=isFinite(maxWidth);let glyphIds=null,glyphPositions=null,glyphData=null,glyphColors=null,caretPositions=null,visibleBounds=null,chunkedBounds=null,maxLineWidth=0,renderableGlyphCount=0,canWrap="nowrap"!==whiteSpace;const{ascender:ascender,descender:descender,unitsPerEm:unitsPerEm,lineGap:lineGap,capHeight:capHeight,xHeight:xHeight}=fontObj;timings.fontLoad=now()-mainStart;const typesetStart=now(),fontSizeMult=fontSize/unitsPerEm;"normal"===lineHeight&&(lineHeight=(ascender-descender+lineGap)/unitsPerEm);const halfLeading=((lineHeight*=fontSize)-(ascender-descender)*fontSizeMult)/2,topBaseline=-(ascender*fontSizeMult+halfLeading),caretHeight=Math.min(lineHeight,(ascender-descender)*fontSizeMult),caretBottomOffset=(ascender+descender)/2*fontSizeMult-caretHeight/2;let lineXOffset=textIndent,currentLine=new TextLine;const lines=[currentLine];fontObj.forEachGlyph(text,fontSize,letterSpacing,((glyphObj,glyphX,charIndex)=>{const char=text.charAt(charIndex),glyphWidth=glyphObj.advanceWidth*fontSizeMult,curLineCount=currentLine.count;let nextLine;if("isEmpty"in glyphObj||(glyphObj.isWhitespace=!!char&&new RegExp(lineBreakingWhiteSpace).test(char),glyphObj.canBreakAfter=!!char&&BREAK_AFTER_CHARS.test(char),glyphObj.isEmpty=glyphObj.xMin===glyphObj.xMax||glyphObj.yMin===glyphObj.yMax||DEFAULT_IGNORABLE_CHARS.test(char)),glyphObj.isWhitespace||glyphObj.isEmpty||renderableGlyphCount++,canWrap&&hasMaxWidth&&!glyphObj.isWhitespace&&glyphX+glyphWidth+lineXOffset>maxWidth&&curLineCount){if(currentLine.glyphAt(curLineCount-1).glyphObj.canBreakAfter)nextLine=new TextLine,lineXOffset=-glyphX;else for(let i=curLineCount;i--;){if(0===i&&"break-word"===overflowWrap){nextLine=new TextLine,lineXOffset=-glyphX;break}if(currentLine.glyphAt(i).glyphObj.canBreakAfter){nextLine=currentLine.splitAt(i+1);const adjustX=nextLine.glyphAt(0).x;lineXOffset-=adjustX;for(let j=nextLine.count;j--;)nextLine.glyphAt(j).x-=adjustX;break}}nextLine&&(currentLine.isSoftWrapped=!0,currentLine=nextLine,lines.push(currentLine),maxLineWidth=maxWidth)}let fly=currentLine.glyphAt(currentLine.count);fly.glyphObj=glyphObj,fly.x=glyphX+lineXOffset,fly.width=glyphWidth,fly.charIndex=charIndex,"\n"===char&&(currentLine=new TextLine,lines.push(currentLine),lineXOffset=-(glyphX+glyphWidth+letterSpacing*fontSize)+textIndent)})),lines.forEach((line=>{for(let i=line.count;i--;){let{glyphObj:glyphObj,x:x,width:width}=line.glyphAt(i);if(!glyphObj.isWhitespace)return line.width=x+width,void(line.width>maxLineWidth&&(maxLineWidth=line.width))}}));let anchorXOffset=0,anchorYOffset=0;if(anchorX&&("number"==typeof anchorX?anchorXOffset=-anchorX:"string"==typeof anchorX&&(anchorXOffset=-maxLineWidth*("left"===anchorX?0:"center"===anchorX?.5:"right"===anchorX?1:parsePercent(anchorX)))),anchorY)if("number"==typeof anchorY)anchorYOffset=-anchorY;else if("string"==typeof anchorY){let height=lines.length*lineHeight;anchorYOffset="top"===anchorY?0:"top-baseline"===anchorY?-topBaseline:"top-cap"===anchorY?-topBaseline-capHeight*fontSizeMult:"top-ex"===anchorY?-topBaseline-xHeight*fontSizeMult:"middle"===anchorY?height/2:"bottom"===anchorY?height:"bottom-baseline"===anchorY?height-halfLeading+descender*fontSizeMult:parsePercent(anchorY)*height}if(!metricsOnly){const bidiLevelsResult=bidi.getEmbeddingLevels(text,direction);glyphIds=new Uint16Array(renderableGlyphCount),glyphPositions=new Float32Array(2*renderableGlyphCount),glyphData={},visibleBounds=[INF,INF,-INF,-INF],chunkedBounds=[];let lineYOffset=topBaseline;includeCaretPositions&&(caretPositions=new Float32Array(3*text.length)),colorRanges&&(glyphColors=new Uint8Array(3*renderableGlyphCount));let chunk,currentColor,renderableGlyphIndex=0,prevCharIndex=-1,colorCharIndex=-1;if(lines.forEach(((line,lineIndex)=>{let{count:lineGlyphCount,width:lineWidth}=line;if(lineGlyphCount>0){let trailingWhitespaceCount=0;for(let i=lineGlyphCount;i--&&line.glyphAt(i).glyphObj.isWhitespace;)trailingWhitespaceCount++;let lineXOffset=0,justifyAdjust=0;if("center"===textAlign)lineXOffset=(maxLineWidth-lineWidth)/2;else if("right"===textAlign)lineXOffset=maxLineWidth-lineWidth;else if("justify"===textAlign&&line.isSoftWrapped){let whitespaceCount=0;for(let i=lineGlyphCount-trailingWhitespaceCount;i--;)line.glyphAt(i).glyphObj.isWhitespace&&whitespaceCount++;justifyAdjust=(maxLineWidth-lineWidth)/whitespaceCount}if(justifyAdjust||lineXOffset){let justifyOffset=0;for(let i=0;i=start){let startInLine=i,endInLine=i;for(;endInLineend)break;endInLineglyphObj=g;for(let i=0;i1&&fillLigatureCaretPositions(caretPositions,prevCharIndex,ligCount),prevCharIndex=charIndex}if(colorRanges){const{charIndex:charIndex}=glyphInfo;for(;charIndex>colorCharIndex;)colorCharIndex++,colorRanges.hasOwnProperty(colorCharIndex)&&(currentColor=colorRanges[colorCharIndex])}if(!glyphObj.isWhitespace&&!glyphObj.isEmpty){const idx=renderableGlyphIndex++;glyphData[glyphId]||(glyphData[glyphId]={path:glyphObj.path,pathBounds:[glyphObj.xMin,glyphObj.yMin,glyphObj.xMax,glyphObj.yMax]});const glyphX=glyphInfo.x+anchorXOffset,glyphY=lineYOffset+anchorYOffset;glyphPositions[2*idx]=glyphX,glyphPositions[2*idx+1]=glyphY;const visX0=glyphX+glyphObj.xMin*fontSizeMult,visY0=glyphY+glyphObj.yMin*fontSizeMult,visX1=glyphX+glyphObj.xMax*fontSizeMult,visY1=glyphY+glyphObj.yMax*fontSizeMult;visX0visibleBounds[2]&&(visibleBounds[2]=visX1),visY1>visibleBounds[3]&&(visibleBounds[3]=visY1),idx%chunkedBoundsSize==0&&(chunk={start:idx,end:idx,rect:[INF,INF,-INF,-INF]},chunkedBounds.push(chunk)),chunk.end++;const chunkRect=chunk.rect;if(visX0chunkRect[2]&&(chunkRect[2]=visX1),visY1>chunkRect[3]&&(chunkRect[3]=visY1),glyphIds[idx]=glyphId,colorRanges){const start=3*idx;glyphColors[start]=currentColor>>16&255,glyphColors[start+1]=currentColor>>8&255,glyphColors[start+2]=255¤tColor}}}}lineYOffset-=lineHeight})),caretPositions){const ligCount=text.length-prevCharIndex;ligCount>1&&fillLigatureCaretPositions(caretPositions,prevCharIndex,ligCount)}}timings.typesetting=now()-typesetStart,callback({glyphIds:glyphIds,glyphPositions:glyphPositions,glyphData:glyphData,caretPositions:caretPositions,caretHeight:caretHeight,glyphColors:glyphColors,chunkedBounds:chunkedBounds,fontSize:fontSize,unitsPerEm:unitsPerEm,ascender:ascender*fontSizeMult,descender:descender*fontSizeMult,capHeight:capHeight*fontSizeMult,xHeight:xHeight*fontSizeMult,lineHeight:lineHeight,topBaseline:topBaseline,blockBounds:[anchorXOffset,anchorYOffset-lines.length*lineHeight,anchorXOffset+maxLineWidth,anchorYOffset],visibleBounds:visibleBounds,timings:timings})}))}function parsePercent(str){let match=str.match(/^([\d.]+)%$/),pct=match?parseFloat(match[1]):NaN;return isNaN(pct)?0:pct/100}function fillLigatureCaretPositions(caretPositions,ligStartIndex,ligCount){const ligStartX=caretPositions[3*ligStartIndex],ligEndX=caretPositions[3*ligStartIndex+1],ligY=caretPositions[3*ligStartIndex+2],guessedAdvanceX=(ligEndX-ligStartX)/ligCount;for(let i=0;i(Object.defineProperty(obj,prop,{get(){return this.data[this.index*textLineProps.length+i]},set(val){this.data[this.index*textLineProps.length+i]=val}}),obj)),{data:null,index:0}),{typeset:typeset,measure:function measure(args,callback){typeset(args,(result=>{const[x0,y0,x1,y1]=result.blockBounds;callback({width:x1-x0,height:y1-y0})}),{metricsOnly:!0})},loadFont:loadFont}},bidi],init(config,fontParser,createTypesetter,bidiFactory){const{defaultFontURL:defaultFontURL}=config;return createTypesetter(fontParser,bidiFactory(),{defaultFontURL:defaultFontURL})}}),typesetInWorker=defineWorkerModule({name:"Typesetter",dependencies:[typesetterWorkerModule],init(typesetter){return function(args){return new Promise((resolve=>{typesetter.typeset(args,resolve)}))}},getTransferables(result){const transferables=[result.glyphPositions.buffer,result.glyphIds.buffer];return result.caretPositions&&transferables.push(result.caretPositions.buffer),result.glyphColors&&transferables.push(result.glyphColors.buffer),transferables}});const templateGeometries={};class GlyphsGeometry extends three_module.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new three_module.Sphere,this.boundingBox=new three_module.Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(side){const verts=this.getIndex().count;this.setDrawRange(side===three_module.BackSide?verts/2:0,side===three_module.DoubleSide?verts:verts/2)}set detail(detail){if(detail!==this._detail){this._detail=detail,("number"!=typeof detail||detail<1)&&(detail=1);let tpl=function getTemplateGeometry(detail){let geom=templateGeometries[detail];if(!geom){const front=new three_module.PlaneGeometry(1,1,detail,detail),back=front.clone(),frontAttrs=front.attributes,backAttrs=back.attributes,combined=new three_module.BufferGeometry,vertCount=frontAttrs.uv.count;for(let i=0;i{combined.setAttribute(name,new three_module.Float32BufferAttribute([...frontAttrs[name].array,...backAttrs[name].array],frontAttrs[name].itemSize))})),combined.setIndex([...front.index.array,...back.index.array.map((n=>n+vertCount))]),combined.translate(.5,.5,0),geom=templateGeometries[detail]=combined}return geom}(detail);["position","normal","uv"].forEach((attr=>{this.attributes[attr]=tpl.attributes[attr].clone()})),this.setIndex(tpl.getIndex().clone())}}get detail(){return this._detail}set curveRadius(r){r!==this._curveRadius&&(this._curveRadius=r,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(glyphBounds,glyphAtlasIndices,blockBounds,chunkedBounds,glyphColors){updateBufferAttr(this,"aTroikaGlyphBounds",glyphBounds,4),updateBufferAttr(this,"aTroikaGlyphIndex",glyphAtlasIndices,1),updateBufferAttr(this,"aTroikaGlyphColor",glyphColors,3),this._blockBounds=blockBounds,this._chunkedBounds=chunkedBounds,this.instanceCount=glyphAtlasIndices.length,this._updateBounds()}_updateBounds(){const bounds=this._blockBounds;if(bounds){const{curveRadius:curveRadius,boundingBox:bbox}=this;if(curveRadius){const{PI:PI,floor:floor,min:min,max:max,sin:sin,cos:cos}=Math,halfPi=PI/2,twoPi=2*PI,absR=Math.abs(curveRadius),leftAngle=bounds[0]/absR,rightAngle=bounds[2]/absR,minX=floor((leftAngle+halfPi)/twoPi)!==floor((rightAngle+halfPi)/twoPi)?-absR:min(sin(leftAngle)*absR,sin(rightAngle)*absR),maxX=floor((leftAngle-halfPi)/twoPi)!==floor((rightAngle-halfPi)/twoPi)?absR:max(sin(leftAngle)*absR,sin(rightAngle)*absR),maxZ=floor((leftAngle+PI)/twoPi)!==floor((rightAngle+PI)/twoPi)?2*absR:max(absR-cos(leftAngle)*absR,absR-cos(rightAngle)*absR);bbox.min.set(minX,bounds[1],curveRadius<0?-maxZ:0),bbox.max.set(maxX,bounds[3],curveRadius<0?0:maxZ)}else bbox.min.set(bounds[0],bounds[1],0),bbox.max.set(bounds[2],bounds[3],0);bbox.getBoundingSphere(this.boundingSphere)}}applyClipRect(clipRect){let count=this.getAttribute("aTroikaGlyphIndex").count,chunks=this._chunkedBounds;if(chunks)for(let i=chunks.length;i--;){count=chunks[i].end;let rect=chunks[i].rect;if(rect[1]clipRect.y&&rect[0]clipRect.x)break}this.instanceCount=count}}function updateBufferAttr(geom,attrName,newArray,itemSize){const attr=geom.getAttribute(attrName);newArray?attr&&attr.array.length===newArray.length?(attr.array.set(newArray),attr.needsUpdate=!0):(geom.setAttribute(attrName,new three_module.InstancedBufferAttribute(newArray,itemSize)),delete geom._maxInstanceCount,geom.dispose()):attr&&geom.deleteAttribute(attrName)}const defaultMaterial=new three_module.MeshBasicMaterial({color:16777215,side:three_module.DoubleSide,transparent:!0}),tempMat4=new three_module.Matrix4,tempVec3a=new three_module.Vector3,tempVec3b=new three_module.Vector3,tempArray=[],origin=new three_module.Vector3;function first(o){return Array.isArray(o)?o[0]:o}let getFlatRaycastMesh=()=>{const mesh=new three_module.Mesh(new three_module.PlaneGeometry(1,1),defaultMaterial);return getFlatRaycastMesh=()=>mesh,mesh},getCurvedRaycastMesh=()=>{const mesh=new three_module.Mesh(new three_module.PlaneGeometry(1,1,32,1),defaultMaterial);return getCurvedRaycastMesh=()=>mesh,mesh};const syncStartEvent={type:"syncstart"},syncCompleteEvent={type:"synccomplete"},SYNCABLE_PROPS=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],COPYABLE_PROPS=SYNCABLE_PROPS.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class Text extends three_module.Mesh{constructor(){super(new GlyphsGeometry,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=8421504,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation="+x+y",this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(callback){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(callback):(this._isSyncing=!0,this.dispatchEvent(syncStartEvent),getTextRenderInfo({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},(textRenderInfo=>{this._isSyncing=!1,this._textRenderInfo=textRenderInfo,this.geometry.updateGlyphs(textRenderInfo.glyphBounds,textRenderInfo.glyphAtlasIndices,textRenderInfo.blockBounds,textRenderInfo.chunkedBounds,textRenderInfo.glyphColors);const queued=this._queuedSyncs;queued&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{queued.forEach((fn=>fn&&fn()))}))),this.dispatchEvent(syncCompleteEvent),callback&&callback()}))))}onBeforeRender(renderer,scene,camera,geometry,material,group){this.sync(),material.isTroikaTextMaterial&&this._prepareForRender(material),material._hadOwnSide=material.hasOwnProperty("side"),this.geometry.setSide(material._actualSide=material.side),material.side=three_module.FrontSide}onAfterRender(renderer,scene,camera,geometry,material,group){material._hadOwnSide?material.side=material._actualSide:delete material.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let derivedMaterial=this._derivedMaterial;const baseMaterial=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=defaultMaterial.clone());if(derivedMaterial&&derivedMaterial.baseMaterial===baseMaterial||(derivedMaterial=this._derivedMaterial=function createTextDerivedMaterial(baseMaterial){const textMaterial=createDerivedMaterial(baseMaterial,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new three_module.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new three_module.Vector4(0,0,0,0)},uTroikaClipRect:{value:new three_module.Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new three_module.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new three_module.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new three_module.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaOutlineOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:vertexShader,fragmentShader:fragmentShader}){let uDiffuseRE=/\buniform\s+vec3\s+diffuse\b/;return uDiffuseRE.test(fragmentShader)&&(fragmentShader=fragmentShader.replace(uDiffuseRE,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),uDiffuseRE.test(vertexShader)||(vertexShader=vertexShader.replace(voidMainRegExp,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:vertexShader,fragmentShader:fragmentShader}}});return textMaterial.transparent=!0,Object.defineProperties(textMaterial,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),textMaterial}(baseMaterial),baseMaterial.addEventListener("dispose",(function onDispose(){baseMaterial.removeEventListener("dispose",onDispose),derivedMaterial.dispose()}))),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let outlineMaterial=derivedMaterial._outlineMtl;return outlineMaterial||(outlineMaterial=derivedMaterial._outlineMtl=Object.create(derivedMaterial,{id:{value:derivedMaterial.id+.1}}),outlineMaterial.isTextOutlineMaterial=!0,outlineMaterial.depthWrite=!1,outlineMaterial.map=null,derivedMaterial.addEventListener("dispose",(function onDispose(){derivedMaterial.removeEventListener("dispose",onDispose),outlineMaterial.dispose()}))),[outlineMaterial,derivedMaterial]}return derivedMaterial}set material(baseMaterial){baseMaterial&&baseMaterial.isTroikaTextMaterial?(this._derivedMaterial=baseMaterial,this._baseMaterial=baseMaterial.baseMaterial):this._baseMaterial=baseMaterial}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(detail){this.geometry.detail=detail}get curveRadius(){return this.geometry.curveRadius}set curveRadius(r){this.geometry.curveRadius=r}get customDepthMaterial(){return first(this.material).getDepthMaterial()}get customDistanceMaterial(){return first(this.material).getDistanceMaterial()}_prepareForRender(material){const isOutline=material.isTextOutlineMaterial,uniforms=material.uniforms,textInfo=this.textRenderInfo;if(textInfo){const{sdfTexture:sdfTexture,blockBounds:blockBounds}=textInfo;uniforms.uTroikaSDFTexture.value=sdfTexture,uniforms.uTroikaSDFTextureSize.value.set(sdfTexture.image.width,sdfTexture.image.height),uniforms.uTroikaSDFGlyphSize.value=textInfo.sdfGlyphSize,uniforms.uTroikaSDFExponent.value=textInfo.sdfExponent,uniforms.uTroikaTotalBounds.value.fromArray(blockBounds),uniforms.uTroikaUseGlyphColors.value=!isOutline&&!!textInfo.glyphColors;let fillOpacity,strokeOpacity,strokeColor,distanceOffset=0,blurRadius=0,strokeWidth=0,offsetX=0,offsetY=0;if(isOutline){let{outlineWidth:outlineWidth,outlineOffsetX:outlineOffsetX,outlineOffsetY:outlineOffsetY,outlineBlur:outlineBlur,outlineOpacity:outlineOpacity}=this;distanceOffset=this._parsePercent(outlineWidth)||0,blurRadius=Math.max(0,this._parsePercent(outlineBlur)||0),fillOpacity=outlineOpacity,offsetX=this._parsePercent(outlineOffsetX)||0,offsetY=this._parsePercent(outlineOffsetY)||0}else strokeWidth=Math.max(0,this._parsePercent(this.strokeWidth)||0),strokeWidth&&(strokeColor=this.strokeColor,uniforms.uTroikaStrokeColor.value.set(null==strokeColor?8421504:strokeColor),strokeOpacity=this.strokeOpacity,null==strokeOpacity&&(strokeOpacity=1)),fillOpacity=this.fillOpacity;uniforms.uTroikaDistanceOffset.value=distanceOffset,uniforms.uTroikaPositionOffset.value.set(offsetX,offsetY),uniforms.uTroikaBlurRadius.value=blurRadius,uniforms.uTroikaStrokeWidth.value=strokeWidth,uniforms.uTroikaStrokeOpacity.value=strokeOpacity,uniforms.uTroikaFillOpacity.value=null==fillOpacity?1:fillOpacity,uniforms.uTroikaCurveRadius.value=this.curveRadius||0;let clipRect=this.clipRect;if(clipRect&&Array.isArray(clipRect)&&4===clipRect.length)uniforms.uTroikaClipRect.value.fromArray(clipRect);else{const pad=100*(this.fontSize||.1);uniforms.uTroikaClipRect.value.set(blockBounds[0]-pad,blockBounds[1]-pad,blockBounds[2]+pad,blockBounds[3]+pad)}this.geometry.applyClipRect(uniforms.uTroikaClipRect.value)}uniforms.uTroikaSDFDebug.value=!!this.debugSDF,material.polygonOffset=!!this.depthOffset,material.polygonOffsetFactor=material.polygonOffsetUnits=this.depthOffset||0;const color=isOutline?this.outlineColor||0:this.color;if(null==color)delete material.color;else{const colorObj=material.hasOwnProperty("color")?material.color:material.color=new three_module.Color;color===colorObj._input&&"object"!=typeof color||colorObj.set(colorObj._input=color)}let orient=this.orientation||"+x+y";if(orient!==material._orientation){let rotMat=uniforms.uTroikaOrient.value;orient=orient.replace(/[^-+xyz]/g,"");let match="+x+y"!==orient&&orient.match(/^([-+])([xyz])([-+])([xyz])$/);if(match){let[,hSign,hAxis,vSign,vAxis]=match;tempVec3a.set(0,0,0)[hAxis]="-"===hSign?1:-1,tempVec3b.set(0,0,0)[vAxis]="-"===vSign?-1:1,tempMat4.lookAt(origin,tempVec3a.cross(tempVec3b),tempVec3b),rotMat.setFromMatrix4(tempMat4)}else rotMat.identity();material._orientation=orient}}_parsePercent(value){if("string"==typeof value){let match=value.match(/^(-?[\d.]+)%$/),pct=match?parseFloat(match[1]):NaN;value=(isNaN(pct)?0:pct/100)*this.fontSize}return value}localPositionToTextCoords(position,target=new three_module.Vector2){target.copy(position);const r=this.curveRadius;return r&&(target.x=Math.atan2(position.x,Math.abs(r)-Math.abs(position.z))*Math.abs(r)),target}worldPositionToTextCoords(position,target=new three_module.Vector2){return tempVec3a.copy(position),this.localPositionToTextCoords(this.worldToLocal(tempVec3a),target)}raycast(raycaster,intersects){const{textRenderInfo:textRenderInfo,curveRadius:curveRadius}=this;if(textRenderInfo){const bounds=textRenderInfo.blockBounds,raycastMesh=curveRadius?getCurvedRaycastMesh():getFlatRaycastMesh(),geom=raycastMesh.geometry,{position:position,uv:uv}=geom.attributes;for(let i=0;i{this[prop]=source[prop]})),this}clone(){return(new this.constructor).copy(this)}}SYNCABLE_PROPS.forEach((prop=>{const privateKey="_private_"+prop;Object.defineProperty(Text.prototype,prop,{get(){return this[privateKey]},set(value){value!==this[privateKey]&&(this[privateKey]=value,this._needsSync=!0)}})}));new WeakMap;new WeakMap;var suspend_react=__webpack_require__("./node_modules/suspend-react/index.js");const Text_Text=react.forwardRef((({sdfGlyphSize:sdfGlyphSize=64,anchorX:anchorX="center",anchorY:anchorY="middle",font:font,fontSize:fontSize=1,children:children,characters:characters,onSync:onSync,...props},ref)=>{const invalidate=(0,index_673ef987_esm.z)((({invalidate:invalidate})=>invalidate)),[troikaMesh]=react.useState((()=>new Text)),[nodes,text]=react.useMemo((()=>{const n=[];let t="";return react.Children.forEach(children,(child=>{"string"==typeof child||"number"==typeof child?t+=child:n.push(child)})),[n,t]}),[children]);return(0,suspend_react.Rq)((()=>new Promise((res=>function preloadFont({font:font,characters:characters,sdfGlyphSize:sdfGlyphSize},callback){getTextRenderInfo({font:font,sdfGlyphSize:sdfGlyphSize,text:Array.isArray(characters)?characters.join("\n"):""+characters},callback)}({font:font,characters:characters},res)))),["troika-text",font,characters]),react.useLayoutEffect((()=>{troikaMesh.sync((()=>{invalidate(),onSync&&onSync(troikaMesh)}))})),react.useEffect((()=>()=>troikaMesh.dispose()),[troikaMesh]),react.createElement("primitive",(0,esm_extends.Z)({object:troikaMesh,ref:ref,font:font,text:text,anchorX:anchorX,anchorY:anchorY,fontSize:fontSize,sdfGlyphSize:sdfGlyphSize},props),nodes)}));function useEvent(eventName,handler,deps=[],options){const handlerRef=(0,react.useRef)(handler);(0,react.useEffect)((()=>{handlerRef.current=handler}),[handler]),(0,react.useEffect)((()=>{const handler2=event=>{var _a;return null==(_a=handlerRef.current)?void 0:_a.call(handlerRef,event)},context=function onEvent(eventName,handler,options){return(null==options?void 0:options.once)?eventEmitter.once(eventName,handler):eventEmitter.on(eventName,handler)}(eventName,handler2,options);return()=>function offEvent(eventName,handler,options){var _a;eventEmitter.removeListener(eventName,handler,null!=(_a=null==options?void 0:options.context)?_a:null,null==options?void 0:options.once)}(eventName,handler2,{...options,context:context})}),[eventName,null==options?void 0:options.once,...deps])}const TextHighHZ=(0,react.memo)((({isPerf:isPerf,color:color,colorBlind:colorBlind,customData:customData2,isMemory:isMemory,isShadersInfo:isShadersInfo,metric:metric,fontSize:fontSize,offsetY:offsetY=0,offsetX:offsetX,round:round,hasInstance:hasInstance})=>{const{width:w,height:h}=(0,index_673ef987_esm.z)((s=>s.viewport)),fpsRef=(0,react.useRef)(null),fpsInstanceRef=(0,react.useRef)(null);return useEvent("log",(function updateR3FPerfText([log,gl]){var _a;if(!log||!fpsRef.current)return;if(customData2&&(fpsRef.current.text=(Math.round(getPerf().customData*Math.pow(10,round))/Math.pow(10,round)).toFixed(round)),!metric)return;let info=log[metric];if(isShadersInfo)info=null==(_a=gl.info.programs)?void 0:_a.length;else if("matriceCount"===metric)info=matriceCount.value;else if(!isPerf&&gl.info.render){info=(isMemory?gl.info.memory:gl.info.render)[metric]}if("fps"===metric&&(fpsRef.current.color=getPerf().overclockingFps?colorsGraph(colorBlind).overClock.toString():`rgb(${colorsGraph(colorBlind).fps.toString()})`),fpsRef.current.text=(Math.round(info*Math.pow(10,round))/Math.pow(10,round)).toFixed(round),hasInstance){const infosInstance=gl.info.instance;if(void 0===infosInstance&&"matriceCount"!==metric)return;let infoInstance;infoInstance="matriceCount"===metric?matriceWorldCount.value:infosInstance[metric],infoInstance>0?(fpsRef.current.fontSize=fontSize/1.15,fpsInstanceRef.current.fontSize=info>0?fontSize/1.4:fontSize,fpsRef.current.position.y=h/2-offsetY-fontSize/1.9,fpsInstanceRef.current.text=" ±\t"+(Math.round(infoInstance*Math.pow(10,round))/Math.pow(10,round)).toFixed(round)):(fpsInstanceRef.current.text&&(fpsInstanceRef.current.text=""),fpsRef.current.position.y=h/2-offsetY-fontSize,fpsRef.current.fontSize=fontSize)}matriceCount.value-=1,fpsRef.current.updateMatrix(),fpsRef.current.matrixWorld.copy(fpsRef.current.matrix)})),(0,jsx_runtime.jsxs)(react.Suspense,{fallback:null,children:[(0,jsx_runtime.jsxs)(Text_Text,{textAlign:"justify",matrixAutoUpdate:!1,ref:fpsRef,fontSize:fontSize,position:[-w/2+offsetX+fontSize,h/2-offsetY-fontSize,0],color:color,characters:"0123456789",onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("meshBasicMaterial",{blending:three_module.NormalBlending}),"0"]}),hasInstance&&(0,jsx_runtime.jsx)(Text_Text,{textAlign:"justify",matrixAutoUpdate:!1,ref:fpsInstanceRef,fontSize:8,position:[-w/2+offsetX+fontSize,h/2-offsetY-1.15*fontSize,0],color:"lightgrey",characters:"0123456789",onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:(0,jsx_runtime.jsx)("meshBasicMaterial",{blending:three_module.NormalBlending})})]})})),TextsHighHZ=({colorBlind:colorBlind,customData:customData2,minimal:minimal,matrixUpdate:matrixUpdate})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TextHighHZ,{colorBlind:colorBlind,color:`rgb(${colorsGraph(colorBlind).fps.toString()})`,isPerf:!0,metric:"fps",fontSize:14,offsetX:140,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{color:`rgb(${colorsGraph(colorBlind).cpu.toString()})`,isPerf:!0,metric:"cpu",fontSize:14,offsetX:72,round:3}),(0,jsx_runtime.jsx)(TextHighHZ,{color:`rgb(${colorsGraph(colorBlind).gpu.toString()})`,isPerf:!0,metric:"gpu",fontSize:14,offsetX:10,round:3}),minimal?null:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TextHighHZ,{metric:"calls",fontSize:14,offsetX:200,round:0,hasInstance:!0}),(0,jsx_runtime.jsx)(TextHighHZ,{metric:"triangles",fontSize:14,offsetX:260,round:0,hasInstance:!0}),(0,jsx_runtime.jsx)(TextHighHZ,{isMemory:!0,metric:"geometries",fontSize:14,offsetY:30,offsetX:0,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{isMemory:!0,metric:"textures",fontSize:14,offsetY:30,offsetX:80,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{isShadersInfo:!0,metric:"programs",fontSize:14,offsetY:30,offsetX:140,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{metric:"lines",fontSize:14,offsetY:30,offsetX:200,round:0,hasInstance:!0}),(0,jsx_runtime.jsx)(TextHighHZ,{metric:"points",fontSize:14,offsetY:30,offsetX:260,round:0,hasInstance:!0}),matrixUpdate&&(0,jsx_runtime.jsx)(TextHighHZ,{isPerf:!0,metric:"matriceCount",fontSize:14,offsetY:30,offsetX:320,round:0,hasInstance:!0})]}),customData2&&(0,jsx_runtime.jsx)(TextHighHZ,{color:`rgb(${colorsGraph(colorBlind).custom.toString()})`,customData:customData2,fontSize:14,offsetY:0,offsetX:minimal?200:320,round:customData2.round||2})]}),ChartCurve=({colorBlind:colorBlind,minimal:minimal,chart:chart={length:120,hz:60}})=>{const curves=(0,react.useMemo)((()=>({fps:new Float32Array(3*chart.length),cpu:new Float32Array(3*chart.length),gpu:new Float32Array(3*chart.length)})),[chart]),fpsRef=(0,react.useRef)(null),fpsMatRef=(0,react.useRef)(null),gpuRef=(0,react.useRef)(null),cpuRef=(0,react.useRef)(null),dummyVec3=(0,react.useMemo)((()=>new three_module.Vector3(0,0,0)),[]),updatePoints=(element,factor=1,ref,viewport)=>{let maxVal=0;const{width:w,height:h}=viewport,chart2=getPerf().chart.data[element];if(!chart2||0===chart2.length)return;const padding=minimal?2:6,paddingTop=minimal?12:50;let len=chart2.length;for(let i=0;imaxVal&&(maxVal=chart2[id]*factor),dummyVec3.set(padding+i/(len-1)*(w-2*padding)-w/2,Math.min(100,chart2[id])*factor/100*(h-2*padding-paddingTop)-h/2,0),dummyVec3.toArray(ref.attributes.position.array,3*i))}ref.attributes.position.needsUpdate=!0};return(0,index_673ef987_esm.A)((function updateChartCurve({viewport:viewport}){updatePoints("fps",1,fpsRef.current,viewport),fpsMatRef.current&&fpsMatRef.current.color.set(getPerf().overclockingFps?colorsGraph(colorBlind).overClock.toString():`rgb(${colorsGraph(colorBlind).fps.toString()})`),updatePoints("gpu",5,gpuRef.current,viewport),updatePoints("cpu",5,cpuRef.current,viewport)})),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)("line",{onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("bufferGeometry",{ref:fpsRef,children:(0,jsx_runtime.jsx)("bufferAttribute",{attach:"attributes-position",count:chart.length,array:curves.fps,itemSize:3,usage:three_module.DynamicDrawUsage,needsUpdate:!0})}),(0,jsx_runtime.jsx)("lineBasicMaterial",{ref:fpsMatRef,color:`rgb(${colorsGraph(colorBlind).fps.toString()})`,transparent:!0,opacity:.5})]}),(0,jsx_runtime.jsxs)("line",{onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("bufferGeometry",{ref:gpuRef,children:(0,jsx_runtime.jsx)("bufferAttribute",{attach:"attributes-position",count:chart.length,array:curves.gpu,itemSize:3,usage:three_module.DynamicDrawUsage,needsUpdate:!0})}),(0,jsx_runtime.jsx)("lineBasicMaterial",{color:`rgb(${colorsGraph(colorBlind).gpu.toString()})`,transparent:!0,opacity:.5})]}),(0,jsx_runtime.jsxs)("line",{onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("bufferGeometry",{ref:cpuRef,children:(0,jsx_runtime.jsx)("bufferAttribute",{attach:"attributes-position",count:chart.length,array:curves.cpu,itemSize:3,usage:three_module.DynamicDrawUsage,needsUpdate:!0})}),(0,jsx_runtime.jsx)("lineBasicMaterial",{color:`rgb(${colorsGraph(colorBlind).cpu.toString()})`,transparent:!0,opacity:.5})]})]})},ChartUI=({colorBlind:colorBlind,chart:chart,customData:customData,matrixUpdate:matrixUpdate,showGraph:showGraph=!0,antialias:antialias=!0,minimal:minimal})=>{const canvas=(0,react.useRef)(void 0),paused=usePerf((state=>state.paused));return(0,jsx_runtime.jsxs)(Graph,{style:{display:"flex",position:"absolute",height:(minimal?37:showGraph?100:60)+"px",minWidth:""+(minimal?"100px":customData?"370px":"310px")},children:[(0,jsx_runtime.jsx)(react_three_fiber_esm.Xz,{ref:canvas,orthographic:!0,dpr:antialias?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:scene})=>{scene.traverse((obj=>{obj.matrixWorldAutoUpdate=!1,obj.matrixAutoUpdate=!1}))},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",height:(minimal?37:showGraph?100:60)+"px"},children:paused?null:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(Renderer,{}),(0,jsx_runtime.jsx)(TextsHighHZ,{customData:customData,minimal:minimal,matrixUpdate:matrixUpdate}),showGraph&&(0,jsx_runtime.jsx)(ChartCurve,{colorBlind:colorBlind,minimal:minimal,chart:chart})]})}),paused&&(0,jsx_runtime.jsxs)(Graphpc,{children:[(0,jsx_runtime.jsx)(PauseIcon,{})," PAUSED"]})]})},Renderer=()=>((0,index_673ef987_esm.A)((function updateR3FPerf({gl:gl,scene:scene,camera:camera}){camera.updateMatrix(),matriceCount.value-=1,camera.matrixWorld.copy(camera.matrix),camera.matrixWorldInverse.copy(camera.matrixWorld).invert(),gl.render(scene,camera),matriceWorldCount.value=0,matriceCount.value=0}),1/0),null);var client=__webpack_require__("./node_modules/react-dom/client.js");const HtmlMinimal=(0,react.forwardRef)((({portal:portal,className:className,children:children,name:name,...props},ref)=>{const gl=(0,index_673ef987_esm.z)((state=>state.gl)),group=(0,react.useRef)(null),rootRef=(0,react.useRef)(null),target=null!=(null==portal?void 0:portal.current)?portal.current:gl.domElement.parentNode;return(0,react.useLayoutEffect)((()=>{if(!group.current||!target)return;const el=document.createElement("div"),root=rootRef.current=(0,client.createRoot)(el);return target.appendChild(el),()=>{root.unmount(),rootRef.current=null,target.removeChild(el)}}),[target]),(0,react.useLayoutEffect)((()=>{const root=rootRef.current;root&&root.render((0,jsx_runtime.jsx)("div",{ref:ref,className:className,children:children}))})),(0,jsx_runtime.jsx)("group",{name:name,...props,ref:group})}));function estimateBytesUsed(geometry){let mem=0;for(let name in geometry.attributes){const attr=geometry.getAttribute(name);mem+=attr.count*attr.itemSize*attr.array.BYTES_PER_ELEMENT}const indices=geometry.getIndex();return mem+=indices?indices.count*indices.itemSize*indices.array.BYTES_PER_ELEMENT:0,mem}const addTextureUniforms=(id,texture)=>({name:id,url:texture.image.currentSrc,encoding:(encoding=>{switch(encoding){case 3e3:return"LinearEncoding";case 3001:return"sRGBEncoding";case 3002:return"RGBEEncoding";case 3003:return"LogLuvEncoding";case 3004:return"RGBM7Encoding";case 3005:return"RGBM16Encoding";case 3006:return"RGBDEncoding";case 3007:return"GammaEncoding";default:return"ClampToEdgeWrapping"}})(texture.encoding),wrapT:(wrap=>{switch(wrap){case 1e3:return"RepeatWrapping";case 1001:default:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping"}})(texture.wrapT),flipY:texture.flipY.toString()}),UniformsGL=({program:program,material:material,setTexNumber:setTexNumber})=>{const gl=usePerf((state=>state.gl)),[uniforms,set]=(0,react.useState)(null);return(0,react.useEffect)((()=>{if(gl){const data=null==program?void 0:program.getUniforms();let TexCount=0;const format=new Map;data.seq.forEach((e=>{if(!e.id.includes("uTroika")&&"isOrthographic"!==e.id&&"uvTransform"!==e.id&&"lightProbe"!==e.id&&"projectionMatrix"!==e.id&&"viewMatrix"!==e.id&&"normalMatrix"!==e.id&&"modelMatrix"!==e.id&&"modelViewMatrix"!==e.id){let values=[],data2={name:e.id};e.cache&&(e.cache.forEach((v=>{void 0!==v&&values.push(v.toString().substring(0,4))})),data2.value=values.join(),material[e.id]&&material[e.id].image&&material[e.id].image&&(TexCount++,data2.value=addTextureUniforms(e.id,material[e.id])),data2.value||(data2.value="empty"),format.set(e.id,data2))}})),material.uniforms&&Object.keys(material.uniforms).forEach((key=>{const uniform=material.uniforms[key];if(uniform.value){const{value:value}=uniform;let data2={name:key};if(key.includes("uTroika"))return;if(value.isTexture)TexCount++,data2.value=addTextureUniforms(key,value);else{let sb=JSON.stringify(value);try{sb=JSON.stringify(value)}catch(_err){sb=value.toString()}data2.value=sb}format.set(key,data2)}})),TexCount>0&&setTexNumber(TexCount),set(format)}}),[]),(0,jsx_runtime.jsx)(ProgramsUL,{children:uniforms&&Array.from(uniforms.values()).map((uniform=>(0,jsx_runtime.jsx)("span",{children:"string"==typeof uniform.value?(0,jsx_runtime.jsx)("li",{children:(0,jsx_runtime.jsxs)("span",{children:[uniform.name," :"," ",(0,jsx_runtime.jsxs)("b",{children:[uniform.value.substring(0,30),uniform.value.length>30?"...":""]})]})}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("li",{children:(0,jsx_runtime.jsxs)("b",{children:[uniform.value.name,":"]})}),(0,jsx_runtime.jsxs)("div",{children:[Object.keys(uniform.value).map((key=>"name"!==key?(0,jsx_runtime.jsx)("div",{children:"url"===key?(0,jsx_runtime.jsx)("a",{href:uniform.value[key],target:"_blank",children:(0,jsx_runtime.jsx)("img",{src:uniform.value[key]})}):(0,jsx_runtime.jsxs)("li",{children:[key,": ",(0,jsx_runtime.jsx)("b",{children:uniform.value[key]})]})},key):null)),(0,jsx_runtime.jsxs)(ProgramConsole,{onClick:()=>{var _a;console.info(material[uniform.value.name]||(null==(_a=null==material?void 0:material.uniforms[uniform.value.name])?void 0:_a.value))},children:["console.info(",uniform.value.name,");"]})]})]})},uniform.name)))})},DynamicDrawCallInfo=({el:el})=>{usePerf((state=>state.log));const gl=usePerf((state=>state.gl));return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:el.drawCounts.total>0&&(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:["Triangle"===el.drawCounts.type?(0,jsx_runtime.jsx)(VercelLogoIcon,{style:{top:"-1px"}}):(0,jsx_runtime.jsx)(ActivityLogIcon,{style:{top:"-1px"}}),el.drawCounts.total,(0,jsx_runtime.jsxs)("small",{children:[el.drawCounts.type,"s"]}),gl&&(0,jsx_runtime.jsxs)(PerfB,{style:{bottom:"-10px",width:"40px",fontWeight:"bold"},children:[el.visible&&!el.material.wireframe?(el2=>{if(!gl)return 0;const res=Math.round(el2.drawCounts.total/(gl.info.render.triangles+gl.info.render.lines+gl.info.render.points)*100*10)/10;return isFinite(res)&&res||0})(el):0,"%"]})]})})},ProgramUI=({el:el})=>{const[showProgram,setShowProgram]=(0,react.useState)(el.visible),[toggleProgram,set]=(0,react.useState)(el.expand),[texNumber,setTexNumber]=(0,react.useState)(0),{meshes:meshes,program:program,material:material}=el;return(0,jsx_runtime.jsxs)(ProgramGeo,{children:[(0,jsx_runtime.jsxs)(ProgramHeader,{onClick:()=>{el.expand=!toggleProgram,Object.keys(meshes).forEach((key=>{meshes[key].material.wireframe=!1})),set(!toggleProgram)},children:[(0,jsx_runtime.jsx)(Toggle,{style:{marginRight:"6px"},children:toggleProgram?(0,jsx_runtime.jsx)("span",{children:(0,jsx_runtime.jsx)(TriangleDownIcon,{})}):(0,jsx_runtime.jsx)("span",{children:(0,jsx_runtime.jsx)(TriangleUpIcon,{})})}),program&&(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(ProgramTitle,{children:program.name}),(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[(0,jsx_runtime.jsx)(LayersIcon,{style:{top:"-1px"}}),Object.keys(meshes).length,(0,jsx_runtime.jsx)("small",{children:Object.keys(meshes).length>1?"users":"user"})]}),texNumber>0&&(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[(0,jsx_runtime.jsx)(ImageIcon,{style:{top:"-1px"}}),texNumber,(0,jsx_runtime.jsx)("small",{children:"tex"})]}),(0,jsx_runtime.jsx)(DynamicDrawCallInfo,{el:el}),"300 es"===material.glslVersion&&(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[(0,jsx_runtime.jsx)(RocketIcon,{style:{top:"-1px"}}),"300",(0,jsx_runtime.jsx)("small",{children:"es"}),(0,jsx_runtime.jsx)(PerfB,{style:{bottom:"-10px",width:"40px"},children:"glsl"})]})]}),(0,jsx_runtime.jsx)(ToggleVisible,{onPointerEnter:()=>{Object.keys(meshes).forEach((key=>{meshes[key].material.wireframe=!0}))},onPointerLeave:()=>{Object.keys(meshes).forEach((key=>{meshes[key].material.wireframe=!1}))},onClick:e=>{e.stopPropagation(),Object.keys(meshes).forEach((key=>{const mesh=meshes[key],invert=!showProgram;mesh.visible=invert,el.visible=invert,setShowProgram(invert)}))},children:showProgram?(0,jsx_runtime.jsx)(EyeOpenIcon,{}):(0,jsx_runtime.jsx)(EyeNoneIcon,{})})]}),(0,jsx_runtime.jsxs)("div",{style:{maxHeight:toggleProgram?"9999px":0,overflow:"hidden"},children:[(0,jsx_runtime.jsxs)(ProgramsULHeader,{children:[(0,jsx_runtime.jsx)(ButtonIcon,{})," Uniforms:"]}),(0,jsx_runtime.jsx)(UniformsGL,{program:program,material:material,setTexNumber:setTexNumber}),(0,jsx_runtime.jsxs)(ProgramsULHeader,{children:[(0,jsx_runtime.jsx)(CubeIcon,{})," Geometries:"]}),(0,jsx_runtime.jsx)(ProgramsUL,{children:meshes&&Object.keys(meshes).map((key=>meshes[key]&&meshes[key].geometry&&(0,jsx_runtime.jsxs)(ProgramsGeoLi,{children:[(0,jsx_runtime.jsxs)("span",{children:[meshes[key].geometry.type,": "]}),meshes[key].userData&&meshes[key].userData.drawCount&&(0,jsx_runtime.jsxs)("b",{children:[(0,jsx_runtime.jsxs)("div",{children:[meshes[key].userData.drawCount.count,(0,jsx_runtime.jsxs)("small",{children:[" ",meshes[key].userData.drawCount.type,"s"]})]}),(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsxs)("div",{children:[Math.round(estimateBytesUsed(meshes[key].geometry)/1024*1e3)/1e3,"Kb",(0,jsx_runtime.jsx)("small",{children:" memory used"})]})]})]},key)))}),(0,jsx_runtime.jsxs)(ProgramConsole,{onClick:()=>{console.info(material)},children:["console.info(",material.type,")"]})]})]})},ProgramsUI=()=>{usePerf((state=>state.triggerProgramsUpdate));const programs=usePerf((state=>state.programs));return(0,jsx_runtime.jsx)(ProgramsContainer,{children:programs&&Array.from(programs.values()).map((el=>el&&el?(0,jsx_runtime.jsx)(ProgramUI,{el:el},el.material.uuid):null))})},colorsGraph=colorBlind=>({overClock:"#ff6eff",fps:colorBlind?"100, 143, 255":"238,38,110",cpu:colorBlind?"254, 254, 98":"66,226,46",gpu:colorBlind?"254,254,254":"253,151,31",custom:colorBlind?"86,180,233":"40,255,255"}),DynamicUIPerf=({showGraph:showGraph,colorBlind:colorBlind})=>{const overclockingFps=usePerf((s=>s.overclockingFps)),fpsLimit=usePerf((s=>s.fpsLimit));return(0,jsx_runtime.jsxs)(PerfB,{style:showGraph?{color:overclockingFps?colorsGraph(colorBlind).overClock.toString():`rgb(${colorsGraph(colorBlind).fps})`}:{},children:["FPS ",overclockingFps?`${fpsLimit}🚀`:""]})},DynamicUI=({showGraph:showGraph,colorBlind:colorBlind,customData:customData,minimal:minimal})=>{const gl=usePerf((state=>state.gl));return gl?(0,jsx_runtime.jsxs)(PerfIContainer,{children:[(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(LightningBoltIcon,{}),(0,jsx_runtime.jsx)(PerfB,{style:showGraph?{color:`rgb(${colorsGraph(colorBlind).gpu.toString()})`}:{},children:"GPU"}),(0,jsx_runtime.jsx)(PerfSmallI,{children:"ms"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(RulerHorizontalIcon,{}),(0,jsx_runtime.jsx)(PerfB,{style:showGraph?{color:`rgb(${colorsGraph(colorBlind).cpu.toString()})`}:{},children:"CPU"}),(0,jsx_runtime.jsx)(PerfSmallI,{children:"ms"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(LapTimerIcon,{}),(0,jsx_runtime.jsx)(DynamicUIPerf,{showGraph:showGraph,colorBlind:colorBlind})]}),!minimal&&gl&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(TextAlignJustifyIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:1===gl.info.render.calls?"call":"calls"})]}),!minimal&&gl&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(VercelLogoIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Triangles"})]}),customData&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(BarChartIcon,{}),(0,jsx_runtime.jsx)(PerfB,{style:showGraph?{color:`rgb(${colorsGraph(colorBlind).custom})`}:{},children:customData.name}),customData.info&&(0,jsx_runtime.jsx)(PerfSmallI,{children:customData.info})]})]}):null},PerfUI=({showGraph:showGraph,colorBlind:colorBlind,deepAnalyze:deepAnalyze,customData:customData,matrixUpdate:matrixUpdate,openByDefault:openByDefault,minimal:minimal})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(DynamicUI,{showGraph:showGraph,colorBlind:colorBlind,customData:customData,minimal:minimal}),!minimal&&(0,jsx_runtime.jsx)(PerfThree,{matrixUpdate:matrixUpdate,openByDefault:openByDefault,deepAnalyze:deepAnalyze,showGraph:showGraph})]}),InfoUI=({matrixUpdate:matrixUpdate})=>(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(MarginIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Geometries"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(ImageIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Textures"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(ActivityLogIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"shaders"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(MinusIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Lines"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(DotIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Points"})]}),matrixUpdate&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(DropdownMenuIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Matrices"})]})]}),ToggleEl=({tab:tab,title:title,set:set})=>{const tabStore=usePerf((s=>s.tab));return(0,jsx_runtime.jsx)(Toggle,{className:""+(tabStore===tab?" __perf_toggle_tab_active":""),onClick:()=>{set(!0),setPerf({tab:tab})},children:(0,jsx_runtime.jsx)("span",{children:title})})},PerfThree=({openByDefault:openByDefault,showGraph:showGraph,deepAnalyze:deepAnalyze,matrixUpdate:matrixUpdate})=>{const[show,set]=react.useState(openByDefault);return(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(TabContainers,{show:show,showGraph:showGraph,matrixUpdate:matrixUpdate}),openByDefault&&!deepAnalyze?null:(0,jsx_runtime.jsxs)(ToggleContainer,{className:"__perf_toggle",children:[deepAnalyze&&(0,jsx_runtime.jsx)(ToggleEl,{tab:"programs",title:"Programs",set:set}),deepAnalyze&&(0,jsx_runtime.jsx)(ToggleEl,{tab:"infos",title:"Infos",set:set}),(0,jsx_runtime.jsx)(Toggle,{onClick:()=>{set(!show)},children:show?(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(TriangleDownIcon,{})," Minimize"]}):(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(TriangleUpIcon,{})," More"]})})]})]})},TabContainers=({show:show,showGraph:showGraph,matrixUpdate:matrixUpdate})=>{const tab=usePerf((state=>state.tab));return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(InfoUI,{matrixUpdate:matrixUpdate}),show&&(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsx)(ContainerScroll,{style:{marginTop:showGraph?"38px":0},children:"programs"===tab&&(0,jsx_runtime.jsx)(ProgramsUI,{})})})]})},Perf=({showGraph:showGraph=!0,colorBlind:colorBlind=!1,openByDefault:openByDefault=!0,className:className,overClock:overClock=!1,style:style,position:position="top-right",chart:chart,logsPerSecond:logsPerSecond,deepAnalyze:deepAnalyze=!1,antialias:antialias=!0,customData:customData,matrixUpdate:matrixUpdate,minimal:minimal})=>{const perfContainerRef=(0,react.useRef)(null);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(PerfHeadless,{logsPerSecond:logsPerSecond,chart:chart,overClock:overClock,deepAnalyze:deepAnalyze,matrixUpdate:matrixUpdate}),(0,jsx_runtime.jsx)(HtmlMinimal,{name:"r3f-perf",children:(0,jsx_runtime.jsxs)(PerfS,{className:(className?" ".concat(className):" ")+` ${position||""} ${minimal?"minimal":""}`,style:{minHeight:minimal?"37px":showGraph?"100px":"60px",...style},ref:perfContainerRef,children:[(0,jsx_runtime.jsx)(ChartUI,{perfContainerRef:perfContainerRef,colorBlind:colorBlind,chart:chart,showGraph:showGraph,antialias:antialias,customData:customData,minimal:minimal,matrixUpdate:matrixUpdate}),(0,jsx_runtime.jsx)(PerfUI,{colorBlind:colorBlind,showGraph:showGraph,deepAnalyze:deepAnalyze,openByDefault:openByDefault,customData:customData,matrixUpdate:matrixUpdate,minimal:minimal})]})})]})}},"./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js":function(__unused_webpack_module,exports,__webpack_require__){var e=__webpack_require__("./node_modules/react/index.js");var k="function"==typeof Object.is?Object.is:function h(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function t(a,b){return b()}:function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];return n((function(){c.value=d,c.getSnapshot=b,r(c)&&g({inst:c})}),[a,d,b]),m((function(){return r(c)&&g({inst:c}),a((function(){r(c)&&g({inst:c})}))}),[a]),p(d),d};exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u},"./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js":function(__unused_webpack_module,exports,__webpack_require__){var h=__webpack_require__("./node_modules/react/index.js"),n=__webpack_require__("./node_modules/use-sync-external-store/shim/index.js");var q="function"==typeof Object.is?Object.is:function p(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;exports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v((function(){function a(a){if(!c){if(c=!0,d=a,a=l(a),void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}if(b=k,q(d,a))return b;var e=l(a);return void 0!==g&&g(b,e)?b:(d=a,k=e)}var d,k,c=!1,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]}),[b,e,l,g]);var d=r(a,c[0],c[1]);return u((function(){f.hasValue=!0,f.value=d}),[d]),w(d),d}},"./node_modules/use-sync-external-store/shim/index.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__("./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js")},"./node_modules/use-sync-external-store/shim/with-selector.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__("./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js")}}]); \ No newline at end of file diff --git a/docs/135.c0b7df5b.iframe.bundle.js b/docs/135.c0b7df5b.iframe.bundle.js new file mode 100644 index 00000000..6600b8a4 --- /dev/null +++ b/docs/135.c0b7df5b.iframe.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see 135.c0b7df5b.iframe.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[135],{"./node_modules/@react-three/drei/core/StatsGl.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{G:function(){return StatsGl}});var react=__webpack_require__("./node_modules/react/index.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js");const _Stats=class _Stats2{constructor({logsPerSecond:logsPerSecond=20,samplesLog:samplesLog=100,samplesGraph:samplesGraph=10,precision:precision=2,minimal:minimal=!1,horizontal:horizontal=!0,mode:mode=0}={}){this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.totalFps=0,this.activeQuery=null,this.gpuQueries=[],this.renderCount=0,this.mode=mode,this.horizontal=horizontal,this.dom=document.createElement("div"),this.dom.style.cssText="position:fixed;top:0;left:0;opacity:0.9;z-index:10000;",minimal&&(this.dom.style.cssText+="cursor:pointer"),this.gl=null,this.query=null,this.isRunningCPUProfiling=!1,this.minimal=minimal,this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.frames=0,this.renderCount=0,this.threeRendererPatched=!1,this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.queryCreated=!1,this.fpsPanel=this.addPanel(new _Stats2.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new _Stats2.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.gpuPanelCompute=null,this.samplesLog=samplesLog,this.samplesGraph=samplesGraph,this.precision=precision,this.logsPerSecond=logsPerSecond,this.minimal?(this.dom.addEventListener("click",(event=>{event.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)}),!1),this.mode=mode,this.showPanel(this.mode)):window.addEventListener("resize",(()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2),this.gpuPanelCompute&&this.resizePanel(this.gpuPanelCompute,3)}))}patchThreeRenderer(renderer){const originalRenderMethod=renderer.render,statsInstance=this;renderer.render=function(scene,camera){statsInstance.begin(),originalRenderMethod.call(this,scene,camera),statsInstance.end()},this.threeRendererPatched=!0}resizePanel(panel,offset){panel.canvas.style.position="absolute",this.minimal?panel.canvas.style.display="none":(panel.canvas.style.display="block",this.horizontal?(panel.canvas.style.top="0px",panel.canvas.style.left=offset*panel.WIDTH/panel.PR+"px"):(panel.canvas.style.left="0px",panel.canvas.style.top=offset*panel.HEIGHT/panel.PR+"px"))}addPanel(panel,offset){return panel.canvas&&(this.dom.appendChild(panel.canvas),this.resizePanel(panel,offset)),panel}showPanel(id){for(let i=0;i{if(this.gl){const available=this.gl.getQueryParameter(queryInfo.query,this.gl.QUERY_RESULT_AVAILABLE),disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(available&&!disjoint){const duration=1e-6*this.gl.getQueryParameter(queryInfo.query,this.gl.QUERY_RESULT);this.totalGpuDuration+=duration,this.gl.deleteQuery(queryInfo.query),this.gpuQueries.splice(index,1)}}})))}update(){void 0===this.info?this.processGpuQueries():(this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp,this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)),this.endProfiling("cpu-started","cpu-finished","cpu-duration"),this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu),this.renderCount=0,0===this.totalCpuDuration&&this.beginProfiling("cpu-started"),this.totalCpuDuration=0,this.totalFps=0,this.beginTime=this.endInternal()}endInternal(){this.frames++;const time=(performance||Date).now();if(time>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.gpuPanelCompute&&this.updatePanel(this.gpuPanelCompute,this.averageGpuCompute),this.prevCpuTime=time),time>=this.prevTime+1e3){const fps=1e3*this.frames/(time-this.prevTime);this.fpsPanel.update(fps,fps,100,100,0),this.prevTime=time,this.frames=0}return time}addToAverage(value,averageArray){averageArray.logs.push(value),averageArray.logs.length>this.samplesLog&&averageArray.logs.shift(),averageArray.graph.push(value),averageArray.graph.length>this.samplesGraph&&averageArray.graph.shift()}beginProfiling(marker){window.performance&&(window.performance.mark(marker),this.isRunningCPUProfiling=!0)}endProfiling(startMarker,endMarker,measureName){if(window.performance&&endMarker&&this.isRunningCPUProfiling){window.performance.mark(endMarker);const cpuMeasure=performance.measure(measureName,startMarker,endMarker);this.totalCpuDuration+=cpuMeasure.duration,this.isRunningCPUProfiling=!1}}updatePanel(panel,averageArray){if(averageArray.logs.length>0){let sumLog=0,max=.01;for(let i=0;imax&&(max=averageArray.logs[i]);let sumGraph=0,maxGraph=.01;for(let i=0;imaxGraph&&(maxGraph=averageArray.graph[i]);panel&&panel.update(sumLog/Math.min(averageArray.logs.length,this.samplesLog),sumGraph/Math.min(averageArray.graph.length,this.samplesGraph),max,maxGraph,this.precision)}}get domElement(){return this.dom}get container(){return console.warn("Stats: Deprecated! this.container as been replaced to this.dom "),this.dom}};_Stats.Panel=class Panel{constructor(name,fg,bg){this.name=name,this.fg=fg,this.bg=bg,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=90*this.PR,this.canvas.height=48*this.PR,this.canvas.style.width="90px",this.canvas.style.position="absolute",this.canvas.style.height="48px",this.canvas.style.cssText="width:90px;height:48px",this.context=this.canvas.getContext("2d"),this.context&&(this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(value,valueGraph,maxValue,maxGraph,decimals=0){let min=1/0,max=0;this.context&&(min=Math.min(min,value),max=Math.max(maxValue,value),maxGraph=Math.max(maxGraph,valueGraph),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(value.toFixed(decimals)+" "+this.name+" ("+min.toFixed(decimals)+"-"+parseFloat(max.toFixed(decimals))+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,(1-valueGraph/maxGraph)*this.GRAPH_HEIGHT))}};let Stats=_Stats;function StatsGl({className:className,parent:parent,...props}){const gl=(0,index_99983b2d_esm.A)((state=>state.gl)),stats=react.useMemo((()=>{const stats=new Stats({...props});return stats.init(gl),stats}),[gl]);return react.useEffect((()=>{if(stats){const node=parent&&parent.current||document.body;null==node||node.appendChild(stats.dom);const classNames=(null!=className?className:"").split(" ").filter((cls=>cls));classNames.length&&stats.dom.classList.add(...classNames);const end=(0,index_99983b2d_esm.o)((()=>stats.update()));return()=>{classNames.length&&stats.dom.classList.remove(...classNames),null==node||node.removeChild(stats.dom),end()}}}),[parent,stats,className]),null}},"./node_modules/eventemitter3/index.js":function(module){var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function addListener(emitter,event,fn,context,once){if("function"!=typeof fn)throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){0==--emitter._eventsCount?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function eventNames(){var events,name,names=[];if(0===this._eventsCount)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names},EventEmitter.prototype.listeners=function listeners(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i{let state;const listeners=new Set,setState=(partial,replace)=>{const nextState="function"==typeof partial?partial(state):partial;if(!Object.is(nextState,state)){const previousState=state;state=(null!=replace?replace:"object"!=typeof nextState)?nextState:Object.assign({},state,nextState),listeners.forEach((listener=>listener(state,previousState)))}},getState=()=>state,api={setState:setState,getState:getState,subscribe:listener=>(listeners.add(listener),()=>listeners.delete(listener)),destroy:()=>listeners.clear()};return state=createState(setState,getState,api),api};var with_selector=__webpack_require__("./node_modules/use-sync-external-store/shim/with-selector.js");const{useSyncExternalStoreWithSelector:useSyncExternalStoreWithSelector}=with_selector;const createImpl=createState=>{const api="function"==typeof createState?(createState=>createState?createStoreImpl(createState):createStoreImpl)(createState):createState,useBoundStore=(selector,equalityFn)=>function useStore(api,selector=api.getState,equalityFn){const slice=useSyncExternalStoreWithSelector(api.subscribe,api.getState,api.getServerState||api.getState,selector,equalityFn);return(0,react.useDebugValue)(slice),slice}(api,selector,equalityFn);return Object.assign(useBoundStore,api),useBoundStore};function shallow(objA,objB){if(Object.is(objA,objB))return!0;if("object"!=typeof objA||null===objA||"object"!=typeof objB||null===objB)return!1;if(objA instanceof Map&&objB instanceof Map){if(objA.size!==objB.size)return!1;for(const[key,value]of objA)if(!Object.is(value,objB.get(key)))return!1;return!0}if(objA instanceof Set&&objB instanceof Set){if(objA.size!==objB.size)return!1;for(const value of objA)if(!objB.has(value))return!1;return!0}const keysA=Object.keys(objA);if(keysA.length!==Object.keys(objB).length)return!1;for(let i=0;i({log:null,paused:!1,triggerProgramsUpdate:0,startTime:0,customData:0,fpsLimit:60,overclockingFps:!1,accumulated:{totalFrames:0,gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0},max:{gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0}}},chart:{data:{fps:[],cpu:[],gpu:[],mem:[]},circularId:0},gl:void 0,objectWithMaterials:null,scene:void 0,programs:new Map,sceneLength:void 0,tab:"infos",getReport:function getReport(){var _a;const{accumulated:accumulated,startTime:startTime,infos:infos}=get(),maxMemory=null==(_a=get().log)?void 0:_a.maxMemory,{totalFrames:totalFrames,log:log,gl:gl,max:max}=accumulated,glAverage={calls:gl.calls/totalFrames,triangles:gl.triangles/totalFrames,points:gl.points/totalFrames,lines:gl.lines/totalFrames},logAverage={gpu:log.gpu/totalFrames,cpu:log.cpu/totalFrames,mem:log.mem/totalFrames,fps:log.fps/totalFrames};return{sessionTime:(window.performance.now()-startTime)/1e3,infos:infos,log:logAverage,gl:glAverage,max:max,maxMemory:maxMemory,totalFrames:totalFrames}}}))?createImpl(createState):createImpl;var createState;const usePerf=sel=>usePerfImpl(sel,shallow);Object.assign(usePerf,usePerfImpl);const{getState:getPerf,setState:setPerf}=usePerfImpl,overLimitFps={value:0,fpsLimit:60,isOverLimit:0},average=arr=>(null==arr?void 0:arr.reduce(((a,b)=>a+b),0))/arr.length;class GLPerf{constructor(settings={}){this.names=[""],this.finished=[],this.paused=!1,this.overClock=!1,this.queryHasResult=!1,this.queryCreated=!1,this.isWebGL2=!0,this.memAccums=[],this.gpuAccums=[],this.activeAccums=[],this.logsAccums={mem:[],gpu:[],cpu:[],fps:[],fpsFixed:[]},this.fpsChart=[],this.gpuChart=[],this.cpuChart=[],this.memChart=[],this.paramLogger=()=>{},this.glFinish=()=>{},this.chartLogger=()=>{},this.chartLen=60,this.logsPerSecond=10,this.maxMemory=1500,this.chartHz=10,this.startCpuProfiling=!1,this.lastCalculateFixed=0,this.chartFrame=0,this.gpuTimeProcess=0,this.chartTime=0,this.activeQueries=0,this.circularId=0,this.detected=0,this.frameId=0,this.rafId=0,this.idleCbId=0,this.checkQueryId=0,this.uuid=void 0,this.currentCpu=0,this.currentMem=0,this.paramFrame=0,this.paramTime=0,this.now=()=>{},this.t0=0,window.GLPerf=window.GLPerf||{},Object.assign(this,settings),this.fpsChart=new Array(this.chartLen).fill(0),this.gpuChart=new Array(this.chartLen).fill(0),this.cpuChart=new Array(this.chartLen).fill(0),this.memChart=new Array(this.chartLen).fill(0),this.now=()=>window.performance&&window.performance.now?window.performance.now():Date.now(),this.initGpu(),this.is120hz()}initGpu(){this.uuid=three_module.MathUtils.generateUUID(),this.gl&&(this.isWebGL2=!0,this.extension||(this.extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")),null===this.extension&&(this.isWebGL2=!1))}is120hz(){let n=0;const loop=t=>{++n<20?this.rafId=window.requestAnimationFrame(loop):(this.detected=Math.ceil(1e3*n/(t-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=t)};this.rafId=window.requestAnimationFrame(loop)}addUI(name){-1===this.names.indexOf(name)&&(this.names.push(name),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(d){const goal=1e3/60,elapsed=goal-d.timeRemaining(),fps=goal*overLimitFps.fpsLimit/10/elapsed;fps<0||(overLimitFps.value=fps,overLimitFps.isOverLimit<25?overLimitFps.isOverLimit++:setPerf({overclockingFps:!0}))}nextFrame(now){this.frameId++;const t=now||this.now();let duration=t-this.paramTime,gpu=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=t;else if(t>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const frameCount=this.frameId-this.paramFrame,fpsFixed=1e3*frameCount/duration,fps=getPerf().overclockingFps?overLimitFps.value:fpsFixed;if(gpu=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/duration,this.isWebGL2?this.gpuAccums[0]=0:Promise.all(this.finished).then((()=>{this.gpuAccums[0]=0,this.finished=[]})),this.currentMem=Math.round(window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize/1048576:0),window.performance&&this.startCpuProfiling){window.performance.mark("cpu-finished");const cpuMeasure=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=cpuMeasure.duration,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(fpsFixed),this.logsAccums.fps.push(fps),this.logsAccums.gpu.push(gpu),this.overClock&&void 0!==window.requestIdleCallback&&(overLimitFps.isOverLimit>0&&fps>fpsFixed?overLimitFps.isOverLimit--:getPerf().overclockingFps&&setPerf({overclockingFps:!1})),t>=this.paramTime+1e3/this.logsPerSecond&&(this.paramLogger({cpu:average(this.logsAccums.cpu),gpu:average(this.logsAccums.gpu),mem:average(this.logsAccums.mem),fps:average(this.logsAccums.fps),duration:Math.round(duration),maxMemory:this.maxMemory,frameCount:frameCount}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=t),this.overClock&&t-this.lastCalculateFixed>=2e3&&(this.lastCalculateFixed=now,overLimitFps.fpsLimit=100*Math.round(average(this.logsAccums.fpsFixed)/10),setPerf({fpsLimit:overLimitFps.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=t)}if(this.detected&&this.chartFrame){const timespan=t-this.chartTime;let hz=this.chartHz*timespan/1e3;for(;--hz>0&&this.detected;){const fpsFixed=(this.frameId-this.chartFrame)/timespan*1e3,fps=getPerf().overclockingFps?overLimitFps.value:fpsFixed;this.fpsChart[this.circularId%this.chartLen]=fps;const memS=1e3/this.currentMem,cpuS=this.currentCpu,gpuS=(this.isWebGL2?2*this.gpuAccums[1]:Math.round(this.gpuAccums[1]/duration*100))+4;gpuS>0&&(this.gpuChart[this.circularId%this.chartLen]=gpuS),cpuS>0&&(this.cpuChart[this.circularId%this.chartLen]=cpuS),memS>0&&(this.memChart[this.circularId%this.chartLen]=memS);for(let i=0;i0&&(disjoint||this.activeAccums.forEach(((_active,i)=>{this.gpuAccums[i]=ms})))}}!available&&this.query||(this.queryCreated=!0,this.query=gl.createQuery(),gl.beginQuery(ext.TIME_ELAPSED_EXT,this.query))}}endGpu(){const ext=this.extension,gl=this.gl;this.isWebGL2&&this.queryCreated&&gl.getQuery(ext.TIME_ELAPSED_EXT,gl.CURRENT_QUERY)&&gl.endQuery(ext.TIME_ELAPSED_EXT)}begin(name){this.startGpu(),this.updateAccums(name)}end(name){this.endGpu(),this.updateAccums(name)}updateAccums(name){let nameId=this.names.indexOf(name);-1===nameId&&(nameId=this.names.length,this.addUI(name));const t=this.now();this.activeAccums[nameId]=!this.activeAccums[nameId],this.t0=t}}var eventemitter3=__webpack_require__("./node_modules/eventemitter3/index.js");const eventEmitter=new(__webpack_require__.n(eventemitter3)());const updateMatrixWorldTemp=three_module.Object3D.prototype.updateMatrixWorld,updateWorldMatrixTemp=three_module.Object3D.prototype.updateWorldMatrix,updateMatrixTemp=three_module.Object3D.prototype.updateMatrix,maxGl=["calls","triangles","points","lines"],maxLog=["gpu","cpu","mem","fps"];let matriceWorldCount={value:0},matriceCount={value:0};const addMuiPerfID=(material,currentObjectWithMaterials)=>{material.defines||(material.defines={}),material.defines&&!material.defines.muiPerf&&(material.defines=Object.assign(material.defines||{},{muiPerf:material.uuid}));const uuid=material.uuid;return currentObjectWithMaterials[uuid]||(currentObjectWithMaterials[uuid]={meshes:{},material:material},material.needsUpdate=!0),material.needsUpdate=!1,uuid},getMUIIndex=muid=>"muiPerf"===muid,PerfHeadless=({overClock:overClock,logsPerSecond:logsPerSecond,chart:chart,deepAnalyze:deepAnalyze,matrixUpdate:matrixUpdate})=>{const{gl:gl,scene:scene}=(0,index_99983b2d_esm.A)();setPerf({gl:gl,scene:scene});const PerfLib=(0,react.useMemo)((()=>{const PerfLib2=new GLPerf({trackGPU:!0,overClock:overClock,chartLen:chart?chart.length:120,chartHz:chart?chart.hz:60,logsPerSecond:logsPerSecond||10,gl:gl.getContext(),chartLogger:chart2=>{setPerf({chart:chart2})},paramLogger:logger=>{const log={maxMemory:logger.maxMemory,gpu:logger.gpu,cpu:logger.cpu,mem:logger.mem,fps:logger.fps,totalTime:logger.duration,frameCount:logger.frameCount};setPerf({log:log});const{accumulated:accumulated}=getPerf(),glRender=gl.info.render;accumulated.totalFrames++,accumulated.gl.calls+=glRender.calls,accumulated.gl.triangles+=glRender.triangles,accumulated.gl.points+=glRender.points,accumulated.gl.lines+=glRender.lines,accumulated.log.gpu+=logger.gpu,accumulated.log.cpu+=logger.cpu,accumulated.log.mem+=logger.mem,accumulated.log.fps+=logger.fps;for(let i=0;iaccumulated.max.gl[key]&&(accumulated.max.gl[key]=value)}for(let i=0;iaccumulated.max.log[key]&&(accumulated.max.log[key]=value)}setPerf({accumulated:accumulated}),function emitEvent(eventName,payload){eventEmitter.emit(eventName,payload)}("log",[log,gl])}}),ctx=gl.getContext();let glRenderer=null,glVendor=null;const rendererInfo=ctx.getExtension("WEBGL_debug_renderer_info"),glVersion=ctx.getParameter(ctx.VERSION);null!=rendererInfo&&(glRenderer=ctx.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL),glVendor=ctx.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL)),glVendor||(glVendor="Unknown vendor"),glRenderer||(glRenderer=ctx.getParameter(ctx.RENDERER)),setPerf({startTime:window.performance.now(),infos:{version:glVersion,renderer:glRenderer,vendor:glVendor}});const callbacks=new Map,callbacksAfter=new Map;return Object.defineProperty(three_module.Scene.prototype,"onBeforeRender",{get(){return(...args)=>{var _a;PerfLib2&&PerfLib2.begin("profiler"),null==(_a=callbacks.get(this))||_a(...args)}},set(callback){callbacks.set(this,callback)},configurable:!0}),Object.defineProperty(three_module.Scene.prototype,"onAfterRender",{get(){return(...args)=>{var _a;PerfLib2&&PerfLib2.end("profiler"),null==(_a=callbacksAfter.get(this))||_a(...args)}},set(callback){callbacksAfter.set(this,callback)},configurable:!0}),PerfLib2}),[]);return(0,react.useEffect)((()=>{PerfLib&&(PerfLib.overClock=overClock||!1,!1===overClock&&(setPerf({overclockingFps:!1}),overLimitFps.value=0,overLimitFps.isOverLimit=0),PerfLib.chartHz=(null==chart?void 0:chart.hz)||60,PerfLib.chartLen=(null==chart?void 0:chart.length)||120)}),[overClock,PerfLib,null==chart?void 0:chart.length,null==chart?void 0:chart.hz]),(0,react.useEffect)((()=>{matrixUpdate&&(three_module.Object3D.prototype.updateMatrixWorld=function(){(this.matrixWorldNeedsUpdate||arguments[0])&&matriceWorldCount.value++,updateMatrixWorldTemp.apply(this,arguments)},three_module.Object3D.prototype.updateWorldMatrix=function(){matriceWorldCount.value++,updateWorldMatrixTemp.apply(this,arguments)},three_module.Object3D.prototype.updateMatrix=function(){matriceCount.value++,updateMatrixTemp.apply(this,arguments)}),gl.info.autoReset=!1;let effectSub=null,afterEffectSub=null;if(gl.info)return effectSub=(0,index_99983b2d_esm.n)((function preRafR3FPerf(){getPerf().paused&&setPerf({paused:!1}),window.performance&&(window.performance.mark("cpu-started"),PerfLib.startCpuProfiling=!0),matriceCount.value-=1,matriceWorldCount.value=0,matriceCount.value=0,gl.info&&gl.info.reset()})),afterEffectSub=(0,index_99983b2d_esm.o)((function postRafR3FPerf(){var _a,_b;if(PerfLib&&!PerfLib.paused&&(PerfLib.nextFrame(window.performance.now()),overClock&&void 0!==window.requestIdleCallback&&(PerfLib.idleCbId=requestIdleCallback(PerfLib.nextFps))),deepAnalyze){const currentObjectWithMaterials={},programs=new Map;scene.traverse((function deepAnalyzeR3FPerf(object){if((object instanceof three_module.Mesh||object instanceof three_module.Points)&&object.material){let uuid=object.material.uuid;const isTroika=Array.isArray(object.material)&&object.material.length>1;uuid=addMuiPerfID(isTroika?object.material[1]:object.material,currentObjectWithMaterials),currentObjectWithMaterials[uuid].meshes[object.uuid]=object}})),null==(_b=null==(_a=null==gl?void 0:gl.info)?void 0:_a.programs)||_b.forEach((program=>{const cacheKeySplited=program.cacheKey.split(","),muiPerfTracker=cacheKeySplited[cacheKeySplited.findIndex(getMUIIndex)+1];if((uuid=>{let s=""+uuid;return s=s.match("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"),null!==s})(muiPerfTracker)&¤tObjectWithMaterials[muiPerfTracker]){const{material:material,meshes:meshes}=currentObjectWithMaterials[muiPerfTracker];programs.set(muiPerfTracker,{program:program,material:material,meshes:meshes,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}})),programs.size!==getPerf().programs.size&&((programs=>{programs.forEach(((program,_pkey)=>{const{meshes:meshes}=program;if(!meshes)return;let drawCounts2={total:0,type:"Triangle",data:[]};Object.keys(meshes).forEach((key=>{const mesh=meshes[key],{geometry:geometry,material:material}=mesh;let index=geometry.index;const position=geometry.attributes.position;if(!position)return;let rangeFactor=1;!0===material.wireframe&&(rangeFactor=0);const dataCount=null!==index?index.count:position.count,rangeStart=geometry.drawRange.start*rangeFactor,rangeCount=geometry.drawRange.count*rangeFactor,drawStart=rangeStart,drawEnd=Math.min(dataCount,rangeStart+rangeCount)-1;let countInstanceRatio=1;const instanceCount=mesh.count||1;let type="Triangle",mostDrawCalls=0;mesh.isMesh?!0===material.wireframe?(type="Line",countInstanceRatio/=2):(type="Triangle",countInstanceRatio/=3):mesh.isLine?(type="Line",mesh.isLineSegments?countInstanceRatio/=2:mesh.isLineLoop||(countInstanceRatio-=1)):mesh.isPoints?type="Point":mesh.isSprite&&(type="Triangle",countInstanceRatio/=3);const drawCount=Math.round(Math.max(0,drawEnd-drawStart+1)*(countInstanceRatio*instanceCount));drawCount>mostDrawCalls&&(mostDrawCalls=drawCount,drawCounts2.type=type),drawCounts2.total+=drawCount,drawCounts2.data.push({drawCount:drawCount,type:type}),mesh.userData.drawCount={type:type,count:drawCount}})),program.drawCounts=drawCounts2}))})(programs),setPerf({programs:programs,triggerProgramsUpdate:getPerf().triggerProgramsUpdate++}))}})),()=>{PerfLib&&(void 0!==window.cancelIdleCallback&&window.cancelIdleCallback(PerfLib.idleCbId),window.cancelAnimationFrame(PerfLib.rafId),window.cancelAnimationFrame(PerfLib.checkQueryId)),matrixUpdate&&(three_module.Object3D.prototype.updateMatrixWorld=updateMatrixTemp),effectSub(),afterEffectSub()}}),[PerfLib,gl,chart,matrixUpdate]),(0,react.useEffect)((()=>{const unsub=(0,index_99983b2d_esm.p)((function postRafTailR3FPerf(){return PerfLib&&(PerfLib.paused=!0,matriceCount.value=0,matriceWorldCount.value=0,setPerf({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1}));return()=>{unsub()}}),[]),null};var X,e="colors",t="sizes",r="space",n={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:e,backgroundColor:e,backgroundImage:e,borderImage:e,border:e,borderBlock:e,borderBlockEnd:e,borderBlockStart:e,borderBottom:e,borderBottomColor:e,borderColor:e,borderInline:e,borderInlineEnd:e,borderInlineStart:e,borderLeft:e,borderLeftColor:e,borderRight:e,borderRightColor:e,borderTop:e,borderTopColor:e,caretColor:e,color:e,columnRuleColor:e,fill:e,outline:e,outlineColor:e,stroke:e,textDecorationColor:e,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t,minBlockSize:t,maxBlockSize:t,inlineSize:t,minInlineSize:t,maxInlineSize:t,width:t,minWidth:t,maxWidth:t,height:t,minHeight:t,maxHeight:t,flexBasis:t,gridTemplateColumns:t,gridTemplateRows:t,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,o=()=>{const e=Object.create(null);return(t,r,...n)=>{const o=(e=>JSON.stringify(e,i))(t);return o in e?e[o]:e[o]=r(t,...n)}},l=Symbol.for("sxs.internal"),s=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),a=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:c}=Object.prototype,d=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),g=/\s+(?![^()]*\))/,p=e=>t=>e(..."string"==typeof t?String(t).split(g):[t]),u={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:p(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:p(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:p(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:p(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:p(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:p(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},h=/([\d.]+)([^]*)/,f=(e,t)=>e.length?e.reduce(((e,r)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(e)?`:is(${r})`:r):r+" "+e))),e)),[]):t,m=(e,t)=>e in b&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,r,n,i)=>r+("stretch"===n?`-moz-available${i};${d(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${d(e)}:${r}fit-content`)+i)):String(t),b={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S=e=>e?e+"-":"",k=(e,t,r)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((e,n,i,o,l)=>"$"==o==!!i?e:(n||"--"==o?"calc(":"")+"var(--"+("$"===o?S(t)+(l.includes("$")?"":S(r))+l.replace(/\$/g,"-"):l)+")"+(n||"--"==o?"*"+(n||"")+(i||"1")+")":""))),y=/\s*,\s*(?![^()]*\))/,B=Object.prototype.toString,$=(e,t,r,n,i)=>{let o,l,s;const a=(e,t,r)=>{let c,g;const p=e=>{for(c in e){const R=64===c.charCodeAt(0),z=R&&Array.isArray(e[c])?e[c]:[e[c]];for(g of z){const e=/[A-Z]/.test($=c)?$:$.replace(/-[^]/g,(e=>e[1].toUpperCase())),z="object"==typeof g&&g&&g.toString===B&&(!n.utils[e]||!t.length);if(e in n.utils&&!z){const t=n.utils[e];if(t!==l){l=t,p(t(g)),l=null;continue}}else if(e in u){const t=u[e];if(t!==s){s=t,p(t(g)),s=null;continue}}if(R&&(b=c.slice(1)in n.media?"@media "+n.media[c.slice(1)]:c,c=b.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,r,n,i,o)=>{const l=h.test(t),s=.0625*(l?-1:1),[a,c]=l?[n,t]:[t,n];return"("+("="===r[0]?"":">"===r[0]===l?"max-":"min-")+a+":"+("="!==r[0]&&1===r.length?c.replace(h,((e,t,n)=>Number(t)+s*(">"===r?1:-1)+n)):c)+(i?") and ("+(">"===i[0]?"min-":"max-")+a+":"+(1===i.length?o.replace(h,((e,t,r)=>Number(t)+s*(">"===i?-1:1)+r)):o):"")+")"}))),z){const e=R?r.concat(c):[...r],n=R?[...t]:f(t,c.split(y));void 0!==o&&i(x(...o)),o=void 0,a(g,n,e)}else void 0===o&&(o=[[],t,r]),c=R||36!==c.charCodeAt(0)?c:`--${S(n.prefix)}${c.slice(1).replace(/\$/g,"-")}`,g=z?g:"number"==typeof g?g&&e in I?String(g)+"px":String(g):k(m(e,null==g?"":g),n.prefix,n.themeMap[e]),o[0].push(`${R?`${c} `:`${d(c)}:`}${g}`)}}var b,$};p(e),void 0!==o&&i(x(...o)),o=void 0};a(e,t,r)},x=(e,t,r)=>`${r.map((e=>`${e}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(r.length?r.length+1:0).join("}")}`,I={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R=e=>String.fromCharCode(e+(e>25?39:97)),z=e=>(e=>{let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=R(t%52)+r;return R(t%52)+r})(((e,t)=>{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e})(5381,JSON.stringify(e))>>>0),W=["themed","global","styled","onevar","resonevar","allvar","inline"],j=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(e){return!1}},E=e=>{let t;const r=()=>{const{cssRules:e}=t.sheet;return[].map.call(e,((r,n)=>{const{cssText:i}=r;let o="";if(i.startsWith("--sxs"))return"";if(e[n-1]&&(o=e[n-1].cssText).startsWith("--sxs")){if(!r.cssRules.length)return"";for(const e in t.rules)if(t.rules[e].group===r)return`--sxs{--sxs:${[...t.rules[e].cache].join(" ")}}${i}`;return r.cssRules.length?`${o}${i}`:""}return i})).join("")},n=()=>{if(t){const{rules:e,sheet:r}=t;if(!r.deleteRule){for(;3===Object(Object(r.cssRules)[0]).type;)r.cssRules.splice(0,1);r.cssRules=[]}for(const t in e)delete e[t]}const i=Object(e).styleSheets||[];for(const e of i)if(j(e)){for(let i=0,o=e.cssRules;o[i];++i){const l=Object(o[i]);if(1!==l.type)continue;const s=Object(o[i+1]);if(4!==s.type)continue;++i;const{cssText:a}=l;if(!a.startsWith("--sxs"))continue;const c=a.slice(14,-3).trim().split(/\s+/),d=W[c[0]];d&&(t||(t={sheet:e,reset:n,rules:{},toString:r}),t.rules[d]={group:s,index:i,cache:new Set(c)})}if(t)break}if(!t){const i=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,i(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,(e=>e.cssText)).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:i("","text/css"),rules:{},reset:n,toString:r}}const{sheet:o,rules:l}=t;for(let e=W.length-1;e>=0;--e){const t=W[e];if(!l[t]){const r=W[e+1],n=l[r]?l[r].index:o.cssRules.length;o.insertRule("@media{}",n),o.insertRule(`--sxs{--sxs:${e}}`,n),l[t]={group:o.cssRules[n+1],index:n,cache:new Set([e])}}v(l[t])}};return n(),t},v=e=>{const t=e.group;let r=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,r),++r}catch(e){}}},T=Symbol(),w=o(),M=(e,t)=>w(e,(()=>(...r)=>{let n={type:null,composers:new Set};for(const t of r)if(null!=t)if(t[l]){null==n.type&&(n.type=t[l].type);for(const e of t[l].composers)n.composers.add(e)}else t.constructor!==Object||t.$$typeof?null==n.type&&(n.type=t):n.composers.add(C(t,e));return null==n.type&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),P(e,n,t)})),C=({variants:e,compoundVariants:t,defaultVariants:r,...n},i)=>{const o=`${S(i.prefix)}c-${z(n)}`,l=[],s=[],d=Object.create(null),g=[];for(const e in r)d[e]=String(r[e]);if("object"==typeof e&&e)for(const t in e){p=d,u=t,c.call(p,u)||(d[t]="undefined");const r=e[t];for(const e in r){const n={[t]:String(e)};"undefined"===String(e)&&g.push(t);const i=r[e],o=[n,i,!a(i)];l.push(o)}}var p,u;if("object"==typeof t&&t)for(const e of t){let{css:t,...r}=e;t="object"==typeof t&&t||{};for(const e in r)r[e]=String(r[e]);const n=[r,t,!a(t)];s.push(n)}return[o,n,l,s,d,g]},P=(e,t,r)=>{const[n,i,o,a]=L(t.composers),c="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let r=0;rt.rules[e]={apply:r=>t[T].push([e,r])})),t})(r):null,d=(c||r).rules,g=`.${n}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,p=l=>{l="object"==typeof l&&l||A;const{css:s,...p}=l,u={};for(const e in o)if(delete p[e],e in l){let t=l[e];"object"==typeof t&&t?u[e]={"@initial":o[e],...t}:(t=String(t),u[e]="undefined"!==t||a.has(e)?t:o[e])}else u[e]=o[e];const h=new Set([...i]);for(const[n,i,o,l]of t.composers){r.rules.styled.cache.has(n)||(r.rules.styled.cache.add(n),$(i,[`.${n}`],[],e,(e=>{d.styled.apply(e)})));const t=O(o,u,e.media),s=O(l,u,e.media,!0);for(const i of t)if(void 0!==i)for(const[t,o,l]of i){const i=`${n}-${z(o)}-${t}`;h.add(i);const s=(l?r.rules.resonevar:r.rules.onevar).cache,a=l?d.resonevar:d.onevar;s.has(i)||(s.add(i),$(o,[`.${i}`],[],e,(e=>{a.apply(e)})))}for(const t of s)if(void 0!==t)for(const[i,o]of t){const t=`${n}-${z(o)}-${i}`;h.add(t),r.rules.allvar.cache.has(t)||(r.rules.allvar.cache.add(t),$(o,[`.${t}`],[],e,(e=>{d.allvar.apply(e)})))}}if("object"==typeof s&&s){const t=`${n}-i${z(s)}-css`;h.add(t),r.rules.inline.cache.has(t)||(r.rules.inline.cache.add(t),$(s,[`.${t}`],[],e,(e=>{d.inline.apply(e)})))}for(const e of String(l.className||"").trim().split(/\s+/))e&&h.add(e);const f=p.className=[...h].join(" ");return{type:t.type,className:f,selector:g,props:p,toString:()=>f,deferredInjector:c}};return s(p,{className:n,selector:g,[l]:t,toString:()=>(r.rules.styled.cache.has(n)||p(),n)})},L=e=>{let t="";const r=[],n={},i=[];for(const[o,,,,l,s]of e){""===t&&(t=o),r.push(o),i.push(...s);for(const e in l){const t=l[e];(void 0===n[e]||"undefined"!==t||s.includes(t))&&(n[e]=t)}}return[t,r,n,new Set(i)]},O=(e,t,r,n)=>{const i=[];e:for(let[o,l,s]of e){if(s)continue;let e,a=0,c=!1;for(e in o){const n=o[e];let i=t[e];if(i!==n){if("object"!=typeof i||!i)continue e;{let e,t,o=0;for(const l in i){if(n===String(i[l])){if("@initial"!==l){const e=l.slice(1);(t=t||[]).push(e in r?r[e]:l.replace(/^@media ?/,"")),c=!0}a+=o,e=!0}++o}if(t&&t.length&&(l={["@media "+t.join(", ")]:l}),!e)continue e}}}(i[a]=i[a]||[]).push([n?"cv":`${e}-${o[e]}`,l,c])}return i},A={},N=o(),D=(e,t)=>N(e,(()=>(...r)=>{const n=()=>{for(let n of r){n="object"==typeof n&&n||{};let r=z(n);if(!t.rules.global.cache.has(r)){if(t.rules.global.cache.add(r),"@import"in n){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let r of[].concat(n["@import"]))r=r.includes('"')||r.includes("'")?r:`"${r}"`,t.sheet.insertRule(`@import ${r};`,e++);delete n["@import"]}$(n,[],[],e,(e=>{t.rules.global.apply(e)}))}}return""};return s(n,{toString:n})})),H=o(),V=(e,t)=>H(e,(()=>r=>{const n=`${S(e.prefix)}k-${z(r)}`,i=()=>{if(!t.rules.global.cache.has(n)){t.rules.global.cache.add(n);const i=[];$(r,[],[],e,(e=>i.push(e)));const o=`@keyframes ${n}{${i.join("")}}`;t.rules.global.apply(o)}return n};return s(i,{get name(){return i()},toString:i})})),G=class{constructor(e,t,r,n){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==r?"":String(r),this.prefix=null==n?"":String(n)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S(this.prefix)+S(this.scale)+this.token}toString(){return this.computedValue}},F=o(),J=(e,t)=>F(e,(()=>(r,n)=>{n="object"==typeof r&&r||Object(n);const i=`.${r=(r="string"==typeof r?r:"")||`${S(e.prefix)}t-${z(n)}`}`,o={},l=[];for(const t in n){o[t]={};for(const r in n[t]){const i=`--${S(e.prefix)}${t}-${r}`,s=k(String(n[t][r]),e.prefix,t);o[t][r]=new G(r,s,t,e.prefix),l.push(`${i}:${s}`)}}const s=()=>{if(l.length&&!t.rules.themed.cache.has(r)){t.rules.themed.cache.add(r);const i=`${n===e.theme?":root,":""}.${r}{${l.join(";")}}`;t.rules.themed.apply(i)}return r};return{...o,get className(){return s()},selector:i,toString:s}})),U=o(),Y=o(),K=()=>X||(X=(e=>{const t=(e=>{let t=!1;const r=U(e,(e=>{t=!0;const r="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",i="object"==typeof e.media&&e.media||{},o="object"==typeof e.root?e.root||null:globalThis.document||null,l="object"==typeof e.theme&&e.theme||{},s={prefix:r,media:i,theme:l,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...n},utils:"object"==typeof e.utils&&e.utils||{}},a=E(o),c={css:M(s,a),globalCss:D(s,a),keyframes:V(s,a),createTheme:J(s,a),reset(){a.reset(),c.theme.toString()},theme:{},sheet:a,config:s,prefix:r,getCssText:a.toString,toString:a.toString};return String(c.theme=c.createTheme(l)),c}));return t||r.reset(),r})(e);return t.styled=(({config:e,sheet:t})=>Y(e,(()=>{const r=M(e,t);return(...e)=>{const t=r(...e),n=t[l].type,i=react.forwardRef(((e,r)=>{const i=e&&e.as||n,{props:o,deferredInjector:l}=t(e);return delete o.as,o.ref=r,l?react.createElement(react.Fragment,null,react.createElement(i,o),react.createElement(l,null)):react.createElement(i,o)}));return i.className=t.className,i.displayName=`Styled.${n.displayName||n.name||n}`,i.selector=t.selector,i.toString=()=>t.selector,i[l]=t[l],i}})))(t),t})()),re=(...e)=>K().styled(...e);const PerfS=re("div",{position:"fixed",top:0,right:0,zIndex:9999,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif",backgroundColor:"rgba(36, 36, 36, .9)",color:"#fff",margin:0,minHeight:"100px",padding:"4px 0","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale",userSelect:"none","&.top-left":{right:"initial",left:0},"&.bottom-left":{right:"initial",top:"initial",bottom:0,left:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.bottom-right":{top:"initial",bottom:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.minimal":{backgroundColor:"rgba(36, 36, 36, .75)"},"*":{margin:"0",padding:"0",border:"0",fontSize:"100%",lineHeight:"1",verticalAlign:"baseline"}}),PerfSmallI=re("small",{position:"absolute",right:0,fontSize:"10px"}),PerfI=re("div",{display:"inline-flex",fontStyle:"normal",padding:0,lineHeight:"13px",fontSize:"14px",width:"62px",position:"relative",pointerEvents:"auto",cursor:"default",fontWeight:500,letterSpacing:"0px",textAlign:"left",height:"29px",whiteSpace:"nowrap",justifyContent:"space-evenly",fontVariantNumeric:"tabular-nums",small:{paddingLeft:"12px"},svg:{padding:0,color:"rgba(145, 145, 145, 0.3)",fontSize:"40px",position:"absolute",zIndex:1,maxHeight:"20px",left:" 50%",marginLeft:"-23px",top:"4px"}}),PerfB=re("span",{verticalAlign:"bottom",position:"absolute",bottom:"5px",color:"rgba(101, 197, 188, 1)",textAlign:"right",letterSpacing:"1px",fontSize:"8px",fontWeight:"500",width:"60px"}),PerfIContainer=re("div",{display:"flex"}),ProgramHeader=re("div",{backgroundColor:"#404040",padding:"6px",display:"block",fontSize:"12px",marginBottom:"6px",cursor:"pointer","*":{cursor:"pointer !important"},"> span":{},small:{fontSize:"9px"},"> b":{marginRight:"4px",cursor:"pointer"}}),Graph=re("div",{height:"66px",overflow:"hidden",position:"absolute",pointerEvents:"none",display:"flex",top:"0px",justifyContent:"center",width:"100%",minWidth:"310px",margin:"0 auto",canvas:{background:"transparent !important",position:"absolute !important"}}),Graphpc=re("div",{textAlign:"center",fontWeight:700,fontSize:"12px",lineHeight:"12px",display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"middle",color:"#f1f1f1",padding:"7px",width:"100%",backgroundColor:"rgba(36, 36, 37, 0.8)",zIndex:1,position:"absolute",height:"100%"}),Toggle=re("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),ToggleVisible=re("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",float:"right",backgroundColor:"rgb(41, 43, 45)",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),ProgramGeo=re("div",{padding:"4px 6px",fontSize:"12px",pointerEvents:"auto"}),ProgramTitle=re("span",{fontWeight:"bold",letterSpacing:"0.08em",maxWidth:"145px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"middle",fontSize:"11px",marginRight:"10px"}),ContainerScroll=re("div",{maxHeight:"50vh",overflowY:"auto",marginTop:"38px"}),ProgramsContainer=re("div",{marginTop:"0"}),ProgramsULHeader=re("div",{display:"flex",position:"relative",fontWeight:"bold",color:"#fff",lineHeight:"14px",svg:{marginRight:"4px",display:"inline-block"}}),ProgramsUL=re("ul",{display:"block",position:"relative",paddingLeft:"10px",margin:"6px 6px",img:{maxHeight:"60px",maxWidth:"100%",margin:"6px auto",display:"block"},"&:after":{content:"",position:"absolute",left:"0px",top:"0px",width:"1px",height:"100%",backgroundColor:"grey",transform:"translateX(-50%)",maxHeight:"50vh",overflowY:"auto"},li:{borderBottom:"1px solid #313131",display:"block",padding:"4px",margin:0,lineHeight:1,verticalAlign:"middle",height:"24px"},b:{fontWeight:"bold"},small:{textAlign:"revert",letterSpacing:"1px",fontSize:"10px",fontWeight:"500",marginLeft:"2px",color:"rgb(101, 197, 188)"}}),ProgramConsole=re("button",{fontWeight:"bold",letterSpacing:"0.02em",backgroundColor:"rgb(41, 43, 45)",color:"rgb(211, 211, 211)",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"block",verticalAlign:"middle",fontSize:"11px",padding:"5px",margin:"4px auto"}),ToggleContainer=re("div",{display:"flex",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0 auto",color:"rgba(145, 145, 145, 1)",textAlign:"center",position:"absolute",right:0,bottom:" -20px",svg:{width:"12px",height:"12px",float:"left"}}),ProgramsGeoLi=re("li",{display:"flex !important",height:"auto !important",span:{height:"40px",display:"block",position:"relative"},b:{paddingLeft:"12px"}});function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}var _excluded$1=["color"],ActivityLogIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M0 1.5C0 1.22386 0.223858 1 0.5 1H2.5C2.77614 1 3 1.22386 3 1.5C3 1.77614 2.77614 2 2.5 2H0.5C0.223858 2 0 1.77614 0 1.5ZM4 1.5C4 1.22386 4.22386 1 4.5 1H14.5C14.7761 1 15 1.22386 15 1.5C15 1.77614 14.7761 2 14.5 2H4.5C4.22386 2 4 1.77614 4 1.5ZM4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5C12 4.77614 11.7761 5 11.5 5H4.5C4.22386 5 4 4.77614 4 4.5ZM0 7.5C0 7.22386 0.223858 7 0.5 7H2.5C2.77614 7 3 7.22386 3 7.5C3 7.77614 2.77614 8 2.5 8H0.5C0.223858 8 0 7.77614 0 7.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H4.5C4.22386 11 4 10.7761 4 10.5ZM0 13.5C0 13.2239 0.223858 13 0.5 13H2.5C2.77614 13 3 13.2239 3 13.5C3 13.7761 2.77614 14 2.5 14H0.5C0.223858 14 0 13.7761 0 13.5ZM4 13.5C4 13.2239 4.22386 13 4.5 13H14.5C14.7761 13 15 13.2239 15 13.5C15 13.7761 14.7761 14 14.5 14H4.5C4.22386 14 4 13.7761 4 13.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$o=["color"],BarChartIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$o);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$H=["color"],ButtonIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2 5H13C13.5523 5 14 5.44772 14 6V9C14 9.55228 13.5523 10 13 10H2C1.44772 10 1 9.55228 1 9V6C1 5.44772 1.44772 5 2 5ZM0 6C0 4.89543 0.895431 4 2 4H13C14.1046 4 15 4.89543 15 6V9C15 10.1046 14.1046 11 13 11H2C0.89543 11 0 10.1046 0 9V6ZM4.5 6.75C4.08579 6.75 3.75 7.08579 3.75 7.5C3.75 7.91421 4.08579 8.25 4.5 8.25C4.91421 8.25 5.25 7.91421 5.25 7.5C5.25 7.08579 4.91421 6.75 4.5 6.75ZM6.75 7.5C6.75 7.08579 7.08579 6.75 7.5 6.75C7.91421 6.75 8.25 7.08579 8.25 7.5C8.25 7.91421 7.91421 8.25 7.5 8.25C7.08579 8.25 6.75 7.91421 6.75 7.5ZM10.5 6.75C10.0858 6.75 9.75 7.08579 9.75 7.5C9.75 7.91421 10.0858 8.25 10.5 8.25C10.9142 8.25 11.25 7.91421 11.25 7.5C11.25 7.08579 10.9142 6.75 10.5 6.75Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$1w=["color"],CubeIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1w);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.28856 0.796908C7.42258 0.734364 7.57742 0.734364 7.71144 0.796908L13.7114 3.59691C13.8875 3.67906 14 3.85574 14 4.05V10.95C14 11.1443 13.8875 11.3209 13.7114 11.4031L7.71144 14.2031C7.57742 14.2656 7.42258 14.2656 7.28856 14.2031L1.28856 11.4031C1.11252 11.3209 1 11.1443 1 10.95V4.05C1 3.85574 1.11252 3.67906 1.28856 3.59691L7.28856 0.796908ZM2 4.80578L7 6.93078V12.9649L2 10.6316V4.80578ZM8 12.9649L13 10.6316V4.80578L8 6.93078V12.9649ZM7.5 6.05672L12.2719 4.02866L7.5 1.80176L2.72809 4.02866L7.5 6.05672Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$1H=["color"],DotIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.5 9.125C8.39746 9.125 9.125 8.39746 9.125 7.5C9.125 6.60254 8.39746 5.875 7.5 5.875C6.60254 5.875 5.875 6.60254 5.875 7.5C5.875 8.39746 6.60254 9.125 7.5 9.125ZM7.5 10.125C8.94975 10.125 10.125 8.94975 10.125 7.5C10.125 6.05025 8.94975 4.875 7.5 4.875C6.05025 4.875 4.875 6.05025 4.875 7.5C4.875 8.94975 6.05025 10.125 7.5 10.125Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$1W=["color"],DropdownMenuIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$1W);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.49999 3.09998C7.27907 3.09998 7.09999 3.27906 7.09999 3.49998C7.09999 3.72089 7.27907 3.89998 7.49999 3.89998H14.5C14.7209 3.89998 14.9 3.72089 14.9 3.49998C14.9 3.27906 14.7209 3.09998 14.5 3.09998H7.49999ZM7.49998 5.1C7.27907 5.1 7.09998 5.27908 7.09998 5.5C7.09998 5.72091 7.27907 5.9 7.49998 5.9H14.5C14.7209 5.9 14.9 5.72091 14.9 5.5C14.9 5.27908 14.7209 5.1 14.5 5.1H7.49998ZM7.1 7.5C7.1 7.27908 7.27909 7.1 7.5 7.1H14.5C14.7209 7.1 14.9 7.27908 14.9 7.5C14.9 7.72091 14.7209 7.9 14.5 7.9H7.5C7.27909 7.9 7.1 7.72091 7.1 7.5ZM7.49998 9.1C7.27907 9.1 7.09998 9.27908 7.09998 9.5C7.09998 9.72091 7.27907 9.9 7.49998 9.9H14.5C14.7209 9.9 14.9 9.72091 14.9 9.5C14.9 9.27908 14.7209 9.1 14.5 9.1H7.49998ZM7.09998 11.5C7.09998 11.2791 7.27907 11.1 7.49998 11.1H14.5C14.7209 11.1 14.9 11.2791 14.9 11.5C14.9 11.7209 14.7209 11.9 14.5 11.9H7.49998C7.27907 11.9 7.09998 11.7209 7.09998 11.5ZM2.5 9.25003L5 6.00003H0L2.5 9.25003Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$25=["color"],EyeNoneIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$25);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$26=["color"],EyeOpenIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$26);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2C=["color"],ImageIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2C);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2H=["color"],LapTimerIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L12.058 2.05806C12.3021 1.81398 12.6978 1.81398 12.9419 2.05806C13.186 2.30214 13.186 2.69786 12.9419 2.94194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13361 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.49998 8.49998V4.09998C5.06992 4.09998 3.09998 6.06992 3.09998 8.49998C3.09998 10.93 5.06992 12.9 7.49998 12.9C8.715 12.9 9.815 12.4075 10.6112 11.6112L7.49998 8.49998Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2J=["color"],LayersIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2J);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.75432 0.819537C7.59742 0.726821 7.4025 0.726821 7.24559 0.819537L1.74559 4.06954C1.59336 4.15949 1.49996 4.32317 1.49996 4.5C1.49996 4.67683 1.59336 4.84051 1.74559 4.93046L7.24559 8.18046C7.4025 8.27318 7.59742 8.27318 7.75432 8.18046L13.2543 4.93046C13.4066 4.84051 13.5 4.67683 13.5 4.5C13.5 4.32317 13.4066 4.15949 13.2543 4.06954L7.75432 0.819537ZM7.49996 7.16923L2.9828 4.5L7.49996 1.83077L12.0171 4.5L7.49996 7.16923ZM1.5695 7.49564C1.70998 7.2579 2.01659 7.17906 2.25432 7.31954L7.49996 10.4192L12.7456 7.31954C12.9833 7.17906 13.2899 7.2579 13.4304 7.49564C13.5709 7.73337 13.4921 8.03998 13.2543 8.18046L7.75432 11.4305C7.59742 11.5232 7.4025 11.5232 7.24559 11.4305L1.74559 8.18046C1.50786 8.03998 1.42901 7.73337 1.5695 7.49564ZM1.56949 10.4956C1.70998 10.2579 2.01658 10.1791 2.25432 10.3195L7.49996 13.4192L12.7456 10.3195C12.9833 10.1791 13.2899 10.2579 13.4304 10.4956C13.5709 10.7334 13.4921 11.04 13.2543 11.1805L7.75432 14.4305C7.59742 14.5232 7.4025 14.5232 7.24559 14.4305L1.74559 11.1805C1.50785 11.04 1.42901 10.7334 1.56949 10.4956Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$2Q=["color"],LightningBoltIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$2Q);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M8.69667 0.0403541C8.90859 0.131038 9.03106 0.354857 8.99316 0.582235L8.0902 6.00001H12.5C12.6893 6.00001 12.8625 6.10701 12.9472 6.27641C13.0319 6.4458 13.0136 6.6485 12.8999 6.80001L6.89997 14.8C6.76167 14.9844 6.51521 15.0503 6.30328 14.9597C6.09135 14.869 5.96888 14.6452 6.00678 14.4178L6.90974 9H2.49999C2.31061 9 2.13748 8.893 2.05278 8.72361C1.96809 8.55422 1.98636 8.35151 2.09999 8.2L8.09997 0.200038C8.23828 0.0156255 8.48474 -0.0503301 8.69667 0.0403541ZM3.49999 8.00001H7.49997C7.64695 8.00001 7.78648 8.06467 7.88148 8.17682C7.97648 8.28896 8.01733 8.43723 7.99317 8.5822L7.33027 12.5596L11.5 7.00001H7.49997C7.353 7.00001 7.21347 6.93534 7.11846 6.8232C7.02346 6.71105 6.98261 6.56279 7.00678 6.41781L7.66968 2.44042L3.49999 8.00001Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$34=["color"],MarginIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$34);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M1.49988 2.00012C1.77602 2.00012 1.99988 1.77626 1.99988 1.50012C1.99988 1.22398 1.77602 1.00012 1.49988 1.00012C1.22374 1.00012 0.999878 1.22398 0.999878 1.50012C0.999878 1.77626 1.22374 2.00012 1.49988 2.00012ZM4.49988 2.00012C4.77602 2.00012 4.99988 1.77626 4.99988 1.50012C4.99988 1.22398 4.77602 1.00012 4.49988 1.00012C4.22374 1.00012 3.99988 1.22398 3.99988 1.50012C3.99988 1.77626 4.22374 2.00012 4.49988 2.00012ZM7.99988 1.50012C7.99988 1.77626 7.77602 2.00012 7.49988 2.00012C7.22374 2.00012 6.99988 1.77626 6.99988 1.50012C6.99988 1.22398 7.22374 1.00012 7.49988 1.00012C7.77602 1.00012 7.99988 1.22398 7.99988 1.50012ZM10.4999 2.00012C10.776 2.00012 10.9999 1.77626 10.9999 1.50012C10.9999 1.22398 10.776 1.00012 10.4999 1.00012C10.2237 1.00012 9.99988 1.22398 9.99988 1.50012C9.99988 1.77626 10.2237 2.00012 10.4999 2.00012ZM13.9999 1.50012C13.9999 1.77626 13.776 2.00012 13.4999 2.00012C13.2237 2.00012 12.9999 1.77626 12.9999 1.50012C12.9999 1.22398 13.2237 1.00012 13.4999 1.00012C13.776 1.00012 13.9999 1.22398 13.9999 1.50012ZM1.49988 14.0001C1.77602 14.0001 1.99988 13.7763 1.99988 13.5001C1.99988 13.224 1.77602 13.0001 1.49988 13.0001C1.22374 13.0001 0.999878 13.224 0.999878 13.5001C0.999878 13.7763 1.22374 14.0001 1.49988 14.0001ZM1.99988 10.5001C1.99988 10.7763 1.77602 11.0001 1.49988 11.0001C1.22374 11.0001 0.999878 10.7763 0.999878 10.5001C0.999878 10.224 1.22374 10.0001 1.49988 10.0001C1.77602 10.0001 1.99988 10.224 1.99988 10.5001ZM1.49988 8.00012C1.77602 8.00012 1.99988 7.77626 1.99988 7.50012C1.99988 7.22398 1.77602 7.00012 1.49988 7.00012C1.22374 7.00012 0.999878 7.22398 0.999878 7.50012C0.999878 7.77626 1.22374 8.00012 1.49988 8.00012ZM1.99988 4.50012C1.99988 4.77626 1.77602 5.00012 1.49988 5.00012C1.22374 5.00012 0.999878 4.77626 0.999878 4.50012C0.999878 4.22398 1.22374 4.00012 1.49988 4.00012C1.77602 4.00012 1.99988 4.22398 1.99988 4.50012ZM13.4999 11.0001C13.776 11.0001 13.9999 10.7763 13.9999 10.5001C13.9999 10.224 13.776 10.0001 13.4999 10.0001C13.2237 10.0001 12.9999 10.224 12.9999 10.5001C12.9999 10.7763 13.2237 11.0001 13.4999 11.0001ZM13.9999 7.50012C13.9999 7.77626 13.776 8.00012 13.4999 8.00012C13.2237 8.00012 12.9999 7.77626 12.9999 7.50012C12.9999 7.22398 13.2237 7.00012 13.4999 7.00012C13.776 7.00012 13.9999 7.22398 13.9999 7.50012ZM13.4999 5.00012C13.776 5.00012 13.9999 4.77626 13.9999 4.50012C13.9999 4.22398 13.776 4.00012 13.4999 4.00012C13.2237 4.00012 12.9999 4.22398 12.9999 4.50012C12.9999 4.77626 13.2237 5.00012 13.4999 5.00012ZM4.99988 13.5001C4.99988 13.7763 4.77602 14.0001 4.49988 14.0001C4.22374 14.0001 3.99988 13.7763 3.99988 13.5001C3.99988 13.224 4.22374 13.0001 4.49988 13.0001C4.77602 13.0001 4.99988 13.224 4.99988 13.5001ZM7.49988 14.0001C7.77602 14.0001 7.99988 13.7763 7.99988 13.5001C7.99988 13.224 7.77602 13.0001 7.49988 13.0001C7.22374 13.0001 6.99988 13.224 6.99988 13.5001C6.99988 13.7763 7.22374 14.0001 7.49988 14.0001ZM10.9999 13.5001C10.9999 13.7763 10.776 14.0001 10.4999 14.0001C10.2237 14.0001 9.99988 13.7763 9.99988 13.5001C9.99988 13.224 10.2237 13.0001 10.4999 13.0001C10.776 13.0001 10.9999 13.224 10.9999 13.5001ZM13.4999 14.0001C13.776 14.0001 13.9999 13.7763 13.9999 13.5001C13.9999 13.224 13.776 13.0001 13.4999 13.0001C13.2237 13.0001 12.9999 13.224 12.9999 13.5001C12.9999 13.7763 13.2237 14.0001 13.4999 14.0001ZM3.99988 5.00012C3.99988 4.44784 4.44759 4.00012 4.99988 4.00012H9.99988C10.5522 4.00012 10.9999 4.44784 10.9999 5.00012V10.0001C10.9999 10.5524 10.5522 11.0001 9.99988 11.0001H4.99988C4.44759 11.0001 3.99988 10.5524 3.99988 10.0001V5.00012ZM4.99988 5.00012H9.99988V10.0001H4.99988V5.00012Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$37=["color"],MinusIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$37);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$3m=["color"],PauseIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$3m);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M6.04995 2.74998C6.04995 2.44623 5.80371 2.19998 5.49995 2.19998C5.19619 2.19998 4.94995 2.44623 4.94995 2.74998V12.25C4.94995 12.5537 5.19619 12.8 5.49995 12.8C5.80371 12.8 6.04995 12.5537 6.04995 12.25V2.74998ZM10.05 2.74998C10.05 2.44623 9.80371 2.19998 9.49995 2.19998C9.19619 2.19998 8.94995 2.44623 8.94995 2.74998V12.25C8.94995 12.5537 9.19619 12.8 9.49995 12.8C9.80371 12.8 10.05 12.5537 10.05 12.25V2.74998Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$3H=["color"],RocketIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$3H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M6.85357 3.85355L7.65355 3.05353C8.2981 2.40901 9.42858 1.96172 10.552 1.80125C11.1056 1.72217 11.6291 1.71725 12.0564 1.78124C12.4987 1.84748 12.7698 1.97696 12.8965 2.10357C13.0231 2.23018 13.1526 2.50125 13.2188 2.94357C13.2828 3.37086 13.2779 3.89439 13.1988 4.44801C13.0383 5.57139 12.591 6.70188 11.9464 7.34645L7.49999 11.7929L6.35354 10.6465C6.15827 10.4512 5.84169 10.4512 5.64643 10.6465C5.45117 10.8417 5.45117 11.1583 5.64643 11.3536L7.14644 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L8.40073 12.3064L9.57124 14.2572C9.65046 14.3893 9.78608 14.4774 9.9389 14.4963C10.0917 14.5151 10.2447 14.4624 10.3535 14.3536L12.3535 12.3536C12.4648 12.2423 12.5172 12.0851 12.495 11.9293L12.0303 8.67679L12.6536 8.05355C13.509 7.19808 14.0117 5.82855 14.1887 4.58943C14.2784 3.9618 14.2891 3.33847 14.2078 2.79546C14.1287 2.26748 13.9519 1.74482 13.6035 1.39645C13.2552 1.04809 12.7325 0.871332 12.2045 0.792264C11.6615 0.710945 11.0382 0.721644 10.4105 0.8113C9.17143 0.988306 7.80189 1.491 6.94644 2.34642L6.32322 2.96968L3.07071 2.50504C2.91492 2.48278 2.75773 2.53517 2.64645 2.64646L0.646451 4.64645C0.537579 4.75533 0.484938 4.90829 0.50375 5.0611C0.522563 5.21391 0.61073 5.34954 0.742757 5.42876L2.69364 6.59928L2.14646 7.14645C2.0527 7.24022 2.00002 7.3674 2.00002 7.50001C2.00002 7.63261 2.0527 7.75979 2.14646 7.85356L3.64647 9.35356C3.84173 9.54883 4.15831 9.54883 4.35357 9.35356C4.54884 9.1583 4.54884 8.84172 4.35357 8.64646L3.20712 7.50001L3.85357 6.85356L6.85357 3.85355ZM10.0993 13.1936L9.12959 11.5775L11.1464 9.56067L11.4697 11.8232L10.0993 13.1936ZM3.42251 5.87041L5.43935 3.85356L3.17678 3.53034L1.80638 4.90074L3.42251 5.87041ZM2.35356 10.3535C2.54882 10.1583 2.54882 9.8417 2.35356 9.64644C2.1583 9.45118 1.84171 9.45118 1.64645 9.64644L0.646451 10.6464C0.451188 10.8417 0.451188 11.1583 0.646451 11.3535C0.841713 11.5488 1.1583 11.5488 1.35356 11.3535L2.35356 10.3535ZM3.85358 11.8536C4.04884 11.6583 4.04885 11.3417 3.85359 11.1465C3.65833 10.9512 3.34175 10.9512 3.14648 11.1465L1.14645 13.1464C0.95119 13.3417 0.951187 13.6583 1.14645 13.8535C1.34171 14.0488 1.65829 14.0488 1.85355 13.8536L3.85358 11.8536ZM5.35356 13.3535C5.54882 13.1583 5.54882 12.8417 5.35356 12.6464C5.1583 12.4512 4.84171 12.4512 4.64645 12.6464L3.64645 13.6464C3.45119 13.8417 3.45119 14.1583 3.64645 14.3535C3.84171 14.5488 4.1583 14.5488 4.35356 14.3535L5.35356 13.3535ZM9.49997 6.74881C10.1897 6.74881 10.7488 6.1897 10.7488 5.5C10.7488 4.8103 10.1897 4.25118 9.49997 4.25118C8.81026 4.25118 8.25115 4.8103 8.25115 5.5C8.25115 6.1897 8.81026 6.74881 9.49997 6.74881Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$3L=["color"],RulerHorizontalIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$3L);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M0.5 4C0.223858 4 0 4.22386 0 4.5V10.5C0 10.7761 0.223858 11 0.5 11H14.5C14.7761 11 15 10.7761 15 10.5V4.5C15 4.22386 14.7761 4 14.5 4H0.5ZM1 10V5H2.075V7.5C2.075 7.73472 2.26528 7.925 2.5 7.925C2.73472 7.925 2.925 7.73472 2.925 7.5V5H4.075V6.5C4.075 6.73472 4.26528 6.925 4.5 6.925C4.73472 6.925 4.925 6.73472 4.925 6.5V5H6.075V6.5C6.075 6.73472 6.26528 6.925 6.5 6.925C6.73472 6.925 6.925 6.73472 6.925 6.5V5H8.075V7.5C8.075 7.73472 8.26528 7.925 8.5 7.925C8.73472 7.925 8.925 7.73472 8.925 7.5V5H10.075V6.5C10.075 6.73472 10.2653 6.925 10.5 6.925C10.7347 6.925 10.925 6.73472 10.925 6.5V5H12.075V6.5C12.075 6.73472 12.2653 6.925 12.5 6.925C12.7347 6.925 12.925 6.73472 12.925 6.5V5H14V10H1Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$4q=["color"],TextAlignJustifyIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4q);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),_excluded$4H=["color"],TriangleDownIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4H);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:color}))})),_excluded$4K=["color"],TriangleUpIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4K);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:color}))})),_excluded$4R=["color"],VercelLogoIcon=(0,react.forwardRef)((function(_ref,forwardedRef){var _ref$color=_ref.color,color=void 0===_ref$color?"currentColor":_ref$color,props=_objectWithoutPropertiesLoose(_ref,_excluded$4R);return(0,react.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),(0,react.createElement)("path",{d:"M7.49998 1L6.92321 2.00307L1.17498 12L0.599976 13H1.7535H13.2464H14.4L13.825 12L8.07674 2.00307L7.49998 1ZM7.49998 3.00613L2.3285 12H12.6714L7.49998 3.00613Z",fill:color,fillRule:"evenodd",clipRule:"evenodd"}))})),react_three_fiber_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"),esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");__webpack_require__("./node_modules/process/browser.js");function workerBootstrap(){var modules=Object.create(null);function registerModule(ref,callback){var id=ref.id,name=ref.name,dependencies=ref.dependencies;void 0===dependencies&&(dependencies=[]);var init=ref.init;void 0===init&&(init=function(){});var getTransferables=ref.getTransferables;if(void 0===getTransferables&&(getTransferables=null),!modules[id])try{dependencies=dependencies.map((function(dep){return dep&&dep.isWorkerModule&&(registerModule(dep,(function(depResult){if(depResult instanceof Error)throw depResult})),dep=modules[dep.id].value),dep})),init=rehydrate("<"+name+">.init",init),getTransferables&&(getTransferables=rehydrate("<"+name+">.getTransferables",getTransferables));var value=null;"function"==typeof init?value=init.apply(void 0,dependencies):console.error("worker module init function failed to rehydrate"),modules[id]={id:id,value:value,getTransferables:getTransferables},callback(value)}catch(err){err&&err.noLog||console.error(err),callback(err)}}function rehydrate(name,str){var result=void 0;self.troikaDefine=function(r){return result=r};var url=URL.createObjectURL(new Blob(["/** "+name.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+str+"\n)"],{type:"application/javascript"}));try{importScripts(url)}catch(err){console.error(err)}return URL.revokeObjectURL(url),delete self.troikaDefine,result}self.addEventListener("message",(function(e){var ref=e.data,messageId=ref.messageId,action=ref.action,data=ref.data;try{"registerModule"===action&®isterModule(data,(function(result){result instanceof Error?postMessage({messageId:messageId,success:!1,error:result.message}):postMessage({messageId:messageId,success:!0,result:{isCallable:"function"==typeof result}})})),"callModule"===action&&function callModule(ref,callback){var ref$1,id=ref.id,args=ref.args;modules[id]&&"function"==typeof modules[id].value||callback(new Error("Worker module "+id+": not found or its 'init' did not return a function"));try{var result=(ref$1=modules[id]).value.apply(ref$1,args);result&&"function"==typeof result.then?result.then(handleResult,(function(rej){return callback(rej instanceof Error?rej:new Error(""+rej))})):handleResult(result)}catch(err){callback(err)}function handleResult(result){try{var tx=modules[id].getTransferables&&modules[id].getTransferables(result);tx&&Array.isArray(tx)&&tx.length||(tx=void 0),callback(result,tx)}catch(err){console.error(err),callback(err)}}}(data,(function(result,transferables){result instanceof Error?postMessage({messageId:messageId,success:!1,error:result.message}):postMessage({messageId:messageId,success:!0,result:result},transferables||void 0)}))}catch(err){postMessage({messageId:messageId,success:!1,error:err.stack})}}))}var supportsWorkers=function(){var supported=!1;if("undefined"!=typeof window&&void 0!==window.document)try{new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"}))).terminate(),supported=!0}catch(err){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+err.message+"]")}return supportsWorkers=function(){return supported},supported},_workerModuleId=0,_messageId=0,_allowInitAsString=!1,workers=Object.create(null),registeredModules=Object.create(null),openRequests=Object.create(null);function defineWorkerModule(options){if(!(options&&"function"==typeof options.init||_allowInitAsString))throw new Error("requires `options.init` function");var dependencies=options.dependencies,init=options.init,getTransferables=options.getTransferables,workerId=options.workerId;if(!supportsWorkers())return function defineMainThreadModule(options){var moduleFunc=function(){for(var args=[],len=arguments.length;len--;)args[len]=arguments[len];return moduleFunc._getInitResult().then((function(initResult){if("function"==typeof initResult)return initResult.apply(void 0,args);throw new Error("Worker module function was called but `init` did not return a callable function")}))};return moduleFunc._getInitResult=function(){var dependencies=options.dependencies,init=options.init;dependencies=Array.isArray(dependencies)?dependencies.map((function(dep){return dep&&dep._getInitResult?dep._getInitResult():dep})):[];var initPromise=Promise.all(dependencies).then((function(deps){return init.apply(null,deps)}));return moduleFunc._getInitResult=function(){return initPromise},initPromise},moduleFunc}(options);null==workerId&&(workerId="#default");var id="workerModule"+ ++_workerModuleId,name=options.name||id,registrationPromise=null;function moduleFunc(){for(var args=[],len=arguments.length;len--;)args[len]=arguments[len];if(!registrationPromise){registrationPromise=callWorker(workerId,"registerModule",moduleFunc.workerModuleData);var unregister=function(){registrationPromise=null,registeredModules[workerId].delete(unregister)};(registeredModules[workerId]||(registeredModules[workerId]=new Set)).add(unregister)}return registrationPromise.then((function(ref){if(ref.isCallable)return callWorker(workerId,"callModule",{id:id,args:args});throw new Error("Worker module function was called but `init` did not return a callable function")}))}return dependencies=dependencies&&dependencies.map((function(dep){return"function"!=typeof dep||dep.workerModuleData||(_allowInitAsString=!0,dep=defineWorkerModule({workerId:workerId,name:"<"+name+"> function dependency: "+dep.name,init:"function(){return (\n"+stringifyFunction(dep)+"\n)}"}),_allowInitAsString=!1),dep&&dep.workerModuleData&&(dep=dep.workerModuleData),dep})),moduleFunc.workerModuleData={isWorkerModule:!0,id:id,name:name,dependencies:dependencies,init:stringifyFunction(init),getTransferables:getTransferables&&stringifyFunction(getTransferables)},moduleFunc}function stringifyFunction(fn){var str=fn.toString();return!/^function/.test(str)&&/^\w+\s*\(/.test(str)&&(str="function "+str),str}function callWorker(workerId,action,data){return new Promise((function(resolve,reject){var messageId=++_messageId;openRequests[messageId]=function(response){response.success?resolve(response.result):reject(new Error("Error in worker "+action+" call: "+response.error))},function getWorker(workerId){var worker=workers[workerId];if(!worker){var bootstrap=stringifyFunction(workerBootstrap);(worker=workers[workerId]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+workerId.replace(/\*/g,"")+" **/\n\n;("+bootstrap+")()"],{type:"application/javascript"})))).onmessage=function(e){var response=e.data,msgId=response.messageId,callback=openRequests[msgId];if(!callback)throw new Error("WorkerModule response with empty or unknown messageId");delete openRequests[msgId],callback(response)}}return worker}(workerId).postMessage({messageId:messageId,action:action,data:data})}))}function SDFGenerator(){var exports=function(exports){function pointOnQuadraticBezier(x0,y0,x1,y1,x2,y2,t,pointOut){var t2=1-t;pointOut.x=t2*t2*x0+2*t2*t*x1+t*t*x2,pointOut.y=t2*t2*y0+2*t2*t*y1+t*t*y2}function pointOnCubicBezier(x0,y0,x1,y1,x2,y2,x3,y3,t,pointOut){var t2=1-t;pointOut.x=t2*t2*t2*x0+3*t2*t2*t*x1+3*t2*t*t*x2+t*t*t*x3,pointOut.y=t2*t2*t2*y0+3*t2*t2*t*y1+3*t2*t*t*y2+t*t*t*y3}function forEachPathCommand(pathString,commandCallback){for(var match,firstX,firstY,prevX,prevY,segmentRE=/([MLQCZ])([^MLQCZ]*)/g;match=segmentRE.exec(pathString);){var args=match[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map((function(v){return parseFloat(v)}));switch(match[1]){case"M":prevX=firstX=args[0],prevY=firstY=args[1];break;case"L":args[0]===prevX&&args[1]===prevY||commandCallback("L",prevX,prevY,prevX=args[0],prevY=args[1]);break;case"Q":commandCallback("Q",prevX,prevY,prevX=args[2],prevY=args[3],args[0],args[1]);break;case"C":commandCallback("C",prevX,prevY,prevX=args[4],prevY=args[5],args[0],args[1],args[2],args[3]);break;case"Z":prevX===firstX&&prevY===firstY||commandCallback("L",prevX,prevY,firstX,firstY)}}}function pathToLineSegments(pathString,segmentCallback,curvePoints){void 0===curvePoints&&(curvePoints=16);var tempPoint={x:0,y:0};forEachPathCommand(pathString,(function(command,startX,startY,endX,endY,ctrl1X,ctrl1Y,ctrl2X,ctrl2Y){switch(command){case"L":segmentCallback(startX,startY,endX,endY);break;case"Q":for(var prevCurveX=startX,prevCurveY=startY,i=1;i0;)values[len]=arguments[len+2];var uniformLoc=uniforms[name]||(uniforms[name]=gl.getUniformLocation(program,name));gl["uniform"+type].apply(gl,[uniformLoc].concat(values))},setAttribute:function setAttribute(name,size,usage,instancingDivisor,data){var attr=attributes[name];attr||(attr=attributes[name]={buf:gl.createBuffer(),loc:gl.getAttribLocation(program,name),data:null}),gl.bindBuffer(gl.ARRAY_BUFFER,attr.buf),gl.vertexAttribPointer(attr.loc,size,gl.FLOAT,!1,0,0),gl.enableVertexAttribArray(attr.loc),isWebGL2?gl.vertexAttribDivisor(attr.loc,instancingDivisor):getExtension("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(attr.loc,instancingDivisor),data!==attr.data&&(gl.bufferData(gl.ARRAY_BUFFER,data,usage),attr.data=data)}})}}}programs[name].transaction(func)}function withTexture(name,func){textureUnit++;try{gl.activeTexture(gl.TEXTURE0+textureUnit);var texture=textures[name];texture||(texture=textures[name]=gl.createTexture(),gl.bindTexture(gl.TEXTURE_2D,texture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST)),gl.bindTexture(gl.TEXTURE_2D,texture),func(texture,textureUnit)}finally{textureUnit--}}function withTextureFramebuffer(texture,textureUnit,func){var framebuffer=gl.createFramebuffer();framebufferStack.push(framebuffer),gl.bindFramebuffer(gl.FRAMEBUFFER,framebuffer),gl.activeTexture(gl.TEXTURE0+textureUnit),gl.bindTexture(gl.TEXTURE_2D,texture),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,texture,0);try{func(framebuffer)}finally{gl.deleteFramebuffer(framebuffer),gl.bindFramebuffer(gl.FRAMEBUFFER,framebufferStack[--framebufferStack.length-1]||null)}}function handleContextLoss(){extensions={},programs={},textures={},textureUnit=-1,framebufferStack.length=0}gl.canvas.addEventListener("webglcontextlost",(function(e){handleContextLoss(),e.preventDefault()}),!1),cache.set(gl,wrapper={gl:gl,isWebGL2:isWebGL2,getExtension:getExtension,withProgram:withProgram,withTexture:withTexture,withTextureFramebuffer:withTextureFramebuffer,handleContextLoss:handleContextLoss})}callback(wrapper)}function renderImageData(glOrCanvas,imageData,x,y,width,height,channels,framebuffer){void 0===channels&&(channels=15),void 0===framebuffer&&(framebuffer=null),withWebGLContext(glOrCanvas,(function(ref){var gl=ref.gl,withProgram=ref.withProgram;(0,ref.withTexture)("copy",(function(tex,texUnit){gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,width,height,0,gl.RGBA,gl.UNSIGNED_BYTE,imageData),withProgram("copy",viewportQuadVertex,copyTexFragment,(function(ref){var setUniform=ref.setUniform;(0,ref.setAttribute)("aUV",2,gl.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),setUniform("1i","image",texUnit),gl.bindFramebuffer(gl.FRAMEBUFFER,framebuffer||null),gl.disable(gl.BLEND),gl.colorMask(8&channels,4&channels,2&channels,1&channels),gl.viewport(x,y,width,height),gl.scissor(x,y,width,height),gl.drawArrays(gl.TRIANGLES,0,3)}))}))}))}var webglUtils=Object.freeze({__proto__:null,withWebGLContext:withWebGLContext,renderImageData:renderImageData,resizeWebGLCanvasWithoutClearing:function resizeWebGLCanvasWithoutClearing(canvas,newWidth,newHeight){var width=canvas.width,height=canvas.height;withWebGLContext(canvas,(function(ref){var gl=ref.gl,data=new Uint8Array(width*height*4);gl.readPixels(0,0,width,height,gl.RGBA,gl.UNSIGNED_BYTE,data),canvas.width=newWidth,canvas.height=newHeight,renderImageData(gl,data,0,0,width,height)}))}});function generate$2(sdfWidth,sdfHeight,path,viewBox,maxDistance,sdfExponent){void 0===sdfExponent&&(sdfExponent=1);var textureData=new Uint8Array(sdfWidth*sdfHeight),viewBoxWidth=viewBox[2]-viewBox[0],viewBoxHeight=viewBox[3]-viewBox[1],segments=[];pathToLineSegments(path,(function(x1,y1,x2,y2){segments.push({x1:x1,y1:y1,x2:x2,y2:y2,minX:Math.min(x1,x2),minY:Math.min(y1,y2),maxX:Math.max(x1,x2),maxY:Math.max(y1,y2)})})),segments.sort((function(a,b){return a.maxX-b.maxX}));for(var sdfX=0;sdfXseg.minX&&y-closestDistseg.minY){var distSq=absSquareDistanceToLineSegment(x,y,seg.x1,seg.y1,seg.x2,seg.y2);distSqy!=seg.y2>y&&x<(seg.x2-seg.x1)*(y-seg.y1)/(seg.y2-seg.y1)+seg.x1&&(winding+=seg.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function parseCharacterMap(encodedString,includeReverse){var prevPair,lastCode=0,map=new Map,reverseMap=includeReverse&&new Map;return encodedString.split(",").forEach((function visit(entry){if(-1!==entry.indexOf("+"))for(var i=+entry;i--;)visit(prevPair);else{prevPair=entry;var ref=entry.split(">"),a=ref[0],b=ref[1];a=String.fromCodePoint(lastCode+=parseInt(a,36)),b=String.fromCodePoint(lastCode+=parseInt(b,36)),map.set(a,b),includeReverse&&reverseMap.set(b,a)}})),{map:map,reverseMap:reverseMap}}function parse$1(){if(!openToClose){var ref=parseCharacterMap(data$1.pairs,!0),map=ref.map,reverseMap=ref.reverseMap;openToClose=map,closeToOpen=reverseMap,canonical=parseCharacterMap(data$1.canonical,!1).map}}function openingToClosingBracket(char){return parse$1(),openToClose.get(char)||null}function closingToOpeningBracket(char){return parse$1(),closeToOpen.get(char)||null}function getCanonicalBracket(char){return parse$1(),canonical.get(char)||null}var TYPE_L=TYPES.L,TYPE_R=TYPES.R,TYPE_EN=TYPES.EN,TYPE_ES=TYPES.ES,TYPE_ET=TYPES.ET,TYPE_AN=TYPES.AN,TYPE_CS=TYPES.CS,TYPE_B=TYPES.B,TYPE_S=TYPES.S,TYPE_ON=TYPES.ON,TYPE_BN=TYPES.BN,TYPE_NSM=TYPES.NSM,TYPE_AL=TYPES.AL,TYPE_LRO=TYPES.LRO,TYPE_RLO=TYPES.RLO,TYPE_LRE=TYPES.LRE,TYPE_RLE=TYPES.RLE,TYPE_PDF=TYPES.PDF,TYPE_LRI=TYPES.LRI,TYPE_RLI=TYPES.RLI,TYPE_FSI=TYPES.FSI,TYPE_PDI=TYPES.PDI;var mirrorMap,data="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1";function getMirroredCharacter(char){return function parse(){if(!mirrorMap){var ref=parseCharacterMap(data,!0),map=ref.map;ref.reverseMap.forEach((function(value,key){map.set(key,value)})),mirrorMap=map}}(),mirrorMap.get(char)||null}function getReorderSegments(string,embeddingLevelsResult,start,end){var strLen=string.length;start=Math.max(0,null==start?0:+start),end=Math.min(strLen-1,null==end?strLen-1:+end);var segments=[];return embeddingLevelsResult.paragraphs.forEach((function(paragraph){var lineStart=Math.max(start,paragraph.start),lineEnd=Math.min(end,paragraph.end);if(lineStart=lineStart&&getBidiCharType(string[i])&TRAILING_TYPES;i--)lineLevels[i]=paragraph.level;for(var maxLevel=paragraph.level,minOddLevel=1/0,i$1=0;i$1maxLevel&&(maxLevel=level),level=minOddLevel;lvl--)for(var i$2=0;i$2=lvl){for(var segStart=i$2;i$2+1=lvl;)i$2++;i$2>segStart&&segments.push([segStart+lineStart,i$2+lineStart])}}})),segments}function getReorderedIndices(string,embedLevelsResult,start,end){for(var segments=getReorderSegments(string,embedLevelsResult,start,end),indices=[],i=0;i0)overflowIsolateCount--;else if(validIsolateCount>0){for(overflowEmbeddingCount=0;!statusStack[statusStack.length-1]._isolate;)statusStack.pop();var isolInitIndex=statusStack[statusStack.length-1]._isolInitIndex;null!=isolInitIndex&&(isolationPairs.set(isolInitIndex,i$2),isolationPairs.set(i$2,isolInitIndex)),statusStack.pop(),validIsolateCount--}stackTop=statusStack[statusStack.length-1],embedLevels[i$2]=stackTop._level,stackTop._override&&changeCharType(i$2,stackTop._override)}else charType&TYPE_PDF?(0===overflowIsolateCount&&(overflowEmbeddingCount>0?overflowEmbeddingCount--:!stackTop._isolate&&statusStack.length>1&&(statusStack.pop(),stackTop=statusStack[statusStack.length-1])),embedLevels[i$2]=stackTop._level):charType&TYPE_B&&(embedLevels[i$2]=paragraph.level);else embedLevels[i$2]=stackTop._level,stackTop._override&&charType!==TYPE_BN&&changeCharType(i$2,stackTop._override)}for(var levelRuns=[],currentRun=null,i$3=paragraph.start;i$3<=paragraph.end;i$3++){var charType$1=charTypes[i$3];if(!(charType$1&BN_LIKE_TYPES)){var lvl=embedLevels[i$3],isIsolInit=charType$1&ISOLATE_INIT_TYPES,isPDI=charType$1===TYPE_PDI;currentRun&&lvl===currentRun._level?(currentRun._end=i$3,currentRun._endsWithIsolInit=isIsolInit):levelRuns.push(currentRun={_start:i$3,_end:i$3,_level:lvl,_startsWithPDI:isPDI,_endsWithIsolInit:isIsolInit})}}for(var isolatingRunSeqs=[],runIdx=0;runIdx=0;i$6--)if(!(charTypes[i$6]&BN_LIKE_TYPES)){prevLevel=embedLevels[i$6];break}var lastIndex=seqIndices[seqIndices.length-1],lastLevel=embedLevels[lastIndex],nextLevel=paragraph.level;if(!(charTypes[lastIndex]&ISOLATE_INIT_TYPES))for(var i$7=lastIndex+1;i$7<=paragraph.end;i$7++)if(!(charTypes[i$7]&BN_LIKE_TYPES)){nextLevel=embedLevels[i$7];break}isolatingRunSeqs.push({_seqIndices:seqIndices,_sosType:Math.max(prevLevel,firstLevel)%2?TYPE_R:TYPE_L,_eosType:Math.max(nextLevel,lastLevel)%2?TYPE_R:TYPE_L})}}for(var seqIdx=0;seqIdx=0;sj--)if(!(charTypes[seqIndices$1[sj]]&BN_LIKE_TYPES)){prevType=charTypes[seqIndices$1[sj]];break}changeCharType(i$8,prevType&(ISOLATE_INIT_TYPES|TYPE_PDI)?TYPE_ON:prevType)}}if(charTypeCounts.get(TYPE_EN))for(var si$1=0;si$1=-1;sj$1--){var prevCharType=-1===sj$1?sosType:charTypes[seqIndices$1[sj$1]];if(prevCharType&STRONG_TYPES){prevCharType===TYPE_AL&&changeCharType(i$9,TYPE_AN);break}}}if(charTypeCounts.get(TYPE_AL))for(var si$2=0;si$2=0&&(prevType$1=charTypes[seqIndices$1[sj$2]])&BN_LIKE_TYPES;sj$2--);for(var sj$3=si$3+1;sj$3=0&&charTypes[seqIndices$1[sj$4]]&(TYPE_ET|BN_LIKE_TYPES);sj$4--)changeCharType(seqIndices$1[sj$4],TYPE_EN);for(si$4++;si$4=0&&charTypes[seqIndices$1[sj$5]]&BN_LIKE_TYPES;sj$5--)changeCharType(seqIndices$1[sj$5],TYPE_ON);for(var sj$6=si$5+1;sj$6=0;stackIdx--){var stackChar=openerStack[stackIdx].char;if(stackChar===oppositeBracket||stackChar===closingToOpeningBracket(getCanonicalBracket(char))||openingToClosingBracket(getCanonicalBracket(stackChar))===char){bracketPairs.push([openerStack[stackIdx].seqIndex,si$7]),openerStack.length=stackIdx;break}}}bracketPairs.sort((function(a,b){return a[0]-b[0]}));for(var pairIdx=0;pairIdx=0;si$9--){var i$16=seqIndices$1[si$9];if(charTypes[i$16]&STRONG_TYPES_FOR_N_STEPS){var lr$1=charTypes[i$16]&R_TYPES_FOR_N_STEPS?TYPE_R:TYPE_L;useStrongType=lr$1!==embedDirection?lr$1:embedDirection;break}}}if(useStrongType){if(charTypes[seqIndices$1[openSeqIdx]]=charTypes[seqIndices$1[closeSeqIdx]]=useStrongType,useStrongType!==embedDirection)for(var si$10=openSeqIdx+1;si$10=0;si2--){if(!(charTypes[seqIndices$1[si2]]&BN_LIKE_TYPES)){prevType$2=charTypes[seqIndices$1[si2]]&R_TYPES_FOR_N_STEPS?TYPE_R:TYPE_L;break}niRunStart=si2}for(var nextType$1=eosType,si2$1=si$12+1;si2$1=0&&getBidiCharType(string[j$1])&TRAILING_TYPES;j$1--)embedLevels[j$1]=paragraph.level}}return{levels:embedLevels,paragraphs:paragraphs};function determineAutoEmbedLevel(start,isFSI){for(var i=start;i/gm,(function replace(match,include){let chunk=three_module.ShaderChunk[include];return chunk?expandShaderIncludes(chunk):match}))}const _lut=[];for(let i=0;i<256;i++)_lut[i]=(i<16?"0":"")+i.toString(16);const troika_three_utils_esm_assign=Object.assign||function(){let target=arguments[0];for(let i=1,len=arguments.length;i/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n")));if(customRewriter){let res=customRewriter({vertexShader:vertexShader,fragmentShader:fragmentShader});vertexShader=res.vertexShader,fragmentShader=res.fragmentShader}if(fragmentColorTransform){let postChunks=[];fragmentShader=fragmentShader.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(match=>(postChunks.push(match),""))),fragmentMainOutro=`${fragmentColorTransform}\n${postChunks.join("\n")}\n${fragmentMainOutro}`}if(timeUniform){const code=`\nuniform float ${timeUniform};\n`;vertexDefs=code+vertexDefs,fragmentDefs=code+fragmentDefs}vertexTransform&&(vertexDefs=`${vertexDefs}\nvoid troikaVertexTransform${key}(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ${vertexTransform}\n}\n`,vertexMainIntro=`\ntroika_position_${key} = vec3(position);\ntroika_normal_${key} = vec3(normal);\ntroika_uv_${key} = vec2(uv);\ntroikaVertexTransform${key}(troika_position_${key}, troika_normal_${key}, troika_uv_${key});\n${vertexMainIntro}\n`,vertexShader=(vertexShader=`vec3 troika_position_${key};\nvec3 troika_normal_${key};\nvec2 troika_uv_${key};\n${vertexShader}\n`).replace(/\b(position|normal|uv)\b/g,((match,match1,index,fullStr)=>/\battribute\s+vec[23]\s+$/.test(fullStr.substr(0,index))?match1:`troika_${match1}_${key}`)),material.map&&material.map.channel>0||(vertexShader=vertexShader.replace(/\bMAP_UV\b/g,`troika_uv_${key}`)));return vertexShader=injectIntoShaderCode(vertexShader,key,vertexDefs,vertexMainIntro,vertexMainOutro),fragmentShader=injectIntoShaderCode(fragmentShader,key,fragmentDefs,fragmentMainIntro,fragmentMainOutro),{vertexShader:vertexShader,fragmentShader:fragmentShader}}(this,shaderInfo,options,optionsKey);upgradedShaders=SHADER_UPGRADE_CACHE[cacheKey]=upgraded}shaderInfo.vertexShader=upgradedShaders.vertexShader,shaderInfo.fragmentShader=upgradedShaders.fragmentShader,troika_three_utils_esm_assign(shaderInfo.uniforms,this.uniforms),options.timeUniform&&(shaderInfo.uniforms[options.timeUniform]={get value(){return Date.now()-epoch}}),this[privateBeforeCompileProp]&&this[privateBeforeCompileProp](shaderInfo)},DerivedMaterial=function DerivedMaterial(){return derive(options.chained?baseMaterial:baseMaterial.clone())},derive=function(base){const derived=Object.create(base,descriptor);return Object.defineProperty(derived,"baseMaterial",{value:baseMaterial}),Object.defineProperty(derived,"id",{value:materialInstanceId++}),derived.uuid=function generateUUID(){const d0=4294967295*Math.random()|0,d1=4294967295*Math.random()|0,d2=4294967295*Math.random()|0,d3=4294967295*Math.random()|0;return(_lut[255&d0]+_lut[d0>>8&255]+_lut[d0>>16&255]+_lut[d0>>24&255]+"-"+_lut[255&d1]+_lut[d1>>8&255]+"-"+_lut[d1>>16&15|64]+_lut[d1>>24&255]+"-"+_lut[63&d2|128]+_lut[d2>>8&255]+"-"+_lut[d2>>16&255]+_lut[d2>>24&255]+_lut[255&d3]+_lut[d3>>8&255]+_lut[d3>>16&255]+_lut[d3>>24&255]).toUpperCase()}(),derived.uniforms=troika_three_utils_esm_assign({},base.uniforms,options.uniforms),derived.defines=troika_three_utils_esm_assign({},base.defines,options.defines),derived.defines[`TROIKA_DERIVED_MATERIAL_${optionsKey}`]="",derived.extensions=troika_three_utils_esm_assign({},base.extensions,options.extensions),derived._listeners=void 0,derived},descriptor={constructor:{value:DerivedMaterial},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return baseMaterial.customProgramCacheKey()+"|"+optionsKey}},onBeforeCompile:{get(){return onBeforeCompile},set(fn){this[privateBeforeCompileProp]=fn}},copy:{writable:!0,configurable:!0,value:function(source){return baseMaterial.copy.call(this,source),baseMaterial.isShaderMaterial||baseMaterial.isDerivedMaterial||(troika_three_utils_esm_assign(this.extensions,source.extensions),troika_three_utils_esm_assign(this.defines,source.defines),troika_three_utils_esm_assign(this.uniforms,three_module.UniformsUtils.clone(source.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const newBase=new baseMaterial.constructor;return derive(newBase).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let depthMaterial=this._depthMaterial;return depthMaterial||(depthMaterial=this._depthMaterial=createDerivedMaterial(baseMaterial.isDerivedMaterial?baseMaterial.getDepthMaterial():new three_module.MeshDepthMaterial({depthPacking:three_module.RGBADepthPacking}),options),depthMaterial.defines.IS_DEPTH_MATERIAL="",depthMaterial.uniforms=this.uniforms),depthMaterial}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let distanceMaterial=this._distanceMaterial;return distanceMaterial||(distanceMaterial=this._distanceMaterial=createDerivedMaterial(baseMaterial.isDerivedMaterial?baseMaterial.getDistanceMaterial():new three_module.MeshDistanceMaterial,options),distanceMaterial.defines.IS_DISTANCE_MATERIAL="",distanceMaterial.uniforms=this.uniforms),distanceMaterial}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:_depthMaterial,_distanceMaterial:_distanceMaterial}=this;_depthMaterial&&_depthMaterial.dispose(),_distanceMaterial&&_distanceMaterial.dispose(),baseMaterial.dispose.call(this)}}};return ctorsByDerivation[optionsKey]=DerivedMaterial,new DerivedMaterial}function injectIntoShaderCode(shaderCode,id,defs,intro,outro){return(intro||outro||defs)&&(shaderCode=shaderCode.replace(voidMainRegExp,`\n${defs}\nvoid troikaOrigMain${id}() {`),shaderCode+=`\nvoid main() {\n ${intro}\n troikaOrigMain${id}();\n ${outro}\n}`),shaderCode}function optionsJsonReplacer(key,value){return"uniforms"===key?void 0:"function"==typeof value?value.toString():value}let _idCtr=0;const optionsHashesToIds=new Map;three_module.DoubleSide;const workerModule=defineWorkerModule({name:"Typr Font Parser",dependencies:[function typrFactory(){return"undefined"==typeof window&&(self.window=self),function(r){var e={parse:function(r){var t=e._bin,a=new Uint8Array(r);if("ttcf"==t.readASCII(a,0,4)){var n=4;t.readUshort(a,n),n+=2,t.readUshort(a,n),n+=2;var o=t.readUint(a,n);n+=4;for(var s=[],i=0;i>>t&1)&&e++;return e},e._lctf.readClassDef=function(r,t){var a=e._bin,n=[],o=a.readUshort(r,t);if(t+=2,1==o){var s=a.readUshort(r,t);t+=2;var i=a.readUshort(r,t);t+=2;for(var h=0;h0&&(o.featureParams=n+s);var i=a.readUshort(r,t);t+=2,o.tab=[];for(var h=0;h0&&(o.default=e._lctf.readLangSysTable(r,n+s));var i=a.readUshort(r,t);t+=2;for(var h=0;h255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[t])},e.CFF.readEncoding=function(r,t,a){e._bin;var n=[".notdef"],o=r[t];if(t++,0!=o)throw"error: unknown encoding format: "+o;var s=r[t];t++;for(var i=0;i>4,p=15&v;if(15!=c&&l.push(c),15!=p&&l.push(p),15==p)break}for(var U="",g=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],S=0;S=s.xMax||s.yMin>=s.yMax)return null;if(s.noc>0){s.endPts=[];for(var i=0;i=1&&i.fmt<=2){d=o.readUshort(r,a),a+=2;var f=o.readUshort(r,a);a+=2;var u=e._lctf.numOfOnes(d),l=e._lctf.numOfOnes(f);if(1==i.fmt){i.pairsets=[];var v=o.readUshort(r,a);a+=2;for(var c=0;c=1&&i.fmt<=2){if(1==i.fmt)i.delta=o.readShort(r,a),a+=2;else if(2==i.fmt){var d=o.readUshort(r,a);a+=2,i.newg=o.readUshorts(r,a,d),a+=2*i.newg.length}}else if(2==t&&1==i.fmt){d=o.readUshort(r,a),a+=2,i.seqs=[];for(var f=0;f>>8;if(0!=(u&=15))throw"unknown kern table format: "+u;t=e.kern.readFormat0(r,t,h)}return h},e.kern.parseV1=function(r,t,a,n){var o=e._bin;o.readFixed(r,t),t+=4;var s=o.readUint(r,t);t+=4;for(var i={glyph1:[],rval:[]},h=0;h>>8;if(0!=(f&=15))throw"unknown kern table format: "+f;t=e.kern.readFormat0(r,t,i)}return i},e.kern.readFormat0=function(r,t,a){var n=e._bin,o=-1,s=n.readUshort(r,t);t+=2,n.readUshort(r,t),t+=2,n.readUshort(r,t),t+=2,n.readUshort(r,t),t+=2;for(var i=0;i=n.map.length?0:n.map[e];if(4==n.format){for(var o=-1,s=0;se?0:65535&(0!=n.idRangeOffset[o]?n.glyphIdArray[e-n.startCount[o]+(n.idRangeOffset[o]>>1)-(n.idRangeOffset.length-o)]:e+n.idDelta[o])}if(12==n.format){if(e>n.groups[n.groups.length-1][1])return 0;for(s=0;s-1?e.U._simpleGlyph(n,a):e.U._compoGlyph(n,t,a))},e.U._simpleGlyph=function(r,t){for(var a=0;ao)){for(var v=!0,c=0,p=0;po)){for(v=!0,p=0;p>1,s.length=0,h=!0;else if("o3"==P||"o23"==P)s.length%2!=0&&!h&&(d=s.shift()+n.nominalWidthX),i+=s.length>>1,s.length=0,h=!0;else if("o4"==P)s.length>1&&!h&&(d=s.shift()+n.nominalWidthX,h=!0),f&&e.U.P.closePath(o),v+=s.pop(),e.U.P.moveTo(o,l,v),f=!0;else if("o5"==P)for(;s.length>0;)l+=s.shift(),v+=s.shift(),e.U.P.lineTo(o,l,v);else if("o6"==P||"o7"==P)for(var x=s.length,I="o6"==P,w=0;wMath.abs(y-v)?l=b+s.shift():v=y+s.shift(),e.U.P.curveTo(o,c,p,U,g,F,C),e.U.P.curveTo(o,S,m,b,y,l,v));else if("o14"==P){if(s.length>0&&!h&&(d=s.shift()+a.nominalWidthX,h=!0),4==s.length){var O=s.shift(),T=s.shift(),D=s.shift(),B=s.shift(),A=e.CFF.glyphBySE(a,D),R=e.CFF.glyphBySE(a,B);e.U._drawCFF(a.CharStrings[A],t,a,n,o),t.x=O,t.y=T,e.U._drawCFF(a.CharStrings[R],t,a,n,o)}f&&(e.U.P.closePath(o),f=!1)}else if("o19"==P||"o20"==P)s.length%2!=0&&!h&&(d=s.shift()+n.nominalWidthX),i+=s.length>>1,s.length=0,h=!0,u+=i+7>>3;else if("o21"==P)s.length>2&&!h&&(d=s.shift()+n.nominalWidthX,h=!0),v+=s.pop(),l+=s.pop(),f&&e.U.P.closePath(o),e.U.P.moveTo(o,l,v),f=!0;else if("o22"==P)s.length>1&&!h&&(d=s.shift()+n.nominalWidthX,h=!0),l+=s.pop(),f&&e.U.P.closePath(o),e.U.P.moveTo(o,l,v),f=!0;else if("o25"==P){for(;s.length>6;)l+=s.shift(),v+=s.shift(),e.U.P.lineTo(o,l,v);c=l+s.shift(),p=v+s.shift(),U=c+s.shift(),g=p+s.shift(),l=U+s.shift(),v=g+s.shift(),e.U.P.curveTo(o,c,p,U,g,l,v)}else if("o26"==P)for(s.length%2&&(l+=s.shift());s.length>0;)c=l,p=v+s.shift(),l=U=c+s.shift(),v=(g=p+s.shift())+s.shift(),e.U.P.curveTo(o,c,p,U,g,l,v);else if("o27"==P)for(s.length%2&&(v+=s.shift());s.length>0;)p=v,U=(c=l+s.shift())+s.shift(),g=p+s.shift(),l=U+s.shift(),v=g,e.U.P.curveTo(o,c,p,U,g,l,v);else if("o10"==P||"o29"==P){var L="o10"==P?n:a;if(0==s.length)console.debug("error: empty stack");else{var W=s.pop(),M=L.Subrs[W+L.Bias];t.x=l,t.y=v,t.nStems=i,t.haveWidth=h,t.width=d,t.open=f,e.U._drawCFF(M,t,a,n,o),l=t.x,v=t.y,i=t.nStems,h=t.haveWidth,d=t.width,f=t.open}}else if("o30"==P||"o31"==P){var V=s.length,E=(G=0,"o31"==P);for(G+=V-(x=-3&V);G>>1|(21845&g)<<1;h=(61680&(h=(52428&h)>>>2|(13107&h)<<2))>>>4|(3855&h)<<4,c[g]=((65280&h)>>>8|(255&h)<<8)>>>1}var w=function(r,e,t){for(var a=r.length,i=0,o=new n(e);i>>v]=s}else for(f=new n(a),i=0;i>>15-r[i]);return f},d=new e(288);for(g=0;g<144;++g)d[g]=8;for(g=144;g<256;++g)d[g]=9;for(g=256;g<280;++g)d[g]=7;for(g=280;g<288;++g)d[g]=8;var m=new e(32);for(g=0;g<32;++g)m[g]=5;var b=w(d,9,1),p=w(m,5,1),y=function(r){for(var e=r[0],n=1;ne&&(e=r[n]);return e},L=function(r,e,n){var t=e/8|0;return(r[t]|r[t+1]<<8)>>(7&e)&n},U=function(r,e){var n=e/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(7&e)},k=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],T=function(r,e,n){var t=new Error(e||k[r]);if(t.code=r,Error.captureStackTrace&&Error.captureStackTrace(t,T),!n)throw t;return t},O=function(r,f,u){var s=r.length;if(!s||u&&!u.l&&s<5)return f||new e(0);var c=!f||u,g=!u||u.i;u||(u={}),f||(f=new e(3*s));var h,d=function(r){var n=f.length;if(r>n){var t=new e(Math.max(2*n,r));t.set(f),f=t}},m=u.f||0,k=u.p||0,O=u.b||0,A=u.l,x=u.d,E=u.m,D=u.n,M=8*s;do{if(!A){u.f=m=L(r,k,1);var S=L(r,k+1,3);if(k+=3,!S){var V=r[(I=((h=k)/8|0)+(7&h&&1)+4)-4]|r[I-3]<<8,_=I+V;if(_>s){g&&T(0);break}c&&d(O+V),f.set(r.subarray(I,_),O),u.b=O+=V,u.p=k=8*_;continue}if(1==S)A=b,x=p,E=9,D=5;else if(2==S){var j=L(r,k,31)+257,z=L(r,k+10,15)+4,C=j+L(r,k+5,31)+1;k+=14;for(var F=new e(C),P=new e(19),q=0;q>>4)<16)F[q++]=I;else{var K=0,N=0;for(16==I?(N=3+L(r,k,3),k+=2,K=F[q-1]):17==I?(N=3+L(r,k,7),k+=3):18==I&&(N=11+L(r,k,127),k+=7);N--;)F[q++]=K}}var Q=F.subarray(0,j),R=F.subarray(j);E=y(Q),D=y(R),A=w(Q,E,1),x=w(R,D,1)}else T(1);if(k>M){g&&T(0);break}}c&&d(O+131072);for(var W=(1<>>4;if((k+=15&K)>M){g&&T(0);break}if(K||T(2),Z<256)f[O++]=Z;else{if(256==Z){Y=k,A=null;break}var $=Z-254;if(Z>264){var rr=a[q=Z-257];$=L(r,k,(1<>>4;if(er||T(3),k+=15&er,R=l[nr],nr>3&&(rr=i[nr],R+=U(r,k)&(1<M){g&&T(0);break}c&&d(O+131072);for(var tr=O+$;Or.length)&&(i=r.length);var o=new(r instanceof n?n:r instanceof t?t:e)(i-a);return o.set(r.subarray(a,i)),o}(f,0,O)},A=new e(0),x="undefined"!=typeof TextDecoder&&new TextDecoder;try{x.decode(A,{stream:!0})}catch(r){}return r.convert_streams=function(r){var e=new DataView(r),n=0;function t(){var r=e.getUint16(n);return n+=2,r}function a(){var r=e.getUint32(n);return n+=4,r}function i(r){m.setUint16(b,r),b+=2}function o(r){m.setUint32(b,r),b+=4}for(var f={signature:a(),flavor:a(),length:a(),numTables:t(),reserved:t(),totalSfntSize:a(),majorVersion:t(),minorVersion:t(),metaOffset:a(),metaLength:a(),metaOrigLength:a(),privOffset:a(),privLength:a()},u=0;Math.pow(2,u)<=f.numTables;)u++;u--;for(var v=16*Math.pow(2,u),s=16*f.numTables-v,l=12,c=[],g=0;g{let[skip,step]=range.split("+");skip=parseInt(skip,36),step=step?parseInt(step,36):0,joiningTypeMap.set(lastCode+=skip,m[type]);for(let i=step;i--;)joiningTypeMap.set(++lastCode,m[type])}))}}return joiningTypeMap.get(ch)||JT_NON_JOINING}const ISOL=1,INIT=2,FINA=3,MEDI=4,formsToFeatures=[null,"isol","init","fina","medi"];function detectJoiningForms(str){const joiningForms=new Uint8Array(str.length);let prevJoiningType=JT_NON_JOINING,prevForm=ISOL,prevIndex=-1;for(let i=0;i65535&&i++)}return joiningForms}function getGlyphClass(font,glyphId){const classDef=font.GDEF&&font.GDEF.glyphClassDef;return classDef?Typr.U._getGlyphClass(glyphId,classDef):0}function firstNum(...args){for(let i=0;i0},forEachGlyph(text,fontSize,letterSpacing,callback){let penX=0;const fontScale=1/fontObj.unitsPerEm*fontSize,glyphIds=function stringToGlyphs(font,str){const glyphIds=[];for(let i=0;i65535&&i++,glyphIds.push(Typr.U.codeToGlyph(font,cc))}const gsub=font.GSUB;if(gsub){const{lookupList:lookupList,featureList:featureList}=gsub;let joiningForms;const supportedFeatures=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,usedLookups=[];featureList.forEach((feature=>{if(supportedFeatures.test(feature.tag))for(let ti=0;ti=0;i--)if(-1!==glyphIds[i]&&(!filter||filter(glyphIds[i])))return i;return-1}function isBaseGlyph(glyphId){return 1===getGlyphClass(font,glyphId)}function applyValueRecord(source,gi){for(let i=0;i<3;i++)positions[3*gi+i]+=source[i]||0}}(typrFont,glyphIds);return glyphIds.forEach(((glyphId,i)=>{if(-1!==glyphId){let glyphObj=glyphMap[glyphId];if(!glyphObj){const{cmds:cmds,crds:crds}=Typr.U.glyphToPath(typrFont,glyphId);let xMin,yMin,xMax,yMax,path="",crdsIdx=0;for(let i=0,len=cmds.length;i1?",":"")+crds[crdsIdx++]}if(crds.length){xMin=yMin=1/0,xMax=yMax=-1/0;for(let i=0,len=crds.length;ixMax&&(xMax=x),y>yMax&&(yMax=y)}}else xMin=xMax=yMin=yMax=0;glyphObj=glyphMap[glyphId]={index:glyphId,advanceWidth:typrFont.hmtx.aWidth[glyphId],xMin:xMin,yMin:yMin,xMax:xMax,yMax:yMax,path:path}}callback.call(null,glyphObj,penX+positions[3*i]*fontScale,positions[3*i+1]*fontScale,charIndex),penX+=positions[3*i+2]*fontScale,letterSpacing&&(penX+=letterSpacing*fontSize)}charIndex+=text.codePointAt(charIndex)>65535?2:1})),penX}};return fontObj}return function parse(buffer){const peek=new Uint8Array(buffer,0,4),tag=Typr._bin.readASCII(peek,0,4);if("wOFF"===tag)buffer=woff2otf(buffer);else if("wOF2"===tag)throw new Error("woff2 fonts not supported");return wrapFontObj(Typr.parse(buffer)[0])}}],init(typrFactory,woff2otfFactory,parserFactory){return parserFactory(typrFactory(),woff2otfFactory())}});const fontResolverWorkerModule=defineWorkerModule({name:"FontResolver",dependencies:[function createFontResolver(fontParser,unicodeFontResolverClient){const parsedFonts=Object.create(null),loadingFonts=Object.create(null);function loadFont(fontUrl,callback){let font=parsedFonts[fontUrl];font?callback(font):loadingFonts[fontUrl]?loadingFonts[fontUrl].push(callback):(loadingFonts[fontUrl]=[callback],function doLoadFont(url,callback){const onError=err=>{console.error(`Failure loading font ${url}`,err)};try{const request=new XMLHttpRequest;request.open("get",url,!0),request.responseType="arraybuffer",request.onload=function(){if(request.status>=400)onError(new Error(request.statusText));else if(request.status>0)try{const fontObj=fontParser(request.response);fontObj.src=url,callback(fontObj)}catch(e){onError(e)}},request.onerror=onError,request.send()}catch(err){onError(err)}}(fontUrl,(fontObj=>{fontObj.src=fontUrl,parsedFonts[fontUrl]=fontObj,loadingFonts[fontUrl].forEach((cb=>cb(fontObj))),delete loadingFonts[fontUrl]})))}return function(text,callback,{lang:lang,fonts:userFonts=[],style:style="normal",weight:weight="normal",unicodeFontsURL:unicodeFontsURL}={}){const charResolutions=new Uint8Array(text.length),fontResolutions=[];text.length||allDone();const fontIndices=new Map,fallbackRanges=[];if("italic"!==style&&(style="normal"),"number"!=typeof weight&&(weight="bold"===weight?700:400),userFonts&&!Array.isArray(userFonts)&&(userFonts=[userFonts]),(userFonts=userFonts.slice().filter((def=>!def.lang||def.lang.test(lang))).reverse()).length){const RESOLVED=1,NEEDS_FALLBACK=2;let prevCharResult=0;!function resolveUserFonts(startIndex=0){for(let i=startIndex,iLen=text.length;i{resolveUserFonts(i)}));if(fontObj.supportsCodePoint(codePoint)){let fontIndex=fontIndices.get(fontObj);"number"!=typeof fontIndex&&(fontIndex=fontResolutions.length,fontResolutions.push(fontObj),fontIndices.set(fontObj,fontIndex)),charResolutions[i]=fontIndex,prevCharResult=RESOLVED;break}}}codePoint>65535&&i+1text.substring(range[0],range[1]+1))).join("\n");unicodeFontResolverClient.getFontsForString(fallbackString,{lang:lang||void 0,style:style,weight:weight,dataUrl:unicodeFontsURL}).then((({fontUrls:fontUrls,chars:chars})=>{const fontIndexOffset=fontResolutions.length;let charIdx=0;fallbackRanges.forEach((range=>{for(let i=0,endIdx=range[1]-range[0];i<=endIdx;i++)charResolutions[range[0]+i]=chars[charIdx++]+fontIndexOffset;charIdx++}));let loadedCount=0;fontUrls.forEach(((url,i)=>{loadFont(url,(fontObj=>{fontResolutions[i+fontIndexOffset]=fontObj,++loadedCount===fontUrls.length&&allDone()}))}))}))}else allDone()}function allDone(){callback({chars:charResolutions,fonts:fontResolutions})}function isCodeInRanges(code,ranges){for(let k=0;k>5;this.buckets.set(n,(this.buckets.get(n)||0)|1<<(31&t))},n.prototype.has=function(t){var n=this.buckets.get(t>>5);return void 0!==n&&0!=(n&1<<(31&t))},n.prototype.serialize=function(){var t=[];return this.buckets.forEach((function(n,r){t.push((+r).toString(36)+":"+n.toString(36))})),t.join(",")},n.prototype.deserialize=function(t){var n=this;this.buckets.clear(),t.split(",").forEach((function(t){var r=t.split(":");n.buckets.set(parseInt(r[0],36),parseInt(r[1],36))}))};var r=Math.pow(2,8),e=r-1,o=~e;function a(t){var n=function(t){return t&o}(t).toString(16),e=function(t){return(t&o)+r-1}(t).toString(16);return"codepoint-index/plane"+(t>>16)+"/"+n+"-"+e+".json"}function i(t,n){var r=t&e,o=n.codePointAt(r/6|0);return 0!=((o=(o||48)-48)&1<65535&&(n++,E=n)},E=0;E65535&&(n++,r=n)},r=0;r65535&&(e++,y[e]=y[e-1])}return{fontUrls:Array.from(h.keys()),chars:y}}))},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}],init(createFontResolver,fontParser,unicodeFontResolverClientFactory){return createFontResolver(fontParser,unicodeFontResolverClientFactory())}});const now=()=>(self.performance||Date).now(),mainThreadGenerator=SDFGenerator();let warned;const queue=[];let timer=0;function nextChunk(){const start=now();for(;queue.length&&now()-start<5;)queue.shift()();timer=queue.length?setTimeout(nextChunk,0):0}const generateSDF_GL=(...args)=>new Promise(((resolve,reject)=>{queue.push((()=>{const start=now();try{mainThreadGenerator.webgl.generateIntoCanvas(...args),resolve({timing:now()-start})}catch(err){reject(err)}})),timer||(timer=setTimeout(nextChunk,0))})),threadCount=4,idleTimeout=2e3,threads={};let callNum=0;function generateSDF_JS_Worker(width,height,path,viewBox,distance,exponent,canvas,x,y,channel){const workerId="TroikaTextSDFGenerator_JS_"+callNum++%threadCount;let thread=threads[workerId];return thread||(thread=threads[workerId]={workerModule:defineWorkerModule({name:workerId,workerId:workerId,dependencies:[SDFGenerator,now],init(_createSDFGenerator,now){const generate=_createSDFGenerator().javascript.generate;return function(...args){const start=now();return{textureData:generate(...args),timing:now()-start}}},getTransferables(result){return[result.textureData.buffer]}}),requests:0,idleTimer:null}),thread.requests++,clearTimeout(thread.idleTimer),thread.workerModule(width,height,path,viewBox,distance,exponent).then((({textureData:textureData,timing:timing})=>{const start=now(),imageData=new Uint8Array(4*textureData.length);for(let i=0;i{!function terminateWorker(workerId){registeredModules[workerId]&®isteredModules[workerId].forEach((function(unregister){unregister()})),workers[workerId]&&(workers[workerId].terminate(),delete workers[workerId])}(workerId)}),idleTimeout)),{timing:timing}}))}const resizeWebGLCanvasWithoutClearing=mainThreadGenerator.webglUtils.resizeWebGLCanvasWithoutClearing,CONFIG={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},tempColor=new three_module.Color;let hasRequested=!1;function now$1(){return(self.performance||Date).now()}const atlases=Object.create(null);function getTextRenderInfo(args,callback){hasRequested=!0,args=troika_three_text_esm_assign({},args);const totalStart=now$1(),{defaultFontURL:defaultFontURL}=CONFIG,fonts=[];if(defaultFontURL&&fonts.push({label:"default",src:toAbsoluteURL(defaultFontURL)}),args.font&&fonts.push({label:"user",src:toAbsoluteURL(args.font)}),args.font=fonts,args.text=""+args.text,args.sdfGlyphSize=args.sdfGlyphSize||CONFIG.sdfGlyphSize,args.unicodeFontsURL=args.unicodeFontsURL||CONFIG.unicodeFontsURL,null!=args.colorRanges){let colors={};for(let key in args.colorRanges)if(args.colorRanges.hasOwnProperty(key)){let val=args.colorRanges[key];"number"!=typeof val&&(val=tempColor.set(val).getHex()),colors[key]=val}args.colorRanges=colors}Object.freeze(args);const{textureWidth:textureWidth,sdfExponent:sdfExponent}=CONFIG,{sdfGlyphSize:sdfGlyphSize}=args,glyphsPerRow=textureWidth/sdfGlyphSize*4;let atlas=atlases[sdfGlyphSize];if(!atlas){const canvas=document.createElement("canvas");canvas.width=textureWidth,canvas.height=256*sdfGlyphSize/glyphsPerRow,atlas=atlases[sdfGlyphSize]={glyphCount:0,sdfGlyphSize:sdfGlyphSize,sdfCanvas:canvas,sdfTexture:new three_module.Texture(canvas,void 0,void 0,void 0,three_module.LinearFilter,three_module.LinearFilter),contextLost:!1,glyphsByFont:new Map},atlas.sdfTexture.generateMipmaps=!1,function initContextLossHandling(atlas){const canvas=atlas.sdfCanvas;canvas.addEventListener("webglcontextlost",(event=>{console.log("Context Lost",event),event.preventDefault(),atlas.contextLost=!0})),canvas.addEventListener("webglcontextrestored",(event=>{console.log("Context Restored",event),atlas.contextLost=!1;const promises=[];atlas.glyphsByFont.forEach((glyphMap=>{glyphMap.forEach((glyph=>{promises.push(generateGlyphSDF(glyph,atlas,!0))}))})),Promise.all(promises).then((()=>{safariPre15Workaround(atlas),atlas.sdfTexture.needsUpdate=!0}))}))}(atlas)}const{sdfTexture:sdfTexture,sdfCanvas:sdfCanvas}=atlas;typesetInWorker(args).then((result=>{const{glyphIds:glyphIds,glyphFontIndices:glyphFontIndices,fontData:fontData,glyphPositions:glyphPositions,fontSize:fontSize,timings:timings}=result,neededSDFs=[],glyphBounds=new Float32Array(4*glyphIds.length);let boundsIdx=0,positionsIdx=0;const quadsStart=now$1(),fontGlyphMaps=fontData.map((font=>{let map=atlas.glyphsByFont.get(font.src);return map||atlas.glyphsByFont.set(font.src,map=new Map),map}));glyphIds.forEach(((glyphId,i)=>{const fontIndex=glyphFontIndices[i],{src:fontSrc,unitsPerEm:unitsPerEm}=fontData[fontIndex];let glyphInfo=fontGlyphMaps[fontIndex].get(glyphId);if(!glyphInfo){const{path:path,pathBounds:pathBounds}=result.glyphData[fontSrc][glyphId],fontUnitsMargin=Math.max(pathBounds[2]-pathBounds[0],pathBounds[3]-pathBounds[1])/sdfGlyphSize*(CONFIG.sdfMargin*sdfGlyphSize+.5),atlasIndex=atlas.glyphCount++,sdfViewBox=[pathBounds[0]-fontUnitsMargin,pathBounds[1]-fontUnitsMargin,pathBounds[2]+fontUnitsMargin,pathBounds[3]+fontUnitsMargin];fontGlyphMaps[fontIndex].set(glyphId,glyphInfo={path:path,atlasIndex:atlasIndex,sdfViewBox:sdfViewBox}),neededSDFs.push(glyphInfo)}const{sdfViewBox:sdfViewBox}=glyphInfo,posX=glyphPositions[positionsIdx++],posY=glyphPositions[positionsIdx++],fontSizeMult=fontSize/unitsPerEm;glyphBounds[boundsIdx++]=posX+sdfViewBox[0]*fontSizeMult,glyphBounds[boundsIdx++]=posY+sdfViewBox[1]*fontSizeMult,glyphBounds[boundsIdx++]=posX+sdfViewBox[2]*fontSizeMult,glyphBounds[boundsIdx++]=posY+sdfViewBox[3]*fontSizeMult,glyphIds[i]=glyphInfo.atlasIndex})),timings.quads=(timings.quads||0)+(now$1()-quadsStart);const sdfStart=now$1();timings.sdf={};const currentHeight=sdfCanvas.height,neededRows=Math.ceil(atlas.glyphCount/glyphsPerRow),neededHeight=Math.pow(2,Math.ceil(Math.log2(neededRows*sdfGlyphSize)));neededHeight>currentHeight&&(console.info(`Increasing SDF texture size ${currentHeight}->${neededHeight}`),resizeWebGLCanvasWithoutClearing(sdfCanvas,textureWidth,neededHeight),sdfTexture.dispose()),Promise.all(neededSDFs.map((glyphInfo=>generateGlyphSDF(glyphInfo,atlas,args.gpuAccelerateSDF).then((({timing:timing})=>{timings.sdf[glyphInfo.atlasIndex]=timing}))))).then((()=>{neededSDFs.length&&!atlas.contextLost&&(safariPre15Workaround(atlas),sdfTexture.needsUpdate=!0),timings.sdfTotal=now$1()-sdfStart,timings.total=now$1()-totalStart,callback(Object.freeze({parameters:args,sdfTexture:sdfTexture,sdfGlyphSize:sdfGlyphSize,sdfExponent:sdfExponent,glyphBounds:glyphBounds,glyphAtlasIndices:glyphIds,glyphColors:result.glyphColors,caretPositions:result.caretPositions,chunkedBounds:result.chunkedBounds,ascender:result.ascender,descender:result.descender,lineHeight:result.lineHeight,capHeight:result.capHeight,xHeight:result.xHeight,topBaseline:result.topBaseline,blockBounds:result.blockBounds,visibleBounds:result.visibleBounds,timings:result.timings}))}))})),Promise.resolve().then((()=>{atlas.contextLost||function warmUpSDFCanvas(canvas){canvas._warm||(mainThreadGenerator.webgl.isSupported(canvas),canvas._warm=!0)}(sdfCanvas)}))}function generateGlyphSDF({path:path,atlasIndex:atlasIndex,sdfViewBox:sdfViewBox},{sdfGlyphSize:sdfGlyphSize,sdfCanvas:sdfCanvas,contextLost:contextLost},useGPU){if(contextLost)return Promise.resolve({timing:-1});const{textureWidth:textureWidth,sdfExponent:sdfExponent}=CONFIG,maxDist=Math.max(sdfViewBox[2]-sdfViewBox[0],sdfViewBox[3]-sdfViewBox[1]),squareIndex=Math.floor(atlasIndex/4);return function generateSDF(width,height,path,viewBox,distance,exponent,canvas,x,y,channel,useWebGL=!0){return useWebGL?generateSDF_GL(width,height,path,viewBox,distance,exponent,canvas,x,y,channel).then(null,(err=>(warned||(console.warn("WebGL SDF generation failed, falling back to JS",err),warned=!0),generateSDF_JS_Worker(width,height,path,viewBox,distance,exponent,canvas,x,y,channel)))):generateSDF_JS_Worker(width,height,path,viewBox,distance,exponent,canvas,x,y,channel)}(sdfGlyphSize,sdfGlyphSize,path,sdfViewBox,maxDist,sdfExponent,sdfCanvas,squareIndex%(textureWidth/sdfGlyphSize)*sdfGlyphSize,Math.floor(squareIndex/(textureWidth/sdfGlyphSize))*sdfGlyphSize,atlasIndex%4,useGPU)}function troika_three_text_esm_assign(toObj,fromObj){for(let key in fromObj)fromObj.hasOwnProperty(key)&&(toObj[key]=fromObj[key]);return toObj}let linkEl;function toAbsoluteURL(path){return linkEl||(linkEl="undefined"==typeof document?{}:document.createElement("a")),linkEl.href=path,linkEl.href}function safariPre15Workaround(atlas){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:sdfCanvas,sdfTexture:sdfTexture}=atlas,{width:width,height:height}=sdfCanvas,gl=atlas.sdfCanvas.getContext("webgl");let pixels=sdfTexture.image.data;pixels&&pixels.length===width*height*4||(pixels=new Uint8Array(width*height*4),sdfTexture.image={width:width,height:height,data:pixels},sdfTexture.flipY=!1,sdfTexture.isDataTexture=!0),gl.readPixels(0,0,width,height,gl.RGBA,gl.UNSIGNED_BYTE,pixels)}}const typesetterWorkerModule=defineWorkerModule({name:"Typesetter",dependencies:[function createTypesetter(resolveFonts,bidi){const INF=1/0,DEFAULT_IGNORABLE_CHARS=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,lineBreakingWhiteSpace="[^\\S\\u00A0]",BREAK_AFTER_CHARS=new RegExp(`${lineBreakingWhiteSpace}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function typeset({text:text="",font:font,lang:lang,sdfGlyphSize:sdfGlyphSize=64,fontSize:fontSize=400,fontWeight:fontWeight=1,fontStyle:fontStyle="normal",letterSpacing:letterSpacing=0,lineHeight:lineHeight="normal",maxWidth:maxWidth=INF,direction:direction,textAlign:textAlign="left",textIndent:textIndent=0,whiteSpace:whiteSpace="normal",overflowWrap:overflowWrap="normal",anchorX:anchorX=0,anchorY:anchorY=0,metricsOnly:metricsOnly=!1,unicodeFontsURL:unicodeFontsURL,preResolvedFonts:preResolvedFonts=null,includeCaretPositions:includeCaretPositions=!1,chunkedBoundsSize:chunkedBoundsSize=8192,colorRanges:colorRanges=null},callback){const mainStart=now(),timings={fontLoad:0,typesetting:0};text.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),text=text.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),fontSize=+fontSize,letterSpacing=+letterSpacing,maxWidth=+maxWidth,lineHeight=lineHeight||"normal",textIndent=+textIndent,function calculateFontRuns({text:text,lang:lang,fonts:fonts,style:style,weight:weight,preResolvedFonts:preResolvedFonts,unicodeFontsURL:unicodeFontsURL},onDone){const onResolved=({chars:chars,fonts:parsedFonts})=>{let curRun,prevVal;const runs=[];for(let i=0;i{timings.fontLoad=now()-mainStart;const hasMaxWidth=isFinite(maxWidth);let glyphIds=null,glyphFontIndices=null,glyphPositions=null,glyphData=null,glyphColors=null,caretPositions=null,visibleBounds=null,chunkedBounds=null,maxLineWidth=0,renderableGlyphCount=0,canWrap="nowrap"!==whiteSpace;const metricsByFont=new Map,typesetStart=now();let lineXOffset=textIndent,prevRunEndX=0,currentLine=new TextLine;const lines=[currentLine];runs.forEach((run=>{const{fontObj:fontObj}=run,{ascender:ascender,descender:descender,unitsPerEm:unitsPerEm,lineGap:lineGap,capHeight:capHeight,xHeight:xHeight}=fontObj;let fontData=metricsByFont.get(fontObj);if(!fontData){const fontSizeMult=fontSize/unitsPerEm,calcLineHeight="normal"===lineHeight?(ascender-descender+lineGap)*fontSizeMult:lineHeight*fontSize,halfLeading=(calcLineHeight-(ascender-descender)*fontSizeMult)/2,caretHeight=Math.min(calcLineHeight,(ascender-descender)*fontSizeMult),caretTop=(ascender+descender)/2*fontSizeMult+caretHeight/2;fontData={index:metricsByFont.size,src:fontObj.src,fontObj:fontObj,fontSizeMult:fontSizeMult,unitsPerEm:unitsPerEm,ascender:ascender*fontSizeMult,descender:descender*fontSizeMult,capHeight:capHeight*fontSizeMult,xHeight:xHeight*fontSizeMult,lineHeight:calcLineHeight,baseline:-halfLeading-ascender*fontSizeMult,caretTop:caretTop,caretBottom:caretTop-caretHeight},metricsByFont.set(fontObj,fontData)}const{fontSizeMult:fontSizeMult}=fontData,runText=text.slice(run.start,run.end+1);let prevGlyphX,prevGlyphObj;fontObj.forEachGlyph(runText,fontSize,letterSpacing,((glyphObj,glyphX,glyphY,charIndex)=>{glyphX+=prevRunEndX,charIndex+=run.start,prevGlyphX=glyphX,prevGlyphObj=glyphObj;const char=text.charAt(charIndex),glyphWidth=glyphObj.advanceWidth*fontSizeMult,curLineCount=currentLine.count;let nextLine;if("isEmpty"in glyphObj||(glyphObj.isWhitespace=!!char&&new RegExp(lineBreakingWhiteSpace).test(char),glyphObj.canBreakAfter=!!char&&BREAK_AFTER_CHARS.test(char),glyphObj.isEmpty=glyphObj.xMin===glyphObj.xMax||glyphObj.yMin===glyphObj.yMax||DEFAULT_IGNORABLE_CHARS.test(char)),glyphObj.isWhitespace||glyphObj.isEmpty||renderableGlyphCount++,canWrap&&hasMaxWidth&&!glyphObj.isWhitespace&&glyphX+glyphWidth+lineXOffset>maxWidth&&curLineCount){if(currentLine.glyphAt(curLineCount-1).glyphObj.canBreakAfter)nextLine=new TextLine,lineXOffset=-glyphX;else for(let i=curLineCount;i--;){if(0===i&&"break-word"===overflowWrap){nextLine=new TextLine,lineXOffset=-glyphX;break}if(currentLine.glyphAt(i).glyphObj.canBreakAfter){nextLine=currentLine.splitAt(i+1);const adjustX=nextLine.glyphAt(0).x;lineXOffset-=adjustX;for(let j=nextLine.count;j--;)nextLine.glyphAt(j).x-=adjustX;break}}nextLine&&(currentLine.isSoftWrapped=!0,currentLine=nextLine,lines.push(currentLine),maxLineWidth=maxWidth)}let fly=currentLine.glyphAt(currentLine.count);fly.glyphObj=glyphObj,fly.x=glyphX+lineXOffset,fly.y=glyphY,fly.width=glyphWidth,fly.charIndex=charIndex,fly.fontData=fontData,"\n"===char&&(currentLine=new TextLine,lines.push(currentLine),lineXOffset=-(glyphX+glyphWidth+letterSpacing*fontSize)+textIndent)})),prevRunEndX=prevGlyphX+prevGlyphObj.advanceWidth*fontSizeMult+letterSpacing*fontSize}));let totalHeight=0;lines.forEach((line=>{let isTrailingWhitespace=!0;for(let i=line.count;i--;){const glyphInfo=line.glyphAt(i);isTrailingWhitespace&&!glyphInfo.glyphObj.isWhitespace&&(line.width=glyphInfo.x+glyphInfo.width,line.width>maxLineWidth&&(maxLineWidth=line.width),isTrailingWhitespace=!1);let{lineHeight:lineHeight,capHeight:capHeight,xHeight:xHeight,baseline:baseline}=glyphInfo.fontData;lineHeight>line.lineHeight&&(line.lineHeight=lineHeight);const baselineDiff=baseline-line.baseline;baselineDiff<0&&(line.baseline+=baselineDiff,line.cap+=baselineDiff,line.ex+=baselineDiff),line.cap=Math.max(line.cap,line.baseline+capHeight),line.ex=Math.max(line.ex,line.baseline+xHeight)}line.baseline-=totalHeight,line.cap-=totalHeight,line.ex-=totalHeight,totalHeight+=line.lineHeight}));let anchorXOffset=0,anchorYOffset=0;if(anchorX&&("number"==typeof anchorX?anchorXOffset=-anchorX:"string"==typeof anchorX&&(anchorXOffset=-maxLineWidth*("left"===anchorX?0:"center"===anchorX?.5:"right"===anchorX?1:parsePercent(anchorX)))),anchorY&&("number"==typeof anchorY?anchorYOffset=-anchorY:"string"==typeof anchorY&&(anchorYOffset="top"===anchorY?0:"top-baseline"===anchorY?-lines[0].baseline:"top-cap"===anchorY?-lines[0].cap:"top-ex"===anchorY?-lines[0].ex:"middle"===anchorY?totalHeight/2:"bottom"===anchorY?totalHeight:"bottom-baseline"===anchorY?-lines[lines.length-1].baseline:parsePercent(anchorY)*totalHeight)),!metricsOnly){const bidiLevelsResult=bidi.getEmbeddingLevels(text,direction);glyphIds=new Uint16Array(renderableGlyphCount),glyphFontIndices=new Uint8Array(renderableGlyphCount),glyphPositions=new Float32Array(2*renderableGlyphCount),glyphData={},visibleBounds=[INF,INF,-INF,-INF],chunkedBounds=[],includeCaretPositions&&(caretPositions=new Float32Array(4*text.length)),colorRanges&&(glyphColors=new Uint8Array(3*renderableGlyphCount));let chunk,currentColor,renderableGlyphIndex=0,prevCharIndex=-1,colorCharIndex=-1;if(lines.forEach(((line,lineIndex)=>{let{count:lineGlyphCount,width:lineWidth}=line;if(lineGlyphCount>0){let trailingWhitespaceCount=0;for(let i=lineGlyphCount;i--&&line.glyphAt(i).glyphObj.isWhitespace;)trailingWhitespaceCount++;let lineXOffset=0,justifyAdjust=0;if("center"===textAlign)lineXOffset=(maxLineWidth-lineWidth)/2;else if("right"===textAlign)lineXOffset=maxLineWidth-lineWidth;else if("justify"===textAlign&&line.isSoftWrapped){let whitespaceCount=0;for(let i=lineGlyphCount-trailingWhitespaceCount;i--;)line.glyphAt(i).glyphObj.isWhitespace&&whitespaceCount++;justifyAdjust=(maxLineWidth-lineWidth)/whitespaceCount}if(justifyAdjust||lineXOffset){let justifyOffset=0;for(let i=0;i=start){let startInLine=i,endInLine=i;for(;endInLineend)break;endInLineglyphObj=g;for(let i=0;i1&&fillLigatureCaretPositions(caretPositions,prevCharIndex,ligCount),prevCharIndex=charIndex}if(colorRanges){const{charIndex:charIndex}=glyphInfo;for(;charIndex>colorCharIndex;)colorCharIndex++,colorRanges.hasOwnProperty(colorCharIndex)&&(currentColor=colorRanges[colorCharIndex])}if(!glyphObj.isWhitespace&&!glyphObj.isEmpty){const idx=renderableGlyphIndex++,{fontSizeMult:fontSizeMult,src:fontSrc,index:fontIndex}=glyphInfo.fontData,fontGlyphData=glyphData[fontSrc]||(glyphData[fontSrc]={});fontGlyphData[glyphId]||(fontGlyphData[glyphId]={path:glyphObj.path,pathBounds:[glyphObj.xMin,glyphObj.yMin,glyphObj.xMax,glyphObj.yMax]});const glyphX=glyphInfo.x+anchorXOffset,glyphY=glyphInfo.y+line.baseline+anchorYOffset;glyphPositions[2*idx]=glyphX,glyphPositions[2*idx+1]=glyphY;const visX0=glyphX+glyphObj.xMin*fontSizeMult,visY0=glyphY+glyphObj.yMin*fontSizeMult,visX1=glyphX+glyphObj.xMax*fontSizeMult,visY1=glyphY+glyphObj.yMax*fontSizeMult;visX0visibleBounds[2]&&(visibleBounds[2]=visX1),visY1>visibleBounds[3]&&(visibleBounds[3]=visY1),idx%chunkedBoundsSize==0&&(chunk={start:idx,end:idx,rect:[INF,INF,-INF,-INF]},chunkedBounds.push(chunk)),chunk.end++;const chunkRect=chunk.rect;if(visX0chunkRect[2]&&(chunkRect[2]=visX1),visY1>chunkRect[3]&&(chunkRect[3]=visY1),glyphIds[idx]=glyphId,glyphFontIndices[idx]=fontIndex,colorRanges){const start=3*idx;glyphColors[start]=currentColor>>16&255,glyphColors[start+1]=currentColor>>8&255,glyphColors[start+2]=255¤tColor}}}}})),caretPositions){const ligCount=text.length-prevCharIndex;ligCount>1&&fillLigatureCaretPositions(caretPositions,prevCharIndex,ligCount)}}const fontData=[];metricsByFont.forEach((({index:index,src:src,unitsPerEm:unitsPerEm,ascender:ascender,descender:descender,lineHeight:lineHeight,capHeight:capHeight,xHeight:xHeight})=>{fontData[index]={src:src,unitsPerEm:unitsPerEm,ascender:ascender,descender:descender,lineHeight:lineHeight,capHeight:capHeight,xHeight:xHeight}})),timings.typesetting=now()-typesetStart,callback({glyphIds:glyphIds,glyphFontIndices:glyphFontIndices,glyphPositions:glyphPositions,glyphData:glyphData,fontData:fontData,caretPositions:caretPositions,glyphColors:glyphColors,chunkedBounds:chunkedBounds,fontSize:fontSize,topBaseline:anchorYOffset+lines[0].baseline,blockBounds:[anchorXOffset,anchorYOffset-totalHeight,anchorXOffset+maxLineWidth,anchorYOffset],visibleBounds:visibleBounds,timings:timings})}))}function parsePercent(str){let match=str.match(/^([\d.]+)%$/),pct=match?parseFloat(match[1]):NaN;return isNaN(pct)?0:pct/100}function fillLigatureCaretPositions(caretPositions,ligStartIndex,ligCount){const ligStartX=caretPositions[4*ligStartIndex],ligEndX=caretPositions[4*ligStartIndex+1],ligBottom=caretPositions[4*ligStartIndex+2],ligTop=caretPositions[4*ligStartIndex+3],guessedAdvanceX=(ligEndX-ligStartX)/ligCount;for(let i=0;i(Object.defineProperty(obj,prop,{get(){return this.data[this.index*textLineProps.length+i]},set(val){this.data[this.index*textLineProps.length+i]=val}}),obj)),{data:null,index:0}),{typeset:typeset,measure:function measure(args,callback){typeset({...args,metricsOnly:!0},(result=>{const[x0,y0,x1,y1]=result.blockBounds;callback({width:x1-x0,height:y1-y0})}))}}},fontResolverWorkerModule,bidi],init(createTypesetter,fontResolver,bidiFactory){return createTypesetter(fontResolver,bidiFactory())}}),typesetInWorker=defineWorkerModule({name:"Typesetter",dependencies:[typesetterWorkerModule],init(typesetter){return function(args){return new Promise((resolve=>{typesetter.typeset(args,resolve)}))}},getTransferables(result){const transferables=[];for(let p in result)result[p]&&result[p].buffer&&transferables.push(result[p].buffer);return transferables}});const templateGeometries={};class GlyphsGeometry extends three_module.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new three_module.Sphere,this.boundingBox=new three_module.Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(side){const verts=this.getIndex().count;this.setDrawRange(side===three_module.BackSide?verts/2:0,side===three_module.DoubleSide?verts:verts/2)}set detail(detail){if(detail!==this._detail){this._detail=detail,("number"!=typeof detail||detail<1)&&(detail=1);let tpl=function getTemplateGeometry(detail){let geom=templateGeometries[detail];if(!geom){const front=new three_module.PlaneGeometry(1,1,detail,detail),back=front.clone(),frontAttrs=front.attributes,backAttrs=back.attributes,combined=new three_module.BufferGeometry,vertCount=frontAttrs.uv.count;for(let i=0;i{combined.setAttribute(name,new three_module.Float32BufferAttribute([...frontAttrs[name].array,...backAttrs[name].array],frontAttrs[name].itemSize))})),combined.setIndex([...front.index.array,...back.index.array.map((n=>n+vertCount))]),combined.translate(.5,.5,0),geom=templateGeometries[detail]=combined}return geom}(detail);["position","normal","uv"].forEach((attr=>{this.attributes[attr]=tpl.attributes[attr].clone()})),this.setIndex(tpl.getIndex().clone())}}get detail(){return this._detail}set curveRadius(r){r!==this._curveRadius&&(this._curveRadius=r,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(glyphBounds,glyphAtlasIndices,blockBounds,chunkedBounds,glyphColors){updateBufferAttr(this,"aTroikaGlyphBounds",glyphBounds,4),updateBufferAttr(this,"aTroikaGlyphIndex",glyphAtlasIndices,1),updateBufferAttr(this,"aTroikaGlyphColor",glyphColors,3),this._blockBounds=blockBounds,this._chunkedBounds=chunkedBounds,this.instanceCount=glyphAtlasIndices.length,this._updateBounds()}_updateBounds(){const bounds=this._blockBounds;if(bounds){const{curveRadius:curveRadius,boundingBox:bbox}=this;if(curveRadius){const{PI:PI,floor:floor,min:min,max:max,sin:sin,cos:cos}=Math,halfPi=PI/2,twoPi=2*PI,absR=Math.abs(curveRadius),leftAngle=bounds[0]/absR,rightAngle=bounds[2]/absR,minX=floor((leftAngle+halfPi)/twoPi)!==floor((rightAngle+halfPi)/twoPi)?-absR:min(sin(leftAngle)*absR,sin(rightAngle)*absR),maxX=floor((leftAngle-halfPi)/twoPi)!==floor((rightAngle-halfPi)/twoPi)?absR:max(sin(leftAngle)*absR,sin(rightAngle)*absR),maxZ=floor((leftAngle+PI)/twoPi)!==floor((rightAngle+PI)/twoPi)?2*absR:max(absR-cos(leftAngle)*absR,absR-cos(rightAngle)*absR);bbox.min.set(minX,bounds[1],curveRadius<0?-maxZ:0),bbox.max.set(maxX,bounds[3],curveRadius<0?0:maxZ)}else bbox.min.set(bounds[0],bounds[1],0),bbox.max.set(bounds[2],bounds[3],0);bbox.getBoundingSphere(this.boundingSphere)}}applyClipRect(clipRect){let count=this.getAttribute("aTroikaGlyphIndex").count,chunks=this._chunkedBounds;if(chunks)for(let i=chunks.length;i--;){count=chunks[i].end;let rect=chunks[i].rect;if(rect[1]clipRect.y&&rect[0]clipRect.x)break}this.instanceCount=count}}function updateBufferAttr(geom,attrName,newArray,itemSize){const attr=geom.getAttribute(attrName);newArray?attr&&attr.array.length===newArray.length?(attr.array.set(newArray),attr.needsUpdate=!0):(geom.setAttribute(attrName,new three_module.InstancedBufferAttribute(newArray,itemSize)),delete geom._maxInstanceCount,geom.dispose()):attr&&geom.deleteAttribute(attrName)}const defaultMaterial=new three_module.MeshBasicMaterial({color:16777215,side:three_module.DoubleSide,transparent:!0}),tempMat4=new three_module.Matrix4,tempVec3a=new three_module.Vector3,tempVec3b=new three_module.Vector3,tempArray=[],origin=new three_module.Vector3;function first(o){return Array.isArray(o)?o[0]:o}let getFlatRaycastMesh=()=>{const mesh=new three_module.Mesh(new three_module.PlaneGeometry(1,1),defaultMaterial);return getFlatRaycastMesh=()=>mesh,mesh},getCurvedRaycastMesh=()=>{const mesh=new three_module.Mesh(new three_module.PlaneGeometry(1,1,32,1),defaultMaterial);return getCurvedRaycastMesh=()=>mesh,mesh};const syncStartEvent={type:"syncstart"},syncCompleteEvent={type:"synccomplete"},SYNCABLE_PROPS=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],COPYABLE_PROPS=SYNCABLE_PROPS.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class Text extends three_module.Mesh{constructor(){super(new GlyphsGeometry,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=8421504,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation="+x+y",this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(callback){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(callback):(this._isSyncing=!0,this.dispatchEvent(syncStartEvent),getTextRenderInfo({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},(textRenderInfo=>{this._isSyncing=!1,this._textRenderInfo=textRenderInfo,this.geometry.updateGlyphs(textRenderInfo.glyphBounds,textRenderInfo.glyphAtlasIndices,textRenderInfo.blockBounds,textRenderInfo.chunkedBounds,textRenderInfo.glyphColors);const queued=this._queuedSyncs;queued&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{queued.forEach((fn=>fn&&fn()))}))),this.dispatchEvent(syncCompleteEvent),callback&&callback()}))))}onBeforeRender(renderer,scene,camera,geometry,material,group){this.sync(),material.isTroikaTextMaterial&&this._prepareForRender(material),material._hadOwnSide=material.hasOwnProperty("side"),this.geometry.setSide(material._actualSide=material.side),material.side=three_module.FrontSide}onAfterRender(renderer,scene,camera,geometry,material,group){material._hadOwnSide?material.side=material._actualSide:delete material.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let derivedMaterial=this._derivedMaterial;const baseMaterial=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=defaultMaterial.clone());if(derivedMaterial&&derivedMaterial.baseMaterial===baseMaterial||(derivedMaterial=this._derivedMaterial=function createTextDerivedMaterial(baseMaterial){const textMaterial=createDerivedMaterial(baseMaterial,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new three_module.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new three_module.Vector4(0,0,0,0)},uTroikaClipRect:{value:new three_module.Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new three_module.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new three_module.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new three_module.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaOutlineOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:vertexShader,fragmentShader:fragmentShader}){let uDiffuseRE=/\buniform\s+vec3\s+diffuse\b/;return uDiffuseRE.test(fragmentShader)&&(fragmentShader=fragmentShader.replace(uDiffuseRE,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),uDiffuseRE.test(vertexShader)||(vertexShader=vertexShader.replace(voidMainRegExp,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:vertexShader,fragmentShader:fragmentShader}}});return textMaterial.transparent=!0,Object.defineProperties(textMaterial,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),textMaterial}(baseMaterial),baseMaterial.addEventListener("dispose",(function onDispose(){baseMaterial.removeEventListener("dispose",onDispose),derivedMaterial.dispose()}))),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let outlineMaterial=derivedMaterial._outlineMtl;return outlineMaterial||(outlineMaterial=derivedMaterial._outlineMtl=Object.create(derivedMaterial,{id:{value:derivedMaterial.id+.1}}),outlineMaterial.isTextOutlineMaterial=!0,outlineMaterial.depthWrite=!1,outlineMaterial.map=null,derivedMaterial.addEventListener("dispose",(function onDispose(){derivedMaterial.removeEventListener("dispose",onDispose),outlineMaterial.dispose()}))),[outlineMaterial,derivedMaterial]}return derivedMaterial}set material(baseMaterial){baseMaterial&&baseMaterial.isTroikaTextMaterial?(this._derivedMaterial=baseMaterial,this._baseMaterial=baseMaterial.baseMaterial):this._baseMaterial=baseMaterial}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(detail){this.geometry.detail=detail}get curveRadius(){return this.geometry.curveRadius}set curveRadius(r){this.geometry.curveRadius=r}get customDepthMaterial(){return first(this.material).getDepthMaterial()}get customDistanceMaterial(){return first(this.material).getDistanceMaterial()}_prepareForRender(material){const isOutline=material.isTextOutlineMaterial,uniforms=material.uniforms,textInfo=this.textRenderInfo;if(textInfo){const{sdfTexture:sdfTexture,blockBounds:blockBounds}=textInfo;uniforms.uTroikaSDFTexture.value=sdfTexture,uniforms.uTroikaSDFTextureSize.value.set(sdfTexture.image.width,sdfTexture.image.height),uniforms.uTroikaSDFGlyphSize.value=textInfo.sdfGlyphSize,uniforms.uTroikaSDFExponent.value=textInfo.sdfExponent,uniforms.uTroikaTotalBounds.value.fromArray(blockBounds),uniforms.uTroikaUseGlyphColors.value=!isOutline&&!!textInfo.glyphColors;let fillOpacity,strokeOpacity,strokeColor,distanceOffset=0,blurRadius=0,strokeWidth=0,offsetX=0,offsetY=0;if(isOutline){let{outlineWidth:outlineWidth,outlineOffsetX:outlineOffsetX,outlineOffsetY:outlineOffsetY,outlineBlur:outlineBlur,outlineOpacity:outlineOpacity}=this;distanceOffset=this._parsePercent(outlineWidth)||0,blurRadius=Math.max(0,this._parsePercent(outlineBlur)||0),fillOpacity=outlineOpacity,offsetX=this._parsePercent(outlineOffsetX)||0,offsetY=this._parsePercent(outlineOffsetY)||0}else strokeWidth=Math.max(0,this._parsePercent(this.strokeWidth)||0),strokeWidth&&(strokeColor=this.strokeColor,uniforms.uTroikaStrokeColor.value.set(null==strokeColor?8421504:strokeColor),strokeOpacity=this.strokeOpacity,null==strokeOpacity&&(strokeOpacity=1)),fillOpacity=this.fillOpacity;uniforms.uTroikaDistanceOffset.value=distanceOffset,uniforms.uTroikaPositionOffset.value.set(offsetX,offsetY),uniforms.uTroikaBlurRadius.value=blurRadius,uniforms.uTroikaStrokeWidth.value=strokeWidth,uniforms.uTroikaStrokeOpacity.value=strokeOpacity,uniforms.uTroikaFillOpacity.value=null==fillOpacity?1:fillOpacity,uniforms.uTroikaCurveRadius.value=this.curveRadius||0;let clipRect=this.clipRect;if(clipRect&&Array.isArray(clipRect)&&4===clipRect.length)uniforms.uTroikaClipRect.value.fromArray(clipRect);else{const pad=100*(this.fontSize||.1);uniforms.uTroikaClipRect.value.set(blockBounds[0]-pad,blockBounds[1]-pad,blockBounds[2]+pad,blockBounds[3]+pad)}this.geometry.applyClipRect(uniforms.uTroikaClipRect.value)}uniforms.uTroikaSDFDebug.value=!!this.debugSDF,material.polygonOffset=!!this.depthOffset,material.polygonOffsetFactor=material.polygonOffsetUnits=this.depthOffset||0;const color=isOutline?this.outlineColor||0:this.color;if(null==color)delete material.color;else{const colorObj=material.hasOwnProperty("color")?material.color:material.color=new three_module.Color;color===colorObj._input&&"object"!=typeof color||colorObj.set(colorObj._input=color)}let orient=this.orientation||"+x+y";if(orient!==material._orientation){let rotMat=uniforms.uTroikaOrient.value;orient=orient.replace(/[^-+xyz]/g,"");let match="+x+y"!==orient&&orient.match(/^([-+])([xyz])([-+])([xyz])$/);if(match){let[,hSign,hAxis,vSign,vAxis]=match;tempVec3a.set(0,0,0)[hAxis]="-"===hSign?1:-1,tempVec3b.set(0,0,0)[vAxis]="-"===vSign?-1:1,tempMat4.lookAt(origin,tempVec3a.cross(tempVec3b),tempVec3b),rotMat.setFromMatrix4(tempMat4)}else rotMat.identity();material._orientation=orient}}_parsePercent(value){if("string"==typeof value){let match=value.match(/^(-?[\d.]+)%$/),pct=match?parseFloat(match[1]):NaN;value=(isNaN(pct)?0:pct/100)*this.fontSize}return value}localPositionToTextCoords(position,target=new three_module.Vector2){target.copy(position);const r=this.curveRadius;return r&&(target.x=Math.atan2(position.x,Math.abs(r)-Math.abs(position.z))*Math.abs(r)),target}worldPositionToTextCoords(position,target=new three_module.Vector2){return tempVec3a.copy(position),this.localPositionToTextCoords(this.worldToLocal(tempVec3a),target)}raycast(raycaster,intersects){const{textRenderInfo:textRenderInfo,curveRadius:curveRadius}=this;if(textRenderInfo){const bounds=textRenderInfo.blockBounds,raycastMesh=curveRadius?getCurvedRaycastMesh():getFlatRaycastMesh(),geom=raycastMesh.geometry,{position:position,uv:uv}=geom.attributes;for(let i=0;i{this[prop]=source[prop]})),this}clone(){return(new this.constructor).copy(this)}}SYNCABLE_PROPS.forEach((prop=>{const privateKey="_private_"+prop;Object.defineProperty(Text.prototype,prop,{get(){return this[privateKey]},set(value){value!==this[privateKey]&&(this[privateKey]=value,this._needsSync=!0)}})}));new WeakMap;new WeakMap;var suspend_react=__webpack_require__("./node_modules/suspend-react/index.js");const Text_Text=react.forwardRef((({sdfGlyphSize:sdfGlyphSize=64,anchorX:anchorX="center",anchorY:anchorY="middle",font:font,fontSize:fontSize=1,children:children,characters:characters,onSync:onSync,...props},ref)=>{const invalidate=(0,index_99983b2d_esm.A)((({invalidate:invalidate})=>invalidate)),[troikaMesh]=react.useState((()=>new Text)),[nodes,text]=react.useMemo((()=>{const n=[];let t="";return react.Children.forEach(children,(child=>{"string"==typeof child||"number"==typeof child?t+=child:n.push(child)})),[n,t]}),[children]);return(0,suspend_react.Rq)((()=>new Promise((res=>function preloadFont({font:font,characters:characters,sdfGlyphSize:sdfGlyphSize},callback){getTextRenderInfo({font:font,sdfGlyphSize:sdfGlyphSize,text:Array.isArray(characters)?characters.join("\n"):""+characters},callback)}({font:font,characters:characters},res)))),["troika-text",font,characters]),react.useLayoutEffect((()=>{troikaMesh.sync((()=>{invalidate(),onSync&&onSync(troikaMesh)}))})),react.useEffect((()=>()=>troikaMesh.dispose()),[troikaMesh]),react.createElement("primitive",(0,esm_extends.Z)({object:troikaMesh,ref:ref,font:font,text:text,anchorX:anchorX,anchorY:anchorY,fontSize:fontSize,sdfGlyphSize:sdfGlyphSize},props),nodes)}));function useEvent(eventName,handler,deps=[],options){const handlerRef=(0,react.useRef)(handler);(0,react.useEffect)((()=>{handlerRef.current=handler}),[handler]),(0,react.useEffect)((()=>{const handler2=event=>{var _a;return null==(_a=handlerRef.current)?void 0:_a.call(handlerRef,event)},context=function onEvent(eventName,handler,options){return(null==options?void 0:options.once)?eventEmitter.once(eventName,handler):eventEmitter.on(eventName,handler)}(eventName,handler2,options);return()=>function offEvent(eventName,handler,options){var _a;eventEmitter.removeListener(eventName,handler,null!=(_a=null==options?void 0:options.context)?_a:null,null==options?void 0:options.once)}(eventName,handler2,{...options,context:context})}),[eventName,null==options?void 0:options.once,...deps])}const TextHighHZ=(0,react.memo)((({isPerf:isPerf,color:color,colorBlind:colorBlind,customData:customData2,isMemory:isMemory,isShadersInfo:isShadersInfo,metric:metric,fontSize:fontSize,offsetY:offsetY=0,offsetX:offsetX,round:round,hasInstance:hasInstance})=>{const{width:w,height:h}=(0,index_99983b2d_esm.A)((s=>s.viewport)),fpsRef=(0,react.useRef)(null),fpsInstanceRef=(0,react.useRef)(null);return useEvent("log",(function updateR3FPerfText([log,gl]){var _a;if(!log||!fpsRef.current)return;if(customData2&&(fpsRef.current.text=(Math.round(getPerf().customData*Math.pow(10,round))/Math.pow(10,round)).toFixed(round)),!metric)return;let info=log[metric];if(isShadersInfo)info=null==(_a=gl.info.programs)?void 0:_a.length;else if("matriceCount"===metric)info=matriceCount.value;else if(!isPerf&&gl.info.render){info=(isMemory?gl.info.memory:gl.info.render)[metric]}if("fps"===metric&&(fpsRef.current.color=getPerf().overclockingFps?colorsGraph(colorBlind).overClock.toString():`rgb(${colorsGraph(colorBlind).fps.toString()})`),fpsRef.current.text=(Math.round(info*Math.pow(10,round))/Math.pow(10,round)).toFixed(round),hasInstance){const infosInstance=gl.info.instance;if(void 0===infosInstance&&"matriceCount"!==metric)return;let infoInstance;infoInstance="matriceCount"===metric?matriceWorldCount.value:infosInstance[metric],infoInstance>0?(fpsRef.current.fontSize=fontSize/1.15,fpsInstanceRef.current.fontSize=info>0?fontSize/1.4:fontSize,fpsRef.current.position.y=h/2-offsetY-fontSize/1.9,fpsInstanceRef.current.text=" ±\t"+(Math.round(infoInstance*Math.pow(10,round))/Math.pow(10,round)).toFixed(round)):(fpsInstanceRef.current.text&&(fpsInstanceRef.current.text=""),fpsRef.current.position.y=h/2-offsetY-fontSize,fpsRef.current.fontSize=fontSize)}matriceCount.value-=1,fpsRef.current.updateMatrix(),fpsRef.current.matrixWorld.copy(fpsRef.current.matrix)})),(0,jsx_runtime.jsxs)(react.Suspense,{fallback:null,children:[(0,jsx_runtime.jsxs)(Text_Text,{textAlign:"justify",matrixAutoUpdate:!1,ref:fpsRef,fontSize:fontSize,position:[-w/2+offsetX+fontSize,h/2-offsetY-fontSize,0],color:color,characters:"0123456789",onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("meshBasicMaterial",{blending:three_module.NormalBlending}),"0"]}),hasInstance&&(0,jsx_runtime.jsx)(Text_Text,{textAlign:"justify",matrixAutoUpdate:!1,ref:fpsInstanceRef,fontSize:8,position:[-w/2+offsetX+fontSize,h/2-offsetY-1.15*fontSize,0],color:"lightgrey",characters:"0123456789",onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:(0,jsx_runtime.jsx)("meshBasicMaterial",{blending:three_module.NormalBlending})})]})})),TextsHighHZ=({colorBlind:colorBlind,customData:customData2,minimal:minimal,matrixUpdate:matrixUpdate})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TextHighHZ,{colorBlind:colorBlind,color:`rgb(${colorsGraph(colorBlind).fps.toString()})`,isPerf:!0,metric:"fps",fontSize:14,offsetX:140,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{color:`rgb(${colorsGraph(colorBlind).cpu.toString()})`,isPerf:!0,metric:"cpu",fontSize:14,offsetX:72,round:3}),(0,jsx_runtime.jsx)(TextHighHZ,{color:`rgb(${colorsGraph(colorBlind).gpu.toString()})`,isPerf:!0,metric:"gpu",fontSize:14,offsetX:10,round:3}),minimal?null:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TextHighHZ,{metric:"calls",fontSize:14,offsetX:200,round:0,hasInstance:!0}),(0,jsx_runtime.jsx)(TextHighHZ,{metric:"triangles",fontSize:14,offsetX:260,round:0,hasInstance:!0}),(0,jsx_runtime.jsx)(TextHighHZ,{isMemory:!0,metric:"geometries",fontSize:14,offsetY:30,offsetX:0,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{isMemory:!0,metric:"textures",fontSize:14,offsetY:30,offsetX:80,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{isShadersInfo:!0,metric:"programs",fontSize:14,offsetY:30,offsetX:140,round:0}),(0,jsx_runtime.jsx)(TextHighHZ,{metric:"lines",fontSize:14,offsetY:30,offsetX:200,round:0,hasInstance:!0}),(0,jsx_runtime.jsx)(TextHighHZ,{metric:"points",fontSize:14,offsetY:30,offsetX:260,round:0,hasInstance:!0}),matrixUpdate&&(0,jsx_runtime.jsx)(TextHighHZ,{isPerf:!0,metric:"matriceCount",fontSize:14,offsetY:30,offsetX:320,round:0,hasInstance:!0})]}),customData2&&(0,jsx_runtime.jsx)(TextHighHZ,{color:`rgb(${colorsGraph(colorBlind).custom.toString()})`,customData:customData2,fontSize:14,offsetY:0,offsetX:minimal?200:320,round:customData2.round||2})]}),ChartCurve=({colorBlind:colorBlind,minimal:minimal,chart:chart={length:120,hz:60}})=>{const curves=(0,react.useMemo)((()=>({fps:new Float32Array(3*chart.length),cpu:new Float32Array(3*chart.length),gpu:new Float32Array(3*chart.length)})),[chart]),fpsRef=(0,react.useRef)(null),fpsMatRef=(0,react.useRef)(null),gpuRef=(0,react.useRef)(null),cpuRef=(0,react.useRef)(null),dummyVec3=(0,react.useMemo)((()=>new three_module.Vector3(0,0,0)),[]),updatePoints=(element,factor=1,ref,viewport)=>{let maxVal=0;const{width:w,height:h}=viewport,chart2=getPerf().chart.data[element];if(!chart2||0===chart2.length)return;const padding=minimal?2:6,paddingTop=minimal?12:50;let len=chart2.length;for(let i=0;imaxVal&&(maxVal=chart2[id]*factor),dummyVec3.set(padding+i/(len-1)*(w-2*padding)-w/2,Math.min(100,chart2[id])*factor/100*(h-2*padding-paddingTop)-h/2,0),dummyVec3.toArray(ref.attributes.position.array,3*i))}ref.attributes.position.needsUpdate=!0};return(0,index_99983b2d_esm.C)((function updateChartCurve({viewport:viewport}){updatePoints("fps",1,fpsRef.current,viewport),fpsMatRef.current&&fpsMatRef.current.color.set(getPerf().overclockingFps?colorsGraph(colorBlind).overClock.toString():`rgb(${colorsGraph(colorBlind).fps.toString()})`),updatePoints("gpu",5,gpuRef.current,viewport),updatePoints("cpu",5,cpuRef.current,viewport)})),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)("line",{onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("bufferGeometry",{ref:fpsRef,children:(0,jsx_runtime.jsx)("bufferAttribute",{attach:"attributes-position",count:chart.length,array:curves.fps,itemSize:3,usage:three_module.DynamicDrawUsage,needsUpdate:!0})}),(0,jsx_runtime.jsx)("lineBasicMaterial",{ref:fpsMatRef,color:`rgb(${colorsGraph(colorBlind).fps.toString()})`,transparent:!0,opacity:.5})]}),(0,jsx_runtime.jsxs)("line",{onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("bufferGeometry",{ref:gpuRef,children:(0,jsx_runtime.jsx)("bufferAttribute",{attach:"attributes-position",count:chart.length,array:curves.gpu,itemSize:3,usage:three_module.DynamicDrawUsage,needsUpdate:!0})}),(0,jsx_runtime.jsx)("lineBasicMaterial",{color:`rgb(${colorsGraph(colorBlind).gpu.toString()})`,transparent:!0,opacity:.5})]}),(0,jsx_runtime.jsxs)("line",{onUpdate:self=>{self.updateMatrix(),matriceCount.value-=1,self.matrixWorld.copy(self.matrix)},children:[(0,jsx_runtime.jsx)("bufferGeometry",{ref:cpuRef,children:(0,jsx_runtime.jsx)("bufferAttribute",{attach:"attributes-position",count:chart.length,array:curves.cpu,itemSize:3,usage:three_module.DynamicDrawUsage,needsUpdate:!0})}),(0,jsx_runtime.jsx)("lineBasicMaterial",{color:`rgb(${colorsGraph(colorBlind).cpu.toString()})`,transparent:!0,opacity:.5})]})]})},ChartUI=({colorBlind:colorBlind,chart:chart,customData:customData,matrixUpdate:matrixUpdate,showGraph:showGraph=!0,antialias:antialias=!0,minimal:minimal})=>{const canvas=(0,react.useRef)(void 0),paused=usePerf((state=>state.paused));return(0,jsx_runtime.jsxs)(Graph,{style:{display:"flex",position:"absolute",height:(minimal?37:showGraph?100:60)+"px",minWidth:""+(minimal?"100px":customData?"370px":"310px")},children:[(0,jsx_runtime.jsx)(react_three_fiber_esm.Xz,{ref:canvas,orthographic:!0,dpr:antialias?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:scene})=>{scene.traverse((obj=>{obj.matrixWorldAutoUpdate=!1,obj.matrixAutoUpdate=!1}))},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",height:(minimal?37:showGraph?100:60)+"px"},children:paused?null:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(Renderer,{}),(0,jsx_runtime.jsx)(TextsHighHZ,{customData:customData,minimal:minimal,matrixUpdate:matrixUpdate}),showGraph&&(0,jsx_runtime.jsx)(ChartCurve,{colorBlind:colorBlind,minimal:minimal,chart:chart})]})}),paused&&(0,jsx_runtime.jsxs)(Graphpc,{children:[(0,jsx_runtime.jsx)(PauseIcon,{})," PAUSED"]})]})},Renderer=()=>((0,index_99983b2d_esm.C)((function updateR3FPerf({gl:gl,scene:scene,camera:camera}){camera.updateMatrix(),matriceCount.value-=1,camera.matrixWorld.copy(camera.matrix),camera.matrixWorldInverse.copy(camera.matrixWorld).invert(),gl.render(scene,camera),matriceWorldCount.value=0,matriceCount.value=0}),1/0),null);var client=__webpack_require__("./node_modules/react-dom/client.js");const HtmlMinimal=(0,react.forwardRef)((({portal:portal,className:className,children:children,name:name,...props},ref)=>{const gl=(0,index_99983b2d_esm.A)((state=>state.gl)),group=(0,react.useRef)(null),rootRef=(0,react.useRef)(null),target=null!=(null==portal?void 0:portal.current)?portal.current:gl.domElement.parentNode;return(0,react.useLayoutEffect)((()=>{if(!group.current||!target)return;const el=document.createElement("div"),root=rootRef.current=(0,client.createRoot)(el);return target.appendChild(el),()=>{root.unmount(),rootRef.current=null,target.removeChild(el)}}),[target]),(0,react.useLayoutEffect)((()=>{const root=rootRef.current;root&&root.render((0,jsx_runtime.jsx)("div",{ref:ref,className:className,children:children}))})),(0,jsx_runtime.jsx)("group",{name:name,...props,ref:group})}));function estimateBytesUsed(geometry){let mem=0;for(let name in geometry.attributes){const attr=geometry.getAttribute(name);mem+=attr.count*attr.itemSize*attr.array.BYTES_PER_ELEMENT}const indices=geometry.getIndex();return mem+=indices?indices.count*indices.itemSize*indices.array.BYTES_PER_ELEMENT:0,mem}const addTextureUniforms=(id,texture)=>({name:id,url:texture.image.currentSrc,encoding:(encoding=>{switch(encoding){case 3e3:return"LinearEncoding";case 3001:return"sRGBEncoding";case 3002:return"RGBEEncoding";case 3003:return"LogLuvEncoding";case 3004:return"RGBM7Encoding";case 3005:return"RGBM16Encoding";case 3006:return"RGBDEncoding";case 3007:return"GammaEncoding";default:return"ClampToEdgeWrapping"}})(texture.encoding),wrapT:(wrap=>{switch(wrap){case 1e3:return"RepeatWrapping";case 1001:default:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping"}})(texture.wrapT),flipY:texture.flipY.toString()}),UniformsGL=({program:program,material:material,setTexNumber:setTexNumber})=>{const gl=usePerf((state=>state.gl)),[uniforms,set]=(0,react.useState)(null);return(0,react.useEffect)((()=>{if(gl){const data=null==program?void 0:program.getUniforms();let TexCount=0;const format=new Map;data.seq.forEach((e=>{if(!e.id.includes("uTroika")&&"isOrthographic"!==e.id&&"uvTransform"!==e.id&&"lightProbe"!==e.id&&"projectionMatrix"!==e.id&&"viewMatrix"!==e.id&&"normalMatrix"!==e.id&&"modelMatrix"!==e.id&&"modelViewMatrix"!==e.id){let values=[],data2={name:e.id};e.cache&&(e.cache.forEach((v=>{void 0!==v&&values.push(v.toString().substring(0,4))})),data2.value=values.join(),material[e.id]&&material[e.id].image&&material[e.id].image&&(TexCount++,data2.value=addTextureUniforms(e.id,material[e.id])),data2.value||(data2.value="empty"),format.set(e.id,data2))}})),material.uniforms&&Object.keys(material.uniforms).forEach((key=>{const uniform=material.uniforms[key];if(uniform.value){const{value:value}=uniform;let data2={name:key};if(key.includes("uTroika"))return;if(value.isTexture)TexCount++,data2.value=addTextureUniforms(key,value);else{let sb=JSON.stringify(value);try{sb=JSON.stringify(value)}catch(_err){sb=value.toString()}data2.value=sb}format.set(key,data2)}})),TexCount>0&&setTexNumber(TexCount),set(format)}}),[]),(0,jsx_runtime.jsx)(ProgramsUL,{children:uniforms&&Array.from(uniforms.values()).map((uniform=>(0,jsx_runtime.jsx)("span",{children:"string"==typeof uniform.value?(0,jsx_runtime.jsx)("li",{children:(0,jsx_runtime.jsxs)("span",{children:[uniform.name," :"," ",(0,jsx_runtime.jsxs)("b",{children:[uniform.value.substring(0,30),uniform.value.length>30?"...":""]})]})}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("li",{children:(0,jsx_runtime.jsxs)("b",{children:[uniform.value.name,":"]})}),(0,jsx_runtime.jsxs)("div",{children:[Object.keys(uniform.value).map((key=>"name"!==key?(0,jsx_runtime.jsx)("div",{children:"url"===key?(0,jsx_runtime.jsx)("a",{href:uniform.value[key],target:"_blank",children:(0,jsx_runtime.jsx)("img",{src:uniform.value[key]})}):(0,jsx_runtime.jsxs)("li",{children:[key,": ",(0,jsx_runtime.jsx)("b",{children:uniform.value[key]})]})},key):null)),(0,jsx_runtime.jsxs)(ProgramConsole,{onClick:()=>{var _a;console.info(material[uniform.value.name]||(null==(_a=null==material?void 0:material.uniforms[uniform.value.name])?void 0:_a.value))},children:["console.info(",uniform.value.name,");"]})]})]})},uniform.name)))})},DynamicDrawCallInfo=({el:el})=>{usePerf((state=>state.log));const gl=usePerf((state=>state.gl));return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:el.drawCounts.total>0&&(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:["Triangle"===el.drawCounts.type?(0,jsx_runtime.jsx)(VercelLogoIcon,{style:{top:"-1px"}}):(0,jsx_runtime.jsx)(ActivityLogIcon,{style:{top:"-1px"}}),el.drawCounts.total,(0,jsx_runtime.jsxs)("small",{children:[el.drawCounts.type,"s"]}),gl&&(0,jsx_runtime.jsxs)(PerfB,{style:{bottom:"-10px",width:"40px",fontWeight:"bold"},children:[el.visible&&!el.material.wireframe?(el2=>{if(!gl)return 0;const res=Math.round(el2.drawCounts.total/(gl.info.render.triangles+gl.info.render.lines+gl.info.render.points)*100*10)/10;return isFinite(res)&&res||0})(el):0,"%"]})]})})},ProgramUI=({el:el})=>{const[showProgram,setShowProgram]=(0,react.useState)(el.visible),[toggleProgram,set]=(0,react.useState)(el.expand),[texNumber,setTexNumber]=(0,react.useState)(0),{meshes:meshes,program:program,material:material}=el;return(0,jsx_runtime.jsxs)(ProgramGeo,{children:[(0,jsx_runtime.jsxs)(ProgramHeader,{onClick:()=>{el.expand=!toggleProgram,Object.keys(meshes).forEach((key=>{meshes[key].material.wireframe=!1})),set(!toggleProgram)},children:[(0,jsx_runtime.jsx)(Toggle,{style:{marginRight:"6px"},children:toggleProgram?(0,jsx_runtime.jsx)("span",{children:(0,jsx_runtime.jsx)(TriangleDownIcon,{})}):(0,jsx_runtime.jsx)("span",{children:(0,jsx_runtime.jsx)(TriangleUpIcon,{})})}),program&&(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(ProgramTitle,{children:program.name}),(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[(0,jsx_runtime.jsx)(LayersIcon,{style:{top:"-1px"}}),Object.keys(meshes).length,(0,jsx_runtime.jsx)("small",{children:Object.keys(meshes).length>1?"users":"user"})]}),texNumber>0&&(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[(0,jsx_runtime.jsx)(ImageIcon,{style:{top:"-1px"}}),texNumber,(0,jsx_runtime.jsx)("small",{children:"tex"})]}),(0,jsx_runtime.jsx)(DynamicDrawCallInfo,{el:el}),"300 es"===material.glslVersion&&(0,jsx_runtime.jsxs)(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[(0,jsx_runtime.jsx)(RocketIcon,{style:{top:"-1px"}}),"300",(0,jsx_runtime.jsx)("small",{children:"es"}),(0,jsx_runtime.jsx)(PerfB,{style:{bottom:"-10px",width:"40px"},children:"glsl"})]})]}),(0,jsx_runtime.jsx)(ToggleVisible,{onPointerEnter:()=>{Object.keys(meshes).forEach((key=>{meshes[key].material.wireframe=!0}))},onPointerLeave:()=>{Object.keys(meshes).forEach((key=>{meshes[key].material.wireframe=!1}))},onClick:e=>{e.stopPropagation(),Object.keys(meshes).forEach((key=>{const mesh=meshes[key],invert=!showProgram;mesh.visible=invert,el.visible=invert,setShowProgram(invert)}))},children:showProgram?(0,jsx_runtime.jsx)(EyeOpenIcon,{}):(0,jsx_runtime.jsx)(EyeNoneIcon,{})})]}),(0,jsx_runtime.jsxs)("div",{style:{maxHeight:toggleProgram?"9999px":0,overflow:"hidden"},children:[(0,jsx_runtime.jsxs)(ProgramsULHeader,{children:[(0,jsx_runtime.jsx)(ButtonIcon,{})," Uniforms:"]}),(0,jsx_runtime.jsx)(UniformsGL,{program:program,material:material,setTexNumber:setTexNumber}),(0,jsx_runtime.jsxs)(ProgramsULHeader,{children:[(0,jsx_runtime.jsx)(CubeIcon,{})," Geometries:"]}),(0,jsx_runtime.jsx)(ProgramsUL,{children:meshes&&Object.keys(meshes).map((key=>meshes[key]&&meshes[key].geometry&&(0,jsx_runtime.jsxs)(ProgramsGeoLi,{children:[(0,jsx_runtime.jsxs)("span",{children:[meshes[key].geometry.type,": "]}),meshes[key].userData&&meshes[key].userData.drawCount&&(0,jsx_runtime.jsxs)("b",{children:[(0,jsx_runtime.jsxs)("div",{children:[meshes[key].userData.drawCount.count,(0,jsx_runtime.jsxs)("small",{children:[" ",meshes[key].userData.drawCount.type,"s"]})]}),(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsxs)("div",{children:[Math.round(estimateBytesUsed(meshes[key].geometry)/1024*1e3)/1e3,"Kb",(0,jsx_runtime.jsx)("small",{children:" memory used"})]})]})]},key)))}),(0,jsx_runtime.jsxs)(ProgramConsole,{onClick:()=>{console.info(material)},children:["console.info(",material.type,")"]})]})]})},ProgramsUI=()=>{usePerf((state=>state.triggerProgramsUpdate));const programs=usePerf((state=>state.programs));return(0,jsx_runtime.jsx)(ProgramsContainer,{children:programs&&Array.from(programs.values()).map((el=>el&&el?(0,jsx_runtime.jsx)(ProgramUI,{el:el},el.material.uuid):null))})},colorsGraph=colorBlind=>({overClock:"#ff6eff",fps:colorBlind?"100, 143, 255":"238,38,110",cpu:colorBlind?"254, 254, 98":"66,226,46",gpu:colorBlind?"254,254,254":"253,151,31",custom:colorBlind?"86,180,233":"40,255,255"}),DynamicUIPerf=({showGraph:showGraph,colorBlind:colorBlind})=>{const overclockingFps=usePerf((s=>s.overclockingFps)),fpsLimit=usePerf((s=>s.fpsLimit));return(0,jsx_runtime.jsxs)(PerfB,{style:showGraph?{color:overclockingFps?colorsGraph(colorBlind).overClock.toString():`rgb(${colorsGraph(colorBlind).fps})`}:{},children:["FPS ",overclockingFps?`${fpsLimit}🚀`:""]})},DynamicUI=({showGraph:showGraph,colorBlind:colorBlind,customData:customData,minimal:minimal})=>{const gl=usePerf((state=>state.gl));return gl?(0,jsx_runtime.jsxs)(PerfIContainer,{children:[(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(LightningBoltIcon,{}),(0,jsx_runtime.jsx)(PerfB,{style:showGraph?{color:`rgb(${colorsGraph(colorBlind).gpu.toString()})`}:{},children:"GPU"}),(0,jsx_runtime.jsx)(PerfSmallI,{children:"ms"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(RulerHorizontalIcon,{}),(0,jsx_runtime.jsx)(PerfB,{style:showGraph?{color:`rgb(${colorsGraph(colorBlind).cpu.toString()})`}:{},children:"CPU"}),(0,jsx_runtime.jsx)(PerfSmallI,{children:"ms"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(LapTimerIcon,{}),(0,jsx_runtime.jsx)(DynamicUIPerf,{showGraph:showGraph,colorBlind:colorBlind})]}),!minimal&&gl&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(TextAlignJustifyIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:1===gl.info.render.calls?"call":"calls"})]}),!minimal&&gl&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(VercelLogoIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Triangles"})]}),customData&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(BarChartIcon,{}),(0,jsx_runtime.jsx)(PerfB,{style:showGraph?{color:`rgb(${colorsGraph(colorBlind).custom})`}:{},children:customData.name}),customData.info&&(0,jsx_runtime.jsx)(PerfSmallI,{children:customData.info})]})]}):null},PerfUI=({showGraph:showGraph,colorBlind:colorBlind,deepAnalyze:deepAnalyze,customData:customData,matrixUpdate:matrixUpdate,openByDefault:openByDefault,minimal:minimal})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(DynamicUI,{showGraph:showGraph,colorBlind:colorBlind,customData:customData,minimal:minimal}),!minimal&&(0,jsx_runtime.jsx)(PerfThree,{matrixUpdate:matrixUpdate,openByDefault:openByDefault,deepAnalyze:deepAnalyze,showGraph:showGraph})]}),InfoUI=({matrixUpdate:matrixUpdate})=>(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(MarginIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Geometries"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(ImageIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Textures"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(ActivityLogIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"shaders"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(MinusIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Lines"})]}),(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(DotIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Points"})]}),matrixUpdate&&(0,jsx_runtime.jsxs)(PerfI,{children:[(0,jsx_runtime.jsx)(DropdownMenuIcon,{}),(0,jsx_runtime.jsx)(PerfB,{children:"Matrices"})]})]}),ToggleEl=({tab:tab,title:title,set:set})=>{const tabStore=usePerf((s=>s.tab));return(0,jsx_runtime.jsx)(Toggle,{className:""+(tabStore===tab?" __perf_toggle_tab_active":""),onClick:()=>{set(!0),setPerf({tab:tab})},children:(0,jsx_runtime.jsx)("span",{children:title})})},PerfThree=({openByDefault:openByDefault,showGraph:showGraph,deepAnalyze:deepAnalyze,matrixUpdate:matrixUpdate})=>{const[show,set]=react.useState(openByDefault);return(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(TabContainers,{show:show,showGraph:showGraph,matrixUpdate:matrixUpdate}),openByDefault&&!deepAnalyze?null:(0,jsx_runtime.jsxs)(ToggleContainer,{className:"__perf_toggle",children:[deepAnalyze&&(0,jsx_runtime.jsx)(ToggleEl,{tab:"programs",title:"Programs",set:set}),deepAnalyze&&(0,jsx_runtime.jsx)(ToggleEl,{tab:"infos",title:"Infos",set:set}),(0,jsx_runtime.jsx)(Toggle,{onClick:()=>{set(!show)},children:show?(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(TriangleDownIcon,{})," Minimize"]}):(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(TriangleUpIcon,{})," More"]})})]})]})},TabContainers=({show:show,showGraph:showGraph,matrixUpdate:matrixUpdate})=>{const tab=usePerf((state=>state.tab));return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(InfoUI,{matrixUpdate:matrixUpdate}),show&&(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsx)(ContainerScroll,{style:{marginTop:showGraph?"38px":0},children:"programs"===tab&&(0,jsx_runtime.jsx)(ProgramsUI,{})})})]})},Perf=({showGraph:showGraph=!0,colorBlind:colorBlind=!1,openByDefault:openByDefault=!0,className:className,overClock:overClock=!1,style:style,position:position="top-right",chart:chart,logsPerSecond:logsPerSecond,deepAnalyze:deepAnalyze=!1,antialias:antialias=!0,customData:customData,matrixUpdate:matrixUpdate,minimal:minimal})=>{const perfContainerRef=(0,react.useRef)(null);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(PerfHeadless,{logsPerSecond:logsPerSecond,chart:chart,overClock:overClock,deepAnalyze:deepAnalyze,matrixUpdate:matrixUpdate}),(0,jsx_runtime.jsx)(HtmlMinimal,{name:"r3f-perf",children:(0,jsx_runtime.jsxs)(PerfS,{className:(className?" ".concat(className):" ")+` ${position||""} ${minimal?"minimal":""}`,style:{minHeight:minimal?"37px":showGraph?"100px":"60px",...style},ref:perfContainerRef,children:[(0,jsx_runtime.jsx)(ChartUI,{perfContainerRef:perfContainerRef,colorBlind:colorBlind,chart:chart,showGraph:showGraph,antialias:antialias,customData:customData,minimal:minimal,matrixUpdate:matrixUpdate}),(0,jsx_runtime.jsx)(PerfUI,{colorBlind:colorBlind,showGraph:showGraph,deepAnalyze:deepAnalyze,openByDefault:openByDefault,customData:customData,matrixUpdate:matrixUpdate,minimal:minimal})]})})]})}},"./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js":function(__unused_webpack_module,exports,__webpack_require__){var e=__webpack_require__("./node_modules/react/index.js");var k="function"==typeof Object.is?Object.is:function h(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function t(a,b){return b()}:function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];return n((function(){c.value=d,c.getSnapshot=b,r(c)&&g({inst:c})}),[a,d,b]),m((function(){return r(c)&&g({inst:c}),a((function(){r(c)&&g({inst:c})}))}),[a]),p(d),d};exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u},"./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js":function(__unused_webpack_module,exports,__webpack_require__){var h=__webpack_require__("./node_modules/react/index.js"),n=__webpack_require__("./node_modules/use-sync-external-store/shim/index.js");var q="function"==typeof Object.is?Object.is:function p(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;exports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v((function(){function a(a){if(!c){if(c=!0,d=a,a=l(a),void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}if(b=k,q(d,a))return b;var e=l(a);return void 0!==g&&g(b,e)?b:(d=a,k=e)}var d,k,c=!1,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]}),[b,e,l,g]);var d=r(a,c[0],c[1]);return u((function(){f.hasValue=!0,f.value=d}),[d]),w(d),d}},"./node_modules/use-sync-external-store/shim/index.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__("./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js")},"./node_modules/use-sync-external-store/shim/with-selector.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__("./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js")}}]); \ No newline at end of file diff --git a/docs/135.78107015.iframe.bundle.js.LICENSE.txt b/docs/135.c0b7df5b.iframe.bundle.js.LICENSE.txt similarity index 85% rename from docs/135.78107015.iframe.bundle.js.LICENSE.txt rename to docs/135.c0b7df5b.iframe.bundle.js.LICENSE.txt index 1f365b85..b146aae1 100644 --- a/docs/135.78107015.iframe.bundle.js.LICENSE.txt +++ b/docs/135.c0b7df5b.iframe.bundle.js.LICENSE.txt @@ -3,6 +3,12 @@ Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE */ +/*! +Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver) +for use in Troika text rendering. +Original MIT license applies +*/ + /*! Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate (https://github.com/101arrowz/fflate) for use in Troika text rendering. diff --git a/docs/140.a6128e7c.iframe.bundle.js b/docs/140.a6128e7c.iframe.bundle.js new file mode 100644 index 00000000..8731788a --- /dev/null +++ b/docs/140.a6128e7c.iframe.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see 140.a6128e7c.iframe.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[140],{"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Z:function(){return _toConsumableArray}});var arrayLikeToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");var unsupportedIterableToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return(0,arrayLikeToArray.Z)(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||(0,unsupportedIterableToArray.Z)(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},"./node_modules/@react-three/postprocessing/dist/EffectComposer.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{x:function(){return EffectComposer},s:function(){return EffectComposerContext}});var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),react=__webpack_require__("./node_modules/react/index.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),build=__webpack_require__("./node_modules/postprocessing/build/index.js");let webGL2Available;function isWebGL2Available(){var _a;if(void 0!==webGL2Available)return webGL2Available;try{let gl;const canvas=document.createElement("canvas");return webGL2Available=!(!window.WebGL2RenderingContext||!(gl=canvas.getContext("webgl2"))),gl&&(null==(_a=gl.getExtension("WEBGL_lose_context"))||_a.loseContext()),webGL2Available}catch(e){return webGL2Available=!1}}const EffectComposerContext=(0,react.createContext)(null),isConvolution=effect=>(effect.getAttributes()&build.VB.CONVOLUTION)===build.VB.CONVOLUTION,EffectComposer=react.memo((0,react.forwardRef)((({children:children,camera:_camera,scene:_scene,resolutionScale:resolutionScale,enabled:enabled=!0,renderPriority:renderPriority=1,autoClear:autoClear=!0,depthBuffer:depthBuffer,enableNormalPass:enableNormalPass,stencilBuffer:stencilBuffer,multisampling:multisampling=8,frameBufferType:frameBufferType=three_module.HalfFloatType},ref)=>{const{gl:gl,scene:defaultScene,camera:defaultCamera,size:size}=(0,index_99983b2d_esm.A)(),scene=_scene||defaultScene,camera=_camera||defaultCamera,[composer,normalPass,downSamplingPass]=(0,react.useMemo)((()=>{const webGL2Available=isWebGL2Available(),effectComposer=new build.xC(gl,{depthBuffer:depthBuffer,stencilBuffer:stencilBuffer,multisampling:multisampling>0&&webGL2Available?multisampling:0,frameBufferType:frameBufferType});effectComposer.addPass(new build.CD(scene,camera));let downSamplingPass2=null,normalPass2=null;return enableNormalPass&&(normalPass2=new build.gh(scene,camera),normalPass2.enabled=!1,effectComposer.addPass(normalPass2),void 0!==resolutionScale&&webGL2Available&&(downSamplingPass2=new build.xs({normalBuffer:normalPass2.texture,resolutionScale:resolutionScale}),downSamplingPass2.enabled=!1,effectComposer.addPass(downSamplingPass2))),[effectComposer,normalPass2,downSamplingPass2]}),[camera,gl,depthBuffer,stencilBuffer,multisampling,frameBufferType,scene,enableNormalPass,resolutionScale]);(0,react.useEffect)((()=>null==composer?void 0:composer.setSize(size.width,size.height)),[composer,size]),(0,index_99983b2d_esm.C)(((_,delta)=>{if(enabled){const currentAutoClear=gl.autoClear;gl.autoClear=autoClear,stencilBuffer&&!autoClear&&gl.clearStencil(),composer.render(delta),gl.autoClear=currentAutoClear}}),enabled?renderPriority:0);const group=(0,react.useRef)(null),instance=(0,index_99983b2d_esm.y)(group);(0,react.useLayoutEffect)((()=>{const passes=[];if(group.current&&instance.current&&composer){const children2=instance.current.objects;for(let i=0;i{for(const pass of passes)null==composer||composer.removePass(pass);normalPass&&(normalPass.enabled=!1),downSamplingPass&&(downSamplingPass.enabled=!1)}}),[composer,children,camera,normalPass,downSamplingPass,instance]),(0,react.useEffect)((()=>{const currentTonemapping=gl.toneMapping;return gl.toneMapping=three_module.NoToneMapping,()=>{gl.toneMapping=currentTonemapping}}),[]);const state=(0,react.useMemo)((()=>({composer:composer,normalPass:normalPass,downSamplingPass:downSamplingPass,resolutionScale:resolutionScale,camera:camera,scene:scene})),[composer,normalPass,downSamplingPass,resolutionScale,camera,scene]);return(0,react.useImperativeHandle)(ref,(()=>composer),[composer]),(0,jsx_runtime.jsx)(EffectComposerContext.Provider,{value:state,children:(0,jsx_runtime.jsx)("group",{ref:group,children:children})})})))},"./node_modules/@react-three/postprocessing/dist/effects/Bloom.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{d:function(){return Bloom}});var postprocessing__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/postprocessing/build/index.js");const Bloom=(0,__webpack_require__("./node_modules/@react-three/postprocessing/dist/util.js").p1)(postprocessing__WEBPACK_IMPORTED_MODULE_1__.rk,{blendFunction:postprocessing__WEBPACK_IMPORTED_MODULE_1__.YQ.ADD})},"./node_modules/@react-three/postprocessing/dist/effects/BrightnessContrast.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{F:function(){return BrightnessContrast}});var postprocessing__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/postprocessing/build/index.js");const BrightnessContrast=(0,__webpack_require__("./node_modules/@react-three/postprocessing/dist/util.js").p1)(postprocessing__WEBPACK_IMPORTED_MODULE_1__.at)},"./node_modules/@react-three/postprocessing/dist/effects/HueSaturation.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{v:function(){return HueSaturation}});var postprocessing__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/postprocessing/build/index.js");const HueSaturation=(0,__webpack_require__("./node_modules/@react-three/postprocessing/dist/util.js").p1)(postprocessing__WEBPACK_IMPORTED_MODULE_1__.JL)},"./node_modules/@react-three/postprocessing/dist/effects/SSAO.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{K:function(){return SSAO}});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),postprocessing__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/postprocessing/build/index.js"),_EffectComposer_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@react-three/postprocessing/dist/EffectComposer.js");const SSAO=(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((function SSAO2(props,ref){const{camera:camera,normalPass:normalPass,downSamplingPass:downSamplingPass,resolutionScale:resolutionScale}=(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_EffectComposer_js__WEBPACK_IMPORTED_MODULE_2__.s),effect=(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((()=>null===normalPass&&null===downSamplingPass?(console.error("Please enable the NormalPass in the EffectComposer in order to use SSAO."),{}):new postprocessing__WEBPACK_IMPORTED_MODULE_3__.bn(camera,normalPass&&!downSamplingPass?normalPass.texture:null,{blendFunction:postprocessing__WEBPACK_IMPORTED_MODULE_3__.YQ.MULTIPLY,samples:30,rings:4,distanceThreshold:1,distanceFalloff:0,rangeThreshold:.5,rangeFalloff:.1,luminanceInfluence:.9,radius:20,bias:.5,intensity:1,color:void 0,normalDepthBuffer:downSamplingPass?downSamplingPass.texture:null,resolutionScale:null!=resolutionScale?resolutionScale:1,depthAwareUpsampling:!0,...props})),[camera,normalPass,props]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("primitive",{ref:ref,object:effect,dispose:null})}))},"./node_modules/@react-three/postprocessing/dist/effects/Vignette.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{s:function(){return Vignette}});var postprocessing__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/postprocessing/build/index.js");const Vignette=(0,__webpack_require__("./node_modules/@react-three/postprocessing/dist/util.js").p1)(postprocessing__WEBPACK_IMPORTED_MODULE_1__.Dd)},"./node_modules/@react-three/postprocessing/dist/util.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{p1:function(){return wrapEffect}});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js");let i=0;const components=new WeakMap,wrapEffect=(effect,defaults)=>react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((function Effect({blendFunction:blendFunction=(null==defaults?void 0:defaults.blendFunction),opacity:opacity=(null==defaults?void 0:defaults.opacity),...props},ref){let Component=components.get(effect);if(!Component){const key=`@react-three/postprocessing/${effect.name}-${i++}`;(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__.e)({[key]:effect}),components.set(effect,Component=key)}const camera=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__.A)((state=>state.camera)),args=react__WEBPACK_IMPORTED_MODULE_1__.useMemo((()=>{var _a,_b;return[...null!=(_a=null==defaults?void 0:defaults.args)?_a:[],...null!=(_b=props.args)?_b:[{...defaults,...props}]]}),[JSON.stringify(props)]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Component,{camera:camera,"blendMode-blendFunction":blendFunction,"blendMode-opacity-value":opacity,...props,ref:ref,args:args})}))},"./node_modules/postprocessing/build/index.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{CD:function(){return RenderPass},Dd:function(){return VignetteEffect},H5:function(){return EffectPass},JL:function(){return HueSaturationEffect},Qm:function(){return Effect},VB:function(){return EffectAttribute},YQ:function(){return BlendFunction},at:function(){return BrightnessContrastEffect},bn:function(){return SSAOEffect},gh:function(){return NormalPass},rk:function(){return BloomEffect},w2:function(){return Pass},xC:function(){return EffectComposer},xs:function(){return DepthDownsamplingPass}});var three__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/three/build/three.module.js"),dummyCamera=new three__WEBPACK_IMPORTED_MODULE_0__.Camera,geometry=null;var Pass=class _Pass{constructor(name="Pass",scene=new three__WEBPACK_IMPORTED_MODULE_0__.Scene,camera=dummyCamera){this.name=name,this.renderer=null,this.scene=scene,this.camera=camera,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(value){if(this.rtt===value){const material=this.fullscreenMaterial;null!==material&&(material.needsUpdate=!0),this.rtt=!value}}set mainScene(value){}set mainCamera(value){}setRenderer(renderer){this.renderer=renderer}isEnabled(){return this.enabled}setEnabled(value){this.enabled=value}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(value){let screen=this.screen;null!==screen?screen.material=value:(screen=new three__WEBPACK_IMPORTED_MODULE_0__.Mesh(function getFullscreenTriangle(){if(null===geometry){const vertices=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),uvs=new Float32Array([0,0,2,0,0,2]);void 0!==(geometry=new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry).setAttribute?(geometry.setAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(vertices,3)),geometry.setAttribute("uv",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(uvs,2))):(geometry.addAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(vertices,3)),geometry.addAttribute("uv",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(uvs,2)))}return geometry}(),value),screen.frustumCulled=!1,null===this.scene&&(this.scene=new three__WEBPACK_IMPORTED_MODULE_0__.Scene),this.scene.add(screen),this.screen=screen)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(value){this.fullscreenMaterial=value}getDepthTexture(){return null}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){throw new Error("Render method not implemented!")}setSize(width,height){}initialize(renderer,alpha,frameBufferType){}dispose(){for(const key of Object.keys(this)){const property=this[key];(property instanceof three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Material||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Texture||property instanceof _Pass)&&this[key].dispose()}}},ClearMaskPass=class extends Pass{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const stencil=renderer.state.buffers.stencil;stencil.setLocked(!1),stencil.setTest(!1)}},revision=Number(three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,""));function updateFragmentShader(fragmentShader){return revision<154?fragmentShader.replace("colorspace_fragment","encodings_fragment"):fragmentShader}var common_default="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",CopyMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),opacity:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include \n#include \n}",vertexShader:common_default}),this.fragmentShader=updateFragmentShader(this.fragmentShader)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}getOpacity(value){return this.uniforms.opacity.value}setOpacity(value){this.uniforms.opacity.value=value}},CopyPass=class extends Pass{constructor(renderTarget,autoResize=!0){super("CopyPass"),this.fullscreenMaterial=new CopyMaterial,this.needsSwap=!1,this.renderTarget=renderTarget,void 0===renderTarget&&(this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=autoResize}get resize(){return this.autoResize}set resize(value){this.autoResize=value}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(value){this.autoResize=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){this.fullscreenMaterial.inputBuffer=inputBuffer.texture,renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){this.autoResize&&this.renderTarget.setSize(width,height)}initialize(renderer,alpha,frameBufferType){void 0!==frameBufferType&&(this.renderTarget.texture.type=frameBufferType,frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":null!==renderer&&renderer.outputColorSpace===three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace&&(this.renderTarget.texture.colorSpace=three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace))}},color=new three__WEBPACK_IMPORTED_MODULE_0__.Color,ClearPass=class extends Pass{constructor(color2=!0,depth=!0,stencil=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=color2,this.depth=depth,this.stencil=stencil,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(color2,depth,stencil){this.color=color2,this.depth=depth,this.stencil=stencil}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(value){this.overrideClearColor=value}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(value){this.overrideClearAlpha=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const overrideClearColor=this.overrideClearColor,overrideClearAlpha=this.overrideClearAlpha,clearAlpha=renderer.getClearAlpha(),hasOverrideClearColor=null!==overrideClearColor,hasOverrideClearAlpha=overrideClearAlpha>=0;hasOverrideClearColor?(renderer.getClearColor(color),renderer.setClearColor(overrideClearColor,hasOverrideClearAlpha?overrideClearAlpha:clearAlpha)):hasOverrideClearAlpha&&renderer.setClearAlpha(overrideClearAlpha),renderer.setRenderTarget(this.renderToScreen?null:inputBuffer),renderer.clear(this.color,this.depth,this.stencil),hasOverrideClearColor?renderer.setClearColor(color,clearAlpha):hasOverrideClearAlpha&&renderer.setClearAlpha(clearAlpha)}},MaskPass=class extends Pass{constructor(scene,camera){super("MaskPass",scene,camera),this.needsSwap=!1,this.clearPass=new ClearPass(!1,!1,!0),this.inverse=!1}set mainScene(value){this.scene=value}set mainCamera(value){this.camera=value}get inverted(){return this.inverse}set inverted(value){this.inverse=value}get clear(){return this.clearPass.enabled}set clear(value){this.clearPass.enabled=value}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(value){this.inverted=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const context=renderer.getContext(),buffers=renderer.state.buffers,scene=this.scene,camera=this.camera,clearPass=this.clearPass,writeValue=this.inverted?0:1,clearValue=1-writeValue;buffers.color.setMask(!1),buffers.depth.setMask(!1),buffers.color.setLocked(!0),buffers.depth.setLocked(!0),buffers.stencil.setTest(!0),buffers.stencil.setOp(context.REPLACE,context.REPLACE,context.REPLACE),buffers.stencil.setFunc(context.ALWAYS,writeValue,4294967295),buffers.stencil.setClear(clearValue),buffers.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?clearPass.render(renderer,null):(clearPass.render(renderer,inputBuffer),clearPass.render(renderer,outputBuffer))),this.renderToScreen?(renderer.setRenderTarget(null),renderer.render(scene,camera)):(renderer.setRenderTarget(inputBuffer),renderer.render(scene,camera),renderer.setRenderTarget(outputBuffer),renderer.render(scene,camera)),buffers.color.setLocked(!1),buffers.depth.setLocked(!1),buffers.stencil.setLocked(!1),buffers.stencil.setFunc(context.EQUAL,1,4294967295),buffers.stencil.setOp(context.KEEP,context.KEEP,context.KEEP),buffers.stencil.setLocked(!0)}},EffectComposer=class{constructor(renderer=null,{depthBuffer:depthBuffer=!0,stencilBuffer:stencilBuffer=!1,multisampling:multisampling=0,frameBufferType:frameBufferType}={}){this.renderer=null,this.inputBuffer=this.createBuffer(depthBuffer,stencilBuffer,frameBufferType,multisampling),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new CopyPass,this.depthTexture=null,this.passes=[],this.timer=new class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(value){"undefined"!=typeof document&&void 0!==document.hidden&&(value?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=value)}get delta(){return.001*this._delta}get fixedDelta(){return.001*this._fixedDelta}set fixedDelta(value){this._fixedDelta=1e3*value}get elapsed(){return.001*this._elapsed}update(timestamp){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(void 0!==timestamp?timestamp:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},this.autoRenderToScreen=!0,this.setRenderer(renderer)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(value){const buffer=this.inputBuffer,multisampling=this.multisampling;multisampling>0&&value>0?(this.inputBuffer.samples=value,this.outputBuffer.samples=value,this.inputBuffer.dispose(),this.outputBuffer.dispose()):multisampling!==value&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(buffer.depthBuffer,buffer.stencilBuffer,buffer.texture.type,value),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(renderer){if(this.renderer=renderer,null!==renderer){const size=renderer.getSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),alpha=renderer.getContext().getContextAttributes().alpha,frameBufferType=this.inputBuffer.texture.type;frameBufferType===three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&renderer.outputColorSpace===three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace&&(this.inputBuffer.texture.colorSpace=three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace,this.outputBuffer.texture.colorSpace=three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace,this.inputBuffer.dispose(),this.outputBuffer.dispose()),renderer.autoClear=!1,this.setSize(size.width,size.height);for(const pass of this.passes)pass.initialize(renderer,alpha,frameBufferType)}}replaceRenderer(renderer,updateDOM=!0){const oldRenderer=this.renderer,parent=oldRenderer.domElement.parentNode;return this.setRenderer(renderer),updateDOM&&null!==parent&&(parent.removeChild(oldRenderer.domElement),parent.appendChild(renderer.domElement)),oldRenderer}createDepthTexture(){const depthTexture=this.depthTexture=new three__WEBPACK_IMPORTED_MODULE_0__.DepthTexture;return this.inputBuffer.depthTexture=depthTexture,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(depthTexture.format=three__WEBPACK_IMPORTED_MODULE_0__.DepthStencilFormat,depthTexture.type=three__WEBPACK_IMPORTED_MODULE_0__.UnsignedInt248Type):depthTexture.type=three__WEBPACK_IMPORTED_MODULE_0__.UnsignedIntType,depthTexture}deleteDepthTexture(){if(null!==this.depthTexture){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const pass of this.passes)pass.setDepthTexture(null)}}createBuffer(depthBuffer,stencilBuffer,type,multisampling){const renderer=this.renderer,size=null===renderer?new three__WEBPACK_IMPORTED_MODULE_0__.Vector2:renderer.getDrawingBufferSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),options={minFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,stencilBuffer:stencilBuffer,depthBuffer:depthBuffer,type:type},renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(size.width,size.height,options);return multisampling>0&&(renderTarget.ignoreDepthForMultisampleCopy=!1,renderTarget.samples=multisampling),type===three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&null!==renderer&&renderer.outputColorSpace===three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace&&(renderTarget.texture.colorSpace=three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace),renderTarget.texture.name="EffectComposer.Buffer",renderTarget.texture.generateMipmaps=!1,renderTarget}setMainScene(scene){for(const pass of this.passes)pass.mainScene=scene}setMainCamera(camera){for(const pass of this.passes)pass.mainCamera=camera}addPass(pass,index){const passes=this.passes,renderer=this.renderer,drawingBufferSize=renderer.getDrawingBufferSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),alpha=renderer.getContext().getContextAttributes().alpha,frameBufferType=this.inputBuffer.texture.type;if(pass.setRenderer(renderer),pass.setSize(drawingBufferSize.width,drawingBufferSize.height),pass.initialize(renderer,alpha,frameBufferType),this.autoRenderToScreen&&(passes.length>0&&(passes[passes.length-1].renderToScreen=!1),pass.renderToScreen&&(this.autoRenderToScreen=!1)),void 0!==index?passes.splice(index,0,pass):passes.push(pass),this.autoRenderToScreen&&(passes[passes.length-1].renderToScreen=!0),pass.needsDepthTexture||null!==this.depthTexture)if(null===this.depthTexture){const depthTexture=this.createDepthTexture();for(pass of passes)pass.setDepthTexture(depthTexture)}else pass.setDepthTexture(this.depthTexture)}removePass(pass){const passes=this.passes,index=passes.indexOf(pass);if(-1!==index&&passes.splice(index,1).length>0){if(null!==this.depthTexture){const reducer=(a,b)=>a||b.needsDepthTexture;passes.reduce(reducer,!1)||(pass.getDepthTexture()===this.depthTexture&&pass.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&index===passes.length&&(pass.renderToScreen=!1,passes.length>0&&(passes[passes.length-1].renderToScreen=!0))}}removeAllPasses(){const passes=this.passes;this.deleteDepthTexture(),passes.length>0&&(this.autoRenderToScreen&&(passes[passes.length-1].renderToScreen=!1),this.passes=[])}render(deltaTime){const renderer=this.renderer,copyPass=this.copyPass;let context,stencil,buffer,inputBuffer=this.inputBuffer,outputBuffer=this.outputBuffer,stencilTest=!1;void 0===deltaTime&&(this.timer.update(),deltaTime=this.timer.getDelta());for(const pass of this.passes)pass.enabled&&(pass.render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest),pass.needsSwap&&(stencilTest&&(copyPass.renderToScreen=pass.renderToScreen,context=renderer.getContext(),stencil=renderer.state.buffers.stencil,stencil.setFunc(context.NOTEQUAL,1,4294967295),copyPass.render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest),stencil.setFunc(context.EQUAL,1,4294967295)),buffer=inputBuffer,inputBuffer=outputBuffer,outputBuffer=buffer),pass instanceof MaskPass?stencilTest=!0:pass instanceof ClearMaskPass&&(stencilTest=!1))}setSize(width,height,updateStyle){const renderer=this.renderer,currentSize=renderer.getSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2);void 0!==width&&void 0!==height||(width=currentSize.width,height=currentSize.height),currentSize.width===width&¤tSize.height===height||renderer.setSize(width,height,updateStyle);const drawingBufferSize=renderer.getDrawingBufferSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2);this.inputBuffer.setSize(drawingBufferSize.width,drawingBufferSize.height),this.outputBuffer.setSize(drawingBufferSize.width,drawingBufferSize.height);for(const pass of this.passes)pass.setSize(drawingBufferSize.width,drawingBufferSize.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const pass of this.passes)pass.dispose();this.passes=[],null!==this.inputBuffer&&this.inputBuffer.dispose(),null!==this.outputBuffer&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},EffectAttribute={NONE:0,DEPTH:1,CONVOLUTION:2},EffectShaderSection={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var workaroundEnabled=!1,OverrideMaterialManager=class{constructor(material=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(material),this.meshCount=0,this.replaceMaterial=node=>{if(node.isMesh){let materials;if(node.material.flatShading)switch(node.material.side){case three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide:materials=this.materialsFlatShadedDoubleSide;break;case three__WEBPACK_IMPORTED_MODULE_0__.BackSide:materials=this.materialsFlatShadedBackSide;break;default:materials=this.materialsFlatShaded}else switch(node.material.side){case three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide:materials=this.materialsDoubleSide;break;case three__WEBPACK_IMPORTED_MODULE_0__.BackSide:materials=this.materialsBackSide;break;default:materials=this.materials}this.originalMaterials.set(node,node.material),node.isSkinnedMesh?node.material=materials[2]:node.isInstancedMesh?node.material=materials[1]:node.material=materials[0],++this.meshCount}}}cloneMaterial(material){if(!(material instanceof three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial))return material.clone();const uniforms=material.uniforms,textureUniforms=new Map;for(const key in uniforms){const value=uniforms[key].value;value.isRenderTargetTexture&&(uniforms[key].value=null,textureUniforms.set(key,value))}const clone=material.clone();for(const entry of textureUniforms)uniforms[entry[0]].value=entry[1],clone.uniforms[entry[0]].value=entry[1];return clone}setMaterial(material){if(this.disposeMaterials(),this.material=material,null!==material){const materials=this.materials=[this.cloneMaterial(material),this.cloneMaterial(material),this.cloneMaterial(material)];for(const m2 of materials)m2.uniforms=Object.assign({},material.uniforms),m2.side=three__WEBPACK_IMPORTED_MODULE_0__.FrontSide;materials[2].skinning=!0,this.materialsBackSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.side=three__WEBPACK_IMPORTED_MODULE_0__.BackSide,c2})),this.materialsDoubleSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.side=three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide,c2})),this.materialsFlatShaded=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.flatShading=!0,c2})),this.materialsFlatShadedBackSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.flatShading=!0,c2.side=three__WEBPACK_IMPORTED_MODULE_0__.BackSide,c2})),this.materialsFlatShadedDoubleSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.flatShading=!0,c2.side=three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide,c2}))}}render(renderer,scene,camera){const shadowMapEnabled=renderer.shadowMap.enabled;if(renderer.shadowMap.enabled=!1,workaroundEnabled){const originalMaterials=this.originalMaterials;this.meshCount=0,scene.traverse(this.replaceMaterial),renderer.render(scene,camera);for(const entry of originalMaterials)entry[0].material=entry[1];this.meshCount!==originalMaterials.size&&originalMaterials.clear()}else{const overrideMaterial=scene.overrideMaterial;scene.overrideMaterial=this.material,renderer.render(scene,camera),scene.overrideMaterial=overrideMaterial}renderer.shadowMap.enabled=shadowMapEnabled}disposeMaterials(){if(null!==this.material){const materials=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const m2 of materials)m2.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return workaroundEnabled}static set workaroundEnabled(value){workaroundEnabled=value}},Resolution=class extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(resizable,width=-1,height=-1,scale=1){super(),this.resizable=resizable,this.baseSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(1,1),this.preferredSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(width,height),this.target=this.preferredSize,this.s=scale,this.effectiveSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,this.addEventListener("change",(()=>this.updateEffectiveSize())),this.updateEffectiveSize()}updateEffectiveSize(){const base=this.baseSize,preferred=this.preferredSize,effective=this.effectiveSize,scale=this.scale;-1!==preferred.width?effective.width=preferred.width:-1!==preferred.height?effective.width=Math.round(preferred.height*(base.width/Math.max(base.height,1))):effective.width=Math.round(base.width*scale),-1!==preferred.height?effective.height=preferred.height:-1!==preferred.width?effective.height=Math.round(preferred.width/Math.max(base.width/Math.max(base.height,1),1)):effective.height=Math.round(base.height*scale)}get width(){return this.effectiveSize.width}set width(value){this.preferredWidth=value}get height(){return this.effectiveSize.height}set height(value){this.preferredHeight=value}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(value){this.s!==value&&(this.s=value,this.preferredSize.setScalar(-1),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(value){this.scale=value}get baseWidth(){return this.baseSize.width}set baseWidth(value){this.baseSize.width!==value&&(this.baseSize.width=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(value){this.baseWidth=value}get baseHeight(){return this.baseSize.height}set baseHeight(value){this.baseSize.height!==value&&(this.baseSize.height=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(value){this.baseHeight=value}setBaseSize(width,height){this.baseSize.width===width&&this.baseSize.height===height||(this.baseSize.set(width,height),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(value){this.preferredSize.width!==value&&(this.preferredSize.width=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(value){this.preferredWidth=value}get preferredHeight(){return this.preferredSize.height}set preferredHeight(value){this.preferredSize.height!==value&&(this.preferredSize.height=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(value){this.preferredHeight=value}setPreferredSize(width,height){this.preferredSize.width===width&&this.preferredSize.height===height||(this.preferredSize.set(width,height),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(resolution){this.s=resolution.scale,this.baseSize.set(resolution.baseWidth,resolution.baseHeight),this.preferredSize.set(resolution.preferredWidth,resolution.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return-1}},BlendFunction={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},blendFunctions=new Map([[BlendFunction.ADD,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}"],[BlendFunction.ALPHA,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}"],[BlendFunction.AVERAGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}"],[BlendFunction.COLOR,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.COLOR_BURN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}"],[BlendFunction.COLOR_DODGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}"],[BlendFunction.DARKEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}"],[BlendFunction.DIFFERENCE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}"],[BlendFunction.DIVIDE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}"],[BlendFunction.DST,null],[BlendFunction.EXCLUSION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}"],[BlendFunction.HARD_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}"],[BlendFunction.HARD_MIX,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}"],[BlendFunction.HUE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.INVERT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}"],[BlendFunction.INVERT_RGB,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}"],[BlendFunction.LIGHTEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}"],[BlendFunction.LINEAR_BURN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}"],[BlendFunction.LINEAR_DODGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}"],[BlendFunction.LINEAR_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}"],[BlendFunction.LUMINOSITY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.MULTIPLY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}"],[BlendFunction.NEGATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}"],[BlendFunction.NORMAL,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}"],[BlendFunction.OVERLAY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}"],[BlendFunction.PIN_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}"],[BlendFunction.REFLECT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}"],[BlendFunction.SATURATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.SCREEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}"],[BlendFunction.SOFT_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}"],[BlendFunction.SRC,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}"],[BlendFunction.SUBTRACT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}"],[BlendFunction.VIVID_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}"]]),BlendMode=class extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(blendFunction,opacity=1){super(),this._blendFunction=blendFunction,this.opacity=new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(opacity)}getOpacity(){return this.opacity.value}setOpacity(value){this.opacity.value=value}get blendFunction(){return this._blendFunction}set blendFunction(value){this._blendFunction=value,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(value){this.blendFunction=value}getShaderCode(){return blendFunctions.get(this.blendFunction)}},KernelSize_MEDIUM=2,KernelSize_LARGE=3,kernelPresets=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],KawaseBlurMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(texelSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector4){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector4),scale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),kernel:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include \n}",vertexShader:"uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.fragmentShader=updateFragmentShader(this.fragmentShader),this.setTexelSize(texelSize.x,texelSize.y),this.kernelSize=KernelSize_MEDIUM}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.inputBuffer=value}get kernelSequence(){return kernelPresets[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(value){this.uniforms.scale.value=value}getScale(){return this.uniforms.scale.value}setScale(value){this.uniforms.scale.value=value}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(value){this.uniforms.kernel.value=value}setKernel(value){this.kernel=value}setTexelSize(x,y){this.uniforms.texelSize.value.set(x,y,.5*x,.5*y)}setSize(width,height){const x=1/width,y=1/height;this.uniforms.texelSize.value.set(x,y,.5*x,.5*y)}},KawaseBlurPass=class extends Pass{constructor({kernelSize:kernelSize=KernelSize_MEDIUM,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("KawaseBlurPass"),this.renderTargetA=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight))),this._blurMaterial=new KawaseBlurMaterial,this._blurMaterial.kernelSize=kernelSize,this.copyMaterial=new CopyMaterial}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(value){this._blurMaterial=value}get dithering(){return this.copyMaterial.dithering}set dithering(value){this.copyMaterial.dithering=value}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(value){this.blurMaterial.kernelSize=value}get width(){return this.resolution.width}set width(value){this.resolution.preferredWidth=value}get height(){return this.resolution.height}set height(value){this.resolution.preferredHeight=value}get scale(){return this.blurMaterial.scale}set scale(value){this.blurMaterial.scale=value}getScale(){return this.blurMaterial.scale}setScale(value){this.blurMaterial.scale=value}getKernelSize(){return this.kernelSize}setKernelSize(value){this.kernelSize=value}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const scene=this.scene,camera=this.camera,renderTargetA=this.renderTargetA,renderTargetB=this.renderTargetB,material=this.blurMaterial,kernelSequence=material.kernelSequence;let previousBuffer=inputBuffer;this.fullscreenMaterial=material;for(let i=0,l=kernelSequence.length;i\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef RANGE\nuniform vec2 range;\n#elif defined(THRESHOLD)\nuniform float threshold;uniform float smoothing;\n#endif\nvarying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);\n#ifdef RANGE\nfloat low=step(range.x,l);float high=step(l,range.y);l*=low*high;\n#elif defined(THRESHOLD)\nl=smoothstep(threshold,threshold+smoothing,l)*l;\n#endif\n#ifdef COLOR\ngl_FragColor=vec4(texel.rgb*clamp(l,0.0,1.0),l);\n#else\ngl_FragColor=vec4(l);\n#endif\n}",vertexShader:common_default}),this.colorOutput=colorOutput,this.luminanceRange=luminanceRange}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}get threshold(){return this.uniforms.threshold.value}set threshold(value){this.smoothing>0||value>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=value}getThreshold(){return this.threshold}setThreshold(value){this.threshold=value}get smoothing(){return this.uniforms.smoothing.value}set smoothing(value){this.threshold>0||value>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=value}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(value){this.smoothing=value}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(value){}get colorOutput(){return void 0!==this.defines.COLOR}set colorOutput(value){value?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(value){return this.colorOutput}setColorOutputEnabled(value){this.colorOutput=value}get useRange(){return null!==this.luminanceRange}set useRange(value){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(value){null!==value?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=value,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(value){this.luminanceRange=value}},LuminancePass=class extends Pass{constructor({renderTarget:renderTarget,luminanceRange:luminanceRange,colorOutput:colorOutput,resolutionScale:resolutionScale=1,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("LuminancePass"),this.fullscreenMaterial=new LuminanceMaterial(colorOutput,luminanceRange),this.needsSwap=!1,this.renderTarget=renderTarget,void 0===this.renderTarget&&(this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){this.fullscreenMaterial.inputBuffer=inputBuffer.texture,renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height)}initialize(renderer,alpha,frameBufferType){void 0!==frameBufferType&&frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.renderTarget.texture.type=frameBufferType,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},DownsamplingMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#define WEIGHT_INNER 0.125\n#define WEIGHT_OUTER 0.0555555\nvarying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;\n#include \n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.fragmentShader=updateFragmentShader(this.fragmentShader)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},UpsamplingMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),supportBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),radius:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.85)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;\n#else\nuniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;\n#endif\nuniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);\n#include \n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.fragmentShader=updateFragmentShader(this.fragmentShader)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}set supportBuffer(value){this.uniforms.supportBuffer.value=value}get radius(){return this.uniforms.radius.value}set radius(value){this.uniforms.radius.value=value}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},MipmapBlurPass=class extends Pass{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new DownsamplingMaterial,this.upsamplingMaterial=new UpsamplingMaterial,this.resolution=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(value){if(this.levels!==value){const renderTarget=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let i=0;i=0;--i){const mipmap=upsamplingMipmaps[i];upsamplingMaterial.setSize(previousBuffer.width,previousBuffer.height),upsamplingMaterial.inputBuffer=previousBuffer.texture,upsamplingMaterial.supportBuffer=downsamplingMipmaps[i].texture,renderer.setRenderTarget(mipmap),renderer.render(scene,camera),previousBuffer=mipmap}}setSize(width,height){const resolution=this.resolution;resolution.set(width,height);let w=resolution.width,h=resolution.height;for(let i=0,l=this.downsamplingMipmaps.length;ithis.setChanged())),this._inputColorSpace=three__WEBPACK_IMPORTED_MODULE_0__.LinearSRGBColorSpace,this._outputColorSpace=three__WEBPACK_IMPORTED_MODULE_0__.NoColorSpace}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(value){this._inputColorSpace=value,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(value){this._outputColorSpace=value,this.setChanged()}set mainScene(value){}set mainCamera(value){}getName(){return this.name}setRenderer(renderer){this.renderer=renderer}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(attributes){this.attributes=attributes,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(fragmentShader){this.fragmentShader=fragmentShader,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(vertexShader){this.vertexShader=vertexShader,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){}update(renderer,inputBuffer,deltaTime){}setSize(width,height){}initialize(renderer,alpha,frameBufferType){}dispose(){for(const key of Object.keys(this)){const property=this[key];(property instanceof three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Material||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Texture||property instanceof Pass)&&this[key].dispose()}}},BloomEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SCREEN,luminanceThreshold:luminanceThreshold=.9,luminanceSmoothing:luminanceSmoothing=.025,mipmapBlur:mipmapBlur=!1,intensity:intensity=1,radius:radius=.85,levels:levels=8,kernelSize:kernelSize=KernelSize_LARGE,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("BloomEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,texel.a);}",{blendFunction:blendFunction,uniforms:new Map([["map",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["intensity",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(intensity)]])}),this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new KawaseBlurPass({kernelSize:kernelSize}),this.luminancePass=new LuminancePass({colorOutput:!0}),this.luminanceMaterial.threshold=luminanceThreshold,this.luminanceMaterial.smoothing=luminanceSmoothing,this.mipmapBlurPass=new MipmapBlurPass,this.mipmapBlurPass.enabled=mipmapBlur,this.mipmapBlurPass.radius=radius,this.mipmapBlurPass.levels=levels,this.uniforms.get("map").value=mipmapBlur?this.mipmapBlurPass.texture:this.renderTarget.texture;const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(value){this.resolution.preferredWidth=value}get height(){return this.resolution.height}set height(value){this.resolution.preferredHeight=value}get dithering(){return this.blurPass.dithering}set dithering(value){this.blurPass.dithering=value}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(value){this.blurPass.kernelSize=value}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(value){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(value){this.uniforms.get("intensity").value=value}getIntensity(){return this.intensity}setIntensity(value){this.intensity=value}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}update(renderer,inputBuffer,deltaTime){const renderTarget=this.renderTarget,luminancePass=this.luminancePass;luminancePass.enabled?(luminancePass.render(renderer,inputBuffer),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(renderer,luminancePass.renderTarget):this.blurPass.render(renderer,luminancePass.renderTarget,renderTarget)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(renderer,inputBuffer):this.blurPass.render(renderer,inputBuffer,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height),this.blurPass.resolution.copy(resolution),this.luminancePass.setSize(width,height),this.mipmapBlurPass.setSize(width,height)}initialize(renderer,alpha,frameBufferType){this.blurPass.initialize(renderer,alpha,frameBufferType),this.luminancePass.initialize(renderer,alpha,frameBufferType),this.mipmapBlurPass.initialize(renderer,alpha,frameBufferType),void 0!==frameBufferType&&(this.renderTarget.texture.type=frameBufferType,null!==renderer&&renderer.outputColorSpace===three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace&&(this.renderTarget.texture.colorSpace=three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace))}},BrightnessContrastEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC,brightness:brightness=0,contrast:contrast=0}={}){super("BrightnessContrastEffect","uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(color+vec3(0.5),inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["brightness",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(brightness)],["contrast",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(contrast)]])}),this.inputColorSpace=three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace}get brightness(){return this.uniforms.get("brightness").value}set brightness(value){this.uniforms.get("brightness").value=value}getBrightness(){return this.brightness}setBrightness(value){this.brightness=value}get contrast(){return this.uniforms.get("contrast").value}set contrast(value){this.uniforms.get("contrast").value=value}getContrast(){return this.contrast}setContrast(value){this.contrast=value}};function orthographicDepthToViewZ(depth,near,far){return depth*(near-far)-near}function viewZToOrthographicDepth(viewZ,near,far){return Math.min(Math.max((viewZ+near)/(near-far),0),1)}var ShaderPass=class extends Pass{constructor(material,input="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=material,this.input=input}setInput(input){this.input=input}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const uniforms=this.fullscreenMaterial.uniforms;null!==inputBuffer&&void 0!==uniforms&&void 0!==uniforms[this.input]&&(uniforms[this.input].value=inputBuffer.texture),renderer.setRenderTarget(this.renderToScreen?null:outputBuffer),renderer.render(this.scene,this.camera)}initialize(renderer,alpha,frameBufferType){void 0!==frameBufferType&&frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}};var NoiseTexture=class extends three__WEBPACK_IMPORTED_MODULE_0__.DataTexture{constructor(width,height,format=three__WEBPACK_IMPORTED_MODULE_0__.LuminanceFormat,type=three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType){super(function getNoise(size,format,type){const channels=new Map([[three__WEBPACK_IMPORTED_MODULE_0__.LuminanceFormat,1],[three__WEBPACK_IMPORTED_MODULE_0__.RedFormat,1],[three__WEBPACK_IMPORTED_MODULE_0__.RGFormat,2],[three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat,4]]);let data;if(channels.has(format)||console.error("Invalid noise texture format"),type===three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType){data=new Uint8Array(size*channels.get(format));for(let i=0,l=data.length;i0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["hue",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3)],["saturation",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(saturation)]])}),this.hue=hue}get saturation(){return this.uniforms.get("saturation").value}set saturation(value){this.uniforms.get("saturation").value=value}getSaturation(){return this.saturation}setSaturation(value){this.saturation=value}get hue(){const hue=this.uniforms.get("hue").value;return Math.acos((3*hue.x-1)/2)}set hue(value){const s=Math.sin(value),c2=Math.cos(value);this.uniforms.get("hue").value.set((2*c2+1)/3,(-Math.sqrt(3)*s-c2+1)/3,(Math.sqrt(3)*s-c2+1)/3)}getHue(){return this.hue}setHue(value){this.hue=value}};var VignetteTechnique_DEFAULT=0,VignetteTechnique_ESKIL=1,SSAOMaterial=(Math.PI,class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(camera){super({name:"SSAOMaterial",defines:{SAMPLES_INT:"0",INV_SAMPLES_FLOAT:"0.0",SPIRAL_TURNS:"0.0",RADIUS:"1.0",RADIUS_SQ:"1.0",DISTANCE_SCALING:"1",DEPTH_PACKING:"0"},uniforms:{depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),normalBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),normalDepthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),noiseTexture:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),inverseProjectionMatrix:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4),projectionMatrix:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),cameraNearFar:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),distanceCutoff:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),proximityCutoff:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),noiseScale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),minRadiusScale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.33),intensity:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),fade:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.01),bias:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}\n#else\nuniform lowp sampler2D normalBuffer;\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nuniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform vec2 cameraNearFar;uniform float intensity;uniform float minRadiusScale;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){float radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;float noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i1.0||coords.t<0.0||coords.t>1.0){continue;}float sampleDepth=readDepth(coords);float viewZ=getViewZ(sampleDepth);\n#ifdef PERSPECTIVE_CAMERA\nfloat linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y);\n#else\nfloat linearSampleDepth=sampleDepth;\n#endif\nfloat proximity=abs(depth-linearSampleDepth);if(proximity\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\n#ifdef DOWNSAMPLE_NORMALS\nuniform lowp sampler2D normalBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]this.setSize(resolution.baseWidth,resolution.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.fullscreenMaterial.depthBuffer=depthTexture,this.fullscreenMaterial.depthPacking=depthPacking}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height),this.fullscreenMaterial.setSize(width,height)}initialize(renderer,alpha,frameBufferType){const gl=renderer.getContext();if(!(gl.getExtension("EXT_color_buffer_float")||gl.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},SSAOEffect=class extends Effect{constructor(camera,normalBuffer,{blendFunction:blendFunction=BlendFunction.MULTIPLY,samples:samples=9,rings:rings=7,normalDepthBuffer:normalDepthBuffer=null,depthAwareUpsampling:depthAwareUpsampling=!0,worldDistanceThreshold:worldDistanceThreshold,worldDistanceFalloff:worldDistanceFalloff,worldProximityThreshold:worldProximityThreshold,worldProximityFalloff:worldProximityFalloff,distanceThreshold:distanceThreshold=.97,distanceFalloff:distanceFalloff=.03,rangeThreshold:rangeThreshold=5e-4,rangeFalloff:rangeFalloff=.001,minRadiusScale:minRadiusScale=.1,luminanceInfluence:luminanceInfluence=.7,radius:radius=.1825,intensity:intensity=1,bias:bias=.025,fade:fade=.01,color:color2=null,resolutionScale:resolutionScale=1,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("SSAOEffect","uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH)\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\n#endif\n#ifdef COLORIZE\nuniform vec3 color;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300\nvec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distancethis.setSize(resolution.baseWidth,resolution.baseHeight))),this.camera=camera,this.depthDownsamplingPass=new DepthDownsamplingPass({normalBuffer:normalBuffer,resolutionScale:resolutionScale}),this.depthDownsamplingPass.enabled=null===normalDepthBuffer,this.ssaoPass=new ShaderPass(new SSAOMaterial(camera));const noiseTexture=new NoiseTexture(64,64,three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat);noiseTexture.wrapS=noiseTexture.wrapT=three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;const ssaoMaterial=this.ssaoMaterial;ssaoMaterial.normalBuffer=normalBuffer,ssaoMaterial.noiseTexture=noiseTexture,ssaoMaterial.minRadiusScale=minRadiusScale,ssaoMaterial.samples=samples,ssaoMaterial.radius=radius,ssaoMaterial.rings=rings,ssaoMaterial.fade=fade,ssaoMaterial.bias=bias,ssaoMaterial.distanceThreshold=distanceThreshold,ssaoMaterial.distanceFalloff=distanceFalloff,ssaoMaterial.proximityThreshold=rangeThreshold,ssaoMaterial.proximityFalloff=rangeFalloff,void 0!==worldDistanceThreshold&&(ssaoMaterial.worldDistanceThreshold=worldDistanceThreshold),void 0!==worldDistanceFalloff&&(ssaoMaterial.worldDistanceFalloff=worldDistanceFalloff),void 0!==worldProximityThreshold&&(ssaoMaterial.worldProximityThreshold=worldProximityThreshold),void 0!==worldProximityFalloff&&(ssaoMaterial.worldProximityFalloff=worldProximityFalloff),null!==normalDepthBuffer&&(this.ssaoMaterial.normalDepthBuffer=normalDepthBuffer,this.defines.set("NORMAL_DEPTH","1")),this.depthAwareUpsampling=depthAwareUpsampling,this.color=color2}set mainCamera(value){this.camera=value,this.ssaoMaterial.copyCameraSettings(value)}get normalBuffer(){return this.ssaoMaterial.normalBuffer}set normalBuffer(value){this.ssaoMaterial.normalBuffer=value,this.depthDownsamplingPass.fullscreenMaterial.normalBuffer=value}getResolution(){return this.resolution}get ssaoMaterial(){return this.ssaoPass.fullscreenMaterial}getSSAOMaterial(){return this.ssaoMaterial}get samples(){return this.ssaoMaterial.samples}set samples(value){this.ssaoMaterial.samples=value}get rings(){return this.ssaoMaterial.rings}set rings(value){this.ssaoMaterial.rings=value}get radius(){return this.ssaoMaterial.radius}set radius(value){this.ssaoMaterial.radius=value}get depthAwareUpsampling(){return this.defines.has("DEPTH_AWARE_UPSAMPLING")}set depthAwareUpsampling(value){this.depthAwareUpsampling!==value&&(value?this.defines.set("DEPTH_AWARE_UPSAMPLING","1"):this.defines.delete("DEPTH_AWARE_UPSAMPLING"),this.setChanged())}isDepthAwareUpsamplingEnabled(){return this.depthAwareUpsampling}setDepthAwareUpsamplingEnabled(value){this.depthAwareUpsampling=value}get distanceScaling(){return!0}set distanceScaling(value){}get color(){return this.uniforms.get("color").value}set color(value){const uniforms=this.uniforms,defines=this.defines;null!==value?defines.has("COLORIZE")?uniforms.get("color").value.set(value):(defines.set("COLORIZE","1"),uniforms.get("color").value=new three__WEBPACK_IMPORTED_MODULE_0__.Color(value),this.setChanged()):defines.has("COLORIZE")&&(defines.delete("COLORIZE"),uniforms.get("color").value=null,this.setChanged())}get luminanceInfluence(){return this.uniforms.get("luminanceInfluence").value}set luminanceInfluence(value){this.uniforms.get("luminanceInfluence").value=value}get intensity(){return this.uniforms.get("intensity").value}set intensity(value){this.uniforms.get("intensity").value=value}getColor(){return this.color}setColor(value){this.color=value}setDistanceCutoff(threshold,falloff){this.ssaoMaterial.distanceThreshold=threshold,this.ssaoMaterial.distanceFalloff=falloff}setProximityCutoff(threshold,falloff){this.ssaoMaterial.proximityThreshold=threshold,this.ssaoMaterial.proximityFalloff=falloff}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthDownsamplingPass.setDepthTexture(depthTexture,depthPacking),this.ssaoMaterial.depthBuffer=depthTexture,this.ssaoMaterial.depthPacking=depthPacking}update(renderer,inputBuffer,deltaTime){const renderTarget=this.renderTarget;this.depthDownsamplingPass.enabled&&this.depthDownsamplingPass.render(renderer),this.ssaoPass.render(renderer,null,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height);const w=resolution.width,h=resolution.height;this.ssaoMaterial.copyCameraSettings(this.camera),this.ssaoMaterial.setSize(w,h),this.renderTarget.setSize(w,h),this.depthDownsamplingPass.resolution.scale=resolution.scale,this.depthDownsamplingPass.setSize(width,height)}initialize(renderer,alpha,frameBufferType){try{let normalDepthBuffer=this.uniforms.get("normalDepthBuffer").value;null===normalDepthBuffer&&(this.depthDownsamplingPass.initialize(renderer,alpha,frameBufferType),normalDepthBuffer=this.depthDownsamplingPass.texture,this.uniforms.get("normalDepthBuffer").value=normalDepthBuffer,this.ssaoMaterial.normalDepthBuffer=normalDepthBuffer,this.defines.set("NORMAL_DEPTH","1"))}catch(e){this.depthDownsamplingPass.enabled=!1}}},VignetteEffect=class extends Effect{constructor({blendFunction:blendFunction,eskil:eskil=!1,technique:technique=(eskil?VignetteTechnique_ESKIL:VignetteTechnique_DEFAULT),offset:offset=.5,darkness:darkness=.5}={}){super("VignetteEffect","uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;\n#if VIGNETTE_TECHNIQUE == 0\nfloat d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));\n#else\nvec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));\n#endif\noutputColor=vec4(color,inputColor.a);}",{blendFunction:blendFunction,defines:new Map([["VIGNETTE_TECHNIQUE",technique.toFixed(0)]]),uniforms:new Map([["offset",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(offset)],["darkness",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(darkness)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(value){this.technique!==value&&(this.defines.set("VIGNETTE_TECHNIQUE",value.toFixed(0)),this.setChanged())}get eskil(){return this.technique===VignetteTechnique_ESKIL}set eskil(value){this.technique=value?VignetteTechnique_ESKIL:VignetteTechnique_DEFAULT}getTechnique(){return this.technique}setTechnique(value){this.technique=value}get offset(){return this.uniforms.get("offset").value}set offset(value){this.uniforms.get("offset").value=value}getOffset(){return this.offset}setOffset(value){this.offset=value}get darkness(){return this.uniforms.get("darkness").value}set darkness(value){this.uniforms.get("darkness").value=value}getDarkness(){return this.darkness}setDarkness(value){this.darkness=value}},EffectMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(shaderParts,defines,uniforms,camera,dithering=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),resolution:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),cameraNear:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.3),cameraFar:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1e3),aspect:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),time:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:dithering}),shaderParts&&this.setShaderParts(shaderParts),defines&&this.setDefines(defines),uniforms&&this.setUniforms(uniforms),this.copyCameraSettings(camera)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(value){this.uniforms.depthBuffer.value=value}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(value){this.defines.DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer=buffer,this.depthPacking=depthPacking}setShaderData(data){this.setShaderParts(data.shaderParts),this.setDefines(data.defines),this.setUniforms(data.uniforms),this.setExtensions(data.extensions)}setShaderParts(shaderParts){return this.fragmentShader="#include \n#include \n#include \n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#if THREE_REVISION >= 137\nvec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0;\n#ifdef ENCODE_OUTPUT\n#include \n#endif\n#include \n}".replace(EffectShaderSection.FRAGMENT_HEAD,shaderParts.get(EffectShaderSection.FRAGMENT_HEAD)||"").replace(EffectShaderSection.FRAGMENT_MAIN_UV,shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV)||"").replace(EffectShaderSection.FRAGMENT_MAIN_IMAGE,shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}".replace(EffectShaderSection.VERTEX_HEAD,shaderParts.get(EffectShaderSection.VERTEX_HEAD)||"").replace(EffectShaderSection.VERTEX_MAIN_SUPPORT,shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT)||""),this.fragmentShader=updateFragmentShader(this.fragmentShader),this.needsUpdate=!0,this}setDefines(defines){for(const entry of defines.entries())this.defines[entry[0]]=entry[1];return this.needsUpdate=!0,this}setUniforms(uniforms){for(const entry of uniforms.entries())this.uniforms[entry[0]]=entry[1];return this}setExtensions(extensions){this.extensions={};for(const extension of extensions)this.extensions[extension]=!0;return this}get encodeOutput(){return void 0!==this.defines.ENCODE_OUTPUT}set encodeOutput(value){this.encodeOutput!==value&&(value?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(value){return this.encodeOutput}setOutputEncodingEnabled(value){this.encodeOutput=value}get time(){return this.uniforms.time.value}set time(value){this.uniforms.time.value=value}setDeltaTime(value){this.uniforms.time.value+=value}adoptCameraSettings(camera){this.copyCameraSettings(camera)}copyCameraSettings(camera){camera&&(this.uniforms.cameraNear.value=camera.near,this.uniforms.cameraFar.value=camera.far,camera instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(width,height){const uniforms=this.uniforms;uniforms.resolution.value.set(width,height),uniforms.texelSize.value.set(1/width,1/height),uniforms.aspect.value=width/height}static get Section(){return EffectShaderSection}};new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);function prefixSubstrings(prefix,substrings,strings){for(const substring of substrings){const prefixed="$1"+prefix+substring.charAt(0).toUpperCase()+substring.slice(1),regExp=new RegExp("([^\\.])(\\b"+substring+"\\b)","g");for(const entry of strings.entries())null!==entry[1]&&strings.set(entry[0],entry[1].replace(regExp,prefixed))}}function integrateEffect(prefix,effect,data){let fragmentShader=effect.getFragmentShader(),vertexShader=effect.getVertexShader();const mainImageExists=void 0!==fragmentShader&&/mainImage/.test(fragmentShader),mainUvExists=void 0!==fragmentShader&&/mainUv/.test(fragmentShader);if(data.attributes|=effect.getAttributes(),void 0===fragmentShader)throw new Error(`Missing fragment shader (${effect.name})`);if(mainUvExists&&0!=(data.attributes&EffectAttribute.CONVOLUTION))throw new Error(`Effects that transform UVs are incompatible with convolution effects (${effect.name})`);if(!mainImageExists&&!mainUvExists)throw new Error(`Could not find mainImage or mainUv function (${effect.name})`);{const functionRegExp=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,shaderParts=data.shaderParts;let fragmentHead=shaderParts.get(EffectShaderSection.FRAGMENT_HEAD)||"",fragmentMainUv=shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV)||"",fragmentMainImage=shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE)||"",vertexHead=shaderParts.get(EffectShaderSection.VERTEX_HEAD)||"",vertexMainSupport=shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT)||"";const varyings=new Set,names=new Set;if(mainUvExists&&(fragmentMainUv+=`\t${prefix}MainUv(UV);\n`,data.uvTransformation=!0),null!==vertexShader&&/mainSupport/.test(vertexShader)){const needsUv=/mainSupport *\([\w\s]*?uv\s*?\)/.test(vertexShader);vertexMainSupport+=`\t${prefix}MainSupport(`,vertexMainSupport+=needsUv?"vUv);\n":");\n";for(const m2 of vertexShader.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const n of m2[1].split(/\s*,\s*/))data.varyings.add(n),varyings.add(n),names.add(n);for(const m2 of vertexShader.matchAll(functionRegExp))names.add(m2[1])}for(const m2 of fragmentShader.matchAll(functionRegExp))names.add(m2[1]);for(const d of effect.defines.keys())names.add(d.replace(/\([\w\s,]*\)/g,""));for(const u of effect.uniforms.keys())names.add(u);names.delete("while"),names.delete("for"),names.delete("if"),effect.uniforms.forEach(((val,key)=>data.uniforms.set(prefix+key.charAt(0).toUpperCase()+key.slice(1),val))),effect.defines.forEach(((val,key)=>data.defines.set(prefix+key.charAt(0).toUpperCase()+key.slice(1),val)));const shaders=new Map([["fragment",fragmentShader],["vertex",vertexShader]]);prefixSubstrings(prefix,names,data.defines),prefixSubstrings(prefix,names,shaders),fragmentShader=shaders.get("fragment"),vertexShader=shaders.get("vertex");const blendMode=effect.blendMode;if(data.blendModes.set(blendMode.blendFunction,blendMode),mainImageExists){null!==effect.inputColorSpace&&effect.inputColorSpace!==data.colorSpace&&(fragmentMainImage+=effect.inputColorSpace===three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace?"color0 = LinearTosRGB(color0);\n\t":"color0 = sRGBToLinear(color0);\n\t"),effect.outputColorSpace!==three__WEBPACK_IMPORTED_MODULE_0__.NoColorSpace?data.colorSpace=effect.outputColorSpace:null!==effect.inputColorSpace&&(data.colorSpace=effect.inputColorSpace);const depthParamRegExp=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;fragmentMainImage+=`${prefix}MainImage(color0, UV, `,0!=(data.attributes&EffectAttribute.DEPTH)&&depthParamRegExp.test(fragmentShader)&&(fragmentMainImage+="depth, ",data.readDepth=!0),fragmentMainImage+="color1);\n\t";const blendOpacity=prefix+"BlendOpacity";data.uniforms.set(blendOpacity,blendMode.opacity),fragmentMainImage+=`color0 = blend${blendMode.blendFunction}(color0, color1, ${blendOpacity});\n\n\t`,fragmentHead+=`uniform float ${blendOpacity};\n\n`}if(fragmentHead+=fragmentShader+"\n",null!==vertexShader&&(vertexHead+=vertexShader+"\n"),shaderParts.set(EffectShaderSection.FRAGMENT_HEAD,fragmentHead),shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV,fragmentMainUv),shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE,fragmentMainImage),shaderParts.set(EffectShaderSection.VERTEX_HEAD,vertexHead),shaderParts.set(EffectShaderSection.VERTEX_MAIN_SUPPORT,vertexMainSupport),null!==effect.extensions)for(const extension of effect.extensions)data.extensions.add(extension)}}var EffectPass=class extends Pass{constructor(camera,...effects){super("EffectPass"),this.fullscreenMaterial=new EffectMaterial(null,null,null,camera),this.listener=event=>this.handleEvent(event),this.effects=[],this.setEffects(effects),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(value){for(const effect of this.effects)effect.mainScene=value}set mainCamera(value){this.fullscreenMaterial.copyCameraSettings(value);for(const effect of this.effects)effect.mainCamera=value}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(value){this.fullscreenMaterial.encodeOutput=value}get dithering(){return this.fullscreenMaterial.dithering}set dithering(value){const material=this.fullscreenMaterial;material.dithering=value,material.needsUpdate=!0}setEffects(effects){for(const effect of this.effects)effect.removeEventListener("change",this.listener);this.effects=effects.sort(((a,b)=>b.attributes-a.attributes));for(const effect of this.effects)effect.addEventListener("change",this.listener)}updateMaterial(){const data=new class{constructor(){this.shaderParts=new Map([[EffectShaderSection.FRAGMENT_HEAD,null],[EffectShaderSection.FRAGMENT_MAIN_UV,null],[EffectShaderSection.FRAGMENT_MAIN_IMAGE,null],[EffectShaderSection.VERTEX_HEAD,null],[EffectShaderSection.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=EffectAttribute.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=three__WEBPACK_IMPORTED_MODULE_0__.LinearSRGBColorSpace}};let id=0;for(const effect of this.effects)if(effect.blendMode.blendFunction===BlendFunction.DST)data.attributes|=effect.getAttributes()&EffectAttribute.DEPTH;else{if(0!=(data.attributes&effect.getAttributes()&EffectAttribute.CONVOLUTION))throw new Error(`Convolution effects cannot be merged (${effect.name})`);integrateEffect("e"+id++,effect,data)}let fragmentHead=data.shaderParts.get(EffectShaderSection.FRAGMENT_HEAD),fragmentMainImage=data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE),fragmentMainUv=data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV);const blendRegExp=/\bblend\b/g;for(const blendMode of data.blendModes.values())fragmentHead+=blendMode.getShaderCode().replace(blendRegExp,`blend${blendMode.blendFunction}`)+"\n";0!=(data.attributes&EffectAttribute.DEPTH)?(data.readDepth&&(fragmentMainImage="float depth = readDepth(UV);\n\n\t"+fragmentMainImage),this.needsDepthTexture=null===this.getDepthTexture()):this.needsDepthTexture=!1,data.colorSpace===three__WEBPACK_IMPORTED_MODULE_0__.SRGBColorSpace&&(fragmentMainImage+="color0 = sRGBToLinear(color0);\n\t"),data.uvTransformation?(fragmentMainUv="vec2 transformedUv = vUv;\n"+fragmentMainUv,data.defines.set("UV","transformedUv")):data.defines.set("UV","vUv"),data.shaderParts.set(EffectShaderSection.FRAGMENT_HEAD,fragmentHead),data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE,fragmentMainImage),data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV,fragmentMainUv);for(const[key,value]of data.shaderParts)null!==value&&data.shaderParts.set(key,value.trim().replace(/^#/,"\n#"));this.skipRendering=0===id,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(data)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.fullscreenMaterial.depthBuffer=depthTexture,this.fullscreenMaterial.depthPacking=depthPacking;for(const effect of this.effects)effect.setDepthTexture(depthTexture,depthPacking)}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){for(const effect of this.effects)effect.update(renderer,inputBuffer,deltaTime);if(!this.skipRendering||this.renderToScreen){const material=this.fullscreenMaterial;material.inputBuffer=inputBuffer.texture,material.time+=deltaTime*this.timeScale,renderer.setRenderTarget(this.renderToScreen?null:outputBuffer),renderer.render(this.scene,this.camera)}}setSize(width,height){this.fullscreenMaterial.setSize(width,height);for(const effect of this.effects)effect.setSize(width,height)}initialize(renderer,alpha,frameBufferType){this.renderer=renderer;for(const effect of this.effects)effect.initialize(renderer,alpha,frameBufferType);this.updateMaterial(),void 0!==frameBufferType&&frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const effect of this.effects)effect.removeEventListener("change",this.listener),effect.dispose()}handleEvent(event){if("change"===event.type)this.recompile()}},NormalPass=class extends Pass{constructor(scene,camera,{renderTarget:renderTarget,resolutionScale:resolutionScale=1,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new RenderPass(scene,camera,new three__WEBPACK_IMPORTED_MODULE_0__.MeshNormalMaterial);const renderPass=this.renderPass;renderPass.ignoreBackground=!0,renderPass.skipShadowMapUpdate=!0;const clearPass=renderPass.getClearPass();clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(7829503),clearPass.overrideClearAlpha=1,this.renderTarget=renderTarget,void 0===this.renderTarget&&(this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter}),this.renderTarget.texture.name="NormalPass.Target");const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}set mainScene(value){this.renderPass.mainScene=value}set mainCamera(value){this.renderPass.mainCamera=value}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const renderTarget=this.renderToScreen?null:this.renderTarget;this.renderPass.render(renderer,renderTarget,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height)}};new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]);new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]);bilinear(0,0,0,0),new Float32Array([0,0,0,0]),bilinear(0,0,0,1),new Float32Array([0,0,0,1]),bilinear(0,0,1,0),new Float32Array([0,0,1,0]),bilinear(0,0,1,1),new Float32Array([0,0,1,1]),bilinear(0,1,0,0),new Float32Array([0,1,0,0]),bilinear(0,1,0,1),new Float32Array([0,1,0,1]),bilinear(0,1,1,0),new Float32Array([0,1,1,0]),bilinear(0,1,1,1),new Float32Array([0,1,1,1]),bilinear(1,0,0,0),new Float32Array([1,0,0,0]),bilinear(1,0,0,1),new Float32Array([1,0,0,1]),bilinear(1,0,1,0),new Float32Array([1,0,1,0]),bilinear(1,0,1,1),new Float32Array([1,0,1,1]),bilinear(1,1,0,0),new Float32Array([1,1,0,0]),bilinear(1,1,0,1),new Float32Array([1,1,0,1]),bilinear(1,1,1,0),new Float32Array([1,1,1,0]),bilinear(1,1,1,1),new Float32Array([1,1,1,1]);function lerp2(a,b,p){return a+(b-a)*p}function bilinear(e0,e1,e2,e3){const a=lerp2(e0,e1,.75),b=lerp2(e2,e3,.75);return lerp2(a,b,.875)}},"./node_modules/three-stdlib/controls/OrbitControls.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{z:function(){return OrbitControls}});var three__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/three/build/three.module.js"),__defProp=Object.defineProperty,__publicField=(obj,key,value)=>(((obj,key,value)=>{key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value})(obj,"symbol"!=typeof key?key+"":key,value),value);const _ray=new three__WEBPACK_IMPORTED_MODULE_0__.Ray,_plane=new three__WEBPACK_IMPORTED_MODULE_0__.Plane,TILT_LIMIT=Math.cos(Math.PI/180*70),moduloWrapAround=(offset,capacity)=>(offset%capacity+capacity)%capacity;class OrbitControls extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(object,domElement){super(),__publicField(this,"object"),__publicField(this,"domElement"),__publicField(this,"enabled",!0),__publicField(this,"target",new three__WEBPACK_IMPORTED_MODULE_0__.Vector3),__publicField(this,"minDistance",0),__publicField(this,"maxDistance",1/0),__publicField(this,"minZoom",0),__publicField(this,"maxZoom",1/0),__publicField(this,"minPolarAngle",0),__publicField(this,"maxPolarAngle",Math.PI),__publicField(this,"minAzimuthAngle",-1/0),__publicField(this,"maxAzimuthAngle",1/0),__publicField(this,"enableDamping",!1),__publicField(this,"dampingFactor",.05),__publicField(this,"enableZoom",!0),__publicField(this,"zoomSpeed",1),__publicField(this,"enableRotate",!0),__publicField(this,"rotateSpeed",1),__publicField(this,"enablePan",!0),__publicField(this,"panSpeed",1),__publicField(this,"screenSpacePanning",!0),__publicField(this,"keyPanSpeed",7),__publicField(this,"zoomToCursor",!1),__publicField(this,"autoRotate",!1),__publicField(this,"autoRotateSpeed",2),__publicField(this,"reverseOrbit",!1),__publicField(this,"reverseHorizontalOrbit",!1),__publicField(this,"reverseVerticalOrbit",!1),__publicField(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),__publicField(this,"mouseButtons",{LEFT:three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.ROTATE,MIDDLE:three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.DOLLY,RIGHT:three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.PAN}),__publicField(this,"touches",{ONE:three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.ROTATE,TWO:three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_PAN}),__publicField(this,"target0"),__publicField(this,"position0"),__publicField(this,"zoom0"),__publicField(this,"_domElementKeyEvents",null),__publicField(this,"getPolarAngle"),__publicField(this,"getAzimuthalAngle"),__publicField(this,"setPolarAngle"),__publicField(this,"setAzimuthalAngle"),__publicField(this,"getDistance"),__publicField(this,"listenToKeyEvents"),__publicField(this,"stopListenToKeyEvents"),__publicField(this,"saveState"),__publicField(this,"reset"),__publicField(this,"update"),__publicField(this,"connect"),__publicField(this,"dispose"),this.object=object,this.domElement=domElement,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>spherical.phi,this.getAzimuthalAngle=()=>spherical.theta,this.setPolarAngle=value=>{let phi=moduloWrapAround(value,2*Math.PI),currentPhi=spherical.phi;currentPhi<0&&(currentPhi+=2*Math.PI),phi<0&&(phi+=2*Math.PI);let phiDist=Math.abs(phi-currentPhi);2*Math.PI-phiDist{let theta=moduloWrapAround(value,2*Math.PI),currentTheta=spherical.theta;currentTheta<0&&(currentTheta+=2*Math.PI),theta<0&&(theta+=2*Math.PI);let thetaDist=Math.abs(theta-currentTheta);2*Math.PI-thetaDistscope.object.position.distanceTo(scope.target),this.listenToKeyEvents=domElement2=>{domElement2.addEventListener("keydown",onKeyDown),this._domElementKeyEvents=domElement2},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",onKeyDown),this._domElementKeyEvents=null},this.saveState=()=>{scope.target0.copy(scope.target),scope.position0.copy(scope.object.position),scope.zoom0=scope.object.zoom},this.reset=()=>{scope.target.copy(scope.target0),scope.object.position.copy(scope.position0),scope.object.zoom=scope.zoom0,scope.object.updateProjectionMatrix(),scope.dispatchEvent(changeEvent),scope.update(),state=STATE.NONE},this.update=(()=>{const offset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,up=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(0,1,0),quat=(new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion).setFromUnitVectors(object.up,up),quatInverse=quat.clone().invert(),lastPosition=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,lastQuaternion=new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion,twoPI=2*Math.PI;return function update(){const position=scope.object.position;quat.setFromUnitVectors(object.up,up),quatInverse.copy(quat).invert(),offset.copy(position).sub(scope.target),offset.applyQuaternion(quat),spherical.setFromVector3(offset),scope.autoRotate&&state===STATE.NONE&&rotateLeft(function getAutoRotationAngle(){return 2*Math.PI/60/60*scope.autoRotateSpeed}()),scope.enableDamping?(spherical.theta+=sphericalDelta.theta*scope.dampingFactor,spherical.phi+=sphericalDelta.phi*scope.dampingFactor):(spherical.theta+=sphericalDelta.theta,spherical.phi+=sphericalDelta.phi);let min=scope.minAzimuthAngle,max=scope.maxAzimuthAngle;isFinite(min)&&isFinite(max)&&(min<-Math.PI?min+=twoPI:min>Math.PI&&(min-=twoPI),max<-Math.PI?max+=twoPI:max>Math.PI&&(max-=twoPI),spherical.theta=min<=max?Math.max(min,Math.min(max,spherical.theta)):spherical.theta>(min+max)/2?Math.max(min,spherical.theta):Math.min(max,spherical.theta)),spherical.phi=Math.max(scope.minPolarAngle,Math.min(scope.maxPolarAngle,spherical.phi)),spherical.makeSafe(),!0===scope.enableDamping?scope.target.addScaledVector(panOffset,scope.dampingFactor):scope.target.add(panOffset),scope.zoomToCursor&&performCursorZoom||scope.object.isOrthographicCamera?spherical.radius=clampDistance(spherical.radius):spherical.radius=clampDistance(spherical.radius*scale),offset.setFromSpherical(spherical),offset.applyQuaternion(quatInverse),position.copy(scope.target).add(offset),scope.object.matrixAutoUpdate||scope.object.updateMatrix(),scope.object.lookAt(scope.target),!0===scope.enableDamping?(sphericalDelta.theta*=1-scope.dampingFactor,sphericalDelta.phi*=1-scope.dampingFactor,panOffset.multiplyScalar(1-scope.dampingFactor)):(sphericalDelta.set(0,0,0),panOffset.set(0,0,0));let zoomChanged=!1;if(scope.zoomToCursor&&performCursorZoom){let newRadius=null;if(scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera){const prevRadius=offset.length();newRadius=clampDistance(prevRadius*scale);const radiusDelta=prevRadius-newRadius;scope.object.position.addScaledVector(dollyDirection,radiusDelta),scope.object.updateMatrixWorld()}else if(scope.object.isOrthographicCamera){const mouseBefore=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(mouse.x,mouse.y,0);mouseBefore.unproject(scope.object),scope.object.zoom=Math.max(scope.minZoom,Math.min(scope.maxZoom,scope.object.zoom/scale)),scope.object.updateProjectionMatrix(),zoomChanged=!0;const mouseAfter=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(mouse.x,mouse.y,0);mouseAfter.unproject(scope.object),scope.object.position.sub(mouseAfter).add(mouseBefore),scope.object.updateMatrixWorld(),newRadius=offset.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),scope.zoomToCursor=!1;null!==newRadius&&(scope.screenSpacePanning?scope.target.set(0,0,-1).transformDirection(scope.object.matrix).multiplyScalar(newRadius).add(scope.object.position):(_ray.origin.copy(scope.object.position),_ray.direction.set(0,0,-1).transformDirection(scope.object.matrix),Math.abs(scope.object.up.dot(_ray.direction))EPS||8*(1-lastQuaternion.dot(scope.object.quaternion))>EPS)&&(scope.dispatchEvent(changeEvent),lastPosition.copy(scope.object.position),lastQuaternion.copy(scope.object.quaternion),zoomChanged=!1,!0)}})(),this.connect=domElement2=>{domElement2===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),scope.domElement=domElement2,scope.domElement.style.touchAction="none",scope.domElement.addEventListener("contextmenu",onContextMenu),scope.domElement.addEventListener("pointerdown",onPointerDown),scope.domElement.addEventListener("pointercancel",onPointerUp),scope.domElement.addEventListener("wheel",onMouseWheel)},this.dispose=()=>{var _a,_b,_c,_d,_e,_f;scope.domElement&&(scope.domElement.style.touchAction="auto"),null==(_a=scope.domElement)||_a.removeEventListener("contextmenu",onContextMenu),null==(_b=scope.domElement)||_b.removeEventListener("pointerdown",onPointerDown),null==(_c=scope.domElement)||_c.removeEventListener("pointercancel",onPointerUp),null==(_d=scope.domElement)||_d.removeEventListener("wheel",onMouseWheel),null==(_e=scope.domElement)||_e.ownerDocument.removeEventListener("pointermove",onPointerMove),null==(_f=scope.domElement)||_f.ownerDocument.removeEventListener("pointerup",onPointerUp),null!==scope._domElementKeyEvents&&scope._domElementKeyEvents.removeEventListener("keydown",onKeyDown)};const scope=this,changeEvent={type:"change"},startEvent={type:"start"},endEvent={type:"end"},STATE={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let state=STATE.NONE;const EPS=1e-6,spherical=new three__WEBPACK_IMPORTED_MODULE_0__.Spherical,sphericalDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Spherical;let scale=1;const panOffset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,rotateStart=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,rotateEnd=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,rotateDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,panStart=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,panEnd=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,panDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyStart=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyEnd=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyDirection=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,mouse=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2;let performCursorZoom=!1;const pointers=[],pointerPositions={};function getZoomScale(){return Math.pow(.95,scope.zoomSpeed)}function rotateLeft(angle){scope.reverseOrbit||scope.reverseHorizontalOrbit?sphericalDelta.theta+=angle:sphericalDelta.theta-=angle}function rotateUp(angle){scope.reverseOrbit||scope.reverseVerticalOrbit?sphericalDelta.phi+=angle:sphericalDelta.phi-=angle}const panLeft=(()=>{const v=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;return function panLeft2(distance,objectMatrix){v.setFromMatrixColumn(objectMatrix,0),v.multiplyScalar(-distance),panOffset.add(v)}})(),panUp=(()=>{const v=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;return function panUp2(distance,objectMatrix){!0===scope.screenSpacePanning?v.setFromMatrixColumn(objectMatrix,1):(v.setFromMatrixColumn(objectMatrix,0),v.crossVectors(scope.object.up,v)),v.multiplyScalar(distance),panOffset.add(v)}})(),pan=(()=>{const offset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;return function pan2(deltaX,deltaY){const element=scope.domElement;if(element&&scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera){const position=scope.object.position;offset.copy(position).sub(scope.target);let targetDistance=offset.length();targetDistance*=Math.tan(scope.object.fov/2*Math.PI/180),panLeft(2*deltaX*targetDistance/element.clientHeight,scope.object.matrix),panUp(2*deltaY*targetDistance/element.clientHeight,scope.object.matrix)}else element&&scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera&&scope.object.isOrthographicCamera?(panLeft(deltaX*(scope.object.right-scope.object.left)/scope.object.zoom/element.clientWidth,scope.object.matrix),panUp(deltaY*(scope.object.top-scope.object.bottom)/scope.object.zoom/element.clientHeight,scope.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),scope.enablePan=!1)}})();function dollyOut(dollyScale){scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera||scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera&&scope.object.isOrthographicCamera?scale/=dollyScale:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),scope.enableZoom=!1)}function dollyIn(dollyScale){scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera||scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera&&scope.object.isOrthographicCamera?scale*=dollyScale:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),scope.enableZoom=!1)}function updateMouseParameters(event){if(!scope.zoomToCursor||!scope.domElement)return;performCursorZoom=!0;const rect=scope.domElement.getBoundingClientRect(),x=event.clientX-rect.left,y=event.clientY-rect.top,w=rect.width,h=rect.height;mouse.x=x/w*2-1,mouse.y=-y/h*2+1,dollyDirection.set(mouse.x,mouse.y,1).unproject(scope.object).sub(scope.object.position).normalize()}function clampDistance(dist){return Math.max(scope.minDistance,Math.min(scope.maxDistance,dist))}function handleMouseDownRotate(event){rotateStart.set(event.clientX,event.clientY)}function handleMouseDownPan(event){panStart.set(event.clientX,event.clientY)}function handleTouchStartRotate(){if(1==pointers.length)rotateStart.set(pointers[0].pageX,pointers[0].pageY);else{const x=.5*(pointers[0].pageX+pointers[1].pageX),y=.5*(pointers[0].pageY+pointers[1].pageY);rotateStart.set(x,y)}}function handleTouchStartPan(){if(1==pointers.length)panStart.set(pointers[0].pageX,pointers[0].pageY);else{const x=.5*(pointers[0].pageX+pointers[1].pageX),y=.5*(pointers[0].pageY+pointers[1].pageY);panStart.set(x,y)}}function handleTouchStartDolly(){const dx=pointers[0].pageX-pointers[1].pageX,dy=pointers[0].pageY-pointers[1].pageY,distance=Math.sqrt(dx*dx+dy*dy);dollyStart.set(0,distance)}function handleTouchMoveRotate(event){if(1==pointers.length)rotateEnd.set(event.pageX,event.pageY);else{const position=getSecondPointerPosition(event),x=.5*(event.pageX+position.x),y=.5*(event.pageY+position.y);rotateEnd.set(x,y)}rotateDelta.subVectors(rotateEnd,rotateStart).multiplyScalar(scope.rotateSpeed);const element=scope.domElement;element&&(rotateLeft(2*Math.PI*rotateDelta.x/element.clientHeight),rotateUp(2*Math.PI*rotateDelta.y/element.clientHeight)),rotateStart.copy(rotateEnd)}function handleTouchMovePan(event){if(1==pointers.length)panEnd.set(event.pageX,event.pageY);else{const position=getSecondPointerPosition(event),x=.5*(event.pageX+position.x),y=.5*(event.pageY+position.y);panEnd.set(x,y)}panDelta.subVectors(panEnd,panStart).multiplyScalar(scope.panSpeed),pan(panDelta.x,panDelta.y),panStart.copy(panEnd)}function handleTouchMoveDolly(event){const position=getSecondPointerPosition(event),dx=event.pageX-position.x,dy=event.pageY-position.y,distance=Math.sqrt(dx*dx+dy*dy);dollyEnd.set(0,distance),dollyDelta.set(0,Math.pow(dollyEnd.y/dollyStart.y,scope.zoomSpeed)),dollyOut(dollyDelta.y),dollyStart.copy(dollyEnd)}function onPointerDown(event){var _a,_b;!1!==scope.enabled&&(0===pointers.length&&(null==(_a=scope.domElement)||_a.ownerDocument.addEventListener("pointermove",onPointerMove),null==(_b=scope.domElement)||_b.ownerDocument.addEventListener("pointerup",onPointerUp)),function addPointer(event){pointers.push(event)}(event),"touch"===event.pointerType?function onTouchStart(event){switch(trackPointer(event),pointers.length){case 1:switch(scope.touches.ONE){case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.ROTATE:if(!1===scope.enableRotate)return;handleTouchStartRotate(),state=STATE.TOUCH_ROTATE;break;case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.PAN:if(!1===scope.enablePan)return;handleTouchStartPan(),state=STATE.TOUCH_PAN;break;default:state=STATE.NONE}break;case 2:switch(scope.touches.TWO){case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_PAN:if(!1===scope.enableZoom&&!1===scope.enablePan)return;!function handleTouchStartDollyPan(){scope.enableZoom&&handleTouchStartDolly(),scope.enablePan&&handleTouchStartPan()}(),state=STATE.TOUCH_DOLLY_PAN;break;case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_ROTATE:if(!1===scope.enableZoom&&!1===scope.enableRotate)return;!function handleTouchStartDollyRotate(){scope.enableZoom&&handleTouchStartDolly(),scope.enableRotate&&handleTouchStartRotate()}(),state=STATE.TOUCH_DOLLY_ROTATE;break;default:state=STATE.NONE}break;default:state=STATE.NONE}state!==STATE.NONE&&scope.dispatchEvent(startEvent)}(event):function onMouseDown(event){let mouseAction;switch(event.button){case 0:mouseAction=scope.mouseButtons.LEFT;break;case 1:mouseAction=scope.mouseButtons.MIDDLE;break;case 2:mouseAction=scope.mouseButtons.RIGHT;break;default:mouseAction=-1}switch(mouseAction){case three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.DOLLY:if(!1===scope.enableZoom)return;!function handleMouseDownDolly(event){updateMouseParameters(event),dollyStart.set(event.clientX,event.clientY)}(event),state=STATE.DOLLY;break;case three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.ROTATE:if(event.ctrlKey||event.metaKey||event.shiftKey){if(!1===scope.enablePan)return;handleMouseDownPan(event),state=STATE.PAN}else{if(!1===scope.enableRotate)return;handleMouseDownRotate(event),state=STATE.ROTATE}break;case three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.PAN:if(event.ctrlKey||event.metaKey||event.shiftKey){if(!1===scope.enableRotate)return;handleMouseDownRotate(event),state=STATE.ROTATE}else{if(!1===scope.enablePan)return;handleMouseDownPan(event),state=STATE.PAN}break;default:state=STATE.NONE}state!==STATE.NONE&&scope.dispatchEvent(startEvent)}(event))}function onPointerMove(event){!1!==scope.enabled&&("touch"===event.pointerType?function onTouchMove(event){switch(trackPointer(event),state){case STATE.TOUCH_ROTATE:if(!1===scope.enableRotate)return;handleTouchMoveRotate(event),scope.update();break;case STATE.TOUCH_PAN:if(!1===scope.enablePan)return;handleTouchMovePan(event),scope.update();break;case STATE.TOUCH_DOLLY_PAN:if(!1===scope.enableZoom&&!1===scope.enablePan)return;!function handleTouchMoveDollyPan(event){scope.enableZoom&&handleTouchMoveDolly(event),scope.enablePan&&handleTouchMovePan(event)}(event),scope.update();break;case STATE.TOUCH_DOLLY_ROTATE:if(!1===scope.enableZoom&&!1===scope.enableRotate)return;!function handleTouchMoveDollyRotate(event){scope.enableZoom&&handleTouchMoveDolly(event),scope.enableRotate&&handleTouchMoveRotate(event)}(event),scope.update();break;default:state=STATE.NONE}}(event):function onMouseMove(event){if(!1===scope.enabled)return;switch(state){case STATE.ROTATE:if(!1===scope.enableRotate)return;!function handleMouseMoveRotate(event){rotateEnd.set(event.clientX,event.clientY),rotateDelta.subVectors(rotateEnd,rotateStart).multiplyScalar(scope.rotateSpeed);const element=scope.domElement;element&&(rotateLeft(2*Math.PI*rotateDelta.x/element.clientHeight),rotateUp(2*Math.PI*rotateDelta.y/element.clientHeight)),rotateStart.copy(rotateEnd),scope.update()}(event);break;case STATE.DOLLY:if(!1===scope.enableZoom)return;!function handleMouseMoveDolly(event){dollyEnd.set(event.clientX,event.clientY),dollyDelta.subVectors(dollyEnd,dollyStart),dollyDelta.y>0?dollyOut(getZoomScale()):dollyDelta.y<0&&dollyIn(getZoomScale()),dollyStart.copy(dollyEnd),scope.update()}(event);break;case STATE.PAN:if(!1===scope.enablePan)return;!function handleMouseMovePan(event){panEnd.set(event.clientX,event.clientY),panDelta.subVectors(panEnd,panStart).multiplyScalar(scope.panSpeed),pan(panDelta.x,panDelta.y),panStart.copy(panEnd),scope.update()}(event)}}(event))}function onPointerUp(event){var _a,_b,_c;!function removePointer(event){delete pointerPositions[event.pointerId];for(let i=0;i0&&dollyOut(getZoomScale()),scope.update()}(event),scope.dispatchEvent(endEvent))}function onKeyDown(event){!1!==scope.enabled&&!1!==scope.enablePan&&function handleKeyDown(event){let needsUpdate=!1;switch(event.code){case scope.keys.UP:pan(0,scope.keyPanSpeed),needsUpdate=!0;break;case scope.keys.BOTTOM:pan(0,-scope.keyPanSpeed),needsUpdate=!0;break;case scope.keys.LEFT:pan(scope.keyPanSpeed,0),needsUpdate=!0;break;case scope.keys.RIGHT:pan(-scope.keyPanSpeed,0),needsUpdate=!0}needsUpdate&&(event.preventDefault(),scope.update())}(event)}function onContextMenu(event){!1!==scope.enabled&&event.preventDefault()}function trackPointer(event){let position=pointerPositions[event.pointerId];void 0===position&&(position=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,pointerPositions[event.pointerId]=position),position.set(event.pageX,event.pageY)}function getSecondPointerPosition(event){const pointer=event.pointerId===pointers[0].pointerId?pointers[1]:pointers[0];return pointerPositions[pointer.pointerId]}void 0!==domElement&&this.connect(domElement),this.update()}}}}]); \ No newline at end of file diff --git a/docs/140.a6128e7c.iframe.bundle.js.LICENSE.txt b/docs/140.a6128e7c.iframe.bundle.js.LICENSE.txt new file mode 100644 index 00000000..c7d4e3b9 --- /dev/null +++ b/docs/140.a6128e7c.iframe.bundle.js.LICENSE.txt @@ -0,0 +1,6 @@ +/** + * postprocessing v6.35.6 build Fri Jul 05 2024 + * https://github.com/pmndrs/postprocessing + * Copyright 2015-2024 Raoul van Rüschen + * @license Zlib + */ diff --git a/docs/152.00429889.iframe.bundle.js b/docs/152.00429889.iframe.bundle.js new file mode 100644 index 00000000..42880dbf --- /dev/null +++ b/docs/152.00429889.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[152],{"./node_modules/@react-three/drei/core/Bounds.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{B:function(){return useBounds},Y:function(){return Bounds}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),three__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/three/build/three.module.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),AnimationState=function(AnimationState){return AnimationState[AnimationState.NONE=0]="NONE",AnimationState[AnimationState.START=1]="START",AnimationState[AnimationState.ACTIVE=2]="ACTIVE",AnimationState}(AnimationState||{});const isOrthographic=def=>def&&def.isOrthographicCamera,isBox3=def=>def&&def.isBox3,interpolateFuncDefault=t=>1-Math.exp(-5*t)+.007*t,context=react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);function Bounds({children:children,maxDuration:maxDuration=1,margin:margin=1.2,observe:observe,fit:fit,clip:clip,interpolateFunc:interpolateFunc=interpolateFuncDefault,onFit:onFit}){const ref=react__WEBPACK_IMPORTED_MODULE_0__.useRef(null),{camera:camera,size:size,invalidate:invalidate}=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__.A)(),controls=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__.A)((state=>state.controls)),onFitRef=react__WEBPACK_IMPORTED_MODULE_0__.useRef(onFit);onFitRef.current=onFit;const origin=react__WEBPACK_IMPORTED_MODULE_0__.useRef({camPos:new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,camRot:new three__WEBPACK_IMPORTED_MODULE_2__.Quaternion,camZoom:1}),goal=react__WEBPACK_IMPORTED_MODULE_0__.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),animationState=react__WEBPACK_IMPORTED_MODULE_0__.useRef(AnimationState.NONE),t=react__WEBPACK_IMPORTED_MODULE_0__.useRef(0),[box]=react__WEBPACK_IMPORTED_MODULE_0__.useState((()=>new three__WEBPACK_IMPORTED_MODULE_2__.Box3)),api=react__WEBPACK_IMPORTED_MODULE_0__.useMemo((()=>{function getSize(){const boxSize=box.getSize(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3),center=box.getCenter(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3),maxSize=Math.max(boxSize.x,boxSize.y,boxSize.z),fitHeightDistance=isOrthographic(camera)?4*maxSize:maxSize/(2*Math.atan(Math.PI*camera.fov/360)),fitWidthDistance=isOrthographic(camera)?4*maxSize:fitHeightDistance/camera.aspect,distance=margin*Math.max(fitHeightDistance,fitWidthDistance);return{box:box,size:boxSize,center:center,distance:distance}}return{getSize:getSize,refresh(object){if(isBox3(object))box.copy(object);else{const target=object||ref.current;if(!target)return this;target.updateWorldMatrix(!0,!0),box.setFromObject(target)}if(box.isEmpty()){const max=camera.position.length()||10;box.setFromCenterAndSize(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(max,max,max))}return origin.current.camPos.copy(camera.position),origin.current.camRot.copy(camera.quaternion),isOrthographic(camera)&&(origin.current.camZoom=camera.zoom),goal.current.camPos=void 0,goal.current.camRot=void 0,goal.current.camZoom=void 0,goal.current.camUp=void 0,goal.current.target=void 0,this},reset(){const{center:center,distance:distance}=getSize(),direction=camera.position.clone().sub(center).normalize();goal.current.camPos=center.clone().addScaledVector(direction,distance),goal.current.target=center.clone();const mCamRot=(new three__WEBPACK_IMPORTED_MODULE_2__.Matrix4).lookAt(goal.current.camPos,goal.current.target,camera.up);return goal.current.camRot=(new three__WEBPACK_IMPORTED_MODULE_2__.Quaternion).setFromRotationMatrix(mCamRot),animationState.current=AnimationState.START,t.current=0,this},moveTo(position){return goal.current.camPos=Array.isArray(position)?new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(...position):position.clone(),animationState.current=AnimationState.START,t.current=0,this},lookAt({target:target,up:up}){goal.current.target=Array.isArray(target)?new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(...target):target.clone(),goal.current.camUp=up?Array.isArray(up)?new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(...up):up.clone():camera.up.clone();const mCamRot=(new three__WEBPACK_IMPORTED_MODULE_2__.Matrix4).lookAt(goal.current.camPos||camera.position,goal.current.target,goal.current.camUp);return goal.current.camRot=(new three__WEBPACK_IMPORTED_MODULE_2__.Quaternion).setFromRotationMatrix(mCamRot),animationState.current=AnimationState.START,t.current=0,this},to({position:position,target:target}){return this.moveTo(position).lookAt({target:target})},fit(){if(!isOrthographic(camera))return this.reset();let maxHeight=0,maxWidth=0;const vertices=[new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.min.y,box.min.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.max.y,box.min.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.min.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.max.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.max.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.max.y,box.min.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.min.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.min.y,box.min.z)],pos=goal.current.camPos||camera.position,target=goal.current.target||(null==controls?void 0:controls.target),up=goal.current.camUp||camera.up,mCamWInv=target?(new three__WEBPACK_IMPORTED_MODULE_2__.Matrix4).lookAt(pos,target,up).setPosition(pos).invert():camera.matrixWorldInverse;for(const v of vertices)v.applyMatrix4(mCamWInv),maxHeight=Math.max(maxHeight,Math.abs(v.y)),maxWidth=Math.max(maxWidth,Math.abs(v.x));maxHeight*=2,maxWidth*=2;const zoomForHeight=(camera.top-camera.bottom)/maxHeight,zoomForWidth=(camera.right-camera.left)/maxWidth;return goal.current.camZoom=Math.min(zoomForHeight,zoomForWidth)/margin,animationState.current=AnimationState.START,t.current=0,onFitRef.current&&onFitRef.current(this.getSize()),this},clip(){const{distance:distance}=getSize();return camera.near=distance/100,camera.far=100*distance,camera.updateProjectionMatrix(),controls&&(controls.maxDistance=10*distance,controls.update()),invalidate(),this}}}),[box,camera,controls,margin,invalidate]);react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect((()=>{if(controls){const callback=()=>{if(controls&&goal.current.target&&animationState.current!==AnimationState.NONE){const front=(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3).setFromMatrixColumn(camera.matrix,2),d0=origin.current.camPos.distanceTo(controls.target),d1=(goal.current.camPos||origin.current.camPos).distanceTo(goal.current.target),d=(1-t.current)*d0+t.current*d1;controls.target.copy(camera.position).addScaledVector(front,-d),controls.update()}animationState.current=AnimationState.NONE};return controls.addEventListener("start",callback),()=>controls.removeEventListener("start",callback)}}),[controls]);const count=react__WEBPACK_IMPORTED_MODULE_0__.useRef(0);return react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect((()=>{(observe||0==count.current++)&&(api.refresh(),fit&&api.reset().fit(),clip&&api.clip())}),[size,clip,fit,observe,camera,controls]),(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__.C)(((state,delta)=>{if(animationState.current===AnimationState.START)animationState.current=AnimationState.ACTIVE,invalidate();else if(animationState.current===AnimationState.ACTIVE){if(t.current+=delta/maxDuration,t.current>=1)goal.current.camPos&&camera.position.copy(goal.current.camPos),goal.current.camRot&&camera.quaternion.copy(goal.current.camRot),goal.current.camUp&&camera.up.copy(goal.current.camUp),goal.current.camZoom&&isOrthographic(camera)&&(camera.zoom=goal.current.camZoom),camera.updateMatrixWorld(),camera.updateProjectionMatrix(),controls&&goal.current.target&&(controls.target.copy(goal.current.target),controls.update()),animationState.current=AnimationState.NONE;else{const k=interpolateFunc(t.current);goal.current.camPos&&camera.position.lerpVectors(origin.current.camPos,goal.current.camPos,k),goal.current.camRot&&camera.quaternion.slerpQuaternions(origin.current.camRot,goal.current.camRot,k),goal.current.camUp&&camera.up.set(0,1,0).applyQuaternion(camera.quaternion),goal.current.camZoom&&isOrthographic(camera)&&(camera.zoom=(1-k)*origin.current.camZoom+k*goal.current.camZoom),camera.updateMatrixWorld(),camera.updateProjectionMatrix()}invalidate()}})),react__WEBPACK_IMPORTED_MODULE_0__.createElement("group",{ref:ref},react__WEBPACK_IMPORTED_MODULE_0__.createElement(context.Provider,{value:api},children))}function useBounds(){return react__WEBPACK_IMPORTED_MODULE_0__.useContext(context)}},"./node_modules/@react-three/drei/web/PresentationControls.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{N:function(){return PresentationControls}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js");let updateQueue=makeQueue();const react_spring_rafz_esm_raf=fn=>schedule(fn,updateQueue);let writeQueue=makeQueue();react_spring_rafz_esm_raf.write=fn=>schedule(fn,writeQueue);let onStartQueue=makeQueue();react_spring_rafz_esm_raf.onStart=fn=>schedule(fn,onStartQueue);let onFrameQueue=makeQueue();react_spring_rafz_esm_raf.onFrame=fn=>schedule(fn,onFrameQueue);let onFinishQueue=makeQueue();react_spring_rafz_esm_raf.onFinish=fn=>schedule(fn,onFinishQueue);let timeouts=[];react_spring_rafz_esm_raf.setTimeout=(handler,ms)=>{let time=react_spring_rafz_esm_raf.now()+ms,cancel=()=>{let i=timeouts.findIndex((t=>t.cancel==cancel));~i&&timeouts.splice(i,1),pendingCount-=~i?1:0},timeout={time:time,handler:handler,cancel:cancel};return timeouts.splice(findTimeout(time),0,timeout),pendingCount+=1,start(),timeout};let findTimeout=time=>~(~timeouts.findIndex((t=>t.time>time))||~timeouts.length);react_spring_rafz_esm_raf.cancel=fn=>{onStartQueue.delete(fn),onFrameQueue.delete(fn),onFinishQueue.delete(fn),updateQueue.delete(fn),writeQueue.delete(fn)},react_spring_rafz_esm_raf.sync=fn=>{sync=!0,react_spring_rafz_esm_raf.batchedUpdates(fn),sync=!1},react_spring_rafz_esm_raf.throttle=fn=>{let lastArgs;function queuedFn(){try{fn(...lastArgs)}finally{lastArgs=null}}function throttled(...args){lastArgs=args,react_spring_rafz_esm_raf.onStart(queuedFn)}return throttled.handler=fn,throttled.cancel=()=>{onStartQueue.delete(queuedFn),lastArgs=null},throttled};let nativeRaf="undefined"!=typeof window?window.requestAnimationFrame:()=>{};react_spring_rafz_esm_raf.use=impl=>nativeRaf=impl,react_spring_rafz_esm_raf.now="undefined"!=typeof performance?()=>performance.now():Date.now,react_spring_rafz_esm_raf.batchedUpdates=fn=>fn(),react_spring_rafz_esm_raf.catch=console.error,react_spring_rafz_esm_raf.frameLoop="always",react_spring_rafz_esm_raf.advance=()=>{"demand"!==react_spring_rafz_esm_raf.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):update()};let ts=-1,pendingCount=0,sync=!1;function schedule(fn,queue){sync?(queue.delete(fn),fn(0)):(queue.add(fn),start())}function start(){ts<0&&(ts=0,"demand"!==react_spring_rafz_esm_raf.frameLoop&&nativeRaf(loop))}function loop(){~ts&&(nativeRaf(loop),react_spring_rafz_esm_raf.batchedUpdates(update))}function update(){let prevTs=ts;ts=react_spring_rafz_esm_raf.now();let count=findTimeout(ts);count&&(eachSafely(timeouts.splice(0,count),(t=>t.handler())),pendingCount-=count),pendingCount?(onStartQueue.flush(),updateQueue.flush(prevTs?Math.min(64,ts-prevTs):16.667),onFrameQueue.flush(),writeQueue.flush(),onFinishQueue.flush()):function stop(){ts=-1}()}function makeQueue(){let next=new Set,current=next;return{add(fn){pendingCount+=current!=next||next.has(fn)?0:1,next.add(fn)},delete(fn){return pendingCount-=current==next&&next.has(fn)?1:0,next.delete(fn)},flush(arg){current.size&&(next=new Set,pendingCount-=current.size,eachSafely(current,(fn=>fn(arg)&&next.add(fn))),pendingCount+=next.size,current=next)}}}function eachSafely(values,each){values.forEach((value=>{try{each(value)}catch(e){react_spring_rafz_esm_raf.catch(e)}}))}function noop(){}const react_spring_shared_esm_is={arr:Array.isArray,obj:a=>!!a&&"Object"===a.constructor.name,fun:a=>"function"==typeof a,str:a=>"string"==typeof a,num:a=>"number"==typeof a,und:a=>void 0===a};function isEqual(a,b){if(react_spring_shared_esm_is.arr(a)){if(!react_spring_shared_esm_is.arr(b)||a.length!==b.length)return!1;for(let i=0;iobj.forEach(fn);function eachProp(obj,fn,ctx){if(react_spring_shared_esm_is.arr(obj))for(let i=0;ireact_spring_shared_esm_is.und(a)?[]:react_spring_shared_esm_is.arr(a)?a:[a];function flush(queue,iterator){if(queue.size){const items=Array.from(queue);queue.clear(),react_spring_shared_esm_each(items,iterator)}}const flushCalls=(queue,...args)=>flush(queue,(fn=>fn(...args))),isSSR=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let createStringInterpolator$1,to,colors$1=null,skipAnimation=!1,willAdvance=noop;const react_spring_shared_esm_assign=globals=>{globals.to&&(to=globals.to),globals.now&&(react_spring_rafz_esm_raf.now=globals.now),void 0!==globals.colors&&(colors$1=globals.colors),null!=globals.skipAnimation&&(skipAnimation=globals.skipAnimation),globals.createStringInterpolator&&(createStringInterpolator$1=globals.createStringInterpolator),globals.requestAnimationFrame&&react_spring_rafz_esm_raf.use(globals.requestAnimationFrame),globals.batchedUpdates&&(react_spring_rafz_esm_raf.batchedUpdates=globals.batchedUpdates),globals.willAdvance&&(willAdvance=globals.willAdvance),globals.frameLoop&&(react_spring_rafz_esm_raf.frameLoop=globals.frameLoop)};var globals=Object.freeze({__proto__:null,get createStringInterpolator(){return createStringInterpolator$1},get to(){return to},get colors(){return colors$1},get skipAnimation(){return skipAnimation},get willAdvance(){return willAdvance},assign:react_spring_shared_esm_assign});const startQueue=new Set;let currentFrame=[],prevFrame=[],priority=0;const frameLoop={get idle(){return!startQueue.size&&!currentFrame.length},start(animation){priority>animation.priority?(startQueue.add(animation),react_spring_rafz_esm_raf.onStart(flushStartQueue)):(startSafely(animation),react_spring_rafz_esm_raf(advance))},advance:advance,sort(animation){if(priority)react_spring_rafz_esm_raf.onFrame((()=>frameLoop.sort(animation)));else{const prevIndex=currentFrame.indexOf(animation);~prevIndex&&(currentFrame.splice(prevIndex,1),startUnsafely(animation))}},clear(){currentFrame=[],startQueue.clear()}};function flushStartQueue(){startQueue.forEach(startSafely),startQueue.clear(),react_spring_rafz_esm_raf(advance)}function startSafely(animation){currentFrame.includes(animation)||startUnsafely(animation)}function startUnsafely(animation){currentFrame.splice(function findIndex(arr,test){const index=arr.findIndex(test);return index<0?arr.length:index}(currentFrame,(other=>other.priority>animation.priority)),0,animation)}function advance(dt){const nextFrame=prevFrame;for(let i=0;i0}const NUMBER="[-+]?\\d*\\.?\\d+",PERCENTAGE=NUMBER+"%";function call(...parts){return"\\(\\s*("+parts.join(")\\s*,\\s*(")+")\\s*\\)"}const rgb=new RegExp("rgb"+call(NUMBER,NUMBER,NUMBER)),rgba=new RegExp("rgba"+call(NUMBER,NUMBER,NUMBER,NUMBER)),hsl=new RegExp("hsl"+call(NUMBER,PERCENTAGE,PERCENTAGE)),hsla=new RegExp("hsla"+call(NUMBER,PERCENTAGE,PERCENTAGE,NUMBER)),hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6=/^#([0-9a-fA-F]{6})$/,hex8=/^#([0-9a-fA-F]{8})$/;function hue2rgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p}function hslToRgb(h,s,l){const q=l<.5?l*(1+s):l+s-l*s,p=2*l-q,r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3);return Math.round(255*r)<<24|Math.round(255*g)<<16|Math.round(255*b)<<8}function parse255(str){const int=parseInt(str,10);return int<0?0:int>255?255:int}function parse360(str){return(parseFloat(str)%360+360)%360/360}function parse1(str){const num=parseFloat(str);return num<0?0:num>1?255:Math.round(255*num)}function parsePercentage(str){const int=parseFloat(str);return int<0?0:int>100?1:int/100}function colorToRgba(input){let int32Color=function normalizeColor(color){let match;return"number"==typeof color?color>>>0===color&&color>=0&&color<=4294967295?color:null:(match=hex6.exec(color))?parseInt(match[1]+"ff",16)>>>0:colors$1&&void 0!==colors$1[color]?colors$1[color]:(match=rgb.exec(color))?(parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|255)>>>0:(match=rgba.exec(color))?(parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|parse1(match[4]))>>>0:(match=hex3.exec(color))?parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+"ff",16)>>>0:(match=hex8.exec(color))?parseInt(match[1],16)>>>0:(match=hex4.exec(color))?parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+match[4]+match[4],16)>>>0:(match=hsl.exec(color))?(255|hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3])))>>>0:(match=hsla.exec(color))?(hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3]))|parse1(match[4]))>>>0:null}(input);return null===int32Color?input:(int32Color=int32Color||0,`rgba(${(4278190080&int32Color)>>>24}, ${(16711680&int32Color)>>>16}, ${(65280&int32Color)>>>8}, ${(255&int32Color)/255})`)}const createInterpolator=(range,output,extrapolate)=>{if(react_spring_shared_esm_is.fun(range))return range;if(react_spring_shared_esm_is.arr(range))return createInterpolator({range:range,output:output,extrapolate:extrapolate});if(react_spring_shared_esm_is.str(range.output[0]))return createStringInterpolator$1(range);const config=range,outputRange=config.output,inputRange=config.range||[0,1],extrapolateLeft=config.extrapolateLeft||config.extrapolate||"extend",extrapolateRight=config.extrapolateRight||config.extrapolate||"extend",easing=config.easing||(t=>t);return input=>{const range=function findRange(input,inputRange){for(var i=1;i=input);++i);return i-1}(input,inputRange);return function interpolate(input,inputMin,inputMax,outputMin,outputMax,easing,extrapolateLeft,extrapolateRight,map){let result=map?map(input):input;if(resultinputMax){if("identity"===extrapolateRight)return result;"clamp"===extrapolateRight&&(result=inputMax)}if(outputMin===outputMax)return outputMin;if(inputMin===inputMax)return input<=inputMin?outputMin:outputMax;inputMin===-1/0?result=-result:inputMax===1/0?result-=inputMin:result=(result-inputMin)/(inputMax-inputMin);result=easing(result),outputMin===-1/0?result=-result:outputMax===1/0?result+=outputMin:result=result*(outputMax-outputMin)+outputMin;return result}(input,inputRange[range],inputRange[range+1],outputRange[range],outputRange[range+1],easing,extrapolateLeft,extrapolateRight,config.map)}};const c1=1.70158,c2=1.525*c1,c4=2*Math.PI/3,c5=2*Math.PI/4.5,bounceOut=x=>{const n1=7.5625,d1=2.75;return x<1/d1?n1*x*x:x<2/d1?n1*(x-=1.5/d1)*x+.75:x<2.5/d1?n1*(x-=2.25/d1)*x+.9375:n1*(x-=2.625/d1)*x+.984375},easings={linear:x=>x,easeInQuad:x=>x*x,easeOutQuad:x=>1-(1-x)*(1-x),easeInOutQuad:x=>x<.5?2*x*x:1-Math.pow(-2*x+2,2)/2,easeInCubic:x=>x*x*x,easeOutCubic:x=>1-Math.pow(1-x,3),easeInOutCubic:x=>x<.5?4*x*x*x:1-Math.pow(-2*x+2,3)/2,easeInQuart:x=>x*x*x*x,easeOutQuart:x=>1-Math.pow(1-x,4),easeInOutQuart:x=>x<.5?8*x*x*x*x:1-Math.pow(-2*x+2,4)/2,easeInQuint:x=>x*x*x*x*x,easeOutQuint:x=>1-Math.pow(1-x,5),easeInOutQuint:x=>x<.5?16*x*x*x*x*x:1-Math.pow(-2*x+2,5)/2,easeInSine:x=>1-Math.cos(x*Math.PI/2),easeOutSine:x=>Math.sin(x*Math.PI/2),easeInOutSine:x=>-(Math.cos(Math.PI*x)-1)/2,easeInExpo:x=>0===x?0:Math.pow(2,10*x-10),easeOutExpo:x=>1===x?1:1-Math.pow(2,-10*x),easeInOutExpo:x=>0===x?0:1===x?1:x<.5?Math.pow(2,20*x-10)/2:(2-Math.pow(2,-20*x+10))/2,easeInCirc:x=>1-Math.sqrt(1-Math.pow(x,2)),easeOutCirc:x=>Math.sqrt(1-Math.pow(x-1,2)),easeInOutCirc:x=>x<.5?(1-Math.sqrt(1-Math.pow(2*x,2)))/2:(Math.sqrt(1-Math.pow(-2*x+2,2))+1)/2,easeInBack:x=>2.70158*x*x*x-c1*x*x,easeOutBack:x=>1+2.70158*Math.pow(x-1,3)+c1*Math.pow(x-1,2),easeInOutBack:x=>x<.5?Math.pow(2*x,2)*(7.189819*x-c2)/2:(Math.pow(2*x-2,2)*((c2+1)*(2*x-2)+c2)+2)/2,easeInElastic:x=>0===x?0:1===x?1:-Math.pow(2,10*x-10)*Math.sin((10*x-10.75)*c4),easeOutElastic:x=>0===x?0:1===x?1:Math.pow(2,-10*x)*Math.sin((10*x-.75)*c4)+1,easeInOutElastic:x=>0===x?0:1===x?1:x<.5?-Math.pow(2,20*x-10)*Math.sin((20*x-11.125)*c5)/2:Math.pow(2,-20*x+10)*Math.sin((20*x-11.125)*c5)/2+1,easeInBounce:x=>1-bounceOut(1-x),easeOutBounce:bounceOut,easeInOutBounce:x=>x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2,steps:(steps,direction="end")=>progress=>{const expanded=(progress="end"===direction?Math.min(progress,.999):Math.max(progress,.001))*steps,rounded="end"===direction?Math.floor(expanded):Math.ceil(expanded);return min=0,max=1,v=rounded/steps,Math.min(Math.max(v,min),max);var min,max,v}};function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;iBoolean(arg&&arg[$get]),getFluidValue=arg=>arg&&arg[$get]?arg[$get]():arg,getFluidObservers=target=>target[$observers]||null;function callFluidObservers(target,event){let observers=target[$observers];observers&&observers.forEach((observer=>{!function callFluidObserver(observer,event){observer.eventObserved?observer.eventObserved(event):observer(event)}(observer,event)}))}class FluidValue{constructor(get){if(this[$get]=void 0,this[$observers]=void 0,!get&&!(get=this.get))throw Error("Unknown getter");setFluidGetter(this,get)}}const setFluidGetter=(target,get)=>setHidden(target,$get,get);function addFluidObserver(target,observer){if(target[$get]){let observers=target[$observers];observers||setHidden(target,$observers,observers=new Set),observers.has(observer)||(observers.add(observer),target.observerAdded&&target.observerAdded(observers.size,observer))}return observer}function removeFluidObserver(target,observer){let observers=target[$observers];if(observers&&observers.has(observer)){const count=observers.size-1;count?observers.delete(observer):target[$observers]=null,target.observerRemoved&&target.observerRemoved(count,observer)}}const setHidden=(target,key,value)=>Object.defineProperty(target,key,{value:value,writable:!0,configurable:!0}),numberRegex=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,colorRegex=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,unitRegex=new RegExp(`(${numberRegex.source})(%|[a-z]+)`,"i"),rgbaRegex=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,variableToRgba=input=>{const[token,fallback]=parseCSSVariable(input);if(!token||isSSR())return input;const value=window.getComputedStyle(document.documentElement).getPropertyValue(token);if(value)return value.trim();if(fallback&&fallback.startsWith("--")){const _value=window.getComputedStyle(document.documentElement).getPropertyValue(fallback);return _value||input}return fallback&&cssVariableRegex.test(fallback)?variableToRgba(fallback):fallback||input},parseCSSVariable=current=>{const match=cssVariableRegex.exec(current);if(!match)return[,];const[,token,fallback]=match;return[token,fallback]};let namedColorRegex;const rgbaRound=(_,p1,p2,p3,p4)=>`rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`,createStringInterpolator=config=>{namedColorRegex||(namedColorRegex=colors$1?new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`,"g"):/^\b$/);const output=config.output.map((value=>getFluidValue(value).replace(cssVariableRegex,variableToRgba).replace(colorRegex,colorToRgba).replace(namedColorRegex,colorToRgba))),keyframes=output.map((value=>value.match(numberRegex).map(Number))),interpolators=keyframes[0].map(((_,i)=>keyframes.map((values=>{if(!(i in values))throw Error('The arity of each "output" value must be equal');return values[i]})))).map((output=>createInterpolator(_extends({},config,{output:output}))));return input=>{var _output$find;const missingUnit=!unitRegex.test(output[0])&&(null==(_output$find=output.find((value=>unitRegex.test(value))))?void 0:_output$find.replace(numberRegex,""));let i=0;return output[0].replace(numberRegex,(()=>`${interpolators[i++](input)}${missingUnit||""}`)).replace(rgbaRegex,rgbaRound)}},prefix="react-spring: ",once=fn=>{const func=fn;let called=!1;if("function"!=typeof func)throw new TypeError(`${prefix}once requires a function parameter`);return(...args)=>{called||(func(...args),called=!0)}},warnInterpolate=once(console.warn);const warnDirectCall=once(console.warn);function isAnimatedString(value){return react_spring_shared_esm_is.str(value)&&("#"==value[0]||/\d/.test(value)||!isSSR()&&cssVariableRegex.test(value)||value in(colors$1||{}))}new WeakMap;new Set;new WeakMap,new WeakMap,new WeakMap;const react_spring_shared_esm_useIsomorphicLayoutEffect=isSSR()?react.useEffect:react.useLayoutEffect,useIsMounted=()=>{const isMounted=(0,react.useRef)(!1);return react_spring_shared_esm_useIsomorphicLayoutEffect((()=>(isMounted.current=!0,()=>{isMounted.current=!1})),[]),isMounted};function react_spring_shared_esm_useForceUpdate(){const update=(0,react.useState)()[1],isMounted=useIsMounted();return()=>{isMounted.current&&update(Math.random())}}const react_spring_shared_esm_useOnce=effect=>(0,react.useEffect)(effect,emptyDeps),emptyDeps=[];function react_spring_shared_esm_usePrev(value){const prevRef=(0,react.useRef)();return(0,react.useEffect)((()=>{prevRef.current=value})),prevRef.current}const $node=Symbol.for("Animated:node"),getAnimated=owner=>owner&&owner[$node],setAnimated=(owner,node)=>{return obj=owner,key=$node,value=node,Object.defineProperty(obj,key,{value:value,writable:!0,configurable:!0});var obj,key,value},getPayload=owner=>owner&&owner[$node]&&owner[$node].getPayload();class Animated{constructor(){this.payload=void 0,setAnimated(this,this)}getPayload(){return this.payload||[]}}class AnimatedValue extends Animated{constructor(_value){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=_value,react_spring_shared_esm_is.num(this._value)&&(this.lastPosition=this._value)}static create(value){return new AnimatedValue(value)}getPayload(){return[this]}getValue(){return this._value}setValue(value,step){return react_spring_shared_esm_is.num(value)&&(this.lastPosition=value,step&&(value=Math.round(value/step)*step,this.done&&(this.lastPosition=value))),this._value!==value&&(this._value=value,!0)}reset(){const{done:done}=this;this.done=!1,react_spring_shared_esm_is.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,done&&(this.lastVelocity=null),this.v0=null)}}class AnimatedString extends AnimatedValue{constructor(value){super(0),this._string=null,this._toString=void 0,this._toString=createInterpolator({output:[value,value]})}static create(value){return new AnimatedString(value)}getValue(){let value=this._string;return null==value?this._string=this._toString(this._value):value}setValue(value){if(react_spring_shared_esm_is.str(value)){if(value==this._string)return!1;this._string=value,this._value=1}else{if(!super.setValue(value))return!1;this._string=null}return!0}reset(goal){goal&&(this._toString=createInterpolator({output:[this.getValue(),goal]})),this._value=0,super.reset()}}const TreeContext={dependencies:null};class AnimatedObject extends Animated{constructor(source){super(),this.source=source,this.setValue(source)}getValue(animated){const values={};return eachProp(this.source,((source,key)=>{var value;(value=source)&&value[$node]===value?values[key]=source.getValue(animated):hasFluidValue(source)?values[key]=getFluidValue(source):animated||(values[key]=source)})),values}setValue(source){this.source=source,this.payload=this._makePayload(source)}reset(){this.payload&&react_spring_shared_esm_each(this.payload,(node=>node.reset()))}_makePayload(source){if(source){const payload=new Set;return eachProp(source,this._addToPayload,payload),Array.from(payload)}}_addToPayload(source){TreeContext.dependencies&&hasFluidValue(source)&&TreeContext.dependencies.add(source);const payload=getPayload(source);payload&&react_spring_shared_esm_each(payload,(node=>this.add(node)))}}class AnimatedArray extends AnimatedObject{constructor(source){super(source)}static create(source){return new AnimatedArray(source)}getValue(){return this.source.map((node=>node.getValue()))}setValue(source){const payload=this.getPayload();return source.length==payload.length?payload.map(((node,i)=>node.setValue(source[i]))).some(Boolean):(super.setValue(source.map(makeAnimated)),!0)}}function makeAnimated(value){return(isAnimatedString(value)?AnimatedString:AnimatedValue).create(value)}function getAnimatedType(value){const parentNode=getAnimated(value);return parentNode?parentNode.constructor:react_spring_shared_esm_is.arr(value)?AnimatedArray:isAnimatedString(value)?AnimatedString:AnimatedValue}function react_spring_animated_esm_extends(){return react_spring_animated_esm_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const hasInstance=!react_spring_shared_esm_is.fun(Component)||Component.prototype&&Component.prototype.isReactComponent;return(0,react.forwardRef)(((givenProps,givenRef)=>{const instanceRef=(0,react.useRef)(null),ref=hasInstance&&(0,react.useCallback)((value=>{instanceRef.current=function updateRef(ref,value){ref&&(react_spring_shared_esm_is.fun(ref)?ref(value):ref.current=value);return value}(givenRef,value)}),[givenRef]),[props,deps]=function getAnimatedState(props,host){const dependencies=new Set;TreeContext.dependencies=dependencies,props.style&&(props=react_spring_animated_esm_extends({},props,{style:host.createAnimatedStyle(props.style)}));return props=new AnimatedObject(props),TreeContext.dependencies=null,[props,dependencies]}(givenProps,host),forceUpdate=react_spring_shared_esm_useForceUpdate(),callback=()=>{const instance=instanceRef.current;if(hasInstance&&!instance)return;!1===(!!instance&&host.applyAnimatedValues(instance,props.getValue(!0)))&&forceUpdate()},observer=new PropsObserver(callback,deps),observerRef=(0,react.useRef)();react_spring_shared_esm_useIsomorphicLayoutEffect((()=>(observerRef.current=observer,react_spring_shared_esm_each(deps,(dep=>addFluidObserver(dep,observer))),()=>{observerRef.current&&(react_spring_shared_esm_each(observerRef.current.deps,(dep=>removeFluidObserver(dep,observerRef.current))),react_spring_rafz_esm_raf.cancel(observerRef.current.update))}))),(0,react.useEffect)(callback,[]),react_spring_shared_esm_useOnce((()=>()=>{const observer=observerRef.current;react_spring_shared_esm_each(observer.deps,(dep=>removeFluidObserver(dep,observer)))}));const usedProps=host.getComponentProps(props.getValue());return react.createElement(Component,react_spring_animated_esm_extends({},usedProps,{ref:ref}))}))};class PropsObserver{constructor(update,deps){this.update=update,this.deps=deps}eventObserved(event){"change"==event.type&&react_spring_rafz_esm_raf.write(this.update)}}const cacheKey=Symbol.for("AnimatedComponent"),getDisplayName=arg=>react_spring_shared_esm_is.str(arg)?arg:arg&&react_spring_shared_esm_is.str(arg.displayName)?arg.displayName:react_spring_shared_esm_is.fun(arg)&&arg.name||null;function react_spring_core_esm_extends(){return react_spring_core_esm_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i!0===value||!!(key&&value&&(react_spring_shared_esm_is.fun(value)?value(key):react_spring_shared_esm_toArray(value).includes(key))),resolveProp=(prop,key)=>react_spring_shared_esm_is.obj(prop)?key&&prop[key]:prop,getDefaultProp=(props,key)=>!0===props.default?props[key]:props.default?props.default[key]:void 0,noopTransform=value=>value,getDefaultProps=(props,transform=noopTransform)=>{let keys=DEFAULT_PROPS;props.default&&!0!==props.default&&(props=props.default,keys=Object.keys(props));const defaults={};for(const key of keys){const value=transform(props[key],key);react_spring_shared_esm_is.und(value)||(defaults[key]=value)}return defaults},DEFAULT_PROPS=["config","onProps","onStart","onChange","onPause","onResume","onRest"],RESERVED_PROPS={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function inferTo(props){const to=function getForwardProps(props){const forward={};let count=0;if(eachProp(props,((value,prop)=>{RESERVED_PROPS[prop]||(forward[prop]=value,count++)})),count)return forward}(props);if(to){const out={to:to};return eachProp(props,((val,key)=>key in to||(out[key]=val))),out}return react_spring_core_esm_extends({},props)}function computeGoal(value){return value=getFluidValue(value),react_spring_shared_esm_is.arr(value)?value.map(computeGoal):isAnimatedString(value)?globals.createStringInterpolator({range:[0,1],output:[value,value]})(1):value}function hasProps(props){for(const _ in props)return!0;return!1}function isAsyncTo(to){return react_spring_shared_esm_is.fun(to)||react_spring_shared_esm_is.arr(to)&&react_spring_shared_esm_is.obj(to[0])}function detachRefs(ctrl,ref){var _ctrl$ref;null==(_ctrl$ref=ctrl.ref)||_ctrl$ref.delete(ctrl),null==ref||ref.delete(ctrl)}function replaceRef(ctrl,ref){var _ctrl$ref2;ref&&ctrl.ref!==ref&&(null==(_ctrl$ref2=ctrl.ref)||_ctrl$ref2.delete(ctrl),ref.add(ctrl),ctrl.ref=ref)}const defaults=react_spring_core_esm_extends({},{tension:170,friction:26},{mass:1,damping:1,easing:easings.linear,clamp:!1});class AnimationConfig{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,defaults)}}function sanitizeConfig(config,props){if(react_spring_shared_esm_is.und(props.decay)){const isTensionConfig=!react_spring_shared_esm_is.und(props.tension)||!react_spring_shared_esm_is.und(props.friction);!isTensionConfig&&react_spring_shared_esm_is.und(props.frequency)&&react_spring_shared_esm_is.und(props.damping)&&react_spring_shared_esm_is.und(props.mass)||(config.duration=void 0,config.decay=void 0),isTensionConfig&&(config.frequency=void 0)}else config.duration=void 0}const emptyArray=[];class Animation{constructor(){this.changed=!1,this.values=emptyArray,this.toValues=null,this.fromValues=emptyArray,this.to=void 0,this.from=void 0,this.config=new AnimationConfig,this.immediate=!1}}function scheduleProps(callId,{key:key,props:props,defaultProps:defaultProps,state:state,actions:actions}){return new Promise(((resolve,reject)=>{var _props$cancel;let delay,timeout,cancel=matchProp(null!=(_props$cancel=props.cancel)?_props$cancel:null==defaultProps?void 0:defaultProps.cancel,key);if(cancel)onStart();else{react_spring_shared_esm_is.und(props.pause)||(state.paused=matchProp(props.pause,key));let pause=null==defaultProps?void 0:defaultProps.pause;!0!==pause&&(pause=state.paused||matchProp(pause,key)),delay=callProp(props.delay||0,key),pause?(state.resumeQueue.add(onResume),actions.pause()):(actions.resume(),onResume())}function onPause(){state.resumeQueue.add(onResume),state.timeouts.delete(timeout),timeout.cancel(),delay=timeout.time-react_spring_rafz_esm_raf.now()}function onResume(){delay>0&&!globals.skipAnimation?(state.delayed=!0,timeout=react_spring_rafz_esm_raf.setTimeout(onStart,delay),state.pauseQueue.add(onPause),state.timeouts.add(timeout)):onStart()}function onStart(){state.delayed&&(state.delayed=!1),state.pauseQueue.delete(onPause),state.timeouts.delete(timeout),callId<=(state.cancelId||0)&&(cancel=!0);try{actions.start(react_spring_core_esm_extends({},props,{callId:callId,cancel:cancel}),resolve)}catch(err){reject(err)}}}))}const getCombinedResult=(target,results)=>1==results.length?results[0]:results.some((result=>result.cancelled))?getCancelledResult(target.get()):results.every((result=>result.noop))?getNoopResult(target.get()):getFinishedResult(target.get(),results.every((result=>result.finished))),getNoopResult=value=>({value:value,noop:!0,finished:!0,cancelled:!1}),getFinishedResult=(value,finished,cancelled=!1)=>({value:value,finished:finished,cancelled:cancelled}),getCancelledResult=value=>({value:value,cancelled:!0,finished:!1});function runAsync(to,props,state,target){const{callId:callId,parentId:parentId,onRest:onRest}=props,{asyncTo:prevTo,promise:prevPromise}=state;return parentId||to!==prevTo||props.reset?state.promise=(async()=>{state.asyncId=callId,state.asyncTo=to;const defaultProps=getDefaultProps(props,((value,key)=>"onRest"===key?void 0:value));let preventBail,bail;const bailPromise=new Promise(((resolve,reject)=>(preventBail=resolve,bail=reject))),bailIfEnded=bailSignal=>{const bailResult=callId<=(state.cancelId||0)&&getCancelledResult(target)||callId!==state.asyncId&&getFinishedResult(target,!1);if(bailResult)throw bailSignal.result=bailResult,bail(bailSignal),bailSignal},animate=(arg1,arg2)=>{const bailSignal=new BailSignal,skipAnimationSignal=new SkipAnimationSignal;return(async()=>{if(globals.skipAnimation)throw stopAsync(state),skipAnimationSignal.result=getFinishedResult(target,!1),bail(skipAnimationSignal),skipAnimationSignal;bailIfEnded(bailSignal);const props=react_spring_shared_esm_is.obj(arg1)?react_spring_core_esm_extends({},arg1):react_spring_core_esm_extends({},arg2,{to:arg1});props.parentId=callId,eachProp(defaultProps,((value,key)=>{react_spring_shared_esm_is.und(props[key])&&(props[key]=value)}));const result=await target.start(props);return bailIfEnded(bailSignal),state.paused&&await new Promise((resume=>{state.resumeQueue.add(resume)})),result})()};let result;if(globals.skipAnimation)return stopAsync(state),getFinishedResult(target,!1);try{let animating;animating=react_spring_shared_esm_is.arr(to)?(async queue=>{for(const props of queue)await animate(props)})(to):Promise.resolve(to(animate,target.stop.bind(target))),await Promise.all([animating.then(preventBail),bailPromise]),result=getFinishedResult(target.get(),!0,!1)}catch(err){if(err instanceof BailSignal)result=err.result;else{if(!(err instanceof SkipAnimationSignal))throw err;result=err.result}}finally{callId==state.asyncId&&(state.asyncId=parentId,state.asyncTo=parentId?prevTo:void 0,state.promise=parentId?prevPromise:void 0)}return react_spring_shared_esm_is.fun(onRest)&&react_spring_rafz_esm_raf.batchedUpdates((()=>{onRest(result,target,target.item)})),result})():prevPromise}function stopAsync(state,cancelId){flush(state.timeouts,(t=>t.cancel())),state.pauseQueue.clear(),state.resumeQueue.clear(),state.asyncId=state.asyncTo=state.promise=void 0,cancelId&&(state.cancelId=cancelId)}class BailSignal extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class SkipAnimationSignal extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const isFrameValue=value=>value instanceof FrameValue;let nextId$1=1;class FrameValue extends FluidValue{constructor(...args){super(...args),this.id=nextId$1++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(priority){this._priority!=priority&&(this._priority=priority,this._onPriorityChange(priority))}get(){const node=getAnimated(this);return node&&node.getValue()}to(...args){return globals.to(this,args)}interpolate(...args){return function react_spring_shared_esm_deprecateInterpolate(){warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`)}(),globals.to(this,args)}toJSON(){return this.get()}observerAdded(count){1==count&&this._attach()}observerRemoved(count){0==count&&this._detach()}_attach(){}_detach(){}_onChange(value,idle=!1){callFluidObservers(this,{type:"change",parent:this,value:value,idle:idle})}_onPriorityChange(priority){this.idle||frameLoop.sort(this),callFluidObservers(this,{type:"priority",parent:this,priority:priority})}}const $P=Symbol.for("SpringPhase"),hasAnimated=target=>(1&target[$P])>0,isAnimating=target=>(2&target[$P])>0,isPaused=target=>(4&target[$P])>0,setActiveBit=(target,active)=>active?target[$P]|=3:target[$P]&=-3,setPausedBit=(target,paused)=>paused?target[$P]|=4:target[$P]&=-5;class SpringValue extends FrameValue{constructor(arg1,arg2){if(super(),this.key=void 0,this.animation=new Animation,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!react_spring_shared_esm_is.und(arg1)||!react_spring_shared_esm_is.und(arg2)){const props=react_spring_shared_esm_is.obj(arg1)?react_spring_core_esm_extends({},arg1):react_spring_core_esm_extends({},arg2,{from:arg1});react_spring_shared_esm_is.und(props.default)&&(props.default=!0),this.start(props)}}get idle(){return!(isAnimating(this)||this._state.asyncTo)||isPaused(this)}get goal(){return getFluidValue(this.animation.to)}get velocity(){const node=getAnimated(this);return node instanceof AnimatedValue?node.lastVelocity||0:node.getPayload().map((node=>node.lastVelocity||0))}get hasAnimated(){return hasAnimated(this)}get isAnimating(){return isAnimating(this)}get isPaused(){return isPaused(this)}get isDelayed(){return this._state.delayed}advance(dt){let idle=!0,changed=!1;const anim=this.animation;let{config:config,toValues:toValues}=anim;const payload=getPayload(anim.to);!payload&&hasFluidValue(anim.to)&&(toValues=react_spring_shared_esm_toArray(getFluidValue(anim.to))),anim.values.forEach(((node,i)=>{if(node.done)return;const to=node.constructor==AnimatedString?1:payload?payload[i].lastPosition:toValues[i];let finished=anim.immediate,position=to;if(!finished){if(position=node.lastPosition,config.tension<=0)return void(node.done=!0);let elapsed=node.elapsedTime+=dt;const from=anim.fromValues[i],v0=null!=node.v0?node.v0:node.v0=react_spring_shared_esm_is.arr(config.velocity)?config.velocity[i]:config.velocity;let velocity;const precision=config.precision||(from==to?.005:Math.min(1,.001*Math.abs(to-from)));if(react_spring_shared_esm_is.und(config.duration))if(config.decay){const decay=!0===config.decay?.998:config.decay,e=Math.exp(-(1-decay)*elapsed);position=from+v0/(1-decay)*(1-e),finished=Math.abs(node.lastPosition-position)<=precision,velocity=v0*e}else{velocity=null==node.lastVelocity?v0:node.lastVelocity;const restVelocity=config.restVelocity||precision/10,bounceFactor=config.clamp?0:config.bounce,canBounce=!react_spring_shared_esm_is.und(bounceFactor),isGrowing=from==to?node.v0>0:fromrestVelocity,isMoving||(finished=Math.abs(to-position)<=precision,!finished));++n){canBounce&&(isBouncing=position==to||position>to==isGrowing,isBouncing&&(velocity=-velocity*bounceFactor,position=to));velocity+=(1e-6*-config.tension*(position-to)+.001*-config.friction*velocity)/config.mass*step,position+=velocity*step}}else{let p=1;config.duration>0&&(this._memoizedDuration!==config.duration&&(this._memoizedDuration=config.duration,node.durationProgress>0&&(node.elapsedTime=config.duration*node.durationProgress,elapsed=node.elapsedTime+=dt)),p=(config.progress||0)+elapsed/this._memoizedDuration,p=p>1?1:p<0?0:p,node.durationProgress=p),position=from+config.easing(p)*(to-from),velocity=(position-node.lastPosition)/dt,finished=1==p}node.lastVelocity=velocity,Number.isNaN(position)&&(console.warn("Got NaN while animating:",this),finished=!0)}payload&&!payload[i].done&&(finished=!1),finished?node.done=!0:idle=!1,node.setValue(position,config.round)&&(changed=!0)}));const node=getAnimated(this),currVal=node.getValue();if(idle){const finalVal=getFluidValue(anim.to);currVal===finalVal&&!changed||config.decay?changed&&config.decay&&this._onChange(currVal):(node.setValue(finalVal),this._onChange(finalVal)),this._stop()}else changed&&this._onChange(currVal)}set(value){return react_spring_rafz_esm_raf.batchedUpdates((()=>{this._stop(),this._focus(value),this._set(value)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(isAnimating(this)){const{to:to,config:config}=this.animation;react_spring_rafz_esm_raf.batchedUpdates((()=>{this._onStart(),config.decay||this._set(to,!1),this._stop()}))}return this}update(props){return(this.queue||(this.queue=[])).push(props),this}start(to,arg2){let queue;return react_spring_shared_esm_is.und(to)?(queue=this.queue||[],this.queue=[]):queue=[react_spring_shared_esm_is.obj(to)?to:react_spring_core_esm_extends({},arg2,{to:to})],Promise.all(queue.map((props=>this._update(props)))).then((results=>getCombinedResult(this,results)))}stop(cancel){const{to:to}=this.animation;return this._focus(this.get()),stopAsync(this._state,cancel&&this._lastCallId),react_spring_rafz_esm_raf.batchedUpdates((()=>this._stop(to,cancel))),this}reset(){this._update({reset:!0})}eventObserved(event){"change"==event.type?this._start():"priority"==event.type&&(this.priority=event.priority+1)}_prepareNode(props){const key=this.key||"";let{to:to,from:from}=props;to=react_spring_shared_esm_is.obj(to)?to[key]:to,(null==to||isAsyncTo(to))&&(to=void 0),from=react_spring_shared_esm_is.obj(from)?from[key]:from,null==from&&(from=void 0);const range={to:to,from:from};return hasAnimated(this)||(props.reverse&&([to,from]=[from,to]),from=getFluidValue(from),react_spring_shared_esm_is.und(from)?getAnimated(this)||this._set(to):this._set(from)),range}_update(_ref,isLoop){let props=react_spring_core_esm_extends({},_ref);const{key:key,defaultProps:defaultProps}=this;props.default&&Object.assign(defaultProps,getDefaultProps(props,((value,prop)=>/^on/.test(prop)?resolveProp(value,key):value))),mergeActiveFn(this,props,"onProps"),sendEvent(this,"onProps",props,this);const range=this._prepareNode(props);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const state=this._state;return scheduleProps(++this._lastCallId,{key:key,props:props,defaultProps:defaultProps,state:state,actions:{pause:()=>{isPaused(this)||(setPausedBit(this,!0),flushCalls(state.pauseQueue),sendEvent(this,"onPause",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},resume:()=>{isPaused(this)&&(setPausedBit(this,!1),isAnimating(this)&&this._resume(),flushCalls(state.resumeQueue),sendEvent(this,"onResume",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},start:this._merge.bind(this,range)}}).then((result=>{if(props.loop&&result.finished&&(!isLoop||!result.noop)){const nextProps=createLoopUpdate(props);if(nextProps)return this._update(nextProps,!0)}return result}))}_merge(range,props,resolve){if(props.cancel)return this.stop(!0),resolve(getCancelledResult(this));const hasToProp=!react_spring_shared_esm_is.und(range.to),hasFromProp=!react_spring_shared_esm_is.und(range.from);if(hasToProp||hasFromProp){if(!(props.callId>this._lastToId))return resolve(getCancelledResult(this));this._lastToId=props.callId}const{key:key,defaultProps:defaultProps,animation:anim}=this,{to:prevTo,from:prevFrom}=anim;let{to:to=prevTo,from:from=prevFrom}=range;!hasFromProp||hasToProp||props.default&&!react_spring_shared_esm_is.und(to)||(to=from),props.reverse&&([to,from]=[from,to]);const hasFromChanged=!isEqual(from,prevFrom);hasFromChanged&&(anim.from=from),from=getFluidValue(from);const hasToChanged=!isEqual(to,prevTo);hasToChanged&&this._focus(to);const hasAsyncTo=isAsyncTo(props.to),{config:config}=anim,{decay:decay,velocity:velocity}=config;(hasToProp||hasFromProp)&&(config.velocity=0),props.config&&!hasAsyncTo&&function mergeConfig(config,newConfig,defaultConfig){defaultConfig&&(sanitizeConfig(defaultConfig=react_spring_core_esm_extends({},defaultConfig),newConfig),newConfig=react_spring_core_esm_extends({},defaultConfig,newConfig)),sanitizeConfig(config,newConfig),Object.assign(config,newConfig);for(const key in defaults)null==config[key]&&(config[key]=defaults[key]);let{mass:mass,frequency:frequency,damping:damping}=config;return react_spring_shared_esm_is.und(frequency)||(frequency<.01&&(frequency=.01),damping<0&&(damping=0),config.tension=Math.pow(2*Math.PI/frequency,2)*mass,config.friction=4*Math.PI*damping*mass/frequency),config}(config,callProp(props.config,key),props.config!==defaultProps.config?callProp(defaultProps.config,key):void 0);let node=getAnimated(this);if(!node||react_spring_shared_esm_is.und(to))return resolve(getFinishedResult(this,!0));const reset=react_spring_shared_esm_is.und(props.reset)?hasFromProp&&!props.default:!react_spring_shared_esm_is.und(from)&&matchProp(props.reset,key),value=reset?from:this.get(),goal=computeGoal(to),isAnimatable=react_spring_shared_esm_is.num(goal)||react_spring_shared_esm_is.arr(goal)||isAnimatedString(goal),immediate=!hasAsyncTo&&(!isAnimatable||matchProp(defaultProps.immediate||props.immediate,key));if(hasToChanged){const nodeType=getAnimatedType(to);if(nodeType!==node.constructor){if(!immediate)throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`);node=this._set(goal)}}const goalType=node.constructor;let started=hasFluidValue(to),finished=!1;if(!started){const hasValueChanged=reset||!hasAnimated(this)&&hasFromChanged;(hasToChanged||hasValueChanged)&&(finished=isEqual(computeGoal(value),goal),started=!finished),(isEqual(anim.immediate,immediate)||immediate)&&isEqual(config.decay,decay)&&isEqual(config.velocity,velocity)||(started=!0)}if(finished&&isAnimating(this)&&(anim.changed&&!reset?started=!0:started||this._stop(prevTo)),!hasAsyncTo&&((started||hasFluidValue(prevTo))&&(anim.values=node.getPayload(),anim.toValues=hasFluidValue(to)?null:goalType==AnimatedString?[1]:react_spring_shared_esm_toArray(goal)),anim.immediate!=immediate&&(anim.immediate=immediate,immediate||reset||this._set(prevTo)),started)){const{onRest:onRest}=anim;react_spring_shared_esm_each(ACTIVE_EVENTS,(type=>mergeActiveFn(this,props,type)));const result=getFinishedResult(this,checkFinished(this,prevTo));flushCalls(this._pendingCalls,result),this._pendingCalls.add(resolve),anim.changed&&react_spring_rafz_esm_raf.batchedUpdates((()=>{anim.changed=!reset,null==onRest||onRest(result,this),reset?callProp(defaultProps.onRest,result):null==anim.onStart||anim.onStart(result,this)}))}reset&&this._set(value),hasAsyncTo?resolve(runAsync(props.to,props,this._state,this)):started?this._start():isAnimating(this)&&!hasToChanged?this._pendingCalls.add(resolve):resolve(getNoopResult(value))}_focus(value){const anim=this.animation;value!==anim.to&&(getFluidObservers(this)&&this._detach(),anim.to=value,getFluidObservers(this)&&this._attach())}_attach(){let priority=0;const{to:to}=this.animation;hasFluidValue(to)&&(addFluidObserver(to,this),isFrameValue(to)&&(priority=to.priority+1)),this.priority=priority}_detach(){const{to:to}=this.animation;hasFluidValue(to)&&removeFluidObserver(to,this)}_set(arg,idle=!0){const value=getFluidValue(arg);if(!react_spring_shared_esm_is.und(value)){const oldNode=getAnimated(this);if(!oldNode||!isEqual(value,oldNode.getValue())){const nodeType=getAnimatedType(value);oldNode&&oldNode.constructor==nodeType?oldNode.setValue(value):setAnimated(this,nodeType.create(value)),oldNode&&react_spring_rafz_esm_raf.batchedUpdates((()=>{this._onChange(value,idle)}))}}return getAnimated(this)}_onStart(){const anim=this.animation;anim.changed||(anim.changed=!0,sendEvent(this,"onStart",getFinishedResult(this,checkFinished(this,anim.to)),this))}_onChange(value,idle){idle||(this._onStart(),callProp(this.animation.onChange,value,this)),callProp(this.defaultProps.onChange,value,this),super._onChange(value,idle)}_start(){const anim=this.animation;getAnimated(this).reset(getFluidValue(anim.to)),anim.immediate||(anim.fromValues=anim.values.map((node=>node.lastPosition))),isAnimating(this)||(setActiveBit(this,!0),isPaused(this)||this._resume())}_resume(){globals.skipAnimation?this.finish():frameLoop.start(this)}_stop(goal,cancel){if(isAnimating(this)){setActiveBit(this,!1);const anim=this.animation;react_spring_shared_esm_each(anim.values,(node=>{node.done=!0})),anim.toValues&&(anim.onChange=anim.onPause=anim.onResume=void 0),callFluidObservers(this,{type:"idle",parent:this});const result=cancel?getCancelledResult(this.get()):getFinishedResult(this.get(),checkFinished(this,null!=goal?goal:anim.to));flushCalls(this._pendingCalls,result),anim.changed&&(anim.changed=!1,sendEvent(this,"onRest",result,this))}}}function checkFinished(target,to){const goal=computeGoal(to);return isEqual(computeGoal(target.get()),goal)}function createLoopUpdate(props,loop=props.loop,to=props.to){let loopRet=callProp(loop);if(loopRet){const overrides=!0!==loopRet&&inferTo(loopRet),reverse=(overrides||props).reverse,reset=!overrides||overrides.reset;return createUpdate(react_spring_core_esm_extends({},props,{loop:loop,default:!1,pause:void 0,to:!reverse||isAsyncTo(to)?to:void 0,from:reset?props.from:void 0,reset:reset},overrides))}}function createUpdate(props){const{to:to,from:from}=props=inferTo(props),keys=new Set;return react_spring_shared_esm_is.obj(to)&&findDefined(to,keys),react_spring_shared_esm_is.obj(from)&&findDefined(from,keys),props.keys=keys.size?Array.from(keys):null,props}function declareUpdate(props){const update=createUpdate(props);return react_spring_shared_esm_is.und(update.default)&&(update.default=getDefaultProps(update)),update}function findDefined(values,keys){eachProp(values,((value,key)=>null!=value&&keys.add(key)))}const ACTIVE_EVENTS=["onStart","onRest","onChange","onPause","onResume"];function mergeActiveFn(target,props,type){target.animation[type]=props[type]!==getDefaultProp(props,type)?resolveProp(props[type],target.key):void 0}function sendEvent(target,type,...args){var _target$animation$typ,_target$animation,_target$defaultProps$,_target$defaultProps;null==(_target$animation$typ=(_target$animation=target.animation)[type])||_target$animation$typ.call(_target$animation,...args),null==(_target$defaultProps$=(_target$defaultProps=target.defaultProps)[type])||_target$defaultProps$.call(_target$defaultProps,...args)}const BATCHED_EVENTS=["onStart","onChange","onRest"];let nextId=1;class Controller{constructor(props,flush){this.id=nextId++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),flush&&(this._flush=flush),props&&this.start(react_spring_core_esm_extends({default:!0},props))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((spring=>spring.idle&&!spring.isDelayed&&!spring.isPaused))}get item(){return this._item}set item(item){this._item=item}get(){const values={};return this.each(((spring,key)=>values[key]=spring.get())),values}set(values){for(const key in values){const value=values[key];react_spring_shared_esm_is.und(value)||this.springs[key].set(value)}}update(props){return props&&this.queue.push(createUpdate(props)),this}start(props){let{queue:queue}=this;return props?queue=react_spring_shared_esm_toArray(props).map(createUpdate):this.queue=[],this._flush?this._flush(this,queue):(prepareKeys(this,queue),flushUpdateQueue(this,queue))}stop(arg,keys){if(arg!==!!arg&&(keys=arg),keys){const springs=this.springs;react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys),(key=>springs[key].stop(!!arg)))}else stopAsync(this._state,this._lastAsyncId),this.each((spring=>spring.stop(!!arg)));return this}pause(keys){if(react_spring_shared_esm_is.und(keys))this.start({pause:!0});else{const springs=this.springs;react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys),(key=>springs[key].pause()))}return this}resume(keys){if(react_spring_shared_esm_is.und(keys))this.start({pause:!1});else{const springs=this.springs;react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys),(key=>springs[key].resume()))}return this}each(iterator){eachProp(this.springs,iterator)}_onFrame(){const{onStart:onStart,onChange:onChange,onRest:onRest}=this._events,active=this._active.size>0,changed=this._changed.size>0;(active&&!this._started||changed&&!this._started)&&(this._started=!0,flush(onStart,(([onStart,result])=>{result.value=this.get(),onStart(result,this,this._item)})));const idle=!active&&this._started,values=changed||idle&&onRest.size?this.get():null;changed&&onChange.size&&flush(onChange,(([onChange,result])=>{result.value=values,onChange(result,this,this._item)})),idle&&(this._started=!1,flush(onRest,(([onRest,result])=>{result.value=values,onRest(result,this,this._item)})))}eventObserved(event){if("change"==event.type)this._changed.add(event.parent),event.idle||this._active.add(event.parent);else{if("idle"!=event.type)return;this._active.delete(event.parent)}react_spring_rafz_esm_raf.onFrame(this._onFrame)}}function flushUpdateQueue(ctrl,queue){return Promise.all(queue.map((props=>flushUpdate(ctrl,props)))).then((results=>getCombinedResult(ctrl,results)))}async function flushUpdate(ctrl,props,isLoop){const{keys:keys,to:to,from:from,loop:loop,onRest:onRest,onResolve:onResolve}=props,defaults=react_spring_shared_esm_is.obj(props.default)&&props.default;loop&&(props.loop=!1),!1===to&&(props.to=null),!1===from&&(props.from=null);const asyncTo=react_spring_shared_esm_is.arr(to)||react_spring_shared_esm_is.fun(to)?to:void 0;asyncTo?(props.to=void 0,props.onRest=void 0,defaults&&(defaults.onRest=void 0)):react_spring_shared_esm_each(BATCHED_EVENTS,(key=>{const handler=props[key];if(react_spring_shared_esm_is.fun(handler)){const queue=ctrl._events[key];props[key]=({finished:finished,cancelled:cancelled})=>{const result=queue.get(handler);result?(finished||(result.finished=!1),cancelled&&(result.cancelled=!0)):queue.set(handler,{value:null,finished:finished||!1,cancelled:cancelled||!1})},defaults&&(defaults[key]=props[key])}}));const state=ctrl._state;props.pause===!state.paused?(state.paused=props.pause,flushCalls(props.pause?state.pauseQueue:state.resumeQueue)):state.paused&&(props.pause=!0);const promises=(keys||Object.keys(ctrl.springs)).map((key=>ctrl.springs[key].start(props))),cancel=!0===props.cancel||!0===getDefaultProp(props,"cancel");(asyncTo||cancel&&state.asyncId)&&promises.push(scheduleProps(++ctrl._lastAsyncId,{props:props,state:state,actions:{pause:noop,resume:noop,start(props,resolve){cancel?(stopAsync(state,ctrl._lastAsyncId),resolve(getCancelledResult(ctrl))):(props.onRest=onRest,resolve(runAsync(asyncTo,props,state,ctrl)))}}})),state.paused&&await new Promise((resume=>{state.resumeQueue.add(resume)}));const result=getCombinedResult(ctrl,await Promise.all(promises));if(loop&&result.finished&&(!isLoop||!result.noop)){const nextProps=createLoopUpdate(props,loop,to);if(nextProps)return prepareKeys(ctrl,[nextProps]),flushUpdate(ctrl,nextProps,!0)}return onResolve&&react_spring_rafz_esm_raf.batchedUpdates((()=>onResolve(result,ctrl,ctrl.item))),result}function getSprings(ctrl,props){const springs=react_spring_core_esm_extends({},ctrl.springs);return props&&react_spring_shared_esm_each(react_spring_shared_esm_toArray(props),(props=>{react_spring_shared_esm_is.und(props.keys)&&(props=createUpdate(props)),react_spring_shared_esm_is.obj(props.to)||(props=react_spring_core_esm_extends({},props,{to:void 0})),prepareSprings(springs,props,(key=>createSpring(key)))})),setSprings(ctrl,springs),springs}function setSprings(ctrl,springs){eachProp(springs,((spring,key)=>{ctrl.springs[key]||(ctrl.springs[key]=spring,addFluidObserver(spring,ctrl))}))}function createSpring(key,observer){const spring=new SpringValue;return spring.key=key,observer&&addFluidObserver(spring,observer),spring}function prepareSprings(springs,props,create){props.keys&&react_spring_shared_esm_each(props.keys,(key=>{(springs[key]||(springs[key]=create(key)))._prepareNode(props)}))}function prepareKeys(ctrl,queue){react_spring_shared_esm_each(queue,(props=>{prepareSprings(ctrl.springs,props,(key=>createSpring(key,ctrl)))}))}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}const _excluded$6=["children"],SpringContext=_ref=>{let{children:children}=_ref,props=_objectWithoutPropertiesLoose(_ref,_excluded$6);const inherited=(0,react.useContext)(ctx),pause=props.pause||!!inherited.pause,immediate=props.immediate||!!inherited.immediate;props=function useMemoOne(getResult,inputs){const[initial]=(0,react.useState)((()=>({inputs:inputs,result:getResult()}))),committed=(0,react.useRef)(),prevCache=committed.current;let cache=prevCache;cache?Boolean(inputs&&cache.inputs&&function areInputsEqual(next,prev){if(next.length!==prev.length)return!1;for(let i=0;i{committed.current=cache,prevCache==initial&&(initial.inputs=initial.result=void 0)}),[cache]),cache.result}((()=>({pause:pause,immediate:immediate})),[pause,immediate]);const{Provider:Provider}=ctx;return react.createElement(Provider,{value:props},children)},ctx=function makeContext(target,init){return Object.assign(target,react.createContext(init)),target.Provider._context=target,target.Consumer._context=target,target}(SpringContext,{});SpringContext.Provider=ctx.Provider,SpringContext.Consumer=ctx.Consumer;const SpringRef=()=>{const current=[],SpringRef=function SpringRef(props){!function deprecateDirectCall(){warnDirectCall(`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}();const results=[];return react_spring_shared_esm_each(current,((ctrl,i)=>{if(react_spring_shared_esm_is.und(props))results.push(ctrl.start());else{const update=_getProps(props,ctrl,i);update&&results.push(ctrl.start(update))}})),results};SpringRef.current=current,SpringRef.add=function(ctrl){current.includes(ctrl)||current.push(ctrl)},SpringRef.delete=function(ctrl){const i=current.indexOf(ctrl);~i&¤t.splice(i,1)},SpringRef.pause=function(){return react_spring_shared_esm_each(current,(ctrl=>ctrl.pause(...arguments))),this},SpringRef.resume=function(){return react_spring_shared_esm_each(current,(ctrl=>ctrl.resume(...arguments))),this},SpringRef.set=function(values){react_spring_shared_esm_each(current,(ctrl=>ctrl.set(values)))},SpringRef.start=function(props){const results=[];return react_spring_shared_esm_each(current,((ctrl,i)=>{if(react_spring_shared_esm_is.und(props))results.push(ctrl.start());else{const update=this._getProps(props,ctrl,i);update&&results.push(ctrl.start(update))}})),results},SpringRef.stop=function(){return react_spring_shared_esm_each(current,(ctrl=>ctrl.stop(...arguments))),this},SpringRef.update=function(props){return react_spring_shared_esm_each(current,((ctrl,i)=>ctrl.update(this._getProps(props,ctrl,i)))),this};const _getProps=function _getProps(arg,ctrl,index){return react_spring_shared_esm_is.fun(arg)?arg(index,ctrl):arg};return SpringRef._getProps=_getProps,SpringRef};function useSprings(length,props,deps){const propsFn=react_spring_shared_esm_is.fun(props)&&props;propsFn&&!deps&&(deps=[]);const ref=(0,react.useMemo)((()=>propsFn||3==arguments.length?SpringRef():void 0),[]),layoutId=(0,react.useRef)(0),forceUpdate=react_spring_shared_esm_useForceUpdate(),state=(0,react.useMemo)((()=>({ctrls:[],queue:[],flush(ctrl,updates){const springs=getSprings(ctrl,updates);return layoutId.current>0&&!state.queue.length&&!Object.keys(springs).some((key=>!ctrl.springs[key]))?flushUpdateQueue(ctrl,updates):new Promise((resolve=>{setSprings(ctrl,springs),state.queue.push((()=>{resolve(flushUpdateQueue(ctrl,updates))})),forceUpdate()}))}})),[]),ctrls=(0,react.useRef)([...state.ctrls]),updates=[],prevLength=react_spring_shared_esm_usePrev(length)||0;function declareUpdates(startIndex,endIndex){for(let i=startIndex;i{react_spring_shared_esm_each(ctrls.current.slice(length,prevLength),(ctrl=>{detachRefs(ctrl,ref),ctrl.stop(!0)})),ctrls.current.length=length,declareUpdates(prevLength,length)}),[length]),(0,react.useMemo)((()=>{declareUpdates(0,Math.min(prevLength,length))}),deps);const springs=ctrls.current.map(((ctrl,i)=>getSprings(ctrl,updates[i]))),context=(0,react.useContext)(SpringContext),prevContext=react_spring_shared_esm_usePrev(context),hasContext=context!==prevContext&&hasProps(context);react_spring_shared_esm_useIsomorphicLayoutEffect((()=>{layoutId.current++,state.ctrls=ctrls.current;const{queue:queue}=state;queue.length&&(state.queue=[],react_spring_shared_esm_each(queue,(cb=>cb()))),react_spring_shared_esm_each(ctrls.current,((ctrl,i)=>{null==ref||ref.add(ctrl),hasContext&&ctrl.start({default:context});const update=updates[i];update&&(replaceRef(ctrl,update.ref),ctrl.ref?ctrl.queue.push(update):ctrl.start(update))}))})),react_spring_shared_esm_useOnce((()=>()=>{react_spring_shared_esm_each(state.ctrls,(ctrl=>ctrl.stop(!0)))}));const values=springs.map((x=>react_spring_core_esm_extends({},x)));return ref?[values,ref]:values}function useSpring(props,deps){const isFn=react_spring_shared_esm_is.fun(props),[[values],ref]=useSprings(1,isFn?props:[props],isFn?deps||[]:deps);return isFn||2==arguments.length?[values,ref]:values}let TransitionPhase;!function(TransitionPhase){TransitionPhase.MOUNT="mount",TransitionPhase.ENTER="enter",TransitionPhase.UPDATE="update",TransitionPhase.LEAVE="leave"}(TransitionPhase||(TransitionPhase={}));class Interpolation extends FrameValue{constructor(source,args){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=source,this.calc=createInterpolator(...args);const value=this._get(),nodeType=getAnimatedType(value);setAnimated(this,nodeType.create(value))}advance(_dt){const value=this._get();isEqual(value,this.get())||(getAnimated(this).setValue(value),this._onChange(value,this.idle)),!this.idle&&checkIdle(this._active)&&becomeIdle(this)}_get(){const inputs=react_spring_shared_esm_is.arr(this.source)?this.source.map(getFluidValue):react_spring_shared_esm_toArray(getFluidValue(this.source));return this.calc(...inputs)}_start(){this.idle&&!checkIdle(this._active)&&(this.idle=!1,react_spring_shared_esm_each(getPayload(this),(node=>{node.done=!1})),globals.skipAnimation?(react_spring_rafz_esm_raf.batchedUpdates((()=>this.advance())),becomeIdle(this)):frameLoop.start(this))}_attach(){let priority=1;react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source),(source=>{hasFluidValue(source)&&addFluidObserver(source,this),isFrameValue(source)&&(source.idle||this._active.add(source),priority=Math.max(priority,source.priority+1))})),this.priority=priority,this._start()}_detach(){react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source),(source=>{hasFluidValue(source)&&removeFluidObserver(source,this)})),this._active.clear(),becomeIdle(this)}eventObserved(event){"change"==event.type?event.idle?this.advance():(this._active.add(event.parent),this._start()):"idle"==event.type?this._active.delete(event.parent):"priority"==event.type&&(this.priority=react_spring_shared_esm_toArray(this.source).reduce(((highest,parent)=>Math.max(highest,(isFrameValue(parent)?parent.priority:0)+1)),0))}}function isIdle(source){return!1!==source.idle}function checkIdle(active){return!active.size||Array.from(active).every(isIdle)}function becomeIdle(self){self.idle||(self.idle=!0,react_spring_shared_esm_each(getPayload(self),(node=>{node.done=!0})),callFluidObservers(self,{type:"idle",parent:self}))}globals.assign({createStringInterpolator:createStringInterpolator,to:(source,args)=>new Interpolation(source,args)});frameLoop.advance;const primitives=["primitive"].concat(Object.keys(three_module).filter((key=>/^[A-Z]/.test(key))).map((key=>key[0].toLowerCase()+key.slice(1))));globals.assign({createStringInterpolator:createStringInterpolator,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},frameLoop:"demand"}),(0,index_99983b2d_esm.n)((()=>{react_spring_rafz_esm_raf.advance()}));const host=((components,{applyAnimatedValues:_applyAnimatedValues=(()=>!1),createAnimatedStyle:_createAnimatedStyle=(style=>new AnimatedObject(style)),getComponentProps:_getComponentProps=(props=>props)}={})=>{const hostConfig={applyAnimatedValues:_applyAnimatedValues,createAnimatedStyle:_createAnimatedStyle,getComponentProps:_getComponentProps},animated=Component=>{const displayName=getDisplayName(Component)||"Anonymous";return(Component=react_spring_shared_esm_is.str(Component)?animated[Component]||(animated[Component]=withAnimated(Component,hostConfig)):Component[cacheKey]||(Component[cacheKey]=withAnimated(Component,hostConfig))).displayName=`Animated(${displayName})`,Component};return eachProp(components,((Component,key)=>{react_spring_shared_esm_is.arr(components)&&(key=getDisplayName(Component)),animated[key]=animated(Component)})),{animated:animated}})(primitives,{applyAnimatedValues:index_99983b2d_esm.j}),animated=host.animated;const V={toVector(v,fallback){return void 0===v&&(v=fallback),Array.isArray(v)?v:[v,v]},add(v1,v2){return[v1[0]+v2[0],v1[1]+v2[1]]},sub(v1,v2){return[v1[0]-v2[0],v1[1]-v2[1]]},addTo(v1,v2){v1[0]+=v2[0],v1[1]+=v2[1]},subTo(v1,v2){v1[0]-=v2[0],v1[1]-=v2[1]}};function rubberband(distance,dimension,constant){return 0===dimension||Math.abs(dimension)===1/0?Math.pow(distance,5*constant):distance*dimension*constant/(dimension+constant*distance)}function rubberbandIfOutOfBounds(position,min,max,constant=.15){return 0===constant?function maths_0ab39ae9_esm_clamp(v,min,max){return Math.max(min,Math.min(v,max))}(position,min,max):positionmax?+rubberband(position-max,max-min,constant)+max:position}function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}function _defineProperty(obj,key,value){return(key=_toPropertyKey(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i{var _event$currentTarget,_event$currentTarget$;return e.target===event.currentTarget||(null===(_event$currentTarget=event.currentTarget)||void 0===_event$currentTarget||null===(_event$currentTarget$=_event$currentTarget.contains)||void 0===_event$currentTarget$?void 0:_event$currentTarget$.call(_event$currentTarget,e.target))}))}(event).map((touch=>touch.identifier))}function touchDistanceAngle(event,ids){const[P1,P2]=Array.from(event.touches).filter((touch=>ids.includes(touch.identifier)));return distanceAngle(P1,P2)}function pointerId(event){const valueEvent=getValueEvent(event);return isTouch(event)?valueEvent.identifier:valueEvent.pointerId}function pointerValues(event){const valueEvent=getValueEvent(event);return[valueEvent.clientX,valueEvent.clientY]}function wheelValues(event){let{deltaX:deltaX,deltaY:deltaY,deltaMode:deltaMode}=event;return 1===deltaMode?(deltaX*=40,deltaY*=40):2===deltaMode&&(deltaX*=800,deltaY*=800),[deltaX,deltaY]}function actions_76b8683e_esm_call(v,...args){return"function"==typeof v?v(...args):v}function actions_76b8683e_esm_noop(){}function chain(...fns){return 0===fns.length?actions_76b8683e_esm_noop:1===fns.length?fns[0]:function(){let result;for(const fn of fns)result=fn.apply(this,arguments)||result;return result}}function assignDefault(value,fallback){return Object.assign({},fallback,value||{})}class Engine{constructor(ctrl,args,key){this.ctrl=ctrl,this.args=args,this.key=key,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(state){this.ctrl.state[this.key]=state}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:state,shared:shared,ingKey:ingKey,args:args}=this;shared[ingKey]=state._active=state.active=state._blocked=state._force=!1,state._step=[!1,!1],state.intentional=!1,state._movement=[0,0],state._distance=[0,0],state._direction=[0,0],state._delta=[0,0],state._bounds=[[-1/0,1/0],[-1/0,1/0]],state.args=args,state.axis=void 0,state.memo=void 0,state.elapsedTime=state.timeDelta=0,state.direction=[0,0],state.distance=[0,0],state.overflow=[0,0],state._movementBound=[!1,!1],state.velocity=[0,0],state.movement=[0,0],state.delta=[0,0],state.timeStamp=0}start(event){const state=this.state,config=this.config;state._active||(this.reset(),this.computeInitial(),state._active=!0,state.target=event.target,state.currentTarget=event.currentTarget,state.lastOffset=config.from?actions_76b8683e_esm_call(config.from,state):state.offset,state.offset=state.lastOffset,state.startTime=state.timeStamp=event.timeStamp)}computeValues(values){const state=this.state;state._values=values,state.values=this.config.transform(values)}computeInitial(){const state=this.state;state._initial=state._values,state.initial=state.values}compute(event){const{state:state,config:config,shared:shared}=this;state.args=this.args;let dt=0;if(event&&(state.event=event,config.preventDefault&&event.cancelable&&state.event.preventDefault(),state.type=event.type,shared.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,shared.locked=!!document.pointerLockElement,Object.assign(shared,function getEventDetails(event){const payload={};if("buttons"in event&&(payload.buttons=event.buttons),"shiftKey"in event){const{shiftKey:shiftKey,altKey:altKey,metaKey:metaKey,ctrlKey:ctrlKey}=event;Object.assign(payload,{shiftKey:shiftKey,altKey:altKey,metaKey:metaKey,ctrlKey:ctrlKey})}return payload}(event)),shared.down=shared.pressed=shared.buttons%2==1||shared.touches>0,dt=event.timeStamp-state.timeStamp,state.timeStamp=event.timeStamp,state.elapsedTime=state.timeStamp-state.startTime),state._active){const _absoluteDelta=state._delta.map(Math.abs);V.addTo(state._distance,_absoluteDelta)}this.axisIntent&&this.axisIntent(event);const[_m0,_m1]=state._movement,[t0,t1]=config.threshold,{_step:_step,values:values}=state;if(config.hasCustomTransform?(!1===_step[0]&&(_step[0]=Math.abs(_m0)>=t0&&values[0]),!1===_step[1]&&(_step[1]=Math.abs(_m1)>=t1&&values[1])):(!1===_step[0]&&(_step[0]=Math.abs(_m0)>=t0&&Math.sign(_m0)*t0),!1===_step[1]&&(_step[1]=Math.abs(_m1)>=t1&&Math.sign(_m1)*t1)),state.intentional=!1!==_step[0]||!1!==_step[1],!state.intentional)return;const movement=[0,0];if(config.hasCustomTransform){const[v0,v1]=values;movement[0]=!1!==_step[0]?v0-_step[0]:0,movement[1]=!1!==_step[1]?v1-_step[1]:0}else movement[0]=!1!==_step[0]?_m0-_step[0]:0,movement[1]=!1!==_step[1]?_m1-_step[1]:0;this.restrictToAxis&&!state._blocked&&this.restrictToAxis(movement);const previousOffset=state.offset,gestureIsActive=state._active&&!state._blocked||state.active;gestureIsActive&&(state.first=state._active&&!state.active,state.last=!state._active&&state.active,state.active=shared[this.ingKey]=state._active,event&&(state.first&&("bounds"in config&&(state._bounds=actions_76b8683e_esm_call(config.bounds,state)),this.setup&&this.setup()),state.movement=movement,this.computeOffset()));const[ox,oy]=state.offset,[[x0,x1],[y0,y1]]=state._bounds;state.overflow=[oxx1?1:0,oyy1?1:0],state._movementBound[0]=!!state.overflow[0]&&(!1===state._movementBound[0]?state._movement[0]:state._movementBound[0]),state._movementBound[1]=!!state.overflow[1]&&(!1===state._movementBound[1]?state._movement[1]:state._movementBound[1]);const rubberband=state._active&&config.rubberband||[0,0];if(state.offset=function computeRubberband(bounds,[Vx,Vy],[Rx,Ry]){const[[X0,X1],[Y0,Y1]]=bounds;return[rubberbandIfOutOfBounds(Vx,X0,X1,Rx),rubberbandIfOutOfBounds(Vy,Y0,Y1,Ry)]}(state._bounds,state.offset,rubberband),state.delta=V.sub(state.offset,previousOffset),this.computeMovement(),gestureIsActive&&(!state.last||dt>32)){state.delta=V.sub(state.offset,previousOffset);const absoluteDelta=state.delta.map(Math.abs);V.addTo(state.distance,absoluteDelta),state.direction=state.delta.map(Math.sign),state._direction=state._delta.map(Math.sign),!state.first&&dt>0&&(state.velocity=[absoluteDelta[0]/dt,absoluteDelta[1]/dt],state.timeDelta=dt)}}emit(){const state=this.state,shared=this.shared,config=this.config;if(state._active||this.clean(),(state._blocked||!state.intentional)&&!state._force&&!config.triggerAllEvents)return;const memo=this.handler(_objectSpread2(_objectSpread2(_objectSpread2({},shared),state),{},{[this.aliasKey]:state.values}));void 0!==memo&&(state.memo=memo)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class CoordinatesEngine extends Engine{constructor(...args){super(...args),_defineProperty(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V.sub(this.state.offset,this.state.lastOffset)}axisIntent(event){const state=this.state,config=this.config;if(!state.axis&&event){const threshold="object"==typeof config.axisThreshold?config.axisThreshold[getPointerType(event)]:config.axisThreshold;state.axis=function selectAxis([dx,dy],threshold){const absDx=Math.abs(dx),absDy=Math.abs(dy);return absDx>absDy&&absDx>threshold?"x":absDy>absDx&&absDy>threshold?"y":void 0}(state._movement,threshold)}state._blocked=(config.lockDirection||!!config.axis)&&!state.axis||!!config.axis&&config.axis!==state.axis}restrictToAxis(v){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":v[1]=0;break;case"y":v[0]=0}}}const identity=v=>v,commonConfigResolver={enabled(value=!0){return value},eventOptions(value,_k,config){return _objectSpread2(_objectSpread2({},config.shared.eventOptions),value)},preventDefault(value=!1){return value},triggerAllEvents(value=!1){return value},rubberband(value=0){switch(value){case!0:return[.15,.15];case!1:return[0,0];default:return V.toVector(value)}},from(value){return"function"==typeof value?value:null!=value?V.toVector(value):void 0},transform(value,_k,config){const transform=value||config.shared.transform;return this.hasCustomTransform=!!transform,transform||identity},threshold(value){return V.toVector(value,0)}};const coordinatesConfigResolver=_objectSpread2(_objectSpread2({},commonConfigResolver),{},{axis(_v,_k,{axis:axis}){if(this.lockDirection="lock"===axis,!this.lockDirection)return axis},axisThreshold(value=0){return value},bounds(value={}){if("function"==typeof value)return state=>coordinatesConfigResolver.bounds(value(state));if("current"in value)return()=>value.current;if("function"==typeof HTMLElement&&value instanceof HTMLElement)return value;const{left:left=-1/0,right:right=1/0,top:top=-1/0,bottom:bottom=1/0}=value;return[[left,right],[top,bottom]]}}),KEYS_DELTA_MAP={ArrowRight:(displacement,factor=1)=>[displacement*factor,0],ArrowLeft:(displacement,factor=1)=>[-1*displacement*factor,0],ArrowUp:(displacement,factor=1)=>[0,-1*displacement*factor],ArrowDown:(displacement,factor=1)=>[0,displacement*factor]};const isBrowser="undefined"!=typeof window&&window.document&&window.document.createElement;function isTouchScreen(){return function supportsTouchEvents(){return isBrowser&&"ontouchstart"in window}()||isBrowser&&window.navigator.maxTouchPoints>1}const SUPPORT={isBrowser:isBrowser,gesture:function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:isTouchScreen(),touchscreen:isTouchScreen(),pointer:function supportsPointerEvents(){return isBrowser&&"onpointerdown"in window}(),pointerLock:function supportsPointerLock(){return isBrowser&&"exitPointerLock"in window.document}()},DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{device(_v,_k,{pointer:{touch:touch=!1,lock:lock=!1,mouse:mouse=!1}={}}){return this.pointerLock=lock&&SUPPORT.pointerLock,SUPPORT.touch&&touch?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!mouse?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(value,_k,{preventScroll:preventScroll}){if(this.preventScrollDelay="number"==typeof preventScroll?preventScroll:preventScroll||void 0===preventScroll&&value?250:void 0,SUPPORT.touchscreen&&!1!==preventScroll)return value||(void 0!==preventScroll?"y":void 0)},pointerCapture(_v,_k,{pointer:{capture:capture=!0,buttons:buttons=1,keys:keys=!0}={}}){return this.pointerButtons=buttons,this.keys=keys,!this.pointerLock&&"pointer"===this.device&&capture},threshold(value,_k,{filterTaps:filterTaps=!1,tapsThreshold:tapsThreshold=3,axis:axis}){const threshold=V.toVector(value,filterTaps?tapsThreshold:axis?1:0);return this.filterTaps=filterTaps,this.tapsThreshold=tapsThreshold,threshold},swipe({velocity:velocity=.5,distance:distance=50,duration:duration=250}={}){return{velocity:this.transform(V.toVector(velocity)),distance:this.transform(V.toVector(distance)),duration:duration}},delay(value=0){switch(value){case!0:return 180;case!1:return 0;default:return value}},axisThreshold(value){return value?_objectSpread2(_objectSpread2({},DEFAULT_DRAG_AXIS_THRESHOLD),value):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(value=10){return value}});function clampStateInternalMovementToBounds(state){const[ox,oy]=state.overflow,[dx,dy]=state._delta,[dirx,diry]=state._direction;(ox<0&&dx>0&&dirx<0||ox>0&&dx<0&&dirx>0)&&(state._movement[0]=state._movementBound[0]),(oy<0&&dy>0&&diry<0||oy>0&&dy<0&&diry>0)&&(state._movement[1]=state._movementBound[1])}const pinchConfigResolver=_objectSpread2(_objectSpread2({},commonConfigResolver),{},{device(_v,_k,{shared:shared,pointer:{touch:touch=!1}={}}){if(shared.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&touch)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(_v,_k,{scaleBounds:scaleBounds={},angleBounds:angleBounds={}}){const _scaleBounds=state=>{const D=assignDefault(actions_76b8683e_esm_call(scaleBounds,state),{min:-1/0,max:1/0});return[D.min,D.max]},_angleBounds=state=>{const A=assignDefault(actions_76b8683e_esm_call(angleBounds,state),{min:-1/0,max:1/0});return[A.min,A.max]};return"function"!=typeof scaleBounds&&"function"!=typeof angleBounds?[_scaleBounds(),_angleBounds()]:state=>[_scaleBounds(state),_angleBounds(state)]},threshold(value,_k,config){this.lockDirection="lock"===config.axis;return V.toVector(value,this.lockDirection?[.1,3]:0)},modifierKey(value){return void 0===value?"ctrlKey":value},pinchOnWheel(value=!0){return value}});const moveConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(value=!0)=>value});const scrollConfigResolver=coordinatesConfigResolver;const wheelConfigResolver=coordinatesConfigResolver;const hoverConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(value=!0)=>value}),EngineMap=new Map,ConfigResolverMap=new Map;function actions_76b8683e_esm_registerAction(action){EngineMap.set(action.key,action.engine),ConfigResolverMap.set(action.key,action.resolver)}const actions_76b8683e_esm_dragAction={key:"drag",engine:class DragEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","dragging")}reset(){super.reset();const state=this.state;state._pointerId=void 0,state._pointerActive=!1,state._keyboardActive=!1,state._preventScroll=!1,state._delayed=!1,state.swipe=[0,0],state.tap=!1,state.canceled=!1,state.cancel=this.cancel.bind(this)}setup(){const state=this.state;if(state._bounds instanceof HTMLElement){const boundRect=state._bounds.getBoundingClientRect(),targetRect=state.currentTarget.getBoundingClientRect(),_bounds={left:boundRect.left-targetRect.left+state.offset[0],right:boundRect.right-targetRect.right+state.offset[0],top:boundRect.top-targetRect.top+state.offset[1],bottom:boundRect.bottom-targetRect.bottom+state.offset[1]};state._bounds=coordinatesConfigResolver.bounds(_bounds)}}cancel(){const state=this.state;state.canceled||(state.canceled=!0,state._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(event){const config=this.config,state=this.state;if(null!=event.buttons&&(Array.isArray(config.pointerButtons)?!config.pointerButtons.includes(event.buttons):-1!==config.pointerButtons&&config.pointerButtons!==event.buttons))return;const ctrlIds=this.ctrl.setEventIds(event);config.pointerCapture&&event.target.setPointerCapture(event.pointerId),ctrlIds&&ctrlIds.size>1&&state._pointerActive||(this.start(event),this.setupPointer(event),state._pointerId=pointerId(event),state._pointerActive=!0,this.computeValues(pointerValues(event)),this.computeInitial(),config.preventScrollAxis&&"mouse"!==getPointerType(event)?(state._active=!1,this.setupScrollPrevention(event)):config.delay>0?(this.setupDelayTrigger(event),config.triggerAllEvents&&(this.compute(event),this.emit())):this.startPointerDrag(event))}startPointerDrag(event){const state=this.state;state._active=!0,state._preventScroll=!0,state._delayed=!1,this.compute(event),this.emit()}pointerMove(event){const state=this.state,config=this.config;if(!state._pointerActive)return;const id=pointerId(event);if(void 0!==state._pointerId&&id!==state._pointerId)return;const _values=pointerValues(event);return document.pointerLockElement===event.target?state._delta=[event.movementX,event.movementY]:(state._delta=V.sub(_values,state._values),this.computeValues(_values)),V.addTo(state._movement,state._delta),this.compute(event),state._delayed&&state.intentional?(this.timeoutStore.remove("dragDelay"),state.active=!1,void this.startPointerDrag(event)):config.preventScrollAxis&&!state._preventScroll?state.axis?state.axis===config.preventScrollAxis||"xy"===config.preventScrollAxis?(state._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(event)):void 0:void this.emit()}pointerUp(event){this.ctrl.setEventIds(event);try{this.config.pointerCapture&&event.target.hasPointerCapture(event.pointerId)&&event.target.releasePointerCapture(event.pointerId)}catch(_unused){0}const state=this.state,config=this.config;if(!state._active||!state._pointerActive)return;const id=pointerId(event);if(void 0!==state._pointerId&&id!==state._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(event);const[dx,dy]=state._distance;if(state.tap=dx<=config.tapsThreshold&&dy<=config.tapsThreshold,state.tap&&config.filterTaps)state._force=!0;else{const[_dx,_dy]=state._delta,[_mx,_my]=state._movement,[svx,svy]=config.swipe.velocity,[sx,sy]=config.swipe.distance,sdt=config.swipe.duration;if(state.elapsedTimesvx&&Math.abs(_mx)>sx&&(state.swipe[0]=Math.sign(_dx)),_vy>svy&&Math.abs(_my)>sy&&(state.swipe[1]=Math.sign(_dy))}}this.emit()}pointerClick(event){!this.state.tap&&event.detail>0&&(event.preventDefault(),event.stopPropagation())}setupPointer(event){const config=this.config,device=config.device;config.pointerLock&&event.currentTarget.requestPointerLock(),config.pointerCapture||(this.eventStore.add(this.sharedConfig.window,device,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,device,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,device,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(event){this.state._preventScroll&&event.cancelable&&event.preventDefault()}setupScrollPrevention(event){this.state._preventScroll=!1,function persistEvent(event){"persist"in event&&"function"==typeof event.persist&&event.persist()}(event);const remove=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",remove),this.eventStore.add(this.sharedConfig.window,"touch","cancel",remove),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,event)}setupDelayTrigger(event){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(event)}),this.config.delay)}keyDown(event){const deltaFn=KEYS_DELTA_MAP[event.key];if(deltaFn){const state=this.state,factor=event.shiftKey?10:event.altKey?.1:1;this.start(event),state._delta=deltaFn(this.config.keyboardDisplacement,factor),state._keyboardActive=!0,V.addTo(state._movement,state._delta),this.compute(event),this.emit()}}keyUp(event){event.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(event),this.emit())}bind(bindFunction){const device=this.config.device;bindFunction(device,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(bindFunction(device,"change",this.pointerMove.bind(this)),bindFunction(device,"end",this.pointerUp.bind(this)),bindFunction(device,"cancel",this.pointerUp.bind(this)),bindFunction("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(bindFunction("key","down",this.keyDown.bind(this)),bindFunction("key","up",this.keyUp.bind(this))),this.config.filterTaps&&bindFunction("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:dragConfigResolver},actions_76b8683e_esm_hoverAction={key:"hover",engine:class HoverEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","hovering")}enter(event){this.config.mouseOnly&&"mouse"!==event.pointerType||(this.start(event),this.computeValues(pointerValues(event)),this.compute(event),this.emit())}leave(event){if(this.config.mouseOnly&&"mouse"!==event.pointerType)return;const state=this.state;if(!state._active)return;state._active=!1;const values=pointerValues(event);state._movement=state._delta=V.sub(values,state._values),this.computeValues(values),this.compute(event),state.delta=state.movement,this.emit()}bind(bindFunction){bindFunction("pointer","enter",this.enter.bind(this)),bindFunction("pointer","leave",this.leave.bind(this))}},resolver:hoverConfigResolver},actions_76b8683e_esm_moveAction={key:"move",engine:class MoveEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","moving")}move(event){this.config.mouseOnly&&"mouse"!==event.pointerType||(this.state._active?this.moveChange(event):this.moveStart(event),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(event){this.start(event),this.computeValues(pointerValues(event)),this.compute(event),this.computeInitial(),this.emit()}moveChange(event){if(!this.state._active)return;const values=pointerValues(event),state=this.state;state._delta=V.sub(values,state._values),V.addTo(state._movement,state._delta),this.computeValues(values),this.compute(event),this.emit()}moveEnd(event){this.state._active&&(this.state._active=!1,this.compute(event),this.emit())}bind(bindFunction){bindFunction("pointer","change",this.move.bind(this)),bindFunction("pointer","leave",this.moveEnd.bind(this))}},resolver:moveConfigResolver},actions_76b8683e_esm_pinchAction={key:"pinch",engine:class PinchEngine extends Engine{constructor(...args){super(...args),_defineProperty(this,"ingKey","pinching"),_defineProperty(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const state=this.state;state._touchIds=[],state.canceled=!1,state.cancel=this.cancel.bind(this),state.turns=0}computeOffset(){const{type:type,movement:movement,lastOffset:lastOffset}=this.state;this.state.offset="wheel"===type?V.add(movement,lastOffset):[(1+movement[0])*lastOffset[0],movement[1]+lastOffset[1]]}computeMovement(){const{offset:offset,lastOffset:lastOffset}=this.state;this.state.movement=[offset[0]/lastOffset[0],offset[1]-lastOffset[1]]}axisIntent(){const state=this.state,[_m0,_m1]=state._movement;if(!state.axis){const axisMovementDifference=30*Math.abs(_m0)-Math.abs(_m1);axisMovementDifference<0?state.axis="angle":axisMovementDifference>0&&(state.axis="scale")}}restrictToAxis(v){this.config.lockDirection&&("scale"===this.state.axis?v[1]=0:"angle"===this.state.axis&&(v[0]=0))}cancel(){const state=this.state;state.canceled||setTimeout((()=>{state.canceled=!0,state._active=!1,this.compute(),this.emit()}),0)}touchStart(event){this.ctrl.setEventIds(event);const state=this.state,ctrlTouchIds=this.ctrl.touchIds;if(state._active&&state._touchIds.every((id=>ctrlTouchIds.has(id))))return;if(ctrlTouchIds.size<2)return;this.start(event),state._touchIds=Array.from(ctrlTouchIds).slice(0,2);const payload=touchDistanceAngle(event,state._touchIds);payload&&this.pinchStart(event,payload)}pointerStart(event){if(null!=event.buttons&&event.buttons%2!=1)return;this.ctrl.setEventIds(event),event.target.setPointerCapture(event.pointerId);const state=this.state,_pointerEvents=state._pointerEvents,ctrlPointerIds=this.ctrl.pointerIds;if(state._active&&Array.from(_pointerEvents.keys()).every((id=>ctrlPointerIds.has(id))))return;if(_pointerEvents.size<2&&_pointerEvents.set(event.pointerId,event),state._pointerEvents.size<2)return;this.start(event);const payload=distanceAngle(...Array.from(_pointerEvents.values()));payload&&this.pinchStart(event,payload)}pinchStart(event,payload){this.state.origin=payload.origin,this.computeValues([payload.distance,payload.angle]),this.computeInitial(),this.compute(event),this.emit()}touchMove(event){if(!this.state._active)return;const payload=touchDistanceAngle(event,this.state._touchIds);payload&&this.pinchMove(event,payload)}pointerMove(event){const _pointerEvents=this.state._pointerEvents;if(_pointerEvents.has(event.pointerId)&&_pointerEvents.set(event.pointerId,event),!this.state._active)return;const payload=distanceAngle(...Array.from(_pointerEvents.values()));payload&&this.pinchMove(event,payload)}pinchMove(event,payload){const state=this.state,prev_a=state._values[1],delta_a=payload.angle-prev_a;let delta_turns=0;Math.abs(delta_a)>270&&(delta_turns+=Math.sign(delta_a)),this.computeValues([payload.distance,payload.angle-360*delta_turns]),state.origin=payload.origin,state.turns=delta_turns,state._movement=[state._values[0]/state._initial[0]-1,state._values[1]-state._initial[1]],this.compute(event),this.emit()}touchEnd(event){this.ctrl.setEventIds(event),this.state._active&&this.state._touchIds.some((id=>!this.ctrl.touchIds.has(id)))&&(this.state._active=!1,this.compute(event),this.emit())}pointerEnd(event){const state=this.state;this.ctrl.setEventIds(event);try{event.target.releasePointerCapture(event.pointerId)}catch(_unused){}state._pointerEvents.has(event.pointerId)&&state._pointerEvents.delete(event.pointerId),state._active&&state._pointerEvents.size<2&&(state._active=!1,this.compute(event),this.emit())}gestureStart(event){event.cancelable&&event.preventDefault();const state=this.state;state._active||(this.start(event),this.computeValues([event.scale,event.rotation]),state.origin=[event.clientX,event.clientY],this.compute(event),this.emit())}gestureMove(event){if(event.cancelable&&event.preventDefault(),!this.state._active)return;const state=this.state;this.computeValues([event.scale,event.rotation]),state.origin=[event.clientX,event.clientY];const _previousMovement=state._movement;state._movement=[event.scale-1,event.rotation],state._delta=V.sub(state._movement,_previousMovement),this.compute(event),this.emit()}gestureEnd(event){this.state._active&&(this.state._active=!1,this.compute(event),this.emit())}wheel(event){const modifierKey=this.config.modifierKey;modifierKey&&!event[modifierKey]||(this.state._active?this.wheelChange(event):this.wheelStart(event),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(event){this.start(event),this.wheelChange(event)}wheelChange(event){"uv"in event||event.cancelable&&event.preventDefault();const state=this.state;state._delta=[-wheelValues(event)[1]/100*state.offset[0],0],V.addTo(state._movement,state._delta),clampStateInternalMovementToBounds(state),this.state.origin=[event.clientX,event.clientY],this.compute(event),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(bindFunction){const device=this.config.device;device&&(bindFunction(device,"start",this[device+"Start"].bind(this)),bindFunction(device,"change",this[device+"Move"].bind(this)),bindFunction(device,"end",this[device+"End"].bind(this)),bindFunction(device,"cancel",this[device+"End"].bind(this)),bindFunction("lostPointerCapture","",this[device+"End"].bind(this))),this.config.pinchOnWheel&&bindFunction("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:pinchConfigResolver},actions_76b8683e_esm_scrollAction={key:"scroll",engine:class ScrollEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","scrolling")}scroll(event){this.state._active||this.start(event),this.scrollChange(event),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(event){event.cancelable&&event.preventDefault();const state=this.state,values=function scrollValues(event){var _ref,_ref2;const{scrollX:scrollX,scrollY:scrollY,scrollLeft:scrollLeft,scrollTop:scrollTop}=event.currentTarget;return[null!==(_ref=null!=scrollX?scrollX:scrollLeft)&&void 0!==_ref?_ref:0,null!==(_ref2=null!=scrollY?scrollY:scrollTop)&&void 0!==_ref2?_ref2:0]}(event);state._delta=V.sub(values,state._values),V.addTo(state._movement,state._delta),this.computeValues(values),this.compute(event),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(bindFunction){bindFunction("scroll","",this.scroll.bind(this))}},resolver:scrollConfigResolver},actions_76b8683e_esm_wheelAction={key:"wheel",engine:class WheelEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","wheeling")}wheel(event){this.state._active||this.start(event),this.wheelChange(event),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(event){const state=this.state;state._delta=wheelValues(event),V.addTo(state._movement,state._delta),clampStateInternalMovementToBounds(state),this.compute(event),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(bindFunction){bindFunction("wheel","",this.wheel.bind(this))}},resolver:wheelConfigResolver};function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function use_gesture_core_esm_objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}const sharedConfigResolver={target(value){if(value)return()=>"current"in value?value.current:value},enabled(value=!0){return value},window(value=(SUPPORT.isBrowser?window:void 0)){return value},eventOptions({passive:passive=!0,capture:capture=!1}={}){return{passive:passive,capture:capture}},transform(value){return value}},use_gesture_core_esm_excluded=["target","eventOptions","window","enabled","transform"];function resolveWith(config={},resolvers){const result={};for(const[key,resolver]of Object.entries(resolvers))switch(typeof resolver){case"function":result[key]=resolver.call(result,config[key],key,config);break;case"object":result[key]=resolveWith(config[key],resolver);break;case"boolean":resolver&&(result[key]=config[key])}return result}class EventStore{constructor(ctrl,gestureKey){_defineProperty(this,"_listeners",new Set),this._ctrl=ctrl,this._gestureKey=gestureKey}add(element,device,action,handler,options){const listeners=this._listeners,type=function toDomEventType(device,action=""){const deviceProps=EVENT_TYPE_MAP[device];return device+(deviceProps&&deviceProps[action]||action)}(device,action),eventOptions=_objectSpread2(_objectSpread2({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),options);element.addEventListener(type,handler,eventOptions);const remove=()=>{element.removeEventListener(type,handler,eventOptions),listeners.delete(remove)};return listeners.add(remove),remove}clean(){this._listeners.forEach((remove=>remove())),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty(this,"_timeouts",new Map)}add(key,callback,ms=140,...args){this.remove(key),this._timeouts.set(key,window.setTimeout(callback,ms,...args))}remove(key){const timeout=this._timeouts.get(key);timeout&&window.clearTimeout(timeout)}clean(){this._timeouts.forEach((timeout=>{window.clearTimeout(timeout)})),this._timeouts.clear()}}class use_gesture_core_esm_Controller{constructor(handlers){_defineProperty(this,"gestures",new Set),_defineProperty(this,"_targetEventStore",new EventStore(this)),_defineProperty(this,"gestureEventStores",{}),_defineProperty(this,"gestureTimeoutStores",{}),_defineProperty(this,"handlers",{}),_defineProperty(this,"config",{}),_defineProperty(this,"pointerIds",new Set),_defineProperty(this,"touchIds",new Set),_defineProperty(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function resolveGestures(ctrl,internalHandlers){internalHandlers.drag&&setupGesture(ctrl,"drag");internalHandlers.wheel&&setupGesture(ctrl,"wheel");internalHandlers.scroll&&setupGesture(ctrl,"scroll");internalHandlers.move&&setupGesture(ctrl,"move");internalHandlers.pinch&&setupGesture(ctrl,"pinch");internalHandlers.hover&&setupGesture(ctrl,"hover")}(this,handlers)}setEventIds(event){return isTouch(event)?(this.touchIds=new Set(touchIds(event)),this.touchIds):"pointerId"in event?("pointerup"===event.type||"pointercancel"===event.type?this.pointerIds.delete(event.pointerId):"pointerdown"===event.type&&this.pointerIds.add(event.pointerId),this.pointerIds):void 0}applyHandlers(handlers,nativeHandlers){this.handlers=handlers,this.nativeHandlers=nativeHandlers}applyConfig(config,gestureKey){this.config=function parse(newConfig,gestureKey,_config={}){const _ref=newConfig,{target:target,eventOptions:eventOptions,window:window,enabled:enabled,transform:transform}=_ref,rest=_objectWithoutProperties(_ref,use_gesture_core_esm_excluded);if(_config.shared=resolveWith({target:target,eventOptions:eventOptions,window:window,enabled:enabled,transform:transform},sharedConfigResolver),gestureKey){const resolver=ConfigResolverMap.get(gestureKey);_config[gestureKey]=resolveWith(_objectSpread2({shared:_config.shared},rest),resolver)}else for(const key in rest){const resolver=ConfigResolverMap.get(key);resolver&&(_config[key]=resolveWith(_objectSpread2({shared:_config.shared},rest[key]),resolver))}return _config}(config,gestureKey,this.config)}clean(){this._targetEventStore.clean();for(const key of this.gestures)this.gestureEventStores[key].clean(),this.gestureTimeoutStores[key].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...args){const sharedConfig=this.config.shared,props={};let target;if(!sharedConfig.target||(target=sharedConfig.target(),target)){if(sharedConfig.enabled){for(const gestureKey of this.gestures){const gestureConfig=this.config[gestureKey],bindFunction=bindToProps(props,gestureConfig.eventOptions,!!target);if(gestureConfig.enabled){new(EngineMap.get(gestureKey))(this,args,gestureKey).bind(bindFunction)}}const nativeBindFunction=bindToProps(props,sharedConfig.eventOptions,!!target);for(const eventKey in this.nativeHandlers)nativeBindFunction(eventKey,"",(event=>this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({},this.state.shared),{},{event:event,args:args}))),void 0,!0)}for(const handlerProp in props)props[handlerProp]=chain(...props[handlerProp]);if(!target)return props;for(const handlerProp in props){const{device:device,capture:capture,passive:passive}=parseProp(handlerProp);this._targetEventStore.add(target,device,"",props[handlerProp],{capture:capture,passive:passive})}}}}function setupGesture(ctrl,gestureKey){ctrl.gestures.add(gestureKey),ctrl.gestureEventStores[gestureKey]=new EventStore(ctrl,gestureKey),ctrl.gestureTimeoutStores[gestureKey]=new TimeoutStore}const bindToProps=(props,eventOptions,withPassiveOption)=>(device,action,handler,options={},isNative=!1)=>{var _options$capture,_options$passive;const capture=null!==(_options$capture=options.capture)&&void 0!==_options$capture?_options$capture:eventOptions.capture,passive=null!==(_options$passive=options.passive)&&void 0!==_options$passive?_options$passive:eventOptions.passive;let handlerProp=isNative?device:toHandlerProp(device,action,capture);withPassiveOption&&passive&&(handlerProp+="Passive"),props[handlerProp]=props[handlerProp]||[],props[handlerProp].push(handler)},RE_NOT_NATIVE=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function registerGesture(actions,handlers,handlerKey,key,internalHandlers,config){if(!actions.has(handlerKey))return;if(!EngineMap.has(key))return void 0;const startKey=handlerKey+"Start",endKey=handlerKey+"End";internalHandlers[key]=state=>{let memo;return state.first&&startKey in handlers&&handlers[startKey](state),handlerKey in handlers&&(memo=handlers[handlerKey](state)),state.last&&endKey in handlers&&handlers[endKey](state),memo},config[key]=config[key]||{}}function parseMergedHandlers(mergedHandlers,mergedConfig){const[handlers,nativeHandlers,actions]=function sortHandlers(_handlers){const native={},handlers={},actions=new Set;for(let key in _handlers)RE_NOT_NATIVE.test(key)?(actions.add(RegExp.lastMatch),handlers[key]=_handlers[key]):native[key]=_handlers[key];return[handlers,native,actions]}(mergedHandlers),internalHandlers={};return registerGesture(actions,handlers,"onDrag","drag",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onWheel","wheel",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onScroll","scroll",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onPinch","pinch",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onMove","move",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onHover","hover",internalHandlers,mergedConfig),{handlers:internalHandlers,config:mergedConfig,nativeHandlers:nativeHandlers}}function useRecognizers(handlers,config={},gestureKey,nativeHandlers){const ctrl=react.useMemo((()=>new use_gesture_core_esm_Controller(handlers)),[]);if(ctrl.applyHandlers(handlers,nativeHandlers),ctrl.applyConfig(config,gestureKey),react.useEffect(ctrl.effect.bind(ctrl)),react.useEffect((()=>ctrl.clean.bind(ctrl)),[]),void 0===config.target)return ctrl.bind.bind(ctrl)}function useGesture(handlers,config){const hook=function createUseGesture(actions){return actions.forEach(actions_76b8683e_esm_registerAction),function useGesture(_handlers,_config){const{handlers:handlers,nativeHandlers:nativeHandlers,config:config}=parseMergedHandlers(_handlers,_config||{});return useRecognizers(handlers,config,void 0,nativeHandlers)}}([actions_76b8683e_esm_dragAction,actions_76b8683e_esm_pinchAction,actions_76b8683e_esm_scrollAction,actions_76b8683e_esm_wheelAction,actions_76b8683e_esm_moveAction,actions_76b8683e_esm_hoverAction]);return hook(handlers,config||{})}function PresentationControls({enabled:enabled=!0,snap:snap,global:global,domElement:domElement,cursor:cursor=!0,children:children,speed:speed=1,rotation:rotation=[0,0,0],zoom:zoom=1,polar:polar=[0,Math.PI/2],azimuth:azimuth=[-1/0,1/0],config:config={mass:1,tension:170,friction:26}}){const events=(0,index_99983b2d_esm.A)((state=>state.events)),gl=(0,index_99983b2d_esm.A)((state=>state.gl)),explDomElement=domElement||events.connected||gl.domElement,{size:size}=(0,index_99983b2d_esm.A)(),rPolar=react.useMemo((()=>[rotation[0]+polar[0],rotation[0]+polar[1]]),[rotation[0],polar[0],polar[1]]),rAzimuth=react.useMemo((()=>[rotation[1]+azimuth[0],rotation[1]+azimuth[1]]),[rotation[1],azimuth[0],azimuth[1]]),rInitial=react.useMemo((()=>[three_module.MathUtils.clamp(rotation[0],...rPolar),three_module.MathUtils.clamp(rotation[1],...rAzimuth),rotation[2]]),[rotation[0],rotation[1],rotation[2],rPolar,rAzimuth]),[spring,api]=useSpring((()=>({scale:1,rotation:rInitial,config:config})));react.useEffect((()=>{api.start({scale:1,rotation:rInitial,config:config})}),[rInitial]),react.useEffect((()=>{if(global&&cursor&&enabled)return explDomElement.style.cursor="grab",gl.domElement.style.cursor="",()=>{explDomElement.style.cursor="default",gl.domElement.style.cursor="default"}}),[global,cursor,explDomElement,enabled]);const bind=useGesture({onHover:({last:last})=>{cursor&&!global&&enabled&&(explDomElement.style.cursor=last?"auto":"grab")},onDrag:({down:down,delta:[x,y],memo:[oldY,oldX]=spring.rotation.animation.to||rInitial})=>{if(!enabled)return[y,x];cursor&&(explDomElement.style.cursor=down?"grabbing":"grab"),x=three_module.MathUtils.clamp(oldX+x/size.width*Math.PI*speed,...rAzimuth),y=three_module.MathUtils.clamp(oldY+y/size.height*Math.PI*speed,...rPolar);const sConfig=snap&&!down&&"boolean"!=typeof snap?snap:config;return api.start({scale:down&&y>rPolar[1]/2?zoom:1,rotation:snap&&!down?rInitial:[y,x,0],config:n=>"scale"===n?{...sConfig,friction:3*sConfig.friction}:sConfig}),[y,x]}},{target:global?explDomElement:void 0});return react.createElement(animated.group,(0,esm_extends.Z)({},null==bind?void 0:bind(),spring),children)}}}]); \ No newline at end of file diff --git a/docs/152.ecb11f02.iframe.bundle.js b/docs/152.ecb11f02.iframe.bundle.js deleted file mode 100644 index 7cdafbce..00000000 --- a/docs/152.ecb11f02.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[152],{"./node_modules/@react-three/drei/core/Bounds.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{B:function(){return useBounds},Y:function(){return Bounds}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),three__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/three/build/three.module.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js");const isOrthographic=def=>def&&def.isOrthographicCamera,isBox3=def=>def&&def.isBox3,context=react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);function Bounds({children:children,damping:damping=6,fit:fit,clip:clip,observe:observe,margin:margin=1.2,eps:eps=.01,onFit:onFit}){const ref=react__WEBPACK_IMPORTED_MODULE_0__.useRef(null),{camera:camera,invalidate:invalidate,size:size,controls:controlsImpl}=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__.z)(),controls=controlsImpl,onFitRef=react__WEBPACK_IMPORTED_MODULE_0__.useRef(onFit);function equals(a,b){return Math.abs(a.x-b.x)({animating:!1,focus:new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,camera:new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,zoom:1}))),[goal]=react__WEBPACK_IMPORTED_MODULE_0__.useState((()=>({focus:new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,camera:new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,zoom:1}))),[box]=react__WEBPACK_IMPORTED_MODULE_0__.useState((()=>new three__WEBPACK_IMPORTED_MODULE_2__.Box3)),api=react__WEBPACK_IMPORTED_MODULE_0__.useMemo((()=>{function getSize(){const size=box.getSize(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3),center=box.getCenter(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3),maxSize=Math.max(size.x,size.y,size.z),fitHeightDistance=isOrthographic(camera)?4*maxSize:maxSize/(2*Math.atan(Math.PI*camera.fov/360)),fitWidthDistance=isOrthographic(camera)?4*maxSize:fitHeightDistance/camera.aspect,distance=margin*Math.max(fitHeightDistance,fitWidthDistance);return{box:box,size:size,center:center,distance:distance}}return{getSize:getSize,refresh(object){if(isBox3(object))box.copy(object);else{const target=object||ref.current;if(!target)return this;target.updateWorldMatrix(!0,!0),box.setFromObject(target)}if(box.isEmpty()){const max=camera.position.length()||10;box.setFromCenterAndSize(new three__WEBPACK_IMPORTED_MODULE_2__.Vector3,new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(max,max,max))}if("OrthographicTrackballControls"===(null==controls?void 0:controls.constructor.name)){const{distance:distance}=getSize(),direction=camera.position.clone().sub(controls.target).normalize().multiplyScalar(distance),newPos=controls.target.clone().add(direction);camera.position.copy(newPos)}return this},clip(){const{distance:distance}=getSize();return controls&&(controls.maxDistance=10*distance),camera.near=distance/100,camera.far=100*distance,camera.updateProjectionMatrix(),controls&&controls.update(),invalidate(),this},to({position:position,target:target}){current.camera.copy(camera.position);const{center:center}=getSize();return goal.camera.set(...position),target?goal.focus.set(...target):goal.focus.copy(center),damping?current.animating=!0:camera.position.set(...position),this},fit(){current.camera.copy(camera.position),controls&¤t.focus.copy(controls.target);const{center:center,distance:distance}=getSize(),direction=center.clone().sub(camera.position).normalize().multiplyScalar(distance);if(goal.camera.copy(center).sub(direction),goal.focus.copy(center),isOrthographic(camera)){current.zoom=camera.zoom;let maxHeight=0,maxWidth=0;const vertices=[new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.min.y,box.min.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.max.y,box.min.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.min.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.min.x,box.max.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.max.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.max.y,box.min.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.min.y,box.max.z),new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(box.max.x,box.min.y,box.min.z)];center.applyMatrix4(camera.matrixWorldInverse);for(const v of vertices)v.applyMatrix4(camera.matrixWorldInverse),maxHeight=Math.max(maxHeight,Math.abs(v.y-center.y)),maxWidth=Math.max(maxWidth,Math.abs(v.x-center.x));maxHeight*=2,maxWidth*=2;const zoomForHeight=(camera.top-camera.bottom)/maxHeight,zoomForWidth=(camera.right-camera.left)/maxWidth;goal.zoom=Math.min(zoomForHeight,zoomForWidth)/margin,damping||(camera.zoom=goal.zoom,camera.updateProjectionMatrix())}return damping?current.animating=!0:(camera.position.copy(goal.camera),camera.lookAt(goal.focus),controls&&(controls.target.copy(goal.focus),controls.update())),onFitRef.current&&onFitRef.current(this.getSize()),invalidate(),this}}}),[box,camera,controls,margin,damping,invalidate]);react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect((()=>{if(controls){const callback=()=>current.animating=!1;return controls.addEventListener("start",callback),()=>controls.removeEventListener("start",callback)}}),[controls]);const count=react__WEBPACK_IMPORTED_MODULE_0__.useRef(0);return react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect((()=>{(observe||0==count.current++)&&(api.refresh(),fit&&api.fit(),clip&&api.clip())}),[size,clip,fit,observe,camera,controls]),(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_1__.A)(((state,delta)=>{if(current.animating){if(damp(current.focus,goal.focus,damping,delta),damp(current.camera,goal.camera,damping,delta),current.zoom=three__WEBPACK_IMPORTED_MODULE_2__.MathUtils.damp(current.zoom,goal.zoom,damping,delta),camera.position.copy(current.camera),isOrthographic(camera)&&(camera.zoom=current.zoom,camera.updateProjectionMatrix()),controls?(controls.target.copy(current.focus),controls.update()):camera.lookAt(current.focus),invalidate(),isOrthographic(camera)&&!(Math.abs(current.zoom-goal.zoom)schedule(fn,updateQueue);let writeQueue=makeQueue();react_spring_rafz_esm_raf.write=fn=>schedule(fn,writeQueue);let onStartQueue=makeQueue();react_spring_rafz_esm_raf.onStart=fn=>schedule(fn,onStartQueue);let onFrameQueue=makeQueue();react_spring_rafz_esm_raf.onFrame=fn=>schedule(fn,onFrameQueue);let onFinishQueue=makeQueue();react_spring_rafz_esm_raf.onFinish=fn=>schedule(fn,onFinishQueue);let timeouts=[];react_spring_rafz_esm_raf.setTimeout=(handler,ms)=>{let time=react_spring_rafz_esm_raf.now()+ms,cancel=()=>{let i=timeouts.findIndex((t=>t.cancel==cancel));~i&&timeouts.splice(i,1),pendingCount-=~i?1:0},timeout={time:time,handler:handler,cancel:cancel};return timeouts.splice(findTimeout(time),0,timeout),pendingCount+=1,start(),timeout};let findTimeout=time=>~(~timeouts.findIndex((t=>t.time>time))||~timeouts.length);react_spring_rafz_esm_raf.cancel=fn=>{onStartQueue.delete(fn),onFrameQueue.delete(fn),onFinishQueue.delete(fn),updateQueue.delete(fn),writeQueue.delete(fn)},react_spring_rafz_esm_raf.sync=fn=>{sync=!0,react_spring_rafz_esm_raf.batchedUpdates(fn),sync=!1},react_spring_rafz_esm_raf.throttle=fn=>{let lastArgs;function queuedFn(){try{fn(...lastArgs)}finally{lastArgs=null}}function throttled(...args){lastArgs=args,react_spring_rafz_esm_raf.onStart(queuedFn)}return throttled.handler=fn,throttled.cancel=()=>{onStartQueue.delete(queuedFn),lastArgs=null},throttled};let nativeRaf="undefined"!=typeof window?window.requestAnimationFrame:()=>{};react_spring_rafz_esm_raf.use=impl=>nativeRaf=impl,react_spring_rafz_esm_raf.now="undefined"!=typeof performance?()=>performance.now():Date.now,react_spring_rafz_esm_raf.batchedUpdates=fn=>fn(),react_spring_rafz_esm_raf.catch=console.error,react_spring_rafz_esm_raf.frameLoop="always",react_spring_rafz_esm_raf.advance=()=>{"demand"!==react_spring_rafz_esm_raf.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):update()};let ts=-1,pendingCount=0,sync=!1;function schedule(fn,queue){sync?(queue.delete(fn),fn(0)):(queue.add(fn),start())}function start(){ts<0&&(ts=0,"demand"!==react_spring_rafz_esm_raf.frameLoop&&nativeRaf(loop))}function loop(){~ts&&(nativeRaf(loop),react_spring_rafz_esm_raf.batchedUpdates(update))}function update(){let prevTs=ts;ts=react_spring_rafz_esm_raf.now();let count=findTimeout(ts);count&&(eachSafely(timeouts.splice(0,count),(t=>t.handler())),pendingCount-=count),pendingCount?(onStartQueue.flush(),updateQueue.flush(prevTs?Math.min(64,ts-prevTs):16.667),onFrameQueue.flush(),writeQueue.flush(),onFinishQueue.flush()):function stop(){ts=-1}()}function makeQueue(){let next=new Set,current=next;return{add(fn){pendingCount+=current!=next||next.has(fn)?0:1,next.add(fn)},delete(fn){return pendingCount-=current==next&&next.has(fn)?1:0,next.delete(fn)},flush(arg){current.size&&(next=new Set,pendingCount-=current.size,eachSafely(current,(fn=>fn(arg)&&next.add(fn))),pendingCount+=next.size,current=next)}}}function eachSafely(values,each){values.forEach((value=>{try{each(value)}catch(e){react_spring_rafz_esm_raf.catch(e)}}))}function noop(){}const react_spring_shared_esm_is={arr:Array.isArray,obj:a=>!!a&&"Object"===a.constructor.name,fun:a=>"function"==typeof a,str:a=>"string"==typeof a,num:a=>"number"==typeof a,und:a=>void 0===a};function isEqual(a,b){if(react_spring_shared_esm_is.arr(a)){if(!react_spring_shared_esm_is.arr(b)||a.length!==b.length)return!1;for(let i=0;iobj.forEach(fn);function eachProp(obj,fn,ctx){if(react_spring_shared_esm_is.arr(obj))for(let i=0;ireact_spring_shared_esm_is.und(a)?[]:react_spring_shared_esm_is.arr(a)?a:[a];function flush(queue,iterator){if(queue.size){const items=Array.from(queue);queue.clear(),react_spring_shared_esm_each(items,iterator)}}const flushCalls=(queue,...args)=>flush(queue,(fn=>fn(...args))),isSSR=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let createStringInterpolator$1,to,colors$1=null,skipAnimation=!1,willAdvance=noop;const react_spring_shared_esm_assign=globals=>{globals.to&&(to=globals.to),globals.now&&(react_spring_rafz_esm_raf.now=globals.now),void 0!==globals.colors&&(colors$1=globals.colors),null!=globals.skipAnimation&&(skipAnimation=globals.skipAnimation),globals.createStringInterpolator&&(createStringInterpolator$1=globals.createStringInterpolator),globals.requestAnimationFrame&&react_spring_rafz_esm_raf.use(globals.requestAnimationFrame),globals.batchedUpdates&&(react_spring_rafz_esm_raf.batchedUpdates=globals.batchedUpdates),globals.willAdvance&&(willAdvance=globals.willAdvance),globals.frameLoop&&(react_spring_rafz_esm_raf.frameLoop=globals.frameLoop)};var globals=Object.freeze({__proto__:null,get createStringInterpolator(){return createStringInterpolator$1},get to(){return to},get colors(){return colors$1},get skipAnimation(){return skipAnimation},get willAdvance(){return willAdvance},assign:react_spring_shared_esm_assign});const startQueue=new Set;let currentFrame=[],prevFrame=[],priority=0;const frameLoop={get idle(){return!startQueue.size&&!currentFrame.length},start(animation){priority>animation.priority?(startQueue.add(animation),react_spring_rafz_esm_raf.onStart(flushStartQueue)):(startSafely(animation),react_spring_rafz_esm_raf(advance))},advance:advance,sort(animation){if(priority)react_spring_rafz_esm_raf.onFrame((()=>frameLoop.sort(animation)));else{const prevIndex=currentFrame.indexOf(animation);~prevIndex&&(currentFrame.splice(prevIndex,1),startUnsafely(animation))}},clear(){currentFrame=[],startQueue.clear()}};function flushStartQueue(){startQueue.forEach(startSafely),startQueue.clear(),react_spring_rafz_esm_raf(advance)}function startSafely(animation){currentFrame.includes(animation)||startUnsafely(animation)}function startUnsafely(animation){currentFrame.splice(function findIndex(arr,test){const index=arr.findIndex(test);return index<0?arr.length:index}(currentFrame,(other=>other.priority>animation.priority)),0,animation)}function advance(dt){const nextFrame=prevFrame;for(let i=0;i0}const NUMBER="[-+]?\\d*\\.?\\d+",PERCENTAGE=NUMBER+"%";function call(...parts){return"\\(\\s*("+parts.join(")\\s*,\\s*(")+")\\s*\\)"}const rgb=new RegExp("rgb"+call(NUMBER,NUMBER,NUMBER)),rgba=new RegExp("rgba"+call(NUMBER,NUMBER,NUMBER,NUMBER)),hsl=new RegExp("hsl"+call(NUMBER,PERCENTAGE,PERCENTAGE)),hsla=new RegExp("hsla"+call(NUMBER,PERCENTAGE,PERCENTAGE,NUMBER)),hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6=/^#([0-9a-fA-F]{6})$/,hex8=/^#([0-9a-fA-F]{8})$/;function hue2rgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p}function hslToRgb(h,s,l){const q=l<.5?l*(1+s):l+s-l*s,p=2*l-q,r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3);return Math.round(255*r)<<24|Math.round(255*g)<<16|Math.round(255*b)<<8}function parse255(str){const int=parseInt(str,10);return int<0?0:int>255?255:int}function parse360(str){return(parseFloat(str)%360+360)%360/360}function parse1(str){const num=parseFloat(str);return num<0?0:num>1?255:Math.round(255*num)}function parsePercentage(str){const int=parseFloat(str);return int<0?0:int>100?1:int/100}function colorToRgba(input){let int32Color=function normalizeColor(color){let match;return"number"==typeof color?color>>>0===color&&color>=0&&color<=4294967295?color:null:(match=hex6.exec(color))?parseInt(match[1]+"ff",16)>>>0:colors$1&&void 0!==colors$1[color]?colors$1[color]:(match=rgb.exec(color))?(parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|255)>>>0:(match=rgba.exec(color))?(parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|parse1(match[4]))>>>0:(match=hex3.exec(color))?parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+"ff",16)>>>0:(match=hex8.exec(color))?parseInt(match[1],16)>>>0:(match=hex4.exec(color))?parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+match[4]+match[4],16)>>>0:(match=hsl.exec(color))?(255|hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3])))>>>0:(match=hsla.exec(color))?(hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3]))|parse1(match[4]))>>>0:null}(input);return null===int32Color?input:(int32Color=int32Color||0,`rgba(${(4278190080&int32Color)>>>24}, ${(16711680&int32Color)>>>16}, ${(65280&int32Color)>>>8}, ${(255&int32Color)/255})`)}const createInterpolator=(range,output,extrapolate)=>{if(react_spring_shared_esm_is.fun(range))return range;if(react_spring_shared_esm_is.arr(range))return createInterpolator({range:range,output:output,extrapolate:extrapolate});if(react_spring_shared_esm_is.str(range.output[0]))return createStringInterpolator$1(range);const config=range,outputRange=config.output,inputRange=config.range||[0,1],extrapolateLeft=config.extrapolateLeft||config.extrapolate||"extend",extrapolateRight=config.extrapolateRight||config.extrapolate||"extend",easing=config.easing||(t=>t);return input=>{const range=function findRange(input,inputRange){for(var i=1;i=input);++i);return i-1}(input,inputRange);return function interpolate(input,inputMin,inputMax,outputMin,outputMax,easing,extrapolateLeft,extrapolateRight,map){let result=map?map(input):input;if(resultinputMax){if("identity"===extrapolateRight)return result;"clamp"===extrapolateRight&&(result=inputMax)}if(outputMin===outputMax)return outputMin;if(inputMin===inputMax)return input<=inputMin?outputMin:outputMax;inputMin===-1/0?result=-result:inputMax===1/0?result-=inputMin:result=(result-inputMin)/(inputMax-inputMin);result=easing(result),outputMin===-1/0?result=-result:outputMax===1/0?result+=outputMin:result=result*(outputMax-outputMin)+outputMin;return result}(input,inputRange[range],inputRange[range+1],outputRange[range],outputRange[range+1],easing,extrapolateLeft,extrapolateRight,config.map)}};const c1=1.70158,c2=1.525*c1,c4=2*Math.PI/3,c5=2*Math.PI/4.5,bounceOut=x=>{const n1=7.5625,d1=2.75;return x<1/d1?n1*x*x:x<2/d1?n1*(x-=1.5/d1)*x+.75:x<2.5/d1?n1*(x-=2.25/d1)*x+.9375:n1*(x-=2.625/d1)*x+.984375},easings={linear:x=>x,easeInQuad:x=>x*x,easeOutQuad:x=>1-(1-x)*(1-x),easeInOutQuad:x=>x<.5?2*x*x:1-Math.pow(-2*x+2,2)/2,easeInCubic:x=>x*x*x,easeOutCubic:x=>1-Math.pow(1-x,3),easeInOutCubic:x=>x<.5?4*x*x*x:1-Math.pow(-2*x+2,3)/2,easeInQuart:x=>x*x*x*x,easeOutQuart:x=>1-Math.pow(1-x,4),easeInOutQuart:x=>x<.5?8*x*x*x*x:1-Math.pow(-2*x+2,4)/2,easeInQuint:x=>x*x*x*x*x,easeOutQuint:x=>1-Math.pow(1-x,5),easeInOutQuint:x=>x<.5?16*x*x*x*x*x:1-Math.pow(-2*x+2,5)/2,easeInSine:x=>1-Math.cos(x*Math.PI/2),easeOutSine:x=>Math.sin(x*Math.PI/2),easeInOutSine:x=>-(Math.cos(Math.PI*x)-1)/2,easeInExpo:x=>0===x?0:Math.pow(2,10*x-10),easeOutExpo:x=>1===x?1:1-Math.pow(2,-10*x),easeInOutExpo:x=>0===x?0:1===x?1:x<.5?Math.pow(2,20*x-10)/2:(2-Math.pow(2,-20*x+10))/2,easeInCirc:x=>1-Math.sqrt(1-Math.pow(x,2)),easeOutCirc:x=>Math.sqrt(1-Math.pow(x-1,2)),easeInOutCirc:x=>x<.5?(1-Math.sqrt(1-Math.pow(2*x,2)))/2:(Math.sqrt(1-Math.pow(-2*x+2,2))+1)/2,easeInBack:x=>2.70158*x*x*x-c1*x*x,easeOutBack:x=>1+2.70158*Math.pow(x-1,3)+c1*Math.pow(x-1,2),easeInOutBack:x=>x<.5?Math.pow(2*x,2)*(7.189819*x-c2)/2:(Math.pow(2*x-2,2)*((c2+1)*(2*x-2)+c2)+2)/2,easeInElastic:x=>0===x?0:1===x?1:-Math.pow(2,10*x-10)*Math.sin((10*x-10.75)*c4),easeOutElastic:x=>0===x?0:1===x?1:Math.pow(2,-10*x)*Math.sin((10*x-.75)*c4)+1,easeInOutElastic:x=>0===x?0:1===x?1:x<.5?-Math.pow(2,20*x-10)*Math.sin((20*x-11.125)*c5)/2:Math.pow(2,-20*x+10)*Math.sin((20*x-11.125)*c5)/2+1,easeInBounce:x=>1-bounceOut(1-x),easeOutBounce:bounceOut,easeInOutBounce:x=>x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2,steps:(steps,direction="end")=>progress=>{const expanded=(progress="end"===direction?Math.min(progress,.999):Math.max(progress,.001))*steps,rounded="end"===direction?Math.floor(expanded):Math.ceil(expanded);return min=0,max=1,v=rounded/steps,Math.min(Math.max(v,min),max);var min,max,v}};function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;iBoolean(arg&&arg[$get]),getFluidValue=arg=>arg&&arg[$get]?arg[$get]():arg,getFluidObservers=target=>target[$observers]||null;function callFluidObservers(target,event){let observers=target[$observers];observers&&observers.forEach((observer=>{!function callFluidObserver(observer,event){observer.eventObserved?observer.eventObserved(event):observer(event)}(observer,event)}))}class FluidValue{constructor(get){if(this[$get]=void 0,this[$observers]=void 0,!get&&!(get=this.get))throw Error("Unknown getter");setFluidGetter(this,get)}}const setFluidGetter=(target,get)=>setHidden(target,$get,get);function addFluidObserver(target,observer){if(target[$get]){let observers=target[$observers];observers||setHidden(target,$observers,observers=new Set),observers.has(observer)||(observers.add(observer),target.observerAdded&&target.observerAdded(observers.size,observer))}return observer}function removeFluidObserver(target,observer){let observers=target[$observers];if(observers&&observers.has(observer)){const count=observers.size-1;count?observers.delete(observer):target[$observers]=null,target.observerRemoved&&target.observerRemoved(count,observer)}}const setHidden=(target,key,value)=>Object.defineProperty(target,key,{value:value,writable:!0,configurable:!0}),numberRegex=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,colorRegex=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,unitRegex=new RegExp(`(${numberRegex.source})(%|[a-z]+)`,"i"),rgbaRegex=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,variableToRgba=input=>{const[token,fallback]=parseCSSVariable(input);if(!token||isSSR())return input;const value=window.getComputedStyle(document.documentElement).getPropertyValue(token);if(value)return value.trim();if(fallback&&fallback.startsWith("--")){const _value=window.getComputedStyle(document.documentElement).getPropertyValue(fallback);return _value||input}return fallback&&cssVariableRegex.test(fallback)?variableToRgba(fallback):fallback||input},parseCSSVariable=current=>{const match=cssVariableRegex.exec(current);if(!match)return[,];const[,token,fallback]=match;return[token,fallback]};let namedColorRegex;const rgbaRound=(_,p1,p2,p3,p4)=>`rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`,createStringInterpolator=config=>{namedColorRegex||(namedColorRegex=colors$1?new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`,"g"):/^\b$/);const output=config.output.map((value=>getFluidValue(value).replace(cssVariableRegex,variableToRgba).replace(colorRegex,colorToRgba).replace(namedColorRegex,colorToRgba))),keyframes=output.map((value=>value.match(numberRegex).map(Number))),interpolators=keyframes[0].map(((_,i)=>keyframes.map((values=>{if(!(i in values))throw Error('The arity of each "output" value must be equal');return values[i]})))).map((output=>createInterpolator(_extends({},config,{output:output}))));return input=>{var _output$find;const missingUnit=!unitRegex.test(output[0])&&(null==(_output$find=output.find((value=>unitRegex.test(value))))?void 0:_output$find.replace(numberRegex,""));let i=0;return output[0].replace(numberRegex,(()=>`${interpolators[i++](input)}${missingUnit||""}`)).replace(rgbaRegex,rgbaRound)}},prefix="react-spring: ",once=fn=>{const func=fn;let called=!1;if("function"!=typeof func)throw new TypeError(`${prefix}once requires a function parameter`);return(...args)=>{called||(func(...args),called=!0)}},warnInterpolate=once(console.warn);const warnDirectCall=once(console.warn);function isAnimatedString(value){return react_spring_shared_esm_is.str(value)&&("#"==value[0]||/\d/.test(value)||!isSSR()&&cssVariableRegex.test(value)||value in(colors$1||{}))}new WeakMap;new Set;new WeakMap,new WeakMap,new WeakMap;const react_spring_shared_esm_useIsomorphicLayoutEffect=isSSR()?react.useEffect:react.useLayoutEffect,useIsMounted=()=>{const isMounted=(0,react.useRef)(!1);return react_spring_shared_esm_useIsomorphicLayoutEffect((()=>(isMounted.current=!0,()=>{isMounted.current=!1})),[]),isMounted};function react_spring_shared_esm_useForceUpdate(){const update=(0,react.useState)()[1],isMounted=useIsMounted();return()=>{isMounted.current&&update(Math.random())}}const react_spring_shared_esm_useOnce=effect=>(0,react.useEffect)(effect,emptyDeps),emptyDeps=[];function react_spring_shared_esm_usePrev(value){const prevRef=(0,react.useRef)();return(0,react.useEffect)((()=>{prevRef.current=value})),prevRef.current}const $node=Symbol.for("Animated:node"),getAnimated=owner=>owner&&owner[$node],setAnimated=(owner,node)=>{return obj=owner,key=$node,value=node,Object.defineProperty(obj,key,{value:value,writable:!0,configurable:!0});var obj,key,value},getPayload=owner=>owner&&owner[$node]&&owner[$node].getPayload();class Animated{constructor(){this.payload=void 0,setAnimated(this,this)}getPayload(){return this.payload||[]}}class AnimatedValue extends Animated{constructor(_value){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=_value,react_spring_shared_esm_is.num(this._value)&&(this.lastPosition=this._value)}static create(value){return new AnimatedValue(value)}getPayload(){return[this]}getValue(){return this._value}setValue(value,step){return react_spring_shared_esm_is.num(value)&&(this.lastPosition=value,step&&(value=Math.round(value/step)*step,this.done&&(this.lastPosition=value))),this._value!==value&&(this._value=value,!0)}reset(){const{done:done}=this;this.done=!1,react_spring_shared_esm_is.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,done&&(this.lastVelocity=null),this.v0=null)}}class AnimatedString extends AnimatedValue{constructor(value){super(0),this._string=null,this._toString=void 0,this._toString=createInterpolator({output:[value,value]})}static create(value){return new AnimatedString(value)}getValue(){let value=this._string;return null==value?this._string=this._toString(this._value):value}setValue(value){if(react_spring_shared_esm_is.str(value)){if(value==this._string)return!1;this._string=value,this._value=1}else{if(!super.setValue(value))return!1;this._string=null}return!0}reset(goal){goal&&(this._toString=createInterpolator({output:[this.getValue(),goal]})),this._value=0,super.reset()}}const TreeContext={dependencies:null};class AnimatedObject extends Animated{constructor(source){super(),this.source=source,this.setValue(source)}getValue(animated){const values={};return eachProp(this.source,((source,key)=>{var value;(value=source)&&value[$node]===value?values[key]=source.getValue(animated):hasFluidValue(source)?values[key]=getFluidValue(source):animated||(values[key]=source)})),values}setValue(source){this.source=source,this.payload=this._makePayload(source)}reset(){this.payload&&react_spring_shared_esm_each(this.payload,(node=>node.reset()))}_makePayload(source){if(source){const payload=new Set;return eachProp(source,this._addToPayload,payload),Array.from(payload)}}_addToPayload(source){TreeContext.dependencies&&hasFluidValue(source)&&TreeContext.dependencies.add(source);const payload=getPayload(source);payload&&react_spring_shared_esm_each(payload,(node=>this.add(node)))}}class AnimatedArray extends AnimatedObject{constructor(source){super(source)}static create(source){return new AnimatedArray(source)}getValue(){return this.source.map((node=>node.getValue()))}setValue(source){const payload=this.getPayload();return source.length==payload.length?payload.map(((node,i)=>node.setValue(source[i]))).some(Boolean):(super.setValue(source.map(makeAnimated)),!0)}}function makeAnimated(value){return(isAnimatedString(value)?AnimatedString:AnimatedValue).create(value)}function getAnimatedType(value){const parentNode=getAnimated(value);return parentNode?parentNode.constructor:react_spring_shared_esm_is.arr(value)?AnimatedArray:isAnimatedString(value)?AnimatedString:AnimatedValue}function react_spring_animated_esm_extends(){return react_spring_animated_esm_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const hasInstance=!react_spring_shared_esm_is.fun(Component)||Component.prototype&&Component.prototype.isReactComponent;return(0,react.forwardRef)(((givenProps,givenRef)=>{const instanceRef=(0,react.useRef)(null),ref=hasInstance&&(0,react.useCallback)((value=>{instanceRef.current=function updateRef(ref,value){ref&&(react_spring_shared_esm_is.fun(ref)?ref(value):ref.current=value);return value}(givenRef,value)}),[givenRef]),[props,deps]=function getAnimatedState(props,host){const dependencies=new Set;TreeContext.dependencies=dependencies,props.style&&(props=react_spring_animated_esm_extends({},props,{style:host.createAnimatedStyle(props.style)}));return props=new AnimatedObject(props),TreeContext.dependencies=null,[props,dependencies]}(givenProps,host),forceUpdate=react_spring_shared_esm_useForceUpdate(),callback=()=>{const instance=instanceRef.current;if(hasInstance&&!instance)return;!1===(!!instance&&host.applyAnimatedValues(instance,props.getValue(!0)))&&forceUpdate()},observer=new PropsObserver(callback,deps),observerRef=(0,react.useRef)();react_spring_shared_esm_useIsomorphicLayoutEffect((()=>(observerRef.current=observer,react_spring_shared_esm_each(deps,(dep=>addFluidObserver(dep,observer))),()=>{observerRef.current&&(react_spring_shared_esm_each(observerRef.current.deps,(dep=>removeFluidObserver(dep,observerRef.current))),react_spring_rafz_esm_raf.cancel(observerRef.current.update))}))),(0,react.useEffect)(callback,[]),react_spring_shared_esm_useOnce((()=>()=>{const observer=observerRef.current;react_spring_shared_esm_each(observer.deps,(dep=>removeFluidObserver(dep,observer)))}));const usedProps=host.getComponentProps(props.getValue());return react.createElement(Component,react_spring_animated_esm_extends({},usedProps,{ref:ref}))}))};class PropsObserver{constructor(update,deps){this.update=update,this.deps=deps}eventObserved(event){"change"==event.type&&react_spring_rafz_esm_raf.write(this.update)}}const cacheKey=Symbol.for("AnimatedComponent"),getDisplayName=arg=>react_spring_shared_esm_is.str(arg)?arg:arg&&react_spring_shared_esm_is.str(arg.displayName)?arg.displayName:react_spring_shared_esm_is.fun(arg)&&arg.name||null;function react_spring_core_esm_extends(){return react_spring_core_esm_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i!0===value||!!(key&&value&&(react_spring_shared_esm_is.fun(value)?value(key):react_spring_shared_esm_toArray(value).includes(key))),resolveProp=(prop,key)=>react_spring_shared_esm_is.obj(prop)?key&&prop[key]:prop,getDefaultProp=(props,key)=>!0===props.default?props[key]:props.default?props.default[key]:void 0,noopTransform=value=>value,getDefaultProps=(props,transform=noopTransform)=>{let keys=DEFAULT_PROPS;props.default&&!0!==props.default&&(props=props.default,keys=Object.keys(props));const defaults={};for(const key of keys){const value=transform(props[key],key);react_spring_shared_esm_is.und(value)||(defaults[key]=value)}return defaults},DEFAULT_PROPS=["config","onProps","onStart","onChange","onPause","onResume","onRest"],RESERVED_PROPS={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function inferTo(props){const to=function getForwardProps(props){const forward={};let count=0;if(eachProp(props,((value,prop)=>{RESERVED_PROPS[prop]||(forward[prop]=value,count++)})),count)return forward}(props);if(to){const out={to:to};return eachProp(props,((val,key)=>key in to||(out[key]=val))),out}return react_spring_core_esm_extends({},props)}function computeGoal(value){return value=getFluidValue(value),react_spring_shared_esm_is.arr(value)?value.map(computeGoal):isAnimatedString(value)?globals.createStringInterpolator({range:[0,1],output:[value,value]})(1):value}function hasProps(props){for(const _ in props)return!0;return!1}function isAsyncTo(to){return react_spring_shared_esm_is.fun(to)||react_spring_shared_esm_is.arr(to)&&react_spring_shared_esm_is.obj(to[0])}function detachRefs(ctrl,ref){var _ctrl$ref;null==(_ctrl$ref=ctrl.ref)||_ctrl$ref.delete(ctrl),null==ref||ref.delete(ctrl)}function replaceRef(ctrl,ref){var _ctrl$ref2;ref&&ctrl.ref!==ref&&(null==(_ctrl$ref2=ctrl.ref)||_ctrl$ref2.delete(ctrl),ref.add(ctrl),ctrl.ref=ref)}const defaults=react_spring_core_esm_extends({},{tension:170,friction:26},{mass:1,damping:1,easing:easings.linear,clamp:!1});class AnimationConfig{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,defaults)}}function sanitizeConfig(config,props){if(react_spring_shared_esm_is.und(props.decay)){const isTensionConfig=!react_spring_shared_esm_is.und(props.tension)||!react_spring_shared_esm_is.und(props.friction);!isTensionConfig&&react_spring_shared_esm_is.und(props.frequency)&&react_spring_shared_esm_is.und(props.damping)&&react_spring_shared_esm_is.und(props.mass)||(config.duration=void 0,config.decay=void 0),isTensionConfig&&(config.frequency=void 0)}else config.duration=void 0}const emptyArray=[];class Animation{constructor(){this.changed=!1,this.values=emptyArray,this.toValues=null,this.fromValues=emptyArray,this.to=void 0,this.from=void 0,this.config=new AnimationConfig,this.immediate=!1}}function scheduleProps(callId,{key:key,props:props,defaultProps:defaultProps,state:state,actions:actions}){return new Promise(((resolve,reject)=>{var _props$cancel;let delay,timeout,cancel=matchProp(null!=(_props$cancel=props.cancel)?_props$cancel:null==defaultProps?void 0:defaultProps.cancel,key);if(cancel)onStart();else{react_spring_shared_esm_is.und(props.pause)||(state.paused=matchProp(props.pause,key));let pause=null==defaultProps?void 0:defaultProps.pause;!0!==pause&&(pause=state.paused||matchProp(pause,key)),delay=callProp(props.delay||0,key),pause?(state.resumeQueue.add(onResume),actions.pause()):(actions.resume(),onResume())}function onPause(){state.resumeQueue.add(onResume),state.timeouts.delete(timeout),timeout.cancel(),delay=timeout.time-react_spring_rafz_esm_raf.now()}function onResume(){delay>0&&!globals.skipAnimation?(state.delayed=!0,timeout=react_spring_rafz_esm_raf.setTimeout(onStart,delay),state.pauseQueue.add(onPause),state.timeouts.add(timeout)):onStart()}function onStart(){state.delayed&&(state.delayed=!1),state.pauseQueue.delete(onPause),state.timeouts.delete(timeout),callId<=(state.cancelId||0)&&(cancel=!0);try{actions.start(react_spring_core_esm_extends({},props,{callId:callId,cancel:cancel}),resolve)}catch(err){reject(err)}}}))}const getCombinedResult=(target,results)=>1==results.length?results[0]:results.some((result=>result.cancelled))?getCancelledResult(target.get()):results.every((result=>result.noop))?getNoopResult(target.get()):getFinishedResult(target.get(),results.every((result=>result.finished))),getNoopResult=value=>({value:value,noop:!0,finished:!0,cancelled:!1}),getFinishedResult=(value,finished,cancelled=!1)=>({value:value,finished:finished,cancelled:cancelled}),getCancelledResult=value=>({value:value,cancelled:!0,finished:!1});function runAsync(to,props,state,target){const{callId:callId,parentId:parentId,onRest:onRest}=props,{asyncTo:prevTo,promise:prevPromise}=state;return parentId||to!==prevTo||props.reset?state.promise=(async()=>{state.asyncId=callId,state.asyncTo=to;const defaultProps=getDefaultProps(props,((value,key)=>"onRest"===key?void 0:value));let preventBail,bail;const bailPromise=new Promise(((resolve,reject)=>(preventBail=resolve,bail=reject))),bailIfEnded=bailSignal=>{const bailResult=callId<=(state.cancelId||0)&&getCancelledResult(target)||callId!==state.asyncId&&getFinishedResult(target,!1);if(bailResult)throw bailSignal.result=bailResult,bail(bailSignal),bailSignal},animate=(arg1,arg2)=>{const bailSignal=new BailSignal,skipAnimationSignal=new SkipAnimationSignal;return(async()=>{if(globals.skipAnimation)throw stopAsync(state),skipAnimationSignal.result=getFinishedResult(target,!1),bail(skipAnimationSignal),skipAnimationSignal;bailIfEnded(bailSignal);const props=react_spring_shared_esm_is.obj(arg1)?react_spring_core_esm_extends({},arg1):react_spring_core_esm_extends({},arg2,{to:arg1});props.parentId=callId,eachProp(defaultProps,((value,key)=>{react_spring_shared_esm_is.und(props[key])&&(props[key]=value)}));const result=await target.start(props);return bailIfEnded(bailSignal),state.paused&&await new Promise((resume=>{state.resumeQueue.add(resume)})),result})()};let result;if(globals.skipAnimation)return stopAsync(state),getFinishedResult(target,!1);try{let animating;animating=react_spring_shared_esm_is.arr(to)?(async queue=>{for(const props of queue)await animate(props)})(to):Promise.resolve(to(animate,target.stop.bind(target))),await Promise.all([animating.then(preventBail),bailPromise]),result=getFinishedResult(target.get(),!0,!1)}catch(err){if(err instanceof BailSignal)result=err.result;else{if(!(err instanceof SkipAnimationSignal))throw err;result=err.result}}finally{callId==state.asyncId&&(state.asyncId=parentId,state.asyncTo=parentId?prevTo:void 0,state.promise=parentId?prevPromise:void 0)}return react_spring_shared_esm_is.fun(onRest)&&react_spring_rafz_esm_raf.batchedUpdates((()=>{onRest(result,target,target.item)})),result})():prevPromise}function stopAsync(state,cancelId){flush(state.timeouts,(t=>t.cancel())),state.pauseQueue.clear(),state.resumeQueue.clear(),state.asyncId=state.asyncTo=state.promise=void 0,cancelId&&(state.cancelId=cancelId)}class BailSignal extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class SkipAnimationSignal extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const isFrameValue=value=>value instanceof FrameValue;let nextId$1=1;class FrameValue extends FluidValue{constructor(...args){super(...args),this.id=nextId$1++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(priority){this._priority!=priority&&(this._priority=priority,this._onPriorityChange(priority))}get(){const node=getAnimated(this);return node&&node.getValue()}to(...args){return globals.to(this,args)}interpolate(...args){return function react_spring_shared_esm_deprecateInterpolate(){warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`)}(),globals.to(this,args)}toJSON(){return this.get()}observerAdded(count){1==count&&this._attach()}observerRemoved(count){0==count&&this._detach()}_attach(){}_detach(){}_onChange(value,idle=!1){callFluidObservers(this,{type:"change",parent:this,value:value,idle:idle})}_onPriorityChange(priority){this.idle||frameLoop.sort(this),callFluidObservers(this,{type:"priority",parent:this,priority:priority})}}const $P=Symbol.for("SpringPhase"),hasAnimated=target=>(1&target[$P])>0,isAnimating=target=>(2&target[$P])>0,isPaused=target=>(4&target[$P])>0,setActiveBit=(target,active)=>active?target[$P]|=3:target[$P]&=-3,setPausedBit=(target,paused)=>paused?target[$P]|=4:target[$P]&=-5;class SpringValue extends FrameValue{constructor(arg1,arg2){if(super(),this.key=void 0,this.animation=new Animation,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!react_spring_shared_esm_is.und(arg1)||!react_spring_shared_esm_is.und(arg2)){const props=react_spring_shared_esm_is.obj(arg1)?react_spring_core_esm_extends({},arg1):react_spring_core_esm_extends({},arg2,{from:arg1});react_spring_shared_esm_is.und(props.default)&&(props.default=!0),this.start(props)}}get idle(){return!(isAnimating(this)||this._state.asyncTo)||isPaused(this)}get goal(){return getFluidValue(this.animation.to)}get velocity(){const node=getAnimated(this);return node instanceof AnimatedValue?node.lastVelocity||0:node.getPayload().map((node=>node.lastVelocity||0))}get hasAnimated(){return hasAnimated(this)}get isAnimating(){return isAnimating(this)}get isPaused(){return isPaused(this)}get isDelayed(){return this._state.delayed}advance(dt){let idle=!0,changed=!1;const anim=this.animation;let{config:config,toValues:toValues}=anim;const payload=getPayload(anim.to);!payload&&hasFluidValue(anim.to)&&(toValues=react_spring_shared_esm_toArray(getFluidValue(anim.to))),anim.values.forEach(((node,i)=>{if(node.done)return;const to=node.constructor==AnimatedString?1:payload?payload[i].lastPosition:toValues[i];let finished=anim.immediate,position=to;if(!finished){if(position=node.lastPosition,config.tension<=0)return void(node.done=!0);let elapsed=node.elapsedTime+=dt;const from=anim.fromValues[i],v0=null!=node.v0?node.v0:node.v0=react_spring_shared_esm_is.arr(config.velocity)?config.velocity[i]:config.velocity;let velocity;const precision=config.precision||(from==to?.005:Math.min(1,.001*Math.abs(to-from)));if(react_spring_shared_esm_is.und(config.duration))if(config.decay){const decay=!0===config.decay?.998:config.decay,e=Math.exp(-(1-decay)*elapsed);position=from+v0/(1-decay)*(1-e),finished=Math.abs(node.lastPosition-position)<=precision,velocity=v0*e}else{velocity=null==node.lastVelocity?v0:node.lastVelocity;const restVelocity=config.restVelocity||precision/10,bounceFactor=config.clamp?0:config.bounce,canBounce=!react_spring_shared_esm_is.und(bounceFactor),isGrowing=from==to?node.v0>0:fromrestVelocity,isMoving||(finished=Math.abs(to-position)<=precision,!finished));++n){canBounce&&(isBouncing=position==to||position>to==isGrowing,isBouncing&&(velocity=-velocity*bounceFactor,position=to));velocity+=(1e-6*-config.tension*(position-to)+.001*-config.friction*velocity)/config.mass*step,position+=velocity*step}}else{let p=1;config.duration>0&&(this._memoizedDuration!==config.duration&&(this._memoizedDuration=config.duration,node.durationProgress>0&&(node.elapsedTime=config.duration*node.durationProgress,elapsed=node.elapsedTime+=dt)),p=(config.progress||0)+elapsed/this._memoizedDuration,p=p>1?1:p<0?0:p,node.durationProgress=p),position=from+config.easing(p)*(to-from),velocity=(position-node.lastPosition)/dt,finished=1==p}node.lastVelocity=velocity,Number.isNaN(position)&&(console.warn("Got NaN while animating:",this),finished=!0)}payload&&!payload[i].done&&(finished=!1),finished?node.done=!0:idle=!1,node.setValue(position,config.round)&&(changed=!0)}));const node=getAnimated(this),currVal=node.getValue();if(idle){const finalVal=getFluidValue(anim.to);currVal===finalVal&&!changed||config.decay?changed&&config.decay&&this._onChange(currVal):(node.setValue(finalVal),this._onChange(finalVal)),this._stop()}else changed&&this._onChange(currVal)}set(value){return react_spring_rafz_esm_raf.batchedUpdates((()=>{this._stop(),this._focus(value),this._set(value)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(isAnimating(this)){const{to:to,config:config}=this.animation;react_spring_rafz_esm_raf.batchedUpdates((()=>{this._onStart(),config.decay||this._set(to,!1),this._stop()}))}return this}update(props){return(this.queue||(this.queue=[])).push(props),this}start(to,arg2){let queue;return react_spring_shared_esm_is.und(to)?(queue=this.queue||[],this.queue=[]):queue=[react_spring_shared_esm_is.obj(to)?to:react_spring_core_esm_extends({},arg2,{to:to})],Promise.all(queue.map((props=>this._update(props)))).then((results=>getCombinedResult(this,results)))}stop(cancel){const{to:to}=this.animation;return this._focus(this.get()),stopAsync(this._state,cancel&&this._lastCallId),react_spring_rafz_esm_raf.batchedUpdates((()=>this._stop(to,cancel))),this}reset(){this._update({reset:!0})}eventObserved(event){"change"==event.type?this._start():"priority"==event.type&&(this.priority=event.priority+1)}_prepareNode(props){const key=this.key||"";let{to:to,from:from}=props;to=react_spring_shared_esm_is.obj(to)?to[key]:to,(null==to||isAsyncTo(to))&&(to=void 0),from=react_spring_shared_esm_is.obj(from)?from[key]:from,null==from&&(from=void 0);const range={to:to,from:from};return hasAnimated(this)||(props.reverse&&([to,from]=[from,to]),from=getFluidValue(from),react_spring_shared_esm_is.und(from)?getAnimated(this)||this._set(to):this._set(from)),range}_update(_ref,isLoop){let props=react_spring_core_esm_extends({},_ref);const{key:key,defaultProps:defaultProps}=this;props.default&&Object.assign(defaultProps,getDefaultProps(props,((value,prop)=>/^on/.test(prop)?resolveProp(value,key):value))),mergeActiveFn(this,props,"onProps"),sendEvent(this,"onProps",props,this);const range=this._prepareNode(props);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const state=this._state;return scheduleProps(++this._lastCallId,{key:key,props:props,defaultProps:defaultProps,state:state,actions:{pause:()=>{isPaused(this)||(setPausedBit(this,!0),flushCalls(state.pauseQueue),sendEvent(this,"onPause",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},resume:()=>{isPaused(this)&&(setPausedBit(this,!1),isAnimating(this)&&this._resume(),flushCalls(state.resumeQueue),sendEvent(this,"onResume",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},start:this._merge.bind(this,range)}}).then((result=>{if(props.loop&&result.finished&&(!isLoop||!result.noop)){const nextProps=createLoopUpdate(props);if(nextProps)return this._update(nextProps,!0)}return result}))}_merge(range,props,resolve){if(props.cancel)return this.stop(!0),resolve(getCancelledResult(this));const hasToProp=!react_spring_shared_esm_is.und(range.to),hasFromProp=!react_spring_shared_esm_is.und(range.from);if(hasToProp||hasFromProp){if(!(props.callId>this._lastToId))return resolve(getCancelledResult(this));this._lastToId=props.callId}const{key:key,defaultProps:defaultProps,animation:anim}=this,{to:prevTo,from:prevFrom}=anim;let{to:to=prevTo,from:from=prevFrom}=range;!hasFromProp||hasToProp||props.default&&!react_spring_shared_esm_is.und(to)||(to=from),props.reverse&&([to,from]=[from,to]);const hasFromChanged=!isEqual(from,prevFrom);hasFromChanged&&(anim.from=from),from=getFluidValue(from);const hasToChanged=!isEqual(to,prevTo);hasToChanged&&this._focus(to);const hasAsyncTo=isAsyncTo(props.to),{config:config}=anim,{decay:decay,velocity:velocity}=config;(hasToProp||hasFromProp)&&(config.velocity=0),props.config&&!hasAsyncTo&&function mergeConfig(config,newConfig,defaultConfig){defaultConfig&&(sanitizeConfig(defaultConfig=react_spring_core_esm_extends({},defaultConfig),newConfig),newConfig=react_spring_core_esm_extends({},defaultConfig,newConfig)),sanitizeConfig(config,newConfig),Object.assign(config,newConfig);for(const key in defaults)null==config[key]&&(config[key]=defaults[key]);let{mass:mass,frequency:frequency,damping:damping}=config;return react_spring_shared_esm_is.und(frequency)||(frequency<.01&&(frequency=.01),damping<0&&(damping=0),config.tension=Math.pow(2*Math.PI/frequency,2)*mass,config.friction=4*Math.PI*damping*mass/frequency),config}(config,callProp(props.config,key),props.config!==defaultProps.config?callProp(defaultProps.config,key):void 0);let node=getAnimated(this);if(!node||react_spring_shared_esm_is.und(to))return resolve(getFinishedResult(this,!0));const reset=react_spring_shared_esm_is.und(props.reset)?hasFromProp&&!props.default:!react_spring_shared_esm_is.und(from)&&matchProp(props.reset,key),value=reset?from:this.get(),goal=computeGoal(to),isAnimatable=react_spring_shared_esm_is.num(goal)||react_spring_shared_esm_is.arr(goal)||isAnimatedString(goal),immediate=!hasAsyncTo&&(!isAnimatable||matchProp(defaultProps.immediate||props.immediate,key));if(hasToChanged){const nodeType=getAnimatedType(to);if(nodeType!==node.constructor){if(!immediate)throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`);node=this._set(goal)}}const goalType=node.constructor;let started=hasFluidValue(to),finished=!1;if(!started){const hasValueChanged=reset||!hasAnimated(this)&&hasFromChanged;(hasToChanged||hasValueChanged)&&(finished=isEqual(computeGoal(value),goal),started=!finished),(isEqual(anim.immediate,immediate)||immediate)&&isEqual(config.decay,decay)&&isEqual(config.velocity,velocity)||(started=!0)}if(finished&&isAnimating(this)&&(anim.changed&&!reset?started=!0:started||this._stop(prevTo)),!hasAsyncTo&&((started||hasFluidValue(prevTo))&&(anim.values=node.getPayload(),anim.toValues=hasFluidValue(to)?null:goalType==AnimatedString?[1]:react_spring_shared_esm_toArray(goal)),anim.immediate!=immediate&&(anim.immediate=immediate,immediate||reset||this._set(prevTo)),started)){const{onRest:onRest}=anim;react_spring_shared_esm_each(ACTIVE_EVENTS,(type=>mergeActiveFn(this,props,type)));const result=getFinishedResult(this,checkFinished(this,prevTo));flushCalls(this._pendingCalls,result),this._pendingCalls.add(resolve),anim.changed&&react_spring_rafz_esm_raf.batchedUpdates((()=>{anim.changed=!reset,null==onRest||onRest(result,this),reset?callProp(defaultProps.onRest,result):null==anim.onStart||anim.onStart(result,this)}))}reset&&this._set(value),hasAsyncTo?resolve(runAsync(props.to,props,this._state,this)):started?this._start():isAnimating(this)&&!hasToChanged?this._pendingCalls.add(resolve):resolve(getNoopResult(value))}_focus(value){const anim=this.animation;value!==anim.to&&(getFluidObservers(this)&&this._detach(),anim.to=value,getFluidObservers(this)&&this._attach())}_attach(){let priority=0;const{to:to}=this.animation;hasFluidValue(to)&&(addFluidObserver(to,this),isFrameValue(to)&&(priority=to.priority+1)),this.priority=priority}_detach(){const{to:to}=this.animation;hasFluidValue(to)&&removeFluidObserver(to,this)}_set(arg,idle=!0){const value=getFluidValue(arg);if(!react_spring_shared_esm_is.und(value)){const oldNode=getAnimated(this);if(!oldNode||!isEqual(value,oldNode.getValue())){const nodeType=getAnimatedType(value);oldNode&&oldNode.constructor==nodeType?oldNode.setValue(value):setAnimated(this,nodeType.create(value)),oldNode&&react_spring_rafz_esm_raf.batchedUpdates((()=>{this._onChange(value,idle)}))}}return getAnimated(this)}_onStart(){const anim=this.animation;anim.changed||(anim.changed=!0,sendEvent(this,"onStart",getFinishedResult(this,checkFinished(this,anim.to)),this))}_onChange(value,idle){idle||(this._onStart(),callProp(this.animation.onChange,value,this)),callProp(this.defaultProps.onChange,value,this),super._onChange(value,idle)}_start(){const anim=this.animation;getAnimated(this).reset(getFluidValue(anim.to)),anim.immediate||(anim.fromValues=anim.values.map((node=>node.lastPosition))),isAnimating(this)||(setActiveBit(this,!0),isPaused(this)||this._resume())}_resume(){globals.skipAnimation?this.finish():frameLoop.start(this)}_stop(goal,cancel){if(isAnimating(this)){setActiveBit(this,!1);const anim=this.animation;react_spring_shared_esm_each(anim.values,(node=>{node.done=!0})),anim.toValues&&(anim.onChange=anim.onPause=anim.onResume=void 0),callFluidObservers(this,{type:"idle",parent:this});const result=cancel?getCancelledResult(this.get()):getFinishedResult(this.get(),checkFinished(this,null!=goal?goal:anim.to));flushCalls(this._pendingCalls,result),anim.changed&&(anim.changed=!1,sendEvent(this,"onRest",result,this))}}}function checkFinished(target,to){const goal=computeGoal(to);return isEqual(computeGoal(target.get()),goal)}function createLoopUpdate(props,loop=props.loop,to=props.to){let loopRet=callProp(loop);if(loopRet){const overrides=!0!==loopRet&&inferTo(loopRet),reverse=(overrides||props).reverse,reset=!overrides||overrides.reset;return createUpdate(react_spring_core_esm_extends({},props,{loop:loop,default:!1,pause:void 0,to:!reverse||isAsyncTo(to)?to:void 0,from:reset?props.from:void 0,reset:reset},overrides))}}function createUpdate(props){const{to:to,from:from}=props=inferTo(props),keys=new Set;return react_spring_shared_esm_is.obj(to)&&findDefined(to,keys),react_spring_shared_esm_is.obj(from)&&findDefined(from,keys),props.keys=keys.size?Array.from(keys):null,props}function declareUpdate(props){const update=createUpdate(props);return react_spring_shared_esm_is.und(update.default)&&(update.default=getDefaultProps(update)),update}function findDefined(values,keys){eachProp(values,((value,key)=>null!=value&&keys.add(key)))}const ACTIVE_EVENTS=["onStart","onRest","onChange","onPause","onResume"];function mergeActiveFn(target,props,type){target.animation[type]=props[type]!==getDefaultProp(props,type)?resolveProp(props[type],target.key):void 0}function sendEvent(target,type,...args){var _target$animation$typ,_target$animation,_target$defaultProps$,_target$defaultProps;null==(_target$animation$typ=(_target$animation=target.animation)[type])||_target$animation$typ.call(_target$animation,...args),null==(_target$defaultProps$=(_target$defaultProps=target.defaultProps)[type])||_target$defaultProps$.call(_target$defaultProps,...args)}const BATCHED_EVENTS=["onStart","onChange","onRest"];let nextId=1;class Controller{constructor(props,flush){this.id=nextId++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),flush&&(this._flush=flush),props&&this.start(react_spring_core_esm_extends({default:!0},props))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((spring=>spring.idle&&!spring.isDelayed&&!spring.isPaused))}get item(){return this._item}set item(item){this._item=item}get(){const values={};return this.each(((spring,key)=>values[key]=spring.get())),values}set(values){for(const key in values){const value=values[key];react_spring_shared_esm_is.und(value)||this.springs[key].set(value)}}update(props){return props&&this.queue.push(createUpdate(props)),this}start(props){let{queue:queue}=this;return props?queue=react_spring_shared_esm_toArray(props).map(createUpdate):this.queue=[],this._flush?this._flush(this,queue):(prepareKeys(this,queue),flushUpdateQueue(this,queue))}stop(arg,keys){if(arg!==!!arg&&(keys=arg),keys){const springs=this.springs;react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys),(key=>springs[key].stop(!!arg)))}else stopAsync(this._state,this._lastAsyncId),this.each((spring=>spring.stop(!!arg)));return this}pause(keys){if(react_spring_shared_esm_is.und(keys))this.start({pause:!0});else{const springs=this.springs;react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys),(key=>springs[key].pause()))}return this}resume(keys){if(react_spring_shared_esm_is.und(keys))this.start({pause:!1});else{const springs=this.springs;react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys),(key=>springs[key].resume()))}return this}each(iterator){eachProp(this.springs,iterator)}_onFrame(){const{onStart:onStart,onChange:onChange,onRest:onRest}=this._events,active=this._active.size>0,changed=this._changed.size>0;(active&&!this._started||changed&&!this._started)&&(this._started=!0,flush(onStart,(([onStart,result])=>{result.value=this.get(),onStart(result,this,this._item)})));const idle=!active&&this._started,values=changed||idle&&onRest.size?this.get():null;changed&&onChange.size&&flush(onChange,(([onChange,result])=>{result.value=values,onChange(result,this,this._item)})),idle&&(this._started=!1,flush(onRest,(([onRest,result])=>{result.value=values,onRest(result,this,this._item)})))}eventObserved(event){if("change"==event.type)this._changed.add(event.parent),event.idle||this._active.add(event.parent);else{if("idle"!=event.type)return;this._active.delete(event.parent)}react_spring_rafz_esm_raf.onFrame(this._onFrame)}}function flushUpdateQueue(ctrl,queue){return Promise.all(queue.map((props=>flushUpdate(ctrl,props)))).then((results=>getCombinedResult(ctrl,results)))}async function flushUpdate(ctrl,props,isLoop){const{keys:keys,to:to,from:from,loop:loop,onRest:onRest,onResolve:onResolve}=props,defaults=react_spring_shared_esm_is.obj(props.default)&&props.default;loop&&(props.loop=!1),!1===to&&(props.to=null),!1===from&&(props.from=null);const asyncTo=react_spring_shared_esm_is.arr(to)||react_spring_shared_esm_is.fun(to)?to:void 0;asyncTo?(props.to=void 0,props.onRest=void 0,defaults&&(defaults.onRest=void 0)):react_spring_shared_esm_each(BATCHED_EVENTS,(key=>{const handler=props[key];if(react_spring_shared_esm_is.fun(handler)){const queue=ctrl._events[key];props[key]=({finished:finished,cancelled:cancelled})=>{const result=queue.get(handler);result?(finished||(result.finished=!1),cancelled&&(result.cancelled=!0)):queue.set(handler,{value:null,finished:finished||!1,cancelled:cancelled||!1})},defaults&&(defaults[key]=props[key])}}));const state=ctrl._state;props.pause===!state.paused?(state.paused=props.pause,flushCalls(props.pause?state.pauseQueue:state.resumeQueue)):state.paused&&(props.pause=!0);const promises=(keys||Object.keys(ctrl.springs)).map((key=>ctrl.springs[key].start(props))),cancel=!0===props.cancel||!0===getDefaultProp(props,"cancel");(asyncTo||cancel&&state.asyncId)&&promises.push(scheduleProps(++ctrl._lastAsyncId,{props:props,state:state,actions:{pause:noop,resume:noop,start(props,resolve){cancel?(stopAsync(state,ctrl._lastAsyncId),resolve(getCancelledResult(ctrl))):(props.onRest=onRest,resolve(runAsync(asyncTo,props,state,ctrl)))}}})),state.paused&&await new Promise((resume=>{state.resumeQueue.add(resume)}));const result=getCombinedResult(ctrl,await Promise.all(promises));if(loop&&result.finished&&(!isLoop||!result.noop)){const nextProps=createLoopUpdate(props,loop,to);if(nextProps)return prepareKeys(ctrl,[nextProps]),flushUpdate(ctrl,nextProps,!0)}return onResolve&&react_spring_rafz_esm_raf.batchedUpdates((()=>onResolve(result,ctrl,ctrl.item))),result}function getSprings(ctrl,props){const springs=react_spring_core_esm_extends({},ctrl.springs);return props&&react_spring_shared_esm_each(react_spring_shared_esm_toArray(props),(props=>{react_spring_shared_esm_is.und(props.keys)&&(props=createUpdate(props)),react_spring_shared_esm_is.obj(props.to)||(props=react_spring_core_esm_extends({},props,{to:void 0})),prepareSprings(springs,props,(key=>createSpring(key)))})),setSprings(ctrl,springs),springs}function setSprings(ctrl,springs){eachProp(springs,((spring,key)=>{ctrl.springs[key]||(ctrl.springs[key]=spring,addFluidObserver(spring,ctrl))}))}function createSpring(key,observer){const spring=new SpringValue;return spring.key=key,observer&&addFluidObserver(spring,observer),spring}function prepareSprings(springs,props,create){props.keys&&react_spring_shared_esm_each(props.keys,(key=>{(springs[key]||(springs[key]=create(key)))._prepareNode(props)}))}function prepareKeys(ctrl,queue){react_spring_shared_esm_each(queue,(props=>{prepareSprings(ctrl.springs,props,(key=>createSpring(key,ctrl)))}))}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}const _excluded$6=["children"],SpringContext=_ref=>{let{children:children}=_ref,props=_objectWithoutPropertiesLoose(_ref,_excluded$6);const inherited=(0,react.useContext)(ctx),pause=props.pause||!!inherited.pause,immediate=props.immediate||!!inherited.immediate;props=function useMemoOne(getResult,inputs){const[initial]=(0,react.useState)((()=>({inputs:inputs,result:getResult()}))),committed=(0,react.useRef)(),prevCache=committed.current;let cache=prevCache;cache?Boolean(inputs&&cache.inputs&&function areInputsEqual(next,prev){if(next.length!==prev.length)return!1;for(let i=0;i{committed.current=cache,prevCache==initial&&(initial.inputs=initial.result=void 0)}),[cache]),cache.result}((()=>({pause:pause,immediate:immediate})),[pause,immediate]);const{Provider:Provider}=ctx;return react.createElement(Provider,{value:props},children)},ctx=function makeContext(target,init){return Object.assign(target,react.createContext(init)),target.Provider._context=target,target.Consumer._context=target,target}(SpringContext,{});SpringContext.Provider=ctx.Provider,SpringContext.Consumer=ctx.Consumer;const SpringRef=()=>{const current=[],SpringRef=function SpringRef(props){!function deprecateDirectCall(){warnDirectCall(`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}();const results=[];return react_spring_shared_esm_each(current,((ctrl,i)=>{if(react_spring_shared_esm_is.und(props))results.push(ctrl.start());else{const update=_getProps(props,ctrl,i);update&&results.push(ctrl.start(update))}})),results};SpringRef.current=current,SpringRef.add=function(ctrl){current.includes(ctrl)||current.push(ctrl)},SpringRef.delete=function(ctrl){const i=current.indexOf(ctrl);~i&¤t.splice(i,1)},SpringRef.pause=function(){return react_spring_shared_esm_each(current,(ctrl=>ctrl.pause(...arguments))),this},SpringRef.resume=function(){return react_spring_shared_esm_each(current,(ctrl=>ctrl.resume(...arguments))),this},SpringRef.set=function(values){react_spring_shared_esm_each(current,(ctrl=>ctrl.set(values)))},SpringRef.start=function(props){const results=[];return react_spring_shared_esm_each(current,((ctrl,i)=>{if(react_spring_shared_esm_is.und(props))results.push(ctrl.start());else{const update=this._getProps(props,ctrl,i);update&&results.push(ctrl.start(update))}})),results},SpringRef.stop=function(){return react_spring_shared_esm_each(current,(ctrl=>ctrl.stop(...arguments))),this},SpringRef.update=function(props){return react_spring_shared_esm_each(current,((ctrl,i)=>ctrl.update(this._getProps(props,ctrl,i)))),this};const _getProps=function _getProps(arg,ctrl,index){return react_spring_shared_esm_is.fun(arg)?arg(index,ctrl):arg};return SpringRef._getProps=_getProps,SpringRef};function useSprings(length,props,deps){const propsFn=react_spring_shared_esm_is.fun(props)&&props;propsFn&&!deps&&(deps=[]);const ref=(0,react.useMemo)((()=>propsFn||3==arguments.length?SpringRef():void 0),[]),layoutId=(0,react.useRef)(0),forceUpdate=react_spring_shared_esm_useForceUpdate(),state=(0,react.useMemo)((()=>({ctrls:[],queue:[],flush(ctrl,updates){const springs=getSprings(ctrl,updates);return layoutId.current>0&&!state.queue.length&&!Object.keys(springs).some((key=>!ctrl.springs[key]))?flushUpdateQueue(ctrl,updates):new Promise((resolve=>{setSprings(ctrl,springs),state.queue.push((()=>{resolve(flushUpdateQueue(ctrl,updates))})),forceUpdate()}))}})),[]),ctrls=(0,react.useRef)([...state.ctrls]),updates=[],prevLength=react_spring_shared_esm_usePrev(length)||0;function declareUpdates(startIndex,endIndex){for(let i=startIndex;i{react_spring_shared_esm_each(ctrls.current.slice(length,prevLength),(ctrl=>{detachRefs(ctrl,ref),ctrl.stop(!0)})),ctrls.current.length=length,declareUpdates(prevLength,length)}),[length]),(0,react.useMemo)((()=>{declareUpdates(0,Math.min(prevLength,length))}),deps);const springs=ctrls.current.map(((ctrl,i)=>getSprings(ctrl,updates[i]))),context=(0,react.useContext)(SpringContext),prevContext=react_spring_shared_esm_usePrev(context),hasContext=context!==prevContext&&hasProps(context);react_spring_shared_esm_useIsomorphicLayoutEffect((()=>{layoutId.current++,state.ctrls=ctrls.current;const{queue:queue}=state;queue.length&&(state.queue=[],react_spring_shared_esm_each(queue,(cb=>cb()))),react_spring_shared_esm_each(ctrls.current,((ctrl,i)=>{null==ref||ref.add(ctrl),hasContext&&ctrl.start({default:context});const update=updates[i];update&&(replaceRef(ctrl,update.ref),ctrl.ref?ctrl.queue.push(update):ctrl.start(update))}))})),react_spring_shared_esm_useOnce((()=>()=>{react_spring_shared_esm_each(state.ctrls,(ctrl=>ctrl.stop(!0)))}));const values=springs.map((x=>react_spring_core_esm_extends({},x)));return ref?[values,ref]:values}function useSpring(props,deps){const isFn=react_spring_shared_esm_is.fun(props),[[values],ref]=useSprings(1,isFn?props:[props],isFn?deps||[]:deps);return isFn||2==arguments.length?[values,ref]:values}let TransitionPhase;!function(TransitionPhase){TransitionPhase.MOUNT="mount",TransitionPhase.ENTER="enter",TransitionPhase.UPDATE="update",TransitionPhase.LEAVE="leave"}(TransitionPhase||(TransitionPhase={}));class Interpolation extends FrameValue{constructor(source,args){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=source,this.calc=createInterpolator(...args);const value=this._get(),nodeType=getAnimatedType(value);setAnimated(this,nodeType.create(value))}advance(_dt){const value=this._get();isEqual(value,this.get())||(getAnimated(this).setValue(value),this._onChange(value,this.idle)),!this.idle&&checkIdle(this._active)&&becomeIdle(this)}_get(){const inputs=react_spring_shared_esm_is.arr(this.source)?this.source.map(getFluidValue):react_spring_shared_esm_toArray(getFluidValue(this.source));return this.calc(...inputs)}_start(){this.idle&&!checkIdle(this._active)&&(this.idle=!1,react_spring_shared_esm_each(getPayload(this),(node=>{node.done=!1})),globals.skipAnimation?(react_spring_rafz_esm_raf.batchedUpdates((()=>this.advance())),becomeIdle(this)):frameLoop.start(this))}_attach(){let priority=1;react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source),(source=>{hasFluidValue(source)&&addFluidObserver(source,this),isFrameValue(source)&&(source.idle||this._active.add(source),priority=Math.max(priority,source.priority+1))})),this.priority=priority,this._start()}_detach(){react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source),(source=>{hasFluidValue(source)&&removeFluidObserver(source,this)})),this._active.clear(),becomeIdle(this)}eventObserved(event){"change"==event.type?event.idle?this.advance():(this._active.add(event.parent),this._start()):"idle"==event.type?this._active.delete(event.parent):"priority"==event.type&&(this.priority=react_spring_shared_esm_toArray(this.source).reduce(((highest,parent)=>Math.max(highest,(isFrameValue(parent)?parent.priority:0)+1)),0))}}function isIdle(source){return!1!==source.idle}function checkIdle(active){return!active.size||Array.from(active).every(isIdle)}function becomeIdle(self){self.idle||(self.idle=!0,react_spring_shared_esm_each(getPayload(self),(node=>{node.done=!0})),callFluidObservers(self,{type:"idle",parent:self}))}globals.assign({createStringInterpolator:createStringInterpolator,to:(source,args)=>new Interpolation(source,args)});frameLoop.advance;const primitives=["primitive"].concat(Object.keys(three_module).filter((key=>/^[A-Z]/.test(key))).map((key=>key[0].toLowerCase()+key.slice(1))));globals.assign({createStringInterpolator:createStringInterpolator,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},frameLoop:"demand"}),(0,index_673ef987_esm.n)((()=>{react_spring_rafz_esm_raf.advance()}));const host=((components,{applyAnimatedValues:_applyAnimatedValues=(()=>!1),createAnimatedStyle:_createAnimatedStyle=(style=>new AnimatedObject(style)),getComponentProps:_getComponentProps=(props=>props)}={})=>{const hostConfig={applyAnimatedValues:_applyAnimatedValues,createAnimatedStyle:_createAnimatedStyle,getComponentProps:_getComponentProps},animated=Component=>{const displayName=getDisplayName(Component)||"Anonymous";return(Component=react_spring_shared_esm_is.str(Component)?animated[Component]||(animated[Component]=withAnimated(Component,hostConfig)):Component[cacheKey]||(Component[cacheKey]=withAnimated(Component,hostConfig))).displayName=`Animated(${displayName})`,Component};return eachProp(components,((Component,key)=>{react_spring_shared_esm_is.arr(components)&&(key=getDisplayName(Component)),animated[key]=animated(Component)})),{animated:animated}})(primitives,{applyAnimatedValues:index_673ef987_esm.j}),animated=host.animated;const V={toVector(v,fallback){return void 0===v&&(v=fallback),Array.isArray(v)?v:[v,v]},add(v1,v2){return[v1[0]+v2[0],v1[1]+v2[1]]},sub(v1,v2){return[v1[0]-v2[0],v1[1]-v2[1]]},addTo(v1,v2){v1[0]+=v2[0],v1[1]+=v2[1]},subTo(v1,v2){v1[0]-=v2[0],v1[1]-=v2[1]}};function rubberband(distance,dimension,constant){return 0===dimension||Math.abs(dimension)===1/0?Math.pow(distance,5*constant):distance*dimension*constant/(dimension+constant*distance)}function rubberbandIfOutOfBounds(position,min,max,constant=.15){return 0===constant?function maths_0ab39ae9_esm_clamp(v,min,max){return Math.max(min,Math.min(v,max))}(position,min,max):positionmax?+rubberband(position-max,max-min,constant)+max:position}function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}function _defineProperty(obj,key,value){return(key=_toPropertyKey(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i{var _event$currentTarget,_event$currentTarget$;return e.target===event.currentTarget||(null===(_event$currentTarget=event.currentTarget)||void 0===_event$currentTarget||null===(_event$currentTarget$=_event$currentTarget.contains)||void 0===_event$currentTarget$?void 0:_event$currentTarget$.call(_event$currentTarget,e.target))}))}(event).map((touch=>touch.identifier))}function touchDistanceAngle(event,ids){const[P1,P2]=Array.from(event.touches).filter((touch=>ids.includes(touch.identifier)));return distanceAngle(P1,P2)}function pointerId(event){const valueEvent=getValueEvent(event);return isTouch(event)?valueEvent.identifier:valueEvent.pointerId}function pointerValues(event){const valueEvent=getValueEvent(event);return[valueEvent.clientX,valueEvent.clientY]}function wheelValues(event){let{deltaX:deltaX,deltaY:deltaY,deltaMode:deltaMode}=event;return 1===deltaMode?(deltaX*=40,deltaY*=40):2===deltaMode&&(deltaX*=800,deltaY*=800),[deltaX,deltaY]}function actions_76b8683e_esm_call(v,...args){return"function"==typeof v?v(...args):v}function actions_76b8683e_esm_noop(){}function chain(...fns){return 0===fns.length?actions_76b8683e_esm_noop:1===fns.length?fns[0]:function(){let result;for(const fn of fns)result=fn.apply(this,arguments)||result;return result}}function assignDefault(value,fallback){return Object.assign({},fallback,value||{})}class Engine{constructor(ctrl,args,key){this.ctrl=ctrl,this.args=args,this.key=key,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(state){this.ctrl.state[this.key]=state}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:state,shared:shared,ingKey:ingKey,args:args}=this;shared[ingKey]=state._active=state.active=state._blocked=state._force=!1,state._step=[!1,!1],state.intentional=!1,state._movement=[0,0],state._distance=[0,0],state._direction=[0,0],state._delta=[0,0],state._bounds=[[-1/0,1/0],[-1/0,1/0]],state.args=args,state.axis=void 0,state.memo=void 0,state.elapsedTime=state.timeDelta=0,state.direction=[0,0],state.distance=[0,0],state.overflow=[0,0],state._movementBound=[!1,!1],state.velocity=[0,0],state.movement=[0,0],state.delta=[0,0],state.timeStamp=0}start(event){const state=this.state,config=this.config;state._active||(this.reset(),this.computeInitial(),state._active=!0,state.target=event.target,state.currentTarget=event.currentTarget,state.lastOffset=config.from?actions_76b8683e_esm_call(config.from,state):state.offset,state.offset=state.lastOffset,state.startTime=state.timeStamp=event.timeStamp)}computeValues(values){const state=this.state;state._values=values,state.values=this.config.transform(values)}computeInitial(){const state=this.state;state._initial=state._values,state.initial=state.values}compute(event){const{state:state,config:config,shared:shared}=this;state.args=this.args;let dt=0;if(event&&(state.event=event,config.preventDefault&&event.cancelable&&state.event.preventDefault(),state.type=event.type,shared.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,shared.locked=!!document.pointerLockElement,Object.assign(shared,function getEventDetails(event){const payload={};if("buttons"in event&&(payload.buttons=event.buttons),"shiftKey"in event){const{shiftKey:shiftKey,altKey:altKey,metaKey:metaKey,ctrlKey:ctrlKey}=event;Object.assign(payload,{shiftKey:shiftKey,altKey:altKey,metaKey:metaKey,ctrlKey:ctrlKey})}return payload}(event)),shared.down=shared.pressed=shared.buttons%2==1||shared.touches>0,dt=event.timeStamp-state.timeStamp,state.timeStamp=event.timeStamp,state.elapsedTime=state.timeStamp-state.startTime),state._active){const _absoluteDelta=state._delta.map(Math.abs);V.addTo(state._distance,_absoluteDelta)}this.axisIntent&&this.axisIntent(event);const[_m0,_m1]=state._movement,[t0,t1]=config.threshold,{_step:_step,values:values}=state;if(config.hasCustomTransform?(!1===_step[0]&&(_step[0]=Math.abs(_m0)>=t0&&values[0]),!1===_step[1]&&(_step[1]=Math.abs(_m1)>=t1&&values[1])):(!1===_step[0]&&(_step[0]=Math.abs(_m0)>=t0&&Math.sign(_m0)*t0),!1===_step[1]&&(_step[1]=Math.abs(_m1)>=t1&&Math.sign(_m1)*t1)),state.intentional=!1!==_step[0]||!1!==_step[1],!state.intentional)return;const movement=[0,0];if(config.hasCustomTransform){const[v0,v1]=values;movement[0]=!1!==_step[0]?v0-_step[0]:0,movement[1]=!1!==_step[1]?v1-_step[1]:0}else movement[0]=!1!==_step[0]?_m0-_step[0]:0,movement[1]=!1!==_step[1]?_m1-_step[1]:0;this.restrictToAxis&&!state._blocked&&this.restrictToAxis(movement);const previousOffset=state.offset,gestureIsActive=state._active&&!state._blocked||state.active;gestureIsActive&&(state.first=state._active&&!state.active,state.last=!state._active&&state.active,state.active=shared[this.ingKey]=state._active,event&&(state.first&&("bounds"in config&&(state._bounds=actions_76b8683e_esm_call(config.bounds,state)),this.setup&&this.setup()),state.movement=movement,this.computeOffset()));const[ox,oy]=state.offset,[[x0,x1],[y0,y1]]=state._bounds;state.overflow=[oxx1?1:0,oyy1?1:0],state._movementBound[0]=!!state.overflow[0]&&(!1===state._movementBound[0]?state._movement[0]:state._movementBound[0]),state._movementBound[1]=!!state.overflow[1]&&(!1===state._movementBound[1]?state._movement[1]:state._movementBound[1]);const rubberband=state._active&&config.rubberband||[0,0];if(state.offset=function computeRubberband(bounds,[Vx,Vy],[Rx,Ry]){const[[X0,X1],[Y0,Y1]]=bounds;return[rubberbandIfOutOfBounds(Vx,X0,X1,Rx),rubberbandIfOutOfBounds(Vy,Y0,Y1,Ry)]}(state._bounds,state.offset,rubberband),state.delta=V.sub(state.offset,previousOffset),this.computeMovement(),gestureIsActive&&(!state.last||dt>32)){state.delta=V.sub(state.offset,previousOffset);const absoluteDelta=state.delta.map(Math.abs);V.addTo(state.distance,absoluteDelta),state.direction=state.delta.map(Math.sign),state._direction=state._delta.map(Math.sign),!state.first&&dt>0&&(state.velocity=[absoluteDelta[0]/dt,absoluteDelta[1]/dt],state.timeDelta=dt)}}emit(){const state=this.state,shared=this.shared,config=this.config;if(state._active||this.clean(),(state._blocked||!state.intentional)&&!state._force&&!config.triggerAllEvents)return;const memo=this.handler(_objectSpread2(_objectSpread2(_objectSpread2({},shared),state),{},{[this.aliasKey]:state.values}));void 0!==memo&&(state.memo=memo)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class CoordinatesEngine extends Engine{constructor(...args){super(...args),_defineProperty(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V.sub(this.state.offset,this.state.lastOffset)}axisIntent(event){const state=this.state,config=this.config;if(!state.axis&&event){const threshold="object"==typeof config.axisThreshold?config.axisThreshold[getPointerType(event)]:config.axisThreshold;state.axis=function selectAxis([dx,dy],threshold){const absDx=Math.abs(dx),absDy=Math.abs(dy);return absDx>absDy&&absDx>threshold?"x":absDy>absDx&&absDy>threshold?"y":void 0}(state._movement,threshold)}state._blocked=(config.lockDirection||!!config.axis)&&!state.axis||!!config.axis&&config.axis!==state.axis}restrictToAxis(v){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":v[1]=0;break;case"y":v[0]=0}}}const identity=v=>v,commonConfigResolver={enabled(value=!0){return value},eventOptions(value,_k,config){return _objectSpread2(_objectSpread2({},config.shared.eventOptions),value)},preventDefault(value=!1){return value},triggerAllEvents(value=!1){return value},rubberband(value=0){switch(value){case!0:return[.15,.15];case!1:return[0,0];default:return V.toVector(value)}},from(value){return"function"==typeof value?value:null!=value?V.toVector(value):void 0},transform(value,_k,config){const transform=value||config.shared.transform;return this.hasCustomTransform=!!transform,transform||identity},threshold(value){return V.toVector(value,0)}};const coordinatesConfigResolver=_objectSpread2(_objectSpread2({},commonConfigResolver),{},{axis(_v,_k,{axis:axis}){if(this.lockDirection="lock"===axis,!this.lockDirection)return axis},axisThreshold(value=0){return value},bounds(value={}){if("function"==typeof value)return state=>coordinatesConfigResolver.bounds(value(state));if("current"in value)return()=>value.current;if("function"==typeof HTMLElement&&value instanceof HTMLElement)return value;const{left:left=-1/0,right:right=1/0,top:top=-1/0,bottom:bottom=1/0}=value;return[[left,right],[top,bottom]]}}),KEYS_DELTA_MAP={ArrowRight:(displacement,factor=1)=>[displacement*factor,0],ArrowLeft:(displacement,factor=1)=>[-1*displacement*factor,0],ArrowUp:(displacement,factor=1)=>[0,-1*displacement*factor],ArrowDown:(displacement,factor=1)=>[0,displacement*factor]};const isBrowser="undefined"!=typeof window&&window.document&&window.document.createElement;function isTouchScreen(){return function supportsTouchEvents(){return isBrowser&&"ontouchstart"in window}()||isBrowser&&window.navigator.maxTouchPoints>1}const SUPPORT={isBrowser:isBrowser,gesture:function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:isTouchScreen(),touchscreen:isTouchScreen(),pointer:function supportsPointerEvents(){return isBrowser&&"onpointerdown"in window}(),pointerLock:function supportsPointerLock(){return isBrowser&&"exitPointerLock"in window.document}()},DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{device(_v,_k,{pointer:{touch:touch=!1,lock:lock=!1,mouse:mouse=!1}={}}){return this.pointerLock=lock&&SUPPORT.pointerLock,SUPPORT.touch&&touch?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!mouse?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(value,_k,{preventScroll:preventScroll}){if(this.preventScrollDelay="number"==typeof preventScroll?preventScroll:preventScroll||void 0===preventScroll&&value?250:void 0,SUPPORT.touchscreen&&!1!==preventScroll)return value||(void 0!==preventScroll?"y":void 0)},pointerCapture(_v,_k,{pointer:{capture:capture=!0,buttons:buttons=1,keys:keys=!0}={}}){return this.pointerButtons=buttons,this.keys=keys,!this.pointerLock&&"pointer"===this.device&&capture},threshold(value,_k,{filterTaps:filterTaps=!1,tapsThreshold:tapsThreshold=3,axis:axis}){const threshold=V.toVector(value,filterTaps?tapsThreshold:axis?1:0);return this.filterTaps=filterTaps,this.tapsThreshold=tapsThreshold,threshold},swipe({velocity:velocity=.5,distance:distance=50,duration:duration=250}={}){return{velocity:this.transform(V.toVector(velocity)),distance:this.transform(V.toVector(distance)),duration:duration}},delay(value=0){switch(value){case!0:return 180;case!1:return 0;default:return value}},axisThreshold(value){return value?_objectSpread2(_objectSpread2({},DEFAULT_DRAG_AXIS_THRESHOLD),value):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(value=10){return value}});function clampStateInternalMovementToBounds(state){const[ox,oy]=state.overflow,[dx,dy]=state._delta,[dirx,diry]=state._direction;(ox<0&&dx>0&&dirx<0||ox>0&&dx<0&&dirx>0)&&(state._movement[0]=state._movementBound[0]),(oy<0&&dy>0&&diry<0||oy>0&&dy<0&&diry>0)&&(state._movement[1]=state._movementBound[1])}const pinchConfigResolver=_objectSpread2(_objectSpread2({},commonConfigResolver),{},{device(_v,_k,{shared:shared,pointer:{touch:touch=!1}={}}){if(shared.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&touch)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(_v,_k,{scaleBounds:scaleBounds={},angleBounds:angleBounds={}}){const _scaleBounds=state=>{const D=assignDefault(actions_76b8683e_esm_call(scaleBounds,state),{min:-1/0,max:1/0});return[D.min,D.max]},_angleBounds=state=>{const A=assignDefault(actions_76b8683e_esm_call(angleBounds,state),{min:-1/0,max:1/0});return[A.min,A.max]};return"function"!=typeof scaleBounds&&"function"!=typeof angleBounds?[_scaleBounds(),_angleBounds()]:state=>[_scaleBounds(state),_angleBounds(state)]},threshold(value,_k,config){this.lockDirection="lock"===config.axis;return V.toVector(value,this.lockDirection?[.1,3]:0)},modifierKey(value){return void 0===value?"ctrlKey":value},pinchOnWheel(value=!0){return value}});const moveConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(value=!0)=>value});const scrollConfigResolver=coordinatesConfigResolver;const wheelConfigResolver=coordinatesConfigResolver;const hoverConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(value=!0)=>value}),EngineMap=new Map,ConfigResolverMap=new Map;function actions_76b8683e_esm_registerAction(action){EngineMap.set(action.key,action.engine),ConfigResolverMap.set(action.key,action.resolver)}const actions_76b8683e_esm_dragAction={key:"drag",engine:class DragEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","dragging")}reset(){super.reset();const state=this.state;state._pointerId=void 0,state._pointerActive=!1,state._keyboardActive=!1,state._preventScroll=!1,state._delayed=!1,state.swipe=[0,0],state.tap=!1,state.canceled=!1,state.cancel=this.cancel.bind(this)}setup(){const state=this.state;if(state._bounds instanceof HTMLElement){const boundRect=state._bounds.getBoundingClientRect(),targetRect=state.currentTarget.getBoundingClientRect(),_bounds={left:boundRect.left-targetRect.left+state.offset[0],right:boundRect.right-targetRect.right+state.offset[0],top:boundRect.top-targetRect.top+state.offset[1],bottom:boundRect.bottom-targetRect.bottom+state.offset[1]};state._bounds=coordinatesConfigResolver.bounds(_bounds)}}cancel(){const state=this.state;state.canceled||(state.canceled=!0,state._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(event){const config=this.config,state=this.state;if(null!=event.buttons&&(Array.isArray(config.pointerButtons)?!config.pointerButtons.includes(event.buttons):-1!==config.pointerButtons&&config.pointerButtons!==event.buttons))return;const ctrlIds=this.ctrl.setEventIds(event);config.pointerCapture&&event.target.setPointerCapture(event.pointerId),ctrlIds&&ctrlIds.size>1&&state._pointerActive||(this.start(event),this.setupPointer(event),state._pointerId=pointerId(event),state._pointerActive=!0,this.computeValues(pointerValues(event)),this.computeInitial(),config.preventScrollAxis&&"mouse"!==getPointerType(event)?(state._active=!1,this.setupScrollPrevention(event)):config.delay>0?(this.setupDelayTrigger(event),config.triggerAllEvents&&(this.compute(event),this.emit())):this.startPointerDrag(event))}startPointerDrag(event){const state=this.state;state._active=!0,state._preventScroll=!0,state._delayed=!1,this.compute(event),this.emit()}pointerMove(event){const state=this.state,config=this.config;if(!state._pointerActive)return;const id=pointerId(event);if(void 0!==state._pointerId&&id!==state._pointerId)return;const _values=pointerValues(event);return document.pointerLockElement===event.target?state._delta=[event.movementX,event.movementY]:(state._delta=V.sub(_values,state._values),this.computeValues(_values)),V.addTo(state._movement,state._delta),this.compute(event),state._delayed&&state.intentional?(this.timeoutStore.remove("dragDelay"),state.active=!1,void this.startPointerDrag(event)):config.preventScrollAxis&&!state._preventScroll?state.axis?state.axis===config.preventScrollAxis||"xy"===config.preventScrollAxis?(state._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(event)):void 0:void this.emit()}pointerUp(event){this.ctrl.setEventIds(event);try{this.config.pointerCapture&&event.target.hasPointerCapture(event.pointerId)&&event.target.releasePointerCapture(event.pointerId)}catch(_unused){0}const state=this.state,config=this.config;if(!state._active||!state._pointerActive)return;const id=pointerId(event);if(void 0!==state._pointerId&&id!==state._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(event);const[dx,dy]=state._distance;if(state.tap=dx<=config.tapsThreshold&&dy<=config.tapsThreshold,state.tap&&config.filterTaps)state._force=!0;else{const[_dx,_dy]=state._delta,[_mx,_my]=state._movement,[svx,svy]=config.swipe.velocity,[sx,sy]=config.swipe.distance,sdt=config.swipe.duration;if(state.elapsedTimesvx&&Math.abs(_mx)>sx&&(state.swipe[0]=Math.sign(_dx)),_vy>svy&&Math.abs(_my)>sy&&(state.swipe[1]=Math.sign(_dy))}}this.emit()}pointerClick(event){!this.state.tap&&event.detail>0&&(event.preventDefault(),event.stopPropagation())}setupPointer(event){const config=this.config,device=config.device;config.pointerLock&&event.currentTarget.requestPointerLock(),config.pointerCapture||(this.eventStore.add(this.sharedConfig.window,device,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,device,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,device,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(event){this.state._preventScroll&&event.cancelable&&event.preventDefault()}setupScrollPrevention(event){this.state._preventScroll=!1,function persistEvent(event){"persist"in event&&"function"==typeof event.persist&&event.persist()}(event);const remove=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",remove),this.eventStore.add(this.sharedConfig.window,"touch","cancel",remove),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,event)}setupDelayTrigger(event){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(event)}),this.config.delay)}keyDown(event){const deltaFn=KEYS_DELTA_MAP[event.key];if(deltaFn){const state=this.state,factor=event.shiftKey?10:event.altKey?.1:1;this.start(event),state._delta=deltaFn(this.config.keyboardDisplacement,factor),state._keyboardActive=!0,V.addTo(state._movement,state._delta),this.compute(event),this.emit()}}keyUp(event){event.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(event),this.emit())}bind(bindFunction){const device=this.config.device;bindFunction(device,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(bindFunction(device,"change",this.pointerMove.bind(this)),bindFunction(device,"end",this.pointerUp.bind(this)),bindFunction(device,"cancel",this.pointerUp.bind(this)),bindFunction("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(bindFunction("key","down",this.keyDown.bind(this)),bindFunction("key","up",this.keyUp.bind(this))),this.config.filterTaps&&bindFunction("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:dragConfigResolver},actions_76b8683e_esm_hoverAction={key:"hover",engine:class HoverEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","hovering")}enter(event){this.config.mouseOnly&&"mouse"!==event.pointerType||(this.start(event),this.computeValues(pointerValues(event)),this.compute(event),this.emit())}leave(event){if(this.config.mouseOnly&&"mouse"!==event.pointerType)return;const state=this.state;if(!state._active)return;state._active=!1;const values=pointerValues(event);state._movement=state._delta=V.sub(values,state._values),this.computeValues(values),this.compute(event),state.delta=state.movement,this.emit()}bind(bindFunction){bindFunction("pointer","enter",this.enter.bind(this)),bindFunction("pointer","leave",this.leave.bind(this))}},resolver:hoverConfigResolver},actions_76b8683e_esm_moveAction={key:"move",engine:class MoveEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","moving")}move(event){this.config.mouseOnly&&"mouse"!==event.pointerType||(this.state._active?this.moveChange(event):this.moveStart(event),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(event){this.start(event),this.computeValues(pointerValues(event)),this.compute(event),this.computeInitial(),this.emit()}moveChange(event){if(!this.state._active)return;const values=pointerValues(event),state=this.state;state._delta=V.sub(values,state._values),V.addTo(state._movement,state._delta),this.computeValues(values),this.compute(event),this.emit()}moveEnd(event){this.state._active&&(this.state._active=!1,this.compute(event),this.emit())}bind(bindFunction){bindFunction("pointer","change",this.move.bind(this)),bindFunction("pointer","leave",this.moveEnd.bind(this))}},resolver:moveConfigResolver},actions_76b8683e_esm_pinchAction={key:"pinch",engine:class PinchEngine extends Engine{constructor(...args){super(...args),_defineProperty(this,"ingKey","pinching"),_defineProperty(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const state=this.state;state._touchIds=[],state.canceled=!1,state.cancel=this.cancel.bind(this),state.turns=0}computeOffset(){const{type:type,movement:movement,lastOffset:lastOffset}=this.state;this.state.offset="wheel"===type?V.add(movement,lastOffset):[(1+movement[0])*lastOffset[0],movement[1]+lastOffset[1]]}computeMovement(){const{offset:offset,lastOffset:lastOffset}=this.state;this.state.movement=[offset[0]/lastOffset[0],offset[1]-lastOffset[1]]}axisIntent(){const state=this.state,[_m0,_m1]=state._movement;if(!state.axis){const axisMovementDifference=30*Math.abs(_m0)-Math.abs(_m1);axisMovementDifference<0?state.axis="angle":axisMovementDifference>0&&(state.axis="scale")}}restrictToAxis(v){this.config.lockDirection&&("scale"===this.state.axis?v[1]=0:"angle"===this.state.axis&&(v[0]=0))}cancel(){const state=this.state;state.canceled||setTimeout((()=>{state.canceled=!0,state._active=!1,this.compute(),this.emit()}),0)}touchStart(event){this.ctrl.setEventIds(event);const state=this.state,ctrlTouchIds=this.ctrl.touchIds;if(state._active&&state._touchIds.every((id=>ctrlTouchIds.has(id))))return;if(ctrlTouchIds.size<2)return;this.start(event),state._touchIds=Array.from(ctrlTouchIds).slice(0,2);const payload=touchDistanceAngle(event,state._touchIds);payload&&this.pinchStart(event,payload)}pointerStart(event){if(null!=event.buttons&&event.buttons%2!=1)return;this.ctrl.setEventIds(event),event.target.setPointerCapture(event.pointerId);const state=this.state,_pointerEvents=state._pointerEvents,ctrlPointerIds=this.ctrl.pointerIds;if(state._active&&Array.from(_pointerEvents.keys()).every((id=>ctrlPointerIds.has(id))))return;if(_pointerEvents.size<2&&_pointerEvents.set(event.pointerId,event),state._pointerEvents.size<2)return;this.start(event);const payload=distanceAngle(...Array.from(_pointerEvents.values()));payload&&this.pinchStart(event,payload)}pinchStart(event,payload){this.state.origin=payload.origin,this.computeValues([payload.distance,payload.angle]),this.computeInitial(),this.compute(event),this.emit()}touchMove(event){if(!this.state._active)return;const payload=touchDistanceAngle(event,this.state._touchIds);payload&&this.pinchMove(event,payload)}pointerMove(event){const _pointerEvents=this.state._pointerEvents;if(_pointerEvents.has(event.pointerId)&&_pointerEvents.set(event.pointerId,event),!this.state._active)return;const payload=distanceAngle(...Array.from(_pointerEvents.values()));payload&&this.pinchMove(event,payload)}pinchMove(event,payload){const state=this.state,prev_a=state._values[1],delta_a=payload.angle-prev_a;let delta_turns=0;Math.abs(delta_a)>270&&(delta_turns+=Math.sign(delta_a)),this.computeValues([payload.distance,payload.angle-360*delta_turns]),state.origin=payload.origin,state.turns=delta_turns,state._movement=[state._values[0]/state._initial[0]-1,state._values[1]-state._initial[1]],this.compute(event),this.emit()}touchEnd(event){this.ctrl.setEventIds(event),this.state._active&&this.state._touchIds.some((id=>!this.ctrl.touchIds.has(id)))&&(this.state._active=!1,this.compute(event),this.emit())}pointerEnd(event){const state=this.state;this.ctrl.setEventIds(event);try{event.target.releasePointerCapture(event.pointerId)}catch(_unused){}state._pointerEvents.has(event.pointerId)&&state._pointerEvents.delete(event.pointerId),state._active&&state._pointerEvents.size<2&&(state._active=!1,this.compute(event),this.emit())}gestureStart(event){event.cancelable&&event.preventDefault();const state=this.state;state._active||(this.start(event),this.computeValues([event.scale,event.rotation]),state.origin=[event.clientX,event.clientY],this.compute(event),this.emit())}gestureMove(event){if(event.cancelable&&event.preventDefault(),!this.state._active)return;const state=this.state;this.computeValues([event.scale,event.rotation]),state.origin=[event.clientX,event.clientY];const _previousMovement=state._movement;state._movement=[event.scale-1,event.rotation],state._delta=V.sub(state._movement,_previousMovement),this.compute(event),this.emit()}gestureEnd(event){this.state._active&&(this.state._active=!1,this.compute(event),this.emit())}wheel(event){const modifierKey=this.config.modifierKey;modifierKey&&!event[modifierKey]||(this.state._active?this.wheelChange(event):this.wheelStart(event),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(event){this.start(event),this.wheelChange(event)}wheelChange(event){"uv"in event||event.cancelable&&event.preventDefault();const state=this.state;state._delta=[-wheelValues(event)[1]/100*state.offset[0],0],V.addTo(state._movement,state._delta),clampStateInternalMovementToBounds(state),this.state.origin=[event.clientX,event.clientY],this.compute(event),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(bindFunction){const device=this.config.device;device&&(bindFunction(device,"start",this[device+"Start"].bind(this)),bindFunction(device,"change",this[device+"Move"].bind(this)),bindFunction(device,"end",this[device+"End"].bind(this)),bindFunction(device,"cancel",this[device+"End"].bind(this)),bindFunction("lostPointerCapture","",this[device+"End"].bind(this))),this.config.pinchOnWheel&&bindFunction("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:pinchConfigResolver},actions_76b8683e_esm_scrollAction={key:"scroll",engine:class ScrollEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","scrolling")}scroll(event){this.state._active||this.start(event),this.scrollChange(event),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(event){event.cancelable&&event.preventDefault();const state=this.state,values=function scrollValues(event){var _ref,_ref2;const{scrollX:scrollX,scrollY:scrollY,scrollLeft:scrollLeft,scrollTop:scrollTop}=event.currentTarget;return[null!==(_ref=null!=scrollX?scrollX:scrollLeft)&&void 0!==_ref?_ref:0,null!==(_ref2=null!=scrollY?scrollY:scrollTop)&&void 0!==_ref2?_ref2:0]}(event);state._delta=V.sub(values,state._values),V.addTo(state._movement,state._delta),this.computeValues(values),this.compute(event),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(bindFunction){bindFunction("scroll","",this.scroll.bind(this))}},resolver:scrollConfigResolver},actions_76b8683e_esm_wheelAction={key:"wheel",engine:class WheelEngine extends CoordinatesEngine{constructor(...args){super(...args),_defineProperty(this,"ingKey","wheeling")}wheel(event){this.state._active||this.start(event),this.wheelChange(event),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(event){const state=this.state;state._delta=wheelValues(event),V.addTo(state._movement,state._delta),clampStateInternalMovementToBounds(state),this.compute(event),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(bindFunction){bindFunction("wheel","",this.wheel.bind(this))}},resolver:wheelConfigResolver};function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function use_gesture_core_esm_objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}const sharedConfigResolver={target(value){if(value)return()=>"current"in value?value.current:value},enabled(value=!0){return value},window(value=(SUPPORT.isBrowser?window:void 0)){return value},eventOptions({passive:passive=!0,capture:capture=!1}={}){return{passive:passive,capture:capture}},transform(value){return value}},use_gesture_core_esm_excluded=["target","eventOptions","window","enabled","transform"];function resolveWith(config={},resolvers){const result={};for(const[key,resolver]of Object.entries(resolvers))switch(typeof resolver){case"function":result[key]=resolver.call(result,config[key],key,config);break;case"object":result[key]=resolveWith(config[key],resolver);break;case"boolean":resolver&&(result[key]=config[key])}return result}class EventStore{constructor(ctrl,gestureKey){_defineProperty(this,"_listeners",new Set),this._ctrl=ctrl,this._gestureKey=gestureKey}add(element,device,action,handler,options){const listeners=this._listeners,type=function toDomEventType(device,action=""){const deviceProps=EVENT_TYPE_MAP[device];return device+(deviceProps&&deviceProps[action]||action)}(device,action),eventOptions=_objectSpread2(_objectSpread2({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),options);element.addEventListener(type,handler,eventOptions);const remove=()=>{element.removeEventListener(type,handler,eventOptions),listeners.delete(remove)};return listeners.add(remove),remove}clean(){this._listeners.forEach((remove=>remove())),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty(this,"_timeouts",new Map)}add(key,callback,ms=140,...args){this.remove(key),this._timeouts.set(key,window.setTimeout(callback,ms,...args))}remove(key){const timeout=this._timeouts.get(key);timeout&&window.clearTimeout(timeout)}clean(){this._timeouts.forEach((timeout=>{window.clearTimeout(timeout)})),this._timeouts.clear()}}class use_gesture_core_esm_Controller{constructor(handlers){_defineProperty(this,"gestures",new Set),_defineProperty(this,"_targetEventStore",new EventStore(this)),_defineProperty(this,"gestureEventStores",{}),_defineProperty(this,"gestureTimeoutStores",{}),_defineProperty(this,"handlers",{}),_defineProperty(this,"config",{}),_defineProperty(this,"pointerIds",new Set),_defineProperty(this,"touchIds",new Set),_defineProperty(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function resolveGestures(ctrl,internalHandlers){internalHandlers.drag&&setupGesture(ctrl,"drag");internalHandlers.wheel&&setupGesture(ctrl,"wheel");internalHandlers.scroll&&setupGesture(ctrl,"scroll");internalHandlers.move&&setupGesture(ctrl,"move");internalHandlers.pinch&&setupGesture(ctrl,"pinch");internalHandlers.hover&&setupGesture(ctrl,"hover")}(this,handlers)}setEventIds(event){return isTouch(event)?(this.touchIds=new Set(touchIds(event)),this.touchIds):"pointerId"in event?("pointerup"===event.type||"pointercancel"===event.type?this.pointerIds.delete(event.pointerId):"pointerdown"===event.type&&this.pointerIds.add(event.pointerId),this.pointerIds):void 0}applyHandlers(handlers,nativeHandlers){this.handlers=handlers,this.nativeHandlers=nativeHandlers}applyConfig(config,gestureKey){this.config=function parse(newConfig,gestureKey,_config={}){const _ref=newConfig,{target:target,eventOptions:eventOptions,window:window,enabled:enabled,transform:transform}=_ref,rest=_objectWithoutProperties(_ref,use_gesture_core_esm_excluded);if(_config.shared=resolveWith({target:target,eventOptions:eventOptions,window:window,enabled:enabled,transform:transform},sharedConfigResolver),gestureKey){const resolver=ConfigResolverMap.get(gestureKey);_config[gestureKey]=resolveWith(_objectSpread2({shared:_config.shared},rest),resolver)}else for(const key in rest){const resolver=ConfigResolverMap.get(key);resolver&&(_config[key]=resolveWith(_objectSpread2({shared:_config.shared},rest[key]),resolver))}return _config}(config,gestureKey,this.config)}clean(){this._targetEventStore.clean();for(const key of this.gestures)this.gestureEventStores[key].clean(),this.gestureTimeoutStores[key].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...args){const sharedConfig=this.config.shared,props={};let target;if(!sharedConfig.target||(target=sharedConfig.target(),target)){if(sharedConfig.enabled){for(const gestureKey of this.gestures){const gestureConfig=this.config[gestureKey],bindFunction=bindToProps(props,gestureConfig.eventOptions,!!target);if(gestureConfig.enabled){new(EngineMap.get(gestureKey))(this,args,gestureKey).bind(bindFunction)}}const nativeBindFunction=bindToProps(props,sharedConfig.eventOptions,!!target);for(const eventKey in this.nativeHandlers)nativeBindFunction(eventKey,"",(event=>this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({},this.state.shared),{},{event:event,args:args}))),void 0,!0)}for(const handlerProp in props)props[handlerProp]=chain(...props[handlerProp]);if(!target)return props;for(const handlerProp in props){const{device:device,capture:capture,passive:passive}=parseProp(handlerProp);this._targetEventStore.add(target,device,"",props[handlerProp],{capture:capture,passive:passive})}}}}function setupGesture(ctrl,gestureKey){ctrl.gestures.add(gestureKey),ctrl.gestureEventStores[gestureKey]=new EventStore(ctrl,gestureKey),ctrl.gestureTimeoutStores[gestureKey]=new TimeoutStore}const bindToProps=(props,eventOptions,withPassiveOption)=>(device,action,handler,options={},isNative=!1)=>{var _options$capture,_options$passive;const capture=null!==(_options$capture=options.capture)&&void 0!==_options$capture?_options$capture:eventOptions.capture,passive=null!==(_options$passive=options.passive)&&void 0!==_options$passive?_options$passive:eventOptions.passive;let handlerProp=isNative?device:toHandlerProp(device,action,capture);withPassiveOption&&passive&&(handlerProp+="Passive"),props[handlerProp]=props[handlerProp]||[],props[handlerProp].push(handler)},RE_NOT_NATIVE=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function registerGesture(actions,handlers,handlerKey,key,internalHandlers,config){if(!actions.has(handlerKey))return;if(!EngineMap.has(key))return void 0;const startKey=handlerKey+"Start",endKey=handlerKey+"End";internalHandlers[key]=state=>{let memo;return state.first&&startKey in handlers&&handlers[startKey](state),handlerKey in handlers&&(memo=handlers[handlerKey](state)),state.last&&endKey in handlers&&handlers[endKey](state),memo},config[key]=config[key]||{}}function parseMergedHandlers(mergedHandlers,mergedConfig){const[handlers,nativeHandlers,actions]=function sortHandlers(_handlers){const native={},handlers={},actions=new Set;for(let key in _handlers)RE_NOT_NATIVE.test(key)?(actions.add(RegExp.lastMatch),handlers[key]=_handlers[key]):native[key]=_handlers[key];return[handlers,native,actions]}(mergedHandlers),internalHandlers={};return registerGesture(actions,handlers,"onDrag","drag",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onWheel","wheel",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onScroll","scroll",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onPinch","pinch",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onMove","move",internalHandlers,mergedConfig),registerGesture(actions,handlers,"onHover","hover",internalHandlers,mergedConfig),{handlers:internalHandlers,config:mergedConfig,nativeHandlers:nativeHandlers}}function useRecognizers(handlers,config={},gestureKey,nativeHandlers){const ctrl=react.useMemo((()=>new use_gesture_core_esm_Controller(handlers)),[]);if(ctrl.applyHandlers(handlers,nativeHandlers),ctrl.applyConfig(config,gestureKey),react.useEffect(ctrl.effect.bind(ctrl)),react.useEffect((()=>ctrl.clean.bind(ctrl)),[]),void 0===config.target)return ctrl.bind.bind(ctrl)}function useGesture(handlers,config){const hook=function createUseGesture(actions){return actions.forEach(actions_76b8683e_esm_registerAction),function useGesture(_handlers,_config){const{handlers:handlers,nativeHandlers:nativeHandlers,config:config}=parseMergedHandlers(_handlers,_config||{});return useRecognizers(handlers,config,void 0,nativeHandlers)}}([actions_76b8683e_esm_dragAction,actions_76b8683e_esm_pinchAction,actions_76b8683e_esm_scrollAction,actions_76b8683e_esm_wheelAction,actions_76b8683e_esm_moveAction,actions_76b8683e_esm_hoverAction]);return hook(handlers,config||{})}function PresentationControls({enabled:enabled=!0,snap:snap,global:global,domElement:domElement,cursor:cursor=!0,children:children,speed:speed=1,rotation:rotation=[0,0,0],zoom:zoom=1,polar:polar=[0,Math.PI/2],azimuth:azimuth=[-1/0,1/0],config:config={mass:1,tension:170,friction:26}}){const events=(0,index_673ef987_esm.z)((state=>state.events)),gl=(0,index_673ef987_esm.z)((state=>state.gl)),explDomElement=domElement||events.connected||gl.domElement,{size:size}=(0,index_673ef987_esm.z)(),rPolar=react.useMemo((()=>[rotation[0]+polar[0],rotation[0]+polar[1]]),[rotation[0],polar[0],polar[1]]),rAzimuth=react.useMemo((()=>[rotation[1]+azimuth[0],rotation[1]+azimuth[1]]),[rotation[1],azimuth[0],azimuth[1]]),rInitial=react.useMemo((()=>[three_module.MathUtils.clamp(rotation[0],...rPolar),three_module.MathUtils.clamp(rotation[1],...rAzimuth),rotation[2]]),[rotation[0],rotation[1],rotation[2],rPolar,rAzimuth]),[spring,api]=useSpring((()=>({scale:1,rotation:rInitial,config:config})));react.useEffect((()=>{api.start({scale:1,rotation:rInitial,config:config})}),[rInitial]),react.useEffect((()=>{if(global&&cursor&&enabled)return explDomElement.style.cursor="grab",gl.domElement.style.cursor="",()=>{explDomElement.style.cursor="default",gl.domElement.style.cursor="default"}}),[global,cursor,explDomElement,enabled]);const bind=useGesture({onHover:({last:last})=>{cursor&&!global&&enabled&&(explDomElement.style.cursor=last?"auto":"grab")},onDrag:({down:down,delta:[x,y],memo:[oldY,oldX]=spring.rotation.animation.to||rInitial})=>{if(!enabled)return[y,x];cursor&&(explDomElement.style.cursor=down?"grabbing":"grab"),x=three_module.MathUtils.clamp(oldX+x/size.width*Math.PI*speed,...rAzimuth),y=three_module.MathUtils.clamp(oldY+y/size.height*Math.PI*speed,...rPolar);const sConfig=snap&&!down&&"boolean"!=typeof snap?snap:config;return api.start({scale:down&&y>rPolar[1]/2?zoom:1,rotation:snap&&!down?rInitial:[y,x,0],config:n=>"scale"===n?{...sConfig,friction:3*sConfig.friction}:sConfig}),[y,x]}},{target:global?explDomElement:void 0});return react.createElement(animated.group,(0,esm_extends.Z)({},null==bind?void 0:bind(),spring),children)}}}]); \ No newline at end of file diff --git a/docs/207.bf2802c1.iframe.bundle.js b/docs/207.bf2802c1.iframe.bundle.js deleted file mode 100644 index fc61a00a..00000000 --- a/docs/207.bf2802c1.iframe.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 207.bf2802c1.iframe.bundle.js.LICENSE.txt */ -(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[207],{"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}__webpack_require__.d(__webpack_exports__,{Z:function(){return _objectWithoutProperties}})},"./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _regeneratorRuntime}});var _typeof_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");function _regeneratorRuntime(){_regeneratorRuntime=function _regeneratorRuntime(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}try{define({},"")}catch(err){define=function define(obj,key,value){return obj[key]=value}}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,(function(){return this}));var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach((function(method){define(prototype,method,(function(arg){return this._invoke(method,arg)}))}))}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==(0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__.Z)(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then((function(value){invoke("next",value,resolve,reject)}),(function(err){invoke("throw",err,resolve,reject)})):PromiseImpl.resolve(value).then((function(unwrapped){result.value=unwrapped,resolve(result)}),(function(error){return invoke("throw",error,resolve,reject)}))}reject(record.arg)}var previousPromise;defineProperty(this,"_invoke",{value:function value(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl((function(resolve,reject){invoke(method,arg,resolve,reject)}))}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(void 0===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel}},catch:function _catch(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _slicedToArray}});var unsupportedIterableToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}(arr,i)||(0,unsupportedIterableToArray.Z)(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _toPropertyKey}});var esm_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!==(0,esm_typeof.Z)(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!==(0,esm_typeof.Z)(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"===(0,esm_typeof.Z)(key)?key:String(key)}},"./node_modules/@babel/runtime/helpers/esm/typeof.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}__webpack_require__.d(__webpack_exports__,{Z:function(){return _typeof}})},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _unsupportedIterableToArray}});var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen):void 0}}},"./node_modules/@react-three/drei/core/ContactShadows.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{j:function(){return ContactShadows}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js");const HorizontalBlurShader={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "},VerticalBlurShader={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform float v;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 sum = vec4( 0.0 );\n\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n gl_FragColor = sum;\n\n }\n "},ContactShadows=react.forwardRef((({scale:scale=10,frames:frames=1/0,opacity:opacity=1,width:width=1,height:height=1,blur:blur=1,near:near=0,far:far=10,resolution:resolution=512,smooth:smooth=!0,color:color="#000000",depthWrite:depthWrite=!1,renderOrder:renderOrder,...props},fref)=>{const ref=react.useRef(null),scene=(0,index_673ef987_esm.z)((state=>state.scene)),gl=(0,index_673ef987_esm.z)((state=>state.gl)),shadowCamera=react.useRef(null);width*=Array.isArray(scale)?scale[0]:scale||1,height*=Array.isArray(scale)?scale[1]:scale||1;const[renderTarget,planeGeometry,depthMaterial,blurPlane,horizontalBlurMaterial,verticalBlurMaterial,renderTargetBlur]=react.useMemo((()=>{const renderTarget=new three_module.WebGLRenderTarget(resolution,resolution),renderTargetBlur=new three_module.WebGLRenderTarget(resolution,resolution);renderTargetBlur.texture.generateMipmaps=renderTarget.texture.generateMipmaps=!1;const planeGeometry=new three_module.PlaneGeometry(width,height).rotateX(Math.PI/2),blurPlane=new three_module.Mesh(planeGeometry),depthMaterial=new three_module.MeshDepthMaterial;depthMaterial.depthTest=depthMaterial.depthWrite=!1,depthMaterial.onBeforeCompile=shader=>{shader.uniforms={...shader.uniforms,ucolor:{value:new three_module.Color(color)}},shader.fragmentShader=shader.fragmentShader.replace("void main() {","uniform vec3 ucolor;\n void main() {\n "),shader.fragmentShader=shader.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const horizontalBlurMaterial=new three_module.ShaderMaterial(HorizontalBlurShader),verticalBlurMaterial=new three_module.ShaderMaterial(VerticalBlurShader);return verticalBlurMaterial.depthTest=horizontalBlurMaterial.depthTest=!1,[renderTarget,planeGeometry,depthMaterial,blurPlane,horizontalBlurMaterial,verticalBlurMaterial,renderTargetBlur]}),[resolution,width,height,scale,color]),blurShadows=blur=>{blurPlane.visible=!0,blurPlane.material=horizontalBlurMaterial,horizontalBlurMaterial.uniforms.tDiffuse.value=renderTarget.texture,horizontalBlurMaterial.uniforms.h.value=1*blur/256,gl.setRenderTarget(renderTargetBlur),gl.render(blurPlane,shadowCamera.current),blurPlane.material=verticalBlurMaterial,verticalBlurMaterial.uniforms.tDiffuse.value=renderTargetBlur.texture,verticalBlurMaterial.uniforms.v.value=1*blur/256,gl.setRenderTarget(renderTarget),gl.render(blurPlane,shadowCamera.current),blurPlane.visible=!1};let initialBackground,initialOverrideMaterial,count=0;return(0,index_673ef987_esm.A)((()=>{shadowCamera.current&&(frames===1/0||countref.current),[]),react.createElement("group",(0,esm_extends.Z)({"rotation-x":Math.PI/2},props,{ref:ref}),react.createElement("mesh",{renderOrder:renderOrder,geometry:planeGeometry,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},react.createElement("meshBasicMaterial",{transparent:!0,map:renderTarget.texture,opacity:opacity,depthWrite:depthWrite})),react.createElement("orthographicCamera",{ref:shadowCamera,args:[-width/2,width/2,height/2,-height/2,near,far]}))}))},"./node_modules/@react-three/drei/core/Environment.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{qA:function(){return Environment}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js");class GroundProjectedEnv extends three_module.Mesh{constructor(texture,options){var _a,_b;const isCubeMap=(def=texture)&&def.isCubeTexture;var def;const cubeSize=(null!=(_b=isCubeMap?null==(_a=texture.image[0])?void 0:_a.width:texture.image.width)?_b:1024)/4,_lodMax=Math.floor(Math.log2(cubeSize)),_cubeSize=Math.pow(2,_lodMax),fragmentShader=[isCubeMap?"#define ENVMAP_TYPE_CUBE":"","#define CUBEUV_TEXEL_WIDTH "+1/(3*Math.max(_cubeSize,112)),"#define CUBEUV_TEXEL_HEIGHT "+1/(4*_cubeSize),`#define CUBEUV_MAX_MIP ${_lodMax}.0`].join("\n")+"\n #define ENVMAP_TYPE_CUBE_UV\n varying vec3 vWorldPosition;\n uniform float radius;\n uniform float height;\n uniform float angle;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube map;\n #else\n uniform sampler2D map;\n #endif\n // From: https://www.shadertoy.com/view/4tsBD7\n float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n {\n float d = dot ( rd, n );\n \n if( d > 0.0 ) { return 1e6; }\n \n vec3 o = ro - c;\n float t = - dot( n, o ) / d;\n vec3 q = o + rd * t;\n \n return ( dot( q, q ) < r * r ) ? t : 1e6;\n }\n // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) \n {\n vec3 oc = ro - ce;\n float b = dot( oc, rd );\n float c = dot( oc, oc ) - ra * ra;\n float h = b * b - c;\n \n if( h < 0.0 ) { return -1.0; }\n \n h = sqrt( h );\n \n return - b + h;\n }\n vec3 project() \n {\n vec3 p = normalize( vWorldPosition );\n vec3 camPos = cameraPosition;\n camPos.y -= height;\n float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n if( intersection > 0.0 ) {\n \n vec3 h = vec3( 0.0, - height, 0.0 );\n float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n p = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n } else {\n p = vec3( 0.0, 1.0, 0.0 );\n }\n return p;\n }\n #include \n #include \n void main() \n {\n vec3 projectedWorldPosition = project();\n \n #ifdef ENVMAP_TYPE_CUBE\n vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n #else\n vec3 direction = normalize( projectedWorldPosition );\n vec2 uv = equirectUv( direction );\n vec3 outcolor = texture2D( map, uv ).rgb;\n #endif\n gl_FragColor = vec4( outcolor, 1.0 );\n #include \n #include \n }\n ",uniforms={map:{value:texture},height:{value:(null==options?void 0:options.height)||15},radius:{value:(null==options?void 0:options.radius)||100}};super(new three_module.IcosahedronGeometry(1,16),new three_module.ShaderMaterial({uniforms:uniforms,fragmentShader:fragmentShader,vertexShader:"\n varying vec3 vWorldPosition;\n void main() \n {\n vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n vWorldPosition = worldPosition.xyz;\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",side:three_module.DoubleSide}))}set radius(radius){this.material.uniforms.radius.value=radius}get radius(){return this.material.uniforms.radius.value}set height(height){this.material.uniforms.height.value=height}get height(){return this.material.uniforms.height.value}}class RGBELoader extends three_module.DataTextureLoader{constructor(manager){super(manager),this.type=three_module.HalfFloatType}parse(buffer){const rgbe_error=function(rgbe_error_code,msg){switch(rgbe_error_code){case 1:console.error("THREE.RGBELoader Read Error: "+(msg||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(msg||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(msg||""));break;default:console.error("THREE.RGBELoader: Error: "+(msg||""))}return-1},fgets=function(buffer2,lineLimit,consume){lineLimit=lineLimit||1024;let p=buffer2.pos,i=-1,len=0,s="",chunk=String.fromCharCode.apply(null,new Uint16Array(buffer2.subarray(p,p+128)));for(;0>(i=chunk.indexOf("\n"))&&len=buffer2.byteLength||!(line=fgets(buffer2)))return rgbe_error(1,"no header found");if(!(match=line.match(/^#\?(\S+)/)))return rgbe_error(3,"bad initial token");for(header.valid|=1,header.programtype=match[1],header.string+=line+"\n";line=fgets(buffer2),!1!==line;)if(header.string+=line+"\n","#"!==line.charAt(0)){if((match=line.match(gamma_re))&&(header.gamma=parseFloat(match[1])),(match=line.match(exposure_re))&&(header.exposure=parseFloat(match[1])),(match=line.match(format_re))&&(header.valid|=2,header.format=match[1]),(match=line.match(dimensions_re))&&(header.valid|=4,header.height=parseInt(match[1],10),header.width=parseInt(match[2],10)),2&header.valid&&4&header.valid)break}else header.comments+=line+"\n";return 2&header.valid?4&header.valid?header:rgbe_error(3,"missing image size specifier"):rgbe_error(3,"missing format specifier")}(byteArray);if(-1!==rgbe_header_info){const w=rgbe_header_info.width,h=rgbe_header_info.height,image_rgba_data=function(buffer2,w,h){const scanline_width=w;if(scanline_width<8||scanline_width>32767||2!==buffer2[0]||2!==buffer2[1]||128&buffer2[2])return new Uint8Array(buffer2);if(scanline_width!==(buffer2[2]<<8|buffer2[3]))return rgbe_error(3,"wrong scanline width");const data_rgba=new Uint8Array(4*w*h);if(!data_rgba.length)return rgbe_error(4,"unable to allocate buffer space");let offset=0,pos=0;const ptr_end=4*scanline_width,rgbeStart=new Uint8Array(4),scanline_buffer=new Uint8Array(ptr_end);let num_scanlines=h;for(;num_scanlines>0&&posbuffer2.byteLength)return rgbe_error(1);if(rgbeStart[0]=buffer2[pos++],rgbeStart[1]=buffer2[pos++],rgbeStart[2]=buffer2[pos++],rgbeStart[3]=buffer2[pos++],2!=rgbeStart[0]||2!=rgbeStart[1]||(rgbeStart[2]<<8|rgbeStart[3])!=scanline_width)return rgbe_error(3,"bad rgbe scanline format");let count,ptr=0;for(;ptr128;if(isEncodedRun&&(count-=128),0===count||ptr+count>ptr_end)return rgbe_error(3,"bad scanline data");if(isEncodedRun){const byteValue=buffer2[pos++];for(let i=0;i>lc&(1<ni)return!1;getBits(6,c,lc,uInt8Array2,p);var l=getBitsReturn.l;if(c=getBitsReturn.c,lc=getBitsReturn.lc,hcode[im]=l,63==l){if(p.value-inOffset.value>ni)throw"Something wrong with hufUnpackEncTable";getBits(8,c,lc,uInt8Array2,p);var zerun=getBitsReturn.l+6;if(c=getBitsReturn.c,lc=getBitsReturn.lc,im+zerun>iM+1)throw"Something wrong with hufUnpackEncTable";for(;zerun--;)hcode[im++]=0;im--}else if(l>=59){if(im+(zerun=l-59+2)>iM+1)throw"Something wrong with hufUnpackEncTable";for(;zerun--;)hcode[im++]=0;im--}}!function hufCanonicalCodeTable(hcode){for(var i=0;i<=58;++i)hufTableBuffer[i]=0;for(i=0;i<65537;++i)hufTableBuffer[hcode[i]]+=1;var c=0;for(i=58;i>0;--i){var nc=c+hufTableBuffer[i]>>1;hufTableBuffer[i]=c,c=nc}for(i=0;i<65537;++i){var l=hcode[i];l>0&&(hcode[i]=l|hufTableBuffer[l]++<<6)}}(hcode)}function hufLength(code){return 63&code}function hufCode(code){return code>>6}const getCharReturn={c:0,lc:0};function getChar(c,lc,uInt8Array2,inOffset){c=c<<8|parseUint8Array(uInt8Array2,inOffset),lc+=8,getCharReturn.c=c,getCharReturn.lc=lc}const getCodeReturn={c:0,lc:0};function getCode(po,rlc,c,lc,uInt8Array2,inDataView,inOffset,outBuffer,outBufferOffset,outBufferEndOffset){if(po==rlc){lc<8&&(getChar(c,lc,uInt8Array2,inOffset),c=getCharReturn.c,lc=getCharReturn.lc);var cs=c>>(lc-=8);cs=new Uint8Array([cs])[0];if(outBufferOffset.value+cs>outBufferEndOffset)return!1;for(var s=outBuffer[outBufferOffset.value-1];cs-- >0;)outBuffer[outBufferOffset.value++]=s}else{if(!(outBufferOffset.value32767?ref-65536:ref}const wdec14Return={a:0,b:0};function wdec14(l,h){var ls=Int16(l),hs=Int16(h),ai=ls+(1&hs)+(hs>>1),as=ai,bs=ai-hs;wdec14Return.a=as,wdec14Return.b=bs}function wdec16(l,h){var m=UInt16(l),d=UInt16(h),bb=m-(d>>1)&65535,aa=d+bb-32768&65535;wdec14Return.a=aa,wdec14Return.b=bb}function wav2Decode(buffer2,j,nx,ox,ny,oy,mx){for(var p2,w14=mx<16384,n=nx>ny?ny:nx,p=1;p<=n;)p<<=1;for(p2=p>>=1,p>>=1;p>=1;){for(var i00,i01,i10,i11,py=0,ey=py+oy*(ny-p2),oy1=oy*p,oy2=oy*p2,ox1=ox*p,ox2=ox*p2;py<=ey;py+=oy2){for(var px=py,ex=py+ox*(nx-p2);px<=ex;px+=ox2){var p01=px+ox1,p11=(p10=px+oy1)+ox1;w14?(wdec14(buffer2[px+j],buffer2[p10+j]),i00=wdec14Return.a,i10=wdec14Return.b,wdec14(buffer2[p01+j],buffer2[p11+j]),i01=wdec14Return.a,i11=wdec14Return.b,wdec14(i00,i01),buffer2[px+j]=wdec14Return.a,buffer2[p01+j]=wdec14Return.b,wdec14(i10,i11),buffer2[p10+j]=wdec14Return.a,buffer2[p11+j]=wdec14Return.b):(wdec16(buffer2[px+j],buffer2[p10+j]),i00=wdec14Return.a,i10=wdec14Return.b,wdec16(buffer2[p01+j],buffer2[p11+j]),i01=wdec14Return.a,i11=wdec14Return.b,wdec16(i00,i01),buffer2[px+j]=wdec14Return.a,buffer2[p01+j]=wdec14Return.b,wdec16(i10,i11),buffer2[p10+j]=wdec14Return.a,buffer2[p11+j]=wdec14Return.b)}if(nx&p){var p10=px+oy1;w14?wdec14(buffer2[px+j],buffer2[p10+j]):wdec16(buffer2[px+j],buffer2[p10+j]),i00=wdec14Return.a,buffer2[p10+j]=wdec14Return.b,buffer2[px+j]=i00}}if(ny&p)for(px=py,ex=py+ox*(nx-p2);px<=ex;px+=ox2){p01=px+ox1;w14?wdec14(buffer2[px+j],buffer2[p01+j]):wdec16(buffer2[px+j],buffer2[p01+j]),i00=wdec14Return.a,buffer2[p01+j]=wdec14Return.b,buffer2[px+j]=i00}p2=p,p>>=1}return py}function hufUncompress(uInt8Array2,inDataView,inOffset,nCompressed,outBuffer,nRaw){var initialInOffset=inOffset.value,im=parseUint32(inDataView,inOffset),iM=parseUint32(inDataView,inOffset);inOffset.value+=4;var nBits=parseUint32(inDataView,inOffset);if(inOffset.value+=4,im<0||im>=65537||iM<0||iM>=65537)throw"Something wrong with HUF_ENCSIZE";var freq=new Array(65537),hdec=new Array(16384);if(function hufClearDecTable(hdec){for(var i=0;i<16384;i++)hdec[i]={},hdec[i].len=0,hdec[i].lit=0,hdec[i].p=null}(hdec),hufUnpackEncTable(uInt8Array2,0,inOffset,nCompressed-(inOffset.value-initialInOffset),im,iM,freq),nBits>8*(nCompressed-(inOffset.value-initialInOffset)))throw"Something wrong with hufUncompress";!function hufBuildDecTable(hcode,im,iM,hdecod){for(;im<=iM;im++){var c=hufCode(hcode[im]),l=hufLength(hcode[im]);if(c>>l)throw"Invalid table entry";if(l>14){if((pl=hdecod[c>>l-14]).len)throw"Invalid table entry";if(pl.lit++,pl.p){var p=pl.p;pl.p=new Array(pl.lit);for(var i=0;i0;i--){var pl;if((pl=hdecod[(c<<14-l)+plOffset]).len||pl.p)throw"Invalid table entry";pl.len=l,pl.lit=im,plOffset++}}}return!0}(freq,im,iM,hdec),function hufDecode(encodingTable,decodingTable,uInt8Array2,inDataView,inOffset,ni,rlc,no,outBuffer,outOffset){for(var c=0,lc=0,outBufferEndOffset=no,inOffsetEnd=Math.trunc(inOffset.value+(ni+7)/8);inOffset.value=14;)if((pl=decodingTable[c>>lc-14&16383]).len)lc-=pl.len,getCode(pl.lit,rlc,c,lc,uInt8Array2,0,inOffset,outBuffer,outOffset,outBufferEndOffset),c=getCodeReturn.c,lc=getCodeReturn.lc;else{if(!pl.p)throw"hufDecode issues";var j;for(j=0;j=l&&hufCode(encodingTable[pl.p[j]])==(c>>lc-l&(1<>=i,lc-=i;lc>0;){var pl;if(!(pl=decodingTable[c<<14-lc&16383]).len)throw"hufDecode issues";lc-=pl.len,getCode(pl.lit,rlc,c,lc,uInt8Array2,0,inOffset,outBuffer,outOffset,outBufferEndOffset),c=getCodeReturn.c,lc=getCodeReturn.lc}return!0}(freq,hdec,uInt8Array2,0,inOffset,nBits,iM,nRaw,outBuffer,{value:0})}function predictor(source){for(var t=1;tstop||(out[s++]=source[t1++],s>stop));)out[s++]=source[t2++]}function decodeRunLength(source){for(var size=source.byteLength,out=new Array,p=0,reader=new DataView(source);size>0;){var l=reader.getInt8(p++);if(l<0){size-=(count=-l)+1;for(var i=0;i>8==255?dctComp+=255&acValue:(halfZigBlock[dctComp]=acValue,dctComp++),currAcComp.value++}function unZigZag(src,dst){dst[0]=decodeFloat16(src[0]),dst[1]=decodeFloat16(src[1]),dst[2]=decodeFloat16(src[5]),dst[3]=decodeFloat16(src[6]),dst[4]=decodeFloat16(src[14]),dst[5]=decodeFloat16(src[15]),dst[6]=decodeFloat16(src[27]),dst[7]=decodeFloat16(src[28]),dst[8]=decodeFloat16(src[2]),dst[9]=decodeFloat16(src[4]),dst[10]=decodeFloat16(src[7]),dst[11]=decodeFloat16(src[13]),dst[12]=decodeFloat16(src[16]),dst[13]=decodeFloat16(src[26]),dst[14]=decodeFloat16(src[29]),dst[15]=decodeFloat16(src[42]),dst[16]=decodeFloat16(src[3]),dst[17]=decodeFloat16(src[8]),dst[18]=decodeFloat16(src[12]),dst[19]=decodeFloat16(src[17]),dst[20]=decodeFloat16(src[25]),dst[21]=decodeFloat16(src[30]),dst[22]=decodeFloat16(src[41]),dst[23]=decodeFloat16(src[43]),dst[24]=decodeFloat16(src[9]),dst[25]=decodeFloat16(src[11]),dst[26]=decodeFloat16(src[18]),dst[27]=decodeFloat16(src[24]),dst[28]=decodeFloat16(src[31]),dst[29]=decodeFloat16(src[40]),dst[30]=decodeFloat16(src[44]),dst[31]=decodeFloat16(src[53]),dst[32]=decodeFloat16(src[10]),dst[33]=decodeFloat16(src[19]),dst[34]=decodeFloat16(src[23]),dst[35]=decodeFloat16(src[32]),dst[36]=decodeFloat16(src[39]),dst[37]=decodeFloat16(src[45]),dst[38]=decodeFloat16(src[52]),dst[39]=decodeFloat16(src[54]),dst[40]=decodeFloat16(src[20]),dst[41]=decodeFloat16(src[22]),dst[42]=decodeFloat16(src[33]),dst[43]=decodeFloat16(src[38]),dst[44]=decodeFloat16(src[46]),dst[45]=decodeFloat16(src[51]),dst[46]=decodeFloat16(src[55]),dst[47]=decodeFloat16(src[60]),dst[48]=decodeFloat16(src[21]),dst[49]=decodeFloat16(src[34]),dst[50]=decodeFloat16(src[37]),dst[51]=decodeFloat16(src[47]),dst[52]=decodeFloat16(src[50]),dst[53]=decodeFloat16(src[56]),dst[54]=decodeFloat16(src[59]),dst[55]=decodeFloat16(src[61]),dst[56]=decodeFloat16(src[35]),dst[57]=decodeFloat16(src[36]),dst[58]=decodeFloat16(src[48]),dst[59]=decodeFloat16(src[49]),dst[60]=decodeFloat16(src[57]),dst[61]=decodeFloat16(src[58]),dst[62]=decodeFloat16(src[62]),dst[63]=decodeFloat16(src[63])}function dctInverse(data){const a=.5*Math.cos(.7853975),b=.5*Math.cos(3.14159/16),c=.5*Math.cos(3.14159/8),d=.5*Math.cos(3*3.14159/16),e=.5*Math.cos(.981746875),f=.5*Math.cos(3*3.14159/8),g=.5*Math.cos(1.374445625);for(var alpha=new Array(4),beta=new Array(4),theta=new Array(4),gamma=new Array(4),row=0;row<8;++row){var rowPtr=8*row;alpha[0]=c*data[rowPtr+2],alpha[1]=f*data[rowPtr+2],alpha[2]=c*data[rowPtr+6],alpha[3]=f*data[rowPtr+6],beta[0]=b*data[rowPtr+1]+d*data[rowPtr+3]+e*data[rowPtr+5]+g*data[rowPtr+7],beta[1]=d*data[rowPtr+1]-g*data[rowPtr+3]-b*data[rowPtr+5]-e*data[rowPtr+7],beta[2]=e*data[rowPtr+1]-b*data[rowPtr+3]+g*data[rowPtr+5]+d*data[rowPtr+7],beta[3]=g*data[rowPtr+1]-e*data[rowPtr+3]+d*data[rowPtr+5]-b*data[rowPtr+7],theta[0]=a*(data[rowPtr+0]+data[rowPtr+4]),theta[3]=a*(data[rowPtr+0]-data[rowPtr+4]),theta[1]=alpha[0]+alpha[3],theta[2]=alpha[1]-alpha[2],gamma[0]=theta[0]+theta[1],gamma[1]=theta[3]+theta[2],gamma[2]=theta[3]-theta[2],gamma[3]=theta[0]-theta[1],data[rowPtr+0]=gamma[0]+beta[0],data[rowPtr+1]=gamma[1]+beta[1],data[rowPtr+2]=gamma[2]+beta[2],data[rowPtr+3]=gamma[3]+beta[3],data[rowPtr+4]=gamma[3]-beta[3],data[rowPtr+5]=gamma[2]-beta[2],data[rowPtr+6]=gamma[1]-beta[1],data[rowPtr+7]=gamma[0]-beta[0]}for(var column=0;column<8;++column)alpha[0]=c*data[16+column],alpha[1]=f*data[16+column],alpha[2]=c*data[48+column],alpha[3]=f*data[48+column],beta[0]=b*data[8+column]+d*data[24+column]+e*data[40+column]+g*data[56+column],beta[1]=d*data[8+column]-g*data[24+column]-b*data[40+column]-e*data[56+column],beta[2]=e*data[8+column]-b*data[24+column]+g*data[40+column]+d*data[56+column],beta[3]=g*data[8+column]-e*data[24+column]+d*data[40+column]-b*data[56+column],theta[0]=a*(data[column]+data[32+column]),theta[3]=a*(data[column]-data[32+column]),theta[1]=alpha[0]+alpha[3],theta[2]=alpha[1]-alpha[2],gamma[0]=theta[0]+theta[1],gamma[1]=theta[3]+theta[2],gamma[2]=theta[3]-theta[2],gamma[3]=theta[0]-theta[1],data[0+column]=gamma[0]+beta[0],data[8+column]=gamma[1]+beta[1],data[16+column]=gamma[2]+beta[2],data[24+column]=gamma[3]+beta[3],data[32+column]=gamma[3]-beta[3],data[40+column]=gamma[2]-beta[2],data[48+column]=gamma[1]-beta[1],data[56+column]=gamma[0]-beta[0]}function csc709Inverse(data){for(var i=0;i<64;++i){var y=data[0][i],cb=data[1][i],cr=data[2][i];data[0][i]=y+1.5747*cr,data[1][i]=y-.1873*cb-.4682*cr,data[2][i]=y+1.8556*cb}}function convertToHalf(src,dst,idx){for(var i=0;i<64;++i)dst[idx+i]=three_module.DataUtils.toHalfFloat(toLinear(src[i]))}function toLinear(float){return float<=1?Math.sign(float)*Math.pow(Math.abs(float),2.2):Math.sign(float)*Math.pow(logBase,Math.abs(float)-1)}function uncompressRAW(info){return new DataView(info.array.buffer,info.offset.value,info.size)}function uncompressRLE(info){var compressed=info.viewer.buffer.slice(info.offset.value,info.offset.value+info.size),rawBuffer=new Uint8Array(decodeRunLength(compressed)),tmpBuffer=new Uint8Array(rawBuffer.length);return predictor(rawBuffer),interleaveScalar(rawBuffer,tmpBuffer),new DataView(tmpBuffer.buffer)}function uncompressZIP(info){var compressed=info.array.slice(info.offset.value,info.offset.value+info.size),rawBuffer=(0,browser.HT)(compressed),tmpBuffer=new Uint8Array(rawBuffer.length);return predictor(rawBuffer),interleaveScalar(rawBuffer,tmpBuffer),new DataView(tmpBuffer.buffer)}function uncompressPIZ(info){for(var inDataView=info.viewer,inOffset={value:info.offset.value},outBuffer=new Uint16Array(info.width*info.scanlineBlockSize*(info.channels*info.type)),bitmap=new Uint8Array(8192),outBufferEnd=0,pizChannelData=new Array(info.channels),i=0;i=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(minNonZero<=maxNonZero)for(i=0;i>3]&1<<(7&i))&&(lut[k++]=i);for(var n=k-1;k<65536;)lut[k++]=0;return n}(bitmap,lut),length=parseUint32(inDataView,inOffset);hufUncompress(info.array,inDataView,inOffset,length,outBuffer,outBufferEnd);for(i=0;i0;){var name=parseNullTerminatedString(inDataView.buffer,inOffset),value=parseUint8(inDataView,inOffset),compression=value>>2&3,index=new Int8Array([(value>>4)-1])[0],type=parseUint8(inDataView,inOffset);channelRules.push({name:name,index:index,type:type,compression:compression}),ruleSize-=name.length+3}for(var channels=EXRHeader.channels,channelData=new Array(info.channels),i=0;i=0&&(cscSet.idx[rule.index]=offset2),cd.offset=offset2)}if(dwaHeader.acCompressedSize>0)switch(dwaHeader.acCompression){case 0:var acBuffer=new Uint16Array(dwaHeader.totalAcUncompressedCount);hufUncompress(info.array,inDataView,inOffset,dwaHeader.acCompressedSize,acBuffer,dwaHeader.totalAcUncompressedCount);break;case 1:var compressed=info.array.slice(inOffset.value,inOffset.value+dwaHeader.totalAcUncompressedCount),data=(0,browser.HT)(compressed);acBuffer=new Uint16Array(data.buffer);inOffset.value+=dwaHeader.totalAcUncompressedCount}if(dwaHeader.dcCompressedSize>0){var zlibInfo={array:info.array,offset:inOffset,size:dwaHeader.dcCompressedSize},dcBuffer=new Uint16Array(uncompressZIP(zlibInfo).buffer);inOffset.value+=dwaHeader.dcCompressedSize}if(dwaHeader.rleRawSize>0){compressed=info.array.slice(inOffset.value,inOffset.value+dwaHeader.rleCompressedSize);var rleBuffer=decodeRunLength((data=(0,browser.HT)(compressed)).buffer);inOffset.value+=dwaHeader.rleCompressedSize}var outBufferEnd=0,rowOffsets=new Array(channelData.length);for(i=0;i>10,fraction=1023&binary;return(binary>>15?-1:1)*(exponent?31===exponent?fraction?NaN:1/0:Math.pow(2,exponent-15)*(1+fraction/1024):fraction/1024*6103515625e-14)}function parseUint16(dataView,offset2){var Uint16=dataView.getUint16(offset2.value,!0);return offset2.value+=2,Uint16}function parseFloat16(buffer2,offset2){return decodeFloat16(parseUint16(buffer2,offset2))}function parseValue(dataView,buffer2,offset2,type,size){return"string"===type||"stringvector"===type||"iccProfile"===type?function parseFixedLengthString(buffer2,offset2,size){var stringValue=(new TextDecoder).decode(new Uint8Array(buffer2).slice(offset2.value,offset2.value+size));return offset2.value=offset2.value+size,stringValue}(buffer2,offset2,size):"chlist"===type?function parseChlist(dataView,buffer2,offset2,size){for(var startOffset=offset2.value,channels=[];offset2.valueEXRDecoder.height?EXRDecoder.height-line:EXRDecoder.scanlineBlockSize;const viewer=EXRDecoder.size=EXRDecoder.height)break;for(let channelID=0;channelIDArray.isArray(arr);function useEnvironment({files:files=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:path="",preset:preset,encoding:encoding,extensions:extensions}={}){var _files$split$pop,_files$split$pop$spli,_files$split$pop$spli2;let extension,loader=null,isCubeMap=!1;if(preset){if(!(preset in presetsObj))throw new Error("Preset must be one of: "+Object.keys(presetsObj).join(", "));files=presetsObj[preset],path=CUBEMAP_ROOT}if(isCubeMap=isArray(files),extension=isArray(files)?"cube":files.startsWith("data:application/exr")?"exr":files.startsWith("data:application/hdr")?"hdr":null==(_files$split$pop=files.split(".").pop())||null==(_files$split$pop$spli=_files$split$pop.split("?"))||null==(_files$split$pop$spli2=_files$split$pop$spli.shift())?void 0:_files$split$pop$spli2.toLowerCase(),loader=isCubeMap?three_module.CubeTextureLoader:"hdr"===extension?RGBELoader:"exr"===extension?EXRLoader:null,!loader)throw new Error("useEnvironment: Unrecognized file extension: "+files);const loaderResult=(0,index_673ef987_esm.D)(loader,isCubeMap?[files]:files,(loader=>{null==loader.setPath||loader.setPath(path),extensions&&extensions(loader)})),texture=isCubeMap?loaderResult[0]:loaderResult;texture.mapping=isCubeMap?three_module.CubeReflectionMapping:three_module.EquirectangularReflectionMapping;return"colorSpace"in texture?texture.colorSpace=(null!=encoding?encoding:isCubeMap)?"srgb":"srgb-linear":texture.encoding=(null!=encoding?encoding:isCubeMap)?3001:3e3,texture}const resolveScene=scene=>{return(obj=scene).current&&obj.current.isScene?scene.current:scene;var obj};function setEnvProps(background,scene,defaultScene,texture,blur=0){const target=resolveScene(scene||defaultScene),oldbg=target.background,oldenv=target.environment,oldBlur=target.backgroundBlurriness||0;return"only"!==background&&(target.environment=texture),background&&(target.background=texture),background&&void 0!==target.backgroundBlurriness&&(target.backgroundBlurriness=blur),()=>{"only"!==background&&(target.environment=oldenv),background&&(target.background=oldbg),background&&void 0!==target.backgroundBlurriness&&(target.backgroundBlurriness=oldBlur)}}function EnvironmentMap({scene:scene,background:background=!1,blur:blur,map:map}){const defaultScene=(0,index_673ef987_esm.z)((state=>state.scene));return react.useLayoutEffect((()=>{if(map)return setEnvProps(background,scene,defaultScene,map,blur)}),[defaultScene,scene,map,background,blur]),null}function EnvironmentCube({background:background=!1,scene:scene,blur:blur,...rest}){const texture=useEnvironment(rest),defaultScene=(0,index_673ef987_esm.z)((state=>state.scene));return react.useLayoutEffect((()=>setEnvProps(background,scene,defaultScene,texture,blur)),[texture,background,scene,defaultScene,blur]),null}function EnvironmentPortal({children:children,near:near=1,far:far=1e3,resolution:resolution=256,frames:frames=1,map:map,background:background=!1,blur:blur,scene:scene,files:files,path:path,preset:preset,extensions:extensions}){const gl=(0,index_673ef987_esm.z)((state=>state.gl)),defaultScene=(0,index_673ef987_esm.z)((state=>state.scene)),camera=react.useRef(null),[virtualScene]=react.useState((()=>new three_module.Scene)),fbo=react.useMemo((()=>{const fbo=new three_module.WebGLCubeRenderTarget(resolution);return fbo.texture.type=three_module.HalfFloatType,fbo}),[resolution]);react.useLayoutEffect((()=>(1===frames&&camera.current.update(gl,virtualScene),setEnvProps(background,scene,defaultScene,fbo.texture,blur))),[children,virtualScene,fbo.texture,scene,defaultScene,background,frames,gl]);let count=1;return(0,index_673ef987_esm.A)((()=>{(frames===1/0||count(0,index_673ef987_esm.e)({GroundProjectedEnvImpl:GroundProjectedEnv})),[]);const args=react.useMemo((()=>[texture]),[texture]),height=null==(_props$ground=props.ground)?void 0:_props$ground.height,radius=null==(_props$ground2=props.ground)?void 0:_props$ground2.radius,scale=null!==(_scale=null==(_props$ground3=props.ground)?void 0:_props$ground3.scale)&&void 0!==_scale?_scale:1e3;return react.createElement(react.Fragment,null,react.createElement(EnvironmentMap,(0,esm_extends.Z)({},props,{map:texture})),react.createElement("groundProjectedEnvImpl",{args:args,scale:scale,height:height,radius:radius}))}function Environment(props){return props.ground?react.createElement(EnvironmentGround,props):props.map?react.createElement(EnvironmentMap,props):props.children?react.createElement(EnvironmentPortal,props):react.createElement(EnvironmentCube,props)}},"./node_modules/@react-three/fiber/dist/index-673ef987.esm.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{A:function(){return useFrame},B:function(){return Block},C:function(){return useGraph},D:function(){return useLoader},E:function(){return ErrorBoundary},a:function(){return index_673ef987_esm_useIsomorphicLayoutEffect},b:function(){return createRoot},c:function(){return createEvents},d:function(){return unmountComponentAtNode},e:function(){return extend},g:function(){return createPortal},i:function(){return isRef},j:function(){return applyProps},n:function(){return addEffect},o:function(){return addAfterEffect},p:function(){return addTail},u:function(){return useMutableCallback},x:function(){return useInstanceHandle},z:function(){return useThree}});var three_module=__webpack_require__("./node_modules/three/build/three.module.js"),react=__webpack_require__("./node_modules/react/index.js"),constants=__webpack_require__("./node_modules/react-reconciler/constants.js");function createStore(createState){let state;const listeners=new Set,setState=(partial,replace)=>{const nextState="function"==typeof partial?partial(state):partial;if(nextState!==state){const previousState=state;state=replace?nextState:Object.assign({},state,nextState),listeners.forEach((listener=>listener(state,previousState)))}},getState=()=>state,api={setState:setState,getState:getState,subscribe:(listener,selector,equalityFn)=>selector||equalityFn?((listener,selector=getState,equalityFn=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let currentSlice=selector(state);function listenerToAdd(){const nextSlice=selector(state);if(!equalityFn(currentSlice,nextSlice)){const previousSlice=currentSlice;listener(currentSlice=nextSlice,previousSlice)}}return listeners.add(listenerToAdd),()=>listeners.delete(listenerToAdd)})(listener,selector,equalityFn):(listeners.add(listener),()=>listeners.delete(listener)),destroy:()=>listeners.clear()};return state=createState(setState,getState,api),api}const useIsomorphicLayoutEffect="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?react.useEffect:react.useLayoutEffect;function create(createState){const api="function"==typeof createState?createStore(createState):createState,useStore=(selector=api.getState,equalityFn=Object.is)=>{const[,forceUpdate]=(0,react.useReducer)((c=>c+1),0),state=api.getState(),stateRef=(0,react.useRef)(state),selectorRef=(0,react.useRef)(selector),equalityFnRef=(0,react.useRef)(equalityFn),erroredRef=(0,react.useRef)(!1),currentSliceRef=(0,react.useRef)();let newStateSlice;void 0===currentSliceRef.current&&(currentSliceRef.current=selector(state));let hasNewStateSlice=!1;(stateRef.current!==state||selectorRef.current!==selector||equalityFnRef.current!==equalityFn||erroredRef.current)&&(newStateSlice=selector(state),hasNewStateSlice=!equalityFn(currentSliceRef.current,newStateSlice)),useIsomorphicLayoutEffect((()=>{hasNewStateSlice&&(currentSliceRef.current=newStateSlice),stateRef.current=state,selectorRef.current=selector,equalityFnRef.current=equalityFn,erroredRef.current=!1}));const stateBeforeSubscriptionRef=(0,react.useRef)(state);useIsomorphicLayoutEffect((()=>{const listener=()=>{try{const nextState=api.getState(),nextStateSlice=selectorRef.current(nextState);equalityFnRef.current(currentSliceRef.current,nextStateSlice)||(stateRef.current=nextState,currentSliceRef.current=nextStateSlice,forceUpdate())}catch(error){erroredRef.current=!0,forceUpdate()}},unsubscribe=api.subscribe(listener);return api.getState()!==stateBeforeSubscriptionRef.current&&listener(),unsubscribe}),[]);const sliceToReturn=hasNewStateSlice?newStateSlice:currentSliceRef.current;return(0,react.useDebugValue)(sliceToReturn),sliceToReturn};return Object.assign(useStore,api),useStore[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const items=[useStore,api];return{next(){const done=items.length<=0;return{value:items.shift(),done:done}}}},useStore}var react_reconciler=__webpack_require__("./node_modules/react-reconciler/index.js"),react_reconciler_default=__webpack_require__.n(react_reconciler),scheduler=__webpack_require__("./node_modules/scheduler/index.js"),suspend_react=__webpack_require__("./node_modules/suspend-react/index.js");const catalogue={},extend=objects=>{Object.assign(catalogue,objects)};var _window$document,_window$navigator;const hasColorSpace=object=>"colorSpace"in object||"outputColorSpace"in object,getColorManagement=()=>{var _ColorManagement;return null!=(_ColorManagement=catalogue.ColorManagement)?_ColorManagement:null},isOrthographicCamera=def=>def&&def.isOrthographicCamera,isRef=obj=>obj&&obj.hasOwnProperty("current"),index_673ef987_esm_useIsomorphicLayoutEffect="undefined"!=typeof window&&(null!=(_window$document=window.document)&&_window$document.createElement||"ReactNative"===(null==(_window$navigator=window.navigator)?void 0:_window$navigator.product))?react.useLayoutEffect:react.useEffect;function useMutableCallback(fn){const ref=react.useRef(fn);return index_673ef987_esm_useIsomorphicLayoutEffect((()=>{ref.current=fn}),[fn]),ref}function Block({set:set}){return index_673ef987_esm_useIsomorphicLayoutEffect((()=>(set(new Promise((()=>null))),()=>set(!1))),[set]),null}class ErrorBoundary extends react.Component{constructor(...args){super(...args),this.state={error:!1}}componentDidCatch(err){this.props.set(err)}render(){return this.state.error?null:this.props.children}}ErrorBoundary.getDerivedStateFromError=()=>({error:!0});const DEFAULT="__default",DEFAULTS=new Map,isDiffSet=def=>def&&!!def.memoized&&!!def.changes;function calculateDpr(dpr){var _window$devicePixelRa;const target="undefined"!=typeof window?null!=(_window$devicePixelRa=window.devicePixelRatio)?_window$devicePixelRa:2:1;return Array.isArray(dpr)?Math.min(Math.max(dpr[0],target),dpr[1]):dpr}const getRootState=obj=>{var _r3f;return null==(_r3f=obj.__r3f)?void 0:_r3f.root.getState()},is={obj:a=>a===Object(a)&&!is.arr(a)&&"function"!=typeof a,fun:a=>"function"==typeof a,str:a=>"string"==typeof a,num:a=>"number"==typeof a,boo:a=>"boolean"==typeof a,und:a=>void 0===a,arr:a=>Array.isArray(a),equ(a,b,{arrays:arrays="shallow",objects:objects="reference",strict:strict=!0}={}){if(typeof a!=typeof b||!!a!=!!b)return!1;if(is.str(a)||is.num(a))return a===b;const isObj=is.obj(a);if(isObj&&"reference"===objects)return a===b;const isArr=is.arr(a);if(isArr&&"reference"===arrays)return a===b;if((isArr||isObj)&&a===b)return!0;let i;for(i in a)if(!(i in b))return!1;if(isObj&&"shallow"===arrays&&"shallow"===objects){for(i in strict?b:a)if(!is.equ(a[i],b[i],{strict:strict,objects:"reference"}))return!1}else for(i in strict?b:a)if(a[i]!==b[i])return!1;if(is.und(i)){if(isArr&&0===a.length&&0===b.length)return!0;if(isObj&&0===Object.keys(a).length&&0===Object.keys(b).length)return!0;if(a!==b)return!1}return!0}};function buildGraph(object){const data={nodes:{},materials:{}};return object&&object.traverse((obj=>{obj.name&&(data.nodes[obj.name]=obj),obj.material&&!data.materials[obj.material.name]&&(data.materials[obj.material.name]=obj.material)})),data}function prepare(object,state){return object.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...state},object}function resolve(instance,key){let target=instance;if(key.includes("-")){const entries=key.split("-"),last=entries.pop();return target=entries.reduce(((acc,key)=>acc[key]),instance),{target:target,key:last}}return{target:target,key:key}}const INDEX_REGEX=/-\d+$/;function attach(parent,child,type){if(is.str(type)){if(INDEX_REGEX.test(type)){const root=type.replace(INDEX_REGEX,""),{target:target,key:key}=resolve(parent,root);Array.isArray(target[key])||(target[key]=[])}const{target:target,key:key}=resolve(parent,type);child.__r3f.previousAttach=target[key],target[key]=child}else child.__r3f.previousAttach=type(parent,child)}function detach(parent,child,type){var _child$__r3f,_child$__r3f2;if(is.str(type)){const{target:target,key:key}=resolve(parent,type),previous=child.__r3f.previousAttach;void 0===previous?delete target[key]:target[key]=previous}else null==(_child$__r3f=child.__r3f)||null==_child$__r3f.previousAttach||_child$__r3f.previousAttach(parent,child);null==(_child$__r3f2=child.__r3f)||delete _child$__r3f2.previousAttach}function diffProps(instance,{children:cN,key:kN,ref:rN,...props},{children:cP,key:kP,ref:rP,...previous}={},remove=!1){var _instance$__r3f;const localState=null!=(_instance$__r3f=null==instance?void 0:instance.__r3f)?_instance$__r3f:{},entries=Object.entries(props),changes=[];if(remove){const previousKeys=Object.keys(previous);for(let i=0;i{var _instance$__r3f2;if(null!=(_instance$__r3f2=instance.__r3f)&&_instance$__r3f2.primitive&&"object"===key)return;if(is.equ(value,previous[key]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(key))return changes.push([key,value,!0,[]]);let entries=[];key.includes("-")&&(entries=key.split("-")),changes.push([key,value,!1,entries]);for(const prop in props){const value=props[prop];prop.startsWith(`${key}-`)&&changes.push([prop,value,!1,prop.split("-")])}}));const memoized={...props};return localState.memoizedProps&&localState.memoizedProps.args&&(memoized.args=localState.memoizedProps.args),localState.memoizedProps&&localState.memoizedProps.attach&&(memoized.attach=localState.memoizedProps.attach),{memoized:memoized,changes:changes}}function applyProps$1(instance,data){var _instance$__r3f3,_root$getState,_instance$__r3f4;const localState=null!=(_instance$__r3f3=instance.__r3f)?_instance$__r3f3:{},root=localState.root,rootState=null!=(_root$getState=null==root||null==root.getState?void 0:root.getState())?_root$getState:{},{memoized:memoized,changes:changes}=isDiffSet(data)?data:diffProps(instance,data),prevHandlers=localState.eventCount;instance.__r3f&&(instance.__r3f.memoizedProps=memoized);for(let i=0;iacc[key]),instance),!targetProp||!targetProp.set)){const[name,...reverseEntries]=keys.reverse();currentInstance=reverseEntries.reverse().reduce(((acc,key)=>acc[key]),instance),key=name}if(value===DEFAULT+"remove")if(currentInstance.constructor){let ctor=DEFAULTS.get(currentInstance.constructor);ctor||(ctor=new currentInstance.constructor,DEFAULTS.set(currentInstance.constructor,ctor)),value=ctor[key]}else value=0;if(isEvent)value?localState.handlers[key]=value:delete localState.handlers[key],localState.eventCount=Object.keys(localState.handlers).length;else if(targetProp&&targetProp.set&&(targetProp.copy||targetProp instanceof three_module.Layers)){if(Array.isArray(value))targetProp.fromArray?targetProp.fromArray(value):targetProp.set(...value);else if(targetProp.copy&&value&&value.constructor&&targetProp.constructor===value.constructor)targetProp.copy(value);else if(void 0!==value){const isColor=targetProp instanceof three_module.Color;!isColor&&targetProp.setScalar?targetProp.setScalar(value):targetProp instanceof three_module.Layers&&value instanceof three_module.Layers?targetProp.mask=value.mask:targetProp.set(value),getColorManagement()||rootState.linear||!isColor||targetProp.convertSRGBToLinear()}}else if(currentInstance[key]=value,currentInstance[key]instanceof three_module.Texture&¤tInstance[key].format===three_module.RGBAFormat&¤tInstance[key].type===three_module.UnsignedByteType){const texture=currentInstance[key];hasColorSpace(texture)&&hasColorSpace(rootState.gl)?texture.colorSpace=rootState.gl.outputColorSpace:texture.encoding=rootState.gl.outputEncoding}invalidateInstance(instance)}if(localState.parent&&rootState.internal&&instance.raycast&&prevHandlers!==localState.eventCount){const index=rootState.internal.interaction.indexOf(instance);index>-1&&rootState.internal.interaction.splice(index,1),localState.eventCount&&rootState.internal.interaction.push(instance)}return!(1===changes.length&&"onUpdate"===changes[0][0])&&changes.length&&null!=(_instance$__r3f4=instance.__r3f)&&_instance$__r3f4.parent&&updateInstance(instance),instance}function invalidateInstance(instance){var _instance$__r3f5,_instance$__r3f5$root;const state=null==(_instance$__r3f5=instance.__r3f)||null==(_instance$__r3f5$root=_instance$__r3f5.root)||null==_instance$__r3f5$root.getState?void 0:_instance$__r3f5$root.getState();state&&0===state.internal.frames&&state.invalidate()}function updateInstance(instance){null==instance.onUpdate||instance.onUpdate(instance)}function updateCamera(camera,size){camera.manual||(isOrthographicCamera(camera)?(camera.left=size.width/-2,camera.right=size.width/2,camera.top=size.height/2,camera.bottom=size.height/-2):camera.aspect=size.width/size.height,camera.updateProjectionMatrix(),camera.updateMatrixWorld())}function makeId(event){return(event.eventObject||event.object).uuid+"/"+event.index+event.instanceId}function releaseInternalPointerCapture(capturedMap,obj,captures,pointerId){const captureData=captures.get(obj);captureData&&(captures.delete(obj),0===captures.size&&(capturedMap.delete(pointerId),captureData.target.releasePointerCapture(pointerId)))}function createEvents(store){function filterPointerEvents(objects){return objects.filter((obj=>["Move","Over","Enter","Out","Leave"].some((name=>{var _r3f;return null==(_r3f=obj.__r3f)?void 0:_r3f.handlers["onPointer"+name]}))))}function cancelPointer(intersections){const{internal:internal}=store.getState();for(const hoveredObj of internal.hovered.values())if(!intersections.length||!intersections.find((hit=>hit.object===hoveredObj.object&&hit.index===hoveredObj.index&&hit.instanceId===hoveredObj.instanceId))){const instance=hoveredObj.eventObject.__r3f,handlers=null==instance?void 0:instance.handlers;if(internal.hovered.delete(makeId(hoveredObj)),null!=instance&&instance.eventCount){const data={...hoveredObj,intersections:intersections};null==handlers.onPointerOut||handlers.onPointerOut(data),null==handlers.onPointerLeave||handlers.onPointerLeave(data)}}}function pointerMissed(event,objects){for(let i=0;icancelPointer([]);case"onLostPointerCapture":return event=>{const{internal:internal}=store.getState();"pointerId"in event&&internal.capturedMap.has(event.pointerId)&&requestAnimationFrame((()=>{internal.capturedMap.has(event.pointerId)&&(internal.capturedMap.delete(event.pointerId),cancelPointer([]))}))}}return function handleEvent(event){const{onPointerMissed:onPointerMissed,internal:internal}=store.getState();internal.lastEvent.current=event;const isPointerMove="onPointerMove"===name,isClickEvent="onClick"===name||"onContextMenu"===name||"onDoubleClick"===name,hits=function intersect(event,filter){const state=store.getState(),duplicates=new Set,intersections=[],eventsObjects=filter?filter(state.internal.interaction):state.internal.interaction;for(let i=0;i{const aState=getRootState(a.object),bState=getRootState(b.object);return aState&&bState&&bState.events.priority-aState.events.priority||a.distance-b.distance})).filter((item=>{const id=makeId(item);return!duplicates.has(id)&&(duplicates.add(id),!0)}));state.events.filter&&(hits=state.events.filter(hits,state));for(const hit of hits){let eventObject=hit.object;for(;eventObject;){var _r3f2;null!=(_r3f2=eventObject.__r3f)&&_r3f2.eventCount&&intersections.push({...hit,eventObject:eventObject}),eventObject=eventObject.parent}}if("pointerId"in event&&state.internal.capturedMap.has(event.pointerId))for(let captureData of state.internal.capturedMap.get(event.pointerId).values())duplicates.has(makeId(captureData.intersection))||intersections.push(captureData.intersection);return intersections}(event,isPointerMove?filterPointerEvents:void 0),delta=isClickEvent?function calculateDistance(event){const{internal:internal}=store.getState(),dx=event.offsetX-internal.initialClick[0],dy=event.offsetY-internal.initialClick[1];return Math.round(Math.sqrt(dx*dx+dy*dy))}(event):0;"onPointerDown"===name&&(internal.initialClick=[event.offsetX,event.offsetY],internal.initialHits=hits.map((hit=>hit.eventObject))),isClickEvent&&!hits.length&&delta<=2&&(pointerMissed(event,internal.interaction),onPointerMissed&&onPointerMissed(event)),isPointerMove&&cancelPointer(hits),function handleIntersects(intersections,event,delta,callback){const rootState=store.getState();if(intersections.length){const localState={stopped:!1};for(const hit of intersections){const state=getRootState(hit.object)||rootState,{raycaster:raycaster,pointer:pointer,camera:camera,internal:internal}=state,unprojectedPoint=new three_module.Vector3(pointer.x,pointer.y,0).unproject(camera),hasPointerCapture=id=>{var _internal$capturedMap,_internal$capturedMap2;return null!=(_internal$capturedMap=null==(_internal$capturedMap2=internal.capturedMap.get(id))?void 0:_internal$capturedMap2.has(hit.eventObject))&&_internal$capturedMap},setPointerCapture=id=>{const captureData={intersection:hit,target:event.target};internal.capturedMap.has(id)?internal.capturedMap.get(id).set(hit.eventObject,captureData):internal.capturedMap.set(id,new Map([[hit.eventObject,captureData]])),event.target.setPointerCapture(id)},releasePointerCapture=id=>{const captures=internal.capturedMap.get(id);captures&&releaseInternalPointerCapture(internal.capturedMap,hit.eventObject,captures,id)};let extractEventProps={};for(let prop in event){let property=event[prop];"function"!=typeof property&&(extractEventProps[prop]=property)}let raycastEvent={...hit,...extractEventProps,pointer:pointer,intersections:intersections,stopped:localState.stopped,delta:delta,unprojectedPoint:unprojectedPoint,ray:raycaster.ray,camera:camera,stopPropagation(){const capturesForPointer="pointerId"in event&&internal.capturedMap.get(event.pointerId);(!capturesForPointer||capturesForPointer.has(hit.eventObject))&&(raycastEvent.stopped=localState.stopped=!0,internal.hovered.size&&Array.from(internal.hovered.values()).find((i=>i.eventObject===hit.eventObject)))&&cancelPointer([...intersections.slice(0,intersections.indexOf(hit)),hit])},target:{hasPointerCapture:hasPointerCapture,setPointerCapture:setPointerCapture,releasePointerCapture:releasePointerCapture},currentTarget:{hasPointerCapture:hasPointerCapture,setPointerCapture:setPointerCapture,releasePointerCapture:releasePointerCapture},nativeEvent:event};if(callback(raycastEvent),!0===localState.stopped)break}}return intersections}(hits,event,delta,(function onIntersect(data){const eventObject=data.eventObject,instance=eventObject.__r3f,handlers=null==instance?void 0:instance.handlers;if(null!=instance&&instance.eventCount)if(isPointerMove){if(handlers.onPointerOver||handlers.onPointerEnter||handlers.onPointerOut||handlers.onPointerLeave){const id=makeId(data),hoveredItem=internal.hovered.get(id);hoveredItem?hoveredItem.stopped&&data.stopPropagation():(internal.hovered.set(id,data),null==handlers.onPointerOver||handlers.onPointerOver(data),null==handlers.onPointerEnter||handlers.onPointerEnter(data))}null==handlers.onPointerMove||handlers.onPointerMove(data)}else{const handler=handlers[name];handler?isClickEvent&&!internal.initialHits.includes(eventObject)||(pointerMissed(event,internal.interaction.filter((object=>!internal.initialHits.includes(object)))),handler(data)):isClickEvent&&internal.initialHits.includes(eventObject)&&pointerMissed(event,internal.interaction.filter((object=>!internal.initialHits.includes(object))))}}))}}}}const privateKeys=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],isRenderer=def=>!(null==def||!def.render),context=react.createContext(null),index_673ef987_esm_createStore=(invalidate,advance)=>{const rootState=create(((set,get)=>{const position=new three_module.Vector3,defaultTarget=new three_module.Vector3,tempTarget=new three_module.Vector3;function getCurrentViewport(camera=get().camera,target=defaultTarget,size=get().size){const{width:width,height:height,top:top,left:left}=size,aspect=width/height;target instanceof three_module.Vector3?tempTarget.copy(target):tempTarget.set(...target);const distance=camera.getWorldPosition(position).distanceTo(tempTarget);if(isOrthographicCamera(camera))return{width:width/camera.zoom,height:height/camera.zoom,top:top,left:left,factor:1,distance:distance,aspect:aspect};{const fov=camera.fov*Math.PI/180,h=2*Math.tan(fov/2)*distance,w=h*(width/height);return{width:w,height:h,top:top,left:left,factor:width/w,distance:distance,aspect:aspect}}}let performanceTimeout;const setPerformanceCurrent=current=>set((state=>({performance:{...state.performance,current:current}}))),pointer=new three_module.Vector2,rootState={set:set,get:get,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(frames=1)=>invalidate(get(),frames),advance:(timestamp,runGlobalEffects)=>advance(timestamp,runGlobalEffects,get()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new three_module.Clock,pointer:pointer,mouse:pointer,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const state=get();performanceTimeout&&clearTimeout(performanceTimeout),state.performance.current!==state.performance.min&&setPerformanceCurrent(state.performance.min),performanceTimeout=setTimeout((()=>setPerformanceCurrent(get().performance.max)),state.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:getCurrentViewport},setEvents:events=>set((state=>({...state,events:{...state.events,...events}}))),setSize:(width,height,updateStyle,top,left)=>{const camera=get().camera,size={width:width,height:height,top:top||0,left:left||0,updateStyle:updateStyle};set((state=>({size:size,viewport:{...state.viewport,...getCurrentViewport(camera,defaultTarget,size)}})))},setDpr:dpr=>set((state=>{const resolved=calculateDpr(dpr);return{viewport:{...state.viewport,dpr:resolved,initialDpr:state.viewport.initialDpr||resolved}}})),setFrameloop:(frameloop="always")=>{const clock=get().clock;clock.stop(),clock.elapsedTime=0,"never"!==frameloop&&(clock.start(),clock.elapsedTime=0),set((()=>({frameloop:frameloop})))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:react.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(ref,priority,store)=>{const internal=get().internal;return internal.priority=internal.priority+(priority>0?1:0),internal.subscribers.push({ref:ref,priority:priority,store:store}),internal.subscribers=internal.subscribers.sort(((a,b)=>a.priority-b.priority)),()=>{const internal=get().internal;null!=internal&&internal.subscribers&&(internal.priority=internal.priority-(priority>0?1:0),internal.subscribers=internal.subscribers.filter((s=>s.ref!==ref)))}}}};return rootState})),state=rootState.getState();let oldSize=state.size,oldDpr=state.viewport.dpr,oldCamera=state.camera;return rootState.subscribe((()=>{const{camera:camera,size:size,viewport:viewport,gl:gl,set:set}=rootState.getState();if(size!==oldSize||viewport.dpr!==oldDpr){var _size$updateStyle;oldSize=size,oldDpr=viewport.dpr,updateCamera(camera,size),gl.setPixelRatio(viewport.dpr);const updateStyle=null!=(_size$updateStyle=size.updateStyle)?_size$updateStyle:"undefined"!=typeof HTMLCanvasElement&&gl.domElement instanceof HTMLCanvasElement;gl.setSize(size.width,size.height,updateStyle)}camera!==oldCamera&&(oldCamera=camera,set((state=>({viewport:{...state.viewport,...state.viewport.getCurrentViewport(camera)}}))))})),rootState.subscribe((state=>invalidate(state))),rootState};function createSubs(callback,subs){const sub={callback:callback};return subs.add(sub),()=>{subs.delete(sub)}}let i,globalEffects=new Set,globalAfterEffects=new Set,globalTailEffects=new Set;const addEffect=callback=>createSubs(callback,globalEffects),addAfterEffect=callback=>createSubs(callback,globalAfterEffects),addTail=callback=>createSubs(callback,globalTailEffects);function run(effects,timestamp){if(effects.size)for(const{callback:callback}of effects.values())callback(timestamp)}function flushGlobalEffects(type,timestamp){switch(type){case"before":return run(globalEffects,timestamp);case"after":return run(globalAfterEffects,timestamp);case"tail":return run(globalTailEffects,timestamp)}}let subscribers,subscription;function render$1(timestamp,state,frame){let delta=state.clock.getDelta();for("never"===state.frameloop&&"number"==typeof timestamp&&(delta=timestamp-state.clock.elapsedTime,state.clock.oldTime=state.clock.elapsedTime,state.clock.elapsedTime=timestamp),subscribers=state.internal.subscribers,i=0;i{instance.current=ref.current.__r3f}),[ref]),instance}function useStore(){const store=react.useContext(context);if(!store)throw new Error("R3F: Hooks can only be used within the Canvas component!");return store}function useThree(selector=(state=>state),equalityFn){return useStore()(selector,equalityFn)}function useFrame(callback,renderPriority=0){const store=useStore(),subscribe=store.getState().internal.subscribe,ref=useMutableCallback(callback);return index_673ef987_esm_useIsomorphicLayoutEffect((()=>subscribe(ref,renderPriority,store)),[renderPriority,subscribe,store]),null}function useGraph(object){return react.useMemo((()=>buildGraph(object)),[object])}function loadingFn(extensions,onProgress){return function(Proto,...input){const loader=new Proto;return extensions&&extensions(loader),Promise.all(input.map((input=>new Promise(((res,reject)=>loader.load(input,(data=>{data.scene&&Object.assign(data,buildGraph(data.scene)),res(data)}),onProgress,(error=>reject(new Error(`Could not load ${input}: ${error.message}`)))))))))}}function useLoader(Proto,input,extensions,onProgress){const keys=Array.isArray(input)?input:[input],results=(0,suspend_react.Rq)(loadingFn(extensions,onProgress),[Proto,...keys],{equal:is.equ});return Array.isArray(input)?results:results[0]}useLoader.preload=function(Proto,input,extensions){const keys=Array.isArray(input)?input:[input];return(0,suspend_react.MA)(loadingFn(extensions),[Proto,...keys])},useLoader.clear=function(Proto,input){const keys=Array.isArray(input)?input:[input];return(0,suspend_react.ZH)([Proto,...keys])};const roots=new Map,{invalidate:invalidate,advance:advance}=function createLoop(roots){let repeat,frame,state,running=!1;function loop(timestamp){frame=requestAnimationFrame(loop),running=!0,repeat=0,flushGlobalEffects("before",timestamp);for(const root of roots.values()){var _state$gl$xr;state=root.store.getState(),!state.internal.active||!("always"===state.frameloop||state.internal.frames>0)||null!=(_state$gl$xr=state.gl.xr)&&_state$gl$xr.isPresenting||(repeat+=render$1(timestamp,state))}if(flushGlobalEffects("after",timestamp),0===repeat)return flushGlobalEffects("tail",timestamp),running=!1,cancelAnimationFrame(frame)}return{loop:loop,invalidate:function invalidate(state,frames=1){var _state$gl$xr2;if(!state)return roots.forEach((root=>invalidate(root.store.getState())),frames);null!=(_state$gl$xr2=state.gl.xr)&&_state$gl$xr2.isPresenting||!state.internal.active||"never"===state.frameloop||(state.internal.frames=Math.min(60,state.internal.frames+frames),running||(running=!0,requestAnimationFrame(loop)))},advance:function advance(timestamp,runGlobalEffects=!0,state,frame){if(runGlobalEffects&&flushGlobalEffects("before",timestamp),state)render$1(timestamp,state,frame);else for(const root of roots.values())render$1(timestamp,root.store.getState());runGlobalEffects&&flushGlobalEffects("after",timestamp)}}}(roots),{reconciler:reconciler,applyProps:applyProps}=function createRenderer(_roots,_getEventPriority){function createInstance(type,{args:args=[],attach:attach,...props},root){let instance,name=`${type[0].toUpperCase()}${type.slice(1)}`;if("primitive"===type){if(void 0===props.object)throw new Error("R3F: Primitives without 'object' are invalid!");instance=prepare(props.object,{type:type,root:root,attach:attach,primitive:!0})}else{const target=catalogue[name];if(!target)throw new Error(`R3F: ${name} 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(!Array.isArray(args))throw new Error("R3F: The args prop must be an array!");instance=prepare(new target(...args),{type:type,root:root,attach:attach,memoizedProps:{args:args}})}return void 0===instance.__r3f.attach&&(instance instanceof three_module.BufferGeometry?instance.__r3f.attach="geometry":instance instanceof three_module.Material&&(instance.__r3f.attach="material")),"inject"!==name&&applyProps$1(instance,props),instance}function appendChild(parentInstance,child){let added=!1;var _child$__r3f,_parentInstance$__r3f;child&&(null!=(_child$__r3f=child.__r3f)&&_child$__r3f.attach?attach(parentInstance,child,child.__r3f.attach):child.isObject3D&&parentInstance.isObject3D&&(parentInstance.add(child),added=!0),added||null==(_parentInstance$__r3f=parentInstance.__r3f)||_parentInstance$__r3f.objects.push(child),child.__r3f||prepare(child,{}),child.__r3f.parent=parentInstance,updateInstance(child),invalidateInstance(child))}function insertBefore(parentInstance,child,beforeChild){let added=!1;if(child){var _child$__r3f2,_parentInstance$__r3f2;if(null!=(_child$__r3f2=child.__r3f)&&_child$__r3f2.attach)attach(parentInstance,child,child.__r3f.attach);else if(child.isObject3D&&parentInstance.isObject3D){child.parent=parentInstance,child.dispatchEvent({type:"added"});const restSiblings=parentInstance.children.filter((sibling=>sibling!==child)),index=restSiblings.indexOf(beforeChild);parentInstance.children=[...restSiblings.slice(0,index),child,...restSiblings.slice(index)],added=!0}added||null==(_parentInstance$__r3f2=parentInstance.__r3f)||_parentInstance$__r3f2.objects.push(child),child.__r3f||prepare(child,{}),child.__r3f.parent=parentInstance,updateInstance(child),invalidateInstance(child)}}function removeRecursive(array,parent,dispose=!1){array&&[...array].forEach((child=>removeChild(parent,child,dispose)))}function removeChild(parentInstance,child,dispose){if(child){var _parentInstance$__r3f3,_child$__r3f3,_child$__r3f5;if(child.__r3f&&(child.__r3f.parent=null),null!=(_parentInstance$__r3f3=parentInstance.__r3f)&&_parentInstance$__r3f3.objects&&(parentInstance.__r3f.objects=parentInstance.__r3f.objects.filter((x=>x!==child))),null!=(_child$__r3f3=child.__r3f)&&_child$__r3f3.attach)detach(parentInstance,child,child.__r3f.attach);else if(child.isObject3D&&parentInstance.isObject3D){var _child$__r3f4;parentInstance.remove(child),null!=(_child$__r3f4=child.__r3f)&&_child$__r3f4.root&&function removeInteractivity(store,object){const{internal:internal}=store.getState();internal.interaction=internal.interaction.filter((o=>o!==object)),internal.initialHits=internal.initialHits.filter((o=>o!==object)),internal.hovered.forEach(((value,key)=>{value.eventObject!==object&&value.object!==object||internal.hovered.delete(key)})),internal.capturedMap.forEach(((captures,pointerId)=>{releaseInternalPointerCapture(internal.capturedMap,object,captures,pointerId)}))}(child.__r3f.root,child)}const isPrimitive=null==(_child$__r3f5=child.__r3f)?void 0:_child$__r3f5.primitive,shouldDispose=void 0===dispose?null!==child.dispose&&!isPrimitive:dispose;var _child$__r3f6;if(!isPrimitive)removeRecursive(null==(_child$__r3f6=child.__r3f)?void 0:_child$__r3f6.objects,child,shouldDispose),removeRecursive(child.children,child,shouldDispose);delete child.__r3f,shouldDispose&&child.dispose&&"Scene"!==child.type&&(0,scheduler.unstable_scheduleCallback)(scheduler.unstable_IdlePriority,(()=>{try{child.dispose()}catch(e){}})),invalidateInstance(parentInstance)}}const handleTextInstance=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:react_reconciler_default()({createInstance:createInstance,removeChild:removeChild,appendChild:appendChild,appendInitialChild:appendChild,insertBefore:insertBefore,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(container,child)=>{if(!child)return;const scene=container.getState().scene;scene.__r3f&&(scene.__r3f.root=container,appendChild(scene,child))},removeChildFromContainer:(container,child)=>{child&&removeChild(container.getState().scene,child)},insertInContainerBefore:(container,child,beforeChild)=>{if(!child||!beforeChild)return;const scene=container.getState().scene;scene.__r3f&&insertBefore(scene,child,beforeChild)},getRootHostContext:()=>null,getChildHostContext:parentHostContext=>parentHostContext,finalizeInitialChildren(instance){var _instance$__r3f2;const localState=null!=(_instance$__r3f2=null==instance?void 0:instance.__r3f)?_instance$__r3f2:{};return Boolean(localState.handlers)},prepareUpdate(instance,_type,oldProps,newProps){var _instance$__r3f3;if((null!=(_instance$__r3f3=null==instance?void 0:instance.__r3f)?_instance$__r3f3:{}).primitive&&newProps.object&&newProps.object!==instance)return[!0];{const{args:argsNew=[],children:cN,...restNew}=newProps,{args:argsOld=[],children:cO,...restOld}=oldProps;if(!Array.isArray(argsNew))throw new Error("R3F: the args prop must be an array!");if(argsNew.some(((value,index)=>value!==argsOld[index])))return[!0];const diff=diffProps(instance,restNew,restOld,!0);return diff.changes.length?[!1,diff]:null}},commitUpdate(instance,[reconstruct,diff],type,_oldProps,newProps,fiber){reconstruct?function switchInstance(instance,type,newProps,fiber){var _instance$__r3f;const parent=null==(_instance$__r3f=instance.__r3f)?void 0:_instance$__r3f.parent;if(!parent)return;const newInstance=createInstance(type,newProps,instance.__r3f.root);if(instance.children){for(const child of instance.children)child.__r3f&&appendChild(newInstance,child);instance.children=instance.children.filter((child=>!child.__r3f))}instance.__r3f.objects.forEach((child=>appendChild(newInstance,child))),instance.__r3f.objects=[],instance.__r3f.autoRemovedBeforeAppend||removeChild(parent,instance),newInstance.parent&&(newInstance.__r3f.autoRemovedBeforeAppend=!0),appendChild(parent,newInstance),newInstance.raycast&&newInstance.__r3f.eventCount&&newInstance.__r3f.root.getState().internal.interaction.push(newInstance);[fiber,fiber.alternate].forEach((fiber=>{null!==fiber&&(fiber.stateNode=newInstance,fiber.ref&&("function"==typeof fiber.ref?fiber.ref(newInstance):fiber.ref.current=newInstance))}))}(instance,type,newProps,fiber):applyProps$1(instance,diff)},commitMount(instance,_type,_props,_int){var _instance$__r3f4;const localState=null!=(_instance$__r3f4=instance.__r3f)?_instance$__r3f4:{};instance.raycast&&localState.handlers&&localState.eventCount&&instance.__r3f.root.getState().internal.interaction.push(instance)},getPublicInstance:instance=>instance,prepareForCommit:()=>null,preparePortalMount:container=>prepare(container.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(instance){var _instance$__r3f5;const{attach:type,parent:parent}=null!=(_instance$__r3f5=instance.__r3f)?_instance$__r3f5:{};type&&parent&&detach(parent,instance,type),instance.isObject3D&&(instance.visible=!1),invalidateInstance(instance)},unhideInstance(instance,props){var _instance$__r3f6;const{attach:type,parent:parent}=null!=(_instance$__r3f6=instance.__r3f)?_instance$__r3f6:{};type&&parent&&attach(parent,instance,type),(instance.isObject3D&&null==props.visible||props.visible)&&(instance.visible=!0),invalidateInstance(instance)},createTextInstance:handleTextInstance,hideTextInstance:handleTextInstance,unhideTextInstance:handleTextInstance,getCurrentEventPriority:()=>_getEventPriority?_getEventPriority():constants.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:"undefined"!=typeof performance&&is.fun(performance.now)?performance.now:is.fun(Date.now)?Date.now:()=>0,scheduleTimeout:is.fun(setTimeout)?setTimeout:void 0,cancelTimeout:is.fun(clearTimeout)?clearTimeout:void 0}),applyProps:applyProps$1}}(0,(function getEventPriority(){var _globalScope$event;const globalScope="undefined"!=typeof self&&self||"undefined"!=typeof window&&window;if(!globalScope)return constants.DefaultEventPriority;switch(null==(_globalScope$event=globalScope.event)?void 0:_globalScope$event.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return constants.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return constants.ContinuousEventPriority;default:return constants.DefaultEventPriority}})),shallowLoose={objects:"shallow",strict:!1},createRendererInstance=(gl,canvas)=>{const customRenderer="function"==typeof gl?gl(canvas):gl;return isRenderer(customRenderer)?customRenderer:new three_module.WebGLRenderer({powerPreference:"high-performance",canvas:canvas,antialias:!0,alpha:!0,...gl})};function createRoot(canvas){const prevRoot=roots.get(canvas),prevFiber=null==prevRoot?void 0:prevRoot.fiber,prevStore=null==prevRoot?void 0:prevRoot.store;prevRoot&&console.warn("R3F.createRoot should only be called once!");const logRecoverableError="function"==typeof reportError?reportError:console.error,store=prevStore||index_673ef987_esm_createStore(invalidate,advance),fiber=prevFiber||reconciler.createContainer(store,constants.ConcurrentRoot,null,!1,null,"",logRecoverableError,null);let onCreated;prevRoot||roots.set(canvas,{fiber:fiber,store:store});let lastCamera,configured=!1;return{configure(props={}){let{gl:glConfig,size:propsSize,scene:sceneOptions,events:events,onCreated:onCreatedCallback,shadows:shadows=!1,linear:linear=!1,flat:flat=!1,legacy:legacy=!1,orthographic:orthographic=!1,frameloop:frameloop="always",dpr:dpr=[1,2],performance:performance,raycaster:raycastOptions,camera:cameraOptions,onPointerMissed:onPointerMissed}=props,state=store.getState(),gl=state.gl;state.gl||state.set({gl:gl=createRendererInstance(glConfig,canvas)});let raycaster=state.raycaster;raycaster||state.set({raycaster:raycaster=new three_module.Raycaster});const{params:params,...options}=raycastOptions||{};if(is.equ(options,raycaster,shallowLoose)||applyProps(raycaster,{...options}),is.equ(params,raycaster.params,shallowLoose)||applyProps(raycaster,{params:{...raycaster.params,...params}}),!state.camera||state.camera===lastCamera&&!is.equ(lastCamera,cameraOptions,shallowLoose)){lastCamera=cameraOptions;const isCamera=cameraOptions instanceof three_module.Camera,camera=isCamera?cameraOptions:orthographic?new three_module.OrthographicCamera(0,0,0,0,.1,1e3):new three_module.PerspectiveCamera(75,0,.1,1e3);isCamera||(camera.position.z=5,cameraOptions&&applyProps(camera,cameraOptions),state.camera||null!=cameraOptions&&cameraOptions.rotation||camera.lookAt(0,0,0)),state.set({camera:camera})}if(!state.scene){let scene;sceneOptions instanceof three_module.Scene?scene=sceneOptions:(scene=new three_module.Scene,sceneOptions&&applyProps(scene,sceneOptions)),state.set({scene:prepare(scene)})}if(!state.xr){var _gl$xr;const handleXRFrame=(timestamp,frame)=>{const state=store.getState();"never"!==state.frameloop&&advance(timestamp,!0,state,frame)},handleSessionChange=()=>{const state=store.getState();state.gl.xr.enabled=state.gl.xr.isPresenting,state.gl.xr.setAnimationLoop(state.gl.xr.isPresenting?handleXRFrame:null),state.gl.xr.isPresenting||invalidate(state)},xr={connect(){const gl=store.getState().gl;gl.xr.addEventListener("sessionstart",handleSessionChange),gl.xr.addEventListener("sessionend",handleSessionChange)},disconnect(){const gl=store.getState().gl;gl.xr.removeEventListener("sessionstart",handleSessionChange),gl.xr.removeEventListener("sessionend",handleSessionChange)}};"function"==typeof(null==(_gl$xr=gl.xr)?void 0:_gl$xr.addEventListener)&&xr.connect(),state.set({xr:xr})}if(gl.shadowMap){const oldEnabled=gl.shadowMap.enabled,oldType=gl.shadowMap.type;if(gl.shadowMap.enabled=!!shadows,is.boo(shadows))gl.shadowMap.type=three_module.PCFSoftShadowMap;else if(is.str(shadows)){var _types$shadows;const types={basic:three_module.BasicShadowMap,percentage:three_module.PCFShadowMap,soft:three_module.PCFSoftShadowMap,variance:three_module.VSMShadowMap};gl.shadowMap.type=null!=(_types$shadows=types[shadows])?_types$shadows:three_module.PCFSoftShadowMap}else is.obj(shadows)&&Object.assign(gl.shadowMap,shadows);oldEnabled===gl.shadowMap.enabled&&oldType===gl.shadowMap.type||(gl.shadowMap.needsUpdate=!0)}const ColorManagement=getColorManagement();ColorManagement&&("enabled"in ColorManagement?ColorManagement.enabled=!legacy:"legacyMode"in ColorManagement&&(ColorManagement.legacyMode=legacy));applyProps(gl,{outputEncoding:linear?3e3:3001,toneMapping:flat?three_module.NoToneMapping:three_module.ACESFilmicToneMapping}),state.legacy!==legacy&&state.set((()=>({legacy:legacy}))),state.linear!==linear&&state.set((()=>({linear:linear}))),state.flat!==flat&&state.set((()=>({flat:flat}))),!glConfig||is.fun(glConfig)||isRenderer(glConfig)||is.equ(glConfig,gl,shallowLoose)||applyProps(gl,glConfig),events&&!state.events.handlers&&state.set({events:events(store)});const size=function computeInitialSize(canvas,defaultSize){if(defaultSize)return defaultSize;if("undefined"!=typeof HTMLCanvasElement&&canvas instanceof HTMLCanvasElement&&canvas.parentElement){const{width:width,height:height,top:top,left:left}=canvas.parentElement.getBoundingClientRect();return{width:width,height:height,top:top,left:left}}return"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?{width:canvas.width,height:canvas.height,top:0,left:0}:{width:0,height:0,top:0,left:0}}(canvas,propsSize);return is.equ(size,state.size,shallowLoose)||state.setSize(size.width,size.height,size.updateStyle,size.top,size.left),dpr&&state.viewport.dpr!==calculateDpr(dpr)&&state.setDpr(dpr),state.frameloop!==frameloop&&state.setFrameloop(frameloop),state.onPointerMissed||state.set({onPointerMissed:onPointerMissed}),performance&&!is.equ(performance,state.performance,shallowLoose)&&state.set((state=>({performance:{...state.performance,...performance}}))),onCreated=onCreatedCallback,configured=!0,this},render(children){return configured||this.configure(),reconciler.updateContainer(react.createElement(Provider,{store:store,children:children,onCreated:onCreated,rootElement:canvas}),fiber,null,(()=>{})),store},unmount(){unmountComponentAtNode(canvas)}}}function Provider({store:store,children:children,onCreated:onCreated,rootElement:rootElement}){return index_673ef987_esm_useIsomorphicLayoutEffect((()=>{const state=store.getState();state.set((state=>({internal:{...state.internal,active:!0}}))),onCreated&&onCreated(state),store.getState().events.connected||null==state.events.connect||state.events.connect(rootElement)}),[]),react.createElement(context.Provider,{value:store},children)}function unmountComponentAtNode(canvas,callback){const root=roots.get(canvas),fiber=null==root?void 0:root.fiber;if(fiber){const state=null==root?void 0:root.store.getState();state&&(state.internal.active=!1),reconciler.updateContainer(null,fiber,null,(()=>{state&&setTimeout((()=>{try{var _state$gl,_state$gl$renderLists,_state$gl2,_state$gl3;null==state.events.disconnect||state.events.disconnect(),null==(_state$gl=state.gl)||null==(_state$gl$renderLists=_state$gl.renderLists)||null==_state$gl$renderLists.dispose||_state$gl$renderLists.dispose(),null==(_state$gl2=state.gl)||null==_state$gl2.forceContextLoss||_state$gl2.forceContextLoss(),null!=(_state$gl3=state.gl)&&_state$gl3.xr&&state.xr.disconnect(),function dispose(obj){obj.dispose&&"Scene"!==obj.type&&obj.dispose();for(const p in obj)null==p.dispose||p.dispose(),delete obj[p]}(state),roots.delete(canvas),callback&&callback(canvas)}catch(e){}}),500)}))}}function createPortal(children,container,state){return react.createElement(Portal,{key:container.uuid,children:children,container:container,state:state})}function Portal({state:state={},children:children,container:container}){const{events:events,size:size,...rest}=state,previousRoot=useStore(),[raycaster]=react.useState((()=>new three_module.Raycaster)),[pointer]=react.useState((()=>new three_module.Vector2)),inject=react.useCallback(((rootState,injectState)=>{const intersect={...rootState};let viewport;if(Object.keys(rootState).forEach((key=>{(privateKeys.includes(key)||rootState[key]!==injectState[key]&&injectState[key])&&delete intersect[key]})),injectState&&size){const camera=injectState.camera;viewport=rootState.viewport.getCurrentViewport(camera,new three_module.Vector3,size),camera!==rootState.camera&&updateCamera(camera,size)}return{...intersect,scene:container,raycaster:raycaster,pointer:pointer,mouse:pointer,previousRoot:previousRoot,events:{...rootState.events,...null==injectState?void 0:injectState.events,...events},size:{...rootState.size,...size},viewport:{...rootState.viewport,...viewport},...rest}}),[state]),[usePortalStore]=react.useState((()=>{const previousState=previousRoot.getState(),store=create(((set,get)=>({...previousState,scene:container,raycaster:raycaster,pointer:pointer,mouse:pointer,previousRoot:previousRoot,events:{...previousState.events,...events},size:{...previousState.size,...size},...rest,set:set,get:get,setEvents:events=>set((state=>({...state,events:{...state.events,...events}})))})));return store}));return react.useEffect((()=>{const unsub=previousRoot.subscribe((prev=>usePortalStore.setState((state=>inject(prev,state)))));return()=>{unsub(),usePortalStore.destroy()}}),[]),react.useEffect((()=>{usePortalStore.setState((injectState=>inject(previousRoot.getState(),injectState)))}),[inject]),react.createElement(react.Fragment,null,reconciler.createPortal(react.createElement(context.Provider,{value:usePortalStore},children),usePortalStore,null))}reconciler.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:react.version});react.unstable_act},"./node_modules/@react-three/fiber/dist/react-three-fiber.esm.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Xz:function(){return Canvas}});var index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),node_modules_debounce=__webpack_require__("./node_modules/debounce/index.js"),debounce_default=__webpack_require__.n(node_modules_debounce);function useMeasure(_temp){let{debounce:debounce,scroll:scroll,polyfill:polyfill,offsetSize:offsetSize}=void 0===_temp?{debounce:0,scroll:!1,offsetSize:!1}:_temp;const ResizeObserver=polyfill||("undefined"==typeof window?class ResizeObserver{}:window.ResizeObserver);if(!ResizeObserver)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[bounds,set]=(0,react.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),state=(0,react.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:bounds}),scrollDebounce=debounce?"number"==typeof debounce?debounce:debounce.scroll:null,resizeDebounce=debounce?"number"==typeof debounce?debounce:debounce.resize:null,mounted=(0,react.useRef)(!1);(0,react.useEffect)((()=>(mounted.current=!0,()=>{mounted.current=!1})));const[forceRefresh,resizeChange,scrollChange]=(0,react.useMemo)((()=>{const callback=()=>{if(!state.current.element)return;const{left:left,top:top,width:width,height:height,bottom:bottom,right:right,x:x,y:y}=state.current.element.getBoundingClientRect(),size={left:left,top:top,width:width,height:height,bottom:bottom,right:right,x:x,y:y};state.current.element instanceof HTMLElement&&offsetSize&&(size.height=state.current.element.offsetHeight,size.width=state.current.element.offsetWidth),Object.freeze(size),mounted.current&&!areBoundsEqual(state.current.lastBounds,size)&&set(state.current.lastBounds=size)};return[callback,resizeDebounce?debounce_default()(callback,resizeDebounce):callback,scrollDebounce?debounce_default()(callback,scrollDebounce):callback]}),[set,offsetSize,scrollDebounce,resizeDebounce]);function removeListeners(){state.current.scrollContainers&&(state.current.scrollContainers.forEach((element=>element.removeEventListener("scroll",scrollChange,!0))),state.current.scrollContainers=null),state.current.resizeObserver&&(state.current.resizeObserver.disconnect(),state.current.resizeObserver=null)}function addListeners(){state.current.element&&(state.current.resizeObserver=new ResizeObserver(scrollChange),state.current.resizeObserver.observe(state.current.element),scroll&&state.current.scrollContainers&&state.current.scrollContainers.forEach((scrollContainer=>scrollContainer.addEventListener("scroll",scrollChange,{capture:!0,passive:!0}))))}return function useOnWindowScroll(onScroll,enabled){(0,react.useEffect)((()=>{if(enabled){const cb=onScroll;return window.addEventListener("scroll",cb,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",cb,!0)}}}),[onScroll,enabled])}(scrollChange,Boolean(scroll)),function useOnWindowResize(onWindowResize){(0,react.useEffect)((()=>{const cb=onWindowResize;return window.addEventListener("resize",cb),()=>{window.removeEventListener("resize",cb)}}),[onWindowResize])}(resizeChange),(0,react.useEffect)((()=>{removeListeners(),addListeners()}),[scroll,scrollChange,resizeChange]),(0,react.useEffect)((()=>removeListeners),[]),[node=>{node&&node!==state.current.element&&(removeListeners(),state.current.element=node,state.current.scrollContainers=findScrollContainers(node),addListeners())},bounds,forceRefresh]}function findScrollContainers(element){const result=[];if(!element||element===document.body)return result;const{overflow:overflow,overflowX:overflowX,overflowY:overflowY}=window.getComputedStyle(element);return[overflow,overflowX,overflowY].some((prop=>"auto"===prop||"scroll"===prop))&&result.push(element),[...result,...findScrollContainers(element.parentElement)]}const keys=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(a,b)=>keys.every((key=>a[key]===b[key]));var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};function traverseFiber(fiber,ascending,selector){if(!fiber)return;if(!0===selector(fiber))return fiber;let child=ascending?fiber.return:fiber.child;for(;child;){const match=traverseFiber(child,ascending,selector);if(match)return match;child=ascending?null:child.sibling}}function wrapContext(context){try{return Object.defineProperties(context,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(_){return context}}const FiberContext=wrapContext(react.createContext(null));class FiberProvider extends react.Component{render(){return react.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:ReactCurrentOwner,ReactCurrentDispatcher:ReactCurrentDispatcher}=react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const root=react.useContext(FiberContext);if(null===root)throw new Error("its-fine: useFiber must be called within a !");const id=react.useId();return react.useMemo((()=>{for(const maybeFiber of[null==ReactCurrentOwner?void 0:ReactCurrentOwner.current,root,null==root?void 0:root.alternate]){if(!maybeFiber)continue;const fiber2=traverseFiber(maybeFiber,!1,(node=>{let state=node.memoizedState;for(;state;){if(state.memoizedState===id)return!0;state=state.next}}));if(fiber2)return fiber2}}),[root,id])}function useContextBridge(){const contextMap=function useContextMap(){var _a,_b;const fiber=useFiber(),[contextMap]=react.useState((()=>new Map));contextMap.clear();let node=fiber;for(;node;){const context=null==(_a=node.type)?void 0:_a._context;context&&context!==FiberContext&&!contextMap.has(context)&&contextMap.set(context,null==(_b=null==ReactCurrentDispatcher?void 0:ReactCurrentDispatcher.current)?void 0:_b.readContext(wrapContext(context))),node=node.return}return contextMap}();return react.useMemo((()=>Array.from(contextMap.keys()).reduce(((Prev,context)=>props=>{return react.createElement(Prev,null,react.createElement(context.Provider,(a=__spreadValues({},props),b={value:contextMap.get(context)},__defProps(a,__getOwnPropDescs(b)))));var a,b}),(props=>react.createElement(FiberProvider,__spreadValues({},props))))),[contextMap])}__webpack_require__("./node_modules/react-reconciler/constants.js"),__webpack_require__("./node_modules/react-reconciler/index.js"),__webpack_require__("./node_modules/scheduler/index.js");const DOM_EVENTS={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 createPointerEvents(store){const{handlePointer:handlePointer}=(0,index_673ef987_esm.c)(store);return{priority:1,enabled:!0,compute(event,state,previous){state.pointer.set(event.offsetX/state.size.width*2-1,-event.offsetY/state.size.height*2+1),state.raycaster.setFromCamera(state.pointer,state.camera)},connected:void 0,handlers:Object.keys(DOM_EVENTS).reduce(((acc,key)=>({...acc,[key]:handlePointer(key)})),{}),update:()=>{var _internal$lastEvent;const{events:events,internal:internal}=store.getState();null!=(_internal$lastEvent=internal.lastEvent)&&_internal$lastEvent.current&&events.handlers&&events.handlers.onPointerMove(internal.lastEvent.current)},connect:target=>{var _events$handlers;const{set:set,events:events}=store.getState();null==events.disconnect||events.disconnect(),set((state=>({events:{...state.events,connected:target}}))),Object.entries(null!=(_events$handlers=events.handlers)?_events$handlers:[]).forEach((([name,event])=>{const[eventName,passive]=DOM_EVENTS[name];target.addEventListener(eventName,event,{passive:passive})}))},disconnect:()=>{const{set:set,events:events}=store.getState();var _events$handlers2;events.connected&&(Object.entries(null!=(_events$handlers2=events.handlers)?_events$handlers2:[]).forEach((([name,event])=>{if(events&&events.connected instanceof HTMLElement){const[eventName]=DOM_EVENTS[name];events.connected.removeEventListener(eventName,event)}})),set((state=>({events:{...state.events,connected:void 0}}))))}}}const CanvasImpl=react.forwardRef((function Canvas({children:children,fallback:fallback,resize:resize,style:style,gl:gl,events:events=createPointerEvents,eventSource:eventSource,eventPrefix:eventPrefix,shadows:shadows,linear:linear,flat:flat,legacy:legacy,orthographic:orthographic,frameloop:frameloop,dpr:dpr,performance:performance,raycaster:raycaster,camera:camera,onPointerMissed:onPointerMissed,onCreated:onCreated,...props},forwardedRef){react.useMemo((()=>(0,index_673ef987_esm.e)(three_module)),[]);const Bridge=useContextBridge(),[containerRef,containerRect]=useMeasure({scroll:!0,debounce:{scroll:50,resize:0},...resize}),canvasRef=react.useRef(null),divRef=react.useRef(null);react.useImperativeHandle(forwardedRef,(()=>canvasRef.current));const handlePointerMissed=(0,index_673ef987_esm.u)(onPointerMissed),[block,setBlock]=react.useState(!1),[error,setError]=react.useState(!1);if(block)throw block;if(error)throw error;const root=react.useRef(null);(0,index_673ef987_esm.a)((()=>{const canvas=canvasRef.current;containerRect.width>0&&containerRect.height>0&&canvas&&(root.current||(root.current=(0,index_673ef987_esm.b)(canvas)),root.current.configure({gl:gl,events:events,shadows:shadows,linear:linear,flat:flat,legacy:legacy,orthographic:orthographic,frameloop:frameloop,dpr:dpr,performance:performance,raycaster:raycaster,camera:camera,size:containerRect,onPointerMissed:(...args)=>null==handlePointerMissed.current?void 0:handlePointerMissed.current(...args),onCreated:state=>{null==state.events.connect||state.events.connect(eventSource?(0,index_673ef987_esm.i)(eventSource)?eventSource.current:eventSource:divRef.current),eventPrefix&&state.setEvents({compute:(event,state)=>{const x=event[eventPrefix+"X"],y=event[eventPrefix+"Y"];state.pointer.set(x/state.size.width*2-1,-y/state.size.height*2+1),state.raycaster.setFromCamera(state.pointer,state.camera)}}),null==onCreated||onCreated(state)}}),root.current.render(react.createElement(Bridge,null,react.createElement(index_673ef987_esm.E,{set:setError},react.createElement(react.Suspense,{fallback:react.createElement(index_673ef987_esm.B,{set:setBlock})},children)))))})),react.useEffect((()=>{const canvas=canvasRef.current;if(canvas)return()=>(0,index_673ef987_esm.d)(canvas)}),[]);const pointerEvents=eventSource?"none":"auto";return react.createElement("div",(0,esm_extends.Z)({ref:divRef,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:pointerEvents,...style}},props),react.createElement("div",{ref:containerRef,style:{width:"100%",height:"100%"}},react.createElement("canvas",{ref:canvasRef,style:{display:"block"}},fallback)))})),Canvas=react.forwardRef((function CanvasWrapper(props,ref){return react.createElement(FiberProvider,null,react.createElement(CanvasImpl,(0,esm_extends.Z)({},props,{ref:ref})))}))},"./node_modules/debounce/index.js":function(module){function debounce(func,wait,immediate){var timeout,args,context,timestamp,result;function later(){var last=Date.now()-timestamp;last=0?timeout=setTimeout(later,wait-last):(timeout=null,immediate||(result=func.apply(context,args),context=args=null))}null==wait&&(wait=100);var debounced=function(){context=this,args=arguments,timestamp=Date.now();var callNow=immediate&&!timeout;return timeout||(timeout=setTimeout(later,wait)),callNow&&(result=func.apply(context,args),context=args=null),result};return debounced.clear=function(){timeout&&(clearTimeout(timeout),timeout=null)},debounced.flush=function(){timeout&&(result=func.apply(context,args),context=args=null,clearTimeout(timeout),timeout=null)},debounced}debounce.debounce=debounce,module.exports=debounce},"./node_modules/fflate/esm/browser.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{HT:function(){return unzlibSync}});var u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(eb,start){for(var b=new u16(31),i=0;i<31;++i)b[i]=start+=1<>>1|(21845&i)<<1;x=(61680&(x=(52428&x)>>>2|(13107&x)<<2))>>>4|(3855&x)<<4,rev[i]=((65280&x)>>>8|(255&x)<<8)>>>1}var hMap=function(cd,mb,r){for(var s=cd.length,i=0,l=new u16(mb);i>>rvb]=sv}else for(co=new u16(s),i=0;i>>15-cd[i]);return co},flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;for(i=144;i<256;++i)flt[i]=9;for(i=256;i<280;++i)flt[i]=7;for(i=280;i<288;++i)flt[i]=8;var fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var flrm=hMap(flt,9,1),fdrm=hMap(fdt,5,1),max=function(a){for(var m=a[0],i=1;im&&(m=a[i]);return m},bits=function(d,p,m){var o=p/8|0;return(d[o]|d[o+1]<<8)>>(7&p)&m},bits16=function(d,p){var o=p/8|0;return(d[o]|d[o+1]<<8|d[o+2]<<16)>>(7&p)},shft=function(p){return(p/8|0)+(7&p&&1)},slc=function(v,s,e){(null==s||s<0)&&(s=0),(null==e||e>v.length)&&(e=v.length);var n=new(v instanceof u16?u16:v instanceof u32?u32:u8)(e-s);return n.set(v.subarray(s,e)),n},inflt=function(dat,buf,st){var sl=dat.length;if(!sl||st&&!st.l&&sl<5)return buf||new u8(0);var noBuf=!buf||st,noSt=!st||st.i;st||(st={}),buf||(buf=new u8(3*sl));var cbuf=function(l){var bl=buf.length;if(l>bl){var nbuf=new u8(Math.max(2*bl,l));nbuf.set(buf),buf=nbuf}},final=st.f||0,pos=st.p||0,bt=st.b||0,lm=st.l,dm=st.d,lbt=st.m,dbt=st.n,tbts=8*sl;do{if(!lm){st.f=final=bits(dat,pos,1);var type=bits(dat,pos+1,3);if(pos+=3,!type){var l=dat[(s=shft(pos)+4)-4]|dat[s-3]<<8,t=s+l;if(t>sl){if(noSt)throw"unexpected EOF";break}noBuf&&cbuf(bt+l),buf.set(dat.subarray(s,t),bt),st.b=bt+=l,st.p=pos=8*t;continue}if(1==type)lm=flrm,dm=fdrm,lbt=9,dbt=5;else{if(2!=type)throw"invalid block type";var hLit=bits(dat,pos,31)+257,hcLen=bits(dat,pos+10,15)+4,tl=hLit+bits(dat,pos+5,31)+1;pos+=14;for(var ldt=new u8(tl),clt=new u8(19),i=0;i>>4)<16)ldt[i++]=s;else{var c=0,n=0;for(16==s?(n=3+bits(dat,pos,3),pos+=2,c=ldt[i-1]):17==s?(n=3+bits(dat,pos,7),pos+=3):18==s&&(n=11+bits(dat,pos,127),pos+=7);n--;)ldt[i++]=c}}var lt=ldt.subarray(0,hLit),dt=ldt.subarray(hLit);lbt=max(lt),dbt=max(dt),lm=hMap(lt,lbt,1),dm=hMap(dt,dbt,1)}if(pos>tbts){if(noSt)throw"unexpected EOF";break}}noBuf&&cbuf(bt+131072);for(var lms=(1<>>4;if((pos+=15&c)>tbts){if(noSt)throw"unexpected EOF";break}if(!c)throw"invalid length/literal";if(sym<256)buf[bt++]=sym;else{if(256==sym){lpos=pos,lm=null;break}var add=sym-254;if(sym>264){var b=fleb[i=sym-257];add=bits(dat,pos,(1<>>4;if(!d)throw"invalid distance";pos+=15&d;dt=fd[dsym];if(dsym>3){b=fdeb[dsym];dt+=bits16(dat,pos)&(1<tbts){if(noSt)throw"unexpected EOF";break}noBuf&&cbuf(bt+131072);for(var end=bt+add;bt>>4>7||(d[0]<<8|d[1])%31)throw"invalid zlib data";if(32&d[1])throw"invalid zlib data: preset dictionaries not supported"};function unzlibSync(data,out){return inflt((zlv(data),data.subarray(2,-4)),out)}var td="undefined"!=typeof TextDecoder&&new TextDecoder;try{td.decode(et,{stream:!0}),1}catch(e){}},"./node_modules/jotai/esm/react.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Dv:function(){return useAtomValue},b9:function(){return useSetAtom},zt:function(){return Provider}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),jotai_vanilla__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/jotai/esm/vanilla.mjs");const StoreContext=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(void 0),useStore=options=>{const store=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(StoreContext);return(null==options?void 0:options.store)||store||(0,jotai_vanilla__WEBPACK_IMPORTED_MODULE_1__.K7)()},Provider=({children:children,store:store})=>{const storeRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();return store||storeRef.current||(storeRef.current=(0,jotai_vanilla__WEBPACK_IMPORTED_MODULE_1__.MT)()),(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(StoreContext.Provider,{value:store||storeRef.current},children)},isPromiseLike=x=>"function"==typeof(null==x?void 0:x.then),use=react__WEBPACK_IMPORTED_MODULE_0__.use||(promise=>{if("pending"===promise.status)throw promise;if("fulfilled"===promise.status)return promise.value;throw"rejected"===promise.status?promise.reason:(promise.status="pending",promise.then((v=>{promise.status="fulfilled",promise.value=v}),(e=>{promise.status="rejected",promise.reason=e})),promise)});function useAtomValue(atom,options){const store=useStore(options),[[valueFromReducer,storeFromReducer,atomFromReducer],rerender]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)((prev=>{const nextValue=store.get(atom);return Object.is(prev[0],nextValue)&&prev[1]===store&&prev[2]===atom?prev:[nextValue,store,atom]}),void 0,(()=>[store.get(atom),store,atom]));let value=valueFromReducer;storeFromReducer===store&&atomFromReducer===atom||(rerender(),value=store.get(atom));const delay=null==options?void 0:options.delay;return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const unsub=store.sub(atom,(()=>{"number"!=typeof delay?rerender():setTimeout(rerender,delay)}));return rerender(),unsub}),[store,atom,delay]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useDebugValue)(value),isPromiseLike(value)?use(value):value}function useSetAtom(atom,options){const store=useStore(options);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(((...args)=>{if(!("write"in atom))throw new Error("not writable atom");return store.set(atom,...args)}),[store,atom])}},"./node_modules/jotai/esm/vanilla.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{K7:function(){return getDefaultStore},MT:function(){return createStore},cn:function(){return atom}});let keyCount=0;function atom(read,write){const key="atom"+ ++keyCount,config={toString:()=>key};return"function"==typeof read?config.read=read:(config.init=read,config.read=get=>get(config),config.write=(get,set,arg)=>set(config,"function"==typeof arg?arg(get(config)):arg)),write&&(config.write=write),config}const hasInitialValue=atom=>"init"in atom,isActuallyWritableAtom=atom=>!!atom.write,cancelPromiseMap=new WeakMap,cancelPromise=(promise,next)=>{const cancel=cancelPromiseMap.get(promise);cancel&&(cancelPromiseMap.delete(promise),cancel(next))},resolvePromise=(promise,value)=>{promise.status="fulfilled",promise.value=value},rejectPromise=(promise,e)=>{promise.status="rejected",promise.reason=e},isEqualAtomValue=(a,b)=>"v"in a&&"v"in b&&Object.is(a.v,b.v),isEqualAtomError=(a,b)=>"e"in a&&"e"in b&&Object.is(a.e,b.e),hasPromiseAtomValue=a=>"v"in a&&a.v instanceof Promise,returnAtomValue=atomState=>{if("e"in atomState)throw atomState.e;return atomState.v},createStore=()=>{const atomStateMap=new WeakMap,mountedMap=new WeakMap,pendingMap=new Map;let storeListenersRev1,storeListenersRev2,mountedAtoms;storeListenersRev1=new Set,storeListenersRev2=new Set,mountedAtoms=new Set;const getAtomState=atom=>atomStateMap.get(atom),setAtomState=(atom,atomState)=>{Object.freeze(atomState);const prevAtomState=atomStateMap.get(atom);if(atomStateMap.set(atom,atomState),pendingMap.has(atom)||pendingMap.set(atom,prevAtomState),prevAtomState&&hasPromiseAtomValue(prevAtomState)){const next="v"in atomState?atomState.v instanceof Promise?atomState.v:Promise.resolve(atomState.v):Promise.reject(atomState.e);cancelPromise(prevAtomState.v,next)}},updateDependencies=(atom,nextAtomState,nextDependencies)=>{const dependencies=new Map;let changed=!1;nextDependencies.forEach(((aState,a)=>{aState||a!==atom||(aState=nextAtomState),aState?(dependencies.set(a,aState),nextAtomState.d.get(a)!==aState&&(changed=!0)):console.warn("[Bug] atom state not found")})),(changed||nextAtomState.d.size!==dependencies.size)&&(nextAtomState.d=dependencies)},setAtomValue=(atom,value,nextDependencies)=>{const prevAtomState=getAtomState(atom),nextAtomState={d:(null==prevAtomState?void 0:prevAtomState.d)||new Map,v:value};if(nextDependencies&&updateDependencies(atom,nextAtomState,nextDependencies),prevAtomState&&isEqualAtomValue(prevAtomState,nextAtomState)&&prevAtomState.d===nextAtomState.d)return prevAtomState;if(prevAtomState&&hasPromiseAtomValue(prevAtomState)&&hasPromiseAtomValue(nextAtomState)&&(b=nextAtomState,"v"in(a=prevAtomState)&&"v"in b&&a.v.orig&&a.v.orig===b.v.orig)){if(prevAtomState.d===nextAtomState.d)return prevAtomState;nextAtomState.v=prevAtomState.v}var a,b;return setAtomState(atom,nextAtomState),nextAtomState},setAtomValueOrPromise=(atom,valueOrPromise,nextDependencies,abortPromise)=>{if("function"==typeof(null==(x=valueOrPromise)?void 0:x.then)){let continuePromise;const promise=new Promise(((resolve,reject)=>{let settled=!1;valueOrPromise.then((v=>{if(!settled){settled=!0;const prevAtomState=getAtomState(atom),nextAtomState=setAtomValue(atom,promise,nextDependencies);resolvePromise(promise,v),resolve(v),(null==prevAtomState?void 0:prevAtomState.d)!==nextAtomState.d&&mountDependencies(atom,nextAtomState,null==prevAtomState?void 0:prevAtomState.d)}}),(e=>{if(!settled){settled=!0;const prevAtomState=getAtomState(atom),nextAtomState=setAtomValue(atom,promise,nextDependencies);rejectPromise(promise,e),reject(e),(null==prevAtomState?void 0:prevAtomState.d)!==nextAtomState.d&&mountDependencies(atom,nextAtomState,null==prevAtomState?void 0:prevAtomState.d)}})),continuePromise=next=>{settled||(settled=!0,next.then((v=>resolvePromise(promise,v)),(e=>rejectPromise(promise,e))),resolve(next))}}));return promise.orig=valueOrPromise,promise.status="pending",((promise,cancel)=>{cancelPromiseMap.set(promise,cancel),promise.catch((()=>{})).finally((()=>cancelPromiseMap.delete(promise)))})(promise,(next=>{next&&continuePromise(next),null==abortPromise||abortPromise()})),setAtomValue(atom,promise,nextDependencies)}var x;return setAtomValue(atom,valueOrPromise,nextDependencies)},readAtomState=atom=>{const atomState=getAtomState(atom);if(atomState&&(atomState.d.forEach(((_,a)=>{a===atom||mountedMap.has(a)||readAtomState(a)})),Array.from(atomState.d).every((([a,s])=>{const aState=getAtomState(a);return a===atom||aState===s||aState&&!hasPromiseAtomValue(aState)&&isEqualAtomValue(aState,s)}))))return atomState;const nextDependencies=new Map;let isSync=!0;const getter=a=>{if(a===atom){const aState2=getAtomState(a);if(aState2)return nextDependencies.set(a,aState2),returnAtomValue(aState2);if(hasInitialValue(a))return nextDependencies.set(a,void 0),a.init;throw new Error("no atom init")}const aState=readAtomState(a);return nextDependencies.set(a,aState),returnAtomValue(aState)};let controller,setSelf;const options={get signal(){return controller||(controller=new AbortController),controller.signal},get setSelf(){return isActuallyWritableAtom(atom)||console.warn("setSelf function cannot be used with read-only atom"),!setSelf&&isActuallyWritableAtom(atom)&&(setSelf=(...args)=>{if(isSync&&console.warn("setSelf function cannot be called in sync"),!isSync)return writeAtom(atom,...args)}),setSelf}};try{const valueOrPromise=atom.read(getter,options);return setAtomValueOrPromise(atom,valueOrPromise,nextDependencies,(()=>null==controller?void 0:controller.abort()))}catch(error){return((atom,error,nextDependencies)=>{const prevAtomState=getAtomState(atom),nextAtomState={d:(null==prevAtomState?void 0:prevAtomState.d)||new Map,e:error};return nextDependencies&&updateDependencies(atom,nextAtomState,nextDependencies),prevAtomState&&isEqualAtomError(prevAtomState,nextAtomState)&&prevAtomState.d===nextAtomState.d?prevAtomState:(setAtomState(atom,nextAtomState),nextAtomState)})(atom,error,nextDependencies)}finally{isSync=!1}},readAtom=atom=>returnAtomValue(readAtomState(atom)),canUnmountAtom=(atom,mounted)=>!mounted.l.size&&(!mounted.t.size||1===mounted.t.size&&mounted.t.has(atom)),recomputeDependents=atom=>{const dependencyMap=new Map,dirtyMap=new WeakMap,loop1=a=>{const mounted=mountedMap.get(a);null==mounted||mounted.t.forEach((dependent=>{dependent!==a&&(dependencyMap.set(dependent,(dependencyMap.get(dependent)||new Set).add(a)),dirtyMap.set(dependent,(dirtyMap.get(dependent)||0)+1),loop1(dependent))}))};loop1(atom);const loop2=a=>{const mounted=mountedMap.get(a);null==mounted||mounted.t.forEach((dependent=>{var _a;if(dependent!==a){let dirtyCount=dirtyMap.get(dependent);if(dirtyCount&&dirtyMap.set(dependent,--dirtyCount),!dirtyCount){let isChanged=!!(null==(_a=dependencyMap.get(dependent))?void 0:_a.size);if(isChanged){const prevAtomState=getAtomState(dependent),nextAtomState=readAtomState(dependent);isChanged=!prevAtomState||!isEqualAtomValue(prevAtomState,nextAtomState)}isChanged||dependencyMap.forEach((s=>s.delete(dependent)))}loop2(dependent)}}))};loop2(atom)},writeAtomState=(atom,...args)=>{let isSync=!0;const result=atom.write((a=>returnAtomValue(readAtomState(a))),((a,...args2)=>{let r;if(a===atom){if(!hasInitialValue(a))throw new Error("atom not writable");const prevAtomState=getAtomState(a),nextAtomState=setAtomValueOrPromise(a,args2[0]);prevAtomState&&isEqualAtomValue(prevAtomState,nextAtomState)||recomputeDependents(a)}else r=writeAtomState(a,...args2);if(!isSync){const flushed=flushPending();storeListenersRev2.forEach((l=>l({type:"async-write",flushed:flushed})))}return r}),...args);return isSync=!1,result},writeAtom=(atom,...args)=>{const result=writeAtomState(atom,...args),flushed=flushPending();return storeListenersRev2.forEach((l=>l({type:"write",flushed:flushed}))),result},mountAtom=(atom,initialDependent)=>{const mounted={t:new Set(initialDependent&&[initialDependent]),l:new Set};if(mountedMap.set(atom,mounted),mountedAtoms.add(atom),readAtomState(atom).d.forEach(((_,a)=>{const aMounted=mountedMap.get(a);aMounted?aMounted.t.add(atom):a!==atom&&mountAtom(a,atom)})),readAtomState(atom),isActuallyWritableAtom(atom)&&atom.onMount){const onUnmount=atom.onMount(((...args)=>writeAtom(atom,...args)));onUnmount&&(mounted.u=onUnmount)}return mounted},unmountAtom=atom=>{var _a;const onUnmount=null==(_a=mountedMap.get(atom))?void 0:_a.u;onUnmount&&onUnmount(),mountedMap.delete(atom),mountedAtoms.delete(atom);const atomState=getAtomState(atom);atomState?(hasPromiseAtomValue(atomState)&&cancelPromise(atomState.v),atomState.d.forEach(((_,a)=>{if(a!==atom){const mounted=mountedMap.get(a);mounted&&(mounted.t.delete(atom),canUnmountAtom(a,mounted)&&unmountAtom(a))}}))):console.warn("[Bug] could not find atom state to unmount",atom)},mountDependencies=(atom,atomState,prevDependencies)=>{const depSet=new Set(atomState.d.keys());null==prevDependencies||prevDependencies.forEach(((_,a)=>{if(depSet.has(a))return void depSet.delete(a);const mounted=mountedMap.get(a);mounted&&(mounted.t.delete(atom),canUnmountAtom(a,mounted)&&unmountAtom(a))})),depSet.forEach((a=>{const mounted=mountedMap.get(a);mounted?mounted.t.add(atom):mountedMap.has(atom)&&mountAtom(a,atom)}))},flushPending=()=>{let flushed;for(flushed=new Set;pendingMap.size;){const pending=Array.from(pendingMap);pendingMap.clear(),pending.forEach((([atom,prevAtomState])=>{const atomState=getAtomState(atom);if(atomState){atomState.d!==(null==prevAtomState?void 0:prevAtomState.d)&&mountDependencies(atom,atomState,null==prevAtomState?void 0:prevAtomState.d);const mounted=mountedMap.get(atom);!mounted||prevAtomState&&!hasPromiseAtomValue(prevAtomState)&&(isEqualAtomValue(prevAtomState,atomState)||isEqualAtomError(prevAtomState,atomState))||(mounted.l.forEach((listener=>listener())),flushed.add(atom))}else console.warn("[Bug] no atom state to flush")}))}return storeListenersRev1.forEach((l=>l("state"))),flushed},subscribeAtom=(atom,listener)=>{const mounted=(atom=>{let mounted=mountedMap.get(atom);return mounted||(mounted=mountAtom(atom)),mounted})(atom),flushed=flushPending(),listeners=mounted.l;return listeners.add(listener),storeListenersRev1.forEach((l=>l("sub"))),storeListenersRev2.forEach((l=>l({type:"sub",flushed:flushed}))),()=>{listeners.delete(listener),(atom=>{const mounted=mountedMap.get(atom);mounted&&canUnmountAtom(atom,mounted)&&unmountAtom(atom)})(atom),storeListenersRev1.forEach((l=>l("unsub"))),storeListenersRev2.forEach((l=>l({type:"unsub"})))}};return{get:readAtom,set:writeAtom,sub:subscribeAtom,dev_subscribe_store:(l,rev)=>2!==rev?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),storeListenersRev1.add(l),()=>{storeListenersRev1.delete(l)}):(storeListenersRev2.add(l),()=>{storeListenersRev2.delete(l)}),dev_get_mounted_atoms:()=>mountedAtoms.values(),dev_get_atom_state:a=>atomStateMap.get(a),dev_get_mounted:a=>mountedMap.get(a),dev_restore_atoms:values=>{for(const[atom,valueOrPromise]of values)hasInitialValue(atom)&&(setAtomValueOrPromise(atom,valueOrPromise),recomputeDependents(atom));const flushed=flushPending();storeListenersRev2.forEach((l=>l({type:"restore",flushed:flushed})))}}};let defaultStore;const getDefaultStore=()=>(defaultStore||(defaultStore=createStore()),defaultStore);globalThis.__JOTAI_PACKAGE_IS_LOADED__?console.warn("Detected multiple Jotai instances. It may cause unexpected behavior. https://github.com/pmndrs/jotai/discussions/2044"):globalThis.__JOTAI_PACKAGE_IS_LOADED__=!0},"./node_modules/react-reconciler/cjs/react-reconciler-constants.production.min.js":function(__unused_webpack_module,exports){"use strict";exports.ConcurrentRoot=1,exports.ContinuousEventPriority=4,exports.DefaultEventPriority=16,exports.DiscreteEventPriority=1},"./node_modules/react-reconciler/cjs/react-reconciler.production.min.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function $$$reconciler($$$hostConfig){var exports={},aa=__webpack_require__("./node_modules/react/index.js"),ba=__webpack_require__("./node_modules/scheduler/index.js"),ca=Object.assign;function n(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c--h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");return a.displayName&&k.includes("")&&(k=k.replace("",a.displayName)),k}}while(1<=g&&0<=h);break}}}finally{bc=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?ac(a):""}var dc=Object.prototype.hasOwnProperty,ec=[],fc=-1;function gc(a){return{current:a}}function x(a){0>fc||(a.current=ec[fc],ec[fc]=null,fc--)}function y(a,b){fc++,ec[fc]=a.current,a.current=b}var hc={},A=gc(hc),B=gc(!1),ic=hc;function jc(a,b){var c=a.type.contextTypes;if(!c)return hc;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var f,e={};for(f in c)e[f]=b[f];return d&&((a=a.stateNode).__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e),e}function C(a){return null!=(a=a.childContextTypes)}function kc(){x(B),x(A)}function lc(a,b,c){if(A.current!==hc)throw Error(n(168));y(A,b),y(B,c)}function mc(a,b,c){var d=a.stateNode;if(b=b.childContextTypes,"function"!=typeof d.getChildContext)return c;for(var e in d=d.getChildContext())if(!(e in b))throw Error(n(108,xa(a)||"Unknown",e));return ca({},c,d)}function nc(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||hc,ic=A.current,y(A,a),y(B,B.current),!0}function oc(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=mc(a,b,ic),d.__reactInternalMemoizedMergedChildContext=a,x(B),x(A),y(A,a)):x(B),y(B,c)}var qc=Math.clz32?Math.clz32:function pc(a){return 0===(a>>>=0)?32:31-(rc(a)/sc|0)|0},rc=Math.log,sc=Math.LN2;var tc=64,uc=4194304;function vc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&a;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&a;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function wc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=268435455&c;if(0!==g){var h=g&~e;0!==h?d=vc(h):0!==(f&=g)&&(d=vc(f))}else 0!==(g=c&~e)?d=vc(g):0!==f&&(d=vc(f));if(0===d)return 0;if(0!==b&&b!==d&&0==(b&e)&&((e=d&-d)>=(f=b&-b)||16===e&&0!=(4194240&f)))return b;if(0!=(4&d)&&(d|=16&c),0!==(b=a.entangledLanes))for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}function Bc(a,b,c){a.pendingLanes|=b,536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0),(a=a.eventTimes)[b=31-qc(b)]=c}function Dc(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-qc(c),e=1<>=g,e-=g,Nd=1<<32-qc(b)+e|c<u?(t=w,w=null):t=w.sibling;var q=r(e,w,h[u],k);if(null===q){null===w&&(w=t);break}a&&w&&null===q.alternate&&b(e,w),g=f(q,g,u),null===m?l=q:m.sibling=q,m=q,w=t}if(u===h.length)return c(e,w),I&&Pd(e,u),l;if(null===w){for(;uu?(q=m,m=null):q=m.sibling;var V=r(e,m,t.value,k);if(null===V){null===m&&(m=q);break}a&&m&&null===V.alternate&&b(e,m),g=f(V,g,u),null===w?l=V:w.sibling=V,w=V,m=q}if(t.done)return c(e,m),I&&Pd(e,u),l;if(null===m){for(;!t.done;u++,t=h.next())null!==(t=v(e,t.value,k))&&(g=f(t,g,u),null===w?l=t:w.sibling=t,w=t);return I&&Pd(e,u),l}for(m=d(e,m);!t.done;u++,t=h.next())null!==(t=z(m,e,u,t.value,k))&&(a&&null!==t.alternate&&m.delete(null===t.key?u:t.key),g=f(t,g,u),null===w?l=t:w.sibling=t,w=t);return a&&m.forEach((function(a){return b(e,a)})),I&&Pd(e,u),l}return function da(a,d,f,h){if("object"==typeof f&&null!==f&&f.type===ia&&null===f.key&&(f=f.props.children),"object"==typeof f&&null!==f){switch(f.$$typeof){case fa:a:{for(var k=f.key,l=d;null!==l;){if(l.key===k){if((k=f.type)===ia){if(7===l.tag){c(a,l.sibling),(d=e(l,f.props.children)).return=a,a=d;break a}}else if(l.elementType===k||"object"==typeof k&&null!==k&&k.$$typeof===ra&&he(k)===l.type){c(a,l.sibling),(d=e(l,f.props)).ref=fe(a,l,f),d.return=a,a=d;break a}c(a,l);break}b(a,l),l=l.sibling}f.type===ia?((d=ne(f.props.children,a.mode,h,f.key)).return=a,a=d):((h=le(f.type,f.key,f.props,null,a.mode,h)).ref=fe(a,d,f),h.return=a,a=h)}return g(a);case ha:a:{for(l=f.key;null!==d;){if(d.key===l){if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling),(d=e(d,f.children||[])).return=a,a=d;break a}c(a,d);break}b(a,d),d=d.sibling}(d=me(f,a.mode,h)).return=a,a=d}return g(a);case ra:return da(a,d,(l=f._init)(f._payload),h)}if(Ea(f))return q(a,d,f,h);if(ua(f))return N(a,d,f,h);ge(a,f)}return"string"==typeof f&&""!==f||"number"==typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),(d=e(d,f)).return=a,a=d):(c(a,d),(d=ke(f,a.mode,h)).return=a,a=d),g(a)):c(a,d)}}var oe=ie(!0),pe=ie(!1),qe={},re=gc(qe),se=gc(qe),te=gc(qe);function ue(a){if(a===qe)throw Error(n(174));return a}function ve(a,b){y(te,b),y(se,a),y(re,qe),a=Ga(b),x(re),y(re,a)}function we(){x(re),x(se),x(te)}function xe(a){var b=ue(te.current),c=ue(re.current);c!==(b=Ha(c,a.type,b))&&(y(se,a),y(re,b))}function ye(a){se.current===a&&(x(re),x(se))}var J=gc(0);function ze(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(null===(c=c.dehydrated)||Ib(c)||Jb(c)))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!=(128&b.flags))return b}else if(null!==b.child){b.child.return=b,b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return,b=b.sibling}return null}var Ae=[];function Be(){for(var a=0;ac?c:4,a(!0);var d=De.transition;De.transition={};try{a(!1),b()}finally{D=c,De.transition=d}}function rf(){return Re().memoizedState}function sf(a,b,c){var d=zd(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null},tf(a)?uf(b,c):(vf(a,b,c),null!==(a=Ad(a,d,c=H()))&&wf(a,b,d))}function df(a,b,c){var d=zd(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(tf(a))uf(b,e);else{vf(a,b,e);var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&null!==(f=b.lastRenderedReducer))try{var g=b.lastRenderedState,h=f(g,c);if(e.hasEagerState=!0,e.eagerState=h,Rc(h,g))return}catch(k){}null!==(a=Ad(a,d,c=H()))&&wf(a,b,d)}}function tf(a){var b=a.alternate;return a===K||null!==b&&b===K}function uf(a,b){Ge=Fe=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b),a.pending=b}function vf(a,b,c){null!==F&&0!=(1&a.mode)&&0==(2&G)?(null===(a=b.interleaved)?(c.next=c,null===md?md=[b]:md.push(b)):(c.next=a.next,a.next=c),b.interleaved=c):(null===(a=b.pending)?c.next=c:(c.next=a.next,a.next=c),b.pending=c)}function wf(a,b,c){if(0!=(4194240&c)){var d=b.lanes;c|=d&=a.pendingLanes,b.lanes=c,Dc(a,c)}}var Oe={readContext:ld,useCallback:O,useContext:O,useEffect:O,useImperativeHandle:O,useInsertionEffect:O,useLayoutEffect:O,useMemo:O,useReducer:O,useRef:O,useState:O,useDebugValue:O,useDeferredValue:O,useTransition:O,useMutableSource:O,useSyncExternalStore:O,useId:O,unstable_isNewReconciler:!1},Le={readContext:ld,useCallback:function(a,b){return Qe().memoizedState=[a,void 0===b?null:b],a},useContext:ld,useEffect:hf,useImperativeHandle:function(a,b,c){return c=null!=c?c.concat([a]):null,ff(4194308,4,lf.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ff(4194308,4,a,b)},useInsertionEffect:function(a,b){return ff(4,2,a,b)},useMemo:function(a,b){var c=Qe();return b=void 0===b?null:b,a=a(),c.memoizedState=[a,b],a},useReducer:function(a,b,c){var d=Qe();return b=void 0!==c?c(b):b,d.memoizedState=d.baseState=b,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},d.queue=a,a=a.dispatch=sf.bind(null,K,a),[d.memoizedState,a]},useRef:function(a){return a={current:a},Qe().memoizedState=a},useState:cf,useDebugValue:nf,useDeferredValue:function(a){var b=cf(a),c=b[0],d=b[1];return hf((function(){var b=De.transition;De.transition={};try{d(a)}finally{De.transition=b}}),[a]),c},useTransition:function(){var a=cf(!1),b=a[0];return a=qf.bind(null,a[1]),Qe().memoizedState=a,[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=K,e=Qe();if(I){if(void 0===c)throw Error(n(407));c=c()}else{if(c=b(),null===F)throw Error(n(349));0!=(30&Ee)||af(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};return e.queue=f,hf(Ye.bind(null,d,f,a),[a]),d.flags|=2048,Ze(9,$e.bind(null,d,f,c,b),void 0,null),c},useId:function(){var a=Qe(),b=F.identifierPrefix;if(I){var c=Od;b=":"+b+"R"+(c=(Nd&~(1<<32-qc(Nd)-1)).toString(32)+c),0<(c=He++)&&(b+="H"+c.toString(32)),b+=":"}else b=":"+b+"r"+(c=Ie++).toString(32)+":";return a.memoizedState=b},unstable_isNewReconciler:!1},Me={readContext:ld,useCallback:of,useContext:ld,useEffect:Xe,useImperativeHandle:mf,useInsertionEffect:jf,useLayoutEffect:kf,useMemo:pf,useReducer:Te,useRef:ef,useState:function(){return Te(Se)},useDebugValue:nf,useDeferredValue:function(a){var b=Te(Se),c=b[0],d=b[1];return Xe((function(){var b=De.transition;De.transition={};try{d(a)}finally{De.transition=b}}),[a]),c},useTransition:function(){return[Te(Se)[0],Re().memoizedState]},useMutableSource:Ve,useSyncExternalStore:We,useId:rf,unstable_isNewReconciler:!1},Ne={readContext:ld,useCallback:of,useContext:ld,useEffect:Xe,useImperativeHandle:mf,useInsertionEffect:jf,useLayoutEffect:kf,useMemo:pf,useReducer:Ue,useRef:ef,useState:function(){return Ue(Se)},useDebugValue:nf,useDeferredValue:function(a){var b=Ue(Se),c=b[0],d=b[1];return Xe((function(){var b=De.transition;De.transition={};try{d(a)}finally{De.transition=b}}),[a]),c},useTransition:function(){return[Ue(Se)[0],Re().memoizedState]},useMutableSource:Ve,useSyncExternalStore:We,useId:rf,unstable_isNewReconciler:!1};function xf(a,b){try{var c="",d=b;do{c+=$c(d),d=d.return}while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack}return{value:a,source:b,stack:e}}function yf(a,b){try{console.error(b.value)}catch(c){setTimeout((function(){throw c}))}}var Lf,Mf,Nf,Of,zf="function"==typeof WeakMap?WeakMap:Map;function Af(a,b,c){(c=qd(-1,c)).tag=3,c.payload={element:null};var d=b.value;return c.callback=function(){Bf||(Bf=!0,Cf=d),yf(0,b)},c}function Df(a,b,c){(c=qd(-1,c)).tag=3;var d=a.type.getDerivedStateFromError;if("function"==typeof d){var e=b.value;c.payload=function(){return d(e)},c.callback=function(){yf(0,b)}}var f=a.stateNode;return null!==f&&"function"==typeof f.componentDidCatch&&(c.callback=function(){yf(0,b),"function"!=typeof d&&(null===Ef?Ef=new Set([this]):Ef.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})}),c}function Ff(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new zf;var e=new Set;d.set(b,e)}else void 0===(e=d.get(b))&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=Gf.bind(null,a,b,c),b.then(a,a))}function Hf(a){do{var b;if((b=13===a.tag)&&(b=null===(b=a.memoizedState)||null!==b.dehydrated),b)return a;a=a.return}while(null!==a);return null}function If(a,b,c,d,e){return 0==(1&a.mode)?(a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:((b=qd(-1,1)).tag=2,rd(c,b))),c.lanes|=1),a):(a.flags|=65536,a.lanes=e,a)}function Jf(a){a.flags|=4}function Kf(a,b){if(null!==a&&a.child===b.child)return!0;if(0!=(16&b.flags))return!1;for(a=b.child;null!==a;){if(0!=(12854&a.flags)||0!=(12854&a.subtreeFlags))return!1;a=a.sibling}return!0}if(Ua)Lf=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)La(a,c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c,c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},Mf=function(){},Nf=function(a,b,c,d,e){if((a=a.memoizedProps)!==d){var f=b.stateNode,g=ue(re.current);c=Na(f,c,a,d,e,g),(b.updateQueue=c)&&Jf(b)}},Of=function(a,b,c,d){c!==d&&Jf(b)};else if(Va){Lf=function(a,b,c,d){for(var e=b.child;null!==e;){if(5===e.tag){var f=e.stateNode;c&&d&&(f=Db(f,e.type,e.memoizedProps,e)),La(a,f)}else if(6===e.tag)f=e.stateNode,c&&d&&(f=Eb(f,e.memoizedProps,e)),La(a,f);else if(4!==e.tag)if(22===e.tag&&null!==e.memoizedState)null!==(f=e.child)&&(f.return=e),Lf(a,e,!0,!0);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===b)break;for(;null===e.sibling;){if(null===e.return||e.return===b)return;e=e.return}e.sibling.return=e.return,e=e.sibling}};var Pf=function(a,b,c,d){for(var e=b.child;null!==e;){if(5===e.tag){var f=e.stateNode;c&&d&&(f=Db(f,e.type,e.memoizedProps,e)),Ab(a,f)}else if(6===e.tag)f=e.stateNode,c&&d&&(f=Eb(f,e.memoizedProps,e)),Ab(a,f);else if(4!==e.tag)if(22===e.tag&&null!==e.memoizedState)null!==(f=e.child)&&(f.return=e),Pf(a,e,!0,!0);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===b)break;for(;null===e.sibling;){if(null===e.return||e.return===b)return;e=e.return}e.sibling.return=e.return,e=e.sibling}};Mf=function(a,b){var c=b.stateNode;if(!Kf(a,b)){a=c.containerInfo;var d=zb(a);Pf(d,b,!1,!1),c.pendingChildren=d,Jf(b),Bb(a,d)}},Nf=function(a,b,c,d,e){var f=a.stateNode,g=a.memoizedProps;if((a=Kf(a,b))&&g===d)b.stateNode=f;else{var h=b.stateNode,k=ue(re.current),l=null;g!==d&&(l=Na(h,c,g,d,e,k)),a&&null===l?b.stateNode=f:(f=yb(f,l,c,g,d,b,a,h),Ma(f,c,d,e,k)&&Jf(b),b.stateNode=f,a?Jf(b):Lf(f,b,!1,!1))}},Of=function(a,b,c,d){c!==d?(a=ue(te.current),c=ue(re.current),b.stateNode=Pa(d,a,c,b),Jf(b)):b.stateNode=a.stateNode}}else Mf=function(){},Nf=function(){},Of=function(){};function Qf(a,b){if(!I)switch(a.tailMode){case"hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function P(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=14680064&e.subtreeFlags,d|=14680064&e.flags,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;return a.subtreeFlags|=d,a.childLanes=c,b}function Rf(a,b,c){var d=b.pendingProps;switch(Sd(b),b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return P(b),null;case 1:case 17:return C(b.type)&&kc(),P(b),null;case 3:return d=b.stateNode,we(),x(B),x(A),Be(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),null!==a&&null!==a.child||(ce(b)?Jf(b):null===a||a.memoizedState.isDehydrated&&0==(256&b.flags)||(b.flags|=1024,null!==Wd&&(Sf(Wd),Wd=null))),Mf(a,b),P(b),null;case 5:ye(b),c=ue(te.current);var e=b.type;if(null!==a&&null!=b.stateNode)Nf(a,b,e,d,c),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(n(166));return P(b),null}if(a=ue(re.current),ce(b)){if(!p)throw Error(n(175));a=Pb(b.stateNode,b.type,b.memoizedProps,c,a,b,!Vd),b.updateQueue=a,null!==a&&Jf(b)}else{var f=Ka(e,d,c,a,b);Lf(f,b,!1,!1),b.stateNode=f,Ma(f,e,d,c,a)&&Jf(b)}null!==b.ref&&(b.flags|=512,b.flags|=2097152)}return P(b),null;case 6:if(a&&null!=b.stateNode)Of(a,b,a.memoizedProps,d);else{if("string"!=typeof d&&null===b.stateNode)throw Error(n(166));if(a=ue(te.current),c=ue(re.current),ce(b)){if(!p)throw Error(n(176));if(a=b.stateNode,d=b.memoizedProps,(c=Qb(a,d,b,!Vd))&&null!==(e=Td))switch(f=0!=(1&e.mode),e.tag){case 3:Yb(e.stateNode.containerInfo,a,d,f);break;case 5:Zb(e.type,e.memoizedProps,e.stateNode,a,d,f)}c&&Jf(b)}else b.stateNode=Pa(d,a,c,b)}return P(b),null;case 13:if(x(J),d=b.memoizedState,I&&null!==Ud&&0!=(1&b.mode)&&0==(128&b.flags)){for(a=Ud;a;)a=Lb(a);return de(),b.flags|=98560,b}if(null!==d&&null!==d.dehydrated){if(d=ce(b),null===a){if(!d)throw Error(n(318));if(!p)throw Error(n(344));if(!(a=null!==(a=b.memoizedState)?a.dehydrated:null))throw Error(n(317));Rb(a,b)}else de(),0==(128&b.flags)&&(b.memoizedState=null),b.flags|=4;return P(b),null}return null!==Wd&&(Sf(Wd),Wd=null),0!=(128&b.flags)?(b.lanes=c,b):(d=null!==d,c=!1,null===a?ce(b):c=null!==a.memoizedState,d&&!c&&(b.child.flags|=8192,0!=(1&b.mode)&&(null===a||0!=(1&J.current)?0===Q&&(Q=3):Tf())),null!==b.updateQueue&&(b.flags|=4),P(b),null);case 4:return we(),Mf(a,b),null===a&&Xa(b.stateNode.containerInfo),P(b),null;case 10:return hd(b.type._context),P(b),null;case 19:if(x(J),null===(e=b.memoizedState))return P(b),null;if(d=0!=(128&b.flags),null===(f=e.rendering))if(d)Qf(e,!1);else{if(0!==Q||null!==a&&0!=(128&a.flags))for(a=b.child;null!==a;){if(null!==(f=ze(a))){for(b.flags|=128,Qf(e,!1),null!==(a=f.updateQueue)&&(b.updateQueue=a,b.flags|=4),b.subtreeFlags=0,a=c,d=b.child;null!==d;)e=a,(c=d).flags&=14680066,null===(f=c.alternate)?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=f.childLanes,c.lanes=f.lanes,c.child=f.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=f.memoizedProps,c.memoizedState=f.memoizedState,c.updateQueue=f.updateQueue,c.type=f.type,e=f.dependencies,c.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),d=d.sibling;return y(J,1&J.current|2),b.child}a=a.sibling}null!==e.tail&&E()>Uf&&(b.flags|=128,d=!0,Qf(e,!1),b.lanes=4194304)}else{if(!d)if(null!==(a=ze(f))){if(b.flags|=128,d=!0,null!==(a=a.updateQueue)&&(b.updateQueue=a,b.flags|=4),Qf(e,!0),null===e.tail&&"hidden"===e.tailMode&&!f.alternate&&!I)return P(b),null}else 2*E()-e.renderingStartTime>Uf&&1073741824!==c&&(b.flags|=128,d=!0,Qf(e,!1),b.lanes=4194304);e.isBackwards?(f.sibling=b.child,b.child=f):(null!==(a=e.last)?a.sibling=f:b.child=f,e.last=f)}return null!==e.tail?(b=e.tail,e.rendering=b,e.tail=b.sibling,e.renderingStartTime=E(),b.sibling=null,a=J.current,y(J,d?1&a|2:1&a),b):(P(b),null);case 22:case 23:return Vf(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!=(1&b.mode)?0!=(1073741824&Wf)&&(P(b),Ua&&6&b.subtreeFlags&&(b.flags|=8192)):P(b),null;case 24:case 25:return null}throw Error(n(156,b.tag))}var Xf=ea.ReactCurrentOwner,kd=!1;function R(a,b,c,d){b.child=null===a?pe(b,null,c,d):oe(b,a.child,c,d)}function Yf(a,b,c,d,e){c=c.render;var f=b.ref;return jd(b,e),d=Ke(a,b,c,d,f,e),c=Pe(),null===a||kd?(I&&c&&Rd(b),b.flags|=1,R(a,b,d,e),b.child):(b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zf(a,b,e))}function $f(a,b,c,d,e){if(null===a){var f=c.type;return"function"!=typeof f||ag(f)||void 0!==f.defaultProps||null!==c.compare||void 0!==c.defaultProps?((a=le(c.type,null,d,b,b.mode,e)).ref=b.ref,a.return=b,b.child=a):(b.tag=15,b.type=f,bg(a,b,f,d,e))}if(f=a.child,0==(a.lanes&e)){var g=f.memoizedProps;if((c=null!==(c=c.compare)?c:Zc)(g,d)&&a.ref===b.ref)return Zf(a,b,e)}return b.flags|=1,(a=je(f,d)).ref=b.ref,a.return=b,b.child=a}function bg(a,b,c,d,e){if(null!==a&&Zc(a.memoizedProps,d)&&a.ref===b.ref){if(kd=!1,0==(a.lanes&e))return b.lanes=a.lanes,Zf(a,b,e);0!=(131072&a.flags)&&(kd=!0)}return cg(a,b,c,d,e)}function dg(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0==(1&b.mode))b.memoizedState={baseLanes:0,cachePool:null},y(eg,Wf),Wf|=c;else{if(0==(1073741824&c))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null},b.updateQueue=null,y(eg,Wf),Wf|=a,null;b.memoizedState={baseLanes:0,cachePool:null},d=null!==f?f.baseLanes:c,y(eg,Wf),Wf|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(eg,Wf),Wf|=d;return R(a,b,e,c),b.child}function fg(a,b){var c=b.ref;(null===a&&null!==c||null!==a&&a.ref!==c)&&(b.flags|=512,b.flags|=2097152)}function cg(a,b,c,d,e){var f=C(c)?ic:A.current;return f=jc(b,f),jd(b,e),c=Ke(a,b,c,d,f,e),d=Pe(),null===a||kd?(I&&d&&Rd(b),b.flags|=1,R(a,b,c,e),b.child):(b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zf(a,b,e))}function gg(a,b,c,d,e){if(C(c)){var f=!0;nc(b)}else f=!1;if(jd(b,e),null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),Dd(b,c,d),Fd(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"==typeof l&&null!==l?l=ld(l):l=jc(b,l=C(c)?ic:A.current);var m=c.getDerivedStateFromProps,v="function"==typeof m||"function"==typeof g.getSnapshotBeforeUpdate;v||"function"!=typeof g.UNSAFE_componentWillReceiveProps&&"function"!=typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Ed(b,g,d,l),nd=!1;var r=b.memoizedState;g.state=r,ud(b,d,g,e),k=b.memoizedState,h!==d||r!==k||B.current||nd?("function"==typeof m&&(yd(b,c,m,d),k=b.memoizedState),(h=nd||Cd(b,c,h,d,r,k,l))?(v||"function"!=typeof g.UNSAFE_componentWillMount&&"function"!=typeof g.componentWillMount||("function"==typeof g.componentWillMount&&g.componentWillMount(),"function"==typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"==typeof g.componentDidMount&&(b.flags|=4194308)):("function"==typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"==typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode,pd(a,b),h=b.memoizedProps,l=b.type===b.elementType?h:ad(b.type,h),g.props=l,v=b.pendingProps,r=g.context,"object"==typeof(k=c.contextType)&&null!==k?k=ld(k):k=jc(b,k=C(c)?ic:A.current);var z=c.getDerivedStateFromProps;(m="function"==typeof z||"function"==typeof g.getSnapshotBeforeUpdate)||"function"!=typeof g.UNSAFE_componentWillReceiveProps&&"function"!=typeof g.componentWillReceiveProps||(h!==v||r!==k)&&Ed(b,g,d,k),nd=!1,r=b.memoizedState,g.state=r,ud(b,d,g,e);var q=b.memoizedState;h!==v||r!==q||B.current||nd?("function"==typeof z&&(yd(b,c,z,d),q=b.memoizedState),(l=nd||Cd(b,c,l,d,r,q,k)||!1)?(m||"function"!=typeof g.UNSAFE_componentWillUpdate&&"function"!=typeof g.componentWillUpdate||("function"==typeof g.componentWillUpdate&&g.componentWillUpdate(d,q,k),"function"==typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,q,k)),"function"==typeof g.componentDidUpdate&&(b.flags|=4),"function"==typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!=typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!=typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=q),g.props=d,g.state=q,g.context=k,d=l):("function"!=typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!=typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return hg(a,b,c,d,f,e)}function hg(a,b,c,d,e,f){fg(a,b);var g=0!=(128&b.flags);if(!d&&!g)return e&&oc(b,c,!1),Zf(a,b,f);d=b.stateNode,Xf.current=b;var h=g&&"function"!=typeof c.getDerivedStateFromError?null:d.render();return b.flags|=1,null!==a&&g?(b.child=oe(b,a.child,null,f),b.child=oe(b,null,h,f)):R(a,b,h,f),b.memoizedState=d.state,e&&oc(b,c,!0),b.child}function ig(a){var b=a.stateNode;b.pendingContext?lc(0,b.pendingContext,b.pendingContext!==b.context):b.context&&lc(0,b.context,!1),ve(a,b.containerInfo)}function jg(a,b,c,d,e){return de(),ee(e),b.flags|=256,R(a,b,c,d),b.child}var kg={dehydrated:null,treeContext:null,retryLane:0};function lg(a){return{baseLanes:a,cachePool:null}}function mg(a,b,c){var h,d=b.pendingProps,e=J.current,f=!1,g=0!=(128&b.flags);if((h=g)||(h=(null===a||null!==a.memoizedState)&&0!=(2&e)),h?(f=!0,b.flags&=-129):null!==a&&null===a.memoizedState||(e|=1),y(J,1&e),null===a)return ae(b),null!==(a=b.memoizedState)&&null!==(a=a.dehydrated)?(0==(1&b.mode)?b.lanes=1:Jb(a)?b.lanes=8:b.lanes=1073741824,null):(e=d.children,a=d.fallback,f?(d=b.mode,f=b.child,e={mode:"hidden",children:e},0==(1&d)&&null!==f?(f.childLanes=0,f.pendingProps=e):f=ng(e,d,0,null),a=ne(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=lg(c),b.memoizedState=kg,a):og(b,e));if(null!==(e=a.memoizedState)){if(null!==(h=e.dehydrated)){if(g)return 256&b.flags?(b.flags&=-257,pg(a,b,c,Error(n(422)))):null!==b.memoizedState?(b.child=a.child,b.flags|=128,null):(f=d.fallback,e=b.mode,d=ng({mode:"visible",children:d.children},e,0,null),(f=ne(f,e,c,null)).flags|=2,d.return=b,f.return=b,d.sibling=f,b.child=d,0!=(1&b.mode)&&oe(b,a.child,null,c),b.child.memoizedState=lg(c),b.memoizedState=kg,f);if(0==(1&b.mode))b=pg(a,b,c,null);else if(Jb(h))b=pg(a,b,c,Error(n(419)));else if(d=0!=(c&a.childLanes),kd||d){if(null!==(d=F)){switch(c&-c){case 4:f=2;break;case 16:f=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}0!==(d=0!=(f&(d.suspendedLanes|c))?0:f)&&d!==e.retryLane&&(e.retryLane=d,Ad(a,d,-1))}Tf(),b=pg(a,b,c,Error(n(421)))}else Ib(h)?(b.flags|=128,b.child=a.child,b=qg.bind(null,a),Kb(h,b),b=null):(c=e.treeContext,p&&(Ud=Ob(h),Td=b,I=!0,Wd=null,Vd=!1,null!==c&&(Kd[Ld++]=Nd,Kd[Ld++]=Od,Kd[Ld++]=Md,Nd=c.id,Od=c.overflow,Md=b)),(b=og(b,b.pendingProps.children)).flags|=4096);return b}return f?(d=rg(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?lg(c):{baseLanes:e.baseLanes|c,cachePool:null},f.childLanes=a.childLanes&~c,b.memoizedState=kg,d):(c=sg(a,b,d.children,c),b.memoizedState=null,c)}return f?(d=rg(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?lg(c):{baseLanes:e.baseLanes|c,cachePool:null},f.childLanes=a.childLanes&~c,b.memoizedState=kg,d):(c=sg(a,b,d.children,c),b.memoizedState=null,c)}function og(a,b){return(b=ng({mode:"visible",children:b},a.mode,0,null)).return=a,a.child=b}function sg(a,b,c,d){var e=a.child;return a=e.sibling,c=je(e,{mode:"visible",children:c}),0==(1&b.mode)&&(c.lanes=d),c.return=b,c.sibling=null,null!==a&&(null===(d=b.deletions)?(b.deletions=[a],b.flags|=16):d.push(a)),b.child=c}function rg(a,b,c,d,e){var f=b.mode,g=(a=a.child).sibling,h={mode:"hidden",children:c};return 0==(1&f)&&b.child!==a?((c=b.child).childLanes=0,c.pendingProps=h,b.deletions=null):(c=je(a,h)).subtreeFlags=14680064&a.subtreeFlags,null!==g?d=je(g,d):(d=ne(d,f,e,null)).flags|=2,d.return=b,c.return=b,c.sibling=d,b.child=c,d}function pg(a,b,c,d){return null!==d&&ee(d),oe(b,a.child,null,c),(a=og(b,b.pendingProps.children)).flags|=2,b.memoizedState=null,a}function tg(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b),id(a.return,b,c)}function ug(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function vg(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;if(R(a,b,d.children,c),0!=(2&(d=J.current)))d=1&d|2,b.flags|=128;else{if(null!==a&&0!=(128&a.flags))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&tg(a,c,b);else if(19===a.tag)tg(a,c,b);else if(null!==a.child){a.child.return=a,a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return,a=a.sibling}d&=1}if(y(J,d),0==(1&b.mode))b.memoizedState=null;else switch(e){case"forwards":for(c=b.child,e=null;null!==c;)null!==(a=c.alternate)&&null===ze(a)&&(e=c),c=c.sibling;null===(c=e)?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null),ug(b,!1,e,c,f);break;case"backwards":for(c=null,e=b.child,b.child=null;null!==e;){if(null!==(a=e.alternate)&&null===ze(a)){b.child=e;break}a=e.sibling,e.sibling=c,c=e,e=a}ug(b,!0,c,null,f);break;case"together":ug(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Zf(a,b,c){if(null!==a&&(b.dependencies=a.dependencies),vd|=b.lanes,0==(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(n(153));if(null!==b.child){for(c=je(a=b.child,a.pendingProps),b.child=c,c.return=b;null!==a.sibling;)a=a.sibling,(c=c.sibling=je(a,a.pendingProps)).return=b;c.sibling=null}return b.child}function xg(a,b){switch(Sd(b),b.tag){case 1:return C(b.type)&&kc(),65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 3:return we(),x(B),x(A),Be(),0!=(65536&(a=b.flags))&&0==(128&a)?(b.flags=-65537&a|128,b):null;case 5:return ye(b),null;case 13:if(x(J),null!==(a=b.memoizedState)&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));de()}return 65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 19:return x(J),null;case 4:return we(),null;case 10:return hd(b.type._context),null;case 22:case 23:return Vf(),null;default:return null}}var yg=!1,zg=!1,Ag="function"==typeof WeakSet?WeakSet:Set,S=null;function Bg(a,b){var c=a.ref;if(null!==c)if("function"==typeof c)try{c(null)}catch(d){T(a,b,d)}else c.current=null}function Cg(a,b,c){try{c()}catch(d){T(a,b,d)}}var Dg=!1;function Fg(a,b,c){var d=b.updateQueue;if(null!==(d=null!==d?d.lastEffect:null)){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0,void 0!==f&&Cg(b,c,f)}e=e.next}while(e!==d)}}function Gg(a,b){if(null!==(b=null!==(b=b.updateQueue)?b.lastEffect:null)){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Hg(a){var b=a.ref;if(null!==b){var c=a.stateNode;if(5===a.tag)a=Fa(c);else a=c;"function"==typeof b?b(a):b.current=a}}function Ig(a,b,c){if(Oc&&"function"==typeof Oc.onCommitFiberUnmount)try{Oc.onCommitFiberUnmount(Nc,b)}catch(g){}switch(b.tag){case 0:case 11:case 14:case 15:if(null!==(a=b.updateQueue)&&null!==(a=a.lastEffect)){var d=a=a.next;do{var e=d,f=e.destroy;e=e.tag,void 0!==f&&(0!=(2&e)||0!=(4&e))&&Cg(b,c,f),d=d.next}while(d!==a)}break;case 1:if(Bg(b,c),"function"==typeof(a=b.stateNode).componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(g){T(b,c,g)}break;case 5:Bg(b,c);break;case 4:Ua?Jg(a,b,c):Va&&Va&&(b=b.stateNode.containerInfo,c=zb(b),Cb(b,c))}}function Kg(a,b,c){for(var d=b;;)if(Ig(a,d,c),null===d.child||Ua&&4===d.tag){if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;d=d.return}d.sibling.return=d.return,d=d.sibling}else d.child.return=d,d=d.child}function Lg(a){var b=a.alternate;null!==b&&(a.alternate=null,Lg(b)),a.child=null,a.deletions=null,a.sibling=null,5===a.tag&&(null!==(b=a.stateNode)&&Za(b)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Mg(a){return 5===a.tag||3===a.tag||4===a.tag}function Ng(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Mg(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(2&a.flags)continue a;if(null===a.child||4===a.tag)continue a;a.child.return=a,a=a.child}if(!(2&a.flags))return a.stateNode}}function Og(a){if(Ua){a:{for(var b=a.return;null!==b;){if(Mg(b))break a;b=b.return}throw Error(n(160))}var c=b;switch(c.tag){case 5:b=c.stateNode,32&c.flags&&(sb(b),c.flags&=-33),Pg(a,c=Ng(a),b);break;case 3:case 4:b=c.stateNode.containerInfo,Qg(a,c=Ng(a),b);break;default:throw Error(n(161))}}}function Qg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?pb(c,a,b):kb(c,a);else if(4!==d&&null!==(a=a.child))for(Qg(a,b,c),a=a.sibling;null!==a;)Qg(a,b,c),a=a.sibling}function Pg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?ob(c,a,b):jb(c,a);else if(4!==d&&null!==(a=a.child))for(Pg(a,b,c),a=a.sibling;null!==a;)Pg(a,b,c),a=a.sibling}function Jg(a,b,c){for(var f,g,d=b,e=!1;;){if(!e){e=d.return;a:for(;;){if(null===e)throw Error(n(160));switch(f=e.stateNode,e.tag){case 5:g=!1;break a;case 3:case 4:f=f.containerInfo,g=!0;break a}e=e.return}e=!0}if(5===d.tag||6===d.tag)Kg(a,d,c),g?rb(f,d.stateNode):qb(f,d.stateNode);else if(18===d.tag)g?Wb(f,d.stateNode):Vb(f,d.stateNode);else if(4===d.tag){if(null!==d.child){f=d.stateNode.containerInfo,g=!0,d.child.return=d,d=d.child;continue}}else if(Ig(a,d,c),null!==d.child){d.child.return=d,d=d.child;continue}if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;4===(d=d.return).tag&&(e=!1)}d.sibling.return=d.return,d=d.sibling}}function Rg(a,b){if(Ua){switch(b.tag){case 0:case 11:case 14:case 15:return Fg(3,b,b.return),Gg(3,b),void Fg(5,b,b.return);case 1:case 12:case 17:return;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null,null!==f&&nb(c,f,e,a,d,b)}return;case 6:if(null===b.stateNode)throw Error(n(162));return c=b.memoizedProps,void lb(b.stateNode,null!==a?a.memoizedProps:c,c);case 3:return void(p&&null!==a&&a.memoizedState.isDehydrated&&Tb(b.stateNode.containerInfo));case 13:case 19:return void Sg(b)}throw Error(n(163))}switch(b.tag){case 0:case 11:case 14:case 15:return Fg(3,b,b.return),Gg(3,b),void Fg(5,b,b.return);case 12:case 22:case 23:return;case 13:case 19:return void Sg(b);case 3:p&&null!==a&&a.memoizedState.isDehydrated&&Tb(b.stateNode.containerInfo)}a:if(Va){switch(b.tag){case 1:case 5:case 6:break a;case 3:case 4:b=b.stateNode,Cb(b.containerInfo,b.pendingChildren);break a}throw Error(n(163))}}function Sg(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Ag),b.forEach((function(b){var d=Tg.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))}))}}function Xg(a,b,c){S=a,Yg(a,b,c)}function Yg(a,b,c){for(var d=0!=(1&a.mode);null!==S;){var e=S,f=e.child;if(22===e.tag&&d){var g=null!==e.memoizedState||yg;if(!g){var h=e.alternate,k=null!==h&&null!==h.memoizedState||zg;h=yg;var l=zg;if(yg=g,(zg=k)&&!l)for(S=e;null!==S;)k=(g=S).child,22===g.tag&&null!==g.memoizedState?Zg(e):null!==k?(k.return=g,S=k):Zg(e);for(;null!==f;)S=f,Yg(f,b,c),f=f.sibling;S=e,yg=h,zg=l}$g(a)}else 0!=(8772&e.subtreeFlags)&&null!==f?(f.return=e,S=f):$g(a)}}function $g(a){for(;null!==S;){var b=S;if(0!=(8772&b.flags)){var c=b.alternate;try{if(0!=(8772&b.flags))switch(b.tag){case 0:case 11:case 15:zg||Gg(5,b);break;case 1:var d=b.stateNode;if(4&b.flags&&!zg)if(null===c)d.componentDidMount();else{var e=b.elementType===b.type?c.memoizedProps:ad(b.type,c.memoizedProps);d.componentDidUpdate(e,c.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var f=b.updateQueue;null!==f&&wd(b,f,d);break;case 3:var g=b.updateQueue;if(null!==g){if(c=null,null!==b.child)switch(b.child.tag){case 5:c=Fa(b.child.stateNode);break;case 1:c=b.child.stateNode}wd(b,g,c)}break;case 5:var h=b.stateNode;null===c&&4&b.flags&&mb(h,b.type,b.memoizedProps,b);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(p&&null===b.memoizedState){var k=b.alternate;if(null!==k){var l=k.memoizedState;if(null!==l){var m=l.dehydrated;null!==m&&Ub(m)}}}break;default:throw Error(n(163))}zg||512&b.flags&&Hg(b)}catch(v){T(b,b.return,v)}}if(b===a){S=null;break}if(null!==(c=b.sibling)){c.return=b.return,S=c;break}S=b.return}}function Wg(a){for(;null!==S;){var b=S;if(b===a){S=null;break}var c=b.sibling;if(null!==c){c.return=b.return,S=c;break}S=b.return}}function Zg(a){for(;null!==S;){var b=S;try{switch(b.tag){case 0:case 11:case 15:var c=b.return;try{Gg(4,b)}catch(k){T(b,c,k)}break;case 1:var d=b.stateNode;if("function"==typeof d.componentDidMount){var e=b.return;try{d.componentDidMount()}catch(k){T(b,e,k)}}var f=b.return;try{Hg(b)}catch(k){T(b,f,k)}break;case 5:var g=b.return;try{Hg(b)}catch(k){T(b,g,k)}}}catch(k){T(b,b.return,k)}if(b===a){S=null;break}var h=b.sibling;if(null!==h){h.return=b.return,S=h;break}S=b.return}}var ah=0,bh=1,ch=2,dh=3,eh=4;if("function"==typeof Symbol&&Symbol.for){var fh=Symbol.for;ah=fh("selector.component"),bh=fh("selector.has_pseudo_class"),ch=fh("selector.role"),dh=fh("selector.test_id"),eh=fh("selector.text")}function gh(a){var b=Wa(a);if(null!=b){if("string"!=typeof b.memoizedProps["data-testname"])throw Error(n(364));return b}if(null===(a=cb(a)))throw Error(n(362));return a.stateNode.current}function hh(a,b){switch(b.$$typeof){case ah:if(a.type===b.value)return!0;break;case bh:a:{b=b.value,a=[a,0];for(var c=0;c";case bh:return":has("+(ih(a)||"")+")";case ch:return'[role="'+a.value+'"]';case eh:return'"'+a.value+'"';case dh:return'[data-testname="'+a.value+'"]';default:throw Error(n(365))}}function jh(a,b){var c=[];a=[a,0];for(var d=0;de&&(e=g),d&=~f}if(d=e,10<(d=(120>(d=E()-d)?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*lh(d/1960))-d)){a.timeoutHandle=Qa(Nh.bind(null,a,Y),d);break}Nh(a,Y);break;default:throw Error(n(329))}}}return Z(a,E()),a.callbackNode===c?Eh.bind(null,a):null}function Lh(a,b){var c=rh;return a.current.memoizedState.isDehydrated&&(Ih(a,b).flags|=256),2!==(a=Gh(a,b))&&(b=Y,Y=c,null!==b&&Sf(b)),a}function Sf(a){null===Y?Y=a:Y.push.apply(Y,a)}function Bh(a,b){for(b&=~qh,b&=~ph,a.suspendedLanes|=b,a.pingedLanes&=~b,a=a.expirationTimes;0a?16:a,null===uh)var d=!1;else{if(a=uh,uh=null,vh=0,0!=(6&G))throw Error(n(331));var e=G;for(G|=4,S=a.current;null!==S;){var f=S,g=f.child;if(0!=(16&S.flags)){var h=f.deletions;if(null!==h){for(var k=0;kE()-Vg?Ih(a,0):qh|=c),Z(a,b)}function Vh(a,b){0===b&&(0==(1&a.mode)?b=1:(b=uc,0==(130023424&(uc<<=1))&&(uc=4194304)));var c=H();null!==(a=Ah(a,b))&&(Bc(a,b,c),Z(a,c))}function qg(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane),Vh(a,c)}function Tg(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode,e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(n(314))}null!==d&&d.delete(b),Vh(a,c)}function Dh(a,b){return Fc(a,b)}function Xh(a,b,c,d){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=b,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yd(a,b,c,d){return new Xh(a,b,c,d)}function ag(a){return!(!(a=a.prototype)||!a.isReactComponent)}function je(a,b){var c=a.alternate;return null===c?((c=Yd(a.tag,b,a.key,a.mode)).elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=14680064&a.flags,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,b=a.dependencies,c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c}function le(a,b,c,d,e,f){var g=2;if(d=a,"function"==typeof a)ag(a)&&(g=1);else if("string"==typeof a)g=5;else a:switch(a){case ia:return ne(c.children,e,f,b);case ja:g=8,e|=8;break;case ka:return(a=Yd(12,c,b,2|e)).elementType=ka,a.lanes=f,a;case oa:return(a=Yd(13,c,b,e)).elementType=oa,a.lanes=f,a;case pa:return(a=Yd(19,c,b,e)).elementType=pa,a.lanes=f,a;case sa:return ng(c,e,f,b);default:if("object"==typeof a&&null!==a)switch(a.$$typeof){case la:g=10;break a;case ma:g=9;break a;case na:g=11;break a;case qa:g=14;break a;case ra:g=16,d=null;break a}throw Error(n(130,null==a?a:typeof a,""))}return(b=Yd(g,c,b,e)).elementType=a,b.type=d,b.lanes=f,b}function ne(a,b,c,d){return(a=Yd(7,a,d,b)).lanes=c,a}function ng(a,b,c,d){return(a=Yd(22,a,d,b)).elementType=sa,a.lanes=c,a.stateNode={},a}function ke(a,b,c){return(a=Yd(6,a,null,b)).lanes=c,a}function me(a,b,c){return(b=Yd(4,null!==a.children?a.children:[],a.key,b)).lanes=c,b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},b}function Yh(a,b,c,d,e){this.tag=b,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Sa,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=d,this.onRecoverableError=e,p&&(this.mutableSourceEagerHydrationData=null)}function Zh(a,b,c,d,e,f,g,h,k){return a=new Yh(a,b,c,h,k),1===b?(b=1,!0===f&&(b|=8)):b=0,f=Yd(3,null,null,b),a.current=f,f.stateNode=a,f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null},od(f),a}function $h(a){if(!a)return hc;a:{if(ya(a=a._reactInternals)!==a||1!==a.tag)throw Error(n(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(C(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(n(171))}if(1===a.tag){var c=a.type;if(C(c))return mc(a,c,b)}return b}function ai(a){var b=a._reactInternals;if(void 0===b){if("function"==typeof a.render)throw Error(n(188));throw a=Object.keys(a).join(","),Error(n(268,a))}return null===(a=Ba(b))?null:a.stateNode}function bi(a,b){if(null!==(a=a.memoizedState)&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c=l&&f>=v&&e<=m&&g<=r){a.splice(b,1);break}if(!(d!==l||c.width!==k.width||rg)){v>f&&(k.height+=v-f,k.y=f),re)){l>d&&(k.width+=l-d,k.x=d),mc&&(c=g)),g ")+"\n\nNo matching component was found for:\n "+a.join(" > ")}return null},exports.getPublicRootInstance=function(a){return(a=a.current).child?5===a.child.tag?Fa(a.child.stateNode):a.child.stateNode:null},exports.injectIntoDevTools=function(a){if(a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ea.ReactCurrentDispatcher,findHostInstanceByFiber:di,findFiberByHostInstance:a.findFiberByHostInstance||ei,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)a=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)a=!0;else{try{Nc=b.inject(a),Oc=b}catch(c){}a=!!b.checkDCE}}return a},exports.isAlreadyRendering=function(){return!1},exports.observeVisibleRects=function(a,b,c,d){if(!bb)throw Error(n(363));a=kh(a,b);var e=ib(a,c,d).disconnect;return{disconnect:function(){e()}}},exports.registerMutableSourceForHydration=function(a,b){var c=b._getVersion;c=c(b._source),null==a.mutableSourceEagerHydrationData?a.mutableSourceEagerHydrationData=[b,c]:a.mutableSourceEagerHydrationData.push(b,c)},exports.runWithPriority=function(a,b){var c=D;try{return D=a,b()}finally{D=c}},exports.shouldError=function(){return null},exports.shouldSuspend=function(){return!1},exports.updateContainer=function(a,b,c,d){var e=b.current,f=H(),g=zd(e);return c=$h(c),null===b.context?b.context=c:b.pendingContext=c,(b=qd(f,g)).payload={element:a},null!==(d=void 0===d?null:d)&&(b.callback=d),rd(e,b),null!==(a=Ad(e,g,f))&&sd(a,e,g),g},exports}},"./node_modules/react-reconciler/constants.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/react-reconciler/cjs/react-reconciler-constants.production.min.js")},"./node_modules/react-reconciler/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/react-reconciler/cjs/react-reconciler.production.min.js")},"./node_modules/react/cjs/react-jsx-runtime.production.min.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var f=__webpack_require__("./node_modules/react/index.js"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;for(b in void 0!==g&&(e=""+g),void 0!==a.key&&(e=""+a.key),void 0!==a.ref&&(h=a.ref),a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l,exports.jsx=q,exports.jsxs=q},"./node_modules/react/jsx-runtime.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/react/cjs/react-jsx-runtime.production.min.js")},"./node_modules/scheduler/cjs/scheduler.production.min.js":function(__unused_webpack_module,exports){"use strict";function f(a,b){var c=a.length;a.push(b);a:for(;0>>1,e=a[d];if(!(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else{if(!(ng(x,c)))break a;a[d]=x,a[n]=c,d=n}}}return b}function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"==typeof performance&&"function"==typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"==typeof setTimeout?setTimeout:null,E="function"==typeof clearTimeout?clearTimeout:null,F="undefined"!=typeof setImmediate?setImmediate:null;function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else{if(!(b.startTime<=a))break;k(t),b.sortIndex=b.expirationTime,f(r,b)}b=h(t)}}function H(a){if(B=!1,G(a),!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}function J(a,b){A=!1,B&&(B=!1,E(L),L=-1),z=!0;var c=y;try{for(G(b),v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"==typeof d){v.callback=null,y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now(),"function"==typeof e?v.callback=e:v===h(r)&&k(r),G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b),w=!1}return w}finally{v=null,y=c,z=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,N=!1,O=null,L=-1,P=5,Q=-1;function M(){return!(exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J))),a},exports.unstable_shouldYield=M,exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}},"./node_modules/scheduler/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/scheduler/cjs/scheduler.production.min.js")},"./node_modules/suspend-react/index.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{MA:function(){return preload},Rq:function(){return suspend},ZH:function(){return clear}});const globalCache=[];function shallowEqualArrays(arrA,arrB,equal=((a,b)=>a===b)){if(arrA===arrB)return!0;if(!arrA||!arrB)return!1;const len=arrA.length;if(arrB.length!==len)return!1;for(let i=0;i0&&(entry.timeout&&clearTimeout(entry.timeout),entry.timeout=setTimeout(entry.remove,config.lifespan)),entry.response;if(!preload)throw entry.promise}const entry={keys:keys,equal:config.equal,remove:()=>{const index=globalCache.indexOf(entry);-1!==index&&globalCache.splice(index,1)},promise:(promise=fn,"object"==typeof promise&&"function"==typeof promise.then?fn:fn(...keys)).then((response=>{entry.response=response,config.lifespan&&config.lifespan>0&&(entry.timeout=setTimeout(entry.remove,config.lifespan))})).catch((error=>entry.error=error))};var promise;if(globalCache.push(entry),!preload)throw entry.promise}const suspend=(fn,keys,config)=>query(fn,keys,!1,config),preload=(fn,keys,config)=>{query(fn,keys,!0,config)},clear=keys=>{if(void 0===keys||0===keys.length)globalCache.splice(0,globalCache.length);else{const entry=globalCache.find((entry=>shallowEqualArrays(keys,entry.keys,entry.equal)));entry&&entry.remove()}}},"./node_modules/three-stdlib/loaders/DRACOLoader.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{_:function(){return DRACOLoader}});var three__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/three/build/three.module.js");const _taskCache=new WeakMap;class DRACOLoader extends three__WEBPACK_IMPORTED_MODULE_0__.Loader{constructor(manager){super(manager),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(path){return this.decoderPath=path,this}setDecoderConfig(config){return this.decoderConfig=config,this}setWorkerLimit(workerLimit){return this.workerLimit=workerLimit,this}load(url,onLoad,onProgress,onError){const loader=new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader(this.manager);loader.setPath(this.path),loader.setResponseType("arraybuffer"),loader.setRequestHeader(this.requestHeader),loader.setWithCredentials(this.withCredentials),loader.load(url,(buffer=>{const taskConfig={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(buffer,taskConfig).then(onLoad).catch(onError)}),onProgress,onError)}decodeDracoFile(buffer,callback,attributeIDs,attributeTypes){const taskConfig={attributeIDs:attributeIDs||this.defaultAttributeIDs,attributeTypes:attributeTypes||this.defaultAttributeTypes,useUniqueIDs:!!attributeIDs};this.decodeGeometry(buffer,taskConfig).then(callback)}decodeGeometry(buffer,taskConfig){for(const attribute in taskConfig.attributeTypes){const type=taskConfig.attributeTypes[attribute];void 0!==type.BYTES_PER_ELEMENT&&(taskConfig.attributeTypes[attribute]=type.name)}const taskKey=JSON.stringify(taskConfig);if(_taskCache.has(buffer)){const cachedTask=_taskCache.get(buffer);if(cachedTask.key===taskKey)return cachedTask.promise;if(0===buffer.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let worker;const taskID=this.workerNextTaskID++,taskCost=buffer.byteLength,geometryPending=this._getWorker(taskID,taskCost).then((_worker=>(worker=_worker,new Promise(((resolve,reject)=>{worker._callbacks[taskID]={resolve:resolve,reject:reject},worker.postMessage({type:"decode",id:taskID,taskConfig:taskConfig,buffer:buffer},[buffer])}))))).then((message=>this._createGeometry(message.geometry)));return geometryPending.catch((()=>!0)).then((()=>{worker&&taskID&&this._releaseTask(worker,taskID)})),_taskCache.set(buffer,{key:taskKey,promise:geometryPending}),geometryPending}_createGeometry(geometryData){const geometry=new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry;geometryData.index&&geometry.setIndex(new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(geometryData.index.array,1));for(let i=0;i{loader.load(url,resolve,void 0,reject)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const useJS="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,librariesPending=[];return useJS?librariesPending.push(this._loadLibrary("draco_decoder.js","text")):(librariesPending.push(this._loadLibrary("draco_wasm_wrapper.js","text")),librariesPending.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(librariesPending).then((libraries=>{const jsContent=libraries[0];useJS||(this.decoderConfig.wasmBinary=libraries[1]);const fn=DRACOWorker.toString(),body=["/* draco decoder */",jsContent,"","/* worker */",fn.substring(fn.indexOf("{")+1,fn.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([body]))})),this.decoderPending}_getWorker(taskID,taskCost){return this._initDecoder().then((()=>{if(this.workerPool.lengthb._taskLoad?-1:1}));const worker=this.workerPool[this.workerPool.length-1];return worker._taskCosts[taskID]=taskCost,worker._taskLoad+=taskCost,worker}))}_releaseTask(worker,taskID){worker._taskLoad-=worker._taskCosts[taskID],delete worker._callbacks[taskID],delete worker._taskCosts[taskID]}debug(){console.log("Task load: ",this.workerPool.map((worker=>worker._taskLoad)))}dispose(){for(let i=0;i{const draco=module.draco,decoder=new draco.Decoder,decoderBuffer=new draco.DecoderBuffer;decoderBuffer.Init(new Int8Array(buffer),buffer.byteLength);try{const geometry=function decodeGeometry(draco,decoder,decoderBuffer,taskConfig){const attributeIDs=taskConfig.attributeIDs,attributeTypes=taskConfig.attributeTypes;let dracoGeometry,decodingStatus;const geometryType=decoder.GetEncodedGeometryType(decoderBuffer);if(geometryType===draco.TRIANGULAR_MESH)dracoGeometry=new draco.Mesh,decodingStatus=decoder.DecodeBufferToMesh(decoderBuffer,dracoGeometry);else{if(geometryType!==draco.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");dracoGeometry=new draco.PointCloud,decodingStatus=decoder.DecodeBufferToPointCloud(decoderBuffer,dracoGeometry)}if(!decodingStatus.ok()||0===dracoGeometry.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+decodingStatus.error_msg());const geometry={index:null,attributes:[]};for(const attributeName in attributeIDs){const attributeType=self[attributeTypes[attributeName]];let attribute,attributeID;if(taskConfig.useUniqueIDs)attributeID=attributeIDs[attributeName],attribute=decoder.GetAttributeByUniqueId(dracoGeometry,attributeID);else{if(attributeID=decoder.GetAttributeId(dracoGeometry,draco[attributeIDs[attributeName]]),-1===attributeID)continue;attribute=decoder.GetAttribute(dracoGeometry,attributeID)}geometry.attributes.push(decodeAttribute(draco,decoder,dracoGeometry,attributeName,attributeType,attribute))}geometryType===draco.TRIANGULAR_MESH&&(geometry.index=function decodeIndex(draco,decoder,dracoGeometry){const numFaces=dracoGeometry.num_faces(),numIndices=3*numFaces,byteLength=4*numIndices,ptr=draco._malloc(byteLength);decoder.GetTrianglesUInt32Array(dracoGeometry,byteLength,ptr);const index=new Uint32Array(draco.HEAPF32.buffer,ptr,numIndices).slice();return draco._free(ptr),{array:index,itemSize:1}}(draco,decoder,dracoGeometry));return draco.destroy(dracoGeometry),geometry}(draco,decoder,decoderBuffer,taskConfig),buffers=geometry.attributes.map((attr=>attr.array.buffer));geometry.index&&buffers.push(geometry.index.array.buffer),self.postMessage({type:"decode",id:message.id,geometry:geometry},buffers)}catch(error){console.error(error),self.postMessage({type:"error",id:message.id,error:error.message})}finally{draco.destroy(decoderBuffer),draco.destroy(decoder)}}))}}}},"./node_modules/three-stdlib/loaders/FBXLoader.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{y:function(){return FBXLoader}});var three_module=__webpack_require__("./node_modules/three/build/three.module.js"),browser=__webpack_require__("./node_modules/fflate/esm/browser.js");function findSpan(p,u,U){const n=U.length-p-1;if(u>=U[n])return n-1;if(u<=U[p])return p;let low=p,high=n,mid=Math.floor((low+high)/2);for(;u=U[mid+1];)u=k&&(a[s2][0]=a[s1][0]/ndu[pk+1][rk],d=a[s2][0]*ndu[rk][pk]);const j2=r2-1<=pk?k-1:p-r2;for(let j3=rk>=-1?1:-rk;j3<=j2;++j3)a[s2][j3]=(a[s1][j3]-a[s1][j3-1])/ndu[pk+1][rk+j3],d+=a[s2][j3]*ndu[rk+j3][pk];r2<=pk&&(a[s2][k]=-a[s1][k-1]/ndu[pk+1][r2],d+=a[s2][k]*ndu[r2][pk]),ders[k][r2]=d;const j=s1;s1=s2,s2=j}}let r=p;for(let k=1;k<=n;++k){for(let j=0;j<=p;++j)ders[k][j]*=r;r*=p-k}return ders}(span,u,p,du,U),Pw=[];for(let i=0;i=CORRECT.length&&CORRECT===convertArrayBufferToString(buffer,0,CORRECT.length)}(FBXBuffer))fbxTree=(new BinaryParser).parse(FBXBuffer);else{const FBXText=convertArrayBufferToString(FBXBuffer);if(!function isFbxFormatASCII(text){const CORRECT=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let cursor=0;function read(offset){const result=text[offset-1];return text=text.slice(cursor+offset),cursor++,result}for(let i=0;i0,base64Content="string"==typeof videoNode.Content&&""!==videoNode.Content;if(arrayBufferContent||base64Content){const image=this.parseImage(videoNodes[nodeID]);blobs[videoNode.RelativeFilename||videoNode.Filename]=image}}}}for(const id in images){const filename=images[id];void 0!==blobs[filename]?images[id]=blobs[filename]:images[id]=images[id].split("\\").pop()}return images}parseImage(videoNode){const content=videoNode.Content,fileName=videoNode.RelativeFilename||videoNode.Filename,extension=fileName.slice(fileName.lastIndexOf(".")+1).toLowerCase();let type;switch(extension){case"bmp":type="image/bmp";break;case"jpg":case"jpeg":type="image/jpeg";break;case"png":type="image/png";break;case"tif":type="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",fileName),type="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+extension+'" is not supported.')}if("string"==typeof content)return"data:"+type+";base64,"+content;{const array=new Uint8Array(content);return window.URL.createObjectURL(new Blob([array],{type:type}))}}parseTextures(images){const textureMap=new Map;if("Texture"in fbxTree.Objects){const textureNodes=fbxTree.Objects.Texture;for(const nodeID in textureNodes){const texture=this.parseTexture(textureNodes[nodeID],images);textureMap.set(parseInt(nodeID),texture)}}return textureMap}parseTexture(textureNode,images){const texture=this.loadTexture(textureNode,images);texture.ID=textureNode.id,texture.name=textureNode.attrName;const wrapModeU=textureNode.WrapModeU,wrapModeV=textureNode.WrapModeV,valueU=void 0!==wrapModeU?wrapModeU.value:0,valueV=void 0!==wrapModeV?wrapModeV.value:0;if(texture.wrapS=0===valueU?three_module.RepeatWrapping:three_module.ClampToEdgeWrapping,texture.wrapT=0===valueV?three_module.RepeatWrapping:three_module.ClampToEdgeWrapping,"Scaling"in textureNode){const values=textureNode.Scaling.value;texture.repeat.x=values[0],texture.repeat.y=values[1]}return texture}loadTexture(textureNode,images){let fileName;const currentPath=this.textureLoader.path,children=connections.get(textureNode.id).children;let texture;void 0!==children&&children.length>0&&void 0!==images[children[0].ID]&&(fileName=images[children[0].ID],0!==fileName.indexOf("blob:")&&0!==fileName.indexOf("data:")||this.textureLoader.setPath(void 0));const extension=textureNode.FileName.slice(-3).toLowerCase();if("tga"===extension){const loader=this.manager.getHandler(".tga");null===loader?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",textureNode.RelativeFilename),texture=new three_module.Texture):(loader.setPath(this.textureLoader.path),texture=loader.load(fileName))}else"psd"===extension?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",textureNode.RelativeFilename),texture=new three_module.Texture):texture=this.textureLoader.load(fileName);return this.textureLoader.setPath(currentPath),texture}parseMaterials(textureMap){const materialMap=new Map;if("Material"in fbxTree.Objects){const materialNodes=fbxTree.Objects.Material;for(const nodeID in materialNodes){const material=this.parseMaterial(materialNodes[nodeID],textureMap);null!==material&&materialMap.set(parseInt(nodeID),material)}}return materialMap}parseMaterial(materialNode,textureMap){const ID=materialNode.id,name=materialNode.attrName;let type=materialNode.ShadingModel;if("object"==typeof type&&(type=type.value),!connections.has(ID))return null;const parameters=this.parseParameters(materialNode,textureMap,ID);let material;switch(type.toLowerCase()){case"phong":material=new three_module.MeshPhongMaterial;break;case"lambert":material=new three_module.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',type),material=new three_module.MeshPhongMaterial}return material.setValues(parameters),material.name=name,material}parseParameters(materialNode,textureMap,ID){const parameters={};materialNode.BumpFactor&&(parameters.bumpScale=materialNode.BumpFactor.value),materialNode.Diffuse?parameters.color=(new three_module.Color).fromArray(materialNode.Diffuse.value):!materialNode.DiffuseColor||"Color"!==materialNode.DiffuseColor.type&&"ColorRGB"!==materialNode.DiffuseColor.type||(parameters.color=(new three_module.Color).fromArray(materialNode.DiffuseColor.value)),materialNode.DisplacementFactor&&(parameters.displacementScale=materialNode.DisplacementFactor.value),materialNode.Emissive?parameters.emissive=(new three_module.Color).fromArray(materialNode.Emissive.value):!materialNode.EmissiveColor||"Color"!==materialNode.EmissiveColor.type&&"ColorRGB"!==materialNode.EmissiveColor.type||(parameters.emissive=(new three_module.Color).fromArray(materialNode.EmissiveColor.value)),materialNode.EmissiveFactor&&(parameters.emissiveIntensity=parseFloat(materialNode.EmissiveFactor.value)),materialNode.Opacity&&(parameters.opacity=parseFloat(materialNode.Opacity.value)),parameters.opacity<1&&(parameters.transparent=!0),materialNode.ReflectionFactor&&(parameters.reflectivity=materialNode.ReflectionFactor.value),materialNode.Shininess&&(parameters.shininess=materialNode.Shininess.value),materialNode.Specular?parameters.specular=(new three_module.Color).fromArray(materialNode.Specular.value):materialNode.SpecularColor&&"Color"===materialNode.SpecularColor.type&&(parameters.specular=(new three_module.Color).fromArray(materialNode.SpecularColor.value));const scope=this;return connections.get(ID).children.forEach((function(child){const type=child.relationship;switch(type){case"Bump":parameters.bumpMap=scope.getTexture(textureMap,child.ID);break;case"Maya|TEX_ao_map":parameters.aoMap=scope.getTexture(textureMap,child.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":parameters.map=scope.getTexture(textureMap,child.ID),void 0!==parameters.map&&("colorSpace"in parameters.map?parameters.map.colorSpace="srgb":parameters.map.encoding=3001);break;case"DisplacementColor":parameters.displacementMap=scope.getTexture(textureMap,child.ID);break;case"EmissiveColor":parameters.emissiveMap=scope.getTexture(textureMap,child.ID),void 0!==parameters.emissiveMap&&("colorSpace"in parameters.emissiveMap?parameters.emissiveMap.colorSpace="srgb":parameters.emissiveMap.encoding=3001);break;case"NormalMap":case"Maya|TEX_normal_map":parameters.normalMap=scope.getTexture(textureMap,child.ID);break;case"ReflectionColor":parameters.envMap=scope.getTexture(textureMap,child.ID),void 0!==parameters.envMap&&(parameters.envMap.mapping=three_module.EquirectangularReflectionMapping,"colorSpace"in parameters.envMap?parameters.envMap.colorSpace="srgb":parameters.envMap.encoding=3001);break;case"SpecularColor":parameters.specularMap=scope.getTexture(textureMap,child.ID),void 0!==parameters.specularMap&&("colorSpace"in parameters.specularMap?parameters.specularMap.colorSpace="srgb":parameters.specularMap.encoding=3001);break;case"TransparentColor":case"TransparencyFactor":parameters.alphaMap=scope.getTexture(textureMap,child.ID),parameters.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",type)}})),parameters}getTexture(textureMap,id){return"LayeredTexture"in fbxTree.Objects&&id in fbxTree.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),id=connections.get(id).children[0].ID),textureMap.get(id)}parseDeformers(){const skeletons={},morphTargets={};if("Deformer"in fbxTree.Objects){const DeformerNodes=fbxTree.Objects.Deformer;for(const nodeID in DeformerNodes){const deformerNode=DeformerNodes[nodeID],relationships=connections.get(parseInt(nodeID));if("Skin"===deformerNode.attrType){const skeleton=this.parseSkeleton(relationships,DeformerNodes);skeleton.ID=nodeID,relationships.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),skeleton.geometryID=relationships.parents[0].ID,skeletons[nodeID]=skeleton}else if("BlendShape"===deformerNode.attrType){const morphTarget={id:nodeID};morphTarget.rawTargets=this.parseMorphTargets(relationships,DeformerNodes),morphTarget.id=nodeID,relationships.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),morphTargets[nodeID]=morphTarget}}}return{skeletons:skeletons,morphTargets:morphTargets}}parseSkeleton(relationships,deformerNodes){const rawBones=[];return relationships.children.forEach((function(child){const boneNode=deformerNodes[child.ID];if("Cluster"!==boneNode.attrType)return;const rawBone={ID:child.ID,indices:[],weights:[],transformLink:(new three_module.Matrix4).fromArray(boneNode.TransformLink.a)};"Indexes"in boneNode&&(rawBone.indices=boneNode.Indexes.a,rawBone.weights=boneNode.Weights.a),rawBones.push(rawBone)})),{rawBones:rawBones,bones:[]}}parseMorphTargets(relationships,deformerNodes){const rawMorphTargets=[];for(let i=0;i1?material=materials:materials.length>0?material=materials[0]:(material=new three_module.MeshPhongMaterial({color:13421772}),materials.push(material)),"color"in geometry.attributes&&materials.forEach((function(material2){material2.vertexColors=!0})),geometry.FBX_Deformer?(model=new three_module.SkinnedMesh(geometry,material),model.normalizeSkinWeights()):model=new three_module.Mesh(geometry,material),model}createCurve(relationships,geometryMap){const geometry=relationships.children.reduce((function(geo,child){return geometryMap.has(child.ID)&&(geo=geometryMap.get(child.ID)),geo}),null),material=new three_module.LineBasicMaterial({color:3342591,linewidth:1});return new three_module.Line(geometry,material)}getTransformData(model,modelNode){const transformData={};"InheritType"in modelNode&&(transformData.inheritType=parseInt(modelNode.InheritType.value)),transformData.eulerOrder="RotationOrder"in modelNode?getEulerOrder(modelNode.RotationOrder.value):"ZYX","Lcl_Translation"in modelNode&&(transformData.translation=modelNode.Lcl_Translation.value),"PreRotation"in modelNode&&(transformData.preRotation=modelNode.PreRotation.value),"Lcl_Rotation"in modelNode&&(transformData.rotation=modelNode.Lcl_Rotation.value),"PostRotation"in modelNode&&(transformData.postRotation=modelNode.PostRotation.value),"Lcl_Scaling"in modelNode&&(transformData.scale=modelNode.Lcl_Scaling.value),"ScalingOffset"in modelNode&&(transformData.scalingOffset=modelNode.ScalingOffset.value),"ScalingPivot"in modelNode&&(transformData.scalingPivot=modelNode.ScalingPivot.value),"RotationOffset"in modelNode&&(transformData.rotationOffset=modelNode.RotationOffset.value),"RotationPivot"in modelNode&&(transformData.rotationPivot=modelNode.RotationPivot.value),model.userData.transformData=transformData}setLookAtProperties(model,modelNode){if("LookAtProperty"in modelNode){connections.get(model.ID).children.forEach((function(child){if("LookAtProperty"===child.relationship){const lookAtTarget=fbxTree.Objects.Model[child.ID];if("Lcl_Translation"in lookAtTarget){const pos=lookAtTarget.Lcl_Translation.value;void 0!==model.target?(model.target.position.fromArray(pos),sceneGraph.add(model.target)):model.lookAt((new three_module.Vector3).fromArray(pos))}}}))}}bindSkeleton(skeletons,geometryMap,modelMap){const bindMatrices=this.parsePoseNodes();for(const ID in skeletons){const skeleton=skeletons[ID];connections.get(parseInt(skeleton.ID)).parents.forEach((function(parent){if(geometryMap.has(parent.ID)){const geoID=parent.ID;connections.get(geoID).parents.forEach((function(geoConnParent){if(modelMap.has(geoConnParent.ID)){modelMap.get(geoConnParent.ID).bind(new three_module.Skeleton(skeleton.bones),bindMatrices[geoConnParent.ID])}}))}}))}}parsePoseNodes(){const bindMatrices={};if("Pose"in fbxTree.Objects){const BindPoseNode=fbxTree.Objects.Pose;for(const nodeID in BindPoseNode)if("BindPose"===BindPoseNode[nodeID].attrType&&BindPoseNode[nodeID].NbPoseNodes>0){const poseNodes=BindPoseNode[nodeID].PoseNode;Array.isArray(poseNodes)?poseNodes.forEach((function(poseNode){bindMatrices[poseNode.Node]=(new three_module.Matrix4).fromArray(poseNode.Matrix.a)})):bindMatrices[poseNodes.Node]=(new three_module.Matrix4).fromArray(poseNodes.Matrix.a)}}return bindMatrices}createAmbientLight(){if("GlobalSettings"in fbxTree&&"AmbientColor"in fbxTree.GlobalSettings){const ambientColor=fbxTree.GlobalSettings.AmbientColor.value,r=ambientColor[0],g=ambientColor[1],b=ambientColor[2];if(0!==r||0!==g||0!==b){const color=new three_module.Color(r,g,b);sceneGraph.add(new three_module.AmbientLight(color,1))}}}}class GeometryParser{parse(deformers){const geometryMap=new Map;if("Geometry"in fbxTree.Objects){const geoNodes=fbxTree.Objects.Geometry;for(const nodeID in geoNodes){const relationships=connections.get(parseInt(nodeID)),geo=this.parseGeometry(relationships,geoNodes[nodeID],deformers);geometryMap.set(parseInt(nodeID),geo)}}return geometryMap}parseGeometry(relationships,geoNode,deformers){switch(geoNode.attrType){case"Mesh":return this.parseMeshGeometry(relationships,geoNode,deformers);case"NurbsCurve":return this.parseNurbsGeometry(geoNode)}}parseMeshGeometry(relationships,geoNode,deformers){const skeletons=deformers.skeletons,morphTargets=[],modelNodes=relationships.parents.map((function(parent){return fbxTree.Objects.Model[parent.ID]}));if(0===modelNodes.length)return;const skeleton=relationships.children.reduce((function(skeleton2,child){return void 0!==skeletons[child.ID]&&(skeleton2=skeletons[child.ID]),skeleton2}),null);relationships.children.forEach((function(child){void 0!==deformers.morphTargets[child.ID]&&morphTargets.push(deformers.morphTargets[child.ID])}));const modelNode=modelNodes[0],transformData={};"RotationOrder"in modelNode&&(transformData.eulerOrder=getEulerOrder(modelNode.RotationOrder.value)),"InheritType"in modelNode&&(transformData.inheritType=parseInt(modelNode.InheritType.value)),"GeometricTranslation"in modelNode&&(transformData.translation=modelNode.GeometricTranslation.value),"GeometricRotation"in modelNode&&(transformData.rotation=modelNode.GeometricRotation.value),"GeometricScaling"in modelNode&&(transformData.scale=modelNode.GeometricScaling.value);const transform=generateTransform(transformData);return this.genGeometry(geoNode,skeleton,morphTargets,transform)}genGeometry(geoNode,skeleton,morphTargets,preTransform){const geo=new three_module.BufferGeometry;geoNode.attrName&&(geo.name=geoNode.attrName);const geoInfo=this.parseGeoNode(geoNode,skeleton),buffers=this.genBuffers(geoInfo),positionAttribute=new three_module.Float32BufferAttribute(buffers.vertex,3);if(positionAttribute.applyMatrix4(preTransform),geo.setAttribute("position",positionAttribute),buffers.colors.length>0&&geo.setAttribute("color",new three_module.Float32BufferAttribute(buffers.colors,3)),skeleton&&(geo.setAttribute("skinIndex",new three_module.Uint16BufferAttribute(buffers.weightsIndices,4)),geo.setAttribute("skinWeight",new three_module.Float32BufferAttribute(buffers.vertexWeights,4)),geo.FBX_Deformer=skeleton),buffers.normal.length>0){const normalMatrix=(new three_module.Matrix3).getNormalMatrix(preTransform),normalAttribute=new three_module.Float32BufferAttribute(buffers.normal,3);normalAttribute.applyNormalMatrix(normalMatrix),geo.setAttribute("normal",normalAttribute)}if(buffers.uvs.forEach((function(uvBuffer,i){let name="uv"+(i+1).toString();0===i&&(name="uv"),geo.setAttribute(name,new three_module.Float32BufferAttribute(buffers.uvs[i],2))})),geoInfo.material&&"AllSame"!==geoInfo.material.mappingType){let prevMaterialIndex=buffers.materialIndex[0],startIndex=0;if(buffers.materialIndex.forEach((function(currentIndex,i){currentIndex!==prevMaterialIndex&&(geo.addGroup(startIndex,i-startIndex,prevMaterialIndex),prevMaterialIndex=currentIndex,startIndex=i)})),geo.groups.length>0){const lastGroup=geo.groups[geo.groups.length-1],lastIndex=lastGroup.start+lastGroup.count;lastIndex!==buffers.materialIndex.length&&geo.addGroup(lastIndex,buffers.materialIndex.length-lastIndex,prevMaterialIndex)}0===geo.groups.length&&geo.addGroup(0,buffers.materialIndex.length,buffers.materialIndex[0])}return this.addMorphTargets(geo,geoNode,morphTargets,preTransform),geo}parseGeoNode(geoNode,skeleton){const geoInfo={};if(geoInfo.vertexPositions=void 0!==geoNode.Vertices?geoNode.Vertices.a:[],geoInfo.vertexIndices=void 0!==geoNode.PolygonVertexIndex?geoNode.PolygonVertexIndex.a:[],geoNode.LayerElementColor&&(geoInfo.color=this.parseVertexColors(geoNode.LayerElementColor[0])),geoNode.LayerElementMaterial&&(geoInfo.material=this.parseMaterialIndices(geoNode.LayerElementMaterial[0])),geoNode.LayerElementNormal&&(geoInfo.normal=this.parseNormals(geoNode.LayerElementNormal[0])),geoNode.LayerElementUV){geoInfo.uv=[];let i=0;for(;geoNode.LayerElementUV[i];)geoNode.LayerElementUV[i].UV&&geoInfo.uv.push(this.parseUVs(geoNode.LayerElementUV[i])),i++}return geoInfo.weightTable={},null!==skeleton&&(geoInfo.skeleton=skeleton,skeleton.rawBones.forEach((function(rawBone,i){rawBone.indices.forEach((function(index,j){void 0===geoInfo.weightTable[index]&&(geoInfo.weightTable[index]=[]),geoInfo.weightTable[index].push({id:i,weight:rawBone.weights[j]})}))}))),geoInfo}genBuffers(geoInfo){const buffers={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let polygonIndex=0,faceLength=0,displayedWeightsWarning=!1,facePositionIndexes=[],faceNormals=[],faceColors=[],faceUVs=[],faceWeights=[],faceWeightIndices=[];const scope=this;return geoInfo.vertexIndices.forEach((function(vertexIndex,polygonVertexIndex){let materialIndex,endOfFace=!1;vertexIndex<0&&(vertexIndex^=-1,endOfFace=!0);let weightIndices=[],weights=[];if(facePositionIndexes.push(3*vertexIndex,3*vertexIndex+1,3*vertexIndex+2),geoInfo.color){const data=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.color);faceColors.push(data[0],data[1],data[2])}if(geoInfo.skeleton){if(void 0!==geoInfo.weightTable[vertexIndex]&&geoInfo.weightTable[vertexIndex].forEach((function(wt){weights.push(wt.weight),weightIndices.push(wt.id)})),weights.length>4){displayedWeightsWarning||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),displayedWeightsWarning=!0);const wIndex=[0,0,0,0],Weight=[0,0,0,0];weights.forEach((function(weight,weightIndex){let currentWeight=weight,currentIndex=weightIndices[weightIndex];Weight.forEach((function(comparedWeight,comparedWeightIndex,comparedWeightArray){if(currentWeight>comparedWeight){comparedWeightArray[comparedWeightIndex]=currentWeight,currentWeight=comparedWeight;const tmp=wIndex[comparedWeightIndex];wIndex[comparedWeightIndex]=currentIndex,currentIndex=tmp}}))})),weightIndices=wIndex,weights=Weight}for(;weights.length<4;)weights.push(0),weightIndices.push(0);for(let i=0;i<4;++i)faceWeights.push(weights[i]),faceWeightIndices.push(weightIndices[i])}if(geoInfo.normal){const data=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.normal);faceNormals.push(data[0],data[1],data[2])}geoInfo.material&&"AllSame"!==geoInfo.material.mappingType&&(materialIndex=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.material)[0]),geoInfo.uv&&geoInfo.uv.forEach((function(uv,i){const data=getData(polygonVertexIndex,polygonIndex,vertexIndex,uv);void 0===faceUVs[i]&&(faceUVs[i]=[]),faceUVs[i].push(data[0]),faceUVs[i].push(data[1])})),faceLength++,endOfFace&&(scope.genFace(buffers,geoInfo,facePositionIndexes,materialIndex,faceNormals,faceColors,faceUVs,faceWeights,faceWeightIndices,faceLength),polygonIndex++,faceLength=0,facePositionIndexes=[],faceNormals=[],faceColors=[],faceUVs=[],faceWeights=[],faceWeightIndices=[])})),buffers}genFace(buffers,geoInfo,facePositionIndexes,materialIndex,faceNormals,faceColors,faceUVs,faceWeights,faceWeightIndices,faceLength){for(let i=2;i1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const layer=layersMap.get(children[0].ID);rawClips[nodeID]={name:rawStacks[nodeID].attrName,layer:layer}}return rawClips}addClip(rawClip){let tracks=[];const scope=this;return rawClip.layer.forEach((function(rawTracks){tracks=tracks.concat(scope.generateTracks(rawTracks))})),new three_module.AnimationClip(rawClip.name,-1,tracks)}generateTracks(rawTracks){const tracks=[];let initialPosition=new three_module.Vector3,initialRotation=new three_module.Quaternion,initialScale=new three_module.Vector3;if(rawTracks.transform&&rawTracks.transform.decompose(initialPosition,initialRotation,initialScale),initialPosition=initialPosition.toArray(),initialRotation=(new three_module.Euler).setFromQuaternion(initialRotation,rawTracks.eulerOrder).toArray(),initialScale=initialScale.toArray(),void 0!==rawTracks.T&&Object.keys(rawTracks.T.curves).length>0){const positionTrack=this.generateVectorTrack(rawTracks.modelName,rawTracks.T.curves,initialPosition,"position");void 0!==positionTrack&&tracks.push(positionTrack)}if(void 0!==rawTracks.R&&Object.keys(rawTracks.R.curves).length>0){const rotationTrack=this.generateRotationTrack(rawTracks.modelName,rawTracks.R.curves,initialRotation,rawTracks.preRotation,rawTracks.postRotation,rawTracks.eulerOrder);void 0!==rotationTrack&&tracks.push(rotationTrack)}if(void 0!==rawTracks.S&&Object.keys(rawTracks.S.curves).length>0){const scaleTrack=this.generateVectorTrack(rawTracks.modelName,rawTracks.S.curves,initialScale,"scale");void 0!==scaleTrack&&tracks.push(scaleTrack)}if(void 0!==rawTracks.DeformPercent){const morphTrack=this.generateMorphTrack(rawTracks);void 0!==morphTrack&&tracks.push(morphTrack)}return tracks}generateVectorTrack(modelName,curves,initialValue,type){const times=this.getTimesForAllAxes(curves),values=this.getKeyframeTrackValues(times,curves,initialValue);return new three_module.VectorKeyframeTrack(modelName+"."+type,times,values)}generateRotationTrack(modelName,curves,initialValue,preRotation,postRotation,eulerOrder){void 0!==curves.x&&(this.interpolateRotations(curves.x),curves.x.values=curves.x.values.map(three_module.MathUtils.degToRad)),void 0!==curves.y&&(this.interpolateRotations(curves.y),curves.y.values=curves.y.values.map(three_module.MathUtils.degToRad)),void 0!==curves.z&&(this.interpolateRotations(curves.z),curves.z.values=curves.z.values.map(three_module.MathUtils.degToRad));const times=this.getTimesForAllAxes(curves),values=this.getKeyframeTrackValues(times,curves,initialValue);void 0!==preRotation&&((preRotation=preRotation.map(three_module.MathUtils.degToRad)).push(eulerOrder),preRotation=(new three_module.Euler).fromArray(preRotation),preRotation=(new three_module.Quaternion).setFromEuler(preRotation)),void 0!==postRotation&&((postRotation=postRotation.map(three_module.MathUtils.degToRad)).push(eulerOrder),postRotation=(new three_module.Euler).fromArray(postRotation),postRotation=(new three_module.Quaternion).setFromEuler(postRotation).invert());const quaternion=new three_module.Quaternion,euler=new three_module.Euler,quaternionValues=[];for(let i=0;i1){let targetIndex=1,lastValue=times[0];for(let i=1;i=180){const numSubIntervals=absoluteSpan/180,step=valuesSpan/numSubIntervals;let nextValue=initialValue+step;const initialTime=curve.times[i-1],interval=(curve.times[i]-initialTime)/numSubIntervals;let nextTime=initialTime+interval;const interpolatedTimes=[],interpolatedValues=[];for(;nextTime1&&(name=attrs[1].replace(/^(\w+)::/,""),type=attrs[2]),{id:id,name:name,type:type}}parseNodeProperty(line,property,contentLine){let propName=property[1].replace(/^"/,"").replace(/"$/,"").trim(),propValue=property[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===propName&&","===propValue&&(propValue=contentLine.replace(/"/g,"").replace(/,$/,"").trim());const currentNode=this.getCurrentNode();if("Properties70"!==currentNode.name){if("C"===propName){const connProps=propValue.split(",").slice(1),from=parseInt(connProps[0]),to=parseInt(connProps[1]);let rest=propValue.split(",").slice(3);rest=rest.map((function(elem){return elem.trim().replace(/^"/,"")})),propName="connections",propValue=[from,to],function append(a,b){for(let i=0,j=a.length,l=b.length;i=reader.size():reader.getOffset()+160+16>=reader.size()}parseNode(reader,version){const node={},endOffset=version>=7500?reader.getUint64():reader.getUint32(),numProperties=version>=7500?reader.getUint64():reader.getUint32();version>=7500?reader.getUint64():reader.getUint32();const nameLen=reader.getUint8(),name=reader.getString(nameLen);if(0===endOffset)return null;const propertyList=[];for(let i=0;i0?propertyList[0]:"",attrName=propertyList.length>1?propertyList[1]:"",attrType=propertyList.length>2?propertyList[2]:"";for(node.singleProperty=1===numProperties&&reader.getOffset()===endOffset;endOffset>reader.getOffset();){const subNode=this.parseNode(reader,version);null!==subNode&&this.parseSubNode(name,node,subNode)}return node.propertyList=propertyList,"number"==typeof id&&(node.id=id),""!==attrName&&(node.attrName=attrName),""!==attrType&&(node.attrType=attrType),""!==name&&(node.name=name),node}parseSubNode(name,node,subNode){if(!0===subNode.singleProperty){const value=subNode.propertyList[0];Array.isArray(value)?(node[subNode.name]=subNode,subNode.a=value):node[subNode.name]=value}else if("Connections"===name&&"C"===subNode.name){const array=[];subNode.propertyList.forEach((function(property,i){0!==i&&array.push(property)})),void 0===node.connections&&(node.connections=[]),node.connections.push(array)}else if("Properties70"===subNode.name){Object.keys(subNode).forEach((function(key){node[key]=subNode[key]}))}else if("Properties70"===name&&"P"===subNode.name){let innerPropName=subNode.propertyList[0],innerPropType1=subNode.propertyList[1];const innerPropType2=subNode.propertyList[2],innerPropFlag=subNode.propertyList[3];let innerPropValue;0===innerPropName.indexOf("Lcl ")&&(innerPropName=innerPropName.replace("Lcl ","Lcl_")),0===innerPropType1.indexOf("Lcl ")&&(innerPropType1=innerPropType1.replace("Lcl ","Lcl_")),innerPropValue="Color"===innerPropType1||"ColorRGB"===innerPropType1||"Vector"===innerPropType1||"Vector3D"===innerPropType1||0===innerPropType1.indexOf("Lcl_")?[subNode.propertyList[4],subNode.propertyList[5],subNode.propertyList[6]]:subNode.propertyList[4],node[innerPropName]={type:innerPropType1,type2:innerPropType2,flag:innerPropFlag,value:innerPropValue}}else void 0===node[subNode.name]?"number"==typeof subNode.id?(node[subNode.name]={},node[subNode.name][subNode.id]=subNode):node[subNode.name]=subNode:"PoseNode"===subNode.name?(Array.isArray(node[subNode.name])||(node[subNode.name]=[node[subNode.name]]),node[subNode.name].push(subNode)):void 0===node[subNode.name][subNode.id]&&(node[subNode.name][subNode.id]=subNode)}parseProperty(reader){const type=reader.getString(1);let length;switch(type){case"C":return reader.getBoolean();case"D":return reader.getFloat64();case"F":return reader.getFloat32();case"I":return reader.getInt32();case"L":return reader.getInt64();case"R":return length=reader.getUint32(),reader.getArrayBuffer(length);case"S":return length=reader.getUint32(),reader.getString(length);case"Y":return reader.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const arrayLength=reader.getUint32(),encoding=reader.getUint32(),compressedLength=reader.getUint32();if(0===encoding)switch(type){case"b":case"c":return reader.getBooleanArray(arrayLength);case"d":return reader.getFloat64Array(arrayLength);case"f":return reader.getFloat32Array(arrayLength);case"i":return reader.getInt32Array(arrayLength);case"l":return reader.getInt64Array(arrayLength)}const data=(0,browser.HT)(new Uint8Array(reader.getArrayBuffer(compressedLength))),reader2=new BinaryReader(data.buffer);switch(type){case"b":case"c":return reader2.getBooleanArray(arrayLength);case"d":return reader2.getFloat64Array(arrayLength);case"f":return reader2.getFloat32Array(arrayLength);case"i":return reader2.getInt32Array(arrayLength);case"l":return reader2.getInt64Array(arrayLength)}default:throw new Error("THREE.FBXLoader: Unknown property type "+type)}}}class BinaryReader{constructor(buffer,littleEndian){this.dv=new DataView(buffer),this.offset=0,this.littleEndian=void 0===littleEndian||littleEndian}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(length){this.offset+=length}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(size){const a=[];for(let i=0;i=0&&(a=a.slice(0,nullByte)),three_module.LoaderUtils.decodeText(new Uint8Array(a))}}class FBXTree{add(key,val){this[key]=val}}function getFbxVersion(text){const match=text.match(/FBXVersion: (\d+)/);if(match){return parseInt(match[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function convertFBXTimeToSeconds(time){return time/46186158e3}const dataArray=[];function getData(polygonVertexIndex,polygonIndex,vertexIndex,infoObject){let index;switch(infoObject.mappingType){case"ByPolygonVertex":index=polygonVertexIndex;break;case"ByPolygon":index=polygonIndex;break;case"ByVertice":index=vertexIndex;break;case"AllSame":index=infoObject.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+infoObject.mappingType)}"IndexToDirect"===infoObject.referenceType&&(index=infoObject.indices[index]);const from=index*infoObject.dataSize,to=from+infoObject.dataSize;return function slice(a,b,from,to){for(let i=from,j=0;i=2.0 are supported.")));const parser=new GLTFParser(json,{path:path||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});parser.fileLoader.setRequestHeader(this.requestHeader);for(let i=0;i=0&&void 0===plugins[extensionName]&&console.warn('THREE.GLTFLoader: Unknown extension "'+extensionName+'".')}}parser.setExtensions(extensions),parser.setPlugins(plugins),parser.parse(onLoad,onError)}parseAsync(data,path){const scope=this;return new Promise((function(resolve,reject){scope.parse(data,path,resolve,reject)}))}}function GLTFRegistry(){let objects={};return{get:function(key){return objects[key]},add:function(key,object){objects[key]=object},remove:function(key){delete objects[key]},removeAll:function(){objects={}}}}const EXTENSIONS={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class GLTFLightsExtension{constructor(parser){this.parser=parser,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const parser=this.parser,nodeDefs=this.parser.json.nodes||[];for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return parser.loadTextureImage(textureIndex,extension.source,loader)}}class GLTFTextureWebPExtension{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(textureIndex){const name=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name])return null;const extension=textureDef.extensions[name],source=json.images[extension.source];let loader=parser.textureLoader;if(source.uri){const handler=parser.options.manager.getHandler(source.uri);null!==handler&&(loader=handler)}return this.detectSupport().then((function(isSupported){if(isSupported)return parser.loadTextureImage(textureIndex,extension.source,loader);if(json.extensionsRequired&&json.extensionsRequired.indexOf(name)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return parser.loadTexture(textureIndex)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(resolve){const image=new Image;image.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",image.onload=image.onerror=function(){resolve(1===image.height)}}))),this.isSupported}}class GLTFTextureAVIFExtension{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(textureIndex){const name=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name])return null;const extension=textureDef.extensions[name],source=json.images[extension.source];let loader=parser.textureLoader;if(source.uri){const handler=parser.options.manager.getHandler(source.uri);null!==handler&&(loader=handler)}return this.detectSupport().then((function(isSupported){if(isSupported)return parser.loadTextureImage(textureIndex,extension.source,loader);if(json.extensionsRequired&&json.extensionsRequired.indexOf(name)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return parser.loadTexture(textureIndex)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(resolve){const image=new Image;image.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",image.onload=image.onerror=function(){resolve(1===image.height)}}))),this.isSupported}}class GLTFMeshoptCompression{constructor(parser){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=parser}loadBufferView(index){const json=this.parser.json,bufferView=json.bufferViews[index];if(bufferView.extensions&&bufferView.extensions[this.name]){const extensionDef=bufferView.extensions[this.name],buffer=this.parser.getDependency("buffer",extensionDef.buffer),decoder=this.parser.options.meshoptDecoder;if(!decoder||!decoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return buffer.then((function(res){const byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count=extensionDef.count,stride=extensionDef.byteStride,source=new Uint8Array(res,byteOffset,byteLength);return decoder.decodeGltfBufferAsync?decoder.decodeGltfBufferAsync(count,stride,source,extensionDef.mode,extensionDef.filter).then((function(res2){return res2.buffer})):decoder.ready.then((function(){const result=new ArrayBuffer(count*stride);return decoder.decodeGltfBuffer(new Uint8Array(result),count,stride,source,extensionDef.mode,extensionDef.filter),result}))}))}return null}}class GLTFMeshGpuInstancing{constructor(parser){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=parser}createNodeMesh(nodeIndex){const json=this.parser.json,nodeDef=json.nodes[nodeIndex];if(!nodeDef.extensions||!nodeDef.extensions[this.name]||void 0===nodeDef.mesh)return null;const meshDef=json.meshes[nodeDef.mesh];for(const primitive of meshDef.primitives)if(primitive.mode!==WEBGL_CONSTANTS.TRIANGLES&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&void 0!==primitive.mode)return null;const attributesDef=nodeDef.extensions[this.name].attributes,pending=[],attributes={};for(const key in attributesDef)pending.push(this.parser.getDependency("accessor",attributesDef[key]).then((accessor=>(attributes[key]=accessor,attributes[key]))));return pending.length<1?null:(pending.push(this.parser.createNodeMesh(nodeIndex)),Promise.all(pending).then((results=>{const nodeObject=results.pop(),meshes=nodeObject.isGroup?nodeObject.children:[nodeObject],count=results[0].count,instancedMeshes=[];for(const mesh of meshes){const m=new three_module.Matrix4,p=new three_module.Vector3,q=new three_module.Quaternion,s=new three_module.Vector3(1,1,1),instancedMesh=new three_module.InstancedMesh(mesh.geometry,mesh.material,count);for(let i=0;i=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},PATH_PROPERTIES={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},INTERPOLATION={CUBICSPLINE:void 0,LINEAR:three_module.InterpolateLinear,STEP:three_module.InterpolateDiscrete},ALPHA_MODES_OPAQUE="OPAQUE",ALPHA_MODES_MASK="MASK",ALPHA_MODES_BLEND="BLEND";function addUnknownExtensionsToUserData(knownExtensions,object,objectDef){for(const name in objectDef.extensions)void 0===knownExtensions[name]&&(object.userData.gltfExtensions=object.userData.gltfExtensions||{},object.userData.gltfExtensions[name]=objectDef.extensions[name])}function assignExtrasToUserData(object,gltfDef){void 0!==gltfDef.extras&&("object"==typeof gltfDef.extras?Object.assign(object.userData,gltfDef.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+gltfDef.extras))}function updateMorphTargets(mesh,meshDef){if(mesh.updateMorphTargets(),void 0!==meshDef.weights)for(let i=0,il=meshDef.weights.length;i-1,firefoxVersion=isFirefox?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||isSafari||isFirefox&&firefoxVersion<98?this.textureLoader=new three_module.TextureLoader(this.options.manager):this.textureLoader=new three_module.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new three_module.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(extensions){this.extensions=extensions}setPlugins(plugins){this.plugins=plugins}parse(onLoad,onError){const parser=this,json=this.json,extensions=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(ext){return ext._markDefs&&ext._markDefs()})),Promise.all(this._invokeAll((function(ext){return ext.beforeRoot&&ext.beforeRoot()}))).then((function(){return Promise.all([parser.getDependencies("scene"),parser.getDependencies("animation"),parser.getDependencies("camera")])})).then((function(dependencies){const result={scene:dependencies[0][json.scene||0],scenes:dependencies[0],animations:dependencies[1],cameras:dependencies[2],asset:json.asset,parser:parser,userData:{}};addUnknownExtensionsToUserData(extensions,result,json),assignExtrasToUserData(result,json),Promise.all(parser._invokeAll((function(ext){return ext.afterRoot&&ext.afterRoot(result)}))).then((function(){onLoad(result)}))})).catch(onError)}_markDefs(){const nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex{const mappings=this.associations.get(original);null!=mappings&&this.associations.set(clone,mappings);for(const[i,child]of original.children.entries())updateMappings(child,clone.children[i])};return updateMappings(object,ref),ref.name+="_instance_"+cache.uses[index]++,ref}_invokeOne(func){const extensions=Object.values(this.plugins);extensions.push(this);for(let i=0;i=2&&bufferAttribute.setY(index,sparseValues[i*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index,sparseValues[i*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index,sparseValues[i*itemSize+3]),itemSize>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return bufferAttribute}))}loadTexture(textureIndex){const json=this.json,options=this.options,sourceIndex=json.textures[textureIndex].source,sourceDef=json.images[sourceIndex];let loader=this.textureLoader;if(sourceDef.uri){const handler=options.manager.getHandler(sourceDef.uri);null!==handler&&(loader=handler)}return this.loadTextureImage(textureIndex,sourceIndex,loader)}loadTextureImage(textureIndex,sourceIndex,loader){const parser=this,json=this.json,textureDef=json.textures[textureIndex],sourceDef=json.images[sourceIndex],cacheKey=(sourceDef.uri||sourceDef.bufferView)+":"+textureDef.sampler;if(this.textureCache[cacheKey])return this.textureCache[cacheKey];const promise=this.loadImageSource(sourceIndex,loader).then((function(texture){texture.flipY=!1,texture.name=textureDef.name||sourceDef.name||"",""===texture.name&&"string"==typeof sourceDef.uri&&!1===sourceDef.uri.startsWith("data:image/")&&(texture.name=sourceDef.uri);const sampler=(json.samplers||{})[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||three_module.LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||three_module.LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||three_module.RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||three_module.RepeatWrapping,parser.associations.set(texture,{textures:textureIndex}),texture})).catch((function(){return null}));return this.textureCache[cacheKey]=promise,promise}loadImageSource(sourceIndex,loader){const parser=this,json=this.json,options=this.options;if(void 0!==this.sourceCache[sourceIndex])return this.sourceCache[sourceIndex].then((texture=>texture.clone()));const sourceDef=json.images[sourceIndex],URL=self.URL||self.webkitURL;let sourceURI=sourceDef.uri||"",isObjectURL=!1;if(void 0!==sourceDef.bufferView)sourceURI=parser.getDependency("bufferView",sourceDef.bufferView).then((function(bufferView){isObjectURL=!0;const blob=new Blob([bufferView],{type:sourceDef.mimeType});return sourceURI=URL.createObjectURL(blob),sourceURI}));else if(void 0===sourceDef.uri)throw new Error("THREE.GLTFLoader: Image "+sourceIndex+" is missing URI and bufferView");const promise=Promise.resolve(sourceURI).then((function(sourceURI2){return new Promise((function(resolve,reject){let onLoad=resolve;!0===loader.isImageBitmapLoader&&(onLoad=function(imageBitmap){const texture=new three_module.Texture(imageBitmap);texture.needsUpdate=!0,resolve(texture)}),loader.load(three_module.LoaderUtils.resolveURL(sourceURI2,options.path),onLoad,void 0,reject)}))})).then((function(texture){return!0===isObjectURL&&URL.revokeObjectURL(sourceURI),texture.userData.mimeType=sourceDef.mimeType||function getImageURIMimeType(uri){return uri.search(/\.jpe?g($|\?)/i)>0||0===uri.search(/^data\:image\/jpeg/)?"image/jpeg":uri.search(/\.webp($|\?)/i)>0||0===uri.search(/^data\:image\/webp/)?"image/webp":"image/png"}(sourceDef.uri),texture})).catch((function(error){throw console.error("THREE.GLTFLoader: Couldn't load texture",sourceURI),error}));return this.sourceCache[sourceIndex]=promise,promise}assignTexture(materialParams,mapName,mapDef,encoding){const parser=this;return this.getDependency("texture",mapDef.index).then((function(texture){if(!texture)return null;if(void 0!==mapDef.texCoord&&mapDef.texCoord>0&&((texture=texture.clone()).channel=mapDef.texCoord),parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){const transform=void 0!==mapDef.extensions?mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]:void 0;if(transform){const gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform),parser.associations.set(texture,gltfReference)}}return void 0!==encoding&&("colorSpace"in texture?texture.colorSpace=3001===encoding?"srgb":"srgb-linear":texture.encoding=encoding),materialParams[mapName]=texture,texture}))}assignFinalMaterial(mesh){const geometry=mesh.geometry;let material=mesh.material;const useDerivativeTangents=void 0===geometry.attributes.tangent,useVertexColors=void 0!==geometry.attributes.color,useFlatShading=void 0===geometry.attributes.normal;if(mesh.isPoints){const cacheKey="PointsMaterial:"+material.uuid;let pointsMaterial=this.cache.get(cacheKey);pointsMaterial||(pointsMaterial=new three_module.PointsMaterial,three_module.Material.prototype.copy.call(pointsMaterial,material),pointsMaterial.color.copy(material.color),pointsMaterial.map=material.map,pointsMaterial.sizeAttenuation=!1,this.cache.add(cacheKey,pointsMaterial)),material=pointsMaterial}else if(mesh.isLine){const cacheKey="LineBasicMaterial:"+material.uuid;let lineMaterial=this.cache.get(cacheKey);lineMaterial||(lineMaterial=new three_module.LineBasicMaterial,three_module.Material.prototype.copy.call(lineMaterial,material),lineMaterial.color.copy(material.color),lineMaterial.map=material.map,this.cache.add(cacheKey,lineMaterial)),material=lineMaterial}if(useDerivativeTangents||useVertexColors||useFlatShading){let cacheKey="ClonedMaterial:"+material.uuid+":";useDerivativeTangents&&(cacheKey+="derivative-tangents:"),useVertexColors&&(cacheKey+="vertex-colors:"),useFlatShading&&(cacheKey+="flat-shading:");let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&(cachedMaterial.flatShading=!0),useDerivativeTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.add(cacheKey,cachedMaterial),this.associations.set(cachedMaterial,this.associations.get(material))),material=cachedMaterial}mesh.material=material}getMaterialType(){return three_module.MeshStandardMaterial}loadMaterial(materialIndex){const parser=this,json=this.json,extensions=this.extensions,materialDef=json.materials[materialIndex];let materialType;const materialParams={},pending=[];if((materialDef.extensions||{})[EXTENSIONS.KHR_MATERIALS_UNLIT]){const kmuExtension=extensions[EXTENSIONS.KHR_MATERIALS_UNLIT];materialType=kmuExtension.getMaterialType(),pending.push(kmuExtension.extendParams(materialParams,materialDef,parser))}else{const metallicRoughness=materialDef.pbrMetallicRoughness||{};if(materialParams.color=new three_module.Color(1,1,1),materialParams.opacity=1,Array.isArray(metallicRoughness.baseColorFactor)){const array=metallicRoughness.baseColorFactor;materialParams.color.fromArray(array),materialParams.opacity=array[3]}void 0!==metallicRoughness.baseColorTexture&&pending.push(parser.assignTexture(materialParams,"map",metallicRoughness.baseColorTexture,3001)),materialParams.metalness=void 0!==metallicRoughness.metallicFactor?metallicRoughness.metallicFactor:1,materialParams.roughness=void 0!==metallicRoughness.roughnessFactor?metallicRoughness.roughnessFactor:1,void 0!==metallicRoughness.metallicRoughnessTexture&&(pending.push(parser.assignTexture(materialParams,"metalnessMap",metallicRoughness.metallicRoughnessTexture)),pending.push(parser.assignTexture(materialParams,"roughnessMap",metallicRoughness.metallicRoughnessTexture))),materialType=this._invokeOne((function(ext){return ext.getMaterialType&&ext.getMaterialType(materialIndex)})),pending.push(Promise.all(this._invokeAll((function(ext){return ext.extendMaterialParams&&ext.extendMaterialParams(materialIndex,materialParams)}))))}!0===materialDef.doubleSided&&(materialParams.side=three_module.DoubleSide);const alphaMode=materialDef.alphaMode||ALPHA_MODES_OPAQUE;if(alphaMode===ALPHA_MODES_BLEND?(materialParams.transparent=!0,materialParams.depthWrite=!1):(materialParams.transparent=!1,alphaMode===ALPHA_MODES_MASK&&(materialParams.alphaTest=void 0!==materialDef.alphaCutoff?materialDef.alphaCutoff:.5)),void 0!==materialDef.normalTexture&&materialType!==three_module.MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,"normalMap",materialDef.normalTexture)),materialParams.normalScale=new three_module.Vector2(1,1),void 0!==materialDef.normalTexture.scale)){const scale=materialDef.normalTexture.scale;materialParams.normalScale.set(scale,scale)}return void 0!==materialDef.occlusionTexture&&materialType!==three_module.MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,"aoMap",materialDef.occlusionTexture)),void 0!==materialDef.occlusionTexture.strength&&(materialParams.aoMapIntensity=materialDef.occlusionTexture.strength)),void 0!==materialDef.emissiveFactor&&materialType!==three_module.MeshBasicMaterial&&(materialParams.emissive=(new three_module.Color).fromArray(materialDef.emissiveFactor)),void 0!==materialDef.emissiveTexture&&materialType!==three_module.MeshBasicMaterial&&pending.push(parser.assignTexture(materialParams,"emissiveMap",materialDef.emissiveTexture,3001)),Promise.all(pending).then((function(){const material=new materialType(materialParams);return materialDef.name&&(material.name=materialDef.name),assignExtrasToUserData(material,materialDef),parser.associations.set(material,{materials:materialIndex}),materialDef.extensions&&addUnknownExtensionsToUserData(extensions,material,materialDef),material}))}createUniqueName(originalName){const sanitizedName=three_module.PropertyBinding.sanitizeNodeName(originalName||"");return sanitizedName in this.nodeNamesUsed?sanitizedName+"_"+ ++this.nodeNamesUsed[sanitizedName]:(this.nodeNamesUsed[sanitizedName]=0,sanitizedName)}loadGeometries(primitives){const parser=this,extensions=this.extensions,cache=this.primitiveCache;function createDracoPrimitive(primitive){return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive,parser).then((function(geometry){return addPrimitiveAttributes(geometry,primitive,parser)}))}const pending=[];for(let i=0,il=primitives.length;i0&&updateMorphTargets(mesh,meshDef),mesh.name=parser.createUniqueName(meshDef.name||"mesh_"+meshIndex),assignExtrasToUserData(mesh,meshDef),primitive.extensions&&addUnknownExtensionsToUserData(extensions,mesh,primitive),parser.assignFinalMaterial(mesh),meshes.push(mesh)}for(let i=0,il=meshes.length;i1?new three_module.Group:1===objects.length?objects[0]:new three_module.Object3D,node!==objects[0])for(let i=0,il=objects.length;i{const reducedAssociations=new Map;for(const[key,value]of parser.associations)(key instanceof three_module.Material||key instanceof three_module.Texture)&&reducedAssociations.set(key,value);return node.traverse((node2=>{const mappings=parser.associations.get(node2);null!=mappings&&reducedAssociations.set(node2,mappings)})),reducedAssociations})(scene),scene}))}}function addPrimitiveAttributes(geometry,primitiveDef,parser){const attributes=primitiveDef.attributes,pending=[];function assignAttributeAccessor(accessorIndex,attributeName){return parser.getDependency("accessor",accessorIndex).then((function(accessor){geometry.setAttribute(attributeName,accessor)}))}for(const gltfAttributeName in attributes){const threeAttributeName=ATTRIBUTES[gltfAttributeName]||gltfAttributeName.toLowerCase();threeAttributeName in geometry.attributes||pending.push(assignAttributeAccessor(attributes[gltfAttributeName],threeAttributeName))}if(void 0!==primitiveDef.indices&&!geometry.index){const accessor=parser.getDependency("accessor",primitiveDef.indices).then((function(accessor2){geometry.setIndex(accessor2)}));pending.push(accessor)}return assignExtrasToUserData(geometry,primitiveDef),function computeBounds(geometry,primitiveDef,parser){const attributes=primitiveDef.attributes,box=new three_module.Box3;if(void 0===attributes.POSITION)return;{const accessor=parser.json.accessors[attributes.POSITION],min=accessor.min,max=accessor.max;if(void 0===min||void 0===max)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(box.set(new three_module.Vector3(min[0],min[1],min[2]),new three_module.Vector3(max[0],max[1],max[2])),accessor.normalized){const boxScale=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[accessor.componentType]);box.min.multiplyScalar(boxScale),box.max.multiplyScalar(boxScale)}}const targets=primitiveDef.targets;if(void 0!==targets){const maxDisplacement=new three_module.Vector3,vector=new three_module.Vector3;for(let i=0,il=targets.length;i>8&255]+_lut[d0>>16&255]+_lut[d0>>24&255]+"-"+_lut[255&d1]+_lut[d1>>8&255]+"-"+_lut[d1>>16&15|64]+_lut[d1>>24&255]+"-"+_lut[63&d2|128]+_lut[d2>>8&255]+"-"+_lut[d2>>16&255]+_lut[d2>>24&255]+_lut[255&d3]+_lut[d3>>8&255]+_lut[d3>>16&255]+_lut[d3>>24&255]).toLowerCase()}function clamp(value,min,max){return Math.max(min,Math.min(max,value))}function euclideanModulo(n,m){return(n%m+m)%m}function lerp(x,y,t){return(1-t)*x+t*y}function isPowerOfTwo(value){return 0==(value&value-1)&&0!==value}function ceilPowerOfTwo(value){return Math.pow(2,Math.ceil(Math.log(value)/Math.LN2))}function floorPowerOfTwo(value){return Math.pow(2,Math.floor(Math.log(value)/Math.LN2))}function denormalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint32Array:return value/4294967295;case Uint16Array:return value/65535;case Uint8Array:return value/255;case Int32Array:return Math.max(value/2147483647,-1);case Int16Array:return Math.max(value/32767,-1);case Int8Array:return Math.max(value/127,-1);default:throw new Error("Invalid component type.")}}function normalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint32Array:return Math.round(4294967295*value);case Uint16Array:return Math.round(65535*value);case Uint8Array:return Math.round(255*value);case Int32Array:return Math.round(2147483647*value);case Int16Array:return Math.round(32767*value);case Int8Array:return Math.round(127*value);default:throw new Error("Invalid component type.")}}const MathUtils={DEG2RAD:DEG2RAD,RAD2DEG:RAD2DEG,generateUUID:generateUUID,clamp:clamp,euclideanModulo:euclideanModulo,mapLinear:function mapLinear(x,a1,a2,b1,b2){return b1+(x-a1)*(b2-b1)/(a2-a1)},inverseLerp:function inverseLerp(x,y,value){return x!==y?(value-x)/(y-x):0},lerp:lerp,damp:function damp(x,y,lambda,dt){return lerp(x,y,1-Math.exp(-lambda*dt))},pingpong:function pingpong(x,length=1){return length-Math.abs(euclideanModulo(x,2*length)-length)},smoothstep:function smoothstep(x,min,max){return x<=min?0:x>=max?1:(x=(x-min)/(max-min))*x*(3-2*x)},smootherstep:function smootherstep(x,min,max){return x<=min?0:x>=max?1:(x=(x-min)/(max-min))*x*x*(x*(6*x-15)+10)},randInt:function randInt(low,high){return low+Math.floor(Math.random()*(high-low+1))},randFloat:function randFloat(low,high){return low+Math.random()*(high-low)},randFloatSpread:function randFloatSpread(range){return range*(.5-Math.random())},seededRandom:function seededRandom(s){void 0!==s&&(_seed=s);let t=_seed+=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 degToRad(degrees){return degrees*DEG2RAD},radToDeg:function radToDeg(radians){return radians*RAD2DEG},isPowerOfTwo:isPowerOfTwo,ceilPowerOfTwo:ceilPowerOfTwo,floorPowerOfTwo:floorPowerOfTwo,setQuaternionFromProperEuler:function setQuaternionFromProperEuler(q,a,b,c,order){const cos=Math.cos,sin=Math.sin,c2=cos(b/2),s2=sin(b/2),c13=cos((a+c)/2),s13=sin((a+c)/2),c1_3=cos((a-c)/2),s1_3=sin((a-c)/2),c3_1=cos((c-a)/2),s3_1=sin((c-a)/2);switch(order){case"XYX":q.set(c2*s13,s2*c1_3,s2*s1_3,c2*c13);break;case"YZY":q.set(s2*s1_3,c2*s13,s2*c1_3,c2*c13);break;case"ZXZ":q.set(s2*c1_3,s2*s1_3,c2*s13,c2*c13);break;case"XZX":q.set(c2*s13,s2*s3_1,s2*c3_1,c2*c13);break;case"YXY":q.set(s2*c3_1,c2*s13,s2*s3_1,c2*c13);break;case"ZYZ":q.set(s2*s3_1,s2*c3_1,c2*s13,c2*c13);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+order)}},normalize:normalize,denormalize:denormalize};class Vector2{constructor(x=0,y=0){Vector2.prototype.isVector2=!0,this.x=x,this.y=y}get width(){return this.x}set width(value){this.x=value}get height(){return this.y}set height(value){this.y=value}set(x,y){return this.x=x,this.y=y,this}setScalar(scalar){return this.x=scalar,this.y=scalar,this}setX(x){return this.x=x,this}setY(y){return this.y=y,this}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;default:throw new Error("index is out of range: "+index)}return this}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+index)}}clone(){return new this.constructor(this.x,this.y)}copy(v){return this.x=v.x,this.y=v.y,this}add(v){return this.x+=v.x,this.y+=v.y,this}addScalar(s){return this.x+=s,this.y+=s,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this}addScaledVector(v,s){return this.x+=v.x*s,this.y+=v.y*s,this}sub(v){return this.x-=v.x,this.y-=v.y,this}subScalar(s){return this.x-=s,this.y-=s,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this}multiply(v){return this.x*=v.x,this.y*=v.y,this}multiplyScalar(scalar){return this.x*=scalar,this.y*=scalar,this}divide(v){return this.x/=v.x,this.y/=v.y,this}divideScalar(scalar){return this.multiplyScalar(1/scalar)}applyMatrix3(m){const x=this.x,y=this.y,e=m.elements;return this.x=e[0]*x+e[3]*y+e[6],this.y=e[1]*x+e[4]*y+e[7],this}min(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this}max(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this}clamp(min,max){return this.x=Math.max(min.x,Math.min(max.x,this.x)),this.y=Math.max(min.y,Math.min(max.y,this.y)),this}clampScalar(minVal,maxVal){return this.x=Math.max(minVal,Math.min(maxVal,this.x)),this.y=Math.max(minVal,Math.min(maxVal,this.y)),this}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(v){return this.x*v.x+this.y*v.y}cross(v){return this.x*v.y-this.y*v.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(v){const denominator=Math.sqrt(this.lengthSq()*v.lengthSq());if(0===denominator)return Math.PI/2;const theta=this.dot(v)/denominator;return Math.acos(clamp(theta,-1,1))}distanceTo(v){return Math.sqrt(this.distanceToSquared(v))}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y;return dx*dx+dy*dy}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)}setLength(length){return this.normalize().multiplyScalar(length)}lerp(v,alpha){return this.x+=(v.x-this.x)*alpha,this.y+=(v.y-this.y)*alpha,this}lerpVectors(v1,v2,alpha){return this.x=v1.x+(v2.x-v1.x)*alpha,this.y=v1.y+(v2.y-v1.y)*alpha,this}equals(v){return v.x===this.x&&v.y===this.y}fromArray(array,offset=0){return this.x=array[offset],this.y=array[offset+1],this}toArray(array=[],offset=0){return array[offset]=this.x,array[offset+1]=this.y,array}fromBufferAttribute(attribute,index){return this.x=attribute.getX(index),this.y=attribute.getY(index),this}rotateAround(center,angle){const c=Math.cos(angle),s=Math.sin(angle),x=this.x-center.x,y=this.y-center.y;return this.x=x*c-y*s+center.x,this.y=x*s+y*c+center.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(n11,n12,n13,n21,n22,n23,n31,n32,n33){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==n11&&this.set(n11,n12,n13,n21,n22,n23,n31,n32,n33)}set(n11,n12,n13,n21,n22,n23,n31,n32,n33){const te=this.elements;return te[0]=n11,te[1]=n21,te[2]=n31,te[3]=n12,te[4]=n22,te[5]=n32,te[6]=n13,te[7]=n23,te[8]=n33,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(m){const te=this.elements,me=m.elements;return te[0]=me[0],te[1]=me[1],te[2]=me[2],te[3]=me[3],te[4]=me[4],te[5]=me[5],te[6]=me[6],te[7]=me[7],te[8]=me[8],this}extractBasis(xAxis,yAxis,zAxis){return xAxis.setFromMatrix3Column(this,0),yAxis.setFromMatrix3Column(this,1),zAxis.setFromMatrix3Column(this,2),this}setFromMatrix4(m){const me=m.elements;return this.set(me[0],me[4],me[8],me[1],me[5],me[9],me[2],me[6],me[10]),this}multiply(m){return this.multiplyMatrices(this,m)}premultiply(m){return this.multiplyMatrices(m,this)}multiplyMatrices(a,b){const ae=a.elements,be=b.elements,te=this.elements,a11=ae[0],a12=ae[3],a13=ae[6],a21=ae[1],a22=ae[4],a23=ae[7],a31=ae[2],a32=ae[5],a33=ae[8],b11=be[0],b12=be[3],b13=be[6],b21=be[1],b22=be[4],b23=be[7],b31=be[2],b32=be[5],b33=be[8];return te[0]=a11*b11+a12*b21+a13*b31,te[3]=a11*b12+a12*b22+a13*b32,te[6]=a11*b13+a12*b23+a13*b33,te[1]=a21*b11+a22*b21+a23*b31,te[4]=a21*b12+a22*b22+a23*b32,te[7]=a21*b13+a22*b23+a23*b33,te[2]=a31*b11+a32*b21+a33*b31,te[5]=a31*b12+a32*b22+a33*b32,te[8]=a31*b13+a32*b23+a33*b33,this}multiplyScalar(s){const te=this.elements;return te[0]*=s,te[3]*=s,te[6]*=s,te[1]*=s,te[4]*=s,te[7]*=s,te[2]*=s,te[5]*=s,te[8]*=s,this}determinant(){const te=this.elements,a=te[0],b=te[1],c=te[2],d=te[3],e=te[4],f=te[5],g=te[6],h=te[7],i=te[8];return a*e*i-a*f*h-b*d*i+b*f*g+c*d*h-c*e*g}invert(){const te=this.elements,n11=te[0],n21=te[1],n31=te[2],n12=te[3],n22=te[4],n32=te[5],n13=te[6],n23=te[7],n33=te[8],t11=n33*n22-n32*n23,t12=n32*n13-n33*n12,t13=n23*n12-n22*n13,det=n11*t11+n21*t12+n31*t13;if(0===det)return this.set(0,0,0,0,0,0,0,0,0);const detInv=1/det;return te[0]=t11*detInv,te[1]=(n31*n23-n33*n21)*detInv,te[2]=(n32*n21-n31*n22)*detInv,te[3]=t12*detInv,te[4]=(n33*n11-n31*n13)*detInv,te[5]=(n31*n12-n32*n11)*detInv,te[6]=t13*detInv,te[7]=(n21*n13-n23*n11)*detInv,te[8]=(n22*n11-n21*n12)*detInv,this}transpose(){let tmp;const m=this.elements;return tmp=m[1],m[1]=m[3],m[3]=tmp,tmp=m[2],m[2]=m[6],m[6]=tmp,tmp=m[5],m[5]=m[7],m[7]=tmp,this}getNormalMatrix(matrix4){return this.setFromMatrix4(matrix4).invert().transpose()}transposeIntoArray(r){const m=this.elements;return r[0]=m[0],r[1]=m[3],r[2]=m[6],r[3]=m[1],r[4]=m[4],r[5]=m[7],r[6]=m[2],r[7]=m[5],r[8]=m[8],this}setUvTransform(tx,ty,sx,sy,rotation,cx,cy){const c=Math.cos(rotation),s=Math.sin(rotation);return this.set(sx*c,sx*s,-sx*(c*cx+s*cy)+cx+tx,-sy*s,sy*c,-sy*(-s*cx+c*cy)+cy+ty,0,0,1),this}scale(sx,sy){return this.premultiply(_m3.makeScale(sx,sy)),this}rotate(theta){return this.premultiply(_m3.makeRotation(-theta)),this}translate(tx,ty){return this.premultiply(_m3.makeTranslation(tx,ty)),this}makeTranslation(x,y){return x.isVector2?this.set(1,0,x.x,0,1,x.y,0,0,1):this.set(1,0,x,0,1,y,0,0,1),this}makeRotation(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(c,-s,0,s,c,0,0,0,1),this}makeScale(x,y){return this.set(x,0,0,0,y,0,0,0,1),this}equals(matrix){const te=this.elements,me=matrix.elements;for(let i=0;i<9;i++)if(te[i]!==me[i])return!1;return!0}fromArray(array,offset=0){for(let i=0;i<9;i++)this.elements[i]=array[i+offset];return this}toArray(array=[],offset=0){const te=this.elements;return array[offset]=te[0],array[offset+1]=te[1],array[offset+2]=te[2],array[offset+3]=te[3],array[offset+4]=te[4],array[offset+5]=te[5],array[offset+6]=te[6],array[offset+7]=te[7],array[offset+8]=te[8],array}clone(){return(new this.constructor).fromArray(this.elements)}}const _m3=new Matrix3;function arrayNeedsUint32(array){for(let i=array.length-1;i>=0;--i)if(array[i]>=65535)return!0;return!1}const TYPED_ARRAYS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function getTypedArray(type,buffer){return new TYPED_ARRAYS[type](buffer)}function createElementNS(name){return document.createElementNS("http://www.w3.org/1999/xhtml",name)}const _cache={};function warnOnce(message){message in _cache||(_cache[message]=!0,console.warn(message))}function SRGBToLinear(c){return c<.04045?.0773993808*c:Math.pow(.9478672986*c+.0521327014,2.4)}function LinearToSRGB(c){return c<.0031308?12.92*c:1.055*Math.pow(c,.41666)-.055}const LINEAR_SRGB_TO_LINEAR_DISPLAY_P3=(new Matrix3).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),LINEAR_DISPLAY_P3_TO_LINEAR_SRGB=(new Matrix3).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const TO_LINEAR={[LinearSRGBColorSpace]:color=>color,[SRGBColorSpace]:color=>color.convertSRGBToLinear(),[DisplayP3ColorSpace]:function DisplayP3ToLinearSRGB(color){return color.convertSRGBToLinear().applyMatrix3(LINEAR_DISPLAY_P3_TO_LINEAR_SRGB)}},FROM_LINEAR={[LinearSRGBColorSpace]:color=>color,[SRGBColorSpace]:color=>color.convertLinearToSRGB(),[DisplayP3ColorSpace]:function LinearSRGBToDisplayP3(color){return color.applyMatrix3(LINEAR_SRGB_TO_LINEAR_DISPLAY_P3).convertLinearToSRGB()}},ColorManagement={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(legacyMode){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!legacyMode},get workingColorSpace(){return LinearSRGBColorSpace},set workingColorSpace(colorSpace){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(color,sourceColorSpace,targetColorSpace){if(!1===this.enabled||sourceColorSpace===targetColorSpace||!sourceColorSpace||!targetColorSpace)return color;const sourceToLinear=TO_LINEAR[sourceColorSpace],targetFromLinear=FROM_LINEAR[targetColorSpace];if(void 0===sourceToLinear||void 0===targetFromLinear)throw new Error(`Unsupported color space conversion, "${sourceColorSpace}" to "${targetColorSpace}".`);return targetFromLinear(sourceToLinear(color))},fromWorkingColorSpace:function(color,targetColorSpace){return this.convert(color,this.workingColorSpace,targetColorSpace)},toWorkingColorSpace:function(color,sourceColorSpace){return this.convert(color,sourceColorSpace,this.workingColorSpace)}};let _canvas;class ImageUtils{static getDataURL(image){if(/^data:/i.test(image.src))return image.src;if("undefined"==typeof HTMLCanvasElement)return image.src;let canvas;if(image instanceof HTMLCanvasElement)canvas=image;else{void 0===_canvas&&(_canvas=createElementNS("canvas")),_canvas.width=image.width,_canvas.height=image.height;const context=_canvas.getContext("2d");image instanceof ImageData?context.putImageData(image,0,0):context.drawImage(image,0,0,image.width,image.height),canvas=_canvas}return canvas.width>2048||canvas.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",image),canvas.toDataURL("image/jpeg",.6)):canvas.toDataURL("image/png")}static sRGBToLinear(image){if("undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&image instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&image instanceof ImageBitmap){const canvas=createElementNS("canvas");canvas.width=image.width,canvas.height=image.height;const context=canvas.getContext("2d");context.drawImage(image,0,0,image.width,image.height);const imageData=context.getImageData(0,0,image.width,image.height),data=imageData.data;for(let i=0;i0&&(output.userData=this.userData),isRootObject||(meta.textures[this.uuid]=output),output}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(uv){if(this.mapping!==UVMapping)return uv;if(uv.applyMatrix3(this.matrix),uv.x<0||uv.x>1)switch(this.wrapS){case RepeatWrapping:uv.x=uv.x-Math.floor(uv.x);break;case ClampToEdgeWrapping:uv.x=uv.x<0?0:1;break;case MirroredRepeatWrapping:1===Math.abs(Math.floor(uv.x)%2)?uv.x=Math.ceil(uv.x)-uv.x:uv.x=uv.x-Math.floor(uv.x)}if(uv.y<0||uv.y>1)switch(this.wrapT){case RepeatWrapping:uv.y=uv.y-Math.floor(uv.y);break;case ClampToEdgeWrapping:uv.y=uv.y<0?0:1;break;case MirroredRepeatWrapping:1===Math.abs(Math.floor(uv.y)%2)?uv.y=Math.ceil(uv.y)-uv.y:uv.y=uv.y-Math.floor(uv.y)}return this.flipY&&(uv.y=1-uv.y),uv}set needsUpdate(value){!0===value&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return warnOnce("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===SRGBColorSpace?sRGBEncoding:LinearEncoding}set encoding(encoding){warnOnce("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=encoding===sRGBEncoding?SRGBColorSpace:NoColorSpace}}Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=UVMapping,Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(x=0,y=0,z=0,w=1){Vector4.prototype.isVector4=!0,this.x=x,this.y=y,this.z=z,this.w=w}get width(){return this.z}set width(value){this.z=value}get height(){return this.w}set height(value){this.w=value}set(x,y,z,w){return this.x=x,this.y=y,this.z=z,this.w=w,this}setScalar(scalar){return this.x=scalar,this.y=scalar,this.z=scalar,this.w=scalar,this}setX(x){return this.x=x,this}setY(y){return this.y=y,this}setZ(z){return this.z=z,this}setW(w){return this.w=w,this}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;case 3:this.w=value;break;default:throw new Error("index is out of range: "+index)}return this}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+index)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(v){return this.x=v.x,this.y=v.y,this.z=v.z,this.w=void 0!==v.w?v.w:1,this}add(v){return this.x+=v.x,this.y+=v.y,this.z+=v.z,this.w+=v.w,this}addScalar(s){return this.x+=s,this.y+=s,this.z+=s,this.w+=s,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this}addScaledVector(v,s){return this.x+=v.x*s,this.y+=v.y*s,this.z+=v.z*s,this.w+=v.w*s,this}sub(v){return this.x-=v.x,this.y-=v.y,this.z-=v.z,this.w-=v.w,this}subScalar(s){return this.x-=s,this.y-=s,this.z-=s,this.w-=s,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this}multiply(v){return this.x*=v.x,this.y*=v.y,this.z*=v.z,this.w*=v.w,this}multiplyScalar(scalar){return this.x*=scalar,this.y*=scalar,this.z*=scalar,this.w*=scalar,this}applyMatrix4(m){const x=this.x,y=this.y,z=this.z,w=this.w,e=m.elements;return this.x=e[0]*x+e[4]*y+e[8]*z+e[12]*w,this.y=e[1]*x+e[5]*y+e[9]*z+e[13]*w,this.z=e[2]*x+e[6]*y+e[10]*z+e[14]*w,this.w=e[3]*x+e[7]*y+e[11]*z+e[15]*w,this}divideScalar(scalar){return this.multiplyScalar(1/scalar)}setAxisAngleFromQuaternion(q){this.w=2*Math.acos(q.w);const s=Math.sqrt(1-q.w*q.w);return s<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=q.x/s,this.y=q.y/s,this.z=q.z/s),this}setAxisAngleFromRotationMatrix(m){let angle,x,y,z;const te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10];if(Math.abs(m12-m21)<.01&&Math.abs(m13-m31)<.01&&Math.abs(m23-m32)<.01){if(Math.abs(m12+m21)<.1&&Math.abs(m13+m31)<.1&&Math.abs(m23+m32)<.1&&Math.abs(m11+m22+m33-3)<.1)return this.set(1,0,0,0),this;angle=Math.PI;const xx=(m11+1)/2,yy=(m22+1)/2,zz=(m33+1)/2,xy=(m12+m21)/4,xz=(m13+m31)/4,yz=(m23+m32)/4;return xx>yy&&xx>zz?xx<.01?(x=0,y=.707106781,z=.707106781):(x=Math.sqrt(xx),y=xy/x,z=xz/x):yy>zz?yy<.01?(x=.707106781,y=0,z=.707106781):(y=Math.sqrt(yy),x=xy/y,z=yz/y):zz<.01?(x=.707106781,y=.707106781,z=0):(z=Math.sqrt(zz),x=xz/z,y=yz/z),this.set(x,y,z,angle),this}let s=Math.sqrt((m32-m23)*(m32-m23)+(m13-m31)*(m13-m31)+(m21-m12)*(m21-m12));return Math.abs(s)<.001&&(s=1),this.x=(m32-m23)/s,this.y=(m13-m31)/s,this.z=(m21-m12)/s,this.w=Math.acos((m11+m22+m33-1)/2),this}min(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this.z=Math.min(this.z,v.z),this.w=Math.min(this.w,v.w),this}max(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this.z=Math.max(this.z,v.z),this.w=Math.max(this.w,v.w),this}clamp(min,max){return this.x=Math.max(min.x,Math.min(max.x,this.x)),this.y=Math.max(min.y,Math.min(max.y,this.y)),this.z=Math.max(min.z,Math.min(max.z,this.z)),this.w=Math.max(min.w,Math.min(max.w,this.w)),this}clampScalar(minVal,maxVal){return this.x=Math.max(minVal,Math.min(maxVal,this.x)),this.y=Math.max(minVal,Math.min(maxVal,this.y)),this.z=Math.max(minVal,Math.min(maxVal,this.z)),this.w=Math.max(minVal,Math.min(maxVal,this.w)),this}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(v){return this.x*v.x+this.y*v.y+this.z*v.z+this.w*v.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(length){return this.normalize().multiplyScalar(length)}lerp(v,alpha){return this.x+=(v.x-this.x)*alpha,this.y+=(v.y-this.y)*alpha,this.z+=(v.z-this.z)*alpha,this.w+=(v.w-this.w)*alpha,this}lerpVectors(v1,v2,alpha){return this.x=v1.x+(v2.x-v1.x)*alpha,this.y=v1.y+(v2.y-v1.y)*alpha,this.z=v1.z+(v2.z-v1.z)*alpha,this.w=v1.w+(v2.w-v1.w)*alpha,this}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z&&v.w===this.w}fromArray(array,offset=0){return this.x=array[offset],this.y=array[offset+1],this.z=array[offset+2],this.w=array[offset+3],this}toArray(array=[],offset=0){return array[offset]=this.x,array[offset+1]=this.y,array[offset+2]=this.z,array[offset+3]=this.w,array}fromBufferAttribute(attribute,index){return this.x=attribute.getX(index),this.y=attribute.getY(index),this.z=attribute.getZ(index),this.w=attribute.getW(index),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class WebGLRenderTarget extends EventDispatcher{constructor(width=1,height=1,options={}){super(),this.isWebGLRenderTarget=!0,this.width=width,this.height=height,this.depth=1,this.scissor=new Vector4(0,0,width,height),this.scissorTest=!1,this.viewport=new Vector4(0,0,width,height);const image={width:width,height:height,depth:1};void 0!==options.encoding&&(warnOnce("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),options.colorSpace=options.encoding===sRGBEncoding?SRGBColorSpace:NoColorSpace),this.texture=new Texture(image,options.mapping,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==options.generateMipmaps&&options.generateMipmaps,this.texture.internalFormat=void 0!==options.internalFormat?options.internalFormat:null,this.texture.minFilter=void 0!==options.minFilter?options.minFilter:LinearFilter,this.depthBuffer=void 0===options.depthBuffer||options.depthBuffer,this.stencilBuffer=void 0!==options.stencilBuffer&&options.stencilBuffer,this.depthTexture=void 0!==options.depthTexture?options.depthTexture:null,this.samples=void 0!==options.samples?options.samples:0}setSize(width,height,depth=1){this.width===width&&this.height===height&&this.depth===depth||(this.width=width,this.height=height,this.depth=depth,this.texture.image.width=width,this.texture.image.height=height,this.texture.image.depth=depth,this.dispose()),this.viewport.set(0,0,width,height),this.scissor.set(0,0,width,height)}clone(){return(new this.constructor).copy(this)}copy(source){this.width=source.width,this.height=source.height,this.depth=source.depth,this.scissor.copy(source.scissor),this.scissorTest=source.scissorTest,this.viewport.copy(source.viewport),this.texture=source.texture.clone(),this.texture.isRenderTargetTexture=!0;const image=Object.assign({},source.texture.image);return this.texture.source=new Source(image),this.depthBuffer=source.depthBuffer,this.stencilBuffer=source.stencilBuffer,null!==source.depthTexture&&(this.depthTexture=source.depthTexture.clone()),this.samples=source.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class DataArrayTexture extends Texture{constructor(data=null,width=1,height=1,depth=1){super(null),this.isDataArrayTexture=!0,this.image={data:data,width:width,height:height,depth:depth},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGLArrayRenderTarget extends WebGLRenderTarget{constructor(width=1,height=1,depth=1){super(width,height),this.isWebGLArrayRenderTarget=!0,this.depth=depth,this.texture=new DataArrayTexture(null,width,height,depth),this.texture.isRenderTargetTexture=!0}}class Data3DTexture extends Texture{constructor(data=null,width=1,height=1,depth=1){super(null),this.isData3DTexture=!0,this.image={data:data,width:width,height:height,depth:depth},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGL3DRenderTarget extends WebGLRenderTarget{constructor(width=1,height=1,depth=1){super(width,height),this.isWebGL3DRenderTarget=!0,this.depth=depth,this.texture=new Data3DTexture(null,width,height,depth),this.texture.isRenderTargetTexture=!0}}class WebGLMultipleRenderTargets extends WebGLRenderTarget{constructor(width=1,height=1,count=1,options={}){super(width,height,options),this.isWebGLMultipleRenderTargets=!0;const texture=this.texture;this.texture=[];for(let i=0;i=0?1:-1,sqrSin=1-cos*cos;if(sqrSin>Number.EPSILON){const sin=Math.sqrt(sqrSin),len=Math.atan2(sin,cos*dir);s=Math.sin(s*len)/sin,t=Math.sin(t*len)/sin}const tDir=t*dir;if(x0=x0*s+x1*tDir,y0=y0*s+y1*tDir,z0=z0*s+z1*tDir,w0=w0*s+w1*tDir,s===1-t){const f=1/Math.sqrt(x0*x0+y0*y0+z0*z0+w0*w0);x0*=f,y0*=f,z0*=f,w0*=f}}dst[dstOffset]=x0,dst[dstOffset+1]=y0,dst[dstOffset+2]=z0,dst[dstOffset+3]=w0}static multiplyQuaternionsFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1){const x0=src0[srcOffset0],y0=src0[srcOffset0+1],z0=src0[srcOffset0+2],w0=src0[srcOffset0+3],x1=src1[srcOffset1],y1=src1[srcOffset1+1],z1=src1[srcOffset1+2],w1=src1[srcOffset1+3];return dst[dstOffset]=x0*w1+w0*x1+y0*z1-z0*y1,dst[dstOffset+1]=y0*w1+w0*y1+z0*x1-x0*z1,dst[dstOffset+2]=z0*w1+w0*z1+x0*y1-y0*x1,dst[dstOffset+3]=w0*w1-x0*x1-y0*y1-z0*z1,dst}get x(){return this._x}set x(value){this._x=value,this._onChangeCallback()}get y(){return this._y}set y(value){this._y=value,this._onChangeCallback()}get z(){return this._z}set z(value){this._z=value,this._onChangeCallback()}get w(){return this._w}set w(value){this._w=value,this._onChangeCallback()}set(x,y,z,w){return this._x=x,this._y=y,this._z=z,this._w=w,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(quaternion){return this._x=quaternion.x,this._y=quaternion.y,this._z=quaternion.z,this._w=quaternion.w,this._onChangeCallback(),this}setFromEuler(euler,update){const x=euler._x,y=euler._y,z=euler._z,order=euler._order,cos=Math.cos,sin=Math.sin,c1=cos(x/2),c2=cos(y/2),c3=cos(z/2),s1=sin(x/2),s2=sin(y/2),s3=sin(z/2);switch(order){case"XYZ":this._x=s1*c2*c3+c1*s2*s3,this._y=c1*s2*c3-s1*c2*s3,this._z=c1*c2*s3+s1*s2*c3,this._w=c1*c2*c3-s1*s2*s3;break;case"YXZ":this._x=s1*c2*c3+c1*s2*s3,this._y=c1*s2*c3-s1*c2*s3,this._z=c1*c2*s3-s1*s2*c3,this._w=c1*c2*c3+s1*s2*s3;break;case"ZXY":this._x=s1*c2*c3-c1*s2*s3,this._y=c1*s2*c3+s1*c2*s3,this._z=c1*c2*s3+s1*s2*c3,this._w=c1*c2*c3-s1*s2*s3;break;case"ZYX":this._x=s1*c2*c3-c1*s2*s3,this._y=c1*s2*c3+s1*c2*s3,this._z=c1*c2*s3-s1*s2*c3,this._w=c1*c2*c3+s1*s2*s3;break;case"YZX":this._x=s1*c2*c3+c1*s2*s3,this._y=c1*s2*c3+s1*c2*s3,this._z=c1*c2*s3-s1*s2*c3,this._w=c1*c2*c3-s1*s2*s3;break;case"XZY":this._x=s1*c2*c3-c1*s2*s3,this._y=c1*s2*c3-s1*c2*s3,this._z=c1*c2*s3+s1*s2*c3,this._w=c1*c2*c3+s1*s2*s3;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+order)}return!1!==update&&this._onChangeCallback(),this}setFromAxisAngle(axis,angle){const halfAngle=angle/2,s=Math.sin(halfAngle);return this._x=axis.x*s,this._y=axis.y*s,this._z=axis.z*s,this._w=Math.cos(halfAngle),this._onChangeCallback(),this}setFromRotationMatrix(m){const te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10],trace=m11+m22+m33;if(trace>0){const s=.5/Math.sqrt(trace+1);this._w=.25/s,this._x=(m32-m23)*s,this._y=(m13-m31)*s,this._z=(m21-m12)*s}else if(m11>m22&&m11>m33){const s=2*Math.sqrt(1+m11-m22-m33);this._w=(m32-m23)/s,this._x=.25*s,this._y=(m12+m21)/s,this._z=(m13+m31)/s}else if(m22>m33){const s=2*Math.sqrt(1+m22-m11-m33);this._w=(m13-m31)/s,this._x=(m12+m21)/s,this._y=.25*s,this._z=(m23+m32)/s}else{const s=2*Math.sqrt(1+m33-m11-m22);this._w=(m21-m12)/s,this._x=(m13+m31)/s,this._y=(m23+m32)/s,this._z=.25*s}return this._onChangeCallback(),this}setFromUnitVectors(vFrom,vTo){let r=vFrom.dot(vTo)+1;return rMath.abs(vFrom.z)?(this._x=-vFrom.y,this._y=vFrom.x,this._z=0,this._w=r):(this._x=0,this._y=-vFrom.z,this._z=vFrom.y,this._w=r)):(this._x=vFrom.y*vTo.z-vFrom.z*vTo.y,this._y=vFrom.z*vTo.x-vFrom.x*vTo.z,this._z=vFrom.x*vTo.y-vFrom.y*vTo.x,this._w=r),this.normalize()}angleTo(q){return 2*Math.acos(Math.abs(clamp(this.dot(q),-1,1)))}rotateTowards(q,step){const angle=this.angleTo(q);if(0===angle)return this;const t=Math.min(1,step/angle);return this.slerp(q,t),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(v){return this._x*v._x+this._y*v._y+this._z*v._z+this._w*v._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 l=this.length();return 0===l?(this._x=0,this._y=0,this._z=0,this._w=1):(l=1/l,this._x=this._x*l,this._y=this._y*l,this._z=this._z*l,this._w=this._w*l),this._onChangeCallback(),this}multiply(q){return this.multiplyQuaternions(this,q)}premultiply(q){return this.multiplyQuaternions(q,this)}multiplyQuaternions(a,b){const qax=a._x,qay=a._y,qaz=a._z,qaw=a._w,qbx=b._x,qby=b._y,qbz=b._z,qbw=b._w;return this._x=qax*qbw+qaw*qbx+qay*qbz-qaz*qby,this._y=qay*qbw+qaw*qby+qaz*qbx-qax*qbz,this._z=qaz*qbw+qaw*qbz+qax*qby-qay*qbx,this._w=qaw*qbw-qax*qbx-qay*qby-qaz*qbz,this._onChangeCallback(),this}slerp(qb,t){if(0===t)return this;if(1===t)return this.copy(qb);const x=this._x,y=this._y,z=this._z,w=this._w;let cosHalfTheta=w*qb._w+x*qb._x+y*qb._y+z*qb._z;if(cosHalfTheta<0?(this._w=-qb._w,this._x=-qb._x,this._y=-qb._y,this._z=-qb._z,cosHalfTheta=-cosHalfTheta):this.copy(qb),cosHalfTheta>=1)return this._w=w,this._x=x,this._y=y,this._z=z,this;const sqrSinHalfTheta=1-cosHalfTheta*cosHalfTheta;if(sqrSinHalfTheta<=Number.EPSILON){const s=1-t;return this._w=s*w+t*this._w,this._x=s*x+t*this._x,this._y=s*y+t*this._y,this._z=s*z+t*this._z,this.normalize(),this._onChangeCallback(),this}const sinHalfTheta=Math.sqrt(sqrSinHalfTheta),halfTheta=Math.atan2(sinHalfTheta,cosHalfTheta),ratioA=Math.sin((1-t)*halfTheta)/sinHalfTheta,ratioB=Math.sin(t*halfTheta)/sinHalfTheta;return this._w=w*ratioA+this._w*ratioB,this._x=x*ratioA+this._x*ratioB,this._y=y*ratioA+this._y*ratioB,this._z=z*ratioA+this._z*ratioB,this._onChangeCallback(),this}slerpQuaternions(qa,qb,t){return this.copy(qa).slerp(qb,t)}random(){const u1=Math.random(),sqrt1u1=Math.sqrt(1-u1),sqrtu1=Math.sqrt(u1),u2=2*Math.PI*Math.random(),u3=2*Math.PI*Math.random();return this.set(sqrt1u1*Math.cos(u2),sqrtu1*Math.sin(u3),sqrtu1*Math.cos(u3),sqrt1u1*Math.sin(u2))}equals(quaternion){return quaternion._x===this._x&&quaternion._y===this._y&&quaternion._z===this._z&&quaternion._w===this._w}fromArray(array,offset=0){return this._x=array[offset],this._y=array[offset+1],this._z=array[offset+2],this._w=array[offset+3],this._onChangeCallback(),this}toArray(array=[],offset=0){return array[offset]=this._x,array[offset+1]=this._y,array[offset+2]=this._z,array[offset+3]=this._w,array}fromBufferAttribute(attribute,index){return this._x=attribute.getX(index),this._y=attribute.getY(index),this._z=attribute.getZ(index),this._w=attribute.getW(index),this}toJSON(){return this.toArray()}_onChange(callback){return this._onChangeCallback=callback,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(x=0,y=0,z=0){Vector3.prototype.isVector3=!0,this.x=x,this.y=y,this.z=z}set(x,y,z){return void 0===z&&(z=this.z),this.x=x,this.y=y,this.z=z,this}setScalar(scalar){return this.x=scalar,this.y=scalar,this.z=scalar,this}setX(x){return this.x=x,this}setY(y){return this.y=y,this}setZ(z){return this.z=z,this}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;default:throw new Error("index is out of range: "+index)}return this}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+index)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(v){return this.x=v.x,this.y=v.y,this.z=v.z,this}add(v){return this.x+=v.x,this.y+=v.y,this.z+=v.z,this}addScalar(s){return this.x+=s,this.y+=s,this.z+=s,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this}addScaledVector(v,s){return this.x+=v.x*s,this.y+=v.y*s,this.z+=v.z*s,this}sub(v){return this.x-=v.x,this.y-=v.y,this.z-=v.z,this}subScalar(s){return this.x-=s,this.y-=s,this.z-=s,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this}multiply(v){return this.x*=v.x,this.y*=v.y,this.z*=v.z,this}multiplyScalar(scalar){return this.x*=scalar,this.y*=scalar,this.z*=scalar,this}multiplyVectors(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this}applyEuler(euler){return this.applyQuaternion(_quaternion$4.setFromEuler(euler))}applyAxisAngle(axis,angle){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis,angle))}applyMatrix3(m){const x=this.x,y=this.y,z=this.z,e=m.elements;return this.x=e[0]*x+e[3]*y+e[6]*z,this.y=e[1]*x+e[4]*y+e[7]*z,this.z=e[2]*x+e[5]*y+e[8]*z,this}applyNormalMatrix(m){return this.applyMatrix3(m).normalize()}applyMatrix4(m){const x=this.x,y=this.y,z=this.z,e=m.elements,w=1/(e[3]*x+e[7]*y+e[11]*z+e[15]);return this.x=(e[0]*x+e[4]*y+e[8]*z+e[12])*w,this.y=(e[1]*x+e[5]*y+e[9]*z+e[13])*w,this.z=(e[2]*x+e[6]*y+e[10]*z+e[14])*w,this}applyQuaternion(q){const x=this.x,y=this.y,z=this.z,qx=q.x,qy=q.y,qz=q.z,qw=q.w,ix=qw*x+qy*z-qz*y,iy=qw*y+qz*x-qx*z,iz=qw*z+qx*y-qy*x,iw=-qx*x-qy*y-qz*z;return this.x=ix*qw+iw*-qx+iy*-qz-iz*-qy,this.y=iy*qw+iw*-qy+iz*-qx-ix*-qz,this.z=iz*qw+iw*-qz+ix*-qy-iy*-qx,this}project(camera){return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix)}unproject(camera){return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld)}transformDirection(m){const x=this.x,y=this.y,z=this.z,e=m.elements;return this.x=e[0]*x+e[4]*y+e[8]*z,this.y=e[1]*x+e[5]*y+e[9]*z,this.z=e[2]*x+e[6]*y+e[10]*z,this.normalize()}divide(v){return this.x/=v.x,this.y/=v.y,this.z/=v.z,this}divideScalar(scalar){return this.multiplyScalar(1/scalar)}min(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this.z=Math.min(this.z,v.z),this}max(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this.z=Math.max(this.z,v.z),this}clamp(min,max){return this.x=Math.max(min.x,Math.min(max.x,this.x)),this.y=Math.max(min.y,Math.min(max.y,this.y)),this.z=Math.max(min.z,Math.min(max.z,this.z)),this}clampScalar(minVal,maxVal){return this.x=Math.max(minVal,Math.min(maxVal,this.x)),this.y=Math.max(minVal,Math.min(maxVal,this.y)),this.z=Math.max(minVal,Math.min(maxVal,this.z)),this}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(v){return this.x*v.x+this.y*v.y+this.z*v.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(length){return this.normalize().multiplyScalar(length)}lerp(v,alpha){return this.x+=(v.x-this.x)*alpha,this.y+=(v.y-this.y)*alpha,this.z+=(v.z-this.z)*alpha,this}lerpVectors(v1,v2,alpha){return this.x=v1.x+(v2.x-v1.x)*alpha,this.y=v1.y+(v2.y-v1.y)*alpha,this.z=v1.z+(v2.z-v1.z)*alpha,this}cross(v){return this.crossVectors(this,v)}crossVectors(a,b){const ax=a.x,ay=a.y,az=a.z,bx=b.x,by=b.y,bz=b.z;return this.x=ay*bz-az*by,this.y=az*bx-ax*bz,this.z=ax*by-ay*bx,this}projectOnVector(v){const denominator=v.lengthSq();if(0===denominator)return this.set(0,0,0);const scalar=v.dot(this)/denominator;return this.copy(v).multiplyScalar(scalar)}projectOnPlane(planeNormal){return _vector$b.copy(this).projectOnVector(planeNormal),this.sub(_vector$b)}reflect(normal){return this.sub(_vector$b.copy(normal).multiplyScalar(2*this.dot(normal)))}angleTo(v){const denominator=Math.sqrt(this.lengthSq()*v.lengthSq());if(0===denominator)return Math.PI/2;const theta=this.dot(v)/denominator;return Math.acos(clamp(theta,-1,1))}distanceTo(v){return Math.sqrt(this.distanceToSquared(v))}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y,dz=this.z-v.z;return dx*dx+dy*dy+dz*dz}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)+Math.abs(this.z-v.z)}setFromSpherical(s){return this.setFromSphericalCoords(s.radius,s.phi,s.theta)}setFromSphericalCoords(radius,phi,theta){const sinPhiRadius=Math.sin(phi)*radius;return this.x=sinPhiRadius*Math.sin(theta),this.y=Math.cos(phi)*radius,this.z=sinPhiRadius*Math.cos(theta),this}setFromCylindrical(c){return this.setFromCylindricalCoords(c.radius,c.theta,c.y)}setFromCylindricalCoords(radius,theta,y){return this.x=radius*Math.sin(theta),this.y=y,this.z=radius*Math.cos(theta),this}setFromMatrixPosition(m){const e=m.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(m){const sx=this.setFromMatrixColumn(m,0).length(),sy=this.setFromMatrixColumn(m,1).length(),sz=this.setFromMatrixColumn(m,2).length();return this.x=sx,this.y=sy,this.z=sz,this}setFromMatrixColumn(m,index){return this.fromArray(m.elements,4*index)}setFromMatrix3Column(m,index){return this.fromArray(m.elements,3*index)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(c){return this.x=c.r,this.y=c.g,this.z=c.b,this}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z}fromArray(array,offset=0){return this.x=array[offset],this.y=array[offset+1],this.z=array[offset+2],this}toArray(array=[],offset=0){return array[offset]=this.x,array[offset+1]=this.y,array[offset+2]=this.z,array}fromBufferAttribute(attribute,index){return this.x=attribute.getX(index),this.y=attribute.getY(index),this.z=attribute.getZ(index),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const u=2*(Math.random()-.5),t=Math.random()*Math.PI*2,f=Math.sqrt(1-u**2);return this.x=f*Math.cos(t),this.y=f*Math.sin(t),this.z=u,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _vector$b=new Vector3,_quaternion$4=new Quaternion;class Box3{constructor(min=new Vector3(1/0,1/0,1/0),max=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=min,this.max=max}set(min,max){return this.min.copy(min),this.max.copy(max),this}setFromArray(array){this.makeEmpty();for(let i=0,il=array.length;ithis.max.x||point.ythis.max.y||point.zthis.max.z)}containsBox(box){return this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y&&this.min.z<=box.min.z&&box.max.z<=this.max.z}getParameter(point,target){return target.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y),(point.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(box){return!(box.max.xthis.max.x||box.max.ythis.max.y||box.max.zthis.max.z)}intersectsSphere(sphere){return this.clampPoint(sphere.center,_vector$a),_vector$a.distanceToSquared(sphere.center)<=sphere.radius*sphere.radius}intersectsPlane(plane){let min,max;return plane.normal.x>0?(min=plane.normal.x*this.min.x,max=plane.normal.x*this.max.x):(min=plane.normal.x*this.max.x,max=plane.normal.x*this.min.x),plane.normal.y>0?(min+=plane.normal.y*this.min.y,max+=plane.normal.y*this.max.y):(min+=plane.normal.y*this.max.y,max+=plane.normal.y*this.min.y),plane.normal.z>0?(min+=plane.normal.z*this.min.z,max+=plane.normal.z*this.max.z):(min+=plane.normal.z*this.max.z,max+=plane.normal.z*this.min.z),min<=-plane.constant&&max>=-plane.constant}intersectsTriangle(triangle){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(triangle.a,_center),_v1$7.subVectors(triangle.b,_center),_v2$4.subVectors(triangle.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$4,_v1$7),_f2.subVectors(_v0$2,_v2$4);let axes=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!!satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)&&(axes=[1,0,0,0,1,0,0,0,1],!!satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)&&(_triangleNormal.crossVectors(_f0,_f1),axes=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)))}clampPoint(point,target){return target.copy(point).clamp(this.min,this.max)}distanceToPoint(point){return this.clampPoint(point,_vector$a).distanceTo(point)}getBoundingSphere(target){return this.isEmpty()?target.makeEmpty():(this.getCenter(target.center),target.radius=.5*this.getSize(_vector$a).length()),target}intersect(box){return this.min.max(box.min),this.max.min(box.max),this.isEmpty()&&this.makeEmpty(),this}union(box){return this.min.min(box.min),this.max.max(box.max),this}applyMatrix4(matrix){return this.isEmpty()||(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(matrix),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(matrix),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(matrix),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(matrix),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(matrix),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(matrix),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(matrix),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(matrix),this.setFromPoints(_points)),this}translate(offset){return this.min.add(offset),this.max.add(offset),this}equals(box){return box.min.equals(this.min)&&box.max.equals(this.max)}}const _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$a=new Vector3,_box$3=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$4=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(axes,v0,v1,v2,extents){for(let i=0,j=axes.length-3;i<=j;i+=3){_testAxis.fromArray(axes,i);const r=extents.x*Math.abs(_testAxis.x)+extents.y*Math.abs(_testAxis.y)+extents.z*Math.abs(_testAxis.z),p0=v0.dot(_testAxis),p1=v1.dot(_testAxis),p2=v2.dot(_testAxis);if(Math.max(-Math.max(p0,p1,p2),Math.min(p0,p1,p2))>r)return!1}return!0}const _box$2=new Box3,_v1$6=new Vector3,_v2$3=new Vector3;class Sphere{constructor(center=new Vector3,radius=-1){this.center=center,this.radius=radius}set(center,radius){return this.center.copy(center),this.radius=radius,this}setFromPoints(points,optionalCenter){const center=this.center;void 0!==optionalCenter?center.copy(optionalCenter):_box$2.setFromPoints(points).getCenter(center);let maxRadiusSq=0;for(let i=0,il=points.length;ithis.radius*this.radius&&(target.sub(this.center).normalize(),target.multiplyScalar(this.radius).add(this.center)),target}getBoundingBox(target){return this.isEmpty()?(target.makeEmpty(),target):(target.set(this.center,this.center),target.expandByScalar(this.radius),target)}applyMatrix4(matrix){return this.center.applyMatrix4(matrix),this.radius=this.radius*matrix.getMaxScaleOnAxis(),this}translate(offset){return this.center.add(offset),this}expandByPoint(point){if(this.isEmpty())return this.center.copy(point),this.radius=0,this;_v1$6.subVectors(point,this.center);const lengthSq=_v1$6.lengthSq();if(lengthSq>this.radius*this.radius){const length=Math.sqrt(lengthSq),delta=.5*(length-this.radius);this.center.addScaledVector(_v1$6,delta/length),this.radius+=delta}return this}union(sphere){return sphere.isEmpty()?this:this.isEmpty()?(this.copy(sphere),this):(!0===this.center.equals(sphere.center)?this.radius=Math.max(this.radius,sphere.radius):(_v2$3.subVectors(sphere.center,this.center).setLength(sphere.radius),this.expandByPoint(_v1$6.copy(sphere.center).add(_v2$3)),this.expandByPoint(_v1$6.copy(sphere.center).sub(_v2$3))),this)}equals(sphere){return sphere.center.equals(this.center)&&sphere.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const _vector$9=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3;class Ray{constructor(origin=new Vector3,direction=new Vector3(0,0,-1)){this.origin=origin,this.direction=direction}set(origin,direction){return this.origin.copy(origin),this.direction.copy(direction),this}copy(ray){return this.origin.copy(ray.origin),this.direction.copy(ray.direction),this}at(t,target){return target.copy(this.origin).addScaledVector(this.direction,t)}lookAt(v){return this.direction.copy(v).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,_vector$9)),this}closestPointToPoint(point,target){target.subVectors(point,this.origin);const directionDistance=target.dot(this.direction);return directionDistance<0?target.copy(this.origin):target.copy(this.origin).addScaledVector(this.direction,directionDistance)}distanceToPoint(point){return Math.sqrt(this.distanceSqToPoint(point))}distanceSqToPoint(point){const directionDistance=_vector$9.subVectors(point,this.origin).dot(this.direction);return directionDistance<0?this.origin.distanceToSquared(point):(_vector$9.copy(this.origin).addScaledVector(this.direction,directionDistance),_vector$9.distanceToSquared(point))}distanceSqToSegment(v0,v1,optionalPointOnRay,optionalPointOnSegment){_segCenter.copy(v0).add(v1).multiplyScalar(.5),_segDir.copy(v1).sub(v0).normalize(),_diff.copy(this.origin).sub(_segCenter);const segExtent=.5*v0.distanceTo(v1),a01=-this.direction.dot(_segDir),b0=_diff.dot(this.direction),b1=-_diff.dot(_segDir),c=_diff.lengthSq(),det=Math.abs(1-a01*a01);let s0,s1,sqrDist,extDet;if(det>0)if(s0=a01*b1-b0,s1=a01*b0-b1,extDet=segExtent*det,s0>=0)if(s1>=-extDet)if(s1<=extDet){const invDet=1/det;s0*=invDet,s1*=invDet,sqrDist=s0*(s0+a01*s1+2*b0)+s1*(a01*s0+s1+2*b1)+c}else s1=segExtent,s0=Math.max(0,-(a01*s1+b0)),sqrDist=-s0*s0+s1*(s1+2*b1)+c;else s1=-segExtent,s0=Math.max(0,-(a01*s1+b0)),sqrDist=-s0*s0+s1*(s1+2*b1)+c;else s1<=-extDet?(s0=Math.max(0,-(-a01*segExtent+b0)),s1=s0>0?-segExtent:Math.min(Math.max(-segExtent,-b1),segExtent),sqrDist=-s0*s0+s1*(s1+2*b1)+c):s1<=extDet?(s0=0,s1=Math.min(Math.max(-segExtent,-b1),segExtent),sqrDist=s1*(s1+2*b1)+c):(s0=Math.max(0,-(a01*segExtent+b0)),s1=s0>0?segExtent:Math.min(Math.max(-segExtent,-b1),segExtent),sqrDist=-s0*s0+s1*(s1+2*b1)+c);else s1=a01>0?-segExtent:segExtent,s0=Math.max(0,-(a01*s1+b0)),sqrDist=-s0*s0+s1*(s1+2*b1)+c;return optionalPointOnRay&&optionalPointOnRay.copy(this.origin).addScaledVector(this.direction,s0),optionalPointOnSegment&&optionalPointOnSegment.copy(_segCenter).addScaledVector(_segDir,s1),sqrDist}intersectSphere(sphere,target){_vector$9.subVectors(sphere.center,this.origin);const tca=_vector$9.dot(this.direction),d2=_vector$9.dot(_vector$9)-tca*tca,radius2=sphere.radius*sphere.radius;if(d2>radius2)return null;const thc=Math.sqrt(radius2-d2),t0=tca-thc,t1=tca+thc;return t1<0?null:t0<0?this.at(t1,target):this.at(t0,target)}intersectsSphere(sphere){return this.distanceSqToPoint(sphere.center)<=sphere.radius*sphere.radius}distanceToPlane(plane){const denominator=plane.normal.dot(this.direction);if(0===denominator)return 0===plane.distanceToPoint(this.origin)?0:null;const t=-(this.origin.dot(plane.normal)+plane.constant)/denominator;return t>=0?t:null}intersectPlane(plane,target){const t=this.distanceToPlane(plane);return null===t?null:this.at(t,target)}intersectsPlane(plane){const distToPoint=plane.distanceToPoint(this.origin);if(0===distToPoint)return!0;return plane.normal.dot(this.direction)*distToPoint<0}intersectBox(box,target){let tmin,tmax,tymin,tymax,tzmin,tzmax;const invdirx=1/this.direction.x,invdiry=1/this.direction.y,invdirz=1/this.direction.z,origin=this.origin;return invdirx>=0?(tmin=(box.min.x-origin.x)*invdirx,tmax=(box.max.x-origin.x)*invdirx):(tmin=(box.max.x-origin.x)*invdirx,tmax=(box.min.x-origin.x)*invdirx),invdiry>=0?(tymin=(box.min.y-origin.y)*invdiry,tymax=(box.max.y-origin.y)*invdiry):(tymin=(box.max.y-origin.y)*invdiry,tymax=(box.min.y-origin.y)*invdiry),tmin>tymax||tymin>tmax?null:((tymin>tmin||isNaN(tmin))&&(tmin=tymin),(tymax=0?(tzmin=(box.min.z-origin.z)*invdirz,tzmax=(box.max.z-origin.z)*invdirz):(tzmin=(box.max.z-origin.z)*invdirz,tzmax=(box.min.z-origin.z)*invdirz),tmin>tzmax||tzmin>tmax?null:((tzmin>tmin||tmin!=tmin)&&(tmin=tzmin),(tzmax=0?tmin:tmax,target)))}intersectsBox(box){return null!==this.intersectBox(box,_vector$9)}intersectTriangle(a,b,c,backfaceCulling,target){_edge1.subVectors(b,a),_edge2.subVectors(c,a),_normal$1.crossVectors(_edge1,_edge2);let sign,DdN=this.direction.dot(_normal$1);if(DdN>0){if(backfaceCulling)return null;sign=1}else{if(!(DdN<0))return null;sign=-1,DdN=-DdN}_diff.subVectors(this.origin,a);const DdQxE2=sign*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(DdQxE2<0)return null;const DdE1xQ=sign*this.direction.dot(_edge1.cross(_diff));if(DdE1xQ<0)return null;if(DdQxE2+DdE1xQ>DdN)return null;const QdN=-sign*_diff.dot(_normal$1);return QdN<0?null:this.at(QdN/DdN,target)}applyMatrix4(matrix4){return this.origin.applyMatrix4(matrix4),this.direction.transformDirection(matrix4),this}equals(ray){return ray.origin.equals(this.origin)&&ray.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==n11&&this.set(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44)}set(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44){const te=this.elements;return te[0]=n11,te[4]=n12,te[8]=n13,te[12]=n14,te[1]=n21,te[5]=n22,te[9]=n23,te[13]=n24,te[2]=n31,te[6]=n32,te[10]=n33,te[14]=n34,te[3]=n41,te[7]=n42,te[11]=n43,te[15]=n44,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 Matrix4).fromArray(this.elements)}copy(m){const te=this.elements,me=m.elements;return te[0]=me[0],te[1]=me[1],te[2]=me[2],te[3]=me[3],te[4]=me[4],te[5]=me[5],te[6]=me[6],te[7]=me[7],te[8]=me[8],te[9]=me[9],te[10]=me[10],te[11]=me[11],te[12]=me[12],te[13]=me[13],te[14]=me[14],te[15]=me[15],this}copyPosition(m){const te=this.elements,me=m.elements;return te[12]=me[12],te[13]=me[13],te[14]=me[14],this}setFromMatrix3(m){const me=m.elements;return this.set(me[0],me[3],me[6],0,me[1],me[4],me[7],0,me[2],me[5],me[8],0,0,0,0,1),this}extractBasis(xAxis,yAxis,zAxis){return xAxis.setFromMatrixColumn(this,0),yAxis.setFromMatrixColumn(this,1),zAxis.setFromMatrixColumn(this,2),this}makeBasis(xAxis,yAxis,zAxis){return this.set(xAxis.x,yAxis.x,zAxis.x,0,xAxis.y,yAxis.y,zAxis.y,0,xAxis.z,yAxis.z,zAxis.z,0,0,0,0,1),this}extractRotation(m){const te=this.elements,me=m.elements,scaleX=1/_v1$5.setFromMatrixColumn(m,0).length(),scaleY=1/_v1$5.setFromMatrixColumn(m,1).length(),scaleZ=1/_v1$5.setFromMatrixColumn(m,2).length();return te[0]=me[0]*scaleX,te[1]=me[1]*scaleX,te[2]=me[2]*scaleX,te[3]=0,te[4]=me[4]*scaleY,te[5]=me[5]*scaleY,te[6]=me[6]*scaleY,te[7]=0,te[8]=me[8]*scaleZ,te[9]=me[9]*scaleZ,te[10]=me[10]*scaleZ,te[11]=0,te[12]=0,te[13]=0,te[14]=0,te[15]=1,this}makeRotationFromEuler(euler){const te=this.elements,x=euler.x,y=euler.y,z=euler.z,a=Math.cos(x),b=Math.sin(x),c=Math.cos(y),d=Math.sin(y),e=Math.cos(z),f=Math.sin(z);if("XYZ"===euler.order){const ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e,te[4]=-c*f,te[8]=d,te[1]=af+be*d,te[5]=ae-bf*d,te[9]=-b*c,te[2]=bf-ae*d,te[6]=be+af*d,te[10]=a*c}else if("YXZ"===euler.order){const ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce+df*b,te[4]=de*b-cf,te[8]=a*d,te[1]=a*f,te[5]=a*e,te[9]=-b,te[2]=cf*b-de,te[6]=df+ce*b,te[10]=a*c}else if("ZXY"===euler.order){const ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce-df*b,te[4]=-a*f,te[8]=de+cf*b,te[1]=cf+de*b,te[5]=a*e,te[9]=df-ce*b,te[2]=-a*d,te[6]=b,te[10]=a*c}else if("ZYX"===euler.order){const ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e,te[4]=be*d-af,te[8]=ae*d+bf,te[1]=c*f,te[5]=bf*d+ae,te[9]=af*d-be,te[2]=-d,te[6]=b*c,te[10]=a*c}else if("YZX"===euler.order){const ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e,te[4]=bd-ac*f,te[8]=bc*f+ad,te[1]=f,te[5]=a*e,te[9]=-b*e,te[2]=-d*e,te[6]=ad*f+bc,te[10]=ac-bd*f}else if("XZY"===euler.order){const ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e,te[4]=-f,te[8]=d*e,te[1]=ac*f+bd,te[5]=a*e,te[9]=ad*f-bc,te[2]=bc*f-ad,te[6]=b*e,te[10]=bd*f+ac}return te[3]=0,te[7]=0,te[11]=0,te[12]=0,te[13]=0,te[14]=0,te[15]=1,this}makeRotationFromQuaternion(q){return this.compose(_zero,q,_one)}lookAt(eye,target,up){const te=this.elements;return _z.subVectors(eye,target),0===_z.lengthSq()&&(_z.z=1),_z.normalize(),_x.crossVectors(up,_z),0===_x.lengthSq()&&(1===Math.abs(up.z)?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(up,_z)),_x.normalize(),_y.crossVectors(_z,_x),te[0]=_x.x,te[4]=_y.x,te[8]=_z.x,te[1]=_x.y,te[5]=_y.y,te[9]=_z.y,te[2]=_x.z,te[6]=_y.z,te[10]=_z.z,this}multiply(m){return this.multiplyMatrices(this,m)}premultiply(m){return this.multiplyMatrices(m,this)}multiplyMatrices(a,b){const ae=a.elements,be=b.elements,te=this.elements,a11=ae[0],a12=ae[4],a13=ae[8],a14=ae[12],a21=ae[1],a22=ae[5],a23=ae[9],a24=ae[13],a31=ae[2],a32=ae[6],a33=ae[10],a34=ae[14],a41=ae[3],a42=ae[7],a43=ae[11],a44=ae[15],b11=be[0],b12=be[4],b13=be[8],b14=be[12],b21=be[1],b22=be[5],b23=be[9],b24=be[13],b31=be[2],b32=be[6],b33=be[10],b34=be[14],b41=be[3],b42=be[7],b43=be[11],b44=be[15];return te[0]=a11*b11+a12*b21+a13*b31+a14*b41,te[4]=a11*b12+a12*b22+a13*b32+a14*b42,te[8]=a11*b13+a12*b23+a13*b33+a14*b43,te[12]=a11*b14+a12*b24+a13*b34+a14*b44,te[1]=a21*b11+a22*b21+a23*b31+a24*b41,te[5]=a21*b12+a22*b22+a23*b32+a24*b42,te[9]=a21*b13+a22*b23+a23*b33+a24*b43,te[13]=a21*b14+a22*b24+a23*b34+a24*b44,te[2]=a31*b11+a32*b21+a33*b31+a34*b41,te[6]=a31*b12+a32*b22+a33*b32+a34*b42,te[10]=a31*b13+a32*b23+a33*b33+a34*b43,te[14]=a31*b14+a32*b24+a33*b34+a34*b44,te[3]=a41*b11+a42*b21+a43*b31+a44*b41,te[7]=a41*b12+a42*b22+a43*b32+a44*b42,te[11]=a41*b13+a42*b23+a43*b33+a44*b43,te[15]=a41*b14+a42*b24+a43*b34+a44*b44,this}multiplyScalar(s){const te=this.elements;return te[0]*=s,te[4]*=s,te[8]*=s,te[12]*=s,te[1]*=s,te[5]*=s,te[9]*=s,te[13]*=s,te[2]*=s,te[6]*=s,te[10]*=s,te[14]*=s,te[3]*=s,te[7]*=s,te[11]*=s,te[15]*=s,this}determinant(){const te=this.elements,n11=te[0],n12=te[4],n13=te[8],n14=te[12],n21=te[1],n22=te[5],n23=te[9],n24=te[13],n31=te[2],n32=te[6],n33=te[10],n34=te[14];return te[3]*(+n14*n23*n32-n13*n24*n32-n14*n22*n33+n12*n24*n33+n13*n22*n34-n12*n23*n34)+te[7]*(+n11*n23*n34-n11*n24*n33+n14*n21*n33-n13*n21*n34+n13*n24*n31-n14*n23*n31)+te[11]*(+n11*n24*n32-n11*n22*n34-n14*n21*n32+n12*n21*n34+n14*n22*n31-n12*n24*n31)+te[15]*(-n13*n22*n31-n11*n23*n32+n11*n22*n33+n13*n21*n32-n12*n21*n33+n12*n23*n31)}transpose(){const te=this.elements;let tmp;return tmp=te[1],te[1]=te[4],te[4]=tmp,tmp=te[2],te[2]=te[8],te[8]=tmp,tmp=te[6],te[6]=te[9],te[9]=tmp,tmp=te[3],te[3]=te[12],te[12]=tmp,tmp=te[7],te[7]=te[13],te[13]=tmp,tmp=te[11],te[11]=te[14],te[14]=tmp,this}setPosition(x,y,z){const te=this.elements;return x.isVector3?(te[12]=x.x,te[13]=x.y,te[14]=x.z):(te[12]=x,te[13]=y,te[14]=z),this}invert(){const te=this.elements,n11=te[0],n21=te[1],n31=te[2],n41=te[3],n12=te[4],n22=te[5],n32=te[6],n42=te[7],n13=te[8],n23=te[9],n33=te[10],n43=te[11],n14=te[12],n24=te[13],n34=te[14],n44=te[15],t11=n23*n34*n42-n24*n33*n42+n24*n32*n43-n22*n34*n43-n23*n32*n44+n22*n33*n44,t12=n14*n33*n42-n13*n34*n42-n14*n32*n43+n12*n34*n43+n13*n32*n44-n12*n33*n44,t13=n13*n24*n42-n14*n23*n42+n14*n22*n43-n12*n24*n43-n13*n22*n44+n12*n23*n44,t14=n14*n23*n32-n13*n24*n32-n14*n22*n33+n12*n24*n33+n13*n22*n34-n12*n23*n34,det=n11*t11+n21*t12+n31*t13+n41*t14;if(0===det)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const detInv=1/det;return te[0]=t11*detInv,te[1]=(n24*n33*n41-n23*n34*n41-n24*n31*n43+n21*n34*n43+n23*n31*n44-n21*n33*n44)*detInv,te[2]=(n22*n34*n41-n24*n32*n41+n24*n31*n42-n21*n34*n42-n22*n31*n44+n21*n32*n44)*detInv,te[3]=(n23*n32*n41-n22*n33*n41-n23*n31*n42+n21*n33*n42+n22*n31*n43-n21*n32*n43)*detInv,te[4]=t12*detInv,te[5]=(n13*n34*n41-n14*n33*n41+n14*n31*n43-n11*n34*n43-n13*n31*n44+n11*n33*n44)*detInv,te[6]=(n14*n32*n41-n12*n34*n41-n14*n31*n42+n11*n34*n42+n12*n31*n44-n11*n32*n44)*detInv,te[7]=(n12*n33*n41-n13*n32*n41+n13*n31*n42-n11*n33*n42-n12*n31*n43+n11*n32*n43)*detInv,te[8]=t13*detInv,te[9]=(n14*n23*n41-n13*n24*n41-n14*n21*n43+n11*n24*n43+n13*n21*n44-n11*n23*n44)*detInv,te[10]=(n12*n24*n41-n14*n22*n41+n14*n21*n42-n11*n24*n42-n12*n21*n44+n11*n22*n44)*detInv,te[11]=(n13*n22*n41-n12*n23*n41-n13*n21*n42+n11*n23*n42+n12*n21*n43-n11*n22*n43)*detInv,te[12]=t14*detInv,te[13]=(n13*n24*n31-n14*n23*n31+n14*n21*n33-n11*n24*n33-n13*n21*n34+n11*n23*n34)*detInv,te[14]=(n14*n22*n31-n12*n24*n31-n14*n21*n32+n11*n24*n32+n12*n21*n34-n11*n22*n34)*detInv,te[15]=(n12*n23*n31-n13*n22*n31+n13*n21*n32-n11*n23*n32-n12*n21*n33+n11*n22*n33)*detInv,this}scale(v){const te=this.elements,x=v.x,y=v.y,z=v.z;return te[0]*=x,te[4]*=y,te[8]*=z,te[1]*=x,te[5]*=y,te[9]*=z,te[2]*=x,te[6]*=y,te[10]*=z,te[3]*=x,te[7]*=y,te[11]*=z,this}getMaxScaleOnAxis(){const te=this.elements,scaleXSq=te[0]*te[0]+te[1]*te[1]+te[2]*te[2],scaleYSq=te[4]*te[4]+te[5]*te[5]+te[6]*te[6],scaleZSq=te[8]*te[8]+te[9]*te[9]+te[10]*te[10];return Math.sqrt(Math.max(scaleXSq,scaleYSq,scaleZSq))}makeTranslation(x,y,z){return x.isVector3?this.set(1,0,0,x.x,0,1,0,x.y,0,0,1,x.z,0,0,0,1):this.set(1,0,0,x,0,1,0,y,0,0,1,z,0,0,0,1),this}makeRotationX(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(1,0,0,0,0,c,-s,0,0,s,c,0,0,0,0,1),this}makeRotationY(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(c,0,s,0,0,1,0,0,-s,0,c,0,0,0,0,1),this}makeRotationZ(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(c,-s,0,0,s,c,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(axis,angle){const c=Math.cos(angle),s=Math.sin(angle),t=1-c,x=axis.x,y=axis.y,z=axis.z,tx=t*x,ty=t*y;return this.set(tx*x+c,tx*y-s*z,tx*z+s*y,0,tx*y+s*z,ty*y+c,ty*z-s*x,0,tx*z-s*y,ty*z+s*x,t*z*z+c,0,0,0,0,1),this}makeScale(x,y,z){return this.set(x,0,0,0,0,y,0,0,0,0,z,0,0,0,0,1),this}makeShear(xy,xz,yx,yz,zx,zy){return this.set(1,yx,zx,0,xy,1,zy,0,xz,yz,1,0,0,0,0,1),this}compose(position,quaternion,scale){const te=this.elements,x=quaternion._x,y=quaternion._y,z=quaternion._z,w=quaternion._w,x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2,sx=scale.x,sy=scale.y,sz=scale.z;return te[0]=(1-(yy+zz))*sx,te[1]=(xy+wz)*sx,te[2]=(xz-wy)*sx,te[3]=0,te[4]=(xy-wz)*sy,te[5]=(1-(xx+zz))*sy,te[6]=(yz+wx)*sy,te[7]=0,te[8]=(xz+wy)*sz,te[9]=(yz-wx)*sz,te[10]=(1-(xx+yy))*sz,te[11]=0,te[12]=position.x,te[13]=position.y,te[14]=position.z,te[15]=1,this}decompose(position,quaternion,scale){const te=this.elements;let sx=_v1$5.set(te[0],te[1],te[2]).length();const sy=_v1$5.set(te[4],te[5],te[6]).length(),sz=_v1$5.set(te[8],te[9],te[10]).length();this.determinant()<0&&(sx=-sx),position.x=te[12],position.y=te[13],position.z=te[14],_m1$2.copy(this);const invSX=1/sx,invSY=1/sy,invSZ=1/sz;return _m1$2.elements[0]*=invSX,_m1$2.elements[1]*=invSX,_m1$2.elements[2]*=invSX,_m1$2.elements[4]*=invSY,_m1$2.elements[5]*=invSY,_m1$2.elements[6]*=invSY,_m1$2.elements[8]*=invSZ,_m1$2.elements[9]*=invSZ,_m1$2.elements[10]*=invSZ,quaternion.setFromRotationMatrix(_m1$2),scale.x=sx,scale.y=sy,scale.z=sz,this}makePerspective(left,right,top,bottom,near,far,coordinateSystem=WebGLCoordinateSystem){const te=this.elements,x=2*near/(right-left),y=2*near/(top-bottom),a=(right+left)/(right-left),b=(top+bottom)/(top-bottom);let c,d;if(coordinateSystem===WebGLCoordinateSystem)c=-(far+near)/(far-near),d=-2*far*near/(far-near);else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+coordinateSystem);c=-far/(far-near),d=-far*near/(far-near)}return te[0]=x,te[4]=0,te[8]=a,te[12]=0,te[1]=0,te[5]=y,te[9]=b,te[13]=0,te[2]=0,te[6]=0,te[10]=c,te[14]=d,te[3]=0,te[7]=0,te[11]=-1,te[15]=0,this}makeOrthographic(left,right,top,bottom,near,far,coordinateSystem=WebGLCoordinateSystem){const te=this.elements,w=1/(right-left),h=1/(top-bottom),p=1/(far-near),x=(right+left)*w,y=(top+bottom)*h;let z,zInv;if(coordinateSystem===WebGLCoordinateSystem)z=(far+near)*p,zInv=-2*p;else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+coordinateSystem);z=near*p,zInv=-1*p}return te[0]=2*w,te[4]=0,te[8]=0,te[12]=-x,te[1]=0,te[5]=2*h,te[9]=0,te[13]=-y,te[2]=0,te[6]=0,te[10]=zInv,te[14]=-z,te[3]=0,te[7]=0,te[11]=0,te[15]=1,this}equals(matrix){const te=this.elements,me=matrix.elements;for(let i=0;i<16;i++)if(te[i]!==me[i])return!1;return!0}fromArray(array,offset=0){for(let i=0;i<16;i++)this.elements[i]=array[i+offset];return this}toArray(array=[],offset=0){const te=this.elements;return array[offset]=te[0],array[offset+1]=te[1],array[offset+2]=te[2],array[offset+3]=te[3],array[offset+4]=te[4],array[offset+5]=te[5],array[offset+6]=te[6],array[offset+7]=te[7],array[offset+8]=te[8],array[offset+9]=te[9],array[offset+10]=te[10],array[offset+11]=te[11],array[offset+12]=te[12],array[offset+13]=te[13],array[offset+14]=te[14],array[offset+15]=te[15],array}}const _v1$5=new Vector3,_m1$2=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix=new Matrix4,_quaternion$3=new Quaternion;class Euler{constructor(x=0,y=0,z=0,order=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=x,this._y=y,this._z=z,this._order=order}get x(){return this._x}set x(value){this._x=value,this._onChangeCallback()}get y(){return this._y}set y(value){this._y=value,this._onChangeCallback()}get z(){return this._z}set z(value){this._z=value,this._onChangeCallback()}get order(){return this._order}set order(value){this._order=value,this._onChangeCallback()}set(x,y,z,order=this._order){return this._x=x,this._y=y,this._z=z,this._order=order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(euler){return this._x=euler._x,this._y=euler._y,this._z=euler._z,this._order=euler._order,this._onChangeCallback(),this}setFromRotationMatrix(m,order=this._order,update=!0){const te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10];switch(order){case"XYZ":this._y=Math.asin(clamp(m13,-1,1)),Math.abs(m13)<.9999999?(this._x=Math.atan2(-m23,m33),this._z=Math.atan2(-m12,m11)):(this._x=Math.atan2(m32,m22),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(m23,-1,1)),Math.abs(m23)<.9999999?(this._y=Math.atan2(m13,m33),this._z=Math.atan2(m21,m22)):(this._y=Math.atan2(-m31,m11),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(m32,-1,1)),Math.abs(m32)<.9999999?(this._y=Math.atan2(-m31,m33),this._z=Math.atan2(-m12,m22)):(this._y=0,this._z=Math.atan2(m21,m11));break;case"ZYX":this._y=Math.asin(-clamp(m31,-1,1)),Math.abs(m31)<.9999999?(this._x=Math.atan2(m32,m33),this._z=Math.atan2(m21,m11)):(this._x=0,this._z=Math.atan2(-m12,m22));break;case"YZX":this._z=Math.asin(clamp(m21,-1,1)),Math.abs(m21)<.9999999?(this._x=Math.atan2(-m23,m22),this._y=Math.atan2(-m31,m11)):(this._x=0,this._y=Math.atan2(m13,m33));break;case"XZY":this._z=Math.asin(-clamp(m12,-1,1)),Math.abs(m12)<.9999999?(this._x=Math.atan2(m32,m22),this._y=Math.atan2(m13,m11)):(this._x=Math.atan2(-m23,m33),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+order)}return this._order=order,!0===update&&this._onChangeCallback(),this}setFromQuaternion(q,order,update){return _matrix.makeRotationFromQuaternion(q),this.setFromRotationMatrix(_matrix,order,update)}setFromVector3(v,order=this._order){return this.set(v.x,v.y,v.z,order)}reorder(newOrder){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,newOrder)}equals(euler){return euler._x===this._x&&euler._y===this._y&&euler._z===this._z&&euler._order===this._order}fromArray(array){return this._x=array[0],this._y=array[1],this._z=array[2],void 0!==array[3]&&(this._order=array[3]),this._onChangeCallback(),this}toArray(array=[],offset=0){return array[offset]=this._x,array[offset+1]=this._y,array[offset+2]=this._z,array[offset+3]=this._order,array}_onChange(callback){return this._onChangeCallback=callback,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(channel){this.mask=(1<>>0}enable(channel){this.mask|=1<1){for(let i=0;i1){for(let i=0;i0&&(result=result.concat(childResult))}return result}getWorldPosition(target){return this.updateWorldMatrix(!0,!1),target.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(target){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_position$3,target,_scale$2),target}getWorldScale(target){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_position$3,_quaternion$2,target),target}getWorldDirection(target){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return target.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(callback){callback(this);const children=this.children;for(let i=0,l=children.length;i0&&(object.userData=this.userData),object.layers=this.layers.mask,object.matrix=this.matrix.toArray(),object.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(object.matrixAutoUpdate=!1),this.isInstancedMesh&&(object.type="InstancedMesh",object.count=this.count,object.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(object.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?object.background=this.background.toJSON():this.background.isTexture&&(object.background=this.background.toJSON(meta).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(object.environment=this.environment.toJSON(meta).uuid);else if(this.isMesh||this.isLine||this.isPoints){object.geometry=serialize(meta.geometries,this.geometry);const parameters=this.geometry.parameters;if(void 0!==parameters&&void 0!==parameters.shapes){const shapes=parameters.shapes;if(Array.isArray(shapes))for(let i=0,l=shapes.length;i0){object.children=[];for(let i=0;i0){object.animations=[];for(let i=0;i0&&(output.geometries=geometries),materials.length>0&&(output.materials=materials),textures.length>0&&(output.textures=textures),images.length>0&&(output.images=images),shapes.length>0&&(output.shapes=shapes),skeletons.length>0&&(output.skeletons=skeletons),animations.length>0&&(output.animations=animations),nodes.length>0&&(output.nodes=nodes)}return output.object=object,output;function extractFromCache(cache){const values=[];for(const key in cache){const data=cache[key];delete data.metadata,values.push(data)}return values}}clone(recursive){return(new this.constructor).copy(this,recursive)}copy(source,recursive=!0){if(this.name=source.name,this.up.copy(source.up),this.position.copy(source.position),this.rotation.order=source.rotation.order,this.quaternion.copy(source.quaternion),this.scale.copy(source.scale),this.matrix.copy(source.matrix),this.matrixWorld.copy(source.matrixWorld),this.matrixAutoUpdate=source.matrixAutoUpdate,this.matrixWorldNeedsUpdate=source.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=source.matrixWorldAutoUpdate,this.layers.mask=source.layers.mask,this.visible=source.visible,this.castShadow=source.castShadow,this.receiveShadow=source.receiveShadow,this.frustumCulled=source.frustumCulled,this.renderOrder=source.renderOrder,this.animations=source.animations,this.userData=JSON.parse(JSON.stringify(source.userData)),!0===recursive)for(let i=0;i0?target.multiplyScalar(1/Math.sqrt(targetLengthSq)):target.set(0,0,0)}static getBarycoord(point,a,b,c,target){_v0$1.subVectors(c,a),_v1$3.subVectors(b,a),_v2$2.subVectors(point,a);const dot00=_v0$1.dot(_v0$1),dot01=_v0$1.dot(_v1$3),dot02=_v0$1.dot(_v2$2),dot11=_v1$3.dot(_v1$3),dot12=_v1$3.dot(_v2$2),denom=dot00*dot11-dot01*dot01;if(0===denom)return target.set(-2,-1,-1);const invDenom=1/denom,u=(dot11*dot02-dot01*dot12)*invDenom,v=(dot00*dot12-dot01*dot02)*invDenom;return target.set(1-u-v,v,u)}static containsPoint(point,a,b,c){return this.getBarycoord(point,a,b,c,_v3$1),_v3$1.x>=0&&_v3$1.y>=0&&_v3$1.x+_v3$1.y<=1}static getUV(point,p1,p2,p3,uv1,uv2,uv3,target){return!1===warnedGetUV&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),warnedGetUV=!0),this.getInterpolation(point,p1,p2,p3,uv1,uv2,uv3,target)}static getInterpolation(point,p1,p2,p3,v1,v2,v3,target){return this.getBarycoord(point,p1,p2,p3,_v3$1),target.setScalar(0),target.addScaledVector(v1,_v3$1.x),target.addScaledVector(v2,_v3$1.y),target.addScaledVector(v3,_v3$1.z),target}static isFrontFacing(a,b,c,direction){return _v0$1.subVectors(c,b),_v1$3.subVectors(a,b),_v0$1.cross(_v1$3).dot(direction)<0}set(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this}setFromPointsAndIndices(points,i0,i1,i2){return this.a.copy(points[i0]),this.b.copy(points[i1]),this.c.copy(points[i2]),this}setFromAttributeAndIndices(attribute,i0,i1,i2){return this.a.fromBufferAttribute(attribute,i0),this.b.fromBufferAttribute(attribute,i1),this.c.fromBufferAttribute(attribute,i2),this}clone(){return(new this.constructor).copy(this)}copy(triangle){return this.a.copy(triangle.a),this.b.copy(triangle.b),this.c.copy(triangle.c),this}getArea(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),.5*_v0$1.cross(_v1$3).length()}getMidpoint(target){return target.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(target){return Triangle.getNormal(this.a,this.b,this.c,target)}getPlane(target){return target.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(point,target){return Triangle.getBarycoord(point,this.a,this.b,this.c,target)}getUV(point,uv1,uv2,uv3,target){return!1===warnedGetUV&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),warnedGetUV=!0),Triangle.getInterpolation(point,this.a,this.b,this.c,uv1,uv2,uv3,target)}getInterpolation(point,v1,v2,v3,target){return Triangle.getInterpolation(point,this.a,this.b,this.c,v1,v2,v3,target)}containsPoint(point){return Triangle.containsPoint(point,this.a,this.b,this.c)}isFrontFacing(direction){return Triangle.isFrontFacing(this.a,this.b,this.c,direction)}intersectsBox(box){return box.intersectsTriangle(this)}closestPointToPoint(p,target){const a=this.a,b=this.b,c=this.c;let v,w;_vab.subVectors(b,a),_vac.subVectors(c,a),_vap.subVectors(p,a);const d1=_vab.dot(_vap),d2=_vac.dot(_vap);if(d1<=0&&d2<=0)return target.copy(a);_vbp.subVectors(p,b);const d3=_vab.dot(_vbp),d4=_vac.dot(_vbp);if(d3>=0&&d4<=d3)return target.copy(b);const vc=d1*d4-d3*d2;if(vc<=0&&d1>=0&&d3<=0)return v=d1/(d1-d3),target.copy(a).addScaledVector(_vab,v);_vcp.subVectors(p,c);const d5=_vab.dot(_vcp),d6=_vac.dot(_vcp);if(d6>=0&&d5<=d6)return target.copy(c);const vb=d5*d2-d1*d6;if(vb<=0&&d2>=0&&d6<=0)return w=d2/(d2-d6),target.copy(a).addScaledVector(_vac,w);const va=d3*d6-d5*d4;if(va<=0&&d4-d3>=0&&d5-d6>=0)return _vbc.subVectors(c,b),w=(d4-d3)/(d4-d3+(d5-d6)),target.copy(b).addScaledVector(_vbc,w);const denom=1/(va+vb+vc);return v=vb*denom,w=vc*denom,target.copy(a).addScaledVector(_vab,v).addScaledVector(_vac,w)}equals(triangle){return triangle.a.equals(this.a)&&triangle.b.equals(this.b)&&triangle.c.equals(this.c)}}let materialId=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:materialId++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=NormalBlending,this.side=FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(value){this._alphaTest>0!=value>0&&this.version++,this._alphaTest=value}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(values){if(void 0!==values)for(const key in values){const newValue=values[key];if(void 0===newValue){console.warn(`THREE.Material: parameter '${key}' has value of undefined.`);continue}const currentValue=this[key];void 0!==currentValue?currentValue&¤tValue.isColor?currentValue.set(newValue):currentValue&¤tValue.isVector3&&newValue&&newValue.isVector3?currentValue.copy(newValue):this[key]=newValue:console.warn(`THREE.Material: '${key}' is not a property of THREE.${this.type}.`)}}toJSON(meta){const isRootObject=void 0===meta||"string"==typeof meta;isRootObject&&(meta={textures:{},images:{}});const data={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function extractFromCache(cache){const values=[];for(const key in cache){const data=cache[key];delete data.metadata,values.push(data)}return values}if(data.uuid=this.uuid,data.type=this.type,""!==this.name&&(data.name=this.name),this.color&&this.color.isColor&&(data.color=this.color.getHex()),void 0!==this.roughness&&(data.roughness=this.roughness),void 0!==this.metalness&&(data.metalness=this.metalness),void 0!==this.sheen&&(data.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(data.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(data.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(data.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(data.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(data.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(data.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(data.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(data.shininess=this.shininess),void 0!==this.clearcoat&&(data.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(data.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(data.clearcoatMap=this.clearcoatMap.toJSON(meta).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(data.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(meta).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(data.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(meta).uuid,data.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(data.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(data.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(data.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(data.iridescenceMap=this.iridescenceMap.toJSON(meta).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(data.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(meta).uuid),void 0!==this.anisotropy&&(data.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(data.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(data.anisotropyMap=this.anisotropyMap.toJSON(meta).uuid),this.map&&this.map.isTexture&&(data.map=this.map.toJSON(meta).uuid),this.matcap&&this.matcap.isTexture&&(data.matcap=this.matcap.toJSON(meta).uuid),this.alphaMap&&this.alphaMap.isTexture&&(data.alphaMap=this.alphaMap.toJSON(meta).uuid),this.lightMap&&this.lightMap.isTexture&&(data.lightMap=this.lightMap.toJSON(meta).uuid,data.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(data.aoMap=this.aoMap.toJSON(meta).uuid,data.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(data.bumpMap=this.bumpMap.toJSON(meta).uuid,data.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(data.normalMap=this.normalMap.toJSON(meta).uuid,data.normalMapType=this.normalMapType,data.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(data.displacementMap=this.displacementMap.toJSON(meta).uuid,data.displacementScale=this.displacementScale,data.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(data.roughnessMap=this.roughnessMap.toJSON(meta).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(data.metalnessMap=this.metalnessMap.toJSON(meta).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(data.emissiveMap=this.emissiveMap.toJSON(meta).uuid),this.specularMap&&this.specularMap.isTexture&&(data.specularMap=this.specularMap.toJSON(meta).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(data.specularIntensityMap=this.specularIntensityMap.toJSON(meta).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(data.specularColorMap=this.specularColorMap.toJSON(meta).uuid),this.envMap&&this.envMap.isTexture&&(data.envMap=this.envMap.toJSON(meta).uuid,void 0!==this.combine&&(data.combine=this.combine)),void 0!==this.envMapIntensity&&(data.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(data.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(data.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(data.gradientMap=this.gradientMap.toJSON(meta).uuid),void 0!==this.transmission&&(data.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(data.transmissionMap=this.transmissionMap.toJSON(meta).uuid),void 0!==this.thickness&&(data.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(data.thicknessMap=this.thicknessMap.toJSON(meta).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(data.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(data.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(data.size=this.size),null!==this.shadowSide&&(data.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(data.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(data.blending=this.blending),this.side!==FrontSide&&(data.side=this.side),this.vertexColors&&(data.vertexColors=!0),this.opacity<1&&(data.opacity=this.opacity),!0===this.transparent&&(data.transparent=this.transparent),data.depthFunc=this.depthFunc,data.depthTest=this.depthTest,data.depthWrite=this.depthWrite,data.colorWrite=this.colorWrite,data.stencilWrite=this.stencilWrite,data.stencilWriteMask=this.stencilWriteMask,data.stencilFunc=this.stencilFunc,data.stencilRef=this.stencilRef,data.stencilFuncMask=this.stencilFuncMask,data.stencilFail=this.stencilFail,data.stencilZFail=this.stencilZFail,data.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(data.rotation=this.rotation),!0===this.polygonOffset&&(data.polygonOffset=!0),0!==this.polygonOffsetFactor&&(data.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(data.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(data.linewidth=this.linewidth),void 0!==this.dashSize&&(data.dashSize=this.dashSize),void 0!==this.gapSize&&(data.gapSize=this.gapSize),void 0!==this.scale&&(data.scale=this.scale),!0===this.dithering&&(data.dithering=!0),this.alphaTest>0&&(data.alphaTest=this.alphaTest),!0===this.alphaHash&&(data.alphaHash=this.alphaHash),!0===this.alphaToCoverage&&(data.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(data.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(data.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(data.wireframe=this.wireframe),this.wireframeLinewidth>1&&(data.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(data.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(data.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(data.flatShading=this.flatShading),!1===this.visible&&(data.visible=!1),!1===this.toneMapped&&(data.toneMapped=!1),!1===this.fog&&(data.fog=!1),Object.keys(this.userData).length>0&&(data.userData=this.userData),isRootObject){const textures=extractFromCache(meta.textures),images=extractFromCache(meta.images);textures.length>0&&(data.textures=textures),images.length>0&&(data.images=images)}return data}clone(){return(new this.constructor).copy(this)}copy(source){this.name=source.name,this.blending=source.blending,this.side=source.side,this.vertexColors=source.vertexColors,this.opacity=source.opacity,this.transparent=source.transparent,this.blendSrc=source.blendSrc,this.blendDst=source.blendDst,this.blendEquation=source.blendEquation,this.blendSrcAlpha=source.blendSrcAlpha,this.blendDstAlpha=source.blendDstAlpha,this.blendEquationAlpha=source.blendEquationAlpha,this.depthFunc=source.depthFunc,this.depthTest=source.depthTest,this.depthWrite=source.depthWrite,this.stencilWriteMask=source.stencilWriteMask,this.stencilFunc=source.stencilFunc,this.stencilRef=source.stencilRef,this.stencilFuncMask=source.stencilFuncMask,this.stencilFail=source.stencilFail,this.stencilZFail=source.stencilZFail,this.stencilZPass=source.stencilZPass,this.stencilWrite=source.stencilWrite;const srcPlanes=source.clippingPlanes;let dstPlanes=null;if(null!==srcPlanes){const n=srcPlanes.length;dstPlanes=new Array(n);for(let i=0;i!==n;++i)dstPlanes[i]=srcPlanes[i].clone()}return this.clippingPlanes=dstPlanes,this.clipIntersection=source.clipIntersection,this.clipShadows=source.clipShadows,this.shadowSide=source.shadowSide,this.colorWrite=source.colorWrite,this.precision=source.precision,this.polygonOffset=source.polygonOffset,this.polygonOffsetFactor=source.polygonOffsetFactor,this.polygonOffsetUnits=source.polygonOffsetUnits,this.dithering=source.dithering,this.alphaTest=source.alphaTest,this.alphaHash=source.alphaHash,this.alphaToCoverage=source.alphaToCoverage,this.premultipliedAlpha=source.premultipliedAlpha,this.forceSinglePass=source.forceSinglePass,this.visible=source.visible,this.toneMapped=source.toneMapped,this.userData=JSON.parse(JSON.stringify(source.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(value){!0===value&&this.version++}}const _colorKeywords={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},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+6*(q-p)*(2/3-t):p}class Color{constructor(r,g,b){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(r,g,b)}set(r,g,b){if(void 0===g&&void 0===b){const value=r;value&&value.isColor?this.copy(value):"number"==typeof value?this.setHex(value):"string"==typeof value&&this.setStyle(value)}else this.setRGB(r,g,b);return this}setScalar(scalar){return this.r=scalar,this.g=scalar,this.b=scalar,this}setHex(hex,colorSpace=SRGBColorSpace){return hex=Math.floor(hex),this.r=(hex>>16&255)/255,this.g=(hex>>8&255)/255,this.b=(255&hex)/255,ColorManagement.toWorkingColorSpace(this,colorSpace),this}setRGB(r,g,b,colorSpace=ColorManagement.workingColorSpace){return this.r=r,this.g=g,this.b=b,ColorManagement.toWorkingColorSpace(this,colorSpace),this}setHSL(h,s,l,colorSpace=ColorManagement.workingColorSpace){if(h=euclideanModulo(h,1),s=clamp(s,0,1),l=clamp(l,0,1),0===s)this.r=this.g=this.b=l;else{const p=l<=.5?l*(1+s):l+s-l*s,q=2*l-p;this.r=hue2rgb(q,p,h+1/3),this.g=hue2rgb(q,p,h),this.b=hue2rgb(q,p,h-1/3)}return ColorManagement.toWorkingColorSpace(this,colorSpace),this}setStyle(style,colorSpace=SRGBColorSpace){function handleAlpha(string){void 0!==string&&parseFloat(string)<1&&console.warn("THREE.Color: Alpha component of "+style+" will be ignored.")}let m;if(m=/^(\w+)\(([^\)]*)\)/.exec(style)){let color;const name=m[1],components=m[2];switch(name){case"rgb":case"rgba":if(color=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components))return handleAlpha(color[4]),this.setRGB(Math.min(255,parseInt(color[1],10))/255,Math.min(255,parseInt(color[2],10))/255,Math.min(255,parseInt(color[3],10))/255,colorSpace);if(color=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components))return handleAlpha(color[4]),this.setRGB(Math.min(100,parseInt(color[1],10))/100,Math.min(100,parseInt(color[2],10))/100,Math.min(100,parseInt(color[3],10))/100,colorSpace);break;case"hsl":case"hsla":if(color=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components))return handleAlpha(color[4]),this.setHSL(parseFloat(color[1])/360,parseFloat(color[2])/100,parseFloat(color[3])/100,colorSpace);break;default:console.warn("THREE.Color: Unknown color model "+style)}}else if(m=/^\#([A-Fa-f\d]+)$/.exec(style)){const hex=m[1],size=hex.length;if(3===size)return this.setRGB(parseInt(hex.charAt(0),16)/15,parseInt(hex.charAt(1),16)/15,parseInt(hex.charAt(2),16)/15,colorSpace);if(6===size)return this.setHex(parseInt(hex,16),colorSpace);console.warn("THREE.Color: Invalid hex color "+style)}else if(style&&style.length>0)return this.setColorName(style,colorSpace);return this}setColorName(style,colorSpace=SRGBColorSpace){const hex=_colorKeywords[style.toLowerCase()];return void 0!==hex?this.setHex(hex,colorSpace):console.warn("THREE.Color: Unknown color "+style),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(color){return this.r=color.r,this.g=color.g,this.b=color.b,this}copySRGBToLinear(color){return this.r=SRGBToLinear(color.r),this.g=SRGBToLinear(color.g),this.b=SRGBToLinear(color.b),this}copyLinearToSRGB(color){return this.r=LinearToSRGB(color.r),this.g=LinearToSRGB(color.g),this.b=LinearToSRGB(color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(colorSpace=SRGBColorSpace){return ColorManagement.fromWorkingColorSpace(_color.copy(this),colorSpace),65536*Math.round(clamp(255*_color.r,0,255))+256*Math.round(clamp(255*_color.g,0,255))+Math.round(clamp(255*_color.b,0,255))}getHexString(colorSpace=SRGBColorSpace){return("000000"+this.getHex(colorSpace).toString(16)).slice(-6)}getHSL(target,colorSpace=ColorManagement.workingColorSpace){ColorManagement.fromWorkingColorSpace(_color.copy(this),colorSpace);const r=_color.r,g=_color.g,b=_color.b,max=Math.max(r,g,b),min=Math.min(r,g,b);let hue,saturation;const lightness=(min+max)/2;if(min===max)hue=0,saturation=0;else{const delta=max-min;switch(saturation=lightness<=.5?delta/(max+min):delta/(2-max-min),max){case r:hue=(g-b)/delta+(g>-e-14,baseTable[256|i]=1024>>-e-14|32768,shiftTable[i]=-e-1,shiftTable[256|i]=-e-1):e<=15?(baseTable[i]=e+15<<10,baseTable[256|i]=e+15<<10|32768,shiftTable[i]=13,shiftTable[256|i]=13):e<128?(baseTable[i]=31744,baseTable[256|i]=64512,shiftTable[i]=24,shiftTable[256|i]=24):(baseTable[i]=31744,baseTable[256|i]=64512,shiftTable[i]=13,shiftTable[256|i]=13)}const mantissaTable=new Uint32Array(2048),exponentTable=new Uint32Array(64),offsetTable=new Uint32Array(64);for(let i=1;i<1024;++i){let m=i<<13,e=0;for(;0==(8388608&m);)m<<=1,e-=8388608;m&=-8388609,e+=947912704,mantissaTable[i]=m|e}for(let i=1024;i<2048;++i)mantissaTable[i]=939524096+(i-1024<<13);for(let i=1;i<31;++i)exponentTable[i]=i<<23;exponentTable[31]=1199570944,exponentTable[32]=2147483648;for(let i=33;i<63;++i)exponentTable[i]=2147483648+(i-32<<23);exponentTable[63]=3347054592;for(let i=1;i<64;++i)32!==i&&(offsetTable[i]=1024);return{floatView:floatView,uint32View:uint32View,baseTable:baseTable,shiftTable:shiftTable,mantissaTable:mantissaTable,exponentTable:exponentTable,offsetTable:offsetTable}}function toHalfFloat(val){Math.abs(val)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),val=clamp(val,-65504,65504),_tables.floatView[0]=val;const f=_tables.uint32View[0],e=f>>23&511;return _tables.baseTable[e]+((8388607&f)>>_tables.shiftTable[e])}function fromHalfFloat(val){const m=val>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[m]+(1023&val)]+_tables.exponentTable[m],_tables.floatView[0]}const DataUtils={toHalfFloat:toHalfFloat,fromHalfFloat:fromHalfFloat},_vector$8=new Vector3,_vector2$1=new Vector2;class BufferAttribute{constructor(array,itemSize,normalized=!1){if(Array.isArray(array))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=array,this.itemSize=itemSize,this.count=void 0!==array?array.length/itemSize:0,this.normalized=normalized,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.gpuType=FloatType,this.version=0}onUploadCallback(){}set needsUpdate(value){!0===value&&this.version++}setUsage(value){return this.usage=value,this}copy(source){return this.name=source.name,this.array=new source.array.constructor(source.array),this.itemSize=source.itemSize,this.count=source.count,this.normalized=source.normalized,this.usage=source.usage,this.gpuType=source.gpuType,this}copyAt(index1,attribute,index2){index1*=this.itemSize,index2*=attribute.itemSize;for(let i=0,l=this.itemSize;i0&&(data.userData=this.userData),void 0!==this.parameters){const parameters=this.parameters;for(const key in parameters)void 0!==parameters[key]&&(data[key]=parameters[key]);return data}data.data={attributes:{}};const index=this.index;null!==index&&(data.data.index={type:index.array.constructor.name,array:Array.prototype.slice.call(index.array)});const attributes=this.attributes;for(const key in attributes){const attribute=attributes[key];data.data.attributes[key]=attribute.toJSON(data.data)}const morphAttributes={};let hasMorphAttributes=!1;for(const key in this.morphAttributes){const attributeArray=this.morphAttributes[key],array=[];for(let i=0,il=attributeArray.length;i0&&(morphAttributes[key]=array,hasMorphAttributes=!0)}hasMorphAttributes&&(data.data.morphAttributes=morphAttributes,data.data.morphTargetsRelative=this.morphTargetsRelative);const groups=this.groups;groups.length>0&&(data.data.groups=JSON.parse(JSON.stringify(groups)));const boundingSphere=this.boundingSphere;return null!==boundingSphere&&(data.data.boundingSphere={center:boundingSphere.center.toArray(),radius:boundingSphere.radius}),data}clone(){return(new this.constructor).copy(this)}copy(source){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const data={};this.name=source.name;const index=source.index;null!==index&&this.setIndex(index.clone(data));const attributes=source.attributes;for(const name in attributes){const attribute=attributes[name];this.setAttribute(name,attribute.clone(data))}const morphAttributes=source.morphAttributes;for(const name in morphAttributes){const array=[],morphAttribute=morphAttributes[name];for(let i=0,l=morphAttribute.length;i0){const morphAttribute=morphAttributes[keys[0]];if(void 0!==morphAttribute){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;m(raycaster.far-raycaster.near)**2)return}_inverseMatrix$3.copy(matrixWorld).invert(),_ray$3.copy(raycaster.ray).applyMatrix4(_inverseMatrix$3),null!==geometry.boundingBox&&!1===_ray$3.intersectsBox(geometry.boundingBox)||this._computeIntersections(raycaster,intersects,_ray$3)}}_computeIntersections(raycaster,intersects,rayLocalSpace){let intersection;const geometry=this.geometry,material=this.material,index=geometry.index,position=geometry.attributes.position,uv=geometry.attributes.uv,uv1=geometry.attributes.uv1,normal=geometry.attributes.normal,groups=geometry.groups,drawRange=geometry.drawRange;if(null!==index)if(Array.isArray(material))for(let i=0,il=groups.length;iraycaster.far?null:{distance:distance,point:_intersectionPointWorld.clone(),object:object}}(object,material,raycaster,ray,_vA$1,_vB$1,_vC$1,_intersectionPoint);if(intersection){uv&&(_uvA$1.fromBufferAttribute(uv,a),_uvB$1.fromBufferAttribute(uv,b),_uvC$1.fromBufferAttribute(uv,c),intersection.uv=Triangle.getInterpolation(_intersectionPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2)),uv1&&(_uvA$1.fromBufferAttribute(uv1,a),_uvB$1.fromBufferAttribute(uv1,b),_uvC$1.fromBufferAttribute(uv1,c),intersection.uv1=Triangle.getInterpolation(_intersectionPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2),intersection.uv2=intersection.uv1),normal&&(_normalA.fromBufferAttribute(normal,a),_normalB.fromBufferAttribute(normal,b),_normalC.fromBufferAttribute(normal,c),intersection.normal=Triangle.getInterpolation(_intersectionPoint,_vA$1,_vB$1,_vC$1,_normalA,_normalB,_normalC,new Vector3),intersection.normal.dot(ray.direction)>0&&intersection.normal.multiplyScalar(-1));const face={a:a,b:b,c:c,normal:new Vector3,materialIndex:0};Triangle.getNormal(_vA$1,_vB$1,_vC$1,face.normal),intersection.face=face}return intersection}class BoxGeometry extends BufferGeometry{constructor(width=1,height=1,depth=1,widthSegments=1,heightSegments=1,depthSegments=1){super(),this.type="BoxGeometry",this.parameters={width:width,height:height,depth:depth,widthSegments:widthSegments,heightSegments:heightSegments,depthSegments:depthSegments};const scope=this;widthSegments=Math.floor(widthSegments),heightSegments=Math.floor(heightSegments),depthSegments=Math.floor(depthSegments);const indices=[],vertices=[],normals=[],uvs=[];let numberOfVertices=0,groupStart=0;function buildPlane(u,v,w,udir,vdir,width,height,depth,gridX,gridY,materialIndex){const segmentWidth=width/gridX,segmentHeight=height/gridY,widthHalf=width/2,heightHalf=height/2,depthHalf=depth/2,gridX1=gridX+1,gridY1=gridY+1;let vertexCounter=0,groupCount=0;const vector=new Vector3;for(let iy=0;iy0?1:-1,normals.push(vector.x,vector.y,vector.z),uvs.push(ix/gridX),uvs.push(1-iy/gridY),vertexCounter+=1}}for(let iy=0;iy0&&(data.defines=this.defines),data.vertexShader=this.vertexShader,data.fragmentShader=this.fragmentShader,data.lights=this.lights,data.clipping=this.clipping;const extensions={};for(const key in this.extensions)!0===this.extensions[key]&&(extensions[key]=!0);return Object.keys(extensions).length>0&&(data.extensions=extensions),data}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=WebGLCoordinateSystem}copy(source,recursive){return super.copy(source,recursive),this.matrixWorldInverse.copy(source.matrixWorldInverse),this.projectionMatrix.copy(source.projectionMatrix),this.projectionMatrixInverse.copy(source.projectionMatrixInverse),this.coordinateSystem=source.coordinateSystem,this}getWorldDirection(target){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return target.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(force){super.updateMatrixWorld(force),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(updateParents,updateChildren){super.updateWorldMatrix(updateParents,updateChildren),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class PerspectiveCamera extends Camera{constructor(fov=50,aspect=1,near=.1,far=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=fov,this.zoom=1,this.near=near,this.far=far,this.focus=10,this.aspect=aspect,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(source,recursive){return super.copy(source,recursive),this.fov=source.fov,this.zoom=source.zoom,this.near=source.near,this.far=source.far,this.focus=source.focus,this.aspect=source.aspect,this.view=null===source.view?null:Object.assign({},source.view),this.filmGauge=source.filmGauge,this.filmOffset=source.filmOffset,this}setFocalLength(focalLength){const vExtentSlope=.5*this.getFilmHeight()/focalLength;this.fov=2*RAD2DEG*Math.atan(vExtentSlope),this.updateProjectionMatrix()}getFocalLength(){const vExtentSlope=Math.tan(.5*DEG2RAD*this.fov);return.5*this.getFilmHeight()/vExtentSlope}getEffectiveFOV(){return 2*RAD2DEG*Math.atan(Math.tan(.5*DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(fullWidth,fullHeight,x,y,width,height){this.aspect=fullWidth/fullHeight,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=fullWidth,this.view.fullHeight=fullHeight,this.view.offsetX=x,this.view.offsetY=y,this.view.width=width,this.view.height=height,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const near=this.near;let top=near*Math.tan(.5*DEG2RAD*this.fov)/this.zoom,height=2*top,width=this.aspect*height,left=-.5*width;const view=this.view;if(null!==this.view&&this.view.enabled){const fullWidth=view.fullWidth,fullHeight=view.fullHeight;left+=view.offsetX*width/fullWidth,top-=view.offsetY*height/fullHeight,width*=view.width/fullWidth,height*=view.height/fullHeight}const skew=this.filmOffset;0!==skew&&(left+=near*skew/this.getFilmWidth()),this.projectionMatrix.makePerspective(left,left+width,top,top-height,near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(meta){const data=super.toJSON(meta);return data.object.fov=this.fov,data.object.zoom=this.zoom,data.object.near=this.near,data.object.far=this.far,data.object.focus=this.focus,data.object.aspect=this.aspect,null!==this.view&&(data.object.view=Object.assign({},this.view)),data.object.filmGauge=this.filmGauge,data.object.filmOffset=this.filmOffset,data}}class CubeCamera extends Object3D{constructor(near,far,renderTarget){super(),this.type="CubeCamera",this.renderTarget=renderTarget,this.coordinateSystem=null;const cameraPX=new PerspectiveCamera(-90,1,near,far);cameraPX.layers=this.layers,this.add(cameraPX);const cameraNX=new PerspectiveCamera(-90,1,near,far);cameraNX.layers=this.layers,this.add(cameraNX);const cameraPY=new PerspectiveCamera(-90,1,near,far);cameraPY.layers=this.layers,this.add(cameraPY);const cameraNY=new PerspectiveCamera(-90,1,near,far);cameraNY.layers=this.layers,this.add(cameraNY);const cameraPZ=new PerspectiveCamera(-90,1,near,far);cameraPZ.layers=this.layers,this.add(cameraPZ);const cameraNZ=new PerspectiveCamera(-90,1,near,far);cameraNZ.layers=this.layers,this.add(cameraNZ)}updateCoordinateSystem(){const coordinateSystem=this.coordinateSystem,cameras=this.children.concat(),[cameraPX,cameraNX,cameraPY,cameraNY,cameraPZ,cameraNZ]=cameras;for(const camera of cameras)this.remove(camera);if(coordinateSystem===WebGLCoordinateSystem)cameraPX.up.set(0,1,0),cameraPX.lookAt(1,0,0),cameraNX.up.set(0,1,0),cameraNX.lookAt(-1,0,0),cameraPY.up.set(0,0,-1),cameraPY.lookAt(0,1,0),cameraNY.up.set(0,0,1),cameraNY.lookAt(0,-1,0),cameraPZ.up.set(0,1,0),cameraPZ.lookAt(0,0,1),cameraNZ.up.set(0,1,0),cameraNZ.lookAt(0,0,-1);else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+coordinateSystem);cameraPX.up.set(0,-1,0),cameraPX.lookAt(-1,0,0),cameraNX.up.set(0,-1,0),cameraNX.lookAt(1,0,0),cameraPY.up.set(0,0,1),cameraPY.lookAt(0,1,0),cameraNY.up.set(0,0,-1),cameraNY.lookAt(0,-1,0),cameraPZ.up.set(0,-1,0),cameraPZ.lookAt(0,0,1),cameraNZ.up.set(0,-1,0),cameraNZ.lookAt(0,0,-1)}for(const camera of cameras)this.add(camera),camera.updateMatrixWorld()}update(renderer,scene){null===this.parent&&this.updateMatrixWorld();const renderTarget=this.renderTarget;this.coordinateSystem!==renderer.coordinateSystem&&(this.coordinateSystem=renderer.coordinateSystem,this.updateCoordinateSystem());const[cameraPX,cameraNX,cameraPY,cameraNY,cameraPZ,cameraNZ]=this.children,currentRenderTarget=renderer.getRenderTarget(),currentToneMapping=renderer.toneMapping,currentXrEnabled=renderer.xr.enabled;renderer.toneMapping=NoToneMapping,renderer.xr.enabled=!1;const generateMipmaps=renderTarget.texture.generateMipmaps;renderTarget.texture.generateMipmaps=!1,renderer.setRenderTarget(renderTarget,0),renderer.render(scene,cameraPX),renderer.setRenderTarget(renderTarget,1),renderer.render(scene,cameraNX),renderer.setRenderTarget(renderTarget,2),renderer.render(scene,cameraPY),renderer.setRenderTarget(renderTarget,3),renderer.render(scene,cameraNY),renderer.setRenderTarget(renderTarget,4),renderer.render(scene,cameraPZ),renderTarget.texture.generateMipmaps=generateMipmaps,renderer.setRenderTarget(renderTarget,5),renderer.render(scene,cameraNZ),renderer.setRenderTarget(currentRenderTarget),renderer.toneMapping=currentToneMapping,renderer.xr.enabled=currentXrEnabled,renderTarget.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(images,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,colorSpace){super(images=void 0!==images?images:[],mapping=void 0!==mapping?mapping:CubeReflectionMapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,colorSpace),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(value){this.image=value}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(size=1,options={}){super(size,size,options),this.isWebGLCubeRenderTarget=!0;const image={width:size,height:size,depth:1},images=[image,image,image,image,image,image];void 0!==options.encoding&&(warnOnce("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),options.colorSpace=options.encoding===sRGBEncoding?SRGBColorSpace:NoColorSpace),this.texture=new CubeTexture(images,options.mapping,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==options.generateMipmaps&&options.generateMipmaps,this.texture.minFilter=void 0!==options.minFilter?options.minFilter:LinearFilter}fromEquirectangularTexture(renderer,texture){this.texture.type=texture.type,this.texture.colorSpace=texture.colorSpace,this.texture.generateMipmaps=texture.generateMipmaps,this.texture.minFilter=texture.minFilter,this.texture.magFilter=texture.magFilter;const shader={uniforms:{tEquirect:{value:null}},vertexShader:"\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 \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \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"},geometry=new BoxGeometry(5,5,5),material=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(shader.uniforms),vertexShader:shader.vertexShader,fragmentShader:shader.fragmentShader,side:BackSide,blending:NoBlending});material.uniforms.tEquirect.value=texture;const mesh=new Mesh(geometry,material),currentMinFilter=texture.minFilter;texture.minFilter===LinearMipmapLinearFilter&&(texture.minFilter=LinearFilter);return new CubeCamera(1,10,this).update(renderer,mesh),texture.minFilter=currentMinFilter,mesh.geometry.dispose(),mesh.material.dispose(),this}clear(renderer,color,depth,stencil){const currentRenderTarget=renderer.getRenderTarget();for(let i=0;i<6;i++)renderer.setRenderTarget(this,i),renderer.clear(color,depth,stencil);renderer.setRenderTarget(currentRenderTarget)}}const _vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3;class Plane{constructor(normal=new Vector3(1,0,0),constant=0){this.isPlane=!0,this.normal=normal,this.constant=constant}set(normal,constant){return this.normal.copy(normal),this.constant=constant,this}setComponents(x,y,z,w){return this.normal.set(x,y,z),this.constant=w,this}setFromNormalAndCoplanarPoint(normal,point){return this.normal.copy(normal),this.constant=-point.dot(this.normal),this}setFromCoplanarPoints(a,b,c){const normal=_vector1.subVectors(c,b).cross(_vector2.subVectors(a,b)).normalize();return this.setFromNormalAndCoplanarPoint(normal,a),this}copy(plane){return this.normal.copy(plane.normal),this.constant=plane.constant,this}normalize(){const inverseNormalLength=1/this.normal.length();return this.normal.multiplyScalar(inverseNormalLength),this.constant*=inverseNormalLength,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(point){return this.normal.dot(point)+this.constant}distanceToSphere(sphere){return this.distanceToPoint(sphere.center)-sphere.radius}projectPoint(point,target){return target.copy(point).addScaledVector(this.normal,-this.distanceToPoint(point))}intersectLine(line,target){const direction=line.delta(_vector1),denominator=this.normal.dot(direction);if(0===denominator)return 0===this.distanceToPoint(line.start)?target.copy(line.start):null;const t=-(line.start.dot(this.normal)+this.constant)/denominator;return t<0||t>1?null:target.copy(line.start).addScaledVector(direction,t)}intersectsLine(line){const startSign=this.distanceToPoint(line.start),endSign=this.distanceToPoint(line.end);return startSign<0&&endSign>0||endSign<0&&startSign>0}intersectsBox(box){return box.intersectsPlane(this)}intersectsSphere(sphere){return sphere.intersectsPlane(this)}coplanarPoint(target){return target.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(matrix,optionalNormalMatrix){const normalMatrix=optionalNormalMatrix||_normalMatrix.getNormalMatrix(matrix),referencePoint=this.coplanarPoint(_vector1).applyMatrix4(matrix),normal=this.normal.applyMatrix3(normalMatrix).normalize();return this.constant=-referencePoint.dot(normal),this}translate(offset){return this.constant-=offset.dot(this.normal),this}equals(plane){return plane.normal.equals(this.normal)&&plane.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const _sphere$4=new Sphere,_vector$6=new Vector3;class Frustum{constructor(p0=new Plane,p1=new Plane,p2=new Plane,p3=new Plane,p4=new Plane,p5=new Plane){this.planes=[p0,p1,p2,p3,p4,p5]}set(p0,p1,p2,p3,p4,p5){const planes=this.planes;return planes[0].copy(p0),planes[1].copy(p1),planes[2].copy(p2),planes[3].copy(p3),planes[4].copy(p4),planes[5].copy(p5),this}copy(frustum){const planes=this.planes;for(let i=0;i<6;i++)planes[i].copy(frustum.planes[i]);return this}setFromProjectionMatrix(m,coordinateSystem=WebGLCoordinateSystem){const planes=this.planes,me=m.elements,me0=me[0],me1=me[1],me2=me[2],me3=me[3],me4=me[4],me5=me[5],me6=me[6],me7=me[7],me8=me[8],me9=me[9],me10=me[10],me11=me[11],me12=me[12],me13=me[13],me14=me[14],me15=me[15];if(planes[0].setComponents(me3-me0,me7-me4,me11-me8,me15-me12).normalize(),planes[1].setComponents(me3+me0,me7+me4,me11+me8,me15+me12).normalize(),planes[2].setComponents(me3+me1,me7+me5,me11+me9,me15+me13).normalize(),planes[3].setComponents(me3-me1,me7-me5,me11-me9,me15-me13).normalize(),planes[4].setComponents(me3-me2,me7-me6,me11-me10,me15-me14).normalize(),coordinateSystem===WebGLCoordinateSystem)planes[5].setComponents(me3+me2,me7+me6,me11+me10,me15+me14).normalize();else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+coordinateSystem);planes[5].setComponents(me2,me6,me10,me14).normalize()}return this}intersectsObject(object){if(void 0!==object.boundingSphere)null===object.boundingSphere&&object.computeBoundingSphere(),_sphere$4.copy(object.boundingSphere).applyMatrix4(object.matrixWorld);else{const geometry=object.geometry;null===geometry.boundingSphere&&geometry.computeBoundingSphere(),_sphere$4.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld)}return this.intersectsSphere(_sphere$4)}intersectsSprite(sprite){return _sphere$4.center.set(0,0,0),_sphere$4.radius=.7071067811865476,_sphere$4.applyMatrix4(sprite.matrixWorld),this.intersectsSphere(_sphere$4)}intersectsSphere(sphere){const planes=this.planes,center=sphere.center,negRadius=-sphere.radius;for(let i=0;i<6;i++){if(planes[i].distanceToPoint(center)0?box.max.x:box.min.x,_vector$6.y=plane.normal.y>0?box.max.y:box.min.y,_vector$6.z=plane.normal.z>0?box.max.z:box.min.z,plane.distanceToPoint(_vector$6)<0)return!1}return!0}containsPoint(point){const planes=this.planes;for(let i=0;i<6;i++)if(planes[i].distanceToPoint(point)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let context=null,isAnimating=!1,animationLoop=null,requestId=null;function onAnimationFrame(time,frame){animationLoop(time,frame),requestId=context.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==isAnimating&&null!==animationLoop&&(requestId=context.requestAnimationFrame(onAnimationFrame),isAnimating=!0)},stop:function(){context.cancelAnimationFrame(requestId),isAnimating=!1},setAnimationLoop:function(callback){animationLoop=callback},setContext:function(value){context=value}}}function WebGLAttributes(gl,capabilities){const isWebGL2=capabilities.isWebGL2,buffers=new WeakMap;return{get:function get(attribute){return attribute.isInterleavedBufferAttribute&&(attribute=attribute.data),buffers.get(attribute)},remove:function remove(attribute){attribute.isInterleavedBufferAttribute&&(attribute=attribute.data);const data=buffers.get(attribute);data&&(gl.deleteBuffer(data.buffer),buffers.delete(attribute))},update:function update(attribute,bufferType){if(attribute.isGLBufferAttribute){const cached=buffers.get(attribute);return void((!cached||cached.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\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_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\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_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\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_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\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\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 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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 = inverseTransformDirection( 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\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 = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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 = inverseTransformDirection( 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_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",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 GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, 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 GeometricContext geometry, 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;\nuniform vec3 lightProbe[ 9 ];\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 = inverseTransformDirection( 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\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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",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 GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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 * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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 = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), 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_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.07, 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\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\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:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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#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 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = 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\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\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.specularColor;\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 * transposeMat3( 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 a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\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}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\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.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\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",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\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\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\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#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\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#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = 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\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#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 = geometryNormal;\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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( 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( 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\treturn depth * ( near - far ) - near;\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\treturn ( near * far ) / ( ( far - near ) * depth - far );\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_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\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\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\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\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\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\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 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 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 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\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\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.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.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\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.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\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\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 OptimizedCineonToneMapping( 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}\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 = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, 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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\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_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\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \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 flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, 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 \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \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 \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\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#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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_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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},UniformsLib={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:ShaderChunk.backgroundCube_vert,fragmentShader:ShaderChunk.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};const _rgb={r:0,b:0,g:0};function WebGLBackground(renderer,cubemaps,cubeuvmaps,state,objects,alpha,premultipliedAlpha){const clearColor=new Color(0);let planeMesh,boxMesh,clearAlpha=!0===alpha?0:1,currentBackground=null,currentBackgroundVersion=0,currentTonemapping=null;function setClear(color,alpha){color.getRGB(_rgb,getUnlitUniformColorSpace(renderer)),state.buffers.color.setClear(_rgb.r,_rgb.g,_rgb.b,alpha,premultipliedAlpha)}return{getClearColor:function(){return clearColor},setClearColor:function(color,alpha=1){clearColor.set(color),clearAlpha=alpha,setClear(clearColor,clearAlpha)},getClearAlpha:function(){return clearAlpha},setClearAlpha:function(alpha){clearAlpha=alpha,setClear(clearColor,clearAlpha)},render:function render(renderList,scene){let forceClear=!1,background=!0===scene.isScene?scene.background:null;if(background&&background.isTexture){background=(scene.backgroundBlurriness>0?cubeuvmaps:cubemaps).get(background)}switch(null===background?setClear(clearColor,clearAlpha):background&&background.isColor&&(setClear(background,1),forceClear=!0),renderer.xr.getEnvironmentBlendMode()){case"opaque":forceClear=!0;break;case"additive":state.buffers.color.setClear(0,0,0,1,premultipliedAlpha),forceClear=!0;break;case"alpha-blend":state.buffers.color.setClear(0,0,0,0,premultipliedAlpha),forceClear=!0}(renderer.autoClear||forceClear)&&renderer.clear(renderer.autoClearColor,renderer.autoClearDepth,renderer.autoClearStencil),background&&(background.isCubeTexture||background.mapping===CubeUVReflectionMapping)?(void 0===boxMesh&&(boxMesh=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.backgroundCube.uniforms),vertexShader:ShaderLib.backgroundCube.vertexShader,fragmentShader:ShaderLib.backgroundCube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),boxMesh.geometry.deleteAttribute("normal"),boxMesh.geometry.deleteAttribute("uv"),boxMesh.onBeforeRender=function(renderer,scene,camera){this.matrixWorld.copyPosition(camera.matrixWorld)},Object.defineProperty(boxMesh.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),objects.update(boxMesh)),boxMesh.material.uniforms.envMap.value=background,boxMesh.material.uniforms.flipEnvMap.value=background.isCubeTexture&&!1===background.isRenderTargetTexture?-1:1,boxMesh.material.uniforms.backgroundBlurriness.value=scene.backgroundBlurriness,boxMesh.material.uniforms.backgroundIntensity.value=scene.backgroundIntensity,boxMesh.material.toneMapped=background.colorSpace!==SRGBColorSpace,currentBackground===background&¤tBackgroundVersion===background.version&¤tTonemapping===renderer.toneMapping||(boxMesh.material.needsUpdate=!0,currentBackground=background,currentBackgroundVersion=background.version,currentTonemapping=renderer.toneMapping),boxMesh.layers.enableAll(),renderList.unshift(boxMesh,boxMesh.geometry,boxMesh.material,0,0,null)):background&&background.isTexture&&(void 0===planeMesh&&(planeMesh=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),planeMesh.geometry.deleteAttribute("normal"),Object.defineProperty(planeMesh.material,"map",{get:function(){return this.uniforms.t2D.value}}),objects.update(planeMesh)),planeMesh.material.uniforms.t2D.value=background,planeMesh.material.uniforms.backgroundIntensity.value=scene.backgroundIntensity,planeMesh.material.toneMapped=background.colorSpace!==SRGBColorSpace,!0===background.matrixAutoUpdate&&background.updateMatrix(),planeMesh.material.uniforms.uvTransform.value.copy(background.matrix),currentBackground===background&¤tBackgroundVersion===background.version&¤tTonemapping===renderer.toneMapping||(planeMesh.material.needsUpdate=!0,currentBackground=background,currentBackgroundVersion=background.version,currentTonemapping=renderer.toneMapping),planeMesh.layers.enableAll(),renderList.unshift(planeMesh,planeMesh.geometry,planeMesh.material,0,0,null))}}}function WebGLBindingStates(gl,extensions,attributes,capabilities){const maxVertexAttributes=gl.getParameter(gl.MAX_VERTEX_ATTRIBS),extension=capabilities.isWebGL2?null:extensions.get("OES_vertex_array_object"),vaoAvailable=capabilities.isWebGL2||null!==extension,bindingStates={},defaultState=createBindingState(null);let currentState=defaultState,forceUpdate=!1;function bindVertexArrayObject(vao){return capabilities.isWebGL2?gl.bindVertexArray(vao):extension.bindVertexArrayOES(vao)}function deleteVertexArrayObject(vao){return capabilities.isWebGL2?gl.deleteVertexArray(vao):extension.deleteVertexArrayOES(vao)}function createBindingState(vao){const newAttributes=[],enabledAttributes=[],attributeDivisors=[];for(let i=0;i=0){const cachedAttribute=cachedAttributes[name];let geometryAttribute=geometryAttributes[name];if(void 0===geometryAttribute&&("instanceMatrix"===name&&object.instanceMatrix&&(geometryAttribute=object.instanceMatrix),"instanceColor"===name&&object.instanceColor&&(geometryAttribute=object.instanceColor)),void 0===cachedAttribute)return!0;if(cachedAttribute.attribute!==geometryAttribute)return!0;if(geometryAttribute&&cachedAttribute.data!==geometryAttribute.data)return!0;attributesNum++}}return currentState.attributesNum!==attributesNum||currentState.index!==index}(object,geometry,program,index),updateBuffers&&function saveCache(object,geometry,program,index){const cache={},attributes=geometry.attributes;let attributesNum=0;const programAttributes=program.getAttributes();for(const name in programAttributes){if(programAttributes[name].location>=0){let attribute=attributes[name];void 0===attribute&&("instanceMatrix"===name&&object.instanceMatrix&&(attribute=object.instanceMatrix),"instanceColor"===name&&object.instanceColor&&(attribute=object.instanceColor));const data={};data.attribute=attribute,attribute&&attribute.data&&(data.data=attribute.data),cache[name]=data,attributesNum++}}currentState.attributes=cache,currentState.attributesNum=attributesNum,currentState.index=index}(object,geometry,program,index)}else{const wireframe=!0===material.wireframe;currentState.geometry===geometry.id&¤tState.program===program.id&¤tState.wireframe===wireframe||(currentState.geometry=geometry.id,currentState.program=program.id,currentState.wireframe=wireframe,updateBuffers=!0)}null!==index&&attributes.update(index,gl.ELEMENT_ARRAY_BUFFER),(updateBuffers||forceUpdate)&&(forceUpdate=!1,function setupVertexAttributes(object,material,program,geometry){if(!1===capabilities.isWebGL2&&(object.isInstancedMesh||geometry.isInstancedBufferGeometry)&&null===extensions.get("ANGLE_instanced_arrays"))return;initAttributes();const geometryAttributes=geometry.attributes,programAttributes=program.getAttributes(),materialDefaultAttributeValues=material.defaultAttributeValues;for(const name in programAttributes){const programAttribute=programAttributes[name];if(programAttribute.location>=0){let geometryAttribute=geometryAttributes[name];if(void 0===geometryAttribute&&("instanceMatrix"===name&&object.instanceMatrix&&(geometryAttribute=object.instanceMatrix),"instanceColor"===name&&object.instanceColor&&(geometryAttribute=object.instanceColor)),void 0!==geometryAttribute){const normalized=geometryAttribute.normalized,size=geometryAttribute.itemSize,attribute=attributes.get(geometryAttribute);if(void 0===attribute)continue;const buffer=attribute.buffer,type=attribute.type,bytesPerElement=attribute.bytesPerElement,integer=!0===capabilities.isWebGL2&&(type===gl.INT||type===gl.UNSIGNED_INT||geometryAttribute.gpuType===IntType);if(geometryAttribute.isInterleavedBufferAttribute){const data=geometryAttribute.data,stride=data.stride,offset=geometryAttribute.offset;if(data.isInstancedInterleavedBuffer){for(let i=0;i0&&gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT).precision>0)return"highp";precision="mediump"}return"mediump"===precision&&gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_FLOAT).precision>0&&gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const isWebGL2="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===gl.constructor.name;let precision=void 0!==parameters.precision?parameters.precision:"highp";const maxPrecision=getMaxPrecision(precision);maxPrecision!==precision&&(console.warn("THREE.WebGLRenderer:",precision,"not supported, using",maxPrecision,"instead."),precision=maxPrecision);const drawBuffers=isWebGL2||extensions.has("WEBGL_draw_buffers"),logarithmicDepthBuffer=!0===parameters.logarithmicDepthBuffer,maxTextures=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures=gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize=gl.getParameter(gl.MAX_TEXTURE_SIZE),maxCubemapSize=gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes=gl.getParameter(gl.MAX_VERTEX_ATTRIBS),maxVertexUniforms=gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings=gl.getParameter(gl.MAX_VARYING_VECTORS),maxFragmentUniforms=gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures=maxVertexTextures>0,floatFragmentTextures=isWebGL2||extensions.has("OES_texture_float");return{isWebGL2:isWebGL2,drawBuffers:drawBuffers,getMaxAnisotropy:function getMaxAnisotropy(){if(void 0!==maxAnisotropy)return maxAnisotropy;if(!0===extensions.has("EXT_texture_filter_anisotropic")){const extension=extensions.get("EXT_texture_filter_anisotropic");maxAnisotropy=gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else maxAnisotropy=0;return maxAnisotropy},getMaxPrecision:getMaxPrecision,precision:precision,logarithmicDepthBuffer:logarithmicDepthBuffer,maxTextures:maxTextures,maxVertexTextures:maxVertexTextures,maxTextureSize:maxTextureSize,maxCubemapSize:maxCubemapSize,maxAttributes:maxAttributes,maxVertexUniforms:maxVertexUniforms,maxVaryings:maxVaryings,maxFragmentUniforms:maxFragmentUniforms,vertexTextures:vertexTextures,floatFragmentTextures:floatFragmentTextures,floatVertexTextures:vertexTextures&&floatFragmentTextures,maxSamples:isWebGL2?gl.getParameter(gl.MAX_SAMPLES):0}}function WebGLClipping(properties){const scope=this;let globalState=null,numGlobalPlanes=0,localClippingEnabled=!1,renderingShadows=!1;const plane=new Plane,viewNormalMatrix=new Matrix3,uniform={value:null,needsUpdate:!1};function projectPlanes(planes,camera,dstOffset,skipTransform){const nPlanes=null!==planes?planes.length:0;let dstArray=null;if(0!==nPlanes){if(dstArray=uniform.value,!0!==skipTransform||null===dstArray){const flatSize=dstOffset+4*nPlanes,viewMatrix=camera.matrixWorldInverse;viewNormalMatrix.getNormalMatrix(viewMatrix),(null===dstArray||dstArray.length0);scope.numPlanes=numGlobalPlanes,scope.numIntersection=0}();else{const nGlobal=renderingShadows?0:numGlobalPlanes,lGlobal=4*nGlobal;let dstArray=materialProperties.clippingState||null;uniform.value=dstArray,dstArray=projectPlanes(planes,camera,lGlobal,useCache);for(let i=0;i!==lGlobal;++i)dstArray[i]=globalState[i];materialProperties.clippingState=dstArray,this.numIntersection=clipIntersection?this.numPlanes:0,this.numPlanes+=nGlobal}}}function WebGLCubeMaps(renderer){let cubemaps=new WeakMap;function mapTextureMapping(texture,mapping){return mapping===EquirectangularReflectionMapping?texture.mapping=CubeReflectionMapping:mapping===EquirectangularRefractionMapping&&(texture.mapping=CubeRefractionMapping),texture}function onTextureDispose(event){const texture=event.target;texture.removeEventListener("dispose",onTextureDispose);const cubemap=cubemaps.get(texture);void 0!==cubemap&&(cubemaps.delete(texture),cubemap.dispose())}return{get:function get(texture){if(texture&&texture.isTexture&&!1===texture.isRenderTargetTexture){const mapping=texture.mapping;if(mapping===EquirectangularReflectionMapping||mapping===EquirectangularRefractionMapping){if(cubemaps.has(texture)){return mapTextureMapping(cubemaps.get(texture).texture,texture.mapping)}{const image=texture.image;if(image&&image.height>0){const renderTarget=new WebGLCubeRenderTarget(image.height/2);return renderTarget.fromEquirectangularTexture(renderer,texture),cubemaps.set(texture,renderTarget),texture.addEventListener("dispose",onTextureDispose),mapTextureMapping(renderTarget.texture,texture.mapping)}return null}}}return texture},dispose:function dispose(){cubemaps=new WeakMap}}}class OrthographicCamera extends Camera{constructor(left=-1,right=1,top=1,bottom=-1,near=.1,far=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=left,this.right=right,this.top=top,this.bottom=bottom,this.near=near,this.far=far,this.updateProjectionMatrix()}copy(source,recursive){return super.copy(source,recursive),this.left=source.left,this.right=source.right,this.top=source.top,this.bottom=source.bottom,this.near=source.near,this.far=source.far,this.zoom=source.zoom,this.view=null===source.view?null:Object.assign({},source.view),this}setViewOffset(fullWidth,fullHeight,x,y,width,height){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=fullWidth,this.view.fullHeight=fullHeight,this.view.offsetX=x,this.view.offsetY=y,this.view.width=width,this.view.height=height,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const dx=(this.right-this.left)/(2*this.zoom),dy=(this.top-this.bottom)/(2*this.zoom),cx=(this.right+this.left)/2,cy=(this.top+this.bottom)/2;let left=cx-dx,right=cx+dx,top=cy+dy,bottom=cy-dy;if(null!==this.view&&this.view.enabled){const scaleW=(this.right-this.left)/this.view.fullWidth/this.zoom,scaleH=(this.top-this.bottom)/this.view.fullHeight/this.zoom;left+=scaleW*this.view.offsetX,right=left+scaleW*this.view.width,top-=scaleH*this.view.offsetY,bottom=top-scaleH*this.view.height}this.projectionMatrix.makeOrthographic(left,right,top,bottom,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(meta){const data=super.toJSON(meta);return data.object.zoom=this.zoom,data.object.left=this.left,data.object.right=this.right,data.object.top=this.top,data.object.bottom=this.bottom,data.object.near=this.near,data.object.far=this.far,null!==this.view&&(data.object.view=Object.assign({},this.view)),data}}const EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],_flatCamera=new OrthographicCamera,_clearColor=new Color;let _oldTarget=null;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,PHI,INV_PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(INV_PHI,0,PHI),new Vector3(-INV_PHI,0,PHI),new Vector3(PHI,INV_PHI,0),new Vector3(-PHI,INV_PHI,0)];class PMREMGenerator{constructor(renderer){this._renderer=renderer,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(scene,sigma=0,near=.1,far=100){_oldTarget=this._renderer.getRenderTarget(),this._setSize(256);const cubeUVRenderTarget=this._allocateTargets();return cubeUVRenderTarget.depthBuffer=!0,this._sceneToCubeUV(scene,near,far,cubeUVRenderTarget),sigma>0&&this._blur(cubeUVRenderTarget,0,0,sigma),this._applyPMREM(cubeUVRenderTarget),this._cleanup(cubeUVRenderTarget),cubeUVRenderTarget}fromEquirectangular(equirectangular,renderTarget=null){return this._fromTexture(equirectangular,renderTarget)}fromCubemap(cubemap,renderTarget=null){return this._fromTexture(cubemap,renderTarget)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(cubeSize){this._lodMax=Math.floor(Math.log2(cubeSize)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let i=0;ilodMax-4?sigma=EXTRA_LOD_SIGMA[i-lodMax+4-1]:0===i&&(sigma=0),sigmas.push(sigma);const texelSize=1/(sizeLod-2),min=-texelSize,max=1+texelSize,uv1=[min,min,max,min,max,max,min,min,max,max,min,max],cubeFaces=6,vertices=6,positionSize=3,uvSize=2,faceIndexSize=1,position=new Float32Array(positionSize*vertices*cubeFaces),uv=new Float32Array(uvSize*vertices*cubeFaces),faceIndex=new Float32Array(faceIndexSize*vertices*cubeFaces);for(let face=0;face2?0:-1,coordinates=[x,y,0,x+2/3,y,0,x+2/3,y+1,0,x,y,0,x+2/3,y+1,0,x,y+1,0];position.set(coordinates,positionSize*vertices*face),uv.set(uv1,uvSize*vertices*face);const fill=[face,face,face,face,face,face];faceIndex.set(fill,faceIndexSize*vertices*face)}const planes=new BufferGeometry;planes.setAttribute("position",new BufferAttribute(position,positionSize)),planes.setAttribute("uv",new BufferAttribute(uv,uvSize)),planes.setAttribute("faceIndex",new BufferAttribute(faceIndex,faceIndexSize)),lodPlanes.push(planes),lod>4&&lod--}return{lodPlanes:lodPlanes,sizeLods:sizeLods,sigmas:sigmas}}(_lodMax)),this._blurMaterial=function _getBlurShader(lodMax,width,height){const weights=new Float32Array(20),poleAxis=new Vector3(0,1,0),shaderMaterial=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/width,CUBEUV_TEXEL_HEIGHT:1/height,CUBEUV_MAX_MIP:`${lodMax}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:weights},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:poleAxis}},vertexShader:_getCommonVertexShader(),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 \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:NoBlending,depthTest:!1,depthWrite:!1});return shaderMaterial}(_lodMax,width,height)}return cubeUVRenderTarget}_compileMaterial(material){const tmpMesh=new Mesh(this._lodPlanes[0],material);this._renderer.compile(tmpMesh,_flatCamera)}_sceneToCubeUV(scene,near,far,cubeUVRenderTarget){const cubeCamera=new PerspectiveCamera(90,1,near,far),upSign=[1,-1,1,1,1,1],forwardSign=[1,1,1,-1,-1,-1],renderer=this._renderer,originalAutoClear=renderer.autoClear,toneMapping=renderer.toneMapping;renderer.getClearColor(_clearColor),renderer.toneMapping=NoToneMapping,renderer.autoClear=!1;const backgroundMaterial=new MeshBasicMaterial({name:"PMREM.Background",side:BackSide,depthWrite:!1,depthTest:!1}),backgroundBox=new Mesh(new BoxGeometry,backgroundMaterial);let useSolidColor=!1;const background=scene.background;background?background.isColor&&(backgroundMaterial.color.copy(background),scene.background=null,useSolidColor=!0):(backgroundMaterial.color.copy(_clearColor),useSolidColor=!0);for(let i=0;i<6;i++){const col=i%3;0===col?(cubeCamera.up.set(0,upSign[i],0),cubeCamera.lookAt(forwardSign[i],0,0)):1===col?(cubeCamera.up.set(0,0,upSign[i]),cubeCamera.lookAt(0,forwardSign[i],0)):(cubeCamera.up.set(0,upSign[i],0),cubeCamera.lookAt(0,0,forwardSign[i]));const size=this._cubeSize;_setViewport(cubeUVRenderTarget,col*size,i>2?size:0,size,size),renderer.setRenderTarget(cubeUVRenderTarget),useSolidColor&&renderer.render(backgroundBox,cubeCamera),renderer.render(scene,cubeCamera)}backgroundBox.geometry.dispose(),backgroundBox.material.dispose(),renderer.toneMapping=toneMapping,renderer.autoClear=originalAutoClear,scene.background=background}_textureToCubeUV(texture,cubeUVRenderTarget){const renderer=this._renderer,isCubeTexture=texture.mapping===CubeReflectionMapping||texture.mapping===CubeRefractionMapping;isCubeTexture?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===texture.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const material=isCubeTexture?this._cubemapMaterial:this._equirectMaterial,mesh=new Mesh(this._lodPlanes[0],material);material.uniforms.envMap.value=texture;const size=this._cubeSize;_setViewport(cubeUVRenderTarget,0,0,3*size,2*size),renderer.setRenderTarget(cubeUVRenderTarget),renderer.render(mesh,_flatCamera)}_applyPMREM(cubeUVRenderTarget){const renderer=this._renderer,autoClear=renderer.autoClear;renderer.autoClear=!1;for(let i=1;i20&&console.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to 20`);const weights=[];let sum=0;for(let i=0;i<20;++i){const x=i/sigmaPixels,weight=Math.exp(-x*x/2);weights.push(weight),0===i?sum+=weight:i_lodMax-4?lodOut-_lodMax+4:0),4*(this._cubeSize-outputSize),3*outputSize,2*outputSize),renderer.setRenderTarget(targetOut),renderer.render(blurMesh,_flatCamera)}}function _createRenderTarget(width,height,params){const cubeUVRenderTarget=new WebGLRenderTarget(width,height,params);return cubeUVRenderTarget.texture.mapping=CubeUVReflectionMapping,cubeUVRenderTarget.texture.name="PMREM.cubeUv",cubeUVRenderTarget.scissorTest=!0,cubeUVRenderTarget}function _setViewport(target,x,y,width,height){target.viewport.set(x,y,width,height),target.scissor.set(x,y,width,height)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),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 \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:NoBlending,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),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:NoBlending,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){return"\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"}function WebGLCubeUVMaps(renderer){let cubeUVmaps=new WeakMap,pmremGenerator=null;function onTextureDispose(event){const texture=event.target;texture.removeEventListener("dispose",onTextureDispose);const cubemapUV=cubeUVmaps.get(texture);void 0!==cubemapUV&&(cubeUVmaps.delete(texture),cubemapUV.dispose())}return{get:function get(texture){if(texture&&texture.isTexture){const mapping=texture.mapping,isEquirectMap=mapping===EquirectangularReflectionMapping||mapping===EquirectangularRefractionMapping,isCubeMap=mapping===CubeReflectionMapping||mapping===CubeRefractionMapping;if(isEquirectMap||isCubeMap){if(texture.isRenderTargetTexture&&!0===texture.needsPMREMUpdate){texture.needsPMREMUpdate=!1;let renderTarget=cubeUVmaps.get(texture);return null===pmremGenerator&&(pmremGenerator=new PMREMGenerator(renderer)),renderTarget=isEquirectMap?pmremGenerator.fromEquirectangular(texture,renderTarget):pmremGenerator.fromCubemap(texture,renderTarget),cubeUVmaps.set(texture,renderTarget),renderTarget.texture}if(cubeUVmaps.has(texture))return cubeUVmaps.get(texture).texture;{const image=texture.image;if(isEquirectMap&&image&&image.height>0||isCubeMap&&image&&function isCubeTextureComplete(image){let count=0;const length=6;for(let i=0;icapabilities.maxTextureSize&&(height=Math.ceil(width/capabilities.maxTextureSize),width=capabilities.maxTextureSize);const buffer=new Float32Array(width*height*4*morphTargetsCount),texture=new DataArrayTexture(buffer,width,height,morphTargetsCount);texture.type=FloatType,texture.needsUpdate=!0;const vertexDataStride=4*vertexDataCount;for(let i=0;i0)return array;const n=nBlocks*blockSize;let r=arrayCacheF32[n];if(void 0===r&&(r=new Float32Array(n),arrayCacheF32[n]=r),0!==nBlocks){firstElem.toArray(r,0);for(let i=1,offset=0;i!==nBlocks;++i)offset+=blockSize,array[i].toArray(r,offset)}return r}function arraysEqual(a,b){if(a.length!==b.length)return!1;for(let i=0,l=a.length;i":" "} ${line}: ${lines[i]}`)}return lines2.join("\n")}(gl.getShaderSource(shader),errorLine)}return errors}function getTexelEncodingFunction(functionName,colorSpace){const components=function getEncodingComponents(colorSpace){switch(colorSpace){case LinearSRGBColorSpace:return["Linear","( value )"];case SRGBColorSpace:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",colorSpace),["Linear","( value )"]}}(colorSpace);return"vec4 "+functionName+"( vec4 value ) { return LinearTo"+components[0]+components[1]+"; }"}function getToneMappingFunction(functionName,toneMapping){let toneMappingName;switch(toneMapping){case LinearToneMapping:toneMappingName="Linear";break;case ReinhardToneMapping:toneMappingName="Reinhard";break;case CineonToneMapping:toneMappingName="OptimizedCineon";break;case ACESFilmicToneMapping:toneMappingName="ACESFilmic";break;case CustomToneMapping:toneMappingName="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",toneMapping),toneMappingName="Linear"}return"vec3 "+functionName+"( vec3 color ) { return "+toneMappingName+"ToneMapping( color ); }"}function filterEmptyLine(string){return""!==string}function replaceLightNums(string,parameters){const numSpotLightCoords=parameters.numSpotLightShadows+parameters.numSpotLightMaps-parameters.numSpotLightShadowsWithMaps;return string.replace(/NUM_DIR_LIGHTS/g,parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g,parameters.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,parameters.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,numSpotLightCoords).replace(/NUM_RECT_AREA_LIGHTS/g,parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g,parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,parameters.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,parameters.numPointLightShadows)}function replaceClippingPlaneNums(string,parameters){return string.replace(/NUM_CLIPPING_PLANES/g,parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,parameters.numClippingPlanes-parameters.numClipIntersection)}const includePattern=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(string){return string.replace(includePattern,includeReplacer)}const shaderChunkMap=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function includeReplacer(match,include){let string=ShaderChunk[include];if(void 0===string){const newInclude=shaderChunkMap.get(include);if(void 0===newInclude)throw new Error("Can not resolve #include <"+include+">");string=ShaderChunk[newInclude],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',include,newInclude)}return resolveIncludes(string)}const unrollLoopPattern=/#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 unrollLoops(string){return string.replace(unrollLoopPattern,loopReplacer)}function loopReplacer(match,start,end,snippet){let string="";for(let i=parseInt(start);i0&&(prefixVertex+="\n"),prefixFragment=[customExtensions,"#define SHADER_TYPE "+parameters.shaderType,"#define SHADER_NAME "+parameters.shaderName,customDefines].filter(filterEmptyLine).join("\n"),prefixFragment.length>0&&(prefixFragment+="\n")):(prefixVertex=[generatePrecision(parameters),"#define SHADER_TYPE "+parameters.shaderType,"#define SHADER_NAME "+parameters.shaderName,customDefines,parameters.instancing?"#define USE_INSTANCING":"",parameters.instancingColor?"#define USE_INSTANCING_COLOR":"",parameters.useFog&¶meters.fog?"#define USE_FOG":"",parameters.useFog&¶meters.fogExp2?"#define FOG_EXP2":"",parameters.map?"#define USE_MAP":"",parameters.envMap?"#define USE_ENVMAP":"",parameters.envMap?"#define "+envMapModeDefine:"",parameters.lightMap?"#define USE_LIGHTMAP":"",parameters.aoMap?"#define USE_AOMAP":"",parameters.bumpMap?"#define USE_BUMPMAP":"",parameters.normalMap?"#define USE_NORMALMAP":"",parameters.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",parameters.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",parameters.displacementMap?"#define USE_DISPLACEMENTMAP":"",parameters.emissiveMap?"#define USE_EMISSIVEMAP":"",parameters.anisotropyMap?"#define USE_ANISOTROPYMAP":"",parameters.clearcoatMap?"#define USE_CLEARCOATMAP":"",parameters.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",parameters.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",parameters.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",parameters.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",parameters.specularMap?"#define USE_SPECULARMAP":"",parameters.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",parameters.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",parameters.roughnessMap?"#define USE_ROUGHNESSMAP":"",parameters.metalnessMap?"#define USE_METALNESSMAP":"",parameters.alphaMap?"#define USE_ALPHAMAP":"",parameters.alphaHash?"#define USE_ALPHAHASH":"",parameters.transmission?"#define USE_TRANSMISSION":"",parameters.transmissionMap?"#define USE_TRANSMISSIONMAP":"",parameters.thicknessMap?"#define USE_THICKNESSMAP":"",parameters.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",parameters.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",parameters.mapUv?"#define MAP_UV "+parameters.mapUv:"",parameters.alphaMapUv?"#define ALPHAMAP_UV "+parameters.alphaMapUv:"",parameters.lightMapUv?"#define LIGHTMAP_UV "+parameters.lightMapUv:"",parameters.aoMapUv?"#define AOMAP_UV "+parameters.aoMapUv:"",parameters.emissiveMapUv?"#define EMISSIVEMAP_UV "+parameters.emissiveMapUv:"",parameters.bumpMapUv?"#define BUMPMAP_UV "+parameters.bumpMapUv:"",parameters.normalMapUv?"#define NORMALMAP_UV "+parameters.normalMapUv:"",parameters.displacementMapUv?"#define DISPLACEMENTMAP_UV "+parameters.displacementMapUv:"",parameters.metalnessMapUv?"#define METALNESSMAP_UV "+parameters.metalnessMapUv:"",parameters.roughnessMapUv?"#define ROUGHNESSMAP_UV "+parameters.roughnessMapUv:"",parameters.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+parameters.anisotropyMapUv:"",parameters.clearcoatMapUv?"#define CLEARCOATMAP_UV "+parameters.clearcoatMapUv:"",parameters.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+parameters.clearcoatNormalMapUv:"",parameters.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+parameters.clearcoatRoughnessMapUv:"",parameters.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+parameters.iridescenceMapUv:"",parameters.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+parameters.iridescenceThicknessMapUv:"",parameters.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+parameters.sheenColorMapUv:"",parameters.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+parameters.sheenRoughnessMapUv:"",parameters.specularMapUv?"#define SPECULARMAP_UV "+parameters.specularMapUv:"",parameters.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+parameters.specularColorMapUv:"",parameters.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+parameters.specularIntensityMapUv:"",parameters.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+parameters.transmissionMapUv:"",parameters.thicknessMapUv?"#define THICKNESSMAP_UV "+parameters.thicknessMapUv:"",parameters.vertexTangents&&!1===parameters.flatShading?"#define USE_TANGENT":"",parameters.vertexColors?"#define USE_COLOR":"",parameters.vertexAlphas?"#define USE_COLOR_ALPHA":"",parameters.vertexUv1s?"#define USE_UV1":"",parameters.vertexUv2s?"#define USE_UV2":"",parameters.vertexUv3s?"#define USE_UV3":"",parameters.pointsUvs?"#define USE_POINTS_UV":"",parameters.flatShading?"#define FLAT_SHADED":"",parameters.skinning?"#define USE_SKINNING":"",parameters.morphTargets?"#define USE_MORPHTARGETS":"",parameters.morphNormals&&!1===parameters.flatShading?"#define USE_MORPHNORMALS":"",parameters.morphColors&¶meters.isWebGL2?"#define USE_MORPHCOLORS":"",parameters.morphTargetsCount>0&¶meters.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",parameters.morphTargetsCount>0&¶meters.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+parameters.morphTextureStride:"",parameters.morphTargetsCount>0&¶meters.isWebGL2?"#define MORPHTARGETS_COUNT "+parameters.morphTargetsCount:"",parameters.doubleSided?"#define DOUBLE_SIDED":"",parameters.flipSided?"#define FLIP_SIDED":"",parameters.shadowMapEnabled?"#define USE_SHADOWMAP":"",parameters.shadowMapEnabled?"#define "+shadowMapTypeDefine:"",parameters.sizeAttenuation?"#define USE_SIZEATTENUATION":"",parameters.useLegacyLights?"#define LEGACY_LIGHTS":"",parameters.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",parameters.logarithmicDepthBuffer&¶meters.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(filterEmptyLine).join("\n"),prefixFragment=[customExtensions,generatePrecision(parameters),"#define SHADER_TYPE "+parameters.shaderType,"#define SHADER_NAME "+parameters.shaderName,customDefines,parameters.useFog&¶meters.fog?"#define USE_FOG":"",parameters.useFog&¶meters.fogExp2?"#define FOG_EXP2":"",parameters.map?"#define USE_MAP":"",parameters.matcap?"#define USE_MATCAP":"",parameters.envMap?"#define USE_ENVMAP":"",parameters.envMap?"#define "+envMapTypeDefine:"",parameters.envMap?"#define "+envMapModeDefine:"",parameters.envMap?"#define "+envMapBlendingDefine:"",envMapCubeUVSize?"#define CUBEUV_TEXEL_WIDTH "+envMapCubeUVSize.texelWidth:"",envMapCubeUVSize?"#define CUBEUV_TEXEL_HEIGHT "+envMapCubeUVSize.texelHeight:"",envMapCubeUVSize?"#define CUBEUV_MAX_MIP "+envMapCubeUVSize.maxMip+".0":"",parameters.lightMap?"#define USE_LIGHTMAP":"",parameters.aoMap?"#define USE_AOMAP":"",parameters.bumpMap?"#define USE_BUMPMAP":"",parameters.normalMap?"#define USE_NORMALMAP":"",parameters.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",parameters.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",parameters.emissiveMap?"#define USE_EMISSIVEMAP":"",parameters.anisotropy?"#define USE_ANISOTROPY":"",parameters.anisotropyMap?"#define USE_ANISOTROPYMAP":"",parameters.clearcoat?"#define USE_CLEARCOAT":"",parameters.clearcoatMap?"#define USE_CLEARCOATMAP":"",parameters.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",parameters.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",parameters.iridescence?"#define USE_IRIDESCENCE":"",parameters.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",parameters.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",parameters.specularMap?"#define USE_SPECULARMAP":"",parameters.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",parameters.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",parameters.roughnessMap?"#define USE_ROUGHNESSMAP":"",parameters.metalnessMap?"#define USE_METALNESSMAP":"",parameters.alphaMap?"#define USE_ALPHAMAP":"",parameters.alphaTest?"#define USE_ALPHATEST":"",parameters.alphaHash?"#define USE_ALPHAHASH":"",parameters.sheen?"#define USE_SHEEN":"",parameters.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",parameters.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",parameters.transmission?"#define USE_TRANSMISSION":"",parameters.transmissionMap?"#define USE_TRANSMISSIONMAP":"",parameters.thicknessMap?"#define USE_THICKNESSMAP":"",parameters.vertexTangents&&!1===parameters.flatShading?"#define USE_TANGENT":"",parameters.vertexColors||parameters.instancingColor?"#define USE_COLOR":"",parameters.vertexAlphas?"#define USE_COLOR_ALPHA":"",parameters.vertexUv1s?"#define USE_UV1":"",parameters.vertexUv2s?"#define USE_UV2":"",parameters.vertexUv3s?"#define USE_UV3":"",parameters.pointsUvs?"#define USE_POINTS_UV":"",parameters.gradientMap?"#define USE_GRADIENTMAP":"",parameters.flatShading?"#define FLAT_SHADED":"",parameters.doubleSided?"#define DOUBLE_SIDED":"",parameters.flipSided?"#define FLIP_SIDED":"",parameters.shadowMapEnabled?"#define USE_SHADOWMAP":"",parameters.shadowMapEnabled?"#define "+shadowMapTypeDefine:"",parameters.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",parameters.useLegacyLights?"#define LEGACY_LIGHTS":"",parameters.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",parameters.logarithmicDepthBuffer&¶meters.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",parameters.toneMapping!==NoToneMapping?"#define TONE_MAPPING":"",parameters.toneMapping!==NoToneMapping?ShaderChunk.tonemapping_pars_fragment:"",parameters.toneMapping!==NoToneMapping?getToneMappingFunction("toneMapping",parameters.toneMapping):"",parameters.dithering?"#define DITHERING":"",parameters.opaque?"#define OPAQUE":"",ShaderChunk.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",parameters.outputColorSpace),parameters.useDepthPacking?"#define DEPTH_PACKING "+parameters.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),vertexShader=resolveIncludes(vertexShader),vertexShader=replaceLightNums(vertexShader,parameters),vertexShader=replaceClippingPlaneNums(vertexShader,parameters),fragmentShader=resolveIncludes(fragmentShader),fragmentShader=replaceLightNums(fragmentShader,parameters),fragmentShader=replaceClippingPlaneNums(fragmentShader,parameters),vertexShader=unrollLoops(vertexShader),fragmentShader=unrollLoops(fragmentShader),parameters.isWebGL2&&!0!==parameters.isRawShaderMaterial&&(versionString="#version 300 es\n",prefixVertex=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+prefixVertex,prefixFragment=["#define varying in",parameters.glslVersion===GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",parameters.glslVersion===GLSL3?"":"#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"+prefixFragment);const vertexGlsl=versionString+prefixVertex+vertexShader,fragmentGlsl=versionString+prefixFragment+fragmentShader,glVertexShader=WebGLShader(gl,gl.VERTEX_SHADER,vertexGlsl),glFragmentShader=WebGLShader(gl,gl.FRAGMENT_SHADER,fragmentGlsl);if(gl.attachShader(program,glVertexShader),gl.attachShader(program,glFragmentShader),void 0!==parameters.index0AttributeName?gl.bindAttribLocation(program,0,parameters.index0AttributeName):!0===parameters.morphTargets&&gl.bindAttribLocation(program,0,"position"),gl.linkProgram(program),renderer.debug.checkShaderErrors){const programLog=gl.getProgramInfoLog(program).trim(),vertexLog=gl.getShaderInfoLog(glVertexShader).trim(),fragmentLog=gl.getShaderInfoLog(glFragmentShader).trim();let runnable=!0,haveDiagnostics=!0;if(!1===gl.getProgramParameter(program,gl.LINK_STATUS))if(runnable=!1,"function"==typeof renderer.debug.onShaderError)renderer.debug.onShaderError(gl,program,glVertexShader,glFragmentShader);else{const vertexErrors=getShaderErrors(gl,glVertexShader,"vertex"),fragmentErrors=getShaderErrors(gl,glFragmentShader,"fragment");console.error("THREE.WebGLProgram: Shader Error "+gl.getError()+" - VALIDATE_STATUS "+gl.getProgramParameter(program,gl.VALIDATE_STATUS)+"\n\nProgram Info Log: "+programLog+"\n"+vertexErrors+"\n"+fragmentErrors)}else""!==programLog?console.warn("THREE.WebGLProgram: Program Info Log:",programLog):""!==vertexLog&&""!==fragmentLog||(haveDiagnostics=!1);haveDiagnostics&&(this.diagnostics={runnable:runnable,programLog:programLog,vertexShader:{log:vertexLog,prefix:prefixVertex},fragmentShader:{log:fragmentLog,prefix:prefixFragment}})}let cachedUniforms,cachedAttributes;return gl.deleteShader(glVertexShader),gl.deleteShader(glFragmentShader),this.getUniforms=function(){return void 0===cachedUniforms&&(cachedUniforms=new WebGLUniforms(gl,program)),cachedUniforms},this.getAttributes=function(){return void 0===cachedAttributes&&(cachedAttributes=function fetchAttributeLocations(gl,program){const attributes={},n=gl.getProgramParameter(program,gl.ACTIVE_ATTRIBUTES);for(let i=0;i0,HAS_CLEARCOAT=material.clearcoat>0,HAS_IRIDESCENCE=material.iridescence>0,HAS_SHEEN=material.sheen>0,HAS_TRANSMISSION=material.transmission>0,HAS_ANISOTROPYMAP=HAS_ANISOTROPY&&!!material.anisotropyMap,HAS_CLEARCOATMAP=HAS_CLEARCOAT&&!!material.clearcoatMap,HAS_CLEARCOAT_NORMALMAP=HAS_CLEARCOAT&&!!material.clearcoatNormalMap,HAS_CLEARCOAT_ROUGHNESSMAP=HAS_CLEARCOAT&&!!material.clearcoatRoughnessMap,HAS_IRIDESCENCEMAP=HAS_IRIDESCENCE&&!!material.iridescenceMap,HAS_IRIDESCENCE_THICKNESSMAP=HAS_IRIDESCENCE&&!!material.iridescenceThicknessMap,HAS_SHEEN_COLORMAP=HAS_SHEEN&&!!material.sheenColorMap,HAS_SHEEN_ROUGHNESSMAP=HAS_SHEEN&&!!material.sheenRoughnessMap,HAS_SPECULARMAP=!!material.specularMap,HAS_SPECULAR_COLORMAP=!!material.specularColorMap,HAS_SPECULAR_INTENSITYMAP=!!material.specularIntensityMap,HAS_TRANSMISSIONMAP=HAS_TRANSMISSION&&!!material.transmissionMap,HAS_THICKNESSMAP=HAS_TRANSMISSION&&!!material.thicknessMap,HAS_GRADIENTMAP=!!material.gradientMap,HAS_ALPHAMAP=!!material.alphaMap,HAS_ALPHATEST=material.alphaTest>0,HAS_ALPHAHASH=!!material.alphaHash,HAS_EXTENSIONS=!!material.extensions,HAS_ATTRIBUTE_UV1=!!geometry.attributes.uv1,HAS_ATTRIBUTE_UV2=!!geometry.attributes.uv2,HAS_ATTRIBUTE_UV3=!!geometry.attributes.uv3;return{isWebGL2:IS_WEBGL2,shaderID:shaderID,shaderType:material.type,shaderName:material.name,vertexShader:vertexShader,fragmentShader:fragmentShader,defines:material.defines,customVertexShaderID:customVertexShaderID,customFragmentShaderID:customFragmentShaderID,isRawShaderMaterial:!0===material.isRawShaderMaterial,glslVersion:material.glslVersion,precision:precision,instancing:IS_INSTANCEDMESH,instancingColor:IS_INSTANCEDMESH&&null!==object.instanceColor,supportsVertexTextures:SUPPORTS_VERTEX_TEXTURES,outputColorSpace:null===currentRenderTarget?renderer.outputColorSpace:!0===currentRenderTarget.isXRRenderTarget?currentRenderTarget.texture.colorSpace:LinearSRGBColorSpace,map:HAS_MAP,matcap:HAS_MATCAP,envMap:HAS_ENVMAP,envMapMode:HAS_ENVMAP&&envMap.mapping,envMapCubeUVHeight:envMapCubeUVHeight,aoMap:HAS_AOMAP,lightMap:HAS_LIGHTMAP,bumpMap:HAS_BUMPMAP,normalMap:HAS_NORMALMAP,displacementMap:SUPPORTS_VERTEX_TEXTURES&&HAS_DISPLACEMENTMAP,emissiveMap:HAS_EMISSIVEMAP,normalMapObjectSpace:HAS_NORMALMAP&&material.normalMapType===ObjectSpaceNormalMap,normalMapTangentSpace:HAS_NORMALMAP&&material.normalMapType===TangentSpaceNormalMap,metalnessMap:HAS_METALNESSMAP,roughnessMap:HAS_ROUGHNESSMAP,anisotropy:HAS_ANISOTROPY,anisotropyMap:HAS_ANISOTROPYMAP,clearcoat:HAS_CLEARCOAT,clearcoatMap:HAS_CLEARCOATMAP,clearcoatNormalMap:HAS_CLEARCOAT_NORMALMAP,clearcoatRoughnessMap:HAS_CLEARCOAT_ROUGHNESSMAP,iridescence:HAS_IRIDESCENCE,iridescenceMap:HAS_IRIDESCENCEMAP,iridescenceThicknessMap:HAS_IRIDESCENCE_THICKNESSMAP,sheen:HAS_SHEEN,sheenColorMap:HAS_SHEEN_COLORMAP,sheenRoughnessMap:HAS_SHEEN_ROUGHNESSMAP,specularMap:HAS_SPECULARMAP,specularColorMap:HAS_SPECULAR_COLORMAP,specularIntensityMap:HAS_SPECULAR_INTENSITYMAP,transmission:HAS_TRANSMISSION,transmissionMap:HAS_TRANSMISSIONMAP,thicknessMap:HAS_THICKNESSMAP,gradientMap:HAS_GRADIENTMAP,opaque:!1===material.transparent&&material.blending===NormalBlending,alphaMap:HAS_ALPHAMAP,alphaTest:HAS_ALPHATEST,alphaHash:HAS_ALPHAHASH,combine:material.combine,mapUv:HAS_MAP&&getChannel(material.map.channel),aoMapUv:HAS_AOMAP&&getChannel(material.aoMap.channel),lightMapUv:HAS_LIGHTMAP&&getChannel(material.lightMap.channel),bumpMapUv:HAS_BUMPMAP&&getChannel(material.bumpMap.channel),normalMapUv:HAS_NORMALMAP&&getChannel(material.normalMap.channel),displacementMapUv:HAS_DISPLACEMENTMAP&&getChannel(material.displacementMap.channel),emissiveMapUv:HAS_EMISSIVEMAP&&getChannel(material.emissiveMap.channel),metalnessMapUv:HAS_METALNESSMAP&&getChannel(material.metalnessMap.channel),roughnessMapUv:HAS_ROUGHNESSMAP&&getChannel(material.roughnessMap.channel),anisotropyMapUv:HAS_ANISOTROPYMAP&&getChannel(material.anisotropyMap.channel),clearcoatMapUv:HAS_CLEARCOATMAP&&getChannel(material.clearcoatMap.channel),clearcoatNormalMapUv:HAS_CLEARCOAT_NORMALMAP&&getChannel(material.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:HAS_CLEARCOAT_ROUGHNESSMAP&&getChannel(material.clearcoatRoughnessMap.channel),iridescenceMapUv:HAS_IRIDESCENCEMAP&&getChannel(material.iridescenceMap.channel),iridescenceThicknessMapUv:HAS_IRIDESCENCE_THICKNESSMAP&&getChannel(material.iridescenceThicknessMap.channel),sheenColorMapUv:HAS_SHEEN_COLORMAP&&getChannel(material.sheenColorMap.channel),sheenRoughnessMapUv:HAS_SHEEN_ROUGHNESSMAP&&getChannel(material.sheenRoughnessMap.channel),specularMapUv:HAS_SPECULARMAP&&getChannel(material.specularMap.channel),specularColorMapUv:HAS_SPECULAR_COLORMAP&&getChannel(material.specularColorMap.channel),specularIntensityMapUv:HAS_SPECULAR_INTENSITYMAP&&getChannel(material.specularIntensityMap.channel),transmissionMapUv:HAS_TRANSMISSIONMAP&&getChannel(material.transmissionMap.channel),thicknessMapUv:HAS_THICKNESSMAP&&getChannel(material.thicknessMap.channel),alphaMapUv:HAS_ALPHAMAP&&getChannel(material.alphaMap.channel),vertexTangents:!!geometry.attributes.tangent&&(HAS_NORMALMAP||HAS_ANISOTROPY),vertexColors:material.vertexColors,vertexAlphas:!0===material.vertexColors&&!!geometry.attributes.color&&4===geometry.attributes.color.itemSize,vertexUv1s:HAS_ATTRIBUTE_UV1,vertexUv2s:HAS_ATTRIBUTE_UV2,vertexUv3s:HAS_ATTRIBUTE_UV3,pointsUvs:!0===object.isPoints&&!!geometry.attributes.uv&&(HAS_MAP||HAS_ALPHAMAP),fog:!!fog,useFog:!0===material.fog,fogExp2:fog&&fog.isFogExp2,flatShading:!0===material.flatShading,sizeAttenuation:!0===material.sizeAttenuation,logarithmicDepthBuffer:logarithmicDepthBuffer,skinning:!0===object.isSkinnedMesh,morphTargets:void 0!==geometry.morphAttributes.position,morphNormals:void 0!==geometry.morphAttributes.normal,morphColors:void 0!==geometry.morphAttributes.color,morphTargetsCount:morphTargetsCount,morphTextureStride:morphTextureStride,numDirLights:lights.directional.length,numPointLights:lights.point.length,numSpotLights:lights.spot.length,numSpotLightMaps:lights.spotLightMap.length,numRectAreaLights:lights.rectArea.length,numHemiLights:lights.hemi.length,numDirLightShadows:lights.directionalShadowMap.length,numPointLightShadows:lights.pointShadowMap.length,numSpotLightShadows:lights.spotShadowMap.length,numSpotLightShadowsWithMaps:lights.numSpotLightShadowsWithMaps,numClippingPlanes:clipping.numPlanes,numClipIntersection:clipping.numIntersection,dithering:material.dithering,shadowMapEnabled:renderer.shadowMap.enabled&&shadows.length>0,shadowMapType:renderer.shadowMap.type,toneMapping:material.toneMapped?renderer.toneMapping:NoToneMapping,useLegacyLights:renderer.useLegacyLights,premultipliedAlpha:material.premultipliedAlpha,doubleSided:material.side===DoubleSide,flipSided:material.side===BackSide,useDepthPacking:material.depthPacking>=0,depthPacking:material.depthPacking||0,index0AttributeName:material.index0AttributeName,extensionDerivatives:HAS_EXTENSIONS&&!0===material.extensions.derivatives,extensionFragDepth:HAS_EXTENSIONS&&!0===material.extensions.fragDepth,extensionDrawBuffers:HAS_EXTENSIONS&&!0===material.extensions.drawBuffers,extensionShaderTextureLOD:HAS_EXTENSIONS&&!0===material.extensions.shaderTextureLOD,rendererExtensionFragDepth:IS_WEBGL2||extensions.has("EXT_frag_depth"),rendererExtensionDrawBuffers:IS_WEBGL2||extensions.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:IS_WEBGL2||extensions.has("EXT_shader_texture_lod"),customProgramCacheKey:material.customProgramCacheKey()}},getProgramCacheKey:function getProgramCacheKey(parameters){const array=[];if(parameters.shaderID?array.push(parameters.shaderID):(array.push(parameters.customVertexShaderID),array.push(parameters.customFragmentShaderID)),void 0!==parameters.defines)for(const name in parameters.defines)array.push(name),array.push(parameters.defines[name]);return!1===parameters.isRawShaderMaterial&&(!function getProgramCacheKeyParameters(array,parameters){array.push(parameters.precision),array.push(parameters.outputColorSpace),array.push(parameters.envMapMode),array.push(parameters.envMapCubeUVHeight),array.push(parameters.mapUv),array.push(parameters.alphaMapUv),array.push(parameters.lightMapUv),array.push(parameters.aoMapUv),array.push(parameters.bumpMapUv),array.push(parameters.normalMapUv),array.push(parameters.displacementMapUv),array.push(parameters.emissiveMapUv),array.push(parameters.metalnessMapUv),array.push(parameters.roughnessMapUv),array.push(parameters.anisotropyMapUv),array.push(parameters.clearcoatMapUv),array.push(parameters.clearcoatNormalMapUv),array.push(parameters.clearcoatRoughnessMapUv),array.push(parameters.iridescenceMapUv),array.push(parameters.iridescenceThicknessMapUv),array.push(parameters.sheenColorMapUv),array.push(parameters.sheenRoughnessMapUv),array.push(parameters.specularMapUv),array.push(parameters.specularColorMapUv),array.push(parameters.specularIntensityMapUv),array.push(parameters.transmissionMapUv),array.push(parameters.thicknessMapUv),array.push(parameters.combine),array.push(parameters.fogExp2),array.push(parameters.sizeAttenuation),array.push(parameters.morphTargetsCount),array.push(parameters.morphAttributeCount),array.push(parameters.numDirLights),array.push(parameters.numPointLights),array.push(parameters.numSpotLights),array.push(parameters.numSpotLightMaps),array.push(parameters.numHemiLights),array.push(parameters.numRectAreaLights),array.push(parameters.numDirLightShadows),array.push(parameters.numPointLightShadows),array.push(parameters.numSpotLightShadows),array.push(parameters.numSpotLightShadowsWithMaps),array.push(parameters.shadowMapType),array.push(parameters.toneMapping),array.push(parameters.numClippingPlanes),array.push(parameters.numClipIntersection),array.push(parameters.depthPacking)}(array,parameters),function getProgramCacheKeyBooleans(array,parameters){_programLayers.disableAll(),parameters.isWebGL2&&_programLayers.enable(0);parameters.supportsVertexTextures&&_programLayers.enable(1);parameters.instancing&&_programLayers.enable(2);parameters.instancingColor&&_programLayers.enable(3);parameters.matcap&&_programLayers.enable(4);parameters.envMap&&_programLayers.enable(5);parameters.normalMapObjectSpace&&_programLayers.enable(6);parameters.normalMapTangentSpace&&_programLayers.enable(7);parameters.clearcoat&&_programLayers.enable(8);parameters.iridescence&&_programLayers.enable(9);parameters.alphaTest&&_programLayers.enable(10);parameters.vertexColors&&_programLayers.enable(11);parameters.vertexAlphas&&_programLayers.enable(12);parameters.vertexUv1s&&_programLayers.enable(13);parameters.vertexUv2s&&_programLayers.enable(14);parameters.vertexUv3s&&_programLayers.enable(15);parameters.vertexTangents&&_programLayers.enable(16);parameters.anisotropy&&_programLayers.enable(17);array.push(_programLayers.mask),_programLayers.disableAll(),parameters.fog&&_programLayers.enable(0);parameters.useFog&&_programLayers.enable(1);parameters.flatShading&&_programLayers.enable(2);parameters.logarithmicDepthBuffer&&_programLayers.enable(3);parameters.skinning&&_programLayers.enable(4);parameters.morphTargets&&_programLayers.enable(5);parameters.morphNormals&&_programLayers.enable(6);parameters.morphColors&&_programLayers.enable(7);parameters.premultipliedAlpha&&_programLayers.enable(8);parameters.shadowMapEnabled&&_programLayers.enable(9);parameters.useLegacyLights&&_programLayers.enable(10);parameters.doubleSided&&_programLayers.enable(11);parameters.flipSided&&_programLayers.enable(12);parameters.useDepthPacking&&_programLayers.enable(13);parameters.dithering&&_programLayers.enable(14);parameters.transmission&&_programLayers.enable(15);parameters.sheen&&_programLayers.enable(16);parameters.opaque&&_programLayers.enable(17);parameters.pointsUvs&&_programLayers.enable(18);array.push(_programLayers.mask)}(array,parameters),array.push(renderer.outputColorSpace)),array.push(parameters.customProgramCacheKey),array.join()},getUniforms:function getUniforms(material){const shaderID=shaderIDs[material.type];let uniforms;if(shaderID){const shader=ShaderLib[shaderID];uniforms=UniformsUtils.clone(shader.uniforms)}else uniforms=material.uniforms;return uniforms},acquireProgram:function acquireProgram(parameters,cacheKey){let program;for(let p=0,pl=programs.length;p0?transmissive.push(renderItem):!0===material.transparent?transparent.push(renderItem):opaque.push(renderItem)},unshift:function unshift(object,geometry,material,groupOrder,z,group){const renderItem=getNextRenderItem(object,geometry,material,groupOrder,z,group);material.transmission>0?transmissive.unshift(renderItem):!0===material.transparent?transparent.unshift(renderItem):opaque.unshift(renderItem)},finish:function finish(){for(let i=renderItemsIndex,il=renderItems.length;i1&&opaque.sort(customOpaqueSort||painterSortStable),transmissive.length>1&&transmissive.sort(customTransparentSort||reversePainterSortStable),transparent.length>1&&transparent.sort(customTransparentSort||reversePainterSortStable)}}}function WebGLRenderLists(){let lists=new WeakMap;return{get:function get(scene,renderCallDepth){const listArray=lists.get(scene);let list;return void 0===listArray?(list=new WebGLRenderList,lists.set(scene,[list])):renderCallDepth>=listArray.length?(list=new WebGLRenderList,listArray.push(list)):list=listArray[renderCallDepth],list},dispose:function dispose(){lists=new WeakMap}}}function UniformsCache(){const lights={};return{get:function(light){if(void 0!==lights[light.id])return lights[light.id];let uniforms;switch(light.type){case"DirectionalLight":uniforms={direction:new Vector3,color:new Color};break;case"SpotLight":uniforms={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":uniforms={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":uniforms={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":uniforms={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return lights[light.id]=uniforms,uniforms}}}let nextVersion=0;function shadowCastingAndTexturingLightsFirst(lightA,lightB){return(lightB.castShadow?2:0)-(lightA.castShadow?2:0)+(lightB.map?1:0)-(lightA.map?1:0)}function WebGLLights(extensions,capabilities){const cache=new UniformsCache,shadowCache=function ShadowUniformsCache(){const lights={};return{get:function(light){if(void 0!==lights[light.id])return lights[light.id];let uniforms;switch(light.type){case"DirectionalLight":case"SpotLight":uniforms={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":uniforms={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return lights[light.id]=uniforms,uniforms}}}(),state={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let i=0;i<9;i++)state.probe.push(new Vector3);const vector3=new Vector3,matrix4=new Matrix4,matrix42=new Matrix4;return{setup:function setup(lights,useLegacyLights){let r=0,g=0,b=0;for(let i=0;i<9;i++)state.probe[i].set(0,0,0);let directionalLength=0,pointLength=0,spotLength=0,rectAreaLength=0,hemiLength=0,numDirectionalShadows=0,numPointShadows=0,numSpotShadows=0,numSpotMaps=0,numSpotShadowsWithMaps=0;lights.sort(shadowCastingAndTexturingLightsFirst);const scaleFactor=!0===useLegacyLights?Math.PI:1;for(let i=0,l=lights.length;i0&&(capabilities.isWebGL2||!0===extensions.has("OES_texture_float_linear")?(state.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,state.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):!0===extensions.has("OES_texture_half_float_linear")?(state.rectAreaLTC1=UniformsLib.LTC_HALF_1,state.rectAreaLTC2=UniformsLib.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),state.ambient[0]=r,state.ambient[1]=g,state.ambient[2]=b;const hash=state.hash;hash.directionalLength===directionalLength&&hash.pointLength===pointLength&&hash.spotLength===spotLength&&hash.rectAreaLength===rectAreaLength&&hash.hemiLength===hemiLength&&hash.numDirectionalShadows===numDirectionalShadows&&hash.numPointShadows===numPointShadows&&hash.numSpotShadows===numSpotShadows&&hash.numSpotMaps===numSpotMaps||(state.directional.length=directionalLength,state.spot.length=spotLength,state.rectArea.length=rectAreaLength,state.point.length=pointLength,state.hemi.length=hemiLength,state.directionalShadow.length=numDirectionalShadows,state.directionalShadowMap.length=numDirectionalShadows,state.pointShadow.length=numPointShadows,state.pointShadowMap.length=numPointShadows,state.spotShadow.length=numSpotShadows,state.spotShadowMap.length=numSpotShadows,state.directionalShadowMatrix.length=numDirectionalShadows,state.pointShadowMatrix.length=numPointShadows,state.spotLightMatrix.length=numSpotShadows+numSpotMaps-numSpotShadowsWithMaps,state.spotLightMap.length=numSpotMaps,state.numSpotLightShadowsWithMaps=numSpotShadowsWithMaps,hash.directionalLength=directionalLength,hash.pointLength=pointLength,hash.spotLength=spotLength,hash.rectAreaLength=rectAreaLength,hash.hemiLength=hemiLength,hash.numDirectionalShadows=numDirectionalShadows,hash.numPointShadows=numPointShadows,hash.numSpotShadows=numSpotShadows,hash.numSpotMaps=numSpotMaps,state.version=nextVersion++)},setupView:function setupView(lights,camera){let directionalLength=0,pointLength=0,spotLength=0,rectAreaLength=0,hemiLength=0;const viewMatrix=camera.matrixWorldInverse;for(let i=0,l=lights.length;i=renderStateArray.length?(renderState=new WebGLRenderState(extensions,capabilities),renderStateArray.push(renderState)):renderState=renderStateArray[renderCallDepth],renderState},dispose:function dispose(){renderStates=new WeakMap}}}class MeshDepthMaterial extends Material{constructor(parameters){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(parameters)}copy(source){return super.copy(source),this.depthPacking=source.depthPacking,this.map=source.map,this.alphaMap=source.alphaMap,this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(parameters){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(parameters)}copy(source){return super.copy(source),this.map=source.map,this.alphaMap=source.alphaMap,this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this}}function WebGLShadowMap(_renderer,_objects,_capabilities){let _frustum=new Frustum;const _shadowMapSize=new Vector2,_viewportSize=new Vector2,_viewport=new Vector4,_depthMaterial=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),_distanceMaterial=new MeshDistanceMaterial,_materialCache={},_maxTextureSize=_capabilities.maxTextureSize,shadowSide={[FrontSide]:BackSide,[BackSide]:FrontSide,[DoubleSide]:DoubleSide},shadowMaterialVertical=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},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;\n#include \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 = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\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 = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\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( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),shadowMaterialHorizontal=shadowMaterialVertical.clone();shadowMaterialHorizontal.defines.HORIZONTAL_PASS=1;const fullScreenTri=new BufferGeometry;fullScreenTri.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const fullScreenMesh=new Mesh(fullScreenTri,shadowMaterialVertical),scope=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap;let _previousType=this.type;function VSMPass(shadow,camera){const geometry=_objects.update(fullScreenMesh);shadowMaterialVertical.defines.VSM_SAMPLES!==shadow.blurSamples&&(shadowMaterialVertical.defines.VSM_SAMPLES=shadow.blurSamples,shadowMaterialHorizontal.defines.VSM_SAMPLES=shadow.blurSamples,shadowMaterialVertical.needsUpdate=!0,shadowMaterialHorizontal.needsUpdate=!0),null===shadow.mapPass&&(shadow.mapPass=new WebGLRenderTarget(_shadowMapSize.x,_shadowMapSize.y)),shadowMaterialVertical.uniforms.shadow_pass.value=shadow.map.texture,shadowMaterialVertical.uniforms.resolution.value=shadow.mapSize,shadowMaterialVertical.uniforms.radius.value=shadow.radius,_renderer.setRenderTarget(shadow.mapPass),_renderer.clear(),_renderer.renderBufferDirect(camera,null,geometry,shadowMaterialVertical,fullScreenMesh,null),shadowMaterialHorizontal.uniforms.shadow_pass.value=shadow.mapPass.texture,shadowMaterialHorizontal.uniforms.resolution.value=shadow.mapSize,shadowMaterialHorizontal.uniforms.radius.value=shadow.radius,_renderer.setRenderTarget(shadow.map),_renderer.clear(),_renderer.renderBufferDirect(camera,null,geometry,shadowMaterialHorizontal,fullScreenMesh,null)}function getDepthMaterial(object,material,light,type){let result=null;const customMaterial=!0===light.isPointLight?object.customDistanceMaterial:object.customDepthMaterial;if(void 0!==customMaterial)result=customMaterial;else if(result=!0===light.isPointLight?_distanceMaterial:_depthMaterial,_renderer.localClippingEnabled&&!0===material.clipShadows&&Array.isArray(material.clippingPlanes)&&0!==material.clippingPlanes.length||material.displacementMap&&0!==material.displacementScale||material.alphaMap&&material.alphaTest>0||material.map&&material.alphaTest>0){const keyA=result.uuid,keyB=material.uuid;let materialsForVariant=_materialCache[keyA];void 0===materialsForVariant&&(materialsForVariant={},_materialCache[keyA]=materialsForVariant);let cachedMaterial=materialsForVariant[keyB];void 0===cachedMaterial&&(cachedMaterial=result.clone(),materialsForVariant[keyB]=cachedMaterial),result=cachedMaterial}if(result.visible=material.visible,result.wireframe=material.wireframe,result.side=type===VSMShadowMap?null!==material.shadowSide?material.shadowSide:material.side:null!==material.shadowSide?material.shadowSide:shadowSide[material.side],result.alphaMap=material.alphaMap,result.alphaTest=material.alphaTest,result.map=material.map,result.clipShadows=material.clipShadows,result.clippingPlanes=material.clippingPlanes,result.clipIntersection=material.clipIntersection,result.displacementMap=material.displacementMap,result.displacementScale=material.displacementScale,result.displacementBias=material.displacementBias,result.wireframeLinewidth=material.wireframeLinewidth,result.linewidth=material.linewidth,!0===light.isPointLight&&!0===result.isMeshDistanceMaterial){_renderer.properties.get(result).light=light}return result}function renderObject(object,camera,shadowCamera,light,type){if(!1===object.visible)return;if(object.layers.test(camera.layers)&&(object.isMesh||object.isLine||object.isPoints)&&(object.castShadow||object.receiveShadow&&type===VSMShadowMap)&&(!object.frustumCulled||_frustum.intersectsObject(object))){object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse,object.matrixWorld);const geometry=_objects.update(object),material=object.material;if(Array.isArray(material)){const groups=geometry.groups;for(let k=0,kl=groups.length;k_maxTextureSize||_shadowMapSize.y>_maxTextureSize)&&(_shadowMapSize.x>_maxTextureSize&&(_viewportSize.x=Math.floor(_maxTextureSize/shadowFrameExtents.x),_shadowMapSize.x=_viewportSize.x*shadowFrameExtents.x,shadow.mapSize.x=_viewportSize.x),_shadowMapSize.y>_maxTextureSize&&(_viewportSize.y=Math.floor(_maxTextureSize/shadowFrameExtents.y),_shadowMapSize.y=_viewportSize.y*shadowFrameExtents.y,shadow.mapSize.y=_viewportSize.y)),null===shadow.map||!0===toVSM||!0===fromVSM){const pars=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};null!==shadow.map&&shadow.map.dispose(),shadow.map=new WebGLRenderTarget(_shadowMapSize.x,_shadowMapSize.y,pars),shadow.map.texture.name=light.name+".shadowMap",shadow.camera.updateProjectionMatrix()}_renderer.setRenderTarget(shadow.map),_renderer.clear();const viewportCount=shadow.getViewportCount();for(let vp=0;vp=1):-1!==glVersion.indexOf("OpenGL ES")&&(version=parseFloat(/^OpenGL ES (\d)/.exec(glVersion)[1]),lineWidthAvailable=version>=2);let currentTextureSlot=null,currentBoundTextures={};const scissorParam=gl.getParameter(gl.SCISSOR_BOX),viewportParam=gl.getParameter(gl.VIEWPORT),currentScissor=(new Vector4).fromArray(scissorParam),currentViewport=(new Vector4).fromArray(viewportParam);function createTexture(type,target,count,dimensions){const data=new Uint8Array(4),texture=gl.createTexture();gl.bindTexture(type,texture),gl.texParameteri(type,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(type,gl.TEXTURE_MAG_FILTER,gl.NEAREST);for(let i=0;imaxSize||image.height>maxSize)&&(scale=maxSize/Math.max(image.width,image.height)),scale<1||!0===needsPowerOfTwo){if("undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&image instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&image instanceof ImageBitmap){const floor=needsPowerOfTwo?floorPowerOfTwo:Math.floor,width=floor(scale*image.width),height=floor(scale*image.height);void 0===_canvas&&(_canvas=createCanvas(width,height));const canvas=needsNewCanvas?createCanvas(width,height):_canvas;canvas.width=width,canvas.height=height;return canvas.getContext("2d").drawImage(image,0,0,width,height),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+image.width+"x"+image.height+") to ("+width+"x"+height+")."),canvas}return"data"in image&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+image.width+"x"+image.height+")."),image}return image}function isPowerOfTwo$1(image){return isPowerOfTwo(image.width)&&isPowerOfTwo(image.height)}function textureNeedsGenerateMipmaps(texture,supportsMips){return texture.generateMipmaps&&supportsMips&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter}function generateMipmap(target){_gl.generateMipmap(target)}function getInternalFormat(internalFormatName,glFormat,glType,colorSpace,forceLinearTransfer=!1){if(!1===isWebGL2)return glFormat;if(null!==internalFormatName){if(void 0!==_gl[internalFormatName])return _gl[internalFormatName];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+internalFormatName+"'")}let internalFormat=glFormat;return glFormat===_gl.RED&&(glType===_gl.FLOAT&&(internalFormat=_gl.R32F),glType===_gl.HALF_FLOAT&&(internalFormat=_gl.R16F),glType===_gl.UNSIGNED_BYTE&&(internalFormat=_gl.R8)),glFormat===_gl.RG&&(glType===_gl.FLOAT&&(internalFormat=_gl.RG32F),glType===_gl.HALF_FLOAT&&(internalFormat=_gl.RG16F),glType===_gl.UNSIGNED_BYTE&&(internalFormat=_gl.RG8)),glFormat===_gl.RGBA&&(glType===_gl.FLOAT&&(internalFormat=_gl.RGBA32F),glType===_gl.HALF_FLOAT&&(internalFormat=_gl.RGBA16F),glType===_gl.UNSIGNED_BYTE&&(internalFormat=colorSpace===SRGBColorSpace&&!1===forceLinearTransfer?_gl.SRGB8_ALPHA8:_gl.RGBA8),glType===_gl.UNSIGNED_SHORT_4_4_4_4&&(internalFormat=_gl.RGBA4),glType===_gl.UNSIGNED_SHORT_5_5_5_1&&(internalFormat=_gl.RGB5_A1)),internalFormat!==_gl.R16F&&internalFormat!==_gl.R32F&&internalFormat!==_gl.RG16F&&internalFormat!==_gl.RG32F&&internalFormat!==_gl.RGBA16F&&internalFormat!==_gl.RGBA32F||extensions.get("EXT_color_buffer_float"),internalFormat}function getMipLevels(texture,image,supportsMips){return!0===textureNeedsGenerateMipmaps(texture,supportsMips)||texture.isFramebufferTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter?Math.log2(Math.max(image.width,image.height))+1:void 0!==texture.mipmaps&&texture.mipmaps.length>0?texture.mipmaps.length:texture.isCompressedTexture&&Array.isArray(texture.image)?image.mipmaps.length:1}function filterFallback(f){return f===NearestFilter||f===NearestMipmapNearestFilter||f===NearestMipmapLinearFilter?_gl.NEAREST:_gl.LINEAR}function onTextureDispose(event){const texture=event.target;texture.removeEventListener("dispose",onTextureDispose),function deallocateTexture(texture){const textureProperties=properties.get(texture);if(void 0===textureProperties.__webglInit)return;const source=texture.source,webglTextures=_sources.get(source);if(webglTextures){const webglTexture=webglTextures[textureProperties.__cacheKey];webglTexture.usedTimes--,0===webglTexture.usedTimes&&deleteTexture(texture),0===Object.keys(webglTextures).length&&_sources.delete(source)}properties.remove(texture)}(texture),texture.isVideoTexture&&_videoTextures.delete(texture)}function onRenderTargetDispose(event){const renderTarget=event.target;renderTarget.removeEventListener("dispose",onRenderTargetDispose),function deallocateRenderTarget(renderTarget){const texture=renderTarget.texture,renderTargetProperties=properties.get(renderTarget),textureProperties=properties.get(texture);void 0!==textureProperties.__webglTexture&&(_gl.deleteTexture(textureProperties.__webglTexture),info.memory.textures--);renderTarget.depthTexture&&renderTarget.depthTexture.dispose();if(renderTarget.isWebGLCubeRenderTarget)for(let i=0;i<6;i++)_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]),renderTargetProperties.__webglDepthbuffer&&_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]);else{if(_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer),renderTargetProperties.__webglDepthbuffer&&_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer),renderTargetProperties.__webglMultisampledFramebuffer&&_gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer),renderTargetProperties.__webglColorRenderbuffer)for(let i=0;i0&&textureProperties.__version!==texture.version){const image=texture.image;if(null===image)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==image.complete)return void uploadTexture(textureProperties,texture,slot);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}state.bindTexture(_gl.TEXTURE_2D,textureProperties.__webglTexture,_gl.TEXTURE0+slot)}const wrappingToGL={[RepeatWrapping]:_gl.REPEAT,[ClampToEdgeWrapping]:_gl.CLAMP_TO_EDGE,[MirroredRepeatWrapping]:_gl.MIRRORED_REPEAT},filterToGL={[NearestFilter]:_gl.NEAREST,[NearestMipmapNearestFilter]:_gl.NEAREST_MIPMAP_NEAREST,[NearestMipmapLinearFilter]:_gl.NEAREST_MIPMAP_LINEAR,[LinearFilter]:_gl.LINEAR,[LinearMipmapNearestFilter]:_gl.LINEAR_MIPMAP_NEAREST,[LinearMipmapLinearFilter]:_gl.LINEAR_MIPMAP_LINEAR},compareToGL={[NeverCompare]:_gl.NEVER,[AlwaysCompare]:_gl.ALWAYS,[LessCompare]:_gl.LESS,[LessEqualCompare]:_gl.LEQUAL,[EqualCompare]:_gl.EQUAL,[GreaterEqualCompare]:_gl.GEQUAL,[GreaterCompare]:_gl.GREATER,[NotEqualCompare]:_gl.NOTEQUAL};function setTextureParameters(textureType,texture,supportsMips){if(supportsMips?(_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_S,wrappingToGL[texture.wrapS]),_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_T,wrappingToGL[texture.wrapT]),textureType!==_gl.TEXTURE_3D&&textureType!==_gl.TEXTURE_2D_ARRAY||_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_R,wrappingToGL[texture.wrapR]),_gl.texParameteri(textureType,_gl.TEXTURE_MAG_FILTER,filterToGL[texture.magFilter]),_gl.texParameteri(textureType,_gl.TEXTURE_MIN_FILTER,filterToGL[texture.minFilter])):(_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_S,_gl.CLAMP_TO_EDGE),_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_T,_gl.CLAMP_TO_EDGE),textureType!==_gl.TEXTURE_3D&&textureType!==_gl.TEXTURE_2D_ARRAY||_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_R,_gl.CLAMP_TO_EDGE),texture.wrapS===ClampToEdgeWrapping&&texture.wrapT===ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),_gl.texParameteri(textureType,_gl.TEXTURE_MAG_FILTER,filterFallback(texture.magFilter)),_gl.texParameteri(textureType,_gl.TEXTURE_MIN_FILTER,filterFallback(texture.minFilter)),texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),texture.compareFunction&&(_gl.texParameteri(textureType,_gl.TEXTURE_COMPARE_MODE,_gl.COMPARE_REF_TO_TEXTURE),_gl.texParameteri(textureType,_gl.TEXTURE_COMPARE_FUNC,compareToGL[texture.compareFunction])),!0===extensions.has("EXT_texture_filter_anisotropic")){const extension=extensions.get("EXT_texture_filter_anisotropic");if(texture.magFilter===NearestFilter)return;if(texture.minFilter!==NearestMipmapLinearFilter&&texture.minFilter!==LinearMipmapLinearFilter)return;if(texture.type===FloatType&&!1===extensions.has("OES_texture_float_linear"))return;if(!1===isWebGL2&&texture.type===HalfFloatType&&!1===extensions.has("OES_texture_half_float_linear"))return;(texture.anisotropy>1||properties.get(texture).__currentAnisotropy)&&(_gl.texParameterf(textureType,extension.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(texture.anisotropy,capabilities.getMaxAnisotropy())),properties.get(texture).__currentAnisotropy=texture.anisotropy)}}function initTexture(textureProperties,texture){let forceUpload=!1;void 0===textureProperties.__webglInit&&(textureProperties.__webglInit=!0,texture.addEventListener("dispose",onTextureDispose));const source=texture.source;let webglTextures=_sources.get(source);void 0===webglTextures&&(webglTextures={},_sources.set(source,webglTextures));const textureCacheKey=function getTextureCacheKey(texture){const array=[];return array.push(texture.wrapS),array.push(texture.wrapT),array.push(texture.wrapR||0),array.push(texture.magFilter),array.push(texture.minFilter),array.push(texture.anisotropy),array.push(texture.internalFormat),array.push(texture.format),array.push(texture.type),array.push(texture.generateMipmaps),array.push(texture.premultiplyAlpha),array.push(texture.flipY),array.push(texture.unpackAlignment),array.push(texture.colorSpace),array.join()}(texture);if(textureCacheKey!==textureProperties.__cacheKey){void 0===webglTextures[textureCacheKey]&&(webglTextures[textureCacheKey]={texture:_gl.createTexture(),usedTimes:0},info.memory.textures++,forceUpload=!0),webglTextures[textureCacheKey].usedTimes++;const webglTexture=webglTextures[textureProperties.__cacheKey];void 0!==webglTexture&&(webglTextures[textureProperties.__cacheKey].usedTimes--,0===webglTexture.usedTimes&&deleteTexture(texture)),textureProperties.__cacheKey=textureCacheKey,textureProperties.__webglTexture=webglTextures[textureCacheKey].texture}return forceUpload}function uploadTexture(textureProperties,texture,slot){let textureType=_gl.TEXTURE_2D;(texture.isDataArrayTexture||texture.isCompressedArrayTexture)&&(textureType=_gl.TEXTURE_2D_ARRAY),texture.isData3DTexture&&(textureType=_gl.TEXTURE_3D);const forceUpload=initTexture(textureProperties,texture),source=texture.source;state.bindTexture(textureType,textureProperties.__webglTexture,_gl.TEXTURE0+slot);const sourceProperties=properties.get(source);if(source.version!==sourceProperties.__version||!0===forceUpload){state.activeTexture(_gl.TEXTURE0+slot),_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,texture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,texture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,texture.unpackAlignment),_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,_gl.NONE);const needsPowerOfTwo=function textureNeedsPowerOfTwo(texture){return!isWebGL2&&(texture.wrapS!==ClampToEdgeWrapping||texture.wrapT!==ClampToEdgeWrapping||texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter)}(texture)&&!1===isPowerOfTwo$1(texture.image);let image=resizeImage(texture.image,needsPowerOfTwo,!1,maxTextureSize);image=verifyColorSpace(texture,image);const supportsMips=isPowerOfTwo$1(image)||isWebGL2,glFormat=utils.convert(texture.format,texture.colorSpace);let mipmap,glType=utils.convert(texture.type),glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.colorSpace);setTextureParameters(textureType,texture,supportsMips);const mipmaps=texture.mipmaps,useTexStorage=isWebGL2&&!0!==texture.isVideoTexture,allocateMemory=void 0===sourceProperties.__version||!0===forceUpload,levels=getMipLevels(texture,image,supportsMips);if(texture.isDepthTexture)glInternalFormat=_gl.DEPTH_COMPONENT,isWebGL2?glInternalFormat=texture.type===FloatType?_gl.DEPTH_COMPONENT32F:texture.type===UnsignedIntType?_gl.DEPTH_COMPONENT24:texture.type===UnsignedInt248Type?_gl.DEPTH24_STENCIL8:_gl.DEPTH_COMPONENT16:texture.type===FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),texture.format===DepthFormat&&glInternalFormat===_gl.DEPTH_COMPONENT&&texture.type!==UnsignedShortType&&texture.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),texture.type=UnsignedIntType,glType=utils.convert(texture.type)),texture.format===DepthStencilFormat&&glInternalFormat===_gl.DEPTH_COMPONENT&&(glInternalFormat=_gl.DEPTH_STENCIL,texture.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),texture.type=UnsignedInt248Type,glType=utils.convert(texture.type))),allocateMemory&&(useTexStorage?state.texStorage2D(_gl.TEXTURE_2D,1,glInternalFormat,image.width,image.height):state.texImage2D(_gl.TEXTURE_2D,0,glInternalFormat,image.width,image.height,0,glFormat,glType,null));else if(texture.isDataTexture)if(mipmaps.length>0&&supportsMips){useTexStorage&&allocateMemory&&state.texStorage2D(_gl.TEXTURE_2D,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);for(let i=0,il=mipmaps.length;i>=1,height>>=1}}else if(mipmaps.length>0&&supportsMips){useTexStorage&&allocateMemory&&state.texStorage2D(_gl.TEXTURE_2D,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);for(let i=0,il=mipmaps.length;i=_gl.TEXTURE_CUBE_MAP_POSITIVE_X&&textureTarget<=_gl.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&_gl.framebufferTexture2D(_gl.FRAMEBUFFER,attachment,textureTarget,properties.get(texture).__webglTexture,0),state.bindFramebuffer(_gl.FRAMEBUFFER,null)}function setupRenderBufferStorage(renderbuffer,renderTarget,isMultisample){if(_gl.bindRenderbuffer(_gl.RENDERBUFFER,renderbuffer),renderTarget.depthBuffer&&!renderTarget.stencilBuffer){let glInternalFormat=_gl.DEPTH_COMPONENT16;if(isMultisample||useMultisampledRTT(renderTarget)){const depthTexture=renderTarget.depthTexture;depthTexture&&depthTexture.isDepthTexture&&(depthTexture.type===FloatType?glInternalFormat=_gl.DEPTH_COMPONENT32F:depthTexture.type===UnsignedIntType&&(glInternalFormat=_gl.DEPTH_COMPONENT24));const samples=getRenderTargetSamples(renderTarget);useMultisampledRTT(renderTarget)?multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER,samples,glInternalFormat,renderTarget.width,renderTarget.height):_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER,samples,glInternalFormat,renderTarget.width,renderTarget.height)}else _gl.renderbufferStorage(_gl.RENDERBUFFER,glInternalFormat,renderTarget.width,renderTarget.height);_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER,_gl.DEPTH_ATTACHMENT,_gl.RENDERBUFFER,renderbuffer)}else if(renderTarget.depthBuffer&&renderTarget.stencilBuffer){const samples=getRenderTargetSamples(renderTarget);isMultisample&&!1===useMultisampledRTT(renderTarget)?_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER,samples,_gl.DEPTH24_STENCIL8,renderTarget.width,renderTarget.height):useMultisampledRTT(renderTarget)?multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER,samples,_gl.DEPTH24_STENCIL8,renderTarget.width,renderTarget.height):_gl.renderbufferStorage(_gl.RENDERBUFFER,_gl.DEPTH_STENCIL,renderTarget.width,renderTarget.height),_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER,_gl.DEPTH_STENCIL_ATTACHMENT,_gl.RENDERBUFFER,renderbuffer)}else{const textures=!0===renderTarget.isWebGLMultipleRenderTargets?renderTarget.texture:[renderTarget.texture];for(let i=0;i0&&!0===extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==renderTargetProperties.__useRenderToTexture}function verifyColorSpace(texture,image){const colorSpace=texture.colorSpace,format=texture.format,type=texture.type;return!0===texture.isCompressedTexture||texture.format===_SRGBAFormat||colorSpace!==LinearSRGBColorSpace&&colorSpace!==NoColorSpace&&(colorSpace===SRGBColorSpace?!1===isWebGL2?!0===extensions.has("EXT_sRGB")&&format===RGBAFormat?(texture.format=_SRGBAFormat,texture.minFilter=LinearFilter,texture.generateMipmaps=!1):image=ImageUtils.sRGBToLinear(image):format===RGBAFormat&&type===UnsignedByteType||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",colorSpace)),image}this.allocateTextureUnit=function allocateTextureUnit(){const textureUnit=textureUnits;return textureUnit>=maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+textureUnit+" texture units while this GPU supports only "+maxTextures),textureUnits+=1,textureUnit},this.resetTextureUnits=function resetTextureUnits(){textureUnits=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function setTexture2DArray(texture,slot){const textureProperties=properties.get(texture);texture.version>0&&textureProperties.__version!==texture.version?uploadTexture(textureProperties,texture,slot):state.bindTexture(_gl.TEXTURE_2D_ARRAY,textureProperties.__webglTexture,_gl.TEXTURE0+slot)},this.setTexture3D=function setTexture3D(texture,slot){const textureProperties=properties.get(texture);texture.version>0&&textureProperties.__version!==texture.version?uploadTexture(textureProperties,texture,slot):state.bindTexture(_gl.TEXTURE_3D,textureProperties.__webglTexture,_gl.TEXTURE0+slot)},this.setTextureCube=function setTextureCube(texture,slot){const textureProperties=properties.get(texture);texture.version>0&&textureProperties.__version!==texture.version?function uploadCubeTexture(textureProperties,texture,slot){if(6!==texture.image.length)return;const forceUpload=initTexture(textureProperties,texture),source=texture.source;state.bindTexture(_gl.TEXTURE_CUBE_MAP,textureProperties.__webglTexture,_gl.TEXTURE0+slot);const sourceProperties=properties.get(source);if(source.version!==sourceProperties.__version||!0===forceUpload){state.activeTexture(_gl.TEXTURE0+slot),_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,texture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,texture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,texture.unpackAlignment),_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,_gl.NONE);const isCompressed=texture.isCompressedTexture||texture.image[0].isCompressedTexture,isDataTexture=texture.image[0]&&texture.image[0].isDataTexture,cubeImage=[];for(let i=0;i<6;i++)cubeImage[i]=isCompressed||isDataTexture?isDataTexture?texture.image[i].image:texture.image[i]:resizeImage(texture.image[i],!1,!0,maxCubemapSize),cubeImage[i]=verifyColorSpace(texture,cubeImage[i]);const image=cubeImage[0],supportsMips=isPowerOfTwo$1(image)||isWebGL2,glFormat=utils.convert(texture.format,texture.colorSpace),glType=utils.convert(texture.type),glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.colorSpace),useTexStorage=isWebGL2&&!0!==texture.isVideoTexture,allocateMemory=void 0===sourceProperties.__version||!0===forceUpload;let mipmaps,levels=getMipLevels(texture,image,supportsMips);if(setTextureParameters(_gl.TEXTURE_CUBE_MAP,texture,supportsMips),isCompressed){useTexStorage&&allocateMemory&&state.texStorage2D(_gl.TEXTURE_CUBE_MAP,levels,glInternalFormat,image.width,image.height);for(let i=0;i<6;i++){mipmaps=cubeImage[i].mipmaps;for(let j=0;j0&&levels++,state.texStorage2D(_gl.TEXTURE_CUBE_MAP,levels,glInternalFormat,cubeImage[0].width,cubeImage[0].height));for(let i=0;i<6;i++)if(isDataTexture){useTexStorage?state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,cubeImage[i].width,cubeImage[i].height,glFormat,glType,cubeImage[i].data):state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,glInternalFormat,cubeImage[i].width,cubeImage[i].height,0,glFormat,glType,cubeImage[i].data);for(let j=0;j0&&!1===useMultisampledRTT(renderTarget)){const textures=isMultipleRenderTargets?texture:[texture];renderTargetProperties.__webglMultisampledFramebuffer=_gl.createFramebuffer(),renderTargetProperties.__webglColorRenderbuffer=[],state.bindFramebuffer(_gl.FRAMEBUFFER,renderTargetProperties.__webglMultisampledFramebuffer);for(let i=0;i0&&!1===useMultisampledRTT(renderTarget)){const textures=renderTarget.isWebGLMultipleRenderTargets?renderTarget.texture:[renderTarget.texture],width=renderTarget.width,height=renderTarget.height;let mask=_gl.COLOR_BUFFER_BIT;const invalidationArray=[],depthStyle=renderTarget.stencilBuffer?_gl.DEPTH_STENCIL_ATTACHMENT:_gl.DEPTH_ATTACHMENT,renderTargetProperties=properties.get(renderTarget),isMultipleRenderTargets=!0===renderTarget.isWebGLMultipleRenderTargets;if(isMultipleRenderTargets)for(let i=0;idistanceToPinch+threshold?(hand.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:inputSource.handedness,target:this})):!hand.inputState.pinching&&distance<=distanceToPinch-threshold&&(hand.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:inputSource.handedness,target:this}))}else null!==grip&&inputSource.gripSpace&&(gripPose=frame.getPose(inputSource.gripSpace,referenceSpace),null!==gripPose&&(grip.matrix.fromArray(gripPose.transform.matrix),grip.matrix.decompose(grip.position,grip.rotation,grip.scale),grip.matrixWorldNeedsUpdate=!0,gripPose.linearVelocity?(grip.hasLinearVelocity=!0,grip.linearVelocity.copy(gripPose.linearVelocity)):grip.hasLinearVelocity=!1,gripPose.angularVelocity?(grip.hasAngularVelocity=!0,grip.angularVelocity.copy(gripPose.angularVelocity)):grip.hasAngularVelocity=!1));null!==targetRay&&(inputPose=frame.getPose(inputSource.targetRaySpace,referenceSpace),null===inputPose&&null!==gripPose&&(inputPose=gripPose),null!==inputPose&&(targetRay.matrix.fromArray(inputPose.transform.matrix),targetRay.matrix.decompose(targetRay.position,targetRay.rotation,targetRay.scale),targetRay.matrixWorldNeedsUpdate=!0,inputPose.linearVelocity?(targetRay.hasLinearVelocity=!0,targetRay.linearVelocity.copy(inputPose.linearVelocity)):targetRay.hasLinearVelocity=!1,inputPose.angularVelocity?(targetRay.hasAngularVelocity=!0,targetRay.angularVelocity.copy(inputPose.angularVelocity)):targetRay.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return null!==targetRay&&(targetRay.visible=null!==inputPose),null!==grip&&(grip.visible=null!==gripPose),null!==hand&&(hand.visible=null!==handPose),this}_getHandJoint(hand,inputjoint){if(void 0===hand.joints[inputjoint.jointName]){const joint=new Group;joint.matrixAutoUpdate=!1,joint.visible=!1,hand.joints[inputjoint.jointName]=joint,hand.add(joint)}return hand.joints[inputjoint.jointName]}}class DepthTexture extends Texture{constructor(width,height,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,format){if((format=void 0!==format?format:DepthFormat)!==DepthFormat&&format!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===type&&format===DepthFormat&&(type=UnsignedIntType),void 0===type&&format===DepthStencilFormat&&(type=UnsignedInt248Type),super(null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy),this.isDepthTexture=!0,this.image={width:width,height:height},this.magFilter=void 0!==magFilter?magFilter:NearestFilter,this.minFilter=void 0!==minFilter?minFilter:NearestFilter,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(source){return super.copy(source),this.compareFunction=source.compareFunction,this}toJSON(meta){const data=super.toJSON(meta);return null!==this.compareFunction&&(data.compareFunction=this.compareFunction),data}}class WebXRManager extends EventDispatcher{constructor(renderer,gl){super();const scope=this;let session=null,framebufferScaleFactor=1,referenceSpace=null,referenceSpaceType="local-floor",foveation=1,customReferenceSpace=null,pose=null,glBinding=null,glProjLayer=null,glBaseLayer=null,xrFrame=null;const attributes=gl.getContextAttributes();let initialRenderTarget=null,newRenderTarget=null;const controllers=[],controllerInputSources=[],cameraL=new PerspectiveCamera;cameraL.layers.enable(1),cameraL.viewport=new Vector4;const cameraR=new PerspectiveCamera;cameraR.layers.enable(2),cameraR.viewport=new Vector4;const cameras=[cameraL,cameraR],cameraXR=new ArrayCamera;cameraXR.layers.enable(1),cameraXR.layers.enable(2);let _currentDepthNear=null,_currentDepthFar=null;function onSessionEvent(event){const controllerIndex=controllerInputSources.indexOf(event.inputSource);if(-1===controllerIndex)return;const controller=controllers[controllerIndex];void 0!==controller&&(controller.update(event.inputSource,event.frame,customReferenceSpace||referenceSpace),controller.dispatchEvent({type:event.type,data:event.inputSource}))}function onSessionEnd(){session.removeEventListener("select",onSessionEvent),session.removeEventListener("selectstart",onSessionEvent),session.removeEventListener("selectend",onSessionEvent),session.removeEventListener("squeeze",onSessionEvent),session.removeEventListener("squeezestart",onSessionEvent),session.removeEventListener("squeezeend",onSessionEvent),session.removeEventListener("end",onSessionEnd),session.removeEventListener("inputsourceschange",onInputSourcesChange);for(let i=0;i=0&&(controllerInputSources[index]=null,controllers[index].disconnect(inputSource))}for(let i=0;i=controllerInputSources.length){controllerInputSources.push(inputSource),controllerIndex=i;break}if(null===controllerInputSources[i]){controllerInputSources[i]=inputSource,controllerIndex=i;break}}if(-1===controllerIndex)break}const controller=controllers[controllerIndex];controller&&controller.connect(inputSource)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(index){let controller=controllers[index];return void 0===controller&&(controller=new WebXRController,controllers[index]=controller),controller.getTargetRaySpace()},this.getControllerGrip=function(index){let controller=controllers[index];return void 0===controller&&(controller=new WebXRController,controllers[index]=controller),controller.getGripSpace()},this.getHand=function(index){let controller=controllers[index];return void 0===controller&&(controller=new WebXRController,controllers[index]=controller),controller.getHandSpace()},this.setFramebufferScaleFactor=function(value){framebufferScaleFactor=value,!0===scope.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(value){referenceSpaceType=value,!0===scope.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return customReferenceSpace||referenceSpace},this.setReferenceSpace=function(space){customReferenceSpace=space},this.getBaseLayer=function(){return null!==glProjLayer?glProjLayer:glBaseLayer},this.getBinding=function(){return glBinding},this.getFrame=function(){return xrFrame},this.getSession=function(){return session},this.setSession=async function(value){if(session=value,null!==session){if(initialRenderTarget=renderer.getRenderTarget(),session.addEventListener("select",onSessionEvent),session.addEventListener("selectstart",onSessionEvent),session.addEventListener("selectend",onSessionEvent),session.addEventListener("squeeze",onSessionEvent),session.addEventListener("squeezestart",onSessionEvent),session.addEventListener("squeezeend",onSessionEvent),session.addEventListener("end",onSessionEnd),session.addEventListener("inputsourceschange",onInputSourcesChange),!0!==attributes.xrCompatible&&await gl.makeXRCompatible(),void 0===session.renderState.layers||!1===renderer.capabilities.isWebGL2){const layerInit={antialias:void 0!==session.renderState.layers||attributes.antialias,alpha:!0,depth:attributes.depth,stencil:attributes.stencil,framebufferScaleFactor:framebufferScaleFactor};glBaseLayer=new XRWebGLLayer(session,gl,layerInit),session.updateRenderState({baseLayer:glBaseLayer}),newRenderTarget=new WebGLRenderTarget(glBaseLayer.framebufferWidth,glBaseLayer.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,colorSpace:renderer.outputColorSpace,stencilBuffer:attributes.stencil})}else{let depthFormat=null,depthType=null,glDepthFormat=null;attributes.depth&&(glDepthFormat=attributes.stencil?gl.DEPTH24_STENCIL8:gl.DEPTH_COMPONENT24,depthFormat=attributes.stencil?DepthStencilFormat:DepthFormat,depthType=attributes.stencil?UnsignedInt248Type:UnsignedIntType);const projectionlayerInit={colorFormat:gl.RGBA8,depthFormat:glDepthFormat,scaleFactor:framebufferScaleFactor};glBinding=new XRWebGLBinding(session,gl),glProjLayer=glBinding.createProjectionLayer(projectionlayerInit),session.updateRenderState({layers:[glProjLayer]}),newRenderTarget=new WebGLRenderTarget(glProjLayer.textureWidth,glProjLayer.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(glProjLayer.textureWidth,glProjLayer.textureHeight,depthType,void 0,void 0,void 0,void 0,void 0,void 0,depthFormat),stencilBuffer:attributes.stencil,colorSpace:renderer.outputColorSpace,samples:attributes.antialias?4:0});renderer.properties.get(newRenderTarget).__ignoreDepthValues=glProjLayer.ignoreDepthValues}newRenderTarget.isXRRenderTarget=!0,this.setFoveation(foveation),customReferenceSpace=null,referenceSpace=await session.requestReferenceSpace(referenceSpaceType),animation.setContext(session),animation.start(),scope.isPresenting=!0,scope.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==session)return session.environmentBlendMode};const cameraLPos=new Vector3,cameraRPos=new Vector3;function updateCamera(camera,parent){null===parent?camera.matrixWorld.copy(camera.matrix):camera.matrixWorld.multiplyMatrices(parent.matrixWorld,camera.matrix),camera.matrixWorldInverse.copy(camera.matrixWorld).invert()}this.updateCamera=function(camera){if(null===session)return;cameraXR.near=cameraR.near=cameraL.near=camera.near,cameraXR.far=cameraR.far=cameraL.far=camera.far,_currentDepthNear===cameraXR.near&&_currentDepthFar===cameraXR.far||(session.updateRenderState({depthNear:cameraXR.near,depthFar:cameraXR.far}),_currentDepthNear=cameraXR.near,_currentDepthFar=cameraXR.far);const parent=camera.parent,cameras=cameraXR.cameras;updateCamera(cameraXR,parent);for(let i=0;i0&&(uniforms.alphaTest.value=material.alphaTest);const envMap=properties.get(material).envMap;if(envMap&&(uniforms.envMap.value=envMap,uniforms.flipEnvMap.value=envMap.isCubeTexture&&!1===envMap.isRenderTargetTexture?-1:1,uniforms.reflectivity.value=material.reflectivity,uniforms.ior.value=material.ior,uniforms.refractionRatio.value=material.refractionRatio),material.lightMap){uniforms.lightMap.value=material.lightMap;const scaleFactor=!0===renderer.useLegacyLights?Math.PI:1;uniforms.lightMapIntensity.value=material.lightMapIntensity*scaleFactor,refreshTransformUniform(material.lightMap,uniforms.lightMapTransform)}material.aoMap&&(uniforms.aoMap.value=material.aoMap,uniforms.aoMapIntensity.value=material.aoMapIntensity,refreshTransformUniform(material.aoMap,uniforms.aoMapTransform))}return{refreshFogUniforms:function refreshFogUniforms(uniforms,fog){fog.color.getRGB(uniforms.fogColor.value,getUnlitUniformColorSpace(renderer)),fog.isFog?(uniforms.fogNear.value=fog.near,uniforms.fogFar.value=fog.far):fog.isFogExp2&&(uniforms.fogDensity.value=fog.density)},refreshMaterialUniforms:function refreshMaterialUniforms(uniforms,material,pixelRatio,height,transmissionRenderTarget){material.isMeshBasicMaterial||material.isMeshLambertMaterial?refreshUniformsCommon(uniforms,material):material.isMeshToonMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsToon(uniforms,material){material.gradientMap&&(uniforms.gradientMap.value=material.gradientMap)}(uniforms,material)):material.isMeshPhongMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsPhong(uniforms,material){uniforms.specular.value.copy(material.specular),uniforms.shininess.value=Math.max(material.shininess,1e-4)}(uniforms,material)):material.isMeshStandardMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsStandard(uniforms,material){uniforms.metalness.value=material.metalness,material.metalnessMap&&(uniforms.metalnessMap.value=material.metalnessMap,refreshTransformUniform(material.metalnessMap,uniforms.metalnessMapTransform));uniforms.roughness.value=material.roughness,material.roughnessMap&&(uniforms.roughnessMap.value=material.roughnessMap,refreshTransformUniform(material.roughnessMap,uniforms.roughnessMapTransform));const envMap=properties.get(material).envMap;envMap&&(uniforms.envMapIntensity.value=material.envMapIntensity)}(uniforms,material),material.isMeshPhysicalMaterial&&function refreshUniformsPhysical(uniforms,material,transmissionRenderTarget){uniforms.ior.value=material.ior,material.sheen>0&&(uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen),uniforms.sheenRoughness.value=material.sheenRoughness,material.sheenColorMap&&(uniforms.sheenColorMap.value=material.sheenColorMap,refreshTransformUniform(material.sheenColorMap,uniforms.sheenColorMapTransform)),material.sheenRoughnessMap&&(uniforms.sheenRoughnessMap.value=material.sheenRoughnessMap,refreshTransformUniform(material.sheenRoughnessMap,uniforms.sheenRoughnessMapTransform)));material.clearcoat>0&&(uniforms.clearcoat.value=material.clearcoat,uniforms.clearcoatRoughness.value=material.clearcoatRoughness,material.clearcoatMap&&(uniforms.clearcoatMap.value=material.clearcoatMap,refreshTransformUniform(material.clearcoatMap,uniforms.clearcoatMapTransform)),material.clearcoatRoughnessMap&&(uniforms.clearcoatRoughnessMap.value=material.clearcoatRoughnessMap,refreshTransformUniform(material.clearcoatRoughnessMap,uniforms.clearcoatRoughnessMapTransform)),material.clearcoatNormalMap&&(uniforms.clearcoatNormalMap.value=material.clearcoatNormalMap,refreshTransformUniform(material.clearcoatNormalMap,uniforms.clearcoatNormalMapTransform),uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale),material.side===BackSide&&uniforms.clearcoatNormalScale.value.negate()));material.iridescence>0&&(uniforms.iridescence.value=material.iridescence,uniforms.iridescenceIOR.value=material.iridescenceIOR,uniforms.iridescenceThicknessMinimum.value=material.iridescenceThicknessRange[0],uniforms.iridescenceThicknessMaximum.value=material.iridescenceThicknessRange[1],material.iridescenceMap&&(uniforms.iridescenceMap.value=material.iridescenceMap,refreshTransformUniform(material.iridescenceMap,uniforms.iridescenceMapTransform)),material.iridescenceThicknessMap&&(uniforms.iridescenceThicknessMap.value=material.iridescenceThicknessMap,refreshTransformUniform(material.iridescenceThicknessMap,uniforms.iridescenceThicknessMapTransform)));material.transmission>0&&(uniforms.transmission.value=material.transmission,uniforms.transmissionSamplerMap.value=transmissionRenderTarget.texture,uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width,transmissionRenderTarget.height),material.transmissionMap&&(uniforms.transmissionMap.value=material.transmissionMap,refreshTransformUniform(material.transmissionMap,uniforms.transmissionMapTransform)),uniforms.thickness.value=material.thickness,material.thicknessMap&&(uniforms.thicknessMap.value=material.thicknessMap,refreshTransformUniform(material.thicknessMap,uniforms.thicknessMapTransform)),uniforms.attenuationDistance.value=material.attenuationDistance,uniforms.attenuationColor.value.copy(material.attenuationColor));material.anisotropy>0&&(uniforms.anisotropyVector.value.set(material.anisotropy*Math.cos(material.anisotropyRotation),material.anisotropy*Math.sin(material.anisotropyRotation)),material.anisotropyMap&&(uniforms.anisotropyMap.value=material.anisotropyMap,refreshTransformUniform(material.anisotropyMap,uniforms.anisotropyMapTransform)));uniforms.specularIntensity.value=material.specularIntensity,uniforms.specularColor.value.copy(material.specularColor),material.specularColorMap&&(uniforms.specularColorMap.value=material.specularColorMap,refreshTransformUniform(material.specularColorMap,uniforms.specularColorMapTransform));material.specularIntensityMap&&(uniforms.specularIntensityMap.value=material.specularIntensityMap,refreshTransformUniform(material.specularIntensityMap,uniforms.specularIntensityMapTransform))}(uniforms,material,transmissionRenderTarget)):material.isMeshMatcapMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsMatcap(uniforms,material){material.matcap&&(uniforms.matcap.value=material.matcap)}(uniforms,material)):material.isMeshDepthMaterial?refreshUniformsCommon(uniforms,material):material.isMeshDistanceMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsDistance(uniforms,material){const light=properties.get(material).light;uniforms.referencePosition.value.setFromMatrixPosition(light.matrixWorld),uniforms.nearDistance.value=light.shadow.camera.near,uniforms.farDistance.value=light.shadow.camera.far}(uniforms,material)):material.isMeshNormalMaterial?refreshUniformsCommon(uniforms,material):material.isLineBasicMaterial?(!function refreshUniformsLine(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform))}(uniforms,material),material.isLineDashedMaterial&&function refreshUniformsDash(uniforms,material){uniforms.dashSize.value=material.dashSize,uniforms.totalSize.value=material.dashSize+material.gapSize,uniforms.scale.value=material.scale}(uniforms,material)):material.isPointsMaterial?function refreshUniformsPoints(uniforms,material,pixelRatio,height){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.size.value=material.size*pixelRatio,uniforms.scale.value=.5*height,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.uvTransform));material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform));material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}(uniforms,material,pixelRatio,height):material.isSpriteMaterial?function refreshUniformsSprites(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.rotation.value=material.rotation,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform));material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform));material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}(uniforms,material):material.isShadowMaterial?(uniforms.color.value.copy(material.color),uniforms.opacity.value=material.opacity):material.isShaderMaterial&&(material.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(gl,info,capabilities,state){let buffers={},updateList={},allocatedBindingPoints=[];const maxBindingPoints=capabilities.isWebGL2?gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS):0;function hasUniformChanged(uniform,index,cache){const value=uniform.value;if(void 0===cache[index]){if("number"==typeof value)cache[index]=value;else{const values=Array.isArray(value)?value:[value],tempValues=[];for(let i=0;i0){chunkOffset=offset%chunkSize;0!==chunkOffset&&chunkSize-chunkOffset-infos.boundary<0&&(offset+=chunkSize-chunkOffset,uniform.__offset=offset)}offset+=infos.storage}chunkOffset=offset%chunkSize,chunkOffset>0&&(offset+=chunkSize-chunkOffset);return uniformsGroup.__size=offset,uniformsGroup.__cache={},this}(uniformsGroup),buffer=function createBuffer(uniformsGroup){const bindingPointIndex=function allocateBindingPointIndex(){for(let i=0;i0),morphTargets=!!geometry.morphAttributes.position,morphNormals=!!geometry.morphAttributes.normal,morphColors=!!geometry.morphAttributes.color,toneMapping=material.toneMapped?_this.toneMapping:NoToneMapping,morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color,morphTargetsCount=void 0!==morphAttribute?morphAttribute.length:0,materialProperties=properties.get(material),lights=currentRenderState.state.lights;if(!0===_clippingEnabled&&(!0===_localClippingEnabled||camera!==_currentCamera)){const useCache=camera===_currentCamera&&material.id===_currentMaterialId;clipping.setState(material,camera,useCache)}let needsProgramChange=!1;material.version===materialProperties.__version?materialProperties.needsLights&&materialProperties.lightsStateVersion!==lights.state.version||materialProperties.outputColorSpace!==colorSpace||object.isInstancedMesh&&!1===materialProperties.instancing?needsProgramChange=!0:object.isInstancedMesh||!0!==materialProperties.instancing?object.isSkinnedMesh&&!1===materialProperties.skinning?needsProgramChange=!0:object.isSkinnedMesh||!0!==materialProperties.skinning?materialProperties.envMap!==envMap||!0===material.fog&&materialProperties.fog!==fog?needsProgramChange=!0:void 0===materialProperties.numClippingPlanes||materialProperties.numClippingPlanes===clipping.numPlanes&&materialProperties.numIntersection===clipping.numIntersection?(materialProperties.vertexAlphas!==vertexAlphas||materialProperties.vertexTangents!==vertexTangents||materialProperties.morphTargets!==morphTargets||materialProperties.morphNormals!==morphNormals||materialProperties.morphColors!==morphColors||materialProperties.toneMapping!==toneMapping||!0===capabilities.isWebGL2&&materialProperties.morphTargetsCount!==morphTargetsCount)&&(needsProgramChange=!0):needsProgramChange=!0:needsProgramChange=!0:needsProgramChange=!0:(needsProgramChange=!0,materialProperties.__version=material.version);let program=materialProperties.currentProgram;!0===needsProgramChange&&(program=getProgram(material,scene,object));let refreshProgram=!1,refreshMaterial=!1,refreshLights=!1;const p_uniforms=program.getUniforms(),m_uniforms=materialProperties.uniforms;state.useProgram(program.program)&&(refreshProgram=!0,refreshMaterial=!0,refreshLights=!0);material.id!==_currentMaterialId&&(_currentMaterialId=material.id,refreshMaterial=!0);if(refreshProgram||_currentCamera!==camera){if(p_uniforms.setValue(_gl,"projectionMatrix",camera.projectionMatrix),capabilities.logarithmicDepthBuffer&&p_uniforms.setValue(_gl,"logDepthBufFC",2/(Math.log(camera.far+1)/Math.LN2)),_currentCamera!==camera&&(_currentCamera=camera,refreshMaterial=!0,refreshLights=!0),material.isShaderMaterial||material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshStandardMaterial||material.envMap){const uCamPos=p_uniforms.map.cameraPosition;void 0!==uCamPos&&uCamPos.setValue(_gl,_vector3.setFromMatrixPosition(camera.matrixWorld))}(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial)&&p_uniforms.setValue(_gl,"isOrthographic",!0===camera.isOrthographicCamera),(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial||material.isShadowMaterial||object.isSkinnedMesh)&&p_uniforms.setValue(_gl,"viewMatrix",camera.matrixWorldInverse)}if(object.isSkinnedMesh){p_uniforms.setOptional(_gl,object,"bindMatrix"),p_uniforms.setOptional(_gl,object,"bindMatrixInverse");const skeleton=object.skeleton;skeleton&&(capabilities.floatVertexTextures?(null===skeleton.boneTexture&&skeleton.computeBoneTexture(),p_uniforms.setValue(_gl,"boneTexture",skeleton.boneTexture,textures),p_uniforms.setValue(_gl,"boneTextureSize",skeleton.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const morphAttributes=geometry.morphAttributes;(void 0!==morphAttributes.position||void 0!==morphAttributes.normal||void 0!==morphAttributes.color&&!0===capabilities.isWebGL2)&&morphtargets.update(object,geometry,program);(refreshMaterial||materialProperties.receiveShadow!==object.receiveShadow)&&(materialProperties.receiveShadow=object.receiveShadow,p_uniforms.setValue(_gl,"receiveShadow",object.receiveShadow));material.isMeshGouraudMaterial&&null!==material.envMap&&(m_uniforms.envMap.value=envMap,m_uniforms.flipEnvMap.value=envMap.isCubeTexture&&!1===envMap.isRenderTargetTexture?-1:1);refreshMaterial&&(p_uniforms.setValue(_gl,"toneMappingExposure",_this.toneMappingExposure),materialProperties.needsLights&&function markUniformsLightsNeedsUpdate(uniforms,value){uniforms.ambientLightColor.needsUpdate=value,uniforms.lightProbe.needsUpdate=value,uniforms.directionalLights.needsUpdate=value,uniforms.directionalLightShadows.needsUpdate=value,uniforms.pointLights.needsUpdate=value,uniforms.pointLightShadows.needsUpdate=value,uniforms.spotLights.needsUpdate=value,uniforms.spotLightShadows.needsUpdate=value,uniforms.rectAreaLights.needsUpdate=value,uniforms.hemisphereLights.needsUpdate=value}(m_uniforms,refreshLights),fog&&!0===material.fog&&materials.refreshFogUniforms(m_uniforms,fog),materials.refreshMaterialUniforms(m_uniforms,material,_pixelRatio,_height,_transmissionRenderTarget),WebGLUniforms.upload(_gl,materialProperties.uniformsList,m_uniforms,textures));material.isShaderMaterial&&!0===material.uniformsNeedUpdate&&(WebGLUniforms.upload(_gl,materialProperties.uniformsList,m_uniforms,textures),material.uniformsNeedUpdate=!1);material.isSpriteMaterial&&p_uniforms.setValue(_gl,"center",object.center);if(p_uniforms.setValue(_gl,"modelViewMatrix",object.modelViewMatrix),p_uniforms.setValue(_gl,"normalMatrix",object.normalMatrix),p_uniforms.setValue(_gl,"modelMatrix",object.matrixWorld),material.isShaderMaterial||material.isRawShaderMaterial){const groups=material.uniformsGroups;for(let i=0,l=groups.length;i0&&function renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera){const isWebGL2=capabilities.isWebGL2;null===_transmissionRenderTarget&&(_transmissionRenderTarget=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:extensions.has("EXT_color_buffer_half_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:isWebGL2?4:0}));_this.getDrawingBufferSize(_vector2),isWebGL2?_transmissionRenderTarget.setSize(_vector2.x,_vector2.y):_transmissionRenderTarget.setSize(floorPowerOfTwo(_vector2.x),floorPowerOfTwo(_vector2.y));const currentRenderTarget=_this.getRenderTarget();_this.setRenderTarget(_transmissionRenderTarget),_this.getClearColor(_currentClearColor),_currentClearAlpha=_this.getClearAlpha(),_currentClearAlpha<1&&_this.setClearColor(16777215,.5);_this.clear();const currentToneMapping=_this.toneMapping;_this.toneMapping=NoToneMapping,renderObjects(opaqueObjects,scene,camera),textures.updateMultisampleRenderTarget(_transmissionRenderTarget),textures.updateRenderTargetMipmap(_transmissionRenderTarget);let renderTargetNeedsUpdate=!1;for(let i=0,l=transmissiveObjects.length;i0&&renderObjects(opaqueObjects,scene,camera),transmissiveObjects.length>0&&renderObjects(transmissiveObjects,scene,camera),transparentObjects.length>0&&renderObjects(transparentObjects,scene,camera),state.buffers.depth.setTest(!0),state.buffers.depth.setMask(!0),state.buffers.color.setMask(!0),state.setPolygonOffset(!1)}function renderObjects(renderList,scene,camera){const overrideMaterial=!0===scene.isScene?scene.overrideMaterial:null;for(let i=0,l=renderList.length;i0?renderStateStack[renderStateStack.length-1]:null,renderListStack.pop(),currentRenderList=renderListStack.length>0?renderListStack[renderListStack.length-1]:null},this.getActiveCubeFace=function(){return _currentActiveCubeFace},this.getActiveMipmapLevel=function(){return _currentActiveMipmapLevel},this.getRenderTarget=function(){return _currentRenderTarget},this.setRenderTargetTextures=function(renderTarget,colorTexture,depthTexture){properties.get(renderTarget.texture).__webglTexture=colorTexture,properties.get(renderTarget.depthTexture).__webglTexture=depthTexture;const renderTargetProperties=properties.get(renderTarget);renderTargetProperties.__hasExternalTextures=!0,renderTargetProperties.__hasExternalTextures&&(renderTargetProperties.__autoAllocateDepthBuffer=void 0===depthTexture,renderTargetProperties.__autoAllocateDepthBuffer||!0===extensions.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),renderTargetProperties.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(renderTarget,defaultFramebuffer){const renderTargetProperties=properties.get(renderTarget);renderTargetProperties.__webglFramebuffer=defaultFramebuffer,renderTargetProperties.__useDefaultFramebuffer=void 0===defaultFramebuffer},this.setRenderTarget=function(renderTarget,activeCubeFace=0,activeMipmapLevel=0){_currentRenderTarget=renderTarget,_currentActiveCubeFace=activeCubeFace,_currentActiveMipmapLevel=activeMipmapLevel;let useDefaultFramebuffer=!0,framebuffer=null,isCube=!1,isRenderTarget3D=!1;if(renderTarget){const renderTargetProperties=properties.get(renderTarget);void 0!==renderTargetProperties.__useDefaultFramebuffer?(state.bindFramebuffer(_gl.FRAMEBUFFER,null),useDefaultFramebuffer=!1):void 0===renderTargetProperties.__webglFramebuffer?textures.setupRenderTarget(renderTarget):renderTargetProperties.__hasExternalTextures&&textures.rebindTextures(renderTarget,properties.get(renderTarget.texture).__webglTexture,properties.get(renderTarget.depthTexture).__webglTexture);const texture=renderTarget.texture;(texture.isData3DTexture||texture.isDataArrayTexture||texture.isCompressedArrayTexture)&&(isRenderTarget3D=!0);const __webglFramebuffer=properties.get(renderTarget).__webglFramebuffer;renderTarget.isWebGLCubeRenderTarget?(framebuffer=__webglFramebuffer[activeCubeFace],isCube=!0):framebuffer=capabilities.isWebGL2&&renderTarget.samples>0&&!1===textures.useMultisampledRTT(renderTarget)?properties.get(renderTarget).__webglMultisampledFramebuffer:__webglFramebuffer,_currentViewport.copy(renderTarget.viewport),_currentScissor.copy(renderTarget.scissor),_currentScissorTest=renderTarget.scissorTest}else _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(),_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(),_currentScissorTest=_scissorTest;if(state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer)&&capabilities.drawBuffers&&useDefaultFramebuffer&&state.drawBuffers(renderTarget,framebuffer),state.viewport(_currentViewport),state.scissor(_currentScissor),state.setScissorTest(_currentScissorTest),isCube){const textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_CUBE_MAP_POSITIVE_X+activeCubeFace,textureProperties.__webglTexture,activeMipmapLevel)}else if(isRenderTarget3D){const textureProperties=properties.get(renderTarget.texture),layer=activeCubeFace||0;_gl.framebufferTextureLayer(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,textureProperties.__webglTexture,activeMipmapLevel||0,layer)}_currentMaterialId=-1},this.readRenderTargetPixels=function(renderTarget,x,y,width,height,buffer,activeCubeFaceIndex){if(!renderTarget||!renderTarget.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&void 0!==activeCubeFaceIndex&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);try{const texture=renderTarget.texture,textureFormat=texture.format,textureType=texture.type;if(textureFormat!==RGBAFormat&&utils.convert(textureFormat)!==_gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const halfFloatSupportedByExt=textureType===HalfFloatType&&(extensions.has("EXT_color_buffer_half_float")||capabilities.isWebGL2&&extensions.has("EXT_color_buffer_float"));if(!(textureType===UnsignedByteType||utils.convert(textureType)===_gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_TYPE)||textureType===FloatType&&(capabilities.isWebGL2||extensions.has("OES_texture_float")||extensions.has("WEBGL_color_buffer_float"))||halfFloatSupportedByExt))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");x>=0&&x<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height&&_gl.readPixels(x,y,width,height,utils.convert(textureFormat),utils.convert(textureType),buffer)}finally{const framebuffer=null!==_currentRenderTarget?properties.get(_currentRenderTarget).__webglFramebuffer:null;state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer)}}},this.copyFramebufferToTexture=function(position,texture,level=0){const levelScale=Math.pow(2,-level),width=Math.floor(texture.image.width*levelScale),height=Math.floor(texture.image.height*levelScale);textures.setTexture2D(texture,0),_gl.copyTexSubImage2D(_gl.TEXTURE_2D,level,0,0,position.x,position.y,width,height),state.unbindTexture()},this.copyTextureToTexture=function(position,srcTexture,dstTexture,level=0){const width=srcTexture.image.width,height=srcTexture.image.height,glFormat=utils.convert(dstTexture.format),glType=utils.convert(dstTexture.type);textures.setTexture2D(dstTexture,0),_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,dstTexture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dstTexture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,dstTexture.unpackAlignment),srcTexture.isDataTexture?_gl.texSubImage2D(_gl.TEXTURE_2D,level,position.x,position.y,width,height,glFormat,glType,srcTexture.image.data):srcTexture.isCompressedTexture?_gl.compressedTexSubImage2D(_gl.TEXTURE_2D,level,position.x,position.y,srcTexture.mipmaps[0].width,srcTexture.mipmaps[0].height,glFormat,srcTexture.mipmaps[0].data):_gl.texSubImage2D(_gl.TEXTURE_2D,level,position.x,position.y,glFormat,glType,srcTexture.image),0===level&&dstTexture.generateMipmaps&&_gl.generateMipmap(_gl.TEXTURE_2D),state.unbindTexture()},this.copyTextureToTexture3D=function(sourceBox,position,srcTexture,dstTexture,level=0){if(_this.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const width=sourceBox.max.x-sourceBox.min.x+1,height=sourceBox.max.y-sourceBox.min.y+1,depth=sourceBox.max.z-sourceBox.min.z+1,glFormat=utils.convert(dstTexture.format),glType=utils.convert(dstTexture.type);let glTarget;if(dstTexture.isData3DTexture)textures.setTexture3D(dstTexture,0),glTarget=_gl.TEXTURE_3D;else{if(!dstTexture.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");textures.setTexture2DArray(dstTexture,0),glTarget=_gl.TEXTURE_2D_ARRAY}_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,dstTexture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dstTexture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,dstTexture.unpackAlignment);const unpackRowLen=_gl.getParameter(_gl.UNPACK_ROW_LENGTH),unpackImageHeight=_gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT),unpackSkipPixels=_gl.getParameter(_gl.UNPACK_SKIP_PIXELS),unpackSkipRows=_gl.getParameter(_gl.UNPACK_SKIP_ROWS),unpackSkipImages=_gl.getParameter(_gl.UNPACK_SKIP_IMAGES),image=srcTexture.isCompressedTexture?srcTexture.mipmaps[0]:srcTexture.image;_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,image.width),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,image.height),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,sourceBox.min.x),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,sourceBox.min.y),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,sourceBox.min.z),srcTexture.isDataTexture||srcTexture.isData3DTexture?_gl.texSubImage3D(glTarget,level,position.x,position.y,position.z,width,height,depth,glFormat,glType,image.data):srcTexture.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_gl.compressedTexSubImage3D(glTarget,level,position.x,position.y,position.z,width,height,depth,glFormat,image.data)):_gl.texSubImage3D(glTarget,level,position.x,position.y,position.z,width,height,depth,glFormat,glType,image),_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,unpackRowLen),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,unpackImageHeight),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,unpackSkipPixels),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,unpackSkipRows),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,unpackSkipImages),0===level&&dstTexture.generateMipmaps&&_gl.generateMipmap(glTarget),state.unbindTexture()},this.initTexture=function(texture){texture.isCubeTexture?textures.setTextureCube(texture,0):texture.isData3DTexture?textures.setTexture3D(texture,0):texture.isDataArrayTexture||texture.isCompressedArrayTexture?textures.setTexture2DArray(texture,0):textures.setTexture2D(texture,0),state.unbindTexture()},this.resetState=function(){_currentActiveCubeFace=0,_currentActiveMipmapLevel=0,_currentRenderTarget=null,state.reset(),bindingStates.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return WebGLCoordinateSystem}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(value){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!value}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===SRGBColorSpace?sRGBEncoding:LinearEncoding}set outputEncoding(encoding){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=encoding===sRGBEncoding?SRGBColorSpace:LinearSRGBColorSpace}}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=!0;class FogExp2{constructor(color,density=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color(color),this.density=density}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Fog{constructor(color,near=1,far=1e3){this.isFog=!0,this.name="",this.color=new Color(color),this.near=near,this.far=far}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(source,recursive){return super.copy(source,recursive),null!==source.background&&(this.background=source.background.clone()),null!==source.environment&&(this.environment=source.environment.clone()),null!==source.fog&&(this.fog=source.fog.clone()),this.backgroundBlurriness=source.backgroundBlurriness,this.backgroundIntensity=source.backgroundIntensity,null!==source.overrideMaterial&&(this.overrideMaterial=source.overrideMaterial.clone()),this.matrixAutoUpdate=source.matrixAutoUpdate,this}toJSON(meta){const data=super.toJSON(meta);return null!==this.fog&&(data.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(data.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(data.object.backgroundIntensity=this.backgroundIntensity),data}}class InterleavedBuffer{constructor(array,stride){this.isInterleavedBuffer=!0,this.array=array,this.stride=stride,this.count=void 0!==array?array.length/stride:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID()}onUploadCallback(){}set needsUpdate(value){!0===value&&this.version++}setUsage(value){return this.usage=value,this}copy(source){return this.array=new source.array.constructor(source.array),this.count=source.count,this.stride=source.stride,this.usage=source.usage,this}copyAt(index1,attribute,index2){index1*=this.stride,index2*=attribute.stride;for(let i=0,l=this.stride;iraycaster.far||intersects.push({distance:distance,point:_intersectPoint.clone(),uv:Triangle.getInterpolation(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(source,recursive){return super.copy(source,recursive),void 0!==source.center&&this.center.copy(source.center),this.material=source.material,this}}function transformVertex(vertexPosition,mvPosition,center,scale,sin,cos){_alignedPosition.subVectors(vertexPosition,center).addScalar(.5).multiply(scale),void 0!==sin?(_rotatedPosition.x=cos*_alignedPosition.x-sin*_alignedPosition.y,_rotatedPosition.y=sin*_alignedPosition.x+cos*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),vertexPosition.copy(mvPosition),vertexPosition.x+=_rotatedPosition.x,vertexPosition.y+=_rotatedPosition.y,vertexPosition.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(source){super.copy(source,!1);const levels=source.levels;for(let i=0,l=levels.length;i0){let i,l;for(i=1,l=levels.length;i0){_v1$2.setFromMatrixPosition(this.matrixWorld);const distance=raycaster.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(distance).raycast(raycaster,intersects)}}update(camera){const levels=this.levels;if(levels.length>1){_v1$2.setFromMatrixPosition(camera.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const distance=_v1$2.distanceTo(_v2$1)/camera.zoom;let i,l;for(levels[0].object.visible=!0,i=1,l=levels.length;i=levelDistance))break;levels[i-1].object.visible=!1,levels[i].object.visible=!0}for(this._currentLevel=i-1;ilocalThresholdSq)continue;interRay.applyMatrix4(this.matrixWorld);const distance=raycaster.ray.origin.distanceTo(interRay);distanceraycaster.far||intersects.push({distance:distance,point:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,drawRange.start),l=Math.min(positionAttribute.count,drawRange.start+drawRange.count)-1;ilocalThresholdSq)continue;interRay.applyMatrix4(this.matrixWorld);const distance=raycaster.ray.origin.distanceTo(interRay);distanceraycaster.far||intersects.push({distance:distance,point:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const morphAttributes=this.geometry.morphAttributes,keys=Object.keys(morphAttributes);if(keys.length>0){const morphAttribute=morphAttributes[keys[0]];if(void 0!==morphAttribute){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;m0){const morphAttribute=morphAttributes[keys[0]];if(void 0!==morphAttribute){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;mraycaster.far)return;intersects.push({distance:distance,distanceToRay:Math.sqrt(rayPointDistanceSq),point:intersectPoint,index:index,face:null,object:object})}}class VideoTexture extends Texture{constructor(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){super(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy),this.isVideoTexture=!0,this.minFilter=void 0!==minFilter?minFilter:LinearFilter,this.magFilter=void 0!==magFilter?magFilter:LinearFilter,this.generateMipmaps=!1;const scope=this;"requestVideoFrameCallback"in video&&video.requestVideoFrameCallback((function updateVideo(){scope.needsUpdate=!0,video.requestVideoFrameCallback(updateVideo)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const video=this.image;!1==="requestVideoFrameCallback"in video&&video.readyState>=video.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(width,height){super({width:width,height:height}),this.isFramebufferTexture=!0,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(mipmaps,width,height,format,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,colorSpace){super(null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,colorSpace),this.isCompressedTexture=!0,this.image={width:width,height:height},this.mipmaps=mipmaps,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(mipmaps,width,height,depth,format,type){super(mipmaps,width,height,format,type),this.isCompressedArrayTexture=!0,this.image.depth=depth,this.wrapR=ClampToEdgeWrapping}}class CanvasTexture extends Texture{constructor(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){super(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Curve{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(u,optionalTarget){const t=this.getUtoTmapping(u);return this.getPoint(t,optionalTarget)}getPoints(divisions=5){const points=[];for(let d=0;d<=divisions;d++)points.push(this.getPoint(d/divisions));return points}getSpacedPoints(divisions=5){const points=[];for(let d=0;d<=divisions;d++)points.push(this.getPointAt(d/divisions));return points}getLength(){const lengths=this.getLengths();return lengths[lengths.length-1]}getLengths(divisions=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===divisions+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const cache=[];let current,last=this.getPoint(0),sum=0;cache.push(0);for(let p=1;p<=divisions;p++)current=this.getPoint(p/divisions),sum+=current.distanceTo(last),cache.push(sum),last=current;return this.cacheArcLengths=cache,cache}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(u,distance){const arcLengths=this.getLengths();let i=0;const il=arcLengths.length;let targetArcLength;targetArcLength=distance||u*arcLengths[il-1];let comparison,low=0,high=il-1;for(;low<=high;)if(i=Math.floor(low+(high-low)/2),comparison=arcLengths[i]-targetArcLength,comparison<0)low=i+1;else{if(!(comparison>0)){high=i;break}high=i-1}if(i=high,arcLengths[i]===targetArcLength)return i/(il-1);const lengthBefore=arcLengths[i];return(i+(targetArcLength-lengthBefore)/(arcLengths[i+1]-lengthBefore))/(il-1)}getTangent(t,optionalTarget){let t1=t-1e-4,t2=t+1e-4;t1<0&&(t1=0),t2>1&&(t2=1);const pt1=this.getPoint(t1),pt2=this.getPoint(t2),tangent=optionalTarget||(pt1.isVector2?new Vector2:new Vector3);return tangent.copy(pt2).sub(pt1).normalize(),tangent}getTangentAt(u,optionalTarget){const t=this.getUtoTmapping(u);return this.getTangent(t,optionalTarget)}computeFrenetFrames(segments,closed){const normal=new Vector3,tangents=[],normals=[],binormals=[],vec=new Vector3,mat=new Matrix4;for(let i=0;i<=segments;i++){const u=i/segments;tangents[i]=this.getTangentAt(u,new Vector3)}normals[0]=new Vector3,binormals[0]=new Vector3;let min=Number.MAX_VALUE;const tx=Math.abs(tangents[0].x),ty=Math.abs(tangents[0].y),tz=Math.abs(tangents[0].z);tx<=min&&(min=tx,normal.set(1,0,0)),ty<=min&&(min=ty,normal.set(0,1,0)),tz<=min&&normal.set(0,0,1),vec.crossVectors(tangents[0],normal).normalize(),normals[0].crossVectors(tangents[0],vec),binormals[0].crossVectors(tangents[0],normals[0]);for(let i=1;i<=segments;i++){if(normals[i]=normals[i-1].clone(),binormals[i]=binormals[i-1].clone(),vec.crossVectors(tangents[i-1],tangents[i]),vec.length()>Number.EPSILON){vec.normalize();const theta=Math.acos(clamp(tangents[i-1].dot(tangents[i]),-1,1));normals[i].applyMatrix4(mat.makeRotationAxis(vec,theta))}binormals[i].crossVectors(tangents[i],normals[i])}if(!0===closed){let theta=Math.acos(clamp(normals[0].dot(normals[segments]),-1,1));theta/=segments,tangents[0].dot(vec.crossVectors(normals[0],normals[segments]))>0&&(theta=-theta);for(let i=1;i<=segments;i++)normals[i].applyMatrix4(mat.makeRotationAxis(tangents[i],theta*i)),binormals[i].crossVectors(tangents[i],normals[i])}return{tangents:tangents,normals:normals,binormals:binormals}}clone(){return(new this.constructor).copy(this)}copy(source){return this.arcLengthDivisions=source.arcLengthDivisions,this}toJSON(){const data={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return data.arcLengthDivisions=this.arcLengthDivisions,data.type=this.type,data}fromJSON(json){return this.arcLengthDivisions=json.arcLengthDivisions,this}}class EllipseCurve extends Curve{constructor(aX=0,aY=0,xRadius=1,yRadius=1,aStartAngle=0,aEndAngle=2*Math.PI,aClockwise=!1,aRotation=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=aX,this.aY=aY,this.xRadius=xRadius,this.yRadius=yRadius,this.aStartAngle=aStartAngle,this.aEndAngle=aEndAngle,this.aClockwise=aClockwise,this.aRotation=aRotation}getPoint(t,optionalTarget){const point=optionalTarget||new Vector2,twoPi=2*Math.PI;let deltaAngle=this.aEndAngle-this.aStartAngle;const samePoints=Math.abs(deltaAngle)twoPi;)deltaAngle-=twoPi;deltaAngle0?0:(Math.floor(Math.abs(intPoint)/l)+1)*l:0===weight&&intPoint===l-1&&(intPoint=l-2,weight=1),this.closed||intPoint>0?p0=points[(intPoint-1)%l]:(tmp.subVectors(points[0],points[1]).add(points[0]),p0=tmp);const p1=points[intPoint%l],p2=points[(intPoint+1)%l];if(this.closed||intPoint+2points.length-2?points.length-1:intPoint+1],p3=points[intPoint>points.length-3?points.length-1:intPoint+2];return point.set(CatmullRom(weight,p0.x,p1.x,p2.x,p3.x),CatmullRom(weight,p0.y,p1.y,p2.y,p3.y)),point}copy(source){super.copy(source),this.points=[];for(let i=0,l=source.points.length;i=d){const diff=curveLengths[i]-d,curve=this.curves[i],segmentLength=curve.getLength(),u=0===segmentLength?0:1-diff/segmentLength;return curve.getPointAt(u,optionalTarget)}i++}return null}getLength(){const lens=this.getCurveLengths();return lens[lens.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 lengths=[];let sums=0;for(let i=0,l=this.curves.length;i1&&!points[points.length-1].equals(points[0])&&points.push(points[0]),points}copy(source){super.copy(source),this.curves=[];for(let i=0,l=source.curves.length;i0){const firstPoint=curve.getPoint(0);firstPoint.equals(this.currentPoint)||this.lineTo(firstPoint.x,firstPoint.y)}this.curves.push(curve);const lastPoint=curve.getPoint(1);return this.currentPoint.copy(lastPoint),this}copy(source){return super.copy(source),this.currentPoint.copy(source.currentPoint),this}toJSON(){const data=super.toJSON();return data.currentPoint=this.currentPoint.toArray(),data}fromJSON(json){return super.fromJSON(json),this.currentPoint.fromArray(json.currentPoint),this}}class LatheGeometry extends BufferGeometry{constructor(points=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],segments=12,phiStart=0,phiLength=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:points,segments:segments,phiStart:phiStart,phiLength:phiLength},segments=Math.floor(segments),phiLength=clamp(phiLength,0,2*Math.PI);const indices=[],vertices=[],uvs=[],initNormals=[],normals=[],inverseSegments=1/segments,vertex=new Vector3,uv=new Vector2,normal=new Vector3,curNormal=new Vector3,prevNormal=new Vector3;let dx=0,dy=0;for(let j=0;j<=points.length-1;j++)switch(j){case 0:dx=points[j+1].x-points[j].x,dy=points[j+1].y-points[j].y,normal.x=1*dy,normal.y=-dx,normal.z=0*dy,prevNormal.copy(normal),normal.normalize(),initNormals.push(normal.x,normal.y,normal.z);break;case points.length-1:initNormals.push(prevNormal.x,prevNormal.y,prevNormal.z);break;default:dx=points[j+1].x-points[j].x,dy=points[j+1].y-points[j].y,normal.x=1*dy,normal.y=-dx,normal.z=0*dy,curNormal.copy(normal),normal.x+=prevNormal.x,normal.y+=prevNormal.y,normal.z+=prevNormal.z,normal.normalize(),initNormals.push(normal.x,normal.y,normal.z),prevNormal.copy(curNormal)}for(let i=0;i<=segments;i++){const phi=phiStart+i*inverseSegments*phiLength,sin=Math.sin(phi),cos=Math.cos(phi);for(let j=0;j<=points.length-1;j++){vertex.x=points[j].x*sin,vertex.y=points[j].y,vertex.z=points[j].x*cos,vertices.push(vertex.x,vertex.y,vertex.z),uv.x=i/segments,uv.y=j/(points.length-1),uvs.push(uv.x,uv.y);const x=initNormals[3*j+0]*sin,y=initNormals[3*j+1],z=initNormals[3*j+0]*cos;normals.push(x,y,z)}}for(let i=0;i0&&generateCap(!0),radiusBottom>0&&generateCap(!1)),this.setIndex(indices),this.setAttribute("position",new Float32BufferAttribute(vertices,3)),this.setAttribute("normal",new Float32BufferAttribute(normals,3)),this.setAttribute("uv",new Float32BufferAttribute(uvs,2))}copy(source){return super.copy(source),this.parameters=Object.assign({},source.parameters),this}static fromJSON(data){return new CylinderGeometry(data.radiusTop,data.radiusBottom,data.height,data.radialSegments,data.heightSegments,data.openEnded,data.thetaStart,data.thetaLength)}}class ConeGeometry extends CylinderGeometry{constructor(radius=1,height=1,radialSegments=32,heightSegments=1,openEnded=!1,thetaStart=0,thetaLength=2*Math.PI){super(0,radius,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength),this.type="ConeGeometry",this.parameters={radius:radius,height:height,radialSegments:radialSegments,heightSegments:heightSegments,openEnded:openEnded,thetaStart:thetaStart,thetaLength:thetaLength}}static fromJSON(data){return new ConeGeometry(data.radius,data.height,data.radialSegments,data.heightSegments,data.openEnded,data.thetaStart,data.thetaLength)}}class PolyhedronGeometry extends BufferGeometry{constructor(vertices=[],indices=[],radius=1,detail=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:vertices,indices:indices,radius:radius,detail:detail};const vertexBuffer=[],uvBuffer=[];function subdivideFace(a,b,c,detail){const cols=detail+1,v=[];for(let i=0;i<=cols;i++){v[i]=[];const aj=a.clone().lerp(c,i/cols),bj=b.clone().lerp(c,i/cols),rows=cols-i;for(let j=0;j<=rows;j++)v[i][j]=0===j&&i===cols?aj:aj.clone().lerp(bj,j/rows)}for(let i=0;i.9&&min<.1&&(x0<.2&&(uvBuffer[i+0]+=1),x1<.2&&(uvBuffer[i+2]+=1),x2<.2&&(uvBuffer[i+4]+=1))}}()}(),this.setAttribute("position",new Float32BufferAttribute(vertexBuffer,3)),this.setAttribute("normal",new Float32BufferAttribute(vertexBuffer.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(uvBuffer,2)),0===detail?this.computeVertexNormals():this.normalizeNormals()}copy(source){return super.copy(source),this.parameters=Object.assign({},source.parameters),this}static fromJSON(data){return new PolyhedronGeometry(data.vertices,data.indices,data.radius,data.details)}}class DodecahedronGeometry extends PolyhedronGeometry{constructor(radius=1,detail=0){const t=(1+Math.sqrt(5))/2,r=1/t;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,-r,-t,0,-r,t,0,r,-t,0,r,t,-r,-t,0,-r,t,0,r,-t,0,r,t,0,-t,0,-r,t,0,-r,-t,0,r,t,0,r],[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,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],radius,detail),this.type="DodecahedronGeometry",this.parameters={radius:radius,detail:detail}}static fromJSON(data){return new DodecahedronGeometry(data.radius,data.detail)}}const _v0=new Vector3,_v1$1=new Vector3,_normal=new Vector3,_triangle=new Triangle;class EdgesGeometry extends BufferGeometry{constructor(geometry=null,thresholdAngle=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:geometry,thresholdAngle:thresholdAngle},null!==geometry){const precisionPoints=4,precision=Math.pow(10,precisionPoints),thresholdDot=Math.cos(DEG2RAD*thresholdAngle),indexAttr=geometry.getIndex(),positionAttr=geometry.getAttribute("position"),indexCount=indexAttr?indexAttr.count:positionAttr.count,indexArr=[0,0,0],vertKeys=["a","b","c"],hashes=new Array(3),edgeData={},vertices=[];for(let i=0;i80*dim){minX=maxX=data[0],minY=maxY=data[1];for(let i=dim;imaxX&&(maxX=x),y>maxY&&(maxY=y);invSize=Math.max(maxX-minX,maxY-minY),invSize=0!==invSize?32767/invSize:0}return earcutLinked(outerNode,triangles,dim,minX,minY,invSize,0),triangles};function linkedList(data,start,end,dim,clockwise){let i,last;if(clockwise===function signedArea(data,start,end,dim){let sum=0;for(let i=start,j=end-dim;i0)for(i=start;i=start;i-=dim)last=insertNode(i,data[i],data[i+1],last);return last&&equals(last,last.next)&&(removeNode(last),last=last.next),last}function filterPoints(start,end){if(!start)return start;end||(end=start);let again,p=start;do{if(again=!1,p.steiner||!equals(p,p.next)&&0!==area(p.prev,p,p.next))p=p.next;else{if(removeNode(p),p=end=p.prev,p===p.next)break;again=!0}}while(again||p!==end);return end}function earcutLinked(ear,triangles,dim,minX,minY,invSize,pass){if(!ear)return;!pass&&invSize&&function indexCurve(start,minX,minY,invSize){let p=start;do{0===p.z&&(p.z=zOrder(p.x,p.y,minX,minY,invSize)),p.prevZ=p.prev,p.nextZ=p.next,p=p.next}while(p!==start);p.prevZ.nextZ=null,p.prevZ=null,function sortLinked(list){let i,p,q,e,tail,numMerges,pSize,qSize,inSize=1;do{for(p=list,list=null,tail=null,numMerges=0;p;){for(numMerges++,q=p,pSize=0,i=0;i0||qSize>0&&q;)0!==pSize&&(0===qSize||!q||p.z<=q.z)?(e=p,p=p.nextZ,pSize--):(e=q,q=q.nextZ,qSize--),tail?tail.nextZ=e:list=e,e.prevZ=tail,tail=e;p=q}tail.nextZ=null,inSize*=2}while(numMerges>1);return list}(p)}(ear,minX,minY,invSize);let prev,next,stop=ear;for(;ear.prev!==ear.next;)if(prev=ear.prev,next=ear.next,invSize?isEarHashed(ear,minX,minY,invSize):isEar(ear))triangles.push(prev.i/dim|0),triangles.push(ear.i/dim|0),triangles.push(next.i/dim|0),removeNode(ear),ear=next.next,stop=next.next;else if((ear=next)===stop){pass?1===pass?earcutLinked(ear=cureLocalIntersections(filterPoints(ear),triangles,dim),triangles,dim,minX,minY,invSize,2):2===pass&&splitEarcut(ear,triangles,dim,minX,minY,invSize):earcutLinked(filterPoints(ear),triangles,dim,minX,minY,invSize,1);break}}function isEar(ear){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=axbx?ax>cx?ax:cx:bx>cx?bx:cx,y1=ay>by?ay>cy?ay:cy:by>cy?by:cy;let p=c.next;for(;p!==a;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function isEarHashed(ear,minX,minY,invSize){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=axbx?ax>cx?ax:cx:bx>cx?bx:cx,y1=ay>by?ay>cy?ay:cy:by>cy?by:cy,minZ=zOrder(x0,y0,minX,minY,invSize),maxZ=zOrder(x1,y1,minX,minY,invSize);let p=ear.prevZ,n=ear.nextZ;for(;p&&p.z>=minZ&&n&&n.z<=maxZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}for(;p&&p.z>=minZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;n&&n.z<=maxZ;){if(n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}return!0}function cureLocalIntersections(start,triangles,dim){let p=start;do{const a=p.prev,b=p.next.next;!equals(a,b)&&intersects(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)&&(triangles.push(a.i/dim|0),triangles.push(p.i/dim|0),triangles.push(b.i/dim|0),removeNode(p),removeNode(p.next),p=start=b),p=p.next}while(p!==start);return filterPoints(p)}function splitEarcut(start,triangles,dim,minX,minY,invSize){let a=start;do{let b=a.next.next;for(;b!==a.prev;){if(a.i!==b.i&&isValidDiagonal(a,b)){let c=splitPolygon(a,b);return a=filterPoints(a,a.next),c=filterPoints(c,c.next),earcutLinked(a,triangles,dim,minX,minY,invSize,0),void earcutLinked(c,triangles,dim,minX,minY,invSize,0)}b=b.next}a=a.next}while(a!==start)}function compareX(a,b){return a.x-b.x}function eliminateHole(hole,outerNode){const bridge=function findHoleBridge(hole,outerNode){let m,p=outerNode,qx=-1/0;const hx=hole.x,hy=hole.y;do{if(hy<=p.y&&hy>=p.next.y&&p.next.y!==p.y){const x=p.x+(hy-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(x<=hx&&x>qx&&(qx=x,m=p.x=p.x&&p.x>=mx&&hx!==p.x&&pointInTriangle(hym.x||p.x===m.x&§orContainsSector(m,p)))&&(m=p,tanMin=tan)),p=p.next}while(p!==stop);return m}(hole,outerNode);if(!bridge)return outerNode;const bridgeReverse=splitPolygon(bridge,hole);return filterPoints(bridgeReverse,bridgeReverse.next),filterPoints(bridge,bridge.next)}function sectorContainsSector(m,p){return area(m.prev,m,p.prev)<0&&area(p.next,m,m.next)<0}function zOrder(x,y,minX,minY,invSize){return(x=1431655765&((x=858993459&((x=252645135&((x=16711935&((x=(x-minX)*invSize|0)|x<<8))|x<<4))|x<<2))|x<<1))|(y=1431655765&((y=858993459&((y=252645135&((y=16711935&((y=(y-minY)*invSize|0)|y<<8))|y<<4))|y<<2))|y<<1))<<1}function getLeftmost(start){let p=start,leftmost=start;do{(p.x=(ax-px)*(cy-py)&&(ax-px)*(by-py)>=(bx-px)*(ay-py)&&(bx-px)*(cy-py)>=(cx-px)*(by-py)}function isValidDiagonal(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function intersectsPolygon(a,b){let p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects(p,p.next,a,b))return!0;p=p.next}while(p!==a);return!1}(a,b)&&(locallyInside(a,b)&&locallyInside(b,a)&&function middleInside(a,b){let p=a,inside=!1;const px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{p.y>py!=p.next.y>py&&p.next.y!==p.y&&px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x&&(inside=!inside),p=p.next}while(p!==a);return inside}(a,b)&&(area(a.prev,a,b.prev)||area(a,b.prev,b))||equals(a,b)&&area(a.prev,a,a.next)>0&&area(b.prev,b,b.next)>0)}function area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y)}function equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y}function intersects(p1,q1,p2,q2){const o1=sign(area(p1,q1,p2)),o2=sign(area(p1,q1,q2)),o3=sign(area(p2,q2,p1)),o4=sign(area(p2,q2,q1));return o1!==o2&&o3!==o4||(!(0!==o1||!onSegment(p1,p2,q1))||(!(0!==o2||!onSegment(p1,q2,q1))||(!(0!==o3||!onSegment(p2,p1,q2))||!(0!==o4||!onSegment(p2,q1,q2)))))}function onSegment(p,q,r){return q.x<=Math.max(p.x,r.x)&&q.x>=Math.min(p.x,r.x)&&q.y<=Math.max(p.y,r.y)&&q.y>=Math.min(p.y,r.y)}function sign(num){return num>0?1:num<0?-1:0}function locallyInside(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0}function splitPolygon(a,b){const a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;return a.next=b,b.prev=a,a2.next=an,an.prev=a2,b2.next=a2,a2.prev=b2,bp.next=b2,b2.prev=bp,b2}function insertNode(i,x,y,last){const p=new Node(i,x,y);return last?(p.next=last.next,p.prev=last,last.next.prev=p,last.next=p):(p.prev=p,p.next=p),p}function removeNode(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function Node(i,x,y){this.i=i,this.x=x,this.y=y,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ShapeUtils{static area(contour){const n=contour.length;let a=0;for(let p=n-1,q=0;q2&&points[l-1].equals(points[0])&&points.pop()}function addContour(vertices,contour){for(let i=0;iNumber.EPSILON){const v_prev_len=Math.sqrt(v_prev_lensq),v_next_len=Math.sqrt(v_next_x*v_next_x+v_next_y*v_next_y),ptPrevShift_x=inPrev.x-v_prev_y/v_prev_len,ptPrevShift_y=inPrev.y+v_prev_x/v_prev_len,sf=((inNext.x-v_next_y/v_next_len-ptPrevShift_x)*v_next_y-(inNext.y+v_next_x/v_next_len-ptPrevShift_y)*v_next_x)/(v_prev_x*v_next_y-v_prev_y*v_next_x);v_trans_x=ptPrevShift_x+v_prev_x*sf-inPt.x,v_trans_y=ptPrevShift_y+v_prev_y*sf-inPt.y;const v_trans_lensq=v_trans_x*v_trans_x+v_trans_y*v_trans_y;if(v_trans_lensq<=2)return new Vector2(v_trans_x,v_trans_y);shrink_by=Math.sqrt(v_trans_lensq/2)}else{let direction_eq=!1;v_prev_x>Number.EPSILON?v_next_x>Number.EPSILON&&(direction_eq=!0):v_prev_x<-Number.EPSILON?v_next_x<-Number.EPSILON&&(direction_eq=!0):Math.sign(v_prev_y)===Math.sign(v_next_y)&&(direction_eq=!0),direction_eq?(v_trans_x=-v_prev_y,v_trans_y=v_prev_x,shrink_by=Math.sqrt(v_prev_lensq)):(v_trans_x=v_prev_x,v_trans_y=v_prev_y,shrink_by=Math.sqrt(v_prev_lensq/2))}return new Vector2(v_trans_x/shrink_by,v_trans_y/shrink_by)}const contourMovements=[];for(let i=0,il=contour.length,j=il-1,k=i+1;i=0;b--){const t=b/bevelSegments,z=bevelThickness*Math.cos(t*Math.PI/2),bs=bevelSize*Math.sin(t*Math.PI/2)+bevelOffset;for(let i=0,il=contour.length;i=0;){const j=i;let k=i-1;k<0&&(k=contour.length-1);for(let s=0,sl=steps+2*bevelSegments;s0)&&indices.push(a,b,d),(iy!==heightSegments-1||thetaEnd0!=value>0&&this.version++,this._anisotropy=value}get clearcoat(){return this._clearcoat}set clearcoat(value){this._clearcoat>0!=value>0&&this.version++,this._clearcoat=value}get iridescence(){return this._iridescence}set iridescence(value){this._iridescence>0!=value>0&&this.version++,this._iridescence=value}get sheen(){return this._sheen}set sheen(value){this._sheen>0!=value>0&&this.version++,this._sheen=value}get transmission(){return this._transmission}set transmission(value){this._transmission>0!=value>0&&this.version++,this._transmission=value}copy(source){return super.copy(source),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=source.anisotropy,this.anisotropyRotation=source.anisotropyRotation,this.anisotropyMap=source.anisotropyMap,this.clearcoat=source.clearcoat,this.clearcoatMap=source.clearcoatMap,this.clearcoatRoughness=source.clearcoatRoughness,this.clearcoatRoughnessMap=source.clearcoatRoughnessMap,this.clearcoatNormalMap=source.clearcoatNormalMap,this.clearcoatNormalScale.copy(source.clearcoatNormalScale),this.ior=source.ior,this.iridescence=source.iridescence,this.iridescenceMap=source.iridescenceMap,this.iridescenceIOR=source.iridescenceIOR,this.iridescenceThicknessRange=[...source.iridescenceThicknessRange],this.iridescenceThicknessMap=source.iridescenceThicknessMap,this.sheen=source.sheen,this.sheenColor.copy(source.sheenColor),this.sheenColorMap=source.sheenColorMap,this.sheenRoughness=source.sheenRoughness,this.sheenRoughnessMap=source.sheenRoughnessMap,this.transmission=source.transmission,this.transmissionMap=source.transmissionMap,this.thickness=source.thickness,this.thicknessMap=source.thicknessMap,this.attenuationDistance=source.attenuationDistance,this.attenuationColor.copy(source.attenuationColor),this.specularIntensity=source.specularIntensity,this.specularIntensityMap=source.specularIntensityMap,this.specularColor.copy(source.specularColor),this.specularColorMap=source.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(parameters){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.specular.copy(source.specular),this.shininess=source.shininess,this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.flatShading=source.flatShading,this.fog=source.fog,this}}class MeshToonMaterial extends Material{constructor(parameters){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(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(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.map=source.map,this.gradientMap=source.gradientMap,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.alphaMap=source.alphaMap,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.fog=source.fog,this}}class MeshNormalMaterial extends Material{constructor(parameters){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(parameters)}copy(source){return super.copy(source),this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.flatShading=source.flatShading,this}}class MeshLambertMaterial extends Material{constructor(parameters){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.flatShading=source.flatShading,this.fog=source.fog,this}}class MeshMatcapMaterial extends Material{constructor(parameters){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.defines={MATCAP:""},this.color.copy(source.color),this.matcap=source.matcap,this.map=source.map,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.alphaMap=source.alphaMap,this.flatShading=source.flatShading,this.fog=source.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(parameters){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(parameters)}copy(source){return super.copy(source),this.scale=source.scale,this.dashSize=source.dashSize,this.gapSize=source.gapSize,this}}function arraySlice(array,from,to){return isTypedArray(array)?new array.constructor(array.subarray(from,void 0!==to?to:array.length)):array.slice(from,to)}function convertArray(array,type,forceClone){return!array||!forceClone&&array.constructor===type?array:"number"==typeof type.BYTES_PER_ELEMENT?new type(array):Array.prototype.slice.call(array)}function isTypedArray(object){return ArrayBuffer.isView(object)&&!(object instanceof DataView)}function getKeyframeOrder(times){const n=times.length,result=new Array(n);for(let i=0;i!==n;++i)result[i]=i;return result.sort((function compareTime(i,j){return times[i]-times[j]})),result}function sortedArray(values,stride,order){const nValues=values.length,result=new values.constructor(nValues);for(let i=0,dstOffset=0;dstOffset!==nValues;++i){const srcOffset=order[i]*stride;for(let j=0;j!==stride;++j)result[dstOffset++]=values[srcOffset+j]}return result}function flattenJSON(jsonKeys,times,values,valuePropertyName){let i=1,key=jsonKeys[0];for(;void 0!==key&&void 0===key[valuePropertyName];)key=jsonKeys[i++];if(void 0===key)return;let value=key[valuePropertyName];if(void 0!==value)if(Array.isArray(value))do{value=key[valuePropertyName],void 0!==value&&(times.push(key.time),values.push.apply(values,value)),key=jsonKeys[i++]}while(void 0!==key);else if(void 0!==value.toArray)do{value=key[valuePropertyName],void 0!==value&&(times.push(key.time),value.toArray(values,values.length)),key=jsonKeys[i++]}while(void 0!==key);else do{value=key[valuePropertyName],void 0!==value&&(times.push(key.time),values.push(value)),key=jsonKeys[i++]}while(void 0!==key)}const AnimationUtils={arraySlice:arraySlice,convertArray:convertArray,isTypedArray:isTypedArray,getKeyframeOrder:getKeyframeOrder,sortedArray:sortedArray,flattenJSON:flattenJSON,subclip:function subclip(sourceClip,name,startFrame,endFrame,fps=30){const clip=sourceClip.clone();clip.name=name;const tracks=[];for(let i=0;i=endFrame)){times.push(track.times[j]);for(let k=0;kclip.tracks[i].times[0]&&(minStartTime=clip.tracks[i].times[0]);for(let i=0;i=referenceTrack.times[lastIndex]){const startIndex=lastIndex*referenceValueSize+referenceOffset,endIndex=startIndex+referenceValueSize-referenceOffset;referenceValue=arraySlice(referenceTrack.values,startIndex,endIndex)}else{const interpolant=referenceTrack.createInterpolant(),startIndex=referenceOffset,endIndex=referenceValueSize-referenceOffset;interpolant.evaluate(referenceTime),referenceValue=arraySlice(interpolant.resultBuffer,startIndex,endIndex)}if("quaternion"===referenceTrackType){(new Quaternion).fromArray(referenceValue).normalize().conjugate().toArray(referenceValue)}const numTimes=targetTrack.times.length;for(let j=0;j=t0)break validate_interval;{const t1global=pp[1];t=t0)break seek}right=i1,i1=0}}for(;i1>>1;tendTime;)--to;if(++to,0!==from||to!==nKeys){from>=to&&(to=Math.max(to,1),from=to-1);const stride=this.getValueSize();this.times=arraySlice(times,from,to),this.values=arraySlice(this.values,from*stride,to*stride)}return this}validate(){let valid=!0;const valueSize=this.getValueSize();valueSize-Math.floor(valueSize)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),valid=!1);const times=this.times,values=this.values,nKeys=times.length;0===nKeys&&(console.error("THREE.KeyframeTrack: Track is empty.",this),valid=!1);let prevTime=null;for(let i=0;i!==nKeys;i++){const currTime=times[i];if("number"==typeof currTime&&isNaN(currTime)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,i,currTime),valid=!1;break}if(null!==prevTime&&prevTime>currTime){console.error("THREE.KeyframeTrack: Out of order keys.",this,i,currTime,prevTime),valid=!1;break}prevTime=currTime}if(void 0!==values&&isTypedArray(values))for(let i=0,n=values.length;i!==n;++i){const value=values[i];if(isNaN(value)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,i,value),valid=!1;break}}return valid}optimize(){const times=arraySlice(this.times),values=arraySlice(this.values),stride=this.getValueSize(),smoothInterpolation=this.getInterpolation()===InterpolateSmooth,lastIndex=times.length-1;let writeIndex=1;for(let i=1;i0){times[writeIndex]=times[lastIndex];for(let readOffset=lastIndex*stride,writeOffset=writeIndex*stride,j=0;j!==stride;++j)values[writeOffset+j]=values[readOffset+j];++writeIndex}return writeIndex!==times.length?(this.times=arraySlice(times,0,writeIndex),this.values=arraySlice(values,0,writeIndex*stride)):(this.times=times,this.values=values),this}clone(){const times=arraySlice(this.times,0),values=arraySlice(this.values,0),track=new(0,this.constructor)(this.name,times,values);return track.createInterpolant=this.createInterpolant,track}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){super(parameterPositions,sampleValues,sampleSize,resultBuffer)}interpolate_(i1,t0,t,t1){const result=this.resultBuffer,values=this.sampleValues,stride=this.valueSize,alpha=(t-t0)/(t1-t0);let offset=i1*stride;for(let end=offset+stride;offset!==end;offset+=4)Quaternion.slerpFlat(result,0,values,offset-stride,values,offset,alpha);return result}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(result){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),result)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(name,duration=-1,tracks,blendMode=NormalAnimationBlendMode){this.name=name,this.tracks=tracks,this.duration=duration,this.blendMode=blendMode,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(json){const tracks=[],jsonTracks=json.tracks,frameTime=1/(json.fps||1);for(let i=0,n=jsonTracks.length;i!==n;++i)tracks.push(parseKeyframeTrack(jsonTracks[i]).scale(frameTime));const clip=new this(json.name,json.duration,tracks,json.blendMode);return clip.uuid=json.uuid,clip}static toJSON(clip){const tracks=[],clipTracks=clip.tracks,json={name:clip.name,duration:clip.duration,tracks:tracks,uuid:clip.uuid,blendMode:clip.blendMode};for(let i=0,n=clipTracks.length;i!==n;++i)tracks.push(KeyframeTrack.toJSON(clipTracks[i]));return json}static CreateFromMorphTargetSequence(name,morphTargetSequence,fps,noLoop){const numMorphTargets=morphTargetSequence.length,tracks=[];for(let i=0;i1){const name=parts[1];let animationMorphTargets=animationToMorphTargets[name];animationMorphTargets||(animationToMorphTargets[name]=animationMorphTargets=[]),animationMorphTargets.push(morphTarget)}}const clips=[];for(const name in animationToMorphTargets)clips.push(this.CreateFromMorphTargetSequence(name,animationToMorphTargets[name],fps,noLoop));return clips}static parseAnimation(animation,bones){if(!animation)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const addNonemptyTrack=function(trackType,trackName,animationKeys,propertyName,destTracks){if(0!==animationKeys.length){const times=[],values=[];flattenJSON(animationKeys,times,values,propertyName),0!==times.length&&destTracks.push(new trackType(trackName,times,values))}},tracks=[],clipName=animation.name||"default",fps=animation.fps||30,blendMode=animation.blendMode;let duration=animation.length||-1;const hierarchyTracks=animation.hierarchy||[];for(let h=0;h{onLoad&&onLoad(cached),this.manager.itemEnd(url)}),0),cached;if(void 0!==loading[url])return void loading[url].push({onLoad:onLoad,onProgress:onProgress,onError:onError});loading[url]=[],loading[url].push({onLoad:onLoad,onProgress:onProgress,onError:onError});const req=new Request(url,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),mimeType=this.mimeType,responseType=this.responseType;fetch(req).then((response=>{if(200===response.status||0===response.status){if(0===response.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===response.body||void 0===response.body.getReader)return response;const callbacks=loading[url],reader=response.body.getReader(),contentLength=response.headers.get("Content-Length")||response.headers.get("X-File-Size"),total=contentLength?parseInt(contentLength):0,lengthComputable=0!==total;let loaded=0;const stream=new ReadableStream({start(controller){!function readData(){reader.read().then((({done:done,value:value})=>{if(done)controller.close();else{loaded+=value.byteLength;const event=new ProgressEvent("progress",{lengthComputable:lengthComputable,loaded:loaded,total:total});for(let i=0,il=callbacks.length;i{switch(responseType){case"arraybuffer":return response.arrayBuffer();case"blob":return response.blob();case"document":return response.text().then((text=>(new DOMParser).parseFromString(text,mimeType)));case"json":return response.json();default:if(void 0===mimeType)return response.text();{const exec=/charset="?([^;"\s]*)"?/i.exec(mimeType),label=exec&&exec[1]?exec[1].toLowerCase():void 0,decoder=new TextDecoder(label);return response.arrayBuffer().then((ab=>decoder.decode(ab)))}}})).then((data=>{Cache.add(url,data);const callbacks=loading[url];delete loading[url];for(let i=0,il=callbacks.length;i{const callbacks=loading[url];if(void 0===callbacks)throw this.manager.itemError(url),err;delete loading[url];for(let i=0,il=callbacks.length;i{this.manager.itemEnd(url)})),this.manager.itemStart(url)}setResponseType(value){return this.responseType=value,this}setMimeType(value){return this.mimeType=value,this}}class AnimationLoader extends Loader{constructor(manager){super(manager)}load(url,onLoad,onProgress,onError){const scope=this,loader=new FileLoader(this.manager);loader.setPath(this.path),loader.setRequestHeader(this.requestHeader),loader.setWithCredentials(this.withCredentials),loader.load(url,(function(text){try{onLoad(scope.parse(JSON.parse(text)))}catch(e){onError?onError(e):console.error(e),scope.manager.itemError(url)}}),onProgress,onError)}parse(json){const animations=[];for(let i=0;i0:material.vertexColors=json.vertexColors),void 0!==json.uniforms)for(const name in json.uniforms){const uniform=json.uniforms[name];switch(material.uniforms[name]={},uniform.type){case"t":material.uniforms[name].value=getTexture(uniform.value);break;case"c":material.uniforms[name].value=(new Color).setHex(uniform.value);break;case"v2":material.uniforms[name].value=(new Vector2).fromArray(uniform.value);break;case"v3":material.uniforms[name].value=(new Vector3).fromArray(uniform.value);break;case"v4":material.uniforms[name].value=(new Vector4).fromArray(uniform.value);break;case"m3":material.uniforms[name].value=(new Matrix3).fromArray(uniform.value);break;case"m4":material.uniforms[name].value=(new Matrix4).fromArray(uniform.value);break;default:material.uniforms[name].value=uniform.value}}if(void 0!==json.defines&&(material.defines=json.defines),void 0!==json.vertexShader&&(material.vertexShader=json.vertexShader),void 0!==json.fragmentShader&&(material.fragmentShader=json.fragmentShader),void 0!==json.glslVersion&&(material.glslVersion=json.glslVersion),void 0!==json.extensions)for(const key in json.extensions)material.extensions[key]=json.extensions[key];if(void 0!==json.lights&&(material.lights=json.lights),void 0!==json.clipping&&(material.clipping=json.clipping),void 0!==json.size&&(material.size=json.size),void 0!==json.sizeAttenuation&&(material.sizeAttenuation=json.sizeAttenuation),void 0!==json.map&&(material.map=getTexture(json.map)),void 0!==json.matcap&&(material.matcap=getTexture(json.matcap)),void 0!==json.alphaMap&&(material.alphaMap=getTexture(json.alphaMap)),void 0!==json.bumpMap&&(material.bumpMap=getTexture(json.bumpMap)),void 0!==json.bumpScale&&(material.bumpScale=json.bumpScale),void 0!==json.normalMap&&(material.normalMap=getTexture(json.normalMap)),void 0!==json.normalMapType&&(material.normalMapType=json.normalMapType),void 0!==json.normalScale){let normalScale=json.normalScale;!1===Array.isArray(normalScale)&&(normalScale=[normalScale,normalScale]),material.normalScale=(new Vector2).fromArray(normalScale)}return void 0!==json.displacementMap&&(material.displacementMap=getTexture(json.displacementMap)),void 0!==json.displacementScale&&(material.displacementScale=json.displacementScale),void 0!==json.displacementBias&&(material.displacementBias=json.displacementBias),void 0!==json.roughnessMap&&(material.roughnessMap=getTexture(json.roughnessMap)),void 0!==json.metalnessMap&&(material.metalnessMap=getTexture(json.metalnessMap)),void 0!==json.emissiveMap&&(material.emissiveMap=getTexture(json.emissiveMap)),void 0!==json.emissiveIntensity&&(material.emissiveIntensity=json.emissiveIntensity),void 0!==json.specularMap&&(material.specularMap=getTexture(json.specularMap)),void 0!==json.specularIntensityMap&&(material.specularIntensityMap=getTexture(json.specularIntensityMap)),void 0!==json.specularColorMap&&(material.specularColorMap=getTexture(json.specularColorMap)),void 0!==json.envMap&&(material.envMap=getTexture(json.envMap)),void 0!==json.envMapIntensity&&(material.envMapIntensity=json.envMapIntensity),void 0!==json.reflectivity&&(material.reflectivity=json.reflectivity),void 0!==json.refractionRatio&&(material.refractionRatio=json.refractionRatio),void 0!==json.lightMap&&(material.lightMap=getTexture(json.lightMap)),void 0!==json.lightMapIntensity&&(material.lightMapIntensity=json.lightMapIntensity),void 0!==json.aoMap&&(material.aoMap=getTexture(json.aoMap)),void 0!==json.aoMapIntensity&&(material.aoMapIntensity=json.aoMapIntensity),void 0!==json.gradientMap&&(material.gradientMap=getTexture(json.gradientMap)),void 0!==json.clearcoatMap&&(material.clearcoatMap=getTexture(json.clearcoatMap)),void 0!==json.clearcoatRoughnessMap&&(material.clearcoatRoughnessMap=getTexture(json.clearcoatRoughnessMap)),void 0!==json.clearcoatNormalMap&&(material.clearcoatNormalMap=getTexture(json.clearcoatNormalMap)),void 0!==json.clearcoatNormalScale&&(material.clearcoatNormalScale=(new Vector2).fromArray(json.clearcoatNormalScale)),void 0!==json.iridescenceMap&&(material.iridescenceMap=getTexture(json.iridescenceMap)),void 0!==json.iridescenceThicknessMap&&(material.iridescenceThicknessMap=getTexture(json.iridescenceThicknessMap)),void 0!==json.transmissionMap&&(material.transmissionMap=getTexture(json.transmissionMap)),void 0!==json.thicknessMap&&(material.thicknessMap=getTexture(json.thicknessMap)),void 0!==json.anisotropyMap&&(material.anisotropyMap=getTexture(json.anisotropyMap)),void 0!==json.sheenColorMap&&(material.sheenColorMap=getTexture(json.sheenColorMap)),void 0!==json.sheenRoughnessMap&&(material.sheenRoughnessMap=getTexture(json.sheenRoughnessMap)),material}setTextures(value){return this.textures=value,this}static createMaterialFromType(type){return new{ShadowMaterial:ShadowMaterial,SpriteMaterial:SpriteMaterial,RawShaderMaterial:RawShaderMaterial,ShaderMaterial:ShaderMaterial,PointsMaterial:PointsMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshToonMaterial:MeshToonMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshBasicMaterial:MeshBasicMaterial,MeshMatcapMaterial:MeshMatcapMaterial,LineDashedMaterial:LineDashedMaterial,LineBasicMaterial:LineBasicMaterial,Material:Material}[type]}}class LoaderUtils{static decodeText(array){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(array);let s="";for(let i=0,il=array.length;i0){const manager=new LoadingManager(onLoad);loader=new ImageLoader(manager),loader.setCrossOrigin(this.crossOrigin);for(let i=0,il=json.length;i0){loader=new ImageLoader(this.manager),loader.setCrossOrigin(this.crossOrigin);for(let i=0,il=json.length;i0){this.source.connect(this.filters[0]);for(let i=1,l=this.filters.length;i0){this.source.disconnect(this.filters[0]);for(let i=1,l=this.filters.length;i0&&this._mixBufferRegionAdditive(buffer,offset,this._addIndex*stride,1,stride);for(let i=stride,e=stride+stride;i!==e;++i)if(buffer[i]!==buffer[i+stride]){binding.setValue(buffer,offset);break}}saveOriginalState(){const binding=this.binding,buffer=this.buffer,stride=this.valueSize,originalValueOffset=stride*this._origIndex;binding.getValue(buffer,originalValueOffset);for(let i=stride,e=originalValueOffset;i!==e;++i)buffer[i]=buffer[originalValueOffset+i%stride];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const originalValueOffset=3*this.valueSize;this.binding.setValue(this.buffer,originalValueOffset)}_setAdditiveIdentityNumeric(){const startIndex=this._addIndex*this.valueSize,endIndex=startIndex+this.valueSize;for(let i=startIndex;i=.5)for(let i=0;i!==stride;++i)buffer[dstOffset+i]=buffer[srcOffset+i]}_slerp(buffer,dstOffset,srcOffset,t){Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,srcOffset,t)}_slerpAdditive(buffer,dstOffset,srcOffset,t,stride){const workOffset=this._workIndex*stride;Quaternion.multiplyQuaternionsFlat(buffer,workOffset,buffer,dstOffset,buffer,srcOffset),Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,workOffset,t)}_lerp(buffer,dstOffset,srcOffset,t,stride){const s=1-t;for(let i=0;i!==stride;++i){const j=dstOffset+i;buffer[j]=buffer[j]*s+buffer[srcOffset+i]*t}}_lerpAdditive(buffer,dstOffset,srcOffset,t,stride){for(let i=0;i!==stride;++i){const j=dstOffset+i;buffer[j]=buffer[j]+buffer[srcOffset+i]*t}}}const _reservedRe=new RegExp("[\\[\\]\\.:\\/]","g"),_wordCharOrDot="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",_trackRe=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]")+/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]")+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]")+"$"),_supportedObjectNames=["material","materials","bones","map"];class PropertyBinding{constructor(rootNode,path,parsedPath){this.path=path,this.parsedPath=parsedPath||PropertyBinding.parseTrackName(path),this.node=PropertyBinding.findNode(rootNode,this.parsedPath.nodeName),this.rootNode=rootNode,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(root,path,parsedPath){return root&&root.isAnimationObjectGroup?new PropertyBinding.Composite(root,path,parsedPath):new PropertyBinding(root,path,parsedPath)}static sanitizeNodeName(name){return name.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(trackName){const matches=_trackRe.exec(trackName);if(null===matches)throw new Error("PropertyBinding: Cannot parse trackName: "+trackName);const results={nodeName:matches[2],objectName:matches[3],objectIndex:matches[4],propertyName:matches[5],propertyIndex:matches[6]},lastDot=results.nodeName&&results.nodeName.lastIndexOf(".");if(void 0!==lastDot&&-1!==lastDot){const objectName=results.nodeName.substring(lastDot+1);-1!==_supportedObjectNames.indexOf(objectName)&&(results.nodeName=results.nodeName.substring(0,lastDot),results.objectName=objectName)}if(null===results.propertyName||0===results.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+trackName);return results}static findNode(root,nodeName){if(void 0===nodeName||""===nodeName||"."===nodeName||-1===nodeName||nodeName===root.name||nodeName===root.uuid)return root;if(root.skeleton){const bone=root.skeleton.getBoneByName(nodeName);if(void 0!==bone)return bone}if(root.children){const searchNodeSubtree=function(children){for(let i=0;i=nCachedObjects){const lastCachedIndex=nCachedObjects++,firstActiveObject=objects[lastCachedIndex];indicesByUUID[firstActiveObject.uuid]=index,objects[index]=firstActiveObject,indicesByUUID[uuid]=lastCachedIndex,objects[lastCachedIndex]=object;for(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j],firstActive=bindingsForPath[lastCachedIndex],binding=bindingsForPath[index];bindingsForPath[index]=firstActive,bindingsForPath[lastCachedIndex]=binding}}}this.nCachedObjects_=nCachedObjects}uncache(){const objects=this._objects,indicesByUUID=this._indicesByUUID,bindings=this._bindings,nBindings=bindings.length;let nCachedObjects=this.nCachedObjects_,nObjects=objects.length;for(let i=0,n=arguments.length;i!==n;++i){const uuid=arguments[i].uuid,index=indicesByUUID[uuid];if(void 0!==index)if(delete indicesByUUID[uuid],index0&&(indicesByUUID[lastObject.uuid]=index),objects[index]=lastObject,objects.pop();for(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j];bindingsForPath[index]=bindingsForPath[lastIndex],bindingsForPath.pop()}}}this.nCachedObjects_=nCachedObjects}subscribe_(path,parsedPath){const indicesByPath=this._bindingsIndicesByPath;let index=indicesByPath[path];const bindings=this._bindings;if(void 0!==index)return bindings[index];const paths=this._paths,parsedPaths=this._parsedPaths,objects=this._objects,nObjects=objects.length,nCachedObjects=this.nCachedObjects_,bindingsForPath=new Array(nObjects);index=bindings.length,indicesByPath[path]=index,paths.push(path),parsedPaths.push(parsedPath),bindings.push(bindingsForPath);for(let i=nCachedObjects,n=objects.length;i!==n;++i){const object=objects[i];bindingsForPath[i]=new PropertyBinding(object,path,parsedPath)}return bindingsForPath}unsubscribe_(path){const indicesByPath=this._bindingsIndicesByPath,index=indicesByPath[path];if(void 0!==index){const paths=this._paths,parsedPaths=this._parsedPaths,bindings=this._bindings,lastBindingsIndex=bindings.length-1,lastBindings=bindings[lastBindingsIndex];indicesByPath[path[lastBindingsIndex]]=index,bindings[index]=lastBindings,bindings.pop(),parsedPaths[index]=parsedPaths[lastBindingsIndex],parsedPaths.pop(),paths[index]=paths[lastBindingsIndex],paths.pop()}}}class AnimationAction{constructor(mixer,clip,localRoot=null,blendMode=clip.blendMode){this._mixer=mixer,this._clip=clip,this._localRoot=localRoot,this.blendMode=blendMode;const tracks=clip.tracks,nTracks=tracks.length,interpolants=new Array(nTracks),interpolantSettings={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let i=0;i!==nTracks;++i){const interpolant=tracks[i].createInterpolant(null);interpolants[i]=interpolant,interpolant.settings=interpolantSettings}this._interpolantSettings=interpolantSettings,this._interpolants=interpolants,this._propertyBindings=new Array(nTracks),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,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(time){return this._startTime=time,this}setLoop(mode,repetitions){return this.loop=mode,this.repetitions=repetitions,this}setEffectiveWeight(weight){return this.weight=weight,this._effectiveWeight=this.enabled?weight:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(duration){return this._scheduleFading(duration,0,1)}fadeOut(duration){return this._scheduleFading(duration,1,0)}crossFadeFrom(fadeOutAction,duration,warp){if(fadeOutAction.fadeOut(duration),this.fadeIn(duration),warp){const fadeInDuration=this._clip.duration,fadeOutDuration=fadeOutAction._clip.duration,startEndRatio=fadeOutDuration/fadeInDuration,endStartRatio=fadeInDuration/fadeOutDuration;fadeOutAction.warp(1,startEndRatio,duration),this.warp(endStartRatio,1,duration)}return this}crossFadeTo(fadeInAction,duration,warp){return fadeInAction.crossFadeFrom(this,duration,warp)}stopFading(){const weightInterpolant=this._weightInterpolant;return null!==weightInterpolant&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(weightInterpolant)),this}setEffectiveTimeScale(timeScale){return this.timeScale=timeScale,this._effectiveTimeScale=this.paused?0:timeScale,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(duration){return this.timeScale=this._clip.duration/duration,this.stopWarping()}syncWith(action){return this.time=action.time,this.timeScale=action.timeScale,this.stopWarping()}halt(duration){return this.warp(this._effectiveTimeScale,0,duration)}warp(startTimeScale,endTimeScale,duration){const mixer=this._mixer,now=mixer.time,timeScale=this.timeScale;let interpolant=this._timeScaleInterpolant;null===interpolant&&(interpolant=mixer._lendControlInterpolant(),this._timeScaleInterpolant=interpolant);const times=interpolant.parameterPositions,values=interpolant.sampleValues;return times[0]=now,times[1]=now+duration,values[0]=startTimeScale/timeScale,values[1]=endTimeScale/timeScale,this}stopWarping(){const timeScaleInterpolant=this._timeScaleInterpolant;return null!==timeScaleInterpolant&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(timeScaleInterpolant)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(time,deltaTime,timeDirection,accuIndex){if(!this.enabled)return void this._updateWeight(time);const startTime=this._startTime;if(null!==startTime){const timeRunning=(time-startTime)*timeDirection;timeRunning<0||0===timeDirection?deltaTime=0:(this._startTime=null,deltaTime=timeDirection*timeRunning)}deltaTime*=this._updateTimeScale(time);const clipTime=this._updateTime(deltaTime),weight=this._updateWeight(time);if(weight>0){const interpolants=this._interpolants,propertyMixers=this._propertyBindings;if(this.blendMode===AdditiveAnimationBlendMode)for(let j=0,m=interpolants.length;j!==m;++j)interpolants[j].evaluate(clipTime),propertyMixers[j].accumulateAdditive(weight);else for(let j=0,m=interpolants.length;j!==m;++j)interpolants[j].evaluate(clipTime),propertyMixers[j].accumulate(accuIndex,weight)}}_updateWeight(time){let weight=0;if(this.enabled){weight=this.weight;const interpolant=this._weightInterpolant;if(null!==interpolant){const interpolantValue=interpolant.evaluate(time)[0];weight*=interpolantValue,time>interpolant.parameterPositions[1]&&(this.stopFading(),0===interpolantValue&&(this.enabled=!1))}}return this._effectiveWeight=weight,weight}_updateTimeScale(time){let timeScale=0;if(!this.paused){timeScale=this.timeScale;const interpolant=this._timeScaleInterpolant;if(null!==interpolant){timeScale*=interpolant.evaluate(time)[0],time>interpolant.parameterPositions[1]&&(this.stopWarping(),0===timeScale?this.paused=!0:this.timeScale=timeScale)}}return this._effectiveTimeScale=timeScale,timeScale}_updateTime(deltaTime){const duration=this._clip.duration,loop=this.loop;let time=this.time+deltaTime,loopCount=this._loopCount;const pingPong=loop===LoopPingPong;if(0===deltaTime)return-1===loopCount?time:pingPong&&1==(1&loopCount)?duration-time:time;if(loop===LoopOnce){-1===loopCount&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(time>=duration)time=duration;else{if(!(time<0)){this.time=time;break handle_stop}time=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=time,this._mixer.dispatchEvent({type:"finished",action:this,direction:deltaTime<0?-1:1})}}else{if(-1===loopCount&&(deltaTime>=0?(loopCount=0,this._setEndings(!0,0===this.repetitions,pingPong)):this._setEndings(0===this.repetitions,!0,pingPong)),time>=duration||time<0){const loopDelta=Math.floor(time/duration);time-=duration*loopDelta,loopCount+=Math.abs(loopDelta);const pending=this.repetitions-loopCount;if(pending<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,time=deltaTime>0?duration:0,this.time=time,this._mixer.dispatchEvent({type:"finished",action:this,direction:deltaTime>0?1:-1});else{if(1===pending){const atStart=deltaTime<0;this._setEndings(atStart,!atStart,pingPong)}else this._setEndings(!1,!1,pingPong);this._loopCount=loopCount,this.time=time,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:loopDelta})}}else this.time=time;if(pingPong&&1==(1&loopCount))return duration-time}return time}_setEndings(atStart,atEnd,pingPong){const settings=this._interpolantSettings;pingPong?(settings.endingStart=ZeroSlopeEnding,settings.endingEnd=ZeroSlopeEnding):(settings.endingStart=atStart?this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding,settings.endingEnd=atEnd?this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding)}_scheduleFading(duration,weightNow,weightThen){const mixer=this._mixer,now=mixer.time;let interpolant=this._weightInterpolant;null===interpolant&&(interpolant=mixer._lendControlInterpolant(),this._weightInterpolant=interpolant);const times=interpolant.parameterPositions,values=interpolant.sampleValues;return times[0]=now,values[0]=weightNow,times[1]=now+duration,values[1]=weightThen,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher{constructor(root){super(),this._root=root,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(action,prototypeAction){const root=action._localRoot||this._root,tracks=action._clip.tracks,nTracks=tracks.length,bindings=action._propertyBindings,interpolants=action._interpolants,rootUuid=root.uuid,bindingsByRoot=this._bindingsByRootAndName;let bindingsByName=bindingsByRoot[rootUuid];void 0===bindingsByName&&(bindingsByName={},bindingsByRoot[rootUuid]=bindingsByName);for(let i=0;i!==nTracks;++i){const track=tracks[i],trackName=track.name;let binding=bindingsByName[trackName];if(void 0!==binding)++binding.referenceCount,bindings[i]=binding;else{if(binding=bindings[i],void 0!==binding){null===binding._cacheIndex&&(++binding.referenceCount,this._addInactiveBinding(binding,rootUuid,trackName));continue}const path=prototypeAction&&prototypeAction._propertyBindings[i].binding.parsedPath;binding=new PropertyMixer(PropertyBinding.create(root,trackName,path),track.ValueTypeName,track.getValueSize()),++binding.referenceCount,this._addInactiveBinding(binding,rootUuid,trackName),bindings[i]=binding}interpolants[i].resultBuffer=binding.buffer}}_activateAction(action){if(!this._isActiveAction(action)){if(null===action._cacheIndex){const rootUuid=(action._localRoot||this._root).uuid,clipUuid=action._clip.uuid,actionsForClip=this._actionsByClip[clipUuid];this._bindAction(action,actionsForClip&&actionsForClip.knownActions[0]),this._addInactiveAction(action,clipUuid,rootUuid)}const bindings=action._propertyBindings;for(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];0==binding.useCount++&&(this._lendBinding(binding),binding.saveOriginalState())}this._lendAction(action)}}_deactivateAction(action){if(this._isActiveAction(action)){const bindings=action._propertyBindings;for(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];0==--binding.useCount&&(binding.restoreOriginalState(),this._takeBackBinding(binding))}this._takeBackAction(action)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const scope=this;this.stats={actions:{get total(){return scope._actions.length},get inUse(){return scope._nActiveActions}},bindings:{get total(){return scope._bindings.length},get inUse(){return scope._nActiveBindings}},controlInterpolants:{get total(){return scope._controlInterpolants.length},get inUse(){return scope._nActiveControlInterpolants}}}}_isActiveAction(action){const index=action._cacheIndex;return null!==index&&index=0;--i)actions[i].stop();return this}update(deltaTime){deltaTime*=this.timeScale;const actions=this._actions,nActions=this._nActiveActions,time=this.time+=deltaTime,timeDirection=Math.sign(deltaTime),accuIndex=this._accuIndex^=1;for(let i=0;i!==nActions;++i){actions[i]._update(time,deltaTime,timeDirection,accuIndex)}const bindings=this._bindings,nBindings=this._nActiveBindings;for(let i=0;i!==nBindings;++i)bindings[i].apply(accuIndex);return this}setTime(timeInSeconds){this.time=0;for(let i=0;ithis.max.x||point.ythis.max.y)}containsBox(box){return this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y}getParameter(point,target){return target.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(box){return!(box.max.xthis.max.x||box.max.ythis.max.y)}clampPoint(point,target){return target.copy(point).clamp(this.min,this.max)}distanceToPoint(point){return this.clampPoint(point,_vector$4).distanceTo(point)}intersect(box){return this.min.max(box.min),this.max.min(box.max),this.isEmpty()&&this.makeEmpty(),this}union(box){return this.min.min(box.min),this.max.max(box.max),this}translate(offset){return this.min.add(offset),this.max.add(offset),this}equals(box){return box.min.equals(this.min)&&box.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(start=new Vector3,end=new Vector3){this.start=start,this.end=end}set(start,end){return this.start.copy(start),this.end.copy(end),this}copy(line){return this.start.copy(line.start),this.end.copy(line.end),this}getCenter(target){return target.addVectors(this.start,this.end).multiplyScalar(.5)}delta(target){return target.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,target){return this.delta(target).multiplyScalar(t).add(this.start)}closestPointToPointParameter(point,clampToLine){_startP.subVectors(point,this.start),_startEnd.subVectors(this.end,this.start);const startEnd2=_startEnd.dot(_startEnd);let t=_startEnd.dot(_startP)/startEnd2;return clampToLine&&(t=clamp(t,0,1)),t}closestPointToPoint(point,clampToLine,target){const t=this.closestPointToPointParameter(point,clampToLine);return this.delta(target).multiplyScalar(t).add(this.start)}applyMatrix4(matrix){return this.start.applyMatrix4(matrix),this.end.applyMatrix4(matrix),this}equals(line){return line.start.equals(this.start)&&line.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(light,color){super(),this.light=light,this.matrix=light.matrixWorld,this.matrixAutoUpdate=!1,this.color=color,this.type="SpotLightHelper";const geometry=new BufferGeometry,positions=[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 i=0,j=1,l=32;i1)for(let i=0;i.99999)this.quaternion.set(0,0,0,1);else if(dir.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(dir.z,0,-dir.x).normalize();const radians=Math.acos(dir.y);this.quaternion.setFromAxisAngle(_axis,radians)}}setLength(length,headLength=.2*length,headWidth=.2*headLength){this.line.scale.set(1,Math.max(1e-4,length-headLength),1),this.line.updateMatrix(),this.cone.scale.set(headWidth,headLength,headWidth),this.cone.position.y=length,this.cone.updateMatrix()}setColor(color){this.line.material.color.set(color),this.cone.material.color.set(color)}copy(source){return super.copy(source,!1),this.line.copy(source.line),this.cone.copy(source.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class AxesHelper extends LineSegments{constructor(size=1){const vertices=[0,0,0,size,0,0,0,0,0,0,size,0,0,0,0,0,0,size],geometry=new BufferGeometry;geometry.setAttribute("position",new Float32BufferAttribute(vertices,3)),geometry.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(geometry,new LineBasicMaterial({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(xAxisColor,yAxisColor,zAxisColor){const color=new Color,array=this.geometry.attributes.color.array;return color.set(xAxisColor),color.toArray(array,0),color.toArray(array,3),color.set(yAxisColor),color.toArray(array,6),color.toArray(array,9),color.set(zAxisColor),color.toArray(array,12),color.toArray(array,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color,this.subPaths=[],this.currentPath=null}moveTo(x,y){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(x,y),this}lineTo(x,y){return this.currentPath.lineTo(x,y),this}quadraticCurveTo(aCPx,aCPy,aX,aY){return this.currentPath.quadraticCurveTo(aCPx,aCPy,aX,aY),this}bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY){return this.currentPath.bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY),this}splineThru(pts){return this.currentPath.splineThru(pts),this}toShapes(isCCW){function isPointInsidePolygon(inPt,inPolygon){const polyLen=inPolygon.length;let inside=!1;for(let p=polyLen-1,q=0;qNumber.EPSILON){if(edgeDy<0&&(edgeLowPt=inPolygon[q],edgeDx=-edgeDx,edgeHighPt=inPolygon[p],edgeDy=-edgeDy),inPt.yedgeHighPt.y)continue;if(inPt.y===edgeLowPt.y){if(inPt.x===edgeLowPt.x)return!0}else{const perpEdge=edgeDy*(inPt.x-edgeLowPt.x)-edgeDx*(inPt.y-edgeLowPt.y);if(0===perpEdge)return!0;if(perpEdge<0)continue;inside=!inside}}else{if(inPt.y!==edgeLowPt.y)continue;if(edgeHighPt.x<=inPt.x&&inPt.x<=edgeLowPt.x||edgeLowPt.x<=inPt.x&&inPt.x<=edgeHighPt.x)return!0}}return inside}const isClockWise=ShapeUtils.isClockWise,subPaths=this.subPaths;if(0===subPaths.length)return[];let solid,tmpPath,tmpShape;const shapes=[];if(1===subPaths.length)return tmpPath=subPaths[0],tmpShape=new Shape,tmpShape.curves=tmpPath.curves,shapes.push(tmpShape),shapes;let holesFirst=!isClockWise(subPaths[0].getPoints());holesFirst=isCCW?!holesFirst:holesFirst;const betterShapeHoles=[],newShapes=[];let tmpPoints,tmpHoles,newShapeHoles=[],mainIdx=0;newShapes[mainIdx]=void 0,newShapeHoles[mainIdx]=[];for(let i=0,l=subPaths.length;i1){let ambiguous=!1,toChange=0;for(let sIdx=0,sLen=newShapes.length;sIdx0&&!1===ambiguous&&(newShapeHoles=betterShapeHoles)}for(let i=0,il=newShapes.length;i"},description:"Applies a face emotion of the model."},background:{required:!1,tsType:{name:"Background"},description:"Allows adding a background image and background color to the scene.\nMake sure that image is loadable to prevent bg errors.\nbackground.src - Accepts URL string.\nbackground.color - Accepts Hexadeximal, RGB, X11 color name, HSL string, doesn't support CSS gradients."},capture:{required:!1,tsType:{name:"CaptureType"},description:"Return base64 image after making screenshot of the canvas."},loader:{required:!1,tsType:{name:"ReactNode"},description:"Pass custom fallback component."},dpr:{required:!1,tsType:{name:"Dpr"},description:"Device Pixel Ratio."},className:{required:!1,tsType:{name:"string"},description:"Custom style classes for canvas."},headMovement:{required:!1,tsType:{name:"boolean"},description:"Enable head tracking cursor movements."},cameraZoomTarget:{required:!1,tsType:{name:"Vector3"},description:"Initialise and update camera movement on Z-Axis.\nDefaults to full-body zoom distance."},onLoadedEffect:{required:!1,tsType:{name:"SpawnState['onLoadedEffect']",raw:"SpawnState['onLoadedEffect']"},description:"Spawn effect when model is loaded into scene."},onLoadedAnimation:{required:!1,tsType:{name:"SpawnState['onLoadedAnimation']",raw:"SpawnState['onLoadedAnimation']"},description:"Spawn animation when model is loaded into scene."},fov:{required:!1,tsType:{name:"number"},description:"Field of view of the camera."},effects:{required:!1,tsType:{name:"EffectConfiguration"},description:"Control some effects like post-processing effects"},children:{required:!1,tsType:{name:"ReactNode"},description:"Use any three.js(fiber, post-processing) compatible components to render in the scene."}},composes:["LightingProps","EnvironmentProps","Omit"]};var Avatar_component=AvatarWrapper},"./src/components/Lights/Lights.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{E:function(){return LIGHT_CONFIG},Z:function(){return Lights_component}});var slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),react=__webpack_require__("./node_modules/react/index.js"),defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),toConsumableArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),definedProps=function definedProps(obj){return function fromEntries(arr){return Object.assign.apply(Object,[{}].concat((0,toConsumableArray.Z)(arr.map((function(_ref){var _ref2=(0,slicedToArray.Z)(_ref,2),k=_ref2[0],v=_ref2[1];return(0,defineProperty.Z)({},k,v)})))))}(Object.entries(obj).filter((function(_ref4){var _ref5=(0,slicedToArray.Z)(_ref4,2);_ref5[0];return void 0!==_ref5[1]})))},three_module=__webpack_require__("./node_modules/three/build/three.module.js"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),LIGHT_CONFIG=Object.freeze({fillLightAngle:Math.PI/3,backLightAngle:Math.PI/8,keyLightAngle:Math.PI,silhouetteLightAngle:1.5*Math.PI,keyLightPosition:new three_module.Vector3(.5,1.55,.5),liftLightPosition:new three_module.Vector3(.25,1.7,2),dirLightPosition:new three_module.Vector3(-.75,2.5,-1),silhouetteLightPosition:new three_module.Vector3(-1.5,.1,-1.5),defaultProps:{keyLightIntensity:.8,keyLightColor:"#FFFFFF",fillLightIntensity:3,fillLightColor:"#6794FF",fillLightPosition:new three_module.Vector3(-.5,1.6,-.5),backLightIntensity:6,backLightColor:"#FFB878",backLightPosition:new three_module.Vector3(.5,1.6,-1),lightTarget:new three_module.Vector3(0,1.7,0)}}),Lights=function Lights(lightingProps){var _Object$assign=Object.assign(LIGHT_CONFIG.defaultProps,definedProps(lightingProps)),keyLightIntensity=_Object$assign.keyLightIntensity,keyLightColor=_Object$assign.keyLightColor,fillLightIntensity=_Object$assign.fillLightIntensity,fillLightColor=_Object$assign.fillLightColor,fillLightPosition=_Object$assign.fillLightPosition,backLightIntensity=_Object$assign.backLightIntensity,backLightColor=_Object$assign.backLightColor,backLightPosition=_Object$assign.backLightPosition,lightTarget=_Object$assign.lightTarget,scene=(0,index_673ef987_esm.z)().scene,_useState=(0,react.useState)({head:new three_module.Object3D,shoe:new three_module.Object3D}),targets=(0,slicedToArray.Z)(_useState,1)[0];return(0,react.useEffect)((function(){targets.head.position.copy(lightTarget),targets.shoe.position.set(0,0,0),scene.add(targets.head),scene.add(targets.shoe)}),[]),(0,jsx_runtime.jsxs)("group",{children:[(0,jsx_runtime.jsx)("spotLight",{position:fillLightPosition,target:targets.head,angle:LIGHT_CONFIG.fillLightAngle,color:fillLightColor,intensity:fillLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:backLightPosition,target:targets.head,angle:LIGHT_CONFIG.backLightAngle,color:backLightColor,intensity:backLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:LIGHT_CONFIG.keyLightPosition,target:targets.head,angle:LIGHT_CONFIG.keyLightAngle,color:keyLightColor,intensity:keyLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:LIGHT_CONFIG.liftLightPosition,target:targets.shoe,angle:LIGHT_CONFIG.keyLightAngle,color:keyLightColor,intensity:.25*keyLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:LIGHT_CONFIG.silhouetteLightPosition,target:targets.head,angle:LIGHT_CONFIG.silhouetteLightAngle,color:keyLightColor,intensity:.25*keyLightIntensity,castShadow:!0})]})};Lights.__docgenInfo={description:"",methods:[],displayName:"Lights"};var Lights_component=Lights},"./src/components/Models/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{sb:function(){return AnimationModelContainer},R8:function(){return EnvironmentModelContainer},T9:function(){return HalfBodyModelContainer},dn:function(){return PoseModelContainer},Pn:function(){return StaticModel.P}});var objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),react=__webpack_require__("./node_modules/react/index.js"),regeneratorRuntime=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),Model=__webpack_require__("./src/components/Models/Model/index.ts"),services=__webpack_require__("./src/services/index.ts"),Animation_service=__webpack_require__("./src/services/Animation.service.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),currentRotation=0,AnimationModel=function AnimationModel(_ref){var modelSrc=_ref.modelSrc,animationSrc=_ref.animationSrc,_ref$rotation=_ref.rotation,rotation=void 0===_ref$rotation?Math.PI/180*20:_ref$rotation,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,_ref$idleRotation=_ref.idleRotation,idleRotation=void 0!==_ref$idleRotation&&_ref$idleRotation,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,_ref$headMovement=_ref.headMovement,headMovement=void 0!==_ref$headMovement&&_ref$headMovement,emotion=_ref.emotion,bloom=_ref.bloom,ref=(0,react.useRef)(null),_useState=(0,react.useState)(!0),_useState2=(0,slicedToArray.Z)(_useState,2),animationRunning=_useState2[0],setAnimationRunning=_useState2[1],scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes,animationClip=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",(0,Animation_service.$)(animationSrc));case 1:case"end":return _context.stop()}}),_callee)}))),[animationSrc]),animationMixer=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(){var mixer,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(mixer=new three_module.AnimationMixer(nodes.Armature),!animationRunning){_context2.next=3;break}return _context2.abrupt("return",mixer);case 3:return _context2.t0=mixer,_context2.next=6,animationClip;case 6:return _context2.t1=_context2.sent,(animation=_context2.t0.clipAction.call(_context2.t0,_context2.t1)).fadeIn(0),animation.play(),mixer.update(0),_context2.abrupt("return",mixer);case 12:case"end":return _context2.stop()}}),_callee2)}))),[animationRunning,animationClip,nodes.Armature]);return(0,index_673ef987_esm.A)(function(){var _ref4=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee3(state,delta){var _yield$animationMixer;return(0,regeneratorRuntime.Z)().wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,animationMixer;case 2:if(_context3.t1=_yield$animationMixer=_context3.sent,_context3.t0=null===_context3.t1,_context3.t0){_context3.next=6;break}_context3.t0=void 0===_yield$animationMixer;case 6:if(!_context3.t0){_context3.next=10;break}_context3.next=11;break;case 10:_yield$animationMixer.update(delta);case 11:if(idleRotation){_context3.next=13;break}return _context3.abrupt("return");case 13:null!=ref&&ref.current&&(currentRotation+=.2*delta,ref.current.rotation.y=rotation+Math.sin(currentRotation)/3);case 14:case"end":return _context3.stop()}}),_callee3)})));return function(_x,_x2){return _ref4.apply(this,arguments)}}()),(0,services.bx)({nodes:nodes,enabled:headMovement}),(0,services.Kx)(nodes,emotion),(0,services.FB)("blink",nodes),(0,services.xD)(nodes,setModelFallback),(0,jsx_runtime.jsx)(Model.H,{modelRef:ref,scene:scene,scale:scale,onLoaded:onLoaded,onSpawnAnimationFinish:function onSpawnAnimationFinish(){setAnimationRunning(!1)},bloom:bloom})};AnimationModel.__docgenInfo={description:"",methods:[],displayName:"AnimationModel",props:{rotation:{defaultValue:{value:"20 * (Math.PI / 180)",computed:!1},required:!1},scale:{defaultValue:{value:"1",computed:!1},required:!1},idleRotation:{defaultValue:{value:"false",computed:!1},required:!1},headMovement:{defaultValue:{value:"false",computed:!1},required:!1}}};var AnimationModelContainer=function AnimationModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1];return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(AnimationModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};AnimationModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"AnimationModelContainer"};__webpack_require__("./src/components/Models/FloatingModel/index.ts");var HalfBodyModel_component_currentRotation=0,HalfBodyModel=function HalfBodyModel(_ref){var modelSrc=_ref.modelSrc,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,_ref$rotation=_ref.rotation,rotation=void 0===_ref$rotation?Math.PI/180*20:_ref$rotation,_ref$idleRotation=_ref.idleRotation,idleRotation=void 0!==_ref$idleRotation&&_ref$idleRotation,emotion=_ref.emotion,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,_ref$headMovement=_ref.headMovement,headMovement=void 0!==_ref$headMovement&&_ref$headMovement,bloom=_ref.bloom,ref=(0,react.useRef)(null),scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes;return scene.traverse((function(object){var node=object;"Wolf3D_Hands"===node.name&&(node.visible=!1),"RightHand"===node.name&&node.position.set(0,-2,0),"LeftHand"===node.name&&node.position.set(0,-2,0)})),(0,index_673ef987_esm.A)((function(state,delta){idleRotation&&null!=ref&&ref.current&&(HalfBodyModel_component_currentRotation+=.2*delta,ref.current.rotation.y=rotation+Math.sin(HalfBodyModel_component_currentRotation)/3)})),(0,services.bx)({nodes:nodes,isHalfBody:!0,enabled:headMovement}),(0,services.FB)("blink",nodes),(0,services.Kx)(nodes,emotion),(0,services.xD)(nodes,setModelFallback),(0,jsx_runtime.jsx)(Model.H,{modelRef:ref,scene:scene,scale:scale,onLoaded:onLoaded,bloom:bloom})};HalfBodyModel.__docgenInfo={description:"",methods:[],displayName:"HalfBodyModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1},rotation:{defaultValue:{value:"20 * (Math.PI / 180)",computed:!1},required:!1},idleRotation:{defaultValue:{value:"false",computed:!1},required:!1},headMovement:{defaultValue:{value:"false",computed:!1},required:!1}}};var HalfBodyModelContainer=function HalfBodyModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1];return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(HalfBodyModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};HalfBodyModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"HalfBodyModelContainer"};var StaticModel=__webpack_require__("./src/components/Models/StaticModel/index.ts"),PoseModel=function PoseModel(_ref){var modelSrc=_ref.modelSrc,poseSrc=_ref.poseSrc,modelRef=_ref.modelRef,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,emotion=_ref.emotion,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,bloom=_ref.bloom,scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes,pose=(0,services.Jr)(poseSrc),sourceNodes=(0,index_673ef987_esm.C)(pose.scene).nodes;return(0,services.bu)(nodes,sourceNodes),(0,services.Kx)(nodes,emotion),(0,services.xD)(nodes,setModelFallback),(0,jsx_runtime.jsx)(Model.H,{modelRef:modelRef,scene:scene,scale:scale,onLoaded:onLoaded,bloom:bloom})};PoseModel.__docgenInfo={description:"",methods:[],displayName:"PoseModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}};var PoseModelContainer=function PoseModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1];return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(PoseModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};PoseModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"PoseModelContainer"};var Environment_service=__webpack_require__("./src/services/Environment.service.ts"),EnvironmentModel=function EnvironmentModel(_ref){var environment=_ref.environment,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,transform=new services.wx,scene=(0,services.Jr)(environment).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes;return(0,services.xD)(nodes,setModelFallback),(0,react.useEffect)((function(){return(0,services.DK)(onLoaded)}),[scene,onLoaded]),(0,jsx_runtime.jsx)("group",{children:Object.keys(nodes).map((function(key){var node=nodes[key];return"Mesh"===node.type?(0,jsx_runtime.jsx)("mesh",{receiveShadow:!0,scale:scale,position:transform.position,rotation:transform.rotation,geometry:node.geometry,material:node.material,morphTargetInfluences:node.morphTargetInfluences||[]},node.name):null}))})};EnvironmentModel.__docgenInfo={description:"",methods:[],displayName:"EnvironmentModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}};var EnvironmentModelContainer=function EnvironmentModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1],environment=props.environment,environmentSrc=environment in Environment_service.om?Environment_service.om[environment]:environment;return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(EnvironmentModel,(0,objectSpread2.Z)((0,objectSpread2.Z)({setModelFallback:setFallback},props),{},{environment:environmentSrc}))})};EnvironmentModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"EnvironmentModelContainer"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[40],{"./src/components/Avatar/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:function(){return Avatar_component},b:function(){return CAMERA}});var controls,objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),ContactShadows=__webpack_require__("./node_modules/@react-three/drei/core/ContactShadows.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),OrbitControls=__webpack_require__("./node_modules/three-stdlib/controls/OrbitControls.js"),services=__webpack_require__("./src/services/index.ts"),progress=Number.POSITIVE_INFINITY,CameraControls=function CameraControls(_ref){var cameraTarget=_ref.cameraTarget,cameraInitialDistance=_ref.cameraInitialDistance,cameraZoomTarget=_ref.cameraZoomTarget,_ref$headScale=_ref.headScale,headScale=void 0===_ref$headScale?1:_ref$headScale,_ref$controlsMinDista=_ref.controlsMinDistance,controlsMinDistance=void 0===_ref$controlsMinDista?.4:_ref$controlsMinDista,_ref$controlsMaxDista=_ref.controlsMaxDistance,controlsMaxDistance=void 0===_ref$controlsMaxDista?2.5:_ref$controlsMaxDista,_ref$updateCameraTarg=_ref.updateCameraTargetOnZoom,updateCameraTargetOnZoom=void 0!==_ref$updateCameraTarg&&_ref$updateCameraTarg,cameraZoomTargetRef=(0,react.useRef)(cameraZoomTarget),_useThree=(0,index_99983b2d_esm.A)(),camera=_useThree.camera,gl=_useThree.gl,fallbackCameraTarget=cameraTarget||1.475+headScale/10,headScaleAdjustedMinDistance=controlsMinDistance+headScale/10;return(0,react.useEffect)((function(){var _cameraZoomTargetRef$,_cameraZoomTargetRef$2,_cameraZoomTargetRef$3;return(null===(_cameraZoomTargetRef$=cameraZoomTargetRef.current)||void 0===_cameraZoomTargetRef$?void 0:_cameraZoomTargetRef$.x)===(null==cameraZoomTarget?void 0:cameraZoomTarget.x)&&(null===(_cameraZoomTargetRef$2=cameraZoomTargetRef.current)||void 0===_cameraZoomTargetRef$2?void 0:_cameraZoomTargetRef$2.y)===(null==cameraZoomTarget?void 0:cameraZoomTarget.y)&&(null===(_cameraZoomTargetRef$3=cameraZoomTargetRef.current)||void 0===_cameraZoomTargetRef$3?void 0:_cameraZoomTargetRef$3.z)===(null==cameraZoomTarget?void 0:cameraZoomTarget.z)||(cameraZoomTargetRef.current=cameraZoomTarget,progress=0),(controls=new OrbitControls.z(camera,gl.domElement)).enableRotate=!1,controls.enablePan=!1,controls.minDistance=headScaleAdjustedMinDistance,controls.maxDistance=controlsMaxDistance,controls.minPolarAngle=1.4,controls.maxPolarAngle=1.4,controls.target.set(0,fallbackCameraTarget,0),controls.update(),cameraInitialDistance&&progress===Number.POSITIVE_INFINITY&&(camera.position.z=cameraInitialDistance,controls.update()),function(){controls.dispose()}}),[cameraInitialDistance,camera,controlsMinDistance,controlsMaxDistance,fallbackCameraTarget,gl.domElement,headScaleAdjustedMinDistance,cameraZoomTarget]),(0,index_99983b2d_esm.C)((function(_,delta){updateCameraTargetOnZoom&&function updateCameraTarget(camera,target,minDistance,maxDistance){if(controls){var distance=controls.target.distanceTo(camera.position),pivot=((distance=(0,services.uZ)(distance,maxDistance,minDistance))-minDistance)/(maxDistance-minDistance);controls.target.set(0,target-.6*pivot,0)}}(camera,fallbackCameraTarget,headScaleAdjustedMinDistance,controlsMaxDistance),function updateCameraFocus(camera,delta,target){target&&progress<=1&&(camera.position.setX((0,services.t7)(camera.position.x,target.x,progress)),camera.position.setZ((0,services.t7)(camera.position.z,target.z,progress)),progress+=delta)}(camera,delta,cameraZoomTarget),controls&&controls.update()})),null},Environment_component=__webpack_require__("./src/components/Scene/Environment.component.tsx"),BaseCanvas=__webpack_require__("./src/components/BaseCanvas/index.ts"),Models=__webpack_require__("./src/components/Models/index.ts"),EffectComposer=__webpack_require__("./node_modules/@react-three/postprocessing/dist/EffectComposer.js"),SSAO=__webpack_require__("./node_modules/@react-three/postprocessing/dist/effects/SSAO.js"),Vignette=__webpack_require__("./node_modules/@react-three/postprocessing/dist/effects/Vignette.js"),BrightnessContrast=__webpack_require__("./node_modules/@react-three/postprocessing/dist/effects/BrightnessContrast.js"),HueSaturation=__webpack_require__("./node_modules/@react-three/postprocessing/dist/effects/HueSaturation.js"),esm_react=__webpack_require__("./node_modules/jotai/esm/react.mjs"),Capture_component=__webpack_require__("./src/components/Capture/Capture.component.tsx"),Box_component=__webpack_require__("./src/components/Background/Box/Box.component.tsx"),Background=__webpack_require__("./src/components/Background/index.ts"),Loader_module_loader="Loader_loader__DwtSp",Loader_module_dots="Loader_dots__2HwYS",Loader_module_dot="Loader_dot__8Tb8I",jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),Loader=function Loader(){return(0,jsx_runtime.jsx)("div",{className:Loader_module_loader,children:(0,jsx_runtime.jsx)("div",{className:Loader_module_dots,children:[1,2,3].map((function(it){return(0,jsx_runtime.jsx)("div",{className:Loader_module_dot},it)}))})})};Loader.__docgenInfo={description:"",methods:[],displayName:"Loader"};var components_Loader=Loader,effects_Bloom=__webpack_require__("./node_modules/@react-three/postprocessing/dist/effects/Bloom.js"),Bloom=function Bloom(_ref){var _ref$luminanceThresho=_ref.luminanceThreshold,luminanceThreshold=void 0===_ref$luminanceThresho?1:_ref$luminanceThresho,_ref$luminanceSmoothi=_ref.luminanceSmoothing,luminanceSmoothing=void 0===_ref$luminanceSmoothi?1:_ref$luminanceSmoothi,_ref$mipmapBlur=_ref.mipmapBlur,mipmapBlur=void 0===_ref$mipmapBlur||_ref$mipmapBlur,_ref$intensity=_ref.intensity,intensity=void 0===_ref$intensity?.1:_ref$intensity,_ref$kernelSize=_ref.kernelSize,kernelSize=void 0===_ref$kernelSize?0:_ref$kernelSize;return(0,jsx_runtime.jsx)(effects_Bloom.d,{luminanceThreshold:luminanceThreshold,luminanceSmoothing:luminanceSmoothing,mipmapBlur:mipmapBlur,intensity:intensity,kernelSize:kernelSize})};Bloom.__docgenInfo={description:"",methods:[],displayName:"Bloom",props:{luminanceThreshold:{defaultValue:{value:"1",computed:!1},required:!1},luminanceSmoothing:{defaultValue:{value:"1",computed:!1},required:!1},mipmapBlur:{defaultValue:{value:"true",computed:!1},required:!1},intensity:{defaultValue:{value:"0.1",computed:!1},required:!1},kernelSize:{defaultValue:{value:"0",computed:!1},required:!1}}};var Bloom_component=Bloom,build=__webpack_require__("./node_modules/postprocessing/build/index.js"),Lights_component=__webpack_require__("./src/components/Lights/Lights.component.tsx"),spawnAtom=__webpack_require__("./src/state/spawnAtom.ts"),CAMERA={TARGET:{FULL_BODY:{MALE:1.65,FEMALE:1.55},HALF_BODY:.6},INITIAL_DISTANCE:{FULL_BODY:.4,HALF_BODY:.5},CONTROLS:{FULL_BODY:{MIN_DISTANCE:.5,MAX_DISTANCE:3.2,ZOOM_TARGET:new three_module.Vector3(-.11,0,3.2)},HALF_BODY:{MIN_DISTANCE:.4,MAX_DISTANCE:1.4,ZOOM_TARGET:new three_module.Vector3(-.15,0,.55)}}},Avatar=function Avatar(_ref){var _effects$bloom,_effects$bloom2,_effects$bloom3,_effects$bloom4,_effects$bloom5,modelSrc=_ref.modelSrc,_ref$animationSrc=_ref.animationSrc,animationSrc=void 0===_ref$animationSrc?void 0:_ref$animationSrc,_ref$poseSrc=_ref.poseSrc,poseSrc=void 0===_ref$poseSrc?void 0:_ref$poseSrc,_ref$environment=_ref.environment,environment=void 0===_ref$environment?"soft":_ref$environment,_ref$halfBody=_ref.halfBody,halfBody=void 0!==_ref$halfBody&&_ref$halfBody,_ref$shadows=_ref.shadows,shadows=void 0!==_ref$shadows&&_ref$shadows,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,_ref$cameraTarget=_ref.cameraTarget,cameraTarget=void 0===_ref$cameraTarget?CAMERA.TARGET.FULL_BODY.MALE:_ref$cameraTarget,_ref$cameraInitialDis=_ref.cameraInitialDistance,cameraInitialDistance=void 0===_ref$cameraInitialDis?CAMERA.INITIAL_DISTANCE.FULL_BODY:_ref$cameraInitialDis,style=_ref.style,emotion=_ref.emotion,_ref$idleRotation=_ref.idleRotation,idleRotation=void 0!==_ref$idleRotation&&_ref$idleRotation,capture=_ref.capture,background=_ref.background,onLoaded=_ref.onLoaded,onLoading=_ref.onLoading,dpr=_ref.dpr,className=_ref.className,_ref$headMovement=_ref.headMovement,headMovement=void 0!==_ref$headMovement&&_ref$headMovement,_ref$cameraZoomTarget=_ref.cameraZoomTarget,cameraZoomTarget=void 0===_ref$cameraZoomTarget?CAMERA.CONTROLS.FULL_BODY.ZOOM_TARGET:_ref$cameraZoomTarget,onLoadedEffect=_ref.onLoadedEffect,onLoadedAnimation=_ref.onLoadedAnimation,children=_ref.children,effects=_ref.effects,keyLightIntensity=_ref.keyLightIntensity,keyLightColor=_ref.keyLightColor,fillLightIntensity=_ref.fillLightIntensity,fillLightColor=_ref.fillLightColor,fillLightPosition=_ref.fillLightPosition,backLightIntensity=_ref.backLightIntensity,backLightColor=_ref.backLightColor,backLightPosition=_ref.backLightPosition,lightTarget=_ref.lightTarget,_ref$fov=_ref.fov,fov=void 0===_ref$fov?50:_ref$fov,setSpawnState=(0,esm_react.b9)(spawnAtom.O);(0,react.useEffect)((function(){setSpawnState({onLoadedEffect:onLoadedEffect,onLoadedAnimation:onLoadedAnimation})}),[onLoadedAnimation,onLoadedEffect,setSpawnState]);var AvatarModel=(0,react.useMemo)((function(){return(0,services.w9)(modelSrc)?animationSrc&&!halfBody&&(0,services.w9)(animationSrc)?(0,jsx_runtime.jsx)(Models.sb,{emotion:emotion,modelSrc:modelSrc,animationSrc:animationSrc,scale:scale,idleRotation:idleRotation,onLoaded:onLoaded,headMovement:headMovement,bloom:null==effects?void 0:effects.bloom}):halfBody?(0,jsx_runtime.jsx)(Models.T9,{emotion:emotion,modelSrc:modelSrc,scale:scale,idleRotation:idleRotation,onLoaded:onLoaded,headMovement:headMovement,bloom:null==effects?void 0:effects.bloom}):(0,services.w9)(poseSrc)?(0,jsx_runtime.jsx)(Models.dn,{emotion:emotion,modelSrc:modelSrc,scale:scale,poseSrc:poseSrc,onLoaded:onLoaded,bloom:null==effects?void 0:effects.bloom}):(0,jsx_runtime.jsx)(Models.Pn,{modelSrc:modelSrc,scale:scale,onLoaded:onLoaded,emotion:emotion,bloom:null==effects?void 0:effects.bloom}):null}),[halfBody,animationSrc,modelSrc,scale,poseSrc,idleRotation,emotion,onLoaded,headMovement,null==effects?void 0:effects.bloom]);(0,react.useEffect)((function(){return(0,services.DK)(onLoading)}),[modelSrc,animationSrc,onLoading]);var enablePostProcessing=Boolean((null==effects?void 0:effects.ambientOcclusion)||(null==effects?void 0:effects.bloom)||(null==effects?void 0:effects.vignette));return(0,jsx_runtime.jsxs)(BaseCanvas.u,{enablePostProcessing:enablePostProcessing,position:new three_module.Vector3(0,0,3),fov:fov,style:style,dpr:dpr,className:className,children:[(0,jsx_runtime.jsx)(Environment_component.q,{environment:environment,enablePostProcessing:enablePostProcessing}),(0,jsx_runtime.jsx)(CameraControls,{cameraTarget:cameraTarget,cameraInitialDistance:cameraInitialDistance,cameraZoomTarget:cameraZoomTarget,controlsMinDistance:halfBody?CAMERA.CONTROLS.HALF_BODY.MIN_DISTANCE:CAMERA.CONTROLS.FULL_BODY.MIN_DISTANCE,controlsMaxDistance:halfBody?CAMERA.CONTROLS.HALF_BODY.MAX_DISTANCE:CAMERA.CONTROLS.FULL_BODY.MAX_DISTANCE,updateCameraTargetOnZoom:!halfBody}),AvatarModel,children,shadows&&(0,jsx_runtime.jsx)(ContactShadows.j,{position:[0,0,0],opacity:2,scale:10,blur:1,far:1}),(null==background?void 0:background.src)&&(0,jsx_runtime.jsx)(Box_component.x,(0,objectSpread2.Z)({},background)),capture&&(0,jsx_runtime.jsx)(Capture_component.Z,(0,objectSpread2.Z)({},capture)),(null==background?void 0:background.color)&&(0,jsx_runtime.jsx)(Background.l,{color:background.color}),enablePostProcessing&&(0,jsx_runtime.jsx)(EffectComposer.x,{autoClear:!0,multisampling:4,enableNormalPass:null==effects?void 0:effects.ambientOcclusion,children:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(null==effects?void 0:effects.ambientOcclusion)&&(0,jsx_runtime.jsx)(SSAO.K,{blendFunction:build.YQ.MULTIPLY,distanceScaling:!1,radius:.08,bias:.01,intensity:3,samples:31,worldDistanceThreshold:24,worldDistanceFalloff:0,worldProximityThreshold:0,worldProximityFalloff:6,fade:.02,rings:8}),(null==effects?void 0:effects.bloom)&&(0,jsx_runtime.jsx)(Bloom_component,{luminanceThreshold:null==effects||null===(_effects$bloom=effects.bloom)||void 0===_effects$bloom?void 0:_effects$bloom.luminanceThreshold,luminanceSmoothing:null==effects||null===(_effects$bloom2=effects.bloom)||void 0===_effects$bloom2?void 0:_effects$bloom2.luminanceSmoothing,intensity:null==effects||null===(_effects$bloom3=effects.bloom)||void 0===_effects$bloom3?void 0:_effects$bloom3.intensity,kernelSize:null==effects||null===(_effects$bloom4=effects.bloom)||void 0===_effects$bloom4?void 0:_effects$bloom4.kernelSize,mipmapBlur:null==effects||null===(_effects$bloom5=effects.bloom)||void 0===_effects$bloom5?void 0:_effects$bloom5.mipmapBlur}),(null==effects?void 0:effects.vignette)&&(0,jsx_runtime.jsx)(Vignette.s,{eskil:!1,offset:.5,darkness:.5}),(0,jsx_runtime.jsx)(BrightnessContrast.F,{brightness:.025,contrast:.25}),(0,jsx_runtime.jsx)(HueSaturation.v,{hue:0,saturation:-.2})]})}),(0,jsx_runtime.jsx)(Lights_component.Z,{keyLightIntensity:keyLightIntensity,keyLightColor:keyLightColor,fillLightIntensity:fillLightIntensity,fillLightColor:fillLightColor,fillLightPosition:fillLightPosition,backLightIntensity:backLightIntensity,backLightColor:backLightColor,backLightPosition:backLightPosition,lightTarget:lightTarget})]})},AvatarWrapper=function AvatarWrapper(props){var _props$loader;return(0,jsx_runtime.jsx)(react.Suspense,{fallback:null!==(_props$loader=props.loader)&&void 0!==_props$loader?_props$loader:(0,jsx_runtime.jsx)(components_Loader,{}),children:(0,jsx_runtime.jsx)(esm_react.zt,{children:(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)({},props))})})};AvatarWrapper.__docgenInfo={description:"",methods:[],displayName:"AvatarWrapper",props:{modelSrc:{required:!0,tsType:{name:"union",raw:"string | Blob",elements:[{name:"string"},{name:"Blob"}]},description:"Arbitrary binary data (base64 string, Blob) of a `.glb` file or path (URL) to a `.glb` resource."},animationSrc:{required:!1,tsType:{name:"union",raw:"string | Blob",elements:[{name:"string"},{name:"Blob"}]},description:"Arbitrary binary data (base64 string, Blob) of a `.glb|.fbx` file or path (URL) to a `.glb|.fbx` resource.\nThe animation will be run for the 3D model provided in `modelSrc`."},poseSrc:{required:!1,tsType:{name:"union",raw:"string | Blob",elements:[{name:"string"},{name:"Blob"}]},description:"Arbitrary binary data (base64 string, Blob) or a path (URL) to `.glb` file which will be used to map Bone placements onto the underlying 3D model.\nApplied when not specifying an animation."},halfBody:{required:!1,tsType:{name:"boolean"},description:""},shadows:{required:!1,tsType:{name:"boolean"},description:"Enable rendering shadows on ground."},scale:{required:!1,tsType:{name:"number"},description:"Size of the rendered GLB model."},cameraTarget:{required:!1,tsType:{name:"number"},description:"Camera target on Y-axis."},cameraInitialDistance:{required:!1,tsType:{name:"number"},description:"Initial Z-axis distance from the object upon render."},style:{required:!1,tsType:{name:"CSSProperties"},description:"Apply styling to canvas DOM element.\nNote that background property can not be set via style prop, it will always be overridden to `transparent`.\nInstead, use `background` prop for that purpose."},idleRotation:{required:!1,tsType:{name:"boolean"},description:"Applies an idle rotation to the animated and half-body models."},emotion:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"number"}],raw:"Record"},description:"Applies a face emotion of the model."},background:{required:!1,tsType:{name:"Background"},description:"Allows adding a background image and background color to the scene.\nMake sure that image is loadable to prevent bg errors.\nbackground.src - Accepts URL string.\nbackground.color - Accepts Hexadeximal, RGB, X11 color name, HSL string, doesn't support CSS gradients."},capture:{required:!1,tsType:{name:"CaptureType"},description:"Return base64 image after making screenshot of the canvas."},loader:{required:!1,tsType:{name:"ReactNode"},description:"Pass custom fallback component."},dpr:{required:!1,tsType:{name:"Dpr"},description:"Device Pixel Ratio."},className:{required:!1,tsType:{name:"string"},description:"Custom style classes for canvas."},headMovement:{required:!1,tsType:{name:"boolean"},description:"Enable head tracking cursor movements."},cameraZoomTarget:{required:!1,tsType:{name:"Vector3"},description:"Initialise and update camera movement on Z-Axis.\nDefaults to full-body zoom distance."},onLoadedEffect:{required:!1,tsType:{name:"SpawnState['onLoadedEffect']",raw:"SpawnState['onLoadedEffect']"},description:"Spawn effect when model is loaded into scene."},onLoadedAnimation:{required:!1,tsType:{name:"SpawnState['onLoadedAnimation']",raw:"SpawnState['onLoadedAnimation']"},description:"Spawn animation when model is loaded into scene."},fov:{required:!1,tsType:{name:"number"},description:"Field of view of the camera."},effects:{required:!1,tsType:{name:"EffectConfiguration"},description:"Control some effects like post-processing effects"},children:{required:!1,tsType:{name:"ReactNode"},description:"Use any three.js(fiber, post-processing) compatible components to render in the scene."}},composes:["LightingProps","EnvironmentProps","Omit"]};var Avatar_component=AvatarWrapper},"./src/components/Lights/Lights.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{E:function(){return LIGHT_CONFIG},Z:function(){return Lights_component}});var slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),react=__webpack_require__("./node_modules/react/index.js"),defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),toConsumableArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),definedProps=function definedProps(obj){return function fromEntries(arr){return Object.assign.apply(Object,[{}].concat((0,toConsumableArray.Z)(arr.map((function(_ref){var _ref2=(0,slicedToArray.Z)(_ref,2),k=_ref2[0],v=_ref2[1];return(0,defineProperty.Z)({},k,v)})))))}(Object.entries(obj).filter((function(_ref4){var _ref5=(0,slicedToArray.Z)(_ref4,2);_ref5[0];return void 0!==_ref5[1]})))},three_module=__webpack_require__("./node_modules/three/build/three.module.js"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),LIGHT_CONFIG=Object.freeze({fillLightAngle:Math.PI/3,backLightAngle:Math.PI/8,keyLightAngle:Math.PI,silhouetteLightAngle:1.5*Math.PI,keyLightPosition:new three_module.Vector3(.5,1.55,.5),liftLightPosition:new three_module.Vector3(.25,1.7,2),dirLightPosition:new three_module.Vector3(-.75,2.5,-1),silhouetteLightPosition:new three_module.Vector3(-1.5,.1,-1.5),defaultProps:{keyLightIntensity:.8,keyLightColor:"#FFFFFF",fillLightIntensity:3,fillLightColor:"#6794FF",fillLightPosition:new three_module.Vector3(-.5,1.6,-.5),backLightIntensity:6,backLightColor:"#FFB878",backLightPosition:new three_module.Vector3(.5,1.6,-1),lightTarget:new three_module.Vector3(0,1.7,0)}}),Lights=function Lights(lightingProps){var _Object$assign=Object.assign(LIGHT_CONFIG.defaultProps,definedProps(lightingProps)),keyLightIntensity=_Object$assign.keyLightIntensity,keyLightColor=_Object$assign.keyLightColor,fillLightIntensity=_Object$assign.fillLightIntensity,fillLightColor=_Object$assign.fillLightColor,fillLightPosition=_Object$assign.fillLightPosition,backLightIntensity=_Object$assign.backLightIntensity,backLightColor=_Object$assign.backLightColor,backLightPosition=_Object$assign.backLightPosition,lightTarget=_Object$assign.lightTarget,scene=(0,index_99983b2d_esm.A)().scene,_useState=(0,react.useState)({head:new three_module.Object3D,shoe:new three_module.Object3D}),targets=(0,slicedToArray.Z)(_useState,1)[0];return(0,react.useEffect)((function(){targets.head.position.copy(lightTarget),targets.shoe.position.set(0,0,0),scene.add(targets.head),scene.add(targets.shoe)}),[]),(0,jsx_runtime.jsxs)("group",{children:[(0,jsx_runtime.jsx)("spotLight",{position:fillLightPosition,target:targets.head,angle:LIGHT_CONFIG.fillLightAngle,color:fillLightColor,intensity:fillLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:backLightPosition,target:targets.head,angle:LIGHT_CONFIG.backLightAngle,color:backLightColor,intensity:backLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:LIGHT_CONFIG.keyLightPosition,target:targets.head,angle:LIGHT_CONFIG.keyLightAngle,color:keyLightColor,intensity:keyLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:LIGHT_CONFIG.liftLightPosition,target:targets.shoe,angle:LIGHT_CONFIG.keyLightAngle,color:keyLightColor,intensity:.25*keyLightIntensity,castShadow:!0}),(0,jsx_runtime.jsx)("spotLight",{position:LIGHT_CONFIG.silhouetteLightPosition,target:targets.head,angle:LIGHT_CONFIG.silhouetteLightAngle,color:keyLightColor,intensity:.25*keyLightIntensity,castShadow:!0})]})};Lights.__docgenInfo={description:"",methods:[],displayName:"Lights"};var Lights_component=Lights},"./src/components/Models/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{sb:function(){return AnimationModelContainer},R8:function(){return EnvironmentModelContainer},T9:function(){return HalfBodyModelContainer},dn:function(){return PoseModelContainer},Pn:function(){return StaticModel.P}});var objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),react=__webpack_require__("./node_modules/react/index.js"),regeneratorRuntime=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),Model=__webpack_require__("./src/components/Models/Model/index.ts"),services=__webpack_require__("./src/services/index.ts"),Animation_service=__webpack_require__("./src/services/Animation.service.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),currentRotation=0,AnimationModel=function AnimationModel(_ref){var modelSrc=_ref.modelSrc,animationSrc=_ref.animationSrc,_ref$rotation=_ref.rotation,rotation=void 0===_ref$rotation?Math.PI/180*20:_ref$rotation,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,_ref$idleRotation=_ref.idleRotation,idleRotation=void 0!==_ref$idleRotation&&_ref$idleRotation,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,_ref$headMovement=_ref.headMovement,headMovement=void 0!==_ref$headMovement&&_ref$headMovement,emotion=_ref.emotion,bloom=_ref.bloom,ref=(0,react.useRef)(null),_useState=(0,react.useState)(!0),_useState2=(0,slicedToArray.Z)(_useState,2),animationRunning=_useState2[0],setAnimationRunning=_useState2[1],scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_99983b2d_esm.D)(scene).nodes,animationClip=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",(0,Animation_service.$)(animationSrc));case 1:case"end":return _context.stop()}}),_callee)}))),[animationSrc]),animationMixer=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(){var mixer,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(mixer=new three_module.AnimationMixer(nodes.Armature),!animationRunning){_context2.next=3;break}return _context2.abrupt("return",mixer);case 3:return _context2.t0=mixer,_context2.next=6,animationClip;case 6:return _context2.t1=_context2.sent,(animation=_context2.t0.clipAction.call(_context2.t0,_context2.t1)).fadeIn(0),animation.play(),mixer.update(0),_context2.abrupt("return",mixer);case 12:case"end":return _context2.stop()}}),_callee2)}))),[animationRunning,animationClip,nodes.Armature]);return(0,index_99983b2d_esm.C)(function(){var _ref4=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee3(state,delta){var _yield$animationMixer;return(0,regeneratorRuntime.Z)().wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,animationMixer;case 2:if(_context3.t1=_yield$animationMixer=_context3.sent,_context3.t0=null===_context3.t1,_context3.t0){_context3.next=6;break}_context3.t0=void 0===_yield$animationMixer;case 6:if(!_context3.t0){_context3.next=10;break}_context3.next=11;break;case 10:_yield$animationMixer.update(delta);case 11:if(idleRotation){_context3.next=13;break}return _context3.abrupt("return");case 13:null!=ref&&ref.current&&(currentRotation+=.2*delta,ref.current.rotation.y=rotation+Math.sin(currentRotation)/3);case 14:case"end":return _context3.stop()}}),_callee3)})));return function(_x,_x2){return _ref4.apply(this,arguments)}}()),(0,services.bx)({nodes:nodes,enabled:headMovement}),(0,services.Kx)(nodes,emotion),(0,services.FB)("blink",nodes),(0,services.xD)(nodes,setModelFallback),(0,jsx_runtime.jsx)(Model.H,{modelRef:ref,scene:scene,scale:scale,onLoaded:onLoaded,onSpawnAnimationFinish:function onSpawnAnimationFinish(){setAnimationRunning(!1)},bloom:bloom})};AnimationModel.__docgenInfo={description:"",methods:[],displayName:"AnimationModel",props:{rotation:{defaultValue:{value:"20 * (Math.PI / 180)",computed:!1},required:!1},scale:{defaultValue:{value:"1",computed:!1},required:!1},idleRotation:{defaultValue:{value:"false",computed:!1},required:!1},headMovement:{defaultValue:{value:"false",computed:!1},required:!1}}};var AnimationModelContainer=function AnimationModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1];return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(AnimationModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};AnimationModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"AnimationModelContainer"};__webpack_require__("./src/components/Models/FloatingModel/index.ts");var HalfBodyModel_component_currentRotation=0,HalfBodyModel=function HalfBodyModel(_ref){var modelSrc=_ref.modelSrc,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,_ref$rotation=_ref.rotation,rotation=void 0===_ref$rotation?Math.PI/180*20:_ref$rotation,_ref$idleRotation=_ref.idleRotation,idleRotation=void 0!==_ref$idleRotation&&_ref$idleRotation,emotion=_ref.emotion,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,_ref$headMovement=_ref.headMovement,headMovement=void 0!==_ref$headMovement&&_ref$headMovement,bloom=_ref.bloom,ref=(0,react.useRef)(null),scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_99983b2d_esm.D)(scene).nodes;return scene.traverse((function(object){var node=object;"Wolf3D_Hands"===node.name&&(node.visible=!1),"RightHand"===node.name&&node.position.set(0,-2,0),"LeftHand"===node.name&&node.position.set(0,-2,0)})),(0,index_99983b2d_esm.C)((function(state,delta){idleRotation&&null!=ref&&ref.current&&(HalfBodyModel_component_currentRotation+=.2*delta,ref.current.rotation.y=rotation+Math.sin(HalfBodyModel_component_currentRotation)/3)})),(0,services.bx)({nodes:nodes,isHalfBody:!0,enabled:headMovement}),(0,services.FB)("blink",nodes),(0,services.Kx)(nodes,emotion),(0,services.xD)(nodes,setModelFallback),(0,jsx_runtime.jsx)(Model.H,{modelRef:ref,scene:scene,scale:scale,onLoaded:onLoaded,bloom:bloom})};HalfBodyModel.__docgenInfo={description:"",methods:[],displayName:"HalfBodyModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1},rotation:{defaultValue:{value:"20 * (Math.PI / 180)",computed:!1},required:!1},idleRotation:{defaultValue:{value:"false",computed:!1},required:!1},headMovement:{defaultValue:{value:"false",computed:!1},required:!1}}};var HalfBodyModelContainer=function HalfBodyModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1];return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(HalfBodyModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};HalfBodyModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"HalfBodyModelContainer"};var StaticModel=__webpack_require__("./src/components/Models/StaticModel/index.ts"),PoseModel=function PoseModel(_ref){var modelSrc=_ref.modelSrc,poseSrc=_ref.poseSrc,modelRef=_ref.modelRef,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,emotion=_ref.emotion,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,bloom=_ref.bloom,scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_99983b2d_esm.D)(scene).nodes,pose=(0,services.Jr)(poseSrc),sourceNodes=(0,index_99983b2d_esm.D)(pose.scene).nodes;return(0,services.bu)(nodes,sourceNodes),(0,services.Kx)(nodes,emotion),(0,services.xD)(nodes,setModelFallback),(0,jsx_runtime.jsx)(Model.H,{modelRef:modelRef,scene:scene,scale:scale,onLoaded:onLoaded,bloom:bloom})};PoseModel.__docgenInfo={description:"",methods:[],displayName:"PoseModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}};var PoseModelContainer=function PoseModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1];return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(PoseModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};PoseModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"PoseModelContainer"};var Environment_service=__webpack_require__("./src/services/Environment.service.ts"),EnvironmentModel=function EnvironmentModel(_ref){var environment=_ref.environment,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,transform=new services.wx,scene=(0,services.Jr)(environment).scene,nodes=(0,index_99983b2d_esm.D)(scene).nodes;return(0,services.xD)(nodes,setModelFallback),(0,react.useEffect)((function(){return(0,services.DK)(onLoaded)}),[scene,onLoaded]),(0,jsx_runtime.jsx)("group",{children:Object.keys(nodes).map((function(key){var node=nodes[key];return"Mesh"===node.type?(0,jsx_runtime.jsx)("mesh",{receiveShadow:!0,scale:scale,position:transform.position,rotation:transform.rotation,geometry:node.geometry,material:node.material,morphTargetInfluences:node.morphTargetInfluences||[]},node.name):null}))})};EnvironmentModel.__docgenInfo={description:"",methods:[],displayName:"EnvironmentModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}};var EnvironmentModelContainer=function EnvironmentModelContainer(props){var _useState=(0,react.useState)((0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})),_useState2=(0,slicedToArray.Z)(_useState,2),fallback=_useState2[0],setFallback=_useState2[1],environment=props.environment,environmentSrc=environment in Environment_service.om?Environment_service.om[environment]:environment;return(0,jsx_runtime.jsx)(react.Suspense,{fallback:fallback,children:(0,jsx_runtime.jsx)(EnvironmentModel,(0,objectSpread2.Z)((0,objectSpread2.Z)({setModelFallback:setFallback},props),{},{environment:environmentSrc}))})};EnvironmentModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"EnvironmentModelContainer"}}}]); \ No newline at end of file diff --git a/docs/576.ad2dabc8.iframe.bundle.js b/docs/576.ad2dabc8.iframe.bundle.js new file mode 100644 index 00000000..0b57a38b --- /dev/null +++ b/docs/576.ad2dabc8.iframe.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see 576.ad2dabc8.iframe.bundle.js.LICENSE.txt */ +(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[576],{"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}__webpack_require__.d(__webpack_exports__,{Z:function(){return _objectWithoutProperties}})},"./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _regeneratorRuntime}});var _typeof_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");function _regeneratorRuntime(){_regeneratorRuntime=function _regeneratorRuntime(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}try{define({},"")}catch(err){define=function define(obj,key,value){return obj[key]=value}}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,(function(){return this}));var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach((function(method){define(prototype,method,(function(arg){return this._invoke(method,arg)}))}))}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==(0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__.Z)(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then((function(value){invoke("next",value,resolve,reject)}),(function(err){invoke("throw",err,resolve,reject)})):PromiseImpl.resolve(value).then((function(unwrapped){result.value=unwrapped,resolve(result)}),(function(error){return invoke("throw",error,resolve,reject)}))}reject(record.arg)}var previousPromise;defineProperty(this,"_invoke",{value:function value(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl((function(resolve,reject){invoke(method,arg,resolve,reject)}))}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(void 0===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel}},catch:function _catch(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _slicedToArray}});var unsupportedIterableToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}(arr,i)||(0,unsupportedIterableToArray.Z)(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _toPropertyKey}});var esm_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!==(0,esm_typeof.Z)(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!==(0,esm_typeof.Z)(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"===(0,esm_typeof.Z)(key)?key:String(key)}},"./node_modules/@babel/runtime/helpers/esm/typeof.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}__webpack_require__.d(__webpack_exports__,{Z:function(){return _typeof}})},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return _unsupportedIterableToArray}});var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen):void 0}}},"./node_modules/@react-three/drei/core/ContactShadows.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{j:function(){return ContactShadows}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js");const HorizontalBlurShader={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "},VerticalBlurShader={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform float v;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 sum = vec4( 0.0 );\n\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n gl_FragColor = sum;\n\n }\n "},ContactShadows=react.forwardRef((({scale:scale=10,frames:frames=1/0,opacity:opacity=1,width:width=1,height:height=1,blur:blur=1,near:near=0,far:far=10,resolution:resolution=512,smooth:smooth=!0,color:color="#000000",depthWrite:depthWrite=!1,renderOrder:renderOrder,...props},fref)=>{const ref=react.useRef(null),scene=(0,index_99983b2d_esm.A)((state=>state.scene)),gl=(0,index_99983b2d_esm.A)((state=>state.gl)),shadowCamera=react.useRef(null);width*=Array.isArray(scale)?scale[0]:scale||1,height*=Array.isArray(scale)?scale[1]:scale||1;const[renderTarget,planeGeometry,depthMaterial,blurPlane,horizontalBlurMaterial,verticalBlurMaterial,renderTargetBlur]=react.useMemo((()=>{const renderTarget=new three_module.WebGLRenderTarget(resolution,resolution),renderTargetBlur=new three_module.WebGLRenderTarget(resolution,resolution);renderTargetBlur.texture.generateMipmaps=renderTarget.texture.generateMipmaps=!1;const planeGeometry=new three_module.PlaneGeometry(width,height).rotateX(Math.PI/2),blurPlane=new three_module.Mesh(planeGeometry),depthMaterial=new three_module.MeshDepthMaterial;depthMaterial.depthTest=depthMaterial.depthWrite=!1,depthMaterial.onBeforeCompile=shader=>{shader.uniforms={...shader.uniforms,ucolor:{value:new three_module.Color(color)}},shader.fragmentShader=shader.fragmentShader.replace("void main() {","uniform vec3 ucolor;\n void main() {\n "),shader.fragmentShader=shader.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const horizontalBlurMaterial=new three_module.ShaderMaterial(HorizontalBlurShader),verticalBlurMaterial=new three_module.ShaderMaterial(VerticalBlurShader);return verticalBlurMaterial.depthTest=horizontalBlurMaterial.depthTest=!1,[renderTarget,planeGeometry,depthMaterial,blurPlane,horizontalBlurMaterial,verticalBlurMaterial,renderTargetBlur]}),[resolution,width,height,scale,color]),blurShadows=blur=>{blurPlane.visible=!0,blurPlane.material=horizontalBlurMaterial,horizontalBlurMaterial.uniforms.tDiffuse.value=renderTarget.texture,horizontalBlurMaterial.uniforms.h.value=1*blur/256,gl.setRenderTarget(renderTargetBlur),gl.render(blurPlane,shadowCamera.current),blurPlane.material=verticalBlurMaterial,verticalBlurMaterial.uniforms.tDiffuse.value=renderTargetBlur.texture,verticalBlurMaterial.uniforms.v.value=1*blur/256,gl.setRenderTarget(renderTarget),gl.render(blurPlane,shadowCamera.current),blurPlane.visible=!1};let initialBackground,initialOverrideMaterial,count=0;return(0,index_99983b2d_esm.C)((()=>{shadowCamera.current&&(frames===1/0||countref.current),[]),react.createElement("group",(0,esm_extends.Z)({"rotation-x":Math.PI/2},props,{ref:ref}),react.createElement("mesh",{renderOrder:renderOrder,geometry:planeGeometry,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},react.createElement("meshBasicMaterial",{transparent:!0,map:renderTarget.texture,opacity:opacity,depthWrite:depthWrite})),react.createElement("orthographicCamera",{ref:shadowCamera,args:[-width/2,width/2,height/2,-height/2,near,far]}))}))},"./node_modules/@react-three/drei/core/Environment.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{qA:function(){return Environment}});var esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("./node_modules/react/index.js"),index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js");class GroundProjectedEnv extends three_module.Mesh{constructor(texture,options){var _a,_b;const isCubeMap=(def=texture)&&def.isCubeTexture;var def;const cubeSize=(null!=(_b=isCubeMap?null==(_a=texture.image[0])?void 0:_a.width:texture.image.width)?_b:1024)/4,_lodMax=Math.floor(Math.log2(cubeSize)),_cubeSize=Math.pow(2,_lodMax),fragmentShader=[isCubeMap?"#define ENVMAP_TYPE_CUBE":"","#define CUBEUV_TEXEL_WIDTH "+1/(3*Math.max(_cubeSize,112)),"#define CUBEUV_TEXEL_HEIGHT "+1/(4*_cubeSize),`#define CUBEUV_MAX_MIP ${_lodMax}.0`].join("\n")+`\n #define ENVMAP_TYPE_CUBE_UV\n varying vec3 vWorldPosition;\n uniform float radius;\n uniform float height;\n uniform float angle;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube map;\n #else\n uniform sampler2D map;\n #endif\n // From: https://www.shadertoy.com/view/4tsBD7\n float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n {\n float d = dot ( rd, n );\n \n if( d > 0.0 ) { return 1e6; }\n \n vec3 o = ro - c;\n float t = - dot( n, o ) / d;\n vec3 q = o + rd * t;\n \n return ( dot( q, q ) < r * r ) ? t : 1e6;\n }\n // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) \n {\n vec3 oc = ro - ce;\n float b = dot( oc, rd );\n float c = dot( oc, oc ) - ra * ra;\n float h = b * b - c;\n \n if( h < 0.0 ) { return -1.0; }\n \n h = sqrt( h );\n \n return - b + h;\n }\n vec3 project() \n {\n vec3 p = normalize( vWorldPosition );\n vec3 camPos = cameraPosition;\n camPos.y -= height;\n float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n if( intersection > 0.0 ) {\n \n vec3 h = vec3( 0.0, - height, 0.0 );\n float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n p = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n } else {\n p = vec3( 0.0, 1.0, 0.0 );\n }\n return p;\n }\n #include \n #include \n void main() \n {\n vec3 projectedWorldPosition = project();\n \n #ifdef ENVMAP_TYPE_CUBE\n vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n #else\n vec3 direction = normalize( projectedWorldPosition );\n vec2 uv = equirectUv( direction );\n vec3 outcolor = texture2D( map, uv ).rgb;\n #endif\n gl_FragColor = vec4( outcolor, 1.0 );\n #include \n #include <${parseInt(three_module.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n }\n `,uniforms={map:{value:texture},height:{value:(null==options?void 0:options.height)||15},radius:{value:(null==options?void 0:options.radius)||100}};super(new three_module.IcosahedronGeometry(1,16),new three_module.ShaderMaterial({uniforms:uniforms,fragmentShader:fragmentShader,vertexShader:"\n varying vec3 vWorldPosition;\n void main() \n {\n vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n vWorldPosition = worldPosition.xyz;\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",side:three_module.DoubleSide}))}set radius(radius){this.material.uniforms.radius.value=radius}get radius(){return this.material.uniforms.radius.value}set height(height){this.material.uniforms.height.value=height}get height(){return this.material.uniforms.height.value}}class RGBELoader extends three_module.DataTextureLoader{constructor(manager){super(manager),this.type=three_module.HalfFloatType}parse(buffer){const rgbe_error=function(rgbe_error_code,msg){switch(rgbe_error_code){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(msg||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(msg||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(msg||""));default:throw new Error("THREE.RGBELoader: Memory Error: "+(msg||""))}},fgets=function(buffer2,lineLimit,consume){lineLimit=lineLimit||1024;let p=buffer2.pos,i=-1,len=0,s="",chunk=String.fromCharCode.apply(null,new Uint16Array(buffer2.subarray(p,p+128)));for(;0>(i=chunk.indexOf("\n"))&&len=buffer2.byteLength||!(line=fgets(buffer2)))&&rgbe_error(1,"no header found"),(match=line.match(/^#\?(\S+)/))||rgbe_error(3,"bad initial token"),header.valid|=1,header.programtype=match[1],header.string+=line+"\n";line=fgets(buffer2),!1!==line;)if(header.string+=line+"\n","#"!==line.charAt(0)){if((match=line.match(gamma_re))&&(header.gamma=parseFloat(match[1])),(match=line.match(exposure_re))&&(header.exposure=parseFloat(match[1])),(match=line.match(format_re))&&(header.valid|=2,header.format=match[1]),(match=line.match(dimensions_re))&&(header.valid|=4,header.height=parseInt(match[1],10),header.width=parseInt(match[2],10)),2&header.valid&&4&header.valid)break}else header.comments+=line+"\n";return 2&header.valid||rgbe_error(3,"missing format specifier"),4&header.valid||rgbe_error(3,"missing image size specifier"),header}(byteArray),w=rgbe_header_info.width,h=rgbe_header_info.height,image_rgba_data=function(buffer2,w2,h2){const scanline_width=w2;if(scanline_width<8||scanline_width>32767||2!==buffer2[0]||2!==buffer2[1]||128&buffer2[2])return new Uint8Array(buffer2);scanline_width!==(buffer2[2]<<8|buffer2[3])&&rgbe_error(3,"wrong scanline width");const data_rgba=new Uint8Array(4*w2*h2);data_rgba.length||rgbe_error(4,"unable to allocate buffer space");let offset=0,pos=0;const ptr_end=4*scanline_width,rgbeStart=new Uint8Array(4),scanline_buffer=new Uint8Array(ptr_end);let num_scanlines=h2;for(;num_scanlines>0&&posbuffer2.byteLength&&rgbe_error(1),rgbeStart[0]=buffer2[pos++],rgbeStart[1]=buffer2[pos++],rgbeStart[2]=buffer2[pos++],rgbeStart[3]=buffer2[pos++],2==rgbeStart[0]&&2==rgbeStart[1]&&(rgbeStart[2]<<8|rgbeStart[3])==scanline_width||rgbe_error(3,"bad rgbe scanline format");let count,ptr=0;for(;ptr128;if(isEncodedRun&&(count-=128),(0===count||ptr+count>ptr_end)&&rgbe_error(3,"bad scanline data"),isEncodedRun){const byteValue=buffer2[pos++];for(let i=0;i>lc&(1<ni)return!1;getBits(6,c,lc,uInt8Array2,p);var l=getBitsReturn.l;if(c=getBitsReturn.c,lc=getBitsReturn.lc,hcode[im]=l,63==l){if(p.value-inOffset.value>ni)throw"Something wrong with hufUnpackEncTable";getBits(8,c,lc,uInt8Array2,p);var zerun=getBitsReturn.l+6;if(c=getBitsReturn.c,lc=getBitsReturn.lc,im+zerun>iM+1)throw"Something wrong with hufUnpackEncTable";for(;zerun--;)hcode[im++]=0;im--}else if(l>=59){if(im+(zerun=l-59+2)>iM+1)throw"Something wrong with hufUnpackEncTable";for(;zerun--;)hcode[im++]=0;im--}}!function hufCanonicalCodeTable(hcode){for(var i=0;i<=58;++i)hufTableBuffer[i]=0;for(i=0;i<65537;++i)hufTableBuffer[hcode[i]]+=1;var c=0;for(i=58;i>0;--i){var nc=c+hufTableBuffer[i]>>1;hufTableBuffer[i]=c,c=nc}for(i=0;i<65537;++i){var l=hcode[i];l>0&&(hcode[i]=l|hufTableBuffer[l]++<<6)}}(hcode)}function hufLength(code){return 63&code}function hufCode(code){return code>>6}const getCharReturn={c:0,lc:0};function getChar(c,lc,uInt8Array2,inOffset){c=c<<8|parseUint8Array(uInt8Array2,inOffset),lc+=8,getCharReturn.c=c,getCharReturn.lc=lc}const getCodeReturn={c:0,lc:0};function getCode(po,rlc,c,lc,uInt8Array2,inDataView,inOffset,outBuffer,outBufferOffset,outBufferEndOffset){if(po==rlc){lc<8&&(getChar(c,lc,uInt8Array2,inOffset),c=getCharReturn.c,lc=getCharReturn.lc);var cs=c>>(lc-=8);cs=new Uint8Array([cs])[0];if(outBufferOffset.value+cs>outBufferEndOffset)return!1;for(var s=outBuffer[outBufferOffset.value-1];cs-- >0;)outBuffer[outBufferOffset.value++]=s}else{if(!(outBufferOffset.value32767?ref-65536:ref}const wdec14Return={a:0,b:0};function wdec14(l,h){var ls=Int16(l),hs=Int16(h),ai=ls+(1&hs)+(hs>>1),as=ai,bs=ai-hs;wdec14Return.a=as,wdec14Return.b=bs}function wdec16(l,h){var m=UInt16(l),d=UInt16(h),bb=m-(d>>1)&65535,aa=d+bb-32768&65535;wdec14Return.a=aa,wdec14Return.b=bb}function wav2Decode(buffer2,j,nx,ox,ny,oy,mx){for(var p2,w14=mx<16384,n=nx>ny?ny:nx,p=1;p<=n;)p<<=1;for(p2=p>>=1,p>>=1;p>=1;){for(var i00,i01,i10,i11,py=0,ey=py+oy*(ny-p2),oy1=oy*p,oy2=oy*p2,ox1=ox*p,ox2=ox*p2;py<=ey;py+=oy2){for(var px=py,ex=py+ox*(nx-p2);px<=ex;px+=ox2){var p01=px+ox1,p11=(p10=px+oy1)+ox1;w14?(wdec14(buffer2[px+j],buffer2[p10+j]),i00=wdec14Return.a,i10=wdec14Return.b,wdec14(buffer2[p01+j],buffer2[p11+j]),i01=wdec14Return.a,i11=wdec14Return.b,wdec14(i00,i01),buffer2[px+j]=wdec14Return.a,buffer2[p01+j]=wdec14Return.b,wdec14(i10,i11),buffer2[p10+j]=wdec14Return.a,buffer2[p11+j]=wdec14Return.b):(wdec16(buffer2[px+j],buffer2[p10+j]),i00=wdec14Return.a,i10=wdec14Return.b,wdec16(buffer2[p01+j],buffer2[p11+j]),i01=wdec14Return.a,i11=wdec14Return.b,wdec16(i00,i01),buffer2[px+j]=wdec14Return.a,buffer2[p01+j]=wdec14Return.b,wdec16(i10,i11),buffer2[p10+j]=wdec14Return.a,buffer2[p11+j]=wdec14Return.b)}if(nx&p){var p10=px+oy1;w14?wdec14(buffer2[px+j],buffer2[p10+j]):wdec16(buffer2[px+j],buffer2[p10+j]),i00=wdec14Return.a,buffer2[p10+j]=wdec14Return.b,buffer2[px+j]=i00}}if(ny&p)for(px=py,ex=py+ox*(nx-p2);px<=ex;px+=ox2){p01=px+ox1;w14?wdec14(buffer2[px+j],buffer2[p01+j]):wdec16(buffer2[px+j],buffer2[p01+j]),i00=wdec14Return.a,buffer2[p01+j]=wdec14Return.b,buffer2[px+j]=i00}p2=p,p>>=1}return py}function hufUncompress(uInt8Array2,inDataView,inOffset,nCompressed,outBuffer,nRaw){var initialInOffset=inOffset.value,im=parseUint32(inDataView,inOffset),iM=parseUint32(inDataView,inOffset);inOffset.value+=4;var nBits=parseUint32(inDataView,inOffset);if(inOffset.value+=4,im<0||im>=65537||iM<0||iM>=65537)throw"Something wrong with HUF_ENCSIZE";var freq=new Array(65537),hdec=new Array(16384);if(function hufClearDecTable(hdec){for(var i=0;i<16384;i++)hdec[i]={},hdec[i].len=0,hdec[i].lit=0,hdec[i].p=null}(hdec),hufUnpackEncTable(uInt8Array2,0,inOffset,nCompressed-(inOffset.value-initialInOffset),im,iM,freq),nBits>8*(nCompressed-(inOffset.value-initialInOffset)))throw"Something wrong with hufUncompress";!function hufBuildDecTable(hcode,im,iM,hdecod){for(;im<=iM;im++){var c=hufCode(hcode[im]),l=hufLength(hcode[im]);if(c>>l)throw"Invalid table entry";if(l>14){if((pl=hdecod[c>>l-14]).len)throw"Invalid table entry";if(pl.lit++,pl.p){var p=pl.p;pl.p=new Array(pl.lit);for(var i=0;i0;i--){var pl;if((pl=hdecod[(c<<14-l)+plOffset]).len||pl.p)throw"Invalid table entry";pl.len=l,pl.lit=im,plOffset++}}}return!0}(freq,im,iM,hdec),function hufDecode(encodingTable,decodingTable,uInt8Array2,inDataView,inOffset,ni,rlc,no,outBuffer,outOffset){for(var c=0,lc=0,outBufferEndOffset=no,inOffsetEnd=Math.trunc(inOffset.value+(ni+7)/8);inOffset.value=14;)if((pl=decodingTable[c>>lc-14&16383]).len)lc-=pl.len,getCode(pl.lit,rlc,c,lc,uInt8Array2,0,inOffset,outBuffer,outOffset,outBufferEndOffset),c=getCodeReturn.c,lc=getCodeReturn.lc;else{if(!pl.p)throw"hufDecode issues";var j;for(j=0;j=l&&hufCode(encodingTable[pl.p[j]])==(c>>lc-l&(1<>=i,lc-=i;lc>0;){var pl;if(!(pl=decodingTable[c<<14-lc&16383]).len)throw"hufDecode issues";lc-=pl.len,getCode(pl.lit,rlc,c,lc,uInt8Array2,0,inOffset,outBuffer,outOffset,outBufferEndOffset),c=getCodeReturn.c,lc=getCodeReturn.lc}return!0}(freq,hdec,uInt8Array2,0,inOffset,nBits,iM,nRaw,outBuffer,{value:0})}function predictor(source){for(var t=1;tstop||(out[s++]=source[t1++],s>stop));)out[s++]=source[t2++]}function decodeRunLength(source){for(var size=source.byteLength,out=new Array,p=0,reader=new DataView(source);size>0;){var l=reader.getInt8(p++);if(l<0){size-=(count=-l)+1;for(var i=0;i>8==255?dctComp+=255&acValue:(halfZigBlock[dctComp]=acValue,dctComp++),currAcComp.value++}function unZigZag(src,dst){dst[0]=decodeFloat16(src[0]),dst[1]=decodeFloat16(src[1]),dst[2]=decodeFloat16(src[5]),dst[3]=decodeFloat16(src[6]),dst[4]=decodeFloat16(src[14]),dst[5]=decodeFloat16(src[15]),dst[6]=decodeFloat16(src[27]),dst[7]=decodeFloat16(src[28]),dst[8]=decodeFloat16(src[2]),dst[9]=decodeFloat16(src[4]),dst[10]=decodeFloat16(src[7]),dst[11]=decodeFloat16(src[13]),dst[12]=decodeFloat16(src[16]),dst[13]=decodeFloat16(src[26]),dst[14]=decodeFloat16(src[29]),dst[15]=decodeFloat16(src[42]),dst[16]=decodeFloat16(src[3]),dst[17]=decodeFloat16(src[8]),dst[18]=decodeFloat16(src[12]),dst[19]=decodeFloat16(src[17]),dst[20]=decodeFloat16(src[25]),dst[21]=decodeFloat16(src[30]),dst[22]=decodeFloat16(src[41]),dst[23]=decodeFloat16(src[43]),dst[24]=decodeFloat16(src[9]),dst[25]=decodeFloat16(src[11]),dst[26]=decodeFloat16(src[18]),dst[27]=decodeFloat16(src[24]),dst[28]=decodeFloat16(src[31]),dst[29]=decodeFloat16(src[40]),dst[30]=decodeFloat16(src[44]),dst[31]=decodeFloat16(src[53]),dst[32]=decodeFloat16(src[10]),dst[33]=decodeFloat16(src[19]),dst[34]=decodeFloat16(src[23]),dst[35]=decodeFloat16(src[32]),dst[36]=decodeFloat16(src[39]),dst[37]=decodeFloat16(src[45]),dst[38]=decodeFloat16(src[52]),dst[39]=decodeFloat16(src[54]),dst[40]=decodeFloat16(src[20]),dst[41]=decodeFloat16(src[22]),dst[42]=decodeFloat16(src[33]),dst[43]=decodeFloat16(src[38]),dst[44]=decodeFloat16(src[46]),dst[45]=decodeFloat16(src[51]),dst[46]=decodeFloat16(src[55]),dst[47]=decodeFloat16(src[60]),dst[48]=decodeFloat16(src[21]),dst[49]=decodeFloat16(src[34]),dst[50]=decodeFloat16(src[37]),dst[51]=decodeFloat16(src[47]),dst[52]=decodeFloat16(src[50]),dst[53]=decodeFloat16(src[56]),dst[54]=decodeFloat16(src[59]),dst[55]=decodeFloat16(src[61]),dst[56]=decodeFloat16(src[35]),dst[57]=decodeFloat16(src[36]),dst[58]=decodeFloat16(src[48]),dst[59]=decodeFloat16(src[49]),dst[60]=decodeFloat16(src[57]),dst[61]=decodeFloat16(src[58]),dst[62]=decodeFloat16(src[62]),dst[63]=decodeFloat16(src[63])}function dctInverse(data){const a=.5*Math.cos(.7853975),b=.5*Math.cos(3.14159/16),c=.5*Math.cos(3.14159/8),d=.5*Math.cos(3*3.14159/16),e=.5*Math.cos(.981746875),f=.5*Math.cos(3*3.14159/8),g=.5*Math.cos(1.374445625);for(var alpha=new Array(4),beta=new Array(4),theta=new Array(4),gamma=new Array(4),row=0;row<8;++row){var rowPtr=8*row;alpha[0]=c*data[rowPtr+2],alpha[1]=f*data[rowPtr+2],alpha[2]=c*data[rowPtr+6],alpha[3]=f*data[rowPtr+6],beta[0]=b*data[rowPtr+1]+d*data[rowPtr+3]+e*data[rowPtr+5]+g*data[rowPtr+7],beta[1]=d*data[rowPtr+1]-g*data[rowPtr+3]-b*data[rowPtr+5]-e*data[rowPtr+7],beta[2]=e*data[rowPtr+1]-b*data[rowPtr+3]+g*data[rowPtr+5]+d*data[rowPtr+7],beta[3]=g*data[rowPtr+1]-e*data[rowPtr+3]+d*data[rowPtr+5]-b*data[rowPtr+7],theta[0]=a*(data[rowPtr+0]+data[rowPtr+4]),theta[3]=a*(data[rowPtr+0]-data[rowPtr+4]),theta[1]=alpha[0]+alpha[3],theta[2]=alpha[1]-alpha[2],gamma[0]=theta[0]+theta[1],gamma[1]=theta[3]+theta[2],gamma[2]=theta[3]-theta[2],gamma[3]=theta[0]-theta[1],data[rowPtr+0]=gamma[0]+beta[0],data[rowPtr+1]=gamma[1]+beta[1],data[rowPtr+2]=gamma[2]+beta[2],data[rowPtr+3]=gamma[3]+beta[3],data[rowPtr+4]=gamma[3]-beta[3],data[rowPtr+5]=gamma[2]-beta[2],data[rowPtr+6]=gamma[1]-beta[1],data[rowPtr+7]=gamma[0]-beta[0]}for(var column=0;column<8;++column)alpha[0]=c*data[16+column],alpha[1]=f*data[16+column],alpha[2]=c*data[48+column],alpha[3]=f*data[48+column],beta[0]=b*data[8+column]+d*data[24+column]+e*data[40+column]+g*data[56+column],beta[1]=d*data[8+column]-g*data[24+column]-b*data[40+column]-e*data[56+column],beta[2]=e*data[8+column]-b*data[24+column]+g*data[40+column]+d*data[56+column],beta[3]=g*data[8+column]-e*data[24+column]+d*data[40+column]-b*data[56+column],theta[0]=a*(data[column]+data[32+column]),theta[3]=a*(data[column]-data[32+column]),theta[1]=alpha[0]+alpha[3],theta[2]=alpha[1]-alpha[2],gamma[0]=theta[0]+theta[1],gamma[1]=theta[3]+theta[2],gamma[2]=theta[3]-theta[2],gamma[3]=theta[0]-theta[1],data[0+column]=gamma[0]+beta[0],data[8+column]=gamma[1]+beta[1],data[16+column]=gamma[2]+beta[2],data[24+column]=gamma[3]+beta[3],data[32+column]=gamma[3]-beta[3],data[40+column]=gamma[2]-beta[2],data[48+column]=gamma[1]-beta[1],data[56+column]=gamma[0]-beta[0]}function csc709Inverse(data){for(var i=0;i<64;++i){var y=data[0][i],cb=data[1][i],cr=data[2][i];data[0][i]=y+1.5747*cr,data[1][i]=y-.1873*cb-.4682*cr,data[2][i]=y+1.8556*cb}}function convertToHalf(src,dst,idx){for(var i=0;i<64;++i)dst[idx+i]=three_module.DataUtils.toHalfFloat(toLinear(src[i]))}function toLinear(float){return float<=1?Math.sign(float)*Math.pow(Math.abs(float),2.2):Math.sign(float)*Math.pow(logBase,Math.abs(float)-1)}function uncompressRAW(info){return new DataView(info.array.buffer,info.offset.value,info.size)}function uncompressRLE(info){var compressed=info.viewer.buffer.slice(info.offset.value,info.offset.value+info.size),rawBuffer=new Uint8Array(decodeRunLength(compressed)),tmpBuffer=new Uint8Array(rawBuffer.length);return predictor(rawBuffer),interleaveScalar(rawBuffer,tmpBuffer),new DataView(tmpBuffer.buffer)}function uncompressZIP(info){var compressed=info.array.slice(info.offset.value,info.offset.value+info.size),rawBuffer=(0,browser.HT)(compressed),tmpBuffer=new Uint8Array(rawBuffer.length);return predictor(rawBuffer),interleaveScalar(rawBuffer,tmpBuffer),new DataView(tmpBuffer.buffer)}function uncompressPIZ(info){for(var inDataView=info.viewer,inOffset={value:info.offset.value},outBuffer=new Uint16Array(info.width*info.scanlineBlockSize*(info.channels*info.type)),bitmap=new Uint8Array(8192),outBufferEnd=0,pizChannelData=new Array(info.channels),i=0;i=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(minNonZero<=maxNonZero)for(i=0;i>3]&1<<(7&i))&&(lut[k++]=i);for(var n=k-1;k<65536;)lut[k++]=0;return n}(bitmap,lut),length=parseUint32(inDataView,inOffset);hufUncompress(info.array,inDataView,inOffset,length,outBuffer,outBufferEnd);for(i=0;i0;){var name=parseNullTerminatedString(inDataView.buffer,inOffset),value=parseUint8(inDataView,inOffset),compression=value>>2&3,index=new Int8Array([(value>>4)-1])[0],type=parseUint8(inDataView,inOffset);channelRules.push({name:name,index:index,type:type,compression:compression}),ruleSize-=name.length+3}for(var channels=EXRHeader.channels,channelData=new Array(info.channels),i=0;i=0&&(cscSet.idx[rule.index]=offset2),cd.offset=offset2)}if(dwaHeader.acCompressedSize>0)switch(dwaHeader.acCompression){case 0:var acBuffer=new Uint16Array(dwaHeader.totalAcUncompressedCount);hufUncompress(info.array,inDataView,inOffset,dwaHeader.acCompressedSize,acBuffer,dwaHeader.totalAcUncompressedCount);break;case 1:var compressed=info.array.slice(inOffset.value,inOffset.value+dwaHeader.totalAcUncompressedCount),data=(0,browser.HT)(compressed);acBuffer=new Uint16Array(data.buffer);inOffset.value+=dwaHeader.totalAcUncompressedCount}if(dwaHeader.dcCompressedSize>0){var zlibInfo={array:info.array,offset:inOffset,size:dwaHeader.dcCompressedSize},dcBuffer=new Uint16Array(uncompressZIP(zlibInfo).buffer);inOffset.value+=dwaHeader.dcCompressedSize}if(dwaHeader.rleRawSize>0){compressed=info.array.slice(inOffset.value,inOffset.value+dwaHeader.rleCompressedSize);var rleBuffer=decodeRunLength((data=(0,browser.HT)(compressed)).buffer);inOffset.value+=dwaHeader.rleCompressedSize}var outBufferEnd=0,rowOffsets=new Array(channelData.length);for(i=0;i>10,fraction=1023&binary;return(binary>>15?-1:1)*(exponent?31===exponent?fraction?NaN:1/0:Math.pow(2,exponent-15)*(1+fraction/1024):fraction/1024*6103515625e-14)}function parseUint16(dataView,offset2){var Uint16=dataView.getUint16(offset2.value,!0);return offset2.value+=2,Uint16}function parseFloat16(buffer2,offset2){return decodeFloat16(parseUint16(buffer2,offset2))}function parseValue(dataView,buffer2,offset2,type,size){return"string"===type||"stringvector"===type||"iccProfile"===type?function parseFixedLengthString(buffer2,offset2,size){var stringValue=(new TextDecoder).decode(new Uint8Array(buffer2).slice(offset2.value,offset2.value+size));return offset2.value=offset2.value+size,stringValue}(buffer2,offset2,size):"chlist"===type?function parseChlist(dataView,buffer2,offset2,size){for(var startOffset=offset2.value,channels=[];offset2.valueEXRDecoder.height?EXRDecoder.height-line:EXRDecoder.scanlineBlockSize;const viewer=EXRDecoder.size=EXRDecoder.height)break;for(let channelID=0;channelID{let out;switch(type){case three_module.UnsignedByteType:out=new Uint8ClampedArray(width*height*4);break;case three_module.HalfFloatType:out=new Uint16Array(width*height*4);break;case three_module.UnsignedIntType:out=new Uint32Array(width*height*4);break;case three_module.ByteType:out=new Int8Array(width*height*4);break;case three_module.ShortType:out=new Int16Array(width*height*4);break;case three_module.IntType:out=new Int32Array(width*height*4);break;case three_module.FloatType:out=new Float32Array(width*height*4);break;default:throw new Error("Unsupported data type")}return out};let _canReadPixelsResult;class QuadRenderer_6HrRQdJM_QuadRenderer{constructor(options){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)},this._width=options.width,this._height=options.height,this._type=options.type,this._colorSpace=options.colorSpace;const rtOptions={format:three_module.RGBAFormat,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:void 0!==(null===(_a=options.renderTargetOptions)||void 0===_a?void 0:_a.anisotropy)?null===(_b=options.renderTargetOptions)||void 0===_b?void 0:_b.anisotropy:1,generateMipmaps:void 0!==(null===(_c=options.renderTargetOptions)||void 0===_c?void 0:_c.generateMipmaps)&&(null===(_d=options.renderTargetOptions)||void 0===_d?void 0:_d.generateMipmaps),magFilter:void 0!==(null===(_e=options.renderTargetOptions)||void 0===_e?void 0:_e.magFilter)?null===(_f=options.renderTargetOptions)||void 0===_f?void 0:_f.magFilter:three_module.LinearFilter,minFilter:void 0!==(null===(_g=options.renderTargetOptions)||void 0===_g?void 0:_g.minFilter)?null===(_h=options.renderTargetOptions)||void 0===_h?void 0:_h.minFilter:three_module.LinearFilter,samples:void 0!==(null===(_j=options.renderTargetOptions)||void 0===_j?void 0:_j.samples)?null===(_k=options.renderTargetOptions)||void 0===_k?void 0:_k.samples:void 0,wrapS:void 0!==(null===(_l=options.renderTargetOptions)||void 0===_l?void 0:_l.wrapS)?null===(_m=options.renderTargetOptions)||void 0===_m?void 0:_m.wrapS:three_module.ClampToEdgeWrapping,wrapT:void 0!==(null===(_o=options.renderTargetOptions)||void 0===_o?void 0:_o.wrapT)?null===(_p=options.renderTargetOptions)||void 0===_p?void 0:_p.wrapT:three_module.ClampToEdgeWrapping};if(this._material=options.material,options.renderer?this._renderer=options.renderer:(this._renderer=QuadRenderer_6HrRQdJM_QuadRenderer.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new three_module.Scene,this._camera=new three_module.OrthographicCamera,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((type,renderer,camera,renderTargetOptions)=>{if(void 0!==_canReadPixelsResult)return _canReadPixelsResult;const testRT=new three_module.WebGLRenderTarget(1,1,renderTargetOptions);renderer.setRenderTarget(testRT);const mesh=new three_module.Mesh(new three_module.PlaneGeometry,new three_module.MeshBasicMaterial({color:16777215}));renderer.render(mesh,camera),renderer.setRenderTarget(null);const out=getBufferForType(type,testRT.width,testRT.height);return renderer.readRenderTargetPixels(testRT,0,0,testRT.width,testRT.height,out),testRT.dispose(),mesh.geometry.dispose(),mesh.material.dispose(),_canReadPixelsResult=0!==out[0],_canReadPixelsResult})(this._type,this._renderer,this._camera,rtOptions)){let alternativeType;if(this._type===three_module.HalfFloatType)alternativeType=this._renderer.extensions.has("EXT_color_buffer_float")?three_module.FloatType:void 0;void 0!==alternativeType?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${three_module.FloatType}`),this._type=alternativeType):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new three_module.Mesh(new three_module.PlaneGeometry,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new three_module.WebGLRenderTarget(this.width,this.height,rtOptions),this._renderTarget.texture.mapping=void 0!==(null===(_q=options.renderTargetOptions)||void 0===_q?void 0:_q.mapping)?null===(_r=options.renderTargetOptions)||void 0===_r?void 0:_r.mapping:three_module.UVMapping}static instantiateRenderer(){const renderer=new three_module.WebGLRenderer;return renderer.setSize(128,128),renderer}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const out=getBufferForType(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,out),out}toDataTexture(options){const returnValue=new three_module.DataTexture(this.toArray(),this.width,this.height,three_module.RGBAFormat,this._type,(null==options?void 0:options.mapping)||three_module.UVMapping,(null==options?void 0:options.wrapS)||three_module.ClampToEdgeWrapping,(null==options?void 0:options.wrapT)||three_module.ClampToEdgeWrapping,(null==options?void 0:options.magFilter)||three_module.LinearFilter,(null==options?void 0:options.minFilter)||three_module.LinearFilter,(null==options?void 0:options.anisotropy)||1,three_module.LinearSRGBColorSpace);return returnValue.generateMipmaps=void 0!==(null==options?void 0:options.generateMipmaps)&&(null==options?void 0:options.generateMipmaps),returnValue}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(disposeRenderTarget){this.disposeOnDemandRenderer(),disposeRenderTarget&&this.renderTarget.dispose(),this.material instanceof three_module.ShaderMaterial&&Object.values(this.material.uniforms).forEach((v=>{v.value instanceof three_module.Texture&&v.value.dispose()})),Object.values(this.material).forEach((value=>{value instanceof three_module.Texture&&value.dispose()})),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(value){this._width=value,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(value){this._height=value,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(value){this._renderTarget=value,this._width=value.width,this._height=value.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class GainMapDecoderMaterial extends three_module.ShaderMaterial{constructor({gamma:gamma,offsetHdr:offsetHdr,offsetSdr:offsetSdr,gainMapMin:gainMapMin,gainMapMax:gainMapMax,maxDisplayBoost:maxDisplayBoost,hdrCapacityMin:hdrCapacityMin,hdrCapacityMax:hdrCapacityMax,sdr:sdr,gainMap:gainMap}){super({name:"GainMapDecoderMaterial",vertexShader:"\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n// min half float value\n#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )\n// max half float value\n#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )\n\nuniform sampler2D sdr;\nuniform sampler2D gainMap;\nuniform vec3 gamma;\nuniform vec3 offsetHdr;\nuniform vec3 offsetSdr;\nuniform vec3 gainMapMin;\nuniform vec3 gainMapMax;\nuniform float weightFactor;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec3 rgb = texture2D( sdr, vUv ).rgb;\n vec3 recovery = texture2D( gainMap, vUv ).rgb;\n vec3 logRecovery = pow( recovery, gamma );\n vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;\n vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;\n vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));\n gl_FragColor = vec4( clampedHdrColor , 1.0 );\n}\n",uniforms:{sdr:{value:sdr},gainMap:{value:gainMap},gamma:{value:new three_module.Vector3(1/gamma[0],1/gamma[1],1/gamma[2])},offsetHdr:{value:(new three_module.Vector3).fromArray(offsetHdr)},offsetSdr:{value:(new three_module.Vector3).fromArray(offsetSdr)},gainMapMin:{value:(new three_module.Vector3).fromArray(gainMapMin)},gainMapMax:{value:(new three_module.Vector3).fromArray(gainMapMax)},weightFactor:{value:(Math.log2(maxDisplayBoost)-hdrCapacityMin)/(hdrCapacityMax-hdrCapacityMin)}},blending:three_module.NoBlending,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=maxDisplayBoost,this._hdrCapacityMin=hdrCapacityMin,this._hdrCapacityMax=hdrCapacityMax,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(value){this.uniforms.sdr.value=value}get gainMap(){return this.uniforms.gainMap.value}set gainMap(value){this.uniforms.gainMap.value=value}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(value){this.uniforms.offsetHdr.value.fromArray(value)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(value){this.uniforms.offsetSdr.value.fromArray(value)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(value){this.uniforms.gainMapMin.value.fromArray(value)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(value){this.uniforms.gainMapMax.value.fromArray(value)}get gamma(){const g=this.uniforms.gamma.value;return[1/g.x,1/g.y,1/g.z]}set gamma(value){const g=this.uniforms.gamma.value;g.x=1/value[0],g.y=1/value[1],g.z=1/value[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(value){this._hdrCapacityMin=value,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(value){this._hdrCapacityMax=value,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(value){this._maxDisplayBoost=Math.max(1,Math.min(65504,value)),this.calculateWeight()}calculateWeight(){const val=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,val))}}class GainMapNotFoundError extends Error{}class XMPMetadataNotFoundError extends Error{}const getAttribute=(description,name,defaultValue)=>{var _a;let returnValue;const parsedValue=null===(_a=description.attributes.getNamedItem(name))||void 0===_a?void 0:_a.nodeValue;if(parsedValue)returnValue=parsedValue;else{const node=description.getElementsByTagName(name)[0];if(!node){if(defaultValue)return defaultValue;throw new Error(`Can't find ${name} in gainmap metadata`)}{const values=node.getElementsByTagName("rdf:li");if(3!==values.length)throw new Error(`Gainmap metadata contains an array of items for ${name} but its length is not 3`);returnValue=Array.from(values).map((v=>v.innerHTML))}}return returnValue};class MPFExtractor{constructor(options){this.options={debug:!(!options||void 0===options.debug)&&options.debug,extractFII:!options||void 0===options.extractFII||options.extractFII,extractNonFII:!options||void 0===options.extractNonFII||options.extractNonFII}}extract(imageArrayBuffer){return new Promise(((resolve,reject)=>{const debug=this.options.debug,dataView=new DataView(imageArrayBuffer.buffer);if(65496!==dataView.getUint16(0))return void reject(new Error("Not a valid jpeg"));const length=dataView.byteLength;let marker,offset=2,loops=0;for(;offset250)return void reject(new Error(`Found no marker after ${loops} loops 😵`));if(255!==dataView.getUint8(offset))return void reject(new Error(`Not a valid marker at offset 0x${offset.toString(16)}, found: 0x${dataView.getUint8(offset).toString(16)}`));if(marker=dataView.getUint8(offset+1),debug&&console.log(`Marker: ${marker.toString(16)}`),226===marker){debug&&console.log("Found APP2 marker (0xffe2)");const formatPt=offset+4;if(1297106432===dataView.getUint32(formatPt)){const tiffOffset=formatPt+4;let bigEnd;if(18761===dataView.getUint16(tiffOffset))bigEnd=!1;else{if(19789!==dataView.getUint16(tiffOffset))return void reject(new Error("No valid endianness marker found in TIFF header"));bigEnd=!0}if(42!==dataView.getUint16(tiffOffset+2,!bigEnd))return void reject(new Error("Not valid TIFF data! (no 0x002A marker)"));const firstIFDOffset=dataView.getUint32(tiffOffset+4,!bigEnd);if(firstIFDOffset<8)return void reject(new Error("Not valid TIFF data! (First offset less than 8)"));const dirStart=tiffOffset+firstIFDOffset,count=dataView.getUint16(dirStart,!bigEnd),entriesStart=dirStart+2;let numberOfImages=0;for(let i=entriesStart;i{const metadata=(input=>{var _a,_b;let str;str="undefined"!=typeof TextDecoder?(new TextDecoder).decode(input):input.toString();let start=str.indexOf("",start);str.slice(start,end+10);const xmpBlock=str.slice(start,end+10);try{const description=parser.parseFromString(xmpBlock,"text/xml").getElementsByTagName("rdf:Description")[0],gainMapMin=getAttribute(description,"hdrgm:GainMapMin","0"),gainMapMax=getAttribute(description,"hdrgm:GainMapMax"),gamma=getAttribute(description,"hdrgm:Gamma","1"),offsetSDR=getAttribute(description,"hdrgm:OffsetSDR","0.015625"),offsetHDR=getAttribute(description,"hdrgm:OffsetHDR","0.015625");let hdrCapacityMin=null===(_a=description.attributes.getNamedItem("hdrgm:HDRCapacityMin"))||void 0===_a?void 0:_a.nodeValue;hdrCapacityMin||(hdrCapacityMin="0");const hdrCapacityMax=null===(_b=description.attributes.getNamedItem("hdrgm:HDRCapacityMax"))||void 0===_b?void 0:_b.nodeValue;if(!hdrCapacityMax)throw new Error("Incomplete gainmap metadata");return{gainMapMin:Array.isArray(gainMapMin)?gainMapMin.map((v=>parseFloat(v))):[parseFloat(gainMapMin),parseFloat(gainMapMin),parseFloat(gainMapMin)],gainMapMax:Array.isArray(gainMapMax)?gainMapMax.map((v=>parseFloat(v))):[parseFloat(gainMapMax),parseFloat(gainMapMax),parseFloat(gainMapMax)],gamma:Array.isArray(gamma)?gamma.map((v=>parseFloat(v))):[parseFloat(gamma),parseFloat(gamma),parseFloat(gamma)],offsetSdr:Array.isArray(offsetSDR)?offsetSDR.map((v=>parseFloat(v))):[parseFloat(offsetSDR),parseFloat(offsetSDR),parseFloat(offsetSDR)],offsetHdr:Array.isArray(offsetHDR)?offsetHDR.map((v=>parseFloat(v))):[parseFloat(offsetHDR),parseFloat(offsetHDR),parseFloat(offsetHDR)],hdrCapacityMin:parseFloat(hdrCapacityMin),hdrCapacityMax:parseFloat(hdrCapacityMax)}}catch(e){}start=str.indexOf("new Promise(((resolve,reject)=>{const img=document.createElement("img");img.onload=()=>{resolve(img)},img.onerror=e=>{reject(e)},img.src=URL.createObjectURL(blob)}));class LoaderBase extends three_module.Loader{constructor(renderer,manager){super(manager),renderer&&(this._renderer=renderer),this._internalLoadingManager=new three_module.LoadingManager}setRenderer(renderer){return this._renderer=renderer,this}setRenderTargetOptions(options){return this._renderTargetOptions=options,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const material=new GainMapDecoderMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new three_module.Texture,sdr:new three_module.Texture});return new QuadRenderer_6HrRQdJM_QuadRenderer({width:16,height:16,type:three_module.HalfFloatType,colorSpace:three_module.LinearSRGBColorSpace,material:material,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(quadRenderer,metadata,sdrBuffer,gainMapBuffer){const gainMapBlob=gainMapBuffer?new Blob([gainMapBuffer],{type:"image/jpeg"}):void 0,sdrBlob=new Blob([sdrBuffer],{type:"image/jpeg"});let sdrImage,gainMapImage,needsFlip=!1;if("undefined"==typeof createImageBitmap){const res=await Promise.all([gainMapBlob?getHTMLImageFromBlob(gainMapBlob):Promise.resolve(void 0),getHTMLImageFromBlob(sdrBlob)]);gainMapImage=res[0],sdrImage=res[1],needsFlip=!0}else{const res=await Promise.all([gainMapBlob?createImageBitmap(gainMapBlob,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(sdrBlob,{imageOrientation:"flipY"})]);gainMapImage=res[0],sdrImage=res[1]}const gainMap=new three_module.Texture(gainMapImage||new ImageData(2,2),three_module.UVMapping,three_module.ClampToEdgeWrapping,three_module.ClampToEdgeWrapping,three_module.LinearFilter,three_module.LinearMipMapLinearFilter,three_module.RGBAFormat,three_module.UnsignedByteType,1,three_module.LinearSRGBColorSpace);gainMap.flipY=needsFlip,gainMap.needsUpdate=!0;const sdr=new three_module.Texture(sdrImage,three_module.UVMapping,three_module.ClampToEdgeWrapping,three_module.ClampToEdgeWrapping,three_module.LinearFilter,three_module.LinearMipMapLinearFilter,three_module.RGBAFormat,three_module.UnsignedByteType,1,three_module.SRGBColorSpace);sdr.flipY=needsFlip,sdr.needsUpdate=!0,quadRenderer.width=sdrImage.width,quadRenderer.height=sdrImage.height,quadRenderer.material.gainMap=gainMap,quadRenderer.material.sdr=sdr,quadRenderer.material.gainMapMin=metadata.gainMapMin,quadRenderer.material.gainMapMax=metadata.gainMapMax,quadRenderer.material.offsetHdr=metadata.offsetHdr,quadRenderer.material.offsetSdr=metadata.offsetSdr,quadRenderer.material.gamma=metadata.gamma,quadRenderer.material.hdrCapacityMin=metadata.hdrCapacityMin,quadRenderer.material.hdrCapacityMax=metadata.hdrCapacityMax,quadRenderer.material.maxDisplayBoost=Math.pow(2,metadata.hdrCapacityMax),quadRenderer.material.needsUpdate=!0,quadRenderer.render()}}class GainMapLoader extends LoaderBase{load([sdrUrl,gainMapUrl,metadataUrl],onLoad,onProgress,onError){const quadRenderer=this.prepareQuadRenderer();let sdr,gainMap,metadata;const loadCheck=async()=>{if(sdr&&gainMap&&metadata){try{await this.render(quadRenderer,metadata,sdr,gainMap)}catch(error){return this.manager.itemError(sdrUrl),this.manager.itemError(gainMapUrl),this.manager.itemError(metadataUrl),"function"==typeof onError&&onError(error),void quadRenderer.disposeOnDemandRenderer()}"function"==typeof onLoad&&onLoad(quadRenderer),this.manager.itemEnd(sdrUrl),this.manager.itemEnd(gainMapUrl),this.manager.itemEnd(metadataUrl),quadRenderer.disposeOnDemandRenderer()}};let sdrLengthComputable=!0,sdrTotal=0,sdrLoaded=0,gainMapLengthComputable=!0,gainMapTotal=0,gainMapLoaded=0,metadataLengthComputable=!0,metadataTotal=0,metadataLoaded=0;const progressHandler=()=>{if("function"==typeof onProgress){onProgress(new ProgressEvent("progress",{lengthComputable:sdrLengthComputable&&gainMapLengthComputable&&metadataLengthComputable,loaded:sdrLoaded+gainMapLoaded+metadataLoaded,total:sdrTotal+gainMapTotal+metadataTotal}))}};this.manager.itemStart(sdrUrl),this.manager.itemStart(gainMapUrl),this.manager.itemStart(metadataUrl);const sdrLoader=new three_module.FileLoader(this._internalLoadingManager);sdrLoader.setResponseType("arraybuffer"),sdrLoader.setRequestHeader(this.requestHeader),sdrLoader.setPath(this.path),sdrLoader.setWithCredentials(this.withCredentials),sdrLoader.load(sdrUrl,(async buffer=>{if("string"==typeof buffer)throw new Error("Invalid sdr buffer");sdr=buffer,await loadCheck()}),(e=>{sdrLengthComputable=e.lengthComputable,sdrLoaded=e.loaded,sdrTotal=e.total,progressHandler()}),(error=>{this.manager.itemError(sdrUrl),"function"==typeof onError&&onError(error)}));const gainMapLoader=new three_module.FileLoader(this._internalLoadingManager);gainMapLoader.setResponseType("arraybuffer"),gainMapLoader.setRequestHeader(this.requestHeader),gainMapLoader.setPath(this.path),gainMapLoader.setWithCredentials(this.withCredentials),gainMapLoader.load(gainMapUrl,(async buffer=>{if("string"==typeof buffer)throw new Error("Invalid gainmap buffer");gainMap=buffer,await loadCheck()}),(e=>{gainMapLengthComputable=e.lengthComputable,gainMapLoaded=e.loaded,gainMapTotal=e.total,progressHandler()}),(error=>{this.manager.itemError(gainMapUrl),"function"==typeof onError&&onError(error)}));const metadataLoader=new three_module.FileLoader(this._internalLoadingManager);return metadataLoader.setRequestHeader(this.requestHeader),metadataLoader.setPath(this.path),metadataLoader.setWithCredentials(this.withCredentials),metadataLoader.load(metadataUrl,(async json=>{if("string"!=typeof json)throw new Error("Invalid metadata string");metadata=JSON.parse(json),await loadCheck()}),(e=>{metadataLengthComputable=e.lengthComputable,metadataLoaded=e.loaded,metadataTotal=e.total,progressHandler()}),(error=>{this.manager.itemError(metadataUrl),"function"==typeof onError&&onError(error)})),quadRenderer}}class HDRJPGLoader extends LoaderBase{load(url,onLoad,onProgress,onError){const quadRenderer=this.prepareQuadRenderer(),loader=new three_module.FileLoader(this._internalLoadingManager);return loader.setResponseType("arraybuffer"),loader.setRequestHeader(this.requestHeader),loader.setPath(this.path),loader.setWithCredentials(this.withCredentials),this.manager.itemStart(url),loader.load(url,(async jpeg=>{if("string"==typeof jpeg)throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const jpegBuffer=new Uint8Array(jpeg);let sdrJPEG,gainMapJPEG,metadata;try{const extractionResult=await extractGainmapFromJPEG(jpegBuffer);sdrJPEG=extractionResult.sdr,gainMapJPEG=extractionResult.gainMap,metadata=extractionResult.metadata}catch(e){if(!(e instanceof XMPMetadataNotFoundError||e instanceof GainMapNotFoundError))throw e;console.warn(`Failure to reconstruct an HDR image from ${url}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),metadata={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},sdrJPEG=jpegBuffer}try{await this.render(quadRenderer,metadata,sdrJPEG,gainMapJPEG)}catch(error){return this.manager.itemError(url),"function"==typeof onError&&onError(error),void quadRenderer.disposeOnDemandRenderer()}"function"==typeof onLoad&&onLoad(quadRenderer),this.manager.itemEnd(url),quadRenderer.disposeOnDemandRenderer()}),onProgress,(error=>{this.manager.itemError(url),"function"==typeof onError&&onError(error)})),quadRenderer}}const presetsObj={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},LinearEncoding=3e3,sRGBEncoding=3001,CUBEMAP_ROOT="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",isArray=arr=>Array.isArray(arr);function useEnvironment({files:files=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:path="",preset:preset,encoding:encoding,extensions:extensions}={}){var _firstEntry$split$pop;let loader=null,multiFile=!1;if(preset){if(!(preset in presetsObj))throw new Error("Preset must be one of: "+Object.keys(presetsObj).join(", "));files=presetsObj[preset],path=CUBEMAP_ROOT}const isCubemap=isArray(files)&&6===files.length,isGainmap=isArray(files)&&3===files.length&&files.some((file=>file.endsWith("json"))),firstEntry=isArray(files)?files[0]:files;multiFile=isArray(files);const extension=isCubemap?"cube":isGainmap?"webp":firstEntry.startsWith("data:application/exr")?"exr":firstEntry.startsWith("data:application/hdr")?"hdr":firstEntry.startsWith("data:image/jpeg")?"jpg":null==(_firstEntry$split$pop=firstEntry.split(".").pop())||null==(_firstEntry$split$pop=_firstEntry$split$pop.split("?"))||null==(_firstEntry$split$pop=_firstEntry$split$pop.shift())?void 0:_firstEntry$split$pop.toLowerCase();if(loader="cube"===extension?three_module.CubeTextureLoader:"hdr"===extension?RGBELoader:"exr"===extension?EXRLoader:"jpg"===extension||"jpeg"===extension?HDRJPGLoader:"webp"===extension?GainMapLoader:null,!loader)throw new Error("useEnvironment: Unrecognized file extension: "+files);const gl=(0,index_99983b2d_esm.A)((state=>state.gl));(0,react.useLayoutEffect)((()=>{"webp"!==extension&&"jpg"!==extension&&"jpeg"!==extension||gl.domElement.addEventListener("webglcontextlost",(function clearGainmapTexture(){index_99983b2d_esm.F.clear(loader,multiFile?[files]:files)}),{once:!0})}),[files,gl.domElement]);const loaderResult=(0,index_99983b2d_esm.F)(loader,multiFile?[files]:files,(loader=>{"webp"!==extension&&"jpg"!==extension&&"jpeg"!==extension||loader.setRenderer(gl),null==loader.setPath||loader.setPath(path),extensions&&extensions(loader)}));let texture=multiFile?loaderResult[0]:loaderResult;var _renderTarget;"jpg"!==extension&&"jpeg"!==extension&&"webp"!==extension||(texture=null==(_renderTarget=texture.renderTarget)?void 0:_renderTarget.texture);return texture.mapping=isCubemap?three_module.CubeReflectionMapping:three_module.EquirectangularReflectionMapping,"colorSpace"in texture?texture.colorSpace=(null!=encoding?encoding:isCubemap)?"srgb":"srgb-linear":texture.encoding=(null!=encoding?encoding:isCubemap)?sRGBEncoding:LinearEncoding,texture}const resolveScene=scene=>{return(obj=scene).current&&obj.current.isScene?scene.current:scene;var obj};function setEnvProps(background,scene,defaultScene,texture,sceneProps={}){var _sceneProps$blur,_target$backgroundRot,_target$backgroundRot2,_target$environmentRo,_target$environmentRo2;sceneProps={backgroundBlurriness:null!==(_sceneProps$blur=sceneProps.blur)&&void 0!==_sceneProps$blur?_sceneProps$blur:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...sceneProps};const target=resolveScene(scene||defaultScene),oldbg=target.background,oldenv=target.environment,oldSceneProps={backgroundBlurriness:target.backgroundBlurriness,backgroundIntensity:target.backgroundIntensity,backgroundRotation:null!==(_target$backgroundRot=null==(_target$backgroundRot2=target.backgroundRotation)||null==_target$backgroundRot2.clone?void 0:_target$backgroundRot2.clone())&&void 0!==_target$backgroundRot?_target$backgroundRot:[0,0,0],environmentIntensity:target.environmentIntensity,environmentRotation:null!==(_target$environmentRo=null==(_target$environmentRo2=target.environmentRotation)||null==_target$environmentRo2.clone?void 0:_target$environmentRo2.clone())&&void 0!==_target$environmentRo?_target$environmentRo:[0,0,0]};return"only"!==background&&(target.environment=texture),background&&(target.background=texture),(0,index_99983b2d_esm.j)(target,sceneProps),()=>{"only"!==background&&(target.environment=oldenv),background&&(target.background=oldbg),(0,index_99983b2d_esm.j)(target,oldSceneProps)}}function EnvironmentMap({scene:scene,background:background=!1,map:map,...config}){const defaultScene=(0,index_99983b2d_esm.A)((state=>state.scene));return react.useLayoutEffect((()=>{if(map)return setEnvProps(background,scene,defaultScene,map,config)})),null}function EnvironmentCube({background:background=!1,scene:scene,blur:blur,backgroundBlurriness:backgroundBlurriness,backgroundIntensity:backgroundIntensity,backgroundRotation:backgroundRotation,environmentIntensity:environmentIntensity,environmentRotation:environmentRotation,...rest}){const texture=useEnvironment(rest),defaultScene=(0,index_99983b2d_esm.A)((state=>state.scene));return react.useLayoutEffect((()=>setEnvProps(background,scene,defaultScene,texture,{blur:blur,backgroundBlurriness:backgroundBlurriness,backgroundIntensity:backgroundIntensity,backgroundRotation:backgroundRotation,environmentIntensity:environmentIntensity,environmentRotation:environmentRotation}))),null}function EnvironmentPortal({children:children,near:near=1,far:far=1e3,resolution:resolution=256,frames:frames=1,map:map,background:background=!1,blur:blur,backgroundBlurriness:backgroundBlurriness,backgroundIntensity:backgroundIntensity,backgroundRotation:backgroundRotation,environmentIntensity:environmentIntensity,environmentRotation:environmentRotation,scene:scene,files:files,path:path,preset:preset,extensions:extensions}){const gl=(0,index_99983b2d_esm.A)((state=>state.gl)),defaultScene=(0,index_99983b2d_esm.A)((state=>state.scene)),camera=react.useRef(null),[virtualScene]=react.useState((()=>new three_module.Scene)),fbo=react.useMemo((()=>{const fbo=new three_module.WebGLCubeRenderTarget(resolution);return fbo.texture.type=three_module.HalfFloatType,fbo}),[resolution]);react.useLayoutEffect((()=>(1===frames&&camera.current.update(gl,virtualScene),setEnvProps(background,scene,defaultScene,fbo.texture,{blur:blur,backgroundBlurriness:backgroundBlurriness,backgroundIntensity:backgroundIntensity,backgroundRotation:backgroundRotation,environmentIntensity:environmentIntensity,environmentRotation:environmentRotation}))),[children,virtualScene,fbo.texture,scene,defaultScene,background,frames,gl]);let count=1;return(0,index_99983b2d_esm.C)((()=>{(frames===1/0||count(0,index_99983b2d_esm.e)({GroundProjectedEnvImpl:GroundProjectedEnv})),[]);const args=react.useMemo((()=>[texture]),[texture]),height=null==(_props$ground=props.ground)?void 0:_props$ground.height,radius=null==(_props$ground2=props.ground)?void 0:_props$ground2.radius,scale=null!==(_scale=null==(_props$ground3=props.ground)?void 0:_props$ground3.scale)&&void 0!==_scale?_scale:1e3;return react.createElement(react.Fragment,null,react.createElement(EnvironmentMap,(0,esm_extends.Z)({},props,{map:texture})),react.createElement("groundProjectedEnvImpl",{args:args,scale:scale,height:height,radius:radius}))}function Environment(props){return props.ground?react.createElement(EnvironmentGround,props):props.map?react.createElement(EnvironmentMap,props):props.children?react.createElement(EnvironmentPortal,props):react.createElement(EnvironmentCube,props)}},"./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{A:function(){return useThree},B:function(){return Block},C:function(){return useFrame},D:function(){return useGraph},E:function(){return ErrorBoundary},F:function(){return useLoader},a:function(){return index_99983b2d_esm_useIsomorphicLayoutEffect},b:function(){return createRoot},c:function(){return createEvents},d:function(){return unmountComponentAtNode},e:function(){return extend},g:function(){return createPortal},i:function(){return isRef},j:function(){return applyProps},n:function(){return addEffect},o:function(){return addAfterEffect},p:function(){return addTail},u:function(){return useMutableCallback},y:function(){return useInstanceHandle}});var three_module=__webpack_require__("./node_modules/three/build/three.module.js"),react=__webpack_require__("./node_modules/react/index.js"),constants=__webpack_require__("./node_modules/react-reconciler/constants.js");function createStore(createState){let state;const listeners=new Set,setState=(partial,replace)=>{const nextState="function"==typeof partial?partial(state):partial;if(nextState!==state){const previousState=state;state=replace?nextState:Object.assign({},state,nextState),listeners.forEach((listener=>listener(state,previousState)))}},getState=()=>state,api={setState:setState,getState:getState,subscribe:(listener,selector,equalityFn)=>selector||equalityFn?((listener,selector=getState,equalityFn=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let currentSlice=selector(state);function listenerToAdd(){const nextSlice=selector(state);if(!equalityFn(currentSlice,nextSlice)){const previousSlice=currentSlice;listener(currentSlice=nextSlice,previousSlice)}}return listeners.add(listenerToAdd),()=>listeners.delete(listenerToAdd)})(listener,selector,equalityFn):(listeners.add(listener),()=>listeners.delete(listener)),destroy:()=>listeners.clear()};return state=createState(setState,getState,api),api}const useIsomorphicLayoutEffect="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?react.useEffect:react.useLayoutEffect;function create(createState){const api="function"==typeof createState?createStore(createState):createState,useStore=(selector=api.getState,equalityFn=Object.is)=>{const[,forceUpdate]=(0,react.useReducer)((c=>c+1),0),state=api.getState(),stateRef=(0,react.useRef)(state),selectorRef=(0,react.useRef)(selector),equalityFnRef=(0,react.useRef)(equalityFn),erroredRef=(0,react.useRef)(!1),currentSliceRef=(0,react.useRef)();let newStateSlice;void 0===currentSliceRef.current&&(currentSliceRef.current=selector(state));let hasNewStateSlice=!1;(stateRef.current!==state||selectorRef.current!==selector||equalityFnRef.current!==equalityFn||erroredRef.current)&&(newStateSlice=selector(state),hasNewStateSlice=!equalityFn(currentSliceRef.current,newStateSlice)),useIsomorphicLayoutEffect((()=>{hasNewStateSlice&&(currentSliceRef.current=newStateSlice),stateRef.current=state,selectorRef.current=selector,equalityFnRef.current=equalityFn,erroredRef.current=!1}));const stateBeforeSubscriptionRef=(0,react.useRef)(state);useIsomorphicLayoutEffect((()=>{const listener=()=>{try{const nextState=api.getState(),nextStateSlice=selectorRef.current(nextState);equalityFnRef.current(currentSliceRef.current,nextStateSlice)||(stateRef.current=nextState,currentSliceRef.current=nextStateSlice,forceUpdate())}catch(error){erroredRef.current=!0,forceUpdate()}},unsubscribe=api.subscribe(listener);return api.getState()!==stateBeforeSubscriptionRef.current&&listener(),unsubscribe}),[]);const sliceToReturn=hasNewStateSlice?newStateSlice:currentSliceRef.current;return(0,react.useDebugValue)(sliceToReturn),sliceToReturn};return Object.assign(useStore,api),useStore[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const items=[useStore,api];return{next(){const done=items.length<=0;return{value:items.shift(),done:done}}}},useStore}var react_reconciler=__webpack_require__("./node_modules/react-reconciler/index.js"),react_reconciler_default=__webpack_require__.n(react_reconciler),scheduler=__webpack_require__("./node_modules/scheduler/index.js"),suspend_react=__webpack_require__("./node_modules/suspend-react/index.js"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),process=__webpack_require__("./node_modules/process/browser.js");const catalogue={},extend=objects=>{Object.assign(catalogue,objects)};var _window$document,_window$navigator;const hasColorSpace=object=>"colorSpace"in object||"outputColorSpace"in object,getColorManagement=()=>{var _ColorManagement;return null!=(_ColorManagement=catalogue.ColorManagement)?_ColorManagement:null},isOrthographicCamera=def=>def&&def.isOrthographicCamera,isRef=obj=>obj&&obj.hasOwnProperty("current"),index_99983b2d_esm_useIsomorphicLayoutEffect="undefined"!=typeof window&&(null!=(_window$document=window.document)&&_window$document.createElement||"ReactNative"===(null==(_window$navigator=window.navigator)?void 0:_window$navigator.product))?react.useLayoutEffect:react.useEffect;function useMutableCallback(fn){const ref=react.useRef(fn);return index_99983b2d_esm_useIsomorphicLayoutEffect((()=>{ref.current=fn}),[fn]),ref}function Block({set:set}){return index_99983b2d_esm_useIsomorphicLayoutEffect((()=>(set(new Promise((()=>null))),()=>set(!1))),[set]),null}class ErrorBoundary extends react.Component{constructor(...args){super(...args),this.state={error:!1}}componentDidCatch(err){this.props.set(err)}render(){return this.state.error?null:this.props.children}}ErrorBoundary.getDerivedStateFromError=()=>({error:!0});const DEFAULT="__default",DEFAULTS=new Map,isDiffSet=def=>def&&!!def.memoized&&!!def.changes;function calculateDpr(dpr){var _window$devicePixelRa;const target="undefined"!=typeof window?null!=(_window$devicePixelRa=window.devicePixelRatio)?_window$devicePixelRa:2:1;return Array.isArray(dpr)?Math.min(Math.max(dpr[0],target),dpr[1]):dpr}const getRootState=obj=>{var _r3f;return null==(_r3f=obj.__r3f)?void 0:_r3f.root.getState()};function findInitialRoot(child){let root=child.__r3f.root;for(;root.getState().previousRoot;)root=root.getState().previousRoot;return root}const is={obj:a=>a===Object(a)&&!is.arr(a)&&"function"!=typeof a,fun:a=>"function"==typeof a,str:a=>"string"==typeof a,num:a=>"number"==typeof a,boo:a=>"boolean"==typeof a,und:a=>void 0===a,arr:a=>Array.isArray(a),equ(a,b,{arrays:arrays="shallow",objects:objects="reference",strict:strict=!0}={}){if(typeof a!=typeof b||!!a!=!!b)return!1;if(is.str(a)||is.num(a)||is.boo(a))return a===b;const isObj=is.obj(a);if(isObj&&"reference"===objects)return a===b;const isArr=is.arr(a);if(isArr&&"reference"===arrays)return a===b;if((isArr||isObj)&&a===b)return!0;let i;for(i in a)if(!(i in b))return!1;if(isObj&&"shallow"===arrays&&"shallow"===objects){for(i in strict?b:a)if(!is.equ(a[i],b[i],{strict:strict,objects:"reference"}))return!1}else for(i in strict?b:a)if(a[i]!==b[i])return!1;if(is.und(i)){if(isArr&&0===a.length&&0===b.length)return!0;if(isObj&&0===Object.keys(a).length&&0===Object.keys(b).length)return!0;if(a!==b)return!1}return!0}};function buildGraph(object){const data={nodes:{},materials:{}};return object&&object.traverse((obj=>{obj.name&&(data.nodes[obj.name]=obj),obj.material&&!data.materials[obj.material.name]&&(data.materials[obj.material.name]=obj.material)})),data}function prepare(object,state){return object.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...state},object}function resolve(instance,key){let target=instance;if(key.includes("-")){const entries=key.split("-"),last=entries.pop();return target=entries.reduce(((acc,key)=>acc[key]),instance),{target:target,key:last}}return{target:target,key:key}}const INDEX_REGEX=/-\d+$/;function attach(parent,child,type){if(is.str(type)){if(INDEX_REGEX.test(type)){const root=type.replace(INDEX_REGEX,""),{target:target,key:key}=resolve(parent,root);Array.isArray(target[key])||(target[key]=[])}const{target:target,key:key}=resolve(parent,type);child.__r3f.previousAttach=target[key],target[key]=child}else child.__r3f.previousAttach=type(parent,child)}function detach(parent,child,type){var _child$__r3f,_child$__r3f2;if(is.str(type)){const{target:target,key:key}=resolve(parent,type),previous=child.__r3f.previousAttach;void 0===previous?delete target[key]:target[key]=previous}else null==(_child$__r3f=child.__r3f)||null==_child$__r3f.previousAttach||_child$__r3f.previousAttach(parent,child);null==(_child$__r3f2=child.__r3f)||delete _child$__r3f2.previousAttach}function diffProps(instance,{children:cN,key:kN,ref:rN,...props},{children:cP,key:kP,ref:rP,...previous}={},remove=!1){const localState=instance.__r3f,entries=Object.entries(props),changes=[];if(remove){const previousKeys=Object.keys(previous);for(let i=0;i{var _instance$__r3f;if(null!=(_instance$__r3f=instance.__r3f)&&_instance$__r3f.primitive&&"object"===key)return;if(is.equ(value,previous[key]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(key))return changes.push([key,value,!0,[]]);let entries=[];key.includes("-")&&(entries=key.split("-")),changes.push([key,value,!1,entries]);for(const prop in props){const value=props[prop];prop.startsWith(`${key}-`)&&changes.push([prop,value,!1,prop.split("-")])}}));const memoized={...props};return null!=localState&&localState.memoizedProps&&null!=localState&&localState.memoizedProps.args&&(memoized.args=localState.memoizedProps.args),null!=localState&&localState.memoizedProps&&null!=localState&&localState.memoizedProps.attach&&(memoized.attach=localState.memoizedProps.attach),{memoized:memoized,changes:changes}}const __DEV__=void 0!==process&&!1;function applyProps$1(instance,data){var _instance$__r3f2;const localState=instance.__r3f,root=null==localState?void 0:localState.root,rootState=null==root||null==root.getState?void 0:root.getState(),{memoized:memoized,changes:changes}=isDiffSet(data)?data:diffProps(instance,data),prevHandlers=null==localState?void 0:localState.eventCount;instance.__r3f&&(instance.__r3f.memoizedProps=memoized);for(let i=0;iacc[key]),instance),!targetProp||!targetProp.set)){const[name,...reverseEntries]=keys.reverse();currentInstance=reverseEntries.reverse().reduce(((acc,key)=>acc[key]),instance),key=name}if(value===DEFAULT+"remove")if(currentInstance.constructor){let ctor=DEFAULTS.get(currentInstance.constructor);ctor||(ctor=new currentInstance.constructor,DEFAULTS.set(currentInstance.constructor,ctor)),value=ctor[key]}else value=0;if(isEvent&&localState)value?localState.handlers[key]=value:delete localState.handlers[key],localState.eventCount=Object.keys(localState.handlers).length;else if(targetProp&&targetProp.set&&(targetProp.copy||targetProp instanceof three_module.Layers)){if(Array.isArray(value))targetProp.fromArray?targetProp.fromArray(value):targetProp.set(...value);else if(targetProp.copy&&value&&value.constructor&&(__DEV__?targetProp.constructor.name===value.constructor.name:targetProp.constructor===value.constructor))targetProp.copy(value);else if(void 0!==value){const isColor=targetProp instanceof three_module.Color;!isColor&&targetProp.setScalar?targetProp.setScalar(value):targetProp instanceof three_module.Layers&&value instanceof three_module.Layers?targetProp.mask=value.mask:targetProp.set(value),!getColorManagement()&&rootState&&!rootState.linear&&isColor&&targetProp.convertSRGBToLinear()}}else if(currentInstance[key]=value,currentInstance[key]instanceof three_module.Texture&¤tInstance[key].format===three_module.RGBAFormat&¤tInstance[key].type===three_module.UnsignedByteType&&rootState){const texture=currentInstance[key];hasColorSpace(texture)&&hasColorSpace(rootState.gl)?texture.colorSpace=rootState.gl.outputColorSpace:texture.encoding=rootState.gl.outputEncoding}invalidateInstance(instance)}if(localState&&localState.parent&&instance.raycast&&prevHandlers!==localState.eventCount){const internal=findInitialRoot(instance).getState().internal,index=internal.interaction.indexOf(instance);index>-1&&internal.interaction.splice(index,1),localState.eventCount&&internal.interaction.push(instance)}return!(1===changes.length&&"onUpdate"===changes[0][0])&&changes.length&&null!=(_instance$__r3f2=instance.__r3f)&&_instance$__r3f2.parent&&updateInstance(instance),instance}function invalidateInstance(instance){var _instance$__r3f3,_instance$__r3f3$root;const state=null==(_instance$__r3f3=instance.__r3f)||null==(_instance$__r3f3$root=_instance$__r3f3.root)||null==_instance$__r3f3$root.getState?void 0:_instance$__r3f3$root.getState();state&&0===state.internal.frames&&state.invalidate()}function updateInstance(instance){null==instance.onUpdate||instance.onUpdate(instance)}function updateCamera(camera,size){camera.manual||(isOrthographicCamera(camera)?(camera.left=size.width/-2,camera.right=size.width/2,camera.top=size.height/2,camera.bottom=size.height/-2):camera.aspect=size.width/size.height,camera.updateProjectionMatrix(),camera.updateMatrixWorld())}function makeId(event){return(event.eventObject||event.object).uuid+"/"+event.index+event.instanceId}function releaseInternalPointerCapture(capturedMap,obj,captures,pointerId){const captureData=captures.get(obj);captureData&&(captures.delete(obj),0===captures.size&&(capturedMap.delete(pointerId),captureData.target.releasePointerCapture(pointerId)))}function createEvents(store){function filterPointerEvents(objects){return objects.filter((obj=>["Move","Over","Enter","Out","Leave"].some((name=>{var _r3f;return null==(_r3f=obj.__r3f)?void 0:_r3f.handlers["onPointer"+name]}))))}function cancelPointer(intersections){const{internal:internal}=store.getState();for(const hoveredObj of internal.hovered.values())if(!intersections.length||!intersections.find((hit=>hit.object===hoveredObj.object&&hit.index===hoveredObj.index&&hit.instanceId===hoveredObj.instanceId))){const instance=hoveredObj.eventObject.__r3f,handlers=null==instance?void 0:instance.handlers;if(internal.hovered.delete(makeId(hoveredObj)),null!=instance&&instance.eventCount){const data={...hoveredObj,intersections:intersections};null==handlers.onPointerOut||handlers.onPointerOut(data),null==handlers.onPointerLeave||handlers.onPointerLeave(data)}}}function pointerMissed(event,objects){for(let i=0;icancelPointer([]);case"onLostPointerCapture":return event=>{const{internal:internal}=store.getState();"pointerId"in event&&internal.capturedMap.has(event.pointerId)&&requestAnimationFrame((()=>{internal.capturedMap.has(event.pointerId)&&(internal.capturedMap.delete(event.pointerId),cancelPointer([]))}))}}return function handleEvent(event){const{onPointerMissed:onPointerMissed,internal:internal}=store.getState();internal.lastEvent.current=event;const isPointerMove="onPointerMove"===name,isClickEvent="onClick"===name||"onContextMenu"===name||"onDoubleClick"===name,hits=function intersect(event,filter){const state=store.getState(),duplicates=new Set,intersections=[],eventsObjects=filter?filter(state.internal.interaction):state.internal.interaction;for(let i=0;i{const aState=getRootState(a.object),bState=getRootState(b.object);return aState&&bState&&bState.events.priority-aState.events.priority||a.distance-b.distance})).filter((item=>{const id=makeId(item);return!duplicates.has(id)&&(duplicates.add(id),!0)}));state.events.filter&&(hits=state.events.filter(hits,state));for(const hit of hits){let eventObject=hit.object;for(;eventObject;){var _r3f2;null!=(_r3f2=eventObject.__r3f)&&_r3f2.eventCount&&intersections.push({...hit,eventObject:eventObject}),eventObject=eventObject.parent}}if("pointerId"in event&&state.internal.capturedMap.has(event.pointerId))for(let captureData of state.internal.capturedMap.get(event.pointerId).values())duplicates.has(makeId(captureData.intersection))||intersections.push(captureData.intersection);return intersections}(event,isPointerMove?filterPointerEvents:void 0),delta=isClickEvent?function calculateDistance(event){const{internal:internal}=store.getState(),dx=event.offsetX-internal.initialClick[0],dy=event.offsetY-internal.initialClick[1];return Math.round(Math.sqrt(dx*dx+dy*dy))}(event):0;"onPointerDown"===name&&(internal.initialClick=[event.offsetX,event.offsetY],internal.initialHits=hits.map((hit=>hit.eventObject))),isClickEvent&&!hits.length&&delta<=2&&(pointerMissed(event,internal.interaction),onPointerMissed&&onPointerMissed(event)),isPointerMove&&cancelPointer(hits),function handleIntersects(intersections,event,delta,callback){const rootState=store.getState();if(intersections.length){const localState={stopped:!1};for(const hit of intersections){const state=getRootState(hit.object)||rootState,{raycaster:raycaster,pointer:pointer,camera:camera,internal:internal}=state,unprojectedPoint=new three_module.Vector3(pointer.x,pointer.y,0).unproject(camera),hasPointerCapture=id=>{var _internal$capturedMap,_internal$capturedMap2;return null!=(_internal$capturedMap=null==(_internal$capturedMap2=internal.capturedMap.get(id))?void 0:_internal$capturedMap2.has(hit.eventObject))&&_internal$capturedMap},setPointerCapture=id=>{const captureData={intersection:hit,target:event.target};internal.capturedMap.has(id)?internal.capturedMap.get(id).set(hit.eventObject,captureData):internal.capturedMap.set(id,new Map([[hit.eventObject,captureData]])),event.target.setPointerCapture(id)},releasePointerCapture=id=>{const captures=internal.capturedMap.get(id);captures&&releaseInternalPointerCapture(internal.capturedMap,hit.eventObject,captures,id)};let extractEventProps={};for(let prop in event){let property=event[prop];"function"!=typeof property&&(extractEventProps[prop]=property)}let raycastEvent={...hit,...extractEventProps,pointer:pointer,intersections:intersections,stopped:localState.stopped,delta:delta,unprojectedPoint:unprojectedPoint,ray:raycaster.ray,camera:camera,stopPropagation(){const capturesForPointer="pointerId"in event&&internal.capturedMap.get(event.pointerId);(!capturesForPointer||capturesForPointer.has(hit.eventObject))&&(raycastEvent.stopped=localState.stopped=!0,internal.hovered.size&&Array.from(internal.hovered.values()).find((i=>i.eventObject===hit.eventObject)))&&cancelPointer([...intersections.slice(0,intersections.indexOf(hit)),hit])},target:{hasPointerCapture:hasPointerCapture,setPointerCapture:setPointerCapture,releasePointerCapture:releasePointerCapture},currentTarget:{hasPointerCapture:hasPointerCapture,setPointerCapture:setPointerCapture,releasePointerCapture:releasePointerCapture},nativeEvent:event};if(callback(raycastEvent),!0===localState.stopped)break}}return intersections}(hits,event,delta,(function onIntersect(data){const eventObject=data.eventObject,instance=eventObject.__r3f,handlers=null==instance?void 0:instance.handlers;if(null!=instance&&instance.eventCount)if(isPointerMove){if(handlers.onPointerOver||handlers.onPointerEnter||handlers.onPointerOut||handlers.onPointerLeave){const id=makeId(data),hoveredItem=internal.hovered.get(id);hoveredItem?hoveredItem.stopped&&data.stopPropagation():(internal.hovered.set(id,data),null==handlers.onPointerOver||handlers.onPointerOver(data),null==handlers.onPointerEnter||handlers.onPointerEnter(data))}null==handlers.onPointerMove||handlers.onPointerMove(data)}else{const handler=handlers[name];handler?isClickEvent&&!internal.initialHits.includes(eventObject)||(pointerMissed(event,internal.interaction.filter((object=>!internal.initialHits.includes(object)))),handler(data)):isClickEvent&&internal.initialHits.includes(eventObject)&&pointerMissed(event,internal.interaction.filter((object=>!internal.initialHits.includes(object))))}}))}}}}const privateKeys=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],isRenderer=def=>!(null==def||!def.render),context=react.createContext(null),index_99983b2d_esm_createStore=(invalidate,advance)=>{const rootState=create(((set,get)=>{const position=new three_module.Vector3,defaultTarget=new three_module.Vector3,tempTarget=new three_module.Vector3;function getCurrentViewport(camera=get().camera,target=defaultTarget,size=get().size){const{width:width,height:height,top:top,left:left}=size,aspect=width/height;target instanceof three_module.Vector3?tempTarget.copy(target):tempTarget.set(...target);const distance=camera.getWorldPosition(position).distanceTo(tempTarget);if(isOrthographicCamera(camera))return{width:width/camera.zoom,height:height/camera.zoom,top:top,left:left,factor:1,distance:distance,aspect:aspect};{const fov=camera.fov*Math.PI/180,h=2*Math.tan(fov/2)*distance,w=h*(width/height);return{width:w,height:h,top:top,left:left,factor:width/w,distance:distance,aspect:aspect}}}let performanceTimeout;const setPerformanceCurrent=current=>set((state=>({performance:{...state.performance,current:current}}))),pointer=new three_module.Vector2,rootState={set:set,get:get,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(frames=1)=>invalidate(get(),frames),advance:(timestamp,runGlobalEffects)=>advance(timestamp,runGlobalEffects,get()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new three_module.Clock,pointer:pointer,mouse:pointer,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const state=get();performanceTimeout&&clearTimeout(performanceTimeout),state.performance.current!==state.performance.min&&setPerformanceCurrent(state.performance.min),performanceTimeout=setTimeout((()=>setPerformanceCurrent(get().performance.max)),state.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:getCurrentViewport},setEvents:events=>set((state=>({...state,events:{...state.events,...events}}))),setSize:(width,height,updateStyle,top,left)=>{const camera=get().camera,size={width:width,height:height,top:top||0,left:left||0,updateStyle:updateStyle};set((state=>({size:size,viewport:{...state.viewport,...getCurrentViewport(camera,defaultTarget,size)}})))},setDpr:dpr=>set((state=>{const resolved=calculateDpr(dpr);return{viewport:{...state.viewport,dpr:resolved,initialDpr:state.viewport.initialDpr||resolved}}})),setFrameloop:(frameloop="always")=>{const clock=get().clock;clock.stop(),clock.elapsedTime=0,"never"!==frameloop&&(clock.start(),clock.elapsedTime=0),set((()=>({frameloop:frameloop})))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:react.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(ref,priority,store)=>{const internal=get().internal;return internal.priority=internal.priority+(priority>0?1:0),internal.subscribers.push({ref:ref,priority:priority,store:store}),internal.subscribers=internal.subscribers.sort(((a,b)=>a.priority-b.priority)),()=>{const internal=get().internal;null!=internal&&internal.subscribers&&(internal.priority=internal.priority-(priority>0?1:0),internal.subscribers=internal.subscribers.filter((s=>s.ref!==ref)))}}}};return rootState})),state=rootState.getState();let oldSize=state.size,oldDpr=state.viewport.dpr,oldCamera=state.camera;return rootState.subscribe((()=>{const{camera:camera,size:size,viewport:viewport,gl:gl,set:set}=rootState.getState();if(size.width!==oldSize.width||size.height!==oldSize.height||viewport.dpr!==oldDpr){var _size$updateStyle;oldSize=size,oldDpr=viewport.dpr,updateCamera(camera,size),gl.setPixelRatio(viewport.dpr);const updateStyle=null!=(_size$updateStyle=size.updateStyle)?_size$updateStyle:"undefined"!=typeof HTMLCanvasElement&&gl.domElement instanceof HTMLCanvasElement;gl.setSize(size.width,size.height,updateStyle)}camera!==oldCamera&&(oldCamera=camera,set((state=>({viewport:{...state.viewport,...state.viewport.getCurrentViewport(camera)}}))))})),rootState.subscribe((state=>invalidate(state))),rootState};function createSubs(callback,subs){const sub={callback:callback};return subs.add(sub),()=>{subs.delete(sub)}}let i,globalEffects=new Set,globalAfterEffects=new Set,globalTailEffects=new Set;const addEffect=callback=>createSubs(callback,globalEffects),addAfterEffect=callback=>createSubs(callback,globalAfterEffects),addTail=callback=>createSubs(callback,globalTailEffects);function run(effects,timestamp){if(effects.size)for(const{callback:callback}of effects.values())callback(timestamp)}function flushGlobalEffects(type,timestamp){switch(type){case"before":return run(globalEffects,timestamp);case"after":return run(globalAfterEffects,timestamp);case"tail":return run(globalTailEffects,timestamp)}}let subscribers,subscription;function render$1(timestamp,state,frame){let delta=state.clock.getDelta();for("never"===state.frameloop&&"number"==typeof timestamp&&(delta=timestamp-state.clock.elapsedTime,state.clock.oldTime=state.clock.elapsedTime,state.clock.elapsedTime=timestamp),subscribers=state.internal.subscribers,i=0;i{instance.current=ref.current.__r3f}),[ref]),instance}function useStore(){const store=react.useContext(context);if(!store)throw new Error("R3F: Hooks can only be used within the Canvas component!");return store}function useThree(selector=(state=>state),equalityFn){return useStore()(selector,equalityFn)}function useFrame(callback,renderPriority=0){const store=useStore(),subscribe=store.getState().internal.subscribe,ref=useMutableCallback(callback);return index_99983b2d_esm_useIsomorphicLayoutEffect((()=>subscribe(ref,renderPriority,store)),[renderPriority,subscribe,store]),null}function useGraph(object){return react.useMemo((()=>buildGraph(object)),[object])}const memoizedLoaders=new WeakMap;function loadingFn(extensions,onProgress){return function(Proto,...input){let loader=memoizedLoaders.get(Proto);return loader||(loader=new Proto,memoizedLoaders.set(Proto,loader)),extensions&&extensions(loader),Promise.all(input.map((input=>new Promise(((res,reject)=>loader.load(input,(data=>{data.scene&&Object.assign(data,buildGraph(data.scene)),res(data)}),onProgress,(error=>reject(new Error(`Could not load ${input}: ${null==error?void 0:error.message}`)))))))))}}function useLoader(Proto,input,extensions,onProgress){const keys=Array.isArray(input)?input:[input],results=(0,suspend_react.Rq)(loadingFn(extensions,onProgress),[Proto,...keys],{equal:is.equ});return Array.isArray(input)?results:results[0]}useLoader.preload=function(Proto,input,extensions){const keys=Array.isArray(input)?input:[input];return(0,suspend_react.MA)(loadingFn(extensions),[Proto,...keys])},useLoader.clear=function(Proto,input){const keys=Array.isArray(input)?input:[input];return(0,suspend_react.ZH)([Proto,...keys])};const roots=new Map,{invalidate:invalidate,advance:advance}=function createLoop(roots){let repeat,frame,state,running=!1,useFrameInProgress=!1;function loop(timestamp){frame=requestAnimationFrame(loop),running=!0,repeat=0,flushGlobalEffects("before",timestamp),useFrameInProgress=!0;for(const root of roots.values()){var _state$gl$xr;state=root.store.getState(),!state.internal.active||!("always"===state.frameloop||state.internal.frames>0)||null!=(_state$gl$xr=state.gl.xr)&&_state$gl$xr.isPresenting||(repeat+=render$1(timestamp,state))}if(useFrameInProgress=!1,flushGlobalEffects("after",timestamp),0===repeat)return flushGlobalEffects("tail",timestamp),running=!1,cancelAnimationFrame(frame)}return{loop:loop,invalidate:function invalidate(state,frames=1){var _state$gl$xr2;if(!state)return roots.forEach((root=>invalidate(root.store.getState(),frames)));null!=(_state$gl$xr2=state.gl.xr)&&_state$gl$xr2.isPresenting||!state.internal.active||"never"===state.frameloop||(state.internal.frames=frames>1?Math.min(60,state.internal.frames+frames):useFrameInProgress?2:1,running||(running=!0,requestAnimationFrame(loop)))},advance:function advance(timestamp,runGlobalEffects=!0,state,frame){if(runGlobalEffects&&flushGlobalEffects("before",timestamp),state)render$1(timestamp,state,frame);else for(const root of roots.values())render$1(timestamp,root.store.getState());runGlobalEffects&&flushGlobalEffects("after",timestamp)}}}(roots),{reconciler:reconciler,applyProps:applyProps}=function createRenderer(_roots,_getEventPriority){function createInstance(type,{args:args=[],attach:attach,...props},root){let instance,name=`${type[0].toUpperCase()}${type.slice(1)}`;if("primitive"===type){if(void 0===props.object)throw new Error("R3F: Primitives without 'object' are invalid!");instance=prepare(props.object,{type:type,root:root,attach:attach,primitive:!0})}else{const target=catalogue[name];if(!target)throw new Error(`R3F: ${name} 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(!Array.isArray(args))throw new Error("R3F: The args prop must be an array!");instance=prepare(new target(...args),{type:type,root:root,attach:attach,memoizedProps:{args:args}})}return void 0===instance.__r3f.attach&&(instance instanceof three_module.BufferGeometry?instance.__r3f.attach="geometry":instance instanceof three_module.Material&&(instance.__r3f.attach="material")),"inject"!==name&&applyProps$1(instance,props),instance}function appendChild(parentInstance,child){let added=!1;var _child$__r3f,_parentInstance$__r3f;child&&(null!=(_child$__r3f=child.__r3f)&&_child$__r3f.attach?attach(parentInstance,child,child.__r3f.attach):child.isObject3D&&parentInstance.isObject3D&&(parentInstance.add(child),added=!0),added||null==(_parentInstance$__r3f=parentInstance.__r3f)||_parentInstance$__r3f.objects.push(child),child.__r3f||prepare(child,{}),child.__r3f.parent=parentInstance,updateInstance(child),invalidateInstance(child))}function insertBefore(parentInstance,child,beforeChild){let added=!1;if(child){var _child$__r3f2,_parentInstance$__r3f2;if(null!=(_child$__r3f2=child.__r3f)&&_child$__r3f2.attach)attach(parentInstance,child,child.__r3f.attach);else if(child.isObject3D&&parentInstance.isObject3D){child.parent=parentInstance,child.dispatchEvent({type:"added"}),parentInstance.dispatchEvent({type:"childadded",child:child});const restSiblings=parentInstance.children.filter((sibling=>sibling!==child)),index=restSiblings.indexOf(beforeChild);parentInstance.children=[...restSiblings.slice(0,index),child,...restSiblings.slice(index)],added=!0}added||null==(_parentInstance$__r3f2=parentInstance.__r3f)||_parentInstance$__r3f2.objects.push(child),child.__r3f||prepare(child,{}),child.__r3f.parent=parentInstance,updateInstance(child),invalidateInstance(child)}}function removeRecursive(array,parent,dispose=!1){array&&[...array].forEach((child=>removeChild(parent,child,dispose)))}function removeChild(parentInstance,child,dispose){if(child){var _parentInstance$__r3f3,_child$__r3f3,_child$__r3f5;if(child.__r3f&&(child.__r3f.parent=null),null!=(_parentInstance$__r3f3=parentInstance.__r3f)&&_parentInstance$__r3f3.objects&&(parentInstance.__r3f.objects=parentInstance.__r3f.objects.filter((x=>x!==child))),null!=(_child$__r3f3=child.__r3f)&&_child$__r3f3.attach)detach(parentInstance,child,child.__r3f.attach);else if(child.isObject3D&&parentInstance.isObject3D){var _child$__r3f4;parentInstance.remove(child),null!=(_child$__r3f4=child.__r3f)&&_child$__r3f4.root&&function removeInteractivity(store,object){const{internal:internal}=store.getState();internal.interaction=internal.interaction.filter((o=>o!==object)),internal.initialHits=internal.initialHits.filter((o=>o!==object)),internal.hovered.forEach(((value,key)=>{value.eventObject!==object&&value.object!==object||internal.hovered.delete(key)})),internal.capturedMap.forEach(((captures,pointerId)=>{releaseInternalPointerCapture(internal.capturedMap,object,captures,pointerId)}))}(findInitialRoot(child),child)}const isPrimitive=null==(_child$__r3f5=child.__r3f)?void 0:_child$__r3f5.primitive,shouldDispose=!isPrimitive&&(void 0===dispose?null!==child.dispose:dispose);var _child$__r3f6;if(!isPrimitive)removeRecursive(null==(_child$__r3f6=child.__r3f)?void 0:_child$__r3f6.objects,child,shouldDispose),removeRecursive(child.children,child,shouldDispose);if(delete child.__r3f,shouldDispose&&child.dispose&&"Scene"!==child.type){const callback=()=>{try{child.dispose()}catch(e){}};"undefined"==typeof IS_REACT_ACT_ENVIRONMENT?(0,scheduler.unstable_scheduleCallback)(scheduler.unstable_IdlePriority,callback):callback()}invalidateInstance(parentInstance)}}const handleTextInstance=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:react_reconciler_default()({createInstance:createInstance,removeChild:removeChild,appendChild:appendChild,appendInitialChild:appendChild,insertBefore:insertBefore,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(container,child)=>{if(!child)return;const scene=container.getState().scene;scene.__r3f&&(scene.__r3f.root=container,appendChild(scene,child))},removeChildFromContainer:(container,child)=>{child&&removeChild(container.getState().scene,child)},insertInContainerBefore:(container,child,beforeChild)=>{if(!child||!beforeChild)return;const scene=container.getState().scene;scene.__r3f&&insertBefore(scene,child,beforeChild)},getRootHostContext:()=>null,getChildHostContext:parentHostContext=>parentHostContext,finalizeInitialChildren(instance){var _instance$__r3f2;const localState=null!=(_instance$__r3f2=null==instance?void 0:instance.__r3f)?_instance$__r3f2:{};return Boolean(localState.handlers)},prepareUpdate(instance,_type,oldProps,newProps){var _instance$__r3f3;if((null!=(_instance$__r3f3=null==instance?void 0:instance.__r3f)?_instance$__r3f3:{}).primitive&&newProps.object&&newProps.object!==instance)return[!0];{const{args:argsNew=[],children:cN,...restNew}=newProps,{args:argsOld=[],children:cO,...restOld}=oldProps;if(!Array.isArray(argsNew))throw new Error("R3F: the args prop must be an array!");if(argsNew.some(((value,index)=>value!==argsOld[index])))return[!0];const diff=diffProps(instance,restNew,restOld,!0);return diff.changes.length?[!1,diff]:null}},commitUpdate(instance,[reconstruct,diff],type,_oldProps,newProps,fiber){reconstruct?function switchInstance(instance,type,newProps,fiber){var _instance$__r3f;const parent=null==(_instance$__r3f=instance.__r3f)?void 0:_instance$__r3f.parent;if(!parent)return;const newInstance=createInstance(type,newProps,instance.__r3f.root);if(instance.children){for(const child of instance.children)child.__r3f&&appendChild(newInstance,child);instance.children=instance.children.filter((child=>!child.__r3f))}instance.__r3f.objects.forEach((child=>appendChild(newInstance,child))),instance.__r3f.objects=[],instance.__r3f.autoRemovedBeforeAppend||removeChild(parent,instance),newInstance.parent&&(newInstance.__r3f.autoRemovedBeforeAppend=!0),appendChild(parent,newInstance),newInstance.raycast&&newInstance.__r3f.eventCount&&findInitialRoot(newInstance).getState().internal.interaction.push(newInstance);[fiber,fiber.alternate].forEach((fiber=>{null!==fiber&&(fiber.stateNode=newInstance,fiber.ref&&("function"==typeof fiber.ref?fiber.ref(newInstance):fiber.ref.current=newInstance))}))}(instance,type,newProps,fiber):applyProps$1(instance,diff)},commitMount(instance,_type,_props,_int){var _instance$__r3f4;const localState=null!=(_instance$__r3f4=instance.__r3f)?_instance$__r3f4:{};instance.raycast&&localState.handlers&&localState.eventCount&&findInitialRoot(instance).getState().internal.interaction.push(instance)},getPublicInstance:instance=>instance,prepareForCommit:()=>null,preparePortalMount:container=>prepare(container.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(instance){var _instance$__r3f5;const{attach:type,parent:parent}=null!=(_instance$__r3f5=instance.__r3f)?_instance$__r3f5:{};type&&parent&&detach(parent,instance,type),instance.isObject3D&&(instance.visible=!1),invalidateInstance(instance)},unhideInstance(instance,props){var _instance$__r3f6;const{attach:type,parent:parent}=null!=(_instance$__r3f6=instance.__r3f)?_instance$__r3f6:{};type&&parent&&attach(parent,instance,type),(instance.isObject3D&&null==props.visible||props.visible)&&(instance.visible=!0),invalidateInstance(instance)},createTextInstance:handleTextInstance,hideTextInstance:handleTextInstance,unhideTextInstance:handleTextInstance,getCurrentEventPriority:()=>_getEventPriority?_getEventPriority():constants.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:"undefined"!=typeof performance&&is.fun(performance.now)?performance.now:is.fun(Date.now)?Date.now:()=>0,scheduleTimeout:is.fun(setTimeout)?setTimeout:void 0,cancelTimeout:is.fun(clearTimeout)?clearTimeout:void 0}),applyProps:applyProps$1}}(0,(function getEventPriority(){var _globalScope$event;const globalScope="undefined"!=typeof self&&self||"undefined"!=typeof window&&window;if(!globalScope)return constants.DefaultEventPriority;switch(null==(_globalScope$event=globalScope.event)?void 0:_globalScope$event.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return constants.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return constants.ContinuousEventPriority;default:return constants.DefaultEventPriority}})),shallowLoose={objects:"shallow",strict:!1},createRendererInstance=(gl,canvas)=>{const customRenderer="function"==typeof gl?gl(canvas):gl;return isRenderer(customRenderer)?customRenderer:new three_module.WebGLRenderer({powerPreference:"high-performance",canvas:canvas,antialias:!0,alpha:!0,...gl})};function createRoot(canvas){const prevRoot=roots.get(canvas),prevFiber=null==prevRoot?void 0:prevRoot.fiber,prevStore=null==prevRoot?void 0:prevRoot.store;prevRoot&&console.warn("R3F.createRoot should only be called once!");const logRecoverableError="function"==typeof reportError?reportError:console.error,store=prevStore||index_99983b2d_esm_createStore(invalidate,advance),fiber=prevFiber||reconciler.createContainer(store,constants.ConcurrentRoot,null,!1,null,"",logRecoverableError,null);let onCreated;prevRoot||roots.set(canvas,{fiber:fiber,store:store});let lastCamera,configured=!1;return{configure(props={}){let{gl:glConfig,size:propsSize,scene:sceneOptions,events:events,onCreated:onCreatedCallback,shadows:shadows=!1,linear:linear=!1,flat:flat=!1,legacy:legacy=!1,orthographic:orthographic=!1,frameloop:frameloop="always",dpr:dpr=[1,2],performance:performance,raycaster:raycastOptions,camera:cameraOptions,onPointerMissed:onPointerMissed}=props,state=store.getState(),gl=state.gl;state.gl||state.set({gl:gl=createRendererInstance(glConfig,canvas)});let raycaster=state.raycaster;raycaster||state.set({raycaster:raycaster=new three_module.Raycaster});const{params:params,...options}=raycastOptions||{};if(is.equ(options,raycaster,shallowLoose)||applyProps(raycaster,{...options}),is.equ(params,raycaster.params,shallowLoose)||applyProps(raycaster,{params:{...raycaster.params,...params}}),!state.camera||state.camera===lastCamera&&!is.equ(lastCamera,cameraOptions,shallowLoose)){lastCamera=cameraOptions;const isCamera=cameraOptions instanceof three_module.Camera,camera=isCamera?cameraOptions:orthographic?new three_module.OrthographicCamera(0,0,0,0,.1,1e3):new three_module.PerspectiveCamera(75,0,.1,1e3);isCamera||(camera.position.z=5,cameraOptions&&(applyProps(camera,cameraOptions),("aspect"in cameraOptions||"left"in cameraOptions||"right"in cameraOptions||"bottom"in cameraOptions||"top"in cameraOptions)&&(camera.manual=!0,camera.updateProjectionMatrix())),state.camera||null!=cameraOptions&&cameraOptions.rotation||camera.lookAt(0,0,0)),state.set({camera:camera}),raycaster.camera=camera}if(!state.scene){let scene;sceneOptions instanceof three_module.Scene?scene=sceneOptions:(scene=new three_module.Scene,sceneOptions&&applyProps(scene,sceneOptions)),state.set({scene:prepare(scene)})}if(!state.xr){var _gl$xr;const handleXRFrame=(timestamp,frame)=>{const state=store.getState();"never"!==state.frameloop&&advance(timestamp,!0,state,frame)},handleSessionChange=()=>{const state=store.getState();state.gl.xr.enabled=state.gl.xr.isPresenting,state.gl.xr.setAnimationLoop(state.gl.xr.isPresenting?handleXRFrame:null),state.gl.xr.isPresenting||invalidate(state)},xr={connect(){const gl=store.getState().gl;gl.xr.addEventListener("sessionstart",handleSessionChange),gl.xr.addEventListener("sessionend",handleSessionChange)},disconnect(){const gl=store.getState().gl;gl.xr.removeEventListener("sessionstart",handleSessionChange),gl.xr.removeEventListener("sessionend",handleSessionChange)}};"function"==typeof(null==(_gl$xr=gl.xr)?void 0:_gl$xr.addEventListener)&&xr.connect(),state.set({xr:xr})}if(gl.shadowMap){const oldEnabled=gl.shadowMap.enabled,oldType=gl.shadowMap.type;if(gl.shadowMap.enabled=!!shadows,is.boo(shadows))gl.shadowMap.type=three_module.PCFSoftShadowMap;else if(is.str(shadows)){var _types$shadows;const types={basic:three_module.BasicShadowMap,percentage:three_module.PCFShadowMap,soft:three_module.PCFSoftShadowMap,variance:three_module.VSMShadowMap};gl.shadowMap.type=null!=(_types$shadows=types[shadows])?_types$shadows:three_module.PCFSoftShadowMap}else is.obj(shadows)&&Object.assign(gl.shadowMap,shadows);oldEnabled===gl.shadowMap.enabled&&oldType===gl.shadowMap.type||(gl.shadowMap.needsUpdate=!0)}const ColorManagement=getColorManagement();if(ColorManagement&&("enabled"in ColorManagement?ColorManagement.enabled=!legacy:"legacyMode"in ColorManagement&&(ColorManagement.legacyMode=legacy)),!configured){applyProps(gl,{outputEncoding:linear?3e3:3001,toneMapping:flat?three_module.NoToneMapping:three_module.ACESFilmicToneMapping})}state.legacy!==legacy&&state.set((()=>({legacy:legacy}))),state.linear!==linear&&state.set((()=>({linear:linear}))),state.flat!==flat&&state.set((()=>({flat:flat}))),!glConfig||is.fun(glConfig)||isRenderer(glConfig)||is.equ(glConfig,gl,shallowLoose)||applyProps(gl,glConfig),events&&!state.events.handlers&&state.set({events:events(store)});const size=function computeInitialSize(canvas,defaultSize){const defaultStyle="undefined"!=typeof HTMLCanvasElement&&canvas instanceof HTMLCanvasElement;if(defaultSize){const{width:width,height:height,top:top,left:left,updateStyle:updateStyle=defaultStyle}=defaultSize;return{width:width,height:height,top:top,left:left,updateStyle:updateStyle}}if("undefined"!=typeof HTMLCanvasElement&&canvas instanceof HTMLCanvasElement&&canvas.parentElement){const{width:width,height:height,top:top,left:left}=canvas.parentElement.getBoundingClientRect();return{width:width,height:height,top:top,left:left,updateStyle:defaultStyle}}return"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?{width:canvas.width,height:canvas.height,top:0,left:0,updateStyle:defaultStyle}:{width:0,height:0,top:0,left:0}}(canvas,propsSize);return is.equ(size,state.size,shallowLoose)||state.setSize(size.width,size.height,size.updateStyle,size.top,size.left),dpr&&state.viewport.dpr!==calculateDpr(dpr)&&state.setDpr(dpr),state.frameloop!==frameloop&&state.setFrameloop(frameloop),state.onPointerMissed||state.set({onPointerMissed:onPointerMissed}),performance&&!is.equ(performance,state.performance,shallowLoose)&&state.set((state=>({performance:{...state.performance,...performance}}))),onCreated=onCreatedCallback,configured=!0,this},render(children){return configured||this.configure(),reconciler.updateContainer((0,jsx_runtime.jsx)(Provider,{store:store,children:children,onCreated:onCreated,rootElement:canvas}),fiber,null,(()=>{})),store},unmount(){unmountComponentAtNode(canvas)}}}function Provider({store:store,children:children,onCreated:onCreated,rootElement:rootElement}){return index_99983b2d_esm_useIsomorphicLayoutEffect((()=>{const state=store.getState();state.set((state=>({internal:{...state.internal,active:!0}}))),onCreated&&onCreated(state),store.getState().events.connected||null==state.events.connect||state.events.connect(rootElement)}),[]),(0,jsx_runtime.jsx)(context.Provider,{value:store,children:children})}function unmountComponentAtNode(canvas,callback){const root=roots.get(canvas),fiber=null==root?void 0:root.fiber;if(fiber){const state=null==root?void 0:root.store.getState();state&&(state.internal.active=!1),reconciler.updateContainer(null,fiber,null,(()=>{state&&setTimeout((()=>{try{var _state$gl,_state$gl$renderLists,_state$gl2,_state$gl3;null==state.events.disconnect||state.events.disconnect(),null==(_state$gl=state.gl)||null==(_state$gl$renderLists=_state$gl.renderLists)||null==_state$gl$renderLists.dispose||_state$gl$renderLists.dispose(),null==(_state$gl2=state.gl)||null==_state$gl2.forceContextLoss||_state$gl2.forceContextLoss(),null!=(_state$gl3=state.gl)&&_state$gl3.xr&&state.xr.disconnect(),function dispose(obj){obj.dispose&&"Scene"!==obj.type&&obj.dispose();for(const p in obj)null==p.dispose||p.dispose(),delete obj[p]}(state),roots.delete(canvas),callback&&callback(canvas)}catch(e){}}),500)}))}}function createPortal(children,container,state){return(0,jsx_runtime.jsx)(Portal,{children:children,container:container,state:state},container.uuid)}function Portal({state:state={},children:children,container:container}){const{events:events,size:size,...rest}=state,previousRoot=useStore(),[raycaster]=react.useState((()=>new three_module.Raycaster)),[pointer]=react.useState((()=>new three_module.Vector2)),inject=react.useCallback(((rootState,injectState)=>{const intersect={...rootState};let viewport;if(Object.keys(rootState).forEach((key=>{(privateKeys.includes(key)||rootState[key]!==injectState[key]&&injectState[key])&&delete intersect[key]})),injectState&&size){const camera=injectState.camera;viewport=rootState.viewport.getCurrentViewport(camera,new three_module.Vector3,size),camera!==rootState.camera&&updateCamera(camera,size)}return{...intersect,scene:container,raycaster:raycaster,pointer:pointer,mouse:pointer,previousRoot:previousRoot,events:{...rootState.events,...null==injectState?void 0:injectState.events,...events},size:{...rootState.size,...size},viewport:{...rootState.viewport,...viewport},...rest}}),[state]),[usePortalStore]=react.useState((()=>{const previousState=previousRoot.getState(),store=create(((set,get)=>({...previousState,scene:container,raycaster:raycaster,pointer:pointer,mouse:pointer,previousRoot:previousRoot,events:{...previousState.events,...events},size:{...previousState.size,...size},...rest,set:set,get:get,setEvents:events=>set((state=>({...state,events:{...state.events,...events}})))})));return store}));return react.useEffect((()=>{const unsub=previousRoot.subscribe((prev=>usePortalStore.setState((state=>inject(prev,state)))));return()=>{unsub()}}),[inject]),react.useEffect((()=>{usePortalStore.setState((injectState=>inject(previousRoot.getState(),injectState)))}),[inject]),react.useEffect((()=>()=>{usePortalStore.destroy()}),[]),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:reconciler.createPortal((0,jsx_runtime.jsx)(context.Provider,{value:usePortalStore,children:children}),usePortalStore,null)})}reconciler.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:react.version});react.unstable_act},"./node_modules/@react-three/fiber/dist/react-three-fiber.esm.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Xz:function(){return Canvas}});var index_99983b2d_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-99983b2d.esm.js"),react=__webpack_require__("./node_modules/react/index.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),node_modules_debounce=__webpack_require__("./node_modules/debounce/index.js"),debounce_default=__webpack_require__.n(node_modules_debounce);function useMeasure(_temp){let{debounce:debounce,scroll:scroll,polyfill:polyfill,offsetSize:offsetSize}=void 0===_temp?{debounce:0,scroll:!1,offsetSize:!1}:_temp;const ResizeObserver=polyfill||("undefined"==typeof window?class ResizeObserver{}:window.ResizeObserver);if(!ResizeObserver)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[bounds,set]=(0,react.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),state=(0,react.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:bounds}),scrollDebounce=debounce?"number"==typeof debounce?debounce:debounce.scroll:null,resizeDebounce=debounce?"number"==typeof debounce?debounce:debounce.resize:null,mounted=(0,react.useRef)(!1);(0,react.useEffect)((()=>(mounted.current=!0,()=>{mounted.current=!1})));const[forceRefresh,resizeChange,scrollChange]=(0,react.useMemo)((()=>{const callback=()=>{if(!state.current.element)return;const{left:left,top:top,width:width,height:height,bottom:bottom,right:right,x:x,y:y}=state.current.element.getBoundingClientRect(),size={left:left,top:top,width:width,height:height,bottom:bottom,right:right,x:x,y:y};state.current.element instanceof HTMLElement&&offsetSize&&(size.height=state.current.element.offsetHeight,size.width=state.current.element.offsetWidth),Object.freeze(size),mounted.current&&!areBoundsEqual(state.current.lastBounds,size)&&set(state.current.lastBounds=size)};return[callback,resizeDebounce?debounce_default()(callback,resizeDebounce):callback,scrollDebounce?debounce_default()(callback,scrollDebounce):callback]}),[set,offsetSize,scrollDebounce,resizeDebounce]);function removeListeners(){state.current.scrollContainers&&(state.current.scrollContainers.forEach((element=>element.removeEventListener("scroll",scrollChange,!0))),state.current.scrollContainers=null),state.current.resizeObserver&&(state.current.resizeObserver.disconnect(),state.current.resizeObserver=null)}function addListeners(){state.current.element&&(state.current.resizeObserver=new ResizeObserver(scrollChange),state.current.resizeObserver.observe(state.current.element),scroll&&state.current.scrollContainers&&state.current.scrollContainers.forEach((scrollContainer=>scrollContainer.addEventListener("scroll",scrollChange,{capture:!0,passive:!0}))))}return function useOnWindowScroll(onScroll,enabled){(0,react.useEffect)((()=>{if(enabled){const cb=onScroll;return window.addEventListener("scroll",cb,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",cb,!0)}}}),[onScroll,enabled])}(scrollChange,Boolean(scroll)),function useOnWindowResize(onWindowResize){(0,react.useEffect)((()=>{const cb=onWindowResize;return window.addEventListener("resize",cb),()=>{window.removeEventListener("resize",cb)}}),[onWindowResize])}(resizeChange),(0,react.useEffect)((()=>{removeListeners(),addListeners()}),[scroll,scrollChange,resizeChange]),(0,react.useEffect)((()=>removeListeners),[]),[node=>{node&&node!==state.current.element&&(removeListeners(),state.current.element=node,state.current.scrollContainers=findScrollContainers(node),addListeners())},bounds,forceRefresh]}function findScrollContainers(element){const result=[];if(!element||element===document.body)return result;const{overflow:overflow,overflowX:overflowX,overflowY:overflowY}=window.getComputedStyle(element);return[overflow,overflowX,overflowY].some((prop=>"auto"===prop||"scroll"===prop))&&result.push(element),[...result,...findScrollContainers(element.parentElement)]}const keys=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(a,b)=>keys.every((key=>a[key]===b[key]));var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};function traverseFiber(fiber,ascending,selector){if(!fiber)return;if(!0===selector(fiber))return fiber;let child=ascending?fiber.return:fiber.child;for(;child;){const match=traverseFiber(child,ascending,selector);if(match)return match;child=ascending?null:child.sibling}}function wrapContext(context){try{return Object.defineProperties(context,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(_){return context}}const FiberContext=wrapContext(react.createContext(null));class FiberProvider extends react.Component{render(){return react.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:ReactCurrentOwner,ReactCurrentDispatcher:ReactCurrentDispatcher}=react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const root=react.useContext(FiberContext);if(null===root)throw new Error("its-fine: useFiber must be called within a !");const id=react.useId();return react.useMemo((()=>{for(const maybeFiber of[null==ReactCurrentOwner?void 0:ReactCurrentOwner.current,root,null==root?void 0:root.alternate]){if(!maybeFiber)continue;const fiber2=traverseFiber(maybeFiber,!1,(node=>{let state=node.memoizedState;for(;state;){if(state.memoizedState===id)return!0;state=state.next}}));if(fiber2)return fiber2}}),[root,id])}function useContextBridge(){const contextMap=function useContextMap(){var _a,_b;const fiber=useFiber(),[contextMap]=react.useState((()=>new Map));contextMap.clear();let node=fiber;for(;node;){const context=null==(_a=node.type)?void 0:_a._context;context&&context!==FiberContext&&!contextMap.has(context)&&contextMap.set(context,null==(_b=null==ReactCurrentDispatcher?void 0:ReactCurrentDispatcher.current)?void 0:_b.readContext(wrapContext(context))),node=node.return}return contextMap}();return react.useMemo((()=>Array.from(contextMap.keys()).reduce(((Prev,context)=>props=>{return react.createElement(Prev,null,react.createElement(context.Provider,(a=__spreadValues({},props),b={value:contextMap.get(context)},__defProps(a,__getOwnPropDescs(b)))));var a,b}),(props=>react.createElement(FiberProvider,__spreadValues({},props))))),[contextMap])}var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");__webpack_require__("./node_modules/react-reconciler/constants.js"),__webpack_require__("./node_modules/react-reconciler/index.js"),__webpack_require__("./node_modules/scheduler/index.js");const DOM_EVENTS={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 createPointerEvents(store){const{handlePointer:handlePointer}=(0,index_99983b2d_esm.c)(store);return{priority:1,enabled:!0,compute(event,state,previous){state.pointer.set(event.offsetX/state.size.width*2-1,-event.offsetY/state.size.height*2+1),state.raycaster.setFromCamera(state.pointer,state.camera)},connected:void 0,handlers:Object.keys(DOM_EVENTS).reduce(((acc,key)=>({...acc,[key]:handlePointer(key)})),{}),update:()=>{var _internal$lastEvent;const{events:events,internal:internal}=store.getState();null!=(_internal$lastEvent=internal.lastEvent)&&_internal$lastEvent.current&&events.handlers&&events.handlers.onPointerMove(internal.lastEvent.current)},connect:target=>{var _events$handlers;const{set:set,events:events}=store.getState();null==events.disconnect||events.disconnect(),set((state=>({events:{...state.events,connected:target}}))),Object.entries(null!=(_events$handlers=events.handlers)?_events$handlers:[]).forEach((([name,event])=>{const[eventName,passive]=DOM_EVENTS[name];target.addEventListener(eventName,event,{passive:passive})}))},disconnect:()=>{const{set:set,events:events}=store.getState();var _events$handlers2;events.connected&&(Object.entries(null!=(_events$handlers2=events.handlers)?_events$handlers2:[]).forEach((([name,event])=>{if(events&&events.connected instanceof HTMLElement){const[eventName]=DOM_EVENTS[name];events.connected.removeEventListener(eventName,event)}})),set((state=>({events:{...state.events,connected:void 0}}))))}}}const CanvasImpl=react.forwardRef((function Canvas({children:children,fallback:fallback,resize:resize,style:style,gl:gl,events:events=createPointerEvents,eventSource:eventSource,eventPrefix:eventPrefix,shadows:shadows,linear:linear,flat:flat,legacy:legacy,orthographic:orthographic,frameloop:frameloop,dpr:dpr,performance:performance,raycaster:raycaster,camera:camera,scene:scene,onPointerMissed:onPointerMissed,onCreated:onCreated,...props},forwardedRef){react.useMemo((()=>(0,index_99983b2d_esm.e)(three_module)),[]);const Bridge=useContextBridge(),[containerRef,containerRect]=useMeasure({scroll:!0,debounce:{scroll:50,resize:0},...resize}),canvasRef=react.useRef(null),divRef=react.useRef(null);react.useImperativeHandle(forwardedRef,(()=>canvasRef.current));const handlePointerMissed=(0,index_99983b2d_esm.u)(onPointerMissed),[block,setBlock]=react.useState(!1),[error,setError]=react.useState(!1);if(block)throw block;if(error)throw error;const root=react.useRef(null);(0,index_99983b2d_esm.a)((()=>{const canvas=canvasRef.current;containerRect.width>0&&containerRect.height>0&&canvas&&(root.current||(root.current=(0,index_99983b2d_esm.b)(canvas)),root.current.configure({gl:gl,events:events,shadows:shadows,linear:linear,flat:flat,legacy:legacy,orthographic:orthographic,frameloop:frameloop,dpr:dpr,performance:performance,raycaster:raycaster,camera:camera,scene:scene,size:containerRect,onPointerMissed:(...args)=>null==handlePointerMissed.current?void 0:handlePointerMissed.current(...args),onCreated:state=>{null==state.events.connect||state.events.connect(eventSource?(0,index_99983b2d_esm.i)(eventSource)?eventSource.current:eventSource:divRef.current),eventPrefix&&state.setEvents({compute:(event,state)=>{const x=event[eventPrefix+"X"],y=event[eventPrefix+"Y"];state.pointer.set(x/state.size.width*2-1,-y/state.size.height*2+1),state.raycaster.setFromCamera(state.pointer,state.camera)}}),null==onCreated||onCreated(state)}}),root.current.render((0,jsx_runtime.jsx)(Bridge,{children:(0,jsx_runtime.jsx)(index_99983b2d_esm.E,{set:setError,children:(0,jsx_runtime.jsx)(react.Suspense,{fallback:(0,jsx_runtime.jsx)(index_99983b2d_esm.B,{set:setBlock}),children:children})})})))})),react.useEffect((()=>{const canvas=canvasRef.current;if(canvas)return()=>(0,index_99983b2d_esm.d)(canvas)}),[]);const pointerEvents=eventSource?"none":"auto";return(0,jsx_runtime.jsx)("div",{ref:divRef,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:pointerEvents,...style},...props,children:(0,jsx_runtime.jsx)("div",{ref:containerRef,style:{width:"100%",height:"100%"},children:(0,jsx_runtime.jsx)("canvas",{ref:canvasRef,style:{display:"block"},children:fallback})})})})),Canvas=react.forwardRef((function CanvasWrapper(props,ref){return(0,jsx_runtime.jsx)(FiberProvider,{children:(0,jsx_runtime.jsx)(CanvasImpl,{...props,ref:ref})})}))},"./node_modules/debounce/index.js":function(module){function debounce(func,wait,immediate){var timeout,args,context,timestamp,result;function later(){var last=Date.now()-timestamp;last=0?timeout=setTimeout(later,wait-last):(timeout=null,immediate||(result=func.apply(context,args),context=args=null))}null==wait&&(wait=100);var debounced=function(){context=this,args=arguments,timestamp=Date.now();var callNow=immediate&&!timeout;return timeout||(timeout=setTimeout(later,wait)),callNow&&(result=func.apply(context,args),context=args=null),result};return debounced.clear=function(){timeout&&(clearTimeout(timeout),timeout=null)},debounced.flush=function(){timeout&&(result=func.apply(context,args),context=args=null,clearTimeout(timeout),timeout=null)},debounced}debounce.debounce=debounce,module.exports=debounce},"./node_modules/fflate/esm/browser.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{HT:function(){return unzlibSync}});var u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(eb,start){for(var b=new u16(31),i=0;i<31;++i)b[i]=start+=1<>>1|(21845&i)<<1;x=(61680&(x=(52428&x)>>>2|(13107&x)<<2))>>>4|(3855&x)<<4,rev[i]=((65280&x)>>>8|(255&x)<<8)>>>1}var hMap=function(cd,mb,r){for(var s=cd.length,i=0,l=new u16(mb);i>>rvb]=sv}else for(co=new u16(s),i=0;i>>15-cd[i]);return co},flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;for(i=144;i<256;++i)flt[i]=9;for(i=256;i<280;++i)flt[i]=7;for(i=280;i<288;++i)flt[i]=8;var fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var flrm=hMap(flt,9,1),fdrm=hMap(fdt,5,1),max=function(a){for(var m=a[0],i=1;im&&(m=a[i]);return m},bits=function(d,p,m){var o=p/8|0;return(d[o]|d[o+1]<<8)>>(7&p)&m},bits16=function(d,p){var o=p/8|0;return(d[o]|d[o+1]<<8|d[o+2]<<16)>>(7&p)},shft=function(p){return(p/8|0)+(7&p&&1)},slc=function(v,s,e){(null==s||s<0)&&(s=0),(null==e||e>v.length)&&(e=v.length);var n=new(v instanceof u16?u16:v instanceof u32?u32:u8)(e-s);return n.set(v.subarray(s,e)),n},inflt=function(dat,buf,st){var sl=dat.length;if(!sl||st&&!st.l&&sl<5)return buf||new u8(0);var noBuf=!buf||st,noSt=!st||st.i;st||(st={}),buf||(buf=new u8(3*sl));var cbuf=function(l){var bl=buf.length;if(l>bl){var nbuf=new u8(Math.max(2*bl,l));nbuf.set(buf),buf=nbuf}},final=st.f||0,pos=st.p||0,bt=st.b||0,lm=st.l,dm=st.d,lbt=st.m,dbt=st.n,tbts=8*sl;do{if(!lm){st.f=final=bits(dat,pos,1);var type=bits(dat,pos+1,3);if(pos+=3,!type){var l=dat[(s=shft(pos)+4)-4]|dat[s-3]<<8,t=s+l;if(t>sl){if(noSt)throw"unexpected EOF";break}noBuf&&cbuf(bt+l),buf.set(dat.subarray(s,t),bt),st.b=bt+=l,st.p=pos=8*t;continue}if(1==type)lm=flrm,dm=fdrm,lbt=9,dbt=5;else{if(2!=type)throw"invalid block type";var hLit=bits(dat,pos,31)+257,hcLen=bits(dat,pos+10,15)+4,tl=hLit+bits(dat,pos+5,31)+1;pos+=14;for(var ldt=new u8(tl),clt=new u8(19),i=0;i>>4)<16)ldt[i++]=s;else{var c=0,n=0;for(16==s?(n=3+bits(dat,pos,3),pos+=2,c=ldt[i-1]):17==s?(n=3+bits(dat,pos,7),pos+=3):18==s&&(n=11+bits(dat,pos,127),pos+=7);n--;)ldt[i++]=c}}var lt=ldt.subarray(0,hLit),dt=ldt.subarray(hLit);lbt=max(lt),dbt=max(dt),lm=hMap(lt,lbt,1),dm=hMap(dt,dbt,1)}if(pos>tbts){if(noSt)throw"unexpected EOF";break}}noBuf&&cbuf(bt+131072);for(var lms=(1<>>4;if((pos+=15&c)>tbts){if(noSt)throw"unexpected EOF";break}if(!c)throw"invalid length/literal";if(sym<256)buf[bt++]=sym;else{if(256==sym){lpos=pos,lm=null;break}var add=sym-254;if(sym>264){var b=fleb[i=sym-257];add=bits(dat,pos,(1<>>4;if(!d)throw"invalid distance";pos+=15&d;dt=fd[dsym];if(dsym>3){b=fdeb[dsym];dt+=bits16(dat,pos)&(1<tbts){if(noSt)throw"unexpected EOF";break}noBuf&&cbuf(bt+131072);for(var end=bt+add;bt>>4>7||(d[0]<<8|d[1])%31)throw"invalid zlib data";if(32&d[1])throw"invalid zlib data: preset dictionaries not supported"};function unzlibSync(data,out){return inflt((zlv(data),data.subarray(2,-4)),out)}var td="undefined"!=typeof TextDecoder&&new TextDecoder;try{td.decode(et,{stream:!0}),1}catch(e){}},"./node_modules/jotai/esm/react.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Dv:function(){return useAtomValue},b9:function(){return useSetAtom},zt:function(){return Provider}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),jotai_vanilla__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/jotai/esm/vanilla.mjs");const StoreContext=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(void 0),useStore=options=>{const store=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(StoreContext);return(null==options?void 0:options.store)||store||(0,jotai_vanilla__WEBPACK_IMPORTED_MODULE_1__.K7)()},Provider=({children:children,store:store})=>{const storeRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();return store||storeRef.current||(storeRef.current=(0,jotai_vanilla__WEBPACK_IMPORTED_MODULE_1__.MT)()),(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(StoreContext.Provider,{value:store||storeRef.current},children)},isPromiseLike=x=>"function"==typeof(null==x?void 0:x.then),use=react__WEBPACK_IMPORTED_MODULE_0__.use||(promise=>{if("pending"===promise.status)throw promise;if("fulfilled"===promise.status)return promise.value;throw"rejected"===promise.status?promise.reason:(promise.status="pending",promise.then((v=>{promise.status="fulfilled",promise.value=v}),(e=>{promise.status="rejected",promise.reason=e})),promise)});function useAtomValue(atom,options){const store=useStore(options),[[valueFromReducer,storeFromReducer,atomFromReducer],rerender]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)((prev=>{const nextValue=store.get(atom);return Object.is(prev[0],nextValue)&&prev[1]===store&&prev[2]===atom?prev:[nextValue,store,atom]}),void 0,(()=>[store.get(atom),store,atom]));let value=valueFromReducer;storeFromReducer===store&&atomFromReducer===atom||(rerender(),value=store.get(atom));const delay=null==options?void 0:options.delay;return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const unsub=store.sub(atom,(()=>{"number"!=typeof delay?rerender():setTimeout(rerender,delay)}));return rerender(),unsub}),[store,atom,delay]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useDebugValue)(value),isPromiseLike(value)?use(value):value}function useSetAtom(atom,options){const store=useStore(options);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(((...args)=>{if(!("write"in atom))throw new Error("not writable atom");return store.set(atom,...args)}),[store,atom])}},"./node_modules/jotai/esm/vanilla.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{K7:function(){return getDefaultStore},MT:function(){return createStore},cn:function(){return atom}});let keyCount=0;function atom(read,write){const key="atom"+ ++keyCount,config={toString:()=>key};return"function"==typeof read?config.read=read:(config.init=read,config.read=get=>get(config),config.write=(get,set,arg)=>set(config,"function"==typeof arg?arg(get(config)):arg)),write&&(config.write=write),config}const hasInitialValue=atom=>"init"in atom,isActuallyWritableAtom=atom=>!!atom.write,cancelPromiseMap=new WeakMap,cancelPromise=(promise,next)=>{const cancel=cancelPromiseMap.get(promise);cancel&&(cancelPromiseMap.delete(promise),cancel(next))},resolvePromise=(promise,value)=>{promise.status="fulfilled",promise.value=value},rejectPromise=(promise,e)=>{promise.status="rejected",promise.reason=e},isEqualAtomValue=(a,b)=>"v"in a&&"v"in b&&Object.is(a.v,b.v),isEqualAtomError=(a,b)=>"e"in a&&"e"in b&&Object.is(a.e,b.e),hasPromiseAtomValue=a=>"v"in a&&a.v instanceof Promise,returnAtomValue=atomState=>{if("e"in atomState)throw atomState.e;return atomState.v},createStore=()=>{const atomStateMap=new WeakMap,mountedMap=new WeakMap,pendingMap=new Map;let storeListenersRev1,storeListenersRev2,mountedAtoms;storeListenersRev1=new Set,storeListenersRev2=new Set,mountedAtoms=new Set;const getAtomState=atom=>atomStateMap.get(atom),setAtomState=(atom,atomState)=>{Object.freeze(atomState);const prevAtomState=atomStateMap.get(atom);if(atomStateMap.set(atom,atomState),pendingMap.has(atom)||pendingMap.set(atom,prevAtomState),prevAtomState&&hasPromiseAtomValue(prevAtomState)){const next="v"in atomState?atomState.v instanceof Promise?atomState.v:Promise.resolve(atomState.v):Promise.reject(atomState.e);cancelPromise(prevAtomState.v,next)}},updateDependencies=(atom,nextAtomState,nextDependencies)=>{const dependencies=new Map;let changed=!1;nextDependencies.forEach(((aState,a)=>{aState||a!==atom||(aState=nextAtomState),aState?(dependencies.set(a,aState),nextAtomState.d.get(a)!==aState&&(changed=!0)):console.warn("[Bug] atom state not found")})),(changed||nextAtomState.d.size!==dependencies.size)&&(nextAtomState.d=dependencies)},setAtomValue=(atom,value,nextDependencies)=>{const prevAtomState=getAtomState(atom),nextAtomState={d:(null==prevAtomState?void 0:prevAtomState.d)||new Map,v:value};if(nextDependencies&&updateDependencies(atom,nextAtomState,nextDependencies),prevAtomState&&isEqualAtomValue(prevAtomState,nextAtomState)&&prevAtomState.d===nextAtomState.d)return prevAtomState;if(prevAtomState&&hasPromiseAtomValue(prevAtomState)&&hasPromiseAtomValue(nextAtomState)&&(b=nextAtomState,"v"in(a=prevAtomState)&&"v"in b&&a.v.orig&&a.v.orig===b.v.orig)){if(prevAtomState.d===nextAtomState.d)return prevAtomState;nextAtomState.v=prevAtomState.v}var a,b;return setAtomState(atom,nextAtomState),nextAtomState},setAtomValueOrPromise=(atom,valueOrPromise,nextDependencies,abortPromise)=>{if("function"==typeof(null==(x=valueOrPromise)?void 0:x.then)){let continuePromise;const promise=new Promise(((resolve,reject)=>{let settled=!1;valueOrPromise.then((v=>{if(!settled){settled=!0;const prevAtomState=getAtomState(atom),nextAtomState=setAtomValue(atom,promise,nextDependencies);resolvePromise(promise,v),resolve(v),(null==prevAtomState?void 0:prevAtomState.d)!==nextAtomState.d&&mountDependencies(atom,nextAtomState,null==prevAtomState?void 0:prevAtomState.d)}}),(e=>{if(!settled){settled=!0;const prevAtomState=getAtomState(atom),nextAtomState=setAtomValue(atom,promise,nextDependencies);rejectPromise(promise,e),reject(e),(null==prevAtomState?void 0:prevAtomState.d)!==nextAtomState.d&&mountDependencies(atom,nextAtomState,null==prevAtomState?void 0:prevAtomState.d)}})),continuePromise=next=>{settled||(settled=!0,next.then((v=>resolvePromise(promise,v)),(e=>rejectPromise(promise,e))),resolve(next))}}));return promise.orig=valueOrPromise,promise.status="pending",((promise,cancel)=>{cancelPromiseMap.set(promise,cancel),promise.catch((()=>{})).finally((()=>cancelPromiseMap.delete(promise)))})(promise,(next=>{next&&continuePromise(next),null==abortPromise||abortPromise()})),setAtomValue(atom,promise,nextDependencies)}var x;return setAtomValue(atom,valueOrPromise,nextDependencies)},readAtomState=atom=>{const atomState=getAtomState(atom);if(atomState&&(atomState.d.forEach(((_,a)=>{a===atom||mountedMap.has(a)||readAtomState(a)})),Array.from(atomState.d).every((([a,s])=>{const aState=getAtomState(a);return a===atom||aState===s||aState&&!hasPromiseAtomValue(aState)&&isEqualAtomValue(aState,s)}))))return atomState;const nextDependencies=new Map;let isSync=!0;const getter=a=>{if(a===atom){const aState2=getAtomState(a);if(aState2)return nextDependencies.set(a,aState2),returnAtomValue(aState2);if(hasInitialValue(a))return nextDependencies.set(a,void 0),a.init;throw new Error("no atom init")}const aState=readAtomState(a);return nextDependencies.set(a,aState),returnAtomValue(aState)};let controller,setSelf;const options={get signal(){return controller||(controller=new AbortController),controller.signal},get setSelf(){return isActuallyWritableAtom(atom)||console.warn("setSelf function cannot be used with read-only atom"),!setSelf&&isActuallyWritableAtom(atom)&&(setSelf=(...args)=>{if(isSync&&console.warn("setSelf function cannot be called in sync"),!isSync)return writeAtom(atom,...args)}),setSelf}};try{const valueOrPromise=atom.read(getter,options);return setAtomValueOrPromise(atom,valueOrPromise,nextDependencies,(()=>null==controller?void 0:controller.abort()))}catch(error){return((atom,error,nextDependencies)=>{const prevAtomState=getAtomState(atom),nextAtomState={d:(null==prevAtomState?void 0:prevAtomState.d)||new Map,e:error};return nextDependencies&&updateDependencies(atom,nextAtomState,nextDependencies),prevAtomState&&isEqualAtomError(prevAtomState,nextAtomState)&&prevAtomState.d===nextAtomState.d?prevAtomState:(setAtomState(atom,nextAtomState),nextAtomState)})(atom,error,nextDependencies)}finally{isSync=!1}},readAtom=atom=>returnAtomValue(readAtomState(atom)),canUnmountAtom=(atom,mounted)=>!mounted.l.size&&(!mounted.t.size||1===mounted.t.size&&mounted.t.has(atom)),recomputeDependents=atom=>{const dependencyMap=new Map,dirtyMap=new WeakMap,loop1=a=>{const mounted=mountedMap.get(a);null==mounted||mounted.t.forEach((dependent=>{dependent!==a&&(dependencyMap.set(dependent,(dependencyMap.get(dependent)||new Set).add(a)),dirtyMap.set(dependent,(dirtyMap.get(dependent)||0)+1),loop1(dependent))}))};loop1(atom);const loop2=a=>{const mounted=mountedMap.get(a);null==mounted||mounted.t.forEach((dependent=>{var _a;if(dependent!==a){let dirtyCount=dirtyMap.get(dependent);if(dirtyCount&&dirtyMap.set(dependent,--dirtyCount),!dirtyCount){let isChanged=!!(null==(_a=dependencyMap.get(dependent))?void 0:_a.size);if(isChanged){const prevAtomState=getAtomState(dependent),nextAtomState=readAtomState(dependent);isChanged=!prevAtomState||!isEqualAtomValue(prevAtomState,nextAtomState)}isChanged||dependencyMap.forEach((s=>s.delete(dependent)))}loop2(dependent)}}))};loop2(atom)},writeAtomState=(atom,...args)=>{let isSync=!0;const result=atom.write((a=>returnAtomValue(readAtomState(a))),((a,...args2)=>{let r;if(a===atom){if(!hasInitialValue(a))throw new Error("atom not writable");const prevAtomState=getAtomState(a),nextAtomState=setAtomValueOrPromise(a,args2[0]);prevAtomState&&isEqualAtomValue(prevAtomState,nextAtomState)||recomputeDependents(a)}else r=writeAtomState(a,...args2);if(!isSync){const flushed=flushPending();storeListenersRev2.forEach((l=>l({type:"async-write",flushed:flushed})))}return r}),...args);return isSync=!1,result},writeAtom=(atom,...args)=>{const result=writeAtomState(atom,...args),flushed=flushPending();return storeListenersRev2.forEach((l=>l({type:"write",flushed:flushed}))),result},mountAtom=(atom,initialDependent)=>{const mounted={t:new Set(initialDependent&&[initialDependent]),l:new Set};if(mountedMap.set(atom,mounted),mountedAtoms.add(atom),readAtomState(atom).d.forEach(((_,a)=>{const aMounted=mountedMap.get(a);aMounted?aMounted.t.add(atom):a!==atom&&mountAtom(a,atom)})),readAtomState(atom),isActuallyWritableAtom(atom)&&atom.onMount){const onUnmount=atom.onMount(((...args)=>writeAtom(atom,...args)));onUnmount&&(mounted.u=onUnmount)}return mounted},unmountAtom=atom=>{var _a;const onUnmount=null==(_a=mountedMap.get(atom))?void 0:_a.u;onUnmount&&onUnmount(),mountedMap.delete(atom),mountedAtoms.delete(atom);const atomState=getAtomState(atom);atomState?(hasPromiseAtomValue(atomState)&&cancelPromise(atomState.v),atomState.d.forEach(((_,a)=>{if(a!==atom){const mounted=mountedMap.get(a);mounted&&(mounted.t.delete(atom),canUnmountAtom(a,mounted)&&unmountAtom(a))}}))):console.warn("[Bug] could not find atom state to unmount",atom)},mountDependencies=(atom,atomState,prevDependencies)=>{const depSet=new Set(atomState.d.keys());null==prevDependencies||prevDependencies.forEach(((_,a)=>{if(depSet.has(a))return void depSet.delete(a);const mounted=mountedMap.get(a);mounted&&(mounted.t.delete(atom),canUnmountAtom(a,mounted)&&unmountAtom(a))})),depSet.forEach((a=>{const mounted=mountedMap.get(a);mounted?mounted.t.add(atom):mountedMap.has(atom)&&mountAtom(a,atom)}))},flushPending=()=>{let flushed;for(flushed=new Set;pendingMap.size;){const pending=Array.from(pendingMap);pendingMap.clear(),pending.forEach((([atom,prevAtomState])=>{const atomState=getAtomState(atom);if(atomState){atomState.d!==(null==prevAtomState?void 0:prevAtomState.d)&&mountDependencies(atom,atomState,null==prevAtomState?void 0:prevAtomState.d);const mounted=mountedMap.get(atom);!mounted||prevAtomState&&!hasPromiseAtomValue(prevAtomState)&&(isEqualAtomValue(prevAtomState,atomState)||isEqualAtomError(prevAtomState,atomState))||(mounted.l.forEach((listener=>listener())),flushed.add(atom))}else console.warn("[Bug] no atom state to flush")}))}return storeListenersRev1.forEach((l=>l("state"))),flushed},subscribeAtom=(atom,listener)=>{const mounted=(atom=>{let mounted=mountedMap.get(atom);return mounted||(mounted=mountAtom(atom)),mounted})(atom),flushed=flushPending(),listeners=mounted.l;return listeners.add(listener),storeListenersRev1.forEach((l=>l("sub"))),storeListenersRev2.forEach((l=>l({type:"sub",flushed:flushed}))),()=>{listeners.delete(listener),(atom=>{const mounted=mountedMap.get(atom);mounted&&canUnmountAtom(atom,mounted)&&unmountAtom(atom)})(atom),storeListenersRev1.forEach((l=>l("unsub"))),storeListenersRev2.forEach((l=>l({type:"unsub"})))}};return{get:readAtom,set:writeAtom,sub:subscribeAtom,dev_subscribe_store:(l,rev)=>2!==rev?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),storeListenersRev1.add(l),()=>{storeListenersRev1.delete(l)}):(storeListenersRev2.add(l),()=>{storeListenersRev2.delete(l)}),dev_get_mounted_atoms:()=>mountedAtoms.values(),dev_get_atom_state:a=>atomStateMap.get(a),dev_get_mounted:a=>mountedMap.get(a),dev_restore_atoms:values=>{for(const[atom,valueOrPromise]of values)hasInitialValue(atom)&&(setAtomValueOrPromise(atom,valueOrPromise),recomputeDependents(atom));const flushed=flushPending();storeListenersRev2.forEach((l=>l({type:"restore",flushed:flushed})))}}};let defaultStore;const getDefaultStore=()=>(defaultStore||(defaultStore=createStore()),defaultStore);globalThis.__JOTAI_PACKAGE_IS_LOADED__?console.warn("Detected multiple Jotai instances. It may cause unexpected behavior. https://github.com/pmndrs/jotai/discussions/2044"):globalThis.__JOTAI_PACKAGE_IS_LOADED__=!0},"./node_modules/react-reconciler/cjs/react-reconciler-constants.production.min.js":function(__unused_webpack_module,exports){"use strict";exports.ConcurrentRoot=1,exports.ContinuousEventPriority=4,exports.DefaultEventPriority=16,exports.DiscreteEventPriority=1},"./node_modules/react-reconciler/cjs/react-reconciler.production.min.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function $$$reconciler($$$hostConfig){var exports={},aa=__webpack_require__("./node_modules/react/index.js"),ba=__webpack_require__("./node_modules/scheduler/index.js"),ca=Object.assign;function n(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c--h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");return a.displayName&&k.includes("")&&(k=k.replace("",a.displayName)),k}}while(1<=g&&0<=h);break}}}finally{bc=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?ac(a):""}var dc=Object.prototype.hasOwnProperty,ec=[],fc=-1;function gc(a){return{current:a}}function x(a){0>fc||(a.current=ec[fc],ec[fc]=null,fc--)}function y(a,b){fc++,ec[fc]=a.current,a.current=b}var hc={},A=gc(hc),B=gc(!1),ic=hc;function jc(a,b){var c=a.type.contextTypes;if(!c)return hc;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var f,e={};for(f in c)e[f]=b[f];return d&&((a=a.stateNode).__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e),e}function C(a){return null!=(a=a.childContextTypes)}function kc(){x(B),x(A)}function lc(a,b,c){if(A.current!==hc)throw Error(n(168));y(A,b),y(B,c)}function mc(a,b,c){var d=a.stateNode;if(b=b.childContextTypes,"function"!=typeof d.getChildContext)return c;for(var e in d=d.getChildContext())if(!(e in b))throw Error(n(108,xa(a)||"Unknown",e));return ca({},c,d)}function nc(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||hc,ic=A.current,y(A,a),y(B,B.current),!0}function oc(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=mc(a,b,ic),d.__reactInternalMemoizedMergedChildContext=a,x(B),x(A),y(A,a)):x(B),y(B,c)}var qc=Math.clz32?Math.clz32:function pc(a){return 0===(a>>>=0)?32:31-(rc(a)/sc|0)|0},rc=Math.log,sc=Math.LN2;var tc=64,uc=4194304;function vc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&a;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&a;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function wc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=268435455&c;if(0!==g){var h=g&~e;0!==h?d=vc(h):0!==(f&=g)&&(d=vc(f))}else 0!==(g=c&~e)?d=vc(g):0!==f&&(d=vc(f));if(0===d)return 0;if(0!==b&&b!==d&&0==(b&e)&&((e=d&-d)>=(f=b&-b)||16===e&&0!=(4194240&f)))return b;if(0!=(4&d)&&(d|=16&c),0!==(b=a.entangledLanes))for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}function Bc(a,b,c){a.pendingLanes|=b,536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0),(a=a.eventTimes)[b=31-qc(b)]=c}function Dc(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-qc(c),e=1<>=g,e-=g,Nd=1<<32-qc(b)+e|c<u?(t=w,w=null):t=w.sibling;var q=r(e,w,h[u],k);if(null===q){null===w&&(w=t);break}a&&w&&null===q.alternate&&b(e,w),g=f(q,g,u),null===m?l=q:m.sibling=q,m=q,w=t}if(u===h.length)return c(e,w),I&&Pd(e,u),l;if(null===w){for(;uu?(q=m,m=null):q=m.sibling;var V=r(e,m,t.value,k);if(null===V){null===m&&(m=q);break}a&&m&&null===V.alternate&&b(e,m),g=f(V,g,u),null===w?l=V:w.sibling=V,w=V,m=q}if(t.done)return c(e,m),I&&Pd(e,u),l;if(null===m){for(;!t.done;u++,t=h.next())null!==(t=v(e,t.value,k))&&(g=f(t,g,u),null===w?l=t:w.sibling=t,w=t);return I&&Pd(e,u),l}for(m=d(e,m);!t.done;u++,t=h.next())null!==(t=z(m,e,u,t.value,k))&&(a&&null!==t.alternate&&m.delete(null===t.key?u:t.key),g=f(t,g,u),null===w?l=t:w.sibling=t,w=t);return a&&m.forEach((function(a){return b(e,a)})),I&&Pd(e,u),l}return function da(a,d,f,h){if("object"==typeof f&&null!==f&&f.type===ia&&null===f.key&&(f=f.props.children),"object"==typeof f&&null!==f){switch(f.$$typeof){case fa:a:{for(var k=f.key,l=d;null!==l;){if(l.key===k){if((k=f.type)===ia){if(7===l.tag){c(a,l.sibling),(d=e(l,f.props.children)).return=a,a=d;break a}}else if(l.elementType===k||"object"==typeof k&&null!==k&&k.$$typeof===ra&&he(k)===l.type){c(a,l.sibling),(d=e(l,f.props)).ref=fe(a,l,f),d.return=a,a=d;break a}c(a,l);break}b(a,l),l=l.sibling}f.type===ia?((d=ne(f.props.children,a.mode,h,f.key)).return=a,a=d):((h=le(f.type,f.key,f.props,null,a.mode,h)).ref=fe(a,d,f),h.return=a,a=h)}return g(a);case ha:a:{for(l=f.key;null!==d;){if(d.key===l){if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling),(d=e(d,f.children||[])).return=a,a=d;break a}c(a,d);break}b(a,d),d=d.sibling}(d=me(f,a.mode,h)).return=a,a=d}return g(a);case ra:return da(a,d,(l=f._init)(f._payload),h)}if(Ea(f))return q(a,d,f,h);if(ua(f))return N(a,d,f,h);ge(a,f)}return"string"==typeof f&&""!==f||"number"==typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),(d=e(d,f)).return=a,a=d):(c(a,d),(d=ke(f,a.mode,h)).return=a,a=d),g(a)):c(a,d)}}var oe=ie(!0),pe=ie(!1),qe={},re=gc(qe),se=gc(qe),te=gc(qe);function ue(a){if(a===qe)throw Error(n(174));return a}function ve(a,b){y(te,b),y(se,a),y(re,qe),a=Ga(b),x(re),y(re,a)}function we(){x(re),x(se),x(te)}function xe(a){var b=ue(te.current),c=ue(re.current);c!==(b=Ha(c,a.type,b))&&(y(se,a),y(re,b))}function ye(a){se.current===a&&(x(re),x(se))}var J=gc(0);function ze(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(null===(c=c.dehydrated)||Ib(c)||Jb(c)))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!=(128&b.flags))return b}else if(null!==b.child){b.child.return=b,b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return,b=b.sibling}return null}var Ae=[];function Be(){for(var a=0;ac?c:4,a(!0);var d=De.transition;De.transition={};try{a(!1),b()}finally{D=c,De.transition=d}}function rf(){return Re().memoizedState}function sf(a,b,c){var d=zd(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null},tf(a)?uf(b,c):(vf(a,b,c),null!==(a=Ad(a,d,c=H()))&&wf(a,b,d))}function df(a,b,c){var d=zd(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(tf(a))uf(b,e);else{vf(a,b,e);var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&null!==(f=b.lastRenderedReducer))try{var g=b.lastRenderedState,h=f(g,c);if(e.hasEagerState=!0,e.eagerState=h,Rc(h,g))return}catch(k){}null!==(a=Ad(a,d,c=H()))&&wf(a,b,d)}}function tf(a){var b=a.alternate;return a===K||null!==b&&b===K}function uf(a,b){Ge=Fe=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b),a.pending=b}function vf(a,b,c){null!==F&&0!=(1&a.mode)&&0==(2&G)?(null===(a=b.interleaved)?(c.next=c,null===md?md=[b]:md.push(b)):(c.next=a.next,a.next=c),b.interleaved=c):(null===(a=b.pending)?c.next=c:(c.next=a.next,a.next=c),b.pending=c)}function wf(a,b,c){if(0!=(4194240&c)){var d=b.lanes;c|=d&=a.pendingLanes,b.lanes=c,Dc(a,c)}}var Oe={readContext:ld,useCallback:O,useContext:O,useEffect:O,useImperativeHandle:O,useInsertionEffect:O,useLayoutEffect:O,useMemo:O,useReducer:O,useRef:O,useState:O,useDebugValue:O,useDeferredValue:O,useTransition:O,useMutableSource:O,useSyncExternalStore:O,useId:O,unstable_isNewReconciler:!1},Le={readContext:ld,useCallback:function(a,b){return Qe().memoizedState=[a,void 0===b?null:b],a},useContext:ld,useEffect:hf,useImperativeHandle:function(a,b,c){return c=null!=c?c.concat([a]):null,ff(4194308,4,lf.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ff(4194308,4,a,b)},useInsertionEffect:function(a,b){return ff(4,2,a,b)},useMemo:function(a,b){var c=Qe();return b=void 0===b?null:b,a=a(),c.memoizedState=[a,b],a},useReducer:function(a,b,c){var d=Qe();return b=void 0!==c?c(b):b,d.memoizedState=d.baseState=b,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},d.queue=a,a=a.dispatch=sf.bind(null,K,a),[d.memoizedState,a]},useRef:function(a){return a={current:a},Qe().memoizedState=a},useState:cf,useDebugValue:nf,useDeferredValue:function(a){var b=cf(a),c=b[0],d=b[1];return hf((function(){var b=De.transition;De.transition={};try{d(a)}finally{De.transition=b}}),[a]),c},useTransition:function(){var a=cf(!1),b=a[0];return a=qf.bind(null,a[1]),Qe().memoizedState=a,[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=K,e=Qe();if(I){if(void 0===c)throw Error(n(407));c=c()}else{if(c=b(),null===F)throw Error(n(349));0!=(30&Ee)||af(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};return e.queue=f,hf(Ye.bind(null,d,f,a),[a]),d.flags|=2048,Ze(9,$e.bind(null,d,f,c,b),void 0,null),c},useId:function(){var a=Qe(),b=F.identifierPrefix;if(I){var c=Od;b=":"+b+"R"+(c=(Nd&~(1<<32-qc(Nd)-1)).toString(32)+c),0<(c=He++)&&(b+="H"+c.toString(32)),b+=":"}else b=":"+b+"r"+(c=Ie++).toString(32)+":";return a.memoizedState=b},unstable_isNewReconciler:!1},Me={readContext:ld,useCallback:of,useContext:ld,useEffect:Xe,useImperativeHandle:mf,useInsertionEffect:jf,useLayoutEffect:kf,useMemo:pf,useReducer:Te,useRef:ef,useState:function(){return Te(Se)},useDebugValue:nf,useDeferredValue:function(a){var b=Te(Se),c=b[0],d=b[1];return Xe((function(){var b=De.transition;De.transition={};try{d(a)}finally{De.transition=b}}),[a]),c},useTransition:function(){return[Te(Se)[0],Re().memoizedState]},useMutableSource:Ve,useSyncExternalStore:We,useId:rf,unstable_isNewReconciler:!1},Ne={readContext:ld,useCallback:of,useContext:ld,useEffect:Xe,useImperativeHandle:mf,useInsertionEffect:jf,useLayoutEffect:kf,useMemo:pf,useReducer:Ue,useRef:ef,useState:function(){return Ue(Se)},useDebugValue:nf,useDeferredValue:function(a){var b=Ue(Se),c=b[0],d=b[1];return Xe((function(){var b=De.transition;De.transition={};try{d(a)}finally{De.transition=b}}),[a]),c},useTransition:function(){return[Ue(Se)[0],Re().memoizedState]},useMutableSource:Ve,useSyncExternalStore:We,useId:rf,unstable_isNewReconciler:!1};function xf(a,b){try{var c="",d=b;do{c+=$c(d),d=d.return}while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack}return{value:a,source:b,stack:e}}function yf(a,b){try{console.error(b.value)}catch(c){setTimeout((function(){throw c}))}}var Lf,Mf,Nf,Of,zf="function"==typeof WeakMap?WeakMap:Map;function Af(a,b,c){(c=qd(-1,c)).tag=3,c.payload={element:null};var d=b.value;return c.callback=function(){Bf||(Bf=!0,Cf=d),yf(0,b)},c}function Df(a,b,c){(c=qd(-1,c)).tag=3;var d=a.type.getDerivedStateFromError;if("function"==typeof d){var e=b.value;c.payload=function(){return d(e)},c.callback=function(){yf(0,b)}}var f=a.stateNode;return null!==f&&"function"==typeof f.componentDidCatch&&(c.callback=function(){yf(0,b),"function"!=typeof d&&(null===Ef?Ef=new Set([this]):Ef.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})}),c}function Ff(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new zf;var e=new Set;d.set(b,e)}else void 0===(e=d.get(b))&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=Gf.bind(null,a,b,c),b.then(a,a))}function Hf(a){do{var b;if((b=13===a.tag)&&(b=null===(b=a.memoizedState)||null!==b.dehydrated),b)return a;a=a.return}while(null!==a);return null}function If(a,b,c,d,e){return 0==(1&a.mode)?(a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:((b=qd(-1,1)).tag=2,rd(c,b))),c.lanes|=1),a):(a.flags|=65536,a.lanes=e,a)}function Jf(a){a.flags|=4}function Kf(a,b){if(null!==a&&a.child===b.child)return!0;if(0!=(16&b.flags))return!1;for(a=b.child;null!==a;){if(0!=(12854&a.flags)||0!=(12854&a.subtreeFlags))return!1;a=a.sibling}return!0}if(Ua)Lf=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)La(a,c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c,c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},Mf=function(){},Nf=function(a,b,c,d,e){if((a=a.memoizedProps)!==d){var f=b.stateNode,g=ue(re.current);c=Na(f,c,a,d,e,g),(b.updateQueue=c)&&Jf(b)}},Of=function(a,b,c,d){c!==d&&Jf(b)};else if(Va){Lf=function(a,b,c,d){for(var e=b.child;null!==e;){if(5===e.tag){var f=e.stateNode;c&&d&&(f=Db(f,e.type,e.memoizedProps,e)),La(a,f)}else if(6===e.tag)f=e.stateNode,c&&d&&(f=Eb(f,e.memoizedProps,e)),La(a,f);else if(4!==e.tag)if(22===e.tag&&null!==e.memoizedState)null!==(f=e.child)&&(f.return=e),Lf(a,e,!0,!0);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===b)break;for(;null===e.sibling;){if(null===e.return||e.return===b)return;e=e.return}e.sibling.return=e.return,e=e.sibling}};var Pf=function(a,b,c,d){for(var e=b.child;null!==e;){if(5===e.tag){var f=e.stateNode;c&&d&&(f=Db(f,e.type,e.memoizedProps,e)),Ab(a,f)}else if(6===e.tag)f=e.stateNode,c&&d&&(f=Eb(f,e.memoizedProps,e)),Ab(a,f);else if(4!==e.tag)if(22===e.tag&&null!==e.memoizedState)null!==(f=e.child)&&(f.return=e),Pf(a,e,!0,!0);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===b)break;for(;null===e.sibling;){if(null===e.return||e.return===b)return;e=e.return}e.sibling.return=e.return,e=e.sibling}};Mf=function(a,b){var c=b.stateNode;if(!Kf(a,b)){a=c.containerInfo;var d=zb(a);Pf(d,b,!1,!1),c.pendingChildren=d,Jf(b),Bb(a,d)}},Nf=function(a,b,c,d,e){var f=a.stateNode,g=a.memoizedProps;if((a=Kf(a,b))&&g===d)b.stateNode=f;else{var h=b.stateNode,k=ue(re.current),l=null;g!==d&&(l=Na(h,c,g,d,e,k)),a&&null===l?b.stateNode=f:(f=yb(f,l,c,g,d,b,a,h),Ma(f,c,d,e,k)&&Jf(b),b.stateNode=f,a?Jf(b):Lf(f,b,!1,!1))}},Of=function(a,b,c,d){c!==d?(a=ue(te.current),c=ue(re.current),b.stateNode=Pa(d,a,c,b),Jf(b)):b.stateNode=a.stateNode}}else Mf=function(){},Nf=function(){},Of=function(){};function Qf(a,b){if(!I)switch(a.tailMode){case"hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function P(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=14680064&e.subtreeFlags,d|=14680064&e.flags,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;return a.subtreeFlags|=d,a.childLanes=c,b}function Rf(a,b,c){var d=b.pendingProps;switch(Sd(b),b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return P(b),null;case 1:case 17:return C(b.type)&&kc(),P(b),null;case 3:return d=b.stateNode,we(),x(B),x(A),Be(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),null!==a&&null!==a.child||(ce(b)?Jf(b):null===a||a.memoizedState.isDehydrated&&0==(256&b.flags)||(b.flags|=1024,null!==Wd&&(Sf(Wd),Wd=null))),Mf(a,b),P(b),null;case 5:ye(b),c=ue(te.current);var e=b.type;if(null!==a&&null!=b.stateNode)Nf(a,b,e,d,c),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(n(166));return P(b),null}if(a=ue(re.current),ce(b)){if(!p)throw Error(n(175));a=Pb(b.stateNode,b.type,b.memoizedProps,c,a,b,!Vd),b.updateQueue=a,null!==a&&Jf(b)}else{var f=Ka(e,d,c,a,b);Lf(f,b,!1,!1),b.stateNode=f,Ma(f,e,d,c,a)&&Jf(b)}null!==b.ref&&(b.flags|=512,b.flags|=2097152)}return P(b),null;case 6:if(a&&null!=b.stateNode)Of(a,b,a.memoizedProps,d);else{if("string"!=typeof d&&null===b.stateNode)throw Error(n(166));if(a=ue(te.current),c=ue(re.current),ce(b)){if(!p)throw Error(n(176));if(a=b.stateNode,d=b.memoizedProps,(c=Qb(a,d,b,!Vd))&&null!==(e=Td))switch(f=0!=(1&e.mode),e.tag){case 3:Yb(e.stateNode.containerInfo,a,d,f);break;case 5:Zb(e.type,e.memoizedProps,e.stateNode,a,d,f)}c&&Jf(b)}else b.stateNode=Pa(d,a,c,b)}return P(b),null;case 13:if(x(J),d=b.memoizedState,I&&null!==Ud&&0!=(1&b.mode)&&0==(128&b.flags)){for(a=Ud;a;)a=Lb(a);return de(),b.flags|=98560,b}if(null!==d&&null!==d.dehydrated){if(d=ce(b),null===a){if(!d)throw Error(n(318));if(!p)throw Error(n(344));if(!(a=null!==(a=b.memoizedState)?a.dehydrated:null))throw Error(n(317));Rb(a,b)}else de(),0==(128&b.flags)&&(b.memoizedState=null),b.flags|=4;return P(b),null}return null!==Wd&&(Sf(Wd),Wd=null),0!=(128&b.flags)?(b.lanes=c,b):(d=null!==d,c=!1,null===a?ce(b):c=null!==a.memoizedState,d&&!c&&(b.child.flags|=8192,0!=(1&b.mode)&&(null===a||0!=(1&J.current)?0===Q&&(Q=3):Tf())),null!==b.updateQueue&&(b.flags|=4),P(b),null);case 4:return we(),Mf(a,b),null===a&&Xa(b.stateNode.containerInfo),P(b),null;case 10:return hd(b.type._context),P(b),null;case 19:if(x(J),null===(e=b.memoizedState))return P(b),null;if(d=0!=(128&b.flags),null===(f=e.rendering))if(d)Qf(e,!1);else{if(0!==Q||null!==a&&0!=(128&a.flags))for(a=b.child;null!==a;){if(null!==(f=ze(a))){for(b.flags|=128,Qf(e,!1),null!==(a=f.updateQueue)&&(b.updateQueue=a,b.flags|=4),b.subtreeFlags=0,a=c,d=b.child;null!==d;)e=a,(c=d).flags&=14680066,null===(f=c.alternate)?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=f.childLanes,c.lanes=f.lanes,c.child=f.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=f.memoizedProps,c.memoizedState=f.memoizedState,c.updateQueue=f.updateQueue,c.type=f.type,e=f.dependencies,c.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),d=d.sibling;return y(J,1&J.current|2),b.child}a=a.sibling}null!==e.tail&&E()>Uf&&(b.flags|=128,d=!0,Qf(e,!1),b.lanes=4194304)}else{if(!d)if(null!==(a=ze(f))){if(b.flags|=128,d=!0,null!==(a=a.updateQueue)&&(b.updateQueue=a,b.flags|=4),Qf(e,!0),null===e.tail&&"hidden"===e.tailMode&&!f.alternate&&!I)return P(b),null}else 2*E()-e.renderingStartTime>Uf&&1073741824!==c&&(b.flags|=128,d=!0,Qf(e,!1),b.lanes=4194304);e.isBackwards?(f.sibling=b.child,b.child=f):(null!==(a=e.last)?a.sibling=f:b.child=f,e.last=f)}return null!==e.tail?(b=e.tail,e.rendering=b,e.tail=b.sibling,e.renderingStartTime=E(),b.sibling=null,a=J.current,y(J,d?1&a|2:1&a),b):(P(b),null);case 22:case 23:return Vf(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!=(1&b.mode)?0!=(1073741824&Wf)&&(P(b),Ua&&6&b.subtreeFlags&&(b.flags|=8192)):P(b),null;case 24:case 25:return null}throw Error(n(156,b.tag))}var Xf=ea.ReactCurrentOwner,kd=!1;function R(a,b,c,d){b.child=null===a?pe(b,null,c,d):oe(b,a.child,c,d)}function Yf(a,b,c,d,e){c=c.render;var f=b.ref;return jd(b,e),d=Ke(a,b,c,d,f,e),c=Pe(),null===a||kd?(I&&c&&Rd(b),b.flags|=1,R(a,b,d,e),b.child):(b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zf(a,b,e))}function $f(a,b,c,d,e){if(null===a){var f=c.type;return"function"!=typeof f||ag(f)||void 0!==f.defaultProps||null!==c.compare||void 0!==c.defaultProps?((a=le(c.type,null,d,b,b.mode,e)).ref=b.ref,a.return=b,b.child=a):(b.tag=15,b.type=f,bg(a,b,f,d,e))}if(f=a.child,0==(a.lanes&e)){var g=f.memoizedProps;if((c=null!==(c=c.compare)?c:Zc)(g,d)&&a.ref===b.ref)return Zf(a,b,e)}return b.flags|=1,(a=je(f,d)).ref=b.ref,a.return=b,b.child=a}function bg(a,b,c,d,e){if(null!==a&&Zc(a.memoizedProps,d)&&a.ref===b.ref){if(kd=!1,0==(a.lanes&e))return b.lanes=a.lanes,Zf(a,b,e);0!=(131072&a.flags)&&(kd=!0)}return cg(a,b,c,d,e)}function dg(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0==(1&b.mode))b.memoizedState={baseLanes:0,cachePool:null},y(eg,Wf),Wf|=c;else{if(0==(1073741824&c))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null},b.updateQueue=null,y(eg,Wf),Wf|=a,null;b.memoizedState={baseLanes:0,cachePool:null},d=null!==f?f.baseLanes:c,y(eg,Wf),Wf|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(eg,Wf),Wf|=d;return R(a,b,e,c),b.child}function fg(a,b){var c=b.ref;(null===a&&null!==c||null!==a&&a.ref!==c)&&(b.flags|=512,b.flags|=2097152)}function cg(a,b,c,d,e){var f=C(c)?ic:A.current;return f=jc(b,f),jd(b,e),c=Ke(a,b,c,d,f,e),d=Pe(),null===a||kd?(I&&d&&Rd(b),b.flags|=1,R(a,b,c,e),b.child):(b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zf(a,b,e))}function gg(a,b,c,d,e){if(C(c)){var f=!0;nc(b)}else f=!1;if(jd(b,e),null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),Dd(b,c,d),Fd(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"==typeof l&&null!==l?l=ld(l):l=jc(b,l=C(c)?ic:A.current);var m=c.getDerivedStateFromProps,v="function"==typeof m||"function"==typeof g.getSnapshotBeforeUpdate;v||"function"!=typeof g.UNSAFE_componentWillReceiveProps&&"function"!=typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Ed(b,g,d,l),nd=!1;var r=b.memoizedState;g.state=r,ud(b,d,g,e),k=b.memoizedState,h!==d||r!==k||B.current||nd?("function"==typeof m&&(yd(b,c,m,d),k=b.memoizedState),(h=nd||Cd(b,c,h,d,r,k,l))?(v||"function"!=typeof g.UNSAFE_componentWillMount&&"function"!=typeof g.componentWillMount||("function"==typeof g.componentWillMount&&g.componentWillMount(),"function"==typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"==typeof g.componentDidMount&&(b.flags|=4194308)):("function"==typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"==typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode,pd(a,b),h=b.memoizedProps,l=b.type===b.elementType?h:ad(b.type,h),g.props=l,v=b.pendingProps,r=g.context,"object"==typeof(k=c.contextType)&&null!==k?k=ld(k):k=jc(b,k=C(c)?ic:A.current);var z=c.getDerivedStateFromProps;(m="function"==typeof z||"function"==typeof g.getSnapshotBeforeUpdate)||"function"!=typeof g.UNSAFE_componentWillReceiveProps&&"function"!=typeof g.componentWillReceiveProps||(h!==v||r!==k)&&Ed(b,g,d,k),nd=!1,r=b.memoizedState,g.state=r,ud(b,d,g,e);var q=b.memoizedState;h!==v||r!==q||B.current||nd?("function"==typeof z&&(yd(b,c,z,d),q=b.memoizedState),(l=nd||Cd(b,c,l,d,r,q,k)||!1)?(m||"function"!=typeof g.UNSAFE_componentWillUpdate&&"function"!=typeof g.componentWillUpdate||("function"==typeof g.componentWillUpdate&&g.componentWillUpdate(d,q,k),"function"==typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,q,k)),"function"==typeof g.componentDidUpdate&&(b.flags|=4),"function"==typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!=typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!=typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=q),g.props=d,g.state=q,g.context=k,d=l):("function"!=typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!=typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return hg(a,b,c,d,f,e)}function hg(a,b,c,d,e,f){fg(a,b);var g=0!=(128&b.flags);if(!d&&!g)return e&&oc(b,c,!1),Zf(a,b,f);d=b.stateNode,Xf.current=b;var h=g&&"function"!=typeof c.getDerivedStateFromError?null:d.render();return b.flags|=1,null!==a&&g?(b.child=oe(b,a.child,null,f),b.child=oe(b,null,h,f)):R(a,b,h,f),b.memoizedState=d.state,e&&oc(b,c,!0),b.child}function ig(a){var b=a.stateNode;b.pendingContext?lc(0,b.pendingContext,b.pendingContext!==b.context):b.context&&lc(0,b.context,!1),ve(a,b.containerInfo)}function jg(a,b,c,d,e){return de(),ee(e),b.flags|=256,R(a,b,c,d),b.child}var kg={dehydrated:null,treeContext:null,retryLane:0};function lg(a){return{baseLanes:a,cachePool:null}}function mg(a,b,c){var h,d=b.pendingProps,e=J.current,f=!1,g=0!=(128&b.flags);if((h=g)||(h=(null===a||null!==a.memoizedState)&&0!=(2&e)),h?(f=!0,b.flags&=-129):null!==a&&null===a.memoizedState||(e|=1),y(J,1&e),null===a)return ae(b),null!==(a=b.memoizedState)&&null!==(a=a.dehydrated)?(0==(1&b.mode)?b.lanes=1:Jb(a)?b.lanes=8:b.lanes=1073741824,null):(e=d.children,a=d.fallback,f?(d=b.mode,f=b.child,e={mode:"hidden",children:e},0==(1&d)&&null!==f?(f.childLanes=0,f.pendingProps=e):f=ng(e,d,0,null),a=ne(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=lg(c),b.memoizedState=kg,a):og(b,e));if(null!==(e=a.memoizedState)){if(null!==(h=e.dehydrated)){if(g)return 256&b.flags?(b.flags&=-257,pg(a,b,c,Error(n(422)))):null!==b.memoizedState?(b.child=a.child,b.flags|=128,null):(f=d.fallback,e=b.mode,d=ng({mode:"visible",children:d.children},e,0,null),(f=ne(f,e,c,null)).flags|=2,d.return=b,f.return=b,d.sibling=f,b.child=d,0!=(1&b.mode)&&oe(b,a.child,null,c),b.child.memoizedState=lg(c),b.memoizedState=kg,f);if(0==(1&b.mode))b=pg(a,b,c,null);else if(Jb(h))b=pg(a,b,c,Error(n(419)));else if(d=0!=(c&a.childLanes),kd||d){if(null!==(d=F)){switch(c&-c){case 4:f=2;break;case 16:f=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}0!==(d=0!=(f&(d.suspendedLanes|c))?0:f)&&d!==e.retryLane&&(e.retryLane=d,Ad(a,d,-1))}Tf(),b=pg(a,b,c,Error(n(421)))}else Ib(h)?(b.flags|=128,b.child=a.child,b=qg.bind(null,a),Kb(h,b),b=null):(c=e.treeContext,p&&(Ud=Ob(h),Td=b,I=!0,Wd=null,Vd=!1,null!==c&&(Kd[Ld++]=Nd,Kd[Ld++]=Od,Kd[Ld++]=Md,Nd=c.id,Od=c.overflow,Md=b)),(b=og(b,b.pendingProps.children)).flags|=4096);return b}return f?(d=rg(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?lg(c):{baseLanes:e.baseLanes|c,cachePool:null},f.childLanes=a.childLanes&~c,b.memoizedState=kg,d):(c=sg(a,b,d.children,c),b.memoizedState=null,c)}return f?(d=rg(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?lg(c):{baseLanes:e.baseLanes|c,cachePool:null},f.childLanes=a.childLanes&~c,b.memoizedState=kg,d):(c=sg(a,b,d.children,c),b.memoizedState=null,c)}function og(a,b){return(b=ng({mode:"visible",children:b},a.mode,0,null)).return=a,a.child=b}function sg(a,b,c,d){var e=a.child;return a=e.sibling,c=je(e,{mode:"visible",children:c}),0==(1&b.mode)&&(c.lanes=d),c.return=b,c.sibling=null,null!==a&&(null===(d=b.deletions)?(b.deletions=[a],b.flags|=16):d.push(a)),b.child=c}function rg(a,b,c,d,e){var f=b.mode,g=(a=a.child).sibling,h={mode:"hidden",children:c};return 0==(1&f)&&b.child!==a?((c=b.child).childLanes=0,c.pendingProps=h,b.deletions=null):(c=je(a,h)).subtreeFlags=14680064&a.subtreeFlags,null!==g?d=je(g,d):(d=ne(d,f,e,null)).flags|=2,d.return=b,c.return=b,c.sibling=d,b.child=c,d}function pg(a,b,c,d){return null!==d&&ee(d),oe(b,a.child,null,c),(a=og(b,b.pendingProps.children)).flags|=2,b.memoizedState=null,a}function tg(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b),id(a.return,b,c)}function ug(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function vg(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;if(R(a,b,d.children,c),0!=(2&(d=J.current)))d=1&d|2,b.flags|=128;else{if(null!==a&&0!=(128&a.flags))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&tg(a,c,b);else if(19===a.tag)tg(a,c,b);else if(null!==a.child){a.child.return=a,a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return,a=a.sibling}d&=1}if(y(J,d),0==(1&b.mode))b.memoizedState=null;else switch(e){case"forwards":for(c=b.child,e=null;null!==c;)null!==(a=c.alternate)&&null===ze(a)&&(e=c),c=c.sibling;null===(c=e)?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null),ug(b,!1,e,c,f);break;case"backwards":for(c=null,e=b.child,b.child=null;null!==e;){if(null!==(a=e.alternate)&&null===ze(a)){b.child=e;break}a=e.sibling,e.sibling=c,c=e,e=a}ug(b,!0,c,null,f);break;case"together":ug(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Zf(a,b,c){if(null!==a&&(b.dependencies=a.dependencies),vd|=b.lanes,0==(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(n(153));if(null!==b.child){for(c=je(a=b.child,a.pendingProps),b.child=c,c.return=b;null!==a.sibling;)a=a.sibling,(c=c.sibling=je(a,a.pendingProps)).return=b;c.sibling=null}return b.child}function xg(a,b){switch(Sd(b),b.tag){case 1:return C(b.type)&&kc(),65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 3:return we(),x(B),x(A),Be(),0!=(65536&(a=b.flags))&&0==(128&a)?(b.flags=-65537&a|128,b):null;case 5:return ye(b),null;case 13:if(x(J),null!==(a=b.memoizedState)&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));de()}return 65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 19:return x(J),null;case 4:return we(),null;case 10:return hd(b.type._context),null;case 22:case 23:return Vf(),null;default:return null}}var yg=!1,zg=!1,Ag="function"==typeof WeakSet?WeakSet:Set,S=null;function Bg(a,b){var c=a.ref;if(null!==c)if("function"==typeof c)try{c(null)}catch(d){T(a,b,d)}else c.current=null}function Cg(a,b,c){try{c()}catch(d){T(a,b,d)}}var Dg=!1;function Fg(a,b,c){var d=b.updateQueue;if(null!==(d=null!==d?d.lastEffect:null)){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0,void 0!==f&&Cg(b,c,f)}e=e.next}while(e!==d)}}function Gg(a,b){if(null!==(b=null!==(b=b.updateQueue)?b.lastEffect:null)){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Hg(a){var b=a.ref;if(null!==b){var c=a.stateNode;if(5===a.tag)a=Fa(c);else a=c;"function"==typeof b?b(a):b.current=a}}function Ig(a,b,c){if(Oc&&"function"==typeof Oc.onCommitFiberUnmount)try{Oc.onCommitFiberUnmount(Nc,b)}catch(g){}switch(b.tag){case 0:case 11:case 14:case 15:if(null!==(a=b.updateQueue)&&null!==(a=a.lastEffect)){var d=a=a.next;do{var e=d,f=e.destroy;e=e.tag,void 0!==f&&(0!=(2&e)||0!=(4&e))&&Cg(b,c,f),d=d.next}while(d!==a)}break;case 1:if(Bg(b,c),"function"==typeof(a=b.stateNode).componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(g){T(b,c,g)}break;case 5:Bg(b,c);break;case 4:Ua?Jg(a,b,c):Va&&Va&&(b=b.stateNode.containerInfo,c=zb(b),Cb(b,c))}}function Kg(a,b,c){for(var d=b;;)if(Ig(a,d,c),null===d.child||Ua&&4===d.tag){if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;d=d.return}d.sibling.return=d.return,d=d.sibling}else d.child.return=d,d=d.child}function Lg(a){var b=a.alternate;null!==b&&(a.alternate=null,Lg(b)),a.child=null,a.deletions=null,a.sibling=null,5===a.tag&&(null!==(b=a.stateNode)&&Za(b)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Mg(a){return 5===a.tag||3===a.tag||4===a.tag}function Ng(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Mg(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(2&a.flags)continue a;if(null===a.child||4===a.tag)continue a;a.child.return=a,a=a.child}if(!(2&a.flags))return a.stateNode}}function Og(a){if(Ua){a:{for(var b=a.return;null!==b;){if(Mg(b))break a;b=b.return}throw Error(n(160))}var c=b;switch(c.tag){case 5:b=c.stateNode,32&c.flags&&(sb(b),c.flags&=-33),Pg(a,c=Ng(a),b);break;case 3:case 4:b=c.stateNode.containerInfo,Qg(a,c=Ng(a),b);break;default:throw Error(n(161))}}}function Qg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?pb(c,a,b):kb(c,a);else if(4!==d&&null!==(a=a.child))for(Qg(a,b,c),a=a.sibling;null!==a;)Qg(a,b,c),a=a.sibling}function Pg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?ob(c,a,b):jb(c,a);else if(4!==d&&null!==(a=a.child))for(Pg(a,b,c),a=a.sibling;null!==a;)Pg(a,b,c),a=a.sibling}function Jg(a,b,c){for(var f,g,d=b,e=!1;;){if(!e){e=d.return;a:for(;;){if(null===e)throw Error(n(160));switch(f=e.stateNode,e.tag){case 5:g=!1;break a;case 3:case 4:f=f.containerInfo,g=!0;break a}e=e.return}e=!0}if(5===d.tag||6===d.tag)Kg(a,d,c),g?rb(f,d.stateNode):qb(f,d.stateNode);else if(18===d.tag)g?Wb(f,d.stateNode):Vb(f,d.stateNode);else if(4===d.tag){if(null!==d.child){f=d.stateNode.containerInfo,g=!0,d.child.return=d,d=d.child;continue}}else if(Ig(a,d,c),null!==d.child){d.child.return=d,d=d.child;continue}if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;4===(d=d.return).tag&&(e=!1)}d.sibling.return=d.return,d=d.sibling}}function Rg(a,b){if(Ua){switch(b.tag){case 0:case 11:case 14:case 15:return Fg(3,b,b.return),Gg(3,b),void Fg(5,b,b.return);case 1:case 12:case 17:return;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null,null!==f&&nb(c,f,e,a,d,b)}return;case 6:if(null===b.stateNode)throw Error(n(162));return c=b.memoizedProps,void lb(b.stateNode,null!==a?a.memoizedProps:c,c);case 3:return void(p&&null!==a&&a.memoizedState.isDehydrated&&Tb(b.stateNode.containerInfo));case 13:case 19:return void Sg(b)}throw Error(n(163))}switch(b.tag){case 0:case 11:case 14:case 15:return Fg(3,b,b.return),Gg(3,b),void Fg(5,b,b.return);case 12:case 22:case 23:return;case 13:case 19:return void Sg(b);case 3:p&&null!==a&&a.memoizedState.isDehydrated&&Tb(b.stateNode.containerInfo)}a:if(Va){switch(b.tag){case 1:case 5:case 6:break a;case 3:case 4:b=b.stateNode,Cb(b.containerInfo,b.pendingChildren);break a}throw Error(n(163))}}function Sg(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Ag),b.forEach((function(b){var d=Tg.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))}))}}function Xg(a,b,c){S=a,Yg(a,b,c)}function Yg(a,b,c){for(var d=0!=(1&a.mode);null!==S;){var e=S,f=e.child;if(22===e.tag&&d){var g=null!==e.memoizedState||yg;if(!g){var h=e.alternate,k=null!==h&&null!==h.memoizedState||zg;h=yg;var l=zg;if(yg=g,(zg=k)&&!l)for(S=e;null!==S;)k=(g=S).child,22===g.tag&&null!==g.memoizedState?Zg(e):null!==k?(k.return=g,S=k):Zg(e);for(;null!==f;)S=f,Yg(f,b,c),f=f.sibling;S=e,yg=h,zg=l}$g(a)}else 0!=(8772&e.subtreeFlags)&&null!==f?(f.return=e,S=f):$g(a)}}function $g(a){for(;null!==S;){var b=S;if(0!=(8772&b.flags)){var c=b.alternate;try{if(0!=(8772&b.flags))switch(b.tag){case 0:case 11:case 15:zg||Gg(5,b);break;case 1:var d=b.stateNode;if(4&b.flags&&!zg)if(null===c)d.componentDidMount();else{var e=b.elementType===b.type?c.memoizedProps:ad(b.type,c.memoizedProps);d.componentDidUpdate(e,c.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var f=b.updateQueue;null!==f&&wd(b,f,d);break;case 3:var g=b.updateQueue;if(null!==g){if(c=null,null!==b.child)switch(b.child.tag){case 5:c=Fa(b.child.stateNode);break;case 1:c=b.child.stateNode}wd(b,g,c)}break;case 5:var h=b.stateNode;null===c&&4&b.flags&&mb(h,b.type,b.memoizedProps,b);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(p&&null===b.memoizedState){var k=b.alternate;if(null!==k){var l=k.memoizedState;if(null!==l){var m=l.dehydrated;null!==m&&Ub(m)}}}break;default:throw Error(n(163))}zg||512&b.flags&&Hg(b)}catch(v){T(b,b.return,v)}}if(b===a){S=null;break}if(null!==(c=b.sibling)){c.return=b.return,S=c;break}S=b.return}}function Wg(a){for(;null!==S;){var b=S;if(b===a){S=null;break}var c=b.sibling;if(null!==c){c.return=b.return,S=c;break}S=b.return}}function Zg(a){for(;null!==S;){var b=S;try{switch(b.tag){case 0:case 11:case 15:var c=b.return;try{Gg(4,b)}catch(k){T(b,c,k)}break;case 1:var d=b.stateNode;if("function"==typeof d.componentDidMount){var e=b.return;try{d.componentDidMount()}catch(k){T(b,e,k)}}var f=b.return;try{Hg(b)}catch(k){T(b,f,k)}break;case 5:var g=b.return;try{Hg(b)}catch(k){T(b,g,k)}}}catch(k){T(b,b.return,k)}if(b===a){S=null;break}var h=b.sibling;if(null!==h){h.return=b.return,S=h;break}S=b.return}}var ah=0,bh=1,ch=2,dh=3,eh=4;if("function"==typeof Symbol&&Symbol.for){var fh=Symbol.for;ah=fh("selector.component"),bh=fh("selector.has_pseudo_class"),ch=fh("selector.role"),dh=fh("selector.test_id"),eh=fh("selector.text")}function gh(a){var b=Wa(a);if(null!=b){if("string"!=typeof b.memoizedProps["data-testname"])throw Error(n(364));return b}if(null===(a=cb(a)))throw Error(n(362));return a.stateNode.current}function hh(a,b){switch(b.$$typeof){case ah:if(a.type===b.value)return!0;break;case bh:a:{b=b.value,a=[a,0];for(var c=0;c";case bh:return":has("+(ih(a)||"")+")";case ch:return'[role="'+a.value+'"]';case eh:return'"'+a.value+'"';case dh:return'[data-testname="'+a.value+'"]';default:throw Error(n(365))}}function jh(a,b){var c=[];a=[a,0];for(var d=0;de&&(e=g),d&=~f}if(d=e,10<(d=(120>(d=E()-d)?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*lh(d/1960))-d)){a.timeoutHandle=Qa(Nh.bind(null,a,Y),d);break}Nh(a,Y);break;default:throw Error(n(329))}}}return Z(a,E()),a.callbackNode===c?Eh.bind(null,a):null}function Lh(a,b){var c=rh;return a.current.memoizedState.isDehydrated&&(Ih(a,b).flags|=256),2!==(a=Gh(a,b))&&(b=Y,Y=c,null!==b&&Sf(b)),a}function Sf(a){null===Y?Y=a:Y.push.apply(Y,a)}function Bh(a,b){for(b&=~qh,b&=~ph,a.suspendedLanes|=b,a.pingedLanes&=~b,a=a.expirationTimes;0a?16:a,null===uh)var d=!1;else{if(a=uh,uh=null,vh=0,0!=(6&G))throw Error(n(331));var e=G;for(G|=4,S=a.current;null!==S;){var f=S,g=f.child;if(0!=(16&S.flags)){var h=f.deletions;if(null!==h){for(var k=0;kE()-Vg?Ih(a,0):qh|=c),Z(a,b)}function Vh(a,b){0===b&&(0==(1&a.mode)?b=1:(b=uc,0==(130023424&(uc<<=1))&&(uc=4194304)));var c=H();null!==(a=Ah(a,b))&&(Bc(a,b,c),Z(a,c))}function qg(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane),Vh(a,c)}function Tg(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode,e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(n(314))}null!==d&&d.delete(b),Vh(a,c)}function Dh(a,b){return Fc(a,b)}function Xh(a,b,c,d){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=b,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yd(a,b,c,d){return new Xh(a,b,c,d)}function ag(a){return!(!(a=a.prototype)||!a.isReactComponent)}function je(a,b){var c=a.alternate;return null===c?((c=Yd(a.tag,b,a.key,a.mode)).elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=14680064&a.flags,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,b=a.dependencies,c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c}function le(a,b,c,d,e,f){var g=2;if(d=a,"function"==typeof a)ag(a)&&(g=1);else if("string"==typeof a)g=5;else a:switch(a){case ia:return ne(c.children,e,f,b);case ja:g=8,e|=8;break;case ka:return(a=Yd(12,c,b,2|e)).elementType=ka,a.lanes=f,a;case oa:return(a=Yd(13,c,b,e)).elementType=oa,a.lanes=f,a;case pa:return(a=Yd(19,c,b,e)).elementType=pa,a.lanes=f,a;case sa:return ng(c,e,f,b);default:if("object"==typeof a&&null!==a)switch(a.$$typeof){case la:g=10;break a;case ma:g=9;break a;case na:g=11;break a;case qa:g=14;break a;case ra:g=16,d=null;break a}throw Error(n(130,null==a?a:typeof a,""))}return(b=Yd(g,c,b,e)).elementType=a,b.type=d,b.lanes=f,b}function ne(a,b,c,d){return(a=Yd(7,a,d,b)).lanes=c,a}function ng(a,b,c,d){return(a=Yd(22,a,d,b)).elementType=sa,a.lanes=c,a.stateNode={},a}function ke(a,b,c){return(a=Yd(6,a,null,b)).lanes=c,a}function me(a,b,c){return(b=Yd(4,null!==a.children?a.children:[],a.key,b)).lanes=c,b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},b}function Yh(a,b,c,d,e){this.tag=b,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Sa,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=d,this.onRecoverableError=e,p&&(this.mutableSourceEagerHydrationData=null)}function Zh(a,b,c,d,e,f,g,h,k){return a=new Yh(a,b,c,h,k),1===b?(b=1,!0===f&&(b|=8)):b=0,f=Yd(3,null,null,b),a.current=f,f.stateNode=a,f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null},od(f),a}function $h(a){if(!a)return hc;a:{if(ya(a=a._reactInternals)!==a||1!==a.tag)throw Error(n(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(C(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(n(171))}if(1===a.tag){var c=a.type;if(C(c))return mc(a,c,b)}return b}function ai(a){var b=a._reactInternals;if(void 0===b){if("function"==typeof a.render)throw Error(n(188));throw a=Object.keys(a).join(","),Error(n(268,a))}return null===(a=Ba(b))?null:a.stateNode}function bi(a,b){if(null!==(a=a.memoizedState)&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c=l&&f>=v&&e<=m&&g<=r){a.splice(b,1);break}if(!(d!==l||c.width!==k.width||rg)){v>f&&(k.height+=v-f,k.y=f),re)){l>d&&(k.width+=l-d,k.x=d),mc&&(c=g)),g ")+"\n\nNo matching component was found for:\n "+a.join(" > ")}return null},exports.getPublicRootInstance=function(a){return(a=a.current).child?5===a.child.tag?Fa(a.child.stateNode):a.child.stateNode:null},exports.injectIntoDevTools=function(a){if(a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ea.ReactCurrentDispatcher,findHostInstanceByFiber:di,findFiberByHostInstance:a.findFiberByHostInstance||ei,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)a=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)a=!0;else{try{Nc=b.inject(a),Oc=b}catch(c){}a=!!b.checkDCE}}return a},exports.isAlreadyRendering=function(){return!1},exports.observeVisibleRects=function(a,b,c,d){if(!bb)throw Error(n(363));a=kh(a,b);var e=ib(a,c,d).disconnect;return{disconnect:function(){e()}}},exports.registerMutableSourceForHydration=function(a,b){var c=b._getVersion;c=c(b._source),null==a.mutableSourceEagerHydrationData?a.mutableSourceEagerHydrationData=[b,c]:a.mutableSourceEagerHydrationData.push(b,c)},exports.runWithPriority=function(a,b){var c=D;try{return D=a,b()}finally{D=c}},exports.shouldError=function(){return null},exports.shouldSuspend=function(){return!1},exports.updateContainer=function(a,b,c,d){var e=b.current,f=H(),g=zd(e);return c=$h(c),null===b.context?b.context=c:b.pendingContext=c,(b=qd(f,g)).payload={element:a},null!==(d=void 0===d?null:d)&&(b.callback=d),rd(e,b),null!==(a=Ad(e,g,f))&&sd(a,e,g),g},exports}},"./node_modules/react-reconciler/constants.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/react-reconciler/cjs/react-reconciler-constants.production.min.js")},"./node_modules/react-reconciler/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/react-reconciler/cjs/react-reconciler.production.min.js")},"./node_modules/react/cjs/react-jsx-runtime.production.min.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var f=__webpack_require__("./node_modules/react/index.js"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;for(b in void 0!==g&&(e=""+g),void 0!==a.key&&(e=""+a.key),void 0!==a.ref&&(h=a.ref),a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l,exports.jsx=q,exports.jsxs=q},"./node_modules/react/jsx-runtime.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/react/cjs/react-jsx-runtime.production.min.js")},"./node_modules/scheduler/cjs/scheduler.production.min.js":function(__unused_webpack_module,exports){"use strict";function f(a,b){var c=a.length;a.push(b);a:for(;0>>1,e=a[d];if(!(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else{if(!(ng(x,c)))break a;a[d]=x,a[n]=c,d=n}}}return b}function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"==typeof performance&&"function"==typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"==typeof setTimeout?setTimeout:null,E="function"==typeof clearTimeout?clearTimeout:null,F="undefined"!=typeof setImmediate?setImmediate:null;function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else{if(!(b.startTime<=a))break;k(t),b.sortIndex=b.expirationTime,f(r,b)}b=h(t)}}function H(a){if(B=!1,G(a),!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}function J(a,b){A=!1,B&&(B=!1,E(L),L=-1),z=!0;var c=y;try{for(G(b),v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"==typeof d){v.callback=null,y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now(),"function"==typeof e?v.callback=e:v===h(r)&&k(r),G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b),w=!1}return w}finally{v=null,y=c,z=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,N=!1,O=null,L=-1,P=5,Q=-1;function M(){return!(exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J))),a},exports.unstable_shouldYield=M,exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}},"./node_modules/scheduler/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/scheduler/cjs/scheduler.production.min.js")},"./node_modules/suspend-react/index.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{MA:function(){return preload},Rq:function(){return suspend},ZH:function(){return clear}});const globalCache=[];function shallowEqualArrays(arrA,arrB,equal=((a,b)=>a===b)){if(arrA===arrB)return!0;if(!arrA||!arrB)return!1;const len=arrA.length;if(arrB.length!==len)return!1;for(let i=0;i0&&(entry.timeout&&clearTimeout(entry.timeout),entry.timeout=setTimeout(entry.remove,config.lifespan)),entry.response;if(!preload)throw entry.promise}const entry={keys:keys,equal:config.equal,remove:()=>{const index=globalCache.indexOf(entry);-1!==index&&globalCache.splice(index,1)},promise:(promise=fn,"object"==typeof promise&&"function"==typeof promise.then?fn:fn(...keys)).then((response=>{entry.response=response,config.lifespan&&config.lifespan>0&&(entry.timeout=setTimeout(entry.remove,config.lifespan))})).catch((error=>entry.error=error))};var promise;if(globalCache.push(entry),!preload)throw entry.promise}const suspend=(fn,keys,config)=>query(fn,keys,!1,config),preload=(fn,keys,config)=>{query(fn,keys,!0,config)},clear=keys=>{if(void 0===keys||0===keys.length)globalCache.splice(0,globalCache.length);else{const entry=globalCache.find((entry=>shallowEqualArrays(keys,entry.keys,entry.equal)));entry&&entry.remove()}}},"./node_modules/three-stdlib/_polyfill/LoaderUtils.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function decodeText(array){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(array);let s="";for(let i=0,il=array.length;i{const taskConfig={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(buffer,taskConfig).then(onLoad).catch(onError)}),onProgress,onError)}decodeDracoFile(buffer,callback,attributeIDs,attributeTypes){const taskConfig={attributeIDs:attributeIDs||this.defaultAttributeIDs,attributeTypes:attributeTypes||this.defaultAttributeTypes,useUniqueIDs:!!attributeIDs};this.decodeGeometry(buffer,taskConfig).then(callback)}decodeGeometry(buffer,taskConfig){for(const attribute in taskConfig.attributeTypes){const type=taskConfig.attributeTypes[attribute];void 0!==type.BYTES_PER_ELEMENT&&(taskConfig.attributeTypes[attribute]=type.name)}const taskKey=JSON.stringify(taskConfig);if(_taskCache.has(buffer)){const cachedTask=_taskCache.get(buffer);if(cachedTask.key===taskKey)return cachedTask.promise;if(0===buffer.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let worker;const taskID=this.workerNextTaskID++,taskCost=buffer.byteLength,geometryPending=this._getWorker(taskID,taskCost).then((_worker=>(worker=_worker,new Promise(((resolve,reject)=>{worker._callbacks[taskID]={resolve:resolve,reject:reject},worker.postMessage({type:"decode",id:taskID,taskConfig:taskConfig,buffer:buffer},[buffer])}))))).then((message=>this._createGeometry(message.geometry)));return geometryPending.catch((()=>!0)).then((()=>{worker&&taskID&&this._releaseTask(worker,taskID)})),_taskCache.set(buffer,{key:taskKey,promise:geometryPending}),geometryPending}_createGeometry(geometryData){const geometry=new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry;geometryData.index&&geometry.setIndex(new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(geometryData.index.array,1));for(let i=0;i{loader.load(url,resolve,void 0,reject)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const useJS="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,librariesPending=[];return useJS?librariesPending.push(this._loadLibrary("draco_decoder.js","text")):(librariesPending.push(this._loadLibrary("draco_wasm_wrapper.js","text")),librariesPending.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(librariesPending).then((libraries=>{const jsContent=libraries[0];useJS||(this.decoderConfig.wasmBinary=libraries[1]);const fn=DRACOWorker.toString(),body=["/* draco decoder */",jsContent,"","/* worker */",fn.substring(fn.indexOf("{")+1,fn.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([body]))})),this.decoderPending}_getWorker(taskID,taskCost){return this._initDecoder().then((()=>{if(this.workerPool.lengthb._taskLoad?-1:1}));const worker=this.workerPool[this.workerPool.length-1];return worker._taskCosts[taskID]=taskCost,worker._taskLoad+=taskCost,worker}))}_releaseTask(worker,taskID){worker._taskLoad-=worker._taskCosts[taskID],delete worker._callbacks[taskID],delete worker._taskCosts[taskID]}debug(){console.log("Task load: ",this.workerPool.map((worker=>worker._taskLoad)))}dispose(){for(let i=0;i{const draco=module.draco,decoder=new draco.Decoder,decoderBuffer=new draco.DecoderBuffer;decoderBuffer.Init(new Int8Array(buffer),buffer.byteLength);try{const geometry=function decodeGeometry(draco,decoder,decoderBuffer,taskConfig){const attributeIDs=taskConfig.attributeIDs,attributeTypes=taskConfig.attributeTypes;let dracoGeometry,decodingStatus;const geometryType=decoder.GetEncodedGeometryType(decoderBuffer);if(geometryType===draco.TRIANGULAR_MESH)dracoGeometry=new draco.Mesh,decodingStatus=decoder.DecodeBufferToMesh(decoderBuffer,dracoGeometry);else{if(geometryType!==draco.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");dracoGeometry=new draco.PointCloud,decodingStatus=decoder.DecodeBufferToPointCloud(decoderBuffer,dracoGeometry)}if(!decodingStatus.ok()||0===dracoGeometry.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+decodingStatus.error_msg());const geometry={index:null,attributes:[]};for(const attributeName in attributeIDs){const attributeType=self[attributeTypes[attributeName]];let attribute,attributeID;if(taskConfig.useUniqueIDs)attributeID=attributeIDs[attributeName],attribute=decoder.GetAttributeByUniqueId(dracoGeometry,attributeID);else{if(attributeID=decoder.GetAttributeId(dracoGeometry,draco[attributeIDs[attributeName]]),-1===attributeID)continue;attribute=decoder.GetAttribute(dracoGeometry,attributeID)}geometry.attributes.push(decodeAttribute(draco,decoder,dracoGeometry,attributeName,attributeType,attribute))}geometryType===draco.TRIANGULAR_MESH&&(geometry.index=function decodeIndex(draco,decoder,dracoGeometry){const numFaces=dracoGeometry.num_faces(),numIndices=3*numFaces,byteLength=4*numIndices,ptr=draco._malloc(byteLength);decoder.GetTrianglesUInt32Array(dracoGeometry,byteLength,ptr);const index=new Uint32Array(draco.HEAPF32.buffer,ptr,numIndices).slice();return draco._free(ptr),{array:index,itemSize:1}}(draco,decoder,dracoGeometry));return draco.destroy(dracoGeometry),geometry}(draco,decoder,decoderBuffer,taskConfig),buffers=geometry.attributes.map((attr=>attr.array.buffer));geometry.index&&buffers.push(geometry.index.array.buffer),self.postMessage({type:"decode",id:message.id,geometry:geometry},buffers)}catch(error){console.error(error),self.postMessage({type:"error",id:message.id,error:error.message})}finally{draco.destroy(decoderBuffer),draco.destroy(decoder)}}))}}}},"./node_modules/three-stdlib/loaders/FBXLoader.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{y:function(){return FBXLoader}});var three_module=__webpack_require__("./node_modules/three/build/three.module.js"),browser=__webpack_require__("./node_modules/fflate/esm/browser.js");function findSpan(p,u,U){const n=U.length-p-1;if(u>=U[n])return n-1;if(u<=U[p])return p;let low=p,high=n,mid=Math.floor((low+high)/2);for(;u=U[mid+1];)u=k&&(a[s2][0]=a[s1][0]/ndu[pk+1][rk],d=a[s2][0]*ndu[rk][pk]);const j2=r2-1<=pk?k-1:p-r2;for(let j3=rk>=-1?1:-rk;j3<=j2;++j3)a[s2][j3]=(a[s1][j3]-a[s1][j3-1])/ndu[pk+1][rk+j3],d+=a[s2][j3]*ndu[rk+j3][pk];r2<=pk&&(a[s2][k]=-a[s1][k-1]/ndu[pk+1][r2],d+=a[s2][k]*ndu[r2][pk]),ders[k][r2]=d;const j=s1;s1=s2,s2=j}}let r=p;for(let k=1;k<=n;++k){for(let j=0;j<=p;++j)ders[k][j]*=r;r*=p-k}return ders}(span,u,p,du,U),Pw=[];for(let i=0;i=CORRECT.length&&CORRECT===convertArrayBufferToString(buffer,0,CORRECT.length)}(FBXBuffer))fbxTree=(new BinaryParser).parse(FBXBuffer);else{const FBXText=convertArrayBufferToString(FBXBuffer);if(!function isFbxFormatASCII(text){const CORRECT=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let cursor=0;function read(offset){const result=text[offset-1];return text=text.slice(cursor+offset),cursor++,result}for(let i=0;i0,base64Content="string"==typeof videoNode.Content&&""!==videoNode.Content;if(arrayBufferContent||base64Content){const image=this.parseImage(videoNodes[nodeID]);blobs[videoNode.RelativeFilename||videoNode.Filename]=image}}}}for(const id in images){const filename=images[id];void 0!==blobs[filename]?images[id]=blobs[filename]:images[id]=images[id].split("\\").pop()}return images}parseImage(videoNode){const content=videoNode.Content,fileName=videoNode.RelativeFilename||videoNode.Filename,extension=fileName.slice(fileName.lastIndexOf(".")+1).toLowerCase();let type;switch(extension){case"bmp":type="image/bmp";break;case"jpg":case"jpeg":type="image/jpeg";break;case"png":type="image/png";break;case"tif":type="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",fileName),type="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+extension+'" is not supported.')}if("string"==typeof content)return"data:"+type+";base64,"+content;{const array=new Uint8Array(content);return window.URL.createObjectURL(new Blob([array],{type:type}))}}parseTextures(images){const textureMap=new Map;if("Texture"in fbxTree.Objects){const textureNodes=fbxTree.Objects.Texture;for(const nodeID in textureNodes){const texture=this.parseTexture(textureNodes[nodeID],images);textureMap.set(parseInt(nodeID),texture)}}return textureMap}parseTexture(textureNode,images){const texture=this.loadTexture(textureNode,images);texture.ID=textureNode.id,texture.name=textureNode.attrName;const wrapModeU=textureNode.WrapModeU,wrapModeV=textureNode.WrapModeV,valueU=void 0!==wrapModeU?wrapModeU.value:0,valueV=void 0!==wrapModeV?wrapModeV.value:0;if(texture.wrapS=0===valueU?three_module.RepeatWrapping:three_module.ClampToEdgeWrapping,texture.wrapT=0===valueV?three_module.RepeatWrapping:three_module.ClampToEdgeWrapping,"Scaling"in textureNode){const values=textureNode.Scaling.value;texture.repeat.x=values[0],texture.repeat.y=values[1]}return texture}loadTexture(textureNode,images){let fileName;const currentPath=this.textureLoader.path,children=connections.get(textureNode.id).children;let texture;void 0!==children&&children.length>0&&void 0!==images[children[0].ID]&&(fileName=images[children[0].ID],0!==fileName.indexOf("blob:")&&0!==fileName.indexOf("data:")||this.textureLoader.setPath(void 0));const extension=textureNode.FileName.slice(-3).toLowerCase();if("tga"===extension){const loader=this.manager.getHandler(".tga");null===loader?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",textureNode.RelativeFilename),texture=new three_module.Texture):(loader.setPath(this.textureLoader.path),texture=loader.load(fileName))}else"psd"===extension?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",textureNode.RelativeFilename),texture=new three_module.Texture):texture=this.textureLoader.load(fileName);return this.textureLoader.setPath(currentPath),texture}parseMaterials(textureMap){const materialMap=new Map;if("Material"in fbxTree.Objects){const materialNodes=fbxTree.Objects.Material;for(const nodeID in materialNodes){const material=this.parseMaterial(materialNodes[nodeID],textureMap);null!==material&&materialMap.set(parseInt(nodeID),material)}}return materialMap}parseMaterial(materialNode,textureMap){const ID=materialNode.id,name=materialNode.attrName;let type=materialNode.ShadingModel;if("object"==typeof type&&(type=type.value),!connections.has(ID))return null;const parameters=this.parseParameters(materialNode,textureMap,ID);let material;switch(type.toLowerCase()){case"phong":material=new three_module.MeshPhongMaterial;break;case"lambert":material=new three_module.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',type),material=new three_module.MeshPhongMaterial}return material.setValues(parameters),material.name=name,material}parseParameters(materialNode,textureMap,ID){const parameters={};materialNode.BumpFactor&&(parameters.bumpScale=materialNode.BumpFactor.value),materialNode.Diffuse?parameters.color=(new three_module.Color).fromArray(materialNode.Diffuse.value):!materialNode.DiffuseColor||"Color"!==materialNode.DiffuseColor.type&&"ColorRGB"!==materialNode.DiffuseColor.type||(parameters.color=(new three_module.Color).fromArray(materialNode.DiffuseColor.value)),materialNode.DisplacementFactor&&(parameters.displacementScale=materialNode.DisplacementFactor.value),materialNode.Emissive?parameters.emissive=(new three_module.Color).fromArray(materialNode.Emissive.value):!materialNode.EmissiveColor||"Color"!==materialNode.EmissiveColor.type&&"ColorRGB"!==materialNode.EmissiveColor.type||(parameters.emissive=(new three_module.Color).fromArray(materialNode.EmissiveColor.value)),materialNode.EmissiveFactor&&(parameters.emissiveIntensity=parseFloat(materialNode.EmissiveFactor.value)),materialNode.Opacity&&(parameters.opacity=parseFloat(materialNode.Opacity.value)),parameters.opacity<1&&(parameters.transparent=!0),materialNode.ReflectionFactor&&(parameters.reflectivity=materialNode.ReflectionFactor.value),materialNode.Shininess&&(parameters.shininess=materialNode.Shininess.value),materialNode.Specular?parameters.specular=(new three_module.Color).fromArray(materialNode.Specular.value):materialNode.SpecularColor&&"Color"===materialNode.SpecularColor.type&&(parameters.specular=(new three_module.Color).fromArray(materialNode.SpecularColor.value));const scope=this;return connections.get(ID).children.forEach((function(child){const type=child.relationship;switch(type){case"Bump":parameters.bumpMap=scope.getTexture(textureMap,child.ID);break;case"Maya|TEX_ao_map":parameters.aoMap=scope.getTexture(textureMap,child.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":parameters.map=scope.getTexture(textureMap,child.ID),void 0!==parameters.map&&("colorSpace"in parameters.map?parameters.map.colorSpace="srgb":parameters.map.encoding=3001);break;case"DisplacementColor":parameters.displacementMap=scope.getTexture(textureMap,child.ID);break;case"EmissiveColor":parameters.emissiveMap=scope.getTexture(textureMap,child.ID),void 0!==parameters.emissiveMap&&("colorSpace"in parameters.emissiveMap?parameters.emissiveMap.colorSpace="srgb":parameters.emissiveMap.encoding=3001);break;case"NormalMap":case"Maya|TEX_normal_map":parameters.normalMap=scope.getTexture(textureMap,child.ID);break;case"ReflectionColor":parameters.envMap=scope.getTexture(textureMap,child.ID),void 0!==parameters.envMap&&(parameters.envMap.mapping=three_module.EquirectangularReflectionMapping,"colorSpace"in parameters.envMap?parameters.envMap.colorSpace="srgb":parameters.envMap.encoding=3001);break;case"SpecularColor":parameters.specularMap=scope.getTexture(textureMap,child.ID),void 0!==parameters.specularMap&&("colorSpace"in parameters.specularMap?parameters.specularMap.colorSpace="srgb":parameters.specularMap.encoding=3001);break;case"TransparentColor":case"TransparencyFactor":parameters.alphaMap=scope.getTexture(textureMap,child.ID),parameters.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",type)}})),parameters}getTexture(textureMap,id){return"LayeredTexture"in fbxTree.Objects&&id in fbxTree.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),id=connections.get(id).children[0].ID),textureMap.get(id)}parseDeformers(){const skeletons={},morphTargets={};if("Deformer"in fbxTree.Objects){const DeformerNodes=fbxTree.Objects.Deformer;for(const nodeID in DeformerNodes){const deformerNode=DeformerNodes[nodeID],relationships=connections.get(parseInt(nodeID));if("Skin"===deformerNode.attrType){const skeleton=this.parseSkeleton(relationships,DeformerNodes);skeleton.ID=nodeID,relationships.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),skeleton.geometryID=relationships.parents[0].ID,skeletons[nodeID]=skeleton}else if("BlendShape"===deformerNode.attrType){const morphTarget={id:nodeID};morphTarget.rawTargets=this.parseMorphTargets(relationships,DeformerNodes),morphTarget.id=nodeID,relationships.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),morphTargets[nodeID]=morphTarget}}}return{skeletons:skeletons,morphTargets:morphTargets}}parseSkeleton(relationships,deformerNodes){const rawBones=[];return relationships.children.forEach((function(child){const boneNode=deformerNodes[child.ID];if("Cluster"!==boneNode.attrType)return;const rawBone={ID:child.ID,indices:[],weights:[],transformLink:(new three_module.Matrix4).fromArray(boneNode.TransformLink.a)};"Indexes"in boneNode&&(rawBone.indices=boneNode.Indexes.a,rawBone.weights=boneNode.Weights.a),rawBones.push(rawBone)})),{rawBones:rawBones,bones:[]}}parseMorphTargets(relationships,deformerNodes){const rawMorphTargets=[];for(let i=0;i1?material=materials:materials.length>0?material=materials[0]:(material=new three_module.MeshPhongMaterial({color:13421772}),materials.push(material)),"color"in geometry.attributes&&materials.forEach((function(material2){material2.vertexColors=!0})),geometry.FBX_Deformer?(model=new three_module.SkinnedMesh(geometry,material),model.normalizeSkinWeights()):model=new three_module.Mesh(geometry,material),model}createCurve(relationships,geometryMap){const geometry=relationships.children.reduce((function(geo,child){return geometryMap.has(child.ID)&&(geo=geometryMap.get(child.ID)),geo}),null),material=new three_module.LineBasicMaterial({color:3342591,linewidth:1});return new three_module.Line(geometry,material)}getTransformData(model,modelNode){const transformData={};"InheritType"in modelNode&&(transformData.inheritType=parseInt(modelNode.InheritType.value)),transformData.eulerOrder="RotationOrder"in modelNode?getEulerOrder(modelNode.RotationOrder.value):"ZYX","Lcl_Translation"in modelNode&&(transformData.translation=modelNode.Lcl_Translation.value),"PreRotation"in modelNode&&(transformData.preRotation=modelNode.PreRotation.value),"Lcl_Rotation"in modelNode&&(transformData.rotation=modelNode.Lcl_Rotation.value),"PostRotation"in modelNode&&(transformData.postRotation=modelNode.PostRotation.value),"Lcl_Scaling"in modelNode&&(transformData.scale=modelNode.Lcl_Scaling.value),"ScalingOffset"in modelNode&&(transformData.scalingOffset=modelNode.ScalingOffset.value),"ScalingPivot"in modelNode&&(transformData.scalingPivot=modelNode.ScalingPivot.value),"RotationOffset"in modelNode&&(transformData.rotationOffset=modelNode.RotationOffset.value),"RotationPivot"in modelNode&&(transformData.rotationPivot=modelNode.RotationPivot.value),model.userData.transformData=transformData}setLookAtProperties(model,modelNode){if("LookAtProperty"in modelNode){connections.get(model.ID).children.forEach((function(child){if("LookAtProperty"===child.relationship){const lookAtTarget=fbxTree.Objects.Model[child.ID];if("Lcl_Translation"in lookAtTarget){const pos=lookAtTarget.Lcl_Translation.value;void 0!==model.target?(model.target.position.fromArray(pos),sceneGraph.add(model.target)):model.lookAt((new three_module.Vector3).fromArray(pos))}}}))}}bindSkeleton(skeletons,geometryMap,modelMap){const bindMatrices=this.parsePoseNodes();for(const ID in skeletons){const skeleton=skeletons[ID];connections.get(parseInt(skeleton.ID)).parents.forEach((function(parent){if(geometryMap.has(parent.ID)){const geoID=parent.ID;connections.get(geoID).parents.forEach((function(geoConnParent){if(modelMap.has(geoConnParent.ID)){modelMap.get(geoConnParent.ID).bind(new three_module.Skeleton(skeleton.bones),bindMatrices[geoConnParent.ID])}}))}}))}}parsePoseNodes(){const bindMatrices={};if("Pose"in fbxTree.Objects){const BindPoseNode=fbxTree.Objects.Pose;for(const nodeID in BindPoseNode)if("BindPose"===BindPoseNode[nodeID].attrType&&BindPoseNode[nodeID].NbPoseNodes>0){const poseNodes=BindPoseNode[nodeID].PoseNode;Array.isArray(poseNodes)?poseNodes.forEach((function(poseNode){bindMatrices[poseNode.Node]=(new three_module.Matrix4).fromArray(poseNode.Matrix.a)})):bindMatrices[poseNodes.Node]=(new three_module.Matrix4).fromArray(poseNodes.Matrix.a)}}return bindMatrices}createAmbientLight(){if("GlobalSettings"in fbxTree&&"AmbientColor"in fbxTree.GlobalSettings){const ambientColor=fbxTree.GlobalSettings.AmbientColor.value,r=ambientColor[0],g=ambientColor[1],b=ambientColor[2];if(0!==r||0!==g||0!==b){const color=new three_module.Color(r,g,b);sceneGraph.add(new three_module.AmbientLight(color,1))}}}}class GeometryParser{parse(deformers){const geometryMap=new Map;if("Geometry"in fbxTree.Objects){const geoNodes=fbxTree.Objects.Geometry;for(const nodeID in geoNodes){const relationships=connections.get(parseInt(nodeID)),geo=this.parseGeometry(relationships,geoNodes[nodeID],deformers);geometryMap.set(parseInt(nodeID),geo)}}return geometryMap}parseGeometry(relationships,geoNode,deformers){switch(geoNode.attrType){case"Mesh":return this.parseMeshGeometry(relationships,geoNode,deformers);case"NurbsCurve":return this.parseNurbsGeometry(geoNode)}}parseMeshGeometry(relationships,geoNode,deformers){const skeletons=deformers.skeletons,morphTargets=[],modelNodes=relationships.parents.map((function(parent){return fbxTree.Objects.Model[parent.ID]}));if(0===modelNodes.length)return;const skeleton=relationships.children.reduce((function(skeleton2,child){return void 0!==skeletons[child.ID]&&(skeleton2=skeletons[child.ID]),skeleton2}),null);relationships.children.forEach((function(child){void 0!==deformers.morphTargets[child.ID]&&morphTargets.push(deformers.morphTargets[child.ID])}));const modelNode=modelNodes[0],transformData={};"RotationOrder"in modelNode&&(transformData.eulerOrder=getEulerOrder(modelNode.RotationOrder.value)),"InheritType"in modelNode&&(transformData.inheritType=parseInt(modelNode.InheritType.value)),"GeometricTranslation"in modelNode&&(transformData.translation=modelNode.GeometricTranslation.value),"GeometricRotation"in modelNode&&(transformData.rotation=modelNode.GeometricRotation.value),"GeometricScaling"in modelNode&&(transformData.scale=modelNode.GeometricScaling.value);const transform=generateTransform(transformData);return this.genGeometry(geoNode,skeleton,morphTargets,transform)}genGeometry(geoNode,skeleton,morphTargets,preTransform){const geo=new three_module.BufferGeometry;geoNode.attrName&&(geo.name=geoNode.attrName);const geoInfo=this.parseGeoNode(geoNode,skeleton),buffers=this.genBuffers(geoInfo),positionAttribute=new three_module.Float32BufferAttribute(buffers.vertex,3);if(positionAttribute.applyMatrix4(preTransform),geo.setAttribute("position",positionAttribute),buffers.colors.length>0&&geo.setAttribute("color",new three_module.Float32BufferAttribute(buffers.colors,3)),skeleton&&(geo.setAttribute("skinIndex",new three_module.Uint16BufferAttribute(buffers.weightsIndices,4)),geo.setAttribute("skinWeight",new three_module.Float32BufferAttribute(buffers.vertexWeights,4)),geo.FBX_Deformer=skeleton),buffers.normal.length>0){const normalMatrix=(new three_module.Matrix3).getNormalMatrix(preTransform),normalAttribute=new three_module.Float32BufferAttribute(buffers.normal,3);normalAttribute.applyNormalMatrix(normalMatrix),geo.setAttribute("normal",normalAttribute)}if(buffers.uvs.forEach((function(uvBuffer,i){let name="uv"+(i+1).toString();0===i&&(name="uv"),geo.setAttribute(name,new three_module.Float32BufferAttribute(buffers.uvs[i],2))})),geoInfo.material&&"AllSame"!==geoInfo.material.mappingType){let prevMaterialIndex=buffers.materialIndex[0],startIndex=0;if(buffers.materialIndex.forEach((function(currentIndex,i){currentIndex!==prevMaterialIndex&&(geo.addGroup(startIndex,i-startIndex,prevMaterialIndex),prevMaterialIndex=currentIndex,startIndex=i)})),geo.groups.length>0){const lastGroup=geo.groups[geo.groups.length-1],lastIndex=lastGroup.start+lastGroup.count;lastIndex!==buffers.materialIndex.length&&geo.addGroup(lastIndex,buffers.materialIndex.length-lastIndex,prevMaterialIndex)}0===geo.groups.length&&geo.addGroup(0,buffers.materialIndex.length,buffers.materialIndex[0])}return this.addMorphTargets(geo,geoNode,morphTargets,preTransform),geo}parseGeoNode(geoNode,skeleton){const geoInfo={};if(geoInfo.vertexPositions=void 0!==geoNode.Vertices?geoNode.Vertices.a:[],geoInfo.vertexIndices=void 0!==geoNode.PolygonVertexIndex?geoNode.PolygonVertexIndex.a:[],geoNode.LayerElementColor&&(geoInfo.color=this.parseVertexColors(geoNode.LayerElementColor[0])),geoNode.LayerElementMaterial&&(geoInfo.material=this.parseMaterialIndices(geoNode.LayerElementMaterial[0])),geoNode.LayerElementNormal&&(geoInfo.normal=this.parseNormals(geoNode.LayerElementNormal[0])),geoNode.LayerElementUV){geoInfo.uv=[];let i=0;for(;geoNode.LayerElementUV[i];)geoNode.LayerElementUV[i].UV&&geoInfo.uv.push(this.parseUVs(geoNode.LayerElementUV[i])),i++}return geoInfo.weightTable={},null!==skeleton&&(geoInfo.skeleton=skeleton,skeleton.rawBones.forEach((function(rawBone,i){rawBone.indices.forEach((function(index,j){void 0===geoInfo.weightTable[index]&&(geoInfo.weightTable[index]=[]),geoInfo.weightTable[index].push({id:i,weight:rawBone.weights[j]})}))}))),geoInfo}genBuffers(geoInfo){const buffers={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let polygonIndex=0,faceLength=0,displayedWeightsWarning=!1,facePositionIndexes=[],faceNormals=[],faceColors=[],faceUVs=[],faceWeights=[],faceWeightIndices=[];const scope=this;return geoInfo.vertexIndices.forEach((function(vertexIndex,polygonVertexIndex){let materialIndex,endOfFace=!1;vertexIndex<0&&(vertexIndex^=-1,endOfFace=!0);let weightIndices=[],weights=[];if(facePositionIndexes.push(3*vertexIndex,3*vertexIndex+1,3*vertexIndex+2),geoInfo.color){const data=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.color);faceColors.push(data[0],data[1],data[2])}if(geoInfo.skeleton){if(void 0!==geoInfo.weightTable[vertexIndex]&&geoInfo.weightTable[vertexIndex].forEach((function(wt){weights.push(wt.weight),weightIndices.push(wt.id)})),weights.length>4){displayedWeightsWarning||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),displayedWeightsWarning=!0);const wIndex=[0,0,0,0],Weight=[0,0,0,0];weights.forEach((function(weight,weightIndex){let currentWeight=weight,currentIndex=weightIndices[weightIndex];Weight.forEach((function(comparedWeight,comparedWeightIndex,comparedWeightArray){if(currentWeight>comparedWeight){comparedWeightArray[comparedWeightIndex]=currentWeight,currentWeight=comparedWeight;const tmp=wIndex[comparedWeightIndex];wIndex[comparedWeightIndex]=currentIndex,currentIndex=tmp}}))})),weightIndices=wIndex,weights=Weight}for(;weights.length<4;)weights.push(0),weightIndices.push(0);for(let i=0;i<4;++i)faceWeights.push(weights[i]),faceWeightIndices.push(weightIndices[i])}if(geoInfo.normal){const data=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.normal);faceNormals.push(data[0],data[1],data[2])}geoInfo.material&&"AllSame"!==geoInfo.material.mappingType&&(materialIndex=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.material)[0]),geoInfo.uv&&geoInfo.uv.forEach((function(uv,i){const data=getData(polygonVertexIndex,polygonIndex,vertexIndex,uv);void 0===faceUVs[i]&&(faceUVs[i]=[]),faceUVs[i].push(data[0]),faceUVs[i].push(data[1])})),faceLength++,endOfFace&&(scope.genFace(buffers,geoInfo,facePositionIndexes,materialIndex,faceNormals,faceColors,faceUVs,faceWeights,faceWeightIndices,faceLength),polygonIndex++,faceLength=0,facePositionIndexes=[],faceNormals=[],faceColors=[],faceUVs=[],faceWeights=[],faceWeightIndices=[])})),buffers}genFace(buffers,geoInfo,facePositionIndexes,materialIndex,faceNormals,faceColors,faceUVs,faceWeights,faceWeightIndices,faceLength){for(let i=2;i1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const layer=layersMap.get(children[0].ID);rawClips[nodeID]={name:rawStacks[nodeID].attrName,layer:layer}}return rawClips}addClip(rawClip){let tracks=[];const scope=this;return rawClip.layer.forEach((function(rawTracks){tracks=tracks.concat(scope.generateTracks(rawTracks))})),new three_module.AnimationClip(rawClip.name,-1,tracks)}generateTracks(rawTracks){const tracks=[];let initialPosition=new three_module.Vector3,initialRotation=new three_module.Quaternion,initialScale=new three_module.Vector3;if(rawTracks.transform&&rawTracks.transform.decompose(initialPosition,initialRotation,initialScale),initialPosition=initialPosition.toArray(),initialRotation=(new three_module.Euler).setFromQuaternion(initialRotation,rawTracks.eulerOrder).toArray(),initialScale=initialScale.toArray(),void 0!==rawTracks.T&&Object.keys(rawTracks.T.curves).length>0){const positionTrack=this.generateVectorTrack(rawTracks.modelName,rawTracks.T.curves,initialPosition,"position");void 0!==positionTrack&&tracks.push(positionTrack)}if(void 0!==rawTracks.R&&Object.keys(rawTracks.R.curves).length>0){const rotationTrack=this.generateRotationTrack(rawTracks.modelName,rawTracks.R.curves,initialRotation,rawTracks.preRotation,rawTracks.postRotation,rawTracks.eulerOrder);void 0!==rotationTrack&&tracks.push(rotationTrack)}if(void 0!==rawTracks.S&&Object.keys(rawTracks.S.curves).length>0){const scaleTrack=this.generateVectorTrack(rawTracks.modelName,rawTracks.S.curves,initialScale,"scale");void 0!==scaleTrack&&tracks.push(scaleTrack)}if(void 0!==rawTracks.DeformPercent){const morphTrack=this.generateMorphTrack(rawTracks);void 0!==morphTrack&&tracks.push(morphTrack)}return tracks}generateVectorTrack(modelName,curves,initialValue,type){const times=this.getTimesForAllAxes(curves),values=this.getKeyframeTrackValues(times,curves,initialValue);return new three_module.VectorKeyframeTrack(modelName+"."+type,times,values)}generateRotationTrack(modelName,curves,initialValue,preRotation,postRotation,eulerOrder){void 0!==curves.x&&(this.interpolateRotations(curves.x),curves.x.values=curves.x.values.map(three_module.MathUtils.degToRad)),void 0!==curves.y&&(this.interpolateRotations(curves.y),curves.y.values=curves.y.values.map(three_module.MathUtils.degToRad)),void 0!==curves.z&&(this.interpolateRotations(curves.z),curves.z.values=curves.z.values.map(three_module.MathUtils.degToRad));const times=this.getTimesForAllAxes(curves),values=this.getKeyframeTrackValues(times,curves,initialValue);void 0!==preRotation&&((preRotation=preRotation.map(three_module.MathUtils.degToRad)).push(eulerOrder),preRotation=(new three_module.Euler).fromArray(preRotation),preRotation=(new three_module.Quaternion).setFromEuler(preRotation)),void 0!==postRotation&&((postRotation=postRotation.map(three_module.MathUtils.degToRad)).push(eulerOrder),postRotation=(new three_module.Euler).fromArray(postRotation),postRotation=(new three_module.Quaternion).setFromEuler(postRotation).invert());const quaternion=new three_module.Quaternion,euler=new three_module.Euler,quaternionValues=[];for(let i=0;i1){let targetIndex=1,lastValue=times[0];for(let i=1;i=180){const numSubIntervals=absoluteSpan/180,step=valuesSpan/numSubIntervals;let nextValue=initialValue+step;const initialTime=curve.times[i-1],interval=(curve.times[i]-initialTime)/numSubIntervals;let nextTime=initialTime+interval;const interpolatedTimes=[],interpolatedValues=[];for(;nextTime1&&(name=attrs[1].replace(/^(\w+)::/,""),type=attrs[2]),{id:id,name:name,type:type}}parseNodeProperty(line,property,contentLine){let propName=property[1].replace(/^"/,"").replace(/"$/,"").trim(),propValue=property[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===propName&&","===propValue&&(propValue=contentLine.replace(/"/g,"").replace(/,$/,"").trim());const currentNode=this.getCurrentNode();if("Properties70"!==currentNode.name){if("C"===propName){const connProps=propValue.split(",").slice(1),from=parseInt(connProps[0]),to=parseInt(connProps[1]);let rest=propValue.split(",").slice(3);rest=rest.map((function(elem){return elem.trim().replace(/^"/,"")})),propName="connections",propValue=[from,to],function append(a,b){for(let i=0,j=a.length,l=b.length;i=reader.size():reader.getOffset()+160+16>=reader.size()}parseNode(reader,version){const node={},endOffset=version>=7500?reader.getUint64():reader.getUint32(),numProperties=version>=7500?reader.getUint64():reader.getUint32();version>=7500?reader.getUint64():reader.getUint32();const nameLen=reader.getUint8(),name=reader.getString(nameLen);if(0===endOffset)return null;const propertyList=[];for(let i=0;i0?propertyList[0]:"",attrName=propertyList.length>1?propertyList[1]:"",attrType=propertyList.length>2?propertyList[2]:"";for(node.singleProperty=1===numProperties&&reader.getOffset()===endOffset;endOffset>reader.getOffset();){const subNode=this.parseNode(reader,version);null!==subNode&&this.parseSubNode(name,node,subNode)}return node.propertyList=propertyList,"number"==typeof id&&(node.id=id),""!==attrName&&(node.attrName=attrName),""!==attrType&&(node.attrType=attrType),""!==name&&(node.name=name),node}parseSubNode(name,node,subNode){if(!0===subNode.singleProperty){const value=subNode.propertyList[0];Array.isArray(value)?(node[subNode.name]=subNode,subNode.a=value):node[subNode.name]=value}else if("Connections"===name&&"C"===subNode.name){const array=[];subNode.propertyList.forEach((function(property,i){0!==i&&array.push(property)})),void 0===node.connections&&(node.connections=[]),node.connections.push(array)}else if("Properties70"===subNode.name){Object.keys(subNode).forEach((function(key){node[key]=subNode[key]}))}else if("Properties70"===name&&"P"===subNode.name){let innerPropName=subNode.propertyList[0],innerPropType1=subNode.propertyList[1];const innerPropType2=subNode.propertyList[2],innerPropFlag=subNode.propertyList[3];let innerPropValue;0===innerPropName.indexOf("Lcl ")&&(innerPropName=innerPropName.replace("Lcl ","Lcl_")),0===innerPropType1.indexOf("Lcl ")&&(innerPropType1=innerPropType1.replace("Lcl ","Lcl_")),innerPropValue="Color"===innerPropType1||"ColorRGB"===innerPropType1||"Vector"===innerPropType1||"Vector3D"===innerPropType1||0===innerPropType1.indexOf("Lcl_")?[subNode.propertyList[4],subNode.propertyList[5],subNode.propertyList[6]]:subNode.propertyList[4],node[innerPropName]={type:innerPropType1,type2:innerPropType2,flag:innerPropFlag,value:innerPropValue}}else void 0===node[subNode.name]?"number"==typeof subNode.id?(node[subNode.name]={},node[subNode.name][subNode.id]=subNode):node[subNode.name]=subNode:"PoseNode"===subNode.name?(Array.isArray(node[subNode.name])||(node[subNode.name]=[node[subNode.name]]),node[subNode.name].push(subNode)):void 0===node[subNode.name][subNode.id]&&(node[subNode.name][subNode.id]=subNode)}parseProperty(reader){const type=reader.getString(1);let length;switch(type){case"C":return reader.getBoolean();case"D":return reader.getFloat64();case"F":return reader.getFloat32();case"I":return reader.getInt32();case"L":return reader.getInt64();case"R":return length=reader.getUint32(),reader.getArrayBuffer(length);case"S":return length=reader.getUint32(),reader.getString(length);case"Y":return reader.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const arrayLength=reader.getUint32(),encoding=reader.getUint32(),compressedLength=reader.getUint32();if(0===encoding)switch(type){case"b":case"c":return reader.getBooleanArray(arrayLength);case"d":return reader.getFloat64Array(arrayLength);case"f":return reader.getFloat32Array(arrayLength);case"i":return reader.getInt32Array(arrayLength);case"l":return reader.getInt64Array(arrayLength)}const data=(0,browser.HT)(new Uint8Array(reader.getArrayBuffer(compressedLength))),reader2=new BinaryReader(data.buffer);switch(type){case"b":case"c":return reader2.getBooleanArray(arrayLength);case"d":return reader2.getFloat64Array(arrayLength);case"f":return reader2.getFloat32Array(arrayLength);case"i":return reader2.getInt32Array(arrayLength);case"l":return reader2.getInt64Array(arrayLength)}default:throw new Error("THREE.FBXLoader: Unknown property type "+type)}}}class BinaryReader{constructor(buffer,littleEndian){this.dv=new DataView(buffer),this.offset=0,this.littleEndian=void 0===littleEndian||littleEndian}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(length){this.offset+=length}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(size){const a=[];for(let i=0;i=0&&(a=a.slice(0,nullByte)),(0,LoaderUtils.r)(new Uint8Array(a))}}class FBXTree{add(key,val){this[key]=val}}function getFbxVersion(text){const match=text.match(/FBXVersion: (\d+)/);if(match){return parseInt(match[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function convertFBXTimeToSeconds(time){return time/46186158e3}const dataArray=[];function getData(polygonVertexIndex,polygonIndex,vertexIndex,infoObject){let index;switch(infoObject.mappingType){case"ByPolygonVertex":index=polygonVertexIndex;break;case"ByPolygon":index=polygonIndex;break;case"ByVertice":index=vertexIndex;break;case"AllSame":index=infoObject.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+infoObject.mappingType)}"IndexToDirect"===infoObject.referenceType&&(index=infoObject.indices[index]);const from=index*infoObject.dataSize,to=from+infoObject.dataSize;return function slice(a,b,from,to){for(let i=from,j=0;i=2.0 are supported.")));const parser=new GLTFParser(json,{path:path||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});parser.fileLoader.setRequestHeader(this.requestHeader);for(let i=0;i=0&&void 0===plugins[extensionName]&&console.warn('THREE.GLTFLoader: Unknown extension "'+extensionName+'".')}}parser.setExtensions(extensions),parser.setPlugins(plugins),parser.parse(onLoad,onError)}parseAsync(data,path){const scope=this;return new Promise((function(resolve,reject){scope.parse(data,path,resolve,reject)}))}}function GLTFRegistry(){let objects={};return{get:function(key){return objects[key]},add:function(key,object){objects[key]=object},remove:function(key){delete objects[key]},removeAll:function(){objects={}}}}const EXTENSIONS={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class GLTFLightsExtension{constructor(parser){this.parser=parser,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const parser=this.parser,nodeDefs=this.parser.json.nodes||[];for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return parser.loadTextureImage(textureIndex,extension.source,loader)}}class GLTFTextureWebPExtension{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(textureIndex){const name=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name])return null;const extension=textureDef.extensions[name],source=json.images[extension.source];let loader=parser.textureLoader;if(source.uri){const handler=parser.options.manager.getHandler(source.uri);null!==handler&&(loader=handler)}return this.detectSupport().then((function(isSupported){if(isSupported)return parser.loadTextureImage(textureIndex,extension.source,loader);if(json.extensionsRequired&&json.extensionsRequired.indexOf(name)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return parser.loadTexture(textureIndex)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(resolve){const image=new Image;image.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",image.onload=image.onerror=function(){resolve(1===image.height)}}))),this.isSupported}}class GLTFTextureAVIFExtension{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(textureIndex){const name=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name])return null;const extension=textureDef.extensions[name],source=json.images[extension.source];let loader=parser.textureLoader;if(source.uri){const handler=parser.options.manager.getHandler(source.uri);null!==handler&&(loader=handler)}return this.detectSupport().then((function(isSupported){if(isSupported)return parser.loadTextureImage(textureIndex,extension.source,loader);if(json.extensionsRequired&&json.extensionsRequired.indexOf(name)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return parser.loadTexture(textureIndex)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(resolve){const image=new Image;image.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",image.onload=image.onerror=function(){resolve(1===image.height)}}))),this.isSupported}}class GLTFMeshoptCompression{constructor(parser){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=parser}loadBufferView(index){const json=this.parser.json,bufferView=json.bufferViews[index];if(bufferView.extensions&&bufferView.extensions[this.name]){const extensionDef=bufferView.extensions[this.name],buffer=this.parser.getDependency("buffer",extensionDef.buffer),decoder=this.parser.options.meshoptDecoder;if(!decoder||!decoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return buffer.then((function(res){const byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count=extensionDef.count,stride=extensionDef.byteStride,source=new Uint8Array(res,byteOffset,byteLength);return decoder.decodeGltfBufferAsync?decoder.decodeGltfBufferAsync(count,stride,source,extensionDef.mode,extensionDef.filter).then((function(res2){return res2.buffer})):decoder.ready.then((function(){const result=new ArrayBuffer(count*stride);return decoder.decodeGltfBuffer(new Uint8Array(result),count,stride,source,extensionDef.mode,extensionDef.filter),result}))}))}return null}}class GLTFMeshGpuInstancing{constructor(parser){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=parser}createNodeMesh(nodeIndex){const json=this.parser.json,nodeDef=json.nodes[nodeIndex];if(!nodeDef.extensions||!nodeDef.extensions[this.name]||void 0===nodeDef.mesh)return null;const meshDef=json.meshes[nodeDef.mesh];for(const primitive of meshDef.primitives)if(primitive.mode!==WEBGL_CONSTANTS.TRIANGLES&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&void 0!==primitive.mode)return null;const attributesDef=nodeDef.extensions[this.name].attributes,pending=[],attributes={};for(const key in attributesDef)pending.push(this.parser.getDependency("accessor",attributesDef[key]).then((accessor=>(attributes[key]=accessor,attributes[key]))));return pending.length<1?null:(pending.push(this.parser.createNodeMesh(nodeIndex)),Promise.all(pending).then((results=>{const nodeObject=results.pop(),meshes=nodeObject.isGroup?nodeObject.children:[nodeObject],count=results[0].count,instancedMeshes=[];for(const mesh of meshes){const m=new three_module.Matrix4,p=new three_module.Vector3,q=new three_module.Quaternion,s=new three_module.Vector3(1,1,1),instancedMesh=new three_module.InstancedMesh(mesh.geometry,mesh.material,count);for(let i=0;i=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},PATH_PROPERTIES={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},INTERPOLATION={CUBICSPLINE:void 0,LINEAR:three_module.InterpolateLinear,STEP:three_module.InterpolateDiscrete},ALPHA_MODES_OPAQUE="OPAQUE",ALPHA_MODES_MASK="MASK",ALPHA_MODES_BLEND="BLEND";function addUnknownExtensionsToUserData(knownExtensions,object,objectDef){for(const name in objectDef.extensions)void 0===knownExtensions[name]&&(object.userData.gltfExtensions=object.userData.gltfExtensions||{},object.userData.gltfExtensions[name]=objectDef.extensions[name])}function assignExtrasToUserData(object,gltfDef){void 0!==gltfDef.extras&&("object"==typeof gltfDef.extras?Object.assign(object.userData,gltfDef.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+gltfDef.extras))}function updateMorphTargets(mesh,meshDef){if(mesh.updateMorphTargets(),void 0!==meshDef.weights)for(let i=0,il=meshDef.weights.length;i-1,firefoxVersion=isFirefox?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||isSafari||isFirefox&&firefoxVersion<98?this.textureLoader=new three_module.TextureLoader(this.options.manager):this.textureLoader=new three_module.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new three_module.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(extensions){this.extensions=extensions}setPlugins(plugins){this.plugins=plugins}parse(onLoad,onError){const parser=this,json=this.json,extensions=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(ext){return ext._markDefs&&ext._markDefs()})),Promise.all(this._invokeAll((function(ext){return ext.beforeRoot&&ext.beforeRoot()}))).then((function(){return Promise.all([parser.getDependencies("scene"),parser.getDependencies("animation"),parser.getDependencies("camera")])})).then((function(dependencies){const result={scene:dependencies[0][json.scene||0],scenes:dependencies[0],animations:dependencies[1],cameras:dependencies[2],asset:json.asset,parser:parser,userData:{}};return addUnknownExtensionsToUserData(extensions,result,json),assignExtrasToUserData(result,json),Promise.all(parser._invokeAll((function(ext){return ext.afterRoot&&ext.afterRoot(result)}))).then((function(){for(const scene of result.scenes)scene.updateMatrixWorld();onLoad(result)}))})).catch(onError)}_markDefs(){const nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex{const mappings=this.associations.get(original);null!=mappings&&this.associations.set(clone,mappings);for(const[i,child]of original.children.entries())updateMappings(child,clone.children[i])};return updateMappings(object,ref),ref.name+="_instance_"+cache.uses[index]++,ref}_invokeOne(func){const extensions=Object.values(this.plugins);extensions.push(this);for(let i=0;i=2&&bufferAttribute.setY(index,sparseValues[i*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index,sparseValues[i*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index,sparseValues[i*itemSize+3]),itemSize>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return bufferAttribute}))}loadTexture(textureIndex){const json=this.json,options=this.options,sourceIndex=json.textures[textureIndex].source,sourceDef=json.images[sourceIndex];let loader=this.textureLoader;if(sourceDef.uri){const handler=options.manager.getHandler(sourceDef.uri);null!==handler&&(loader=handler)}return this.loadTextureImage(textureIndex,sourceIndex,loader)}loadTextureImage(textureIndex,sourceIndex,loader){const parser=this,json=this.json,textureDef=json.textures[textureIndex],sourceDef=json.images[sourceIndex],cacheKey=(sourceDef.uri||sourceDef.bufferView)+":"+textureDef.sampler;if(this.textureCache[cacheKey])return this.textureCache[cacheKey];const promise=this.loadImageSource(sourceIndex,loader).then((function(texture){texture.flipY=!1,texture.name=textureDef.name||sourceDef.name||"",""===texture.name&&"string"==typeof sourceDef.uri&&!1===sourceDef.uri.startsWith("data:image/")&&(texture.name=sourceDef.uri);const sampler=(json.samplers||{})[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||three_module.LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||three_module.LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||three_module.RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||three_module.RepeatWrapping,parser.associations.set(texture,{textures:textureIndex}),texture})).catch((function(){return null}));return this.textureCache[cacheKey]=promise,promise}loadImageSource(sourceIndex,loader){const parser=this,json=this.json,options=this.options;if(void 0!==this.sourceCache[sourceIndex])return this.sourceCache[sourceIndex].then((texture=>texture.clone()));const sourceDef=json.images[sourceIndex],URL=self.URL||self.webkitURL;let sourceURI=sourceDef.uri||"",isObjectURL=!1;if(void 0!==sourceDef.bufferView)sourceURI=parser.getDependency("bufferView",sourceDef.bufferView).then((function(bufferView){isObjectURL=!0;const blob=new Blob([bufferView],{type:sourceDef.mimeType});return sourceURI=URL.createObjectURL(blob),sourceURI}));else if(void 0===sourceDef.uri)throw new Error("THREE.GLTFLoader: Image "+sourceIndex+" is missing URI and bufferView");const promise=Promise.resolve(sourceURI).then((function(sourceURI2){return new Promise((function(resolve,reject){let onLoad=resolve;!0===loader.isImageBitmapLoader&&(onLoad=function(imageBitmap){const texture=new three_module.Texture(imageBitmap);texture.needsUpdate=!0,resolve(texture)}),loader.load(three_module.LoaderUtils.resolveURL(sourceURI2,options.path),onLoad,void 0,reject)}))})).then((function(texture){return!0===isObjectURL&&URL.revokeObjectURL(sourceURI),assignExtrasToUserData(texture,sourceDef),texture.userData.mimeType=sourceDef.mimeType||function getImageURIMimeType(uri){return uri.search(/\.jpe?g($|\?)/i)>0||0===uri.search(/^data\:image\/jpeg/)?"image/jpeg":uri.search(/\.webp($|\?)/i)>0||0===uri.search(/^data\:image\/webp/)?"image/webp":"image/png"}(sourceDef.uri),texture})).catch((function(error){throw console.error("THREE.GLTFLoader: Couldn't load texture",sourceURI),error}));return this.sourceCache[sourceIndex]=promise,promise}assignTexture(materialParams,mapName,mapDef,colorSpace){const parser=this;return this.getDependency("texture",mapDef.index).then((function(texture){if(!texture)return null;if(void 0!==mapDef.texCoord&&mapDef.texCoord>0&&((texture=texture.clone()).channel=mapDef.texCoord),parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){const transform=void 0!==mapDef.extensions?mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]:void 0;if(transform){const gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform),parser.associations.set(texture,gltfReference)}}return void 0!==colorSpace&&("number"==typeof colorSpace&&(colorSpace=3001===colorSpace?"srgb":"srgb-linear"),"colorSpace"in texture?texture.colorSpace=colorSpace:texture.encoding="srgb"===colorSpace?3001:3e3),materialParams[mapName]=texture,texture}))}assignFinalMaterial(mesh){const geometry=mesh.geometry;let material=mesh.material;const useDerivativeTangents=void 0===geometry.attributes.tangent,useVertexColors=void 0!==geometry.attributes.color,useFlatShading=void 0===geometry.attributes.normal;if(mesh.isPoints){const cacheKey="PointsMaterial:"+material.uuid;let pointsMaterial=this.cache.get(cacheKey);pointsMaterial||(pointsMaterial=new three_module.PointsMaterial,three_module.Material.prototype.copy.call(pointsMaterial,material),pointsMaterial.color.copy(material.color),pointsMaterial.map=material.map,pointsMaterial.sizeAttenuation=!1,this.cache.add(cacheKey,pointsMaterial)),material=pointsMaterial}else if(mesh.isLine){const cacheKey="LineBasicMaterial:"+material.uuid;let lineMaterial=this.cache.get(cacheKey);lineMaterial||(lineMaterial=new three_module.LineBasicMaterial,three_module.Material.prototype.copy.call(lineMaterial,material),lineMaterial.color.copy(material.color),lineMaterial.map=material.map,this.cache.add(cacheKey,lineMaterial)),material=lineMaterial}if(useDerivativeTangents||useVertexColors||useFlatShading){let cacheKey="ClonedMaterial:"+material.uuid+":";useDerivativeTangents&&(cacheKey+="derivative-tangents:"),useVertexColors&&(cacheKey+="vertex-colors:"),useFlatShading&&(cacheKey+="flat-shading:");let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&(cachedMaterial.flatShading=!0),useDerivativeTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.add(cacheKey,cachedMaterial),this.associations.set(cachedMaterial,this.associations.get(material))),material=cachedMaterial}mesh.material=material}getMaterialType(){return three_module.MeshStandardMaterial}loadMaterial(materialIndex){const parser=this,json=this.json,extensions=this.extensions,materialDef=json.materials[materialIndex];let materialType;const materialParams={},pending=[];if((materialDef.extensions||{})[EXTENSIONS.KHR_MATERIALS_UNLIT]){const kmuExtension=extensions[EXTENSIONS.KHR_MATERIALS_UNLIT];materialType=kmuExtension.getMaterialType(),pending.push(kmuExtension.extendParams(materialParams,materialDef,parser))}else{const metallicRoughness=materialDef.pbrMetallicRoughness||{};if(materialParams.color=new three_module.Color(1,1,1),materialParams.opacity=1,Array.isArray(metallicRoughness.baseColorFactor)){const array=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array[0],array[1],array[2],"srgb-linear"),materialParams.opacity=array[3]}void 0!==metallicRoughness.baseColorTexture&&pending.push(parser.assignTexture(materialParams,"map",metallicRoughness.baseColorTexture,"srgb")),materialParams.metalness=void 0!==metallicRoughness.metallicFactor?metallicRoughness.metallicFactor:1,materialParams.roughness=void 0!==metallicRoughness.roughnessFactor?metallicRoughness.roughnessFactor:1,void 0!==metallicRoughness.metallicRoughnessTexture&&(pending.push(parser.assignTexture(materialParams,"metalnessMap",metallicRoughness.metallicRoughnessTexture)),pending.push(parser.assignTexture(materialParams,"roughnessMap",metallicRoughness.metallicRoughnessTexture))),materialType=this._invokeOne((function(ext){return ext.getMaterialType&&ext.getMaterialType(materialIndex)})),pending.push(Promise.all(this._invokeAll((function(ext){return ext.extendMaterialParams&&ext.extendMaterialParams(materialIndex,materialParams)}))))}!0===materialDef.doubleSided&&(materialParams.side=three_module.DoubleSide);const alphaMode=materialDef.alphaMode||ALPHA_MODES_OPAQUE;if(alphaMode===ALPHA_MODES_BLEND?(materialParams.transparent=!0,materialParams.depthWrite=!1):(materialParams.transparent=!1,alphaMode===ALPHA_MODES_MASK&&(materialParams.alphaTest=void 0!==materialDef.alphaCutoff?materialDef.alphaCutoff:.5)),void 0!==materialDef.normalTexture&&materialType!==three_module.MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,"normalMap",materialDef.normalTexture)),materialParams.normalScale=new three_module.Vector2(1,1),void 0!==materialDef.normalTexture.scale)){const scale=materialDef.normalTexture.scale;materialParams.normalScale.set(scale,scale)}if(void 0!==materialDef.occlusionTexture&&materialType!==three_module.MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,"aoMap",materialDef.occlusionTexture)),void 0!==materialDef.occlusionTexture.strength&&(materialParams.aoMapIntensity=materialDef.occlusionTexture.strength)),void 0!==materialDef.emissiveFactor&&materialType!==three_module.MeshBasicMaterial){const emissiveFactor=materialDef.emissiveFactor;materialParams.emissive=(new three_module.Color).setRGB(emissiveFactor[0],emissiveFactor[1],emissiveFactor[2],"srgb-linear")}return void 0!==materialDef.emissiveTexture&&materialType!==three_module.MeshBasicMaterial&&pending.push(parser.assignTexture(materialParams,"emissiveMap",materialDef.emissiveTexture,"srgb")),Promise.all(pending).then((function(){const material=new materialType(materialParams);return materialDef.name&&(material.name=materialDef.name),assignExtrasToUserData(material,materialDef),parser.associations.set(material,{materials:materialIndex}),materialDef.extensions&&addUnknownExtensionsToUserData(extensions,material,materialDef),material}))}createUniqueName(originalName){const sanitizedName=three_module.PropertyBinding.sanitizeNodeName(originalName||"");return sanitizedName in this.nodeNamesUsed?sanitizedName+"_"+ ++this.nodeNamesUsed[sanitizedName]:(this.nodeNamesUsed[sanitizedName]=0,sanitizedName)}loadGeometries(primitives){const parser=this,extensions=this.extensions,cache=this.primitiveCache;function createDracoPrimitive(primitive){return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive,parser).then((function(geometry){return addPrimitiveAttributes(geometry,primitive,parser)}))}const pending=[];for(let i=0,il=primitives.length;i0&&updateMorphTargets(mesh,meshDef),mesh.name=parser.createUniqueName(meshDef.name||"mesh_"+meshIndex),assignExtrasToUserData(mesh,meshDef),primitive.extensions&&addUnknownExtensionsToUserData(extensions,mesh,primitive),parser.assignFinalMaterial(mesh),meshes.push(mesh)}for(let i=0,il=meshes.length;i1?new three_module.Group:1===objects.length?objects[0]:new three_module.Object3D,node!==objects[0])for(let i=0,il=objects.length;i{const reducedAssociations=new Map;for(const[key,value]of parser.associations)(key instanceof three_module.Material||key instanceof three_module.Texture)&&reducedAssociations.set(key,value);return node.traverse((node2=>{const mappings=parser.associations.get(node2);null!=mappings&&reducedAssociations.set(node2,mappings)})),reducedAssociations})(scene),scene}))}_createAnimationTracks(node,inputAccessor,outputAccessor,sampler,target){const tracks=[],targetName=node.name?node.name:node.uuid,targetNames=[];let TypedKeyframeTrack;switch(PATH_PROPERTIES[target.path]===PATH_PROPERTIES.weights?node.traverse((function(object){object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.uuid)})):targetNames.push(targetName),PATH_PROPERTIES[target.path]){case PATH_PROPERTIES.weights:TypedKeyframeTrack=three_module.NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:TypedKeyframeTrack=three_module.QuaternionKeyframeTrack;break;case PATH_PROPERTIES.position:case PATH_PROPERTIES.scale:TypedKeyframeTrack=three_module.VectorKeyframeTrack;break;default:if(1===outputAccessor.itemSize)TypedKeyframeTrack=three_module.NumberKeyframeTrack;else TypedKeyframeTrack=three_module.VectorKeyframeTrack}const interpolation=void 0!==sampler.interpolation?INTERPOLATION[sampler.interpolation]:three_module.InterpolateLinear,outputArray=this._getArrayFromAccessor(outputAccessor);for(let j=0,jl=targetNames.length;j>8&255]+_lut[d0>>16&255]+_lut[d0>>24&255]+"-"+_lut[255&d1]+_lut[d1>>8&255]+"-"+_lut[d1>>16&15|64]+_lut[d1>>24&255]+"-"+_lut[63&d2|128]+_lut[d2>>8&255]+"-"+_lut[d2>>16&255]+_lut[d2>>24&255]+_lut[255&d3]+_lut[d3>>8&255]+_lut[d3>>16&255]+_lut[d3>>24&255]).toLowerCase()}function clamp(value,min,max){return Math.max(min,Math.min(max,value))}function euclideanModulo(n,m){return(n%m+m)%m}function lerp(x,y,t){return(1-t)*x+t*y}function denormalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint32Array:return value/4294967295;case Uint16Array:return value/65535;case Uint8Array:return value/255;case Int32Array:return Math.max(value/2147483647,-1);case Int16Array:return Math.max(value/32767,-1);case Int8Array:return Math.max(value/127,-1);default:throw new Error("Invalid component type.")}}function normalize(value,array){switch(array.constructor){case Float32Array:return value;case Uint32Array:return Math.round(4294967295*value);case Uint16Array:return Math.round(65535*value);case Uint8Array:return Math.round(255*value);case Int32Array:return Math.round(2147483647*value);case Int16Array:return Math.round(32767*value);case Int8Array:return Math.round(127*value);default:throw new Error("Invalid component type.")}}const MathUtils={DEG2RAD:DEG2RAD,RAD2DEG:RAD2DEG,generateUUID:generateUUID,clamp:clamp,euclideanModulo:euclideanModulo,mapLinear:function mapLinear(x,a1,a2,b1,b2){return b1+(x-a1)*(b2-b1)/(a2-a1)},inverseLerp:function inverseLerp(x,y,value){return x!==y?(value-x)/(y-x):0},lerp:lerp,damp:function damp(x,y,lambda,dt){return lerp(x,y,1-Math.exp(-lambda*dt))},pingpong:function pingpong(x,length=1){return length-Math.abs(euclideanModulo(x,2*length)-length)},smoothstep:function smoothstep(x,min,max){return x<=min?0:x>=max?1:(x=(x-min)/(max-min))*x*(3-2*x)},smootherstep:function smootherstep(x,min,max){return x<=min?0:x>=max?1:(x=(x-min)/(max-min))*x*x*(x*(6*x-15)+10)},randInt:function randInt(low,high){return low+Math.floor(Math.random()*(high-low+1))},randFloat:function randFloat(low,high){return low+Math.random()*(high-low)},randFloatSpread:function randFloatSpread(range){return range*(.5-Math.random())},seededRandom:function seededRandom(s){void 0!==s&&(_seed=s);let t=_seed+=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 degToRad(degrees){return degrees*DEG2RAD},radToDeg:function radToDeg(radians){return radians*RAD2DEG},isPowerOfTwo:function isPowerOfTwo(value){return 0==(value&value-1)&&0!==value},ceilPowerOfTwo:function ceilPowerOfTwo(value){return Math.pow(2,Math.ceil(Math.log(value)/Math.LN2))},floorPowerOfTwo:function floorPowerOfTwo(value){return Math.pow(2,Math.floor(Math.log(value)/Math.LN2))},setQuaternionFromProperEuler:function setQuaternionFromProperEuler(q,a,b,c,order){const cos=Math.cos,sin=Math.sin,c2=cos(b/2),s2=sin(b/2),c13=cos((a+c)/2),s13=sin((a+c)/2),c1_3=cos((a-c)/2),s1_3=sin((a-c)/2),c3_1=cos((c-a)/2),s3_1=sin((c-a)/2);switch(order){case"XYX":q.set(c2*s13,s2*c1_3,s2*s1_3,c2*c13);break;case"YZY":q.set(s2*s1_3,c2*s13,s2*c1_3,c2*c13);break;case"ZXZ":q.set(s2*c1_3,s2*s1_3,c2*s13,c2*c13);break;case"XZX":q.set(c2*s13,s2*s3_1,s2*c3_1,c2*c13);break;case"YXY":q.set(s2*c3_1,c2*s13,s2*s3_1,c2*c13);break;case"ZYZ":q.set(s2*s3_1,s2*c3_1,c2*s13,c2*c13);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+order)}},normalize:normalize,denormalize:denormalize};class Vector2{constructor(x=0,y=0){Vector2.prototype.isVector2=!0,this.x=x,this.y=y}get width(){return this.x}set width(value){this.x=value}get height(){return this.y}set height(value){this.y=value}set(x,y){return this.x=x,this.y=y,this}setScalar(scalar){return this.x=scalar,this.y=scalar,this}setX(x){return this.x=x,this}setY(y){return this.y=y,this}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;default:throw new Error("index is out of range: "+index)}return this}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+index)}}clone(){return new this.constructor(this.x,this.y)}copy(v){return this.x=v.x,this.y=v.y,this}add(v){return this.x+=v.x,this.y+=v.y,this}addScalar(s){return this.x+=s,this.y+=s,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this}addScaledVector(v,s){return this.x+=v.x*s,this.y+=v.y*s,this}sub(v){return this.x-=v.x,this.y-=v.y,this}subScalar(s){return this.x-=s,this.y-=s,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this}multiply(v){return this.x*=v.x,this.y*=v.y,this}multiplyScalar(scalar){return this.x*=scalar,this.y*=scalar,this}divide(v){return this.x/=v.x,this.y/=v.y,this}divideScalar(scalar){return this.multiplyScalar(1/scalar)}applyMatrix3(m){const x=this.x,y=this.y,e=m.elements;return this.x=e[0]*x+e[3]*y+e[6],this.y=e[1]*x+e[4]*y+e[7],this}min(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this}max(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this}clamp(min,max){return this.x=Math.max(min.x,Math.min(max.x,this.x)),this.y=Math.max(min.y,Math.min(max.y,this.y)),this}clampScalar(minVal,maxVal){return this.x=Math.max(minVal,Math.min(maxVal,this.x)),this.y=Math.max(minVal,Math.min(maxVal,this.y)),this}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)))}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(v){return this.x*v.x+this.y*v.y}cross(v){return this.x*v.y-this.y*v.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(v){const denominator=Math.sqrt(this.lengthSq()*v.lengthSq());if(0===denominator)return Math.PI/2;const theta=this.dot(v)/denominator;return Math.acos(clamp(theta,-1,1))}distanceTo(v){return Math.sqrt(this.distanceToSquared(v))}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y;return dx*dx+dy*dy}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)}setLength(length){return this.normalize().multiplyScalar(length)}lerp(v,alpha){return this.x+=(v.x-this.x)*alpha,this.y+=(v.y-this.y)*alpha,this}lerpVectors(v1,v2,alpha){return this.x=v1.x+(v2.x-v1.x)*alpha,this.y=v1.y+(v2.y-v1.y)*alpha,this}equals(v){return v.x===this.x&&v.y===this.y}fromArray(array,offset=0){return this.x=array[offset],this.y=array[offset+1],this}toArray(array=[],offset=0){return array[offset]=this.x,array[offset+1]=this.y,array}fromBufferAttribute(attribute,index){return this.x=attribute.getX(index),this.y=attribute.getY(index),this}rotateAround(center,angle){const c=Math.cos(angle),s=Math.sin(angle),x=this.x-center.x,y=this.y-center.y;return this.x=x*c-y*s+center.x,this.y=x*s+y*c+center.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(n11,n12,n13,n21,n22,n23,n31,n32,n33){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==n11&&this.set(n11,n12,n13,n21,n22,n23,n31,n32,n33)}set(n11,n12,n13,n21,n22,n23,n31,n32,n33){const te=this.elements;return te[0]=n11,te[1]=n21,te[2]=n31,te[3]=n12,te[4]=n22,te[5]=n32,te[6]=n13,te[7]=n23,te[8]=n33,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(m){const te=this.elements,me=m.elements;return te[0]=me[0],te[1]=me[1],te[2]=me[2],te[3]=me[3],te[4]=me[4],te[5]=me[5],te[6]=me[6],te[7]=me[7],te[8]=me[8],this}extractBasis(xAxis,yAxis,zAxis){return xAxis.setFromMatrix3Column(this,0),yAxis.setFromMatrix3Column(this,1),zAxis.setFromMatrix3Column(this,2),this}setFromMatrix4(m){const me=m.elements;return this.set(me[0],me[4],me[8],me[1],me[5],me[9],me[2],me[6],me[10]),this}multiply(m){return this.multiplyMatrices(this,m)}premultiply(m){return this.multiplyMatrices(m,this)}multiplyMatrices(a,b){const ae=a.elements,be=b.elements,te=this.elements,a11=ae[0],a12=ae[3],a13=ae[6],a21=ae[1],a22=ae[4],a23=ae[7],a31=ae[2],a32=ae[5],a33=ae[8],b11=be[0],b12=be[3],b13=be[6],b21=be[1],b22=be[4],b23=be[7],b31=be[2],b32=be[5],b33=be[8];return te[0]=a11*b11+a12*b21+a13*b31,te[3]=a11*b12+a12*b22+a13*b32,te[6]=a11*b13+a12*b23+a13*b33,te[1]=a21*b11+a22*b21+a23*b31,te[4]=a21*b12+a22*b22+a23*b32,te[7]=a21*b13+a22*b23+a23*b33,te[2]=a31*b11+a32*b21+a33*b31,te[5]=a31*b12+a32*b22+a33*b32,te[8]=a31*b13+a32*b23+a33*b33,this}multiplyScalar(s){const te=this.elements;return te[0]*=s,te[3]*=s,te[6]*=s,te[1]*=s,te[4]*=s,te[7]*=s,te[2]*=s,te[5]*=s,te[8]*=s,this}determinant(){const te=this.elements,a=te[0],b=te[1],c=te[2],d=te[3],e=te[4],f=te[5],g=te[6],h=te[7],i=te[8];return a*e*i-a*f*h-b*d*i+b*f*g+c*d*h-c*e*g}invert(){const te=this.elements,n11=te[0],n21=te[1],n31=te[2],n12=te[3],n22=te[4],n32=te[5],n13=te[6],n23=te[7],n33=te[8],t11=n33*n22-n32*n23,t12=n32*n13-n33*n12,t13=n23*n12-n22*n13,det=n11*t11+n21*t12+n31*t13;if(0===det)return this.set(0,0,0,0,0,0,0,0,0);const detInv=1/det;return te[0]=t11*detInv,te[1]=(n31*n23-n33*n21)*detInv,te[2]=(n32*n21-n31*n22)*detInv,te[3]=t12*detInv,te[4]=(n33*n11-n31*n13)*detInv,te[5]=(n31*n12-n32*n11)*detInv,te[6]=t13*detInv,te[7]=(n21*n13-n23*n11)*detInv,te[8]=(n22*n11-n21*n12)*detInv,this}transpose(){let tmp;const m=this.elements;return tmp=m[1],m[1]=m[3],m[3]=tmp,tmp=m[2],m[2]=m[6],m[6]=tmp,tmp=m[5],m[5]=m[7],m[7]=tmp,this}getNormalMatrix(matrix4){return this.setFromMatrix4(matrix4).invert().transpose()}transposeIntoArray(r){const m=this.elements;return r[0]=m[0],r[1]=m[3],r[2]=m[6],r[3]=m[1],r[4]=m[4],r[5]=m[7],r[6]=m[2],r[7]=m[5],r[8]=m[8],this}setUvTransform(tx,ty,sx,sy,rotation,cx,cy){const c=Math.cos(rotation),s=Math.sin(rotation);return this.set(sx*c,sx*s,-sx*(c*cx+s*cy)+cx+tx,-sy*s,sy*c,-sy*(-s*cx+c*cy)+cy+ty,0,0,1),this}scale(sx,sy){return this.premultiply(_m3.makeScale(sx,sy)),this}rotate(theta){return this.premultiply(_m3.makeRotation(-theta)),this}translate(tx,ty){return this.premultiply(_m3.makeTranslation(tx,ty)),this}makeTranslation(x,y){return x.isVector2?this.set(1,0,x.x,0,1,x.y,0,0,1):this.set(1,0,x,0,1,y,0,0,1),this}makeRotation(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(c,-s,0,s,c,0,0,0,1),this}makeScale(x,y){return this.set(x,0,0,0,y,0,0,0,1),this}equals(matrix){const te=this.elements,me=matrix.elements;for(let i=0;i<9;i++)if(te[i]!==me[i])return!1;return!0}fromArray(array,offset=0){for(let i=0;i<9;i++)this.elements[i]=array[i+offset];return this}toArray(array=[],offset=0){const te=this.elements;return array[offset]=te[0],array[offset+1]=te[1],array[offset+2]=te[2],array[offset+3]=te[3],array[offset+4]=te[4],array[offset+5]=te[5],array[offset+6]=te[6],array[offset+7]=te[7],array[offset+8]=te[8],array}clone(){return(new this.constructor).fromArray(this.elements)}}const _m3=new Matrix3;function arrayNeedsUint32(array){for(let i=array.length-1;i>=0;--i)if(array[i]>=65535)return!0;return!1}const TYPED_ARRAYS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function getTypedArray(type,buffer){return new TYPED_ARRAYS[type](buffer)}function createElementNS(name){return document.createElementNS("http://www.w3.org/1999/xhtml",name)}function createCanvasElement(){const canvas=createElementNS("canvas");return canvas.style.display="block",canvas}const _cache={};function warnOnce(message){message in _cache||(_cache[message]=!0,console.warn(message))}const LINEAR_SRGB_TO_LINEAR_DISPLAY_P3=(new Matrix3).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),LINEAR_DISPLAY_P3_TO_LINEAR_SRGB=(new Matrix3).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),COLOR_SPACES={[LinearSRGBColorSpace]:{transfer:LinearTransfer,primaries:Rec709Primaries,toReference:color=>color,fromReference:color=>color},[SRGBColorSpace]:{transfer:SRGBTransfer,primaries:Rec709Primaries,toReference:color=>color.convertSRGBToLinear(),fromReference:color=>color.convertLinearToSRGB()},[LinearDisplayP3ColorSpace]:{transfer:LinearTransfer,primaries:P3Primaries,toReference:color=>color.applyMatrix3(LINEAR_DISPLAY_P3_TO_LINEAR_SRGB),fromReference:color=>color.applyMatrix3(LINEAR_SRGB_TO_LINEAR_DISPLAY_P3)},[DisplayP3ColorSpace]:{transfer:SRGBTransfer,primaries:P3Primaries,toReference:color=>color.convertSRGBToLinear().applyMatrix3(LINEAR_DISPLAY_P3_TO_LINEAR_SRGB),fromReference:color=>color.applyMatrix3(LINEAR_SRGB_TO_LINEAR_DISPLAY_P3).convertLinearToSRGB()}},SUPPORTED_WORKING_COLOR_SPACES=new Set([LinearSRGBColorSpace,LinearDisplayP3ColorSpace]),ColorManagement={enabled:!0,_workingColorSpace:LinearSRGBColorSpace,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(colorSpace){if(!SUPPORTED_WORKING_COLOR_SPACES.has(colorSpace))throw new Error(`Unsupported working color space, "${colorSpace}".`);this._workingColorSpace=colorSpace},convert:function(color,sourceColorSpace,targetColorSpace){if(!1===this.enabled||sourceColorSpace===targetColorSpace||!sourceColorSpace||!targetColorSpace)return color;const sourceToReference=COLOR_SPACES[sourceColorSpace].toReference;return(0,COLOR_SPACES[targetColorSpace].fromReference)(sourceToReference(color))},fromWorkingColorSpace:function(color,targetColorSpace){return this.convert(color,this._workingColorSpace,targetColorSpace)},toWorkingColorSpace:function(color,sourceColorSpace){return this.convert(color,sourceColorSpace,this._workingColorSpace)},getPrimaries:function(colorSpace){return COLOR_SPACES[colorSpace].primaries},getTransfer:function(colorSpace){return colorSpace===NoColorSpace?LinearTransfer:COLOR_SPACES[colorSpace].transfer}};function SRGBToLinear(c){return c<.04045?.0773993808*c:Math.pow(.9478672986*c+.0521327014,2.4)}function LinearToSRGB(c){return c<.0031308?12.92*c:1.055*Math.pow(c,.41666)-.055}let _canvas;class ImageUtils{static getDataURL(image){if(/^data:/i.test(image.src))return image.src;if("undefined"==typeof HTMLCanvasElement)return image.src;let canvas;if(image instanceof HTMLCanvasElement)canvas=image;else{void 0===_canvas&&(_canvas=createElementNS("canvas")),_canvas.width=image.width,_canvas.height=image.height;const context=_canvas.getContext("2d");image instanceof ImageData?context.putImageData(image,0,0):context.drawImage(image,0,0,image.width,image.height),canvas=_canvas}return canvas.width>2048||canvas.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",image),canvas.toDataURL("image/jpeg",.6)):canvas.toDataURL("image/png")}static sRGBToLinear(image){if("undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&image instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&image instanceof ImageBitmap){const canvas=createElementNS("canvas");canvas.width=image.width,canvas.height=image.height;const context=canvas.getContext("2d");context.drawImage(image,0,0,image.width,image.height);const imageData=context.getImageData(0,0,image.width,image.height),data=imageData.data;for(let i=0;i0&&(output.userData=this.userData),isRootObject||(meta.textures[this.uuid]=output),output}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(uv){if(this.mapping!==UVMapping)return uv;if(uv.applyMatrix3(this.matrix),uv.x<0||uv.x>1)switch(this.wrapS){case RepeatWrapping:uv.x=uv.x-Math.floor(uv.x);break;case ClampToEdgeWrapping:uv.x=uv.x<0?0:1;break;case MirroredRepeatWrapping:1===Math.abs(Math.floor(uv.x)%2)?uv.x=Math.ceil(uv.x)-uv.x:uv.x=uv.x-Math.floor(uv.x)}if(uv.y<0||uv.y>1)switch(this.wrapT){case RepeatWrapping:uv.y=uv.y-Math.floor(uv.y);break;case ClampToEdgeWrapping:uv.y=uv.y<0?0:1;break;case MirroredRepeatWrapping:1===Math.abs(Math.floor(uv.y)%2)?uv.y=Math.ceil(uv.y)-uv.y:uv.y=uv.y-Math.floor(uv.y)}return this.flipY&&(uv.y=1-uv.y),uv}set needsUpdate(value){!0===value&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(value){!0===value&&this.pmremVersion++}}Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=UVMapping,Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(x=0,y=0,z=0,w=1){Vector4.prototype.isVector4=!0,this.x=x,this.y=y,this.z=z,this.w=w}get width(){return this.z}set width(value){this.z=value}get height(){return this.w}set height(value){this.w=value}set(x,y,z,w){return this.x=x,this.y=y,this.z=z,this.w=w,this}setScalar(scalar){return this.x=scalar,this.y=scalar,this.z=scalar,this.w=scalar,this}setX(x){return this.x=x,this}setY(y){return this.y=y,this}setZ(z){return this.z=z,this}setW(w){return this.w=w,this}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;case 3:this.w=value;break;default:throw new Error("index is out of range: "+index)}return this}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+index)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(v){return this.x=v.x,this.y=v.y,this.z=v.z,this.w=void 0!==v.w?v.w:1,this}add(v){return this.x+=v.x,this.y+=v.y,this.z+=v.z,this.w+=v.w,this}addScalar(s){return this.x+=s,this.y+=s,this.z+=s,this.w+=s,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this}addScaledVector(v,s){return this.x+=v.x*s,this.y+=v.y*s,this.z+=v.z*s,this.w+=v.w*s,this}sub(v){return this.x-=v.x,this.y-=v.y,this.z-=v.z,this.w-=v.w,this}subScalar(s){return this.x-=s,this.y-=s,this.z-=s,this.w-=s,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this}multiply(v){return this.x*=v.x,this.y*=v.y,this.z*=v.z,this.w*=v.w,this}multiplyScalar(scalar){return this.x*=scalar,this.y*=scalar,this.z*=scalar,this.w*=scalar,this}applyMatrix4(m){const x=this.x,y=this.y,z=this.z,w=this.w,e=m.elements;return this.x=e[0]*x+e[4]*y+e[8]*z+e[12]*w,this.y=e[1]*x+e[5]*y+e[9]*z+e[13]*w,this.z=e[2]*x+e[6]*y+e[10]*z+e[14]*w,this.w=e[3]*x+e[7]*y+e[11]*z+e[15]*w,this}divideScalar(scalar){return this.multiplyScalar(1/scalar)}setAxisAngleFromQuaternion(q){this.w=2*Math.acos(q.w);const s=Math.sqrt(1-q.w*q.w);return s<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=q.x/s,this.y=q.y/s,this.z=q.z/s),this}setAxisAngleFromRotationMatrix(m){let angle,x,y,z;const te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10];if(Math.abs(m12-m21)<.01&&Math.abs(m13-m31)<.01&&Math.abs(m23-m32)<.01){if(Math.abs(m12+m21)<.1&&Math.abs(m13+m31)<.1&&Math.abs(m23+m32)<.1&&Math.abs(m11+m22+m33-3)<.1)return this.set(1,0,0,0),this;angle=Math.PI;const xx=(m11+1)/2,yy=(m22+1)/2,zz=(m33+1)/2,xy=(m12+m21)/4,xz=(m13+m31)/4,yz=(m23+m32)/4;return xx>yy&&xx>zz?xx<.01?(x=0,y=.707106781,z=.707106781):(x=Math.sqrt(xx),y=xy/x,z=xz/x):yy>zz?yy<.01?(x=.707106781,y=0,z=.707106781):(y=Math.sqrt(yy),x=xy/y,z=yz/y):zz<.01?(x=.707106781,y=.707106781,z=0):(z=Math.sqrt(zz),x=xz/z,y=yz/z),this.set(x,y,z,angle),this}let s=Math.sqrt((m32-m23)*(m32-m23)+(m13-m31)*(m13-m31)+(m21-m12)*(m21-m12));return Math.abs(s)<.001&&(s=1),this.x=(m32-m23)/s,this.y=(m13-m31)/s,this.z=(m21-m12)/s,this.w=Math.acos((m11+m22+m33-1)/2),this}setFromMatrixPosition(m){const e=m.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this.z=Math.min(this.z,v.z),this.w=Math.min(this.w,v.w),this}max(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this.z=Math.max(this.z,v.z),this.w=Math.max(this.w,v.w),this}clamp(min,max){return this.x=Math.max(min.x,Math.min(max.x,this.x)),this.y=Math.max(min.y,Math.min(max.y,this.y)),this.z=Math.max(min.z,Math.min(max.z,this.z)),this.w=Math.max(min.w,Math.min(max.w,this.w)),this}clampScalar(minVal,maxVal){return this.x=Math.max(minVal,Math.min(maxVal,this.x)),this.y=Math.max(minVal,Math.min(maxVal,this.y)),this.z=Math.max(minVal,Math.min(maxVal,this.z)),this.w=Math.max(minVal,Math.min(maxVal,this.w)),this}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)))}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(v){return this.x*v.x+this.y*v.y+this.z*v.z+this.w*v.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(length){return this.normalize().multiplyScalar(length)}lerp(v,alpha){return this.x+=(v.x-this.x)*alpha,this.y+=(v.y-this.y)*alpha,this.z+=(v.z-this.z)*alpha,this.w+=(v.w-this.w)*alpha,this}lerpVectors(v1,v2,alpha){return this.x=v1.x+(v2.x-v1.x)*alpha,this.y=v1.y+(v2.y-v1.y)*alpha,this.z=v1.z+(v2.z-v1.z)*alpha,this.w=v1.w+(v2.w-v1.w)*alpha,this}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z&&v.w===this.w}fromArray(array,offset=0){return this.x=array[offset],this.y=array[offset+1],this.z=array[offset+2],this.w=array[offset+3],this}toArray(array=[],offset=0){return array[offset]=this.x,array[offset+1]=this.y,array[offset+2]=this.z,array[offset+3]=this.w,array}fromBufferAttribute(attribute,index){return this.x=attribute.getX(index),this.y=attribute.getY(index),this.z=attribute.getZ(index),this.w=attribute.getW(index),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class RenderTarget extends EventDispatcher{constructor(width=1,height=1,options={}){super(),this.isRenderTarget=!0,this.width=width,this.height=height,this.depth=1,this.scissor=new Vector4(0,0,width,height),this.scissorTest=!1,this.viewport=new Vector4(0,0,width,height);const image={width:width,height:height,depth:1};options=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:LinearFilter,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},options);const texture=new Texture(image,options.mapping,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.colorSpace);texture.flipY=!1,texture.generateMipmaps=options.generateMipmaps,texture.internalFormat=options.internalFormat,this.textures=[];const count=options.count;for(let i=0;i=0?1:-1,sqrSin=1-cos*cos;if(sqrSin>Number.EPSILON){const sin=Math.sqrt(sqrSin),len=Math.atan2(sin,cos*dir);s=Math.sin(s*len)/sin,t=Math.sin(t*len)/sin}const tDir=t*dir;if(x0=x0*s+x1*tDir,y0=y0*s+y1*tDir,z0=z0*s+z1*tDir,w0=w0*s+w1*tDir,s===1-t){const f=1/Math.sqrt(x0*x0+y0*y0+z0*z0+w0*w0);x0*=f,y0*=f,z0*=f,w0*=f}}dst[dstOffset]=x0,dst[dstOffset+1]=y0,dst[dstOffset+2]=z0,dst[dstOffset+3]=w0}static multiplyQuaternionsFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1){const x0=src0[srcOffset0],y0=src0[srcOffset0+1],z0=src0[srcOffset0+2],w0=src0[srcOffset0+3],x1=src1[srcOffset1],y1=src1[srcOffset1+1],z1=src1[srcOffset1+2],w1=src1[srcOffset1+3];return dst[dstOffset]=x0*w1+w0*x1+y0*z1-z0*y1,dst[dstOffset+1]=y0*w1+w0*y1+z0*x1-x0*z1,dst[dstOffset+2]=z0*w1+w0*z1+x0*y1-y0*x1,dst[dstOffset+3]=w0*w1-x0*x1-y0*y1-z0*z1,dst}get x(){return this._x}set x(value){this._x=value,this._onChangeCallback()}get y(){return this._y}set y(value){this._y=value,this._onChangeCallback()}get z(){return this._z}set z(value){this._z=value,this._onChangeCallback()}get w(){return this._w}set w(value){this._w=value,this._onChangeCallback()}set(x,y,z,w){return this._x=x,this._y=y,this._z=z,this._w=w,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(quaternion){return this._x=quaternion.x,this._y=quaternion.y,this._z=quaternion.z,this._w=quaternion.w,this._onChangeCallback(),this}setFromEuler(euler,update=!0){const x=euler._x,y=euler._y,z=euler._z,order=euler._order,cos=Math.cos,sin=Math.sin,c1=cos(x/2),c2=cos(y/2),c3=cos(z/2),s1=sin(x/2),s2=sin(y/2),s3=sin(z/2);switch(order){case"XYZ":this._x=s1*c2*c3+c1*s2*s3,this._y=c1*s2*c3-s1*c2*s3,this._z=c1*c2*s3+s1*s2*c3,this._w=c1*c2*c3-s1*s2*s3;break;case"YXZ":this._x=s1*c2*c3+c1*s2*s3,this._y=c1*s2*c3-s1*c2*s3,this._z=c1*c2*s3-s1*s2*c3,this._w=c1*c2*c3+s1*s2*s3;break;case"ZXY":this._x=s1*c2*c3-c1*s2*s3,this._y=c1*s2*c3+s1*c2*s3,this._z=c1*c2*s3+s1*s2*c3,this._w=c1*c2*c3-s1*s2*s3;break;case"ZYX":this._x=s1*c2*c3-c1*s2*s3,this._y=c1*s2*c3+s1*c2*s3,this._z=c1*c2*s3-s1*s2*c3,this._w=c1*c2*c3+s1*s2*s3;break;case"YZX":this._x=s1*c2*c3+c1*s2*s3,this._y=c1*s2*c3+s1*c2*s3,this._z=c1*c2*s3-s1*s2*c3,this._w=c1*c2*c3-s1*s2*s3;break;case"XZY":this._x=s1*c2*c3-c1*s2*s3,this._y=c1*s2*c3-s1*c2*s3,this._z=c1*c2*s3+s1*s2*c3,this._w=c1*c2*c3+s1*s2*s3;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+order)}return!0===update&&this._onChangeCallback(),this}setFromAxisAngle(axis,angle){const halfAngle=angle/2,s=Math.sin(halfAngle);return this._x=axis.x*s,this._y=axis.y*s,this._z=axis.z*s,this._w=Math.cos(halfAngle),this._onChangeCallback(),this}setFromRotationMatrix(m){const te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10],trace=m11+m22+m33;if(trace>0){const s=.5/Math.sqrt(trace+1);this._w=.25/s,this._x=(m32-m23)*s,this._y=(m13-m31)*s,this._z=(m21-m12)*s}else if(m11>m22&&m11>m33){const s=2*Math.sqrt(1+m11-m22-m33);this._w=(m32-m23)/s,this._x=.25*s,this._y=(m12+m21)/s,this._z=(m13+m31)/s}else if(m22>m33){const s=2*Math.sqrt(1+m22-m11-m33);this._w=(m13-m31)/s,this._x=(m12+m21)/s,this._y=.25*s,this._z=(m23+m32)/s}else{const s=2*Math.sqrt(1+m33-m11-m22);this._w=(m21-m12)/s,this._x=(m13+m31)/s,this._y=(m23+m32)/s,this._z=.25*s}return this._onChangeCallback(),this}setFromUnitVectors(vFrom,vTo){let r=vFrom.dot(vTo)+1;return rMath.abs(vFrom.z)?(this._x=-vFrom.y,this._y=vFrom.x,this._z=0,this._w=r):(this._x=0,this._y=-vFrom.z,this._z=vFrom.y,this._w=r)):(this._x=vFrom.y*vTo.z-vFrom.z*vTo.y,this._y=vFrom.z*vTo.x-vFrom.x*vTo.z,this._z=vFrom.x*vTo.y-vFrom.y*vTo.x,this._w=r),this.normalize()}angleTo(q){return 2*Math.acos(Math.abs(clamp(this.dot(q),-1,1)))}rotateTowards(q,step){const angle=this.angleTo(q);if(0===angle)return this;const t=Math.min(1,step/angle);return this.slerp(q,t),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(v){return this._x*v._x+this._y*v._y+this._z*v._z+this._w*v._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 l=this.length();return 0===l?(this._x=0,this._y=0,this._z=0,this._w=1):(l=1/l,this._x=this._x*l,this._y=this._y*l,this._z=this._z*l,this._w=this._w*l),this._onChangeCallback(),this}multiply(q){return this.multiplyQuaternions(this,q)}premultiply(q){return this.multiplyQuaternions(q,this)}multiplyQuaternions(a,b){const qax=a._x,qay=a._y,qaz=a._z,qaw=a._w,qbx=b._x,qby=b._y,qbz=b._z,qbw=b._w;return this._x=qax*qbw+qaw*qbx+qay*qbz-qaz*qby,this._y=qay*qbw+qaw*qby+qaz*qbx-qax*qbz,this._z=qaz*qbw+qaw*qbz+qax*qby-qay*qbx,this._w=qaw*qbw-qax*qbx-qay*qby-qaz*qbz,this._onChangeCallback(),this}slerp(qb,t){if(0===t)return this;if(1===t)return this.copy(qb);const x=this._x,y=this._y,z=this._z,w=this._w;let cosHalfTheta=w*qb._w+x*qb._x+y*qb._y+z*qb._z;if(cosHalfTheta<0?(this._w=-qb._w,this._x=-qb._x,this._y=-qb._y,this._z=-qb._z,cosHalfTheta=-cosHalfTheta):this.copy(qb),cosHalfTheta>=1)return this._w=w,this._x=x,this._y=y,this._z=z,this;const sqrSinHalfTheta=1-cosHalfTheta*cosHalfTheta;if(sqrSinHalfTheta<=Number.EPSILON){const s=1-t;return this._w=s*w+t*this._w,this._x=s*x+t*this._x,this._y=s*y+t*this._y,this._z=s*z+t*this._z,this.normalize(),this}const sinHalfTheta=Math.sqrt(sqrSinHalfTheta),halfTheta=Math.atan2(sinHalfTheta,cosHalfTheta),ratioA=Math.sin((1-t)*halfTheta)/sinHalfTheta,ratioB=Math.sin(t*halfTheta)/sinHalfTheta;return this._w=w*ratioA+this._w*ratioB,this._x=x*ratioA+this._x*ratioB,this._y=y*ratioA+this._y*ratioB,this._z=z*ratioA+this._z*ratioB,this._onChangeCallback(),this}slerpQuaternions(qa,qb,t){return this.copy(qa).slerp(qb,t)}random(){const theta1=2*Math.PI*Math.random(),theta2=2*Math.PI*Math.random(),x0=Math.random(),r1=Math.sqrt(1-x0),r2=Math.sqrt(x0);return this.set(r1*Math.sin(theta1),r1*Math.cos(theta1),r2*Math.sin(theta2),r2*Math.cos(theta2))}equals(quaternion){return quaternion._x===this._x&&quaternion._y===this._y&&quaternion._z===this._z&&quaternion._w===this._w}fromArray(array,offset=0){return this._x=array[offset],this._y=array[offset+1],this._z=array[offset+2],this._w=array[offset+3],this._onChangeCallback(),this}toArray(array=[],offset=0){return array[offset]=this._x,array[offset+1]=this._y,array[offset+2]=this._z,array[offset+3]=this._w,array}fromBufferAttribute(attribute,index){return this._x=attribute.getX(index),this._y=attribute.getY(index),this._z=attribute.getZ(index),this._w=attribute.getW(index),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(callback){return this._onChangeCallback=callback,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(x=0,y=0,z=0){Vector3.prototype.isVector3=!0,this.x=x,this.y=y,this.z=z}set(x,y,z){return void 0===z&&(z=this.z),this.x=x,this.y=y,this.z=z,this}setScalar(scalar){return this.x=scalar,this.y=scalar,this.z=scalar,this}setX(x){return this.x=x,this}setY(y){return this.y=y,this}setZ(z){return this.z=z,this}setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;default:throw new Error("index is out of range: "+index)}return this}getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+index)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(v){return this.x=v.x,this.y=v.y,this.z=v.z,this}add(v){return this.x+=v.x,this.y+=v.y,this.z+=v.z,this}addScalar(s){return this.x+=s,this.y+=s,this.z+=s,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this}addScaledVector(v,s){return this.x+=v.x*s,this.y+=v.y*s,this.z+=v.z*s,this}sub(v){return this.x-=v.x,this.y-=v.y,this.z-=v.z,this}subScalar(s){return this.x-=s,this.y-=s,this.z-=s,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this}multiply(v){return this.x*=v.x,this.y*=v.y,this.z*=v.z,this}multiplyScalar(scalar){return this.x*=scalar,this.y*=scalar,this.z*=scalar,this}multiplyVectors(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this}applyEuler(euler){return this.applyQuaternion(_quaternion$4.setFromEuler(euler))}applyAxisAngle(axis,angle){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis,angle))}applyMatrix3(m){const x=this.x,y=this.y,z=this.z,e=m.elements;return this.x=e[0]*x+e[3]*y+e[6]*z,this.y=e[1]*x+e[4]*y+e[7]*z,this.z=e[2]*x+e[5]*y+e[8]*z,this}applyNormalMatrix(m){return this.applyMatrix3(m).normalize()}applyMatrix4(m){const x=this.x,y=this.y,z=this.z,e=m.elements,w=1/(e[3]*x+e[7]*y+e[11]*z+e[15]);return this.x=(e[0]*x+e[4]*y+e[8]*z+e[12])*w,this.y=(e[1]*x+e[5]*y+e[9]*z+e[13])*w,this.z=(e[2]*x+e[6]*y+e[10]*z+e[14])*w,this}applyQuaternion(q){const vx=this.x,vy=this.y,vz=this.z,qx=q.x,qy=q.y,qz=q.z,qw=q.w,tx=2*(qy*vz-qz*vy),ty=2*(qz*vx-qx*vz),tz=2*(qx*vy-qy*vx);return this.x=vx+qw*tx+qy*tz-qz*ty,this.y=vy+qw*ty+qz*tx-qx*tz,this.z=vz+qw*tz+qx*ty-qy*tx,this}project(camera){return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix)}unproject(camera){return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld)}transformDirection(m){const x=this.x,y=this.y,z=this.z,e=m.elements;return this.x=e[0]*x+e[4]*y+e[8]*z,this.y=e[1]*x+e[5]*y+e[9]*z,this.z=e[2]*x+e[6]*y+e[10]*z,this.normalize()}divide(v){return this.x/=v.x,this.y/=v.y,this.z/=v.z,this}divideScalar(scalar){return this.multiplyScalar(1/scalar)}min(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this.z=Math.min(this.z,v.z),this}max(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this.z=Math.max(this.z,v.z),this}clamp(min,max){return this.x=Math.max(min.x,Math.min(max.x,this.x)),this.y=Math.max(min.y,Math.min(max.y,this.y)),this.z=Math.max(min.z,Math.min(max.z,this.z)),this}clampScalar(minVal,maxVal){return this.x=Math.max(minVal,Math.min(maxVal,this.x)),this.y=Math.max(minVal,Math.min(maxVal,this.y)),this.z=Math.max(minVal,Math.min(maxVal,this.z)),this}clampLength(min,max){const length=this.length();return this.divideScalar(length||1).multiplyScalar(Math.max(min,Math.min(max,length)))}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(v){return this.x*v.x+this.y*v.y+this.z*v.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(length){return this.normalize().multiplyScalar(length)}lerp(v,alpha){return this.x+=(v.x-this.x)*alpha,this.y+=(v.y-this.y)*alpha,this.z+=(v.z-this.z)*alpha,this}lerpVectors(v1,v2,alpha){return this.x=v1.x+(v2.x-v1.x)*alpha,this.y=v1.y+(v2.y-v1.y)*alpha,this.z=v1.z+(v2.z-v1.z)*alpha,this}cross(v){return this.crossVectors(this,v)}crossVectors(a,b){const ax=a.x,ay=a.y,az=a.z,bx=b.x,by=b.y,bz=b.z;return this.x=ay*bz-az*by,this.y=az*bx-ax*bz,this.z=ax*by-ay*bx,this}projectOnVector(v){const denominator=v.lengthSq();if(0===denominator)return this.set(0,0,0);const scalar=v.dot(this)/denominator;return this.copy(v).multiplyScalar(scalar)}projectOnPlane(planeNormal){return _vector$c.copy(this).projectOnVector(planeNormal),this.sub(_vector$c)}reflect(normal){return this.sub(_vector$c.copy(normal).multiplyScalar(2*this.dot(normal)))}angleTo(v){const denominator=Math.sqrt(this.lengthSq()*v.lengthSq());if(0===denominator)return Math.PI/2;const theta=this.dot(v)/denominator;return Math.acos(clamp(theta,-1,1))}distanceTo(v){return Math.sqrt(this.distanceToSquared(v))}distanceToSquared(v){const dx=this.x-v.x,dy=this.y-v.y,dz=this.z-v.z;return dx*dx+dy*dy+dz*dz}manhattanDistanceTo(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)+Math.abs(this.z-v.z)}setFromSpherical(s){return this.setFromSphericalCoords(s.radius,s.phi,s.theta)}setFromSphericalCoords(radius,phi,theta){const sinPhiRadius=Math.sin(phi)*radius;return this.x=sinPhiRadius*Math.sin(theta),this.y=Math.cos(phi)*radius,this.z=sinPhiRadius*Math.cos(theta),this}setFromCylindrical(c){return this.setFromCylindricalCoords(c.radius,c.theta,c.y)}setFromCylindricalCoords(radius,theta,y){return this.x=radius*Math.sin(theta),this.y=y,this.z=radius*Math.cos(theta),this}setFromMatrixPosition(m){const e=m.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(m){const sx=this.setFromMatrixColumn(m,0).length(),sy=this.setFromMatrixColumn(m,1).length(),sz=this.setFromMatrixColumn(m,2).length();return this.x=sx,this.y=sy,this.z=sz,this}setFromMatrixColumn(m,index){return this.fromArray(m.elements,4*index)}setFromMatrix3Column(m,index){return this.fromArray(m.elements,3*index)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(c){return this.x=c.r,this.y=c.g,this.z=c.b,this}equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z}fromArray(array,offset=0){return this.x=array[offset],this.y=array[offset+1],this.z=array[offset+2],this}toArray(array=[],offset=0){return array[offset]=this.x,array[offset+1]=this.y,array[offset+2]=this.z,array}fromBufferAttribute(attribute,index){return this.x=attribute.getX(index),this.y=attribute.getY(index),this.z=attribute.getZ(index),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const theta=Math.random()*Math.PI*2,u=2*Math.random()-1,c=Math.sqrt(1-u*u);return this.x=c*Math.cos(theta),this.y=u,this.z=c*Math.sin(theta),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _vector$c=new Vector3,_quaternion$4=new Quaternion;class Box3{constructor(min=new Vector3(1/0,1/0,1/0),max=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=min,this.max=max}set(min,max){return this.min.copy(min),this.max.copy(max),this}setFromArray(array){this.makeEmpty();for(let i=0,il=array.length;ithis.max.x||point.ythis.max.y||point.zthis.max.z)}containsBox(box){return this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y&&this.min.z<=box.min.z&&box.max.z<=this.max.z}getParameter(point,target){return target.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y),(point.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(box){return!(box.max.xthis.max.x||box.max.ythis.max.y||box.max.zthis.max.z)}intersectsSphere(sphere){return this.clampPoint(sphere.center,_vector$b),_vector$b.distanceToSquared(sphere.center)<=sphere.radius*sphere.radius}intersectsPlane(plane){let min,max;return plane.normal.x>0?(min=plane.normal.x*this.min.x,max=plane.normal.x*this.max.x):(min=plane.normal.x*this.max.x,max=plane.normal.x*this.min.x),plane.normal.y>0?(min+=plane.normal.y*this.min.y,max+=plane.normal.y*this.max.y):(min+=plane.normal.y*this.max.y,max+=plane.normal.y*this.min.y),plane.normal.z>0?(min+=plane.normal.z*this.min.z,max+=plane.normal.z*this.max.z):(min+=plane.normal.z*this.max.z,max+=plane.normal.z*this.min.z),min<=-plane.constant&&max>=-plane.constant}intersectsTriangle(triangle){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(triangle.a,_center),_v1$7.subVectors(triangle.b,_center),_v2$4.subVectors(triangle.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$4,_v1$7),_f2.subVectors(_v0$2,_v2$4);let axes=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!!satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)&&(axes=[1,0,0,0,1,0,0,0,1],!!satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)&&(_triangleNormal.crossVectors(_f0,_f1),axes=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(axes,_v0$2,_v1$7,_v2$4,_extents)))}clampPoint(point,target){return target.copy(point).clamp(this.min,this.max)}distanceToPoint(point){return this.clampPoint(point,_vector$b).distanceTo(point)}getBoundingSphere(target){return this.isEmpty()?target.makeEmpty():(this.getCenter(target.center),target.radius=.5*this.getSize(_vector$b).length()),target}intersect(box){return this.min.max(box.min),this.max.min(box.max),this.isEmpty()&&this.makeEmpty(),this}union(box){return this.min.min(box.min),this.max.max(box.max),this}applyMatrix4(matrix){return this.isEmpty()||(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(matrix),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(matrix),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(matrix),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(matrix),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(matrix),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(matrix),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(matrix),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(matrix),this.setFromPoints(_points)),this}translate(offset){return this.min.add(offset),this.max.add(offset),this}equals(box){return box.min.equals(this.min)&&box.max.equals(this.max)}}const _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$b=new Vector3,_box$4=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$4=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(axes,v0,v1,v2,extents){for(let i=0,j=axes.length-3;i<=j;i+=3){_testAxis.fromArray(axes,i);const r=extents.x*Math.abs(_testAxis.x)+extents.y*Math.abs(_testAxis.y)+extents.z*Math.abs(_testAxis.z),p0=v0.dot(_testAxis),p1=v1.dot(_testAxis),p2=v2.dot(_testAxis);if(Math.max(-Math.max(p0,p1,p2),Math.min(p0,p1,p2))>r)return!1}return!0}const _box$3=new Box3,_v1$6=new Vector3,_v2$3=new Vector3;class Sphere{constructor(center=new Vector3,radius=-1){this.isSphere=!0,this.center=center,this.radius=radius}set(center,radius){return this.center.copy(center),this.radius=radius,this}setFromPoints(points,optionalCenter){const center=this.center;void 0!==optionalCenter?center.copy(optionalCenter):_box$3.setFromPoints(points).getCenter(center);let maxRadiusSq=0;for(let i=0,il=points.length;ithis.radius*this.radius&&(target.sub(this.center).normalize(),target.multiplyScalar(this.radius).add(this.center)),target}getBoundingBox(target){return this.isEmpty()?(target.makeEmpty(),target):(target.set(this.center,this.center),target.expandByScalar(this.radius),target)}applyMatrix4(matrix){return this.center.applyMatrix4(matrix),this.radius=this.radius*matrix.getMaxScaleOnAxis(),this}translate(offset){return this.center.add(offset),this}expandByPoint(point){if(this.isEmpty())return this.center.copy(point),this.radius=0,this;_v1$6.subVectors(point,this.center);const lengthSq=_v1$6.lengthSq();if(lengthSq>this.radius*this.radius){const length=Math.sqrt(lengthSq),delta=.5*(length-this.radius);this.center.addScaledVector(_v1$6,delta/length),this.radius+=delta}return this}union(sphere){return sphere.isEmpty()?this:this.isEmpty()?(this.copy(sphere),this):(!0===this.center.equals(sphere.center)?this.radius=Math.max(this.radius,sphere.radius):(_v2$3.subVectors(sphere.center,this.center).setLength(sphere.radius),this.expandByPoint(_v1$6.copy(sphere.center).add(_v2$3)),this.expandByPoint(_v1$6.copy(sphere.center).sub(_v2$3))),this)}equals(sphere){return sphere.center.equals(this.center)&&sphere.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const _vector$a=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3;class Ray{constructor(origin=new Vector3,direction=new Vector3(0,0,-1)){this.origin=origin,this.direction=direction}set(origin,direction){return this.origin.copy(origin),this.direction.copy(direction),this}copy(ray){return this.origin.copy(ray.origin),this.direction.copy(ray.direction),this}at(t,target){return target.copy(this.origin).addScaledVector(this.direction,t)}lookAt(v){return this.direction.copy(v).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,_vector$a)),this}closestPointToPoint(point,target){target.subVectors(point,this.origin);const directionDistance=target.dot(this.direction);return directionDistance<0?target.copy(this.origin):target.copy(this.origin).addScaledVector(this.direction,directionDistance)}distanceToPoint(point){return Math.sqrt(this.distanceSqToPoint(point))}distanceSqToPoint(point){const directionDistance=_vector$a.subVectors(point,this.origin).dot(this.direction);return directionDistance<0?this.origin.distanceToSquared(point):(_vector$a.copy(this.origin).addScaledVector(this.direction,directionDistance),_vector$a.distanceToSquared(point))}distanceSqToSegment(v0,v1,optionalPointOnRay,optionalPointOnSegment){_segCenter.copy(v0).add(v1).multiplyScalar(.5),_segDir.copy(v1).sub(v0).normalize(),_diff.copy(this.origin).sub(_segCenter);const segExtent=.5*v0.distanceTo(v1),a01=-this.direction.dot(_segDir),b0=_diff.dot(this.direction),b1=-_diff.dot(_segDir),c=_diff.lengthSq(),det=Math.abs(1-a01*a01);let s0,s1,sqrDist,extDet;if(det>0)if(s0=a01*b1-b0,s1=a01*b0-b1,extDet=segExtent*det,s0>=0)if(s1>=-extDet)if(s1<=extDet){const invDet=1/det;s0*=invDet,s1*=invDet,sqrDist=s0*(s0+a01*s1+2*b0)+s1*(a01*s0+s1+2*b1)+c}else s1=segExtent,s0=Math.max(0,-(a01*s1+b0)),sqrDist=-s0*s0+s1*(s1+2*b1)+c;else s1=-segExtent,s0=Math.max(0,-(a01*s1+b0)),sqrDist=-s0*s0+s1*(s1+2*b1)+c;else s1<=-extDet?(s0=Math.max(0,-(-a01*segExtent+b0)),s1=s0>0?-segExtent:Math.min(Math.max(-segExtent,-b1),segExtent),sqrDist=-s0*s0+s1*(s1+2*b1)+c):s1<=extDet?(s0=0,s1=Math.min(Math.max(-segExtent,-b1),segExtent),sqrDist=s1*(s1+2*b1)+c):(s0=Math.max(0,-(a01*segExtent+b0)),s1=s0>0?segExtent:Math.min(Math.max(-segExtent,-b1),segExtent),sqrDist=-s0*s0+s1*(s1+2*b1)+c);else s1=a01>0?-segExtent:segExtent,s0=Math.max(0,-(a01*s1+b0)),sqrDist=-s0*s0+s1*(s1+2*b1)+c;return optionalPointOnRay&&optionalPointOnRay.copy(this.origin).addScaledVector(this.direction,s0),optionalPointOnSegment&&optionalPointOnSegment.copy(_segCenter).addScaledVector(_segDir,s1),sqrDist}intersectSphere(sphere,target){_vector$a.subVectors(sphere.center,this.origin);const tca=_vector$a.dot(this.direction),d2=_vector$a.dot(_vector$a)-tca*tca,radius2=sphere.radius*sphere.radius;if(d2>radius2)return null;const thc=Math.sqrt(radius2-d2),t0=tca-thc,t1=tca+thc;return t1<0?null:t0<0?this.at(t1,target):this.at(t0,target)}intersectsSphere(sphere){return this.distanceSqToPoint(sphere.center)<=sphere.radius*sphere.radius}distanceToPlane(plane){const denominator=plane.normal.dot(this.direction);if(0===denominator)return 0===plane.distanceToPoint(this.origin)?0:null;const t=-(this.origin.dot(plane.normal)+plane.constant)/denominator;return t>=0?t:null}intersectPlane(plane,target){const t=this.distanceToPlane(plane);return null===t?null:this.at(t,target)}intersectsPlane(plane){const distToPoint=plane.distanceToPoint(this.origin);if(0===distToPoint)return!0;return plane.normal.dot(this.direction)*distToPoint<0}intersectBox(box,target){let tmin,tmax,tymin,tymax,tzmin,tzmax;const invdirx=1/this.direction.x,invdiry=1/this.direction.y,invdirz=1/this.direction.z,origin=this.origin;return invdirx>=0?(tmin=(box.min.x-origin.x)*invdirx,tmax=(box.max.x-origin.x)*invdirx):(tmin=(box.max.x-origin.x)*invdirx,tmax=(box.min.x-origin.x)*invdirx),invdiry>=0?(tymin=(box.min.y-origin.y)*invdiry,tymax=(box.max.y-origin.y)*invdiry):(tymin=(box.max.y-origin.y)*invdiry,tymax=(box.min.y-origin.y)*invdiry),tmin>tymax||tymin>tmax?null:((tymin>tmin||isNaN(tmin))&&(tmin=tymin),(tymax=0?(tzmin=(box.min.z-origin.z)*invdirz,tzmax=(box.max.z-origin.z)*invdirz):(tzmin=(box.max.z-origin.z)*invdirz,tzmax=(box.min.z-origin.z)*invdirz),tmin>tzmax||tzmin>tmax?null:((tzmin>tmin||tmin!=tmin)&&(tmin=tzmin),(tzmax=0?tmin:tmax,target)))}intersectsBox(box){return null!==this.intersectBox(box,_vector$a)}intersectTriangle(a,b,c,backfaceCulling,target){_edge1.subVectors(b,a),_edge2.subVectors(c,a),_normal$1.crossVectors(_edge1,_edge2);let sign,DdN=this.direction.dot(_normal$1);if(DdN>0){if(backfaceCulling)return null;sign=1}else{if(!(DdN<0))return null;sign=-1,DdN=-DdN}_diff.subVectors(this.origin,a);const DdQxE2=sign*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(DdQxE2<0)return null;const DdE1xQ=sign*this.direction.dot(_edge1.cross(_diff));if(DdE1xQ<0)return null;if(DdQxE2+DdE1xQ>DdN)return null;const QdN=-sign*_diff.dot(_normal$1);return QdN<0?null:this.at(QdN/DdN,target)}applyMatrix4(matrix4){return this.origin.applyMatrix4(matrix4),this.direction.transformDirection(matrix4),this}equals(ray){return ray.origin.equals(this.origin)&&ray.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==n11&&this.set(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44)}set(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44){const te=this.elements;return te[0]=n11,te[4]=n12,te[8]=n13,te[12]=n14,te[1]=n21,te[5]=n22,te[9]=n23,te[13]=n24,te[2]=n31,te[6]=n32,te[10]=n33,te[14]=n34,te[3]=n41,te[7]=n42,te[11]=n43,te[15]=n44,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 Matrix4).fromArray(this.elements)}copy(m){const te=this.elements,me=m.elements;return te[0]=me[0],te[1]=me[1],te[2]=me[2],te[3]=me[3],te[4]=me[4],te[5]=me[5],te[6]=me[6],te[7]=me[7],te[8]=me[8],te[9]=me[9],te[10]=me[10],te[11]=me[11],te[12]=me[12],te[13]=me[13],te[14]=me[14],te[15]=me[15],this}copyPosition(m){const te=this.elements,me=m.elements;return te[12]=me[12],te[13]=me[13],te[14]=me[14],this}setFromMatrix3(m){const me=m.elements;return this.set(me[0],me[3],me[6],0,me[1],me[4],me[7],0,me[2],me[5],me[8],0,0,0,0,1),this}extractBasis(xAxis,yAxis,zAxis){return xAxis.setFromMatrixColumn(this,0),yAxis.setFromMatrixColumn(this,1),zAxis.setFromMatrixColumn(this,2),this}makeBasis(xAxis,yAxis,zAxis){return this.set(xAxis.x,yAxis.x,zAxis.x,0,xAxis.y,yAxis.y,zAxis.y,0,xAxis.z,yAxis.z,zAxis.z,0,0,0,0,1),this}extractRotation(m){const te=this.elements,me=m.elements,scaleX=1/_v1$5.setFromMatrixColumn(m,0).length(),scaleY=1/_v1$5.setFromMatrixColumn(m,1).length(),scaleZ=1/_v1$5.setFromMatrixColumn(m,2).length();return te[0]=me[0]*scaleX,te[1]=me[1]*scaleX,te[2]=me[2]*scaleX,te[3]=0,te[4]=me[4]*scaleY,te[5]=me[5]*scaleY,te[6]=me[6]*scaleY,te[7]=0,te[8]=me[8]*scaleZ,te[9]=me[9]*scaleZ,te[10]=me[10]*scaleZ,te[11]=0,te[12]=0,te[13]=0,te[14]=0,te[15]=1,this}makeRotationFromEuler(euler){const te=this.elements,x=euler.x,y=euler.y,z=euler.z,a=Math.cos(x),b=Math.sin(x),c=Math.cos(y),d=Math.sin(y),e=Math.cos(z),f=Math.sin(z);if("XYZ"===euler.order){const ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e,te[4]=-c*f,te[8]=d,te[1]=af+be*d,te[5]=ae-bf*d,te[9]=-b*c,te[2]=bf-ae*d,te[6]=be+af*d,te[10]=a*c}else if("YXZ"===euler.order){const ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce+df*b,te[4]=de*b-cf,te[8]=a*d,te[1]=a*f,te[5]=a*e,te[9]=-b,te[2]=cf*b-de,te[6]=df+ce*b,te[10]=a*c}else if("ZXY"===euler.order){const ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce-df*b,te[4]=-a*f,te[8]=de+cf*b,te[1]=cf+de*b,te[5]=a*e,te[9]=df-ce*b,te[2]=-a*d,te[6]=b,te[10]=a*c}else if("ZYX"===euler.order){const ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e,te[4]=be*d-af,te[8]=ae*d+bf,te[1]=c*f,te[5]=bf*d+ae,te[9]=af*d-be,te[2]=-d,te[6]=b*c,te[10]=a*c}else if("YZX"===euler.order){const ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e,te[4]=bd-ac*f,te[8]=bc*f+ad,te[1]=f,te[5]=a*e,te[9]=-b*e,te[2]=-d*e,te[6]=ad*f+bc,te[10]=ac-bd*f}else if("XZY"===euler.order){const ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e,te[4]=-f,te[8]=d*e,te[1]=ac*f+bd,te[5]=a*e,te[9]=ad*f-bc,te[2]=bc*f-ad,te[6]=b*e,te[10]=bd*f+ac}return te[3]=0,te[7]=0,te[11]=0,te[12]=0,te[13]=0,te[14]=0,te[15]=1,this}makeRotationFromQuaternion(q){return this.compose(_zero,q,_one)}lookAt(eye,target,up){const te=this.elements;return _z.subVectors(eye,target),0===_z.lengthSq()&&(_z.z=1),_z.normalize(),_x.crossVectors(up,_z),0===_x.lengthSq()&&(1===Math.abs(up.z)?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(up,_z)),_x.normalize(),_y.crossVectors(_z,_x),te[0]=_x.x,te[4]=_y.x,te[8]=_z.x,te[1]=_x.y,te[5]=_y.y,te[9]=_z.y,te[2]=_x.z,te[6]=_y.z,te[10]=_z.z,this}multiply(m){return this.multiplyMatrices(this,m)}premultiply(m){return this.multiplyMatrices(m,this)}multiplyMatrices(a,b){const ae=a.elements,be=b.elements,te=this.elements,a11=ae[0],a12=ae[4],a13=ae[8],a14=ae[12],a21=ae[1],a22=ae[5],a23=ae[9],a24=ae[13],a31=ae[2],a32=ae[6],a33=ae[10],a34=ae[14],a41=ae[3],a42=ae[7],a43=ae[11],a44=ae[15],b11=be[0],b12=be[4],b13=be[8],b14=be[12],b21=be[1],b22=be[5],b23=be[9],b24=be[13],b31=be[2],b32=be[6],b33=be[10],b34=be[14],b41=be[3],b42=be[7],b43=be[11],b44=be[15];return te[0]=a11*b11+a12*b21+a13*b31+a14*b41,te[4]=a11*b12+a12*b22+a13*b32+a14*b42,te[8]=a11*b13+a12*b23+a13*b33+a14*b43,te[12]=a11*b14+a12*b24+a13*b34+a14*b44,te[1]=a21*b11+a22*b21+a23*b31+a24*b41,te[5]=a21*b12+a22*b22+a23*b32+a24*b42,te[9]=a21*b13+a22*b23+a23*b33+a24*b43,te[13]=a21*b14+a22*b24+a23*b34+a24*b44,te[2]=a31*b11+a32*b21+a33*b31+a34*b41,te[6]=a31*b12+a32*b22+a33*b32+a34*b42,te[10]=a31*b13+a32*b23+a33*b33+a34*b43,te[14]=a31*b14+a32*b24+a33*b34+a34*b44,te[3]=a41*b11+a42*b21+a43*b31+a44*b41,te[7]=a41*b12+a42*b22+a43*b32+a44*b42,te[11]=a41*b13+a42*b23+a43*b33+a44*b43,te[15]=a41*b14+a42*b24+a43*b34+a44*b44,this}multiplyScalar(s){const te=this.elements;return te[0]*=s,te[4]*=s,te[8]*=s,te[12]*=s,te[1]*=s,te[5]*=s,te[9]*=s,te[13]*=s,te[2]*=s,te[6]*=s,te[10]*=s,te[14]*=s,te[3]*=s,te[7]*=s,te[11]*=s,te[15]*=s,this}determinant(){const te=this.elements,n11=te[0],n12=te[4],n13=te[8],n14=te[12],n21=te[1],n22=te[5],n23=te[9],n24=te[13],n31=te[2],n32=te[6],n33=te[10],n34=te[14];return te[3]*(+n14*n23*n32-n13*n24*n32-n14*n22*n33+n12*n24*n33+n13*n22*n34-n12*n23*n34)+te[7]*(+n11*n23*n34-n11*n24*n33+n14*n21*n33-n13*n21*n34+n13*n24*n31-n14*n23*n31)+te[11]*(+n11*n24*n32-n11*n22*n34-n14*n21*n32+n12*n21*n34+n14*n22*n31-n12*n24*n31)+te[15]*(-n13*n22*n31-n11*n23*n32+n11*n22*n33+n13*n21*n32-n12*n21*n33+n12*n23*n31)}transpose(){const te=this.elements;let tmp;return tmp=te[1],te[1]=te[4],te[4]=tmp,tmp=te[2],te[2]=te[8],te[8]=tmp,tmp=te[6],te[6]=te[9],te[9]=tmp,tmp=te[3],te[3]=te[12],te[12]=tmp,tmp=te[7],te[7]=te[13],te[13]=tmp,tmp=te[11],te[11]=te[14],te[14]=tmp,this}setPosition(x,y,z){const te=this.elements;return x.isVector3?(te[12]=x.x,te[13]=x.y,te[14]=x.z):(te[12]=x,te[13]=y,te[14]=z),this}invert(){const te=this.elements,n11=te[0],n21=te[1],n31=te[2],n41=te[3],n12=te[4],n22=te[5],n32=te[6],n42=te[7],n13=te[8],n23=te[9],n33=te[10],n43=te[11],n14=te[12],n24=te[13],n34=te[14],n44=te[15],t11=n23*n34*n42-n24*n33*n42+n24*n32*n43-n22*n34*n43-n23*n32*n44+n22*n33*n44,t12=n14*n33*n42-n13*n34*n42-n14*n32*n43+n12*n34*n43+n13*n32*n44-n12*n33*n44,t13=n13*n24*n42-n14*n23*n42+n14*n22*n43-n12*n24*n43-n13*n22*n44+n12*n23*n44,t14=n14*n23*n32-n13*n24*n32-n14*n22*n33+n12*n24*n33+n13*n22*n34-n12*n23*n34,det=n11*t11+n21*t12+n31*t13+n41*t14;if(0===det)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const detInv=1/det;return te[0]=t11*detInv,te[1]=(n24*n33*n41-n23*n34*n41-n24*n31*n43+n21*n34*n43+n23*n31*n44-n21*n33*n44)*detInv,te[2]=(n22*n34*n41-n24*n32*n41+n24*n31*n42-n21*n34*n42-n22*n31*n44+n21*n32*n44)*detInv,te[3]=(n23*n32*n41-n22*n33*n41-n23*n31*n42+n21*n33*n42+n22*n31*n43-n21*n32*n43)*detInv,te[4]=t12*detInv,te[5]=(n13*n34*n41-n14*n33*n41+n14*n31*n43-n11*n34*n43-n13*n31*n44+n11*n33*n44)*detInv,te[6]=(n14*n32*n41-n12*n34*n41-n14*n31*n42+n11*n34*n42+n12*n31*n44-n11*n32*n44)*detInv,te[7]=(n12*n33*n41-n13*n32*n41+n13*n31*n42-n11*n33*n42-n12*n31*n43+n11*n32*n43)*detInv,te[8]=t13*detInv,te[9]=(n14*n23*n41-n13*n24*n41-n14*n21*n43+n11*n24*n43+n13*n21*n44-n11*n23*n44)*detInv,te[10]=(n12*n24*n41-n14*n22*n41+n14*n21*n42-n11*n24*n42-n12*n21*n44+n11*n22*n44)*detInv,te[11]=(n13*n22*n41-n12*n23*n41-n13*n21*n42+n11*n23*n42+n12*n21*n43-n11*n22*n43)*detInv,te[12]=t14*detInv,te[13]=(n13*n24*n31-n14*n23*n31+n14*n21*n33-n11*n24*n33-n13*n21*n34+n11*n23*n34)*detInv,te[14]=(n14*n22*n31-n12*n24*n31-n14*n21*n32+n11*n24*n32+n12*n21*n34-n11*n22*n34)*detInv,te[15]=(n12*n23*n31-n13*n22*n31+n13*n21*n32-n11*n23*n32-n12*n21*n33+n11*n22*n33)*detInv,this}scale(v){const te=this.elements,x=v.x,y=v.y,z=v.z;return te[0]*=x,te[4]*=y,te[8]*=z,te[1]*=x,te[5]*=y,te[9]*=z,te[2]*=x,te[6]*=y,te[10]*=z,te[3]*=x,te[7]*=y,te[11]*=z,this}getMaxScaleOnAxis(){const te=this.elements,scaleXSq=te[0]*te[0]+te[1]*te[1]+te[2]*te[2],scaleYSq=te[4]*te[4]+te[5]*te[5]+te[6]*te[6],scaleZSq=te[8]*te[8]+te[9]*te[9]+te[10]*te[10];return Math.sqrt(Math.max(scaleXSq,scaleYSq,scaleZSq))}makeTranslation(x,y,z){return x.isVector3?this.set(1,0,0,x.x,0,1,0,x.y,0,0,1,x.z,0,0,0,1):this.set(1,0,0,x,0,1,0,y,0,0,1,z,0,0,0,1),this}makeRotationX(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(1,0,0,0,0,c,-s,0,0,s,c,0,0,0,0,1),this}makeRotationY(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(c,0,s,0,0,1,0,0,-s,0,c,0,0,0,0,1),this}makeRotationZ(theta){const c=Math.cos(theta),s=Math.sin(theta);return this.set(c,-s,0,0,s,c,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(axis,angle){const c=Math.cos(angle),s=Math.sin(angle),t=1-c,x=axis.x,y=axis.y,z=axis.z,tx=t*x,ty=t*y;return this.set(tx*x+c,tx*y-s*z,tx*z+s*y,0,tx*y+s*z,ty*y+c,ty*z-s*x,0,tx*z-s*y,ty*z+s*x,t*z*z+c,0,0,0,0,1),this}makeScale(x,y,z){return this.set(x,0,0,0,0,y,0,0,0,0,z,0,0,0,0,1),this}makeShear(xy,xz,yx,yz,zx,zy){return this.set(1,yx,zx,0,xy,1,zy,0,xz,yz,1,0,0,0,0,1),this}compose(position,quaternion,scale){const te=this.elements,x=quaternion._x,y=quaternion._y,z=quaternion._z,w=quaternion._w,x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2,sx=scale.x,sy=scale.y,sz=scale.z;return te[0]=(1-(yy+zz))*sx,te[1]=(xy+wz)*sx,te[2]=(xz-wy)*sx,te[3]=0,te[4]=(xy-wz)*sy,te[5]=(1-(xx+zz))*sy,te[6]=(yz+wx)*sy,te[7]=0,te[8]=(xz+wy)*sz,te[9]=(yz-wx)*sz,te[10]=(1-(xx+yy))*sz,te[11]=0,te[12]=position.x,te[13]=position.y,te[14]=position.z,te[15]=1,this}decompose(position,quaternion,scale){const te=this.elements;let sx=_v1$5.set(te[0],te[1],te[2]).length();const sy=_v1$5.set(te[4],te[5],te[6]).length(),sz=_v1$5.set(te[8],te[9],te[10]).length();this.determinant()<0&&(sx=-sx),position.x=te[12],position.y=te[13],position.z=te[14],_m1$4.copy(this);const invSX=1/sx,invSY=1/sy,invSZ=1/sz;return _m1$4.elements[0]*=invSX,_m1$4.elements[1]*=invSX,_m1$4.elements[2]*=invSX,_m1$4.elements[4]*=invSY,_m1$4.elements[5]*=invSY,_m1$4.elements[6]*=invSY,_m1$4.elements[8]*=invSZ,_m1$4.elements[9]*=invSZ,_m1$4.elements[10]*=invSZ,quaternion.setFromRotationMatrix(_m1$4),scale.x=sx,scale.y=sy,scale.z=sz,this}makePerspective(left,right,top,bottom,near,far,coordinateSystem=WebGLCoordinateSystem){const te=this.elements,x=2*near/(right-left),y=2*near/(top-bottom),a=(right+left)/(right-left),b=(top+bottom)/(top-bottom);let c,d;if(coordinateSystem===WebGLCoordinateSystem)c=-(far+near)/(far-near),d=-2*far*near/(far-near);else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+coordinateSystem);c=-far/(far-near),d=-far*near/(far-near)}return te[0]=x,te[4]=0,te[8]=a,te[12]=0,te[1]=0,te[5]=y,te[9]=b,te[13]=0,te[2]=0,te[6]=0,te[10]=c,te[14]=d,te[3]=0,te[7]=0,te[11]=-1,te[15]=0,this}makeOrthographic(left,right,top,bottom,near,far,coordinateSystem=WebGLCoordinateSystem){const te=this.elements,w=1/(right-left),h=1/(top-bottom),p=1/(far-near),x=(right+left)*w,y=(top+bottom)*h;let z,zInv;if(coordinateSystem===WebGLCoordinateSystem)z=(far+near)*p,zInv=-2*p;else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+coordinateSystem);z=near*p,zInv=-1*p}return te[0]=2*w,te[4]=0,te[8]=0,te[12]=-x,te[1]=0,te[5]=2*h,te[9]=0,te[13]=-y,te[2]=0,te[6]=0,te[10]=zInv,te[14]=-z,te[3]=0,te[7]=0,te[11]=0,te[15]=1,this}equals(matrix){const te=this.elements,me=matrix.elements;for(let i=0;i<16;i++)if(te[i]!==me[i])return!1;return!0}fromArray(array,offset=0){for(let i=0;i<16;i++)this.elements[i]=array[i+offset];return this}toArray(array=[],offset=0){const te=this.elements;return array[offset]=te[0],array[offset+1]=te[1],array[offset+2]=te[2],array[offset+3]=te[3],array[offset+4]=te[4],array[offset+5]=te[5],array[offset+6]=te[6],array[offset+7]=te[7],array[offset+8]=te[8],array[offset+9]=te[9],array[offset+10]=te[10],array[offset+11]=te[11],array[offset+12]=te[12],array[offset+13]=te[13],array[offset+14]=te[14],array[offset+15]=te[15],array}}const _v1$5=new Vector3,_m1$4=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix$2=new Matrix4,_quaternion$3=new Quaternion;class Euler{constructor(x=0,y=0,z=0,order=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=x,this._y=y,this._z=z,this._order=order}get x(){return this._x}set x(value){this._x=value,this._onChangeCallback()}get y(){return this._y}set y(value){this._y=value,this._onChangeCallback()}get z(){return this._z}set z(value){this._z=value,this._onChangeCallback()}get order(){return this._order}set order(value){this._order=value,this._onChangeCallback()}set(x,y,z,order=this._order){return this._x=x,this._y=y,this._z=z,this._order=order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(euler){return this._x=euler._x,this._y=euler._y,this._z=euler._z,this._order=euler._order,this._onChangeCallback(),this}setFromRotationMatrix(m,order=this._order,update=!0){const te=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10];switch(order){case"XYZ":this._y=Math.asin(clamp(m13,-1,1)),Math.abs(m13)<.9999999?(this._x=Math.atan2(-m23,m33),this._z=Math.atan2(-m12,m11)):(this._x=Math.atan2(m32,m22),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(m23,-1,1)),Math.abs(m23)<.9999999?(this._y=Math.atan2(m13,m33),this._z=Math.atan2(m21,m22)):(this._y=Math.atan2(-m31,m11),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(m32,-1,1)),Math.abs(m32)<.9999999?(this._y=Math.atan2(-m31,m33),this._z=Math.atan2(-m12,m22)):(this._y=0,this._z=Math.atan2(m21,m11));break;case"ZYX":this._y=Math.asin(-clamp(m31,-1,1)),Math.abs(m31)<.9999999?(this._x=Math.atan2(m32,m33),this._z=Math.atan2(m21,m11)):(this._x=0,this._z=Math.atan2(-m12,m22));break;case"YZX":this._z=Math.asin(clamp(m21,-1,1)),Math.abs(m21)<.9999999?(this._x=Math.atan2(-m23,m22),this._y=Math.atan2(-m31,m11)):(this._x=0,this._y=Math.atan2(m13,m33));break;case"XZY":this._z=Math.asin(-clamp(m12,-1,1)),Math.abs(m12)<.9999999?(this._x=Math.atan2(m32,m22),this._y=Math.atan2(m13,m11)):(this._x=Math.atan2(-m23,m33),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+order)}return this._order=order,!0===update&&this._onChangeCallback(),this}setFromQuaternion(q,order,update){return _matrix$2.makeRotationFromQuaternion(q),this.setFromRotationMatrix(_matrix$2,order,update)}setFromVector3(v,order=this._order){return this.set(v.x,v.y,v.z,order)}reorder(newOrder){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,newOrder)}equals(euler){return euler._x===this._x&&euler._y===this._y&&euler._z===this._z&&euler._order===this._order}fromArray(array){return this._x=array[0],this._y=array[1],this._z=array[2],void 0!==array[3]&&(this._order=array[3]),this._onChangeCallback(),this}toArray(array=[],offset=0){return array[offset]=this._x,array[offset+1]=this._y,array[offset+2]=this._z,array[offset+3]=this._order,array}_onChange(callback){return this._onChangeCallback=callback,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(channel){this.mask=(1<>>0}enable(channel){this.mask|=1<1){for(let i=0;i1){for(let i=0;i0&&(object.userData=this.userData),object.layers=this.layers.mask,object.matrix=this.matrix.toArray(),object.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(object.matrixAutoUpdate=!1),this.isInstancedMesh&&(object.type="InstancedMesh",object.count=this.count,object.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(object.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(object.type="BatchedMesh",object.perObjectFrustumCulled=this.perObjectFrustumCulled,object.sortObjects=this.sortObjects,object.drawRanges=this._drawRanges,object.reservedRanges=this._reservedRanges,object.visibility=this._visibility,object.active=this._active,object.bounds=this._bounds.map((bound=>({boxInitialized:bound.boxInitialized,boxMin:bound.box.min.toArray(),boxMax:bound.box.max.toArray(),sphereInitialized:bound.sphereInitialized,sphereRadius:bound.sphere.radius,sphereCenter:bound.sphere.center.toArray()}))),object.maxInstanceCount=this._maxInstanceCount,object.maxVertexCount=this._maxVertexCount,object.maxIndexCount=this._maxIndexCount,object.geometryInitialized=this._geometryInitialized,object.geometryCount=this._geometryCount,object.matricesTexture=this._matricesTexture.toJSON(meta),null!==this._colorsTexture&&(object.colorsTexture=this._colorsTexture.toJSON(meta)),null!==this.boundingSphere&&(object.boundingSphere={center:object.boundingSphere.center.toArray(),radius:object.boundingSphere.radius}),null!==this.boundingBox&&(object.boundingBox={min:object.boundingBox.min.toArray(),max:object.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?object.background=this.background.toJSON():this.background.isTexture&&(object.background=this.background.toJSON(meta).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(object.environment=this.environment.toJSON(meta).uuid);else if(this.isMesh||this.isLine||this.isPoints){object.geometry=serialize(meta.geometries,this.geometry);const parameters=this.geometry.parameters;if(void 0!==parameters&&void 0!==parameters.shapes){const shapes=parameters.shapes;if(Array.isArray(shapes))for(let i=0,l=shapes.length;i0){object.children=[];for(let i=0;i0){object.animations=[];for(let i=0;i0&&(output.geometries=geometries),materials.length>0&&(output.materials=materials),textures.length>0&&(output.textures=textures),images.length>0&&(output.images=images),shapes.length>0&&(output.shapes=shapes),skeletons.length>0&&(output.skeletons=skeletons),animations.length>0&&(output.animations=animations),nodes.length>0&&(output.nodes=nodes)}return output.object=object,output;function extractFromCache(cache){const values=[];for(const key in cache){const data=cache[key];delete data.metadata,values.push(data)}return values}}clone(recursive){return(new this.constructor).copy(this,recursive)}copy(source,recursive=!0){if(this.name=source.name,this.up.copy(source.up),this.position.copy(source.position),this.rotation.order=source.rotation.order,this.quaternion.copy(source.quaternion),this.scale.copy(source.scale),this.matrix.copy(source.matrix),this.matrixWorld.copy(source.matrixWorld),this.matrixAutoUpdate=source.matrixAutoUpdate,this.matrixWorldAutoUpdate=source.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=source.matrixWorldNeedsUpdate,this.layers.mask=source.layers.mask,this.visible=source.visible,this.castShadow=source.castShadow,this.receiveShadow=source.receiveShadow,this.frustumCulled=source.frustumCulled,this.renderOrder=source.renderOrder,this.animations=source.animations.slice(),this.userData=JSON.parse(JSON.stringify(source.userData)),!0===recursive)for(let i=0;i0?target.multiplyScalar(1/Math.sqrt(targetLengthSq)):target.set(0,0,0)}static getBarycoord(point,a,b,c,target){_v0$1.subVectors(c,a),_v1$3.subVectors(b,a),_v2$2.subVectors(point,a);const dot00=_v0$1.dot(_v0$1),dot01=_v0$1.dot(_v1$3),dot02=_v0$1.dot(_v2$2),dot11=_v1$3.dot(_v1$3),dot12=_v1$3.dot(_v2$2),denom=dot00*dot11-dot01*dot01;if(0===denom)return target.set(0,0,0),null;const invDenom=1/denom,u=(dot11*dot02-dot01*dot12)*invDenom,v=(dot00*dot12-dot01*dot02)*invDenom;return target.set(1-u-v,v,u)}static containsPoint(point,a,b,c){return null!==this.getBarycoord(point,a,b,c,_v3$2)&&(_v3$2.x>=0&&_v3$2.y>=0&&_v3$2.x+_v3$2.y<=1)}static getInterpolation(point,p1,p2,p3,v1,v2,v3,target){return null===this.getBarycoord(point,p1,p2,p3,_v3$2)?(target.x=0,target.y=0,"z"in target&&(target.z=0),"w"in target&&(target.w=0),null):(target.setScalar(0),target.addScaledVector(v1,_v3$2.x),target.addScaledVector(v2,_v3$2.y),target.addScaledVector(v3,_v3$2.z),target)}static isFrontFacing(a,b,c,direction){return _v0$1.subVectors(c,b),_v1$3.subVectors(a,b),_v0$1.cross(_v1$3).dot(direction)<0}set(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this}setFromPointsAndIndices(points,i0,i1,i2){return this.a.copy(points[i0]),this.b.copy(points[i1]),this.c.copy(points[i2]),this}setFromAttributeAndIndices(attribute,i0,i1,i2){return this.a.fromBufferAttribute(attribute,i0),this.b.fromBufferAttribute(attribute,i1),this.c.fromBufferAttribute(attribute,i2),this}clone(){return(new this.constructor).copy(this)}copy(triangle){return this.a.copy(triangle.a),this.b.copy(triangle.b),this.c.copy(triangle.c),this}getArea(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),.5*_v0$1.cross(_v1$3).length()}getMidpoint(target){return target.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(target){return Triangle.getNormal(this.a,this.b,this.c,target)}getPlane(target){return target.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(point,target){return Triangle.getBarycoord(point,this.a,this.b,this.c,target)}getInterpolation(point,v1,v2,v3,target){return Triangle.getInterpolation(point,this.a,this.b,this.c,v1,v2,v3,target)}containsPoint(point){return Triangle.containsPoint(point,this.a,this.b,this.c)}isFrontFacing(direction){return Triangle.isFrontFacing(this.a,this.b,this.c,direction)}intersectsBox(box){return box.intersectsTriangle(this)}closestPointToPoint(p,target){const a=this.a,b=this.b,c=this.c;let v,w;_vab.subVectors(b,a),_vac.subVectors(c,a),_vap.subVectors(p,a);const d1=_vab.dot(_vap),d2=_vac.dot(_vap);if(d1<=0&&d2<=0)return target.copy(a);_vbp.subVectors(p,b);const d3=_vab.dot(_vbp),d4=_vac.dot(_vbp);if(d3>=0&&d4<=d3)return target.copy(b);const vc=d1*d4-d3*d2;if(vc<=0&&d1>=0&&d3<=0)return v=d1/(d1-d3),target.copy(a).addScaledVector(_vab,v);_vcp.subVectors(p,c);const d5=_vab.dot(_vcp),d6=_vac.dot(_vcp);if(d6>=0&&d5<=d6)return target.copy(c);const vb=d5*d2-d1*d6;if(vb<=0&&d2>=0&&d6<=0)return w=d2/(d2-d6),target.copy(a).addScaledVector(_vac,w);const va=d3*d6-d5*d4;if(va<=0&&d4-d3>=0&&d5-d6>=0)return _vbc.subVectors(c,b),w=(d4-d3)/(d4-d3+(d5-d6)),target.copy(b).addScaledVector(_vbc,w);const denom=1/(va+vb+vc);return v=vb*denom,w=vc*denom,target.copy(a).addScaledVector(_vab,v).addScaledVector(_vac,w)}equals(triangle){return triangle.a.equals(this.a)&&triangle.b.equals(this.b)&&triangle.c.equals(this.c)}}const _colorKeywords={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},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+6*(q-p)*(2/3-t):p}class Color{constructor(r,g,b){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(r,g,b)}set(r,g,b){if(void 0===g&&void 0===b){const value=r;value&&value.isColor?this.copy(value):"number"==typeof value?this.setHex(value):"string"==typeof value&&this.setStyle(value)}else this.setRGB(r,g,b);return this}setScalar(scalar){return this.r=scalar,this.g=scalar,this.b=scalar,this}setHex(hex,colorSpace=SRGBColorSpace){return hex=Math.floor(hex),this.r=(hex>>16&255)/255,this.g=(hex>>8&255)/255,this.b=(255&hex)/255,ColorManagement.toWorkingColorSpace(this,colorSpace),this}setRGB(r,g,b,colorSpace=ColorManagement.workingColorSpace){return this.r=r,this.g=g,this.b=b,ColorManagement.toWorkingColorSpace(this,colorSpace),this}setHSL(h,s,l,colorSpace=ColorManagement.workingColorSpace){if(h=euclideanModulo(h,1),s=clamp(s,0,1),l=clamp(l,0,1),0===s)this.r=this.g=this.b=l;else{const p=l<=.5?l*(1+s):l+s-l*s,q=2*l-p;this.r=hue2rgb(q,p,h+1/3),this.g=hue2rgb(q,p,h),this.b=hue2rgb(q,p,h-1/3)}return ColorManagement.toWorkingColorSpace(this,colorSpace),this}setStyle(style,colorSpace=SRGBColorSpace){function handleAlpha(string){void 0!==string&&parseFloat(string)<1&&console.warn("THREE.Color: Alpha component of "+style+" will be ignored.")}let m;if(m=/^(\w+)\(([^\)]*)\)/.exec(style)){let color;const name=m[1],components=m[2];switch(name){case"rgb":case"rgba":if(color=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components))return handleAlpha(color[4]),this.setRGB(Math.min(255,parseInt(color[1],10))/255,Math.min(255,parseInt(color[2],10))/255,Math.min(255,parseInt(color[3],10))/255,colorSpace);if(color=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components))return handleAlpha(color[4]),this.setRGB(Math.min(100,parseInt(color[1],10))/100,Math.min(100,parseInt(color[2],10))/100,Math.min(100,parseInt(color[3],10))/100,colorSpace);break;case"hsl":case"hsla":if(color=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components))return handleAlpha(color[4]),this.setHSL(parseFloat(color[1])/360,parseFloat(color[2])/100,parseFloat(color[3])/100,colorSpace);break;default:console.warn("THREE.Color: Unknown color model "+style)}}else if(m=/^\#([A-Fa-f\d]+)$/.exec(style)){const hex=m[1],size=hex.length;if(3===size)return this.setRGB(parseInt(hex.charAt(0),16)/15,parseInt(hex.charAt(1),16)/15,parseInt(hex.charAt(2),16)/15,colorSpace);if(6===size)return this.setHex(parseInt(hex,16),colorSpace);console.warn("THREE.Color: Invalid hex color "+style)}else if(style&&style.length>0)return this.setColorName(style,colorSpace);return this}setColorName(style,colorSpace=SRGBColorSpace){const hex=_colorKeywords[style.toLowerCase()];return void 0!==hex?this.setHex(hex,colorSpace):console.warn("THREE.Color: Unknown color "+style),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(color){return this.r=color.r,this.g=color.g,this.b=color.b,this}copySRGBToLinear(color){return this.r=SRGBToLinear(color.r),this.g=SRGBToLinear(color.g),this.b=SRGBToLinear(color.b),this}copyLinearToSRGB(color){return this.r=LinearToSRGB(color.r),this.g=LinearToSRGB(color.g),this.b=LinearToSRGB(color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(colorSpace=SRGBColorSpace){return ColorManagement.fromWorkingColorSpace(_color.copy(this),colorSpace),65536*Math.round(clamp(255*_color.r,0,255))+256*Math.round(clamp(255*_color.g,0,255))+Math.round(clamp(255*_color.b,0,255))}getHexString(colorSpace=SRGBColorSpace){return("000000"+this.getHex(colorSpace).toString(16)).slice(-6)}getHSL(target,colorSpace=ColorManagement.workingColorSpace){ColorManagement.fromWorkingColorSpace(_color.copy(this),colorSpace);const r=_color.r,g=_color.g,b=_color.b,max=Math.max(r,g,b),min=Math.min(r,g,b);let hue,saturation;const lightness=(min+max)/2;if(min===max)hue=0,saturation=0;else{const delta=max-min;switch(saturation=lightness<=.5?delta/(max+min):delta/(2-max-min),max){case r:hue=(g-b)/delta+(g0!=value>0&&this.version++,this._alphaTest=value}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(values){if(void 0!==values)for(const key in values){const newValue=values[key];if(void 0===newValue){console.warn(`THREE.Material: parameter '${key}' has value of undefined.`);continue}const currentValue=this[key];void 0!==currentValue?currentValue&¤tValue.isColor?currentValue.set(newValue):currentValue&¤tValue.isVector3&&newValue&&newValue.isVector3?currentValue.copy(newValue):this[key]=newValue:console.warn(`THREE.Material: '${key}' is not a property of THREE.${this.type}.`)}}toJSON(meta){const isRootObject=void 0===meta||"string"==typeof meta;isRootObject&&(meta={textures:{},images:{}});const data={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function extractFromCache(cache){const values=[];for(const key in cache){const data=cache[key];delete data.metadata,values.push(data)}return values}if(data.uuid=this.uuid,data.type=this.type,""!==this.name&&(data.name=this.name),this.color&&this.color.isColor&&(data.color=this.color.getHex()),void 0!==this.roughness&&(data.roughness=this.roughness),void 0!==this.metalness&&(data.metalness=this.metalness),void 0!==this.sheen&&(data.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(data.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(data.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(data.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(data.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(data.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(data.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(data.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(data.shininess=this.shininess),void 0!==this.clearcoat&&(data.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(data.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(data.clearcoatMap=this.clearcoatMap.toJSON(meta).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(data.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(meta).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(data.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(meta).uuid,data.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(data.dispersion=this.dispersion),void 0!==this.iridescence&&(data.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(data.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(data.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(data.iridescenceMap=this.iridescenceMap.toJSON(meta).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(data.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(meta).uuid),void 0!==this.anisotropy&&(data.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(data.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(data.anisotropyMap=this.anisotropyMap.toJSON(meta).uuid),this.map&&this.map.isTexture&&(data.map=this.map.toJSON(meta).uuid),this.matcap&&this.matcap.isTexture&&(data.matcap=this.matcap.toJSON(meta).uuid),this.alphaMap&&this.alphaMap.isTexture&&(data.alphaMap=this.alphaMap.toJSON(meta).uuid),this.lightMap&&this.lightMap.isTexture&&(data.lightMap=this.lightMap.toJSON(meta).uuid,data.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(data.aoMap=this.aoMap.toJSON(meta).uuid,data.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(data.bumpMap=this.bumpMap.toJSON(meta).uuid,data.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(data.normalMap=this.normalMap.toJSON(meta).uuid,data.normalMapType=this.normalMapType,data.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(data.displacementMap=this.displacementMap.toJSON(meta).uuid,data.displacementScale=this.displacementScale,data.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(data.roughnessMap=this.roughnessMap.toJSON(meta).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(data.metalnessMap=this.metalnessMap.toJSON(meta).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(data.emissiveMap=this.emissiveMap.toJSON(meta).uuid),this.specularMap&&this.specularMap.isTexture&&(data.specularMap=this.specularMap.toJSON(meta).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(data.specularIntensityMap=this.specularIntensityMap.toJSON(meta).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(data.specularColorMap=this.specularColorMap.toJSON(meta).uuid),this.envMap&&this.envMap.isTexture&&(data.envMap=this.envMap.toJSON(meta).uuid,void 0!==this.combine&&(data.combine=this.combine)),void 0!==this.envMapRotation&&(data.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(data.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(data.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(data.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(data.gradientMap=this.gradientMap.toJSON(meta).uuid),void 0!==this.transmission&&(data.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(data.transmissionMap=this.transmissionMap.toJSON(meta).uuid),void 0!==this.thickness&&(data.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(data.thicknessMap=this.thicknessMap.toJSON(meta).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(data.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(data.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(data.size=this.size),null!==this.shadowSide&&(data.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(data.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(data.blending=this.blending),this.side!==FrontSide&&(data.side=this.side),!0===this.vertexColors&&(data.vertexColors=!0),this.opacity<1&&(data.opacity=this.opacity),!0===this.transparent&&(data.transparent=!0),this.blendSrc!==SrcAlphaFactor&&(data.blendSrc=this.blendSrc),this.blendDst!==OneMinusSrcAlphaFactor&&(data.blendDst=this.blendDst),this.blendEquation!==AddEquation&&(data.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(data.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(data.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(data.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(data.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(data.blendAlpha=this.blendAlpha),this.depthFunc!==LessEqualDepth&&(data.depthFunc=this.depthFunc),!1===this.depthTest&&(data.depthTest=this.depthTest),!1===this.depthWrite&&(data.depthWrite=this.depthWrite),!1===this.colorWrite&&(data.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(data.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==AlwaysStencilFunc&&(data.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(data.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(data.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==KeepStencilOp&&(data.stencilFail=this.stencilFail),this.stencilZFail!==KeepStencilOp&&(data.stencilZFail=this.stencilZFail),this.stencilZPass!==KeepStencilOp&&(data.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(data.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(data.rotation=this.rotation),!0===this.polygonOffset&&(data.polygonOffset=!0),0!==this.polygonOffsetFactor&&(data.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(data.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(data.linewidth=this.linewidth),void 0!==this.dashSize&&(data.dashSize=this.dashSize),void 0!==this.gapSize&&(data.gapSize=this.gapSize),void 0!==this.scale&&(data.scale=this.scale),!0===this.dithering&&(data.dithering=!0),this.alphaTest>0&&(data.alphaTest=this.alphaTest),!0===this.alphaHash&&(data.alphaHash=!0),!0===this.alphaToCoverage&&(data.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(data.premultipliedAlpha=!0),!0===this.forceSinglePass&&(data.forceSinglePass=!0),!0===this.wireframe&&(data.wireframe=!0),this.wireframeLinewidth>1&&(data.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(data.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(data.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(data.flatShading=!0),!1===this.visible&&(data.visible=!1),!1===this.toneMapped&&(data.toneMapped=!1),!1===this.fog&&(data.fog=!1),Object.keys(this.userData).length>0&&(data.userData=this.userData),isRootObject){const textures=extractFromCache(meta.textures),images=extractFromCache(meta.images);textures.length>0&&(data.textures=textures),images.length>0&&(data.images=images)}return data}clone(){return(new this.constructor).copy(this)}copy(source){this.name=source.name,this.blending=source.blending,this.side=source.side,this.vertexColors=source.vertexColors,this.opacity=source.opacity,this.transparent=source.transparent,this.blendSrc=source.blendSrc,this.blendDst=source.blendDst,this.blendEquation=source.blendEquation,this.blendSrcAlpha=source.blendSrcAlpha,this.blendDstAlpha=source.blendDstAlpha,this.blendEquationAlpha=source.blendEquationAlpha,this.blendColor.copy(source.blendColor),this.blendAlpha=source.blendAlpha,this.depthFunc=source.depthFunc,this.depthTest=source.depthTest,this.depthWrite=source.depthWrite,this.stencilWriteMask=source.stencilWriteMask,this.stencilFunc=source.stencilFunc,this.stencilRef=source.stencilRef,this.stencilFuncMask=source.stencilFuncMask,this.stencilFail=source.stencilFail,this.stencilZFail=source.stencilZFail,this.stencilZPass=source.stencilZPass,this.stencilWrite=source.stencilWrite;const srcPlanes=source.clippingPlanes;let dstPlanes=null;if(null!==srcPlanes){const n=srcPlanes.length;dstPlanes=new Array(n);for(let i=0;i!==n;++i)dstPlanes[i]=srcPlanes[i].clone()}return this.clippingPlanes=dstPlanes,this.clipIntersection=source.clipIntersection,this.clipShadows=source.clipShadows,this.shadowSide=source.shadowSide,this.colorWrite=source.colorWrite,this.precision=source.precision,this.polygonOffset=source.polygonOffset,this.polygonOffsetFactor=source.polygonOffsetFactor,this.polygonOffsetUnits=source.polygonOffsetUnits,this.dithering=source.dithering,this.alphaTest=source.alphaTest,this.alphaHash=source.alphaHash,this.alphaToCoverage=source.alphaToCoverage,this.premultipliedAlpha=source.premultipliedAlpha,this.forceSinglePass=source.forceSinglePass,this.visible=source.visible,this.toneMapped=source.toneMapped,this.userData=JSON.parse(JSON.stringify(source.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(value){!0===value&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class MeshBasicMaterial extends Material{constructor(parameters){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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 Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.envMapRotation.copy(source.envMapRotation),this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.fog=source.fog,this}}const _tables=_generateTables();function _generateTables(){const buffer=new ArrayBuffer(4),floatView=new Float32Array(buffer),uint32View=new Uint32Array(buffer),baseTable=new Uint32Array(512),shiftTable=new Uint32Array(512);for(let i=0;i<256;++i){const e=i-127;e<-27?(baseTable[i]=0,baseTable[256|i]=32768,shiftTable[i]=24,shiftTable[256|i]=24):e<-14?(baseTable[i]=1024>>-e-14,baseTable[256|i]=1024>>-e-14|32768,shiftTable[i]=-e-1,shiftTable[256|i]=-e-1):e<=15?(baseTable[i]=e+15<<10,baseTable[256|i]=e+15<<10|32768,shiftTable[i]=13,shiftTable[256|i]=13):e<128?(baseTable[i]=31744,baseTable[256|i]=64512,shiftTable[i]=24,shiftTable[256|i]=24):(baseTable[i]=31744,baseTable[256|i]=64512,shiftTable[i]=13,shiftTable[256|i]=13)}const mantissaTable=new Uint32Array(2048),exponentTable=new Uint32Array(64),offsetTable=new Uint32Array(64);for(let i=1;i<1024;++i){let m=i<<13,e=0;for(;0==(8388608&m);)m<<=1,e-=8388608;m&=-8388609,e+=947912704,mantissaTable[i]=m|e}for(let i=1024;i<2048;++i)mantissaTable[i]=939524096+(i-1024<<13);for(let i=1;i<31;++i)exponentTable[i]=i<<23;exponentTable[31]=1199570944,exponentTable[32]=2147483648;for(let i=33;i<63;++i)exponentTable[i]=2147483648+(i-32<<23);exponentTable[63]=3347054592;for(let i=1;i<64;++i)32!==i&&(offsetTable[i]=1024);return{floatView:floatView,uint32View:uint32View,baseTable:baseTable,shiftTable:shiftTable,mantissaTable:mantissaTable,exponentTable:exponentTable,offsetTable:offsetTable}}function toHalfFloat(val){Math.abs(val)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),val=clamp(val,-65504,65504),_tables.floatView[0]=val;const f=_tables.uint32View[0],e=f>>23&511;return _tables.baseTable[e]+((8388607&f)>>_tables.shiftTable[e])}function fromHalfFloat(val){const m=val>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[m]+(1023&val)]+_tables.exponentTable[m],_tables.floatView[0]}const DataUtils={toHalfFloat:toHalfFloat,fromHalfFloat:fromHalfFloat},_vector$9=new Vector3,_vector2$1=new Vector2;class BufferAttribute{constructor(array,itemSize,normalized=!1){if(Array.isArray(array))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=array,this.itemSize=itemSize,this.count=void 0!==array?array.length/itemSize:0,this.normalized=normalized,this.usage=StaticDrawUsage,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=FloatType,this.version=0}onUploadCallback(){}set needsUpdate(value){!0===value&&this.version++}get updateRange(){return warnOnce("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(value){return this.usage=value,this}addUpdateRange(start,count){this.updateRanges.push({start:start,count:count})}clearUpdateRanges(){this.updateRanges.length=0}copy(source){return this.name=source.name,this.array=new source.array.constructor(source.array),this.itemSize=source.itemSize,this.count=source.count,this.normalized=source.normalized,this.usage=source.usage,this.gpuType=source.gpuType,this}copyAt(index1,attribute,index2){index1*=this.itemSize,index2*=attribute.itemSize;for(let i=0,l=this.itemSize;i0&&(data.userData=this.userData),void 0!==this.parameters){const parameters=this.parameters;for(const key in parameters)void 0!==parameters[key]&&(data[key]=parameters[key]);return data}data.data={attributes:{}};const index=this.index;null!==index&&(data.data.index={type:index.array.constructor.name,array:Array.prototype.slice.call(index.array)});const attributes=this.attributes;for(const key in attributes){const attribute=attributes[key];data.data.attributes[key]=attribute.toJSON(data.data)}const morphAttributes={};let hasMorphAttributes=!1;for(const key in this.morphAttributes){const attributeArray=this.morphAttributes[key],array=[];for(let i=0,il=attributeArray.length;i0&&(morphAttributes[key]=array,hasMorphAttributes=!0)}hasMorphAttributes&&(data.data.morphAttributes=morphAttributes,data.data.morphTargetsRelative=this.morphTargetsRelative);const groups=this.groups;groups.length>0&&(data.data.groups=JSON.parse(JSON.stringify(groups)));const boundingSphere=this.boundingSphere;return null!==boundingSphere&&(data.data.boundingSphere={center:boundingSphere.center.toArray(),radius:boundingSphere.radius}),data}clone(){return(new this.constructor).copy(this)}copy(source){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const data={};this.name=source.name;const index=source.index;null!==index&&this.setIndex(index.clone(data));const attributes=source.attributes;for(const name in attributes){const attribute=attributes[name];this.setAttribute(name,attribute.clone(data))}const morphAttributes=source.morphAttributes;for(const name in morphAttributes){const array=[],morphAttribute=morphAttributes[name];for(let i=0,l=morphAttribute.length;i0){const morphAttribute=morphAttributes[keys[0]];if(void 0!==morphAttribute){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;m(raycaster.far-raycaster.near)**2)return}_inverseMatrix$3.copy(matrixWorld).invert(),_ray$3.copy(raycaster.ray).applyMatrix4(_inverseMatrix$3),null!==geometry.boundingBox&&!1===_ray$3.intersectsBox(geometry.boundingBox)||this._computeIntersections(raycaster,intersects,_ray$3)}}_computeIntersections(raycaster,intersects,rayLocalSpace){let intersection;const geometry=this.geometry,material=this.material,index=geometry.index,position=geometry.attributes.position,uv=geometry.attributes.uv,uv1=geometry.attributes.uv1,normal=geometry.attributes.normal,groups=geometry.groups,drawRange=geometry.drawRange;if(null!==index)if(Array.isArray(material))for(let i=0,il=groups.length;iraycaster.far?null:{distance:distance,point:_intersectionPointWorld.clone(),object:object}}(object,material,raycaster,ray,_vA$1,_vB$1,_vC$1,_intersectionPoint);if(intersection){uv&&(_uvA$1.fromBufferAttribute(uv,a),_uvB$1.fromBufferAttribute(uv,b),_uvC$1.fromBufferAttribute(uv,c),intersection.uv=Triangle.getInterpolation(_intersectionPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2)),uv1&&(_uvA$1.fromBufferAttribute(uv1,a),_uvB$1.fromBufferAttribute(uv1,b),_uvC$1.fromBufferAttribute(uv1,c),intersection.uv1=Triangle.getInterpolation(_intersectionPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2)),normal&&(_normalA.fromBufferAttribute(normal,a),_normalB.fromBufferAttribute(normal,b),_normalC.fromBufferAttribute(normal,c),intersection.normal=Triangle.getInterpolation(_intersectionPoint,_vA$1,_vB$1,_vC$1,_normalA,_normalB,_normalC,new Vector3),intersection.normal.dot(ray.direction)>0&&intersection.normal.multiplyScalar(-1));const face={a:a,b:b,c:c,normal:new Vector3,materialIndex:0};Triangle.getNormal(_vA$1,_vB$1,_vC$1,face.normal),intersection.face=face}return intersection}class BoxGeometry extends BufferGeometry{constructor(width=1,height=1,depth=1,widthSegments=1,heightSegments=1,depthSegments=1){super(),this.type="BoxGeometry",this.parameters={width:width,height:height,depth:depth,widthSegments:widthSegments,heightSegments:heightSegments,depthSegments:depthSegments};const scope=this;widthSegments=Math.floor(widthSegments),heightSegments=Math.floor(heightSegments),depthSegments=Math.floor(depthSegments);const indices=[],vertices=[],normals=[],uvs=[];let numberOfVertices=0,groupStart=0;function buildPlane(u,v,w,udir,vdir,width,height,depth,gridX,gridY,materialIndex){const segmentWidth=width/gridX,segmentHeight=height/gridY,widthHalf=width/2,heightHalf=height/2,depthHalf=depth/2,gridX1=gridX+1,gridY1=gridY+1;let vertexCounter=0,groupCount=0;const vector=new Vector3;for(let iy=0;iy0?1:-1,normals.push(vector.x,vector.y,vector.z),uvs.push(ix/gridX),uvs.push(1-iy/gridY),vertexCounter+=1}}for(let iy=0;iy0&&(data.defines=this.defines),data.vertexShader=this.vertexShader,data.fragmentShader=this.fragmentShader,data.lights=this.lights,data.clipping=this.clipping;const extensions={};for(const key in this.extensions)!0===this.extensions[key]&&(extensions[key]=!0);return Object.keys(extensions).length>0&&(data.extensions=extensions),data}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=WebGLCoordinateSystem}copy(source,recursive){return super.copy(source,recursive),this.matrixWorldInverse.copy(source.matrixWorldInverse),this.projectionMatrix.copy(source.projectionMatrix),this.projectionMatrixInverse.copy(source.projectionMatrixInverse),this.coordinateSystem=source.coordinateSystem,this}getWorldDirection(target){return super.getWorldDirection(target).negate()}updateMatrixWorld(force){super.updateMatrixWorld(force),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(updateParents,updateChildren){super.updateWorldMatrix(updateParents,updateChildren),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const _v3$1=new Vector3,_minTarget=new Vector2,_maxTarget=new Vector2;class PerspectiveCamera extends Camera{constructor(fov=50,aspect=1,near=.1,far=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=fov,this.zoom=1,this.near=near,this.far=far,this.focus=10,this.aspect=aspect,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(source,recursive){return super.copy(source,recursive),this.fov=source.fov,this.zoom=source.zoom,this.near=source.near,this.far=source.far,this.focus=source.focus,this.aspect=source.aspect,this.view=null===source.view?null:Object.assign({},source.view),this.filmGauge=source.filmGauge,this.filmOffset=source.filmOffset,this}setFocalLength(focalLength){const vExtentSlope=.5*this.getFilmHeight()/focalLength;this.fov=2*RAD2DEG*Math.atan(vExtentSlope),this.updateProjectionMatrix()}getFocalLength(){const vExtentSlope=Math.tan(.5*DEG2RAD*this.fov);return.5*this.getFilmHeight()/vExtentSlope}getEffectiveFOV(){return 2*RAD2DEG*Math.atan(Math.tan(.5*DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(distance,minTarget,maxTarget){_v3$1.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),minTarget.set(_v3$1.x,_v3$1.y).multiplyScalar(-distance/_v3$1.z),_v3$1.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),maxTarget.set(_v3$1.x,_v3$1.y).multiplyScalar(-distance/_v3$1.z)}getViewSize(distance,target){return this.getViewBounds(distance,_minTarget,_maxTarget),target.subVectors(_maxTarget,_minTarget)}setViewOffset(fullWidth,fullHeight,x,y,width,height){this.aspect=fullWidth/fullHeight,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=fullWidth,this.view.fullHeight=fullHeight,this.view.offsetX=x,this.view.offsetY=y,this.view.width=width,this.view.height=height,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const near=this.near;let top=near*Math.tan(.5*DEG2RAD*this.fov)/this.zoom,height=2*top,width=this.aspect*height,left=-.5*width;const view=this.view;if(null!==this.view&&this.view.enabled){const fullWidth=view.fullWidth,fullHeight=view.fullHeight;left+=view.offsetX*width/fullWidth,top-=view.offsetY*height/fullHeight,width*=view.width/fullWidth,height*=view.height/fullHeight}const skew=this.filmOffset;0!==skew&&(left+=near*skew/this.getFilmWidth()),this.projectionMatrix.makePerspective(left,left+width,top,top-height,near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(meta){const data=super.toJSON(meta);return data.object.fov=this.fov,data.object.zoom=this.zoom,data.object.near=this.near,data.object.far=this.far,data.object.focus=this.focus,data.object.aspect=this.aspect,null!==this.view&&(data.object.view=Object.assign({},this.view)),data.object.filmGauge=this.filmGauge,data.object.filmOffset=this.filmOffset,data}}class CubeCamera extends Object3D{constructor(near,far,renderTarget){super(),this.type="CubeCamera",this.renderTarget=renderTarget,this.coordinateSystem=null,this.activeMipmapLevel=0;const cameraPX=new PerspectiveCamera(-90,1,near,far);cameraPX.layers=this.layers,this.add(cameraPX);const cameraNX=new PerspectiveCamera(-90,1,near,far);cameraNX.layers=this.layers,this.add(cameraNX);const cameraPY=new PerspectiveCamera(-90,1,near,far);cameraPY.layers=this.layers,this.add(cameraPY);const cameraNY=new PerspectiveCamera(-90,1,near,far);cameraNY.layers=this.layers,this.add(cameraNY);const cameraPZ=new PerspectiveCamera(-90,1,near,far);cameraPZ.layers=this.layers,this.add(cameraPZ);const cameraNZ=new PerspectiveCamera(-90,1,near,far);cameraNZ.layers=this.layers,this.add(cameraNZ)}updateCoordinateSystem(){const coordinateSystem=this.coordinateSystem,cameras=this.children.concat(),[cameraPX,cameraNX,cameraPY,cameraNY,cameraPZ,cameraNZ]=cameras;for(const camera of cameras)this.remove(camera);if(coordinateSystem===WebGLCoordinateSystem)cameraPX.up.set(0,1,0),cameraPX.lookAt(1,0,0),cameraNX.up.set(0,1,0),cameraNX.lookAt(-1,0,0),cameraPY.up.set(0,0,-1),cameraPY.lookAt(0,1,0),cameraNY.up.set(0,0,1),cameraNY.lookAt(0,-1,0),cameraPZ.up.set(0,1,0),cameraPZ.lookAt(0,0,1),cameraNZ.up.set(0,1,0),cameraNZ.lookAt(0,0,-1);else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+coordinateSystem);cameraPX.up.set(0,-1,0),cameraPX.lookAt(-1,0,0),cameraNX.up.set(0,-1,0),cameraNX.lookAt(1,0,0),cameraPY.up.set(0,0,1),cameraPY.lookAt(0,1,0),cameraNY.up.set(0,0,-1),cameraNY.lookAt(0,-1,0),cameraPZ.up.set(0,-1,0),cameraPZ.lookAt(0,0,1),cameraNZ.up.set(0,-1,0),cameraNZ.lookAt(0,0,-1)}for(const camera of cameras)this.add(camera),camera.updateMatrixWorld()}update(renderer,scene){null===this.parent&&this.updateMatrixWorld();const{renderTarget:renderTarget,activeMipmapLevel:activeMipmapLevel}=this;this.coordinateSystem!==renderer.coordinateSystem&&(this.coordinateSystem=renderer.coordinateSystem,this.updateCoordinateSystem());const[cameraPX,cameraNX,cameraPY,cameraNY,cameraPZ,cameraNZ]=this.children,currentRenderTarget=renderer.getRenderTarget(),currentActiveCubeFace=renderer.getActiveCubeFace(),currentActiveMipmapLevel=renderer.getActiveMipmapLevel(),currentXrEnabled=renderer.xr.enabled;renderer.xr.enabled=!1;const generateMipmaps=renderTarget.texture.generateMipmaps;renderTarget.texture.generateMipmaps=!1,renderer.setRenderTarget(renderTarget,0,activeMipmapLevel),renderer.render(scene,cameraPX),renderer.setRenderTarget(renderTarget,1,activeMipmapLevel),renderer.render(scene,cameraNX),renderer.setRenderTarget(renderTarget,2,activeMipmapLevel),renderer.render(scene,cameraPY),renderer.setRenderTarget(renderTarget,3,activeMipmapLevel),renderer.render(scene,cameraNY),renderer.setRenderTarget(renderTarget,4,activeMipmapLevel),renderer.render(scene,cameraPZ),renderTarget.texture.generateMipmaps=generateMipmaps,renderer.setRenderTarget(renderTarget,5,activeMipmapLevel),renderer.render(scene,cameraNZ),renderer.setRenderTarget(currentRenderTarget,currentActiveCubeFace,currentActiveMipmapLevel),renderer.xr.enabled=currentXrEnabled,renderTarget.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(images,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,colorSpace){super(images=void 0!==images?images:[],mapping=void 0!==mapping?mapping:CubeReflectionMapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,colorSpace),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(value){this.image=value}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(size=1,options={}){super(size,size,options),this.isWebGLCubeRenderTarget=!0;const image={width:size,height:size,depth:1},images=[image,image,image,image,image,image];this.texture=new CubeTexture(images,options.mapping,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==options.generateMipmaps&&options.generateMipmaps,this.texture.minFilter=void 0!==options.minFilter?options.minFilter:LinearFilter}fromEquirectangularTexture(renderer,texture){this.texture.type=texture.type,this.texture.colorSpace=texture.colorSpace,this.texture.generateMipmaps=texture.generateMipmaps,this.texture.minFilter=texture.minFilter,this.texture.magFilter=texture.magFilter;const shader={uniforms:{tEquirect:{value:null}},vertexShader:"\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 \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \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"},geometry=new BoxGeometry(5,5,5),material=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(shader.uniforms),vertexShader:shader.vertexShader,fragmentShader:shader.fragmentShader,side:BackSide,blending:NoBlending});material.uniforms.tEquirect.value=texture;const mesh=new Mesh(geometry,material),currentMinFilter=texture.minFilter;texture.minFilter===LinearMipmapLinearFilter&&(texture.minFilter=LinearFilter);return new CubeCamera(1,10,this).update(renderer,mesh),texture.minFilter=currentMinFilter,mesh.geometry.dispose(),mesh.material.dispose(),this}clear(renderer,color,depth,stencil){const currentRenderTarget=renderer.getRenderTarget();for(let i=0;i<6;i++)renderer.setRenderTarget(this,i),renderer.clear(color,depth,stencil);renderer.setRenderTarget(currentRenderTarget)}}const _vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3;class Plane{constructor(normal=new Vector3(1,0,0),constant=0){this.isPlane=!0,this.normal=normal,this.constant=constant}set(normal,constant){return this.normal.copy(normal),this.constant=constant,this}setComponents(x,y,z,w){return this.normal.set(x,y,z),this.constant=w,this}setFromNormalAndCoplanarPoint(normal,point){return this.normal.copy(normal),this.constant=-point.dot(this.normal),this}setFromCoplanarPoints(a,b,c){const normal=_vector1.subVectors(c,b).cross(_vector2.subVectors(a,b)).normalize();return this.setFromNormalAndCoplanarPoint(normal,a),this}copy(plane){return this.normal.copy(plane.normal),this.constant=plane.constant,this}normalize(){const inverseNormalLength=1/this.normal.length();return this.normal.multiplyScalar(inverseNormalLength),this.constant*=inverseNormalLength,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(point){return this.normal.dot(point)+this.constant}distanceToSphere(sphere){return this.distanceToPoint(sphere.center)-sphere.radius}projectPoint(point,target){return target.copy(point).addScaledVector(this.normal,-this.distanceToPoint(point))}intersectLine(line,target){const direction=line.delta(_vector1),denominator=this.normal.dot(direction);if(0===denominator)return 0===this.distanceToPoint(line.start)?target.copy(line.start):null;const t=-(line.start.dot(this.normal)+this.constant)/denominator;return t<0||t>1?null:target.copy(line.start).addScaledVector(direction,t)}intersectsLine(line){const startSign=this.distanceToPoint(line.start),endSign=this.distanceToPoint(line.end);return startSign<0&&endSign>0||endSign<0&&startSign>0}intersectsBox(box){return box.intersectsPlane(this)}intersectsSphere(sphere){return sphere.intersectsPlane(this)}coplanarPoint(target){return target.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(matrix,optionalNormalMatrix){const normalMatrix=optionalNormalMatrix||_normalMatrix.getNormalMatrix(matrix),referencePoint=this.coplanarPoint(_vector1).applyMatrix4(matrix),normal=this.normal.applyMatrix3(normalMatrix).normalize();return this.constant=-referencePoint.dot(normal),this}translate(offset){return this.constant-=offset.dot(this.normal),this}equals(plane){return plane.normal.equals(this.normal)&&plane.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const _sphere$5=new Sphere,_vector$7=new Vector3;class Frustum{constructor(p0=new Plane,p1=new Plane,p2=new Plane,p3=new Plane,p4=new Plane,p5=new Plane){this.planes=[p0,p1,p2,p3,p4,p5]}set(p0,p1,p2,p3,p4,p5){const planes=this.planes;return planes[0].copy(p0),planes[1].copy(p1),planes[2].copy(p2),planes[3].copy(p3),planes[4].copy(p4),planes[5].copy(p5),this}copy(frustum){const planes=this.planes;for(let i=0;i<6;i++)planes[i].copy(frustum.planes[i]);return this}setFromProjectionMatrix(m,coordinateSystem=WebGLCoordinateSystem){const planes=this.planes,me=m.elements,me0=me[0],me1=me[1],me2=me[2],me3=me[3],me4=me[4],me5=me[5],me6=me[6],me7=me[7],me8=me[8],me9=me[9],me10=me[10],me11=me[11],me12=me[12],me13=me[13],me14=me[14],me15=me[15];if(planes[0].setComponents(me3-me0,me7-me4,me11-me8,me15-me12).normalize(),planes[1].setComponents(me3+me0,me7+me4,me11+me8,me15+me12).normalize(),planes[2].setComponents(me3+me1,me7+me5,me11+me9,me15+me13).normalize(),planes[3].setComponents(me3-me1,me7-me5,me11-me9,me15-me13).normalize(),planes[4].setComponents(me3-me2,me7-me6,me11-me10,me15-me14).normalize(),coordinateSystem===WebGLCoordinateSystem)planes[5].setComponents(me3+me2,me7+me6,me11+me10,me15+me14).normalize();else{if(coordinateSystem!==WebGPUCoordinateSystem)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+coordinateSystem);planes[5].setComponents(me2,me6,me10,me14).normalize()}return this}intersectsObject(object){if(void 0!==object.boundingSphere)null===object.boundingSphere&&object.computeBoundingSphere(),_sphere$5.copy(object.boundingSphere).applyMatrix4(object.matrixWorld);else{const geometry=object.geometry;null===geometry.boundingSphere&&geometry.computeBoundingSphere(),_sphere$5.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld)}return this.intersectsSphere(_sphere$5)}intersectsSprite(sprite){return _sphere$5.center.set(0,0,0),_sphere$5.radius=.7071067811865476,_sphere$5.applyMatrix4(sprite.matrixWorld),this.intersectsSphere(_sphere$5)}intersectsSphere(sphere){const planes=this.planes,center=sphere.center,negRadius=-sphere.radius;for(let i=0;i<6;i++){if(planes[i].distanceToPoint(center)0?box.max.x:box.min.x,_vector$7.y=plane.normal.y>0?box.max.y:box.min.y,_vector$7.z=plane.normal.z>0?box.max.z:box.min.z,plane.distanceToPoint(_vector$7)<0)return!1}return!0}containsPoint(point){const planes=this.planes;for(let i=0;i<6;i++)if(planes[i].distanceToPoint(point)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let context=null,isAnimating=!1,animationLoop=null,requestId=null;function onAnimationFrame(time,frame){animationLoop(time,frame),requestId=context.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==isAnimating&&null!==animationLoop&&(requestId=context.requestAnimationFrame(onAnimationFrame),isAnimating=!0)},stop:function(){context.cancelAnimationFrame(requestId),isAnimating=!1},setAnimationLoop:function(callback){animationLoop=callback},setContext:function(value){context=value}}}function WebGLAttributes(gl){const buffers=new WeakMap;return{get:function get(attribute){return attribute.isInterleavedBufferAttribute&&(attribute=attribute.data),buffers.get(attribute)},remove:function remove(attribute){attribute.isInterleavedBufferAttribute&&(attribute=attribute.data);const data=buffers.get(attribute);data&&(gl.deleteBuffer(data.buffer),buffers.delete(attribute))},update:function update(attribute,bufferType){if(attribute.isGLBufferAttribute){const cached=buffers.get(attribute);return void((!cached||cached.version 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_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\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}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\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 );\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\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\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\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:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\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}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\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 = inverseTransformDirection( 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 * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\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\t\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 = inverseTransformDirection( 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, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( 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 = inverseTransformDirection( 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 = inverseTransformDirection( 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",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 * ( 1.0 - 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 = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), 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.07, 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:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\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#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\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\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.specularColor;\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 * transposeMat3( 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 a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\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}\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.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\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\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\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\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\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 );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\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 )\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#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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\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\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",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\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 = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\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#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\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#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\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\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#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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( 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( 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\treturn depth * ( near - far ) - near;\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\treturn ( near * far ) / ( ( far - near ) * depth - far );\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\tuniform sampler2D directionalShadowMap[ 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\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\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 sampler2D pointShadowMap[ 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\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D 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\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\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\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\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\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 OptimizedCineonToneMapping( 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 = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, 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\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\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\n\t\t#else\n\t\t\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\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 \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \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 flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\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 \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \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 \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\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#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), 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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},UniformsLib={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:ShaderChunk.backgroundCube_vert,fragmentShader:ShaderChunk.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};const _rgb={r:0,b:0,g:0},_e1$1=new Euler,_m1$1=new Matrix4;function WebGLBackground(renderer,cubemaps,cubeuvmaps,state,objects,alpha,premultipliedAlpha){const clearColor=new Color(0);let planeMesh,boxMesh,clearAlpha=!0===alpha?0:1,currentBackground=null,currentBackgroundVersion=0,currentTonemapping=null;function getBackground(scene){let background=!0===scene.isScene?scene.background:null;if(background&&background.isTexture){background=(scene.backgroundBlurriness>0?cubeuvmaps:cubemaps).get(background)}return background}function setClear(color,alpha){color.getRGB(_rgb,getUnlitUniformColorSpace(renderer)),state.buffers.color.setClear(_rgb.r,_rgb.g,_rgb.b,alpha,premultipliedAlpha)}return{getClearColor:function(){return clearColor},setClearColor:function(color,alpha=1){clearColor.set(color),clearAlpha=alpha,setClear(clearColor,clearAlpha)},getClearAlpha:function(){return clearAlpha},setClearAlpha:function(alpha){clearAlpha=alpha,setClear(clearColor,clearAlpha)},render:function render(scene){let forceClear=!1;const background=getBackground(scene);null===background?setClear(clearColor,clearAlpha):background&&background.isColor&&(setClear(background,1),forceClear=!0);const environmentBlendMode=renderer.xr.getEnvironmentBlendMode();"additive"===environmentBlendMode?state.buffers.color.setClear(0,0,0,1,premultipliedAlpha):"alpha-blend"===environmentBlendMode&&state.buffers.color.setClear(0,0,0,0,premultipliedAlpha),(renderer.autoClear||forceClear)&&(state.buffers.depth.setTest(!0),state.buffers.depth.setMask(!0),state.buffers.color.setMask(!0),renderer.clear(renderer.autoClearColor,renderer.autoClearDepth,renderer.autoClearStencil))},addToRenderList:function addToRenderList(renderList,scene){const background=getBackground(scene);background&&(background.isCubeTexture||background.mapping===CubeUVReflectionMapping)?(void 0===boxMesh&&(boxMesh=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.backgroundCube.uniforms),vertexShader:ShaderLib.backgroundCube.vertexShader,fragmentShader:ShaderLib.backgroundCube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),boxMesh.geometry.deleteAttribute("normal"),boxMesh.geometry.deleteAttribute("uv"),boxMesh.onBeforeRender=function(renderer,scene,camera){this.matrixWorld.copyPosition(camera.matrixWorld)},Object.defineProperty(boxMesh.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),objects.update(boxMesh)),_e1$1.copy(scene.backgroundRotation),_e1$1.x*=-1,_e1$1.y*=-1,_e1$1.z*=-1,background.isCubeTexture&&!1===background.isRenderTargetTexture&&(_e1$1.y*=-1,_e1$1.z*=-1),boxMesh.material.uniforms.envMap.value=background,boxMesh.material.uniforms.flipEnvMap.value=background.isCubeTexture&&!1===background.isRenderTargetTexture?-1:1,boxMesh.material.uniforms.backgroundBlurriness.value=scene.backgroundBlurriness,boxMesh.material.uniforms.backgroundIntensity.value=scene.backgroundIntensity,boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$1.makeRotationFromEuler(_e1$1)),boxMesh.material.toneMapped=ColorManagement.getTransfer(background.colorSpace)!==SRGBTransfer,currentBackground===background&¤tBackgroundVersion===background.version&¤tTonemapping===renderer.toneMapping||(boxMesh.material.needsUpdate=!0,currentBackground=background,currentBackgroundVersion=background.version,currentTonemapping=renderer.toneMapping),boxMesh.layers.enableAll(),renderList.unshift(boxMesh,boxMesh.geometry,boxMesh.material,0,0,null)):background&&background.isTexture&&(void 0===planeMesh&&(planeMesh=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),planeMesh.geometry.deleteAttribute("normal"),Object.defineProperty(planeMesh.material,"map",{get:function(){return this.uniforms.t2D.value}}),objects.update(planeMesh)),planeMesh.material.uniforms.t2D.value=background,planeMesh.material.uniforms.backgroundIntensity.value=scene.backgroundIntensity,planeMesh.material.toneMapped=ColorManagement.getTransfer(background.colorSpace)!==SRGBTransfer,!0===background.matrixAutoUpdate&&background.updateMatrix(),planeMesh.material.uniforms.uvTransform.value.copy(background.matrix),currentBackground===background&¤tBackgroundVersion===background.version&¤tTonemapping===renderer.toneMapping||(planeMesh.material.needsUpdate=!0,currentBackground=background,currentBackgroundVersion=background.version,currentTonemapping=renderer.toneMapping),planeMesh.layers.enableAll(),renderList.unshift(planeMesh,planeMesh.geometry,planeMesh.material,0,0,null))}}}function WebGLBindingStates(gl,attributes){const maxVertexAttributes=gl.getParameter(gl.MAX_VERTEX_ATTRIBS),bindingStates={},defaultState=createBindingState(null);let currentState=defaultState,forceUpdate=!1;function bindVertexArrayObject(vao){return gl.bindVertexArray(vao)}function deleteVertexArrayObject(vao){return gl.deleteVertexArray(vao)}function createBindingState(vao){const newAttributes=[],enabledAttributes=[],attributeDivisors=[];for(let i=0;i=0){const cachedAttribute=cachedAttributes[name];let geometryAttribute=geometryAttributes[name];if(void 0===geometryAttribute&&("instanceMatrix"===name&&object.instanceMatrix&&(geometryAttribute=object.instanceMatrix),"instanceColor"===name&&object.instanceColor&&(geometryAttribute=object.instanceColor)),void 0===cachedAttribute)return!0;if(cachedAttribute.attribute!==geometryAttribute)return!0;if(geometryAttribute&&cachedAttribute.data!==geometryAttribute.data)return!0;attributesNum++}}return currentState.attributesNum!==attributesNum||currentState.index!==index}(object,geometry,program,index),updateBuffers&&function saveCache(object,geometry,program,index){const cache={},attributes=geometry.attributes;let attributesNum=0;const programAttributes=program.getAttributes();for(const name in programAttributes){if(programAttributes[name].location>=0){let attribute=attributes[name];void 0===attribute&&("instanceMatrix"===name&&object.instanceMatrix&&(attribute=object.instanceMatrix),"instanceColor"===name&&object.instanceColor&&(attribute=object.instanceColor));const data={};data.attribute=attribute,attribute&&attribute.data&&(data.data=attribute.data),cache[name]=data,attributesNum++}}currentState.attributes=cache,currentState.attributesNum=attributesNum,currentState.index=index}(object,geometry,program,index),null!==index&&attributes.update(index,gl.ELEMENT_ARRAY_BUFFER),(updateBuffers||forceUpdate)&&(forceUpdate=!1,function setupVertexAttributes(object,material,program,geometry){initAttributes();const geometryAttributes=geometry.attributes,programAttributes=program.getAttributes(),materialDefaultAttributeValues=material.defaultAttributeValues;for(const name in programAttributes){const programAttribute=programAttributes[name];if(programAttribute.location>=0){let geometryAttribute=geometryAttributes[name];if(void 0===geometryAttribute&&("instanceMatrix"===name&&object.instanceMatrix&&(geometryAttribute=object.instanceMatrix),"instanceColor"===name&&object.instanceColor&&(geometryAttribute=object.instanceColor)),void 0!==geometryAttribute){const normalized=geometryAttribute.normalized,size=geometryAttribute.itemSize,attribute=attributes.get(geometryAttribute);if(void 0===attribute)continue;const buffer=attribute.buffer,type=attribute.type,bytesPerElement=attribute.bytesPerElement,integer=type===gl.INT||type===gl.UNSIGNED_INT||geometryAttribute.gpuType===IntType;if(geometryAttribute.isInterleavedBufferAttribute){const data=geometryAttribute.data,stride=data.stride,offset=geometryAttribute.offset;if(data.isInstancedInterleavedBuffer){for(let i=0;i0&&gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT).precision>0)return"highp";precision="mediump"}return"mediump"===precision&&gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_FLOAT).precision>0&&gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let precision=void 0!==parameters.precision?parameters.precision:"highp";const maxPrecision=getMaxPrecision(precision);maxPrecision!==precision&&(console.warn("THREE.WebGLRenderer:",precision,"not supported, using",maxPrecision,"instead."),precision=maxPrecision);const logarithmicDepthBuffer=!0===parameters.logarithmicDepthBuffer,maxTextures=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures=gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function getMaxAnisotropy(){if(void 0!==maxAnisotropy)return maxAnisotropy;if(!0===extensions.has("EXT_texture_filter_anisotropic")){const extension=extensions.get("EXT_texture_filter_anisotropic");maxAnisotropy=gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else maxAnisotropy=0;return maxAnisotropy},getMaxPrecision:getMaxPrecision,textureFormatReadable:function textureFormatReadable(textureFormat){return textureFormat===RGBAFormat||utils.convert(textureFormat)===gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function textureTypeReadable(textureType){const halfFloatSupportedByExt=textureType===HalfFloatType&&(extensions.has("EXT_color_buffer_half_float")||extensions.has("EXT_color_buffer_float"));return!(textureType!==UnsignedByteType&&utils.convert(textureType)!==gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE)&&textureType!==FloatType&&!halfFloatSupportedByExt)},precision:precision,logarithmicDepthBuffer:logarithmicDepthBuffer,maxTextures:maxTextures,maxVertexTextures:maxVertexTextures,maxTextureSize:gl.getParameter(gl.MAX_TEXTURE_SIZE),maxCubemapSize:gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:gl.getParameter(gl.MAX_VERTEX_ATTRIBS),maxVertexUniforms:gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:gl.getParameter(gl.MAX_VARYING_VECTORS),maxFragmentUniforms:gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:maxVertexTextures>0,maxSamples:gl.getParameter(gl.MAX_SAMPLES)}}function WebGLClipping(properties){const scope=this;let globalState=null,numGlobalPlanes=0,localClippingEnabled=!1,renderingShadows=!1;const plane=new Plane,viewNormalMatrix=new Matrix3,uniform={value:null,needsUpdate:!1};function projectPlanes(planes,camera,dstOffset,skipTransform){const nPlanes=null!==planes?planes.length:0;let dstArray=null;if(0!==nPlanes){if(dstArray=uniform.value,!0!==skipTransform||null===dstArray){const flatSize=dstOffset+4*nPlanes,viewMatrix=camera.matrixWorldInverse;viewNormalMatrix.getNormalMatrix(viewMatrix),(null===dstArray||dstArray.length0);scope.numPlanes=numGlobalPlanes,scope.numIntersection=0}();else{const nGlobal=renderingShadows?0:numGlobalPlanes,lGlobal=4*nGlobal;let dstArray=materialProperties.clippingState||null;uniform.value=dstArray,dstArray=projectPlanes(planes,camera,lGlobal,useCache);for(let i=0;i!==lGlobal;++i)dstArray[i]=globalState[i];materialProperties.clippingState=dstArray,this.numIntersection=clipIntersection?this.numPlanes:0,this.numPlanes+=nGlobal}}}function WebGLCubeMaps(renderer){let cubemaps=new WeakMap;function mapTextureMapping(texture,mapping){return mapping===EquirectangularReflectionMapping?texture.mapping=CubeReflectionMapping:mapping===EquirectangularRefractionMapping&&(texture.mapping=CubeRefractionMapping),texture}function onTextureDispose(event){const texture=event.target;texture.removeEventListener("dispose",onTextureDispose);const cubemap=cubemaps.get(texture);void 0!==cubemap&&(cubemaps.delete(texture),cubemap.dispose())}return{get:function get(texture){if(texture&&texture.isTexture){const mapping=texture.mapping;if(mapping===EquirectangularReflectionMapping||mapping===EquirectangularRefractionMapping){if(cubemaps.has(texture)){return mapTextureMapping(cubemaps.get(texture).texture,texture.mapping)}{const image=texture.image;if(image&&image.height>0){const renderTarget=new WebGLCubeRenderTarget(image.height);return renderTarget.fromEquirectangularTexture(renderer,texture),cubemaps.set(texture,renderTarget),texture.addEventListener("dispose",onTextureDispose),mapTextureMapping(renderTarget.texture,texture.mapping)}return null}}}return texture},dispose:function dispose(){cubemaps=new WeakMap}}}class OrthographicCamera extends Camera{constructor(left=-1,right=1,top=1,bottom=-1,near=.1,far=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=left,this.right=right,this.top=top,this.bottom=bottom,this.near=near,this.far=far,this.updateProjectionMatrix()}copy(source,recursive){return super.copy(source,recursive),this.left=source.left,this.right=source.right,this.top=source.top,this.bottom=source.bottom,this.near=source.near,this.far=source.far,this.zoom=source.zoom,this.view=null===source.view?null:Object.assign({},source.view),this}setViewOffset(fullWidth,fullHeight,x,y,width,height){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=fullWidth,this.view.fullHeight=fullHeight,this.view.offsetX=x,this.view.offsetY=y,this.view.width=width,this.view.height=height,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const dx=(this.right-this.left)/(2*this.zoom),dy=(this.top-this.bottom)/(2*this.zoom),cx=(this.right+this.left)/2,cy=(this.top+this.bottom)/2;let left=cx-dx,right=cx+dx,top=cy+dy,bottom=cy-dy;if(null!==this.view&&this.view.enabled){const scaleW=(this.right-this.left)/this.view.fullWidth/this.zoom,scaleH=(this.top-this.bottom)/this.view.fullHeight/this.zoom;left+=scaleW*this.view.offsetX,right=left+scaleW*this.view.width,top-=scaleH*this.view.offsetY,bottom=top-scaleH*this.view.height}this.projectionMatrix.makeOrthographic(left,right,top,bottom,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(meta){const data=super.toJSON(meta);return data.object.zoom=this.zoom,data.object.left=this.left,data.object.right=this.right,data.object.top=this.top,data.object.bottom=this.bottom,data.object.near=this.near,data.object.far=this.far,null!==this.view&&(data.object.view=Object.assign({},this.view)),data}}const EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],_flatCamera=new OrthographicCamera,_clearColor=new Color;let _oldTarget=null,_oldActiveCubeFace=0,_oldActiveMipmapLevel=0,_oldXrEnabled=!1;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(-PHI,INV_PHI,0),new Vector3(PHI,INV_PHI,0),new Vector3(-INV_PHI,0,PHI),new Vector3(INV_PHI,0,PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(0,PHI,INV_PHI),new Vector3(-1,1,-1),new Vector3(1,1,-1),new Vector3(-1,1,1),new Vector3(1,1,1)];class PMREMGenerator{constructor(renderer){this._renderer=renderer,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(scene,sigma=0,near=.1,far=100){_oldTarget=this._renderer.getRenderTarget(),_oldActiveCubeFace=this._renderer.getActiveCubeFace(),_oldActiveMipmapLevel=this._renderer.getActiveMipmapLevel(),_oldXrEnabled=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const cubeUVRenderTarget=this._allocateTargets();return cubeUVRenderTarget.depthBuffer=!0,this._sceneToCubeUV(scene,near,far,cubeUVRenderTarget),sigma>0&&this._blur(cubeUVRenderTarget,0,0,sigma),this._applyPMREM(cubeUVRenderTarget),this._cleanup(cubeUVRenderTarget),cubeUVRenderTarget}fromEquirectangular(equirectangular,renderTarget=null){return this._fromTexture(equirectangular,renderTarget)}fromCubemap(cubemap,renderTarget=null){return this._fromTexture(cubemap,renderTarget)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(cubeSize){this._lodMax=Math.floor(Math.log2(cubeSize)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let i=0;ilodMax-4?sigma=EXTRA_LOD_SIGMA[i-lodMax+4-1]:0===i&&(sigma=0),sigmas.push(sigma);const texelSize=1/(sizeLod-2),min=-texelSize,max=1+texelSize,uv1=[min,min,max,min,max,max,min,min,max,max,min,max],cubeFaces=6,vertices=6,positionSize=3,uvSize=2,faceIndexSize=1,position=new Float32Array(positionSize*vertices*cubeFaces),uv=new Float32Array(uvSize*vertices*cubeFaces),faceIndex=new Float32Array(faceIndexSize*vertices*cubeFaces);for(let face=0;face2?0:-1,coordinates=[x,y,0,x+2/3,y,0,x+2/3,y+1,0,x,y,0,x+2/3,y+1,0,x,y+1,0];position.set(coordinates,positionSize*vertices*face),uv.set(uv1,uvSize*vertices*face);const fill=[face,face,face,face,face,face];faceIndex.set(fill,faceIndexSize*vertices*face)}const planes=new BufferGeometry;planes.setAttribute("position",new BufferAttribute(position,positionSize)),planes.setAttribute("uv",new BufferAttribute(uv,uvSize)),planes.setAttribute("faceIndex",new BufferAttribute(faceIndex,faceIndexSize)),lodPlanes.push(planes),lod>4&&lod--}return{lodPlanes:lodPlanes,sizeLods:sizeLods,sigmas:sigmas}}(_lodMax)),this._blurMaterial=function _getBlurShader(lodMax,width,height){const weights=new Float32Array(20),poleAxis=new Vector3(0,1,0),shaderMaterial=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/width,CUBEUV_TEXEL_HEIGHT:1/height,CUBEUV_MAX_MIP:`${lodMax}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:weights},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:poleAxis}},vertexShader:_getCommonVertexShader(),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 \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:NoBlending,depthTest:!1,depthWrite:!1});return shaderMaterial}(_lodMax,width,height)}return cubeUVRenderTarget}_compileMaterial(material){const tmpMesh=new Mesh(this._lodPlanes[0],material);this._renderer.compile(tmpMesh,_flatCamera)}_sceneToCubeUV(scene,near,far,cubeUVRenderTarget){const cubeCamera=new PerspectiveCamera(90,1,near,far),upSign=[1,-1,1,1,1,1],forwardSign=[1,1,1,-1,-1,-1],renderer=this._renderer,originalAutoClear=renderer.autoClear,toneMapping=renderer.toneMapping;renderer.getClearColor(_clearColor),renderer.toneMapping=NoToneMapping,renderer.autoClear=!1;const backgroundMaterial=new MeshBasicMaterial({name:"PMREM.Background",side:BackSide,depthWrite:!1,depthTest:!1}),backgroundBox=new Mesh(new BoxGeometry,backgroundMaterial);let useSolidColor=!1;const background=scene.background;background?background.isColor&&(backgroundMaterial.color.copy(background),scene.background=null,useSolidColor=!0):(backgroundMaterial.color.copy(_clearColor),useSolidColor=!0);for(let i=0;i<6;i++){const col=i%3;0===col?(cubeCamera.up.set(0,upSign[i],0),cubeCamera.lookAt(forwardSign[i],0,0)):1===col?(cubeCamera.up.set(0,0,upSign[i]),cubeCamera.lookAt(0,forwardSign[i],0)):(cubeCamera.up.set(0,upSign[i],0),cubeCamera.lookAt(0,0,forwardSign[i]));const size=this._cubeSize;_setViewport(cubeUVRenderTarget,col*size,i>2?size:0,size,size),renderer.setRenderTarget(cubeUVRenderTarget),useSolidColor&&renderer.render(backgroundBox,cubeCamera),renderer.render(scene,cubeCamera)}backgroundBox.geometry.dispose(),backgroundBox.material.dispose(),renderer.toneMapping=toneMapping,renderer.autoClear=originalAutoClear,scene.background=background}_textureToCubeUV(texture,cubeUVRenderTarget){const renderer=this._renderer,isCubeTexture=texture.mapping===CubeReflectionMapping||texture.mapping===CubeRefractionMapping;isCubeTexture?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===texture.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const material=isCubeTexture?this._cubemapMaterial:this._equirectMaterial,mesh=new Mesh(this._lodPlanes[0],material);material.uniforms.envMap.value=texture;const size=this._cubeSize;_setViewport(cubeUVRenderTarget,0,0,3*size,2*size),renderer.setRenderTarget(cubeUVRenderTarget),renderer.render(mesh,_flatCamera)}_applyPMREM(cubeUVRenderTarget){const renderer=this._renderer,autoClear=renderer.autoClear;renderer.autoClear=!1;const n=this._lodPlanes.length;for(let i=1;i20&&console.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to 20`);const weights=[];let sum=0;for(let i=0;i<20;++i){const x=i/sigmaPixels,weight=Math.exp(-x*x/2);weights.push(weight),0===i?sum+=weight:i_lodMax-4?lodOut-_lodMax+4:0),4*(this._cubeSize-outputSize),3*outputSize,2*outputSize),renderer.setRenderTarget(targetOut),renderer.render(blurMesh,_flatCamera)}}function _createRenderTarget(width,height,params){const cubeUVRenderTarget=new WebGLRenderTarget(width,height,params);return cubeUVRenderTarget.texture.mapping=CubeUVReflectionMapping,cubeUVRenderTarget.texture.name="PMREM.cubeUv",cubeUVRenderTarget.scissorTest=!0,cubeUVRenderTarget}function _setViewport(target,x,y,width,height){target.viewport.set(x,y,width,height),target.scissor.set(x,y,width,height)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),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 \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:NoBlending,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),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:NoBlending,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){return"\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"}function WebGLCubeUVMaps(renderer){let cubeUVmaps=new WeakMap,pmremGenerator=null;function onTextureDispose(event){const texture=event.target;texture.removeEventListener("dispose",onTextureDispose);const cubemapUV=cubeUVmaps.get(texture);void 0!==cubemapUV&&(cubeUVmaps.delete(texture),cubemapUV.dispose())}return{get:function get(texture){if(texture&&texture.isTexture){const mapping=texture.mapping,isEquirectMap=mapping===EquirectangularReflectionMapping||mapping===EquirectangularRefractionMapping,isCubeMap=mapping===CubeReflectionMapping||mapping===CubeRefractionMapping;if(isEquirectMap||isCubeMap){let renderTarget=cubeUVmaps.get(texture);const currentPMREMVersion=void 0!==renderTarget?renderTarget.texture.pmremVersion:0;if(texture.isRenderTargetTexture&&texture.pmremVersion!==currentPMREMVersion)return null===pmremGenerator&&(pmremGenerator=new PMREMGenerator(renderer)),renderTarget=isEquirectMap?pmremGenerator.fromEquirectangular(texture,renderTarget):pmremGenerator.fromCubemap(texture,renderTarget),renderTarget.texture.pmremVersion=texture.pmremVersion,cubeUVmaps.set(texture,renderTarget),renderTarget.texture;if(void 0!==renderTarget)return renderTarget.texture;{const image=texture.image;return isEquirectMap&&image&&image.height>0||isCubeMap&&image&&function isCubeTextureComplete(image){let count=0;const length=6;for(let i=0;icapabilities.maxTextureSize&&(height=Math.ceil(width/capabilities.maxTextureSize),width=capabilities.maxTextureSize);const buffer=new Float32Array(width*height*4*morphTargetsCount),texture=new DataArrayTexture(buffer,width,height,morphTargetsCount);texture.type=FloatType,texture.needsUpdate=!0;const vertexDataStride=4*vertexDataCount;for(let i=0;i0)return array;const n=nBlocks*blockSize;let r=arrayCacheF32[n];if(void 0===r&&(r=new Float32Array(n),arrayCacheF32[n]=r),0!==nBlocks){firstElem.toArray(r,0);for(let i=1,offset=0;i!==nBlocks;++i)offset+=blockSize,array[i].toArray(r,offset)}return r}function arraysEqual(a,b){if(a.length!==b.length)return!1;for(let i=0,l=a.length;i":" "} ${line}: ${lines[i]}`)}return lines2.join("\n")}(gl.getShaderSource(shader),errorLine)}return errors}function getTexelEncodingFunction(functionName,colorSpace){const components=function getEncodingComponents(colorSpace){const workingPrimaries=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),encodingPrimaries=ColorManagement.getPrimaries(colorSpace);let gamutMapping;switch(workingPrimaries===encodingPrimaries?gamutMapping="":workingPrimaries===P3Primaries&&encodingPrimaries===Rec709Primaries?gamutMapping="LinearDisplayP3ToLinearSRGB":workingPrimaries===Rec709Primaries&&encodingPrimaries===P3Primaries&&(gamutMapping="LinearSRGBToLinearDisplayP3"),colorSpace){case LinearSRGBColorSpace:case LinearDisplayP3ColorSpace:return[gamutMapping,"LinearTransferOETF"];case SRGBColorSpace:case DisplayP3ColorSpace:return[gamutMapping,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",colorSpace),[gamutMapping,"LinearTransferOETF"]}}(colorSpace);return`vec4 ${functionName}( vec4 value ) { return ${components[0]}( ${components[1]}( value ) ); }`}function getToneMappingFunction(functionName,toneMapping){let toneMappingName;switch(toneMapping){case LinearToneMapping:toneMappingName="Linear";break;case ReinhardToneMapping:toneMappingName="Reinhard";break;case CineonToneMapping:toneMappingName="OptimizedCineon";break;case ACESFilmicToneMapping:toneMappingName="ACESFilmic";break;case AgXToneMapping:toneMappingName="AgX";break;case NeutralToneMapping:toneMappingName="Neutral";break;case CustomToneMapping:toneMappingName="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",toneMapping),toneMappingName="Linear"}return"vec3 "+functionName+"( vec3 color ) { return "+toneMappingName+"ToneMapping( color ); }"}function filterEmptyLine(string){return""!==string}function replaceLightNums(string,parameters){const numSpotLightCoords=parameters.numSpotLightShadows+parameters.numSpotLightMaps-parameters.numSpotLightShadowsWithMaps;return string.replace(/NUM_DIR_LIGHTS/g,parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g,parameters.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,parameters.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,numSpotLightCoords).replace(/NUM_RECT_AREA_LIGHTS/g,parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g,parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,parameters.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,parameters.numPointLightShadows)}function replaceClippingPlaneNums(string,parameters){return string.replace(/NUM_CLIPPING_PLANES/g,parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,parameters.numClippingPlanes-parameters.numClipIntersection)}const includePattern=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(string){return string.replace(includePattern,includeReplacer)}const shaderChunkMap=new Map;function includeReplacer(match,include){let string=ShaderChunk[include];if(void 0===string){const newInclude=shaderChunkMap.get(include);if(void 0===newInclude)throw new Error("Can not resolve #include <"+include+">");string=ShaderChunk[newInclude],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',include,newInclude)}return resolveIncludes(string)}const unrollLoopPattern=/#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 unrollLoops(string){return string.replace(unrollLoopPattern,loopReplacer)}function loopReplacer(match,start,end,snippet){let string="";for(let i=parseInt(start);i0&&(prefixVertex+="\n"),prefixFragment=["#define SHADER_TYPE "+parameters.shaderType,"#define SHADER_NAME "+parameters.shaderName,customDefines].filter(filterEmptyLine).join("\n"),prefixFragment.length>0&&(prefixFragment+="\n")):(prefixVertex=[generatePrecision(parameters),"#define SHADER_TYPE "+parameters.shaderType,"#define SHADER_NAME "+parameters.shaderName,customDefines,parameters.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",parameters.batching?"#define USE_BATCHING":"",parameters.batchingColor?"#define USE_BATCHING_COLOR":"",parameters.instancing?"#define USE_INSTANCING":"",parameters.instancingColor?"#define USE_INSTANCING_COLOR":"",parameters.instancingMorph?"#define USE_INSTANCING_MORPH":"",parameters.useFog&¶meters.fog?"#define USE_FOG":"",parameters.useFog&¶meters.fogExp2?"#define FOG_EXP2":"",parameters.map?"#define USE_MAP":"",parameters.envMap?"#define USE_ENVMAP":"",parameters.envMap?"#define "+envMapModeDefine:"",parameters.lightMap?"#define USE_LIGHTMAP":"",parameters.aoMap?"#define USE_AOMAP":"",parameters.bumpMap?"#define USE_BUMPMAP":"",parameters.normalMap?"#define USE_NORMALMAP":"",parameters.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",parameters.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",parameters.displacementMap?"#define USE_DISPLACEMENTMAP":"",parameters.emissiveMap?"#define USE_EMISSIVEMAP":"",parameters.anisotropy?"#define USE_ANISOTROPY":"",parameters.anisotropyMap?"#define USE_ANISOTROPYMAP":"",parameters.clearcoatMap?"#define USE_CLEARCOATMAP":"",parameters.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",parameters.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",parameters.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",parameters.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",parameters.specularMap?"#define USE_SPECULARMAP":"",parameters.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",parameters.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",parameters.roughnessMap?"#define USE_ROUGHNESSMAP":"",parameters.metalnessMap?"#define USE_METALNESSMAP":"",parameters.alphaMap?"#define USE_ALPHAMAP":"",parameters.alphaHash?"#define USE_ALPHAHASH":"",parameters.transmission?"#define USE_TRANSMISSION":"",parameters.transmissionMap?"#define USE_TRANSMISSIONMAP":"",parameters.thicknessMap?"#define USE_THICKNESSMAP":"",parameters.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",parameters.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",parameters.mapUv?"#define MAP_UV "+parameters.mapUv:"",parameters.alphaMapUv?"#define ALPHAMAP_UV "+parameters.alphaMapUv:"",parameters.lightMapUv?"#define LIGHTMAP_UV "+parameters.lightMapUv:"",parameters.aoMapUv?"#define AOMAP_UV "+parameters.aoMapUv:"",parameters.emissiveMapUv?"#define EMISSIVEMAP_UV "+parameters.emissiveMapUv:"",parameters.bumpMapUv?"#define BUMPMAP_UV "+parameters.bumpMapUv:"",parameters.normalMapUv?"#define NORMALMAP_UV "+parameters.normalMapUv:"",parameters.displacementMapUv?"#define DISPLACEMENTMAP_UV "+parameters.displacementMapUv:"",parameters.metalnessMapUv?"#define METALNESSMAP_UV "+parameters.metalnessMapUv:"",parameters.roughnessMapUv?"#define ROUGHNESSMAP_UV "+parameters.roughnessMapUv:"",parameters.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+parameters.anisotropyMapUv:"",parameters.clearcoatMapUv?"#define CLEARCOATMAP_UV "+parameters.clearcoatMapUv:"",parameters.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+parameters.clearcoatNormalMapUv:"",parameters.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+parameters.clearcoatRoughnessMapUv:"",parameters.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+parameters.iridescenceMapUv:"",parameters.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+parameters.iridescenceThicknessMapUv:"",parameters.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+parameters.sheenColorMapUv:"",parameters.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+parameters.sheenRoughnessMapUv:"",parameters.specularMapUv?"#define SPECULARMAP_UV "+parameters.specularMapUv:"",parameters.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+parameters.specularColorMapUv:"",parameters.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+parameters.specularIntensityMapUv:"",parameters.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+parameters.transmissionMapUv:"",parameters.thicknessMapUv?"#define THICKNESSMAP_UV "+parameters.thicknessMapUv:"",parameters.vertexTangents&&!1===parameters.flatShading?"#define USE_TANGENT":"",parameters.vertexColors?"#define USE_COLOR":"",parameters.vertexAlphas?"#define USE_COLOR_ALPHA":"",parameters.vertexUv1s?"#define USE_UV1":"",parameters.vertexUv2s?"#define USE_UV2":"",parameters.vertexUv3s?"#define USE_UV3":"",parameters.pointsUvs?"#define USE_POINTS_UV":"",parameters.flatShading?"#define FLAT_SHADED":"",parameters.skinning?"#define USE_SKINNING":"",parameters.morphTargets?"#define USE_MORPHTARGETS":"",parameters.morphNormals&&!1===parameters.flatShading?"#define USE_MORPHNORMALS":"",parameters.morphColors?"#define USE_MORPHCOLORS":"",parameters.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+parameters.morphTextureStride:"",parameters.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+parameters.morphTargetsCount:"",parameters.doubleSided?"#define DOUBLE_SIDED":"",parameters.flipSided?"#define FLIP_SIDED":"",parameters.shadowMapEnabled?"#define USE_SHADOWMAP":"",parameters.shadowMapEnabled?"#define "+shadowMapTypeDefine:"",parameters.sizeAttenuation?"#define USE_SIZEATTENUATION":"",parameters.numLightProbes>0?"#define USE_LIGHT_PROBES":"",parameters.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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(filterEmptyLine).join("\n"),prefixFragment=[generatePrecision(parameters),"#define SHADER_TYPE "+parameters.shaderType,"#define SHADER_NAME "+parameters.shaderName,customDefines,parameters.useFog&¶meters.fog?"#define USE_FOG":"",parameters.useFog&¶meters.fogExp2?"#define FOG_EXP2":"",parameters.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",parameters.map?"#define USE_MAP":"",parameters.matcap?"#define USE_MATCAP":"",parameters.envMap?"#define USE_ENVMAP":"",parameters.envMap?"#define "+envMapTypeDefine:"",parameters.envMap?"#define "+envMapModeDefine:"",parameters.envMap?"#define "+envMapBlendingDefine:"",envMapCubeUVSize?"#define CUBEUV_TEXEL_WIDTH "+envMapCubeUVSize.texelWidth:"",envMapCubeUVSize?"#define CUBEUV_TEXEL_HEIGHT "+envMapCubeUVSize.texelHeight:"",envMapCubeUVSize?"#define CUBEUV_MAX_MIP "+envMapCubeUVSize.maxMip+".0":"",parameters.lightMap?"#define USE_LIGHTMAP":"",parameters.aoMap?"#define USE_AOMAP":"",parameters.bumpMap?"#define USE_BUMPMAP":"",parameters.normalMap?"#define USE_NORMALMAP":"",parameters.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",parameters.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",parameters.emissiveMap?"#define USE_EMISSIVEMAP":"",parameters.anisotropy?"#define USE_ANISOTROPY":"",parameters.anisotropyMap?"#define USE_ANISOTROPYMAP":"",parameters.clearcoat?"#define USE_CLEARCOAT":"",parameters.clearcoatMap?"#define USE_CLEARCOATMAP":"",parameters.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",parameters.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",parameters.dispersion?"#define USE_DISPERSION":"",parameters.iridescence?"#define USE_IRIDESCENCE":"",parameters.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",parameters.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",parameters.specularMap?"#define USE_SPECULARMAP":"",parameters.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",parameters.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",parameters.roughnessMap?"#define USE_ROUGHNESSMAP":"",parameters.metalnessMap?"#define USE_METALNESSMAP":"",parameters.alphaMap?"#define USE_ALPHAMAP":"",parameters.alphaTest?"#define USE_ALPHATEST":"",parameters.alphaHash?"#define USE_ALPHAHASH":"",parameters.sheen?"#define USE_SHEEN":"",parameters.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",parameters.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",parameters.transmission?"#define USE_TRANSMISSION":"",parameters.transmissionMap?"#define USE_TRANSMISSIONMAP":"",parameters.thicknessMap?"#define USE_THICKNESSMAP":"",parameters.vertexTangents&&!1===parameters.flatShading?"#define USE_TANGENT":"",parameters.vertexColors||parameters.instancingColor||parameters.batchingColor?"#define USE_COLOR":"",parameters.vertexAlphas?"#define USE_COLOR_ALPHA":"",parameters.vertexUv1s?"#define USE_UV1":"",parameters.vertexUv2s?"#define USE_UV2":"",parameters.vertexUv3s?"#define USE_UV3":"",parameters.pointsUvs?"#define USE_POINTS_UV":"",parameters.gradientMap?"#define USE_GRADIENTMAP":"",parameters.flatShading?"#define FLAT_SHADED":"",parameters.doubleSided?"#define DOUBLE_SIDED":"",parameters.flipSided?"#define FLIP_SIDED":"",parameters.shadowMapEnabled?"#define USE_SHADOWMAP":"",parameters.shadowMapEnabled?"#define "+shadowMapTypeDefine:"",parameters.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",parameters.numLightProbes>0?"#define USE_LIGHT_PROBES":"",parameters.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",parameters.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",parameters.toneMapping!==NoToneMapping?"#define TONE_MAPPING":"",parameters.toneMapping!==NoToneMapping?ShaderChunk.tonemapping_pars_fragment:"",parameters.toneMapping!==NoToneMapping?getToneMappingFunction("toneMapping",parameters.toneMapping):"",parameters.dithering?"#define DITHERING":"",parameters.opaque?"#define OPAQUE":"",ShaderChunk.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",parameters.outputColorSpace),parameters.useDepthPacking?"#define DEPTH_PACKING "+parameters.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),vertexShader=resolveIncludes(vertexShader),vertexShader=replaceLightNums(vertexShader,parameters),vertexShader=replaceClippingPlaneNums(vertexShader,parameters),fragmentShader=resolveIncludes(fragmentShader),fragmentShader=replaceLightNums(fragmentShader,parameters),fragmentShader=replaceClippingPlaneNums(fragmentShader,parameters),vertexShader=unrollLoops(vertexShader),fragmentShader=unrollLoops(fragmentShader),!0!==parameters.isRawShaderMaterial&&(versionString="#version 300 es\n",prefixVertex=[customVertexExtensions,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+prefixVertex,prefixFragment=["#define varying in",parameters.glslVersion===GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",parameters.glslVersion===GLSL3?"":"#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"+prefixFragment);const vertexGlsl=versionString+prefixVertex+vertexShader,fragmentGlsl=versionString+prefixFragment+fragmentShader,glVertexShader=WebGLShader(gl,gl.VERTEX_SHADER,vertexGlsl),glFragmentShader=WebGLShader(gl,gl.FRAGMENT_SHADER,fragmentGlsl);function onFirstUse(self){if(renderer.debug.checkShaderErrors){const programLog=gl.getProgramInfoLog(program).trim(),vertexLog=gl.getShaderInfoLog(glVertexShader).trim(),fragmentLog=gl.getShaderInfoLog(glFragmentShader).trim();let runnable=!0,haveDiagnostics=!0;if(!1===gl.getProgramParameter(program,gl.LINK_STATUS))if(runnable=!1,"function"==typeof renderer.debug.onShaderError)renderer.debug.onShaderError(gl,program,glVertexShader,glFragmentShader);else{const vertexErrors=getShaderErrors(gl,glVertexShader,"vertex"),fragmentErrors=getShaderErrors(gl,glFragmentShader,"fragment");console.error("THREE.WebGLProgram: Shader Error "+gl.getError()+" - VALIDATE_STATUS "+gl.getProgramParameter(program,gl.VALIDATE_STATUS)+"\n\nMaterial Name: "+self.name+"\nMaterial Type: "+self.type+"\n\nProgram Info Log: "+programLog+"\n"+vertexErrors+"\n"+fragmentErrors)}else""!==programLog?console.warn("THREE.WebGLProgram: Program Info Log:",programLog):""!==vertexLog&&""!==fragmentLog||(haveDiagnostics=!1);haveDiagnostics&&(self.diagnostics={runnable:runnable,programLog:programLog,vertexShader:{log:vertexLog,prefix:prefixVertex},fragmentShader:{log:fragmentLog,prefix:prefixFragment}})}gl.deleteShader(glVertexShader),gl.deleteShader(glFragmentShader),cachedUniforms=new WebGLUniforms(gl,program),cachedAttributes=function fetchAttributeLocations(gl,program){const attributes={},n=gl.getProgramParameter(program,gl.ACTIVE_ATTRIBUTES);for(let i=0;i0,HAS_CLEARCOAT=material.clearcoat>0,HAS_DISPERSION=material.dispersion>0,HAS_IRIDESCENCE=material.iridescence>0,HAS_SHEEN=material.sheen>0,HAS_TRANSMISSION=material.transmission>0,HAS_ANISOTROPYMAP=HAS_ANISOTROPY&&!!material.anisotropyMap,HAS_CLEARCOATMAP=HAS_CLEARCOAT&&!!material.clearcoatMap,HAS_CLEARCOAT_NORMALMAP=HAS_CLEARCOAT&&!!material.clearcoatNormalMap,HAS_CLEARCOAT_ROUGHNESSMAP=HAS_CLEARCOAT&&!!material.clearcoatRoughnessMap,HAS_IRIDESCENCEMAP=HAS_IRIDESCENCE&&!!material.iridescenceMap,HAS_IRIDESCENCE_THICKNESSMAP=HAS_IRIDESCENCE&&!!material.iridescenceThicknessMap,HAS_SHEEN_COLORMAP=HAS_SHEEN&&!!material.sheenColorMap,HAS_SHEEN_ROUGHNESSMAP=HAS_SHEEN&&!!material.sheenRoughnessMap,HAS_SPECULARMAP=!!material.specularMap,HAS_SPECULAR_COLORMAP=!!material.specularColorMap,HAS_SPECULAR_INTENSITYMAP=!!material.specularIntensityMap,HAS_TRANSMISSIONMAP=HAS_TRANSMISSION&&!!material.transmissionMap,HAS_THICKNESSMAP=HAS_TRANSMISSION&&!!material.thicknessMap,HAS_GRADIENTMAP=!!material.gradientMap,HAS_ALPHAMAP=!!material.alphaMap,HAS_ALPHATEST=material.alphaTest>0,HAS_ALPHAHASH=!!material.alphaHash,HAS_EXTENSIONS=!!material.extensions;let toneMapping=NoToneMapping;material.toneMapped&&(null!==currentRenderTarget&&!0!==currentRenderTarget.isXRRenderTarget||(toneMapping=renderer.toneMapping));const parameters={shaderID:shaderID,shaderType:material.type,shaderName:material.name,vertexShader:vertexShader,fragmentShader:fragmentShader,defines:material.defines,customVertexShaderID:customVertexShaderID,customFragmentShaderID:customFragmentShaderID,isRawShaderMaterial:!0===material.isRawShaderMaterial,glslVersion:material.glslVersion,precision:precision,batching:IS_BATCHEDMESH,batchingColor:IS_BATCHEDMESH&&null!==object._colorsTexture,instancing:IS_INSTANCEDMESH,instancingColor:IS_INSTANCEDMESH&&null!==object.instanceColor,instancingMorph:IS_INSTANCEDMESH&&null!==object.morphTexture,supportsVertexTextures:SUPPORTS_VERTEX_TEXTURES,outputColorSpace:null===currentRenderTarget?renderer.outputColorSpace:!0===currentRenderTarget.isXRRenderTarget?currentRenderTarget.texture.colorSpace:LinearSRGBColorSpace,alphaToCoverage:!!material.alphaToCoverage,map:HAS_MAP,matcap:HAS_MATCAP,envMap:HAS_ENVMAP,envMapMode:HAS_ENVMAP&&envMap.mapping,envMapCubeUVHeight:envMapCubeUVHeight,aoMap:HAS_AOMAP,lightMap:HAS_LIGHTMAP,bumpMap:HAS_BUMPMAP,normalMap:HAS_NORMALMAP,displacementMap:SUPPORTS_VERTEX_TEXTURES&&HAS_DISPLACEMENTMAP,emissiveMap:HAS_EMISSIVEMAP,normalMapObjectSpace:HAS_NORMALMAP&&material.normalMapType===ObjectSpaceNormalMap,normalMapTangentSpace:HAS_NORMALMAP&&material.normalMapType===TangentSpaceNormalMap,metalnessMap:HAS_METALNESSMAP,roughnessMap:HAS_ROUGHNESSMAP,anisotropy:HAS_ANISOTROPY,anisotropyMap:HAS_ANISOTROPYMAP,clearcoat:HAS_CLEARCOAT,clearcoatMap:HAS_CLEARCOATMAP,clearcoatNormalMap:HAS_CLEARCOAT_NORMALMAP,clearcoatRoughnessMap:HAS_CLEARCOAT_ROUGHNESSMAP,dispersion:HAS_DISPERSION,iridescence:HAS_IRIDESCENCE,iridescenceMap:HAS_IRIDESCENCEMAP,iridescenceThicknessMap:HAS_IRIDESCENCE_THICKNESSMAP,sheen:HAS_SHEEN,sheenColorMap:HAS_SHEEN_COLORMAP,sheenRoughnessMap:HAS_SHEEN_ROUGHNESSMAP,specularMap:HAS_SPECULARMAP,specularColorMap:HAS_SPECULAR_COLORMAP,specularIntensityMap:HAS_SPECULAR_INTENSITYMAP,transmission:HAS_TRANSMISSION,transmissionMap:HAS_TRANSMISSIONMAP,thicknessMap:HAS_THICKNESSMAP,gradientMap:HAS_GRADIENTMAP,opaque:!1===material.transparent&&material.blending===NormalBlending&&!1===material.alphaToCoverage,alphaMap:HAS_ALPHAMAP,alphaTest:HAS_ALPHATEST,alphaHash:HAS_ALPHAHASH,combine:material.combine,mapUv:HAS_MAP&&getChannel(material.map.channel),aoMapUv:HAS_AOMAP&&getChannel(material.aoMap.channel),lightMapUv:HAS_LIGHTMAP&&getChannel(material.lightMap.channel),bumpMapUv:HAS_BUMPMAP&&getChannel(material.bumpMap.channel),normalMapUv:HAS_NORMALMAP&&getChannel(material.normalMap.channel),displacementMapUv:HAS_DISPLACEMENTMAP&&getChannel(material.displacementMap.channel),emissiveMapUv:HAS_EMISSIVEMAP&&getChannel(material.emissiveMap.channel),metalnessMapUv:HAS_METALNESSMAP&&getChannel(material.metalnessMap.channel),roughnessMapUv:HAS_ROUGHNESSMAP&&getChannel(material.roughnessMap.channel),anisotropyMapUv:HAS_ANISOTROPYMAP&&getChannel(material.anisotropyMap.channel),clearcoatMapUv:HAS_CLEARCOATMAP&&getChannel(material.clearcoatMap.channel),clearcoatNormalMapUv:HAS_CLEARCOAT_NORMALMAP&&getChannel(material.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:HAS_CLEARCOAT_ROUGHNESSMAP&&getChannel(material.clearcoatRoughnessMap.channel),iridescenceMapUv:HAS_IRIDESCENCEMAP&&getChannel(material.iridescenceMap.channel),iridescenceThicknessMapUv:HAS_IRIDESCENCE_THICKNESSMAP&&getChannel(material.iridescenceThicknessMap.channel),sheenColorMapUv:HAS_SHEEN_COLORMAP&&getChannel(material.sheenColorMap.channel),sheenRoughnessMapUv:HAS_SHEEN_ROUGHNESSMAP&&getChannel(material.sheenRoughnessMap.channel),specularMapUv:HAS_SPECULARMAP&&getChannel(material.specularMap.channel),specularColorMapUv:HAS_SPECULAR_COLORMAP&&getChannel(material.specularColorMap.channel),specularIntensityMapUv:HAS_SPECULAR_INTENSITYMAP&&getChannel(material.specularIntensityMap.channel),transmissionMapUv:HAS_TRANSMISSIONMAP&&getChannel(material.transmissionMap.channel),thicknessMapUv:HAS_THICKNESSMAP&&getChannel(material.thicknessMap.channel),alphaMapUv:HAS_ALPHAMAP&&getChannel(material.alphaMap.channel),vertexTangents:!!geometry.attributes.tangent&&(HAS_NORMALMAP||HAS_ANISOTROPY),vertexColors:material.vertexColors,vertexAlphas:!0===material.vertexColors&&!!geometry.attributes.color&&4===geometry.attributes.color.itemSize,pointsUvs:!0===object.isPoints&&!!geometry.attributes.uv&&(HAS_MAP||HAS_ALPHAMAP),fog:!!fog,useFog:!0===material.fog,fogExp2:!!fog&&fog.isFogExp2,flatShading:!0===material.flatShading,sizeAttenuation:!0===material.sizeAttenuation,logarithmicDepthBuffer:logarithmicDepthBuffer,skinning:!0===object.isSkinnedMesh,morphTargets:void 0!==geometry.morphAttributes.position,morphNormals:void 0!==geometry.morphAttributes.normal,morphColors:void 0!==geometry.morphAttributes.color,morphTargetsCount:morphTargetsCount,morphTextureStride:morphTextureStride,numDirLights:lights.directional.length,numPointLights:lights.point.length,numSpotLights:lights.spot.length,numSpotLightMaps:lights.spotLightMap.length,numRectAreaLights:lights.rectArea.length,numHemiLights:lights.hemi.length,numDirLightShadows:lights.directionalShadowMap.length,numPointLightShadows:lights.pointShadowMap.length,numSpotLightShadows:lights.spotShadowMap.length,numSpotLightShadowsWithMaps:lights.numSpotLightShadowsWithMaps,numLightProbes:lights.numLightProbes,numClippingPlanes:clipping.numPlanes,numClipIntersection:clipping.numIntersection,dithering:material.dithering,shadowMapEnabled:renderer.shadowMap.enabled&&shadows.length>0,shadowMapType:renderer.shadowMap.type,toneMapping:toneMapping,decodeVideoTexture:HAS_MAP&&!0===material.map.isVideoTexture&&ColorManagement.getTransfer(material.map.colorSpace)===SRGBTransfer,premultipliedAlpha:material.premultipliedAlpha,doubleSided:material.side===DoubleSide,flipSided:material.side===BackSide,useDepthPacking:material.depthPacking>=0,depthPacking:material.depthPacking||0,index0AttributeName:material.index0AttributeName,extensionClipCullDistance:HAS_EXTENSIONS&&!0===material.extensions.clipCullDistance&&extensions.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(HAS_EXTENSIONS&&!0===material.extensions.multiDraw||IS_BATCHEDMESH)&&extensions.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:extensions.has("KHR_parallel_shader_compile"),customProgramCacheKey:material.customProgramCacheKey()};return parameters.vertexUv1s=_activeChannels.has(1),parameters.vertexUv2s=_activeChannels.has(2),parameters.vertexUv3s=_activeChannels.has(3),_activeChannels.clear(),parameters},getProgramCacheKey:function getProgramCacheKey(parameters){const array=[];if(parameters.shaderID?array.push(parameters.shaderID):(array.push(parameters.customVertexShaderID),array.push(parameters.customFragmentShaderID)),void 0!==parameters.defines)for(const name in parameters.defines)array.push(name),array.push(parameters.defines[name]);return!1===parameters.isRawShaderMaterial&&(!function getProgramCacheKeyParameters(array,parameters){array.push(parameters.precision),array.push(parameters.outputColorSpace),array.push(parameters.envMapMode),array.push(parameters.envMapCubeUVHeight),array.push(parameters.mapUv),array.push(parameters.alphaMapUv),array.push(parameters.lightMapUv),array.push(parameters.aoMapUv),array.push(parameters.bumpMapUv),array.push(parameters.normalMapUv),array.push(parameters.displacementMapUv),array.push(parameters.emissiveMapUv),array.push(parameters.metalnessMapUv),array.push(parameters.roughnessMapUv),array.push(parameters.anisotropyMapUv),array.push(parameters.clearcoatMapUv),array.push(parameters.clearcoatNormalMapUv),array.push(parameters.clearcoatRoughnessMapUv),array.push(parameters.iridescenceMapUv),array.push(parameters.iridescenceThicknessMapUv),array.push(parameters.sheenColorMapUv),array.push(parameters.sheenRoughnessMapUv),array.push(parameters.specularMapUv),array.push(parameters.specularColorMapUv),array.push(parameters.specularIntensityMapUv),array.push(parameters.transmissionMapUv),array.push(parameters.thicknessMapUv),array.push(parameters.combine),array.push(parameters.fogExp2),array.push(parameters.sizeAttenuation),array.push(parameters.morphTargetsCount),array.push(parameters.morphAttributeCount),array.push(parameters.numDirLights),array.push(parameters.numPointLights),array.push(parameters.numSpotLights),array.push(parameters.numSpotLightMaps),array.push(parameters.numHemiLights),array.push(parameters.numRectAreaLights),array.push(parameters.numDirLightShadows),array.push(parameters.numPointLightShadows),array.push(parameters.numSpotLightShadows),array.push(parameters.numSpotLightShadowsWithMaps),array.push(parameters.numLightProbes),array.push(parameters.shadowMapType),array.push(parameters.toneMapping),array.push(parameters.numClippingPlanes),array.push(parameters.numClipIntersection),array.push(parameters.depthPacking)}(array,parameters),function getProgramCacheKeyBooleans(array,parameters){_programLayers.disableAll(),parameters.supportsVertexTextures&&_programLayers.enable(0);parameters.instancing&&_programLayers.enable(1);parameters.instancingColor&&_programLayers.enable(2);parameters.instancingMorph&&_programLayers.enable(3);parameters.matcap&&_programLayers.enable(4);parameters.envMap&&_programLayers.enable(5);parameters.normalMapObjectSpace&&_programLayers.enable(6);parameters.normalMapTangentSpace&&_programLayers.enable(7);parameters.clearcoat&&_programLayers.enable(8);parameters.iridescence&&_programLayers.enable(9);parameters.alphaTest&&_programLayers.enable(10);parameters.vertexColors&&_programLayers.enable(11);parameters.vertexAlphas&&_programLayers.enable(12);parameters.vertexUv1s&&_programLayers.enable(13);parameters.vertexUv2s&&_programLayers.enable(14);parameters.vertexUv3s&&_programLayers.enable(15);parameters.vertexTangents&&_programLayers.enable(16);parameters.anisotropy&&_programLayers.enable(17);parameters.alphaHash&&_programLayers.enable(18);parameters.batching&&_programLayers.enable(19);parameters.dispersion&&_programLayers.enable(20);parameters.batchingColor&&_programLayers.enable(21);array.push(_programLayers.mask),_programLayers.disableAll(),parameters.fog&&_programLayers.enable(0);parameters.useFog&&_programLayers.enable(1);parameters.flatShading&&_programLayers.enable(2);parameters.logarithmicDepthBuffer&&_programLayers.enable(3);parameters.skinning&&_programLayers.enable(4);parameters.morphTargets&&_programLayers.enable(5);parameters.morphNormals&&_programLayers.enable(6);parameters.morphColors&&_programLayers.enable(7);parameters.premultipliedAlpha&&_programLayers.enable(8);parameters.shadowMapEnabled&&_programLayers.enable(9);parameters.doubleSided&&_programLayers.enable(10);parameters.flipSided&&_programLayers.enable(11);parameters.useDepthPacking&&_programLayers.enable(12);parameters.dithering&&_programLayers.enable(13);parameters.transmission&&_programLayers.enable(14);parameters.sheen&&_programLayers.enable(15);parameters.opaque&&_programLayers.enable(16);parameters.pointsUvs&&_programLayers.enable(17);parameters.decodeVideoTexture&&_programLayers.enable(18);parameters.alphaToCoverage&&_programLayers.enable(19);array.push(_programLayers.mask)}(array,parameters),array.push(renderer.outputColorSpace)),array.push(parameters.customProgramCacheKey),array.join()},getUniforms:function getUniforms(material){const shaderID=shaderIDs[material.type];let uniforms;if(shaderID){const shader=ShaderLib[shaderID];uniforms=UniformsUtils.clone(shader.uniforms)}else uniforms=material.uniforms;return uniforms},acquireProgram:function acquireProgram(parameters,cacheKey){let program;for(let p=0,pl=programs.length;p0?transmissive.push(renderItem):!0===material.transparent?transparent.push(renderItem):opaque.push(renderItem)},unshift:function unshift(object,geometry,material,groupOrder,z,group){const renderItem=getNextRenderItem(object,geometry,material,groupOrder,z,group);material.transmission>0?transmissive.unshift(renderItem):!0===material.transparent?transparent.unshift(renderItem):opaque.unshift(renderItem)},finish:function finish(){for(let i=renderItemsIndex,il=renderItems.length;i1&&opaque.sort(customOpaqueSort||painterSortStable),transmissive.length>1&&transmissive.sort(customTransparentSort||reversePainterSortStable),transparent.length>1&&transparent.sort(customTransparentSort||reversePainterSortStable)}}}function WebGLRenderLists(){let lists=new WeakMap;return{get:function get(scene,renderCallDepth){const listArray=lists.get(scene);let list;return void 0===listArray?(list=new WebGLRenderList,lists.set(scene,[list])):renderCallDepth>=listArray.length?(list=new WebGLRenderList,listArray.push(list)):list=listArray[renderCallDepth],list},dispose:function dispose(){lists=new WeakMap}}}function UniformsCache(){const lights={};return{get:function(light){if(void 0!==lights[light.id])return lights[light.id];let uniforms;switch(light.type){case"DirectionalLight":uniforms={direction:new Vector3,color:new Color};break;case"SpotLight":uniforms={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":uniforms={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":uniforms={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":uniforms={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return lights[light.id]=uniforms,uniforms}}}let nextVersion=0;function shadowCastingAndTexturingLightsFirst(lightA,lightB){return(lightB.castShadow?2:0)-(lightA.castShadow?2:0)+(lightB.map?1:0)-(lightA.map?1:0)}function WebGLLights(extensions){const cache=new UniformsCache,shadowCache=function ShadowUniformsCache(){const lights={};return{get:function(light){if(void 0!==lights[light.id])return lights[light.id];let uniforms;switch(light.type){case"DirectionalLight":case"SpotLight":uniforms={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":uniforms={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return lights[light.id]=uniforms,uniforms}}}(),state={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 i=0;i<9;i++)state.probe.push(new Vector3);const vector3=new Vector3,matrix4=new Matrix4,matrix42=new Matrix4;return{setup:function setup(lights){let r=0,g=0,b=0;for(let i=0;i<9;i++)state.probe[i].set(0,0,0);let directionalLength=0,pointLength=0,spotLength=0,rectAreaLength=0,hemiLength=0,numDirectionalShadows=0,numPointShadows=0,numSpotShadows=0,numSpotMaps=0,numSpotShadowsWithMaps=0,numLightProbes=0;lights.sort(shadowCastingAndTexturingLightsFirst);for(let i=0,l=lights.length;i0&&(!0===extensions.has("OES_texture_float_linear")?(state.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,state.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):(state.rectAreaLTC1=UniformsLib.LTC_HALF_1,state.rectAreaLTC2=UniformsLib.LTC_HALF_2)),state.ambient[0]=r,state.ambient[1]=g,state.ambient[2]=b;const hash=state.hash;hash.directionalLength===directionalLength&&hash.pointLength===pointLength&&hash.spotLength===spotLength&&hash.rectAreaLength===rectAreaLength&&hash.hemiLength===hemiLength&&hash.numDirectionalShadows===numDirectionalShadows&&hash.numPointShadows===numPointShadows&&hash.numSpotShadows===numSpotShadows&&hash.numSpotMaps===numSpotMaps&&hash.numLightProbes===numLightProbes||(state.directional.length=directionalLength,state.spot.length=spotLength,state.rectArea.length=rectAreaLength,state.point.length=pointLength,state.hemi.length=hemiLength,state.directionalShadow.length=numDirectionalShadows,state.directionalShadowMap.length=numDirectionalShadows,state.pointShadow.length=numPointShadows,state.pointShadowMap.length=numPointShadows,state.spotShadow.length=numSpotShadows,state.spotShadowMap.length=numSpotShadows,state.directionalShadowMatrix.length=numDirectionalShadows,state.pointShadowMatrix.length=numPointShadows,state.spotLightMatrix.length=numSpotShadows+numSpotMaps-numSpotShadowsWithMaps,state.spotLightMap.length=numSpotMaps,state.numSpotLightShadowsWithMaps=numSpotShadowsWithMaps,state.numLightProbes=numLightProbes,hash.directionalLength=directionalLength,hash.pointLength=pointLength,hash.spotLength=spotLength,hash.rectAreaLength=rectAreaLength,hash.hemiLength=hemiLength,hash.numDirectionalShadows=numDirectionalShadows,hash.numPointShadows=numPointShadows,hash.numSpotShadows=numSpotShadows,hash.numSpotMaps=numSpotMaps,hash.numLightProbes=numLightProbes,state.version=nextVersion++)},setupView:function setupView(lights,camera){let directionalLength=0,pointLength=0,spotLength=0,rectAreaLength=0,hemiLength=0;const viewMatrix=camera.matrixWorldInverse;for(let i=0,l=lights.length;i=renderStateArray.length?(renderState=new WebGLRenderState(extensions),renderStateArray.push(renderState)):renderState=renderStateArray[renderCallDepth],renderState},dispose:function dispose(){renderStates=new WeakMap}}}class MeshDepthMaterial extends Material{constructor(parameters){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(parameters)}copy(source){return super.copy(source),this.depthPacking=source.depthPacking,this.map=source.map,this.alphaMap=source.alphaMap,this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(parameters){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(parameters)}copy(source){return super.copy(source),this.map=source.map,this.alphaMap=source.alphaMap,this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this}}function WebGLShadowMap(renderer,objects,capabilities){let _frustum=new Frustum;const _shadowMapSize=new Vector2,_viewportSize=new Vector2,_viewport=new Vector4,_depthMaterial=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),_distanceMaterial=new MeshDistanceMaterial,_materialCache={},_maxTextureSize=capabilities.maxTextureSize,shadowSide={[FrontSide]:BackSide,[BackSide]:FrontSide,[DoubleSide]:DoubleSide},shadowMaterialVertical=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},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;\n#include \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 = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\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 = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\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( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),shadowMaterialHorizontal=shadowMaterialVertical.clone();shadowMaterialHorizontal.defines.HORIZONTAL_PASS=1;const fullScreenTri=new BufferGeometry;fullScreenTri.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const fullScreenMesh=new Mesh(fullScreenTri,shadowMaterialVertical),scope=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap;let _previousType=this.type;function VSMPass(shadow,camera){const geometry=objects.update(fullScreenMesh);shadowMaterialVertical.defines.VSM_SAMPLES!==shadow.blurSamples&&(shadowMaterialVertical.defines.VSM_SAMPLES=shadow.blurSamples,shadowMaterialHorizontal.defines.VSM_SAMPLES=shadow.blurSamples,shadowMaterialVertical.needsUpdate=!0,shadowMaterialHorizontal.needsUpdate=!0),null===shadow.mapPass&&(shadow.mapPass=new WebGLRenderTarget(_shadowMapSize.x,_shadowMapSize.y)),shadowMaterialVertical.uniforms.shadow_pass.value=shadow.map.texture,shadowMaterialVertical.uniforms.resolution.value=shadow.mapSize,shadowMaterialVertical.uniforms.radius.value=shadow.radius,renderer.setRenderTarget(shadow.mapPass),renderer.clear(),renderer.renderBufferDirect(camera,null,geometry,shadowMaterialVertical,fullScreenMesh,null),shadowMaterialHorizontal.uniforms.shadow_pass.value=shadow.mapPass.texture,shadowMaterialHorizontal.uniforms.resolution.value=shadow.mapSize,shadowMaterialHorizontal.uniforms.radius.value=shadow.radius,renderer.setRenderTarget(shadow.map),renderer.clear(),renderer.renderBufferDirect(camera,null,geometry,shadowMaterialHorizontal,fullScreenMesh,null)}function getDepthMaterial(object,material,light,type){let result=null;const customMaterial=!0===light.isPointLight?object.customDistanceMaterial:object.customDepthMaterial;if(void 0!==customMaterial)result=customMaterial;else if(result=!0===light.isPointLight?_distanceMaterial:_depthMaterial,renderer.localClippingEnabled&&!0===material.clipShadows&&Array.isArray(material.clippingPlanes)&&0!==material.clippingPlanes.length||material.displacementMap&&0!==material.displacementScale||material.alphaMap&&material.alphaTest>0||material.map&&material.alphaTest>0){const keyA=result.uuid,keyB=material.uuid;let materialsForVariant=_materialCache[keyA];void 0===materialsForVariant&&(materialsForVariant={},_materialCache[keyA]=materialsForVariant);let cachedMaterial=materialsForVariant[keyB];void 0===cachedMaterial&&(cachedMaterial=result.clone(),materialsForVariant[keyB]=cachedMaterial,material.addEventListener("dispose",onMaterialDispose)),result=cachedMaterial}if(result.visible=material.visible,result.wireframe=material.wireframe,result.side=type===VSMShadowMap?null!==material.shadowSide?material.shadowSide:material.side:null!==material.shadowSide?material.shadowSide:shadowSide[material.side],result.alphaMap=material.alphaMap,result.alphaTest=material.alphaTest,result.map=material.map,result.clipShadows=material.clipShadows,result.clippingPlanes=material.clippingPlanes,result.clipIntersection=material.clipIntersection,result.displacementMap=material.displacementMap,result.displacementScale=material.displacementScale,result.displacementBias=material.displacementBias,result.wireframeLinewidth=material.wireframeLinewidth,result.linewidth=material.linewidth,!0===light.isPointLight&&!0===result.isMeshDistanceMaterial){renderer.properties.get(result).light=light}return result}function renderObject(object,camera,shadowCamera,light,type){if(!1===object.visible)return;if(object.layers.test(camera.layers)&&(object.isMesh||object.isLine||object.isPoints)&&(object.castShadow||object.receiveShadow&&type===VSMShadowMap)&&(!object.frustumCulled||_frustum.intersectsObject(object))){object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse,object.matrixWorld);const geometry=objects.update(object),material=object.material;if(Array.isArray(material)){const groups=geometry.groups;for(let k=0,kl=groups.length;k_maxTextureSize||_shadowMapSize.y>_maxTextureSize)&&(_shadowMapSize.x>_maxTextureSize&&(_viewportSize.x=Math.floor(_maxTextureSize/shadowFrameExtents.x),_shadowMapSize.x=_viewportSize.x*shadowFrameExtents.x,shadow.mapSize.x=_viewportSize.x),_shadowMapSize.y>_maxTextureSize&&(_viewportSize.y=Math.floor(_maxTextureSize/shadowFrameExtents.y),_shadowMapSize.y=_viewportSize.y*shadowFrameExtents.y,shadow.mapSize.y=_viewportSize.y)),null===shadow.map||!0===toVSM||!0===fromVSM){const pars=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};null!==shadow.map&&shadow.map.dispose(),shadow.map=new WebGLRenderTarget(_shadowMapSize.x,_shadowMapSize.y,pars),shadow.map.texture.name=light.name+".shadowMap",shadow.camera.updateProjectionMatrix()}renderer.setRenderTarget(shadow.map),renderer.clear();const viewportCount=shadow.getViewportCount();for(let vp=0;vp=1):-1!==glVersion.indexOf("OpenGL ES")&&(version=parseFloat(/^OpenGL ES (\d)/.exec(glVersion)[1]),lineWidthAvailable=version>=2);let currentTextureSlot=null,currentBoundTextures={};const scissorParam=gl.getParameter(gl.SCISSOR_BOX),viewportParam=gl.getParameter(gl.VIEWPORT),currentScissor=(new Vector4).fromArray(scissorParam),currentViewport=(new Vector4).fromArray(viewportParam);function createTexture(type,target,count,dimensions){const data=new Uint8Array(4),texture=gl.createTexture();gl.bindTexture(type,texture),gl.texParameteri(type,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(type,gl.TEXTURE_MAG_FILTER,gl.NEAREST);for(let i=0;iaspect?(texture.repeat.x=1,texture.repeat.y=imageAspect/aspect,texture.offset.x=0,texture.offset.y=(1-texture.repeat.y)/2):(texture.repeat.x=aspect/imageAspect,texture.repeat.y=1,texture.offset.x=(1-texture.repeat.x)/2,texture.offset.y=0),texture},cover:function cover(texture,aspect){const imageAspect=texture.image&&texture.image.width?texture.image.width/texture.image.height:1;return imageAspect>aspect?(texture.repeat.x=aspect/imageAspect,texture.repeat.y=1,texture.offset.x=(1-texture.repeat.x)/2,texture.offset.y=0):(texture.repeat.x=1,texture.repeat.y=imageAspect/aspect,texture.offset.x=0,texture.offset.y=(1-texture.repeat.y)/2),texture},fill:function fill(texture){return texture.repeat.x=1,texture.repeat.y=1,texture.offset.x=0,texture.offset.y=0,texture},getByteLength:getByteLength};function WebGLTextures(_gl,extensions,state,properties,capabilities,utils,info){const multisampledRTTExt=extensions.has("WEBGL_multisampled_render_to_texture")?extensions.get("WEBGL_multisampled_render_to_texture"):null,supportsInvalidateFramebuffer="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),_imageDimensions=new Vector2,_videoTextures=new WeakMap;let _canvas;const _sources=new WeakMap;let useOffscreenCanvas=!1;try{useOffscreenCanvas="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(err){}function createCanvas(width,height){return useOffscreenCanvas?new OffscreenCanvas(width,height):createElementNS("canvas")}function resizeImage(image,needsNewCanvas,maxSize){let scale=1;const dimensions=getDimensions(image);if((dimensions.width>maxSize||dimensions.height>maxSize)&&(scale=maxSize/Math.max(dimensions.width,dimensions.height)),scale<1){if("undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&image instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&image instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&image instanceof VideoFrame){const width=Math.floor(scale*dimensions.width),height=Math.floor(scale*dimensions.height);void 0===_canvas&&(_canvas=createCanvas(width,height));const canvas=needsNewCanvas?createCanvas(width,height):_canvas;canvas.width=width,canvas.height=height;return canvas.getContext("2d").drawImage(image,0,0,width,height),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+dimensions.width+"x"+dimensions.height+") to ("+width+"x"+height+")."),canvas}return"data"in image&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+dimensions.width+"x"+dimensions.height+")."),image}return image}function textureNeedsGenerateMipmaps(texture){return texture.generateMipmaps&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter}function generateMipmap(target){_gl.generateMipmap(target)}function getInternalFormat(internalFormatName,glFormat,glType,colorSpace,forceLinearTransfer=!1){if(null!==internalFormatName){if(void 0!==_gl[internalFormatName])return _gl[internalFormatName];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+internalFormatName+"'")}let internalFormat=glFormat;if(glFormat===_gl.RED&&(glType===_gl.FLOAT&&(internalFormat=_gl.R32F),glType===_gl.HALF_FLOAT&&(internalFormat=_gl.R16F),glType===_gl.UNSIGNED_BYTE&&(internalFormat=_gl.R8)),glFormat===_gl.RED_INTEGER&&(glType===_gl.UNSIGNED_BYTE&&(internalFormat=_gl.R8UI),glType===_gl.UNSIGNED_SHORT&&(internalFormat=_gl.R16UI),glType===_gl.UNSIGNED_INT&&(internalFormat=_gl.R32UI),glType===_gl.BYTE&&(internalFormat=_gl.R8I),glType===_gl.SHORT&&(internalFormat=_gl.R16I),glType===_gl.INT&&(internalFormat=_gl.R32I)),glFormat===_gl.RG&&(glType===_gl.FLOAT&&(internalFormat=_gl.RG32F),glType===_gl.HALF_FLOAT&&(internalFormat=_gl.RG16F),glType===_gl.UNSIGNED_BYTE&&(internalFormat=_gl.RG8)),glFormat===_gl.RG_INTEGER&&(glType===_gl.UNSIGNED_BYTE&&(internalFormat=_gl.RG8UI),glType===_gl.UNSIGNED_SHORT&&(internalFormat=_gl.RG16UI),glType===_gl.UNSIGNED_INT&&(internalFormat=_gl.RG32UI),glType===_gl.BYTE&&(internalFormat=_gl.RG8I),glType===_gl.SHORT&&(internalFormat=_gl.RG16I),glType===_gl.INT&&(internalFormat=_gl.RG32I)),glFormat===_gl.RGB&&glType===_gl.UNSIGNED_INT_5_9_9_9_REV&&(internalFormat=_gl.RGB9_E5),glFormat===_gl.RGBA){const transfer=forceLinearTransfer?LinearTransfer:ColorManagement.getTransfer(colorSpace);glType===_gl.FLOAT&&(internalFormat=_gl.RGBA32F),glType===_gl.HALF_FLOAT&&(internalFormat=_gl.RGBA16F),glType===_gl.UNSIGNED_BYTE&&(internalFormat=transfer===SRGBTransfer?_gl.SRGB8_ALPHA8:_gl.RGBA8),glType===_gl.UNSIGNED_SHORT_4_4_4_4&&(internalFormat=_gl.RGBA4),glType===_gl.UNSIGNED_SHORT_5_5_5_1&&(internalFormat=_gl.RGB5_A1)}return internalFormat!==_gl.R16F&&internalFormat!==_gl.R32F&&internalFormat!==_gl.RG16F&&internalFormat!==_gl.RG32F&&internalFormat!==_gl.RGBA16F&&internalFormat!==_gl.RGBA32F||extensions.get("EXT_color_buffer_float"),internalFormat}function getInternalDepthFormat(useStencil,depthType){let glInternalFormat;return useStencil?null===depthType||depthType===UnsignedIntType||depthType===UnsignedInt248Type?glInternalFormat=_gl.DEPTH24_STENCIL8:depthType===FloatType?glInternalFormat=_gl.DEPTH32F_STENCIL8:depthType===UnsignedShortType&&(glInternalFormat=_gl.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===depthType||depthType===UnsignedIntType||depthType===UnsignedInt248Type?glInternalFormat=_gl.DEPTH_COMPONENT24:depthType===FloatType?glInternalFormat=_gl.DEPTH_COMPONENT32F:depthType===UnsignedShortType&&(glInternalFormat=_gl.DEPTH_COMPONENT16),glInternalFormat}function getMipLevels(texture,image){return!0===textureNeedsGenerateMipmaps(texture)||texture.isFramebufferTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter?Math.log2(Math.max(image.width,image.height))+1:void 0!==texture.mipmaps&&texture.mipmaps.length>0?texture.mipmaps.length:texture.isCompressedTexture&&Array.isArray(texture.image)?image.mipmaps.length:1}function onTextureDispose(event){const texture=event.target;texture.removeEventListener("dispose",onTextureDispose),function deallocateTexture(texture){const textureProperties=properties.get(texture);if(void 0===textureProperties.__webglInit)return;const source=texture.source,webglTextures=_sources.get(source);if(webglTextures){const webglTexture=webglTextures[textureProperties.__cacheKey];webglTexture.usedTimes--,0===webglTexture.usedTimes&&deleteTexture(texture),0===Object.keys(webglTextures).length&&_sources.delete(source)}properties.remove(texture)}(texture),texture.isVideoTexture&&_videoTextures.delete(texture)}function onRenderTargetDispose(event){const renderTarget=event.target;renderTarget.removeEventListener("dispose",onRenderTargetDispose),function deallocateRenderTarget(renderTarget){const renderTargetProperties=properties.get(renderTarget);renderTarget.depthTexture&&renderTarget.depthTexture.dispose();if(renderTarget.isWebGLCubeRenderTarget)for(let i=0;i<6;i++){if(Array.isArray(renderTargetProperties.__webglFramebuffer[i]))for(let level=0;level0&&textureProperties.__version!==texture.version){const image=texture.image;if(null===image)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==image.complete)return void uploadTexture(textureProperties,texture,slot);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}state.bindTexture(_gl.TEXTURE_2D,textureProperties.__webglTexture,_gl.TEXTURE0+slot)}const wrappingToGL={[RepeatWrapping]:_gl.REPEAT,[ClampToEdgeWrapping]:_gl.CLAMP_TO_EDGE,[MirroredRepeatWrapping]:_gl.MIRRORED_REPEAT},filterToGL={[NearestFilter]:_gl.NEAREST,[NearestMipmapNearestFilter]:_gl.NEAREST_MIPMAP_NEAREST,[NearestMipmapLinearFilter]:_gl.NEAREST_MIPMAP_LINEAR,[LinearFilter]:_gl.LINEAR,[LinearMipmapNearestFilter]:_gl.LINEAR_MIPMAP_NEAREST,[LinearMipmapLinearFilter]:_gl.LINEAR_MIPMAP_LINEAR},compareToGL={[NeverCompare]:_gl.NEVER,[AlwaysCompare]:_gl.ALWAYS,[LessCompare]:_gl.LESS,[LessEqualCompare]:_gl.LEQUAL,[EqualCompare]:_gl.EQUAL,[GreaterEqualCompare]:_gl.GEQUAL,[GreaterCompare]:_gl.GREATER,[NotEqualCompare]:_gl.NOTEQUAL};function setTextureParameters(textureType,texture){if(texture.type!==FloatType||!1!==extensions.has("OES_texture_float_linear")||texture.magFilter!==LinearFilter&&texture.magFilter!==LinearMipmapNearestFilter&&texture.magFilter!==NearestMipmapLinearFilter&&texture.magFilter!==LinearMipmapLinearFilter&&texture.minFilter!==LinearFilter&&texture.minFilter!==LinearMipmapNearestFilter&&texture.minFilter!==NearestMipmapLinearFilter&&texture.minFilter!==LinearMipmapLinearFilter||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_S,wrappingToGL[texture.wrapS]),_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_T,wrappingToGL[texture.wrapT]),textureType!==_gl.TEXTURE_3D&&textureType!==_gl.TEXTURE_2D_ARRAY||_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_R,wrappingToGL[texture.wrapR]),_gl.texParameteri(textureType,_gl.TEXTURE_MAG_FILTER,filterToGL[texture.magFilter]),_gl.texParameteri(textureType,_gl.TEXTURE_MIN_FILTER,filterToGL[texture.minFilter]),texture.compareFunction&&(_gl.texParameteri(textureType,_gl.TEXTURE_COMPARE_MODE,_gl.COMPARE_REF_TO_TEXTURE),_gl.texParameteri(textureType,_gl.TEXTURE_COMPARE_FUNC,compareToGL[texture.compareFunction])),!0===extensions.has("EXT_texture_filter_anisotropic")){if(texture.magFilter===NearestFilter)return;if(texture.minFilter!==NearestMipmapLinearFilter&&texture.minFilter!==LinearMipmapLinearFilter)return;if(texture.type===FloatType&&!1===extensions.has("OES_texture_float_linear"))return;if(texture.anisotropy>1||properties.get(texture).__currentAnisotropy){const extension=extensions.get("EXT_texture_filter_anisotropic");_gl.texParameterf(textureType,extension.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(texture.anisotropy,capabilities.getMaxAnisotropy())),properties.get(texture).__currentAnisotropy=texture.anisotropy}}}function initTexture(textureProperties,texture){let forceUpload=!1;void 0===textureProperties.__webglInit&&(textureProperties.__webglInit=!0,texture.addEventListener("dispose",onTextureDispose));const source=texture.source;let webglTextures=_sources.get(source);void 0===webglTextures&&(webglTextures={},_sources.set(source,webglTextures));const textureCacheKey=function getTextureCacheKey(texture){const array=[];return array.push(texture.wrapS),array.push(texture.wrapT),array.push(texture.wrapR||0),array.push(texture.magFilter),array.push(texture.minFilter),array.push(texture.anisotropy),array.push(texture.internalFormat),array.push(texture.format),array.push(texture.type),array.push(texture.generateMipmaps),array.push(texture.premultiplyAlpha),array.push(texture.flipY),array.push(texture.unpackAlignment),array.push(texture.colorSpace),array.join()}(texture);if(textureCacheKey!==textureProperties.__cacheKey){void 0===webglTextures[textureCacheKey]&&(webglTextures[textureCacheKey]={texture:_gl.createTexture(),usedTimes:0},info.memory.textures++,forceUpload=!0),webglTextures[textureCacheKey].usedTimes++;const webglTexture=webglTextures[textureProperties.__cacheKey];void 0!==webglTexture&&(webglTextures[textureProperties.__cacheKey].usedTimes--,0===webglTexture.usedTimes&&deleteTexture(texture)),textureProperties.__cacheKey=textureCacheKey,textureProperties.__webglTexture=webglTextures[textureCacheKey].texture}return forceUpload}function uploadTexture(textureProperties,texture,slot){let textureType=_gl.TEXTURE_2D;(texture.isDataArrayTexture||texture.isCompressedArrayTexture)&&(textureType=_gl.TEXTURE_2D_ARRAY),texture.isData3DTexture&&(textureType=_gl.TEXTURE_3D);const forceUpload=initTexture(textureProperties,texture),source=texture.source;state.bindTexture(textureType,textureProperties.__webglTexture,_gl.TEXTURE0+slot);const sourceProperties=properties.get(source);if(source.version!==sourceProperties.__version||!0===forceUpload){state.activeTexture(_gl.TEXTURE0+slot);const workingPrimaries=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),texturePrimaries=texture.colorSpace===NoColorSpace?null:ColorManagement.getPrimaries(texture.colorSpace),unpackConversion=texture.colorSpace===NoColorSpace||workingPrimaries===texturePrimaries?_gl.NONE:_gl.BROWSER_DEFAULT_WEBGL;_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,texture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,texture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,texture.unpackAlignment),_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,unpackConversion);let image=resizeImage(texture.image,!1,capabilities.maxTextureSize);image=verifyColorSpace(texture,image);const glFormat=utils.convert(texture.format,texture.colorSpace),glType=utils.convert(texture.type);let mipmap,glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.colorSpace,texture.isVideoTexture);setTextureParameters(textureType,texture);const mipmaps=texture.mipmaps,useTexStorage=!0!==texture.isVideoTexture,allocateMemory=void 0===sourceProperties.__version||!0===forceUpload,dataReady=source.dataReady,levels=getMipLevels(texture,image);if(texture.isDepthTexture)glInternalFormat=getInternalDepthFormat(texture.format===DepthStencilFormat,texture.type),allocateMemory&&(useTexStorage?state.texStorage2D(_gl.TEXTURE_2D,1,glInternalFormat,image.width,image.height):state.texImage2D(_gl.TEXTURE_2D,0,glInternalFormat,image.width,image.height,0,glFormat,glType,null));else if(texture.isDataTexture)if(mipmaps.length>0){useTexStorage&&allocateMemory&&state.texStorage2D(_gl.TEXTURE_2D,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);for(let i=0,il=mipmaps.length;i0){const layerByteLength=getByteLength(mipmap.width,mipmap.height,texture.format,texture.type);for(const layerIndex of texture.layerUpdates){const layerData=mipmap.data.subarray(layerIndex*layerByteLength/mipmap.data.BYTES_PER_ELEMENT,(layerIndex+1)*layerByteLength/mipmap.data.BYTES_PER_ELEMENT);state.compressedTexSubImage3D(_gl.TEXTURE_2D_ARRAY,i,0,0,layerIndex,mipmap.width,mipmap.height,1,glFormat,layerData,0,0)}texture.clearLayerUpdates()}else state.compressedTexSubImage3D(_gl.TEXTURE_2D_ARRAY,i,0,0,0,mipmap.width,mipmap.height,image.depth,glFormat,mipmap.data,0,0)}else state.compressedTexImage3D(_gl.TEXTURE_2D_ARRAY,i,glInternalFormat,mipmap.width,mipmap.height,image.depth,0,mipmap.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else useTexStorage?dataReady&&state.texSubImage3D(_gl.TEXTURE_2D_ARRAY,i,0,0,0,mipmap.width,mipmap.height,image.depth,glFormat,glType,mipmap.data):state.texImage3D(_gl.TEXTURE_2D_ARRAY,i,glInternalFormat,mipmap.width,mipmap.height,image.depth,0,glFormat,glType,mipmap.data)}else{useTexStorage&&allocateMemory&&state.texStorage2D(_gl.TEXTURE_2D,levels,glInternalFormat,mipmaps[0].width,mipmaps[0].height);for(let i=0,il=mipmaps.length;i0){const layerByteLength=getByteLength(image.width,image.height,texture.format,texture.type);for(const layerIndex of texture.layerUpdates){const layerData=image.data.subarray(layerIndex*layerByteLength/image.data.BYTES_PER_ELEMENT,(layerIndex+1)*layerByteLength/image.data.BYTES_PER_ELEMENT);state.texSubImage3D(_gl.TEXTURE_2D_ARRAY,0,0,0,layerIndex,image.width,image.height,1,glFormat,glType,layerData)}texture.clearLayerUpdates()}else state.texSubImage3D(_gl.TEXTURE_2D_ARRAY,0,0,0,0,image.width,image.height,image.depth,glFormat,glType,image.data)}else state.texImage3D(_gl.TEXTURE_2D_ARRAY,0,glInternalFormat,image.width,image.height,image.depth,0,glFormat,glType,image.data);else if(texture.isData3DTexture)useTexStorage?(allocateMemory&&state.texStorage3D(_gl.TEXTURE_3D,levels,glInternalFormat,image.width,image.height,image.depth),dataReady&&state.texSubImage3D(_gl.TEXTURE_3D,0,0,0,0,image.width,image.height,image.depth,glFormat,glType,image.data)):state.texImage3D(_gl.TEXTURE_3D,0,glInternalFormat,image.width,image.height,image.depth,0,glFormat,glType,image.data);else if(texture.isFramebufferTexture){if(allocateMemory)if(useTexStorage)state.texStorage2D(_gl.TEXTURE_2D,levels,glInternalFormat,image.width,image.height);else{let width=image.width,height=image.height;for(let i=0;i>=1,height>>=1}}else if(mipmaps.length>0){if(useTexStorage&&allocateMemory){const dimensions=getDimensions(mipmaps[0]);state.texStorage2D(_gl.TEXTURE_2D,levels,glInternalFormat,dimensions.width,dimensions.height)}for(let i=0,il=mipmaps.length;i>level),height=Math.max(1,renderTarget.height>>level);textureTarget===_gl.TEXTURE_3D||textureTarget===_gl.TEXTURE_2D_ARRAY?state.texImage3D(textureTarget,level,glInternalFormat,width,height,renderTarget.depth,0,glFormat,glType,null):state.texImage2D(textureTarget,level,glInternalFormat,width,height,0,glFormat,glType,null)}state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer),useMultisampledRTT(renderTarget)?multisampledRTTExt.framebufferTexture2DMultisampleEXT(_gl.FRAMEBUFFER,attachment,textureTarget,properties.get(texture).__webglTexture,0,getRenderTargetSamples(renderTarget)):(textureTarget===_gl.TEXTURE_2D||textureTarget>=_gl.TEXTURE_CUBE_MAP_POSITIVE_X&&textureTarget<=_gl.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&_gl.framebufferTexture2D(_gl.FRAMEBUFFER,attachment,textureTarget,properties.get(texture).__webglTexture,level),state.bindFramebuffer(_gl.FRAMEBUFFER,null)}function setupRenderBufferStorage(renderbuffer,renderTarget,isMultisample){if(_gl.bindRenderbuffer(_gl.RENDERBUFFER,renderbuffer),renderTarget.depthBuffer){const depthTexture=renderTarget.depthTexture,depthType=depthTexture&&depthTexture.isDepthTexture?depthTexture.type:null,glInternalFormat=getInternalDepthFormat(renderTarget.stencilBuffer,depthType),glAttachmentType=renderTarget.stencilBuffer?_gl.DEPTH_STENCIL_ATTACHMENT:_gl.DEPTH_ATTACHMENT,samples=getRenderTargetSamples(renderTarget);useMultisampledRTT(renderTarget)?multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER,samples,glInternalFormat,renderTarget.width,renderTarget.height):isMultisample?_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER,samples,glInternalFormat,renderTarget.width,renderTarget.height):_gl.renderbufferStorage(_gl.RENDERBUFFER,glInternalFormat,renderTarget.width,renderTarget.height),_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER,glAttachmentType,_gl.RENDERBUFFER,renderbuffer)}else{const textures=renderTarget.textures;for(let i=0;i0&&!0===extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==renderTargetProperties.__useRenderToTexture}function verifyColorSpace(texture,image){const colorSpace=texture.colorSpace,format=texture.format,type=texture.type;return!0===texture.isCompressedTexture||!0===texture.isVideoTexture||colorSpace!==LinearSRGBColorSpace&&colorSpace!==NoColorSpace&&(ColorManagement.getTransfer(colorSpace)===SRGBTransfer?format===RGBAFormat&&type===UnsignedByteType||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",colorSpace)),image}function getDimensions(image){return"undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement?(_imageDimensions.width=image.naturalWidth||image.width,_imageDimensions.height=image.naturalHeight||image.height):"undefined"!=typeof VideoFrame&&image instanceof VideoFrame?(_imageDimensions.width=image.displayWidth,_imageDimensions.height=image.displayHeight):(_imageDimensions.width=image.width,_imageDimensions.height=image.height),_imageDimensions}this.allocateTextureUnit=function allocateTextureUnit(){const textureUnit=textureUnits;return textureUnit>=capabilities.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+textureUnit+" texture units while this GPU supports only "+capabilities.maxTextures),textureUnits+=1,textureUnit},this.resetTextureUnits=function resetTextureUnits(){textureUnits=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function setTexture2DArray(texture,slot){const textureProperties=properties.get(texture);texture.version>0&&textureProperties.__version!==texture.version?uploadTexture(textureProperties,texture,slot):state.bindTexture(_gl.TEXTURE_2D_ARRAY,textureProperties.__webglTexture,_gl.TEXTURE0+slot)},this.setTexture3D=function setTexture3D(texture,slot){const textureProperties=properties.get(texture);texture.version>0&&textureProperties.__version!==texture.version?uploadTexture(textureProperties,texture,slot):state.bindTexture(_gl.TEXTURE_3D,textureProperties.__webglTexture,_gl.TEXTURE0+slot)},this.setTextureCube=function setTextureCube(texture,slot){const textureProperties=properties.get(texture);texture.version>0&&textureProperties.__version!==texture.version?function uploadCubeTexture(textureProperties,texture,slot){if(6!==texture.image.length)return;const forceUpload=initTexture(textureProperties,texture),source=texture.source;state.bindTexture(_gl.TEXTURE_CUBE_MAP,textureProperties.__webglTexture,_gl.TEXTURE0+slot);const sourceProperties=properties.get(source);if(source.version!==sourceProperties.__version||!0===forceUpload){state.activeTexture(_gl.TEXTURE0+slot);const workingPrimaries=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),texturePrimaries=texture.colorSpace===NoColorSpace?null:ColorManagement.getPrimaries(texture.colorSpace),unpackConversion=texture.colorSpace===NoColorSpace||workingPrimaries===texturePrimaries?_gl.NONE:_gl.BROWSER_DEFAULT_WEBGL;_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,texture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,texture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,texture.unpackAlignment),_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,unpackConversion);const isCompressed=texture.isCompressedTexture||texture.image[0].isCompressedTexture,isDataTexture=texture.image[0]&&texture.image[0].isDataTexture,cubeImage=[];for(let i=0;i<6;i++)cubeImage[i]=isCompressed||isDataTexture?isDataTexture?texture.image[i].image:texture.image[i]:resizeImage(texture.image[i],!0,capabilities.maxCubemapSize),cubeImage[i]=verifyColorSpace(texture,cubeImage[i]);const image=cubeImage[0],glFormat=utils.convert(texture.format,texture.colorSpace),glType=utils.convert(texture.type),glInternalFormat=getInternalFormat(texture.internalFormat,glFormat,glType,texture.colorSpace),useTexStorage=!0!==texture.isVideoTexture,allocateMemory=void 0===sourceProperties.__version||!0===forceUpload,dataReady=source.dataReady;let mipmaps,levels=getMipLevels(texture,image);if(setTextureParameters(_gl.TEXTURE_CUBE_MAP,texture),isCompressed){useTexStorage&&allocateMemory&&state.texStorage2D(_gl.TEXTURE_CUBE_MAP,levels,glInternalFormat,image.width,image.height);for(let i=0;i<6;i++){mipmaps=cubeImage[i].mipmaps;for(let j=0;j0&&levels++;const dimensions=getDimensions(cubeImage[0]);state.texStorage2D(_gl.TEXTURE_CUBE_MAP,levels,glInternalFormat,dimensions.width,dimensions.height)}for(let i=0;i<6;i++)if(isDataTexture){useTexStorage?dataReady&&state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,cubeImage[i].width,cubeImage[i].height,glFormat,glType,cubeImage[i].data):state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,glInternalFormat,cubeImage[i].width,cubeImage[i].height,0,glFormat,glType,cubeImage[i].data);for(let j=0;j1;if(isMultipleRenderTargets||(void 0===textureProperties.__webglTexture&&(textureProperties.__webglTexture=_gl.createTexture()),textureProperties.__version=texture.version,info.memory.textures++),isCube){renderTargetProperties.__webglFramebuffer=[];for(let i=0;i<6;i++)if(texture.mipmaps&&texture.mipmaps.length>0){renderTargetProperties.__webglFramebuffer[i]=[];for(let level=0;level0){renderTargetProperties.__webglFramebuffer=[];for(let level=0;level0&&!1===useMultisampledRTT(renderTarget)){renderTargetProperties.__webglMultisampledFramebuffer=_gl.createFramebuffer(),renderTargetProperties.__webglColorRenderbuffer=[],state.bindFramebuffer(_gl.FRAMEBUFFER,renderTargetProperties.__webglMultisampledFramebuffer);for(let i=0;i0)for(let level=0;level0)for(let level=0;level0)if(!1===useMultisampledRTT(renderTarget)){const textures=renderTarget.textures,width=renderTarget.width,height=renderTarget.height;let mask=_gl.COLOR_BUFFER_BIT;const depthStyle=renderTarget.stencilBuffer?_gl.DEPTH_STENCIL_ATTACHMENT:_gl.DEPTH_ATTACHMENT,renderTargetProperties=properties.get(renderTarget),isMultipleRenderTargets=textures.length>1;if(isMultipleRenderTargets)for(let i=0;idistanceToPinch+threshold?(hand.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:inputSource.handedness,target:this})):!hand.inputState.pinching&&distance<=distanceToPinch-threshold&&(hand.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:inputSource.handedness,target:this}))}else null!==grip&&inputSource.gripSpace&&(gripPose=frame.getPose(inputSource.gripSpace,referenceSpace),null!==gripPose&&(grip.matrix.fromArray(gripPose.transform.matrix),grip.matrix.decompose(grip.position,grip.rotation,grip.scale),grip.matrixWorldNeedsUpdate=!0,gripPose.linearVelocity?(grip.hasLinearVelocity=!0,grip.linearVelocity.copy(gripPose.linearVelocity)):grip.hasLinearVelocity=!1,gripPose.angularVelocity?(grip.hasAngularVelocity=!0,grip.angularVelocity.copy(gripPose.angularVelocity)):grip.hasAngularVelocity=!1));null!==targetRay&&(inputPose=frame.getPose(inputSource.targetRaySpace,referenceSpace),null===inputPose&&null!==gripPose&&(inputPose=gripPose),null!==inputPose&&(targetRay.matrix.fromArray(inputPose.transform.matrix),targetRay.matrix.decompose(targetRay.position,targetRay.rotation,targetRay.scale),targetRay.matrixWorldNeedsUpdate=!0,inputPose.linearVelocity?(targetRay.hasLinearVelocity=!0,targetRay.linearVelocity.copy(inputPose.linearVelocity)):targetRay.hasLinearVelocity=!1,inputPose.angularVelocity?(targetRay.hasAngularVelocity=!0,targetRay.angularVelocity.copy(inputPose.angularVelocity)):targetRay.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return null!==targetRay&&(targetRay.visible=null!==inputPose),null!==grip&&(grip.visible=null!==gripPose),null!==hand&&(hand.visible=null!==handPose),this}_getHandJoint(hand,inputjoint){if(void 0===hand.joints[inputjoint.jointName]){const joint=new Group;joint.matrixAutoUpdate=!1,joint.visible=!1,hand.joints[inputjoint.jointName]=joint,hand.add(joint)}return hand.joints[inputjoint.jointName]}}class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(renderer,depthData,renderState){if(null===this.texture){const texture=new Texture;renderer.properties.get(texture).__webglTexture=depthData.texture,depthData.depthNear==renderState.depthNear&&depthData.depthFar==renderState.depthFar||(this.depthNear=depthData.depthNear,this.depthFar=depthData.depthFar),this.texture=texture}}getMesh(cameraXR){if(null!==this.texture&&null===this.mesh){const viewport=cameraXR.cameras[0].viewport,material=new ShaderMaterial({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:viewport.z},depthHeight:{value:viewport.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),material)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class WebXRManager extends EventDispatcher{constructor(renderer,gl){super();const scope=this;let session=null,framebufferScaleFactor=1,referenceSpace=null,referenceSpaceType="local-floor",foveation=1,customReferenceSpace=null,pose=null,glBinding=null,glProjLayer=null,glBaseLayer=null,xrFrame=null;const depthSensing=new WebXRDepthSensing,attributes=gl.getContextAttributes();let initialRenderTarget=null,newRenderTarget=null;const controllers=[],controllerInputSources=[],currentSize=new Vector2;let currentPixelRatio=null;const cameraL=new PerspectiveCamera;cameraL.layers.enable(1),cameraL.viewport=new Vector4;const cameraR=new PerspectiveCamera;cameraR.layers.enable(2),cameraR.viewport=new Vector4;const cameras=[cameraL,cameraR],cameraXR=new ArrayCamera;cameraXR.layers.enable(1),cameraXR.layers.enable(2);let _currentDepthNear=null,_currentDepthFar=null;function onSessionEvent(event){const controllerIndex=controllerInputSources.indexOf(event.inputSource);if(-1===controllerIndex)return;const controller=controllers[controllerIndex];void 0!==controller&&(controller.update(event.inputSource,event.frame,customReferenceSpace||referenceSpace),controller.dispatchEvent({type:event.type,data:event.inputSource}))}function onSessionEnd(){session.removeEventListener("select",onSessionEvent),session.removeEventListener("selectstart",onSessionEvent),session.removeEventListener("selectend",onSessionEvent),session.removeEventListener("squeeze",onSessionEvent),session.removeEventListener("squeezestart",onSessionEvent),session.removeEventListener("squeezeend",onSessionEvent),session.removeEventListener("end",onSessionEnd),session.removeEventListener("inputsourceschange",onInputSourcesChange);for(let i=0;i=0&&(controllerInputSources[index]=null,controllers[index].disconnect(inputSource))}for(let i=0;i=controllerInputSources.length){controllerInputSources.push(inputSource),controllerIndex=i;break}if(null===controllerInputSources[i]){controllerInputSources[i]=inputSource,controllerIndex=i;break}}if(-1===controllerIndex)break}const controller=controllers[controllerIndex];controller&&controller.connect(inputSource)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(index){let controller=controllers[index];return void 0===controller&&(controller=new WebXRController,controllers[index]=controller),controller.getTargetRaySpace()},this.getControllerGrip=function(index){let controller=controllers[index];return void 0===controller&&(controller=new WebXRController,controllers[index]=controller),controller.getGripSpace()},this.getHand=function(index){let controller=controllers[index];return void 0===controller&&(controller=new WebXRController,controllers[index]=controller),controller.getHandSpace()},this.setFramebufferScaleFactor=function(value){framebufferScaleFactor=value,!0===scope.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(value){referenceSpaceType=value,!0===scope.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return customReferenceSpace||referenceSpace},this.setReferenceSpace=function(space){customReferenceSpace=space},this.getBaseLayer=function(){return null!==glProjLayer?glProjLayer:glBaseLayer},this.getBinding=function(){return glBinding},this.getFrame=function(){return xrFrame},this.getSession=function(){return session},this.setSession=async function(value){if(session=value,null!==session){if(initialRenderTarget=renderer.getRenderTarget(),session.addEventListener("select",onSessionEvent),session.addEventListener("selectstart",onSessionEvent),session.addEventListener("selectend",onSessionEvent),session.addEventListener("squeeze",onSessionEvent),session.addEventListener("squeezestart",onSessionEvent),session.addEventListener("squeezeend",onSessionEvent),session.addEventListener("end",onSessionEnd),session.addEventListener("inputsourceschange",onInputSourcesChange),!0!==attributes.xrCompatible&&await gl.makeXRCompatible(),currentPixelRatio=renderer.getPixelRatio(),renderer.getSize(currentSize),void 0===session.renderState.layers){const layerInit={antialias:attributes.antialias,alpha:!0,depth:attributes.depth,stencil:attributes.stencil,framebufferScaleFactor:framebufferScaleFactor};glBaseLayer=new XRWebGLLayer(session,gl,layerInit),session.updateRenderState({baseLayer:glBaseLayer}),renderer.setPixelRatio(1),renderer.setSize(glBaseLayer.framebufferWidth,glBaseLayer.framebufferHeight,!1),newRenderTarget=new WebGLRenderTarget(glBaseLayer.framebufferWidth,glBaseLayer.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,colorSpace:renderer.outputColorSpace,stencilBuffer:attributes.stencil})}else{let depthFormat=null,depthType=null,glDepthFormat=null;attributes.depth&&(glDepthFormat=attributes.stencil?gl.DEPTH24_STENCIL8:gl.DEPTH_COMPONENT24,depthFormat=attributes.stencil?DepthStencilFormat:DepthFormat,depthType=attributes.stencil?UnsignedInt248Type:UnsignedIntType);const projectionlayerInit={colorFormat:gl.RGBA8,depthFormat:glDepthFormat,scaleFactor:framebufferScaleFactor};glBinding=new XRWebGLBinding(session,gl),glProjLayer=glBinding.createProjectionLayer(projectionlayerInit),session.updateRenderState({layers:[glProjLayer]}),renderer.setPixelRatio(1),renderer.setSize(glProjLayer.textureWidth,glProjLayer.textureHeight,!1),newRenderTarget=new WebGLRenderTarget(glProjLayer.textureWidth,glProjLayer.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(glProjLayer.textureWidth,glProjLayer.textureHeight,depthType,void 0,void 0,void 0,void 0,void 0,void 0,depthFormat),stencilBuffer:attributes.stencil,colorSpace:renderer.outputColorSpace,samples:attributes.antialias?4:0,resolveDepthBuffer:!1===glProjLayer.ignoreDepthValues})}newRenderTarget.isXRRenderTarget=!0,this.setFoveation(foveation),customReferenceSpace=null,referenceSpace=await session.requestReferenceSpace(referenceSpaceType),animation.setContext(session),animation.start(),scope.isPresenting=!0,scope.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==session)return session.environmentBlendMode},this.getDepthTexture=function(){return depthSensing.getDepthTexture()};const cameraLPos=new Vector3,cameraRPos=new Vector3;function updateCamera(camera,parent){null===parent?camera.matrixWorld.copy(camera.matrix):camera.matrixWorld.multiplyMatrices(parent.matrixWorld,camera.matrix),camera.matrixWorldInverse.copy(camera.matrixWorld).invert()}this.updateCamera=function(camera){if(null===session)return;null!==depthSensing.texture&&(camera.near=depthSensing.depthNear,camera.far=depthSensing.depthFar),cameraXR.near=cameraR.near=cameraL.near=camera.near,cameraXR.far=cameraR.far=cameraL.far=camera.far,_currentDepthNear===cameraXR.near&&_currentDepthFar===cameraXR.far||(session.updateRenderState({depthNear:cameraXR.near,depthFar:cameraXR.far}),_currentDepthNear=cameraXR.near,_currentDepthFar=cameraXR.far,cameraL.near=_currentDepthNear,cameraL.far=_currentDepthFar,cameraR.near=_currentDepthNear,cameraR.far=_currentDepthFar,cameraL.updateProjectionMatrix(),cameraR.updateProjectionMatrix(),camera.updateProjectionMatrix());const parent=camera.parent,cameras=cameraXR.cameras;updateCamera(cameraXR,parent);for(let i=0;i0&&(uniforms.alphaTest.value=material.alphaTest);const materialProperties=properties.get(material),envMap=materialProperties.envMap,envMapRotation=materialProperties.envMapRotation;envMap&&(uniforms.envMap.value=envMap,_e1.copy(envMapRotation),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,envMap.isCubeTexture&&!1===envMap.isRenderTargetTexture&&(_e1.y*=-1,_e1.z*=-1),uniforms.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),uniforms.flipEnvMap.value=envMap.isCubeTexture&&!1===envMap.isRenderTargetTexture?-1:1,uniforms.reflectivity.value=material.reflectivity,uniforms.ior.value=material.ior,uniforms.refractionRatio.value=material.refractionRatio),material.lightMap&&(uniforms.lightMap.value=material.lightMap,uniforms.lightMapIntensity.value=material.lightMapIntensity,refreshTransformUniform(material.lightMap,uniforms.lightMapTransform)),material.aoMap&&(uniforms.aoMap.value=material.aoMap,uniforms.aoMapIntensity.value=material.aoMapIntensity,refreshTransformUniform(material.aoMap,uniforms.aoMapTransform))}return{refreshFogUniforms:function refreshFogUniforms(uniforms,fog){fog.color.getRGB(uniforms.fogColor.value,getUnlitUniformColorSpace(renderer)),fog.isFog?(uniforms.fogNear.value=fog.near,uniforms.fogFar.value=fog.far):fog.isFogExp2&&(uniforms.fogDensity.value=fog.density)},refreshMaterialUniforms:function refreshMaterialUniforms(uniforms,material,pixelRatio,height,transmissionRenderTarget){material.isMeshBasicMaterial||material.isMeshLambertMaterial?refreshUniformsCommon(uniforms,material):material.isMeshToonMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsToon(uniforms,material){material.gradientMap&&(uniforms.gradientMap.value=material.gradientMap)}(uniforms,material)):material.isMeshPhongMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsPhong(uniforms,material){uniforms.specular.value.copy(material.specular),uniforms.shininess.value=Math.max(material.shininess,1e-4)}(uniforms,material)):material.isMeshStandardMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsStandard(uniforms,material){uniforms.metalness.value=material.metalness,material.metalnessMap&&(uniforms.metalnessMap.value=material.metalnessMap,refreshTransformUniform(material.metalnessMap,uniforms.metalnessMapTransform));uniforms.roughness.value=material.roughness,material.roughnessMap&&(uniforms.roughnessMap.value=material.roughnessMap,refreshTransformUniform(material.roughnessMap,uniforms.roughnessMapTransform));material.envMap&&(uniforms.envMapIntensity.value=material.envMapIntensity)}(uniforms,material),material.isMeshPhysicalMaterial&&function refreshUniformsPhysical(uniforms,material,transmissionRenderTarget){uniforms.ior.value=material.ior,material.sheen>0&&(uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen),uniforms.sheenRoughness.value=material.sheenRoughness,material.sheenColorMap&&(uniforms.sheenColorMap.value=material.sheenColorMap,refreshTransformUniform(material.sheenColorMap,uniforms.sheenColorMapTransform)),material.sheenRoughnessMap&&(uniforms.sheenRoughnessMap.value=material.sheenRoughnessMap,refreshTransformUniform(material.sheenRoughnessMap,uniforms.sheenRoughnessMapTransform)));material.clearcoat>0&&(uniforms.clearcoat.value=material.clearcoat,uniforms.clearcoatRoughness.value=material.clearcoatRoughness,material.clearcoatMap&&(uniforms.clearcoatMap.value=material.clearcoatMap,refreshTransformUniform(material.clearcoatMap,uniforms.clearcoatMapTransform)),material.clearcoatRoughnessMap&&(uniforms.clearcoatRoughnessMap.value=material.clearcoatRoughnessMap,refreshTransformUniform(material.clearcoatRoughnessMap,uniforms.clearcoatRoughnessMapTransform)),material.clearcoatNormalMap&&(uniforms.clearcoatNormalMap.value=material.clearcoatNormalMap,refreshTransformUniform(material.clearcoatNormalMap,uniforms.clearcoatNormalMapTransform),uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale),material.side===BackSide&&uniforms.clearcoatNormalScale.value.negate()));material.dispersion>0&&(uniforms.dispersion.value=material.dispersion);material.iridescence>0&&(uniforms.iridescence.value=material.iridescence,uniforms.iridescenceIOR.value=material.iridescenceIOR,uniforms.iridescenceThicknessMinimum.value=material.iridescenceThicknessRange[0],uniforms.iridescenceThicknessMaximum.value=material.iridescenceThicknessRange[1],material.iridescenceMap&&(uniforms.iridescenceMap.value=material.iridescenceMap,refreshTransformUniform(material.iridescenceMap,uniforms.iridescenceMapTransform)),material.iridescenceThicknessMap&&(uniforms.iridescenceThicknessMap.value=material.iridescenceThicknessMap,refreshTransformUniform(material.iridescenceThicknessMap,uniforms.iridescenceThicknessMapTransform)));material.transmission>0&&(uniforms.transmission.value=material.transmission,uniforms.transmissionSamplerMap.value=transmissionRenderTarget.texture,uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width,transmissionRenderTarget.height),material.transmissionMap&&(uniforms.transmissionMap.value=material.transmissionMap,refreshTransformUniform(material.transmissionMap,uniforms.transmissionMapTransform)),uniforms.thickness.value=material.thickness,material.thicknessMap&&(uniforms.thicknessMap.value=material.thicknessMap,refreshTransformUniform(material.thicknessMap,uniforms.thicknessMapTransform)),uniforms.attenuationDistance.value=material.attenuationDistance,uniforms.attenuationColor.value.copy(material.attenuationColor));material.anisotropy>0&&(uniforms.anisotropyVector.value.set(material.anisotropy*Math.cos(material.anisotropyRotation),material.anisotropy*Math.sin(material.anisotropyRotation)),material.anisotropyMap&&(uniforms.anisotropyMap.value=material.anisotropyMap,refreshTransformUniform(material.anisotropyMap,uniforms.anisotropyMapTransform)));uniforms.specularIntensity.value=material.specularIntensity,uniforms.specularColor.value.copy(material.specularColor),material.specularColorMap&&(uniforms.specularColorMap.value=material.specularColorMap,refreshTransformUniform(material.specularColorMap,uniforms.specularColorMapTransform));material.specularIntensityMap&&(uniforms.specularIntensityMap.value=material.specularIntensityMap,refreshTransformUniform(material.specularIntensityMap,uniforms.specularIntensityMapTransform))}(uniforms,material,transmissionRenderTarget)):material.isMeshMatcapMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsMatcap(uniforms,material){material.matcap&&(uniforms.matcap.value=material.matcap)}(uniforms,material)):material.isMeshDepthMaterial?refreshUniformsCommon(uniforms,material):material.isMeshDistanceMaterial?(refreshUniformsCommon(uniforms,material),function refreshUniformsDistance(uniforms,material){const light=properties.get(material).light;uniforms.referencePosition.value.setFromMatrixPosition(light.matrixWorld),uniforms.nearDistance.value=light.shadow.camera.near,uniforms.farDistance.value=light.shadow.camera.far}(uniforms,material)):material.isMeshNormalMaterial?refreshUniformsCommon(uniforms,material):material.isLineBasicMaterial?(!function refreshUniformsLine(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform))}(uniforms,material),material.isLineDashedMaterial&&function refreshUniformsDash(uniforms,material){uniforms.dashSize.value=material.dashSize,uniforms.totalSize.value=material.dashSize+material.gapSize,uniforms.scale.value=material.scale}(uniforms,material)):material.isPointsMaterial?function refreshUniformsPoints(uniforms,material,pixelRatio,height){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.size.value=material.size*pixelRatio,uniforms.scale.value=.5*height,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.uvTransform));material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform));material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}(uniforms,material,pixelRatio,height):material.isSpriteMaterial?function refreshUniformsSprites(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.rotation.value=material.rotation,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform));material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform));material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}(uniforms,material):material.isShadowMaterial?(uniforms.color.value.copy(material.color),uniforms.opacity.value=material.opacity):material.isShaderMaterial&&(material.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(gl,info,capabilities,state){let buffers={},updateList={},allocatedBindingPoints=[];const maxBindingPoints=gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS);function hasUniformChanged(uniform,index,indexArray,cache){const value=uniform.value,indexString=index+"_"+indexArray;if(void 0===cache[indexString])return cache[indexString]="number"==typeof value||"boolean"==typeof value?value:value.clone(),!0;{const cachedObject=cache[indexString];if("number"==typeof value||"boolean"==typeof value){if(cachedObject!==value)return cache[indexString]=value,!0}else if(!1===cachedObject.equals(value))return cachedObject.copy(value),!0}return!1}function getUniformSize(value){const info={boundary:0,storage:0};return"number"==typeof value||"boolean"==typeof value?(info.boundary=4,info.storage=4):value.isVector2?(info.boundary=8,info.storage=8):value.isVector3||value.isColor?(info.boundary=16,info.storage=12):value.isVector4?(info.boundary=16,info.storage=16):value.isMatrix3?(info.boundary=48,info.storage=48):value.isMatrix4?(info.boundary=64,info.storage=64):value.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",value),info}function onUniformsGroupsDispose(event){const uniformsGroup=event.target;uniformsGroup.removeEventListener("dispose",onUniformsGroupsDispose);const index=allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex);allocatedBindingPoints.splice(index,1),gl.deleteBuffer(buffers[uniformsGroup.id]),delete buffers[uniformsGroup.id],delete updateList[uniformsGroup.id]}return{bind:function bind(uniformsGroup,program){const webglProgram=program.program;state.uniformBlockBinding(uniformsGroup,webglProgram)},update:function update(uniformsGroup,program){let buffer=buffers[uniformsGroup.id];void 0===buffer&&(!function prepareUniformsGroup(uniformsGroup){const uniforms=uniformsGroup.uniforms;let offset=0;const chunkSize=16;for(let i=0,l=uniforms.length;i0&&(offset+=chunkSize-chunkOffset);return uniformsGroup.__size=offset,uniformsGroup.__cache={},this}(uniformsGroup),buffer=function createBuffer(uniformsGroup){const bindingPointIndex=function allocateBindingPointIndex(){for(let i=0;i0),morphTargets=!!geometry.morphAttributes.position,morphNormals=!!geometry.morphAttributes.normal,morphColors=!!geometry.morphAttributes.color;let toneMapping=NoToneMapping;material.toneMapped&&(null!==_currentRenderTarget&&!0!==_currentRenderTarget.isXRRenderTarget||(toneMapping=_this.toneMapping));const morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color,morphTargetsCount=void 0!==morphAttribute?morphAttribute.length:0,materialProperties=properties.get(material),lights=currentRenderState.state.lights;if(!0===_clippingEnabled&&(!0===_localClippingEnabled||camera!==_currentCamera)){const useCache=camera===_currentCamera&&material.id===_currentMaterialId;clipping.setState(material,camera,useCache)}let needsProgramChange=!1;material.version===materialProperties.__version?materialProperties.needsLights&&materialProperties.lightsStateVersion!==lights.state.version||materialProperties.outputColorSpace!==colorSpace||object.isBatchedMesh&&!1===materialProperties.batching?needsProgramChange=!0:object.isBatchedMesh||!0!==materialProperties.batching?object.isBatchedMesh&&!0===materialProperties.batchingColor&&null===object.colorTexture||object.isBatchedMesh&&!1===materialProperties.batchingColor&&null!==object.colorTexture||object.isInstancedMesh&&!1===materialProperties.instancing?needsProgramChange=!0:object.isInstancedMesh||!0!==materialProperties.instancing?object.isSkinnedMesh&&!1===materialProperties.skinning?needsProgramChange=!0:object.isSkinnedMesh||!0!==materialProperties.skinning?object.isInstancedMesh&&!0===materialProperties.instancingColor&&null===object.instanceColor||object.isInstancedMesh&&!1===materialProperties.instancingColor&&null!==object.instanceColor||object.isInstancedMesh&&!0===materialProperties.instancingMorph&&null===object.morphTexture||object.isInstancedMesh&&!1===materialProperties.instancingMorph&&null!==object.morphTexture||materialProperties.envMap!==envMap||!0===material.fog&&materialProperties.fog!==fog?needsProgramChange=!0:void 0===materialProperties.numClippingPlanes||materialProperties.numClippingPlanes===clipping.numPlanes&&materialProperties.numIntersection===clipping.numIntersection?(materialProperties.vertexAlphas!==vertexAlphas||materialProperties.vertexTangents!==vertexTangents||materialProperties.morphTargets!==morphTargets||materialProperties.morphNormals!==morphNormals||materialProperties.morphColors!==morphColors||materialProperties.toneMapping!==toneMapping||materialProperties.morphTargetsCount!==morphTargetsCount)&&(needsProgramChange=!0):needsProgramChange=!0:needsProgramChange=!0:needsProgramChange=!0:needsProgramChange=!0:(needsProgramChange=!0,materialProperties.__version=material.version);let program=materialProperties.currentProgram;!0===needsProgramChange&&(program=getProgram(material,scene,object));let refreshProgram=!1,refreshMaterial=!1,refreshLights=!1;const p_uniforms=program.getUniforms(),m_uniforms=materialProperties.uniforms;state.useProgram(program.program)&&(refreshProgram=!0,refreshMaterial=!0,refreshLights=!0);material.id!==_currentMaterialId&&(_currentMaterialId=material.id,refreshMaterial=!0);if(refreshProgram||_currentCamera!==camera){p_uniforms.setValue(_gl,"projectionMatrix",camera.projectionMatrix),p_uniforms.setValue(_gl,"viewMatrix",camera.matrixWorldInverse);const uCamPos=p_uniforms.map.cameraPosition;void 0!==uCamPos&&uCamPos.setValue(_gl,_vector3.setFromMatrixPosition(camera.matrixWorld)),capabilities.logarithmicDepthBuffer&&p_uniforms.setValue(_gl,"logDepthBufFC",2/(Math.log(camera.far+1)/Math.LN2)),(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial)&&p_uniforms.setValue(_gl,"isOrthographic",!0===camera.isOrthographicCamera),_currentCamera!==camera&&(_currentCamera=camera,refreshMaterial=!0,refreshLights=!0)}if(object.isSkinnedMesh){p_uniforms.setOptional(_gl,object,"bindMatrix"),p_uniforms.setOptional(_gl,object,"bindMatrixInverse");const skeleton=object.skeleton;skeleton&&(null===skeleton.boneTexture&&skeleton.computeBoneTexture(),p_uniforms.setValue(_gl,"boneTexture",skeleton.boneTexture,textures))}object.isBatchedMesh&&(p_uniforms.setOptional(_gl,object,"batchingTexture"),p_uniforms.setValue(_gl,"batchingTexture",object._matricesTexture,textures),p_uniforms.setOptional(_gl,object,"batchingIdTexture"),p_uniforms.setValue(_gl,"batchingIdTexture",object._indirectTexture,textures),p_uniforms.setOptional(_gl,object,"batchingColorTexture"),null!==object._colorsTexture&&p_uniforms.setValue(_gl,"batchingColorTexture",object._colorsTexture,textures));const morphAttributes=geometry.morphAttributes;void 0===morphAttributes.position&&void 0===morphAttributes.normal&&void 0===morphAttributes.color||morphtargets.update(object,geometry,program);(refreshMaterial||materialProperties.receiveShadow!==object.receiveShadow)&&(materialProperties.receiveShadow=object.receiveShadow,p_uniforms.setValue(_gl,"receiveShadow",object.receiveShadow));material.isMeshGouraudMaterial&&null!==material.envMap&&(m_uniforms.envMap.value=envMap,m_uniforms.flipEnvMap.value=envMap.isCubeTexture&&!1===envMap.isRenderTargetTexture?-1:1);material.isMeshStandardMaterial&&null===material.envMap&&null!==scene.environment&&(m_uniforms.envMapIntensity.value=scene.environmentIntensity);refreshMaterial&&(p_uniforms.setValue(_gl,"toneMappingExposure",_this.toneMappingExposure),materialProperties.needsLights&&function markUniformsLightsNeedsUpdate(uniforms,value){uniforms.ambientLightColor.needsUpdate=value,uniforms.lightProbe.needsUpdate=value,uniforms.directionalLights.needsUpdate=value,uniforms.directionalLightShadows.needsUpdate=value,uniforms.pointLights.needsUpdate=value,uniforms.pointLightShadows.needsUpdate=value,uniforms.spotLights.needsUpdate=value,uniforms.spotLightShadows.needsUpdate=value,uniforms.rectAreaLights.needsUpdate=value,uniforms.hemisphereLights.needsUpdate=value}(m_uniforms,refreshLights),fog&&!0===material.fog&&materials.refreshFogUniforms(m_uniforms,fog),materials.refreshMaterialUniforms(m_uniforms,material,_pixelRatio,_height,currentRenderState.state.transmissionRenderTarget[camera.id]),WebGLUniforms.upload(_gl,getUniformList(materialProperties),m_uniforms,textures));material.isShaderMaterial&&!0===material.uniformsNeedUpdate&&(WebGLUniforms.upload(_gl,getUniformList(materialProperties),m_uniforms,textures),material.uniformsNeedUpdate=!1);material.isSpriteMaterial&&p_uniforms.setValue(_gl,"center",object.center);if(p_uniforms.setValue(_gl,"modelViewMatrix",object.modelViewMatrix),p_uniforms.setValue(_gl,"normalMatrix",object.normalMatrix),p_uniforms.setValue(_gl,"modelMatrix",object.matrixWorld),material.isShaderMaterial||material.isRawShaderMaterial){const groups=material.uniformsGroups;for(let i=0,l=groups.length;i{function checkMaterialsReady(){materials.forEach((function(material){properties.get(material).currentProgram.isReady()&&materials.delete(material)})),0!==materials.size?setTimeout(checkMaterialsReady,10):resolve(scene)}null!==extensions.get("KHR_parallel_shader_compile")?checkMaterialsReady():setTimeout(checkMaterialsReady,10)}))};let onAnimationFrameCallback=null;function onXRSessionStart(){animation.stop()}function onXRSessionEnd(){animation.start()}const animation=new WebGLAnimation;function projectObject(object,camera,groupOrder,sortObjects){if(!1===object.visible)return;if(object.layers.test(camera.layers))if(object.isGroup)groupOrder=object.renderOrder;else if(object.isLOD)!0===object.autoUpdate&&object.update(camera);else if(object.isLight)currentRenderState.pushLight(object),object.castShadow&¤tRenderState.pushShadow(object);else if(object.isSprite){if(!object.frustumCulled||_frustum.intersectsSprite(object)){sortObjects&&_vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);const geometry=objects.update(object),material=object.material;material.visible&¤tRenderList.push(object,geometry,material,groupOrder,_vector4.z,null)}}else if((object.isMesh||object.isLine||object.isPoints)&&(!object.frustumCulled||_frustum.intersectsObject(object))){const geometry=objects.update(object),material=object.material;if(sortObjects&&(void 0!==object.boundingSphere?(null===object.boundingSphere&&object.computeBoundingSphere(),_vector4.copy(object.boundingSphere.center)):(null===geometry.boundingSphere&&geometry.computeBoundingSphere(),_vector4.copy(geometry.boundingSphere.center)),_vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix)),Array.isArray(material)){const groups=geometry.groups;for(let i=0,l=groups.length;i0&&renderObjects(opaqueObjects,scene,camera),transmissiveObjects.length>0&&renderObjects(transmissiveObjects,scene,camera),transparentObjects.length>0&&renderObjects(transparentObjects,scene,camera),state.buffers.depth.setTest(!0),state.buffers.depth.setMask(!0),state.buffers.color.setMask(!0),state.setPolygonOffset(!1)}function renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera){if(null!==(!0===scene.isScene?scene.overrideMaterial:null))return;void 0===currentRenderState.state.transmissionRenderTarget[camera.id]&&(currentRenderState.state.transmissionRenderTarget[camera.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:extensions.has("EXT_color_buffer_half_float")||extensions.has("EXT_color_buffer_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ColorManagement.workingColorSpace}));const transmissionRenderTarget=currentRenderState.state.transmissionRenderTarget[camera.id],activeViewport=camera.viewport||_currentViewport;transmissionRenderTarget.setSize(activeViewport.z,activeViewport.w);const currentRenderTarget=_this.getRenderTarget();_this.setRenderTarget(transmissionRenderTarget),_this.getClearColor(_currentClearColor),_currentClearAlpha=_this.getClearAlpha(),_currentClearAlpha<1&&_this.setClearColor(16777215,.5),_renderBackground?background.render(scene):_this.clear();const currentToneMapping=_this.toneMapping;_this.toneMapping=NoToneMapping;const currentCameraViewport=camera.viewport;if(void 0!==camera.viewport&&(camera.viewport=void 0),currentRenderState.setupLightsView(camera),!0===_clippingEnabled&&clipping.setGlobalState(_this.clippingPlanes,camera),renderObjects(opaqueObjects,scene,camera),textures.updateMultisampleRenderTarget(transmissionRenderTarget),textures.updateRenderTargetMipmap(transmissionRenderTarget),!1===extensions.has("WEBGL_multisampled_render_to_texture")){let renderTargetNeedsUpdate=!1;for(let i=0,l=transmissiveObjects.length;i0)for(let i=0,l=cameras.length;i0&&renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera),_renderBackground&&background.render(scene),renderScene(currentRenderList,scene,camera);null!==_currentRenderTarget&&(textures.updateMultisampleRenderTarget(_currentRenderTarget),textures.updateRenderTargetMipmap(_currentRenderTarget)),!0===scene.isScene&&scene.onAfterRender(_this,scene,camera),bindingStates.resetDefaultState(),_currentMaterialId=-1,_currentCamera=null,renderStateStack.pop(),renderStateStack.length>0?(currentRenderState=renderStateStack[renderStateStack.length-1],!0===_clippingEnabled&&clipping.setGlobalState(_this.clippingPlanes,currentRenderState.state.camera)):currentRenderState=null,renderListStack.pop(),currentRenderList=renderListStack.length>0?renderListStack[renderListStack.length-1]:null},this.getActiveCubeFace=function(){return _currentActiveCubeFace},this.getActiveMipmapLevel=function(){return _currentActiveMipmapLevel},this.getRenderTarget=function(){return _currentRenderTarget},this.setRenderTargetTextures=function(renderTarget,colorTexture,depthTexture){properties.get(renderTarget.texture).__webglTexture=colorTexture,properties.get(renderTarget.depthTexture).__webglTexture=depthTexture;const renderTargetProperties=properties.get(renderTarget);renderTargetProperties.__hasExternalTextures=!0,renderTargetProperties.__autoAllocateDepthBuffer=void 0===depthTexture,renderTargetProperties.__autoAllocateDepthBuffer||!0===extensions.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),renderTargetProperties.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(renderTarget,defaultFramebuffer){const renderTargetProperties=properties.get(renderTarget);renderTargetProperties.__webglFramebuffer=defaultFramebuffer,renderTargetProperties.__useDefaultFramebuffer=void 0===defaultFramebuffer},this.setRenderTarget=function(renderTarget,activeCubeFace=0,activeMipmapLevel=0){_currentRenderTarget=renderTarget,_currentActiveCubeFace=activeCubeFace,_currentActiveMipmapLevel=activeMipmapLevel;let useDefaultFramebuffer=!0,framebuffer=null,isCube=!1,isRenderTarget3D=!1;if(renderTarget){const renderTargetProperties=properties.get(renderTarget);void 0!==renderTargetProperties.__useDefaultFramebuffer?(state.bindFramebuffer(_gl.FRAMEBUFFER,null),useDefaultFramebuffer=!1):void 0===renderTargetProperties.__webglFramebuffer?textures.setupRenderTarget(renderTarget):renderTargetProperties.__hasExternalTextures&&textures.rebindTextures(renderTarget,properties.get(renderTarget.texture).__webglTexture,properties.get(renderTarget.depthTexture).__webglTexture);const texture=renderTarget.texture;(texture.isData3DTexture||texture.isDataArrayTexture||texture.isCompressedArrayTexture)&&(isRenderTarget3D=!0);const __webglFramebuffer=properties.get(renderTarget).__webglFramebuffer;renderTarget.isWebGLCubeRenderTarget?(framebuffer=Array.isArray(__webglFramebuffer[activeCubeFace])?__webglFramebuffer[activeCubeFace][activeMipmapLevel]:__webglFramebuffer[activeCubeFace],isCube=!0):framebuffer=renderTarget.samples>0&&!1===textures.useMultisampledRTT(renderTarget)?properties.get(renderTarget).__webglMultisampledFramebuffer:Array.isArray(__webglFramebuffer)?__webglFramebuffer[activeMipmapLevel]:__webglFramebuffer,_currentViewport.copy(renderTarget.viewport),_currentScissor.copy(renderTarget.scissor),_currentScissorTest=renderTarget.scissorTest}else _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(),_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(),_currentScissorTest=_scissorTest;if(state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer)&&useDefaultFramebuffer&&state.drawBuffers(renderTarget,framebuffer),state.viewport(_currentViewport),state.scissor(_currentScissor),state.setScissorTest(_currentScissorTest),isCube){const textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_CUBE_MAP_POSITIVE_X+activeCubeFace,textureProperties.__webglTexture,activeMipmapLevel)}else if(isRenderTarget3D){const textureProperties=properties.get(renderTarget.texture),layer=activeCubeFace||0;_gl.framebufferTextureLayer(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,textureProperties.__webglTexture,activeMipmapLevel||0,layer)}_currentMaterialId=-1},this.readRenderTargetPixels=function(renderTarget,x,y,width,height,buffer,activeCubeFaceIndex){if(!renderTarget||!renderTarget.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&void 0!==activeCubeFaceIndex&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);try{const texture=renderTarget.texture,textureFormat=texture.format,textureType=texture.type;if(!capabilities.textureFormatReadable(textureFormat))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!capabilities.textureTypeReadable(textureType))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");x>=0&&x<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height&&_gl.readPixels(x,y,width,height,utils.convert(textureFormat),utils.convert(textureType),buffer)}finally{const framebuffer=null!==_currentRenderTarget?properties.get(_currentRenderTarget).__webglFramebuffer:null;state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer)}}},this.readRenderTargetPixelsAsync=async function(renderTarget,x,y,width,height,buffer,activeCubeFaceIndex){if(!renderTarget||!renderTarget.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&void 0!==activeCubeFaceIndex&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);try{const texture=renderTarget.texture,textureFormat=texture.format,textureType=texture.type;if(!capabilities.textureFormatReadable(textureFormat))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!capabilities.textureTypeReadable(textureType))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(x>=0&&x<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height){const glBuffer=_gl.createBuffer();_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER,glBuffer),_gl.bufferData(_gl.PIXEL_PACK_BUFFER,buffer.byteLength,_gl.STREAM_READ),_gl.readPixels(x,y,width,height,utils.convert(textureFormat),utils.convert(textureType),0),_gl.flush();const sync=_gl.fenceSync(_gl.SYNC_GPU_COMMANDS_COMPLETE,0);await function probeAsync(gl,sync,interval){return new Promise((function(resolve,reject){setTimeout((function probe(){switch(gl.clientWaitSync(sync,gl.SYNC_FLUSH_COMMANDS_BIT,0)){case gl.WAIT_FAILED:reject();break;case gl.TIMEOUT_EXPIRED:setTimeout(probe,interval);break;default:resolve()}}),interval)}))}(_gl,sync,4);try{_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER,glBuffer),_gl.getBufferSubData(_gl.PIXEL_PACK_BUFFER,0,buffer)}finally{_gl.deleteBuffer(glBuffer),_gl.deleteSync(sync)}return buffer}}finally{const framebuffer=null!==_currentRenderTarget?properties.get(_currentRenderTarget).__webglFramebuffer:null;state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer)}}},this.copyFramebufferToTexture=function(texture,position=null,level=0){!0!==texture.isTexture&&(console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),position=arguments[0]||null,texture=arguments[1]);const levelScale=Math.pow(2,-level),width=Math.floor(texture.image.width*levelScale),height=Math.floor(texture.image.height*levelScale),x=null!==position?position.x:0,y=null!==position?position.y:0;textures.setTexture2D(texture,0),_gl.copyTexSubImage2D(_gl.TEXTURE_2D,level,0,0,x,y,width,height),state.unbindTexture()},this.copyTextureToTexture=function(srcTexture,dstTexture,srcRegion=null,dstPosition=null,level=0){let width,height,minX,minY,dstX,dstY;!0!==srcTexture.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),dstPosition=arguments[0]||null,srcTexture=arguments[1],dstTexture=arguments[2],level=arguments[3]||0,srcRegion=null),null!==srcRegion?(width=srcRegion.max.x-srcRegion.min.x,height=srcRegion.max.y-srcRegion.min.y,minX=srcRegion.min.x,minY=srcRegion.min.y):(width=srcTexture.image.width,height=srcTexture.image.height,minX=0,minY=0),null!==dstPosition?(dstX=dstPosition.x,dstY=dstPosition.y):(dstX=0,dstY=0);const glFormat=utils.convert(dstTexture.format),glType=utils.convert(dstTexture.type);textures.setTexture2D(dstTexture,0),_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,dstTexture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dstTexture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,dstTexture.unpackAlignment);const currentUnpackRowLen=_gl.getParameter(_gl.UNPACK_ROW_LENGTH),currentUnpackImageHeight=_gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT),currentUnpackSkipPixels=_gl.getParameter(_gl.UNPACK_SKIP_PIXELS),currentUnpackSkipRows=_gl.getParameter(_gl.UNPACK_SKIP_ROWS),currentUnpackSkipImages=_gl.getParameter(_gl.UNPACK_SKIP_IMAGES),image=srcTexture.isCompressedTexture?srcTexture.mipmaps[level]:srcTexture.image;_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,image.width),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,image.height),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,minX),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,minY),srcTexture.isDataTexture?_gl.texSubImage2D(_gl.TEXTURE_2D,level,dstX,dstY,width,height,glFormat,glType,image.data):srcTexture.isCompressedTexture?_gl.compressedTexSubImage2D(_gl.TEXTURE_2D,level,dstX,dstY,image.width,image.height,glFormat,image.data):_gl.texSubImage2D(_gl.TEXTURE_2D,level,dstX,dstY,width,height,glFormat,glType,image),_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,currentUnpackRowLen),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,currentUnpackImageHeight),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,currentUnpackSkipPixels),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,currentUnpackSkipRows),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,currentUnpackSkipImages),0===level&&dstTexture.generateMipmaps&&_gl.generateMipmap(_gl.TEXTURE_2D),state.unbindTexture()},this.copyTextureToTexture3D=function(srcTexture,dstTexture,srcRegion=null,dstPosition=null,level=0){let width,height,depth,minX,minY,minZ,dstX,dstY,dstZ;!0!==srcTexture.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),srcRegion=arguments[0]||null,dstPosition=arguments[1]||null,srcTexture=arguments[2],dstTexture=arguments[3],level=arguments[4]||0);const image=srcTexture.isCompressedTexture?srcTexture.mipmaps[level]:srcTexture.image;null!==srcRegion?(width=srcRegion.max.x-srcRegion.min.x,height=srcRegion.max.y-srcRegion.min.y,depth=srcRegion.max.z-srcRegion.min.z,minX=srcRegion.min.x,minY=srcRegion.min.y,minZ=srcRegion.min.z):(width=image.width,height=image.height,depth=image.depth,minX=0,minY=0,minZ=0),null!==dstPosition?(dstX=dstPosition.x,dstY=dstPosition.y,dstZ=dstPosition.z):(dstX=0,dstY=0,dstZ=0);const glFormat=utils.convert(dstTexture.format),glType=utils.convert(dstTexture.type);let glTarget;if(dstTexture.isData3DTexture)textures.setTexture3D(dstTexture,0),glTarget=_gl.TEXTURE_3D;else{if(!dstTexture.isDataArrayTexture&&!dstTexture.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");textures.setTexture2DArray(dstTexture,0),glTarget=_gl.TEXTURE_2D_ARRAY}_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,dstTexture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dstTexture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,dstTexture.unpackAlignment);const currentUnpackRowLen=_gl.getParameter(_gl.UNPACK_ROW_LENGTH),currentUnpackImageHeight=_gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT),currentUnpackSkipPixels=_gl.getParameter(_gl.UNPACK_SKIP_PIXELS),currentUnpackSkipRows=_gl.getParameter(_gl.UNPACK_SKIP_ROWS),currentUnpackSkipImages=_gl.getParameter(_gl.UNPACK_SKIP_IMAGES);_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,image.width),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,image.height),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,minX),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,minY),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,minZ),srcTexture.isDataTexture||srcTexture.isData3DTexture?_gl.texSubImage3D(glTarget,level,dstX,dstY,dstZ,width,height,depth,glFormat,glType,image.data):dstTexture.isCompressedArrayTexture?_gl.compressedTexSubImage3D(glTarget,level,dstX,dstY,dstZ,width,height,depth,glFormat,image.data):_gl.texSubImage3D(glTarget,level,dstX,dstY,dstZ,width,height,depth,glFormat,glType,image),_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,currentUnpackRowLen),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,currentUnpackImageHeight),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,currentUnpackSkipPixels),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,currentUnpackSkipRows),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,currentUnpackSkipImages),0===level&&dstTexture.generateMipmaps&&_gl.generateMipmap(glTarget),state.unbindTexture()},this.initRenderTarget=function(target){void 0===properties.get(target).__webglFramebuffer&&textures.setupRenderTarget(target)},this.initTexture=function(texture){texture.isCubeTexture?textures.setTextureCube(texture,0):texture.isData3DTexture?textures.setTexture3D(texture,0):texture.isDataArrayTexture||texture.isCompressedArrayTexture?textures.setTexture2DArray(texture,0):textures.setTexture2D(texture,0),state.unbindTexture()},this.resetState=function(){_currentActiveCubeFace=0,_currentActiveMipmapLevel=0,_currentRenderTarget=null,state.reset(),bindingStates.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return WebGLCoordinateSystem}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(colorSpace){this._outputColorSpace=colorSpace;const gl=this.getContext();gl.drawingBufferColorSpace=colorSpace===DisplayP3ColorSpace?"display-p3":"srgb",gl.unpackColorSpace=ColorManagement.workingColorSpace===LinearDisplayP3ColorSpace?"display-p3":"srgb"}}class FogExp2{constructor(color,density=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color(color),this.density=density}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Fog{constructor(color,near=1,far=1e3){this.isFog=!0,this.name="",this.color=new Color(color),this.near=near,this.far=far}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{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 Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(source,recursive){return super.copy(source,recursive),null!==source.background&&(this.background=source.background.clone()),null!==source.environment&&(this.environment=source.environment.clone()),null!==source.fog&&(this.fog=source.fog.clone()),this.backgroundBlurriness=source.backgroundBlurriness,this.backgroundIntensity=source.backgroundIntensity,this.backgroundRotation.copy(source.backgroundRotation),this.environmentIntensity=source.environmentIntensity,this.environmentRotation.copy(source.environmentRotation),null!==source.overrideMaterial&&(this.overrideMaterial=source.overrideMaterial.clone()),this.matrixAutoUpdate=source.matrixAutoUpdate,this}toJSON(meta){const data=super.toJSON(meta);return null!==this.fog&&(data.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(data.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(data.object.backgroundIntensity=this.backgroundIntensity),data.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(data.object.environmentIntensity=this.environmentIntensity),data.object.environmentRotation=this.environmentRotation.toArray(),data}}class InterleavedBuffer{constructor(array,stride){this.isInterleavedBuffer=!0,this.array=array,this.stride=stride,this.count=void 0!==array?array.length/stride:0,this.usage=StaticDrawUsage,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=generateUUID()}onUploadCallback(){}set needsUpdate(value){!0===value&&this.version++}get updateRange(){return warnOnce("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(value){return this.usage=value,this}addUpdateRange(start,count){this.updateRanges.push({start:start,count:count})}clearUpdateRanges(){this.updateRanges.length=0}copy(source){return this.array=new source.array.constructor(source.array),this.count=source.count,this.stride=source.stride,this.usage=source.usage,this}copyAt(index1,attribute,index2){index1*=this.stride,index2*=attribute.stride;for(let i=0,l=this.stride;iraycaster.far||intersects.push({distance:distance,point:_intersectPoint.clone(),uv:Triangle.getInterpolation(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(source,recursive){return super.copy(source,recursive),void 0!==source.center&&this.center.copy(source.center),this.material=source.material,this}}function transformVertex(vertexPosition,mvPosition,center,scale,sin,cos){_alignedPosition.subVectors(vertexPosition,center).addScalar(.5).multiply(scale),void 0!==sin?(_rotatedPosition.x=cos*_alignedPosition.x-sin*_alignedPosition.y,_rotatedPosition.y=sin*_alignedPosition.x+cos*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),vertexPosition.copy(mvPosition),vertexPosition.x+=_rotatedPosition.x,vertexPosition.y+=_rotatedPosition.y,vertexPosition.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(source){super.copy(source,!1);const levels=source.levels;for(let i=0,l=levels.length;i0){let i,l;for(i=1,l=levels.length;i0){_v1$2.setFromMatrixPosition(this.matrixWorld);const distance=raycaster.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(distance).raycast(raycaster,intersects)}}update(camera){const levels=this.levels;if(levels.length>1){_v1$2.setFromMatrixPosition(camera.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const distance=_v1$2.distanceTo(_v2$1)/camera.zoom;let i,l;for(levels[0].object.visible=!0,i=1,l=levels.length;i=levelDistance))break;levels[i-1].object.visible=!1,levels[i].object.visible=!0}for(this._currentLevel=i-1;i=pool.length&&pool.push({start:-1,count:-1,z:-1,index:-1});const item=pool[this.index];list.push(item),this.index++,item.start=drawRange.start,item.count=drawRange.count,item.z=z,item.index=index}reset(){this.list.length=0,this.index=0}}const _matrix$1=new Matrix4,_invMatrixWorld=new Matrix4,_identityMatrix=new Matrix4,_whiteColor=new Color(1,1,1),_projScreenMatrix$2=new Matrix4,_frustum=new Frustum,_box$1=new Box3,_sphere$2=new Sphere,_vector$5=new Vector3,_forward=new Vector3,_temp=new Vector3,_renderList=new MultiDrawRenderList,_mesh=new Mesh,_batchIntersects=[];function copyAttributeData(src,target,targetOffset=0){const itemSize=target.itemSize;if(src.isInterleavedBufferAttribute||src.array.constructor!==target.array.constructor){const vertexCount=src.count;for(let i=0;i65535?new Uint32Array(maxIndexCount):new Uint16Array(maxIndexCount);geometry.setIndex(new BufferAttribute(indexArray,1))}this._geometryInitialized=!0}}_validateGeometry(geometry){const batchGeometry=this.geometry;if(Boolean(geometry.getIndex())!==Boolean(batchGeometry.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const attributeName in batchGeometry.attributes){if(!geometry.hasAttribute(attributeName))throw new Error(`BatchedMesh: Added geometry missing "${attributeName}". All geometries must have consistent attributes.`);const srcAttribute=geometry.getAttribute(attributeName),dstAttribute=batchGeometry.getAttribute(attributeName);if(srcAttribute.itemSize!==dstAttribute.itemSize||srcAttribute.normalized!==dstAttribute.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(func){return this.customSort=func,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const geometryCount=this._geometryCount,boundingBox=this.boundingBox,drawInfo=this._drawInfo;boundingBox.makeEmpty();for(let i=0;i=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:geometryId});const drawId=this._drawInfo.length-1,matricesTexture=this._matricesTexture,matricesArray=matricesTexture.image.data;_identityMatrix.toArray(matricesArray,16*drawId),matricesTexture.needsUpdate=!0;const colorsTexture=this._colorsTexture;return colorsTexture&&(_whiteColor.toArray(colorsTexture.image.data,4*drawId),colorsTexture.needsUpdate=!0),drawId}addGeometry(geometry,vertexCount=-1,indexCount=-1){if(this._initializeGeometry(geometry),this._validateGeometry(geometry),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const reservedRange={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let lastRange=null;const reservedRanges=this._reservedRanges,drawRanges=this._drawRanges,bounds=this._bounds;0!==this._geometryCount&&(lastRange=reservedRanges[reservedRanges.length-1]),reservedRange.vertexCount=-1===vertexCount?geometry.getAttribute("position").count:vertexCount,reservedRange.vertexStart=null===lastRange?0:lastRange.vertexStart+lastRange.vertexCount;const index=geometry.getIndex(),hasIndex=null!==index;if(hasIndex&&(reservedRange.indexCount=-1===indexCount?index.count:indexCount,reservedRange.indexStart=null===lastRange?0:lastRange.indexStart+lastRange.indexCount),-1!==reservedRange.indexStart&&reservedRange.indexStart+reservedRange.indexCount>this._maxIndexCount||reservedRange.vertexStart+reservedRange.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const geometryId=this._geometryCount;return this._geometryCount++,reservedRanges.push(reservedRange),drawRanges.push({start:hasIndex?reservedRange.indexStart:reservedRange.vertexStart,count:-1}),bounds.push({boxInitialized:!1,box:new Box3,sphereInitialized:!1,sphere:new Sphere}),this.setGeometryAt(geometryId,geometry),geometryId}setGeometryAt(geometryId,geometry){if(geometryId>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(geometry);const batchGeometry=this.geometry,hasIndex=null!==batchGeometry.getIndex(),dstIndex=batchGeometry.getIndex(),srcIndex=geometry.getIndex(),reservedRange=this._reservedRanges[geometryId];if(hasIndex&&srcIndex.count>reservedRange.indexCount||geometry.attributes.position.count>reservedRange.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const vertexStart=reservedRange.vertexStart,vertexCount=reservedRange.vertexCount;for(const attributeName in batchGeometry.attributes){const srcAttribute=geometry.getAttribute(attributeName),dstAttribute=batchGeometry.getAttribute(attributeName);copyAttributeData(srcAttribute,dstAttribute,vertexStart);const itemSize=srcAttribute.itemSize;for(let i=srcAttribute.count,l=vertexCount;i=this._geometryCount)return null;const bound=this._bounds[geometryId],box=bound.box,geometry=this.geometry;if(!1===bound.boxInitialized){box.makeEmpty();const index=geometry.index,position=geometry.attributes.position,drawRange=this._drawRanges[geometryId];for(let i=drawRange.start,l=drawRange.start+drawRange.count;i=this._geometryCount)return null;const bound=this._bounds[geometryId],sphere=bound.sphere,geometry=this.geometry;if(!1===bound.sphereInitialized){sphere.makeEmpty(),this.getBoundingBoxAt(geometryId,_box$1),_box$1.getCenter(sphere.center);const index=geometry.index,position=geometry.attributes.position,drawRange=this._drawRanges[geometryId];let maxRadiusSq=0;for(let i=drawRange.start,l=drawRange.start+drawRange.count;i=drawInfo.length||!1===drawInfo[instanceId].active||(matrix.toArray(matricesArray,16*instanceId),matricesTexture.needsUpdate=!0),this}getMatrixAt(instanceId,matrix){const drawInfo=this._drawInfo,matricesArray=this._matricesTexture.image.data;return instanceId>=drawInfo.length||!1===drawInfo[instanceId].active?null:matrix.fromArray(matricesArray,16*instanceId)}setColorAt(instanceId,color){null===this._colorsTexture&&this._initColorsTexture();const colorsTexture=this._colorsTexture,colorsArray=this._colorsTexture.image.data,drawInfo=this._drawInfo;return instanceId>=drawInfo.length||!1===drawInfo[instanceId].active||(color.toArray(colorsArray,4*instanceId),colorsTexture.needsUpdate=!0),this}getColorAt(instanceId,color){const colorsArray=this._colorsTexture.image.data,drawInfo=this._drawInfo;return instanceId>=drawInfo.length||!1===drawInfo[instanceId].active?null:color.fromArray(colorsArray,4*instanceId)}setVisibleAt(instanceId,value){const drawInfo=this._drawInfo;return instanceId>=drawInfo.length||!1===drawInfo[instanceId].active||drawInfo[instanceId].visible===value||(drawInfo[instanceId].visible=value,this._visibilityChanged=!0),this}getVisibleAt(instanceId){const drawInfo=this._drawInfo;return!(instanceId>=drawInfo.length||!1===drawInfo[instanceId].active)&&drawInfo[instanceId].visible}raycast(raycaster,intersects){const drawInfo=this._drawInfo,drawRanges=this._drawRanges,matrixWorld=this.matrixWorld,batchGeometry=this.geometry;_mesh.material=this.material,_mesh.geometry.index=batchGeometry.index,_mesh.geometry.attributes=batchGeometry.attributes,null===_mesh.geometry.boundingBox&&(_mesh.geometry.boundingBox=new Box3),null===_mesh.geometry.boundingSphere&&(_mesh.geometry.boundingSphere=new Sphere);for(let i=0,l=drawInfo.length;i({...range}))),this._reservedRanges=source._reservedRanges.map((range=>({...range}))),this._drawInfo=source._drawInfo.map((inf=>({...inf}))),this._bounds=source._bounds.map((bound=>({boxInitialized:bound.boxInitialized,box:bound.box.clone(),sphereInitialized:bound.sphereInitialized,sphere:bound.sphere.clone()}))),this._maxInstanceCount=source._maxInstanceCount,this._maxVertexCount=source._maxVertexCount,this._maxIndexCount=source._maxIndexCount,this._geometryInitialized=source._geometryInitialized,this._geometryCount=source._geometryCount,this._multiDrawCounts=source._multiDrawCounts.slice(),this._multiDrawStarts=source._multiDrawStarts.slice(),this._matricesTexture=source._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),null!==this._colorsTexture&&(this._colorsTexture=source._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(renderer,scene,camera,geometry,material){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const index=geometry.getIndex(),bytesPerElement=null===index?1:index.array.BYTES_PER_ELEMENT,drawInfo=this._drawInfo,multiDrawStarts=this._multiDrawStarts,multiDrawCounts=this._multiDrawCounts,drawRanges=this._drawRanges,perObjectFrustumCulled=this.perObjectFrustumCulled,indirectTexture=this._indirectTexture,indirectArray=indirectTexture.image.data;perObjectFrustumCulled&&(_projScreenMatrix$2.multiplyMatrices(camera.projectionMatrix,camera.matrixWorldInverse).multiply(this.matrixWorld),_frustum.setFromProjectionMatrix(_projScreenMatrix$2,renderer.coordinateSystem));let count=0;if(this.sortObjects){_invMatrixWorld.copy(this.matrixWorld).invert(),_vector$5.setFromMatrixPosition(camera.matrixWorld).applyMatrix4(_invMatrixWorld),_forward.set(0,0,-1).transformDirection(camera.matrixWorld).transformDirection(_invMatrixWorld);for(let i=0,l=drawInfo.length;i0){const morphAttribute=morphAttributes[keys[0]];if(void 0!==morphAttribute){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;mthresholdSq)return;_intersectPointOnRay.applyMatrix4(object.matrixWorld);const distance=raycaster.ray.origin.distanceTo(_intersectPointOnRay);return distanceraycaster.far?void 0:{distance:distance,point:_intersectPointOnSegment.clone().applyMatrix4(object.matrixWorld),index:a,face:null,faceIndex:null,object:object}}const _start=new Vector3,_end=new Vector3;class LineSegments extends Line{constructor(geometry,material){super(geometry,material),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const geometry=this.geometry;if(null===geometry.index){const positionAttribute=geometry.attributes.position,lineDistances=[];for(let i=0,l=positionAttribute.count;i0){const morphAttribute=morphAttributes[keys[0]];if(void 0!==morphAttribute){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let m=0,ml=morphAttribute.length;mraycaster.far)return;intersects.push({distance:distance,distanceToRay:Math.sqrt(rayPointDistanceSq),point:intersectPoint,index:index,face:null,object:object})}}class VideoTexture extends Texture{constructor(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){super(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy),this.isVideoTexture=!0,this.minFilter=void 0!==minFilter?minFilter:LinearFilter,this.magFilter=void 0!==magFilter?magFilter:LinearFilter,this.generateMipmaps=!1;const scope=this;"requestVideoFrameCallback"in video&&video.requestVideoFrameCallback((function updateVideo(){scope.needsUpdate=!0,video.requestVideoFrameCallback(updateVideo)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const video=this.image;!1==="requestVideoFrameCallback"in video&&video.readyState>=video.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(width,height){super({width:width,height:height}),this.isFramebufferTexture=!0,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(mipmaps,width,height,format,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,colorSpace){super(null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,colorSpace),this.isCompressedTexture=!0,this.image={width:width,height:height},this.mipmaps=mipmaps,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(mipmaps,width,height,depth,format,type){super(mipmaps,width,height,format,type),this.isCompressedArrayTexture=!0,this.image.depth=depth,this.wrapR=ClampToEdgeWrapping,this.layerUpdates=new Set}addLayerUpdate(layerIndex){this.layerUpdates.add(layerIndex)}clearLayerUpdates(){this.layerUpdates.clear()}}class CompressedCubeTexture extends CompressedTexture{constructor(images,format,type){super(void 0,images[0].width,images[0].height,format,type,CubeReflectionMapping),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=images}}class CanvasTexture extends Texture{constructor(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){super(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Curve{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(u,optionalTarget){const t=this.getUtoTmapping(u);return this.getPoint(t,optionalTarget)}getPoints(divisions=5){const points=[];for(let d=0;d<=divisions;d++)points.push(this.getPoint(d/divisions));return points}getSpacedPoints(divisions=5){const points=[];for(let d=0;d<=divisions;d++)points.push(this.getPointAt(d/divisions));return points}getLength(){const lengths=this.getLengths();return lengths[lengths.length-1]}getLengths(divisions=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===divisions+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const cache=[];let current,last=this.getPoint(0),sum=0;cache.push(0);for(let p=1;p<=divisions;p++)current=this.getPoint(p/divisions),sum+=current.distanceTo(last),cache.push(sum),last=current;return this.cacheArcLengths=cache,cache}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(u,distance){const arcLengths=this.getLengths();let i=0;const il=arcLengths.length;let targetArcLength;targetArcLength=distance||u*arcLengths[il-1];let comparison,low=0,high=il-1;for(;low<=high;)if(i=Math.floor(low+(high-low)/2),comparison=arcLengths[i]-targetArcLength,comparison<0)low=i+1;else{if(!(comparison>0)){high=i;break}high=i-1}if(i=high,arcLengths[i]===targetArcLength)return i/(il-1);const lengthBefore=arcLengths[i];return(i+(targetArcLength-lengthBefore)/(arcLengths[i+1]-lengthBefore))/(il-1)}getTangent(t,optionalTarget){let t1=t-1e-4,t2=t+1e-4;t1<0&&(t1=0),t2>1&&(t2=1);const pt1=this.getPoint(t1),pt2=this.getPoint(t2),tangent=optionalTarget||(pt1.isVector2?new Vector2:new Vector3);return tangent.copy(pt2).sub(pt1).normalize(),tangent}getTangentAt(u,optionalTarget){const t=this.getUtoTmapping(u);return this.getTangent(t,optionalTarget)}computeFrenetFrames(segments,closed){const normal=new Vector3,tangents=[],normals=[],binormals=[],vec=new Vector3,mat=new Matrix4;for(let i=0;i<=segments;i++){const u=i/segments;tangents[i]=this.getTangentAt(u,new Vector3)}normals[0]=new Vector3,binormals[0]=new Vector3;let min=Number.MAX_VALUE;const tx=Math.abs(tangents[0].x),ty=Math.abs(tangents[0].y),tz=Math.abs(tangents[0].z);tx<=min&&(min=tx,normal.set(1,0,0)),ty<=min&&(min=ty,normal.set(0,1,0)),tz<=min&&normal.set(0,0,1),vec.crossVectors(tangents[0],normal).normalize(),normals[0].crossVectors(tangents[0],vec),binormals[0].crossVectors(tangents[0],normals[0]);for(let i=1;i<=segments;i++){if(normals[i]=normals[i-1].clone(),binormals[i]=binormals[i-1].clone(),vec.crossVectors(tangents[i-1],tangents[i]),vec.length()>Number.EPSILON){vec.normalize();const theta=Math.acos(clamp(tangents[i-1].dot(tangents[i]),-1,1));normals[i].applyMatrix4(mat.makeRotationAxis(vec,theta))}binormals[i].crossVectors(tangents[i],normals[i])}if(!0===closed){let theta=Math.acos(clamp(normals[0].dot(normals[segments]),-1,1));theta/=segments,tangents[0].dot(vec.crossVectors(normals[0],normals[segments]))>0&&(theta=-theta);for(let i=1;i<=segments;i++)normals[i].applyMatrix4(mat.makeRotationAxis(tangents[i],theta*i)),binormals[i].crossVectors(tangents[i],normals[i])}return{tangents:tangents,normals:normals,binormals:binormals}}clone(){return(new this.constructor).copy(this)}copy(source){return this.arcLengthDivisions=source.arcLengthDivisions,this}toJSON(){const data={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return data.arcLengthDivisions=this.arcLengthDivisions,data.type=this.type,data}fromJSON(json){return this.arcLengthDivisions=json.arcLengthDivisions,this}}class EllipseCurve extends Curve{constructor(aX=0,aY=0,xRadius=1,yRadius=1,aStartAngle=0,aEndAngle=2*Math.PI,aClockwise=!1,aRotation=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=aX,this.aY=aY,this.xRadius=xRadius,this.yRadius=yRadius,this.aStartAngle=aStartAngle,this.aEndAngle=aEndAngle,this.aClockwise=aClockwise,this.aRotation=aRotation}getPoint(t,optionalTarget=new Vector2){const point=optionalTarget,twoPi=2*Math.PI;let deltaAngle=this.aEndAngle-this.aStartAngle;const samePoints=Math.abs(deltaAngle)twoPi;)deltaAngle-=twoPi;deltaAngle0?0:(Math.floor(Math.abs(intPoint)/l)+1)*l:0===weight&&intPoint===l-1&&(intPoint=l-2,weight=1),this.closed||intPoint>0?p0=points[(intPoint-1)%l]:(tmp.subVectors(points[0],points[1]).add(points[0]),p0=tmp);const p1=points[intPoint%l],p2=points[(intPoint+1)%l];if(this.closed||intPoint+2points.length-2?points.length-1:intPoint+1],p3=points[intPoint>points.length-3?points.length-1:intPoint+2];return point.set(CatmullRom(weight,p0.x,p1.x,p2.x,p3.x),CatmullRom(weight,p0.y,p1.y,p2.y,p3.y)),point}copy(source){super.copy(source),this.points=[];for(let i=0,l=source.points.length;i=d){const diff=curveLengths[i]-d,curve=this.curves[i],segmentLength=curve.getLength(),u=0===segmentLength?0:1-diff/segmentLength;return curve.getPointAt(u,optionalTarget)}i++}return null}getLength(){const lens=this.getCurveLengths();return lens[lens.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 lengths=[];let sums=0;for(let i=0,l=this.curves.length;i1&&!points[points.length-1].equals(points[0])&&points.push(points[0]),points}copy(source){super.copy(source),this.curves=[];for(let i=0,l=source.curves.length;i0){const firstPoint=curve.getPoint(0);firstPoint.equals(this.currentPoint)||this.lineTo(firstPoint.x,firstPoint.y)}this.curves.push(curve);const lastPoint=curve.getPoint(1);return this.currentPoint.copy(lastPoint),this}copy(source){return super.copy(source),this.currentPoint.copy(source.currentPoint),this}toJSON(){const data=super.toJSON();return data.currentPoint=this.currentPoint.toArray(),data}fromJSON(json){return super.fromJSON(json),this.currentPoint.fromArray(json.currentPoint),this}}class LatheGeometry extends BufferGeometry{constructor(points=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],segments=12,phiStart=0,phiLength=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:points,segments:segments,phiStart:phiStart,phiLength:phiLength},segments=Math.floor(segments),phiLength=clamp(phiLength,0,2*Math.PI);const indices=[],vertices=[],uvs=[],initNormals=[],normals=[],inverseSegments=1/segments,vertex=new Vector3,uv=new Vector2,normal=new Vector3,curNormal=new Vector3,prevNormal=new Vector3;let dx=0,dy=0;for(let j=0;j<=points.length-1;j++)switch(j){case 0:dx=points[j+1].x-points[j].x,dy=points[j+1].y-points[j].y,normal.x=1*dy,normal.y=-dx,normal.z=0*dy,prevNormal.copy(normal),normal.normalize(),initNormals.push(normal.x,normal.y,normal.z);break;case points.length-1:initNormals.push(prevNormal.x,prevNormal.y,prevNormal.z);break;default:dx=points[j+1].x-points[j].x,dy=points[j+1].y-points[j].y,normal.x=1*dy,normal.y=-dx,normal.z=0*dy,curNormal.copy(normal),normal.x+=prevNormal.x,normal.y+=prevNormal.y,normal.z+=prevNormal.z,normal.normalize(),initNormals.push(normal.x,normal.y,normal.z),prevNormal.copy(curNormal)}for(let i=0;i<=segments;i++){const phi=phiStart+i*inverseSegments*phiLength,sin=Math.sin(phi),cos=Math.cos(phi);for(let j=0;j<=points.length-1;j++){vertex.x=points[j].x*sin,vertex.y=points[j].y,vertex.z=points[j].x*cos,vertices.push(vertex.x,vertex.y,vertex.z),uv.x=i/segments,uv.y=j/(points.length-1),uvs.push(uv.x,uv.y);const x=initNormals[3*j+0]*sin,y=initNormals[3*j+1],z=initNormals[3*j+0]*cos;normals.push(x,y,z)}}for(let i=0;i0&&generateCap(!0),radiusBottom>0&&generateCap(!1)),this.setIndex(indices),this.setAttribute("position",new Float32BufferAttribute(vertices,3)),this.setAttribute("normal",new Float32BufferAttribute(normals,3)),this.setAttribute("uv",new Float32BufferAttribute(uvs,2))}copy(source){return super.copy(source),this.parameters=Object.assign({},source.parameters),this}static fromJSON(data){return new CylinderGeometry(data.radiusTop,data.radiusBottom,data.height,data.radialSegments,data.heightSegments,data.openEnded,data.thetaStart,data.thetaLength)}}class ConeGeometry extends CylinderGeometry{constructor(radius=1,height=1,radialSegments=32,heightSegments=1,openEnded=!1,thetaStart=0,thetaLength=2*Math.PI){super(0,radius,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength),this.type="ConeGeometry",this.parameters={radius:radius,height:height,radialSegments:radialSegments,heightSegments:heightSegments,openEnded:openEnded,thetaStart:thetaStart,thetaLength:thetaLength}}static fromJSON(data){return new ConeGeometry(data.radius,data.height,data.radialSegments,data.heightSegments,data.openEnded,data.thetaStart,data.thetaLength)}}class PolyhedronGeometry extends BufferGeometry{constructor(vertices=[],indices=[],radius=1,detail=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:vertices,indices:indices,radius:radius,detail:detail};const vertexBuffer=[],uvBuffer=[];function subdivideFace(a,b,c,detail){const cols=detail+1,v=[];for(let i=0;i<=cols;i++){v[i]=[];const aj=a.clone().lerp(c,i/cols),bj=b.clone().lerp(c,i/cols),rows=cols-i;for(let j=0;j<=rows;j++)v[i][j]=0===j&&i===cols?aj:aj.clone().lerp(bj,j/rows)}for(let i=0;i.9&&min<.1&&(x0<.2&&(uvBuffer[i+0]+=1),x1<.2&&(uvBuffer[i+2]+=1),x2<.2&&(uvBuffer[i+4]+=1))}}()}(),this.setAttribute("position",new Float32BufferAttribute(vertexBuffer,3)),this.setAttribute("normal",new Float32BufferAttribute(vertexBuffer.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(uvBuffer,2)),0===detail?this.computeVertexNormals():this.normalizeNormals()}copy(source){return super.copy(source),this.parameters=Object.assign({},source.parameters),this}static fromJSON(data){return new PolyhedronGeometry(data.vertices,data.indices,data.radius,data.details)}}class DodecahedronGeometry extends PolyhedronGeometry{constructor(radius=1,detail=0){const t=(1+Math.sqrt(5))/2,r=1/t;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,-r,-t,0,-r,t,0,r,-t,0,r,t,-r,-t,0,-r,t,0,r,-t,0,r,t,0,-t,0,-r,t,0,-r,-t,0,r,t,0,r],[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,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],radius,detail),this.type="DodecahedronGeometry",this.parameters={radius:radius,detail:detail}}static fromJSON(data){return new DodecahedronGeometry(data.radius,data.detail)}}const _v0=new Vector3,_v1$1=new Vector3,_normal=new Vector3,_triangle=new Triangle;class EdgesGeometry extends BufferGeometry{constructor(geometry=null,thresholdAngle=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:geometry,thresholdAngle:thresholdAngle},null!==geometry){const precisionPoints=4,precision=Math.pow(10,precisionPoints),thresholdDot=Math.cos(DEG2RAD*thresholdAngle),indexAttr=geometry.getIndex(),positionAttr=geometry.getAttribute("position"),indexCount=indexAttr?indexAttr.count:positionAttr.count,indexArr=[0,0,0],vertKeys=["a","b","c"],hashes=new Array(3),edgeData={},vertices=[];for(let i=0;i80*dim){minX=maxX=data[0],minY=maxY=data[1];for(let i=dim;imaxX&&(maxX=x),y>maxY&&(maxY=y);invSize=Math.max(maxX-minX,maxY-minY),invSize=0!==invSize?32767/invSize:0}return earcutLinked(outerNode,triangles,dim,minX,minY,invSize,0),triangles};function linkedList(data,start,end,dim,clockwise){let i,last;if(clockwise===function signedArea(data,start,end,dim){let sum=0;for(let i=start,j=end-dim;i0)for(i=start;i=start;i-=dim)last=insertNode(i,data[i],data[i+1],last);return last&&equals(last,last.next)&&(removeNode(last),last=last.next),last}function filterPoints(start,end){if(!start)return start;end||(end=start);let again,p=start;do{if(again=!1,p.steiner||!equals(p,p.next)&&0!==area(p.prev,p,p.next))p=p.next;else{if(removeNode(p),p=end=p.prev,p===p.next)break;again=!0}}while(again||p!==end);return end}function earcutLinked(ear,triangles,dim,minX,minY,invSize,pass){if(!ear)return;!pass&&invSize&&function indexCurve(start,minX,minY,invSize){let p=start;do{0===p.z&&(p.z=zOrder(p.x,p.y,minX,minY,invSize)),p.prevZ=p.prev,p.nextZ=p.next,p=p.next}while(p!==start);p.prevZ.nextZ=null,p.prevZ=null,function sortLinked(list){let i,p,q,e,tail,numMerges,pSize,qSize,inSize=1;do{for(p=list,list=null,tail=null,numMerges=0;p;){for(numMerges++,q=p,pSize=0,i=0;i0||qSize>0&&q;)0!==pSize&&(0===qSize||!q||p.z<=q.z)?(e=p,p=p.nextZ,pSize--):(e=q,q=q.nextZ,qSize--),tail?tail.nextZ=e:list=e,e.prevZ=tail,tail=e;p=q}tail.nextZ=null,inSize*=2}while(numMerges>1);return list}(p)}(ear,minX,minY,invSize);let prev,next,stop=ear;for(;ear.prev!==ear.next;)if(prev=ear.prev,next=ear.next,invSize?isEarHashed(ear,minX,minY,invSize):isEar(ear))triangles.push(prev.i/dim|0),triangles.push(ear.i/dim|0),triangles.push(next.i/dim|0),removeNode(ear),ear=next.next,stop=next.next;else if((ear=next)===stop){pass?1===pass?earcutLinked(ear=cureLocalIntersections(filterPoints(ear),triangles,dim),triangles,dim,minX,minY,invSize,2):2===pass&&splitEarcut(ear,triangles,dim,minX,minY,invSize):earcutLinked(filterPoints(ear),triangles,dim,minX,minY,invSize,1);break}}function isEar(ear){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=axbx?ax>cx?ax:cx:bx>cx?bx:cx,y1=ay>by?ay>cy?ay:cy:by>cy?by:cy;let p=c.next;for(;p!==a;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function isEarHashed(ear,minX,minY,invSize){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=axbx?ax>cx?ax:cx:bx>cx?bx:cx,y1=ay>by?ay>cy?ay:cy:by>cy?by:cy,minZ=zOrder(x0,y0,minX,minY,invSize),maxZ=zOrder(x1,y1,minX,minY,invSize);let p=ear.prevZ,n=ear.nextZ;for(;p&&p.z>=minZ&&n&&n.z<=maxZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}for(;p&&p.z>=minZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;n&&n.z<=maxZ;){if(n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangle(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}return!0}function cureLocalIntersections(start,triangles,dim){let p=start;do{const a=p.prev,b=p.next.next;!equals(a,b)&&intersects(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)&&(triangles.push(a.i/dim|0),triangles.push(p.i/dim|0),triangles.push(b.i/dim|0),removeNode(p),removeNode(p.next),p=start=b),p=p.next}while(p!==start);return filterPoints(p)}function splitEarcut(start,triangles,dim,minX,minY,invSize){let a=start;do{let b=a.next.next;for(;b!==a.prev;){if(a.i!==b.i&&isValidDiagonal(a,b)){let c=splitPolygon(a,b);return a=filterPoints(a,a.next),c=filterPoints(c,c.next),earcutLinked(a,triangles,dim,minX,minY,invSize,0),void earcutLinked(c,triangles,dim,minX,minY,invSize,0)}b=b.next}a=a.next}while(a!==start)}function compareX(a,b){return a.x-b.x}function eliminateHole(hole,outerNode){const bridge=function findHoleBridge(hole,outerNode){let m,p=outerNode,qx=-1/0;const hx=hole.x,hy=hole.y;do{if(hy<=p.y&&hy>=p.next.y&&p.next.y!==p.y){const x=p.x+(hy-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(x<=hx&&x>qx&&(qx=x,m=p.x=p.x&&p.x>=mx&&hx!==p.x&&pointInTriangle(hym.x||p.x===m.x&§orContainsSector(m,p)))&&(m=p,tanMin=tan)),p=p.next}while(p!==stop);return m}(hole,outerNode);if(!bridge)return outerNode;const bridgeReverse=splitPolygon(bridge,hole);return filterPoints(bridgeReverse,bridgeReverse.next),filterPoints(bridge,bridge.next)}function sectorContainsSector(m,p){return area(m.prev,m,p.prev)<0&&area(p.next,m,m.next)<0}function zOrder(x,y,minX,minY,invSize){return(x=1431655765&((x=858993459&((x=252645135&((x=16711935&((x=(x-minX)*invSize|0)|x<<8))|x<<4))|x<<2))|x<<1))|(y=1431655765&((y=858993459&((y=252645135&((y=16711935&((y=(y-minY)*invSize|0)|y<<8))|y<<4))|y<<2))|y<<1))<<1}function getLeftmost(start){let p=start,leftmost=start;do{(p.x=(ax-px)*(cy-py)&&(ax-px)*(by-py)>=(bx-px)*(ay-py)&&(bx-px)*(cy-py)>=(cx-px)*(by-py)}function isValidDiagonal(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function intersectsPolygon(a,b){let p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects(p,p.next,a,b))return!0;p=p.next}while(p!==a);return!1}(a,b)&&(locallyInside(a,b)&&locallyInside(b,a)&&function middleInside(a,b){let p=a,inside=!1;const px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{p.y>py!=p.next.y>py&&p.next.y!==p.y&&px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x&&(inside=!inside),p=p.next}while(p!==a);return inside}(a,b)&&(area(a.prev,a,b.prev)||area(a,b.prev,b))||equals(a,b)&&area(a.prev,a,a.next)>0&&area(b.prev,b,b.next)>0)}function area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y)}function equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y}function intersects(p1,q1,p2,q2){const o1=sign(area(p1,q1,p2)),o2=sign(area(p1,q1,q2)),o3=sign(area(p2,q2,p1)),o4=sign(area(p2,q2,q1));return o1!==o2&&o3!==o4||(!(0!==o1||!onSegment(p1,p2,q1))||(!(0!==o2||!onSegment(p1,q2,q1))||(!(0!==o3||!onSegment(p2,p1,q2))||!(0!==o4||!onSegment(p2,q1,q2)))))}function onSegment(p,q,r){return q.x<=Math.max(p.x,r.x)&&q.x>=Math.min(p.x,r.x)&&q.y<=Math.max(p.y,r.y)&&q.y>=Math.min(p.y,r.y)}function sign(num){return num>0?1:num<0?-1:0}function locallyInside(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0}function splitPolygon(a,b){const a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;return a.next=b,b.prev=a,a2.next=an,an.prev=a2,b2.next=a2,a2.prev=b2,bp.next=b2,b2.prev=bp,b2}function insertNode(i,x,y,last){const p=new Node(i,x,y);return last?(p.next=last.next,p.prev=last,last.next.prev=p,last.next=p):(p.prev=p,p.next=p),p}function removeNode(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function Node(i,x,y){this.i=i,this.x=x,this.y=y,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ShapeUtils{static area(contour){const n=contour.length;let a=0;for(let p=n-1,q=0;q2&&points[l-1].equals(points[0])&&points.pop()}function addContour(vertices,contour){for(let i=0;iNumber.EPSILON){const v_prev_len=Math.sqrt(v_prev_lensq),v_next_len=Math.sqrt(v_next_x*v_next_x+v_next_y*v_next_y),ptPrevShift_x=inPrev.x-v_prev_y/v_prev_len,ptPrevShift_y=inPrev.y+v_prev_x/v_prev_len,sf=((inNext.x-v_next_y/v_next_len-ptPrevShift_x)*v_next_y-(inNext.y+v_next_x/v_next_len-ptPrevShift_y)*v_next_x)/(v_prev_x*v_next_y-v_prev_y*v_next_x);v_trans_x=ptPrevShift_x+v_prev_x*sf-inPt.x,v_trans_y=ptPrevShift_y+v_prev_y*sf-inPt.y;const v_trans_lensq=v_trans_x*v_trans_x+v_trans_y*v_trans_y;if(v_trans_lensq<=2)return new Vector2(v_trans_x,v_trans_y);shrink_by=Math.sqrt(v_trans_lensq/2)}else{let direction_eq=!1;v_prev_x>Number.EPSILON?v_next_x>Number.EPSILON&&(direction_eq=!0):v_prev_x<-Number.EPSILON?v_next_x<-Number.EPSILON&&(direction_eq=!0):Math.sign(v_prev_y)===Math.sign(v_next_y)&&(direction_eq=!0),direction_eq?(v_trans_x=-v_prev_y,v_trans_y=v_prev_x,shrink_by=Math.sqrt(v_prev_lensq)):(v_trans_x=v_prev_x,v_trans_y=v_prev_y,shrink_by=Math.sqrt(v_prev_lensq/2))}return new Vector2(v_trans_x/shrink_by,v_trans_y/shrink_by)}const contourMovements=[];for(let i=0,il=contour.length,j=il-1,k=i+1;i=0;b--){const t=b/bevelSegments,z=bevelThickness*Math.cos(t*Math.PI/2),bs=bevelSize*Math.sin(t*Math.PI/2)+bevelOffset;for(let i=0,il=contour.length;i=0;){const j=i;let k=i-1;k<0&&(k=contour.length-1);for(let s=0,sl=steps+2*bevelSegments;s0)&&indices.push(a,b,d),(iy!==heightSegments-1||thetaEnd0!=value>0&&this.version++,this._anisotropy=value}get clearcoat(){return this._clearcoat}set clearcoat(value){this._clearcoat>0!=value>0&&this.version++,this._clearcoat=value}get iridescence(){return this._iridescence}set iridescence(value){this._iridescence>0!=value>0&&this.version++,this._iridescence=value}get dispersion(){return this._dispersion}set dispersion(value){this._dispersion>0!=value>0&&this.version++,this._dispersion=value}get sheen(){return this._sheen}set sheen(value){this._sheen>0!=value>0&&this.version++,this._sheen=value}get transmission(){return this._transmission}set transmission(value){this._transmission>0!=value>0&&this.version++,this._transmission=value}copy(source){return super.copy(source),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=source.anisotropy,this.anisotropyRotation=source.anisotropyRotation,this.anisotropyMap=source.anisotropyMap,this.clearcoat=source.clearcoat,this.clearcoatMap=source.clearcoatMap,this.clearcoatRoughness=source.clearcoatRoughness,this.clearcoatRoughnessMap=source.clearcoatRoughnessMap,this.clearcoatNormalMap=source.clearcoatNormalMap,this.clearcoatNormalScale.copy(source.clearcoatNormalScale),this.dispersion=source.dispersion,this.ior=source.ior,this.iridescence=source.iridescence,this.iridescenceMap=source.iridescenceMap,this.iridescenceIOR=source.iridescenceIOR,this.iridescenceThicknessRange=[...source.iridescenceThicknessRange],this.iridescenceThicknessMap=source.iridescenceThicknessMap,this.sheen=source.sheen,this.sheenColor.copy(source.sheenColor),this.sheenColorMap=source.sheenColorMap,this.sheenRoughness=source.sheenRoughness,this.sheenRoughnessMap=source.sheenRoughnessMap,this.transmission=source.transmission,this.transmissionMap=source.transmissionMap,this.thickness=source.thickness,this.thicknessMap=source.thicknessMap,this.attenuationDistance=source.attenuationDistance,this.attenuationColor.copy(source.attenuationColor),this.specularIntensity=source.specularIntensity,this.specularIntensityMap=source.specularIntensityMap,this.specularColor.copy(source.specularColor),this.specularColorMap=source.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(parameters){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.specular.copy(source.specular),this.shininess=source.shininess,this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.envMapRotation.copy(source.envMapRotation),this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.flatShading=source.flatShading,this.fog=source.fog,this}}class MeshToonMaterial extends Material{constructor(parameters){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(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(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.map=source.map,this.gradientMap=source.gradientMap,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.alphaMap=source.alphaMap,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.fog=source.fog,this}}class MeshNormalMaterial extends Material{constructor(parameters){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(parameters)}copy(source){return super.copy(source),this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.flatShading=source.flatShading,this}}class MeshLambertMaterial extends Material{constructor(parameters){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.color.copy(source.color),this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.envMapRotation.copy(source.envMapRotation),this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.flatShading=source.flatShading,this.fog=source.fog,this}}class MeshMatcapMaterial extends Material{constructor(parameters){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(parameters)}copy(source){return super.copy(source),this.defines={MATCAP:""},this.color.copy(source.color),this.matcap=source.matcap,this.map=source.map,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.alphaMap=source.alphaMap,this.flatShading=source.flatShading,this.fog=source.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(parameters){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(parameters)}copy(source){return super.copy(source),this.scale=source.scale,this.dashSize=source.dashSize,this.gapSize=source.gapSize,this}}function convertArray(array,type,forceClone){return!array||!forceClone&&array.constructor===type?array:"number"==typeof type.BYTES_PER_ELEMENT?new type(array):Array.prototype.slice.call(array)}function isTypedArray(object){return ArrayBuffer.isView(object)&&!(object instanceof DataView)}function getKeyframeOrder(times){const n=times.length,result=new Array(n);for(let i=0;i!==n;++i)result[i]=i;return result.sort((function compareTime(i,j){return times[i]-times[j]})),result}function sortedArray(values,stride,order){const nValues=values.length,result=new values.constructor(nValues);for(let i=0,dstOffset=0;dstOffset!==nValues;++i){const srcOffset=order[i]*stride;for(let j=0;j!==stride;++j)result[dstOffset++]=values[srcOffset+j]}return result}function flattenJSON(jsonKeys,times,values,valuePropertyName){let i=1,key=jsonKeys[0];for(;void 0!==key&&void 0===key[valuePropertyName];)key=jsonKeys[i++];if(void 0===key)return;let value=key[valuePropertyName];if(void 0!==value)if(Array.isArray(value))do{value=key[valuePropertyName],void 0!==value&&(times.push(key.time),values.push.apply(values,value)),key=jsonKeys[i++]}while(void 0!==key);else if(void 0!==value.toArray)do{value=key[valuePropertyName],void 0!==value&&(times.push(key.time),value.toArray(values,values.length)),key=jsonKeys[i++]}while(void 0!==key);else do{value=key[valuePropertyName],void 0!==value&&(times.push(key.time),values.push(value)),key=jsonKeys[i++]}while(void 0!==key)}const AnimationUtils={convertArray:convertArray,isTypedArray:isTypedArray,getKeyframeOrder:getKeyframeOrder,sortedArray:sortedArray,flattenJSON:flattenJSON,subclip:function subclip(sourceClip,name,startFrame,endFrame,fps=30){const clip=sourceClip.clone();clip.name=name;const tracks=[];for(let i=0;i=endFrame)){times.push(track.times[j]);for(let k=0;kclip.tracks[i].times[0]&&(minStartTime=clip.tracks[i].times[0]);for(let i=0;i=referenceTrack.times[lastIndex]){const startIndex=lastIndex*referenceValueSize+referenceOffset,endIndex=startIndex+referenceValueSize-referenceOffset;referenceValue=referenceTrack.values.slice(startIndex,endIndex)}else{const interpolant=referenceTrack.createInterpolant(),startIndex=referenceOffset,endIndex=referenceValueSize-referenceOffset;interpolant.evaluate(referenceTime),referenceValue=interpolant.resultBuffer.slice(startIndex,endIndex)}if("quaternion"===referenceTrackType){(new Quaternion).fromArray(referenceValue).normalize().conjugate().toArray(referenceValue)}const numTimes=targetTrack.times.length;for(let j=0;j=t0)break validate_interval;{const t1global=pp[1];t=t0)break seek}right=i1,i1=0}}for(;i1>>1;tendTime;)--to;if(++to,0!==from||to!==nKeys){from>=to&&(to=Math.max(to,1),from=to-1);const stride=this.getValueSize();this.times=times.slice(from,to),this.values=this.values.slice(from*stride,to*stride)}return this}validate(){let valid=!0;const valueSize=this.getValueSize();valueSize-Math.floor(valueSize)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),valid=!1);const times=this.times,values=this.values,nKeys=times.length;0===nKeys&&(console.error("THREE.KeyframeTrack: Track is empty.",this),valid=!1);let prevTime=null;for(let i=0;i!==nKeys;i++){const currTime=times[i];if("number"==typeof currTime&&isNaN(currTime)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,i,currTime),valid=!1;break}if(null!==prevTime&&prevTime>currTime){console.error("THREE.KeyframeTrack: Out of order keys.",this,i,currTime,prevTime),valid=!1;break}prevTime=currTime}if(void 0!==values&&isTypedArray(values))for(let i=0,n=values.length;i!==n;++i){const value=values[i];if(isNaN(value)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,i,value),valid=!1;break}}return valid}optimize(){const times=this.times.slice(),values=this.values.slice(),stride=this.getValueSize(),smoothInterpolation=this.getInterpolation()===InterpolateSmooth,lastIndex=times.length-1;let writeIndex=1;for(let i=1;i0){times[writeIndex]=times[lastIndex];for(let readOffset=lastIndex*stride,writeOffset=writeIndex*stride,j=0;j!==stride;++j)values[writeOffset+j]=values[readOffset+j];++writeIndex}return writeIndex!==times.length?(this.times=times.slice(0,writeIndex),this.values=values.slice(0,writeIndex*stride)):(this.times=times,this.values=values),this}clone(){const times=this.times.slice(),values=this.values.slice(),track=new(0,this.constructor)(this.name,times,values);return track.createInterpolant=this.createInterpolant,track}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{constructor(name,times,values){super(name,times,values)}}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(parameterPositions,sampleValues,sampleSize,resultBuffer){super(parameterPositions,sampleValues,sampleSize,resultBuffer)}interpolate_(i1,t0,t,t1){const result=this.resultBuffer,values=this.sampleValues,stride=this.valueSize,alpha=(t-t0)/(t1-t0);let offset=i1*stride;for(let end=offset+stride;offset!==end;offset+=4)Quaternion.slerpFlat(result,0,values,offset-stride,values,offset,alpha);return result}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(result){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),result)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{constructor(name,times,values){super(name,times,values)}}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(name="",duration=-1,tracks=[],blendMode=NormalAnimationBlendMode){this.name=name,this.tracks=tracks,this.duration=duration,this.blendMode=blendMode,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(json){const tracks=[],jsonTracks=json.tracks,frameTime=1/(json.fps||1);for(let i=0,n=jsonTracks.length;i!==n;++i)tracks.push(parseKeyframeTrack(jsonTracks[i]).scale(frameTime));const clip=new this(json.name,json.duration,tracks,json.blendMode);return clip.uuid=json.uuid,clip}static toJSON(clip){const tracks=[],clipTracks=clip.tracks,json={name:clip.name,duration:clip.duration,tracks:tracks,uuid:clip.uuid,blendMode:clip.blendMode};for(let i=0,n=clipTracks.length;i!==n;++i)tracks.push(KeyframeTrack.toJSON(clipTracks[i]));return json}static CreateFromMorphTargetSequence(name,morphTargetSequence,fps,noLoop){const numMorphTargets=morphTargetSequence.length,tracks=[];for(let i=0;i1){const name=parts[1];let animationMorphTargets=animationToMorphTargets[name];animationMorphTargets||(animationToMorphTargets[name]=animationMorphTargets=[]),animationMorphTargets.push(morphTarget)}}const clips=[];for(const name in animationToMorphTargets)clips.push(this.CreateFromMorphTargetSequence(name,animationToMorphTargets[name],fps,noLoop));return clips}static parseAnimation(animation,bones){if(!animation)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const addNonemptyTrack=function(trackType,trackName,animationKeys,propertyName,destTracks){if(0!==animationKeys.length){const times=[],values=[];flattenJSON(animationKeys,times,values,propertyName),0!==times.length&&destTracks.push(new trackType(trackName,times,values))}},tracks=[],clipName=animation.name||"default",fps=animation.fps||30,blendMode=animation.blendMode;let duration=animation.length||-1;const hierarchyTracks=animation.hierarchy||[];for(let h=0;h{onLoad&&onLoad(cached),this.manager.itemEnd(url)}),0),cached;if(void 0!==loading[url])return void loading[url].push({onLoad:onLoad,onProgress:onProgress,onError:onError});loading[url]=[],loading[url].push({onLoad:onLoad,onProgress:onProgress,onError:onError});const req=new Request(url,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),mimeType=this.mimeType,responseType=this.responseType;fetch(req).then((response=>{if(200===response.status||0===response.status){if(0===response.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===response.body||void 0===response.body.getReader)return response;const callbacks=loading[url],reader=response.body.getReader(),contentLength=response.headers.get("X-File-Size")||response.headers.get("Content-Length"),total=contentLength?parseInt(contentLength):0,lengthComputable=0!==total;let loaded=0;const stream=new ReadableStream({start(controller){!function readData(){reader.read().then((({done:done,value:value})=>{if(done)controller.close();else{loaded+=value.byteLength;const event=new ProgressEvent("progress",{lengthComputable:lengthComputable,loaded:loaded,total:total});for(let i=0,il=callbacks.length;i{controller.error(e)}))}()}});return new Response(stream)}throw new HttpError(`fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`,response)})).then((response=>{switch(responseType){case"arraybuffer":return response.arrayBuffer();case"blob":return response.blob();case"document":return response.text().then((text=>(new DOMParser).parseFromString(text,mimeType)));case"json":return response.json();default:if(void 0===mimeType)return response.text();{const exec=/charset="?([^;"\s]*)"?/i.exec(mimeType),label=exec&&exec[1]?exec[1].toLowerCase():void 0,decoder=new TextDecoder(label);return response.arrayBuffer().then((ab=>decoder.decode(ab)))}}})).then((data=>{Cache.add(url,data);const callbacks=loading[url];delete loading[url];for(let i=0,il=callbacks.length;i{const callbacks=loading[url];if(void 0===callbacks)throw this.manager.itemError(url),err;delete loading[url];for(let i=0,il=callbacks.length;i{this.manager.itemEnd(url)})),this.manager.itemStart(url)}setResponseType(value){return this.responseType=value,this}setMimeType(value){return this.mimeType=value,this}}class AnimationLoader extends Loader{constructor(manager){super(manager)}load(url,onLoad,onProgress,onError){const scope=this,loader=new FileLoader(this.manager);loader.setPath(this.path),loader.setRequestHeader(this.requestHeader),loader.setWithCredentials(this.withCredentials),loader.load(url,(function(text){try{onLoad(scope.parse(JSON.parse(text)))}catch(e){onError?onError(e):console.error(e),scope.manager.itemError(url)}}),onProgress,onError)}parse(json){const animations=[];for(let i=0;i0:material.vertexColors=json.vertexColors),void 0!==json.uniforms)for(const name in json.uniforms){const uniform=json.uniforms[name];switch(material.uniforms[name]={},uniform.type){case"t":material.uniforms[name].value=getTexture(uniform.value);break;case"c":material.uniforms[name].value=(new Color).setHex(uniform.value);break;case"v2":material.uniforms[name].value=(new Vector2).fromArray(uniform.value);break;case"v3":material.uniforms[name].value=(new Vector3).fromArray(uniform.value);break;case"v4":material.uniforms[name].value=(new Vector4).fromArray(uniform.value);break;case"m3":material.uniforms[name].value=(new Matrix3).fromArray(uniform.value);break;case"m4":material.uniforms[name].value=(new Matrix4).fromArray(uniform.value);break;default:material.uniforms[name].value=uniform.value}}if(void 0!==json.defines&&(material.defines=json.defines),void 0!==json.vertexShader&&(material.vertexShader=json.vertexShader),void 0!==json.fragmentShader&&(material.fragmentShader=json.fragmentShader),void 0!==json.glslVersion&&(material.glslVersion=json.glslVersion),void 0!==json.extensions)for(const key in json.extensions)material.extensions[key]=json.extensions[key];if(void 0!==json.lights&&(material.lights=json.lights),void 0!==json.clipping&&(material.clipping=json.clipping),void 0!==json.size&&(material.size=json.size),void 0!==json.sizeAttenuation&&(material.sizeAttenuation=json.sizeAttenuation),void 0!==json.map&&(material.map=getTexture(json.map)),void 0!==json.matcap&&(material.matcap=getTexture(json.matcap)),void 0!==json.alphaMap&&(material.alphaMap=getTexture(json.alphaMap)),void 0!==json.bumpMap&&(material.bumpMap=getTexture(json.bumpMap)),void 0!==json.bumpScale&&(material.bumpScale=json.bumpScale),void 0!==json.normalMap&&(material.normalMap=getTexture(json.normalMap)),void 0!==json.normalMapType&&(material.normalMapType=json.normalMapType),void 0!==json.normalScale){let normalScale=json.normalScale;!1===Array.isArray(normalScale)&&(normalScale=[normalScale,normalScale]),material.normalScale=(new Vector2).fromArray(normalScale)}return void 0!==json.displacementMap&&(material.displacementMap=getTexture(json.displacementMap)),void 0!==json.displacementScale&&(material.displacementScale=json.displacementScale),void 0!==json.displacementBias&&(material.displacementBias=json.displacementBias),void 0!==json.roughnessMap&&(material.roughnessMap=getTexture(json.roughnessMap)),void 0!==json.metalnessMap&&(material.metalnessMap=getTexture(json.metalnessMap)),void 0!==json.emissiveMap&&(material.emissiveMap=getTexture(json.emissiveMap)),void 0!==json.emissiveIntensity&&(material.emissiveIntensity=json.emissiveIntensity),void 0!==json.specularMap&&(material.specularMap=getTexture(json.specularMap)),void 0!==json.specularIntensityMap&&(material.specularIntensityMap=getTexture(json.specularIntensityMap)),void 0!==json.specularColorMap&&(material.specularColorMap=getTexture(json.specularColorMap)),void 0!==json.envMap&&(material.envMap=getTexture(json.envMap)),void 0!==json.envMapRotation&&material.envMapRotation.fromArray(json.envMapRotation),void 0!==json.envMapIntensity&&(material.envMapIntensity=json.envMapIntensity),void 0!==json.reflectivity&&(material.reflectivity=json.reflectivity),void 0!==json.refractionRatio&&(material.refractionRatio=json.refractionRatio),void 0!==json.lightMap&&(material.lightMap=getTexture(json.lightMap)),void 0!==json.lightMapIntensity&&(material.lightMapIntensity=json.lightMapIntensity),void 0!==json.aoMap&&(material.aoMap=getTexture(json.aoMap)),void 0!==json.aoMapIntensity&&(material.aoMapIntensity=json.aoMapIntensity),void 0!==json.gradientMap&&(material.gradientMap=getTexture(json.gradientMap)),void 0!==json.clearcoatMap&&(material.clearcoatMap=getTexture(json.clearcoatMap)),void 0!==json.clearcoatRoughnessMap&&(material.clearcoatRoughnessMap=getTexture(json.clearcoatRoughnessMap)),void 0!==json.clearcoatNormalMap&&(material.clearcoatNormalMap=getTexture(json.clearcoatNormalMap)),void 0!==json.clearcoatNormalScale&&(material.clearcoatNormalScale=(new Vector2).fromArray(json.clearcoatNormalScale)),void 0!==json.iridescenceMap&&(material.iridescenceMap=getTexture(json.iridescenceMap)),void 0!==json.iridescenceThicknessMap&&(material.iridescenceThicknessMap=getTexture(json.iridescenceThicknessMap)),void 0!==json.transmissionMap&&(material.transmissionMap=getTexture(json.transmissionMap)),void 0!==json.thicknessMap&&(material.thicknessMap=getTexture(json.thicknessMap)),void 0!==json.anisotropyMap&&(material.anisotropyMap=getTexture(json.anisotropyMap)),void 0!==json.sheenColorMap&&(material.sheenColorMap=getTexture(json.sheenColorMap)),void 0!==json.sheenRoughnessMap&&(material.sheenRoughnessMap=getTexture(json.sheenRoughnessMap)),material}setTextures(value){return this.textures=value,this}static createMaterialFromType(type){return new{ShadowMaterial:ShadowMaterial,SpriteMaterial:SpriteMaterial,RawShaderMaterial:RawShaderMaterial,ShaderMaterial:ShaderMaterial,PointsMaterial:PointsMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshToonMaterial:MeshToonMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshBasicMaterial:MeshBasicMaterial,MeshMatcapMaterial:MeshMatcapMaterial,LineDashedMaterial:LineDashedMaterial,LineBasicMaterial:LineBasicMaterial,Material:Material}[type]}}class LoaderUtils{static decodeText(array){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(array);let s="";for(let i=0,il=array.length;i0){const manager=new LoadingManager(onLoad);loader=new ImageLoader(manager),loader.setCrossOrigin(this.crossOrigin);for(let i=0,il=json.length;i0){loader=new ImageLoader(this.manager),loader.setCrossOrigin(this.crossOrigin);for(let i=0,il=json.length;i{const box=new Box3;box.min.fromArray(bound.boxMin),box.max.fromArray(bound.boxMax);const sphere=new Sphere;return sphere.radius=bound.sphereRadius,sphere.center.fromArray(bound.sphereCenter),{boxInitialized:bound.boxInitialized,box:box,sphereInitialized:bound.sphereInitialized,sphere:sphere}})),object._maxInstanceCount=data.maxInstanceCount,object._maxVertexCount=data.maxVertexCount,object._maxIndexCount=data.maxIndexCount,object._geometryInitialized=data.geometryInitialized,object._geometryCount=data.geometryCount,object._matricesTexture=getTexture(data.matricesTexture.uuid),void 0!==data.colorsTexture&&(object._colorsTexture=getTexture(data.colorsTexture.uuid));break;case"LOD":object=new LOD;break;case"Line":object=new Line(getGeometry(data.geometry),getMaterial(data.material));break;case"LineLoop":object=new LineLoop(getGeometry(data.geometry),getMaterial(data.material));break;case"LineSegments":object=new LineSegments(getGeometry(data.geometry),getMaterial(data.material));break;case"PointCloud":case"Points":object=new Points(getGeometry(data.geometry),getMaterial(data.material));break;case"Sprite":object=new Sprite(getMaterial(data.material));break;case"Group":object=new Group;break;case"Bone":object=new Bone;break;default:object=new Object3D}if(object.uuid=data.uuid,void 0!==data.name&&(object.name=data.name),void 0!==data.matrix?(object.matrix.fromArray(data.matrix),void 0!==data.matrixAutoUpdate&&(object.matrixAutoUpdate=data.matrixAutoUpdate),object.matrixAutoUpdate&&object.matrix.decompose(object.position,object.quaternion,object.scale)):(void 0!==data.position&&object.position.fromArray(data.position),void 0!==data.rotation&&object.rotation.fromArray(data.rotation),void 0!==data.quaternion&&object.quaternion.fromArray(data.quaternion),void 0!==data.scale&&object.scale.fromArray(data.scale)),void 0!==data.up&&object.up.fromArray(data.up),void 0!==data.castShadow&&(object.castShadow=data.castShadow),void 0!==data.receiveShadow&&(object.receiveShadow=data.receiveShadow),data.shadow&&(void 0!==data.shadow.intensity&&(object.shadow.intensity=data.shadow.intensity),void 0!==data.shadow.bias&&(object.shadow.bias=data.shadow.bias),void 0!==data.shadow.normalBias&&(object.shadow.normalBias=data.shadow.normalBias),void 0!==data.shadow.radius&&(object.shadow.radius=data.shadow.radius),void 0!==data.shadow.mapSize&&object.shadow.mapSize.fromArray(data.shadow.mapSize),void 0!==data.shadow.camera&&(object.shadow.camera=this.parseObject(data.shadow.camera))),void 0!==data.visible&&(object.visible=data.visible),void 0!==data.frustumCulled&&(object.frustumCulled=data.frustumCulled),void 0!==data.renderOrder&&(object.renderOrder=data.renderOrder),void 0!==data.userData&&(object.userData=data.userData),void 0!==data.layers&&(object.layers.mask=data.layers),void 0!==data.children){const children=data.children;for(let i=0;i{onLoad&&onLoad(imageBitmap),scope.manager.itemEnd(url)})).catch((e=>{onError&&onError(e)})):(setTimeout((function(){onLoad&&onLoad(cached),scope.manager.itemEnd(url)}),0),cached);const fetchOptions={};fetchOptions.credentials="anonymous"===this.crossOrigin?"same-origin":"include",fetchOptions.headers=this.requestHeader;const promise=fetch(url,fetchOptions).then((function(res){return res.blob()})).then((function(blob){return createImageBitmap(blob,Object.assign(scope.options,{colorSpaceConversion:"none"}))})).then((function(imageBitmap){return Cache.add(url,imageBitmap),onLoad&&onLoad(imageBitmap),scope.manager.itemEnd(url),imageBitmap})).catch((function(e){onError&&onError(e),Cache.remove(url),scope.manager.itemError(url),scope.manager.itemEnd(url)}));Cache.add(url,promise),scope.manager.itemStart(url)}}let _context;class AudioContext{static getContext(){return void 0===_context&&(_context=new(window.AudioContext||window.webkitAudioContext)),_context}static setContext(value){_context=value}}class AudioLoader extends Loader{constructor(manager){super(manager)}load(url,onLoad,onProgress,onError){const scope=this,loader=new FileLoader(this.manager);function handleError(e){onError?onError(e):console.error(e),scope.manager.itemError(url)}loader.setResponseType("arraybuffer"),loader.setPath(this.path),loader.setRequestHeader(this.requestHeader),loader.setWithCredentials(this.withCredentials),loader.load(url,(function(buffer){try{const bufferCopy=buffer.slice(0);AudioContext.getContext().decodeAudioData(bufferCopy,(function(audioBuffer){onLoad(audioBuffer)})).catch(handleError)}catch(e){handleError(e)}}),onProgress,onError)}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,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(camera){const cache=this._cache;if(cache.focus!==camera.focus||cache.fov!==camera.fov||cache.aspect!==camera.aspect*this.aspect||cache.near!==camera.near||cache.far!==camera.far||cache.zoom!==camera.zoom||cache.eyeSep!==this.eyeSep){cache.focus=camera.focus,cache.fov=camera.fov,cache.aspect=camera.aspect*this.aspect,cache.near=camera.near,cache.far=camera.far,cache.zoom=camera.zoom,cache.eyeSep=this.eyeSep,_projectionMatrix.copy(camera.projectionMatrix);const eyeSepHalf=cache.eyeSep/2,eyeSepOnProjection=eyeSepHalf*cache.near/cache.focus,ymax=cache.near*Math.tan(DEG2RAD*cache.fov*.5)/cache.zoom;let xmin,xmax;_eyeLeft.elements[12]=-eyeSepHalf,_eyeRight.elements[12]=eyeSepHalf,xmin=-ymax*cache.aspect+eyeSepOnProjection,xmax=ymax*cache.aspect+eyeSepOnProjection,_projectionMatrix.elements[0]=2*cache.near/(xmax-xmin),_projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin),this.cameraL.projectionMatrix.copy(_projectionMatrix),xmin=-ymax*cache.aspect-eyeSepOnProjection,xmax=ymax*cache.aspect-eyeSepOnProjection,_projectionMatrix.elements[0]=2*cache.near/(xmax-xmin),_projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(_eyeRight)}}class Clock{constructor(autoStart=!0){this.autoStart=autoStart,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=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 diff=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const newTime=now();diff=(newTime-this.oldTime)/1e3,this.oldTime=newTime,this.elapsedTime+=diff}return diff}}function now(){return("undefined"==typeof performance?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock}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(value){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=value,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(value){return this.gain.gain.setTargetAtTime(value,this.context.currentTime,.01),this}updateMatrixWorld(force){super.updateMatrixWorld(force);const listener=this.context.listener,up=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),listener.positionX){const endTime=this.context.currentTime+this.timeDelta;listener.positionX.linearRampToValueAtTime(_position$1.x,endTime),listener.positionY.linearRampToValueAtTime(_position$1.y,endTime),listener.positionZ.linearRampToValueAtTime(_position$1.z,endTime),listener.forwardX.linearRampToValueAtTime(_orientation$1.x,endTime),listener.forwardY.linearRampToValueAtTime(_orientation$1.y,endTime),listener.forwardZ.linearRampToValueAtTime(_orientation$1.z,endTime),listener.upX.linearRampToValueAtTime(up.x,endTime),listener.upY.linearRampToValueAtTime(up.y,endTime),listener.upZ.linearRampToValueAtTime(up.z,endTime)}else listener.setPosition(_position$1.x,_position$1.y,_position$1.z),listener.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,up.x,up.y,up.z)}}class Audio extends Object3D{constructor(listener){super(),this.type="Audio",this.listener=listener,this.context=listener.context,this.gain=this.context.createGain(),this.gain.connect(listener.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(audioNode){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=audioNode,this.connect(),this}setMediaElementSource(mediaElement){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(mediaElement),this.connect(),this}setMediaStreamSource(mediaStream){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(mediaStream),this.connect(),this}setBuffer(audioBuffer){return this.buffer=audioBuffer,this.sourceType="buffer",this.autoplay&&this.play(),this}play(delay=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+delay;const source=this.context.createBufferSource();return source.buffer=this.buffer,source.loop=this.loop,source.loopStart=this.loopStart,source.loopEnd=this.loopEnd,source.onended=this.onEnded.bind(this),source.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=source,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;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let i=1,l=this.filters.length;i0){this.source.disconnect(this.filters[0]);for(let i=1,l=this.filters.length;i0&&this._mixBufferRegionAdditive(buffer,offset,this._addIndex*stride,1,stride);for(let i=stride,e=stride+stride;i!==e;++i)if(buffer[i]!==buffer[i+stride]){binding.setValue(buffer,offset);break}}saveOriginalState(){const binding=this.binding,buffer=this.buffer,stride=this.valueSize,originalValueOffset=stride*this._origIndex;binding.getValue(buffer,originalValueOffset);for(let i=stride,e=originalValueOffset;i!==e;++i)buffer[i]=buffer[originalValueOffset+i%stride];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const originalValueOffset=3*this.valueSize;this.binding.setValue(this.buffer,originalValueOffset)}_setAdditiveIdentityNumeric(){const startIndex=this._addIndex*this.valueSize,endIndex=startIndex+this.valueSize;for(let i=startIndex;i=.5)for(let i=0;i!==stride;++i)buffer[dstOffset+i]=buffer[srcOffset+i]}_slerp(buffer,dstOffset,srcOffset,t){Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,srcOffset,t)}_slerpAdditive(buffer,dstOffset,srcOffset,t,stride){const workOffset=this._workIndex*stride;Quaternion.multiplyQuaternionsFlat(buffer,workOffset,buffer,dstOffset,buffer,srcOffset),Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,workOffset,t)}_lerp(buffer,dstOffset,srcOffset,t,stride){const s=1-t;for(let i=0;i!==stride;++i){const j=dstOffset+i;buffer[j]=buffer[j]*s+buffer[srcOffset+i]*t}}_lerpAdditive(buffer,dstOffset,srcOffset,t,stride){for(let i=0;i!==stride;++i){const j=dstOffset+i;buffer[j]=buffer[j]+buffer[srcOffset+i]*t}}}const _reservedRe=new RegExp("[\\[\\]\\.:\\/]","g"),_wordCharOrDot="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",_trackRe=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]")+/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]")+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]")+"$"),_supportedObjectNames=["material","materials","bones","map"];class PropertyBinding{constructor(rootNode,path,parsedPath){this.path=path,this.parsedPath=parsedPath||PropertyBinding.parseTrackName(path),this.node=PropertyBinding.findNode(rootNode,this.parsedPath.nodeName),this.rootNode=rootNode,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(root,path,parsedPath){return root&&root.isAnimationObjectGroup?new PropertyBinding.Composite(root,path,parsedPath):new PropertyBinding(root,path,parsedPath)}static sanitizeNodeName(name){return name.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(trackName){const matches=_trackRe.exec(trackName);if(null===matches)throw new Error("PropertyBinding: Cannot parse trackName: "+trackName);const results={nodeName:matches[2],objectName:matches[3],objectIndex:matches[4],propertyName:matches[5],propertyIndex:matches[6]},lastDot=results.nodeName&&results.nodeName.lastIndexOf(".");if(void 0!==lastDot&&-1!==lastDot){const objectName=results.nodeName.substring(lastDot+1);-1!==_supportedObjectNames.indexOf(objectName)&&(results.nodeName=results.nodeName.substring(0,lastDot),results.objectName=objectName)}if(null===results.propertyName||0===results.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+trackName);return results}static findNode(root,nodeName){if(void 0===nodeName||""===nodeName||"."===nodeName||-1===nodeName||nodeName===root.name||nodeName===root.uuid)return root;if(root.skeleton){const bone=root.skeleton.getBoneByName(nodeName);if(void 0!==bone)return bone}if(root.children){const searchNodeSubtree=function(children){for(let i=0;i=nCachedObjects){const lastCachedIndex=nCachedObjects++,firstActiveObject=objects[lastCachedIndex];indicesByUUID[firstActiveObject.uuid]=index,objects[index]=firstActiveObject,indicesByUUID[uuid]=lastCachedIndex,objects[lastCachedIndex]=object;for(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j],firstActive=bindingsForPath[lastCachedIndex],binding=bindingsForPath[index];bindingsForPath[index]=firstActive,bindingsForPath[lastCachedIndex]=binding}}}this.nCachedObjects_=nCachedObjects}uncache(){const objects=this._objects,indicesByUUID=this._indicesByUUID,bindings=this._bindings,nBindings=bindings.length;let nCachedObjects=this.nCachedObjects_,nObjects=objects.length;for(let i=0,n=arguments.length;i!==n;++i){const uuid=arguments[i].uuid,index=indicesByUUID[uuid];if(void 0!==index)if(delete indicesByUUID[uuid],index0&&(indicesByUUID[lastObject.uuid]=index),objects[index]=lastObject,objects.pop();for(let j=0,m=nBindings;j!==m;++j){const bindingsForPath=bindings[j];bindingsForPath[index]=bindingsForPath[lastIndex],bindingsForPath.pop()}}}this.nCachedObjects_=nCachedObjects}subscribe_(path,parsedPath){const indicesByPath=this._bindingsIndicesByPath;let index=indicesByPath[path];const bindings=this._bindings;if(void 0!==index)return bindings[index];const paths=this._paths,parsedPaths=this._parsedPaths,objects=this._objects,nObjects=objects.length,nCachedObjects=this.nCachedObjects_,bindingsForPath=new Array(nObjects);index=bindings.length,indicesByPath[path]=index,paths.push(path),parsedPaths.push(parsedPath),bindings.push(bindingsForPath);for(let i=nCachedObjects,n=objects.length;i!==n;++i){const object=objects[i];bindingsForPath[i]=new PropertyBinding(object,path,parsedPath)}return bindingsForPath}unsubscribe_(path){const indicesByPath=this._bindingsIndicesByPath,index=indicesByPath[path];if(void 0!==index){const paths=this._paths,parsedPaths=this._parsedPaths,bindings=this._bindings,lastBindingsIndex=bindings.length-1,lastBindings=bindings[lastBindingsIndex];indicesByPath[path[lastBindingsIndex]]=index,bindings[index]=lastBindings,bindings.pop(),parsedPaths[index]=parsedPaths[lastBindingsIndex],parsedPaths.pop(),paths[index]=paths[lastBindingsIndex],paths.pop()}}}class AnimationAction{constructor(mixer,clip,localRoot=null,blendMode=clip.blendMode){this._mixer=mixer,this._clip=clip,this._localRoot=localRoot,this.blendMode=blendMode;const tracks=clip.tracks,nTracks=tracks.length,interpolants=new Array(nTracks),interpolantSettings={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let i=0;i!==nTracks;++i){const interpolant=tracks[i].createInterpolant(null);interpolants[i]=interpolant,interpolant.settings=interpolantSettings}this._interpolantSettings=interpolantSettings,this._interpolants=interpolants,this._propertyBindings=new Array(nTracks),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,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(time){return this._startTime=time,this}setLoop(mode,repetitions){return this.loop=mode,this.repetitions=repetitions,this}setEffectiveWeight(weight){return this.weight=weight,this._effectiveWeight=this.enabled?weight:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(duration){return this._scheduleFading(duration,0,1)}fadeOut(duration){return this._scheduleFading(duration,1,0)}crossFadeFrom(fadeOutAction,duration,warp){if(fadeOutAction.fadeOut(duration),this.fadeIn(duration),warp){const fadeInDuration=this._clip.duration,fadeOutDuration=fadeOutAction._clip.duration,startEndRatio=fadeOutDuration/fadeInDuration,endStartRatio=fadeInDuration/fadeOutDuration;fadeOutAction.warp(1,startEndRatio,duration),this.warp(endStartRatio,1,duration)}return this}crossFadeTo(fadeInAction,duration,warp){return fadeInAction.crossFadeFrom(this,duration,warp)}stopFading(){const weightInterpolant=this._weightInterpolant;return null!==weightInterpolant&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(weightInterpolant)),this}setEffectiveTimeScale(timeScale){return this.timeScale=timeScale,this._effectiveTimeScale=this.paused?0:timeScale,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(duration){return this.timeScale=this._clip.duration/duration,this.stopWarping()}syncWith(action){return this.time=action.time,this.timeScale=action.timeScale,this.stopWarping()}halt(duration){return this.warp(this._effectiveTimeScale,0,duration)}warp(startTimeScale,endTimeScale,duration){const mixer=this._mixer,now=mixer.time,timeScale=this.timeScale;let interpolant=this._timeScaleInterpolant;null===interpolant&&(interpolant=mixer._lendControlInterpolant(),this._timeScaleInterpolant=interpolant);const times=interpolant.parameterPositions,values=interpolant.sampleValues;return times[0]=now,times[1]=now+duration,values[0]=startTimeScale/timeScale,values[1]=endTimeScale/timeScale,this}stopWarping(){const timeScaleInterpolant=this._timeScaleInterpolant;return null!==timeScaleInterpolant&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(timeScaleInterpolant)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(time,deltaTime,timeDirection,accuIndex){if(!this.enabled)return void this._updateWeight(time);const startTime=this._startTime;if(null!==startTime){const timeRunning=(time-startTime)*timeDirection;timeRunning<0||0===timeDirection?deltaTime=0:(this._startTime=null,deltaTime=timeDirection*timeRunning)}deltaTime*=this._updateTimeScale(time);const clipTime=this._updateTime(deltaTime),weight=this._updateWeight(time);if(weight>0){const interpolants=this._interpolants,propertyMixers=this._propertyBindings;if(this.blendMode===AdditiveAnimationBlendMode)for(let j=0,m=interpolants.length;j!==m;++j)interpolants[j].evaluate(clipTime),propertyMixers[j].accumulateAdditive(weight);else for(let j=0,m=interpolants.length;j!==m;++j)interpolants[j].evaluate(clipTime),propertyMixers[j].accumulate(accuIndex,weight)}}_updateWeight(time){let weight=0;if(this.enabled){weight=this.weight;const interpolant=this._weightInterpolant;if(null!==interpolant){const interpolantValue=interpolant.evaluate(time)[0];weight*=interpolantValue,time>interpolant.parameterPositions[1]&&(this.stopFading(),0===interpolantValue&&(this.enabled=!1))}}return this._effectiveWeight=weight,weight}_updateTimeScale(time){let timeScale=0;if(!this.paused){timeScale=this.timeScale;const interpolant=this._timeScaleInterpolant;if(null!==interpolant){timeScale*=interpolant.evaluate(time)[0],time>interpolant.parameterPositions[1]&&(this.stopWarping(),0===timeScale?this.paused=!0:this.timeScale=timeScale)}}return this._effectiveTimeScale=timeScale,timeScale}_updateTime(deltaTime){const duration=this._clip.duration,loop=this.loop;let time=this.time+deltaTime,loopCount=this._loopCount;const pingPong=loop===LoopPingPong;if(0===deltaTime)return-1===loopCount?time:pingPong&&1==(1&loopCount)?duration-time:time;if(loop===LoopOnce){-1===loopCount&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(time>=duration)time=duration;else{if(!(time<0)){this.time=time;break handle_stop}time=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=time,this._mixer.dispatchEvent({type:"finished",action:this,direction:deltaTime<0?-1:1})}}else{if(-1===loopCount&&(deltaTime>=0?(loopCount=0,this._setEndings(!0,0===this.repetitions,pingPong)):this._setEndings(0===this.repetitions,!0,pingPong)),time>=duration||time<0){const loopDelta=Math.floor(time/duration);time-=duration*loopDelta,loopCount+=Math.abs(loopDelta);const pending=this.repetitions-loopCount;if(pending<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,time=deltaTime>0?duration:0,this.time=time,this._mixer.dispatchEvent({type:"finished",action:this,direction:deltaTime>0?1:-1});else{if(1===pending){const atStart=deltaTime<0;this._setEndings(atStart,!atStart,pingPong)}else this._setEndings(!1,!1,pingPong);this._loopCount=loopCount,this.time=time,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:loopDelta})}}else this.time=time;if(pingPong&&1==(1&loopCount))return duration-time}return time}_setEndings(atStart,atEnd,pingPong){const settings=this._interpolantSettings;pingPong?(settings.endingStart=ZeroSlopeEnding,settings.endingEnd=ZeroSlopeEnding):(settings.endingStart=atStart?this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding,settings.endingEnd=atEnd?this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding)}_scheduleFading(duration,weightNow,weightThen){const mixer=this._mixer,now=mixer.time;let interpolant=this._weightInterpolant;null===interpolant&&(interpolant=mixer._lendControlInterpolant(),this._weightInterpolant=interpolant);const times=interpolant.parameterPositions,values=interpolant.sampleValues;return times[0]=now,values[0]=weightNow,times[1]=now+duration,values[1]=weightThen,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher{constructor(root){super(),this._root=root,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(action,prototypeAction){const root=action._localRoot||this._root,tracks=action._clip.tracks,nTracks=tracks.length,bindings=action._propertyBindings,interpolants=action._interpolants,rootUuid=root.uuid,bindingsByRoot=this._bindingsByRootAndName;let bindingsByName=bindingsByRoot[rootUuid];void 0===bindingsByName&&(bindingsByName={},bindingsByRoot[rootUuid]=bindingsByName);for(let i=0;i!==nTracks;++i){const track=tracks[i],trackName=track.name;let binding=bindingsByName[trackName];if(void 0!==binding)++binding.referenceCount,bindings[i]=binding;else{if(binding=bindings[i],void 0!==binding){null===binding._cacheIndex&&(++binding.referenceCount,this._addInactiveBinding(binding,rootUuid,trackName));continue}const path=prototypeAction&&prototypeAction._propertyBindings[i].binding.parsedPath;binding=new PropertyMixer(PropertyBinding.create(root,trackName,path),track.ValueTypeName,track.getValueSize()),++binding.referenceCount,this._addInactiveBinding(binding,rootUuid,trackName),bindings[i]=binding}interpolants[i].resultBuffer=binding.buffer}}_activateAction(action){if(!this._isActiveAction(action)){if(null===action._cacheIndex){const rootUuid=(action._localRoot||this._root).uuid,clipUuid=action._clip.uuid,actionsForClip=this._actionsByClip[clipUuid];this._bindAction(action,actionsForClip&&actionsForClip.knownActions[0]),this._addInactiveAction(action,clipUuid,rootUuid)}const bindings=action._propertyBindings;for(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];0==binding.useCount++&&(this._lendBinding(binding),binding.saveOriginalState())}this._lendAction(action)}}_deactivateAction(action){if(this._isActiveAction(action)){const bindings=action._propertyBindings;for(let i=0,n=bindings.length;i!==n;++i){const binding=bindings[i];0==--binding.useCount&&(binding.restoreOriginalState(),this._takeBackBinding(binding))}this._takeBackAction(action)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const scope=this;this.stats={actions:{get total(){return scope._actions.length},get inUse(){return scope._nActiveActions}},bindings:{get total(){return scope._bindings.length},get inUse(){return scope._nActiveBindings}},controlInterpolants:{get total(){return scope._controlInterpolants.length},get inUse(){return scope._nActiveControlInterpolants}}}}_isActiveAction(action){const index=action._cacheIndex;return null!==index&&index=0;--i)actions[i].stop();return this}update(deltaTime){deltaTime*=this.timeScale;const actions=this._actions,nActions=this._nActiveActions,time=this.time+=deltaTime,timeDirection=Math.sign(deltaTime),accuIndex=this._accuIndex^=1;for(let i=0;i!==nActions;++i){actions[i]._update(time,deltaTime,timeDirection,accuIndex)}const bindings=this._bindings,nBindings=this._nActiveBindings;for(let i=0;i!==nBindings;++i)bindings[i].apply(accuIndex);return this}setTime(timeInSeconds){this.time=0;for(let i=0;ithis.max.x||point.ythis.max.y)}containsBox(box){return this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y}getParameter(point,target){return target.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(box){return!(box.max.xthis.max.x||box.max.ythis.max.y)}clampPoint(point,target){return target.copy(point).clamp(this.min,this.max)}distanceToPoint(point){return this.clampPoint(point,_vector$4).distanceTo(point)}intersect(box){return this.min.max(box.min),this.max.min(box.max),this.isEmpty()&&this.makeEmpty(),this}union(box){return this.min.min(box.min),this.max.max(box.max),this}translate(offset){return this.min.add(offset),this.max.add(offset),this}equals(box){return box.min.equals(this.min)&&box.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(start=new Vector3,end=new Vector3){this.start=start,this.end=end}set(start,end){return this.start.copy(start),this.end.copy(end),this}copy(line){return this.start.copy(line.start),this.end.copy(line.end),this}getCenter(target){return target.addVectors(this.start,this.end).multiplyScalar(.5)}delta(target){return target.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,target){return this.delta(target).multiplyScalar(t).add(this.start)}closestPointToPointParameter(point,clampToLine){_startP.subVectors(point,this.start),_startEnd.subVectors(this.end,this.start);const startEnd2=_startEnd.dot(_startEnd);let t=_startEnd.dot(_startP)/startEnd2;return clampToLine&&(t=clamp(t,0,1)),t}closestPointToPoint(point,clampToLine,target){const t=this.closestPointToPointParameter(point,clampToLine);return this.delta(target).multiplyScalar(t).add(this.start)}applyMatrix4(matrix){return this.start.applyMatrix4(matrix),this.end.applyMatrix4(matrix),this}equals(line){return line.start.equals(this.start)&&line.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(light,color){super(),this.light=light,this.matrixAutoUpdate=!1,this.color=color,this.type="SpotLightHelper";const geometry=new BufferGeometry,positions=[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 i=0,j=1,l=32;i1)for(let i=0;i.99999)this.quaternion.set(0,0,0,1);else if(dir.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(dir.z,0,-dir.x).normalize();const radians=Math.acos(dir.y);this.quaternion.setFromAxisAngle(_axis,radians)}}setLength(length,headLength=.2*length,headWidth=.2*headLength){this.line.scale.set(1,Math.max(1e-4,length-headLength),1),this.line.updateMatrix(),this.cone.scale.set(headWidth,headLength,headWidth),this.cone.position.y=length,this.cone.updateMatrix()}setColor(color){this.line.material.color.set(color),this.cone.material.color.set(color)}copy(source){return super.copy(source,!1),this.line.copy(source.line),this.cone.copy(source.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class AxesHelper extends LineSegments{constructor(size=1){const vertices=[0,0,0,size,0,0,0,0,0,0,size,0,0,0,0,0,0,size],geometry=new BufferGeometry;geometry.setAttribute("position",new Float32BufferAttribute(vertices,3)),geometry.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(geometry,new LineBasicMaterial({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(xAxisColor,yAxisColor,zAxisColor){const color=new Color,array=this.geometry.attributes.color.array;return color.set(xAxisColor),color.toArray(array,0),color.toArray(array,3),color.set(yAxisColor),color.toArray(array,6),color.toArray(array,9),color.set(zAxisColor),color.toArray(array,12),color.toArray(array,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color,this.subPaths=[],this.currentPath=null}moveTo(x,y){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(x,y),this}lineTo(x,y){return this.currentPath.lineTo(x,y),this}quadraticCurveTo(aCPx,aCPy,aX,aY){return this.currentPath.quadraticCurveTo(aCPx,aCPy,aX,aY),this}bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY){return this.currentPath.bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY),this}splineThru(pts){return this.currentPath.splineThru(pts),this}toShapes(isCCW){function isPointInsidePolygon(inPt,inPolygon){const polyLen=inPolygon.length;let inside=!1;for(let p=polyLen-1,q=0;qNumber.EPSILON){if(edgeDy<0&&(edgeLowPt=inPolygon[q],edgeDx=-edgeDx,edgeHighPt=inPolygon[p],edgeDy=-edgeDy),inPt.yedgeHighPt.y)continue;if(inPt.y===edgeLowPt.y){if(inPt.x===edgeLowPt.x)return!0}else{const perpEdge=edgeDy*(inPt.x-edgeLowPt.x)-edgeDx*(inPt.y-edgeLowPt.y);if(0===perpEdge)return!0;if(perpEdge<0)continue;inside=!inside}}else{if(inPt.y!==edgeLowPt.y)continue;if(edgeHighPt.x<=inPt.x&&inPt.x<=edgeLowPt.x||edgeLowPt.x<=inPt.x&&inPt.x<=edgeHighPt.x)return!0}}return inside}const isClockWise=ShapeUtils.isClockWise,subPaths=this.subPaths;if(0===subPaths.length)return[];let solid,tmpPath,tmpShape;const shapes=[];if(1===subPaths.length)return tmpPath=subPaths[0],tmpShape=new Shape,tmpShape.curves=tmpPath.curves,shapes.push(tmpShape),shapes;let holesFirst=!isClockWise(subPaths[0].getPoints());holesFirst=isCCW?!holesFirst:holesFirst;const betterShapeHoles=[],newShapes=[];let tmpPoints,tmpHoles,newShapeHoles=[],mainIdx=0;newShapes[mainIdx]=void 0,newShapeHoles[mainIdx]=[];for(let i=0,l=subPaths.length;i1){let ambiguous=!1,toChange=0;for(let sIdx=0,sLen=newShapes.length;sIdx0&&!1===ambiguous&&(newShapeHoles=betterShapeHoles)}for(let i=0,il=newShapes.length;iarr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);iMath.PI&&(delta-=2*Math.PI),delta}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Grad=function Grad(x,y,z){var _this=this;_classCallCheck(this,Grad),_defineProperty(this,"dot2",(function(x,y){return _this.x*x+_this.y*y})),_defineProperty(this,"dot3",(function(x,y,z){return _this.x*x+_this.y*y+_this.z*z})),this.x=x,this.y=y,this.z=z},grad3=[new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0),new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1),new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)],p=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],perm=new Array(512),gradP=new Array(512),seed=function seed(_seed){_seed>0&&_seed<1&&(_seed*=65536),(_seed=Math.floor(_seed))<256&&(_seed|=_seed<<8);for(var i=0;i<256;i++){var v;v=1&i?p[i]^255&_seed:p[i]^_seed>>8&255,perm[i]=perm[i+256]=v,gradP[i]=gradP[i+256]=grad3[v%12]}};seed(0);Math.sqrt(3),Math.sqrt(3),Math.PI;function lcgRandom(seed){var state=function normalizeSeed(seed){if("number"==typeof seed)seed=Math.abs(seed);else if("string"==typeof seed){var string=seed;seed=0;for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:.25,delta=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.01,maxSpeed=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,easing=arguments.length>6&&void 0!==arguments[6]?arguments[6]:exp,eps=arguments.length>7&&void 0!==arguments[7]?arguments[7]:.001,vel="velocity_"+prop;if(void 0===current.__damp&&(current.__damp={}),void 0===current.__damp[vel]&&(current.__damp[vel]=0),Math.abs(current[prop]-target)<=eps)return current[prop]=target,!1;var omega=2/(smoothTime=Math.max(1e-4,smoothTime)),t=easing(omega*delta),change=current[prop]-target,originalTo=target,maxChange=maxSpeed*smoothTime;change=Math.min(Math.max(change,-maxChange),maxChange),target=current[prop]-change;var temp=(current.__damp[vel]+omega*change)*delta;current.__damp[vel]=(current.__damp[vel]-omega*temp)*t;var output=target+(change+temp)*t;return originalTo-current[prop]>0==output>originalTo&&(output=originalTo,current.__damp[vel]=(output-originalTo)/delta),current[prop]=output,!0}function dampAngle(current,prop,target,smoothTime,delta,maxSpeed,easing,eps){return damp(current,prop,current[prop]+deltaAngle(current[prop],target),smoothTime,delta,maxSpeed,easing,eps)}var a2,b2,v2d=new three_module.Vector2;var a3,b3,c3,v3d=new three_module.Vector3;function damp3(current,target,smoothTime,delta,maxSpeed,easing,eps){return"number"==typeof target?v3d.setScalar(target):Array.isArray(target)?v3d.set(target[0],target[1],target[2]):v3d.copy(target),a3=damp(current,"x",v3d.x,smoothTime,delta,maxSpeed,easing,eps),b3=damp(current,"y",v3d.y,smoothTime,delta,maxSpeed,easing,eps),c3=damp(current,"z",v3d.z,smoothTime,delta,maxSpeed,easing,eps),a3||b3||c3}var a4,b4,c4,d4,v4d=new three_module.Vector4;var aE,bE,cE,rot=new three_module.Euler;var aC,bC,cC,col=new three_module.Color;var aQ,bQ,cQ,dQ,qt=new three_module.Quaternion,v4result=new three_module.Vector4,v4velocity=new three_module.Vector4,v4error=new three_module.Vector4;function dampQ(current,target,smoothTime,delta,maxSpeed,easing,eps){var cur=current;Array.isArray(target)?qt.set(target[0],target[1],target[2],target[3]):qt.copy(target);var multi=current.dot(qt)>0?1:-1;return qt.x*=multi,qt.y*=multi,qt.z*=multi,qt.w*=multi,aQ=damp(current,"x",qt.x,smoothTime,delta,maxSpeed,easing,eps),bQ=damp(current,"y",qt.y,smoothTime,delta,maxSpeed,easing,eps),cQ=damp(current,"z",qt.z,smoothTime,delta,maxSpeed,easing,eps),dQ=damp(current,"w",qt.w,smoothTime,delta,maxSpeed,easing,eps),v4result.set(current.x,current.y,current.z,current.w).normalize(),v4velocity.set(cur.__damp.velocity_x,cur.__damp.velocity_y,cur.__damp.velocity_z,cur.__damp.velocity_w),v4error.copy(v4result).multiplyScalar(v4velocity.dot(v4result)/v4result.dot(v4result)),cur.__damp.velocity_x-=v4error.x,cur.__damp.velocity_y-=v4error.y,cur.__damp.velocity_z-=v4error.z,cur.__damp.velocity_w-=v4error.w,current.set(v4result.x,v4result.y,v4result.z,v4result.w),aQ||bQ||cQ||dQ}var aS,bS,cS,spherical=new three_module.Spherical;var aM,bM,cM,mat=new three_module.Matrix4,mPos=new three_module.Vector3,mRot=new three_module.Quaternion,mSca=new three_module.Vector3;var easing=Object.freeze({__proto__:null,rsqw:function rsqw(t){var delta=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.01,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/(2*Math.PI);return a/Math.atan(1/delta)*Math.atan(Math.sin(2*Math.PI*t*f)/delta)},exp:exp,damp:damp,dampAngle:dampAngle,damp2:function damp2(current,target,smoothTime,delta,maxSpeed,easing,eps){return"number"==typeof target?v2d.setScalar(target):Array.isArray(target)?v2d.set(target[0],target[1]):v2d.copy(target),a2=damp(current,"x",v2d.x,smoothTime,delta,maxSpeed,easing,eps),b2=damp(current,"y",v2d.y,smoothTime,delta,maxSpeed,easing,eps),a2||b2},damp3:damp3,damp4:function damp4(current,target,smoothTime,delta,maxSpeed,easing,eps){return"number"==typeof target?v4d.setScalar(target):Array.isArray(target)?v4d.set(target[0],target[1],target[2],target[3]):v4d.copy(target),a4=damp(current,"x",v4d.x,smoothTime,delta,maxSpeed,easing,eps),b4=damp(current,"y",v4d.y,smoothTime,delta,maxSpeed,easing,eps),c4=damp(current,"z",v4d.z,smoothTime,delta,maxSpeed,easing,eps),d4=damp(current,"w",v4d.w,smoothTime,delta,maxSpeed,easing,eps),a4||b4||c4||d4},dampE:function dampE(current,target,smoothTime,delta,maxSpeed,easing,eps){return Array.isArray(target)?rot.set(target[0],target[1],target[2],target[3]):rot.copy(target),aE=dampAngle(current,"x",rot.x,smoothTime,delta,maxSpeed,easing,eps),bE=dampAngle(current,"y",rot.y,smoothTime,delta,maxSpeed,easing,eps),cE=dampAngle(current,"z",rot.z,smoothTime,delta,maxSpeed,easing,eps),aE||bE||cE},dampC:function dampC(current,target,smoothTime,delta,maxSpeed,easing,eps){return target instanceof three_module.Color?col.copy(target):Array.isArray(target)?col.setRGB(target[0],target[1],target[2]):col.set(target),aC=damp(current,"r",col.r,smoothTime,delta,maxSpeed,easing,eps),bC=damp(current,"g",col.g,smoothTime,delta,maxSpeed,easing,eps),cC=damp(current,"b",col.b,smoothTime,delta,maxSpeed,easing,eps),aC||bC||cC},dampQ:dampQ,dampS:function dampS(current,target,smoothTime,delta,maxSpeed,easing,eps){return Array.isArray(target)?spherical.set(target[0],target[1],target[2]):spherical.copy(target),aS=damp(current,"radius",spherical.radius,smoothTime,delta,maxSpeed,easing,eps),bS=dampAngle(current,"phi",spherical.phi,smoothTime,delta,maxSpeed,easing,eps),cS=dampAngle(current,"theta",spherical.theta,smoothTime,delta,maxSpeed,easing,eps),aS||bS||cS},dampM:function dampM(current,target,smoothTime,delta,maxSpeed,easing,eps){var cur=current;return void 0===cur.__damp&&(cur.__damp={position:new three_module.Vector3,rotation:new three_module.Quaternion,scale:new three_module.Vector3},current.decompose(cur.__damp.position,cur.__damp.rotation,cur.__damp.scale)),Array.isArray(target)?mat.set.apply(mat,_toConsumableArray(target)):mat.copy(target),mat.decompose(mPos,mRot,mSca),aM=damp3(cur.__damp.position,mPos,smoothTime,delta,maxSpeed,easing,eps),bM=dampQ(cur.__damp.rotation,mRot,smoothTime,delta,maxSpeed,easing,eps),cM=damp3(cur.__damp.scale,mSca,smoothTime,delta,maxSpeed,easing,eps),current.compose(cur.__damp.position,cur.__damp.rotation,cur.__damp.scale),aM||bM||cM}});function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _possibleConstructorReturn(self,call){if(call&&("object"==typeof call||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}three_module.BufferGeometry;const selectionContext=(0,react.createContext)(null);const EffectComposerContext=(0,react.createContext)(null),EffectComposer=react.memo((0,react.forwardRef)((({children:children,camera:_camera,scene:_scene,resolutionScale:resolutionScale,enabled:enabled=!0,renderPriority:renderPriority=1,autoClear:autoClear=!0,depthBuffer:depthBuffer,disableNormalPass:disableNormalPass,stencilBuffer:stencilBuffer,multisampling:multisampling=8,frameBufferType:frameBufferType=three_module.HalfFloatType},ref)=>{const{gl:gl,scene:defaultScene,camera:defaultCamera,size:size}=(0,index_673ef987_esm.z)(),scene=_scene||defaultScene,camera=_camera||defaultCamera,[composer,normalPass,downSamplingPass]=(0,react.useMemo)((()=>{const webGL2Available=isWebGL2Available(),effectComposer=new build.xC(gl,{depthBuffer:depthBuffer,stencilBuffer:stencilBuffer,multisampling:multisampling>0&&webGL2Available?multisampling:0,frameBufferType:frameBufferType});effectComposer.addPass(new build.CD(scene,camera));let downSamplingPass2=null,normalPass2=null;return disableNormalPass||(normalPass2=new build.gh(scene,camera),normalPass2.enabled=!1,effectComposer.addPass(normalPass2),void 0!==resolutionScale&&webGL2Available&&(downSamplingPass2=new build.xs({normalBuffer:normalPass2.texture,resolutionScale:resolutionScale}),downSamplingPass2.enabled=!1,effectComposer.addPass(downSamplingPass2))),[effectComposer,normalPass2,downSamplingPass2]}),[camera,gl,depthBuffer,stencilBuffer,multisampling,frameBufferType,scene,disableNormalPass,resolutionScale]);(0,react.useEffect)((()=>null==composer?void 0:composer.setSize(size.width,size.height)),[composer,size]),(0,index_673ef987_esm.A)(((_,delta)=>{if(enabled){const currentAutoClear=gl.autoClear;gl.autoClear=autoClear,stencilBuffer&&!autoClear&&gl.clearStencil(),composer.render(delta),gl.autoClear=currentAutoClear}}),enabled?renderPriority:0);const group=(0,react.useRef)(null),instance=(0,index_673ef987_esm.x)(group);(0,react.useLayoutEffect)((()=>{const passes=[];if(group.current&&instance.current&&composer){const children2=instance.current.objects;for(let i2=0;i2{for(const pass of passes)null==composer||composer.removePass(pass);normalPass&&(normalPass.enabled=!1),downSamplingPass&&(downSamplingPass.enabled=!1)}}),[composer,children,camera,normalPass,downSamplingPass,instance]);const state=(0,react.useMemo)((()=>({composer:composer,normalPass:normalPass,downSamplingPass:downSamplingPass,resolutionScale:resolutionScale,camera:camera,scene:scene})),[composer,normalPass,downSamplingPass,resolutionScale,camera,scene]);return(0,react.useImperativeHandle)(ref,(()=>composer),[composer]),(0,jsx_runtime.jsx)(EffectComposerContext.Provider,{value:state,children:(0,jsx_runtime.jsx)("group",{ref:group,children:children})})}))),resolveRef=ref=>"object"==typeof ref&&null!=ref&&"current"in ref?ref.current:ref;let i=0;const components=new WeakMap,wrapEffect=(effect,defaults)=>react.forwardRef((function Effect2({blendFunction:blendFunction=(null==defaults?void 0:defaults.blendFunction),opacity:opacity=(null==defaults?void 0:defaults.opacity),...props},ref){let Component=components.get(effect);if(!Component){const key=`@react-three/postprocessing/${effect.name}-${i++}`;(0,index_673ef987_esm.e)({[key]:effect}),components.set(effect,Component=key)}const camera=(0,index_673ef987_esm.z)((state=>state.camera)),args=react.useMemo((()=>{var _a,_b;return[...null!=(_a=null==defaults?void 0:defaults.args)?_a:[],...null!=(_b=props.args)?_b:[{...defaults,...props}]]}),[JSON.stringify(props)]);return(0,jsx_runtime.jsx)(Component,{camera:camera,"blendMode-blendFunction":blendFunction,"blendMode-opacity-value":opacity,...props,ref:ref,args:args})})),useVector2=(props,key)=>{const value=props[key];return react.useMemo((()=>"number"==typeof value?new three_module.Vector2(value,value):value?new three_module.Vector2(...value):new three_module.Vector2),[value])},DepthOfField=(0,react.forwardRef)((function DepthOfField2({target:target,depthTexture:depthTexture,...props},ref){const invalidate=(0,index_673ef987_esm.z)((state=>state.invalidate)),{camera:camera}=(0,react.useContext)(EffectComposerContext),effect=(0,react.useMemo)((()=>{const effect2=new build.Jy(camera,props);return effect2.maskPass.getFullscreenMaterial().maskFunction=build.DF.MULTIPLY_RGB_SET_ALPHA,effect2}),[camera,props]);return(0,react.useLayoutEffect)((()=>{if(target&&"number"!=typeof target){const vec=target instanceof three_module.Vector3?(new three_module.Vector3).set(target.x,target.y,target.z):(new three_module.Vector3).set(target[0],target[1],target[2]);effect.target=vec}depthTexture&&effect.setDepthTexture(depthTexture.texture,depthTexture.packing),invalidate()}),[target,depthTexture,effect]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),LensFlareShader=((0,react.forwardRef)((({target:target,mouse:followMouse=!1,debug:debug,manual:manual=!1,smoothTime:smoothTime=.25,...props},fref)=>{const dofRef=(0,react.useRef)(null),hitpointRef=(0,react.useRef)(null),targetRef=(0,react.useRef)(null),scene=(0,index_673ef987_esm.z)((({scene:scene2})=>scene2)),pointer=(0,index_673ef987_esm.z)((({pointer:pointer2})=>pointer2)),{composer:composer,camera:camera}=(0,react.useContext)(EffectComposerContext),[depthPickingPass]=(0,react.useState)((()=>new build.DY)),[copyPass]=(0,react.useState)((()=>new build.KM));(0,react.useEffect)((()=>(composer.addPass(depthPickingPass),composer.addPass(copyPass),()=>{composer.removePass(depthPickingPass),composer.removePass(copyPass)})),[composer,depthPickingPass,copyPass]),(0,react.useEffect)((()=>()=>{depthPickingPass.dispose(),copyPass.dispose()}),[depthPickingPass,copyPass]);const[hitpoint]=(0,react.useState)((()=>new three_module.Vector3(0,0,0))),[ndc]=(0,react.useState)((()=>new three_module.Vector3(0,0,0))),getHit=(0,react.useCallback)((async(x,y)=>{ndc.x=x,ndc.y=y,ndc.z=await depthPickingPass.readDepth(ndc),ndc.z=2*ndc.z-1;return!!(1-ndc.z>1e-7)&&ndc.unproject(camera)}),[ndc,depthPickingPass,camera]),update=(0,react.useCallback)((async(delta,updateTarget=!0)=>{var _a;if(target)hitpoint.set(...target);else{const{x:x,y:y}=followMouse?pointer:{x:0,y:0},hit=await getHit(x,y);hit&&hitpoint.copy(hit)}updateTarget&&(null==(_a=dofRef.current)?void 0:_a.target)&&(smoothTime>0&&delta>0?easing.damp3(dofRef.current.target,hitpoint,smoothTime,delta):dofRef.current.target.copy(hitpoint))}),[target,hitpoint,followMouse,getHit,smoothTime,pointer]);(0,index_673ef987_esm.A)((async(_,delta)=>{var _a;manual||update(delta),hitpointRef.current&&hitpointRef.current.position.copy(hitpoint),targetRef.current&&(null==(_a=dofRef.current)?void 0:_a.target)&&targetRef.current.position.copy(dofRef.current.target)}));const api=(0,react.useMemo)((()=>({dofRef:dofRef,hitpoint:hitpoint,update:update})),[hitpoint,update]);return(0,react.useImperativeHandle)(fref,(()=>api),[api]),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[debug?(0,index_673ef987_esm.g)((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)("mesh",{ref:hitpointRef,children:[(0,jsx_runtime.jsx)("sphereGeometry",{args:[debug,16,16]}),(0,jsx_runtime.jsx)("meshBasicMaterial",{color:"#00ff00",opacity:1,transparent:!0,depthWrite:!1})]}),(0,jsx_runtime.jsxs)("mesh",{ref:targetRef,children:[(0,jsx_runtime.jsx)("sphereGeometry",{args:[debug/2,16,16]}),(0,jsx_runtime.jsx)("meshBasicMaterial",{color:"#00ff00",opacity:.5,transparent:!0,depthWrite:!1})]})]}),scene):null,(0,jsx_runtime.jsx)(DepthOfField,{ref:dofRef,...props,target:hitpoint})]})})),{fragmentShader:"\n\n uniform float iTime;\n uniform vec2 lensPosition;\n uniform vec2 iResolution;\n uniform vec3 colorGain;\n uniform float starPoints;\n uniform float glareSize;\n uniform float flareSize;\n uniform float flareSpeed;\n uniform float flareShape;\n uniform float haloScale;\n uniform float opacity;\n uniform bool animated;\n uniform bool anamorphic;\n uniform bool enabled;\n uniform bool secondaryGhosts;\n uniform bool starBurst;\n uniform float ghostScale;\n uniform bool aditionalStreaks;\n uniform sampler2D lensDirtTexture;\n vec2 vxtC;\n\n float rndf(float n){return fract(sin(n) * 43758.5453123);}float niz(float p){float fl = floor(p);float fc = fract(p);return mix(rndf(fl),rndf(fl + 1.0), fc);}\n vec3 hsv2rgb(vec3 c){vec4 k = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);vec3 p = abs(fract(c.xxx + k.xyz) * 6.0 - k.www);return c.z * mix(k.xxx, clamp(p - k.xxx, 0.0, 1.0), c.y);}\n float satU(float x){return clamp(x, 0.,1.);}vec2 rtU(vec2 naz, float rtn){return vec2(cos(rtn) * naz.x + sin(rtn) * naz.y,cos(rtn) * naz.y - sin(rtn) * naz.x);}\n vec3 drwF(vec2 p, float intensity, float rnd, float speed, int id){float flhos = (1. / 32.) * float(id) * 0.1;float lingrad = distance(vec2(0.), p);float expg = 1. / exp(lingrad * (fract(rnd) * 0.66 + 0.33));vec3 qzTg = hsv2rgb(vec3( fract( (expg * 8.) + speed * flareSpeed + flhos), pow(1.-abs(expg*2.-1.), 0.45), 20.0 * expg * intensity));float internalStarPoints;if(anamorphic){internalStarPoints = 1.0;} else{internalStarPoints = starPoints;}float ams = length(p * flareShape * sin(internalStarPoints * atan(p.x, p.y)));float kJhg = pow(1.-satU(ams), ( anamorphic ? 100. : 12.));kJhg += satU(expg-0.9) * 3.;kJhg = pow(kJhg * expg, 8. + (1.-intensity) * 5.);if(flareSpeed > 0.0){return vec3(kJhg) * qzTg;} else{return vec3(kJhg) * flareSize * 15.;}}\n float ams2(vec3 a, vec3 b) { return abs(a.x - b.x) + abs(a.y - b.y) + abs(a.z - b.z);}vec3 satU(vec3 x){return clamp(x, vec3(0.0), vec3(1.0));}\n float glR(vec2 naz, vec2 pos, float zsi){vec2 mni;if(animated){mni = rtU(naz-pos, iTime * 0.1);} else{mni = naz-pos;}float ang = atan(mni.y, mni.x) * (anamorphic ? 1.0 : starPoints);float ams2 = length(mni);ams2 = pow(ams2, .9);float f0 = 1.0/(length(naz-pos)*(1.0/zsi*16.0)+.2);return f0+f0*(sin((ang))*.2 +.3);}\n float sdHex(vec2 p){p = abs(p);vec2 q = vec2(p.x*2.0*0.5773503, p.y + p.x*0.5773503);return dot(step(q.xy,q.yx), 1.0-q.yx);}float fpow(float x, float k){return x > k ? pow((x-k)/(1.0-k),2.0) : 0.0;}\n vec3 rHx(vec2 naz, vec2 p, float s, vec3 col){naz -= p;if (abs(naz.x) < 0.2*s && abs(naz.y) < 0.2*s){return mix(vec3(0),mix(vec3(0),col,0.1 + fpow(length(naz/s),0.1)*10.0),smoothstep(0.0,0.1,sdHex(naz*20.0/s)));}return vec3(0);}\n vec3 mLs(vec2 naz, vec2 pos){vec2 mni = naz-pos;vec2 zxMp = naz*(length(naz));float ang = atan(mni.x,mni.y);float f0 = .3/(length(naz-pos)*16.0+1.0);f0 = f0*(sin(niz(sin(ang*3.9-(animated ? iTime : 0.0) * 0.3) * starPoints))*.2 );float f1 = max(0.01-pow(length(naz+1.2*pos),1.9),.0)*7.0;float f2 = max(.9/(10.0+32.0*pow(length(zxMp+0.99*pos),2.0)),.0)*0.35;float f22 = max(.9/(11.0+32.0*pow(length(zxMp+0.85*pos),2.0)),.0)*0.23;float f23 = max(.9/(12.0+32.0*pow(length(zxMp+0.95*pos),2.0)),.0)*0.6;vec2 ztX = mix(naz,zxMp, 0.1);float f4 = max(0.01-pow(length(ztX+0.4*pos),2.9),.0)*4.02;float f42 = max(0.0-pow(length(ztX+0.45*pos),2.9),.0)*4.1;float f43 = max(0.01-pow(length(ztX+0.5*pos),2.9),.0)*4.6;ztX = mix(naz,zxMp,-.4);float f5 = max(0.01-pow(length(ztX+0.1*pos),5.5),.0)*2.0;float f52 = max(0.01-pow(length(ztX+0.2*pos),5.5),.0)*2.0;float f53 = max(0.01-pow(length(ztX+0.1*pos),5.5),.0)*2.0;ztX = mix(naz,zxMp, 2.1);float f6 = max(0.01-pow(length(ztX-0.3*pos),1.61),.0)*3.159;float f62 = max(0.01-pow(length(ztX-0.325*pos),1.614),.0)*3.14;float f63 = max(0.01-pow(length(ztX-0.389*pos),1.623),.0)*3.12;vec3 c = vec3(glR(naz,pos, glareSize));vec2 prot;if(animated){prot = rtU(naz - pos, (iTime * 0.1));} else if(anamorphic){prot = rtU(naz - pos, 1.570796);} else {prot = naz - pos;}c += drwF(prot, (anamorphic ? flareSize * 10. : flareSize), 0.1, iTime, 1);c.r+=f1+f2+f4+f5+f6; c.g+=f1+f22+f42+f52+f62; c.b+=f1+f23+f43+f53+f63;c = c*1.3 * vec3(length(zxMp)+.09);c+=vec3(f0);return c;}\n vec3 cc(vec3 clr, float fct,float fct2){float w = clr.x+clr.y+clr.z;return mix(clr,vec3(w)*fct,w*fct2);}float rnd(vec2 p){float f = fract(sin(dot(p, vec2(12.1234, 72.8392) )*45123.2));return f;}float rnd(float w){float f = fract(sin(w)*1000.);return f;}\n float rShp(vec2 p, int N){float f;float a=atan(p.x,p.y)+.2;float b=6.28319/float(N);f=smoothstep(.5,.51, cos(floor(.5+a/b)*b-a)*length(p.xy)* 2.0 -ghostScale);return f;}\n vec3 drC(vec2 p, float zsi, float dCy, vec3 clr, vec3 clr2, float ams2, vec2 esom){float l = length(p + esom*(ams2*2.))+zsi/2.;float l2 = length(p + esom*(ams2*4.))+zsi/3.;float c = max(0.01-pow(length(p + esom*ams2), zsi*ghostScale), 0.0)*10.;float c1 = max(0.001-pow(l-0.3, 1./40.)+sin(l*20.), 0.0)*3.;float c2 = max(0.09/pow(length(p-esom*ams2/.5)*1., .95), 0.0)/20.;float s = max(0.02-pow(rShp(p*5. + esom*ams2*5. + dCy, 6) , 1.), 0.0)*1.5;clr = cos(vec3(0.44, .24, .2)*8. + ams2*4.)*0.5+.5;vec3 f = c*clr;f += c1*clr;f += c2*clr;f += s*clr;return f-0.01;}\n vec4 geLC(float x){return vec4(vec3(mix(mix(mix(mix(mix(mix(mix(mix(mix(mix(mix(mix(mix(mix(mix(vec3(0., 0., 0.),vec3(0., 0., 0.), smoothstep(0.0, 0.063, x)),vec3(0., 0., 0.), smoothstep(0.063, 0.125, x)),vec3(0.0, 0., 0.), smoothstep(0.125, 0.188, x)),vec3(0.188, 0.131, 0.116), smoothstep(0.188, 0.227, x)),vec3(0.31, 0.204, 0.537), smoothstep(0.227, 0.251, x)),vec3(0.192, 0.106, 0.286), smoothstep(0.251, 0.314, x)),vec3(0.102, 0.008, 0.341), smoothstep(0.314, 0.392, x)),vec3(0.086, 0.0, 0.141), smoothstep(0.392, 0.502, x)),vec3(1.0, 0.31, 0.0), smoothstep(0.502, 0.604, x)),vec3(.1, 0.1, 0.1), smoothstep(0.604, 0.643, x)),vec3(1.0, 0.929, 0.0), smoothstep(0.643, 0.761, x)),vec3(1.0, 0.086, 0.424), smoothstep(0.761, 0.847, x)),vec3(1.0, 0.49, 0.0), smoothstep(0.847, 0.89, x)),vec3(0.945, 0.275, 0.475), smoothstep(0.89, 0.941, x)),vec3(0.251, 0.275, 0.796), smoothstep(0.941, 1.0, x))),1.0);}\n float diTN(vec2 p){vec2 f = fract(p);f = (f * f) * (3.0 - (2.0 * f));float n = dot(floor(p), vec2(1.0, 157.0));vec4 a = fract(sin(vec4(n + 0.0, n + 1.0, n + 157.0, n + 158.0)) * 43758.5453123);return mix(mix(a.x, a.y, f.x), mix(a.z, a.w, f.x), f.y);} \n float fbm(vec2 p){const mat2 m = mat2(0.80, -0.60, 0.60, 0.80);float f = 0.0;f += 0.5000*diTN(p); p = m*p*2.02;f += 0.2500*diTN(p); p = m*p*2.03;f += 0.1250*diTN(p); p = m*p*2.01;f += 0.0625*diTN(p);return f/0.9375;} \n vec4 geLS(vec2 p){vec2 pp = (p - vec2(0.5)) * 2.0;float a = atan(pp.y, pp.x);vec4 cp = vec4(sin(a * 1.0), length(pp), sin(a * 13.0), sin(a * 53.0));float d = sin(clamp(pow(length(vec2(0.5) - p) * 0.5 + haloScale /2., 5.0), 0.0, 1.0) * 3.14159);vec3 c = vec3(d) * vec3(fbm(cp.xy * 16.0) * fbm(cp.zw * 9.0) * max(max(max(max(0.5, sin(a * 1.0)), sin(a * 3.0) * 0.8), sin(a * 7.0) * 0.8), sin(a * 9.0) * 10.6));c *= vec3(mix(2.0, (sin(length(pp.xy) * 256.0) * 0.5) + 0.5, sin((clamp((length(pp.xy) - 0.875) / 0.1, 0.0, 1.0) + 0.0) * 2.0 * 3.14159) * 1.5) + 0.5) * 0.3275;return vec4(vec3(c * 1.0), d);}\n vec4 geLD(vec2 p){p.xy += vec2(fbm(p.yx * 3.0), fbm(p.yx * 2.0)) * 0.0825;vec3 o = vec3(mix(0.125, 0.25, max(max(smoothstep(0.1, 0.0, length(p - vec2(0.25))),smoothstep(0.4, 0.0, length(p - vec2(0.75)))),smoothstep(0.8, 0.0, length(p - vec2(0.875, 0.125))))));o += vec3(max(fbm(p * 1.0) - 0.5, 0.0)) * 0.5;o += vec3(max(fbm(p * 2.0) - 0.5, 0.0)) * 0.5;o += vec3(max(fbm(p * 4.0) - 0.5, 0.0)) * 0.25;o += vec3(max(fbm(p * 8.0) - 0.75, 0.0)) * 1.0;o += vec3(max(fbm(p * 16.0) - 0.75, 0.0)) * 0.75;o += vec3(max(fbm(p * 64.0) - 0.75, 0.0)) * 0.5;return vec4(clamp(o, vec3(0.15), vec3(1.0)), 1.0);}\n vec4 txL(sampler2D tex, vec2 xtC){if(((xtC.x < 0.) || (xtC.y < 0.)) || ((xtC.x > 1.) || (xtC.y > 1.))){return vec4(0.0);}else{return texture(tex, xtC); }}\n vec4 txD(sampler2D tex, vec2 xtC, vec2 dir, vec3 ditn) {return vec4(txL(tex, (xtC + (dir * ditn.r))).r,txL(tex, (xtC + (dir * ditn.g))).g,txL(tex, (xtC + (dir * ditn.b))).b,1.0);}\n vec4 strB(){vec2 aspXtc = vec2(1.0) - (((vxtC - vec2(0.5)) * vec2(1.0)) + vec2(0.5)); vec2 xtC = vec2(1.0) - vxtC; vec2 ghvc = (vec2(0.5) - xtC) * 0.3 - lensPosition; vec2 ghNm = normalize(ghvc * vec2(1.0)) * vec2(1.0);vec2 haloVec = normalize(ghvc) * 0.6;vec2 hlNm = ghNm * 0.6;vec2 texelSize = vec2(1.0) / vec2(iResolution.xy);vec3 ditn = vec3(-(texelSize.x * 1.5), 0.2, texelSize.x * 1.5);vec4 c = vec4(0.0);for (int i = 0; i < 8; i++) {vec2 offset = xtC + (ghvc * float(i));c += txD(lensDirtTexture, offset, ghNm, ditn) * pow(max(0.0, 1.0 - (length(vec2(0.5) - offset) / length(vec2(0.5)))), 10.0);}vec2 uyTrz = xtC + hlNm; return (c * geLC((length(vec2(0.5) - aspXtc) / length(vec2(haloScale))))) +(txD(lensDirtTexture, uyTrz, ghNm, ditn) * pow(max(0.0, 1.0 - (length(vec2(0.5) - uyTrz) / length(vec2(0.5)))), 10.0));} \n void mainImage(vec4 v,vec2 r,out vec4 i){vec2 g=r-.5;g.y*=iResolution.y/iResolution.x;vec2 l=lensPosition*.5;l.y*=iResolution.y/iResolution.x;vec3 f=mLs(g,l)*20.*colorGain/256.;if(aditionalStreaks){vec3 o=vec3(.9,.2,.1),p=vec3(.3,.1,.9);for(float n=0.;n<10.;n++)f+=drC(g,pow(rnd(n*2e3)*2.8,.1)+1.41,0.,o+n,p+n,rnd(n*20.)*3.+.2-.5,lensPosition);}if(secondaryGhosts){vec3 n=vec3(0);n+=rHx(g,-lensPosition*.25,ghostScale*1.4,vec3(.25,.35,0));n+=rHx(g,lensPosition*.25,ghostScale*.5,vec3(1,.5,.5));n+=rHx(g,lensPosition*.1,ghostScale*1.6,vec3(1));n+=rHx(g,lensPosition*1.8,ghostScale*2.,vec3(0,.5,.75));n+=rHx(g,lensPosition*1.25,ghostScale*.8,vec3(1,1,.5));n+=rHx(g,-lensPosition*1.25,ghostScale*5.,vec3(.5,.5,.25));n+=fpow(1.-abs(distance(lensPosition*.8,g)-.7),.985)*colorGain/2100.;f+=n;}if(starBurst){vxtC=g+.5;vec4 n=geLD(g);float o=1.-clamp(0.5,0.,.5)*2.;n+=mix(n,pow(n*2.,vec4(2))*.5,o);float s=(g.x+g.y)*(1./6.);vec2 d=mat2(cos(s),-sin(s),sin(s),cos(s))*vxtC;n+=geLS(d)*2.;f+=clamp(n.xyz*strB().xyz,.01,1.);}i=enabled?vec4(mix(f,vec3(0),opacity)+v.xyz,v.w):vec4(v);}\n"});class LensFlareEffect extends build.Qm{constructor({blendFunction:blendFunction=build.YQ.NORMAL,enabled:enabled=!0,glareSize:glareSize=.2,lensPosition:lensPosition=[.01,.01],iResolution:iResolution=[0,0],starPoints:starPoints=6,flareSize:flareSize=.01,flareSpeed:flareSpeed=.01,flareShape:flareShape=.01,animated:animated=!0,anamorphic:anamorphic=!1,colorGain:colorGain=new three_module.Color(20,20,20),lensDirtTexture:lensDirtTexture=null,haloScale:haloScale=.5,secondaryGhosts:secondaryGhosts=!0,aditionalStreaks:aditionalStreaks=!0,ghostScale:ghostScale=0,opacity:opacity=1,starBurst:starBurst=!1}={}){super("LensFlareEffect",LensFlareShader.fragmentShader,{blendFunction:blendFunction,uniforms:new Map([["enabled",new three_module.Uniform(enabled)],["glareSize",new three_module.Uniform(glareSize)],["lensPosition",new three_module.Uniform(lensPosition)],["iTime",new three_module.Uniform(0)],["iResolution",new three_module.Uniform(iResolution)],["starPoints",new three_module.Uniform(starPoints)],["flareSize",new three_module.Uniform(flareSize)],["flareSpeed",new three_module.Uniform(flareSpeed)],["flareShape",new three_module.Uniform(flareShape)],["animated",new three_module.Uniform(animated)],["anamorphic",new three_module.Uniform(anamorphic)],["colorGain",new three_module.Uniform(colorGain)],["lensDirtTexture",new three_module.Uniform(lensDirtTexture)],["haloScale",new three_module.Uniform(haloScale)],["secondaryGhosts",new three_module.Uniform(secondaryGhosts)],["aditionalStreaks",new three_module.Uniform(aditionalStreaks)],["ghostScale",new three_module.Uniform(ghostScale)],["starBurst",new three_module.Uniform(starBurst)],["opacity",new three_module.Uniform(opacity)]])})}update(_renderer,_inputBuffer,deltaTime){const iTime=this.uniforms.get("iTime");iTime&&(iTime.value+=deltaTime)}}(0,react.forwardRef)((({position:position=new three_module.Vector3(-25,6,-60),followMouse:followMouse=!1,smoothTime:smoothTime=.07,...props},ref)=>{const viewport=(0,index_673ef987_esm.z)((({viewport:viewport2})=>viewport2)),raycaster=(0,index_673ef987_esm.z)((({raycaster:raycaster2})=>raycaster2)),pointer=(0,index_673ef987_esm.z)((({pointer:pointer2})=>pointer2)),{scene:scene,camera:camera}=(0,react.useContext)(EffectComposerContext),[projectedPosition]=(0,react.useState)((()=>new three_module.Vector3)),[mouse2d]=(0,react.useState)((()=>new three_module.Vector2)),effect=(0,react.useMemo)((()=>new LensFlareEffect(props)),[props]);return(0,index_673ef987_esm.A)(((_,delta)=>{var _a,_b,_c;const uLensPosition=effect.uniforms.get("lensPosition"),uOpacity=effect.uniforms.get("opacity");if(!uLensPosition||!uOpacity)return;let target=1;if(followMouse)uLensPosition.value.x=pointer.x,uLensPosition.value.y=pointer.y,target=0;else{if(projectedPosition.copy(position).project(camera),projectedPosition.z>1)return;uLensPosition.value.x=projectedPosition.x,uLensPosition.value.y=projectedPosition.y,mouse2d.set(projectedPosition.x,projectedPosition.y),raycaster.setFromCamera(mouse2d,camera);const intersects=raycaster.intersectObjects(scene.children,!0),{object:object}=intersects[0];object&&("no-occlusion"===(null==(_a=object.userData)?void 0:_a.lensflare)?target=0:object instanceof three_module.Mesh&&((null==(_c=null==(_b=object.material.uniforms)?void 0:_b._transmission)?void 0:_c.value)>.2||object.material._transmission&&object.material._transmission>.2?target=.2:object.material.transparent&&(target=object.material.opacity)))}easing.damp(uOpacity,"value",target,smoothTime,delta)})),(0,react.useEffect)((()=>{const iResolution=effect.uniforms.get("iResolution");iResolution&&(iResolution.value.x=viewport.width,iResolution.value.y=viewport.height)}),[effect,viewport]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})}));const Bloom=wrapEffect(build.rk,{blendFunction:build.YQ.ADD}),SSAO=(wrapEffect(build.at),wrapEffect(build.YY),(0,react.forwardRef)((function ColorAverage2({blendFunction:blendFunction=build.YQ.NORMAL},ref){const effect=(0,react.useMemo)((()=>new build.TC(blendFunction)),[blendFunction]);return(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),wrapEffect(build.zo),wrapEffect(build.AL),wrapEffect(build.ol),(0,react.forwardRef)((function Glitch2({active:active=!0,...props},ref){const invalidate=(0,index_673ef987_esm.z)((state=>state.invalidate)),delay=useVector2(props,"delay"),duration=useVector2(props,"duration"),strength=useVector2(props,"strength"),chromaticAberrationOffset=useVector2(props,"chromaticAberrationOffset"),effect=(0,react.useMemo)((()=>new build.sy({...props,delay:delay,duration:duration,strength:strength,chromaticAberrationOffset:chromaticAberrationOffset})),[delay,duration,props,strength,chromaticAberrationOffset]);return(0,react.useLayoutEffect)((()=>{effect.mode=active?props.mode||build.O7.SPORADIC:build.O7.DISABLED,invalidate()}),[active,effect,invalidate,props.mode]),(0,react.useEffect)((()=>()=>{effect.dispose()}),[effect]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),(0,react.forwardRef)((function GodRays2(props,ref){const{camera:camera}=(0,react.useContext)(EffectComposerContext),effect=(0,react.useMemo)((()=>new build.KI(camera,resolveRef(props.sun),props)),[camera,props]);return(0,react.useLayoutEffect)((()=>{effect.lightSource=resolveRef(props.sun)}),[effect,props.sun]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),(0,react.forwardRef)((function Grid2({size:size,...props},ref){const invalidate=(0,index_673ef987_esm.z)((state=>state.invalidate)),effect=(0,react.useMemo)((()=>new build.Qt(props)),[props]);return(0,react.useLayoutEffect)((()=>{size&&effect.setSize(size.width,size.height),invalidate()}),[effect,size]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),wrapEffect(build.JL),wrapEffect(build.xV,{blendFunction:build.YQ.COLOR_DODGE}),(0,react.forwardRef)((function Outline2({selection:selection=[],selectionLayer:selectionLayer=10,blendFunction:blendFunction,patternTexture:patternTexture,edgeStrength:edgeStrength,pulseSpeed:pulseSpeed,visibleEdgeColor:visibleEdgeColor,hiddenEdgeColor:hiddenEdgeColor,width:width,height:height,kernelSize:kernelSize,blur:blur,xRay:xRay,...props},forwardRef2){const invalidate=(0,index_673ef987_esm.z)((state=>state.invalidate)),{scene:scene,camera:camera}=(0,react.useContext)(EffectComposerContext),effect=(0,react.useMemo)((()=>new build.Mn(scene,camera,{blendFunction:blendFunction,patternTexture:patternTexture,edgeStrength:edgeStrength,pulseSpeed:pulseSpeed,visibleEdgeColor:visibleEdgeColor,hiddenEdgeColor:hiddenEdgeColor,width:width,height:height,kernelSize:kernelSize,blur:blur,xRay:xRay,...props})),[blendFunction,blur,camera,edgeStrength,height,hiddenEdgeColor,kernelSize,patternTexture,pulseSpeed,scene,visibleEdgeColor,width,xRay]),api=(0,react.useContext)(selectionContext);return(0,react.useEffect)((()=>{if(!api&&selection)return effect.selection.set(Array.isArray(selection)?selection.map(resolveRef):[resolveRef(selection)]),invalidate(),()=>{effect.selection.clear(),invalidate()}}),[effect,selection,api,invalidate]),(0,react.useEffect)((()=>{effect.selectionLayer=selectionLayer,invalidate()}),[effect,invalidate,selectionLayer]),(0,react.useRef)(),(0,react.useEffect)((()=>{var _a;if(api&&api.enabled&&(null==(_a=api.selected)?void 0:_a.length))return effect.selection.set(api.selected),invalidate(),()=>{effect.selection.clear(),invalidate()}}),[api,effect.selection,invalidate]),(0,jsx_runtime.jsx)("primitive",{ref:forwardRef2,object:effect})})),(0,react.forwardRef)((function Pixelation2({granularity:granularity=5},ref){const effect=(0,react.useMemo)((()=>new build.Qg(granularity)),[granularity]);return(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),wrapEffect(build.p$,{blendFunction:build.YQ.OVERLAY,density:1.25}),(0,react.forwardRef)((function SelectiveBloom2({selection:selection=[],selectionLayer:selectionLayer=10,lights:lights=[],luminanceThreshold:luminanceThreshold,luminanceSmoothing:luminanceSmoothing,intensity:intensity,width:width,height:height,kernelSize:kernelSize,mipmapBlur:mipmapBlur,...props},forwardRef2){0===lights.length&&console.warn("SelectiveBloom requires lights to work.");const invalidate=(0,index_673ef987_esm.z)((state=>state.invalidate)),{scene:scene,camera:camera}=(0,react.useContext)(EffectComposerContext),effect=(0,react.useMemo)((()=>new build.V$(scene,camera,{blendFunction:build.YQ.ADD,luminanceThreshold:luminanceThreshold,luminanceSmoothing:luminanceSmoothing,intensity:intensity,width:width,height:height,kernelSize:kernelSize,mipmapBlur:mipmapBlur,...props})),[scene,camera,luminanceThreshold,luminanceSmoothing,intensity,width,height,kernelSize,mipmapBlur,props]),api=(0,react.useContext)(selectionContext);return(0,react.useEffect)((()=>{if(!api&&selection)return effect.selection.set(Array.isArray(selection)?selection.map(resolveRef):[resolveRef(selection)]),invalidate(),()=>{effect.selection.clear(),invalidate()}}),[effect,selection,api,invalidate]),(0,react.useEffect)((()=>{effect.selection.layer=selectionLayer,invalidate()}),[effect,invalidate,selectionLayer]),(0,react.useEffect)((()=>{if(lights&&lights.length>0)return lights.forEach((light=>((light,effect)=>light.layers.enable(effect.selection.layer))(resolveRef(light),effect))),invalidate(),()=>{lights.forEach((light=>((light,effect)=>light.layers.disable(effect.selection.layer))(resolveRef(light),effect))),invalidate()}}),[effect,invalidate,lights,selectionLayer]),(0,react.useEffect)((()=>{var _a;if(api&&api.enabled&&(null==(_a=api.selected)?void 0:_a.length))return effect.selection.set(api.selected),invalidate(),()=>{effect.selection.clear(),invalidate()}}),[api,effect.selection,invalidate]),(0,jsx_runtime.jsx)("primitive",{ref:forwardRef2,object:effect,dispose:null})})),wrapEffect(build.wL),(0,react.forwardRef)((function SSAO2(props,ref){const{camera:camera,normalPass:normalPass,downSamplingPass:downSamplingPass,resolutionScale:resolutionScale}=(0,react.useContext)(EffectComposerContext),effect=(0,react.useMemo)((()=>null===normalPass&&null===downSamplingPass?(console.error("Please enable the NormalPass in the EffectComposer in order to use SSAO."),{}):new build.bn(camera,normalPass&&!downSamplingPass?normalPass.texture:null,{blendFunction:build.YQ.MULTIPLY,samples:30,rings:4,distanceThreshold:1,distanceFalloff:0,rangeThreshold:.5,rangeFalloff:.1,luminanceInfluence:.9,radius:20,bias:.5,intensity:1,color:void 0,normalDepthBuffer:downSamplingPass?downSamplingPass.texture:null,resolutionScale:null!=resolutionScale?resolutionScale:1,depthAwareUpsampling:!0,...props})),[camera,normalPass,props]);return(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})}))),Vignette=(wrapEffect(build.fY),wrapEffect(build.Ln),(0,react.forwardRef)((function Texture2({textureSrc:textureSrc,texture:texture,...props},ref){const t=(0,index_673ef987_esm.D)(three_module.TextureLoader,textureSrc);(0,react.useLayoutEffect)((()=>{t.encoding=three_module.sRGBEncoding,t.wrapS=t.wrapT=three_module.RepeatWrapping}),[t]);const effect=(0,react.useMemo)((()=>new build.tq({...props,texture:t||texture})),[props,t,texture]);return(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),wrapEffect(build.M4),wrapEffect(build.Dd)),TiltShiftShader=(wrapEffect(build.Uy),(0,react.forwardRef)((function LUT2({lut:lut,tetrahedralInterpolation:tetrahedralInterpolation,...props},ref){const effect=(0,react.useMemo)((()=>new build.CI(lut,props)),[lut,props]),invalidate=(0,index_673ef987_esm.z)((state=>state.invalidate));return(0,react.useLayoutEffect)((()=>{tetrahedralInterpolation&&(effect.tetrahedralInterpolation=tetrahedralInterpolation),lut&&(effect.lut=lut),invalidate()}),[effect,invalidate,lut,tetrahedralInterpolation]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,dispose:null})})),wrapEffect(build.$L,{blendFunction:build.YQ.ADD}),{fragmentShader:"\n\n // original shader by Evan Wallace\n\n #define MAX_ITERATIONS 100\n\n uniform float blur;\n uniform float taper;\n uniform vec2 start;\n uniform vec2 end;\n uniform vec2 direction;\n uniform int samples;\n\n float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n }\n\n void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) {\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 startPixel = vec2(start.x * resolution.x, start.y * resolution.y);\n vec2 endPixel = vec2(end.x * resolution.x, end.y * resolution.y);\n float f_samples = float(samples);\n float half_samples = f_samples / 2.0;\n\n // use screen diagonal to normalize blur radii\n float maxScreenDistance = distance(vec2(0.0), resolution); // diagonal distance\n float gradientRadius = taper * (maxScreenDistance);\n float blurRadius = blur * (maxScreenDistance / 16.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(startPixel.y - endPixel.y, endPixel.x - startPixel.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(uv * resolution - startPixel, normal)) / gradientRadius) * blurRadius;\n\n #pragma unroll_loop_start\n for (int i = 0; i <= MAX_ITERATIONS; i++) {\n if (i >= samples) { break; } // return early if over sample count\n float f_i = float(i);\n float s_i = -half_samples + f_i;\n float percent = (s_i + offset - 0.5) / half_samples;\n float weight = 1.0 - abs(percent);\n vec4 sample_i = texture2D(inputBuffer, uv + normalize(direction) / resolution * percent * radius);\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample_i.rgb *= sample_i.a;\n color += sample_i * weight;\n total += weight;\n }\n #pragma unroll_loop_end\n\n outputColor = color / total;\n\n /* switch back from pre-multiplied alpha */\n outputColor.rgb /= outputColor.a + 0.00001;\n }\n "});class TiltShiftEffect extends build.Qm{constructor({blendFunction:blendFunction=build.YQ.NORMAL,blur:blur=.15,taper:taper=.5,start:start=[.5,0],end:end=[.5,1],samples:samples=10,direction:direction=[1,1]}={}){super("TiltShiftEffect",TiltShiftShader.fragmentShader,{blendFunction:blendFunction,attributes:build.VB.CONVOLUTION,uniforms:new Map([["blur",new three_module.Uniform(blur)],["taper",new three_module.Uniform(taper)],["start",new three_module.Uniform(start)],["end",new three_module.Uniform(end)],["samples",new three_module.Uniform(samples)],["direction",new three_module.Uniform(direction)]])})}}wrapEffect(TiltShiftEffect,{blendFunction:build.YQ.NORMAL});class ASCIIEffect extends build.Qm{constructor({characters:characters=" .:,'-^=*+?!|0#X%WM@",fontSize:fontSize=54,cellSize:cellSize=16,color:color="#ffffff",invert:invert=!1}={}){super("ASCIIEffect","\nuniform sampler2D uCharacters;\nuniform float uCharactersCount;\nuniform float uCellSize;\nuniform bool uInvert;\nuniform vec3 uColor;\n\nconst vec2 SIZE = vec2(16.);\n\nvec3 greyscale(vec3 color, float strength) {\n float g = dot(color, vec3(0.299, 0.587, 0.114));\n return mix(color, vec3(g), strength);\n}\n\nvec3 greyscale(vec3 color) {\n return greyscale(color, 1.0);\n}\n\nvoid mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) {\n vec2 cell = resolution / uCellSize;\n vec2 grid = 1.0 / cell;\n vec2 pixelizedUV = grid * (0.5 + floor(uv / grid));\n vec4 pixelized = texture2D(inputBuffer, pixelizedUV);\n float greyscaled = greyscale(pixelized.rgb).r;\n\n if (uInvert) {\n greyscaled = 1.0 - greyscaled;\n }\n\n float characterIndex = floor((uCharactersCount - 1.0) * greyscaled);\n vec2 characterPosition = vec2(mod(characterIndex, SIZE.x), floor(characterIndex / SIZE.y));\n vec2 offset = vec2(characterPosition.x, -characterPosition.y) / SIZE;\n vec2 charUV = mod(uv * (cell / SIZE), 1.0 / SIZE) - vec2(0., 1.0 / SIZE) + offset;\n vec4 asciiCharacter = texture2D(uCharacters, charUV);\n\n asciiCharacter.rgb = uColor * asciiCharacter.r;\n asciiCharacter.a = pixelized.a;\n outputColor = asciiCharacter;\n}\n",{uniforms:new Map([["uCharacters",new three_module.Uniform(new three_module.Texture)],["uCellSize",new three_module.Uniform(cellSize)],["uCharactersCount",new three_module.Uniform(characters.length)],["uColor",new three_module.Uniform(new three_module.Color(color))],["uInvert",new three_module.Uniform(invert)]])});const charactersTextureUniform=this.uniforms.get("uCharacters");charactersTextureUniform&&(charactersTextureUniform.value=this.createCharactersTexture(characters,fontSize))}createCharactersTexture(characters,fontSize){const canvas=document.createElement("canvas");canvas.width=canvas.height=1024;const texture=new three_module.CanvasTexture(canvas,void 0,three_module.RepeatWrapping,three_module.RepeatWrapping,three_module.NearestFilter,three_module.NearestFilter),context=canvas.getContext("2d");if(!context)throw new Error("Context not available");context.clearRect(0,0,1024,1024),context.font=`${fontSize}px arial`,context.textAlign="center",context.textBaseline="middle",context.fillStyle="#fff";for(let i2=0;i2{const effect=(0,react.useMemo)((()=>new ASCIIEffect({characters:characters,fontSize:fontSize,cellSize:cellSize,color:color,invert:invert})),[characters,fontSize,cellSize,color,invert]);return(0,jsx_runtime.jsx)("primitive",{ref:fref,object:effect})}));var helperFunctions="#define GLSLIFY 1\nvec3 getViewPosition(const float depth){float clipW=_projectionMatrix[2][3]*depth+_projectionMatrix[3][3];vec4 clipPosition=vec4((vec3(vUv,depth)-0.5)*2.0,1.0);clipPosition*=clipW;return(_inverseProjectionMatrix*clipPosition).xyz;}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 screenSpaceToWorldSpace(const vec2 uv,const float depth){vec4 ndc=vec4((uv.x-0.5)*2.0,(uv.y-0.5)*2.0,(depth-0.5)*2.0,1.0);vec4 clip=_inverseProjectionMatrix*ndc;vec4 view=cameraMatrixWorld*(clip/clip.w);return view.xyz;}\n#define Scale (vec3(0.8, 0.8, 0.8))\n#define K (19.19)\nvec3 hash(vec3 a){a=fract(a*Scale);a+=dot(a,a.yxz+K);return fract((a.xxy+a.yxx)*a.zyx);}float fresnel_dielectric_cos(float cosi,float eta){float c=abs(cosi);float g=eta*eta-1.0+c*c;float result;if(g>0.0){g=sqrt(g);float A=(g-c)/(g+c);float B=(c*(g+c)-1.0)/(c*(g-c)+1.0);result=0.5*A*A*(1.0+B*B);}else{result=1.0;}return result;}float fresnel_dielectric(vec3 Incoming,vec3 Normal,float eta){float cosine=dot(Incoming,Normal);return min(1.0,5.0*fresnel_dielectric_cos(cosine,eta));}";class MRTMaterial extends three_module.ShaderMaterial{constructor(){super({type:"MRTMaterial",defines:{USE_UV:"",TEMPORAL_RESOLVE:""},uniforms:{opacity:new three_module.Uniform(1),normalMap:new three_module.Uniform(null),normalScale:new three_module.Uniform(new three_module.Vector2(1,1)),uvTransform:new three_module.Uniform(new three_module.Matrix3),roughness:new three_module.Uniform(1),roughnessMap:new three_module.Uniform(null)},vertexShader:`\n #ifdef USE_MRT\n varying vec2 vHighPrecisionZW;\n #endif\n #define NORMAL\n #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #ifdef USE_UV\n ${three_module.REVISION.replace(/\D+/g,"")>=151?"uniform mat3 uvTransform;":""}\n #endif\n void main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n vViewPosition = - mvPosition.xyz;\n #endif\n #ifdef USE_MRT\n vHighPrecisionZW = gl_Position.zw;\n #endif\n #ifdef USE_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n }\n `,fragmentShader:"\n #define NORMAL\n #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n\n #ifdef USE_MRT\n layout(location = 0) out vec4 gNormal;\n layout(location = 1) out vec4 gDepth;\n\n varying vec2 vHighPrecisionZW;\n #endif\n uniform float roughness;\n void main() {\n #include \n #include \n #include \n #include \n\n float roughnessFactor = roughness;\n\n if(roughness > 10.0e9){\n roughnessFactor = 1.;\n }else{\n #ifdef useRoughnessMap\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n // reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n roughnessFactor *= texelRoughness.g;\n #endif\n }\n\n vec3 normalColor = packNormalToRGB( normal );\n #ifdef USE_MRT\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n vec4 depthColor = packDepthToRGBA( fragCoordZ );\n gNormal = vec4( normalColor, roughnessFactor );\n gDepth = depthColor;\n #else\n gl_FragColor = vec4(normalColor, roughnessFactor);\n #endif\n }\n ",toneMapped:!1}),this.normalMapType=three_module.TangentSpaceNormalMap,this.normalScale=new three_module.Vector2(1,1),Object.defineProperty(this,"glslVersion",{get(){return"USE_MRT"in this.defines?three_module.GLSL3:null},set(_){}})}}class ReflectionsMaterial extends three_module.ShaderMaterial{constructor(){super({type:"ReflectionsMaterial",uniforms:{inputTexture:new three_module.Uniform(null),accumulatedTexture:new three_module.Uniform(null),normalTexture:new three_module.Uniform(null),depthTexture:new three_module.Uniform(null),_projectionMatrix:new three_module.Uniform(new three_module.Matrix4),_inverseProjectionMatrix:new three_module.Uniform(new three_module.Matrix4),cameraMatrixWorld:new three_module.Uniform(new three_module.Matrix4),cameraNear:new three_module.Uniform(0),cameraFar:new three_module.Uniform(0),rayDistance:new three_module.Uniform(0),intensity:new three_module.Uniform(0),roughnessFade:new three_module.Uniform(0),fade:new three_module.Uniform(0),thickness:new three_module.Uniform(0),ior:new three_module.Uniform(0),maxDepthDifference:new three_module.Uniform(0),jitter:new three_module.Uniform(0),jitterRoughness:new three_module.Uniform(0),maxRoughness:new three_module.Uniform(0),samples:new three_module.Uniform(0),envMap:new three_module.Uniform(null),envMapPosition:new three_module.Uniform(new three_module.Vector3),envMapSize:new three_module.Uniform(new three_module.Vector3),viewMatrix:new three_module.Uniform(new three_module.Matrix4)},defines:{steps:20,refineSteps:5,CUBEUV_TEXEL_WIDTH:0,CUBEUV_TEXEL_HEIGHT:0,CUBEUV_MAX_MIP:0,vWorldPosition:"worldPos"},fragmentShader:"#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D inputTexture;uniform sampler2D accumulatedTexture;uniform sampler2D normalTexture;uniform sampler2D depthTexture;uniform sampler2D envMap;uniform mat4 _projectionMatrix;uniform mat4 _inverseProjectionMatrix;uniform mat4 cameraMatrixWorld;uniform float cameraNear;uniform float cameraFar;uniform float rayDistance;uniform float intensity;uniform float maxDepthDifference;uniform float roughnessFade;uniform float maxRoughness;uniform float fade;uniform float thickness;uniform float ior;uniform float samples;uniform float jitter;uniform float jitterRoughness;\n#define INVALID_RAY_COORDS vec2(-1.0);\n#define EARLY_OUT_COLOR vec4(0.0, 0.0, 0.0, 1.0)\n#define FLOAT_EPSILON 0.00001\nfloat nearMinusFar;float nearMulFar;float farMinusNear;\n#include \n#include \nvec2 RayMarch(vec3 dir,inout vec3 hitPos,inout float rayHitDepthDifference);vec2 BinarySearch(in vec3 dir,inout vec3 hitPos,inout float rayHitDepthDifference);float fastGetViewZ(const in float depth);vec3 getIBLRadiance(const in vec3 viewDir,const in vec3 normal,const in float roughness);void main(){vec4 depthTexel=textureLod(depthTexture,vUv,0.0);if(dot(depthTexel.rgb,depthTexel.rgb)1.0)jitterMix=1.0;jitt=mix(vec3(0.0),randomJitter*spread,jitterMix);}viewNormal+=jitt;float fresnelFactor=fresnel_dielectric(viewDir,viewNormal,ior);vec3 iblRadiance=getIBLRadiance(-viewDir,viewNormal,0.)*fresnelFactor;float lastFrameAlpha=textureLod(accumulatedTexture,vUv,0.0).a;if(roughness>maxRoughness||(roughness>1.0-FLOAT_EPSILON&&roughnessFade>1.0-FLOAT_EPSILON)){gl_FragColor=vec4(iblRadiance,lastFrameAlpha);return;}vec3 reflected=reflect(viewDir,viewNormal);vec3 rayDir=reflected*-viewPos.z;vec3 hitPos=viewPos;float rayHitDepthDifference;vec2 coords=RayMarch(rayDir,hitPos,rayHitDepthDifference);if(coords.x==-1.0){gl_FragColor=vec4(iblRadiance,lastFrameAlpha);return;}vec4 SSRTexel=textureLod(inputTexture,coords.xy,0.0);vec4 SSRTexelReflected=textureLod(accumulatedTexture,coords.xy,0.0);vec3 SSR=SSRTexel.rgb+SSRTexelReflected.rgb;float roughnessFactor=mix(specular,1.0,max(0.0,1.0-roughnessFade));vec2 coordsNDC=(coords.xy*2.0-1.0);float screenFade=0.1;float maxDimension=min(1.0,max(abs(coordsNDC.x),abs(coordsNDC.y)));float reflectionIntensity=1.0-(max(0.0,maxDimension-screenFade)/(1.0-screenFade));reflectionIntensity=max(0.,reflectionIntensity);vec3 finalSSR=mix(iblRadiance,SSR,reflectionIntensity)*roughnessFactor;if(fade!=0.0){vec3 hitWorldPos=screenSpaceToWorldSpace(coords,rayHitDepthDifference);float reflectionDistance=distance(hitWorldPos,worldPos)+1.0;float opacity=1.0/(reflectionDistance*fade*0.1);if(opacity>1.0)opacity=1.0;finalSSR*=opacity;}finalSSR*=fresnelFactor*intensity;finalSSR=min(vec3(1.0),finalSSR);float alpha=hitPos.z==1.0 ? 1.0 : SSRTexelReflected.a;alpha=min(lastFrameAlpha,alpha);gl_FragColor=vec4(finalSSR,alpha);}vec2 RayMarch(vec3 dir,inout vec3 hitPos,inout float rayHitDepthDifference){dir=normalize(dir);dir*=rayDistance/float(steps);float depth;vec4 projectedCoord;vec4 lastProjectedCoord;float unpackedDepth;vec4 depthTexel;for(int i=0;i1.0||projectedCoord.y<0.0||projectedCoord.y>1.0){return INVALID_RAY_COORDS;}\n#endif\ndepthTexel=textureLod(depthTexture,projectedCoord.xy,0.0);unpackedDepth=unpackRGBAToDepth(depthTexel);depth=fastGetViewZ(unpackedDepth);rayHitDepthDifference=depth-hitPos.z;if(rayHitDepthDifference>=0.0&&rayHitDepthDifference0.0){return INVALID_RAY_COORDS;}\n#endif\nlastProjectedCoord=projectedCoord;}hitPos.z=1.0;\n#ifndef missedRays\nreturn INVALID_RAY_COORDS;\n#endif\nrayHitDepthDifference=unpackedDepth;return projectedCoord.xy;}vec2 BinarySearch(in vec3 dir,inout vec3 hitPos,inout float rayHitDepthDifference){float depth;vec4 projectedCoord;vec2 lastMinProjectedCoordXY;float unpackedDepth;vec4 depthTexel;for(int i=0;i0.0){hitPos-=dir;}else{hitPos+=dir;}}if(dot(depthTexel.rgb,depthTexel.rgb)maxDepthDifference)return INVALID_RAY_COORDS;projectedCoord=_projectionMatrix*vec4(hitPos,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=projectedCoord.xy*0.5+0.5;rayHitDepthDifference=unpackedDepth;return projectedCoord.xy;}float fastGetViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn nearMulFar/(farMinusNear*depth-cameraFar);\n#else\nreturn depth*nearMinusFar-cameraNear;\n#endif\n}\n#include \n#include \nvec3 getIBLRadiance(const in vec3 viewDir,const in vec3 normal,const in float roughness){\n#if defined(ENVMAP_TYPE_CUBE_UV)\nvec3 reflectVec=reflect(-viewDir,normal);reflectVec=normalize(mix(reflectVec,normal,roughness*roughness));reflectVec=inverseTransformDirection(reflectVec,viewMatrix);vec4 envMapColor=textureCubeUV(envMap,reflectVec,roughness);return envMapColor.rgb*intensity;\n#else\nreturn vec3(0.0);\n#endif\n}".replace("#include ",helperFunctions),vertexShader:"#define GLSLIFY 1\nvarying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",toneMapped:!1,depthWrite:!1,depthTest:!1})}}const getVisibleChildren=object=>{const queue=[object],objects=[];for(;0!==queue.length;){const mesh=queue.shift();mesh.material&&objects.push(mesh);for(const c of mesh.children)c.visible&&queue.push(c)}return objects},setupEnvMap=(reflectionsMaterial,envMap,envMapCubeUVHeight)=>{reflectionsMaterial.uniforms.envMap.value=envMap;const envMapCubeUVSize=(parameters=>{const imageHeight=parameters.envMapCubeUVHeight;if(null===imageHeight)return null;const maxMip=Math.log2(imageHeight)-2,texelHeight=1/imageHeight;return{texelWidth:1/(3*Math.max(Math.pow(2,maxMip),112)),texelHeight:texelHeight,maxMip:maxMip}})({envMapCubeUVHeight:envMapCubeUVHeight});reflectionsMaterial.defines.ENVMAP_TYPE_CUBE_UV="",reflectionsMaterial.defines.CUBEUV_TEXEL_WIDTH=envMapCubeUVSize.texelWidth,reflectionsMaterial.defines.CUBEUV_TEXEL_HEIGHT=envMapCubeUVSize.texelHeight,reflectionsMaterial.defines.CUBEUV_MAX_MIP=envMapCubeUVSize.maxMip+".0",reflectionsMaterial.needsUpdate=!0};class ReflectionsPass extends build.w2{constructor(ssrEffect,options={}){super("ReflectionsPass"),this.ssrEffect=void 0,this.cachedMaterials=new WeakMap,this.USE_MRT=!1,this.webgl1DepthPass=null,this.visibleMeshes=[],this.ssrEffect=ssrEffect,this._scene=ssrEffect._scene,this._camera=ssrEffect._camera,this.fullscreenMaterial=new ReflectionsMaterial,ssrEffect._camera.isPerspectiveCamera&&(this.fullscreenMaterial.defines.PERSPECTIVE_CAMERA="");const width=options.width||"undefined"!=typeof window?window.innerWidth:2e3,height=options.height||"undefined"!=typeof window?window.innerHeight:1e3;this.renderTarget=new three_module.WebGLRenderTarget(width,height,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,type:three_module.HalfFloatType,depthBuffer:!1}),this.renderPass=new build.CD(this._scene,this._camera),this.USE_MRT=(()=>{try{const canvas=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!canvas.getContext("webgl2"))}catch(e){return!1}})(),this.USE_MRT?(this.gBuffersRenderTarget=new three_module.WebGLMultipleRenderTargets(width,height,2,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter}),this.normalTexture=this.gBuffersRenderTarget.texture[0],this.depthTexture=this.gBuffersRenderTarget.texture[1]):(this.webgl1DepthPass=new build.Dv(this._scene,this._camera),this.webgl1DepthPass.renderTarget.minFilter=three_module.LinearFilter,this.webgl1DepthPass.renderTarget.magFilter=three_module.LinearFilter,this.webgl1DepthPass.renderTarget.texture.minFilter=three_module.LinearFilter,this.webgl1DepthPass.renderTarget.texture.magFilter=three_module.LinearFilter,this.webgl1DepthPass.setSize("undefined"!=typeof window?window.innerWidth:2e3,"undefined"!=typeof window?window.innerHeight:1e3),this.gBuffersRenderTarget=new three_module.WebGLRenderTarget(width,height,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter}),this.normalTexture=this.gBuffersRenderTarget.texture,this.depthTexture=this.webgl1DepthPass.texture),this.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,this.fullscreenMaterial.uniforms.depthTexture.value=this.depthTexture,this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.ssrEffect.temporalResolvePass.accumulatedTexture,this.fullscreenMaterial.uniforms.cameraMatrixWorld.value=this._camera.matrixWorld,this.fullscreenMaterial.uniforms._projectionMatrix.value=this._camera.projectionMatrix,this.fullscreenMaterial.uniforms._inverseProjectionMatrix.value=this._camera.projectionMatrixInverse}setSize(width,height){this.renderTarget.setSize(width*this.ssrEffect.resolutionScale,height*this.ssrEffect.resolutionScale),this.gBuffersRenderTarget.setSize(width*this.ssrEffect.resolutionScale,height*this.ssrEffect.resolutionScale),this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.ssrEffect.temporalResolvePass.accumulatedTexture,this.fullscreenMaterial.needsUpdate=!0}dispose(){this.renderTarget.dispose(),this.gBuffersRenderTarget.dispose(),this.renderPass.dispose(),this.USE_MRT||this.webgl1DepthPass.dispose(),this.fullscreenMaterial.dispose(),this.normalTexture=null,this.depthTexture=null,this.velocityTexture=null}keepMaterialMapUpdated(mrtMaterial,originalMaterial,prop,define){this.ssrEffect[define]?originalMaterial[prop]!==mrtMaterial[prop]&&(mrtMaterial[prop]=originalMaterial[prop],mrtMaterial.uniforms[prop].value=originalMaterial[prop],originalMaterial[prop]?mrtMaterial.defines[define]="":delete mrtMaterial.defines[define],mrtMaterial.needsUpdate=!0):void 0!==mrtMaterial[prop]&&(mrtMaterial[prop]=void 0,mrtMaterial.uniforms[prop].value=void 0,delete mrtMaterial.defines[define],mrtMaterial.needsUpdate=!0)}setMRTMaterialInScene(){this.visibleMeshes=getVisibleChildren(this._scene);for(const c of this.visibleMeshes)if(c.material){const originalMaterial=c.material;let[cachedOriginalMaterial,mrtMaterial]=this.cachedMaterials.get(c)||[];if(originalMaterial!==cachedOriginalMaterial){mrtMaterial&&mrtMaterial.dispose(),mrtMaterial=new MRTMaterial,this.USE_MRT&&(mrtMaterial.defines.USE_MRT=""),mrtMaterial.normalScale=originalMaterial.normalScale,mrtMaterial.uniforms.normalScale.value=originalMaterial.normalScale;const map=originalMaterial.map||originalMaterial.normalMap||originalMaterial.roughnessMap||originalMaterial.metalnessMap;map&&(mrtMaterial.uniforms.uvTransform.value=map.matrix),this.cachedMaterials.set(c,[originalMaterial,mrtMaterial])}this.keepMaterialMapUpdated(mrtMaterial,originalMaterial,"normalMap","useNormalMap"),this.keepMaterialMapUpdated(mrtMaterial,originalMaterial,"roughnessMap","useRoughnessMap"),mrtMaterial.uniforms.roughness.value=0===this.ssrEffect.selection.size||this.ssrEffect.selection.has(c)?originalMaterial.roughness||0:1e11,c.material=mrtMaterial}}unsetMRTMaterialInScene(){for(const c of this.visibleMeshes){var _c$material;if("MRTMaterial"===(null==(_c$material=c.material)?void 0:_c$material.type)){c.visible=!0;const[originalMaterial]=this.cachedMaterials.get(c);c.material=originalMaterial}}}render(renderer,inputBuffer){this.setMRTMaterialInScene(),renderer.setRenderTarget(this.gBuffersRenderTarget),this.renderPass.render(renderer,this.gBuffersRenderTarget),this.unsetMRTMaterialInScene(),this.USE_MRT||this.webgl1DepthPass.renderPass.render(renderer,this.webgl1DepthPass.renderTarget),this.fullscreenMaterial.uniforms.inputTexture.value=inputBuffer.texture,this.fullscreenMaterial.uniforms.samples.value=this.ssrEffect.temporalResolvePass.samples,this.fullscreenMaterial.uniforms.cameraNear.value=this._camera.near,this.fullscreenMaterial.uniforms.cameraFar.value=this._camera.far,this.fullscreenMaterial.uniforms.viewMatrix.value.copy(this._camera.matrixWorldInverse),renderer.setRenderTarget(this.renderTarget),renderer.render(this.scene,this.camera)}}const defaultSSROptions={intensity:1,exponent:1,distance:10,fade:0,roughnessFade:1,thickness:10,ior:1.45,maxRoughness:1,maxDepthDifference:10,blend:.9,correction:1,correctionRadius:1,blur:.5,blurKernel:1,blurSharpness:10,jitter:0,jitterRoughness:0,steps:20,refineSteps:5,missedRays:!0,useNormalMap:!0,useRoughnessMap:!0,resolutionScale:1,velocityResolutionScale:1};class TemporalResolveMaterial extends three_module.ShaderMaterial{constructor(customComposeShader){const fragmentShader2="#define GLSLIFY 1\nuniform sampler2D inputTexture;uniform sampler2D accumulatedTexture;uniform sampler2D velocityTexture;uniform sampler2D lastVelocityTexture;uniform float blend;uniform float correction;uniform float exponent;uniform float samples;uniform vec2 invTexSize;uniform mat4 curInverseProjectionMatrix;uniform mat4 curCameraMatrixWorld;uniform mat4 prevInverseProjectionMatrix;uniform mat4 prevCameraMatrixWorld;varying vec2 vUv;\n#define MAX_NEIGHBOR_DEPTH_DIFFERENCE 0.001\n#define FLOAT_EPSILON 0.00001\n#define FLOAT_ONE_MINUS_EPSILON 0.99999\nvec3 transformexponent;vec3 undoColorTransformExponent;vec3 transformColor(vec3 color){if(exponent==1.0)return color;return pow(abs(color),transformexponent);}vec3 undoColorTransform(vec3 color){if(exponent==1.0)return color;return max(pow(abs(color),undoColorTransformExponent),vec3(0.0));}void main(){if(exponent!=1.0){transformexponent=vec3(1.0/exponent);undoColorTransformExponent=vec3(exponent);}vec4 inputTexel=textureLod(inputTexture,vUv,0.0);vec4 accumulatedTexel;vec3 inputColor=transformColor(inputTexel.rgb);vec3 accumulatedColor;float alpha=inputTexel.a;float velocityDisocclusion;bool didReproject=false;\n#ifdef boxBlur\nvec3 boxBlurredColor=inputTexel.rgb;\n#endif\nvec4 velocity=textureLod(velocityTexture,vUv,0.0);bool isMoving=alpha<1.0||dot(velocity.xy,velocity.xy)>0.0;if(isMoving){vec3 minNeighborColor=inputColor;vec3 maxNeighborColor=inputColor;vec3 col;vec2 neighborUv;vec2 reprojectedUv=vUv-velocity.xy;vec4 lastVelocity=textureLod(lastVelocityTexture,reprojectedUv,0.0);float depth=velocity.b;float closestDepth=depth;float lastClosestDepth=lastVelocity.b;float neighborDepth;float lastNeighborDepth;for(int x=-correctionRadius;x<=correctionRadius;x++){for(int y=-correctionRadius;y<=correctionRadius;y++){if(x!=0||y!=0){neighborUv=vUv+vec2(x,y)*invTexSize;vec4 neigborVelocity=textureLod(velocityTexture,neighborUv,0.0);neighborDepth=neigborVelocity.b;col=textureLod(inputTexture,neighborUv,0.0).xyz;int absX=abs(x);int absY=abs(y);\n#ifdef dilation\nif(absX==1&&absY==1){if(neighborDepth>closestDepth){velocity=neigborVelocity;closestDepth=neighborDepth;}vec4 lastNeighborVelocity=textureLod(velocityTexture,vUv+vec2(x,y)*invTexSize,0.0);lastNeighborDepth=lastNeighborVelocity.b;if(neighborDepth>closestDepth){lastVelocity=lastNeighborVelocity;lastClosestDepth=lastNeighborDepth;}}\n#endif\nif(abs(depth-neighborDepth)5 ? 121.0 : pow(float(correctionRadius*2+1),2.0);boxBlurredColor/=pxRadius;boxBlurredColor=transformColor(boxBlurredColor);\n#endif\nif(reprojectedUv.x>=0.0&&reprojectedUv.x<=1.0&&reprojectedUv.y>=0.0&&reprojectedUv.y<=1.0){accumulatedTexel=textureLod(accumulatedTexture,reprojectedUv,0.0);accumulatedColor=transformColor(accumulatedTexel.rgb);vec3 clampedColor=clamp(accumulatedColor,minNeighborColor,maxNeighborColor);accumulatedColor=mix(accumulatedColor,clampedColor,correction);didReproject=true;}else{\n#ifdef boxBlur\naccumulatedColor=boxBlurredColor;\n#else\naccumulatedColor=inputColor;\n#endif\n}if(velocity.r>FLOAT_ONE_MINUS_EPSILON&&velocity.g>FLOAT_ONE_MINUS_EPSILON){alpha=0.0;velocityDisocclusion=1.0;}}else{accumulatedColor=transformColor(textureLod(accumulatedTexture,vUv,0.0).rgb);}vec3 outputColor=inputColor;\n#include \ngl_FragColor=vec4(undoColorTransform(outputColor),alpha);}".replace("#include ",customComposeShader);super({type:"TemporalResolveMaterial",uniforms:{inputTexture:new three_module.Uniform(null),accumulatedTexture:new three_module.Uniform(null),velocityTexture:new three_module.Uniform(null),lastVelocityTexture:new three_module.Uniform(null),samples:new three_module.Uniform(1),blend:new three_module.Uniform(.5),correction:new three_module.Uniform(1),exponent:new three_module.Uniform(1),invTexSize:new three_module.Uniform(new three_module.Vector2)},defines:{correctionRadius:1},vertexShader:"#define GLSLIFY 1\nvarying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",fragmentShader:fragmentShader2})}}const velocity_vertex=`\n vec3 transformed;\n\n // Get the normal\n ${three_module.ShaderChunk.skinbase_vertex}\n ${three_module.ShaderChunk.beginnormal_vertex}\n ${three_module.ShaderChunk.skinnormal_vertex}\n ${three_module.ShaderChunk.defaultnormal_vertex}\n\n // Get the current vertex position\n transformed = vec3( position );\n ${three_module.ShaderChunk.skinning_vertex}\n newPosition = velocityMatrix * vec4( transformed, 1.0 );\n\n // Get the previous vertex position\n transformed = vec3( position );\n ${three_module.ShaderChunk.skinbase_vertex.replace(/mat4 /g,"").replace(/getBoneMatrix/g,"getPrevBoneMatrix")}\n ${three_module.ShaderChunk.skinning_vertex.replace(/vec4 /g,"")}\n prevPosition = prevVelocityMatrix * vec4( transformed, 1.0 );\n\n gl_Position = newPosition;\n`;class VelocityMaterial extends three_module.ShaderMaterial{constructor(){super({uniforms:{prevVelocityMatrix:{value:new three_module.Matrix4},velocityMatrix:{value:new three_module.Matrix4},prevBoneTexture:{value:null},interpolateGeometry:{value:0},intensity:{value:1},boneTexture:{value:null},alphaTest:{value:0},map:{value:null},alphaMap:{value:null},opacity:{value:1}},vertexShader:`\n #define MAX_BONES 1024\n\n ${three_module.ShaderChunk.skinning_pars_vertex}\n \n #ifdef USE_SKINNING\n #ifdef BONE_TEXTURE\n uniform sampler2D prevBoneTexture;\n mat4 getPrevBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureSize ) );\n float y = floor( j / float( boneTextureSize ) );\n float dx = 1.0 / float( boneTextureSize );\n float dy = 1.0 / float( boneTextureSize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( prevBoneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( prevBoneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( prevBoneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( prevBoneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 prevBoneMatrices[ MAX_BONES ];\n mat4 getPrevBoneMatrix( const in float i ) {\n mat4 bone = prevBoneMatrices[ int(i) ];\n return bone;\n }\n #endif\n #endif\n\n\n uniform mat4 velocityMatrix;\n uniform mat4 prevVelocityMatrix;\n uniform float interpolateGeometry;\n varying vec4 prevPosition;\n varying vec4 newPosition;\n varying vec2 vHighPrecisionZW;\n\n void main() {\n\n ${velocity_vertex}\n\n vHighPrecisionZW = gl_Position.zw;\n\n }`,fragmentShader:"\n uniform float intensity;\n varying vec4 prevPosition;\n varying vec4 newPosition;\n varying vec2 vHighPrecisionZW;\n\n void main() {\n #ifdef FULL_MOVEMENT\n gl_FragColor = vec4( 1., 1., 1. - gl_FragCoord.z, 0. );\n return;\n #endif\n\n vec2 pos0 = (prevPosition.xy / prevPosition.w) * 0.5 + 0.5;\n vec2 pos1 = (newPosition.xy / newPosition.w) * 0.5 + 0.5;\n\n vec2 vel = pos1 - pos0;\n\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n gl_FragColor = vec4( vel, 1. - fragCoordZ, 0. );\n\n }"}),this.isVelocityMaterial=!0}}const backgroundColor=new three_module.Color(0),updateProperties=["visible","wireframe","side"];class VelocityPass extends build.w2{constructor(scene,camera){var _window,_window2;super("VelocityPass"),this.cachedMaterials=new WeakMap,this.lastCameraTransform={position:new three_module.Vector3,quaternion:new three_module.Quaternion},this.visibleMeshes=[],this.renderedMeshesThisFrame=0,this.renderedMeshesLastFrame=0,this._scene=scene,this._camera=camera,this.renderTarget=new three_module.WebGLRenderTarget((null==(_window=window)?void 0:_window.innerWidth)||1e3,(null==(_window2=window)?void 0:_window2.innerHeight)||1e3,{type:three_module.HalfFloatType})}setVelocityMaterialInScene(){this.renderedMeshesThisFrame=0,this.visibleMeshes=getVisibleChildren(this._scene);for(const c of this.visibleMeshes){var _c$skeleton2;const originalMaterial=c.material;let[cachedOriginalMaterial,velocityMaterial]=this.cachedMaterials.get(c)||[];var _c$skeleton;if(originalMaterial!==cachedOriginalMaterial)velocityMaterial=new VelocityMaterial,velocityMaterial.lastMatrixWorld=new three_module.Matrix4,c.material=velocityMaterial,null!=(_c$skeleton=c.skeleton)&&_c$skeleton.boneTexture&&this.saveBoneTexture(c),this.cachedMaterials.set(c,[originalMaterial,velocityMaterial]);if(velocityMaterial.uniforms.velocityMatrix.value.multiplyMatrices(this._camera.projectionMatrix,c.modelViewMatrix),c.userData.needsUpdatedReflections||originalMaterial.map instanceof three_module.VideoTexture?("FULL_MOVEMENT"in velocityMaterial.defines||(velocityMaterial.needsUpdate=!0),velocityMaterial.defines.FULL_MOVEMENT=""):"FULL_MOVEMENT"in velocityMaterial.defines&&(delete velocityMaterial.defines.FULL_MOVEMENT,velocityMaterial.needsUpdate=!0),c.visible=this.cameraMovedThisFrame||!c.matrixWorld.equals(velocityMaterial.lastMatrixWorld)||c.skeleton||"FULL_MOVEMENT"in velocityMaterial.defines,c.material=velocityMaterial,c.visible){this.renderedMeshesThisFrame++;for(const prop of updateProperties)velocityMaterial[prop]=originalMaterial[prop];null!=(_c$skeleton2=c.skeleton)&&_c$skeleton2.boneTexture&&(velocityMaterial.defines.USE_SKINNING="",velocityMaterial.defines.BONE_TEXTURE="",velocityMaterial.uniforms.boneTexture.value=c.skeleton.boneTexture)}}}saveBoneTexture(object){let boneTexture=object.material.uniforms.prevBoneTexture.value;if(boneTexture&&boneTexture.image.width===object.skeleton.boneTexture.width)boneTexture=object.material.uniforms.prevBoneTexture.value,boneTexture.image.data.set(object.skeleton.boneTexture.image.data);else{var _boneTexture;null==(_boneTexture=boneTexture)||_boneTexture.dispose();const boneMatrices=object.skeleton.boneTexture.image.data.slice(),size=object.skeleton.boneTexture.image.width;boneTexture=new three_module.DataTexture(boneMatrices,size,size,three_module.RGBAFormat,three_module.FloatType),object.material.uniforms.prevBoneTexture.value=boneTexture,boneTexture.needsUpdate=!0}}unsetVelocityMaterialInScene(){for(const c of this.visibleMeshes){var _c$skeleton3;if(c.material.isVelocityMaterial)c.visible=!0,c.material.lastMatrixWorld.copy(c.matrixWorld),c.material.uniforms.prevVelocityMatrix.value.multiplyMatrices(this._camera.projectionMatrix,c.modelViewMatrix),null!=(_c$skeleton3=c.skeleton)&&_c$skeleton3.boneTexture&&this.saveBoneTexture(c),c.material=this.cachedMaterials.get(c)[0]}}setSize(width,height){this.renderTarget.setSize(width,height)}renderVelocity(renderer){if(renderer.setRenderTarget(this.renderTarget),this.renderedMeshesThisFrame>0){const{background:background}=this._scene;this._scene.background=backgroundColor,renderer.render(this._scene,this._camera),this._scene.background=background}else renderer.clearColor()}checkCameraMoved(){const moveDist=this.lastCameraTransform.position.distanceToSquared(this._camera.position),rotateDist=8*(1-this.lastCameraTransform.quaternion.dot(this._camera.quaternion));return(moveDist>1e-6||rotateDist>1e-6)&&(this.lastCameraTransform.position.copy(this._camera.position),this.lastCameraTransform.quaternion.copy(this._camera.quaternion),!0)}render(renderer){this.cameraMovedThisFrame=this.checkCameraMoved(),this.setVelocityMaterialInScene(),(this.renderedMeshesThisFrame>0||this.renderedMeshesLastFrame>0)&&this.renderVelocity(renderer),this.unsetVelocityMaterialInScene(),this.renderedMeshesLastFrame=this.renderedMeshesThisFrame}}const zeroVec2=new three_module.Vector2;class TemporalResolvePass extends build.w2{constructor(scene,camera,customComposeShader,options={}){super("TemporalResolvePass"),this.velocityPass=null,this.velocityResolutionScale=1,this.samples=1,this.lastCameraTransform={position:new three_module.Vector3,quaternion:new three_module.Quaternion},this._scene=scene,this._camera=camera,this.renderTarget=new three_module.WebGLRenderTarget(1,1,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,type:three_module.HalfFloatType,depthBuffer:!1}),this.velocityPass=new VelocityPass(scene,camera),this.fullscreenMaterial=new TemporalResolveMaterial(customComposeShader),this.fullscreenMaterial.defines.correctionRadius=options.correctionRadius||1,options.dilation&&(this.fullscreenMaterial.defines.dilation=""),options.boxBlur&&(this.fullscreenMaterial.defines.boxBlur=""),this.setupFramebuffers(1,1),this.checkCanUseSharedVelocityTexture()}dispose(){this._scene.userData.velocityTexture===this.velocityPass.renderTarget.texture&&(delete this._scene.userData.velocityTexture,delete this._scene.userData.lastVelocityTexture),this.renderTarget.dispose(),this.accumulatedTexture.dispose(),this.fullscreenMaterial.dispose(),this.velocityPass.dispose()}setSize(width,height){this.renderTarget.setSize(width,height),this.velocityPass.setSize(width*this.velocityResolutionScale,height*this.velocityResolutionScale),this.velocityPass.renderTarget.texture.minFilter=1===this.velocityResolutionScale?three_module.NearestFilter:three_module.LinearFilter,this.velocityPass.renderTarget.texture.magFilter=1===this.velocityResolutionScale?three_module.NearestFilter:three_module.LinearFilter,this.velocityPass.renderTarget.texture.needsUpdate=!0,this.fullscreenMaterial.uniforms.invTexSize.value.set(1/width,1/height),this.setupFramebuffers(width,height)}setupFramebuffers(width,height){this.accumulatedTexture&&this.accumulatedTexture.dispose(),this.lastVelocityTexture&&this.lastVelocityTexture.dispose(),this.accumulatedTexture=new three_module.FramebufferTexture(width,height,three_module.RGBAFormat),this.accumulatedTexture.minFilter=three_module.LinearFilter,this.accumulatedTexture.magFilter=three_module.LinearFilter,this.accumulatedTexture.type=three_module.HalfFloatType,this.lastVelocityTexture=new three_module.FramebufferTexture(width*this.velocityResolutionScale,height*this.velocityResolutionScale,three_module.RGBAFormat),this.lastVelocityTexture.minFilter=1===this.velocityResolutionScale?three_module.NearestFilter:three_module.LinearFilter,this.lastVelocityTexture.magFilter=1===this.velocityResolutionScale?three_module.NearestFilter:three_module.LinearFilter,this.lastVelocityTexture.type=three_module.HalfFloatType,this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.accumulatedTexture,this.fullscreenMaterial.uniforms.lastVelocityTexture.value=this.lastVelocityTexture,this.fullscreenMaterial.needsUpdate=!0}checkCanUseSharedVelocityTexture(){return this._scene.userData.velocityTexture&&this.velocityPass.renderTarget.texture!==this._scene.userData.velocityTexture?this.velocityPass.renderTarget.texture===this.fullscreenMaterial.uniforms.velocityTexture.value&&(this.fullscreenMaterial.uniforms.lastVelocityTexture.value=this._scene.userData.lastVelocityTexture,this.fullscreenMaterial.uniforms.velocityTexture.value=this._scene.userData.velocityTexture,this.fullscreenMaterial.needsUpdate=!0):this.velocityPass.renderTarget.texture!==this.fullscreenMaterial.uniforms.velocityTexture.value&&(this.fullscreenMaterial.uniforms.velocityTexture.value=this.velocityPass.renderTarget.texture,this.fullscreenMaterial.uniforms.lastVelocityTexture.value=this.lastVelocityTexture,this.fullscreenMaterial.needsUpdate=!0,this._scene.userData.velocityTexture||(this._scene.userData.velocityTexture=this.velocityPass.renderTarget.texture,this._scene.userData.lastVelocityTexture=this.lastVelocityTexture)),this.velocityPass.renderTarget.texture!==this.fullscreenMaterial.uniforms.velocityTexture.value}checkNeedsResample(){const moveDist=this.lastCameraTransform.position.distanceToSquared(this._camera.position),rotateDist=8*(1-this.lastCameraTransform.quaternion.dot(this._camera.quaternion));(moveDist>1e-6||rotateDist>1e-6)&&(this.samples=1,this.lastCameraTransform.position.copy(this._camera.position),this.lastCameraTransform.quaternion.copy(this._camera.quaternion))}render(renderer){this.samples++,this.checkNeedsResample(),this.fullscreenMaterial.uniforms.samples.value=this.samples,renderer.setRenderTarget(this.renderTarget),renderer.render(this.scene,this.camera),renderer.copyFramebufferToTexture(zeroVec2,this.accumulatedTexture),renderer.setRenderTarget(this.velocityPass.renderTarget),renderer.copyFramebufferToTexture(zeroVec2,this.lastVelocityTexture)}}const halton=function halton2(index,base){let fraction=1,result=0;for(;index>0;)fraction/=base,result+=fraction*(index%base),index=~~(index/base);return result};function escapeRegExp(string){return string.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const finalFragmentShader="#define GLSLIFY 1\n#define MODE_DEFAULT 0\n#define MODE_REFLECTIONS 1\n#define MODE_RAW_REFLECTION 2\n#define MODE_BLURRED_REFLECTIONS 3\n#define MODE_INPUT 4\n#define MODE_BLUR_MIX 5\n#define FLOAT_EPSILON 0.00001\nuniform sampler2D inputTexture;uniform sampler2D reflectionsTexture;uniform float samples;\n#include \nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 reflectionsTexel=texture2D(reflectionsTexture,vUv);ivec2 size=textureSize(reflectionsTexture,0);vec2 invTexSize=1./vec2(size.x,size.y);vec3 reflectionClr=reflectionsTexel.xyz;if(blur>FLOAT_EPSILON){vec3 blurredReflectionsColor=denoise(reflectionsTexel.rgb,reflectionsTexture,vUv,invTexSize,blur,blurSharpness,blurKernel);reflectionClr=mix(reflectionClr,blurredReflectionsColor.rgb,blur);}\n#if RENDER_MODE == MODE_DEFAULT\noutputColor=vec4(inputColor.rgb+reflectionClr,1.0);\n#endif\n#if RENDER_MODE == MODE_REFLECTIONS\noutputColor=vec4(reflectionClr,1.0);\n#endif\n#if RENDER_MODE == MODE_RAW_REFLECTION\noutputColor=vec4(reflectionsTexel.xyz,1.0);\n#endif\n#if RENDER_MODE == MODE_BLURRED_REFLECTIONS\noutputColor=vec4(blurredReflectionsTexel.xyz,1.0);\n#endif\n#if RENDER_MODE == MODE_INPUT\noutputColor=vec4(inputColor.xyz,1.0);\n#endif\n#if RENDER_MODE == MODE_BLUR_MIX\noutputColor=vec4(vec3(blur),1.0);\n#endif\n}".replace("#include ",helperFunctions).replace("#include ","#define GLSLIFY 1\nuniform float blur;uniform float blurSharpness;uniform int blurKernel;vec3 denoise(vec3 center,sampler2D tex,vec2 uv,vec2 invTexSize,float blur,float blurSharpness,int blurKernel){vec3 color;float total;vec3 col;float weight;for(int x=-blurKernel;x<=blurKernel;x++){for(int y=-blurKernel;y<=blurKernel;y++){col=textureLod(tex,uv+vec2(x,y)*invTexSize,0.).rgb;weight=1.0-abs(dot(col-center,vec3(0.25)));weight=pow(weight,blurSharpness);color+=col*weight;total+=weight;}}return color/total;}"),noResetSamplesProperties=["blur","blurSharpness","blurKernel"],defaultCubeRenderTarget=new three_module.WebGLCubeRenderTarget(1);let pmremGenerator;class SSREffect extends build.Qm{constructor(scene,camera,options=defaultSSROptions){super("SSREffect",finalFragmentShader,{type:"FinalSSRMaterial",uniforms:new Map([["reflectionsTexture",new three_module.Uniform(null)],["blur",new three_module.Uniform(0)],["blurSharpness",new three_module.Uniform(0)],["blurKernel",new three_module.Uniform(0)]]),defines:new Map([["RENDER_MODE","0"]])}),this.haltonSequence=(count=>{const data=[];let i2=1;const end=i2+count;for(;i20.5;\n#ifdef boxBlur\nif(needsBlur)inputColor=boxBlurredColor;\n#endif\nif(alpha==1.0){outputColor=accumulatedColor;}else{float m=mix(alpha,1.0,blend);if(needsBlur)m=0.0;outputColor=accumulatedColor*m+inputColor*(1.0-m);}",options),this.uniforms.get("reflectionsTexture").value=this.temporalResolvePass.renderTarget.texture,this.reflectionsPass=new ReflectionsPass(this,options),this.temporalResolvePass.fullscreenMaterial.uniforms.inputTexture.value=this.reflectionsPass.renderTarget.texture,this.lastSize={width:options.width,height:options.height,resolutionScale:options.resolutionScale,velocityResolutionScale:options.velocityResolutionScale},this.setSize(options.width,options.height),this.makeOptionsReactive(options)}makeOptionsReactive(options){let needsUpdate=!1;const reflectionPassFullscreenMaterialUniforms=this.reflectionsPass.fullscreenMaterial.uniforms,reflectionPassFullscreenMaterialUniformsKeys=Object.keys(reflectionPassFullscreenMaterialUniforms);for(const key of Object.keys(options))Object.defineProperty(this,key,{get(){return options[key]},set(value){if(options[key]!==value||!needsUpdate)switch(options[key]=value,noResetSamplesProperties.includes(key)||this.setSize(this.lastSize.width,this.lastSize.height,!0),key){case"resolutionScale":this.setSize(this.lastSize.width,this.lastSize.height);break;case"velocityResolutionScale":this.temporalResolvePass.velocityResolutionScale=value,this.setSize(this.lastSize.width,this.lastSize.height,!0);break;case"blur":this.uniforms.get("blur").value=value;break;case"blurSharpness":this.uniforms.get("blurSharpness").value=value;break;case"blurKernel":this.uniforms.get("blurKernel").value=value;break;case"steps":this.reflectionsPass.fullscreenMaterial.defines.steps=parseInt(value),this.reflectionsPass.fullscreenMaterial.needsUpdate=needsUpdate;break;case"refineSteps":this.reflectionsPass.fullscreenMaterial.defines.refineSteps=parseInt(value),this.reflectionsPass.fullscreenMaterial.needsUpdate=needsUpdate;break;case"missedRays":value?this.reflectionsPass.fullscreenMaterial.defines.missedRays="":delete this.reflectionsPass.fullscreenMaterial.defines.missedRays,this.reflectionsPass.fullscreenMaterial.needsUpdate=needsUpdate;break;case"correctionRadius":this.temporalResolvePass.fullscreenMaterial.defines.correctionRadius=Math.round(value),this.temporalResolvePass.fullscreenMaterial.needsUpdate=needsUpdate;break;case"blend":this.temporalResolvePass.fullscreenMaterial.uniforms.blend.value=value;break;case"correction":this.temporalResolvePass.fullscreenMaterial.uniforms.correction.value=value;break;case"exponent":this.temporalResolvePass.fullscreenMaterial.uniforms.exponent.value=value;break;case"distance":reflectionPassFullscreenMaterialUniforms.rayDistance.value=value;default:reflectionPassFullscreenMaterialUniformsKeys.includes(key)&&(reflectionPassFullscreenMaterialUniforms[key].value=value)}}}),this[key]=options[key];needsUpdate=!0}setSize(width,height,force=!1){(force||width!==this.lastSize.width||height!==this.lastSize.height||this.resolutionScale!==this.lastSize.resolutionScale||this.velocityResolutionScale!==this.lastSize.velocityResolutionScale)&&(this.temporalResolvePass.setSize(width,height),this.reflectionsPass.setSize(width,height),this.lastSize={width:width,height:height,resolutionScale:this.resolutionScale,velocityResolutionScale:this.velocityResolutionScale})}generateBoxProjectedEnvMapFallback(renderer,position=new three_module.Vector3,size=new three_module.Vector3,envMapSize=512){this.cubeCamera.renderTarget.dispose(),this.cubeCamera.renderTarget=new three_module.WebGLCubeRenderTarget(envMapSize),this.cubeCamera.position.copy(position),this.cubeCamera.updateMatrixWorld(),this.cubeCamera.update(renderer,this._scene),pmremGenerator||(pmremGenerator=new three_module.PMREMGenerator(renderer),pmremGenerator.compileCubemapShader());const envMap=pmremGenerator.fromCubemap(this.cubeCamera.renderTarget.texture).texture;envMap.minFilter=three_module.LinearFilter,envMap.magFilter=three_module.LinearFilter;const reflectionsMaterial=this.reflectionsPass.fullscreenMaterial;return function useBoxProjectedEnvMap(shader,envMapPosition,envMapSize){shader.defines.BOX_PROJECTED_ENV_MAP="",shader.uniforms.envMapPosition={value:envMapPosition},shader.uniforms.envMapSize={value:envMapSize};const line1=new RegExp(escapeRegExp("vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;").replaceAll(" ","\\s*"),"g"),line2=new RegExp(escapeRegExp("reflectVec = inverseTransformDirection ( reflectVec , viewMatrix ) ;").replaceAll(" ","\\s*"),"g");shader.vertexShader="varying vec3 vWorldPosition;\n"+shader.vertexShader.replace("#include ","\n#if defined( USE_ENVMAP ) || defined( ) || defined ( USE_SHADOWMAP )\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\n #ifdef BOX_PROJECTED_ENV_MAP\n vWorldPosition = worldPosition.xyz;\n #endif\n#endif\n"),shader.fragmentShader="\n#ifdef BOX_PROJECTED_ENV_MAP\n uniform vec3 envMapSize;\n uniform vec3 envMapPosition;\n varying vec3 vWorldPosition;\n\n vec3 parallaxCorrectNormal( vec3 v, vec3 cubeSize, vec3 cubePos ) {\n vec3 nDir = normalize( v );\n\n vec3 rbmax = ( .5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbmin = ( -.5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n\n vec3 rbminmax;\n\n rbminmax.x = ( nDir.x > 0. ) ? rbmax.x : rbmin.x;\n rbminmax.y = ( nDir.y > 0. ) ? rbmax.y : rbmin.y;\n rbminmax.z = ( nDir.z > 0. ) ? rbmax.z : rbmin.z;\n\n float correction = min( min( rbminmax.x, rbminmax.y ), rbminmax.z );\n vec3 boxIntersection = vWorldPosition + nDir * correction;\n\n return boxIntersection - cubePos;\n }\n#endif\n\n"+shader.fragmentShader.replace("#include ",three_module.ShaderChunk.envmap_physical_pars_fragment).replace(line1,"vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n \n#ifdef BOX_PROJECTED_ENV_MAP\n worldNormal = parallaxCorrectNormal( worldNormal, envMapSize, envMapPosition );\n#endif\n").replace(line2,"reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n \n#ifdef BOX_PROJECTED_ENV_MAP\n reflectVec = parallaxCorrectNormal( reflectVec, envMapSize, envMapPosition );\n#endif\n")}(reflectionsMaterial,position,size),reflectionsMaterial.fragmentShader=reflectionsMaterial.fragmentShader.replace("vec3 worldPos","worldPos").replace("varying vec3 vWorldPosition;","vec3 worldPos;"),reflectionsMaterial.uniforms.envMapPosition.value.copy(position),reflectionsMaterial.uniforms.envMapSize.value.copy(size),setupEnvMap(reflectionsMaterial,envMap,envMapSize),this.usingBoxProjectedEnvMap=!0,envMap}setIBLRadiance(iblRadiance,renderer){this._scene.traverse((c=>{if(c.material){var _renderer$properties$;const uniforms=null==(_renderer$properties$=renderer.properties.get(c.material))?void 0:_renderer$properties$.uniforms;uniforms&&"disableIBLRadiance"in uniforms&&(uniforms.disableIBLRadiance.value=iblRadiance)}}))}deleteBoxProjectedEnvMapFallback(){const reflectionsMaterial=this.reflectionsPass.fullscreenMaterial;reflectionsMaterial.uniforms.envMap.value=null,reflectionsMaterial.fragmentShader=reflectionsMaterial.fragmentShader.replace("worldPos = ","vec3 worldPos = "),delete reflectionsMaterial.defines.BOX_PROJECTED_ENV_MAP,reflectionsMaterial.needsUpdate=!0,this.usingBoxProjectedEnvMap=!1}dispose(){super.dispose(),this.reflectionsPass.dispose(),this.temporalResolvePass.dispose()}update(renderer,inputBuffer){if(!this.usingBoxProjectedEnvMap&&this._scene.environment){const reflectionsMaterial=this.reflectionsPass.fullscreenMaterial;let envMap=null;if(this._scene.traverse((c=>{if(!envMap&&c.material&&!c.material.envMap){const properties=renderer.properties.get(c.material);"envMap"in properties&&properties.envMap instanceof three_module.Texture&&(envMap=properties.envMap)}})),envMap){const envMapCubeUVHeight=this._scene.environment.image.height;setupEnvMap(reflectionsMaterial,envMap,envMapCubeUVHeight)}}this.haltonIndex=(this.haltonIndex+1)%this.haltonSequence.length;const[x,y]=this.haltonSequence[this.haltonIndex],{width:width,height:height}=this.lastSize;this.temporalResolvePass.velocityPass.render(renderer),this._camera.setViewOffset&&this._camera.setViewOffset(width,height,x,y,width,height),this.reflectionsPass.render(renderer,inputBuffer),this.temporalResolvePass.render(renderer),this._camera.clearViewOffset()}static patchDirectEnvIntensity(envMapIntensity=0){three_module.ShaderChunk.envmap_physical_pars_fragment=0===envMapIntensity?three_module.ShaderChunk.envmap_physical_pars_fragment.replace("vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {","vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { return vec3(0.0);"):three_module.ShaderChunk.envmap_physical_pars_fragment.replace("vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );","vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ) * "+envMapIntensity.toFixed(5)+";")}}(0,react.forwardRef)((function SSR2({ENABLE_BLUR:ENABLE_BLUR=!0,USE_MRT:USE_MRT=!0,...props},ref){const{invalidate:invalidate}=(0,index_673ef987_esm.z)(),{scene:scene,camera:camera}=(0,react.useContext)(EffectComposerContext),effect=(0,react.useMemo)((()=>new SSREffect(scene,camera,{ENABLE_BLUR:ENABLE_BLUR,USE_MRT:USE_MRT,...props})),[scene,camera,ENABLE_BLUR,USE_MRT,props]),api=(0,react.useContext)(selectionContext);return(0,react.useEffect)((()=>{var _a;if(api&&api.enabled&&(null==(_a=api.selected)?void 0:_a.length))return effect.selection.set(api.selected),invalidate(),()=>{effect.selection.clear(),invalidate()}}),[api]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect,...props})}));const $e4ca8dcb0218f846$var$_geometry=new three_module.BufferGeometry;$e4ca8dcb0218f846$var$_geometry.setAttribute("position",new three_module.BufferAttribute(new Float32Array([-1,-1,3,-1,-1,3]),2)),$e4ca8dcb0218f846$var$_geometry.setAttribute("uv",new three_module.BufferAttribute(new Float32Array([0,0,2,0,0,2]),2)),$e4ca8dcb0218f846$var$_geometry.boundingSphere=new three_module.Sphere,$e4ca8dcb0218f846$var$_geometry.computeBoundingSphere=function(){};const $e4ca8dcb0218f846$var$_camera=new three_module.OrthographicCamera;class $e4ca8dcb0218f846$export$dcd670d73db751f5{constructor(material){this._mesh=new three_module.Mesh($e4ca8dcb0218f846$var$_geometry,material),this._mesh.frustumCulled=!1}render(renderer){renderer.render(this._mesh,$e4ca8dcb0218f846$var$_camera)}get material(){return this._mesh.material}set material(value){this._mesh.material=value}dispose(){this._mesh.material.dispose(),this._mesh.geometry.dispose()}}const $1ed45968c1160c3c$export$c9b263b9a17dffd7={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},sceneNormal:{value:null},projMat:{value:new three_module.Matrix4},viewMat:{value:new three_module.Matrix4},projViewMat:{value:new three_module.Matrix4},projectionMatrixInv:{value:new three_module.Matrix4},viewMatrixInv:{value:new three_module.Matrix4},cameraPos:{value:new three_module.Vector3},resolution:{value:new three_module.Vector2},time:{value:0},samples:{value:[]},samplesR:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},logDepth:{value:!1},ortho:{value:!1},screenSpaceRadius:{value:!1}},vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1);\n}",fragmentShader:"\n #define SAMPLES 16\n #define FSAMPLES 16.0\nuniform sampler2D sceneDiffuse;\nuniform highp sampler2D sceneNormal;\nuniform highp sampler2D sceneDepth;\nuniform mat4 projectionMatrixInv;\nuniform mat4 viewMatrixInv;\nuniform mat4 projMat;\nuniform mat4 viewMat;\nuniform mat4 projViewMat;\nuniform vec3 cameraPos;\nuniform vec2 resolution;\nuniform float time;\nuniform vec3[SAMPLES] samples;\nuniform float[SAMPLES] samplesR;\nuniform float radius;\nuniform float distanceFalloff;\nuniform float near;\nuniform float far;\nuniform bool logDepth;\nuniform bool ortho;\nuniform bool screenSpaceRadius;\nuniform sampler2D bluenoise;\n varying vec2 vUv;\n highp float linearize_depth(highp float d, highp float zNear,highp float zFar)\n {\n return (zFar * zNear) / (zFar - d * (zFar - zNear));\n }\n highp float linearize_depth_ortho(highp float d, highp float nearZ, highp float farZ) {\n return nearZ + (farZ - nearZ) * d;\n }\n highp float linearize_depth_log(highp float d, highp float nearZ,highp float farZ) {\n float depth = pow(2.0, d * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n return ortho ? linearize_depth_ortho(\n linDepth,\n nearZ,\n farZ\n ) :linearize_depth(linDepth, nearZ, farZ);\n }\n\n vec3 getWorldPosLog(vec3 posS) {\n vec2 uv = posS.xy;\n float z = posS.z;\n float nearZ =near;\n float farZ = far;\n float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0;\n vec4 wpos = projectionMatrixInv * clipVec;\n return wpos.xyz / wpos.w;\n }\n vec3 getWorldPos(float depth, vec2 coord) {\n #ifdef LOGDEPTH\n return getWorldPosLog(vec3(coord, depth));\n #endif\n float z = depth * 2.0 - 1.0;\n vec4 clipSpacePosition = vec4(coord * 2.0 - 1.0, z, 1.0);\n vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition;\n // Perspective division\n vec4 worldSpacePosition = viewSpacePosition;\n worldSpacePosition.xyz /= worldSpacePosition.w;\n return worldSpacePosition.xyz;\n }\n\n vec3 computeNormal(vec3 worldPos, vec2 vUv) {\n ivec2 p = ivec2(vUv * resolution);\n float c0 = texelFetch(sceneDepth, p, 0).x;\n float l2 = texelFetch(sceneDepth, p - ivec2(2, 0), 0).x;\n float l1 = texelFetch(sceneDepth, p - ivec2(1, 0), 0).x;\n float r1 = texelFetch(sceneDepth, p + ivec2(1, 0), 0).x;\n float r2 = texelFetch(sceneDepth, p + ivec2(2, 0), 0).x;\n float b2 = texelFetch(sceneDepth, p - ivec2(0, 2), 0).x;\n float b1 = texelFetch(sceneDepth, p - ivec2(0, 1), 0).x;\n float t1 = texelFetch(sceneDepth, p + ivec2(0, 1), 0).x;\n float t2 = texelFetch(sceneDepth, p + ivec2(0, 2), 0).x;\n\n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n\n vec3 ce = getWorldPos(c0, vUv).xyz;\n\n vec3 dpdx = (dl < dr) ? ce - getWorldPos(l1, (vUv - vec2(1.0 / resolution.x, 0.0))).xyz\n : -ce + getWorldPos(r1, (vUv + vec2(1.0 / resolution.x, 0.0))).xyz;\n vec3 dpdy = (db < dt) ? ce - getWorldPos(b1, (vUv - vec2(0.0, 1.0 / resolution.y))).xyz\n : -ce + getWorldPos(t1, (vUv + vec2(0.0, 1.0 / resolution.y))).xyz;\n\n return normalize(cross(dpdx, dpdy));\n}\n\nvoid main() {\n vec4 diffuse = texture2D(sceneDiffuse, vUv);\n float depth = texture2D(sceneDepth, vUv).x;\n if (depth == 1.0) {\n gl_FragColor = vec4(vec3(1.0), 1.0);\n return;\n }\n vec3 worldPos = getWorldPos(depth, vUv);\n // vec3 normal = texture2D(sceneNormal, vUv).rgb;//computeNormal(worldPos, vUv);\n #ifdef HALFRES\n vec3 normal = texture2D(sceneNormal, vUv).rgb;\n #else\n vec3 normal = computeNormal(worldPos, vUv);\n #endif\n vec4 noise = texture2D(bluenoise, gl_FragCoord.xy / 128.0);\n vec3 randomVec = normalize(noise.rgb * 2.0 - 1.0);\n vec3 tangent = normalize(randomVec - normal * dot(randomVec, normal));\n vec3 bitangent = cross(normal, tangent);\n mat3 tbn = mat3(tangent, bitangent, normal);\n float occluded = 0.0;\n float totalWeight = 0.0;\n /* float radiusScreen = distance(\n worldPos,\n getWorldPos(depth, vUv + \n vec2(48.0, 0.0) / resolution)\n );/*vUv.x < 0.5 ? radius : min(distance(\n worldPos,\n getWorldPos(depth, vUv + \n vec2(100.0, 0.0) / resolution)\n ), radius);\n float distanceFalloffScreen = radiusScreen * 0.2;*/\n float radiusToUse = screenSpaceRadius ? distance(\n worldPos,\n getWorldPos(depth, vUv +\n vec2(radius, 0.0) / resolution)\n ) : radius;\n float distanceFalloffToUse =screenSpaceRadius ?\n radiusToUse * distanceFalloff\n : distanceFalloff;\n float bias = (0.1 / near) * fwidth(distance(worldPos, cameraPos)) / radiusToUse;\n for(float i = 0.0; i < FSAMPLES; i++) {\n vec3 sampleDirection = \n tbn * \n samples[int(i)];\n ;\n float moveAmt = samplesR[int(mod(i + noise.a * FSAMPLES, FSAMPLES))];\n vec3 samplePos = worldPos + radiusToUse * moveAmt * sampleDirection;\n vec4 offset = projMat * vec4(samplePos, 1.0);\n offset.xyz /= offset.w;\n offset.xyz = offset.xyz * 0.5 + 0.5;\n float sampleDepth = textureLod(sceneDepth, offset.xy, 0.0).x;\n /*float distSample = logDepth ? linearize_depth_log(sampleDepth, near, far) \n (ortho ? linearize_depth_ortho(sampleDepth, near, far) : linearize_depth(sampleDepth, near, far));*/\n #ifdef LOGDEPTH\n float distSample = linearize_depth_log(sampleDepth, near, far);\n #else\n float distSample = ortho ? linearize_depth_ortho(sampleDepth, near, far) : linearize_depth(sampleDepth, near, far);\n #endif\n float distWorld = ortho ? linearize_depth_ortho(offset.z, near, far) : linearize_depth(offset.z, near, far);\n float rangeCheck = smoothstep(0.0, 1.0, distanceFalloffToUse / (abs(distSample - distWorld)));\n vec2 diff = gl_FragCoord.xy - ( offset.xy * resolution);\n float weight = dot(sampleDirection, normal);\n occluded += rangeCheck * weight * \n (distSample + bias\n < distWorld ? 1.0 : 0.0) * (\n (dot(\n diff,\n diff\n \n ) < 1.0 || (sampleDepth == depth) || (\n offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0\n ) ? 0.0 : 1.0)\n );\n totalWeight += weight;\n }\n float occ = clamp(1.0 - occluded / totalWeight, 0.0, 1.0);\n gl_FragColor = vec4(0.5 + 0.5 * normal, occ);\n}"},$12b21d24d1192a04$export$a815acccbd2c9a49={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},tDiffuse:{value:null},projMat:{value:new three_module.Matrix4},viewMat:{value:new three_module.Matrix4},projectionMatrixInv:{value:new three_module.Matrix4},viewMatrixInv:{value:new three_module.Matrix4},cameraPos:{value:new three_module.Vector3},resolution:{value:new three_module.Vector2},color:{value:new three_module.Vector3(0,0,0)},blueNoise:{value:null},downsampledDepth:{value:null},time:{value:0},intensity:{value:10},renderMode:{value:0},gammaCorrection:{value:!1},logDepth:{value:!1},ortho:{value:!1},near:{value:.1},far:{value:1e3},screenSpaceRadius:{value:!1},radius:{value:0},distanceFalloff:{value:1},fog:{value:!1},fogExp:{value:!1},fogDensity:{value:0},fogNear:{value:1/0},fogFar:{value:1/0},colorMultiply:{value:!0}},vertexShader:"\n\t\tvarying vec2 vUv;\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = vec4(position, 1);\n\t\t}",fragmentShader:"\n\t\tuniform sampler2D sceneDiffuse;\n uniform highp sampler2D sceneDepth;\n uniform highp sampler2D downsampledDepth;\n uniform sampler2D tDiffuse;\n uniform sampler2D blueNoise;\n uniform vec2 resolution;\n uniform vec3 color;\n uniform mat4 projectionMatrixInv;\n uniform mat4 viewMatrixInv;\n uniform float intensity;\n uniform float renderMode;\n uniform float near;\n uniform float far;\n uniform bool gammaCorrection;\n uniform bool logDepth;\n uniform bool ortho;\n uniform bool screenSpaceRadius;\n uniform bool fog;\n uniform bool fogExp;\n uniform bool colorMultiply;\n uniform float fogDensity;\n uniform float fogNear;\n uniform float fogFar;\n uniform float radius;\n uniform float distanceFalloff;\n uniform vec3 cameraPos;\n varying vec2 vUv;\n highp float linearize_depth(highp float d, highp float zNear,highp float zFar)\n {\n return (zFar * zNear) / (zFar - d * (zFar - zNear));\n }\n highp float linearize_depth_ortho(highp float d, highp float nearZ, highp float farZ) {\n return nearZ + (farZ - nearZ) * d;\n }\n highp float linearize_depth_log(highp float d, highp float nearZ,highp float farZ) {\n float depth = pow(2.0, d * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n return ortho ? linearize_depth_ortho(\n linDepth,\n nearZ,\n farZ\n ) :linearize_depth(linDepth, nearZ, farZ);\n }\n vec3 getWorldPosLog(vec3 posS) {\n vec2 uv = posS.xy;\n float z = posS.z;\n float nearZ =near;\n float farZ = far;\n float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0;\n vec4 wpos = projectionMatrixInv * clipVec;\n return wpos.xyz / wpos.w;\n }\n vec3 getWorldPos(float depth, vec2 coord) {\n // if (logDepth) {\n #ifdef LOGDEPTH\n return getWorldPosLog(vec3(coord, depth));\n #endif\n // }\n float z = depth * 2.0 - 1.0;\n vec4 clipSpacePosition = vec4(coord * 2.0 - 1.0, z, 1.0);\n vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition;\n // Perspective division\n vec4 worldSpacePosition = viewSpacePosition;\n worldSpacePosition.xyz /= worldSpacePosition.w;\n return worldSpacePosition.xyz;\n }\n \n vec3 computeNormal(vec3 worldPos, vec2 vUv) {\n ivec2 p = ivec2(vUv * resolution);\n float c0 = texelFetch(sceneDepth, p, 0).x;\n float l2 = texelFetch(sceneDepth, p - ivec2(2, 0), 0).x;\n float l1 = texelFetch(sceneDepth, p - ivec2(1, 0), 0).x;\n float r1 = texelFetch(sceneDepth, p + ivec2(1, 0), 0).x;\n float r2 = texelFetch(sceneDepth, p + ivec2(2, 0), 0).x;\n float b2 = texelFetch(sceneDepth, p - ivec2(0, 2), 0).x;\n float b1 = texelFetch(sceneDepth, p - ivec2(0, 1), 0).x;\n float t1 = texelFetch(sceneDepth, p + ivec2(0, 1), 0).x;\n float t2 = texelFetch(sceneDepth, p + ivec2(0, 2), 0).x;\n \n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n \n vec3 ce = getWorldPos(c0, vUv).xyz;\n \n vec3 dpdx = (dl < dr) ? ce - getWorldPos(l1, (vUv - vec2(1.0 / resolution.x, 0.0))).xyz\n : -ce + getWorldPos(r1, (vUv + vec2(1.0 / resolution.x, 0.0))).xyz;\n vec3 dpdy = (db < dt) ? ce - getWorldPos(b1, (vUv - vec2(0.0, 1.0 / resolution.y))).xyz\n : -ce + getWorldPos(t1, (vUv + vec2(0.0, 1.0 / resolution.y))).xyz;\n \n return normalize(cross(dpdx, dpdy));\n }\n\n #include \n #include \n void main() {\n //vec4 texel = texture2D(tDiffuse, vUv);//vec3(0.0);\n vec4 sceneTexel = texture2D(sceneDiffuse, vUv);\n float depth = texture2D(\n sceneDepth,\n vUv\n ).x;\n #ifdef HALFRES \n vec4 texel;\n if (depth == 1.0) {\n texel = vec4(0.0, 0.0, 0.0, 1.0);\n } else {\n vec3 worldPos = getWorldPos(depth, vUv);\n vec3 normal = computeNormal(getWorldPos(depth, vUv), vUv);\n // vec4 texel = texture2D(tDiffuse, vUv);\n // Find closest depth;\n float totalWeight = 0.0;\n float radiusToUse = screenSpaceRadius ? distance(\n worldPos,\n getWorldPos(depth, vUv +\n vec2(radius, 0.0) / resolution)\n ) : radius;\n float distanceFalloffToUse =screenSpaceRadius ?\n radiusToUse * distanceFalloff\n : distanceFalloff;\n for(float x = -1.0; x <= 1.0; x++) {\n for(float y = -1.0; y <= 1.0; y++) {\n vec2 offset = vec2(x, y);\n ivec2 p = ivec2(\n (vUv * resolution * 0.5) + offset\n );\n vec2 pUv = vec2(p) / (resolution * 0.5);\n float sampleDepth = texelFetch(downsampledDepth,p, 0).x;\n vec4 sampleInfo = texelFetch(tDiffuse, p, 0);\n vec3 normalSample = sampleInfo.xyz * 2.0 - 1.0;\n vec3 worldPosSample = getWorldPos(sampleDepth, pUv);\n float tangentPlaneDist = abs(dot(worldPos - worldPosSample, normal));\n float rangeCheck = exp(-1.0 * tangentPlaneDist * (1.0 / distanceFalloffToUse)) * max(dot(normal, normalSample), 0.0);\n float weight = rangeCheck;\n totalWeight += weight;\n texel += sampleInfo * weight;\n }\n }\n if (totalWeight == 0.0) {\n texel = texture2D(tDiffuse, vUv);\n } else {\n texel /= totalWeight;\n }\n }\n #else\n vec4 texel = texture2D(tDiffuse, vUv);\n #endif\n\n \n float finalAo = pow(texel.a, intensity);\n float fogFactor;\n float fogDepth = distance(\n cameraPos,\n getWorldPos(depth, vUv)\n );\n if (fog) {\n if (fogExp) {\n fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n } else {\n fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n }\n }\n finalAo = mix(finalAo, 1.0, fogFactor);\n vec3 aoApplied = color * mix(vec3(1.0), sceneTexel.rgb, float(colorMultiply));\n if (renderMode == 0.0) {\n gl_FragColor = vec4( mix(sceneTexel.rgb, aoApplied, 1.0 - finalAo), sceneTexel.a);\n } else if (renderMode == 1.0) {\n gl_FragColor = vec4( mix(vec3(1.0), aoApplied, 1.0 - finalAo), sceneTexel.a);\n } else if (renderMode == 2.0) {\n gl_FragColor = vec4( sceneTexel.rgb, sceneTexel.a);\n } else if (renderMode == 3.0) {\n if (vUv.x < 0.5) {\n gl_FragColor = vec4( sceneTexel.rgb, sceneTexel.a);\n } else if (abs(vUv.x - 0.5) < 1.0 / resolution.x) {\n gl_FragColor = vec4(1.0);\n } else {\n gl_FragColor = vec4( mix(sceneTexel.rgb, aoApplied, 1.0 - finalAo), sceneTexel.a);\n }\n } else if (renderMode == 4.0) {\n if (vUv.x < 0.5) {\n gl_FragColor = vec4( sceneTexel.rgb, sceneTexel.a);\n } else if (abs(vUv.x - 0.5) < 1.0 / resolution.x) {\n gl_FragColor = vec4(1.0);\n } else {\n gl_FragColor = vec4( mix(vec3(1.0), aoApplied, 1.0 - finalAo), sceneTexel.a);\n }\n }\n #include \n if (gammaCorrection) {\n gl_FragColor = LinearTosRGB(gl_FragColor);\n }\n }\n "},$e52378cd0f5a973d$export$57856b59f317262e={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},tDiffuse:{value:null},projMat:{value:new three_module.Matrix4},viewMat:{value:new three_module.Matrix4},projectionMatrixInv:{value:new three_module.Matrix4},viewMatrixInv:{value:new three_module.Matrix4},cameraPos:{value:new three_module.Vector3},resolution:{value:new three_module.Vector2},time:{value:0},r:{value:5},blueNoise:{value:null},radius:{value:12},worldRadius:{value:5},index:{value:0},poissonDisk:{value:[]},distanceFalloff:{value:1},near:{value:.1},far:{value:1e3},logDepth:{value:!1},screenSpaceRadius:{value:!1}},vertexShader:"\n\t\tvarying vec2 vUv;\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = vec4(position, 1.0);\n\t\t}",fragmentShader:"\n\t\tuniform sampler2D sceneDiffuse;\n uniform highp sampler2D sceneDepth;\n uniform sampler2D tDiffuse;\n uniform sampler2D blueNoise;\n uniform mat4 projectionMatrixInv;\n uniform mat4 viewMatrixInv;\n uniform vec2 resolution;\n uniform float r;\n uniform float radius;\n uniform float worldRadius;\n uniform float index;\n uniform float near;\n uniform float far;\n uniform float distanceFalloff;\n uniform bool logDepth;\n uniform bool screenSpaceRadius;\n varying vec2 vUv;\n\n highp float linearize_depth(highp float d, highp float zNear,highp float zFar)\n {\n highp float z_n = 2.0 * d - 1.0;\n return 2.0 * zNear * zFar / (zFar + zNear - z_n * (zFar - zNear));\n }\n highp float linearize_depth_log(highp float d, highp float nearZ,highp float farZ) {\n float depth = pow(2.0, d * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n return linearize_depth(linDepth, nearZ, farZ);\n }\n highp float linearize_depth_ortho(highp float d, highp float nearZ, highp float farZ) {\n return nearZ + (farZ - nearZ) * d;\n }\n vec3 getWorldPosLog(vec3 posS) {\n vec2 uv = posS.xy;\n float z = posS.z;\n float nearZ =near;\n float farZ = far;\n float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0;\n vec4 wpos = projectionMatrixInv * clipVec;\n return wpos.xyz / wpos.w;\n }\n vec3 getWorldPos(float depth, vec2 coord) {\n #ifdef LOGDEPTH\n return getWorldPosLog(vec3(coord, depth));\n #endif\n \n float z = depth * 2.0 - 1.0;\n vec4 clipSpacePosition = vec4(coord * 2.0 - 1.0, z, 1.0);\n vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition;\n // Perspective division\n vec4 worldSpacePosition = viewSpacePosition;\n worldSpacePosition.xyz /= worldSpacePosition.w;\n return worldSpacePosition.xyz;\n }\n #include \n #define NUM_SAMPLES 16\n uniform vec2 poissonDisk[NUM_SAMPLES];\n void main() {\n const float pi = 3.14159;\n vec2 texelSize = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec2 uv = vUv;\n vec4 data = texture2D(tDiffuse, vUv);\n float occlusion = data.a;\n float baseOcc = data.a;\n vec3 normal = data.rgb * 2.0 - 1.0;\n float count = 1.0;\n float d = texture2D(sceneDepth, vUv).x;\n if (d == 1.0) {\n gl_FragColor = data;\n return;\n }\n vec3 worldPos = getWorldPos(d, vUv);\n float size = radius;\n float angle;\n if (index == 0.0) {\n angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).x * PI2;\n } else if (index == 1.0) {\n angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).y * PI2;\n } else if (index == 2.0) {\n angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).z * PI2;\n } else {\n angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).w * PI2;\n }\n\n mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n float radiusToUse = screenSpaceRadius ? distance(\n worldPos,\n getWorldPos(d, vUv +\n vec2(worldRadius, 0.0) / resolution)\n ) : worldRadius;\n float distanceFalloffToUse =screenSpaceRadius ?\n radiusToUse * distanceFalloff\n : distanceFalloff;\n\n\n for(int i = 0; i < NUM_SAMPLES; i++) {\n vec2 offset = (rotationMatrix * poissonDisk[i]) * texelSize * size;\n vec4 dataSample = texture2D(tDiffuse, uv + offset);\n float occSample = dataSample.a;\n vec3 normalSample = dataSample.rgb * 2.0 - 1.0;\n float dSample = texture2D(sceneDepth, uv + offset).x;\n vec3 worldPosSample = getWorldPos(dSample, uv + offset);\n float tangentPlaneDist = abs(dot(worldPos - worldPosSample, normal));\n float rangeCheck = dSample == 1.0 ? 0.0 :exp(-1.0 * tangentPlaneDist * (1.0 / distanceFalloffToUse)) * max(dot(normal, normalSample), 0.0) * (1.0 - abs(occSample - baseOcc));\n occlusion += occSample * rangeCheck;\n count += rangeCheck;\n }\n occlusion /= count;\n gl_FragColor = vec4(0.5 + 0.5 * normal, occlusion);\n }\n "},$26aca173e0984d99$export$1efdf491687cd442={uniforms:{sceneDepth:{value:null},resolution:{value:new three_module.Vector2},near:{value:.1},far:{value:1e3},viewMatrixInv:{value:new three_module.Matrix4},projectionMatrixInv:{value:new three_module.Matrix4},logDepth:{value:!1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4(position, 1);\n }",fragmentShader:"\n uniform highp sampler2D sceneDepth;\n uniform vec2 resolution;\n uniform float near;\n uniform float far;\n uniform bool logDepth;\n uniform mat4 viewMatrixInv;\n uniform mat4 projectionMatrixInv;\n varying vec2 vUv;\n layout(location = 1) out vec4 gNormal;\n vec3 getWorldPosLog(vec3 posS) {\n vec2 uv = posS.xy;\n float z = posS.z;\n float nearZ =near;\n float farZ = far;\n float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0;\n float a = farZ / (farZ - nearZ);\n float b = farZ * nearZ / (nearZ - farZ);\n float linDepth = a + b / depth;\n vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0;\n vec4 wpos = projectionMatrixInv * clipVec;\n return wpos.xyz / wpos.w;\n }\n vec3 getWorldPos(float depth, vec2 coord) {\n if (logDepth) {\n return getWorldPosLog(vec3(coord, depth));\n }\n float z = depth * 2.0 - 1.0;\n vec4 clipSpacePosition = vec4(coord * 2.0 - 1.0, z, 1.0);\n vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition;\n // Perspective division\n vec4 worldSpacePosition = viewSpacePosition;\n worldSpacePosition.xyz /= worldSpacePosition.w;\n return worldSpacePosition.xyz;\n }\n \n vec3 computeNormal(vec3 worldPos, vec2 vUv) {\n ivec2 p = ivec2(vUv * resolution);\n float c0 = texelFetch(sceneDepth, p, 0).x;\n float l2 = texelFetch(sceneDepth, p - ivec2(2, 0), 0).x;\n float l1 = texelFetch(sceneDepth, p - ivec2(1, 0), 0).x;\n float r1 = texelFetch(sceneDepth, p + ivec2(1, 0), 0).x;\n float r2 = texelFetch(sceneDepth, p + ivec2(2, 0), 0).x;\n float b2 = texelFetch(sceneDepth, p - ivec2(0, 2), 0).x;\n float b1 = texelFetch(sceneDepth, p - ivec2(0, 1), 0).x;\n float t1 = texelFetch(sceneDepth, p + ivec2(0, 1), 0).x;\n float t2 = texelFetch(sceneDepth, p + ivec2(0, 2), 0).x;\n \n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n \n vec3 ce = getWorldPos(c0, vUv).xyz;\n \n vec3 dpdx = (dl < dr) ? ce - getWorldPos(l1, (vUv - vec2(1.0 / resolution.x, 0.0))).xyz\n : -ce + getWorldPos(r1, (vUv + vec2(1.0 / resolution.x, 0.0))).xyz;\n vec3 dpdy = (db < dt) ? ce - getWorldPos(b1, (vUv - vec2(0.0, 1.0 / resolution.y))).xyz\n : -ce + getWorldPos(t1, (vUv + vec2(0.0, 1.0 / resolution.y))).xyz;\n \n return normalize(cross(dpdx, dpdy));\n }\n void main() {\n vec2 uv = vUv - vec2(0.5) / resolution;\n vec2 pixelSize = vec2(1.0) / resolution;\n vec2[] uvSamples = vec2[4](\n uv,\n uv + vec2(pixelSize.x, 0.0),\n uv + vec2(0.0, pixelSize.y),\n uv + pixelSize\n );\n float depth00 = texture2D(sceneDepth, uvSamples[0]).r;\n float depth10 = texture2D(sceneDepth, uvSamples[1]).r;\n float depth01 = texture2D(sceneDepth, uvSamples[2]).r;\n float depth11 = texture2D(sceneDepth, uvSamples[3]).r;\n float minDepth = min(min(depth00, depth10), min(depth01, depth11));\n float maxDepth = max(max(depth00, depth10), max(depth01, depth11));\n float targetDepth = minDepth;\n // Checkerboard pattern to avoid artifacts\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 2.0) > 0.5) { \n targetDepth = maxDepth;\n }\n int chosenIndex = 0;\n float[] samples = float[4](depth00, depth10, depth01, depth11);\n for(int i = 0; i < 4; ++i) {\n if (samples[i] == targetDepth) {\n chosenIndex = i;\n break;\n }\n }\n gl_FragColor = vec4(samples[chosenIndex], 0.0, 0.0, 1.0);\n gNormal = vec4(computeNormal(\n getWorldPos(samples[chosenIndex], uvSamples[chosenIndex]), uvSamples[chosenIndex]\n ), 0.0);\n /* float[] samples = float[4](depth00, depth10, depth01, depth11);\n float c = 0.25 * (depth00 + depth10 + depth01 + depth11);\n float[] distances = float[4](depth00, depth10, depth01, depth11);\n float maxDistance = max(max(distances[0], distances[1]), max(distances[2], distances[3]));\n\n int remaining[3];\n int rejected[3];\n int i, j, k;\n\n for(i = 0, j = 0, k = 0; i < 4; ++i) {\n if (distances[i] < maxDistance) {\n remaining[j++] = i;\n } else {\n rejected[k++] = i;\n }\n }\n for(;j < 3;++j) {\n remaining[j] = rejected[--k];\n }\n vec3 s = vec3(\n samples[remaining[0]],\n samples[remaining[1]],\n samples[remaining[2]]\n );\n c = (s.x + s.y + s.z) / 3.0;\n\n distances[0] = abs(c - s.x);\n distances[1] = abs(c - s.y);\n distances[2] = abs(c - s.z);\n\n float minDistance = min(min(distances[0], distances[1]), distances[2]);\n\n for(i = 0; i < 3; ++i) {\n if (distances[i] == minDistance) {\n break;\n }\n }*/\n /* gl_FragColor = vec4(samples[remaining[i]], 0.0, 0.0, 0.0);\n gNormal = vec4(computeNormal(\n getWorldPos(samples[remaining[i]], uvSamples[remaining[i]]), uvSamples[remaining[i]]\n ), 0.0);*/\n }"};var $06269ad78f3c5fdf$export$2e2bcd8739ae039="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";const $87431ee93b037844$var$bluenoiseBits=Uint8Array.from(atob($06269ad78f3c5fdf$export$2e2bcd8739ae039),(c=>c.charCodeAt(0)));function $87431ee93b037844$var$checkTimerQuery(timerQuery,gl,pass){if(gl.getQueryParameter(timerQuery,gl.QUERY_RESULT_AVAILABLE)){const elapsedTimeInMs=gl.getQueryParameter(timerQuery,gl.QUERY_RESULT)/1e6;pass.lastTime=elapsedTimeInMs}else setTimeout((()=>{$87431ee93b037844$var$checkTimerQuery(timerQuery,gl,pass)}),1)}class $87431ee93b037844$export$2489f9981ab0fa82 extends build.w2{constructor(scene,camera,width=512,height=512){super(),this.width=width,this.height=height,this.clear=!0,this.camera=camera,this.scene=scene,this.autosetGamma=!0,this.configuration=new Proxy({aoSamples:16,aoRadius:5,denoiseSamples:8,denoiseRadius:12,distanceFalloff:1,intensity:5,denoiseIterations:2,renderMode:0,color:new three_module.Color(0,0,0),gammaCorrection:!0,logarithmicDepthBuffer:!1,screenSpaceRadius:!1,halfRes:!1,depthAwareUpsampling:!0,colorMultiply:!0},{set:(target,propName,value)=>{const oldProp=target[propName];return target[propName]=value,"aoSamples"===propName&&oldProp!==value&&this.configureAOPass(this.configuration.logarithmicDepthBuffer),"denoiseSamples"===propName&&oldProp!==value&&this.configureDenoisePass(this.configuration.logarithmicDepthBuffer),"halfRes"===propName&&oldProp!==value&&(this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureHalfResTargets(),this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),this.setSize(this.width,this.height)),"depthAwareUpsampling"===propName&&oldProp!==value&&this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),"gammaCorrection"===propName&&(this.autosetGamma=!1),!0}}),this.samples=[],this.samplesR=[],this.samplesDenoise=[],this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),this.configureSampleDependentPasses(),this.configureHalfResTargets(),this.copyQuad=new $e4ca8dcb0218f846$export$dcd670d73db751f5(new three_module.ShaderMaterial({uniforms:{tDiffuse:{value:null}},depthWrite:!1,vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4(position, 1);\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n gl_FragColor = texture2D(tDiffuse, vUv);\n }\n "})),this.writeTargetInternal=new three_module.WebGLRenderTarget(this.width,this.height,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,depthBuffer:!1}),this.readTargetInternal=new three_module.WebGLRenderTarget(this.width,this.height,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,depthBuffer:!1}),this.outputTargetInternal=new three_module.WebGLRenderTarget(this.width,this.height,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,depthBuffer:!1}),this.bluenoise=new three_module.DataTexture($87431ee93b037844$var$bluenoiseBits,128,128),this.bluenoise.colorSpace=three_module.NoColorSpace,this.bluenoise.wrapS=three_module.RepeatWrapping,this.bluenoise.wrapT=three_module.RepeatWrapping,this.bluenoise.minFilter=three_module.NearestFilter,this.bluenoise.magFilter=three_module.NearestFilter,this.bluenoise.needsUpdate=!0,this.lastTime=0,this.needsDepthTexture=!0,this.needsSwap=!0,this._r=new three_module.Vector2,this._c=new three_module.Color}configureHalfResTargets(){this.configuration.halfRes?(this.depthDownsampleTarget=new three_module.WebGLMultipleRenderTargets(this.width/2,this.height/2,2),this.depthDownsampleTarget.texture[0].format=three_module.RedFormat,this.depthDownsampleTarget.texture[0].type=three_module.FloatType,this.depthDownsampleTarget.texture[0].minFilter=three_module.NearestFilter,this.depthDownsampleTarget.texture[0].magFilter=three_module.NearestFilter,this.depthDownsampleTarget.texture[0].depthBuffer=!1,this.depthDownsampleTarget.texture[1].format=three_module.RGBAFormat,this.depthDownsampleTarget.texture[1].type=three_module.HalfFloatType,this.depthDownsampleTarget.texture[1].minFilter=three_module.NearestFilter,this.depthDownsampleTarget.texture[1].magFilter=three_module.NearestFilter,this.depthDownsampleTarget.texture[1].depthBuffer=!1,this.depthDownsampleQuad=new $e4ca8dcb0218f846$export$dcd670d73db751f5(new three_module.ShaderMaterial($26aca173e0984d99$export$1efdf491687cd442))):(this.depthDownsampleTarget&&(this.depthDownsampleTarget.dispose(),this.depthDownsampleTarget=null),this.depthDownsampleQuad&&(this.depthDownsampleQuad.dispose(),this.depthDownsampleQuad=null))}configureSampleDependentPasses(){this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureDenoisePass(this.configuration.logarithmicDepthBuffer)}configureAOPass(logarithmicDepthBuffer=!1){this.samples=this.generateHemisphereSamples(this.configuration.aoSamples),this.samplesR=this.generateHemisphereSamplesR(this.configuration.aoSamples);const e={...$1ed45968c1160c3c$export$c9b263b9a17dffd7};e.fragmentShader=e.fragmentShader.replace("16",this.configuration.aoSamples).replace("16.0",this.configuration.aoSamples+".0"),logarithmicDepthBuffer&&(e.fragmentShader="#define LOGDEPTH\n"+e.fragmentShader),this.configuration.halfRes&&(e.fragmentShader="#define HALFRES\n"+e.fragmentShader),this.effectShaderQuad?(this.effectShaderQuad.material.dispose(),this.effectShaderQuad.material=new three_module.ShaderMaterial(e)):this.effectShaderQuad=new $e4ca8dcb0218f846$export$dcd670d73db751f5(new three_module.ShaderMaterial(e))}configureDenoisePass(logarithmicDepthBuffer=!1){this.samplesDenoise=this.generateDenoiseSamples(this.configuration.denoiseSamples,11);const p={...$e52378cd0f5a973d$export$57856b59f317262e};p.fragmentShader=p.fragmentShader.replace("16",this.configuration.denoiseSamples),logarithmicDepthBuffer&&(p.fragmentShader="#define LOGDEPTH\n"+p.fragmentShader),this.poissonBlurQuad?(this.poissonBlurQuad.material.dispose(),this.poissonBlurQuad.material=new three_module.ShaderMaterial(p)):this.poissonBlurQuad=new $e4ca8dcb0218f846$export$dcd670d73db751f5(new three_module.ShaderMaterial(p))}configureEffectCompositer(logarithmicDepthBuffer=!1){const e={...$12b21d24d1192a04$export$a815acccbd2c9a49};logarithmicDepthBuffer&&(e.fragmentShader="#define LOGDEPTH\n"+e.fragmentShader),this.configuration.halfRes&&this.configuration.depthAwareUpsampling&&(e.fragmentShader="#define HALFRES\n"+e.fragmentShader),this.effectCompositerQuad?(this.effectCompositerQuad.material.dispose(),this.effectCompositerQuad.material=new three_module.ShaderMaterial(e)):this.effectCompositerQuad=new $e4ca8dcb0218f846$export$dcd670d73db751f5(new three_module.ShaderMaterial(e))}generateHemisphereSamples(n){const points=[];for(let k=0;kc.charCodeAt(0)));(0,react.forwardRef)((({halfRes:halfRes,screenSpaceRadius:screenSpaceRadius,quality:quality,depthAwareUpsampling:depthAwareUpsampling=!0,aoRadius:aoRadius=5,aoSamples:aoSamples=16,denoiseSamples:denoiseSamples=4,denoiseRadius:denoiseRadius=12,distanceFalloff:distanceFalloff=1,intensity:intensity=1,color:color,renderMode:renderMode=0},ref)=>{const{camera:camera,scene:scene}=(0,index_673ef987_esm.z)(),effect=(0,react.useMemo)((()=>new $87431ee93b037844$export$2489f9981ab0fa82(scene,camera)),[]);return(0,react.useLayoutEffect)((()=>{(0,index_673ef987_esm.j)(effect.configuration,{color:color,aoRadius:aoRadius,distanceFalloff:distanceFalloff,intensity:intensity,aoSamples:aoSamples,denoiseSamples:denoiseSamples,denoiseRadius:denoiseRadius,screenSpaceRadius:screenSpaceRadius,renderMode:renderMode,halfRes:halfRes,depthAwareUpsampling:depthAwareUpsampling})}),[screenSpaceRadius,color,aoRadius,distanceFalloff,intensity,aoSamples,denoiseSamples,denoiseRadius,renderMode,halfRes,depthAwareUpsampling]),(0,react.useLayoutEffect)((()=>{quality&&effect.setQualityMode(quality.charAt(0).toUpperCase()+quality.slice(1))}),[quality]),(0,jsx_runtime.jsx)("primitive",{ref:ref,object:effect})}))},"./node_modules/postprocessing/build/index.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{$L:function(){return TiltShiftEffect},AL:function(){return DepthEffect},CD:function(){return RenderPass},CI:function(){return LUT3DEffect},DF:function(){return MaskFunction},DY:function(){return DepthPickingPass},Dd:function(){return VignetteEffect},Dv:function(){return DepthPass},H5:function(){return EffectPass},JL:function(){return HueSaturationEffect},Jy:function(){return DepthOfFieldEffect},KI:function(){return GodRaysEffect},KM:function(){return CopyPass},Ln:function(){return FXAAEffect},M4:function(){return ToneMappingEffect},Mn:function(){return OutlineEffect},O7:function(){return GlitchMode},Qg:function(){return PixelationEffect},Qm:function(){return Effect},Qt:function(){return GridEffect},TC:function(){return ColorAverageEffect},Uy:function(){return ShockWaveEffect},V$:function(){return SelectiveBloomEffect},VB:function(){return EffectAttribute},Y1:function(){return Selection},YQ:function(){return BlendFunction},YY:function(){return ChromaticAberrationEffect},at:function(){return BrightnessContrastEffect},bn:function(){return SSAOEffect},fY:function(){return SMAAEffect},gh:function(){return NormalPass},ol:function(){return DotScreenEffect},p$:function(){return ScanlineEffect},rk:function(){return BloomEffect},sy:function(){return GlitchEffect},tq:function(){return TextureEffect},w2:function(){return Pass},wL:function(){return SepiaEffect},xC:function(){return EffectComposer},xV:function(){return NoiseEffect},xs:function(){return DepthDownsamplingPass},zo:function(){return ColorDepthEffect}});var three__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/three/build/three.module.js"),common_default="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",AdaptiveLuminanceMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"AdaptiveLuminanceMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{luminanceBuffer0:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),luminanceBuffer1:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),minLuminance:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.01),deltaTime:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0),tau:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)},extensions:{shaderTextureLOD:!0},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\nuniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv));\n#if __VERSION__ < 300\nfloat l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;\n#else\nfloat l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;\n#endif\nl0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}",vertexShader:common_default})}set luminanceBuffer0(value){this.uniforms.luminanceBuffer0.value=value}setLuminanceBuffer0(value){this.uniforms.luminanceBuffer0.value=value}set luminanceBuffer1(value){this.uniforms.luminanceBuffer1.value=value}setLuminanceBuffer1(value){this.uniforms.luminanceBuffer1.value=value}set mipLevel1x1(value){this.defines.MIP_LEVEL_1X1=value.toFixed(1),this.needsUpdate=!0}setMipLevel1x1(value){this.mipLevel1x1=value}set deltaTime(value){this.uniforms.deltaTime.value=value}setDeltaTime(value){this.uniforms.deltaTime.value=value}get minLuminance(){return this.uniforms.minLuminance.value}set minLuminance(value){this.uniforms.minLuminance.value=value}getMinLuminance(){return this.uniforms.minLuminance.value}setMinLuminance(value){this.uniforms.minLuminance.value=value}get adaptationRate(){return this.uniforms.tau.value}set adaptationRate(value){this.uniforms.tau.value=value}getAdaptationRate(){return this.uniforms.tau.value}setAdaptationRate(value){this.uniforms.tau.value=value}},BokehMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(fill=!1,foreground=!1){super({name:"BokehMaterial",defines:{PASS:fill?"2":"1"},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),cocBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),kernel64:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),kernel16:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),scale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#if PASS == 1\nuniform vec4 kernel64[32];\n#else\nuniform vec4 kernel16[8];\n#endif\nuniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;varying vec2 vUv;void main(){\n#ifdef FOREGROUND\nvec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale;\n#else\nfloat CoC=texture2D(cocBuffer,vUv).g*scale;\n#endif\nif(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{\n#ifdef FOREGROUND\nvec2 step=texelSize*max(CoC,CoCNearFar.g*scale);\n#else\nvec2 step=texelSize*CoC;\n#endif\n#if PASS == 1\nvec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;\n#else\nvec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;\n#endif\n}}",vertexShader:common_default}),foreground&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}set cocBuffer(value){this.uniforms.cocBuffer.value=value}setCoCBuffer(value){this.uniforms.cocBuffer.value=value}get scale(){return this.uniforms.scale.value}set scale(value){this.uniforms.scale.value=value}getScale(value){return this.scale}setScale(value){this.scale=value}generateKernel(){const points64=new Float64Array(128),points16=new Float64Array(32);let i64=0,i16=0;for(let i=0,sqrt80=Math.sqrt(80);i<80;++i){const theta=2.39996323*i,r=Math.sqrt(i)/sqrt80,u=r*Math.cos(theta),v3=r*Math.sin(theta);i%5==0?(points16[i16++]=u,points16[i16++]=v3):(points64[i64++]=u,points64[i64++]=v3)}this.uniforms.kernel64.value=points64,this.uniforms.kernel16.value=points16}setTexelSize(x,y){this.uniforms.texelSize.value.set(x,y)}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},revision=Number(three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,"")),useColorSpace=revision>=152,encodingToColorSpace=new Map([[three__WEBPACK_IMPORTED_MODULE_0__.LinearEncoding,"srgb-linear"],[three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding,"srgb"]]),colorSpaceToEncoding=new Map([["srgb-linear",three__WEBPACK_IMPORTED_MODULE_0__.LinearEncoding],["srgb",three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding]]);function getOutputColorSpace(renderer){return null===renderer?null:useColorSpace?renderer.outputColorSpace:encodingToColorSpace.get(renderer.outputEncoding)}function setTextureColorSpace(texture,colorSpace){null!==texture&&(useColorSpace?texture.colorSpace=colorSpace:texture.encoding=colorSpaceToEncoding.get(colorSpace))}function copyTextureColorSpace(src,dest){null!==src&&null!==dest&&(useColorSpace?dest.colorSpace=src.colorSpace:dest.encoding=src.encoding)}function updateFragmentShader(fragmentShader){return revision<154?fragmentShader.replace("colorspace_fragment","encodings_fragment"):fragmentShader}function orthographicDepthToViewZ(depth,near,far){return depth*(near-far)-near}function viewZToOrthographicDepth(viewZ,near,far){return Math.min(Math.max((viewZ+near)/(near-far),0),1)}var CircleOfConfusionMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(camera){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),focusDistance:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0),focusRange:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0),cameraNear:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.3),cameraFar:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1e3)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nfloat depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nfloat depth=texture2D(depthBuffer,uv).r;\n#endif\n#ifdef LOG_DEPTH\nfloat d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;\n#endif\nreturn depth;}void main(){float depth=readDepth(vUv);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}",vertexShader:common_default}),this.uniforms.focalLength=this.uniforms.focusRange,this.copyCameraSettings(camera)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(value){this.uniforms.depthBuffer.value=value}set depthPacking(value){this.defines.DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer=buffer,this.depthPacking=depthPacking}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(value){this.uniforms.focusDistance.value=value}get worldFocusDistance(){return-orthographicDepthToViewZ(this.focusDistance,this.near,this.far)}set worldFocusDistance(value){this.focusDistance=viewZToOrthographicDepth(-value,this.near,this.far)}getFocusDistance(value){this.uniforms.focusDistance.value=value}setFocusDistance(value){this.uniforms.focusDistance.value=value}get focalLength(){return this.focusRange}set focalLength(value){this.focusRange=value}get focusRange(){return this.uniforms.focusRange.value}set focusRange(value){this.uniforms.focusRange.value=value}get worldFocusRange(){return-orthographicDepthToViewZ(this.focusRange,this.near,this.far)}set worldFocusRange(value){this.focusRange=viewZToOrthographicDepth(-value,this.near,this.far)}getFocalLength(value){return this.focusRange}setFocalLength(value){this.focusRange=value}adoptCameraSettings(camera){this.copyCameraSettings(camera)}copyCameraSettings(camera){camera&&(this.uniforms.cameraNear.value=camera.near,this.uniforms.cameraFar.value=camera.far,camera instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},BlendFunction={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},ColorChannel_RED=0,ColorChannel_GREEN=1,ColorChannel_BLUE=2,ColorChannel_ALPHA=3,DepthCopyMode_FULL=0,DepthCopyMode_SINGLE=1,DepthTestStrategy_KEEP_MAX_DEPTH=1,DepthTestStrategy_DISCARD_MAX_DEPTH=2,EdgeDetectionMode_COLOR=2,EffectAttribute={NONE:0,DEPTH:1,CONVOLUTION:2},EffectShaderSection={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},GlitchMode={DISABLED:0,SPORADIC:1,CONSTANT_MILD:2,CONSTANT_WILD:3},KernelSize_VERY_SMALL=0,KernelSize_SMALL=1,KernelSize_MEDIUM=2,KernelSize_LARGE=3,LUTOperation_SCALE_UP="lut.scaleup",MaskFunction={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2},PredicationMode_DISABLED=0,SMAAPreset_LOW=0,SMAAPreset_MEDIUM=1,SMAAPreset_HIGH=2,SMAAPreset_ULTRA=3,ToneMappingMode_REINHARD=0,ToneMappingMode_REINHARD2=1,ToneMappingMode_REINHARD2_ADAPTIVE=2,ToneMappingMode_OPTIMIZED_CINEON=3,ToneMappingMode_ACES_FILMIC=4,VignetteTechnique_DEFAULT=0,VignetteTechnique_ESKIL=1,kernelPresets=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],KawaseBlurMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(texelSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector4){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector4),scale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),kernel:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include \n}",vertexShader:"uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.fragmentShader=updateFragmentShader(this.fragmentShader),this.setTexelSize(texelSize.x,texelSize.y),this.kernelSize=KernelSize_MEDIUM}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.inputBuffer=value}get kernelSequence(){return kernelPresets[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(value){this.uniforms.scale.value=value}getScale(){return this.uniforms.scale.value}setScale(value){this.uniforms.scale.value=value}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(value){this.uniforms.kernel.value=value}setKernel(value){this.kernel=value}setTexelSize(x,y){this.uniforms.texelSize.value.set(x,y,.5*x,.5*y)}setSize(width,height){const x=1/width,y=1/height;this.uniforms.texelSize.value.set(x,y,.5*x,.5*y)}},CopyMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),opacity:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include \n#include \n}",vertexShader:common_default}),this.fragmentShader=updateFragmentShader(this.fragmentShader)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}getOpacity(value){return this.uniforms.opacity.value}setOpacity(value){this.uniforms.opacity.value=value}},DepthComparisonMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(depthTexture=null,camera){super({name:"DepthComparisonMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),cameraNear:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.3),cameraFar:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1e3)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float cameraNear;uniform float cameraFar;varying float vViewZ;varying vec4 vProjTexCoord;void main(){\n#include \nvec2 projTexCoord=(vProjTexCoord.xy/vProjTexCoord.w)*0.5+0.5;projTexCoord=clamp(projTexCoord,0.002,0.998);\n#if DEPTH_PACKING == 3201\nfloat fragCoordZ=unpackRGBAToDepth(texture2D(depthBuffer,projTexCoord));\n#else\nfloat fragCoordZ=texture2D(depthBuffer,projTexCoord).r;\n#endif\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(fragCoordZ,cameraNear,cameraFar);\n#else\nfloat viewZ=orthographicDepthToViewZ(fragCoordZ,cameraNear,cameraFar);\n#endif\nfloat depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}",vertexShader:"#include \n#include \n#include \n#include \nvarying float vViewZ;varying vec4 vProjTexCoord;void main(){\n#include \n#include \n#include \n#include \n#include \nvViewZ=mvPosition.z;vProjTexCoord=gl_Position;\n#include \n}"}),this.depthBuffer=depthTexture,this.depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking,this.copyCameraSettings(camera)}set depthBuffer(value){this.uniforms.depthBuffer.value=value}set depthPacking(value){this.defines.DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking){this.depthBuffer=buffer,this.depthPacking=depthPacking}adoptCameraSettings(camera){this.copyCameraSettings(camera)}copyCameraSettings(camera){camera&&(this.uniforms.cameraNear.value=camera.near,this.uniforms.cameraFar.value=camera.far,camera instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},DepthCopyMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"DepthCopyMaterial",defines:{INPUT_DEPTH_PACKING:"0",OUTPUT_DEPTH_PACKING:"0",DEPTH_COPY_MODE:"0"},uniforms:{depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelPosition:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \nvarying vec2 vUv;\n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}\n#else\n#if INPUT_DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if INPUT_DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nvoid main(){\n#if INPUT_DEPTH_PACKING == OUTPUT_DEPTH_PACKING\ngl_FragColor=texture2D(depthBuffer,vUv);\n#else\nfloat depth=readDepth(vUv);\n#if OUTPUT_DEPTH_PACKING == 3201\ngl_FragColor=(depth==1.0)?vec4(1.0):packDepthToRGBA(depth);\n#else\ngl_FragColor=vec4(vec3(depth),1.0);\n#endif\n#endif\n}",vertexShader:"varying vec2 vUv;\n#if DEPTH_COPY_MODE == 1\nuniform vec2 texelPosition;\n#endif\nvoid main(){\n#if DEPTH_COPY_MODE == 1\nvUv=texelPosition;\n#else\nvUv=position.xy*0.5+0.5;\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}"}),this.depthCopyMode=DepthCopyMode_FULL}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(value){this.uniforms.depthBuffer.value=value}set inputDepthPacking(value){this.defines.INPUT_DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}get outputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}set outputDepthPacking(value){this.defines.OUTPUT_DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer=buffer,this.inputDepthPacking=depthPacking}getInputDepthPacking(){return Number(this.defines.INPUT_DEPTH_PACKING)}setInputDepthPacking(value){this.defines.INPUT_DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}getOutputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}setOutputDepthPacking(value){this.defines.OUTPUT_DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}get texelPosition(){return this.uniforms.texelPosition.value}getTexelPosition(){return this.uniforms.texelPosition.value}setTexelPosition(value){this.uniforms.texelPosition.value=value}get mode(){return this.depthCopyMode}set mode(value){this.depthCopyMode=value,this.defines.DEPTH_COPY_MODE=value.toFixed(0),this.needsUpdate=!0}getMode(){return this.mode}setMode(value){this.mode=value}},DepthDownsamplingMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),normalBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\n#ifdef DOWNSAMPLE_NORMALS\nuniform lowp sampler2D normalBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}int findBestDepth(const in highp float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;highp float distances[]=float[4](abs(c-samples[0]),abs(c-samples[1]),abs(c-samples[2]),abs(c-samples[3]));float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]\n#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer0;uniform highp sampler2D depthBuffer1;\n#else\nuniform mediump sampler2D depthBuffer0;uniform mediump sampler2D depthBuffer1;\n#endif\nuniform sampler2D inputBuffer;uniform vec2 cameraNearFar;float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}varying vec2 vUv;void main(){vec2 depth;\n#if DEPTH_PACKING_0 == 3201\ndepth.x=unpackRGBAToDepth(texture2D(depthBuffer0,vUv));\n#else\ndepth.x=texture2D(depthBuffer0,vUv).r;\n#ifdef LOG_DEPTH\nfloat d=pow(2.0,depth.x*log2(cameraNearFar.y+1.0))-1.0;float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);depth.x=a+b/d;\n#endif\n#endif\n#if DEPTH_PACKING_1 == 3201\ndepth.y=unpackRGBAToDepth(texture2D(depthBuffer1,vUv));\n#else\ndepth.y=texture2D(depthBuffer1,vUv).r;\n#ifdef LOG_DEPTH\nfloat d=pow(2.0,depth.y*log2(cameraNearFar.y+1.0))-1.0;float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);depth.y=a+b/d;\n#endif\n#endif\nbool isMaxDepth=(depth.x==1.0);\n#ifdef PERSPECTIVE_CAMERA\ndepth.x=viewZToOrthographicDepth(getViewZ(depth.x),cameraNearFar.x,cameraNearFar.y);depth.y=viewZToOrthographicDepth(getViewZ(depth.y),cameraNearFar.x,cameraNearFar.y);\n#endif\n#if DEPTH_TEST_STRATEGY == 0\nbool keep=depthTest(depth.x,depth.y);\n#elif DEPTH_TEST_STRATEGY == 1\nbool keep=isMaxDepth||depthTest(depth.x,depth.y);\n#else\nbool keep=!isMaxDepth&&depthTest(depth.x,depth.y);\n#endif\nif(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}",vertexShader:common_default}),this.depthMode=three__WEBPACK_IMPORTED_MODULE_0__.LessDepth}set depthBuffer0(value){this.uniforms.depthBuffer0.value=value}set depthPacking0(value){this.defines.DEPTH_PACKING_0=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer0(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer0=buffer,this.depthPacking0=depthPacking}set depthBuffer1(value){this.uniforms.depthBuffer1.value=value}set depthPacking1(value){this.defines.DEPTH_PACKING_1=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer1(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer1=buffer,this.depthPacking1=depthPacking}get maxDepthStrategy(){return Number(this.defines.DEPTH_TEST_STRATEGY)}set maxDepthStrategy(value){this.defines.DEPTH_TEST_STRATEGY=value.toFixed(0),this.needsUpdate=!0}get keepFar(){return this.maxDepthStrategy}set keepFar(value){this.maxDepthStrategy=value?DepthTestStrategy_KEEP_MAX_DEPTH:DepthTestStrategy_DISCARD_MAX_DEPTH}getMaxDepthStrategy(){return this.maxDepthStrategy}setMaxDepthStrategy(value){this.maxDepthStrategy=value}get epsilon(){return Number(this.defines.DEPTH_EPSILON)}set epsilon(value){this.defines.DEPTH_EPSILON=value.toFixed(16),this.needsUpdate=!0}getEpsilon(){return this.epsilon}setEpsilon(value){this.epsilon=value}get depthMode(){return Number(this.defines.DEPTH_MODE)}set depthMode(value){let depthTest;switch(value){case three__WEBPACK_IMPORTED_MODULE_0__.NeverDepth:depthTest="false";break;case three__WEBPACK_IMPORTED_MODULE_0__.AlwaysDepth:depthTest="true";break;case three__WEBPACK_IMPORTED_MODULE_0__.EqualDepth:depthTest="abs(d1 - d0) <= DEPTH_EPSILON";break;case three__WEBPACK_IMPORTED_MODULE_0__.NotEqualDepth:depthTest="abs(d1 - d0) > DEPTH_EPSILON";break;case three__WEBPACK_IMPORTED_MODULE_0__.LessDepth:depthTest="d0 > d1";break;case three__WEBPACK_IMPORTED_MODULE_0__.LessEqualDepth:depthTest="d0 >= d1";break;case three__WEBPACK_IMPORTED_MODULE_0__.GreaterEqualDepth:depthTest="d0 <= d1";break;case three__WEBPACK_IMPORTED_MODULE_0__.GreaterDepth:default:depthTest="d0 < d1"}this.defines.DEPTH_MODE=value.toFixed(0),this.defines["depthTest(d0, d1)"]=depthTest,this.needsUpdate=!0}getDepthMode(){return this.depthMode}setDepthMode(mode){this.depthMode=mode}adoptCameraSettings(camera){this.copyCameraSettings(camera)}copyCameraSettings(camera){camera&&(this.uniforms.cameraNearFar.value.set(camera.near,camera.far),camera instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},DownsamplingMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#define WEIGHT_INNER 0.125\n#define WEIGHT_OUTER 0.0555555\nvarying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;\n#include \n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.fragmentShader=updateFragmentShader(this.fragmentShader)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},EdgeDetectionMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(texelSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,mode=EdgeDetectionMode_COLOR){super({name:"EdgeDetectionMaterial",defines:{THREE_REVISION:three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,""),LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),predicationBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(texelSize)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\n#if EDGE_DETECTION_MODE == 1\n#include \n#endif\n#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);}\n#elif PREDICATION_MODE == 2\nuniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);}\n#endif\n#if PREDICATION_MODE != 0\nvec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);}\n#endif\n#if EDGE_DETECTION_MODE != 0\nuniform sampler2D inputBuffer;\n#endif\nvoid main(){\n#if EDGE_DETECTION_MODE == 0\nconst vec2 threshold=vec2(DEPTH_THRESHOLD);\n#elif PREDICATION_MODE != 0\nvec2 threshold=calculatePredicatedThreshold();\n#else\nconst vec2 threshold=vec2(EDGE_THRESHOLD);\n#endif\n#if EDGE_DETECTION_MODE == 0\nvec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 1\nfloat l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 2\nvec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#endif\n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\nvoid main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0);\n#if EDGE_DETECTION_MODE != 0\nvUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}"}),this.edgeDetectionMode=mode}set depthBuffer(value){this.uniforms.depthBuffer.value=value}set depthPacking(value){this.defines.DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer=buffer,this.depthPacking=depthPacking}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(value){this.defines.EDGE_DETECTION_MODE=value.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(value){this.edgeDetectionMode=value}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(value){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=value.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(value){this.localContrastAdaptationFactor=value}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(value){this.defines.EDGE_THRESHOLD=value.toFixed("6"),this.defines.DEPTH_THRESHOLD=(.1*value).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(value){this.edgeDetectionThreshold=value}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(value){this.defines.PREDICATION_MODE=value.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(value){this.predicationMode=value}set predicationBuffer(value){this.uniforms.predicationBuffer.value=value}setPredicationBuffer(value){this.uniforms.predicationBuffer.value=value}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(value){this.defines.PREDICATION_THRESHOLD=value.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(value){this.predicationThreshold=value}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(value){this.defines.PREDICATION_SCALE=value.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(value){this.predicationScale=value}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(value){this.defines.PREDICATION_STRENGTH=value.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(value){this.predicationStrength=value}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},EffectMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(shaderParts,defines,uniforms,camera,dithering=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),resolution:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),cameraNear:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.3),cameraFar:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1e3),aspect:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),time:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:dithering}),shaderParts&&this.setShaderParts(shaderParts),defines&&this.setDefines(defines),uniforms&&this.setUniforms(uniforms),this.copyCameraSettings(camera)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(value){this.uniforms.depthBuffer.value=value}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(value){this.defines.DEPTH_PACKING=value.toFixed(0),this.needsUpdate=!0}setDepthBuffer(buffer,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthBuffer=buffer,this.depthPacking=depthPacking}setShaderData(data){this.setShaderParts(data.shaderParts),this.setDefines(data.defines),this.setUniforms(data.uniforms),this.setExtensions(data.extensions)}setShaderParts(shaderParts){return this.fragmentShader="#include \n#include \n#include \n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#if THREE_REVISION >= 137\nvec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE gl_FragColor=color0;\n#ifdef ENCODE_OUTPUT\n#include \n#endif\n#include \n}".replace(EffectShaderSection.FRAGMENT_HEAD,shaderParts.get(EffectShaderSection.FRAGMENT_HEAD)||"").replace(EffectShaderSection.FRAGMENT_MAIN_UV,shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV)||"").replace(EffectShaderSection.FRAGMENT_MAIN_IMAGE,shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}".replace(EffectShaderSection.VERTEX_HEAD,shaderParts.get(EffectShaderSection.VERTEX_HEAD)||"").replace(EffectShaderSection.VERTEX_MAIN_SUPPORT,shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT)||""),this.fragmentShader=updateFragmentShader(this.fragmentShader),this.needsUpdate=!0,this}setDefines(defines){for(const entry of defines.entries())this.defines[entry[0]]=entry[1];return this.needsUpdate=!0,this}setUniforms(uniforms){for(const entry of uniforms.entries())this.uniforms[entry[0]]=entry[1];return this}setExtensions(extensions){this.extensions={};for(const extension of extensions)this.extensions[extension]=!0;return this}get encodeOutput(){return void 0!==this.defines.ENCODE_OUTPUT}set encodeOutput(value){this.encodeOutput!==value&&(value?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(value){return this.encodeOutput}setOutputEncodingEnabled(value){this.encodeOutput=value}get time(){return this.uniforms.time.value}set time(value){this.uniforms.time.value=value}setDeltaTime(value){this.uniforms.time.value+=value}adoptCameraSettings(camera){this.copyCameraSettings(camera)}copyCameraSettings(camera){camera&&(this.uniforms.cameraNear.value=camera.near,this.uniforms.cameraFar.value=camera.far,camera instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(width,height){const uniforms=this.uniforms;uniforms.resolution.value.set(width,height),uniforms.texelSize.value.set(1/width,1/height),uniforms.aspect.value=width/height}static get Section(){return EffectShaderSection}},GodRaysMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(lightPosition){super({name:"GodRaysMaterial",defines:{SAMPLES_INT:"60",SAMPLES_FLOAT:"60.0"},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),lightPosition:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(lightPosition),density:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),decay:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),weight:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),exposure:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),clampMax:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform vec2 lightPosition;uniform float exposure;uniform float decay;uniform float density;uniform float weight;uniform float clampMax;varying vec2 vUv;void main(){vec2 coord=vUv;vec2 delta=lightPosition-coord;delta*=1.0/SAMPLES_FLOAT*density;float illuminationDecay=1.0;vec4 color=vec4(0.0);for(int i=0;i\n}",vertexShader:common_default})}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}get lightPosition(){return this.uniforms.lightPosition.value}getLightPosition(){return this.uniforms.lightPosition.value}setLightPosition(value){this.uniforms.lightPosition.value=value}get density(){return this.uniforms.density.value}set density(value){this.uniforms.density.value=value}getDensity(){return this.uniforms.density.value}setDensity(value){this.uniforms.density.value=value}get decay(){return this.uniforms.decay.value}set decay(value){this.uniforms.decay.value=value}getDecay(){return this.uniforms.decay.value}setDecay(value){this.uniforms.decay.value=value}get weight(){return this.uniforms.weight.value}set weight(value){this.uniforms.weight.value=value}getWeight(){return this.uniforms.weight.value}setWeight(value){this.uniforms.weight.value=value}get exposure(){return this.uniforms.exposure.value}set exposure(value){this.uniforms.exposure.value=value}getExposure(){return this.uniforms.exposure.value}setExposure(value){this.uniforms.exposure.value=value}get maxIntensity(){return this.uniforms.clampMax.value}set maxIntensity(value){this.uniforms.clampMax.value=value}getMaxIntensity(){return this.uniforms.clampMax.value}setMaxIntensity(value){this.uniforms.clampMax.value=value}get samples(){return Number(this.defines.SAMPLES_INT)}set samples(value){const s=Math.floor(value);this.defines.SAMPLES_INT=s.toFixed(0),this.defines.SAMPLES_FLOAT=s.toFixed(1),this.needsUpdate=!0}getSamples(){return this.samples}setSamples(value){this.samples=value}},LuminanceMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(colorOutput=!1,luminanceRange=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:three__WEBPACK_IMPORTED_MODULE_0__.REVISION.replace(/\D+/g,"")},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),threshold:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0),smoothing:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),range:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef RANGE\nuniform vec2 range;\n#elif defined(THRESHOLD)\nuniform float threshold;uniform float smoothing;\n#endif\nvarying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);\n#ifdef RANGE\nfloat low=step(range.x,l);float high=step(l,range.y);l*=low*high;\n#elif defined(THRESHOLD)\nl=smoothstep(threshold,threshold+smoothing,l);\n#endif\n#ifdef COLOR\ngl_FragColor=vec4(texel.rgb*l,l);\n#else\ngl_FragColor=vec4(l);\n#endif\n}",vertexShader:common_default}),this.colorOutput=colorOutput,this.luminanceRange=luminanceRange}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}get threshold(){return this.uniforms.threshold.value}set threshold(value){this.smoothing>0||value>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=value}getThreshold(){return this.threshold}setThreshold(value){this.threshold=value}get smoothing(){return this.uniforms.smoothing.value}set smoothing(value){this.threshold>0||value>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=value}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(value){this.smoothing=value}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(value){}get colorOutput(){return void 0!==this.defines.COLOR}set colorOutput(value){value?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(value){return this.colorOutput}setColorOutputEnabled(value){this.colorOutput=value}get useRange(){return null!==this.luminanceRange}set useRange(value){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(value){null!==value?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=value,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(value){this.luminanceRange=value}},MaskMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(maskTexture=null){super({name:"MaskMaterial",uniforms:{maskTexture:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(maskTexture),inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),strength:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef MASK_PRECISION_HIGH\nuniform mediump sampler2D maskTexture;\n#else\nuniform lowp sampler2D maskTexture;\n#endif\n#if MASK_FUNCTION != 0\nuniform float strength;\n#endif\nvarying vec2 vUv;void main(){\n#if COLOR_CHANNEL == 0\nfloat mask=texture2D(maskTexture,vUv).r;\n#elif COLOR_CHANNEL == 1\nfloat mask=texture2D(maskTexture,vUv).g;\n#elif COLOR_CHANNEL == 2\nfloat mask=texture2D(maskTexture,vUv).b;\n#else\nfloat mask=texture2D(maskTexture,vUv).a;\n#endif\n#if MASK_FUNCTION == 0\n#ifdef INVERTED\nmask=step(mask,0.0);\n#else\nmask=1.0-step(mask,0.0);\n#endif\n#else\nmask=clamp(mask*strength,0.0,1.0);\n#ifdef INVERTED\nmask=1.0-mask;\n#endif\n#endif\n#if MASK_FUNCTION == 2\ngl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);\n#else\ngl_FragColor=mask*texture2D(inputBuffer,vUv);\n#endif\n}",vertexShader:common_default}),this.colorChannel=ColorChannel_RED,this.maskFunction=MaskFunction.DISCARD}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}set maskTexture(value){this.uniforms.maskTexture.value=value,delete this.defines.MASK_PRECISION_HIGH,value.type!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(value){this.maskTexture=value}set colorChannel(value){this.defines.COLOR_CHANNEL=value.toFixed(0),this.needsUpdate=!0}setColorChannel(value){this.colorChannel=value}set maskFunction(value){this.defines.MASK_FUNCTION=value.toFixed(0),this.needsUpdate=!0}setMaskFunction(value){this.maskFunction=value}get inverted(){return void 0!==this.defines.INVERTED}set inverted(value){this.inverted&&!value?delete this.defines.INVERTED:value&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(value){this.inverted=value}get strength(){return this.uniforms.strength.value}set strength(value){this.uniforms.strength.value=value}getStrength(){return this.strength}setStrength(value){this.strength=value}},OutlineMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(texelSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2){super({name:"OutlineMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.uniforms.texelSize.value.set(texelSize.x,texelSize.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}setTexelSize(x,y){this.uniforms.texelSize.value.set(x,y)}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},SMAAWeightsMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(texelSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,resolution=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),searchTexture:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),areaTexture:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),resolution:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(resolution),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(texelSize)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)\n#if __VERSION__ < 300\n#define round(v) floor(v + 0.5)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0);\n#endif\n}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0);\n#endif\n}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){\n#if !defined(DISABLE_DIAG_DETECTION)\nweights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){\n#endif\nvec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d);\n#if !defined(DISABLE_DIAG_DETECTION)\n}else{e.r=0.0;}\n#endif\n}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}",vertexShader:"uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}"})}set inputBuffer(value){this.uniforms.inputBuffer.value=value}setInputBuffer(value){this.uniforms.inputBuffer.value=value}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(value){this.uniforms.searchTexture.value=value}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(value){this.uniforms.areaTexture.value=value}setLookupTextures(search,area2){this.searchTexture=search,this.areaTexture=area2}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(value){const s=Math.min(Math.max(value,0),112);this.defines.MAX_SEARCH_STEPS_INT=s.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=s.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(value){this.orthogonalSearchSteps=value}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(value){const s=Math.min(Math.max(value,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=s.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=s.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(value){this.diagonalSearchSteps=value}get diagonalDetection(){return void 0===this.defines.DISABLE_DIAG_DETECTION}set diagonalDetection(value){value?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(value){this.diagonalDetection=value}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(value){const r=Math.min(Math.max(value,0),100);this.defines.CORNER_ROUNDING=r.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(r/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(value){this.cornerRounding=value}get cornerDetection(){return void 0===this.defines.DISABLE_CORNER_DETECTION}set cornerDetection(value){value?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(value){this.cornerDetection=value}setSize(width,height){const uniforms=this.uniforms;uniforms.texelSize.value.set(1/width,1/height),uniforms.resolution.value.set(width,height)}},SSAOMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(camera){super({name:"SSAOMaterial",defines:{SAMPLES_INT:"0",INV_SAMPLES_FLOAT:"0.0",SPIRAL_TURNS:"0.0",RADIUS:"1.0",RADIUS_SQ:"1.0",DISTANCE_SCALING:"1",DEPTH_PACKING:"0"},uniforms:{depthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),normalBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),normalDepthBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),noiseTexture:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),inverseProjectionMatrix:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4),projectionMatrix:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),cameraNearFar:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),distanceCutoff:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),proximityCutoff:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),noiseScale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),minRadiusScale:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.33),intensity:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),fade:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.01),bias:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#include \n#include \n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}\n#else\nuniform lowp sampler2D normalBuffer;\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nuniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform vec2 cameraNearFar;uniform float intensity;uniform float minRadiusScale;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){float radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;float noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i1.0||coords.t<0.0||coords.t>1.0){continue;}float sampleDepth=readDepth(coords);float viewZ=getViewZ(sampleDepth);\n#ifdef PERSPECTIVE_CAMERA\nfloat linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y);\n#else\nfloat linearSampleDepth=sampleDepth;\n#endif\nfloat proximity=abs(depth-linearSampleDepth);if(proximity\n}",this.vertexShader="uniform vec4 texelSize;uniform float kernel;uniform float scale;uniform float aspect;uniform vec2 rotation;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;void main(){vec2 uv=position.xy*0.5+0.5;vUv=uv;vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));vOffset=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;gl_Position=vec4(position.xy,1.0,1.0);}",this.kernelSize=kernelSize,this.fragmentShader=updateFragmentShader(this.fragmentShader),this.uniforms.aspect=new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1),this.uniforms.rotation=new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),this.uniforms.maskParams=new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector4),this._offset=offset,this._focusArea=focusArea,this._feather=feather,this.rotation=rotation,this.updateParams()}updateParams(){const params=this.uniforms.maskParams.value,a=Math.max(this.focusArea,0),b=Math.max(a-this.feather,0);params.set(this.offset-a,this.offset-b,this.offset+a,this.offset+b)}get rotation(){return Math.acos(this.uniforms.rotation.value.x)}set rotation(value){this.uniforms.rotation.value.set(Math.cos(value),Math.sin(value))}get offset(){return this._offset}set offset(value){this._offset=value,this.updateParams()}get focusArea(){return this._focusArea}set focusArea(value){this._focusArea=value,this.updateParams()}get feather(){return this._feather}set feather(value){this._feather=value,this.updateParams()}setSize(width,height){super.setSize(width,height),this.uniforms.aspect.value=width/height}},UpsamplingMaterial=class extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),supportBuffer:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null),texelSize:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),radius:new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(.85)},blending:three__WEBPACK_IMPORTED_MODULE_0__.NoBlending,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;\n#else\nuniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;\n#endif\nuniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);\n#include \n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.fragmentShader=updateFragmentShader(this.fragmentShader)}set inputBuffer(value){this.uniforms.inputBuffer.value=value}set supportBuffer(value){this.uniforms.supportBuffer.value=value}get radius(){return this.uniforms.radius.value}set radius(value){this.uniforms.radius.value=value}setSize(width,height){this.uniforms.texelSize.value.set(1/width,1/height)}},dummyCamera=new three__WEBPACK_IMPORTED_MODULE_0__.Camera,geometry=null;var Pass=class _Pass{constructor(name="Pass",scene=new three__WEBPACK_IMPORTED_MODULE_0__.Scene,camera=dummyCamera){this.name=name,this.renderer=null,this.scene=scene,this.camera=camera,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(value){if(this.rtt===value){const material=this.fullscreenMaterial;null!==material&&(material.needsUpdate=!0),this.rtt=!value}}set mainScene(value){}set mainCamera(value){}setRenderer(renderer){this.renderer=renderer}isEnabled(){return this.enabled}setEnabled(value){this.enabled=value}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(value){let screen=this.screen;null!==screen?screen.material=value:(screen=new three__WEBPACK_IMPORTED_MODULE_0__.Mesh(function getFullscreenTriangle(){if(null===geometry){const vertices=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),uvs=new Float32Array([0,0,2,0,0,2]);void 0!==(geometry=new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry).setAttribute?(geometry.setAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(vertices,3)),geometry.setAttribute("uv",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(uvs,2))):(geometry.addAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(vertices,3)),geometry.addAttribute("uv",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(uvs,2)))}return geometry}(),value),screen.frustumCulled=!1,null===this.scene&&(this.scene=new three__WEBPACK_IMPORTED_MODULE_0__.Scene),this.scene.add(screen),this.screen=screen)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(value){this.fullscreenMaterial=value}getDepthTexture(){return null}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){throw new Error("Render method not implemented!")}setSize(width,height){}initialize(renderer,alpha,frameBufferType){}dispose(){for(const key of Object.keys(this)){const property=this[key];(property instanceof three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Material||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Texture||property instanceof _Pass)&&this[key].dispose()}}},CopyPass=class extends Pass{constructor(renderTarget,autoResize=!0){super("CopyPass"),this.fullscreenMaterial=new CopyMaterial,this.needsSwap=!1,this.renderTarget=renderTarget,void 0===renderTarget&&(this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=autoResize}get resize(){return this.autoResize}set resize(value){this.autoResize=value}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(value){this.autoResize=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){this.fullscreenMaterial.inputBuffer=inputBuffer.texture,renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){this.autoResize&&this.renderTarget.setSize(width,height)}initialize(renderer,alpha,frameBufferType){void 0!==frameBufferType&&(this.renderTarget.texture.type=frameBufferType,frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":"srgb"===getOutputColorSpace(renderer)&&setTextureColorSpace(this.renderTarget.texture,"srgb"))}},AdaptiveLuminancePass=class extends Pass{constructor(luminanceBuffer,{minLuminance:minLuminance=.01,adaptationRate:adaptationRate=1}={}){super("AdaptiveLuminancePass"),this.fullscreenMaterial=new AdaptiveLuminanceMaterial,this.needsSwap=!1,this.renderTargetPrevious=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,depthBuffer:!1}),this.renderTargetPrevious.texture.name="Luminance.Previous";const material=this.fullscreenMaterial;material.luminanceBuffer0=this.renderTargetPrevious.texture,material.luminanceBuffer1=luminanceBuffer,material.minLuminance=minLuminance,material.adaptationRate=adaptationRate,this.renderTargetAdapted=this.renderTargetPrevious.clone(),this.renderTargetAdapted.texture.name="Luminance.Adapted",this.copyPass=new CopyPass(this.renderTargetPrevious,!1)}get texture(){return this.renderTargetAdapted.texture}getTexture(){return this.renderTargetAdapted.texture}set mipLevel1x1(value){this.fullscreenMaterial.mipLevel1x1=value}get adaptationRate(){return this.fullscreenMaterial.adaptationRate}set adaptationRate(value){this.fullscreenMaterial.adaptationRate=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){this.fullscreenMaterial.deltaTime=deltaTime,renderer.setRenderTarget(this.renderToScreen?null:this.renderTargetAdapted),renderer.render(this.scene,this.camera),this.copyPass.render(renderer,this.renderTargetAdapted)}},ClearMaskPass=class extends Pass{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const stencil=renderer.state.buffers.stencil;stencil.setLocked(!1),stencil.setTest(!1)}},color=new three__WEBPACK_IMPORTED_MODULE_0__.Color,ClearPass=class extends Pass{constructor(color2=!0,depth=!0,stencil=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=color2,this.depth=depth,this.stencil=stencil,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(color2,depth,stencil){this.color=color2,this.depth=depth,this.stencil=stencil}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(value){this.overrideClearColor=value}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(value){this.overrideClearAlpha=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const overrideClearColor=this.overrideClearColor,overrideClearAlpha=this.overrideClearAlpha,clearAlpha=renderer.getClearAlpha(),hasOverrideClearColor=null!==overrideClearColor,hasOverrideClearAlpha=overrideClearAlpha>=0;hasOverrideClearColor?(renderer.getClearColor(color),renderer.setClearColor(overrideClearColor,hasOverrideClearAlpha?overrideClearAlpha:clearAlpha)):hasOverrideClearAlpha&&renderer.setClearAlpha(overrideClearAlpha),renderer.setRenderTarget(this.renderToScreen?null:inputBuffer),renderer.clear(this.color,this.depth,this.stencil),hasOverrideClearColor?renderer.setClearColor(color,clearAlpha):hasOverrideClearAlpha&&renderer.setClearAlpha(clearAlpha)}},Resolution=class extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(resizable,width=-1,height=-1,scale=1){super(),this.resizable=resizable,this.baseSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(1,1),this.preferredSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(width,height),this.target=this.preferredSize,this.s=scale,this.effectiveSize=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,this.addEventListener("change",(()=>this.updateEffectiveSize())),this.updateEffectiveSize()}updateEffectiveSize(){const base=this.baseSize,preferred=this.preferredSize,effective=this.effectiveSize,scale=this.scale;-1!==preferred.width?effective.width=preferred.width:-1!==preferred.height?effective.width=Math.round(preferred.height*(base.width/Math.max(base.height,1))):effective.width=Math.round(base.width*scale),-1!==preferred.height?effective.height=preferred.height:-1!==preferred.width?effective.height=Math.round(preferred.width/Math.max(base.width/Math.max(base.height,1),1)):effective.height=Math.round(base.height*scale)}get width(){return this.effectiveSize.width}set width(value){this.preferredWidth=value}get height(){return this.effectiveSize.height}set height(value){this.preferredHeight=value}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(value){this.s!==value&&(this.s=value,this.preferredSize.setScalar(-1),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(value){this.scale=value}get baseWidth(){return this.baseSize.width}set baseWidth(value){this.baseSize.width!==value&&(this.baseSize.width=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(value){this.baseWidth=value}get baseHeight(){return this.baseSize.height}set baseHeight(value){this.baseSize.height!==value&&(this.baseSize.height=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(value){this.baseHeight=value}setBaseSize(width,height){this.baseSize.width===width&&this.baseSize.height===height||(this.baseSize.set(width,height),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(value){this.preferredSize.width!==value&&(this.preferredSize.width=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(value){this.preferredWidth=value}get preferredHeight(){return this.preferredSize.height}set preferredHeight(value){this.preferredSize.height!==value&&(this.preferredSize.height=value,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(value){this.preferredHeight=value}setPreferredSize(width,height){this.preferredSize.width===width&&this.preferredSize.height===height||(this.preferredSize.set(width,height),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(resolution){this.s=resolution.scale,this.baseSize.set(resolution.baseWidth,resolution.baseHeight),this.preferredSize.set(resolution.preferredWidth,resolution.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return-1}},workaroundEnabled=!1,OverrideMaterialManager=class{constructor(material=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(material),this.meshCount=0,this.replaceMaterial=node=>{if(node.isMesh){let materials;if(node.material.flatShading)switch(node.material.side){case three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide:materials=this.materialsFlatShadedDoubleSide;break;case three__WEBPACK_IMPORTED_MODULE_0__.BackSide:materials=this.materialsFlatShadedBackSide;break;default:materials=this.materialsFlatShaded}else switch(node.material.side){case three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide:materials=this.materialsDoubleSide;break;case three__WEBPACK_IMPORTED_MODULE_0__.BackSide:materials=this.materialsBackSide;break;default:materials=this.materials}this.originalMaterials.set(node,node.material),node.isSkinnedMesh?node.material=materials[2]:node.isInstancedMesh?node.material=materials[1]:node.material=materials[0],++this.meshCount}}}cloneMaterial(material){if(!(material instanceof three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial))return material.clone();const uniforms=material.uniforms,textureUniforms=new Map;for(const key in uniforms){const value=uniforms[key].value;value.isRenderTargetTexture&&(uniforms[key].value=null,textureUniforms.set(key,value))}const clone=material.clone();for(const entry of textureUniforms)uniforms[entry[0]].value=entry[1],clone.uniforms[entry[0]].value=entry[1];return clone}setMaterial(material){if(this.disposeMaterials(),this.material=material,null!==material){const materials=this.materials=[this.cloneMaterial(material),this.cloneMaterial(material),this.cloneMaterial(material)];for(const m2 of materials)m2.uniforms=Object.assign({},material.uniforms),m2.side=three__WEBPACK_IMPORTED_MODULE_0__.FrontSide;materials[2].skinning=!0,this.materialsBackSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.side=three__WEBPACK_IMPORTED_MODULE_0__.BackSide,c2})),this.materialsDoubleSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.side=three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide,c2})),this.materialsFlatShaded=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.flatShading=!0,c2})),this.materialsFlatShadedBackSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.flatShading=!0,c2.side=three__WEBPACK_IMPORTED_MODULE_0__.BackSide,c2})),this.materialsFlatShadedDoubleSide=materials.map((m2=>{const c2=this.cloneMaterial(m2);return c2.uniforms=Object.assign({},material.uniforms),c2.flatShading=!0,c2.side=three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide,c2}))}}render(renderer,scene,camera){const shadowMapEnabled=renderer.shadowMap.enabled;if(renderer.shadowMap.enabled=!1,workaroundEnabled){const originalMaterials=this.originalMaterials;this.meshCount=0,scene.traverse(this.replaceMaterial),renderer.render(scene,camera);for(const entry of originalMaterials)entry[0].material=entry[1];this.meshCount!==originalMaterials.size&&originalMaterials.clear()}else{const overrideMaterial=scene.overrideMaterial;scene.overrideMaterial=this.material,renderer.render(scene,camera),scene.overrideMaterial=overrideMaterial}renderer.shadowMap.enabled=shadowMapEnabled}disposeMaterials(){if(null!==this.material){const materials=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const m2 of materials)m2.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return workaroundEnabled}static set workaroundEnabled(value){workaroundEnabled=value}},RenderPass=class extends Pass{constructor(scene,camera,overrideMaterial=null){super("RenderPass",scene,camera),this.needsSwap=!1,this.clearPass=new ClearPass,this.overrideMaterialManager=null===overrideMaterial?null:new OverrideMaterialManager(overrideMaterial),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(value){this.scene=value}set mainCamera(value){this.camera=value}get renderToScreen(){return super.renderToScreen}set renderToScreen(value){super.renderToScreen=value,this.clearPass.renderToScreen=value}get overrideMaterial(){const manager=this.overrideMaterialManager;return null!==manager?manager.material:null}set overrideMaterial(value){const manager=this.overrideMaterialManager;null!==value?null!==manager?manager.setMaterial(value):this.overrideMaterialManager=new OverrideMaterialManager(value):null!==manager&&(manager.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(value){this.overrideMaterial=value}get clear(){return this.clearPass.enabled}set clear(value){this.clearPass.enabled=value}getSelection(){return this.selection}setSelection(value){this.selection=value}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(value){this.ignoreBackground=value}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(value){this.skipShadowMapUpdate=value}getClearPass(){return this.clearPass}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const scene=this.scene,camera=this.camera,selection=this.selection,mask=camera.layers.mask,background=scene.background,shadowMapAutoUpdate=renderer.shadowMap.autoUpdate,renderTarget=this.renderToScreen?null:inputBuffer;null!==selection&&camera.layers.set(selection.getLayer()),this.skipShadowMapUpdate&&(renderer.shadowMap.autoUpdate=!1),(this.ignoreBackground||null!==this.clearPass.overrideClearColor)&&(scene.background=null),this.clearPass.enabled&&this.clearPass.render(renderer,inputBuffer),renderer.setRenderTarget(renderTarget),null!==this.overrideMaterialManager?this.overrideMaterialManager.render(renderer,scene,camera):renderer.render(scene,camera),camera.layers.mask=mask,scene.background=background,renderer.shadowMap.autoUpdate=shadowMapAutoUpdate}},DepthPass=class extends Pass{constructor(scene,camera,{renderTarget:renderTarget,resolutionScale:resolutionScale=1,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new RenderPass(scene,camera,new three__WEBPACK_IMPORTED_MODULE_0__.MeshDepthMaterial({depthPacking:three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking}));const renderPass=this.renderPass;renderPass.skipShadowMapUpdate=!0,renderPass.ignoreBackground=!0;const clearPass=renderPass.clearPass;clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(16777215),clearPass.overrideClearAlpha=1,this.renderTarget=renderTarget,void 0===this.renderTarget&&(this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter}),this.renderTarget.texture.name="DepthPass.Target");const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}set mainScene(value){this.renderPass.mainScene=value}set mainCamera(value){this.renderPass.mainCamera=value}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const renderTarget=this.renderToScreen?null:this.renderTarget;this.renderPass.render(renderer,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height)}},DepthDownsamplingPass=class extends Pass{constructor({normalBuffer:normalBuffer=null,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("DepthDownsamplingPass");const material=new DepthDownsamplingMaterial;material.normalBuffer=normalBuffer,this.fullscreenMaterial=material,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,depthBuffer:!1,type:three__WEBPACK_IMPORTED_MODULE_0__.FloatType}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.fullscreenMaterial.depthBuffer=depthTexture,this.fullscreenMaterial.depthPacking=depthPacking}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height),this.fullscreenMaterial.setSize(width,height)}initialize(renderer,alpha,frameBufferType){const gl=renderer.getContext();if(!(gl.getExtension("EXT_color_buffer_float")||gl.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},DepthCopyPass=class extends Pass{constructor({depthPacking:depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking}={}){super("DepthCopyPass");const material=new DepthCopyMaterial;material.outputDepthPacking=depthPacking,this.fullscreenMaterial=material,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{type:depthPacking===three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking?three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType:three__WEBPACK_IMPORTED_MODULE_0__.FloatType,minFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,depthBuffer:!1}),this.renderTarget.texture.name="DepthCopyPass.Target"}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get depthPacking(){return this.fullscreenMaterial.outputDepthPacking}getDepthPacking(){return this.fullscreenMaterial.outputDepthPacking}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.fullscreenMaterial.depthBuffer=depthTexture,this.fullscreenMaterial.inputDepthPacking=depthPacking}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){this.renderTarget.setSize(width,height)}},unpackFactors=new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var DepthPickingPass=class extends DepthCopyPass{constructor({depthPacking:depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking,mode:mode=DepthCopyMode_SINGLE}={}){super({depthPacking:depthPacking}),this.name="DepthPickingPass",this.fullscreenMaterial.mode=mode,this.pixelBuffer=depthPacking===three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking?new Uint8Array(4):new Float32Array(4),this.callback=null}readDepth(ndc){return this.fullscreenMaterial.texelPosition.set(.5*ndc.x+.5,.5*ndc.y+.5),new Promise((resolve=>{this.callback=resolve}))}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const material=this.fullscreenMaterial,mode=material.mode;if(mode===DepthCopyMode_FULL&&super.render(renderer),null!==this.callback){const renderTarget=this.renderTarget,pixelBuffer=this.pixelBuffer,packed=renderTarget.texture.type!==three__WEBPACK_IMPORTED_MODULE_0__.FloatType;let x=0,y=0;if(mode===DepthCopyMode_SINGLE)super.render(renderer);else{const texelPosition=material.texelPosition;x=Math.round(texelPosition.x*renderTarget.width),y=Math.round(texelPosition.y*renderTarget.height)}renderer.readRenderTargetPixels(renderTarget,x,y,1,1,pixelBuffer),this.callback(packed?function unpackRGBAToDepth(packedDepth){return(packedDepth[0]*unpackFactors[0]+packedDepth[1]*unpackFactors[1]+packedDepth[2]*unpackFactors[2]+packedDepth[3]*unpackFactors[3])/255}(pixelBuffer):pixelBuffer[0]),this.callback=null}}setSize(width,height){this.fullscreenMaterial.mode===DepthCopyMode_FULL&&super.setSize(width,height)}};function prefixSubstrings(prefix,substrings,strings){for(const substring of substrings){const prefixed="$1"+prefix+substring.charAt(0).toUpperCase()+substring.slice(1),regExp=new RegExp("([^\\.])(\\b"+substring+"\\b)","g");for(const entry of strings.entries())null!==entry[1]&&strings.set(entry[0],entry[1].replace(regExp,prefixed))}}function integrateEffect(prefix,effect,data){let fragmentShader=effect.getFragmentShader(),vertexShader=effect.getVertexShader();const mainImageExists=void 0!==fragmentShader&&/mainImage/.test(fragmentShader),mainUvExists=void 0!==fragmentShader&&/mainUv/.test(fragmentShader);if(data.attributes|=effect.getAttributes(),void 0===fragmentShader)throw new Error(`Missing fragment shader (${effect.name})`);if(mainUvExists&&0!=(data.attributes&EffectAttribute.CONVOLUTION))throw new Error(`Effects that transform UVs are incompatible with convolution effects (${effect.name})`);if(!mainImageExists&&!mainUvExists)throw new Error(`Could not find mainImage or mainUv function (${effect.name})`);{const functionRegExp=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,shaderParts=data.shaderParts;let fragmentHead=shaderParts.get(EffectShaderSection.FRAGMENT_HEAD)||"",fragmentMainUv=shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV)||"",fragmentMainImage=shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE)||"",vertexHead=shaderParts.get(EffectShaderSection.VERTEX_HEAD)||"",vertexMainSupport=shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT)||"";const varyings=new Set,names=new Set;if(mainUvExists&&(fragmentMainUv+=`\t${prefix}MainUv(UV);\n`,data.uvTransformation=!0),null!==vertexShader&&/mainSupport/.test(vertexShader)){const needsUv=/mainSupport *\([\w\s]*?uv\s*?\)/.test(vertexShader);vertexMainSupport+=`\t${prefix}MainSupport(`,vertexMainSupport+=needsUv?"vUv);\n":");\n";for(const m2 of vertexShader.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const n of m2[1].split(/\s*,\s*/))data.varyings.add(n),varyings.add(n),names.add(n);for(const m2 of vertexShader.matchAll(functionRegExp))names.add(m2[1])}for(const m2 of fragmentShader.matchAll(functionRegExp))names.add(m2[1]);for(const d of effect.defines.keys())names.add(d.replace(/\([\w\s,]*\)/g,""));for(const u of effect.uniforms.keys())names.add(u);names.delete("while"),names.delete("for"),names.delete("if"),effect.uniforms.forEach(((val,key)=>data.uniforms.set(prefix+key.charAt(0).toUpperCase()+key.slice(1),val))),effect.defines.forEach(((val,key)=>data.defines.set(prefix+key.charAt(0).toUpperCase()+key.slice(1),val)));const shaders=new Map([["fragment",fragmentShader],["vertex",vertexShader]]);prefixSubstrings(prefix,names,data.defines),prefixSubstrings(prefix,names,shaders),fragmentShader=shaders.get("fragment"),vertexShader=shaders.get("vertex");const blendMode=effect.blendMode;if(data.blendModes.set(blendMode.blendFunction,blendMode),mainImageExists){null!==effect.inputColorSpace&&effect.inputColorSpace!==data.colorSpace&&(fragmentMainImage+="srgb"===effect.inputColorSpace?"color0 = LinearTosRGB(color0);\n\t":"color0 = sRGBToLinear(color0);\n\t"),""!==effect.outputColorSpace?data.colorSpace=effect.outputColorSpace:null!==effect.inputColorSpace&&(data.colorSpace=effect.inputColorSpace);const depthParamRegExp=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;fragmentMainImage+=`${prefix}MainImage(color0, UV, `,0!=(data.attributes&EffectAttribute.DEPTH)&&depthParamRegExp.test(fragmentShader)&&(fragmentMainImage+="depth, ",data.readDepth=!0),fragmentMainImage+="color1);\n\t";const blendOpacity=prefix+"BlendOpacity";data.uniforms.set(blendOpacity,blendMode.opacity),fragmentMainImage+=`color0 = blend${blendMode.blendFunction}(color0, color1, ${blendOpacity});\n\n\t`,fragmentHead+=`uniform float ${blendOpacity};\n\n`}if(fragmentHead+=fragmentShader+"\n",null!==vertexShader&&(vertexHead+=vertexShader+"\n"),shaderParts.set(EffectShaderSection.FRAGMENT_HEAD,fragmentHead),shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV,fragmentMainUv),shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE,fragmentMainImage),shaderParts.set(EffectShaderSection.VERTEX_HEAD,vertexHead),shaderParts.set(EffectShaderSection.VERTEX_MAIN_SUPPORT,vertexMainSupport),null!==effect.extensions)for(const extension of effect.extensions)data.extensions.add(extension)}}var EffectPass=class extends Pass{constructor(camera,...effects){super("EffectPass"),this.fullscreenMaterial=new EffectMaterial(null,null,null,camera),this.listener=event=>this.handleEvent(event),this.effects=[],this.setEffects(effects),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(value){for(const effect of this.effects)effect.mainScene=value}set mainCamera(value){this.fullscreenMaterial.copyCameraSettings(value);for(const effect of this.effects)effect.mainCamera=value}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(value){this.fullscreenMaterial.encodeOutput=value}get dithering(){return this.fullscreenMaterial.dithering}set dithering(value){const material=this.fullscreenMaterial;material.dithering=value,material.needsUpdate=!0}setEffects(effects){for(const effect of this.effects)effect.removeEventListener("change",this.listener);this.effects=effects.sort(((a,b)=>b.attributes-a.attributes));for(const effect of this.effects)effect.addEventListener("change",this.listener)}updateMaterial(){const data=new EffectShaderData;let id=0;for(const effect of this.effects)if(effect.blendMode.blendFunction===BlendFunction.DST)data.attributes|=effect.getAttributes()&EffectAttribute.DEPTH;else{if(0!=(data.attributes&effect.getAttributes()&EffectAttribute.CONVOLUTION))throw new Error(`Convolution effects cannot be merged (${effect.name})`);integrateEffect("e"+id++,effect,data)}let fragmentHead=data.shaderParts.get(EffectShaderSection.FRAGMENT_HEAD),fragmentMainImage=data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE),fragmentMainUv=data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV);const blendRegExp=/\bblend\b/g;for(const blendMode of data.blendModes.values())fragmentHead+=blendMode.getShaderCode().replace(blendRegExp,`blend${blendMode.blendFunction}`)+"\n";0!=(data.attributes&EffectAttribute.DEPTH)?(data.readDepth&&(fragmentMainImage="float depth = readDepth(UV);\n\n\t"+fragmentMainImage),this.needsDepthTexture=null===this.getDepthTexture()):this.needsDepthTexture=!1,"srgb"===data.colorSpace&&(fragmentMainImage+="color0 = sRGBToLinear(color0);\n\t"),data.uvTransformation?(fragmentMainUv="vec2 transformedUv = vUv;\n"+fragmentMainUv,data.defines.set("UV","transformedUv")):data.defines.set("UV","vUv"),data.shaderParts.set(EffectShaderSection.FRAGMENT_HEAD,fragmentHead),data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE,fragmentMainImage),data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV,fragmentMainUv);for(const[key,value]of data.shaderParts)null!==value&&data.shaderParts.set(key,value.trim().replace(/^#/,"\n#"));this.skipRendering=0===id,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(data)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.fullscreenMaterial.depthBuffer=depthTexture,this.fullscreenMaterial.depthPacking=depthPacking;for(const effect of this.effects)effect.setDepthTexture(depthTexture,depthPacking)}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){for(const effect of this.effects)effect.update(renderer,inputBuffer,deltaTime);if(!this.skipRendering||this.renderToScreen){const material=this.fullscreenMaterial;material.inputBuffer=inputBuffer.texture,material.time+=deltaTime*this.timeScale,renderer.setRenderTarget(this.renderToScreen?null:outputBuffer),renderer.render(this.scene,this.camera)}}setSize(width,height){this.fullscreenMaterial.setSize(width,height);for(const effect of this.effects)effect.setSize(width,height)}initialize(renderer,alpha,frameBufferType){this.renderer=renderer;for(const effect of this.effects)effect.initialize(renderer,alpha,frameBufferType);this.updateMaterial(),void 0!==frameBufferType&&frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const effect of this.effects)effect.removeEventListener("change",this.listener),effect.dispose()}handleEvent(event){if("change"===event.type)this.recompile()}},KawaseBlurPass=class extends Pass{constructor({kernelSize:kernelSize=KernelSize_MEDIUM,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("KawaseBlurPass"),this.renderTargetA=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight))),this._blurMaterial=new KawaseBlurMaterial,this._blurMaterial.kernelSize=kernelSize,this.copyMaterial=new CopyMaterial}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(value){this._blurMaterial=value}get dithering(){return this.copyMaterial.dithering}set dithering(value){this.copyMaterial.dithering=value}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(value){this.blurMaterial.kernelSize=value}get width(){return this.resolution.width}set width(value){this.resolution.preferredWidth=value}get height(){return this.resolution.height}set height(value){this.resolution.preferredHeight=value}get scale(){return this.blurMaterial.scale}set scale(value){this.blurMaterial.scale=value}getScale(){return this.blurMaterial.scale}setScale(value){this.blurMaterial.scale=value}getKernelSize(){return this.kernelSize}setKernelSize(value){this.kernelSize=value}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const scene=this.scene,camera=this.camera,renderTargetA=this.renderTargetA,renderTargetB=this.renderTargetB,material=this.blurMaterial,kernelSequence=material.kernelSequence;let previousBuffer=inputBuffer;this.fullscreenMaterial=material;for(let i=0,l=kernelSequence.length;ithis.setSize(resolution.baseWidth,resolution.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){this.fullscreenMaterial.inputBuffer=inputBuffer.texture,renderer.setRenderTarget(this.renderToScreen?null:this.renderTarget),renderer.render(this.scene,this.camera)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height)}initialize(renderer,alpha,frameBufferType){void 0!==frameBufferType&&frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.renderTarget.texture.type=frameBufferType,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},MaskPass=class extends Pass{constructor(scene,camera){super("MaskPass",scene,camera),this.needsSwap=!1,this.clearPass=new ClearPass(!1,!1,!0),this.inverse=!1}set mainScene(value){this.scene=value}set mainCamera(value){this.camera=value}get inverted(){return this.inverse}set inverted(value){this.inverse=value}get clear(){return this.clearPass.enabled}set clear(value){this.clearPass.enabled=value}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(value){this.inverted=value}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const context=renderer.getContext(),buffers=renderer.state.buffers,scene=this.scene,camera=this.camera,clearPass=this.clearPass,writeValue=this.inverted?0:1,clearValue=1-writeValue;buffers.color.setMask(!1),buffers.depth.setMask(!1),buffers.color.setLocked(!0),buffers.depth.setLocked(!0),buffers.stencil.setTest(!0),buffers.stencil.setOp(context.REPLACE,context.REPLACE,context.REPLACE),buffers.stencil.setFunc(context.ALWAYS,writeValue,4294967295),buffers.stencil.setClear(clearValue),buffers.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?clearPass.render(renderer,null):(clearPass.render(renderer,inputBuffer),clearPass.render(renderer,outputBuffer))),this.renderToScreen?(renderer.setRenderTarget(null),renderer.render(scene,camera)):(renderer.setRenderTarget(inputBuffer),renderer.render(scene,camera),renderer.setRenderTarget(outputBuffer),renderer.render(scene,camera)),buffers.color.setLocked(!1),buffers.depth.setLocked(!1),buffers.stencil.setLocked(!1),buffers.stencil.setFunc(context.EQUAL,1,4294967295),buffers.stencil.setOp(context.KEEP,context.KEEP,context.KEEP),buffers.stencil.setLocked(!0)}},MipmapBlurPass=class extends Pass{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new DownsamplingMaterial,this.upsamplingMaterial=new UpsamplingMaterial,this.resolution=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(value){if(this.levels!==value){const renderTarget=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let i=0;i=0;--i){const mipmap=upsamplingMipmaps[i];upsamplingMaterial.setSize(previousBuffer.width,previousBuffer.height),upsamplingMaterial.inputBuffer=previousBuffer.texture,upsamplingMaterial.supportBuffer=downsamplingMipmaps[i].texture,renderer.setRenderTarget(mipmap),renderer.render(scene,camera),previousBuffer=mipmap}}setSize(width,height){const resolution=this.resolution;resolution.set(width,height);let w=resolution.width,h=resolution.height;for(let i=0,l=this.downsamplingMipmaps.length;ithis.setSize(resolution.baseWidth,resolution.baseHeight)))}set mainScene(value){this.renderPass.mainScene=value}set mainCamera(value){this.renderPass.mainCamera=value}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const renderTarget=this.renderToScreen?null:this.renderTarget;this.renderPass.render(renderer,renderTarget,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height)}},ShaderPass=class extends Pass{constructor(material,input="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=material,this.input=input}setInput(input){this.input=input}render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest){const uniforms=this.fullscreenMaterial.uniforms;null!==inputBuffer&&void 0!==uniforms&&void 0!==uniforms[this.input]&&(uniforms[this.input].value=inputBuffer.texture),renderer.setRenderTarget(this.renderToScreen?null:outputBuffer),renderer.render(this.scene,this.camera)}initialize(renderer,alpha,frameBufferType){void 0!==frameBufferType&&frameBufferType!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},TiltShiftBlurPass=class extends KawaseBlurPass{constructor({offset:offset=0,rotation:rotation=0,focusArea:focusArea=.4,feather:feather=.3,kernelSize:kernelSize=KernelSize_MEDIUM,resolutionScale:resolutionScale=.5,resolutionX:resolutionX=Resolution.AUTO_SIZE,resolutionY:resolutionY=Resolution.AUTO_SIZE}={}){super({kernelSize:kernelSize,resolutionScale:resolutionScale,resolutionX:resolutionX,resolutionY:resolutionY}),this.blurMaterial=new TiltShiftBlurMaterial({kernelSize:kernelSize,offset:offset,rotation:rotation,focusArea:focusArea,feather:feather})}},EffectComposer=class{constructor(renderer=null,{depthBuffer:depthBuffer=!0,stencilBuffer:stencilBuffer=!1,multisampling:multisampling=0,frameBufferType:frameBufferType}={}){this.renderer=null,this.inputBuffer=this.createBuffer(depthBuffer,stencilBuffer,frameBufferType,multisampling),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new CopyPass,this.depthTexture=null,this.passes=[],this.timer=new class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(value){"undefined"!=typeof document&&void 0!==document.hidden&&(value?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=value)}get delta(){return.001*this._delta}get fixedDelta(){return.001*this._fixedDelta}set fixedDelta(value){this._fixedDelta=1e3*value}get elapsed(){return.001*this._elapsed}update(timestamp){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(void 0!==timestamp?timestamp:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},this.autoRenderToScreen=!0,this.setRenderer(renderer)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(value){const buffer=this.inputBuffer,multisampling=this.multisampling;multisampling>0&&value>0?(this.inputBuffer.samples=value,this.outputBuffer.samples=value,this.inputBuffer.dispose(),this.outputBuffer.dispose()):multisampling!==value&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(buffer.depthBuffer,buffer.stencilBuffer,buffer.texture.type,value),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(renderer){if(this.renderer=renderer,null!==renderer){const size=renderer.getSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),alpha=renderer.getContext().getContextAttributes().alpha,frameBufferType=this.inputBuffer.texture.type;frameBufferType===three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&"srgb"===getOutputColorSpace(renderer)&&(setTextureColorSpace(this.inputBuffer.texture,"srgb"),setTextureColorSpace(this.outputBuffer.texture,"srgb"),this.inputBuffer.dispose(),this.outputBuffer.dispose()),renderer.autoClear=!1,this.setSize(size.width,size.height);for(const pass of this.passes)pass.initialize(renderer,alpha,frameBufferType)}}replaceRenderer(renderer,updateDOM=!0){const oldRenderer=this.renderer,parent=oldRenderer.domElement.parentNode;return this.setRenderer(renderer),updateDOM&&null!==parent&&(parent.removeChild(oldRenderer.domElement),parent.appendChild(renderer.domElement)),oldRenderer}createDepthTexture(){const depthTexture=this.depthTexture=new three__WEBPACK_IMPORTED_MODULE_0__.DepthTexture;return this.inputBuffer.depthTexture=depthTexture,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(depthTexture.format=three__WEBPACK_IMPORTED_MODULE_0__.DepthStencilFormat,depthTexture.type=three__WEBPACK_IMPORTED_MODULE_0__.UnsignedInt248Type):depthTexture.type=three__WEBPACK_IMPORTED_MODULE_0__.UnsignedIntType,depthTexture}deleteDepthTexture(){if(null!==this.depthTexture){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const pass of this.passes)pass.setDepthTexture(null)}}createBuffer(depthBuffer,stencilBuffer,type,multisampling){const renderer=this.renderer,size=null===renderer?new three__WEBPACK_IMPORTED_MODULE_0__.Vector2:renderer.getDrawingBufferSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),options={minFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,magFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,stencilBuffer:stencilBuffer,depthBuffer:depthBuffer,type:type},renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(size.width,size.height,options);return multisampling>0&&(renderTarget.ignoreDepthForMultisampleCopy=!1,renderTarget.samples=multisampling),type===three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&"srgb"===getOutputColorSpace(renderer)&&setTextureColorSpace(renderTarget.texture,"srgb"),renderTarget.texture.name="EffectComposer.Buffer",renderTarget.texture.generateMipmaps=!1,renderTarget}setMainScene(scene){for(const pass of this.passes)pass.mainScene=scene}setMainCamera(camera){for(const pass of this.passes)pass.mainCamera=camera}addPass(pass,index){const passes=this.passes,renderer=this.renderer,drawingBufferSize=renderer.getDrawingBufferSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2),alpha=renderer.getContext().getContextAttributes().alpha,frameBufferType=this.inputBuffer.texture.type;if(pass.setRenderer(renderer),pass.setSize(drawingBufferSize.width,drawingBufferSize.height),pass.initialize(renderer,alpha,frameBufferType),this.autoRenderToScreen&&(passes.length>0&&(passes[passes.length-1].renderToScreen=!1),pass.renderToScreen&&(this.autoRenderToScreen=!1)),void 0!==index?passes.splice(index,0,pass):passes.push(pass),this.autoRenderToScreen&&(passes[passes.length-1].renderToScreen=!0),pass.needsDepthTexture||null!==this.depthTexture)if(null===this.depthTexture){const depthTexture=this.createDepthTexture();for(pass of passes)pass.setDepthTexture(depthTexture)}else pass.setDepthTexture(this.depthTexture)}removePass(pass){const passes=this.passes,index=passes.indexOf(pass);if(-1!==index&&passes.splice(index,1).length>0){if(null!==this.depthTexture){const reducer=(a,b)=>a||b.needsDepthTexture;passes.reduce(reducer,!1)||(pass.getDepthTexture()===this.depthTexture&&pass.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&index===passes.length&&(pass.renderToScreen=!1,passes.length>0&&(passes[passes.length-1].renderToScreen=!0))}}removeAllPasses(){const passes=this.passes;this.deleteDepthTexture(),passes.length>0&&(this.autoRenderToScreen&&(passes[passes.length-1].renderToScreen=!1),this.passes=[])}render(deltaTime){const renderer=this.renderer,copyPass=this.copyPass;let context,stencil,buffer,inputBuffer=this.inputBuffer,outputBuffer=this.outputBuffer,stencilTest=!1;void 0===deltaTime&&(this.timer.update(),deltaTime=this.timer.delta);for(const pass of this.passes)pass.enabled&&(pass.render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest),pass.needsSwap&&(stencilTest&&(copyPass.renderToScreen=pass.renderToScreen,context=renderer.getContext(),stencil=renderer.state.buffers.stencil,stencil.setFunc(context.NOTEQUAL,1,4294967295),copyPass.render(renderer,inputBuffer,outputBuffer,deltaTime,stencilTest),stencil.setFunc(context.EQUAL,1,4294967295)),buffer=inputBuffer,inputBuffer=outputBuffer,outputBuffer=buffer),pass instanceof MaskPass?stencilTest=!0:pass instanceof ClearMaskPass&&(stencilTest=!1))}setSize(width,height,updateStyle){const renderer=this.renderer,currentSize=renderer.getSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2);void 0!==width&&void 0!==height||(width=currentSize.width,height=currentSize.height),currentSize.width===width&¤tSize.height===height||renderer.setSize(width,height,updateStyle);const drawingBufferSize=renderer.getDrawingBufferSize(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2);this.inputBuffer.setSize(drawingBufferSize.width,drawingBufferSize.height),this.outputBuffer.setSize(drawingBufferSize.width,drawingBufferSize.height);for(const pass of this.passes)pass.setSize(drawingBufferSize.width,drawingBufferSize.height)}reset(){const autoReset=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=autoReset}dispose(){for(const pass of this.passes)pass.dispose();this.passes=[],null!==this.inputBuffer&&this.inputBuffer.dispose(),null!==this.outputBuffer&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},EffectShaderData=class{constructor(){this.shaderParts=new Map([[EffectShaderSection.FRAGMENT_HEAD,null],[EffectShaderSection.FRAGMENT_MAIN_UV,null],[EffectShaderSection.FRAGMENT_MAIN_IMAGE,null],[EffectShaderSection.VERTEX_HEAD,null],[EffectShaderSection.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=EffectAttribute.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace="srgb-linear"}};var Selection=class extends Set{constructor(iterable,layer=10){super(),this.l=layer,this.exclusive=!1,void 0!==iterable&&this.set(iterable)}get layer(){return this.l}set layer(value){const currentLayer=this.l;for(const object of this)object.layers.disable(currentLayer),object.layers.enable(value);this.l=value}getLayer(){return this.layer}setLayer(value){this.layer=value}isExclusive(){return this.exclusive}setExclusive(value){this.exclusive=value}clear(){const layer=this.layer;for(const object of this)object.layers.disable(layer);return super.clear()}set(objects){this.clear();for(const object of objects)this.add(object);return this}indexOf(object){return this.has(object)?0:-1}add(object){return this.exclusive?object.layers.set(this.layer):object.layers.enable(this.layer),super.add(object)}delete(object){return this.has(object)&&object.layers.disable(this.layer),super.delete(object)}toggle(object){let result;return this.has(object)?(this.delete(object),result=!1):(this.add(object),result=!0),result}setVisible(visible){for(const object of this)visible?object.layers.enable(0):object.layers.disable(0);return this}},blendFunctions=new Map([[BlendFunction.ADD,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}"],[BlendFunction.ALPHA,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}"],[BlendFunction.AVERAGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}"],[BlendFunction.COLOR,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.COLOR_BURN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}"],[BlendFunction.COLOR_DODGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}"],[BlendFunction.DARKEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}"],[BlendFunction.DIFFERENCE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}"],[BlendFunction.DIVIDE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}"],[BlendFunction.DST,null],[BlendFunction.EXCLUSION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}"],[BlendFunction.HARD_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}"],[BlendFunction.HARD_MIX,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}"],[BlendFunction.HUE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.INVERT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}"],[BlendFunction.INVERT_RGB,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}"],[BlendFunction.LIGHTEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}"],[BlendFunction.LINEAR_BURN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}"],[BlendFunction.LINEAR_DODGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}"],[BlendFunction.LINEAR_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}"],[BlendFunction.LUMINOSITY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.MULTIPLY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}"],[BlendFunction.NEGATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}"],[BlendFunction.NORMAL,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}"],[BlendFunction.OVERLAY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}"],[BlendFunction.PIN_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}"],[BlendFunction.REFLECT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}"],[BlendFunction.SATURATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[BlendFunction.SCREEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}"],[BlendFunction.SOFT_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}"],[BlendFunction.SRC,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}"],[BlendFunction.SUBTRACT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}"],[BlendFunction.VIVID_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}"]]),BlendMode=class extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(blendFunction,opacity=1){super(),this._blendFunction=blendFunction,this.opacity=new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(opacity)}getOpacity(){return this.opacity.value}setOpacity(value){this.opacity.value=value}get blendFunction(){return this._blendFunction}set blendFunction(value){this._blendFunction=value,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(value){this.blendFunction=value}getShaderCode(){return blendFunctions.get(this.blendFunction)}},Effect=class extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(name,fragmentShader,{attributes:attributes=EffectAttribute.NONE,blendFunction:blendFunction=BlendFunction.NORMAL,defines:defines=new Map,uniforms:uniforms=new Map,extensions:extensions=null,vertexShader:vertexShader=null}={}){super(),this.name=name,this.renderer=null,this.attributes=attributes,this.fragmentShader=fragmentShader,this.vertexShader=vertexShader,this.defines=defines,this.uniforms=uniforms,this.extensions=extensions,this.blendMode=new BlendMode(blendFunction),this.blendMode.addEventListener("change",(event=>this.setChanged())),this._inputColorSpace="srgb-linear",this._outputColorSpace=""}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(value){this._inputColorSpace=value,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(value){this._outputColorSpace=value,this.setChanged()}set mainScene(value){}set mainCamera(value){}getName(){return this.name}setRenderer(renderer){this.renderer=renderer}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(attributes){this.attributes=attributes,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(fragmentShader){this.fragmentShader=fragmentShader,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(vertexShader){this.vertexShader=vertexShader,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){}update(renderer,inputBuffer,deltaTime){}setSize(width,height){}initialize(renderer,alpha,frameBufferType){}dispose(){for(const key of Object.keys(this)){const property=this[key];(property instanceof three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Material||property instanceof three__WEBPACK_IMPORTED_MODULE_0__.Texture||property instanceof Pass)&&this[key].dispose()}}},BloomEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SCREEN,luminanceThreshold:luminanceThreshold=.9,luminanceSmoothing:luminanceSmoothing=.025,mipmapBlur:mipmapBlur=!1,intensity:intensity=1,radius:radius=.85,levels:levels=8,kernelSize:kernelSize=KernelSize_LARGE,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("BloomEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}",{blendFunction:blendFunction,uniforms:new Map([["map",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["intensity",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(intensity)]])}),this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new KawaseBlurPass({kernelSize:kernelSize}),this.luminancePass=new LuminancePass({colorOutput:!0}),this.luminanceMaterial.threshold=luminanceThreshold,this.luminanceMaterial.smoothing=luminanceSmoothing,this.mipmapBlurPass=new MipmapBlurPass,this.mipmapBlurPass.enabled=mipmapBlur,this.mipmapBlurPass.radius=radius,this.mipmapBlurPass.levels=levels,this.uniforms.get("map").value=mipmapBlur?this.mipmapBlurPass.texture:this.renderTarget.texture;const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(value){this.resolution.preferredWidth=value}get height(){return this.resolution.height}set height(value){this.resolution.preferredHeight=value}get dithering(){return this.blurPass.dithering}set dithering(value){this.blurPass.dithering=value}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(value){this.blurPass.kernelSize=value}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(value){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(value){this.uniforms.get("intensity").value=value}getIntensity(){return this.intensity}setIntensity(value){this.intensity=value}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}update(renderer,inputBuffer,deltaTime){const renderTarget=this.renderTarget,luminancePass=this.luminancePass;luminancePass.enabled?(luminancePass.render(renderer,inputBuffer),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(renderer,luminancePass.renderTarget):this.blurPass.render(renderer,luminancePass.renderTarget,renderTarget)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(renderer,inputBuffer):this.blurPass.render(renderer,inputBuffer,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height),this.blurPass.resolution.copy(resolution),this.luminancePass.setSize(width,height),this.mipmapBlurPass.setSize(width,height)}initialize(renderer,alpha,frameBufferType){this.blurPass.initialize(renderer,alpha,frameBufferType),this.luminancePass.initialize(renderer,alpha,frameBufferType),this.mipmapBlurPass.initialize(renderer,alpha,frameBufferType),void 0!==frameBufferType&&(this.renderTarget.texture.type=frameBufferType,"srgb"===getOutputColorSpace(renderer)&&setTextureColorSpace(this.renderTarget.texture,"srgb"))}},BrightnessContrastEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC,brightness:brightness=0,contrast:contrast=0}={}){super("BrightnessContrastEffect","uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(color+vec3(0.5),inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["brightness",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(brightness)],["contrast",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(contrast)]])}),this.inputColorSpace="srgb"}get brightness(){return this.uniforms.get("brightness").value}set brightness(value){this.uniforms.get("brightness").value=value}getBrightness(){return this.brightness}setBrightness(value){this.brightness=value}get contrast(){return this.uniforms.get("contrast").value}set contrast(value){this.uniforms.get("contrast").value=value}getContrast(){return this.contrast}setContrast(value){this.contrast=value}},ColorAverageEffect=class extends Effect{constructor(blendFunction){super("ColorAverageEffect","void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",{blendFunction:blendFunction})}},ColorDepthEffect=class extends Effect{constructor({blendFunction:blendFunction,bits:bits=16}={}){super("ColorDepthEffect","uniform float factor;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(floor(inputColor.rgb*factor+0.5)/factor,inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["factor",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)]])}),this.bits=0,this.bitDepth=bits}get bitDepth(){return this.bits}set bitDepth(value){this.bits=value,this.uniforms.get("factor").value=Math.pow(2,value/3)}getBitDepth(){return this.bitDepth}setBitDepth(value){this.bitDepth=value}},ChromaticAberrationEffect=class extends Effect{constructor({offset:offset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(.001,5e-4),radialModulation:radialModulation=!1,modulationOffset:modulationOffset=.15}={}){super("ChromaticAberrationEffect","#ifdef RADIAL_MODULATION\nuniform float modulationOffset;\n#endif\nvarying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=inputColor.ra;vec2 ba=inputColor.ba;\n#ifdef RADIAL_MODULATION\nconst vec2 center=vec2(0.5);float d=distance(uv,center)*2.0;d=max(d-modulationOffset,0.0);if(vActive>0.0&&d>0.0){ra=texture2D(inputBuffer,mix(uv,vUvR,d)).ra;ba=texture2D(inputBuffer,mix(uv,vUvB,d)).ba;}\n#else\nif(vActive>0.0){ra=texture2D(inputBuffer,vUvR).ra;ba=texture2D(inputBuffer,vUvB).ba;}\n#endif\noutputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}",{vertexShader:"uniform vec2 offset;varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vActive=(shift.x!=0.0||shift.y!=0.0)?1.0:0.0;vUvR=uv+shift;vUvB=uv-shift;}",attributes:EffectAttribute.CONVOLUTION,uniforms:new Map([["offset",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(offset)],["modulationOffset",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(modulationOffset)]])}),this.radialModulation=radialModulation}get offset(){return this.uniforms.get("offset").value}set offset(value){this.uniforms.get("offset").value=value}get radialModulation(){return this.defines.has("RADIAL_MODULATION")}set radialModulation(value){value?this.defines.set("RADIAL_MODULATION","1"):this.defines.delete("RADIAL_MODULATION"),this.setChanged()}get modulationOffset(){return this.uniforms.get("modulationOffset").value}set modulationOffset(value){this.uniforms.get("modulationOffset").value=value}getOffset(){return this.offset}setOffset(value){this.offset=value}},DepthEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC,inverted:inverted=!1}={}){super("DepthEffect","void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){\n#ifdef INVERTED\nvec3 color=vec3(1.0-depth);\n#else\nvec3 color=vec3(depth);\n#endif\noutputColor=vec4(color,inputColor.a);}",{blendFunction:blendFunction,attributes:EffectAttribute.DEPTH}),this.inverted=inverted}get inverted(){return this.defines.has("INVERTED")}set inverted(value){this.inverted!==value&&(value?this.defines.set("INVERTED","1"):this.defines.delete("INVERTED"),this.setChanged())}isInverted(){return this.inverted}setInverted(value){this.inverted=value}},DepthOfFieldEffect=class extends Effect{constructor(camera,{blendFunction:blendFunction,worldFocusDistance:worldFocusDistance,worldFocusRange:worldFocusRange,focusDistance:focusDistance=0,focalLength:focalLength=.1,focusRange:focusRange=focalLength,bokehScale:bokehScale=1,resolutionScale:resolutionScale=1,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("DepthOfFieldEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;\n#else\nuniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;\n#endif\nuniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float cocNear=texture2D(nearCoCBuffer,uv).r;cocNear=min(cocNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,cocNear);outputColor=result;}",{blendFunction:blendFunction,attributes:EffectAttribute.DEPTH,uniforms:new Map([["nearColorBuffer",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["farColorBuffer",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["nearCoCBuffer",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["scale",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)]])}),this.camera=camera,this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new ShaderPass(new CircleOfConfusionMaterial(camera));const cocMaterial=this.cocMaterial;cocMaterial.focusDistance=focusDistance,cocMaterial.focusRange=focusRange,void 0!==worldFocusDistance&&(cocMaterial.worldFocusDistance=worldFocusDistance),void 0!==worldFocusRange&&(cocMaterial.worldFocusRange=worldFocusRange),this.blurPass=new KawaseBlurPass({resolutionScale:resolutionScale,resolutionX:resolutionX,resolutionY:resolutionY,kernelSize:KernelSize_MEDIUM}),this.maskPass=new ShaderPass(new MaskMaterial(this.renderTargetCoC.texture));const maskMaterial=this.maskPass.fullscreenMaterial;maskMaterial.maskFunction=MaskFunction.MULTIPLY,maskMaterial.colorChannel=ColorChannel_GREEN,this.bokehNearBasePass=new ShaderPass(new BokehMaterial(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new ShaderPass(new BokehMaterial(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new ShaderPass(new BokehMaterial(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new ShaderPass(new BokehMaterial(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null;const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight))),this.bokehScale=bokehScale}set mainCamera(value){this.camera=value,this.cocMaterial.copyCameraSettings(value)}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}getResolution(){return this.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(value){this.bokehNearBasePass.fullscreenMaterial.scale=value,this.bokehNearFillPass.fullscreenMaterial.scale=value,this.bokehFarBasePass.fullscreenMaterial.scale=value,this.bokehFarFillPass.fullscreenMaterial.scale=value,this.maskPass.fullscreenMaterial.strength=value,this.uniforms.get("scale").value=value}getBokehScale(){return this.bokehScale}setBokehScale(value){this.bokehScale=value}getTarget(){return this.target}setTarget(value){this.target=value}calculateFocusDistance(target){const camera=this.camera;return viewZToOrthographicDepth(-camera.position.distanceTo(target),camera.near,camera.far)}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.circleOfConfusionMaterial.depthBuffer=depthTexture,this.circleOfConfusionMaterial.depthPacking=depthPacking}update(renderer,inputBuffer,deltaTime){const renderTarget=this.renderTarget,renderTargetCoC=this.renderTargetCoC,renderTargetCoCBlurred=this.renderTargetCoCBlurred,renderTargetMasked=this.renderTargetMasked;if(null!==this.target){const distance=this.calculateFocusDistance(this.target);this.cocMaterial.focusDistance=distance}this.cocPass.render(renderer,null,renderTargetCoC),this.blurPass.render(renderer,renderTargetCoC,renderTargetCoCBlurred),this.maskPass.render(renderer,inputBuffer,renderTargetMasked),this.bokehFarBasePass.render(renderer,renderTargetMasked,renderTarget),this.bokehFarFillPass.render(renderer,renderTarget,this.renderTargetFar),this.bokehNearBasePass.render(renderer,inputBuffer,renderTarget),this.bokehNearFillPass.render(renderer,renderTarget,this.renderTargetNear)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height);const w=resolution.width,h=resolution.height;this.cocPass.setSize(width,height),this.blurPass.setSize(width,height),this.maskPass.setSize(width,height),this.renderTargetCoC.setSize(width,height),this.renderTargetMasked.setSize(width,height),this.renderTarget.setSize(w,h),this.renderTargetNear.setSize(w,h),this.renderTargetFar.setSize(w,h),this.renderTargetCoCBlurred.setSize(w,h),this.bokehNearBasePass.fullscreenMaterial.setSize(width,height),this.bokehNearFillPass.fullscreenMaterial.setSize(width,height),this.bokehFarBasePass.fullscreenMaterial.setSize(width,height),this.bokehFarFillPass.fullscreenMaterial.setSize(width,height)}initialize(renderer,alpha,frameBufferType){this.cocPass.initialize(renderer,alpha,frameBufferType),this.maskPass.initialize(renderer,alpha,frameBufferType),this.bokehNearBasePass.initialize(renderer,alpha,frameBufferType),this.bokehNearFillPass.initialize(renderer,alpha,frameBufferType),this.bokehFarBasePass.initialize(renderer,alpha,frameBufferType),this.bokehFarFillPass.initialize(renderer,alpha,frameBufferType),this.blurPass.initialize(renderer,alpha,three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType);this.maskPass.fullscreenMaterial.maskFunction=alpha?MaskFunction.MULTIPLY:MaskFunction.MULTIPLY_RGB_SET_ALPHA,renderer.capabilities.logarithmicDepthBuffer&&(this.cocPass.fullscreenMaterial.defines.LOG_DEPTH="1"),void 0!==frameBufferType&&(this.renderTarget.texture.type=frameBufferType,this.renderTargetNear.texture.type=frameBufferType,this.renderTargetFar.texture.type=frameBufferType,this.renderTargetMasked.texture.type=frameBufferType,"srgb"===getOutputColorSpace(renderer)&&(setTextureColorSpace(this.renderTarget.texture,"srgb"),setTextureColorSpace(this.renderTargetNear.texture,"srgb"),setTextureColorSpace(this.renderTargetFar.texture,"srgb"),setTextureColorSpace(this.renderTargetMasked.texture,"srgb")))}},DotScreenEffect=class extends Effect{constructor({blendFunction:blendFunction,angle:angle=.5*Math.PI,scale:scale=1}={}){super("DotScreenEffect","uniform vec2 angle;uniform float scale;float pattern(const in vec2 uv){vec2 point=scale*vec2(dot(angle.yx,vec2(uv.x,-uv.y)),dot(angle,uv));return(sin(point.x)*sin(point.y))*4.0;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(inputColor.rgb*10.0-5.0+pattern(uv*resolution));outputColor=vec4(color,inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["angle",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)],["scale",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(scale)]])}),this.angle=angle}get angle(){return Math.acos(this.uniforms.get("angle").value.y)}set angle(value){this.uniforms.get("angle").value.set(Math.sin(value),Math.cos(value))}getAngle(){return this.angle}setAngle(value){this.angle=value}get scale(){return this.uniforms.get("scale").value}set scale(value){this.uniforms.get("scale").value=value}},FXAAEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC}={}){super("FXAAEffect","#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#define QUALITY(q) ((q) < 5 ? 1.0 : ((q) > 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5))\n#define ONE_OVER_TWELVE 0.08333333333333333\nvarying vec2 vUvDown;varying vec2 vUvUp;varying vec2 vUvLeft;varying vec2 vUvRight;varying vec2 vUvDownLeft;varying vec2 vUvUpRight;varying vec2 vUvUpLeft;varying vec2 vUvDownRight;vec4 fxaa(const in vec4 inputColor,const in vec2 uv){float lumaCenter=luminance(inputColor.rgb);float lumaDown=luminance(texture2D(inputBuffer,vUvDown).rgb);float lumaUp=luminance(texture2D(inputBuffer,vUvUp).rgb);float lumaLeft=luminance(texture2D(inputBuffer,vUvLeft).rgb);float lumaRight=luminance(texture2D(inputBuffer,vUvRight).rgb);float lumaMin=min(lumaCenter,min(min(lumaDown,lumaUp),min(lumaLeft,lumaRight)));float lumaMax=max(lumaCenter,max(max(lumaDown,lumaUp),max(lumaLeft,lumaRight)));float lumaRange=lumaMax-lumaMin;if(lumaRange=edgeVertical);float stepLength=isHorizontal?texelSize.y:texelSize.x;float luma1=isHorizontal?lumaDown:lumaLeft;float luma2=isHorizontal?lumaUp:lumaRight;float gradient1=abs(luma1-lumaCenter);float gradient2=abs(luma2-lumaCenter);bool is1Steepest=gradient1>=gradient2;float gradientScaled=0.25*max(gradient1,gradient2);float lumaLocalAverage=0.0;if(is1Steepest){stepLength=-stepLength;lumaLocalAverage=0.5*(luma1+lumaCenter);}else{lumaLocalAverage=0.5*(luma2+lumaCenter);}vec2 currentUv=uv;if(isHorizontal){currentUv.y+=stepLength*0.5;}else{currentUv.x+=stepLength*0.5;}vec2 offset=isHorizontal?vec2(texelSize.x,0.0):vec2(0.0,texelSize.y);vec2 uv1=currentUv-offset*QUALITY(0);vec2 uv2=currentUv+offset*QUALITY(0);float lumaEnd1=luminance(texture2D(inputBuffer,uv1).rgb);float lumaEnd2=luminance(texture2D(inputBuffer,uv2).rgb);lumaEnd1-=lumaLocalAverage;lumaEnd2-=lumaLocalAverage;bool reached1=abs(lumaEnd1)>=gradientScaled;bool reached2=abs(lumaEnd2)>=gradientScaled;bool reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(1);}if(!reached2){uv2+=offset*QUALITY(1);}if(!reachedBoth){for(int i=2;i=gradientScaled;reached2=abs(lumaEnd2)>=gradientScaled;reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(i);}if(!reached2){uv2+=offset*QUALITY(i);}if(reachedBoth){break;}}}float distance1=isHorizontal?(uv.x-uv1.x):(uv.y-uv1.y);float distance2=isHorizontal?(uv2.x-uv.x):(uv2.y-uv.y);bool isDirection1=distance1distortion.x-columns*random){float sx=clamp(ceil(seeds.x),0.0,1.0);uv.y=sx*(1.0-(uv.y+distortion.y))+(1.0-sx)*distortion.y;}if(uv.xdistortion.y-columns*random){float sy=clamp(ceil(seeds.y),0.0,1.0);uv.x=sy*distortion.x+(1.0-sy)*(1.0-(uv.x+distortion.x));}vec2 normal=texture2D(perturbationMap,uv*random*random).rg;uv+=normal*seeds*(random*0.2);}}",{uniforms:new Map([["perturbationMap",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["columns",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(columns)],["active",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(!1)],["random",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)],["seeds",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)],["distortion",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)]])}),null===perturbationMap){const map=new NoiseTexture(dtSize,dtSize,three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat);map.name=textureTag,this.perturbationMap=map}else this.perturbationMap=perturbationMap;this.time=0,this.distortion=this.uniforms.get("distortion").value,this.delay=delay,this.duration=duration,this.breakPoint=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(randomFloat(this.delay.x,this.delay.y),randomFloat(this.duration.x,this.duration.y)),this.strength=strength,this.mode=GlitchMode.SPORADIC,this.ratio=ratio,this.chromaticAberrationOffset=chromaticAberrationOffset}get seeds(){return this.uniforms.get("seeds").value}get active(){return this.uniforms.get("active").value}isActive(){return this.active}get minDelay(){return this.delay.x}set minDelay(value){this.delay.x=value}getMinDelay(){return this.delay.x}setMinDelay(value){this.delay.x=value}get maxDelay(){return this.delay.y}set maxDelay(value){this.delay.y=value}getMaxDelay(){return this.delay.y}setMaxDelay(value){this.delay.y=value}get minDuration(){return this.duration.x}set minDuration(value){this.duration.x=value}getMinDuration(){return this.duration.x}setMinDuration(value){this.duration.x=value}get maxDuration(){return this.duration.y}set maxDuration(value){this.duration.y=value}getMaxDuration(){return this.duration.y}setMaxDuration(value){this.duration.y=value}get minStrength(){return this.strength.x}set minStrength(value){this.strength.x=value}getMinStrength(){return this.strength.x}setMinStrength(value){this.strength.x=value}get maxStrength(){return this.strength.y}set maxStrength(value){this.strength.y=value}getMaxStrength(){return this.strength.y}setMaxStrength(value){this.strength.y=value}getMode(){return this.mode}setMode(value){this.mode=value}getGlitchRatio(){return 1-this.ratio}setGlitchRatio(value){this.ratio=Math.min(Math.max(1-value,0),1)}get columns(){return this.uniforms.get("columns").value}set columns(value){this.uniforms.get("columns").value=value}getGlitchColumns(){return this.columns}setGlitchColumns(value){this.columns=value}getChromaticAberrationOffset(){return this.chromaticAberrationOffset}setChromaticAberrationOffset(value){this.chromaticAberrationOffset=value}get perturbationMap(){return this.uniforms.get("perturbationMap").value}set perturbationMap(value){const currentMap=this.perturbationMap;null!==currentMap&¤tMap.name===textureTag&¤tMap.dispose(),value.minFilter=value.magFilter=three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,value.wrapS=value.wrapT=three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping,value.generateMipmaps=!1,this.uniforms.get("perturbationMap").value=value}getPerturbationMap(){return this.perturbationMap}setPerturbationMap(value){this.perturbationMap=value}generatePerturbationMap(value=64){const map=new NoiseTexture(value,value,three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat);return map.name=textureTag,map}update(renderer,inputBuffer,deltaTime){const mode=this.mode,breakPoint=this.breakPoint,offset=this.chromaticAberrationOffset,s=this.strength;let trigger,time=this.time,active=!1,r=0,a=0;mode!==GlitchMode.DISABLED&&(mode===GlitchMode.SPORADIC&&(time+=deltaTime,trigger=time>breakPoint.x,time>=breakPoint.x+breakPoint.y&&(breakPoint.set(randomFloat(this.delay.x,this.delay.y),randomFloat(this.duration.x,this.duration.y)),time=0)),r=Math.random(),this.uniforms.get("random").value=r,trigger&&r>this.ratio||mode===GlitchMode.CONSTANT_WILD?(active=!0,r*=.03*s.y,a=randomFloat(-Math.PI,Math.PI),this.seeds.set(randomFloat(-s.y,s.y),randomFloat(-s.y,s.y)),this.distortion.set(randomFloat(0,1),randomFloat(0,1))):(trigger||mode===GlitchMode.CONSTANT_MILD)&&(active=!0,r*=.03*s.x,a=randomFloat(-Math.PI,Math.PI),this.seeds.set(randomFloat(-s.x,s.x),randomFloat(-s.x,s.x)),this.distortion.set(randomFloat(0,1),randomFloat(0,1))),this.time=time),null!==offset&&(active?offset.set(Math.cos(a),Math.sin(a)).multiplyScalar(r):offset.set(0,0)),this.uniforms.get("active").value=active}dispose(){const map=this.perturbationMap;null!==map&&map.name===textureTag&&map.dispose()}},v=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,m=new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4,GodRaysEffect=class extends Effect{constructor(camera,lightSource,{blendFunction:blendFunction=BlendFunction.SCREEN,samples:samples=60,density:density=.96,decay:decay=.9,weight:weight=.4,exposure:exposure=.6,clampMax:clampMax=1,blur:blur=!0,kernelSize:kernelSize=KernelSize_SMALL,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("GodRaysEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv);}",{blendFunction:blendFunction,attributes:EffectAttribute.DEPTH,uniforms:new Map([["map",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)]])}),this.camera=camera,this._lightSource=lightSource,this.lightSource=lightSource,this.lightScene=new three__WEBPACK_IMPORTED_MODULE_0__.Scene,this.screenPosition=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,this.renderTargetA=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="GodRays.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="GodRays.Target.B",this.uniforms.get("map").value=this.renderTargetB.texture,this.renderTargetLight=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1),this.renderTargetLight.texture.name="GodRays.Light",this.renderTargetLight.depthTexture=new three__WEBPACK_IMPORTED_MODULE_0__.DepthTexture,this.renderPassLight=new RenderPass(this.lightScene,camera),this.renderPassLight.clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(0),this.clearPass=new ClearPass(!0,!1,!1),this.clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(0),this.blurPass=new KawaseBlurPass({kernelSize:kernelSize}),this.blurPass.enabled=blur,this.depthMaskPass=new ShaderPass(new DepthMaskMaterial);const depthMaskMaterial=this.depthMaskMaterial;depthMaskMaterial.depthBuffer1=this.renderTargetLight.depthTexture,depthMaskMaterial.copyCameraSettings(camera),this.godRaysPass=new ShaderPass(new GodRaysMaterial(this.screenPosition));const godRaysMaterial=this.godRaysMaterial;godRaysMaterial.density=density,godRaysMaterial.decay=decay,godRaysMaterial.weight=weight,godRaysMaterial.exposure=exposure,godRaysMaterial.maxIntensity=clampMax,godRaysMaterial.samples=samples;const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight)))}set mainCamera(value){this.camera=value,this.renderPassLight.mainCamera=value,this.depthMaskMaterial.copyCameraSettings(value)}get lightSource(){return this._lightSource}set lightSource(value){this._lightSource=value,null!==value&&(value.material.depthWrite=!1,value.material.transparent=!0)}getBlurPass(){return this.blurPass}get texture(){return this.renderTargetB.texture}getTexture(){return this.texture}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get godRaysMaterial(){return this.godRaysPass.fullscreenMaterial}getGodRaysMaterial(){return this.godRaysMaterial}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(value){this.resolution.preferredWidth=value}get height(){return this.resolution.height}set height(value){this.resolution.preferredHeight=value}get dithering(){return this.godRaysMaterial.dithering}set dithering(value){const material=this.godRaysMaterial;material.dithering=value,material.needsUpdate=!0}get blur(){return this.blurPass.enabled}set blur(value){this.blurPass.enabled=value}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(value){this.blurPass.kernelSize=value}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}get samples(){return this.godRaysMaterial.samples}set samples(value){this.godRaysMaterial.samples=value}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthMaskPass.fullscreenMaterial.depthBuffer0=depthTexture,this.depthMaskPass.fullscreenMaterial.depthPacking0=depthPacking}update(renderer,inputBuffer,deltaTime){const lightSource=this.lightSource,parent=lightSource.parent,matrixAutoUpdate=lightSource.matrixAutoUpdate,renderTargetA=this.renderTargetA,renderTargetLight=this.renderTargetLight;lightSource.material.depthWrite=!0,lightSource.matrixAutoUpdate=!1,lightSource.updateWorldMatrix(!0,!1),null!==parent&&(matrixAutoUpdate||m.copy(lightSource.matrix),lightSource.matrix.copy(lightSource.matrixWorld)),this.lightScene.add(lightSource),this.renderPassLight.render(renderer,renderTargetLight),this.clearPass.render(renderer,renderTargetA),this.depthMaskPass.render(renderer,renderTargetLight,renderTargetA),lightSource.material.depthWrite=!1,lightSource.matrixAutoUpdate=matrixAutoUpdate,null!==parent&&(matrixAutoUpdate||lightSource.matrix.copy(m),parent.add(lightSource)),v.setFromMatrixPosition(lightSource.matrixWorld).project(this.camera),this.screenPosition.set(Math.min(Math.max(.5*(v.x+1),-1),2),Math.min(Math.max(.5*(v.y+1),-1),2)),this.blurPass.enabled&&this.blurPass.render(renderer,renderTargetA,renderTargetA),this.godRaysPass.render(renderer,renderTargetA,this.renderTargetB)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height);const w=resolution.width,h=resolution.height;this.renderTargetA.setSize(w,h),this.renderTargetB.setSize(w,h),this.renderTargetLight.setSize(w,h),this.blurPass.resolution.copy(resolution)}initialize(renderer,alpha,frameBufferType){this.blurPass.initialize(renderer,alpha,frameBufferType),this.renderPassLight.initialize(renderer,alpha,frameBufferType),this.depthMaskPass.initialize(renderer,alpha,frameBufferType),this.godRaysPass.initialize(renderer,alpha,frameBufferType),void 0!==frameBufferType&&(this.renderTargetA.texture.type=frameBufferType,this.renderTargetB.texture.type=frameBufferType,this.renderTargetLight.texture.type=frameBufferType,"srgb"===getOutputColorSpace(renderer)&&(setTextureColorSpace(this.renderTargetA.texture,"srgb"),setTextureColorSpace(this.renderTargetB.texture,"srgb"),setTextureColorSpace(this.renderTargetLight.texture,"srgb")))}},GridEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.OVERLAY,scale:scale=1,lineWidth:lineWidth=0}={}){super("GridEffect","uniform vec2 scale;uniform float lineWidth;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float grid=0.5-max(abs(mod(uv.x*scale.x,1.0)-0.5),abs(mod(uv.y*scale.y,1.0)-0.5));outputColor=vec4(vec3(smoothstep(0.0,lineWidth,grid)),inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["scale",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)],["lineWidth",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(lineWidth)]])}),this.resolution=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,this.s=0,this.scale=scale,this.l=0,this.lineWidth=lineWidth}get scale(){return this.s}set scale(value){this.s=Math.max(value,1e-6),this.setSize(this.resolution.width,this.resolution.height)}getScale(){return this.scale}setScale(value){this.scale=value}get lineWidth(){return this.l}set lineWidth(value){this.l=value,this.setSize(this.resolution.width,this.resolution.height)}getLineWidth(){return this.lineWidth}setLineWidth(value){this.lineWidth=value}setSize(width,height){this.resolution.set(width,height);const aspect=width/height,scale=this.scale*(.125*height);this.uniforms.get("scale").value.set(aspect*scale,scale),this.uniforms.get("lineWidth").value=scale/height+this.lineWidth}},HueSaturationEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC,hue:hue=0,saturation:saturation=0}={}){super("HueSaturationEffect","uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["hue",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3)],["saturation",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(saturation)]])}),this.hue=hue}get saturation(){return this.uniforms.get("saturation").value}set saturation(value){this.uniforms.get("saturation").value=value}getSaturation(){return this.saturation}setSaturation(value){this.saturation=value}get hue(){const hue=this.uniforms.get("hue").value;return Math.acos((3*hue.x-1)/2)}set hue(value){const s=Math.sin(value),c2=Math.cos(value);this.uniforms.get("hue").value.set((2*c2+1)/3,(-Math.sqrt(3)*s-c2+1)/3,(Math.sqrt(3)*s-c2+1)/3)}getHue(){return this.hue}setHue(value){this.hue=value}};function createCanvas(width,height,data){const canvas=document.createElement("canvas"),context=canvas.getContext("2d");if(canvas.width=width,canvas.height=height,data instanceof Image)context.drawImage(data,0,0);else{const imageData=context.createImageData(width,height);imageData.data.set(data),context.putImageData(imageData,0,0)}return canvas}var RawImageData=class _RawImageData{constructor(width=0,height=0,data=null){this.width=width,this.height=height,this.data=data}toCanvas(){return"undefined"==typeof document?null:createCanvas(this.width,this.height,this.data)}static from(image){const{width:width,height:height}=image;let data;if(image instanceof Image){const canvas=createCanvas(width,height,image);if(null!==canvas){data=canvas.getContext("2d").getImageData(0,0,width,height).data}}else data=image.data;return new _RawImageData(width,height,data)}},c=new three__WEBPACK_IMPORTED_MODULE_0__.Color,LookupTexture=class _LookupTexture extends three__WEBPACK_IMPORTED_MODULE_0__.Data3DTexture{constructor(data,size){super(data,size,size,size),this.type=three__WEBPACK_IMPORTED_MODULE_0__.FloatType,this.format=three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat,this.minFilter=three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,this.magFilter=three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,this.wrapS=three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping,this.wrapT=three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping,this.wrapR=three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping,this.unpackAlignment=1,this.needsUpdate=!0,setTextureColorSpace(this,"srgb-linear"),this.domainMin=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(0,0,0),this.domainMax=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(1,1,1)}get isLookupTexture3D(){return!0}scaleUp(size,transferData=!0){const image=this.image;let promise;return promise=size<=image.width?Promise.reject(new Error("The target size must be greater than the current size")):new Promise(((resolve,reject)=>{const workerURL=URL.createObjectURL(new Blob(['"use strict";(()=>{var O={SCALE_UP:"lut.scaleup"};var _=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function d(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function V(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function k(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)V(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=_[0];P[0]=s,P[1]=F,P[2]=f;let o=_[1],L=x-w,S=u-c,U=b-l;o[0]=L*M[0]+w,o[1]=S*M[1]+c,o[2]=U*M[2]+l,V(a,t,o[0],o[1],o[2],n[0]),o[0]=L*g[0]+w,o[1]=S*g[1]+c,o[2]=U*g[2]+l,V(a,t,o[0],o[1],o[2],n[1]),o[0]=L*X[0]+w,o[1]=S*X[1]+c,o[2]=U*X[2]+l,V(a,t,o[0],o[1],o[2],n[2]),o[0]=L*Y[0]+w,o[1]=S*Y[1]+c,o[2]=U*Y[2]+l,V(a,t,o[0],o[1],o[2],n[3]);let T=d(g,X,Y,P)*6,q=d(M,X,Y,P)*6,C=d(M,g,Y,P)*6,E=d(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=q,n[1][1]*=q,n[1][2]*=q,n[2][0]*=C,n[2][1]*=C,n[2][2]*=C,n[3][0]*=E,n[3][1]*=E,n[3][2]*=E,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var v=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(r**3*4),y=t instanceof Uint8Array?255:1,h=r**2,A=1/(r-1);for(let w=0;w{let t=a.data,r=t.data;switch(t.operation){case O.SCALE_UP:r=v.expand(r,t.size);break}postMessage(r,[r.buffer]),close()});})();\n'],{type:"text/javascript"})),worker=new Worker(workerURL);worker.addEventListener("error",(event=>reject(event.error))),worker.addEventListener("message",(event=>{const lut=new _LookupTexture(event.data,size);copyTextureColorSpace(this,lut),lut.type=this.type,lut.name=this.name,URL.revokeObjectURL(workerURL),resolve(lut)}));const transferList=transferData?[image.data.buffer]:[];worker.postMessage({operation:LUTOperation_SCALE_UP,data:image.data,size:size},transferList)})),promise}applyLUT(lut){const img0=this.image,img1=lut.image,size0=Math.min(img0.width,img0.height,img0.depth);if(size0!==Math.min(img1.width,img1.height,img1.depth))console.error("Size mismatch");else if(lut.type!==three__WEBPACK_IMPORTED_MODULE_0__.FloatType||this.type!==three__WEBPACK_IMPORTED_MODULE_0__.FloatType)console.error("Both LUTs must be FloatType textures");else if(lut.format!==three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat||this.format!==three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat)console.error("Both LUTs must be RGBA textures");else{const data0=img0.data,data1=img1.data,size=size0,sizeSq=size**2,s=size-1;for(let i=0,l=size**3;iheight){data=new Uint8Array(src.length);for(let z=0;z=f.g){if(f.g>f.b){frac=f.rgb;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else if(f.r>=f.b){frac=f.rbg;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v1.y,v4.z);}else{frac=f.brg;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v4.x,v1.y,v4.z);}}else{if(f.b>f.g){frac=f.bgr;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v1.x,v4.y,v4.z);}else if(f.r>=f.b){frac=f.grb;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else{frac=f.gbr;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v1.x,v4.y,v4.z);}}vec4 n1=texture(lut,v1);vec4 n2=texture(lut,v2);vec4 n3=texture(lut,v3);vec4 n4=texture(lut,v4);vec4 weights=vec4(1.0-frac.x,frac.x-frac.y,frac.y-frac.z,frac.z);vec4 result=weights*mat4(vec4(n1.r,n2.r,n3.r,n4.r),vec4(n1.g,n2.g,n3.g,n4.g),vec4(n1.b,n2.b,n3.b,n4.b),vec4(1.0));return vec4(result.rgb,1.0);\n#else\nreturn texture(lut,rgb);\n#endif\n}\n#else\n#ifdef LUT_PRECISION_HIGH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D lut;\n#else\nuniform mediump sampler2D lut;\n#endif\n#else\nuniform lowp sampler2D lut;\n#endif\nvec4 applyLUT(const in vec3 rgb){float slice=rgb.b*LUT_SIZE;float slice0=floor(slice);float interp=slice-slice0;float centeredInterp=interp-0.5;float slice1=slice0+sign(centeredInterp);\n#ifdef LUT_STRIP_HORIZONTAL\nfloat xOffset=clamp(rgb.r*LUT_TEXEL_HEIGHT,LUT_TEXEL_WIDTH*0.5,LUT_TEXEL_HEIGHT-LUT_TEXEL_WIDTH*0.5);vec2 uv0=vec2(slice0*LUT_TEXEL_HEIGHT+xOffset,rgb.g);vec2 uv1=vec2(slice1*LUT_TEXEL_HEIGHT+xOffset,rgb.g);\n#else\nfloat yOffset=clamp(rgb.g*LUT_TEXEL_WIDTH,LUT_TEXEL_HEIGHT*0.5,LUT_TEXEL_WIDTH-LUT_TEXEL_HEIGHT*0.5);vec2 uv0=vec2(rgb.r,slice0*LUT_TEXEL_WIDTH+yOffset);vec2 uv1=vec2(rgb.r,slice1*LUT_TEXEL_WIDTH+yOffset);\n#endif\nvec4 sample0=texture2D(lut,uv0);vec4 sample1=texture2D(lut,uv1);return mix(sample0,sample1,abs(centeredInterp));}\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 c=inputColor.rgb;\n#ifdef CUSTOM_INPUT_DOMAIN\nif(c.r>=domainMin.r&&c.g>=domainMin.g&&c.b>=domainMin.b&&c.r<=domainMax.r&&c.g<=domainMax.g&&c.b<=domainMax.b){c=applyLUT(scale*c+offset).rgb;}else{c=inputColor.rgb;}\n#else\n#if !defined(LUT_3D) || defined(TETRAHEDRAL_INTERPOLATION)\nc=clamp(c,0.0,1.0);\n#endif\nc=applyLUT(scale*c+offset).rgb;\n#endif\noutputColor=vec4(c,inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["lut",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["scale",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3)],["offset",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3)],["domainMin",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["domainMax",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)]])}),this.tetrahedralInterpolation=tetrahedralInterpolation,this.inputColorSpace=inputColorSpace||encodingToColorSpace.get(inputEncoding),this.lut=lut}get inputEncoding(){return this.inputColorSpace}set inputEncoding(value){this.inputColorSpace=value}getInputEncoding(){return this.inputColorSpace}setInputEncoding(value){this.inputColorSpace=value}getOutputEncoding(){return this.outputColorSpace}get lut(){return this.uniforms.get("lut").value}set lut(value){const defines=this.defines,uniforms=this.uniforms;if(this.lut!==value&&(uniforms.get("lut").value=value,null!==value)){const image=value.image,tetrahedralInterpolation=this.tetrahedralInterpolation;if(defines.clear(),defines.set("LUT_SIZE",Math.min(image.width,image.height).toFixed(16)),defines.set("LUT_TEXEL_WIDTH",(1/image.width).toFixed(16)),defines.set("LUT_TEXEL_HEIGHT",(1/image.height).toFixed(16)),uniforms.get("domainMin").value=null,uniforms.get("domainMax").value=null,value.type!==three__WEBPACK_IMPORTED_MODULE_0__.FloatType&&value.type!==three__WEBPACK_IMPORTED_MODULE_0__.HalfFloatType||defines.set("LUT_PRECISION_HIGH","1"),image.width>image.height?defines.set("LUT_STRIP_HORIZONTAL","1"):value instanceof three__WEBPACK_IMPORTED_MODULE_0__.Data3DTexture&&defines.set("LUT_3D","1"),value instanceof LookupTexture){const min=value.domainMin,max=value.domainMax;0===min.x&&0===min.y&&0===min.z&&1===max.x&&1===max.y&&1===max.z||(defines.set("CUSTOM_INPUT_DOMAIN","1"),uniforms.get("domainMin").value=min.clone(),uniforms.get("domainMax").value=max.clone())}this.tetrahedralInterpolation=tetrahedralInterpolation}}getLUT(){return this.lut}setLUT(value){this.lut=value}updateScaleOffset(){const lut=this.lut;if(null!==lut){const size=Math.min(lut.image.width,lut.image.height),scale=this.uniforms.get("scale").value,offset=this.uniforms.get("offset").value;if(this.tetrahedralInterpolation&&lut instanceof three__WEBPACK_IMPORTED_MODULE_0__.Data3DTexture)if(this.defines.has("CUSTOM_INPUT_DOMAIN")){const domainScale=lut.domainMax.clone().sub(lut.domainMin);scale.setScalar(size-1).divide(domainScale),offset.copy(lut.domainMin).negate().multiply(scale)}else scale.setScalar(size-1),offset.setScalar(0);else if(this.defines.has("CUSTOM_INPUT_DOMAIN")){const domainScale=lut.domainMax.clone().sub(lut.domainMin).multiplyScalar(size);scale.setScalar(size-1).divide(domainScale),offset.copy(lut.domainMin).negate().multiply(scale).addScalar(1/(2*size))}else scale.setScalar((size-1)/size),offset.setScalar(1/(2*size))}}configureTetrahedralInterpolation(){const lut=this.lut;null!==lut&&(lut.minFilter=three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,lut.magFilter=three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,this.tetrahedralInterpolation&&(lut instanceof three__WEBPACK_IMPORTED_MODULE_0__.Data3DTexture?(lut.minFilter=three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,lut.magFilter=three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter):console.warn("Tetrahedral interpolation requires a 3D texture")),void 0===lut.source&&(lut.needsUpdate=!0))}get tetrahedralInterpolation(){return this.defines.has("TETRAHEDRAL_INTERPOLATION")}set tetrahedralInterpolation(value){value?this.defines.set("TETRAHEDRAL_INTERPOLATION","1"):this.defines.delete("TETRAHEDRAL_INTERPOLATION"),this.configureTetrahedralInterpolation(),this.updateScaleOffset(),this.setChanged()}setTetrahedralInterpolationEnabled(value){this.tetrahedralInterpolation=value}},NoiseEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SCREEN,premultiply:premultiply=!1}={}){super("NoiseEffect","void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time));\n#ifdef PREMULTIPLY\noutputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a);\n#else\noutputColor=vec4(noise,inputColor.a);\n#endif\n}",{blendFunction:blendFunction}),this.premultiply=premultiply}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(value){this.premultiply!==value&&(value?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(value){this.premultiply=value}},OutlineEffect=class extends Effect{constructor(scene,camera,{blendFunction:blendFunction=BlendFunction.SCREEN,patternTexture:patternTexture=null,patternScale:patternScale=1,edgeStrength:edgeStrength=1,pulseSpeed:pulseSpeed=0,visibleEdgeColor:visibleEdgeColor=16777215,hiddenEdgeColor:hiddenEdgeColor=2230538,kernelSize:kernelSize=KernelSize_VERY_SMALL,blur:blur=!1,xRay:xRay=!0,multisampling:multisampling=0,resolutionScale:resolutionScale=.5,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("OutlineEffect","uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength;\n#ifdef USE_PATTERN\nuniform lowp sampler2D patternTexture;varying vec2 vUvPattern;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 edge=texture2D(edgeTexture,uv).rg;vec2 mask=texture2D(maskTexture,uv).rg;\n#ifndef X_RAY\nedge.y=0.0;\n#endif\nedge*=(edgeStrength*mask.x*pulse);vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;float visibilityFactor=0.0;\n#ifdef USE_PATTERN\nvec4 patternColor=texture2D(patternTexture,vUvPattern);\n#ifdef X_RAY\nfloat hiddenFactor=0.5;\n#else\nfloat hiddenFactor=0.0;\n#endif\nvisibilityFactor=(1.0-mask.y>0.0)?1.0:hiddenFactor;visibilityFactor*=(1.0-mask.x)*patternColor.a;color+=visibilityFactor*patternColor.rgb;\n#endif\nfloat alpha=max(max(edge.x,edge.y),visibilityFactor);\n#ifdef ALPHA\noutputColor=vec4(color,alpha);\n#else\noutputColor=vec4(color,max(alpha,inputColor.a));\n#endif\n}",{uniforms:new Map([["maskTexture",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["edgeTexture",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["edgeStrength",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(edgeStrength)],["visibleEdgeColor",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Color(visibleEdgeColor))],["hiddenEdgeColor",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Color(hiddenEdgeColor))],["pulse",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)],["patternScale",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(patternScale)],["patternTexture",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)]])}),this.blendMode.addEventListener("change",(event=>{this.blendMode.blendFunction===BlendFunction.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()})),this.blendMode.blendFunction=blendFunction,this.patternTexture=patternTexture,this.xRay=xRay,this.scene=scene,this.camera=camera,this.renderTargetMask=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1),this.renderTargetMask.samples=multisampling,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new ClearPass,this.clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new DepthPass(scene,camera),this.maskPass=new RenderPass(scene,camera,new DepthComparisonMaterial(this.depthPass.texture,camera));const clearPass=this.maskPass.clearPass;clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(16777215),clearPass.overrideClearAlpha=1,this.blurPass=new KawaseBlurPass({resolutionScale:resolutionScale,resolutionX:resolutionX,resolutionY:resolutionY,kernelSize:kernelSize}),this.blurPass.enabled=blur;const resolution=this.blurPass.resolution;resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight))),this.outlinePass=new ShaderPass(new OutlineMaterial);this.outlinePass.fullscreenMaterial.inputBuffer=this.renderTargetMask.texture,this.time=0,this.active=!1,this.selection=new Selection,this.selection.layer=10,this.pulseSpeed=pulseSpeed}set mainScene(value){this.scene=value,this.depthPass.mainScene=value,this.maskPass.mainScene=value}set mainCamera(value){this.camera=value,this.depthPass.mainCamera=value,this.maskPass.mainCamera=value,this.maskPass.overrideMaterial.copyCameraSettings(value)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(value){this.renderTargetMask.samples=value,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(value){this.uniforms.get("patternScale").value=value}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(value){this.uniforms.get("edgeStrength").value=value}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(value){this.uniforms.get("visibleEdgeColor").value=value}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(value){this.uniforms.get("hiddenEdgeColor").value=value}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(value){this.pulseSpeed=value}get width(){return this.resolution.width}set width(value){this.resolution.preferredWidth=value}get height(){return this.resolution.height}set height(value){this.resolution.preferredHeight=value}get selectionLayer(){return this.selection.layer}set selectionLayer(value){this.selection.layer=value}get dithering(){return this.blurPass.dithering}set dithering(value){this.blurPass.dithering=value}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(value){this.blurPass.kernelSize=value}get blur(){return this.blurPass.enabled}set blur(value){this.blurPass.enabled=value}get xRay(){return this.defines.has("X_RAY")}set xRay(value){this.xRay!==value&&(value?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(value){this.xRay=value}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(value){null!==value?(value.wrapS=value.wrapT=three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping,this.defines.set("USE_PATTERN","1"),this.setVertexShader("uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}")):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=value,this.setChanged()}setPatternTexture(value){this.patternTexture=value}getResolutionScale(){return this.resolution.scale}setResolutionScale(scale){this.resolution.scale=scale}setSelection(objects){return this.selection.set(objects),this}clearSelection(){return this.selection.clear(),this}selectObject(object){return this.selection.add(object),this}deselectObject(object){return this.selection.delete(object),this}update(renderer,inputBuffer,deltaTime){const scene=this.scene,camera=this.camera,selection=this.selection,pulse=this.uniforms.get("pulse"),background=scene.background,mask=camera.layers.mask;selection.size>0?(scene.background=null,pulse.value=1,this.pulseSpeed>0&&(pulse.value=.375*Math.cos(this.time*this.pulseSpeed*10)+.625),this.active=!0,this.time+=deltaTime,selection.setVisible(!1),this.depthPass.render(renderer),selection.setVisible(!0),camera.layers.set(selection.layer),this.maskPass.render(renderer,this.renderTargetMask),camera.layers.mask=mask,scene.background=background,this.outlinePass.render(renderer,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(renderer,this.renderTargetOutline,this.renderTargetOutline)):this.active&&(camera.layers.set(selection.layer),this.maskPass.render(renderer,this.renderTargetMask),camera.layers.mask=mask,this.clearPass.render(renderer,this.renderTargetOutline),this.active=!1)}setSize(width,height){this.blurPass.setSize(width,height),this.renderTargetMask.setSize(width,height);const resolution=this.resolution;resolution.setBaseSize(width,height);const w=resolution.width,h=resolution.height;this.depthPass.setSize(w,h),this.renderTargetOutline.setSize(w,h),this.outlinePass.fullscreenMaterial.setSize(w,h)}initialize(renderer,alpha,frameBufferType){this.blurPass.initialize(renderer,alpha,three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType),void 0!==frameBufferType&&(this.depthPass.initialize(renderer,alpha,frameBufferType),this.maskPass.initialize(renderer,alpha,frameBufferType),this.outlinePass.initialize(renderer,alpha,frameBufferType))}},PixelationEffect=class extends Effect{constructor(granularity=30){super("PixelationEffect","uniform bool active;uniform vec4 d;void mainUv(inout vec2 uv){if(active){uv=d.xy*(floor(uv*d.zw)+0.5);}}",{uniforms:new Map([["active",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(!1)],["d",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector4)]])}),this.resolution=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,this._granularity=0,this.granularity=granularity}get granularity(){return this._granularity}set granularity(value){let d=Math.floor(value);d%2>0&&(d+=1),this._granularity=d,this.uniforms.get("active").value=d>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(value){this.granularity=value}setSize(width,height){const resolution=this.resolution;resolution.set(width,height);const d=this.granularity,x=d/resolution.x,y=d/resolution.y;this.uniforms.get("d").value.set(x,y,1/x,1/y)}},ScanlineEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.OVERLAY,density:density=1.25,scrollSpeed:scrollSpeed=0}={}){super("ScanlineEffect","uniform float count;\n#ifdef SCROLL\nuniform float scrollSpeed;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float y=uv.y;\n#ifdef SCROLL\ny+=time*scrollSpeed;\n#endif\nvec2 sl=vec2(sin(y*count),cos(y*count));outputColor=vec4(sl.xyx,inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["count",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)],["scrollSpeed",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(0)]])}),this.resolution=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,this.d=density,this.scrollSpeed=scrollSpeed}get density(){return this.d}set density(value){this.d=value,this.setSize(this.resolution.width,this.resolution.height)}getDensity(){return this.density}setDensity(value){this.density=value}get scrollSpeed(){return this.uniforms.get("scrollSpeed").value}set scrollSpeed(value){this.uniforms.get("scrollSpeed").value=value,0===value?this.defines.delete("SCROLL")&&this.setChanged():this.defines.has("SCROLL")||(this.defines.set("SCROLL","1"),this.setChanged())}setSize(width,height){this.resolution.set(width,height),this.uniforms.get("count").value=Math.round(height*this.density)}},HALF_PI=.5*Math.PI,v2=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,ab=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,ShockWaveEffect=class extends Effect{constructor(camera,position=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,{speed:speed=2,maxRadius:maxRadius=1,waveSize:waveSize=.2,amplitude:amplitude=.05}={}){super("ShockWaveEffect","uniform bool active;uniform vec2 center;uniform float waveSize;uniform float radius;uniform float maxRadius;uniform float amplitude;varying float vSize;void mainUv(inout vec2 uv){if(active){vec2 aspectCorrection=vec2(aspect,1.0);vec2 difference=uv*aspectCorrection-center*aspectCorrection;float distance=sqrt(dot(difference,difference))*vSize;if(distance>radius){if(distanceHALF_PI,uActive.value&&(uniforms.get("cameraDistance").value=camera.position.distanceTo(position),v2.copy(position).project(camera),this.screenPosition.set(.5*(v2.x+1),.5*(v2.y+1))),this.time+=delta*this.speed;const radius=this.time-waveSize;uniforms.get("radius").value=radius,radius>=2*(uniforms.get("maxRadius").value+waveSize)&&(this.active=!1,uActive.value=!1)}}},SelectiveBloomEffect=class extends BloomEffect{constructor(scene,camera,options){super(options),this.setAttributes(this.getAttributes()|EffectAttribute.DEPTH),this.camera=camera,this.depthPass=new DepthPass(scene,camera),this.clearPass=new ClearPass(!0,!1,!1),this.clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(0),this.depthMaskPass=new ShaderPass(new DepthMaskMaterial);const depthMaskMaterial=this.depthMaskMaterial;depthMaskMaterial.copyCameraSettings(camera),depthMaskMaterial.depthBuffer1=this.depthPass.texture,depthMaskMaterial.depthPacking1=three__WEBPACK_IMPORTED_MODULE_0__.RGBADepthPacking,depthMaskMaterial.depthMode=three__WEBPACK_IMPORTED_MODULE_0__.EqualDepth,this.renderTargetMasked=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetMasked.texture.name="Bloom.Masked",this.selection=new Selection,this.selection.layer=11,this._inverted=!1,this._ignoreBackground=!1}set mainScene(value){this.depthPass.mainScene=value}set mainCamera(value){this.camera=value,this.depthPass.mainCamera=value,this.depthMaskMaterial.copyCameraSettings(value)}getSelection(){return this.selection}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get inverted(){return this._inverted}set inverted(value){this._inverted=value,this.depthMaskMaterial.depthMode=value?three__WEBPACK_IMPORTED_MODULE_0__.NotEqualDepth:three__WEBPACK_IMPORTED_MODULE_0__.EqualDepth}isInverted(){return this.inverted}setInverted(value){this.inverted=value}get ignoreBackground(){return this._ignoreBackground}set ignoreBackground(value){this._ignoreBackground=value,this.depthMaskMaterial.maxDepthStrategy=value?DepthTestStrategy_DISCARD_MAX_DEPTH:DepthTestStrategy_KEEP_MAX_DEPTH}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(value){this.ignoreBackground=value}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthMaskMaterial.depthBuffer0=depthTexture,this.depthMaskMaterial.depthPacking0=depthPacking}update(renderer,inputBuffer,deltaTime){const camera=this.camera,selection=this.selection,inverted=this.inverted;let renderTarget=inputBuffer;if(this.ignoreBackground||!inverted||selection.size>0){const mask=camera.layers.mask;camera.layers.set(selection.layer),this.depthPass.render(renderer),camera.layers.mask=mask,renderTarget=this.renderTargetMasked,this.clearPass.render(renderer,renderTarget),this.depthMaskPass.render(renderer,inputBuffer,renderTarget)}super.update(renderer,renderTarget,deltaTime)}setSize(width,height){super.setSize(width,height),this.renderTargetMasked.setSize(width,height),this.depthPass.setSize(width,height)}initialize(renderer,alpha,frameBufferType){super.initialize(renderer,alpha,frameBufferType),this.clearPass.initialize(renderer,alpha,frameBufferType),this.depthPass.initialize(renderer,alpha,frameBufferType),this.depthMaskPass.initialize(renderer,alpha,frameBufferType),renderer.capabilities.logarithmicDepthBuffer&&(this.depthMaskPass.fullscreenMaterial.defines.LOG_DEPTH="1"),void 0!==frameBufferType&&(this.renderTargetMasked.texture.type=frameBufferType,"srgb"===getOutputColorSpace(renderer)&&setTextureColorSpace(this.renderTargetMasked.texture,"srgb"))}},SepiaEffect=class extends Effect{constructor({blendFunction:blendFunction,intensity:intensity=1}={}){super("SepiaEffect","uniform vec3 weightsR;uniform vec3 weightsG;uniform vec3 weightsB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,weightsR),dot(inputColor.rgb,weightsG),dot(inputColor.rgb,weightsB));outputColor=vec4(color,inputColor.a);}",{blendFunction:blendFunction,uniforms:new Map([["weightsR",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(.393,.769,.189))],["weightsG",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(.349,.686,.168))],["weightsB",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(.272,.534,.131))]])})}get intensity(){return this.blendMode.opacity.value}set intensity(value){this.blendMode.opacity.value=value}getIntensity(){return this.intensity}setIntensity(value){this.intensity=value}get weightsR(){return this.uniforms.get("weightsR").value}get weightsG(){return this.uniforms.get("weightsG").value}get weightsB(){return this.uniforms.get("weightsB").value}},searchImageDataURL_default="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",areaImageDataURL_default="data:image/png;base64,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",SMAAEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC,preset:preset=SMAAPreset_MEDIUM,edgeDetectionMode:edgeDetectionMode=EdgeDetectionMode_COLOR,predicationMode:predicationMode=PredicationMode_DISABLED}={}){let searchImage,areaImage;super("SMAAEffect","uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",{vertexShader:"varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",blendFunction:blendFunction,attributes:EffectAttribute.CONVOLUTION|EffectAttribute.DEPTH,uniforms:new Map([["weightMap",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)]])}),arguments.length>1&&(searchImage=arguments[0],areaImage=arguments[1],arguments.length>2&&(preset=arguments[2]),arguments.length>3&&(edgeDetectionMode=arguments[3])),this.renderTargetEdges=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ClearPass(!0,!1,!1),this.clearPass.overrideClearColor=new three__WEBPACK_IMPORTED_MODULE_0__.Color(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new ShaderPass(new EdgeDetectionMaterial),this.edgeDetectionMaterial.edgeDetectionMode=edgeDetectionMode,this.edgeDetectionMaterial.predicationMode=predicationMode,this.weightsPass=new ShaderPass(new SMAAWeightsMaterial);const loadingManager=new three__WEBPACK_IMPORTED_MODULE_0__.LoadingManager;loadingManager.onLoad=()=>{const searchTexture=new three__WEBPACK_IMPORTED_MODULE_0__.Texture(searchImage);searchTexture.name="SMAA.Search",searchTexture.magFilter=three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,searchTexture.minFilter=three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter,searchTexture.generateMipmaps=!1,searchTexture.needsUpdate=!0,searchTexture.flipY=!0,this.weightsMaterial.searchTexture=searchTexture;const areaTexture=new three__WEBPACK_IMPORTED_MODULE_0__.Texture(areaImage);areaTexture.name="SMAA.Area",areaTexture.magFilter=three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,areaTexture.minFilter=three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter,areaTexture.generateMipmaps=!1,areaTexture.needsUpdate=!0,areaTexture.flipY=!1,this.weightsMaterial.areaTexture=areaTexture,this.dispatchEvent({type:"load"})},loadingManager.itemStart("search"),loadingManager.itemStart("area"),void 0!==searchImage&&void 0!==areaImage?(loadingManager.itemEnd("search"),loadingManager.itemEnd("area")):"undefined"!=typeof Image&&(searchImage=new Image,areaImage=new Image,searchImage.addEventListener("load",(()=>loadingManager.itemEnd("search"))),areaImage.addEventListener("load",(()=>loadingManager.itemEnd("area"))),searchImage.src=searchImageDataURL_default,areaImage.src=areaImageDataURL_default),this.applyPreset(preset)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(threshold){this.edgeDetectionMaterial.edgeDetectionThreshold=threshold}setOrthogonalSearchSteps(steps){this.weightsMaterial.orthogonalSearchSteps=steps}applyPreset(preset){const edgeDetectionMaterial=this.edgeDetectionMaterial,weightsMaterial=this.weightsMaterial;switch(preset){case SMAAPreset_LOW:edgeDetectionMaterial.edgeDetectionThreshold=.15,weightsMaterial.orthogonalSearchSteps=4,weightsMaterial.diagonalDetection=!1,weightsMaterial.cornerDetection=!1;break;case SMAAPreset_MEDIUM:edgeDetectionMaterial.edgeDetectionThreshold=.1,weightsMaterial.orthogonalSearchSteps=8,weightsMaterial.diagonalDetection=!1,weightsMaterial.cornerDetection=!1;break;case SMAAPreset_HIGH:edgeDetectionMaterial.edgeDetectionThreshold=.1,weightsMaterial.orthogonalSearchSteps=16,weightsMaterial.diagonalSearchSteps=8,weightsMaterial.cornerRounding=25,weightsMaterial.diagonalDetection=!0,weightsMaterial.cornerDetection=!0;break;case SMAAPreset_ULTRA:edgeDetectionMaterial.edgeDetectionThreshold=.05,weightsMaterial.orthogonalSearchSteps=32,weightsMaterial.diagonalSearchSteps=16,weightsMaterial.cornerRounding=25,weightsMaterial.diagonalDetection=!0,weightsMaterial.cornerDetection=!0}}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.edgeDetectionMaterial.depthBuffer=depthTexture,this.edgeDetectionMaterial.depthPacking=depthPacking}update(renderer,inputBuffer,deltaTime){this.clearPass.render(renderer,this.renderTargetEdges),this.edgeDetectionPass.render(renderer,inputBuffer,this.renderTargetEdges),this.weightsPass.render(renderer,this.renderTargetEdges,this.renderTargetWeights)}setSize(width,height){this.edgeDetectionMaterial.setSize(width,height),this.weightsMaterial.setSize(width,height),this.renderTargetEdges.setSize(width,height),this.renderTargetWeights.setSize(width,height)}dispose(){const{searchTexture:searchTexture,areaTexture:areaTexture}=this.weightsMaterial;null!==searchTexture&&null!==areaTexture&&(searchTexture.dispose(),areaTexture.dispose()),super.dispose()}static get searchImageDataURL(){return searchImageDataURL_default}static get areaImageDataURL(){return areaImageDataURL_default}},SSAOEffect=class extends Effect{constructor(camera,normalBuffer,{blendFunction:blendFunction=BlendFunction.MULTIPLY,samples:samples=9,rings:rings=7,normalDepthBuffer:normalDepthBuffer=null,depthAwareUpsampling:depthAwareUpsampling=!0,worldDistanceThreshold:worldDistanceThreshold,worldDistanceFalloff:worldDistanceFalloff,worldProximityThreshold:worldProximityThreshold,worldProximityFalloff:worldProximityFalloff,distanceThreshold:distanceThreshold=.97,distanceFalloff:distanceFalloff=.03,rangeThreshold:rangeThreshold=5e-4,rangeFalloff:rangeFalloff=.001,minRadiusScale:minRadiusScale=.1,luminanceInfluence:luminanceInfluence=.7,radius:radius=.1825,intensity:intensity=1,bias:bias=.025,fade:fade=.01,color:color2=null,resolutionScale:resolutionScale=1,width:width=Resolution.AUTO_SIZE,height:height=Resolution.AUTO_SIZE,resolutionX:resolutionX=width,resolutionY:resolutionY=height}={}){super("SSAOEffect","uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity;\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH)\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\n#endif\n#ifdef COLORIZE\nuniform vec3 color;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300\nvec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distancethis.setSize(resolution.baseWidth,resolution.baseHeight))),this.camera=camera,this.depthDownsamplingPass=new DepthDownsamplingPass({normalBuffer:normalBuffer,resolutionScale:resolutionScale}),this.depthDownsamplingPass.enabled=null===normalDepthBuffer,this.ssaoPass=new ShaderPass(new SSAOMaterial(camera));const noiseTexture=new NoiseTexture(64,64,three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat);noiseTexture.wrapS=noiseTexture.wrapT=three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;const ssaoMaterial=this.ssaoMaterial;ssaoMaterial.normalBuffer=normalBuffer,ssaoMaterial.noiseTexture=noiseTexture,ssaoMaterial.minRadiusScale=minRadiusScale,ssaoMaterial.samples=samples,ssaoMaterial.radius=radius,ssaoMaterial.rings=rings,ssaoMaterial.fade=fade,ssaoMaterial.bias=bias,ssaoMaterial.distanceThreshold=distanceThreshold,ssaoMaterial.distanceFalloff=distanceFalloff,ssaoMaterial.proximityThreshold=rangeThreshold,ssaoMaterial.proximityFalloff=rangeFalloff,void 0!==worldDistanceThreshold&&(ssaoMaterial.worldDistanceThreshold=worldDistanceThreshold),void 0!==worldDistanceFalloff&&(ssaoMaterial.worldDistanceFalloff=worldDistanceFalloff),void 0!==worldProximityThreshold&&(ssaoMaterial.worldProximityThreshold=worldProximityThreshold),void 0!==worldProximityFalloff&&(ssaoMaterial.worldProximityFalloff=worldProximityFalloff),null!==normalDepthBuffer&&(this.ssaoMaterial.normalDepthBuffer=normalDepthBuffer,this.defines.set("NORMAL_DEPTH","1")),this.depthAwareUpsampling=depthAwareUpsampling,this.color=color2}set mainCamera(value){this.camera=value,this.ssaoMaterial.copyCameraSettings(value)}get normalBuffer(){return this.ssaoMaterial.normalBuffer}set normalBuffer(value){this.ssaoMaterial.normalBuffer=value,this.depthDownsamplingPass.fullscreenMaterial.normalBuffer=value}getResolution(){return this.resolution}get ssaoMaterial(){return this.ssaoPass.fullscreenMaterial}getSSAOMaterial(){return this.ssaoMaterial}get samples(){return this.ssaoMaterial.samples}set samples(value){this.ssaoMaterial.samples=value}get rings(){return this.ssaoMaterial.rings}set rings(value){this.ssaoMaterial.rings=value}get radius(){return this.ssaoMaterial.radius}set radius(value){this.ssaoMaterial.radius=value}get depthAwareUpsampling(){return this.defines.has("DEPTH_AWARE_UPSAMPLING")}set depthAwareUpsampling(value){this.depthAwareUpsampling!==value&&(value?this.defines.set("DEPTH_AWARE_UPSAMPLING","1"):this.defines.delete("DEPTH_AWARE_UPSAMPLING"),this.setChanged())}isDepthAwareUpsamplingEnabled(){return this.depthAwareUpsampling}setDepthAwareUpsamplingEnabled(value){this.depthAwareUpsampling=value}get distanceScaling(){return!0}set distanceScaling(value){}get color(){return this.uniforms.get("color").value}set color(value){const uniforms=this.uniforms,defines=this.defines;null!==value?defines.has("COLORIZE")?uniforms.get("color").value.set(value):(defines.set("COLORIZE","1"),uniforms.get("color").value=new three__WEBPACK_IMPORTED_MODULE_0__.Color(value),this.setChanged()):defines.has("COLORIZE")&&(defines.delete("COLORIZE"),uniforms.get("color").value=null,this.setChanged())}get luminanceInfluence(){return this.uniforms.get("luminanceInfluence").value}set luminanceInfluence(value){this.uniforms.get("luminanceInfluence").value=value}get intensity(){return this.uniforms.get("intensity").value}set intensity(value){this.uniforms.get("intensity").value=value}getColor(){return this.color}setColor(value){this.color=value}setDistanceCutoff(threshold,falloff){this.ssaoMaterial.distanceThreshold=threshold,this.ssaoMaterial.distanceFalloff=falloff}setProximityCutoff(threshold,falloff){this.ssaoMaterial.proximityThreshold=threshold,this.ssaoMaterial.proximityFalloff=falloff}setDepthTexture(depthTexture,depthPacking=three__WEBPACK_IMPORTED_MODULE_0__.BasicDepthPacking){this.depthDownsamplingPass.setDepthTexture(depthTexture,depthPacking),this.ssaoMaterial.depthBuffer=depthTexture,this.ssaoMaterial.depthPacking=depthPacking}update(renderer,inputBuffer,deltaTime){const renderTarget=this.renderTarget;this.depthDownsamplingPass.enabled&&this.depthDownsamplingPass.render(renderer),this.ssaoPass.render(renderer,null,renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height);const w=resolution.width,h=resolution.height;this.ssaoMaterial.copyCameraSettings(this.camera),this.ssaoMaterial.setSize(w,h),this.renderTarget.setSize(w,h),this.depthDownsamplingPass.resolution.scale=resolution.scale,this.depthDownsamplingPass.setSize(width,height)}initialize(renderer,alpha,frameBufferType){try{let normalDepthBuffer=this.uniforms.get("normalDepthBuffer").value;null===normalDepthBuffer&&(this.depthDownsamplingPass.initialize(renderer,alpha,frameBufferType),normalDepthBuffer=this.depthDownsamplingPass.texture,this.uniforms.get("normalDepthBuffer").value=normalDepthBuffer,this.ssaoMaterial.normalDepthBuffer=normalDepthBuffer,this.defines.set("NORMAL_DEPTH","1"))}catch(e){this.depthDownsamplingPass.enabled=!1}}},TextureEffect=class extends Effect{constructor({blendFunction:blendFunction,texture:texture=null,aspectCorrection:aspectCorrection=!1}={}){super("TextureEffect","#ifdef TEXTURE_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nvarying vec2 vUv2;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){\n#ifdef UV_TRANSFORM\nvec4 texel=texture2D(map,vUv2);\n#else\nvec4 texel=texture2D(map,uv);\n#endif\noutputColor=TEXEL;}",{blendFunction:blendFunction,defines:new Map([["TEXEL","texel"]]),uniforms:new Map([["map",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["scale",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(1)],["uvTransform",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)]])}),this.texture=texture,this.aspectCorrection=aspectCorrection}get texture(){return this.uniforms.get("map").value}set texture(value){const prevTexture=this.texture,uniforms=this.uniforms,defines=this.defines;prevTexture!==value&&(uniforms.get("map").value=value,uniforms.get("uvTransform").value=value.matrix,defines.delete("TEXTURE_PRECISION_HIGH"),null!==value&&(value.matrixAutoUpdate?(defines.set("UV_TRANSFORM","1"),this.setVertexShader("#ifdef ASPECT_CORRECTION\nuniform float scale;\n#else\nuniform mat3 uvTransform;\n#endif\nvarying vec2 vUv2;void mainSupport(const in vec2 uv){\n#ifdef ASPECT_CORRECTION\nvUv2=uv*vec2(aspect,1.0)*scale;\n#else\nvUv2=(uvTransform*vec3(uv,1.0)).xy;\n#endif\n}")):(defines.delete("UV_TRANSFORM"),this.setVertexShader(null)),value.type!==three__WEBPACK_IMPORTED_MODULE_0__.UnsignedByteType&&defines.set("TEXTURE_PRECISION_HIGH","1"),null!==prevTexture&&prevTexture.type===value.type&&prevTexture.encoding===value.encoding||this.setChanged()))}getTexture(){return this.texture}setTexture(value){this.texture=value}get aspectCorrection(){return this.defines.has("ASPECT_CORRECTION")}set aspectCorrection(value){this.aspectCorrection!==value&&(value?this.defines.set("ASPECT_CORRECTION","1"):this.defines.delete("ASPECT_CORRECTION"),this.setChanged())}get uvTransform(){const texture=this.texture;return null!==texture&&texture.matrixAutoUpdate}set uvTransform(value){const texture=this.texture;null!==texture&&(texture.matrixAutoUpdate=value)}setTextureSwizzleRGBA(r,g=r,b=r,a=r){let swizzle="";r===ColorChannel_RED&&g===ColorChannel_GREEN&&b===ColorChannel_BLUE&&a===ColorChannel_ALPHA||(swizzle=[".","rgba"[r],"rgba"[g],"rgba"[b],"rgba"[a]].join("")),this.defines.set("TEXEL","texel"+swizzle),this.setChanged()}update(renderer,inputBuffer,deltaTime){this.texture.matrixAutoUpdate&&this.texture.updateMatrix()}},TiltShiftEffect=class extends Effect{constructor({blendFunction:blendFunction,offset:offset=0,rotation:rotation=0,focusArea:focusArea=.4,feather:feather=.3,kernelSize:kernelSize=KernelSize_MEDIUM,resolutionScale:resolutionScale=.5,resolutionX:resolutionX=Resolution.AUTO_SIZE,resolutionY:resolutionY=Resolution.AUTO_SIZE}={}){super("TiltShiftEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform vec2 maskParams;varying vec2 vUv2;float linearGradientMask(const in float x){return step(maskParams.x,x)-step(maskParams.y,x);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float mask=linearGradientMask(vUv2.y);vec4 texel=texture2D(map,uv);outputColor=mix(texel,inputColor,mask);}",{vertexShader:"uniform vec2 rotation;varying vec2 vUv2;void mainSupport(const in vec2 uv){vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));}",blendFunction:blendFunction,uniforms:new Map([["rotation",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)],["maskParams",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(new three__WEBPACK_IMPORTED_MODULE_0__.Vector2)],["map",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)]])}),this._offset=offset,this._focusArea=focusArea,this._feather=feather,this.renderTarget=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="TiltShift.Target",this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new TiltShiftBlurPass({kernelSize:kernelSize,resolutionScale:resolutionScale,resolutionX:resolutionX,resolutionY:resolutionY,offset:offset,rotation:rotation,focusArea:focusArea,feather:feather});const resolution=this.resolution=new Resolution(this,resolutionX,resolutionY,resolutionScale);resolution.addEventListener("change",(e=>this.setSize(resolution.baseWidth,resolution.baseHeight))),this.rotation=rotation,this.updateParams()}updateParams(){const params=this.uniforms.get("maskParams").value,x=Math.max(this.focusArea-this.feather,0);params.set(this.offset-x,this.offset+x)}get rotation(){return Math.acos(this.uniforms.get("rotation").value.x)}set rotation(value){this.uniforms.get("rotation").value.set(Math.cos(value),Math.sin(value)),this.blurPass.blurMaterial.rotation=value}get offset(){return this._offset}set offset(value){this._offset=value,this.blurPass.blurMaterial.offset=value,this.updateParams()}get focusArea(){return this._focusArea}set focusArea(value){this._focusArea=value,this.blurPass.blurMaterial.focusArea=value,this.updateParams()}get feather(){return this._feather}set feather(value){this._feather=value,this.blurPass.blurMaterial.feather=value,this.updateParams()}get bias(){return 0}set bias(value){}update(renderer,inputBuffer,deltaTime){this.blurPass.render(renderer,inputBuffer,this.renderTarget)}setSize(width,height){const resolution=this.resolution;resolution.setBaseSize(width,height),this.renderTarget.setSize(resolution.width,resolution.height),this.blurPass.resolution.copy(resolution)}initialize(renderer,alpha,frameBufferType){this.blurPass.initialize(renderer,alpha,frameBufferType),void 0!==frameBufferType&&(this.renderTarget.texture.type=frameBufferType,"srgb"===getOutputColorSpace(renderer)&&setTextureColorSpace(this.renderTarget.texture,"srgb"))}},ToneMappingEffect=class extends Effect{constructor({blendFunction:blendFunction=BlendFunction.SRC,adaptive:adaptive=!1,mode:mode=(adaptive?ToneMappingMode_REINHARD2_ADAPTIVE:ToneMappingMode_ACES_FILMIC),resolution:resolution=256,maxLuminance:maxLuminance=4,whitePoint:whitePoint=maxLuminance,middleGrey:middleGrey=.6,minLuminance:minLuminance=.01,averageLuminance:averageLuminance=1,adaptationRate:adaptationRate=1}={}){super("ToneMappingEffect","#include \n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\nuniform float whitePoint;\n#if TONE_MAPPING_MODE == 1 || TONE_MAPPING_MODE == 2\nuniform float middleGrey;\n#if TONE_MAPPING_MODE == 2\nuniform lowp sampler2D luminanceBuffer;\n#else\nuniform float averageLuminance;\n#endif\nvec3 Reinhard2ToneMapping(vec3 color){color*=toneMappingExposure;float l=luminance(color);\n#if TONE_MAPPING_MODE == 2\nfloat lumAvg=unpackRGBAToFloat(texture2D(luminanceBuffer,vec2(0.5)));\n#else\nfloat lumAvg=averageLuminance;\n#endif\nfloat lumScaled=(l*middleGrey)/max(lumAvg,1e-6);float lumCompressed=lumScaled*(1.0+lumScaled/(whitePoint*whitePoint));lumCompressed/=(1.0+lumScaled);return clamp(lumCompressed*color,0.0,1.0);}\n#elif TONE_MAPPING_MODE == 5\n#define A 0.15\n#define B 0.50\n#define C 0.10\n#define D 0.20\n#define E 0.02\n#define F 0.30\nvec3 Uncharted2Helper(const in vec3 x){return((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}vec3 Uncharted2ToneMapping(vec3 color){color*=toneMappingExposure;return clamp(Uncharted2Helper(color)/Uncharted2Helper(vec3(whitePoint)),0.0,1.0);}\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){\n#if TONE_MAPPING_MODE == 1 || TONE_MAPPING_MODE == 2\noutputColor=vec4(Reinhard2ToneMapping(inputColor.rgb),inputColor.a);\n#elif TONE_MAPPING_MODE == 5\noutputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a);\n#else\noutputColor=vec4(toneMapping(inputColor.rgb),inputColor.a);\n#endif\n}",{blendFunction:blendFunction,uniforms:new Map([["luminanceBuffer",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(null)],["maxLuminance",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(maxLuminance)],["whitePoint",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(whitePoint)],["middleGrey",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(middleGrey)],["averageLuminance",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(averageLuminance)]])}),this.renderTargetLuminance=new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget(1,1,{minFilter:three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter,depthBuffer:!1}),this.renderTargetLuminance.texture.generateMipmaps=!0,this.renderTargetLuminance.texture.name="Luminance",this.luminancePass=new LuminancePass({renderTarget:this.renderTargetLuminance}),this.adaptiveLuminancePass=new AdaptiveLuminancePass(this.luminancePass.texture,{minLuminance:minLuminance,adaptationRate:adaptationRate}),this.uniforms.get("luminanceBuffer").value=this.adaptiveLuminancePass.texture,this.resolution=resolution,this.mode=mode}get mode(){return Number(this.defines.get("TONE_MAPPING_MODE"))}set mode(value){if(this.mode!==value){switch(this.defines.clear(),this.defines.set("TONE_MAPPING_MODE",value.toFixed(0)),value){case ToneMappingMode_REINHARD:this.defines.set("toneMapping(texel)","ReinhardToneMapping(texel)");break;case ToneMappingMode_OPTIMIZED_CINEON:this.defines.set("toneMapping(texel)","OptimizedCineonToneMapping(texel)");break;case ToneMappingMode_ACES_FILMIC:this.defines.set("toneMapping(texel)","ACESFilmicToneMapping(texel)");break;default:this.defines.set("toneMapping(texel)","texel")}this.adaptiveLuminancePass.enabled=value===ToneMappingMode_REINHARD2_ADAPTIVE,this.setChanged()}}getMode(){return this.mode}setMode(value){this.mode=value}get whitePoint(){return this.uniforms.get("whitePoint").value}set whitePoint(value){this.uniforms.get("whitePoint").value=value}get middleGrey(){return this.uniforms.get("middleGrey").value}set middleGrey(value){this.uniforms.get("middleGrey").value=value}get averageLuminance(){return this.uniforms.get("averageLuminance").value}set averageLuminance(value){this.uniforms.get("averageLuminance").value=value}get adaptiveLuminanceMaterial(){return this.adaptiveLuminancePass.fullscreenMaterial}getAdaptiveLuminanceMaterial(){return this.adaptiveLuminanceMaterial}get resolution(){return this.luminancePass.resolution.width}set resolution(value){const exponent=Math.max(0,Math.ceil(Math.log2(value))),size=Math.pow(2,exponent);this.luminancePass.resolution.setPreferredSize(size,size),this.adaptiveLuminanceMaterial.mipLevel1x1=exponent}getResolution(){return this.resolution}setResolution(value){this.resolution=value}get adaptive(){return this.mode===ToneMappingMode_REINHARD2_ADAPTIVE}set adaptive(value){this.mode=value?ToneMappingMode_REINHARD2_ADAPTIVE:ToneMappingMode_REINHARD2}get adaptationRate(){return this.adaptiveLuminanceMaterial.adaptationRate}set adaptationRate(value){this.adaptiveLuminanceMaterial.adaptationRate=value}get distinction(){return console.warn(this.name,"distinction was removed."),1}set distinction(value){console.warn(this.name,"distinction was removed.")}update(renderer,inputBuffer,deltaTime){this.adaptiveLuminancePass.enabled&&(this.luminancePass.render(renderer,inputBuffer),this.adaptiveLuminancePass.render(renderer,null,null,deltaTime))}initialize(renderer,alpha,frameBufferType){this.adaptiveLuminancePass.initialize(renderer,alpha,frameBufferType)}},VignetteEffect=class extends Effect{constructor({blendFunction:blendFunction,technique:technique=VignetteTechnique_DEFAULT,eskil:eskil=!1,offset:offset=.5,darkness:darkness=.5}={}){super("VignetteEffect","uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;\n#if VIGNETTE_TECHNIQUE == 0\nfloat d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));\n#else\nvec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));\n#endif\noutputColor=vec4(color,inputColor.a);}",{blendFunction:blendFunction,defines:new Map([["VIGNETTE_TECHNIQUE",technique.toFixed(0)]]),uniforms:new Map([["offset",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(offset)],["darkness",new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(darkness)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(value){this.technique!==value&&(this.defines.set("VIGNETTE_TECHNIQUE",value.toFixed(0)),this.setChanged())}get eskil(){return this.technique===VignetteTechnique_ESKIL}set eskil(value){this.technique=value?VignetteTechnique_ESKIL:VignetteTechnique_DEFAULT}getTechnique(){return this.technique}setTechnique(value){this.technique=value}get offset(){return this.uniforms.get("offset").value}set offset(value){this.uniforms.get("offset").value=value}getOffset(){return this.offset}setOffset(value){this.offset=value}get darkness(){return this.uniforms.get("darkness").value}set darkness(value){this.uniforms.get("darkness").value=value}getDarkness(){return this.darkness}setDarkness(value){this.darkness=value}}},"./node_modules/three-stdlib/controls/OrbitControls.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{z:function(){return OrbitControls}});var three__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/three/build/three.module.js"),__defProp=Object.defineProperty,__publicField=(obj,key,value)=>(((obj,key,value)=>{key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value})(obj,"symbol"!=typeof key?key+"":key,value),value);const moduloWrapAround=(offset,capacity)=>(offset%capacity+capacity)%capacity;class OrbitControls extends three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher{constructor(object,domElement){super(),__publicField(this,"object"),__publicField(this,"domElement"),__publicField(this,"enabled",!0),__publicField(this,"target",new three__WEBPACK_IMPORTED_MODULE_0__.Vector3),__publicField(this,"minDistance",0),__publicField(this,"maxDistance",1/0),__publicField(this,"minZoom",0),__publicField(this,"maxZoom",1/0),__publicField(this,"minPolarAngle",0),__publicField(this,"maxPolarAngle",Math.PI),__publicField(this,"minAzimuthAngle",-1/0),__publicField(this,"maxAzimuthAngle",1/0),__publicField(this,"enableDamping",!1),__publicField(this,"dampingFactor",.05),__publicField(this,"enableZoom",!0),__publicField(this,"zoomSpeed",1),__publicField(this,"enableRotate",!0),__publicField(this,"rotateSpeed",1),__publicField(this,"enablePan",!0),__publicField(this,"panSpeed",1),__publicField(this,"screenSpacePanning",!0),__publicField(this,"keyPanSpeed",7),__publicField(this,"autoRotate",!1),__publicField(this,"autoRotateSpeed",2),__publicField(this,"reverseOrbit",!1),__publicField(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),__publicField(this,"mouseButtons",{LEFT:three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.ROTATE,MIDDLE:three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.DOLLY,RIGHT:three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.PAN}),__publicField(this,"touches",{ONE:three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.ROTATE,TWO:three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_PAN}),__publicField(this,"target0"),__publicField(this,"position0"),__publicField(this,"zoom0"),__publicField(this,"_domElementKeyEvents",null),__publicField(this,"getPolarAngle"),__publicField(this,"getAzimuthalAngle"),__publicField(this,"setPolarAngle"),__publicField(this,"setAzimuthalAngle"),__publicField(this,"getDistance"),__publicField(this,"listenToKeyEvents"),__publicField(this,"saveState"),__publicField(this,"reset"),__publicField(this,"update"),__publicField(this,"connect"),__publicField(this,"dispose"),this.object=object,this.domElement=domElement,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>spherical.phi,this.getAzimuthalAngle=()=>spherical.theta,this.setPolarAngle=value=>{let phi=moduloWrapAround(value,2*Math.PI),currentPhi=spherical.phi;currentPhi<0&&(currentPhi+=2*Math.PI),phi<0&&(phi+=2*Math.PI);let phiDist=Math.abs(phi-currentPhi);2*Math.PI-phiDist{let theta=moduloWrapAround(value,2*Math.PI),currentTheta=spherical.theta;currentTheta<0&&(currentTheta+=2*Math.PI),theta<0&&(theta+=2*Math.PI);let thetaDist=Math.abs(theta-currentTheta);2*Math.PI-thetaDistscope.object.position.distanceTo(scope.target),this.listenToKeyEvents=domElement2=>{domElement2.addEventListener("keydown",onKeyDown),this._domElementKeyEvents=domElement2},this.saveState=()=>{scope.target0.copy(scope.target),scope.position0.copy(scope.object.position),scope.zoom0=scope.object.zoom},this.reset=()=>{scope.target.copy(scope.target0),scope.object.position.copy(scope.position0),scope.object.zoom=scope.zoom0,scope.object.updateProjectionMatrix(),scope.dispatchEvent(changeEvent),scope.update(),state=STATE.NONE},this.update=(()=>{const offset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,up=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(0,1,0),quat=(new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion).setFromUnitVectors(object.up,up),quatInverse=quat.clone().invert(),lastPosition=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,lastQuaternion=new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion,twoPI=2*Math.PI;return function update(){const position=scope.object.position;quat.setFromUnitVectors(object.up,up),quatInverse.copy(quat).invert(),offset.copy(position).sub(scope.target),offset.applyQuaternion(quat),spherical.setFromVector3(offset),scope.autoRotate&&state===STATE.NONE&&rotateLeft(function getAutoRotationAngle(){return 2*Math.PI/60/60*scope.autoRotateSpeed}()),scope.enableDamping?(spherical.theta+=sphericalDelta.theta*scope.dampingFactor,spherical.phi+=sphericalDelta.phi*scope.dampingFactor):(spherical.theta+=sphericalDelta.theta,spherical.phi+=sphericalDelta.phi);let min=scope.minAzimuthAngle,max=scope.maxAzimuthAngle;return isFinite(min)&&isFinite(max)&&(min<-Math.PI?min+=twoPI:min>Math.PI&&(min-=twoPI),max<-Math.PI?max+=twoPI:max>Math.PI&&(max-=twoPI),spherical.theta=min<=max?Math.max(min,Math.min(max,spherical.theta)):spherical.theta>(min+max)/2?Math.max(min,spherical.theta):Math.min(max,spherical.theta)),spherical.phi=Math.max(scope.minPolarAngle,Math.min(scope.maxPolarAngle,spherical.phi)),spherical.makeSafe(),spherical.radius*=scale,spherical.radius=Math.max(scope.minDistance,Math.min(scope.maxDistance,spherical.radius)),!0===scope.enableDamping?scope.target.addScaledVector(panOffset,scope.dampingFactor):scope.target.add(panOffset),offset.setFromSpherical(spherical),offset.applyQuaternion(quatInverse),position.copy(scope.target).add(offset),scope.object.lookAt(scope.target),!0===scope.enableDamping?(sphericalDelta.theta*=1-scope.dampingFactor,sphericalDelta.phi*=1-scope.dampingFactor,panOffset.multiplyScalar(1-scope.dampingFactor)):(sphericalDelta.set(0,0,0),panOffset.set(0,0,0)),scale=1,!!(zoomChanged||lastPosition.distanceToSquared(scope.object.position)>EPS||8*(1-lastQuaternion.dot(scope.object.quaternion))>EPS)&&(scope.dispatchEvent(changeEvent),lastPosition.copy(scope.object.position),lastQuaternion.copy(scope.object.quaternion),zoomChanged=!1,!0)}})(),this.connect=domElement2=>{domElement2===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),scope.domElement=domElement2,scope.domElement.style.touchAction="none",scope.domElement.addEventListener("contextmenu",onContextMenu),scope.domElement.addEventListener("pointerdown",onPointerDown),scope.domElement.addEventListener("pointercancel",onPointerCancel),scope.domElement.addEventListener("wheel",onMouseWheel)},this.dispose=()=>{var _a,_b,_c,_d,_e,_f;null==(_a=scope.domElement)||_a.removeEventListener("contextmenu",onContextMenu),null==(_b=scope.domElement)||_b.removeEventListener("pointerdown",onPointerDown),null==(_c=scope.domElement)||_c.removeEventListener("pointercancel",onPointerCancel),null==(_d=scope.domElement)||_d.removeEventListener("wheel",onMouseWheel),null==(_e=scope.domElement)||_e.ownerDocument.removeEventListener("pointermove",onPointerMove),null==(_f=scope.domElement)||_f.ownerDocument.removeEventListener("pointerup",onPointerUp),null!==scope._domElementKeyEvents&&scope._domElementKeyEvents.removeEventListener("keydown",onKeyDown)};const scope=this,changeEvent={type:"change"},startEvent={type:"start"},endEvent={type:"end"},STATE={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let state=STATE.NONE;const EPS=1e-6,spherical=new three__WEBPACK_IMPORTED_MODULE_0__.Spherical,sphericalDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Spherical;let scale=1;const panOffset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;let zoomChanged=!1;const rotateStart=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,rotateEnd=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,rotateDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,panStart=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,panEnd=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,panDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyStart=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyEnd=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,dollyDelta=new three__WEBPACK_IMPORTED_MODULE_0__.Vector2,pointers=[],pointerPositions={};function getZoomScale(){return Math.pow(.95,scope.zoomSpeed)}function rotateLeft(angle){scope.reverseOrbit?sphericalDelta.theta+=angle:sphericalDelta.theta-=angle}function rotateUp(angle){scope.reverseOrbit?sphericalDelta.phi+=angle:sphericalDelta.phi-=angle}const panLeft=(()=>{const v=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;return function panLeft2(distance,objectMatrix){v.setFromMatrixColumn(objectMatrix,0),v.multiplyScalar(-distance),panOffset.add(v)}})(),panUp=(()=>{const v=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;return function panUp2(distance,objectMatrix){!0===scope.screenSpacePanning?v.setFromMatrixColumn(objectMatrix,1):(v.setFromMatrixColumn(objectMatrix,0),v.crossVectors(scope.object.up,v)),v.multiplyScalar(distance),panOffset.add(v)}})(),pan=(()=>{const offset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;return function pan2(deltaX,deltaY){const element=scope.domElement;if(element&&scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera){const position=scope.object.position;offset.copy(position).sub(scope.target);let targetDistance=offset.length();targetDistance*=Math.tan(scope.object.fov/2*Math.PI/180),panLeft(2*deltaX*targetDistance/element.clientHeight,scope.object.matrix),panUp(2*deltaY*targetDistance/element.clientHeight,scope.object.matrix)}else element&&scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera&&scope.object.isOrthographicCamera?(panLeft(deltaX*(scope.object.right-scope.object.left)/scope.object.zoom/element.clientWidth,scope.object.matrix),panUp(deltaY*(scope.object.top-scope.object.bottom)/scope.object.zoom/element.clientHeight,scope.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),scope.enablePan=!1)}})();function dollyOut(dollyScale){scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera?scale/=dollyScale:scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera&&scope.object.isOrthographicCamera?(scope.object.zoom=Math.max(scope.minZoom,Math.min(scope.maxZoom,scope.object.zoom*dollyScale)),scope.object.updateProjectionMatrix(),zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),scope.enableZoom=!1)}function dollyIn(dollyScale){scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera&&scope.object.isPerspectiveCamera?scale*=dollyScale:scope.object instanceof three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera&&scope.object.isOrthographicCamera?(scope.object.zoom=Math.max(scope.minZoom,Math.min(scope.maxZoom,scope.object.zoom/dollyScale)),scope.object.updateProjectionMatrix(),zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),scope.enableZoom=!1)}function handleMouseDownRotate(event){rotateStart.set(event.clientX,event.clientY)}function handleMouseDownPan(event){panStart.set(event.clientX,event.clientY)}function handleTouchStartRotate(){if(1==pointers.length)rotateStart.set(pointers[0].pageX,pointers[0].pageY);else{const x=.5*(pointers[0].pageX+pointers[1].pageX),y=.5*(pointers[0].pageY+pointers[1].pageY);rotateStart.set(x,y)}}function handleTouchStartPan(){if(1==pointers.length)panStart.set(pointers[0].pageX,pointers[0].pageY);else{const x=.5*(pointers[0].pageX+pointers[1].pageX),y=.5*(pointers[0].pageY+pointers[1].pageY);panStart.set(x,y)}}function handleTouchStartDolly(){const dx=pointers[0].pageX-pointers[1].pageX,dy=pointers[0].pageY-pointers[1].pageY,distance=Math.sqrt(dx*dx+dy*dy);dollyStart.set(0,distance)}function handleTouchMoveRotate(event){if(1==pointers.length)rotateEnd.set(event.pageX,event.pageY);else{const position=getSecondPointerPosition(event),x=.5*(event.pageX+position.x),y=.5*(event.pageY+position.y);rotateEnd.set(x,y)}rotateDelta.subVectors(rotateEnd,rotateStart).multiplyScalar(scope.rotateSpeed);const element=scope.domElement;element&&(rotateLeft(2*Math.PI*rotateDelta.x/element.clientHeight),rotateUp(2*Math.PI*rotateDelta.y/element.clientHeight)),rotateStart.copy(rotateEnd)}function handleTouchMovePan(event){if(1==pointers.length)panEnd.set(event.pageX,event.pageY);else{const position=getSecondPointerPosition(event),x=.5*(event.pageX+position.x),y=.5*(event.pageY+position.y);panEnd.set(x,y)}panDelta.subVectors(panEnd,panStart).multiplyScalar(scope.panSpeed),pan(panDelta.x,panDelta.y),panStart.copy(panEnd)}function handleTouchMoveDolly(event){const position=getSecondPointerPosition(event),dx=event.pageX-position.x,dy=event.pageY-position.y,distance=Math.sqrt(dx*dx+dy*dy);dollyEnd.set(0,distance),dollyDelta.set(0,Math.pow(dollyEnd.y/dollyStart.y,scope.zoomSpeed)),dollyOut(dollyDelta.y),dollyStart.copy(dollyEnd)}function onPointerDown(event){var _a,_b;!1!==scope.enabled&&(0===pointers.length&&(null==(_a=scope.domElement)||_a.ownerDocument.addEventListener("pointermove",onPointerMove),null==(_b=scope.domElement)||_b.ownerDocument.addEventListener("pointerup",onPointerUp)),function addPointer(event){pointers.push(event)}(event),"touch"===event.pointerType?function onTouchStart(event){switch(trackPointer(event),pointers.length){case 1:switch(scope.touches.ONE){case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.ROTATE:if(!1===scope.enableRotate)return;handleTouchStartRotate(),state=STATE.TOUCH_ROTATE;break;case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.PAN:if(!1===scope.enablePan)return;handleTouchStartPan(),state=STATE.TOUCH_PAN;break;default:state=STATE.NONE}break;case 2:switch(scope.touches.TWO){case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_PAN:if(!1===scope.enableZoom&&!1===scope.enablePan)return;!function handleTouchStartDollyPan(){scope.enableZoom&&handleTouchStartDolly(),scope.enablePan&&handleTouchStartPan()}(),state=STATE.TOUCH_DOLLY_PAN;break;case three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_ROTATE:if(!1===scope.enableZoom&&!1===scope.enableRotate)return;!function handleTouchStartDollyRotate(){scope.enableZoom&&handleTouchStartDolly(),scope.enableRotate&&handleTouchStartRotate()}(),state=STATE.TOUCH_DOLLY_ROTATE;break;default:state=STATE.NONE}break;default:state=STATE.NONE}state!==STATE.NONE&&scope.dispatchEvent(startEvent)}(event):function onMouseDown(event){let mouseAction;switch(event.button){case 0:mouseAction=scope.mouseButtons.LEFT;break;case 1:mouseAction=scope.mouseButtons.MIDDLE;break;case 2:mouseAction=scope.mouseButtons.RIGHT;break;default:mouseAction=-1}switch(mouseAction){case three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.DOLLY:if(!1===scope.enableZoom)return;!function handleMouseDownDolly(event){dollyStart.set(event.clientX,event.clientY)}(event),state=STATE.DOLLY;break;case three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.ROTATE:if(event.ctrlKey||event.metaKey||event.shiftKey){if(!1===scope.enablePan)return;handleMouseDownPan(event),state=STATE.PAN}else{if(!1===scope.enableRotate)return;handleMouseDownRotate(event),state=STATE.ROTATE}break;case three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.PAN:if(event.ctrlKey||event.metaKey||event.shiftKey){if(!1===scope.enableRotate)return;handleMouseDownRotate(event),state=STATE.ROTATE}else{if(!1===scope.enablePan)return;handleMouseDownPan(event),state=STATE.PAN}break;default:state=STATE.NONE}state!==STATE.NONE&&scope.dispatchEvent(startEvent)}(event))}function onPointerMove(event){!1!==scope.enabled&&("touch"===event.pointerType?function onTouchMove(event){switch(trackPointer(event),state){case STATE.TOUCH_ROTATE:if(!1===scope.enableRotate)return;handleTouchMoveRotate(event),scope.update();break;case STATE.TOUCH_PAN:if(!1===scope.enablePan)return;handleTouchMovePan(event),scope.update();break;case STATE.TOUCH_DOLLY_PAN:if(!1===scope.enableZoom&&!1===scope.enablePan)return;!function handleTouchMoveDollyPan(event){scope.enableZoom&&handleTouchMoveDolly(event),scope.enablePan&&handleTouchMovePan(event)}(event),scope.update();break;case STATE.TOUCH_DOLLY_ROTATE:if(!1===scope.enableZoom&&!1===scope.enableRotate)return;!function handleTouchMoveDollyRotate(event){scope.enableZoom&&handleTouchMoveDolly(event),scope.enableRotate&&handleTouchMoveRotate(event)}(event),scope.update();break;default:state=STATE.NONE}}(event):function onMouseMove(event){if(!1===scope.enabled)return;switch(state){case STATE.ROTATE:if(!1===scope.enableRotate)return;!function handleMouseMoveRotate(event){rotateEnd.set(event.clientX,event.clientY),rotateDelta.subVectors(rotateEnd,rotateStart).multiplyScalar(scope.rotateSpeed);const element=scope.domElement;element&&(rotateLeft(2*Math.PI*rotateDelta.x/element.clientHeight),rotateUp(2*Math.PI*rotateDelta.y/element.clientHeight)),rotateStart.copy(rotateEnd),scope.update()}(event);break;case STATE.DOLLY:if(!1===scope.enableZoom)return;!function handleMouseMoveDolly(event){dollyEnd.set(event.clientX,event.clientY),dollyDelta.subVectors(dollyEnd,dollyStart),dollyDelta.y>0?dollyOut(getZoomScale()):dollyDelta.y<0&&dollyIn(getZoomScale()),dollyStart.copy(dollyEnd),scope.update()}(event);break;case STATE.PAN:if(!1===scope.enablePan)return;!function handleMouseMovePan(event){panEnd.set(event.clientX,event.clientY),panDelta.subVectors(panEnd,panStart).multiplyScalar(scope.panSpeed),pan(panDelta.x,panDelta.y),panStart.copy(panEnd),scope.update()}(event)}}(event))}function onPointerUp(event){var _a,_b,_c;removePointer(event),0===pointers.length&&(null==(_a=scope.domElement)||_a.releasePointerCapture(event.pointerId),null==(_b=scope.domElement)||_b.ownerDocument.removeEventListener("pointermove",onPointerMove),null==(_c=scope.domElement)||_c.ownerDocument.removeEventListener("pointerup",onPointerUp)),scope.dispatchEvent(endEvent),state=STATE.NONE}function onPointerCancel(event){removePointer(event)}function onMouseWheel(event){!1===scope.enabled||!1===scope.enableZoom||state!==STATE.NONE&&state!==STATE.ROTATE||(event.preventDefault(),scope.dispatchEvent(startEvent),function handleMouseWheel(event){event.deltaY<0?dollyIn(getZoomScale()):event.deltaY>0&&dollyOut(getZoomScale()),scope.update()}(event),scope.dispatchEvent(endEvent))}function onKeyDown(event){!1!==scope.enabled&&!1!==scope.enablePan&&function handleKeyDown(event){let needsUpdate=!1;switch(event.code){case scope.keys.UP:pan(0,scope.keyPanSpeed),needsUpdate=!0;break;case scope.keys.BOTTOM:pan(0,-scope.keyPanSpeed),needsUpdate=!0;break;case scope.keys.LEFT:pan(scope.keyPanSpeed,0),needsUpdate=!0;break;case scope.keys.RIGHT:pan(-scope.keyPanSpeed,0),needsUpdate=!0}needsUpdate&&(event.preventDefault(),scope.update())}(event)}function onContextMenu(event){!1!==scope.enabled&&event.preventDefault()}function removePointer(event){delete pointerPositions[event.pointerId];for(let i=0;i{let proto=Object.getPrototypeOf(obj);return!proto||callback(proto)?proto:findProto(proto,callback)},serializeArg=a=>{if("object"==typeof(e=a)&&e&&findProto(e,(proto=>/^Synthetic(?:Base)?Event$/.test(proto.constructor.name)))&&"function"==typeof e.persist){let e=Object.create(a.constructor.prototype,Object.getOwnPropertyDescriptors(a));e.persist();let viewDescriptor=Object.getOwnPropertyDescriptor(e,"view"),view=viewDescriptor?.value;return"object"==typeof view&&"Window"===view?.constructor.name&&Object.defineProperty(e,"view",{...viewDescriptor,value:Object.create(view.constructor.prototype)}),e}var e;return a};function action(name,options={}){let actionOptions={...config,...options},handler=function(...args){let channel=external_STORYBOOK_MODULE_PREVIEW_API_.addons.getChannel(),id=esm_browser_v4(),serializedArgs=args.map(serializeArg),normalizedArgs=args.length>1?serializedArgs:serializedArgs[0],actionDisplayToEmit={id:id,count:0,data:{name:name,args:normalizedArgs},options:{...actionOptions,maxDepth:5+(actionOptions.depth||3),allowFunction:actionOptions.allowFunction||!1}};channel.emit(EVENT_ID,actionDisplayToEmit)};return handler.isAction=!0,handler}var isInInitialArgs=(name,initialArgs)=>typeof initialArgs[name]>"u"&&!(name in initialArgs),argsEnhancers=[context=>{let{initialArgs:initialArgs,argTypes:argTypes,parameters:{actions:actions}}=context;return actions?.disable||!argTypes?{}:Object.entries(argTypes).filter((([name,argType])=>!!argType.action)).reduce(((acc,[name,argType])=>(isInInitialArgs(name,initialArgs)&&(acc[name]=action("string"==typeof argType.action?argType.action:name)),acc)),{})},context=>{let{initialArgs:initialArgs,argTypes:argTypes,parameters:{actions:actions}}=context;if(!actions||actions.disable||!actions.argTypesRegex||!argTypes)return{};let argTypesRegex=new RegExp(actions.argTypesRegex);return Object.entries(argTypes).filter((([name])=>!!argTypesRegex.test(name))).reduce(((acc,[name,argType])=>(isInInitialArgs(name,initialArgs)&&(acc[name]=action(name)),acc)),{})}]},"./node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{decorators:function(){return decorators},globals:function(){return globals},parameters:function(){return parameters}});var dist=__webpack_require__("./node_modules/@storybook/global/dist/index.mjs"),esm=__webpack_require__("./node_modules/ts-dedent/esm/index.js"),external_STORYBOOK_MODULE_CLIENT_LOGGER_=__webpack_require__("@storybook/client-logger"),{document:chunk_GRJZJKJ4_document,window:chunk_GRJZJKJ4_window}=dist.global,clearStyles=selector=>{(Array.isArray(selector)?selector:[selector]).forEach(clearStyle)},clearStyle=selector=>{let element=chunk_GRJZJKJ4_document.getElementById(selector);element&&element.parentElement.removeChild(element)},external_STORYBOOK_MODULE_PREVIEW_API_=__webpack_require__("@storybook/preview-api"),decorators=[(StoryFn,context)=>{let{globals:globals2,parameters:parameters2}=context,gridParameters=parameters2.backgrounds.grid,isActive=!0===globals2.backgrounds?.grid&&!0!==gridParameters.disable,{cellAmount:cellAmount,cellSize:cellSize,opacity:opacity}=gridParameters,isInDocs="docs"===context.viewMode,defaultOffset=void 0===parameters2.layout||"padded"===parameters2.layout?16:0,offsetX=gridParameters.offsetX??(isInDocs?20:defaultOffset),offsetY=gridParameters.offsetY??(isInDocs?20:defaultOffset),gridStyles=(0,external_STORYBOOK_MODULE_PREVIEW_API_.useMemo)((()=>`\n ${"docs"===context.viewMode?`#anchor--${context.id} .docs-story`:".sb-show-main"} {\n background-size: ${[`${cellSize*cellAmount}px ${cellSize*cellAmount}px`,`${cellSize*cellAmount}px ${cellSize*cellAmount}px`,`${cellSize}px ${cellSize}px`,`${cellSize}px ${cellSize}px`].join(", ")} !important;\n background-position: ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px !important;\n background-blend-mode: difference !important;\n background-image: linear-gradient(rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n linear-gradient(90deg, rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n linear-gradient(rgba(130, 130, 130, ${opacity/2}) 1px, transparent 1px),\n linear-gradient(90deg, rgba(130, 130, 130, ${opacity/2}) 1px, transparent 1px) !important;\n }\n `),[cellSize]);return(0,external_STORYBOOK_MODULE_PREVIEW_API_.useEffect)((()=>{let selectorId="docs"===context.viewMode?`addon-backgrounds-grid-docs-${context.id}`:"addon-backgrounds-grid";isActive?((selector,css)=>{let existingStyle=chunk_GRJZJKJ4_document.getElementById(selector);if(existingStyle)existingStyle.innerHTML!==css&&(existingStyle.innerHTML=css);else{let style=chunk_GRJZJKJ4_document.createElement("style");style.setAttribute("id",selector),style.innerHTML=css,chunk_GRJZJKJ4_document.head.appendChild(style)}})(selectorId,gridStyles):clearStyles(selectorId)}),[isActive,gridStyles,context]),StoryFn()},(StoryFn,context)=>{let{globals:globals2,parameters:parameters2}=context,globalsBackgroundColor=globals2.backgrounds?.value,backgroundsConfig=parameters2.backgrounds,selectedBackgroundColor=(0,external_STORYBOOK_MODULE_PREVIEW_API_.useMemo)((()=>backgroundsConfig.disable?"transparent":((currentSelectedValue,backgrounds=[],defaultName)=>{if("transparent"===currentSelectedValue)return"transparent";if(backgrounds.find((background=>background.value===currentSelectedValue)))return currentSelectedValue;let defaultBackground=backgrounds.find((background=>background.name===defaultName));if(defaultBackground)return defaultBackground.value;if(defaultName){let availableColors=backgrounds.map((background=>background.name)).join(", ");external_STORYBOOK_MODULE_CLIENT_LOGGER_.logger.warn(esm.Z` +/*! For license information please see 690.995a3e10.iframe.bundle.js.LICENSE.txt */ +(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[690],{"./node_modules/@base2/pretty-print-object/dist/index.js":function(__unused_webpack_module,exports){"use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i{let proto=Object.getPrototypeOf(obj);return!proto||callback(proto)?proto:findProto(proto,callback)},serializeArg=a=>{if("object"==typeof(e=a)&&e&&findProto(e,(proto=>/^Synthetic(?:Base)?Event$/.test(proto.constructor.name)))&&"function"==typeof e.persist){let e=Object.create(a.constructor.prototype,Object.getOwnPropertyDescriptors(a));e.persist();let viewDescriptor=Object.getOwnPropertyDescriptor(e,"view"),view=viewDescriptor?.value;return"object"==typeof view&&"Window"===view?.constructor.name&&Object.defineProperty(e,"view",{...viewDescriptor,value:Object.create(view.constructor.prototype)}),e}var e;return a};function action(name,options={}){let actionOptions={...config,...options},handler=function(...args){let channel=external_STORYBOOK_MODULE_PREVIEW_API_.addons.getChannel(),id=esm_browser_v4(),serializedArgs=args.map(serializeArg),normalizedArgs=args.length>1?serializedArgs:serializedArgs[0],actionDisplayToEmit={id:id,count:0,data:{name:name,args:normalizedArgs},options:{...actionOptions,maxDepth:5+(actionOptions.depth||3),allowFunction:actionOptions.allowFunction||!1}};channel.emit(EVENT_ID,actionDisplayToEmit)};return handler.isAction=!0,handler}var isInInitialArgs=(name,initialArgs)=>typeof initialArgs[name]>"u"&&!(name in initialArgs),argsEnhancers=[context=>{let{initialArgs:initialArgs,argTypes:argTypes,parameters:{actions:actions}}=context;return actions?.disable||!argTypes?{}:Object.entries(argTypes).filter((([name,argType])=>!!argType.action)).reduce(((acc,[name,argType])=>(isInInitialArgs(name,initialArgs)&&(acc[name]=action("string"==typeof argType.action?argType.action:name)),acc)),{})},context=>{let{initialArgs:initialArgs,argTypes:argTypes,parameters:{actions:actions}}=context;if(!actions||actions.disable||!actions.argTypesRegex||!argTypes)return{};let argTypesRegex=new RegExp(actions.argTypesRegex);return Object.entries(argTypes).filter((([name])=>!!argTypesRegex.test(name))).reduce(((acc,[name,argType])=>(isInInitialArgs(name,initialArgs)&&(acc[name]=action(name)),acc)),{})}]},"./node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{decorators:function(){return decorators},globals:function(){return globals},parameters:function(){return parameters}});var dist=__webpack_require__("./node_modules/@storybook/global/dist/index.mjs"),esm=__webpack_require__("./node_modules/ts-dedent/esm/index.js"),external_STORYBOOK_MODULE_CLIENT_LOGGER_=__webpack_require__("@storybook/client-logger"),{document:chunk_GRJZJKJ4_document,window:chunk_GRJZJKJ4_window}=dist.global,clearStyles=selector=>{(Array.isArray(selector)?selector:[selector]).forEach(clearStyle)},clearStyle=selector=>{let element=chunk_GRJZJKJ4_document.getElementById(selector);element&&element.parentElement.removeChild(element)},external_STORYBOOK_MODULE_PREVIEW_API_=__webpack_require__("@storybook/preview-api"),decorators=[(StoryFn,context)=>{let{globals:globals2,parameters:parameters2}=context,gridParameters=parameters2.backgrounds.grid,isActive=!0===globals2.backgrounds?.grid&&!0!==gridParameters.disable,{cellAmount:cellAmount,cellSize:cellSize,opacity:opacity}=gridParameters,isInDocs="docs"===context.viewMode,defaultOffset=void 0===parameters2.layout||"padded"===parameters2.layout?16:0,offsetX=gridParameters.offsetX??(isInDocs?20:defaultOffset),offsetY=gridParameters.offsetY??(isInDocs?20:defaultOffset),gridStyles=(0,external_STORYBOOK_MODULE_PREVIEW_API_.useMemo)((()=>`\n ${"docs"===context.viewMode?`#anchor--${context.id} .docs-story`:".sb-show-main"} {\n background-size: ${[`${cellSize*cellAmount}px ${cellSize*cellAmount}px`,`${cellSize*cellAmount}px ${cellSize*cellAmount}px`,`${cellSize}px ${cellSize}px`,`${cellSize}px ${cellSize}px`].join(", ")} !important;\n background-position: ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px !important;\n background-blend-mode: difference !important;\n background-image: linear-gradient(rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n linear-gradient(90deg, rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n linear-gradient(rgba(130, 130, 130, ${opacity/2}) 1px, transparent 1px),\n linear-gradient(90deg, rgba(130, 130, 130, ${opacity/2}) 1px, transparent 1px) !important;\n }\n `),[cellSize]);return(0,external_STORYBOOK_MODULE_PREVIEW_API_.useEffect)((()=>{let selectorId="docs"===context.viewMode?`addon-backgrounds-grid-docs-${context.id}`:"addon-backgrounds-grid";isActive?((selector,css)=>{let existingStyle=chunk_GRJZJKJ4_document.getElementById(selector);if(existingStyle)existingStyle.innerHTML!==css&&(existingStyle.innerHTML=css);else{let style=chunk_GRJZJKJ4_document.createElement("style");style.setAttribute("id",selector),style.innerHTML=css,chunk_GRJZJKJ4_document.head.appendChild(style)}})(selectorId,gridStyles):clearStyles(selectorId)}),[isActive,gridStyles,context]),StoryFn()},(StoryFn,context)=>{let{globals:globals2,parameters:parameters2}=context,globalsBackgroundColor=globals2.backgrounds?.value,backgroundsConfig=parameters2.backgrounds,selectedBackgroundColor=(0,external_STORYBOOK_MODULE_PREVIEW_API_.useMemo)((()=>backgroundsConfig.disable?"transparent":((currentSelectedValue,backgrounds=[],defaultName)=>{if("transparent"===currentSelectedValue)return"transparent";if(backgrounds.find((background=>background.value===currentSelectedValue)))return currentSelectedValue;let defaultBackground=backgrounds.find((background=>background.name===defaultName));if(defaultBackground)return defaultBackground.value;if(defaultName){let availableColors=backgrounds.map((background=>background.name)).join(", ");external_STORYBOOK_MODULE_CLIENT_LOGGER_.logger.warn(esm.Z` Backgrounds Addon: could not find the default color "${defaultName}". These are the available colors for your story based on your configuration: ${availableColors}. @@ -399,4 +399,4 @@ ${selector} wbr { outline: 1px solid #db175b !important; }`}(isInDocs?'[data-story-block="true"]':".sb-show-main")),[context]);return(0,external_STORYBOOK_MODULE_PREVIEW_API_.useEffect)((()=>{let selectorId=isInDocs?`addon-outline-docs-${context.id}`:"addon-outline";return isActive?((selector,css)=>{let existingStyle=dist.global.document.getElementById(selector);if(existingStyle)existingStyle.innerHTML!==css&&(existingStyle.innerHTML=css);else{let style=dist.global.document.createElement("style");style.setAttribute("id",selector),style.innerHTML=css,dist.global.document.head.appendChild(style)}})(selectorId,outlineStyles):clearStyles(selectorId),()=>{clearStyles(selectorId)}}),[isActive,outlineStyles,context]),StoryFn()}],globals={outline:!1}},"./node_modules/@storybook/docs-tools/dist/index.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Bd:function(){return str},Ir:function(){return createSummaryValue},Je:function(){return extractComponentProps},PO:function(){return SourceType},Px:function(){return hasDocgen},VF:function(){return extractComponentDescription},_A:function(){return isTooLongForTypeSummary},fW:function(){return isTooLongForDefaultValueSummary},g:function(){return SNIPPET_RENDERED},jq:function(){return getDocgenSection},p5:function(){return TypeSystem},rS:function(){return enhanceArgTypes}});var TypeSystem2,lodash_mapValues_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/lodash/mapValues.js"),lodash_mapValues_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(lodash_mapValues_js__WEBPACK_IMPORTED_MODULE_0__),doctrine__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/doctrine/lib/doctrine.js"),_storybook_preview_api__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("@storybook/preview-api"),convertSig=type=>{switch(type.type){case"function":return{name:"function"};case"object":let values={};return type.signature.properties.forEach((prop=>{values[prop.key]=convert(prop.value)})),{name:"object",value:values};default:throw new Error(`Unknown: ${type}`)}},convert=type=>{let{name:name,raw:raw}=type,base={};switch(typeof raw<"u"&&(base.raw=raw),type.name){case"string":case"number":case"symbol":case"boolean":return{...base,name:name};case"Array":return{...base,name:"array",value:type.elements.map(convert)};case"signature":return{...base,...convertSig(type)};case"union":case"intersection":return{...base,name:name,value:type.elements.map(convert)};default:return{...base,name:"other",value:name}}},isLiteral=type=>"literal"===type.name,toEnumOption=element=>element.value.replace(/['|"]/g,""),convertSig2=type=>{switch(type.type){case"function":return{name:"function"};case"object":let values={};return type.signature.properties.forEach((prop=>{values[prop.key]=convert2(prop.value)})),{name:"object",value:values};default:throw new Error(`Unknown: ${type}`)}},convert2=type=>{let{name:name,raw:raw}=type,base={};switch(typeof raw<"u"&&(base.raw=raw),type.name){case"literal":return{...base,name:"other",value:type.value};case"string":case"number":case"symbol":case"boolean":return{...base,name:name};case"Array":return{...base,name:"array",value:type.elements.map(convert2)};case"signature":return{...base,...convertSig2(type)};case"union":return type.elements.every(isLiteral)?{...base,name:"enum",value:type.elements.map(toEnumOption)}:{...base,name:name,value:type.elements.map(convert2)};case"intersection":return{...base,name:name,value:type.elements.map(convert2)};default:return{...base,name:"other",value:name}}},QUOTE_REGEX=/^['"]|['"]$/g,SIGNATURE_REGEXP=/^\(.*\) => /,convert3=type=>{let{name:name,raw:raw,computed:computed,value:value}=type,base={};switch(typeof raw<"u"&&(base.raw=raw),name){case"enum":{let values2=computed?value:value.map((v=>{let trimmedValue=v.value.replace(QUOTE_REGEX,"");return(str2=>QUOTE_REGEX.test(str2))(v.value)||Number.isNaN(Number(trimmedValue))?trimmedValue:Number(trimmedValue)}));return{...base,name:name,value:values2}}case"string":case"number":case"symbol":case"object":return{...base,name:name};case"func":return{...base,name:"function"};case"bool":case"boolean":return{...base,name:"boolean"};case"arrayOf":case"array":return{...base,name:"array",value:value&&convert3(value)};case"objectOf":return{...base,name:name,value:convert3(value)};case"shape":case"exact":let values=lodash_mapValues_js__WEBPACK_IMPORTED_MODULE_0___default()(value,(field=>convert3(field)));return{...base,name:"object",value:values};case"union":return{...base,name:"union",value:value.map((v=>convert3(v)))};default:{if(name?.indexOf("|")>0)try{let literalValues=name.split("|").map((v=>JSON.parse(v)));return{...base,name:"enum",value:literalValues}}catch{}let otherVal=value?`${name}(${value})`:name,otherName=SIGNATURE_REGEXP.test(name)?"function":"other";return{...base,name:otherName,value:otherVal}}}},convert4=docgenInfo=>{let{type:type,tsType:tsType,flowType:flowType}=docgenInfo;return null!=type?convert3(type):null!=tsType?convert(tsType):null!=flowType?convert2(flowType):null},TypeSystem=((TypeSystem2=TypeSystem||{}).JAVASCRIPT="JavaScript",TypeSystem2.FLOW="Flow",TypeSystem2.TYPESCRIPT="TypeScript",TypeSystem2.UNKNOWN="Unknown",TypeSystem2),BLACKLIST=["null","undefined"];function isDefaultValueBlacklisted(value){return BLACKLIST.some((x=>x===value))}var str=obj=>{if(!obj)return"";if("string"==typeof obj)return obj;throw new Error(`Description: expected string, got: ${JSON.stringify(obj)}`)};function hasDocgen(component){return!!component.__docgenInfo}function getDocgenSection(component,section){return hasDocgen(component)?component.__docgenInfo[section]:null}var DEFAULT_OPTIONS={tags:["param","arg","argument","returns","ignore","deprecated"]},parseJsDoc=(value,options=DEFAULT_OPTIONS)=>{if(!function containsJsDoc(value){return null!=value&&value.includes("@")}(value))return{includesJsDoc:!1,ignore:!1};let jsDocAst=function parse(content,tags){let ast;try{ast=doctrine__WEBPACK_IMPORTED_MODULE_1__.parse(content,{tags:tags,sloppy:!0})}catch(e){throw console.error(e),new Error("Cannot parse JSDoc tags.")}return ast}(value,options.tags),extractedTags=function extractJsDocTags(ast){let extractedTags={params:null,deprecated:null,returns:null,ignore:!1};for(let i=0;iparamName.includes("null")?paramName.replace("-null","").replace(".null",""):tag.name,getTypeName:()=>null!=tag.type?extractTypeName(tag.type):null}:null}function extractDeprecated(tag){return null!=tag.title?tag.description:null}function extractReturns(tag){return null!=tag.type?{type:tag.type,description:tag.description,getTypeName:()=>extractTypeName(tag.type)}:null}function extractTypeName(type){return"NameExpression"===type.type?type.name:"RecordType"===type.type?`({${type.fields.map((field=>{if(null!=field.value){let valueTypeName=extractTypeName(field.value);return`${field.key}: ${valueTypeName}`}return field.key})).join(", ")}})`:"UnionType"===type.type?`(${type.elements.map(extractTypeName).join("|")})`:"ArrayType"===type.type?"[]":"TypeApplication"===type.type&&null!=type.expression&&"Array"===type.expression.name?`${extractTypeName(type.applications[0])}[]`:"NullableType"===type.type||"NonNullableType"===type.type||"OptionalType"===type.type?extractTypeName(type.expression):"AllLiteral"===type.type?"any":null}function isTooLongForTypeSummary(value){return value.length>90}function isTooLongForDefaultValueSummary(value){return value.length>50}function createSummaryValue(summary,detail){return summary===detail?{summary:summary}:{summary:summary,detail:detail}}function generateUnionElement({name:name,value:value,elements:elements,raw:raw}){return value??(null!=elements?elements.map(generateUnionElement).join(" | "):raw??name)}function generateSignature(flowType){let{type:type}=flowType;return"object"===type?function generateObjectSignature({type:type,raw:raw}){return null!=raw?isTooLongForTypeSummary(raw)?createSummaryValue(type,raw):createSummaryValue(raw):createSummaryValue(type)}(flowType):function generateFuncSignature({type:type,raw:raw}){return createSummaryValue(null!=raw?raw:type)}(flowType)}function createType(type){if(null==type)return null;switch(type.name){case"union":return function generateUnion({name:name,raw:raw,elements:elements}){return createSummaryValue(null!=elements?elements.map(generateUnionElement).join(" | "):null!=raw?raw.replace(/^\|\s*/,""):name)}(type);case"signature":return generateSignature(type);default:return function generateDefault({name:name,raw:raw}){return null!=raw?isTooLongForTypeSummary(raw)?createSummaryValue(name,raw):createSummaryValue(raw):createSummaryValue(name)}(type)}}function createDefaultValue(defaultValue,type){if(null!=defaultValue){let{value:value}=defaultValue;if(!isDefaultValueBlacklisted(value))return isTooLongForDefaultValueSummary(value)?createSummaryValue(type.name,value):createSummaryValue(value)}return null}function createType2({tsType:tsType,required:required}){return null==tsType?null:createSummaryValue(required?tsType.name:tsType.name.replace(" | undefined",""))}function createDefaultValue2({defaultValue:defaultValue}){if(null!=defaultValue){let{value:value}=defaultValue;if(!isDefaultValueBlacklisted(value))return createSummaryValue(value)}return null}function createType3(type){return null!=type?createSummaryValue(type.name):null}function createDefaultValue3(defaultValue,type){if(null!=defaultValue){let{value:value}=defaultValue;if(!isDefaultValueBlacklisted(value))return function isReactDocgenTypescript(defaultValue){let{computed:computed,func:func}=defaultValue;return typeof computed>"u"&&typeof func>"u"}(defaultValue)&&function isStringValued(type){return!!type&&("string"===type.name||"enum"===type.name&&Array.isArray(type.value)&&type.value.every((({value:tv})=>"string"==typeof tv&&'"'===tv[0]&&'"'===tv[tv.length-1])))}(type)?createSummaryValue(JSON.stringify(value)):createSummaryValue(value)}return null}function createBasicPropDef(name,type,docgenInfo){let{description:description,required:required,defaultValue:defaultValue}=docgenInfo;return{name:name,type:createType3(type),required:required,description:description,defaultValue:createDefaultValue3(defaultValue,type)}}function applyJsDocResult(propDef,jsDocParsingResult){if(jsDocParsingResult.includesJsDoc){let{description:description,extractedTags:extractedTags}=jsDocParsingResult;null!=description&&(propDef.description=jsDocParsingResult.description);let value={...extractedTags,params:extractedTags?.params?.map((x=>({name:x.getPrettyName(),description:x.description})))};Object.values(value).filter(Boolean).length>0&&(propDef.jsDocTags=value)}return propDef}var javaScriptFactory=(propName,docgenInfo,jsDocParsingResult)=>{let propDef=createBasicPropDef(propName,docgenInfo.type,docgenInfo);return propDef.sbType=convert4(docgenInfo),applyJsDocResult(propDef,jsDocParsingResult)},tsFactory=(propName,docgenInfo,jsDocParsingResult)=>{let propDef=((propName,docgenInfo)=>{let{description:description,required:required}=docgenInfo;return{name:propName,type:createType2(docgenInfo),required:required,description:description,defaultValue:createDefaultValue2(docgenInfo)}})(propName,docgenInfo);return propDef.sbType=convert4(docgenInfo),applyJsDocResult(propDef,jsDocParsingResult)},flowFactory=(propName,docgenInfo,jsDocParsingResult)=>{let propDef=((propName,docgenInfo)=>{let{flowType:flowType,description:description,required:required,defaultValue:defaultValue}=docgenInfo;return{name:propName,type:createType(flowType),required:required,description:description,defaultValue:createDefaultValue(defaultValue,flowType)}})(propName,docgenInfo);return propDef.sbType=convert4(docgenInfo),applyJsDocResult(propDef,jsDocParsingResult)},unknownFactory=(propName,docgenInfo,jsDocParsingResult)=>applyJsDocResult(createBasicPropDef(propName,{name:"unknown"},docgenInfo),jsDocParsingResult),getPropDefFactory=typeSystem=>{switch(typeSystem){case"JavaScript":return javaScriptFactory;case"TypeScript":return tsFactory;case"Flow":return flowFactory;default:return unknownFactory}},getTypeSystem=docgenInfo=>null!=docgenInfo.type?"JavaScript":null!=docgenInfo.flowType?"Flow":null!=docgenInfo.tsType?"TypeScript":"Unknown",extractComponentProps=(component,section)=>{let docgenSection=getDocgenSection(component,section);return function isValidDocgenSection(docgenSection){return null!=docgenSection&&Object.keys(docgenSection).length>0}(docgenSection)?Array.isArray(docgenSection)?(docgenSection=>{let typeSystem=getTypeSystem(docgenSection[0]),createPropDef=getPropDefFactory(typeSystem);return docgenSection.map((item=>{let sanitizedItem=item;return item.type?.elements&&(sanitizedItem={...item,type:{...item.type,value:item.type.elements}}),extractProp(sanitizedItem.name,sanitizedItem,typeSystem,createPropDef)}))})(docgenSection):(docgenSection=>{let docgenPropsKeys=Object.keys(docgenSection),typeSystem=getTypeSystem(docgenSection[docgenPropsKeys[0]]),createPropDef=getPropDefFactory(typeSystem);return docgenPropsKeys.map((propName=>{let docgenInfo=docgenSection[propName];return null!=docgenInfo?extractProp(propName,docgenInfo,typeSystem,createPropDef):null})).filter(Boolean)})(docgenSection):[]};function extractProp(propName,docgenInfo,typeSystem,createPropDef){let jsDocParsingResult=parseJsDoc(docgenInfo.description);return jsDocParsingResult.includesJsDoc&&jsDocParsingResult.ignore?null:{propDef:createPropDef(propName,docgenInfo,jsDocParsingResult),jsDocTags:jsDocParsingResult.extractedTags,docgenInfo:docgenInfo,typeSystem:typeSystem}}function extractComponentDescription(component){return null!=component&&function getDocgenDescription(component){return hasDocgen(component)&&str(component.__docgenInfo.description)}(component)}var SourceType2,enhanceArgTypes=context=>{let{component:component,argTypes:userArgTypes,parameters:{docs:docs={}}}=context,{extractArgTypes:extractArgTypes}=docs,extractedArgTypes=extractArgTypes&&component?extractArgTypes(component):{};return extractedArgTypes?(0,_storybook_preview_api__WEBPACK_IMPORTED_MODULE_2__.combineParameters)(extractedArgTypes,userArgTypes):userArgTypes},SNIPPET_RENDERED="storybook/docs/snippet-rendered",SourceType=((SourceType2=SourceType||{}).AUTO="auto",SourceType2.CODE="code",SourceType2.DYNAMIC="dynamic",SourceType2)},"./node_modules/@storybook/global/dist/index.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{global:function(){return scope}});var scope=(()=>{let win;return win="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{},win})()},"./node_modules/@storybook/react-dom-shim/dist/react-18.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{K:function(){return unmountElement},l:function(){return renderElement}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_dom_client__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-dom/client.js"),nodes=new Map,WithCallback=({callback:callback,children:children})=>{let once=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();return(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)((()=>{once.current!==callback&&(once.current=callback,callback())}),[callback]),children},renderElement=async(node,el)=>{let root=await getReactRoot(el);return new Promise((resolve=>{root.render(react__WEBPACK_IMPORTED_MODULE_0__.createElement(WithCallback,{callback:()=>resolve(null)},node))}))},unmountElement=(el,shouldUseNewRootApi)=>{let root=nodes.get(el);root&&(root.unmount(),nodes.delete(el))},getReactRoot=async el=>{let root=nodes.get(el);return root||(root=react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot(el),nodes.set(el,root)),root}},"./node_modules/@storybook/react/preview.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{applyDecorators:function(){return applyDecorators},argTypesEnhancers:function(){return argTypesEnhancers},decorators:function(){return decorators},parameters:function(){return parameters2},render:function(){return render},renderToCanvas:function(){return renderToCanvas}});var dist=__webpack_require__("./node_modules/@storybook/global/dist/index.mjs"),react=__webpack_require__("./node_modules/react/index.js"),react_18=__webpack_require__("./node_modules/@storybook/react-dom-shim/dist/react-18.mjs"),{FRAMEWORK_OPTIONS:FRAMEWORK_OPTIONS}=dist.global,render=(args,context)=>{let{id:id,component:Component}=context;if(!Component)throw new Error(`Unable to render story ${id} as the component annotation is missing from the default export`);return react.createElement(Component,{...args})},ErrorBoundary=class extends react.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidMount(){let{hasError:hasError}=this.state,{showMain:showMain}=this.props;hasError||showMain()}componentDidCatch(err){let{showException:showException}=this.props;showException(err)}render(){let{hasError:hasError}=this.state,{children:children}=this.props;return hasError?null:children}},Wrapper=FRAMEWORK_OPTIONS?.strictMode?react.StrictMode:react.Fragment;async function renderToCanvas({storyContext:storyContext,unboundStoryFn:unboundStoryFn,showMain:showMain,showException:showException,forceRemount:forceRemount},canvasElement){let content=react.createElement(ErrorBoundary,{showMain:showMain,showException:showException},react.createElement(unboundStoryFn,{...storyContext})),element=Wrapper?react.createElement(Wrapper,null,content):content;return forceRemount&&(0,react_18.K)(canvasElement),await(0,react_18.l)(element,canvasElement),()=>(0,react_18.K)(canvasElement)}var docs_tools_dist=__webpack_require__("./node_modules/@storybook/docs-tools/dist/index.mjs"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),html_tags=__webpack_require__("./node_modules/html-tags/index.js"),escodegen=__webpack_require__("./node_modules/escodegen/escodegen.js"),esm=__webpack_require__("./node_modules/ts-dedent/esm/index.js"),acorn=__webpack_require__("./node_modules/acorn/dist/acorn.mjs"),acorn_jsx=__webpack_require__("./node_modules/acorn-jsx/index.js"),acorn_jsx_default=__webpack_require__.n(acorn_jsx);function simple(node,visitors,baseVisitor,state,override){baseVisitor||(baseVisitor=base),function c(node,st,override){var type=override||node.type,found=visitors[type];baseVisitor[type](node,st,c),found&&found(node,st)}(node,state,override)}Object.create;function skipThrough(node,st,c){c(node,st)}function ignore(_node,_st,_c){}var base={};base.Program=base.BlockStatement=function(node,st,c){for(var i=0,list=node.body;i{let prettyName=x.getPrettyName(),typeName=x.getTypeName();return null!=typeName?`${prettyName}: ${typeName}`:prettyName}));funcParts.push(`(${funcParams.join(", ")})`)}else funcParts.push("()");return hasReturns&&funcParts.push(`=> ${returns.getTypeName()}`),funcParts.join(" ")}function generateShortFuncSignature(params,returns){let hasParams=null!=params,hasReturns=null!=returns;if(!hasParams&&!hasReturns)return"";let funcParts=[];return hasParams?funcParts.push("( ... )"):funcParts.push("()"),hasReturns&&funcParts.push(`=> ${returns.getTypeName()}`),funcParts.join(" ")}var CUSTOM_CAPTION="custom",OBJECT_CAPTION="object",ARRAY_CAPTION="array",CLASS_CAPTION="class",FUNCTION_CAPTION="func",ELEMENT_CAPTION="element";function isHtmlTag(tagName){return html_tags.includes(tagName.toLowerCase())}var BASIC_OPTIONS={format:{indent:{style:" "},semicolons:!1}},COMPACT_OPTIONS={...BASIC_OPTIONS,format:{newline:""}},PRETTY_OPTIONS={...BASIC_OPTIONS};function generateCode(ast,compact=!1){return(0,escodegen.R_)(ast,compact?COMPACT_OPTIONS:PRETTY_OPTIONS)}function generateObjectCode(ast,compact=!1){return compact?function generateCompactObjectCode(ast){let result=generateCode(ast,!0);return result.endsWith(" }")||(result=`${result.slice(0,-1)} }`),result}(ast):generateCode(ast)}function generateArrayCode(ast,compact=!1){return compact?function generateCompactArrayCode(ast){let result=generateCode(ast,!0);return result.startsWith("[ ")&&(result=result.replace("[ ","[")),result}(ast):function generateMultilineArrayCode(ast){let result=generateCode(ast);return result.endsWith(" }]")&&(result=(0,esm.Z)(result)),result}(ast)}var isMemo=component=>component.$$typeof===Symbol.for("react.memo"),ACORN_WALK_VISITORS={...base,JSXElement:()=>{}},acornParser=acorn.Parser.extend(acorn_jsx_default()());function extractIdentifierName(identifierNode){return null!=identifierNode?identifierNode.name:null}function filterAncestors(ancestors){return ancestors.filter((x=>"ObjectExpression"===x.type||"ArrayExpression"===x.type))}function calculateNodeDepth(node){let depths=[];return function ancestor(node,visitors,baseVisitor,state,override){var ancestors=[];baseVisitor||(baseVisitor=base),function c(node,st,override){var type=override||node.type,found=visitors[type],isNew=node!==ancestors[ancestors.length-1];isNew&&ancestors.push(node),baseVisitor[type](node,st,c),found&&found(node,st||ancestors,ancestors),isNew&&ancestors.pop()}(node,state,override)}(node,{ObjectExpression(_,ancestors){depths.push(filterAncestors(ancestors).length)},ArrayExpression(_,ancestors){depths.push(filterAncestors(ancestors).length)}},ACORN_WALK_VISITORS),Math.max(...depths)}function parseObject(objectNode){return{inferredType:{type:"Object",depth:calculateNodeDepth(objectNode)},ast:objectNode}}function parseExpression(expression){switch(expression.type){case"Identifier":return function parseIdentifier(identifierNode){return{inferredType:{type:"Identifier",identifier:extractIdentifierName(identifierNode)},ast:identifierNode}}(expression);case"Literal":return function parseLiteral(literalNode){return{inferredType:{type:"Literal"},ast:literalNode}}(expression);case"FunctionExpression":case"ArrowFunctionExpression":return function parseFunction(funcNode){let innerJsxElementNode;simple(funcNode.body,{JSXElement(node){innerJsxElementNode=node}},ACORN_WALK_VISITORS);let inferredType={type:null!=innerJsxElementNode?"Element":"Function",params:funcNode.params,hasParams:0!==funcNode.params.length},identifierName=extractIdentifierName(funcNode.id);return null!=identifierName&&(inferredType.identifier=identifierName),{inferredType:inferredType,ast:funcNode}}(expression);case"ClassExpression":return function parseClass(classNode){let innerJsxElementNode;return simple(classNode.body,{JSXElement(node){innerJsxElementNode=node}},ACORN_WALK_VISITORS),{inferredType:{type:null!=innerJsxElementNode?"Element":"Class",identifier:extractIdentifierName(classNode.id)},ast:classNode}}(expression);case"JSXElement":return function parseJsxElement(jsxElementNode){let inferredType={type:"Element"},identifierName=extractIdentifierName(jsxElementNode.openingElement.name);return null!=identifierName&&(inferredType.identifier=identifierName),{inferredType:inferredType,ast:jsxElementNode}}(expression);case"CallExpression":return function parseCall(callNode){return"shape"===extractIdentifierName("MemberExpression"===callNode.callee.type?callNode.callee.property:callNode.callee)?parseObject(callNode.arguments[0]):null}(expression);case"ObjectExpression":return parseObject(expression);case"ArrayExpression":return function parseArray(arrayNode){return{inferredType:{type:"Array",depth:calculateNodeDepth(arrayNode)},ast:arrayNode}}(expression);default:return null}}function parse(value){let ast=acornParser.parse(`(${value})`),parsingResult={inferredType:{type:"Unknown"},ast:ast};if(null!=ast.body[0]){let rootNode=ast.body[0];switch(rootNode.type){case"ExpressionStatement":{let expressionResult=parseExpression(rootNode.expression);null!=expressionResult&&(parsingResult=expressionResult);break}}}return parsingResult}function inspectValue(value){try{return{...parse(value)}}catch{}return{inferredType:{type:"Unknown"}}}var MAX_FUNC_LENGTH=150;function createTypeDef({name:name,short:short,compact:compact,full:full,inferredType:inferredType}){return{name:name,short:short,compact:compact,full:full??short,inferredType:inferredType}}function cleanPropTypes(value){return value.replace(/PropTypes./g,"").replace(/.isRequired/g,"")}function splitIntoLines(value){return value.split(/\r?\n/)}function prettyObject(ast,compact=!1){return cleanPropTypes(generateObjectCode(ast,compact))}function prettyArray(ast,compact=!1){return cleanPropTypes(generateCode(ast,compact))}function generateTypeFromString(value,originalTypeName){let short,compact,full,{inferredType:inferredType,ast:ast}=inspectValue(value),{type:type}=inferredType;switch(type){case"Identifier":case"Literal":short=value,compact=value;break;case"Object":{let{depth:depth}=inferredType;short=OBJECT_CAPTION,compact=1===depth?prettyObject(ast,!0):null,full=prettyObject(ast);break}case"Element":{let{identifier:identifier}=inferredType;short=null==identifier||isHtmlTag(identifier)?ELEMENT_CAPTION:identifier,compact=1===splitIntoLines(value).length?value:null,full=value;break}case"Array":{let{depth:depth}=inferredType;short=ARRAY_CAPTION,compact=depth<=2?prettyArray(ast,!0):null,full=prettyArray(ast);break}default:short=function getCaptionForInspectionType(type){switch(type){case"Object":return OBJECT_CAPTION;case"Array":return ARRAY_CAPTION;case"Class":return CLASS_CAPTION;case"Function":return FUNCTION_CAPTION;case"Element":return ELEMENT_CAPTION;default:return CUSTOM_CAPTION}}(type),compact=1===splitIntoLines(value).length?value:null,full=value}return createTypeDef({name:originalTypeName,short:short,compact:compact,full:full,inferredType:type})}function objectOf(of){return`objectOf(${of})`}function generateEnum(type){if(Array.isArray(type.value)){let values=type.value.reduce(((acc,v)=>{let{short:short,compact:compact,full:full}=function generateEnumValue({value:value,computed:computed}){return computed?generateTypeFromString(value,"enumvalue"):createTypeDef({name:"enumvalue",short:value,compact:value})}(v);return acc.short.push(short),acc.compact.push(compact),acc.full.push(full),acc}),{short:[],compact:[],full:[]});return createTypeDef({name:"enum",short:values.short.join(" | "),compact:values.compact.every((x=>null!=x))?values.compact.join(" | "):null,full:values.full.join(" | ")})}return createTypeDef({name:"enum",short:type.value,compact:type.value})}function braceAfter(of){return`${of}[]`}function braceAround(of){return`[${of}]`}function createArrayOfObjectTypeDef(short,compact,full){return createTypeDef({name:"arrayOf",short:braceAfter(short),compact:null!=compact?braceAround(compact):null,full:full&&braceAround(full)})}function generateType(type,extractedProp){try{switch(type.name){case"custom":return function generateCustom({raw:raw}){return null!=raw?generateTypeFromString(raw,"custom"):createTypeDef({name:"custom",short:CUSTOM_CAPTION,compact:CUSTOM_CAPTION})}(type);case"func":return function generateFunc(extractedProp){let{jsDocTags:jsDocTags}=extractedProp;return null==jsDocTags||null==jsDocTags.params&&null==jsDocTags.returns?createTypeDef({name:"func",short:FUNCTION_CAPTION,compact:FUNCTION_CAPTION}):createTypeDef({name:"func",short:generateShortFuncSignature(jsDocTags.params,jsDocTags.returns),compact:null,full:generateFuncSignature(jsDocTags.params,jsDocTags.returns)})}(extractedProp);case"shape":return function generateShape(type,extractedProp){let fields=Object.keys(type.value).map((key=>`${key}: ${generateType(type.value[key],extractedProp).full}`)).join(", "),{inferredType:inferredType,ast:ast}=inspectValue(`{ ${fields} }`),{depth:depth}=inferredType;return createTypeDef({name:"shape",short:OBJECT_CAPTION,compact:1===depth&&ast?prettyObject(ast,!0):null,full:ast?prettyObject(ast):null})}(type,extractedProp);case"instanceOf":return createTypeDef({name:"instanceOf",short:type.value,compact:type.value});case"objectOf":return function generateObjectOf(type,extractedProp){let{short:short,compact:compact,full:full}=generateType(type.value,extractedProp);return createTypeDef({name:"objectOf",short:objectOf(short),compact:null!=compact?objectOf(compact):null,full:full&&objectOf(full)})}(type,extractedProp);case"union":return function generateUnion(type,extractedProp){if(Array.isArray(type.value)){let values=type.value.reduce(((acc,v)=>{let{short:short,compact:compact,full:full}=generateType(v,extractedProp);return acc.short.push(short),acc.compact.push(compact),acc.full.push(full),acc}),{short:[],compact:[],full:[]});return createTypeDef({name:"union",short:values.short.join(" | "),compact:values.compact.every((x=>null!=x))?values.compact.join(" | "):null,full:values.full.join(" | ")})}return createTypeDef({name:"union",short:type.value,compact:null})}(type,extractedProp);case"enum":return generateEnum(type);case"arrayOf":return function generateArray(type,extractedProp){let{name:name,short:short,compact:compact,full:full,inferredType:inferredType}=generateType(type.value,extractedProp);if("custom"===name){if("Object"===inferredType)return createArrayOfObjectTypeDef(short,compact,full)}else if("shape"===name)return createArrayOfObjectTypeDef(short,compact,full);return createTypeDef({name:"arrayOf",short:braceAfter(short),compact:braceAfter(short)})}(type,extractedProp);default:return createTypeDef({name:type.name,short:type.name,compact:type.name})}}catch(e){console.error(e)}return createTypeDef({name:"unknown",short:"unknown",compact:"unknown"})}function generateObject({inferredType:inferredType,ast:ast}){let{depth:depth}=inferredType;if(1===depth){let compactObject=generateObjectCode(ast,!0);if(!(0,docs_tools_dist.fW)(compactObject))return(0,docs_tools_dist.Ir)(compactObject)}return(0,docs_tools_dist.Ir)(OBJECT_CAPTION,generateObjectCode(ast))}function generateArray2({inferredType:inferredType,ast:ast}){let{depth:depth}=inferredType;if(depth<=2){let compactArray=generateArrayCode(ast,!0);if(!(0,docs_tools_dist.fW)(compactArray))return(0,docs_tools_dist.Ir)(compactArray)}return(0,docs_tools_dist.Ir)(ARRAY_CAPTION,generateArrayCode(ast))}function getPrettyFuncIdentifier(identifier,hasArguments){return hasArguments?`${identifier}( ... )`:`${identifier}()`}function getPrettyElementIdentifier(identifier){return`<${identifier} />`}function getPrettyIdentifier(inferredType){let{type:type,identifier:identifier}=inferredType;switch(type){case"Function":return getPrettyFuncIdentifier(identifier,inferredType.hasParams);case"Element":return getPrettyElementIdentifier(identifier);default:return identifier}}function createDefaultValue(defaultValue){try{let inspectionResult=inspectValue(defaultValue);switch(inspectionResult.inferredType.type){case"Object":return generateObject(inspectionResult);case"Function":return function generateFunc2({inferredType:inferredType,ast:ast}){let{identifier:identifier}=inferredType;if(null!=identifier)return(0,docs_tools_dist.Ir)(getPrettyIdentifier(inferredType),generateCode(ast));let prettyCaption=generateCode(ast,!0);return(0,docs_tools_dist.fW)(prettyCaption)?(0,docs_tools_dist.Ir)(FUNCTION_CAPTION,generateCode(ast)):(0,docs_tools_dist.Ir)(prettyCaption)}(inspectionResult);case"Element":return function generateElement(defaultValue,inspectionResult){let{inferredType:inferredType}=inspectionResult,{identifier:identifier}=inferredType;if(null!=identifier&&!isHtmlTag(identifier)){let prettyIdentifier=getPrettyIdentifier(inferredType);return(0,docs_tools_dist.Ir)(prettyIdentifier,defaultValue)}return(0,docs_tools_dist.fW)(defaultValue)?(0,docs_tools_dist.Ir)(ELEMENT_CAPTION,defaultValue):(0,docs_tools_dist.Ir)(defaultValue)}(defaultValue,inspectionResult);case"Array":return generateArray2(inspectionResult);default:return null}}catch(e){console.error(e)}return null}function isReactElement(element){return null!=element.$$typeof}function extractFunctionName(func,propName){let{name:name}=func;return""!==name&&"anonymous"!==name&&name!==propName?name:null}var DEFAULT_TYPE_RESOLVERS={string:rawDefaultProp=>(0,docs_tools_dist.Ir)(JSON.stringify(rawDefaultProp)),object:rawDefaultProp=>{if(isReactElement(rawDefaultProp)&&null!=rawDefaultProp.type)return function generateReactObject(rawDefaultProp){let{type:type}=rawDefaultProp,{displayName:displayName}=type,jsx2=(0,cjs.ZP)(rawDefaultProp,{});if(null!=displayName){let prettyIdentifier=getPrettyElementIdentifier(displayName);return(0,docs_tools_dist.Ir)(prettyIdentifier,jsx2)}if(isString_default()(type)&&isHtmlTag(type)){let jsxSummary=(0,cjs.ZP)(rawDefaultProp,{tabStop:0}).replace(/\r?\n|\r/g,"");if(!(0,docs_tools_dist.fW)(jsxSummary))return(0,docs_tools_dist.Ir)(jsxSummary)}return(0,docs_tools_dist.Ir)(ELEMENT_CAPTION,jsx2)}(rawDefaultProp);if(isPlainObject_default()(rawDefaultProp)){return generateObject(inspectValue(JSON.stringify(rawDefaultProp)))}if(Array.isArray(rawDefaultProp)){return generateArray2(inspectValue(JSON.stringify(rawDefaultProp)))}return(0,docs_tools_dist.Ir)(OBJECT_CAPTION)},function:(rawDefaultProp,propDef)=>{let inspectionResult,isElement=!1;if(isFunction_default()(rawDefaultProp.render))isElement=!0;else if(null!=rawDefaultProp.prototype&&isFunction_default()(rawDefaultProp.prototype.render))isElement=!0;else{let innerElement;try{inspectionResult=inspectValue(rawDefaultProp.toString());let{hasParams:hasParams,params:params}=inspectionResult.inferredType;hasParams?1===params.length&&"ObjectPattern"===params[0].type&&(innerElement=rawDefaultProp({})):innerElement=rawDefaultProp(),null!=innerElement&&isReactElement(innerElement)&&(isElement=!0)}catch{}}let funcName=extractFunctionName(rawDefaultProp,propDef.name);if(null!=funcName){if(isElement)return(0,docs_tools_dist.Ir)(getPrettyElementIdentifier(funcName));null!=inspectionResult&&(inspectionResult=inspectValue(rawDefaultProp.toString()));let{hasParams:hasParams}=inspectionResult.inferredType;return(0,docs_tools_dist.Ir)(getPrettyFuncIdentifier(funcName,hasParams))}return(0,docs_tools_dist.Ir)(isElement?ELEMENT_CAPTION:FUNCTION_CAPTION)},default:rawDefaultProp=>(0,docs_tools_dist.Ir)(rawDefaultProp.toString())};function createDefaultValueFromRawDefaultProp(rawDefaultProp,propDef,typeResolvers=DEFAULT_TYPE_RESOLVERS){try{switch(typeof rawDefaultProp){case"string":return typeResolvers.string(rawDefaultProp,propDef);case"object":return typeResolvers.object(rawDefaultProp,propDef);case"function":return typeResolvers.function(rawDefaultProp,propDef);default:return typeResolvers.default(rawDefaultProp,propDef)}}catch(e){console.error(e)}return null}var rawDefaultPropTypeResolvers=function createTypeResolvers(customResolvers={}){return{...DEFAULT_TYPE_RESOLVERS,...customResolvers}}({function:(rawDefaultProp,{name:name,type:type})=>{let isElement="element"===type.summary||"elementType"===type.summary,funcName=extractFunctionName(rawDefaultProp,name);if(null!=funcName){if(isElement)return(0,docs_tools_dist.Ir)(getPrettyElementIdentifier(funcName));let{hasParams:hasParams}=inspectValue(rawDefaultProp.toString()).inferredType;return(0,docs_tools_dist.Ir)(getPrettyFuncIdentifier(funcName,hasParams))}return(0,docs_tools_dist.Ir)(isElement?ELEMENT_CAPTION:FUNCTION_CAPTION)}});function enhancePropTypesProp(extractedProp,rawDefaultProp){let{propDef:propDef}=extractedProp,newtype=function createType(extractedProp){let{type:type}=extractedProp.docgenInfo;if(null==type)return null;try{switch(type.name){case"custom":case"shape":case"instanceOf":case"objectOf":case"union":case"enum":case"arrayOf":{let{short:short,compact:compact,full:full}=generateType(type,extractedProp);return null==compact||(0,docs_tools_dist._A)(compact)?full?(0,docs_tools_dist.Ir)(short,full):(0,docs_tools_dist.Ir)(short):(0,docs_tools_dist.Ir)(compact)}case"func":{let detail,{short:short,full:full}=generateType(type,extractedProp),summary=short;return full&&full.lengthextractedProps.find((y=>y.name===x)))).filter(Boolean):extractedProps}(extractedProps.map((x=>enhancePropTypesProp(x,rawDefaultProps[x.propDef.name]))),component)}function enhanceTypeScriptProps(extractedProps){return extractedProps.map((prop=>function enhanceTypeScriptProp(extractedProp,rawDefaultProp){let{propDef:propDef}=extractedProp,{defaultValue:defaultValue}=extractedProp.docgenInfo;if(null!=defaultValue&&null!=defaultValue.value){let newDefaultValue=createDefaultValue(defaultValue.value);null!=newDefaultValue&&(propDef.defaultValue=newDefaultValue)}else if(null!=rawDefaultProp){let newDefaultValue=createDefaultValueFromRawDefaultProp(rawDefaultProp,propDef);null!=newDefaultValue&&(propDef.defaultValue=newDefaultValue)}return propDef}(prop)))}var propTypesMap=new Map;function getPropDefs(component,section){let processedComponent=component;!(0,docs_tools_dist.Px)(component)&&!component.propTypes&&isMemo(component)&&(processedComponent=component.type);let extractedProps=(0,docs_tools_dist.Je)(processedComponent,section);if(0===extractedProps.length)return[];switch(extractedProps[0].typeSystem){case docs_tools_dist.p5.JAVASCRIPT:return enhancePropTypesProps(extractedProps,component);case docs_tools_dist.p5.TYPESCRIPT:return enhanceTypeScriptProps(extractedProps);default:return extractedProps.map((x=>x.propDef))}}Object.keys(prop_types_default()).forEach((typeName=>{let type=prop_types_default()[typeName];propTypesMap.set(type,typeName),propTypesMap.set(type.isRequired,typeName)}));function simplifyNodeForStringify(node){if((0,react.isValidElement)(node)){let props=Object.keys(node.props).reduce(((acc,cur)=>(acc[cur]=simplifyNodeForStringify(node.props[cur]),acc)),{});return{...node,props:props,_owner:null}}return Array.isArray(node)?node.map(simplifyNodeForStringify):node}var renderJsx=(code,options)=>{if(typeof code>"u")return external_STORYBOOK_MODULE_CLIENT_LOGGER_.logger.warn("Too many skip or undefined component"),null;let renderedJSX=code,Type=renderedJSX.type;for(let i=0;i"u")return external_STORYBOOK_MODULE_CLIENT_LOGGER_.logger.warn("Cannot skip undefined element"),null;if(react.Children.count(renderedJSX)>1)return external_STORYBOOK_MODULE_CLIENT_LOGGER_.logger.warn("Trying to skip an array of elements"),null;typeof renderedJSX.props.children>"u"?(external_STORYBOOK_MODULE_CLIENT_LOGGER_.logger.warn("Not enough children to skip elements."),"function"==typeof renderedJSX.type&&""===renderedJSX.type.name&&(renderedJSX=react.createElement(Type,{...renderedJSX.props}))):renderedJSX="function"==typeof renderedJSX.props.children?renderedJSX.props.children():renderedJSX.props.children}let opts={..."string"==typeof options.displayName?{showFunctions:!0,displayName:()=>options.displayName}:{displayName:el=>el.type.displayName||(el.type===Symbol.for("react.profiler")?"Profiler":null)||(0,docs_tools_dist.jq)(el.type,"displayName")||("_default"!==el.type.name?el.type.name:null)||("function"==typeof el.type?"No Display Name":null)||(el.type.$$typeof===Symbol.for("react.forward_ref")?el.type.render.name:null)||(isMemo(el.type)?el.type.type.name:null)||el.type},filterProps:(value,key)=>void 0!==value,...options};return react.Children.map(code,(c=>{let child="number"==typeof c?c.toString():c,string=("function"==typeof cjs.ZP?cjs.ZP:cjs.ZP.default)(simplifyNodeForStringify(child),opts);if(string.indexOf(""")>-1){let matches=string.match(/\S+=\\"([^"]*)\\"/g);matches&&matches.forEach((match=>{string=string.replace(match,match.replace(/"/g,"'"))}))}return string})).join("\n").replace(/function\s+noRefCheck\(\)\s+\{\}/g,"() => {}")},defaultOpts={skip:0,showFunctions:!1,enableBeautify:!0,showDefaultProps:!1},mdxToJsx=node=>{if(!(node=>"MDXCreateElement"===node.type?.displayName&&!!node.props?.mdxType)(node))return node;let{mdxType:mdxType,originalType:originalType,children:children,...rest}=node.props,jsxChildren=[];return children&&(jsxChildren=(Array.isArray(children)?children:[children]).map(mdxToJsx)),(0,react.createElement)(originalType,rest,...jsxChildren)},jsxDecorator=(storyFn,context)=>{let channel=external_STORYBOOK_MODULE_PREVIEW_API_.addons.getChannel(),skip=(context=>{let sourceParams=context?.parameters.docs?.source,isArgsStory=context?.parameters.__isArgsStory;return sourceParams?.type!==docs_tools_dist.PO.DYNAMIC&&(!isArgsStory||sourceParams?.code||sourceParams?.type===docs_tools_dist.PO.CODE)})(context),jsx2="";(0,external_STORYBOOK_MODULE_PREVIEW_API_.useEffect)((()=>{if(!skip){let{id:id,unmappedArgs:unmappedArgs}=context;channel.emit(docs_tools_dist.g,{id:id,source:jsx2,args:unmappedArgs})}}));let story=storyFn();if(skip)return story;let options={...defaultOpts,...context?.parameters.jsx||{}},storyJsx=context?.parameters.docs?.source?.excludeDecorators?context.originalStoryFn(context.args,context):story,sourceJsx=mdxToJsx(storyJsx),rendered=renderJsx(sourceJsx,options);return rendered&&(jsx2=rendered),story},parameters={docs:{story:{inline:!0},extractArgTypes:component=>{if(component){let{rows:rows}=(component=>({rows:getPropDefs(component,"props")}))(component);if(rows)return rows.reduce(((acc,row)=>{let{name:name,description:description,type:type,sbType:sbType,defaultValue:defaultSummary,jsDocTags:jsDocTags,required:required}=row;return acc[name]={name:name,description:description,type:{required:required,...sbType},table:{type:type,jsDocTags:jsDocTags,defaultValue:defaultSummary}},acc}),{})}return null},extractComponentDescription:docs_tools_dist.VF}},decorators=[jsxDecorator],argTypesEnhancers=[docs_tools_dist.rS],applyDecorators=(storyFn,decorators2)=>{let jsxIndex=decorators2.findIndex((d=>d.originalFn===jsxDecorator)),reorderedDecorators=-1===jsxIndex?decorators2:[...decorators2.splice(jsxIndex,1),...decorators2];return(0,external_STORYBOOK_MODULE_PREVIEW_API_.defaultDecorateStory)(storyFn,reorderedDecorators)},parameters2={renderer:"react",...parameters}},"./node_modules/acorn-jsx/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";const XHTMLEntities=__webpack_require__("./node_modules/acorn-jsx/xhtml.js"),hexNumber=/^[\da-fA-F]+$/,decimalNumber=/^\d+$/,acornJsxMap=new WeakMap;function getJsxTokens(acorn){acorn=acorn.Parser.acorn||acorn;let acornJsx=acornJsxMap.get(acorn);if(!acornJsx){const tt=acorn.tokTypes,TokContext=acorn.TokContext,TokenType=acorn.TokenType,tc_oTag=new TokContext("...",!0,!0),tokContexts={tc_oTag:tc_oTag,tc_cTag:tc_cTag,tc_expr:tc_expr},tokTypes={jsxName:new TokenType("jsxName"),jsxText:new TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new TokenType("jsxTagEnd")};tokTypes.jsxTagStart.updateContext=function(){this.context.push(tc_expr),this.context.push(tc_oTag),this.exprAllowed=!1},tokTypes.jsxTagEnd.updateContext=function(prevType){let out=this.context.pop();out===tc_oTag&&prevType===tt.slash||out===tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===tc_expr):this.exprAllowed=!0},acornJsx={tokContexts:tokContexts,tokTypes:tokTypes},acornJsxMap.set(acorn,acornJsx)}return acornJsx}function getQualifiedJSXName(object){return object?"JSXIdentifier"===object.type?object.name:"JSXNamespacedName"===object.type?object.namespace.name+":"+object.name.name:"JSXMemberExpression"===object.type?getQualifiedJSXName(object.object)+"."+getQualifiedJSXName(object.property):void 0:object}module.exports=function(options){return options=options||{},function(Parser){return function plugin(options,Parser){const acorn=Parser.acorn||__webpack_require__("./node_modules/acorn/dist/acorn.mjs"),acornJsx=getJsxTokens(acorn),tt=acorn.tokTypes,tok=acornJsx.tokTypes,tokContexts=acorn.tokContexts,tc_oTag=acornJsx.tokContexts.tc_oTag,tc_cTag=acornJsx.tokContexts.tc_cTag,tc_expr=acornJsx.tokContexts.tc_expr,isNewLine=acorn.isNewLine,isIdentifierStart=acorn.isIdentifierStart,isIdentifierChar=acorn.isIdentifierChar;return class extends Parser{static get acornJsx(){return acornJsx}jsx_readToken(){let out="",chunkStart=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let ch=this.input.charCodeAt(this.pos);switch(ch){case 60:case 123:return this.pos===this.start?60===ch&&this.exprAllowed?(++this.pos,this.finishToken(tok.jsxTagStart)):this.getTokenFromCode(ch):(out+=this.input.slice(chunkStart,this.pos),this.finishToken(tok.jsxText,out));case 38:out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readEntity(),chunkStart=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===ch?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:isNewLine(ch)?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readNewLine(!0),chunkStart=this.pos):++this.pos}}}jsx_readNewLine(normalizeCRLF){let out,ch=this.input.charCodeAt(this.pos);return++this.pos,13===ch&&10===this.input.charCodeAt(this.pos)?(++this.pos,out=normalizeCRLF?"\n":"\r\n"):out=String.fromCharCode(ch),this.options.locations&&(++this.curLine,this.lineStart=this.pos),out}jsx_readString(quote){let out="",chunkStart=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let ch=this.input.charCodeAt(this.pos);if(ch===quote)break;38===ch?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readEntity(),chunkStart=this.pos):isNewLine(ch)?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readNewLine(!1),chunkStart=this.pos):++this.pos}return out+=this.input.slice(chunkStart,this.pos++),this.finishToken(tt.string,out)}jsx_readEntity(){let entity,str="",count=0,ch=this.input[this.pos];"&"!==ch&&this.raise(this.pos,"Entity must start with an ampersand");let startPos=++this.pos;for(;this.pos")}let fragmentOrElement=openingElement.name?"Element":"Fragment";return node["opening"+fragmentOrElement]=openingElement,node["closing"+fragmentOrElement]=closingElement,node.children=children,this.type===tt.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(node,"JSX"+fragmentOrElement)}jsx_parseText(){let node=this.parseLiteral(this.value);return node.type="JSXText",node}jsx_parseElement(){let startPos=this.start,startLoc=this.startLoc;return this.next(),this.jsx_parseElementAt(startPos,startLoc)}parseExprAtom(refShortHandDefaultPos){return this.type===tok.jsxText?this.jsx_parseText():this.type===tok.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(refShortHandDefaultPos)}readToken(code){let context=this.curContext();if(context===tc_expr)return this.jsx_readToken();if(context===tc_oTag||context===tc_cTag){if(isIdentifierStart(code))return this.jsx_readWord();if(62==code)return++this.pos,this.finishToken(tok.jsxTagEnd);if((34===code||39===code)&&context==tc_oTag)return this.jsx_readString(code)}return 60===code&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1)?(++this.pos,this.finishToken(tok.jsxTagStart)):super.readToken(code)}updateContext(prevType){if(this.type==tt.braceL){var curContext=this.curContext();curContext==tc_oTag?this.context.push(tokContexts.b_expr):curContext==tc_expr?this.context.push(tokContexts.b_tmpl):super.updateContext(prevType),this.exprAllowed=!0}else{if(this.type!==tt.slash||prevType!==tok.jsxTagStart)return super.updateContext(prevType);this.context.length-=2,this.context.push(tc_cTag),this.exprAllowed=!1}}}}({allowNamespaces:!1!==options.allowNamespaces,allowNamespacedObjects:!!options.allowNamespacedObjects},Parser)}},Object.defineProperty(module.exports,"tokTypes",{get:function get_tokTypes(){return getJsxTokens(__webpack_require__("./node_modules/acorn/dist/acorn.mjs")).tokTypes},configurable:!0,enumerable:!0})},"./node_modules/acorn-jsx/xhtml.js":function(module){module.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},"./node_modules/acorn/dist/acorn.mjs":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Node:function(){return Node},Parser:function(){return Parser},Position:function(){return Position},SourceLocation:function(){return SourceLocation},TokContext:function(){return TokContext},Token:function(){return Token},TokenType:function(){return TokenType},defaultOptions:function(){return defaultOptions},getLineInfo:function(){return getLineInfo},isIdentifierChar:function(){return isIdentifierChar},isIdentifierStart:function(){return isIdentifierStart},isNewLine:function(){return isNewLine},keywordTypes:function(){return keywords$1},lineBreak:function(){return lineBreak},lineBreakG:function(){return lineBreakG},nonASCIIwhitespace:function(){return nonASCIIwhitespace},parse:function(){return parse},parseExpressionAt:function(){return parseExpressionAt},tokContexts:function(){return types$1},tokTypes:function(){return types},tokenizer:function(){return tokenizer},version:function(){return version}});var reservedWords={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",nonASCIIidentifierChars="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");nonASCIIidentifierStartChars=nonASCIIidentifierChars=null;var astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(code,set){for(var pos=65536,i=0;icode)return!1;if((pos+=set[i+1])>=code)return!0}}function isIdentifierStart(code,astral){return code<65?36===code:code<91||(code<97?95===code:code<123||(code<=65535?code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code)):!1!==astral&&isInAstralSet(code,astralIdentifierStartCodes)))}function isIdentifierChar(code,astral){return code<48?36===code:code<58||!(code<65)&&(code<91||(code<97?95===code:code<123||(code<=65535?code>=170&&nonASCIIidentifier.test(String.fromCharCode(code)):!1!==astral&&(isInAstralSet(code,astralIdentifierStartCodes)||isInAstralSet(code,astralIdentifierCodes)))))}var TokenType=function TokenType(label,conf){void 0===conf&&(conf={}),this.label=label,this.keyword=conf.keyword,this.beforeExpr=!!conf.beforeExpr,this.startsExpr=!!conf.startsExpr,this.isLoop=!!conf.isLoop,this.isAssign=!!conf.isAssign,this.prefix=!!conf.prefix,this.postfix=!!conf.postfix,this.binop=conf.binop||null,this.updateContext=null};function binop(name,prec){return new TokenType(name,{beforeExpr:!0,binop:prec})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords$1={};function kw(name,options){return void 0===options&&(options={}),options.keyword=name,keywords$1[name]=new TokenType(name,options)}var types={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("/<=/>=",7),bitShift:binop("<>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(code,ecma2019String){return 10===code||13===code||!ecma2019String&&(8232===code||8233===code)}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref=Object.prototype,hasOwnProperty=ref.hasOwnProperty,toString=ref.toString;function has(obj,propName){return hasOwnProperty.call(obj,propName)}var isArray=Array.isArray||function(obj){return"[object Array]"===toString.call(obj)};function wordsRegexp(words){return new RegExp("^(?:"+words.replace(/ /g,"|")+")$")}var Position=function Position(line,col){this.line=line,this.column=col};Position.prototype.offset=function offset(n){return new Position(this.line,this.column+n)};var SourceLocation=function SourceLocation(p,start,end){this.start=start,this.end=end,null!==p.sourceFile&&(this.source=p.sourceFile)};function getLineInfo(input,offset){for(var line=1,cur=0;;){lineBreakG.lastIndex=cur;var match=lineBreakG.exec(input);if(!(match&&match.index=2015&&(options.ecmaVersion-=2009),null==options.allowReserved&&(options.allowReserved=options.ecmaVersion<5),isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){return tokens.push(token)}}return isArray(options.onComment)&&(options.onComment=function pushComment(options,array){return function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start:start,end:end};options.locations&&(comment.loc=new SourceLocation(this,startLoc,endLoc)),options.ranges&&(comment.range=[start,end]),array.push(comment)}}(options,options.onComment)),options}function functionFlags(async,generator){return 2|(async?4:0)|(generator?8:0)}var Parser=function Parser(options,input,startPos){this.options=options=getOptions(options),this.sourceFile=options.sourceFile,this.keywords=wordsRegexp(keywords[options.ecmaVersion>=6?6:"module"===options.sourceType?"5module":5]);var reserved="";if(!0!==options.allowReserved){for(var v=options.ecmaVersion;!(reserved=reservedWords[v]);v--);"module"===options.sourceType&&(reserved+=" await")}this.reservedWords=wordsRegexp(reserved);var reservedStrict=(reserved?reserved+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(reservedStrict),this.reservedWordsStrictBind=wordsRegexp(reservedStrict+" "+reservedWords.strictBind),this.input=String(input),this.containsEsc=!1,startPos?(this.pos=startPos,this.lineStart=this.input.lastIndexOf("\n",startPos-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===options.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&options.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},prototypeAccessors={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Parser.prototype.parse=function parse(){var node=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(node)},prototypeAccessors.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},prototypeAccessors.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},prototypeAccessors.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},prototypeAccessors.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},prototypeAccessors.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},prototypeAccessors.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Parser.prototype.inNonArrowFunction=function inNonArrowFunction(){return(2&this.currentThisScope().flags)>0},Parser.extend=function extend(){for(var plugins=[],len=arguments.length;len--;)plugins[len]=arguments[len];for(var cls=this,i=0;i=,?^&]/.test(next)||"!"===next&&"="===this.input.charAt(end+1))}start+=match[0].length,skipWhiteSpace.lastIndex=start,start+=skipWhiteSpace.exec(this.input)[0].length,";"===this.input[start]&&start++}},pp.eat=function(type){return this.type===type&&(this.next(),!0)},pp.isContextual=function(name){return this.type===types.name&&this.value===name&&!this.containsEsc},pp.eatContextual=function(name){return!!this.isContextual(name)&&(this.next(),!0)},pp.expectContextual=function(name){this.eatContextual(name)||this.unexpected()},pp.canInsertSemicolon=function(){return this.type===types.eof||this.type===types.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp.semicolon=function(){this.eat(types.semi)||this.insertSemicolon()||this.unexpected()},pp.afterTrailingComma=function(tokType,notNext){if(this.type===tokType)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),notNext||this.next(),!0},pp.expect=function(type){this.eat(type)||this.unexpected()},pp.unexpected=function(pos){this.raise(null!=pos?pos:this.start,"Unexpected token")},pp.checkPatternErrors=function(refDestructuringErrors,isAssign){if(refDestructuringErrors){refDestructuringErrors.trailingComma>-1&&this.raiseRecoverable(refDestructuringErrors.trailingComma,"Comma is not permitted after the rest element");var parens=isAssign?refDestructuringErrors.parenthesizedAssign:refDestructuringErrors.parenthesizedBind;parens>-1&&this.raiseRecoverable(parens,"Parenthesized pattern")}},pp.checkExpressionErrors=function(refDestructuringErrors,andThrow){if(!refDestructuringErrors)return!1;var shorthandAssign=refDestructuringErrors.shorthandAssign,doubleProto=refDestructuringErrors.doubleProto;if(!andThrow)return shorthandAssign>=0||doubleProto>=0;shorthandAssign>=0&&this.raise(shorthandAssign,"Shorthand property assignments are valid only in destructuring patterns"),doubleProto>=0&&this.raiseRecoverable(doubleProto,"Redefinition of __proto__ property")},pp.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(node,!1,!context);case types._class:return context&&this.unexpected(),this.parseClass(node,!0);case types._if:return this.parseIfStatement(node);case types._return:return this.parseReturnStatement(node);case types._switch:return this.parseSwitchStatement(node);case types._throw:return this.parseThrowStatement(node);case types._try:return this.parseTryStatement(node);case types._const:case types._var:return kind=kind||this.value,context&&"var"!==kind&&this.unexpected(),this.parseVarStatement(node,kind);case types._while:return this.parseWhileStatement(node);case types._with:return this.parseWithStatement(node);case types.braceL:return this.parseBlock(!0,node);case types.semi:return this.parseEmptyStatement(node);case types._export:case types._import:if(this.options.ecmaVersion>10&&starttype===types._import){skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input),next=this.pos+skip[0].length,nextCh=this.input.charCodeAt(next);if(40===nextCh||46===nextCh)return this.parseExpressionStatement(node,this.parseExpression())}return this.options.allowImportExportEverywhere||(topLevel||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),starttype===types._import?this.parseImport(node):this.parseExport(node,exports);default:if(this.isAsyncFunction())return context&&this.unexpected(),this.next(),this.parseFunctionStatement(node,!0,!context);var maybeName=this.value,expr=this.parseExpression();return starttype===types.name&&"Identifier"===expr.type&&this.eat(types.colon)?this.parseLabeledStatement(node,maybeName,expr,context):this.parseExpressionStatement(node,expr)}},pp$1.parseBreakContinueStatement=function(node,keyword){var isBreak="break"===keyword;this.next(),this.eat(types.semi)||this.insertSemicolon()?node.label=null:this.type!==types.name?this.unexpected():(node.label=this.parseIdent(),this.semicolon());for(var i=0;i=6?this.eat(types.semi):this.semicolon(),this.finishNode(node,"DoWhileStatement")},pp$1.parseForStatement=function(node){this.next();var awaitAt=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel),this.enterScope(0),this.expect(types.parenL),this.type===types.semi)return awaitAt>-1&&this.unexpected(awaitAt),this.parseFor(node,null);var isLet=this.isLet();if(this.type===types._var||this.type===types._const||isLet){var init$1=this.startNode(),kind=isLet?"let":this.value;return this.next(),this.parseVar(init$1,!0,kind),this.finishNode(init$1,"VariableDeclaration"),(this.type===types._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===init$1.declarations.length?(this.options.ecmaVersion>=9&&(this.type===types._in?awaitAt>-1&&this.unexpected(awaitAt):node.await=awaitAt>-1),this.parseForIn(node,init$1)):(awaitAt>-1&&this.unexpected(awaitAt),this.parseFor(node,init$1))}var refDestructuringErrors=new DestructuringErrors,init=this.parseExpression(!0,refDestructuringErrors);return this.type===types._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===types._in?awaitAt>-1&&this.unexpected(awaitAt):node.await=awaitAt>-1),this.toAssignable(init,!1,refDestructuringErrors),this.checkLVal(init),this.parseForIn(node,init)):(this.checkExpressionErrors(refDestructuringErrors,!0),awaitAt>-1&&this.unexpected(awaitAt),this.parseFor(node,init))},pp$1.parseFunctionStatement=function(node,isAsync,declarationPosition){return this.next(),this.parseFunction(node,FUNC_STATEMENT|(declarationPosition?0:FUNC_HANGING_STATEMENT),!1,isAsync)},pp$1.parseIfStatement=function(node){return this.next(),node.test=this.parseParenExpression(),node.consequent=this.parseStatement("if"),node.alternate=this.eat(types._else)?this.parseStatement("if"):null,this.finishNode(node,"IfStatement")},pp$1.parseReturnStatement=function(node){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types.semi)||this.insertSemicolon()?node.argument=null:(node.argument=this.parseExpression(),this.semicolon()),this.finishNode(node,"ReturnStatement")},pp$1.parseSwitchStatement=function(node){var cur;this.next(),node.discriminant=this.parseParenExpression(),node.cases=[],this.expect(types.braceL),this.labels.push(switchLabel),this.enterScope(0);for(var sawDefault=!1;this.type!==types.braceR;)if(this.type===types._case||this.type===types._default){var isCase=this.type===types._case;cur&&this.finishNode(cur,"SwitchCase"),node.cases.push(cur=this.startNode()),cur.consequent=[],this.next(),isCase?cur.test=this.parseExpression():(sawDefault&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),sawDefault=!0,cur.test=null),this.expect(types.colon)}else cur||this.unexpected(),cur.consequent.push(this.parseStatement(null));return this.exitScope(),cur&&this.finishNode(cur,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(node,"SwitchStatement")},pp$1.parseThrowStatement=function(node){return this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),node.argument=this.parseExpression(),this.semicolon(),this.finishNode(node,"ThrowStatement")};var empty=[];pp$1.parseTryStatement=function(node){if(this.next(),node.block=this.parseBlock(),node.handler=null,this.type===types._catch){var clause=this.startNode();if(this.next(),this.eat(types.parenL)){clause.param=this.parseBindingAtom();var simple="Identifier"===clause.param.type;this.enterScope(simple?32:0),this.checkLVal(clause.param,simple?4:2),this.expect(types.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),clause.param=null,this.enterScope(0);clause.body=this.parseBlock(!1),this.exitScope(),node.handler=this.finishNode(clause,"CatchClause")}return node.finalizer=this.eat(types._finally)?this.parseBlock():null,node.handler||node.finalizer||this.raise(node.start,"Missing catch or finally clause"),this.finishNode(node,"TryStatement")},pp$1.parseVarStatement=function(node,kind){return this.next(),this.parseVar(node,!1,kind),this.semicolon(),this.finishNode(node,"VariableDeclaration")},pp$1.parseWhileStatement=function(node){return this.next(),node.test=this.parseParenExpression(),this.labels.push(loopLabel),node.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(node,"WhileStatement")},pp$1.parseWithStatement=function(node){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),node.object=this.parseParenExpression(),node.body=this.parseStatement("with"),this.finishNode(node,"WithStatement")},pp$1.parseEmptyStatement=function(node){return this.next(),this.finishNode(node,"EmptyStatement")},pp$1.parseLabeledStatement=function(node,maybeName,expr,context){for(var i$1=0,list=this.labels;i$1=0;i--){var label$1=this.labels[i];if(label$1.statementStart!==node.start)break;label$1.statementStart=this.start,label$1.kind=kind}return this.labels.push({name:maybeName,kind:kind,statementStart:this.start}),node.body=this.parseStatement(context?-1===context.indexOf("label")?context+"label":context:"label"),this.labels.pop(),node.label=expr,this.finishNode(node,"LabeledStatement")},pp$1.parseExpressionStatement=function(node,expr){return node.expression=expr,this.semicolon(),this.finishNode(node,"ExpressionStatement")},pp$1.parseBlock=function(createNewLexicalScope,node,exitStrict){for(void 0===createNewLexicalScope&&(createNewLexicalScope=!0),void 0===node&&(node=this.startNode()),node.body=[],this.expect(types.braceL),createNewLexicalScope&&this.enterScope(0);this.type!==types.braceR;){var stmt=this.parseStatement(null);node.body.push(stmt)}return exitStrict&&(this.strict=!1),this.next(),createNewLexicalScope&&this.exitScope(),this.finishNode(node,"BlockStatement")},pp$1.parseFor=function(node,init){return node.init=init,this.expect(types.semi),node.test=this.type===types.semi?null:this.parseExpression(),this.expect(types.semi),node.update=this.type===types.parenR?null:this.parseExpression(),this.expect(types.parenR),node.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(node,"ForStatement")},pp$1.parseForIn=function(node,init){var isForIn=this.type===types._in;return this.next(),"VariableDeclaration"===init.type&&null!=init.declarations[0].init&&(!isForIn||this.options.ecmaVersion<8||this.strict||"var"!==init.kind||"Identifier"!==init.declarations[0].id.type)?this.raise(init.start,(isForIn?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===init.type&&this.raise(init.start,"Invalid left-hand side in for-loop"),node.left=init,node.right=isForIn?this.parseExpression():this.parseMaybeAssign(),this.expect(types.parenR),node.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(node,isForIn?"ForInStatement":"ForOfStatement")},pp$1.parseVar=function(node,isFor,kind){for(node.declarations=[],node.kind=kind;;){var decl=this.startNode();if(this.parseVarId(decl,kind),this.eat(types.eq)?decl.init=this.parseMaybeAssign(isFor):"const"!==kind||this.type===types._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===decl.id.type||isFor&&(this.type===types._in||this.isContextual("of"))?decl.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),node.declarations.push(this.finishNode(decl,"VariableDeclarator")),!this.eat(types.comma))break}return node},pp$1.parseVarId=function(decl,kind){decl.id=this.parseBindingAtom(),this.checkLVal(decl.id,"var"===kind?1:2,!1)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2;pp$1.parseFunction=function(node,statement,allowExpressionBody,isAsync){this.initFunction(node),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!isAsync)&&(this.type===types.star&&statement&FUNC_HANGING_STATEMENT&&this.unexpected(),node.generator=this.eat(types.star)),this.options.ecmaVersion>=8&&(node.async=!!isAsync),statement&FUNC_STATEMENT&&(node.id=4&statement&&this.type!==types.name?null:this.parseIdent(),!node.id||statement&FUNC_HANGING_STATEMENT||this.checkLVal(node.id,this.strict||node.generator||node.async?this.treatFunctionsAsVar?1:2:3));var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(node.async,node.generator)),statement&FUNC_STATEMENT||(node.id=this.type===types.name?this.parseIdent():null),this.parseFunctionParams(node),this.parseFunctionBody(node,allowExpressionBody,!1),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node,statement&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")},pp$1.parseFunctionParams=function(node){this.expect(types.parenL),node.params=this.parseBindingList(types.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$1.parseClass=function(node,isStatement){this.next();var oldStrict=this.strict;this.strict=!0,this.parseClassId(node,isStatement),this.parseClassSuper(node);var classBody=this.startNode(),hadConstructor=!1;for(classBody.body=[],this.expect(types.braceL);this.type!==types.braceR;){var element=this.parseClassElement(null!==node.superClass);element&&(classBody.body.push(element),"MethodDefinition"===element.type&&"constructor"===element.kind&&(hadConstructor&&this.raise(element.start,"Duplicate constructor in the same class"),hadConstructor=!0))}return this.strict=oldStrict,this.next(),node.body=this.finishNode(classBody,"ClassBody"),this.finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")},pp$1.parseClassElement=function(constructorAllowsSuper){var this$1=this;if(this.eat(types.semi))return null;var method=this.startNode(),tryContextual=function(k,noLineBreak){void 0===noLineBreak&&(noLineBreak=!1);var start=this$1.start,startLoc=this$1.startLoc;return!!this$1.eatContextual(k)&&(!(this$1.type===types.parenL||noLineBreak&&this$1.canInsertSemicolon())||(method.key&&this$1.unexpected(),method.computed=!1,method.key=this$1.startNodeAt(start,startLoc),method.key.name=k,this$1.finishNode(method.key,"Identifier"),!1))};method.kind="method",method.static=tryContextual("static");var isGenerator=this.eat(types.star),isAsync=!1;isGenerator||(this.options.ecmaVersion>=8&&tryContextual("async",!0)?(isAsync=!0,isGenerator=this.options.ecmaVersion>=9&&this.eat(types.star)):tryContextual("get")?method.kind="get":tryContextual("set")&&(method.kind="set")),method.key||this.parsePropertyName(method);var key=method.key,allowsDirectSuper=!1;return method.computed||method.static||!("Identifier"===key.type&&"constructor"===key.name||"Literal"===key.type&&"constructor"===key.value)?method.static&&"Identifier"===key.type&&"prototype"===key.name&&this.raise(key.start,"Classes may not have a static property named prototype"):("method"!==method.kind&&this.raise(key.start,"Constructor can't have get/set modifier"),isGenerator&&this.raise(key.start,"Constructor can't be a generator"),isAsync&&this.raise(key.start,"Constructor can't be an async method"),method.kind="constructor",allowsDirectSuper=constructorAllowsSuper),this.parseClassMethod(method,isGenerator,isAsync,allowsDirectSuper),"get"===method.kind&&0!==method.value.params.length&&this.raiseRecoverable(method.value.start,"getter should have no params"),"set"===method.kind&&1!==method.value.params.length&&this.raiseRecoverable(method.value.start,"setter should have exactly one param"),"set"===method.kind&&"RestElement"===method.value.params[0].type&&this.raiseRecoverable(method.value.params[0].start,"Setter cannot use rest params"),method},pp$1.parseClassMethod=function(method,isGenerator,isAsync,allowsDirectSuper){return method.value=this.parseMethod(isGenerator,isAsync,allowsDirectSuper),this.finishNode(method,"MethodDefinition")},pp$1.parseClassId=function(node,isStatement){this.type===types.name?(node.id=this.parseIdent(),isStatement&&this.checkLVal(node.id,2,!1)):(!0===isStatement&&this.unexpected(),node.id=null)},pp$1.parseClassSuper=function(node){node.superClass=this.eat(types._extends)?this.parseExprSubscripts():null},pp$1.parseExport=function(node,exports){if(this.next(),this.eat(types.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(node.exported=this.parseIdent(!0),this.checkExport(exports,node.exported.name,this.lastTokStart)):node.exported=null),this.expectContextual("from"),this.type!==types.string&&this.unexpected(),node.source=this.parseExprAtom(),this.semicolon(),this.finishNode(node,"ExportAllDeclaration");if(this.eat(types._default)){var isAsync;if(this.checkExport(exports,"default",this.lastTokStart),this.type===types._function||(isAsync=this.isAsyncFunction())){var fNode=this.startNode();this.next(),isAsync&&this.next(),node.declaration=this.parseFunction(fNode,4|FUNC_STATEMENT,!1,isAsync)}else if(this.type===types._class){var cNode=this.startNode();node.declaration=this.parseClass(cNode,"nullableID")}else node.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(node,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())node.declaration=this.parseStatement(null),"VariableDeclaration"===node.declaration.type?this.checkVariableExport(exports,node.declaration.declarations):this.checkExport(exports,node.declaration.id.name,node.declaration.id.start),node.specifiers=[],node.source=null;else{if(node.declaration=null,node.specifiers=this.parseExportSpecifiers(exports),this.eatContextual("from"))this.type!==types.string&&this.unexpected(),node.source=this.parseExprAtom();else{for(var i=0,list=node.specifiers;i=6&&node)switch(node.type){case"Identifier":this.inAsync&&"await"===node.name&&this.raise(node.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":node.type="ObjectPattern",refDestructuringErrors&&this.checkPatternErrors(refDestructuringErrors,!0);for(var i=0,list=node.properties;i=8&&!containsEsc&&"async"===id.name&&!this.canInsertSemicolon()&&this.eat(types._function))return this.parseFunction(this.startNodeAt(startPos,startLoc),0,!1,!0);if(canBeArrow&&!this.canInsertSemicolon()){if(this.eat(types.arrow))return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],!1);if(this.options.ecmaVersion>=8&&"async"===id.name&&this.type===types.name&&!containsEsc)return id=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(types.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],!0)}return id;case types.regexp:var value=this.value;return(node=this.parseLiteral(value.value)).regex={pattern:value.pattern,flags:value.flags},node;case types.num:case types.string:return this.parseLiteral(this.value);case types._null:case types._true:case types._false:return(node=this.startNode()).value=this.type===types._null?null:this.type===types._true,node.raw=this.type.keyword,this.next(),this.finishNode(node,"Literal");case types.parenL:var start=this.start,expr=this.parseParenAndDistinguishExpression(canBeArrow);return refDestructuringErrors&&(refDestructuringErrors.parenthesizedAssign<0&&!this.isSimpleAssignTarget(expr)&&(refDestructuringErrors.parenthesizedAssign=start),refDestructuringErrors.parenthesizedBind<0&&(refDestructuringErrors.parenthesizedBind=start)),expr;case types.bracketL:return node=this.startNode(),this.next(),node.elements=this.parseExprList(types.bracketR,!0,!0,refDestructuringErrors),this.finishNode(node,"ArrayExpression");case types.braceL:return this.parseObj(!1,refDestructuringErrors);case types._function:return node=this.startNode(),this.next(),this.parseFunction(node,0);case types._class:return this.parseClass(this.startNode(),!1);case types._new:return this.parseNew();case types.backQuote:return this.parseTemplate();case types._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},pp$3.parseExprImport=function(){var node=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var meta=this.parseIdent(!0);switch(this.type){case types.parenL:return this.parseDynamicImport(node);case types.dot:return node.meta=meta,this.parseImportMeta(node);default:this.unexpected()}},pp$3.parseDynamicImport=function(node){if(this.next(),node.source=this.parseMaybeAssign(),!this.eat(types.parenR)){var errorPos=this.start;this.eat(types.comma)&&this.eat(types.parenR)?this.raiseRecoverable(errorPos,"Trailing comma is not allowed in import()"):this.unexpected(errorPos)}return this.finishNode(node,"ImportExpression")},pp$3.parseImportMeta=function(node){this.next();var containsEsc=this.containsEsc;return node.property=this.parseIdent(!0),"meta"!==node.property.name&&this.raiseRecoverable(node.property.start,"The only valid meta property for import is 'import.meta'"),containsEsc&&this.raiseRecoverable(node.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(node.start,"Cannot use 'import.meta' outside a module"),this.finishNode(node,"MetaProperty")},pp$3.parseLiteral=function(value){var node=this.startNode();return node.value=value,node.raw=this.input.slice(this.start,this.end),110===node.raw.charCodeAt(node.raw.length-1)&&(node.bigint=node.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(node,"Literal")},pp$3.parseParenExpression=function(){this.expect(types.parenL);var val=this.parseExpression();return this.expect(types.parenR),val},pp$3.parseParenAndDistinguishExpression=function(canBeArrow){var val,startPos=this.start,startLoc=this.startLoc,allowTrailingComma=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var spreadStart,innerStartPos=this.start,innerStartLoc=this.startLoc,exprList=[],first=!0,lastIsComma=!1,refDestructuringErrors=new DestructuringErrors,oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==types.parenR;){if(first?first=!1:this.expect(types.comma),allowTrailingComma&&this.afterTrailingComma(types.parenR,!0)){lastIsComma=!0;break}if(this.type===types.ellipsis){spreadStart=this.start,exprList.push(this.parseParenItem(this.parseRestBinding())),this.type===types.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}exprList.push(this.parseMaybeAssign(!1,refDestructuringErrors,this.parseParenItem))}var innerEndPos=this.start,innerEndLoc=this.startLoc;if(this.expect(types.parenR),canBeArrow&&!this.canInsertSemicolon()&&this.eat(types.arrow))return this.checkPatternErrors(refDestructuringErrors,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.parseParenArrowList(startPos,startLoc,exprList);exprList.length&&!lastIsComma||this.unexpected(this.lastTokStart),spreadStart&&this.unexpected(spreadStart),this.checkExpressionErrors(refDestructuringErrors,!0),this.yieldPos=oldYieldPos||this.yieldPos,this.awaitPos=oldAwaitPos||this.awaitPos,exprList.length>1?((val=this.startNodeAt(innerStartPos,innerStartLoc)).expressions=exprList,this.finishNodeAt(val,"SequenceExpression",innerEndPos,innerEndLoc)):val=exprList[0]}else val=this.parseParenExpression();if(this.options.preserveParens){var par=this.startNodeAt(startPos,startLoc);return par.expression=val,this.finishNode(par,"ParenthesizedExpression")}return val},pp$3.parseParenItem=function(item){return item},pp$3.parseParenArrowList=function(startPos,startLoc,exprList){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),exprList)};var empty$1=[];pp$3.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var node=this.startNode(),meta=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(types.dot)){node.meta=meta;var containsEsc=this.containsEsc;return node.property=this.parseIdent(!0),"target"!==node.property.name&&this.raiseRecoverable(node.property.start,"The only valid meta property for new is 'new.target'"),containsEsc&&this.raiseRecoverable(node.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(node.start,"'new.target' can only be used in functions"),this.finishNode(node,"MetaProperty")}var startPos=this.start,startLoc=this.startLoc,isImport=this.type===types._import;return node.callee=this.parseSubscripts(this.parseExprAtom(),startPos,startLoc,!0),isImport&&"ImportExpression"===node.callee.type&&this.raise(startPos,"Cannot use new with import()"),this.eat(types.parenL)?node.arguments=this.parseExprList(types.parenR,this.options.ecmaVersion>=8,!1):node.arguments=empty$1,this.finishNode(node,"NewExpression")},pp$3.parseTemplateElement=function(ref){var isTagged=ref.isTagged,elem=this.startNode();return this.type===types.invalidTemplate?(isTagged||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),elem.value={raw:this.value,cooked:null}):elem.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),elem.tail=this.type===types.backQuote,this.finishNode(elem,"TemplateElement")},pp$3.parseTemplate=function(ref){void 0===ref&&(ref={});var isTagged=ref.isTagged;void 0===isTagged&&(isTagged=!1);var node=this.startNode();this.next(),node.expressions=[];var curElt=this.parseTemplateElement({isTagged:isTagged});for(node.quasis=[curElt];!curElt.tail;)this.type===types.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(types.dollarBraceL),node.expressions.push(this.parseExpression()),this.expect(types.braceR),node.quasis.push(curElt=this.parseTemplateElement({isTagged:isTagged}));return this.next(),this.finishNode(node,"TemplateLiteral")},pp$3.isAsyncProp=function(prop){return!prop.computed&&"Identifier"===prop.key.type&&"async"===prop.key.name&&(this.type===types.name||this.type===types.num||this.type===types.string||this.type===types.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===types.star)&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp$3.parseObj=function(isPattern,refDestructuringErrors){var node=this.startNode(),first=!0,propHash={};for(node.properties=[],this.next();!this.eat(types.braceR);){if(first)first=!1;else if(this.expect(types.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(types.braceR))break;var prop=this.parseProperty(isPattern,refDestructuringErrors);isPattern||this.checkPropClash(prop,propHash,refDestructuringErrors),node.properties.push(prop)}return this.finishNode(node,isPattern?"ObjectPattern":"ObjectExpression")},pp$3.parseProperty=function(isPattern,refDestructuringErrors){var isGenerator,isAsync,startPos,startLoc,prop=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(types.ellipsis))return isPattern?(prop.argument=this.parseIdent(!1),this.type===types.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(prop,"RestElement")):(this.type===types.parenL&&refDestructuringErrors&&(refDestructuringErrors.parenthesizedAssign<0&&(refDestructuringErrors.parenthesizedAssign=this.start),refDestructuringErrors.parenthesizedBind<0&&(refDestructuringErrors.parenthesizedBind=this.start)),prop.argument=this.parseMaybeAssign(!1,refDestructuringErrors),this.type===types.comma&&refDestructuringErrors&&refDestructuringErrors.trailingComma<0&&(refDestructuringErrors.trailingComma=this.start),this.finishNode(prop,"SpreadElement"));this.options.ecmaVersion>=6&&(prop.method=!1,prop.shorthand=!1,(isPattern||refDestructuringErrors)&&(startPos=this.start,startLoc=this.startLoc),isPattern||(isGenerator=this.eat(types.star)));var containsEsc=this.containsEsc;return this.parsePropertyName(prop),!isPattern&&!containsEsc&&this.options.ecmaVersion>=8&&!isGenerator&&this.isAsyncProp(prop)?(isAsync=!0,isGenerator=this.options.ecmaVersion>=9&&this.eat(types.star),this.parsePropertyName(prop,refDestructuringErrors)):isAsync=!1,this.parsePropertyValue(prop,isPattern,isGenerator,isAsync,startPos,startLoc,refDestructuringErrors,containsEsc),this.finishNode(prop,"Property")},pp$3.parsePropertyValue=function(prop,isPattern,isGenerator,isAsync,startPos,startLoc,refDestructuringErrors,containsEsc){if((isGenerator||isAsync)&&this.type===types.colon&&this.unexpected(),this.eat(types.colon))prop.value=isPattern?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,refDestructuringErrors),prop.kind="init";else if(this.options.ecmaVersion>=6&&this.type===types.parenL)isPattern&&this.unexpected(),prop.kind="init",prop.method=!0,prop.value=this.parseMethod(isGenerator,isAsync);else if(isPattern||containsEsc||!(this.options.ecmaVersion>=5)||prop.computed||"Identifier"!==prop.key.type||"get"!==prop.key.name&&"set"!==prop.key.name||this.type===types.comma||this.type===types.braceR||this.type===types.eq)this.options.ecmaVersion>=6&&!prop.computed&&"Identifier"===prop.key.type?((isGenerator||isAsync)&&this.unexpected(),this.checkUnreserved(prop.key),"await"!==prop.key.name||this.awaitIdentPos||(this.awaitIdentPos=startPos),prop.kind="init",isPattern?prop.value=this.parseMaybeDefault(startPos,startLoc,prop.key):this.type===types.eq&&refDestructuringErrors?(refDestructuringErrors.shorthandAssign<0&&(refDestructuringErrors.shorthandAssign=this.start),prop.value=this.parseMaybeDefault(startPos,startLoc,prop.key)):prop.value=prop.key,prop.shorthand=!0):this.unexpected();else{(isGenerator||isAsync)&&this.unexpected(),prop.kind=prop.key.name,this.parsePropertyName(prop),prop.value=this.parseMethod(!1);var paramCount="get"===prop.kind?0:1;if(prop.value.params.length!==paramCount){var start=prop.value.start;"get"===prop.kind?this.raiseRecoverable(start,"getter should have no params"):this.raiseRecoverable(start,"setter should have exactly one param")}else"set"===prop.kind&&"RestElement"===prop.value.params[0].type&&this.raiseRecoverable(prop.value.params[0].start,"Setter cannot use rest params")}},pp$3.parsePropertyName=function(prop){if(this.options.ecmaVersion>=6){if(this.eat(types.bracketL))return prop.computed=!0,prop.key=this.parseMaybeAssign(),this.expect(types.bracketR),prop.key;prop.computed=!1}return prop.key=this.type===types.num||this.type===types.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},pp$3.initFunction=function(node){node.id=null,this.options.ecmaVersion>=6&&(node.generator=node.expression=!1),this.options.ecmaVersion>=8&&(node.async=!1)},pp$3.parseMethod=function(isGenerator,isAsync,allowDirectSuper){var node=this.startNode(),oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;return this.initFunction(node),this.options.ecmaVersion>=6&&(node.generator=isGenerator),this.options.ecmaVersion>=8&&(node.async=!!isAsync),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|functionFlags(isAsync,node.generator)|(allowDirectSuper?128:0)),this.expect(types.parenL),node.params=this.parseBindingList(types.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(node,!1,!0),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node,"FunctionExpression")},pp$3.parseArrowExpression=function(node,params,isAsync){var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;return this.enterScope(16|functionFlags(isAsync,!1)),this.initFunction(node),this.options.ecmaVersion>=8&&(node.async=!!isAsync),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,node.params=this.toAssignableList(params,!0),this.parseFunctionBody(node,!0,!1),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node,"ArrowFunctionExpression")},pp$3.parseFunctionBody=function(node,isArrowFunction,isMethod){var isExpression=isArrowFunction&&this.type!==types.braceL,oldStrict=this.strict,useStrict=!1;if(isExpression)node.body=this.parseMaybeAssign(),node.expression=!0,this.checkParams(node,!1);else{var nonSimple=this.options.ecmaVersion>=7&&!this.isSimpleParamList(node.params);oldStrict&&!nonSimple||(useStrict=this.strictDirective(this.end))&&nonSimple&&this.raiseRecoverable(node.start,"Illegal 'use strict' directive in function with non-simple parameter list");var oldLabels=this.labels;this.labels=[],useStrict&&(this.strict=!0),this.checkParams(node,!oldStrict&&!useStrict&&!isArrowFunction&&!isMethod&&this.isSimpleParamList(node.params)),this.strict&&node.id&&this.checkLVal(node.id,5),node.body=this.parseBlock(!1,void 0,useStrict&&!oldStrict),node.expression=!1,this.adaptDirectivePrologue(node.body.body),this.labels=oldLabels}this.exitScope()},pp$3.isSimpleParamList=function(params){for(var i=0,list=params;i-1||scope.functions.indexOf(name)>-1||scope.var.indexOf(name)>-1,scope.lexical.push(name),this.inModule&&1&scope.flags&&delete this.undefinedExports[name]}else if(4===bindingType){this.currentScope().lexical.push(name)}else if(3===bindingType){var scope$2=this.currentScope();redeclared=this.treatFunctionsAsVar?scope$2.lexical.indexOf(name)>-1:scope$2.lexical.indexOf(name)>-1||scope$2.var.indexOf(name)>-1,scope$2.functions.push(name)}else for(var i=this.scopeStack.length-1;i>=0;--i){var scope$3=this.scopeStack[i];if(scope$3.lexical.indexOf(name)>-1&&!(32&scope$3.flags&&scope$3.lexical[0]===name)||!this.treatFunctionsAsVarInScope(scope$3)&&scope$3.functions.indexOf(name)>-1){redeclared=!0;break}if(scope$3.var.push(name),this.inModule&&1&scope$3.flags&&delete this.undefinedExports[name],3&scope$3.flags)break}redeclared&&this.raiseRecoverable(pos,"Identifier '"+name+"' has already been declared")},pp$5.checkLocalExport=function(id){-1===this.scopeStack[0].lexical.indexOf(id.name)&&-1===this.scopeStack[0].var.indexOf(id.name)&&(this.undefinedExports[id.name]=id)},pp$5.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},pp$5.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var scope=this.scopeStack[i];if(3&scope.flags)return scope}},pp$5.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var scope=this.scopeStack[i];if(3&scope.flags&&!(16&scope.flags))return scope}};var Node=function Node(parser,pos,loc){this.type="",this.start=pos,this.end=0,parser.options.locations&&(this.loc=new SourceLocation(parser,loc)),parser.options.directSourceFile&&(this.sourceFile=parser.options.directSourceFile),parser.options.ranges&&(this.range=[pos,0])},pp$6=Parser.prototype;function finishNodeAt(node,type,pos,loc){return node.type=type,node.end=pos,this.options.locations&&(node.loc.end=loc),this.options.ranges&&(node.range[1]=pos),node}pp$6.startNode=function(){return new Node(this,this.start,this.startLoc)},pp$6.startNodeAt=function(pos,loc){return new Node(this,pos,loc)},pp$6.finishNode=function(node,type){return finishNodeAt.call(this,node,type,this.lastTokEnd,this.lastTokEndLoc)},pp$6.finishNodeAt=function(node,type,pos,loc){return finishNodeAt.call(this,node,type,pos,loc)};var TokContext=function TokContext(token,isExpr,preserveSpace,override,generator){this.token=token,this.isExpr=!!isExpr,this.preserveSpace=!!preserveSpace,this.override=override,this.generator=!!generator},types$1={b_stat:new TokContext("{",!1),b_expr:new TokContext("{",!0),b_tmpl:new TokContext("${",!1),p_stat:new TokContext("(",!1),p_expr:new TokContext("(",!0),q_tmpl:new TokContext("`",!0,!0,(function(p){return p.tryReadTemplateToken()})),f_stat:new TokContext("function",!1),f_expr:new TokContext("function",!0),f_expr_gen:new TokContext("function",!0,!1,null,!0),f_gen:new TokContext("function",!1,!1,null,!0)},pp$7=Parser.prototype;pp$7.initialContext=function(){return[types$1.b_stat]},pp$7.braceIsBlock=function(prevType){var parent=this.curContext();return parent===types$1.f_expr||parent===types$1.f_stat||(prevType!==types.colon||parent!==types$1.b_stat&&parent!==types$1.b_expr?prevType===types._return||prevType===types.name&&this.exprAllowed?lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):prevType===types._else||prevType===types.semi||prevType===types.eof||prevType===types.parenR||prevType===types.arrow||(prevType===types.braceL?parent===types$1.b_stat:prevType!==types._var&&prevType!==types._const&&prevType!==types.name&&!this.exprAllowed):!parent.isExpr)},pp$7.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var context=this.context[i];if("function"===context.token)return context.generator}return!1},pp$7.updateContext=function(prevType){var update,type=this.type;type.keyword&&prevType===types.dot?this.exprAllowed=!1:(update=type.updateContext)?update.call(this,prevType):this.exprAllowed=type.beforeExpr},types.parenR.updateContext=types.braceR.updateContext=function(){if(1!==this.context.length){var out=this.context.pop();out===types$1.b_stat&&"function"===this.curContext().token&&(out=this.context.pop()),this.exprAllowed=!out.isExpr}else this.exprAllowed=!0},types.braceL.updateContext=function(prevType){this.context.push(this.braceIsBlock(prevType)?types$1.b_stat:types$1.b_expr),this.exprAllowed=!0},types.dollarBraceL.updateContext=function(){this.context.push(types$1.b_tmpl),this.exprAllowed=!0},types.parenL.updateContext=function(prevType){var statementParens=prevType===types._if||prevType===types._for||prevType===types._with||prevType===types._while;this.context.push(statementParens?types$1.p_stat:types$1.p_expr),this.exprAllowed=!0},types.incDec.updateContext=function(){},types._function.updateContext=types._class.updateContext=function(prevType){!prevType.beforeExpr||prevType===types.semi||prevType===types._else||prevType===types._return&&lineBreak.test(this.input.slice(this.lastTokEnd,this.start))||(prevType===types.colon||prevType===types.braceL)&&this.curContext()===types$1.b_stat?this.context.push(types$1.f_stat):this.context.push(types$1.f_expr),this.exprAllowed=!1},types.backQuote.updateContext=function(){this.curContext()===types$1.q_tmpl?this.context.pop():this.context.push(types$1.q_tmpl),this.exprAllowed=!1},types.star.updateContext=function(prevType){if(prevType===types._function){var index=this.context.length-1;this.context[index]===types$1.f_expr?this.context[index]=types$1.f_expr_gen:this.context[index]=types$1.f_gen}this.exprAllowed=!0},types.name.updateContext=function(prevType){var allowed=!1;this.options.ecmaVersion>=6&&prevType!==types.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(allowed=!0),this.exprAllowed=allowed};var ecma9BinaryProperties="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ecma10BinaryProperties=ecma9BinaryProperties+" Extended_Pictographic",unicodeBinaryProperties={9:ecma9BinaryProperties,10:ecma10BinaryProperties,11:ecma10BinaryProperties},unicodeGeneralCategoryValues="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ecma9ScriptValues="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ecma10ScriptValues=ecma9ScriptValues+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",unicodeScriptValues={9:ecma9ScriptValues,10:ecma10ScriptValues,11:ecma10ScriptValues+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},data={};function buildUnicodeData(ecmaVersion){var d=data[ecmaVersion]={binary:wordsRegexp(unicodeBinaryProperties[ecmaVersion]+" "+unicodeGeneralCategoryValues),nonBinary:{General_Category:wordsRegexp(unicodeGeneralCategoryValues),Script:wordsRegexp(unicodeScriptValues[ecmaVersion])}};d.nonBinary.Script_Extensions=d.nonBinary.Script,d.nonBinary.gc=d.nonBinary.General_Category,d.nonBinary.sc=d.nonBinary.Script,d.nonBinary.scx=d.nonBinary.Script_Extensions}buildUnicodeData(9),buildUnicodeData(10),buildUnicodeData(11);var pp$8=Parser.prototype,RegExpValidationState=function RegExpValidationState(parser){this.parser=parser,this.validFlags="gim"+(parser.options.ecmaVersion>=6?"uy":"")+(parser.options.ecmaVersion>=9?"s":""),this.unicodeProperties=data[parser.options.ecmaVersion>=11?11:parser.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function codePointToString(ch){return ch<=65535?String.fromCharCode(ch):(ch-=65536,String.fromCharCode(55296+(ch>>10),56320+(1023&ch)))}function isSyntaxCharacter(ch){return 36===ch||ch>=40&&ch<=43||46===ch||63===ch||ch>=91&&ch<=94||ch>=123&&ch<=125}function isControlLetter(ch){return ch>=65&&ch<=90||ch>=97&&ch<=122}function isUnicodePropertyNameCharacter(ch){return isControlLetter(ch)||95===ch}function isUnicodePropertyValueCharacter(ch){return isUnicodePropertyNameCharacter(ch)||isDecimalDigit(ch)}function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return ch>=48&&ch<=57||ch>=65&&ch<=70||ch>=97&&ch<=102}function hexToInt(ch){return ch>=65&&ch<=70?ch-65+10:ch>=97&&ch<=102?ch-97+10:ch-48}function isOctalDigit(ch){return ch>=48&&ch<=55}RegExpValidationState.prototype.reset=function reset(start,pattern,flags){var unicode=-1!==flags.indexOf("u");this.start=0|start,this.source=pattern+"",this.flags=flags,this.switchU=unicode&&this.parser.options.ecmaVersion>=6,this.switchN=unicode&&this.parser.options.ecmaVersion>=9},RegExpValidationState.prototype.raise=function raise(message){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+message)},RegExpValidationState.prototype.at=function at(i,forceU){void 0===forceU&&(forceU=!1);var s=this.source,l=s.length;if(i>=l)return-1;var c=s.charCodeAt(i);if(!forceU&&!this.switchU||c<=55295||c>=57344||i+1>=l)return c;var next=s.charCodeAt(i+1);return next>=56320&&next<=57343?(c<<10)+next-56613888:c},RegExpValidationState.prototype.nextIndex=function nextIndex(i,forceU){void 0===forceU&&(forceU=!1);var s=this.source,l=s.length;if(i>=l)return l;var next,c=s.charCodeAt(i);return!forceU&&!this.switchU||c<=55295||c>=57344||i+1>=l||(next=s.charCodeAt(i+1))<56320||next>57343?i+1:i+2},RegExpValidationState.prototype.current=function current(forceU){return void 0===forceU&&(forceU=!1),this.at(this.pos,forceU)},RegExpValidationState.prototype.lookahead=function lookahead(forceU){return void 0===forceU&&(forceU=!1),this.at(this.nextIndex(this.pos,forceU),forceU)},RegExpValidationState.prototype.advance=function advance(forceU){void 0===forceU&&(forceU=!1),this.pos=this.nextIndex(this.pos,forceU)},RegExpValidationState.prototype.eat=function eat(ch,forceU){return void 0===forceU&&(forceU=!1),this.current(forceU)===ch&&(this.advance(forceU),!0)},pp$8.validateRegExpFlags=function(state){for(var validFlags=state.validFlags,flags=state.flags,i=0;i-1&&this.raise(state.start,"Duplicate regular expression flag")}},pp$8.validateRegExpPattern=function(state){this.regexp_pattern(state),!state.switchN&&this.options.ecmaVersion>=9&&state.groupNames.length>0&&(state.switchN=!0,this.regexp_pattern(state))},pp$8.regexp_pattern=function(state){state.pos=0,state.lastIntValue=0,state.lastStringValue="",state.lastAssertionIsQuantifiable=!1,state.numCapturingParens=0,state.maxBackReference=0,state.groupNames.length=0,state.backReferenceNames.length=0,this.regexp_disjunction(state),state.pos!==state.source.length&&(state.eat(41)&&state.raise("Unmatched ')'"),(state.eat(93)||state.eat(125))&&state.raise("Lone quantifier brackets")),state.maxBackReference>state.numCapturingParens&&state.raise("Invalid escape");for(var i=0,list=state.backReferenceNames;i=9&&(lookbehind=state.eat(60)),state.eat(61)||state.eat(33))return this.regexp_disjunction(state),state.eat(41)||state.raise("Unterminated group"),state.lastAssertionIsQuantifiable=!lookbehind,!0}return state.pos=start,!1},pp$8.regexp_eatQuantifier=function(state,noError){return void 0===noError&&(noError=!1),!!this.regexp_eatQuantifierPrefix(state,noError)&&(state.eat(63),!0)},pp$8.regexp_eatQuantifierPrefix=function(state,noError){return state.eat(42)||state.eat(43)||state.eat(63)||this.regexp_eatBracedQuantifier(state,noError)},pp$8.regexp_eatBracedQuantifier=function(state,noError){var start=state.pos;if(state.eat(123)){var min=0,max=-1;if(this.regexp_eatDecimalDigits(state)&&(min=state.lastIntValue,state.eat(44)&&this.regexp_eatDecimalDigits(state)&&(max=state.lastIntValue),state.eat(125)))return-1!==max&&max=9?this.regexp_groupSpecifier(state):63===state.current()&&state.raise("Invalid group"),this.regexp_disjunction(state),state.eat(41))return state.numCapturingParens+=1,!0;state.raise("Unterminated group")}return!1},pp$8.regexp_eatExtendedAtom=function(state){return state.eat(46)||this.regexp_eatReverseSolidusAtomEscape(state)||this.regexp_eatCharacterClass(state)||this.regexp_eatUncapturingGroup(state)||this.regexp_eatCapturingGroup(state)||this.regexp_eatInvalidBracedQuantifier(state)||this.regexp_eatExtendedPatternCharacter(state)},pp$8.regexp_eatInvalidBracedQuantifier=function(state){return this.regexp_eatBracedQuantifier(state,!0)&&state.raise("Nothing to repeat"),!1},pp$8.regexp_eatSyntaxCharacter=function(state){var ch=state.current();return!!isSyntaxCharacter(ch)&&(state.lastIntValue=ch,state.advance(),!0)},pp$8.regexp_eatPatternCharacters=function(state){for(var start=state.pos,ch=0;-1!==(ch=state.current())&&!isSyntaxCharacter(ch);)state.advance();return state.pos!==start},pp$8.regexp_eatExtendedPatternCharacter=function(state){var ch=state.current();return!(-1===ch||36===ch||ch>=40&&ch<=43||46===ch||63===ch||91===ch||94===ch||124===ch)&&(state.advance(),!0)},pp$8.regexp_groupSpecifier=function(state){if(state.eat(63)){if(this.regexp_eatGroupName(state))return-1!==state.groupNames.indexOf(state.lastStringValue)&&state.raise("Duplicate capture group name"),void state.groupNames.push(state.lastStringValue);state.raise("Invalid group")}},pp$8.regexp_eatGroupName=function(state){if(state.lastStringValue="",state.eat(60)){if(this.regexp_eatRegExpIdentifierName(state)&&state.eat(62))return!0;state.raise("Invalid capture group name")}return!1},pp$8.regexp_eatRegExpIdentifierName=function(state){if(state.lastStringValue="",this.regexp_eatRegExpIdentifierStart(state)){for(state.lastStringValue+=codePointToString(state.lastIntValue);this.regexp_eatRegExpIdentifierPart(state);)state.lastStringValue+=codePointToString(state.lastIntValue);return!0}return!1},pp$8.regexp_eatRegExpIdentifierStart=function(state){var start=state.pos,forceU=this.options.ecmaVersion>=11,ch=state.current(forceU);return state.advance(forceU),92===ch&&this.regexp_eatRegExpUnicodeEscapeSequence(state,forceU)&&(ch=state.lastIntValue),function isRegExpIdentifierStart(ch){return isIdentifierStart(ch,!0)||36===ch||95===ch}(ch)?(state.lastIntValue=ch,!0):(state.pos=start,!1)},pp$8.regexp_eatRegExpIdentifierPart=function(state){var start=state.pos,forceU=this.options.ecmaVersion>=11,ch=state.current(forceU);return state.advance(forceU),92===ch&&this.regexp_eatRegExpUnicodeEscapeSequence(state,forceU)&&(ch=state.lastIntValue),function isRegExpIdentifierPart(ch){return isIdentifierChar(ch,!0)||36===ch||95===ch||8204===ch||8205===ch}(ch)?(state.lastIntValue=ch,!0):(state.pos=start,!1)},pp$8.regexp_eatAtomEscape=function(state){return!!(this.regexp_eatBackReference(state)||this.regexp_eatCharacterClassEscape(state)||this.regexp_eatCharacterEscape(state)||state.switchN&&this.regexp_eatKGroupName(state))||(state.switchU&&(99===state.current()&&state.raise("Invalid unicode escape"),state.raise("Invalid escape")),!1)},pp$8.regexp_eatBackReference=function(state){var start=state.pos;if(this.regexp_eatDecimalEscape(state)){var n=state.lastIntValue;if(state.switchU)return n>state.maxBackReference&&(state.maxBackReference=n),!0;if(n<=state.numCapturingParens)return!0;state.pos=start}return!1},pp$8.regexp_eatKGroupName=function(state){if(state.eat(107)){if(this.regexp_eatGroupName(state))return state.backReferenceNames.push(state.lastStringValue),!0;state.raise("Invalid named reference")}return!1},pp$8.regexp_eatCharacterEscape=function(state){return this.regexp_eatControlEscape(state)||this.regexp_eatCControlLetter(state)||this.regexp_eatZero(state)||this.regexp_eatHexEscapeSequence(state)||this.regexp_eatRegExpUnicodeEscapeSequence(state,!1)||!state.switchU&&this.regexp_eatLegacyOctalEscapeSequence(state)||this.regexp_eatIdentityEscape(state)},pp$8.regexp_eatCControlLetter=function(state){var start=state.pos;if(state.eat(99)){if(this.regexp_eatControlLetter(state))return!0;state.pos=start}return!1},pp$8.regexp_eatZero=function(state){return 48===state.current()&&!isDecimalDigit(state.lookahead())&&(state.lastIntValue=0,state.advance(),!0)},pp$8.regexp_eatControlEscape=function(state){var ch=state.current();return 116===ch?(state.lastIntValue=9,state.advance(),!0):110===ch?(state.lastIntValue=10,state.advance(),!0):118===ch?(state.lastIntValue=11,state.advance(),!0):102===ch?(state.lastIntValue=12,state.advance(),!0):114===ch&&(state.lastIntValue=13,state.advance(),!0)},pp$8.regexp_eatControlLetter=function(state){var ch=state.current();return!!isControlLetter(ch)&&(state.lastIntValue=ch%32,state.advance(),!0)},pp$8.regexp_eatRegExpUnicodeEscapeSequence=function(state,forceU){void 0===forceU&&(forceU=!1);var start=state.pos,switchU=forceU||state.switchU;if(state.eat(117)){if(this.regexp_eatFixedHexDigits(state,4)){var lead=state.lastIntValue;if(switchU&&lead>=55296&&lead<=56319){var leadSurrogateEnd=state.pos;if(state.eat(92)&&state.eat(117)&&this.regexp_eatFixedHexDigits(state,4)){var trail=state.lastIntValue;if(trail>=56320&&trail<=57343)return state.lastIntValue=1024*(lead-55296)+(trail-56320)+65536,!0}state.pos=leadSurrogateEnd,state.lastIntValue=lead}return!0}if(switchU&&state.eat(123)&&this.regexp_eatHexDigits(state)&&state.eat(125)&&function isValidUnicode(ch){return ch>=0&&ch<=1114111}(state.lastIntValue))return!0;switchU&&state.raise("Invalid unicode escape"),state.pos=start}return!1},pp$8.regexp_eatIdentityEscape=function(state){if(state.switchU)return!!this.regexp_eatSyntaxCharacter(state)||!!state.eat(47)&&(state.lastIntValue=47,!0);var ch=state.current();return!(99===ch||state.switchN&&107===ch)&&(state.lastIntValue=ch,state.advance(),!0)},pp$8.regexp_eatDecimalEscape=function(state){state.lastIntValue=0;var ch=state.current();if(ch>=49&&ch<=57){do{state.lastIntValue=10*state.lastIntValue+(ch-48),state.advance()}while((ch=state.current())>=48&&ch<=57);return!0}return!1},pp$8.regexp_eatCharacterClassEscape=function(state){var ch=state.current();if(function isCharacterClassEscape(ch){return 100===ch||68===ch||115===ch||83===ch||119===ch||87===ch}(ch))return state.lastIntValue=-1,state.advance(),!0;if(state.switchU&&this.options.ecmaVersion>=9&&(80===ch||112===ch)){if(state.lastIntValue=-1,state.advance(),state.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(state)&&state.eat(125))return!0;state.raise("Invalid property name")}return!1},pp$8.regexp_eatUnicodePropertyValueExpression=function(state){var start=state.pos;if(this.regexp_eatUnicodePropertyName(state)&&state.eat(61)){var name=state.lastStringValue;if(this.regexp_eatUnicodePropertyValue(state)){var value=state.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(state,name,value),!0}}if(state.pos=start,this.regexp_eatLoneUnicodePropertyNameOrValue(state)){var nameOrValue=state.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(state,nameOrValue),!0}return!1},pp$8.regexp_validateUnicodePropertyNameAndValue=function(state,name,value){has(state.unicodeProperties.nonBinary,name)||state.raise("Invalid property name"),state.unicodeProperties.nonBinary[name].test(value)||state.raise("Invalid property value")},pp$8.regexp_validateUnicodePropertyNameOrValue=function(state,nameOrValue){state.unicodeProperties.binary.test(nameOrValue)||state.raise("Invalid property name")},pp$8.regexp_eatUnicodePropertyName=function(state){var ch=0;for(state.lastStringValue="";isUnicodePropertyNameCharacter(ch=state.current());)state.lastStringValue+=codePointToString(ch),state.advance();return""!==state.lastStringValue},pp$8.regexp_eatUnicodePropertyValue=function(state){var ch=0;for(state.lastStringValue="";isUnicodePropertyValueCharacter(ch=state.current());)state.lastStringValue+=codePointToString(ch),state.advance();return""!==state.lastStringValue},pp$8.regexp_eatLoneUnicodePropertyNameOrValue=function(state){return this.regexp_eatUnicodePropertyValue(state)},pp$8.regexp_eatCharacterClass=function(state){if(state.eat(91)){if(state.eat(94),this.regexp_classRanges(state),state.eat(93))return!0;state.raise("Unterminated character class")}return!1},pp$8.regexp_classRanges=function(state){for(;this.regexp_eatClassAtom(state);){var left=state.lastIntValue;if(state.eat(45)&&this.regexp_eatClassAtom(state)){var right=state.lastIntValue;!state.switchU||-1!==left&&-1!==right||state.raise("Invalid character class"),-1!==left&&-1!==right&&left>right&&state.raise("Range out of order in character class")}}},pp$8.regexp_eatClassAtom=function(state){var start=state.pos;if(state.eat(92)){if(this.regexp_eatClassEscape(state))return!0;if(state.switchU){var ch$1=state.current();(99===ch$1||isOctalDigit(ch$1))&&state.raise("Invalid class escape"),state.raise("Invalid escape")}state.pos=start}var ch=state.current();return 93!==ch&&(state.lastIntValue=ch,state.advance(),!0)},pp$8.regexp_eatClassEscape=function(state){var start=state.pos;if(state.eat(98))return state.lastIntValue=8,!0;if(state.switchU&&state.eat(45))return state.lastIntValue=45,!0;if(!state.switchU&&state.eat(99)){if(this.regexp_eatClassControlLetter(state))return!0;state.pos=start}return this.regexp_eatCharacterClassEscape(state)||this.regexp_eatCharacterEscape(state)},pp$8.regexp_eatClassControlLetter=function(state){var ch=state.current();return!(!isDecimalDigit(ch)&&95!==ch)&&(state.lastIntValue=ch%32,state.advance(),!0)},pp$8.regexp_eatHexEscapeSequence=function(state){var start=state.pos;if(state.eat(120)){if(this.regexp_eatFixedHexDigits(state,2))return!0;state.switchU&&state.raise("Invalid escape"),state.pos=start}return!1},pp$8.regexp_eatDecimalDigits=function(state){var start=state.pos,ch=0;for(state.lastIntValue=0;isDecimalDigit(ch=state.current());)state.lastIntValue=10*state.lastIntValue+(ch-48),state.advance();return state.pos!==start},pp$8.regexp_eatHexDigits=function(state){var start=state.pos,ch=0;for(state.lastIntValue=0;isHexDigit(ch=state.current());)state.lastIntValue=16*state.lastIntValue+hexToInt(ch),state.advance();return state.pos!==start},pp$8.regexp_eatLegacyOctalEscapeSequence=function(state){if(this.regexp_eatOctalDigit(state)){var n1=state.lastIntValue;if(this.regexp_eatOctalDigit(state)){var n2=state.lastIntValue;n1<=3&&this.regexp_eatOctalDigit(state)?state.lastIntValue=64*n1+8*n2+state.lastIntValue:state.lastIntValue=8*n1+n2}else state.lastIntValue=n1;return!0}return!1},pp$8.regexp_eatOctalDigit=function(state){var ch=state.current();return isOctalDigit(ch)?(state.lastIntValue=ch-48,state.advance(),!0):(state.lastIntValue=0,!1)},pp$8.regexp_eatFixedHexDigits=function(state,length){var start=state.pos;state.lastIntValue=0;for(var i=0;i>10),56320+(1023&code)))}pp$9.next=function(ignoreEscapeSequenceInKeyword){!ignoreEscapeSequenceInKeyword&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pp$9.getToken=function(){return this.next(),new Token(this)},"undefined"!=typeof Symbol&&(pp$9[Symbol.iterator]=function(){var this$1=this;return{next:function(){var token=this$1.getToken();return{done:token.type===types.eof,value:token}}}}),pp$9.curContext=function(){return this.context[this.context.length-1]},pp$9.nextToken=function(){var curContext=this.curContext();return curContext&&curContext.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(types.eof):curContext.override?curContext.override(this):void this.readToken(this.fullCharCodeAtPos())},pp$9.readToken=function(code){return isIdentifierStart(code,this.options.ecmaVersion>=6)||92===code?this.readWord():this.getTokenFromCode(code)},pp$9.fullCharCodeAtPos=function(){var code=this.input.charCodeAt(this.pos);return code<=55295||code>=57344?code:(code<<10)+this.input.charCodeAt(this.pos+1)-56613888},pp$9.skipBlockComment=function(){var match,startLoc=this.options.onComment&&this.curPosition(),start=this.pos,end=this.input.indexOf("*/",this.pos+=2);if(-1===end&&this.raise(this.pos-2,"Unterminated comment"),this.pos=end+2,this.options.locations)for(lineBreakG.lastIndex=start;(match=lineBreakG.exec(this.input))&&match.index8&&ch<14||ch>=5760&&nonASCIIwhitespace.test(String.fromCharCode(ch))))break loop;++this.pos}}},pp$9.finishToken=function(type,val){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var prevType=this.type;this.type=type,this.value=val,this.updateContext(prevType)},pp$9.readToken_dot=function(){var next=this.input.charCodeAt(this.pos+1);if(next>=48&&next<=57)return this.readNumber(!0);var next2=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===next&&46===next2?(this.pos+=3,this.finishToken(types.ellipsis)):(++this.pos,this.finishToken(types.dot))},pp$9.readToken_slash=function(){var next=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===next?this.finishOp(types.assign,2):this.finishOp(types.slash,1)},pp$9.readToken_mult_modulo_exp=function(code){var next=this.input.charCodeAt(this.pos+1),size=1,tokentype=42===code?types.star:types.modulo;return this.options.ecmaVersion>=7&&42===code&&42===next&&(++size,tokentype=types.starstar,next=this.input.charCodeAt(this.pos+2)),61===next?this.finishOp(types.assign,size+1):this.finishOp(tokentype,size)},pp$9.readToken_pipe_amp=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===code){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(types.assign,3);return this.finishOp(124===code?types.logicalOR:types.logicalAND,2)}return 61===next?this.finishOp(types.assign,2):this.finishOp(124===code?types.bitwiseOR:types.bitwiseAND,1)},pp$9.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(types.assign,2):this.finishOp(types.bitwiseXOR,1)},pp$9.readToken_plus_min=function(code){var next=this.input.charCodeAt(this.pos+1);return next===code?45!==next||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(types.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===next?this.finishOp(types.assign,2):this.finishOp(types.plusMin,1)},pp$9.readToken_lt_gt=function(code){var next=this.input.charCodeAt(this.pos+1),size=1;return next===code?(size=62===code&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+size)?this.finishOp(types.assign,size+1):this.finishOp(types.bitShift,size)):33!==next||60!==code||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===next&&(size=2),this.finishOp(types.relational,size)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},pp$9.readToken_eq_excl=function(code){var next=this.input.charCodeAt(this.pos+1);return 61===next?this.finishOp(types.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===code&&62===next&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(types.arrow)):this.finishOp(61===code?types.eq:types.prefix,1)},pp$9.readToken_question=function(){var ecmaVersion=this.options.ecmaVersion;if(ecmaVersion>=11){var next=this.input.charCodeAt(this.pos+1);if(46===next){var next2=this.input.charCodeAt(this.pos+2);if(next2<48||next2>57)return this.finishOp(types.questionDot,2)}if(63===next){if(ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(types.assign,3);return this.finishOp(types.coalesce,2)}}return this.finishOp(types.question,1)},pp$9.getTokenFromCode=function(code){switch(code){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(types.parenL);case 41:return++this.pos,this.finishToken(types.parenR);case 59:return++this.pos,this.finishToken(types.semi);case 44:return++this.pos,this.finishToken(types.comma);case 91:return++this.pos,this.finishToken(types.bracketL);case 93:return++this.pos,this.finishToken(types.bracketR);case 123:return++this.pos,this.finishToken(types.braceL);case 125:return++this.pos,this.finishToken(types.braceR);case 58:return++this.pos,this.finishToken(types.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(types.backQuote);case 48:var next=this.input.charCodeAt(this.pos+1);if(120===next||88===next)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===next||79===next)return this.readRadixNumber(8);if(98===next||66===next)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(code);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(code);case 124:case 38:return this.readToken_pipe_amp(code);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(code);case 60:case 62:return this.readToken_lt_gt(code);case 61:case 33:return this.readToken_eq_excl(code);case 63:return this.readToken_question();case 126:return this.finishOp(types.prefix,1)}this.raise(this.pos,"Unexpected character '"+codePointToString$1(code)+"'")},pp$9.finishOp=function(type,size){var str=this.input.slice(this.pos,this.pos+size);return this.pos+=size,this.finishToken(type,str)},pp$9.readRegexp=function(){for(var escaped,inClass,start=this.pos;;){this.pos>=this.input.length&&this.raise(start,"Unterminated regular expression");var ch=this.input.charAt(this.pos);if(lineBreak.test(ch)&&this.raise(start,"Unterminated regular expression"),escaped)escaped=!1;else{if("["===ch)inClass=!0;else if("]"===ch&&inClass)inClass=!1;else if("/"===ch&&!inClass)break;escaped="\\"===ch}++this.pos}var pattern=this.input.slice(start,this.pos);++this.pos;var flagsStart=this.pos,flags=this.readWord1();this.containsEsc&&this.unexpected(flagsStart);var state=this.regexpState||(this.regexpState=new RegExpValidationState(this));state.reset(start,pattern,flags),this.validateRegExpFlags(state),this.validateRegExpPattern(state);var value=null;try{value=new RegExp(pattern,flags)}catch(e){}return this.finishToken(types.regexp,{pattern:pattern,flags:flags,value:value})},pp$9.readInt=function(radix,len,maybeLegacyOctalNumericLiteral){for(var allowSeparators=this.options.ecmaVersion>=12&&void 0===len,isLegacyOctalNumericLiteral=maybeLegacyOctalNumericLiteral&&48===this.input.charCodeAt(this.pos),start=this.pos,total=0,lastCode=0,i=0,e=null==len?1/0:len;i=97?code-97+10:code>=65?code-65+10:code>=48&&code<=57?code-48:1/0)>=radix)break;lastCode=code,total=total*radix+val}}return allowSeparators&&95===lastCode&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===start||null!=len&&this.pos-start!==len?null:total},pp$9.readRadixNumber=function(radix){var start=this.pos;this.pos+=2;var val=this.readInt(radix);return null==val&&this.raise(this.start+2,"Expected number in radix "+radix),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(val=stringToBigInt(this.input.slice(start,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types.num,val)},pp$9.readNumber=function(startsWithDot){var start=this.pos;startsWithDot||null!==this.readInt(10,void 0,!0)||this.raise(start,"Invalid number");var octal=this.pos-start>=2&&48===this.input.charCodeAt(start);octal&&this.strict&&this.raise(start,"Invalid number");var next=this.input.charCodeAt(this.pos);if(!octal&&!startsWithDot&&this.options.ecmaVersion>=11&&110===next){var val$1=stringToBigInt(this.input.slice(start,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types.num,val$1)}octal&&/[89]/.test(this.input.slice(start,this.pos))&&(octal=!1),46!==next||octal||(++this.pos,this.readInt(10),next=this.input.charCodeAt(this.pos)),69!==next&&101!==next||octal||(43!==(next=this.input.charCodeAt(++this.pos))&&45!==next||++this.pos,null===this.readInt(10)&&this.raise(start,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var val=function stringToNumber(str,isLegacyOctalNumericLiteral){return isLegacyOctalNumericLiteral?parseInt(str,8):parseFloat(str.replace(/_/g,""))}(this.input.slice(start,this.pos),octal);return this.finishToken(types.num,val)},pp$9.readCodePoint=function(){var code;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var codePos=++this.pos;code=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,code>1114111&&this.invalidStringToken(codePos,"Code point out of bounds")}else code=this.readHexChar(4);return code},pp$9.readString=function(quote){for(var out="",chunkStart=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var ch=this.input.charCodeAt(this.pos);if(ch===quote)break;92===ch?(out+=this.input.slice(chunkStart,this.pos),out+=this.readEscapedChar(!1),chunkStart=this.pos):(isNewLine(ch,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return out+=this.input.slice(chunkStart,this.pos++),this.finishToken(types.string,out)};var INVALID_TEMPLATE_ESCAPE_ERROR={};pp$9.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(err){if(err!==INVALID_TEMPLATE_ESCAPE_ERROR)throw err;this.readInvalidTemplateToken()}this.inTemplateElement=!1},pp$9.invalidStringToken=function(position,message){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw INVALID_TEMPLATE_ESCAPE_ERROR;this.raise(position,message)},pp$9.readTmplToken=function(){for(var out="",chunkStart=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var ch=this.input.charCodeAt(this.pos);if(96===ch||36===ch&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==types.template&&this.type!==types.invalidTemplate?(out+=this.input.slice(chunkStart,this.pos),this.finishToken(types.template,out)):36===ch?(this.pos+=2,this.finishToken(types.dollarBraceL)):(++this.pos,this.finishToken(types.backQuote));if(92===ch)out+=this.input.slice(chunkStart,this.pos),out+=this.readEscapedChar(!0),chunkStart=this.pos;else if(isNewLine(ch)){switch(out+=this.input.slice(chunkStart,this.pos),++this.pos,ch){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:out+="\n";break;default:out+=String.fromCharCode(ch)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),chunkStart=this.pos}else++this.pos}},pp$9.readInvalidTemplateToken=function(){for(;this.pos=48&&ch<=55){var octalStr=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],octal=parseInt(octalStr,8);return octal>255&&(octalStr=octalStr.slice(0,-1),octal=parseInt(octalStr,8)),this.pos+=octalStr.length-1,ch=this.input.charCodeAt(this.pos),"0"===octalStr&&56!==ch&&57!==ch||!this.strict&&!inTemplate||this.invalidStringToken(this.pos-1-octalStr.length,inTemplate?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(octal)}return isNewLine(ch)?"":String.fromCharCode(ch)}},pp$9.readHexChar=function(len){var codePos=this.pos,n=this.readInt(16,len);return null===n&&this.invalidStringToken(codePos,"Bad character escape sequence"),n},pp$9.readWord1=function(){this.containsEsc=!1;for(var word="",first=!0,chunkStart=this.pos,astral=this.options.ecmaVersion>=6;this.pos1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];expectsError.apply(void 0,[throws,getActual(promiseFn)].concat(args))},assert.rejects=function rejects(promiseFn){for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return waitForActual(promiseFn).then((function(result){return expectsError.apply(void 0,[rejects,result].concat(args))}))},assert.doesNotThrow=function doesNotThrow(fn){for(var _len4=arguments.length,args=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++)args[_key4-1]=arguments[_key4];expectsNoError.apply(void 0,[doesNotThrow,getActual(fn)].concat(args))},assert.doesNotReject=function doesNotReject(fn){for(var _len5=arguments.length,args=new Array(_len5>1?_len5-1:0),_key5=1;_key5<_len5;_key5++)args[_key5-1]=arguments[_key5];return waitForActual(fn).then((function(result){return expectsNoError.apply(void 0,[doesNotReject,result].concat(args))}))},assert.ifError=function ifError(err){if(null!=err){var message="ifError got unwanted exception: ";"object"===_typeof(err)&&"string"==typeof err.message?0===err.message.length&&err.constructor?message+=err.constructor.name:message+=err.message:message+=inspect(err);var newErr=new AssertionError({actual:err,expected:null,operator:"ifError",message:message,stackStartFn:ifError}),origStack=err.stack;if("string"==typeof origStack){var tmp2=origStack.split("\n");tmp2.shift();for(var tmp1=newErr.stack.split("\n"),i=0;istr.length)&&(this_len=str.length),str.substring(this_len-search.length,this_len)===search}var blue="",green="",red="",white="",kReadableOperator={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function copyError(source){var keys=Object.keys(source),target=Object.create(Object.getPrototypeOf(source));return keys.forEach((function(key){target[key]=source[key]})),Object.defineProperty(target,"message",{value:source.message}),target}function inspectValue(val){return inspect(val,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function createErrDiff(actual,expected,operator){var other="",res="",lastPos=0,end="",skipped=!1,actualInspected=inspectValue(actual),actualLines=actualInspected.split("\n"),expectedLines=inspectValue(expected).split("\n"),i=0,indicator="";if("strictEqual"===operator&&"object"===_typeof(actual)&&"object"===_typeof(expected)&&null!==actual&&null!==expected&&(operator="strictEqualObject"),1===actualLines.length&&1===expectedLines.length&&actualLines[0]!==expectedLines[0]){var inputLength=actualLines[0].length+expectedLines[0].length;if(inputLength<=10){if(!("object"===_typeof(actual)&&null!==actual||"object"===_typeof(expected)&&null!==expected||0===actual&&0===expected))return"".concat(kReadableOperator[operator],"\n\n")+"".concat(actualLines[0]," !== ").concat(expectedLines[0],"\n")}else if("strictEqualObject"!==operator){if(inputLength<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;actualLines[0][i]===expectedLines[0][i];)i++;i>2&&(indicator="\n ".concat(function repeat(str,count){if(count=Math.floor(count),0==str.length||0==count)return"";var maxCount=str.length*count;for(count=Math.floor(Math.log(count)/Math.log(2));count;)str+=str,count--;return str+str.substring(0,maxCount-str.length)}(" ",i),"^"),i=0)}}}for(var a=actualLines[actualLines.length-1],b=expectedLines[expectedLines.length-1];a===b&&(i++<2?end="\n ".concat(a).concat(end):other=a,actualLines.pop(),expectedLines.pop(),0!==actualLines.length&&0!==expectedLines.length);)a=actualLines[actualLines.length-1],b=expectedLines[expectedLines.length-1];var maxLines=Math.max(actualLines.length,expectedLines.length);if(0===maxLines){var _actualLines=actualInspected.split("\n");if(_actualLines.length>30)for(_actualLines[26]="".concat(blue,"...").concat(white);_actualLines.length>27;)_actualLines.pop();return"".concat(kReadableOperator.notIdentical,"\n\n").concat(_actualLines.join("\n"),"\n")}i>3&&(end="\n".concat(blue,"...").concat(white).concat(end),skipped=!0),""!==other&&(end="\n ".concat(other).concat(end),other="");var printedLines=0,msg=kReadableOperator[operator]+"\n".concat(green,"+ actual").concat(white," ").concat(red,"- expected").concat(white),skippedMsg=" ".concat(blue,"...").concat(white," Lines skipped");for(i=0;i1&&i>2&&(cur>4?(res+="\n".concat(blue,"...").concat(white),skipped=!0):cur>3&&(res+="\n ".concat(expectedLines[i-2]),printedLines++),res+="\n ".concat(expectedLines[i-1]),printedLines++),lastPos=i,other+="\n".concat(red,"-").concat(white," ").concat(expectedLines[i]),printedLines++;else if(expectedLines.length1&&i>2&&(cur>4?(res+="\n".concat(blue,"...").concat(white),skipped=!0):cur>3&&(res+="\n ".concat(actualLines[i-2]),printedLines++),res+="\n ".concat(actualLines[i-1]),printedLines++),lastPos=i,res+="\n".concat(green,"+").concat(white," ").concat(actualLines[i]),printedLines++;else{var expectedLine=expectedLines[i],actualLine=actualLines[i],divergingLines=actualLine!==expectedLine&&(!endsWith(actualLine,",")||actualLine.slice(0,-1)!==expectedLine);divergingLines&&endsWith(expectedLine,",")&&expectedLine.slice(0,-1)===actualLine&&(divergingLines=!1,actualLine+=","),divergingLines?(cur>1&&i>2&&(cur>4?(res+="\n".concat(blue,"...").concat(white),skipped=!0):cur>3&&(res+="\n ".concat(actualLines[i-2]),printedLines++),res+="\n ".concat(actualLines[i-1]),printedLines++),lastPos=i,res+="\n".concat(green,"+").concat(white," ").concat(actualLine),other+="\n".concat(red,"-").concat(white," ").concat(expectedLine),printedLines+=2):(res+=other,other="",1!==cur&&0!==i||(res+="\n ".concat(actualLine),printedLines++))}if(printedLines>20&&i30)for(res[26]="".concat(blue,"...").concat(white);res.length>27;)res.pop();_this=1===res.length?_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,"".concat(base," ").concat(res[0]))):_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,"".concat(base,"\n\n").concat(res.join("\n"),"\n")))}else{var _res=inspectValue(actual),other="",knownOperators=kReadableOperator[operator];"notDeepEqual"===operator||"notEqual"===operator?(_res="".concat(kReadableOperator[operator],"\n\n").concat(_res)).length>1024&&(_res="".concat(_res.slice(0,1021),"...")):(other="".concat(inspectValue(expected)),_res.length>512&&(_res="".concat(_res.slice(0,509),"...")),other.length>512&&(other="".concat(other.slice(0,509),"...")),"deepEqual"===operator||"equal"===operator?_res="".concat(knownOperators,"\n\n").concat(_res,"\n\nshould equal\n\n"):other=" ".concat(operator," ").concat(other)),_this=_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,"".concat(_res).concat(other)))}return Error.stackTraceLimit=limit,_this.generatedMessage=!message,Object.defineProperty(_assertThisInitialized(_this),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),_this.code="ERR_ASSERTION",_this.actual=actual,_this.expected=expected,_this.operator=operator,Error.captureStackTrace&&Error.captureStackTrace(_assertThisInitialized(_this),stackStartFn),_this.stack,_this.name="AssertionError",_possibleConstructorReturn(_this)}return function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(AssertionError,_Error),function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(AssertionError,[{key:"toString",value:function toString(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:inspect.custom,value:function value(recurseTimes,ctx){return inspect(this,function _objectSpread(target){for(var i=1;i2?"one of ".concat(thing," ").concat(expected.slice(0,len-1).join(", "),", or ")+expected[len-1]:2===len?"one of ".concat(thing," ").concat(expected[0]," or ").concat(expected[1]):"of ".concat(thing," ").concat(expected[0])}return"of ".concat(thing," ").concat(String(expected))}createErrorType("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(name,expected,actual){var determiner,msg;if(void 0===assert&&(assert=__webpack_require__("./node_modules/assert/build/assert.js")),assert("string"==typeof name,"'name' must be a string"),"string"==typeof expected&&function startsWith(str,search,pos){return str.substr(!pos||pos<0?0:+pos,search.length)===search}(expected,"not ")?(determiner="must not be",expected=expected.replace(/^not /,"")):determiner="must be",function endsWith(str,search,this_len){return(void 0===this_len||this_len>str.length)&&(this_len=str.length),str.substring(this_len-search.length,this_len)===search}(name," argument"))msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,"type"));else{var type=function includes(str,search,start){return"number"!=typeof start&&(start=0),!(start+search.length>str.length)&&-1!==str.indexOf(search,start)}(name,".")?"property":"argument";msg='The "'.concat(name,'" ').concat(type," ").concat(determiner," ").concat(oneOf(expected,"type"))}return msg+=". Received type ".concat(_typeof(actual))}),TypeError),createErrorType("ERR_INVALID_ARG_VALUE",(function(name,value){var reason=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===util&&(util=__webpack_require__("./node_modules/util/util.js"));var inspected=util.inspect(value);return inspected.length>128&&(inspected="".concat(inspected.slice(0,128),"...")),"The argument '".concat(name,"' ").concat(reason,". Received ").concat(inspected)}),TypeError,RangeError),createErrorType("ERR_INVALID_RETURN_VALUE",(function(input,name,value){var type;return type=value&&value.constructor&&value.constructor.name?"instance of ".concat(value.constructor.name):"type ".concat(_typeof(value)),"Expected ".concat(input,' to be returned from the "').concat(name,'"')+" function but got ".concat(type,".")}),TypeError),createErrorType("ERR_MISSING_ARGS",(function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];void 0===assert&&(assert=__webpack_require__("./node_modules/assert/build/assert.js")),assert(args.length>0,"At least one arg needs to be specified");var msg="The ",len=args.length;switch(args=args.map((function(a){return'"'.concat(a,'"')})),len){case 1:msg+="".concat(args[0]," argument");break;case 2:msg+="".concat(args[0]," and ").concat(args[1]," arguments");break;default:msg+=args.slice(0,len-1).join(", "),msg+=", and ".concat(args[len-1]," arguments")}return"".concat(msg," must be specified")}),TypeError),module.exports.codes=codes},"./node_modules/assert/build/internal/util/comparisons.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}var regexFlagsSupported=void 0!==/a/g.flags,arrayFromSet=function arrayFromSet(set){var array=[];return set.forEach((function(value){return array.push(value)})),array},arrayFromMap=function arrayFromMap(map){var array=[];return map.forEach((function(value,key){return array.push([key,value])})),array},objectIs=Object.is?Object.is:__webpack_require__("./node_modules/object-is/index.js"),objectGetOwnPropertySymbols=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},numberIsNaN=Number.isNaN?Number.isNaN:__webpack_require__("./node_modules/is-nan/index.js");function uncurryThis(f){return f.call.bind(f)}var hasOwnProperty=uncurryThis(Object.prototype.hasOwnProperty),propertyIsEnumerable=uncurryThis(Object.prototype.propertyIsEnumerable),objectToString=uncurryThis(Object.prototype.toString),_require$types=__webpack_require__("./node_modules/util/util.js").types,isAnyArrayBuffer=_require$types.isAnyArrayBuffer,isArrayBufferView=_require$types.isArrayBufferView,isDate=_require$types.isDate,isMap=_require$types.isMap,isRegExp=_require$types.isRegExp,isSet=_require$types.isSet,isNativeError=_require$types.isNativeError,isBoxedPrimitive=_require$types.isBoxedPrimitive,isNumberObject=_require$types.isNumberObject,isStringObject=_require$types.isStringObject,isBooleanObject=_require$types.isBooleanObject,isBigIntObject=_require$types.isBigIntObject,isSymbolObject=_require$types.isSymbolObject,isFloat32Array=_require$types.isFloat32Array,isFloat64Array=_require$types.isFloat64Array;function isNonIndex(key){if(0===key.length||key.length>10)return!0;for(var i=0;i57)return!0}return 10===key.length&&key>=Math.pow(2,32)}function getOwnNonIndexProperties(value){return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)))}function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i-1?callBind(intrinsic):intrinsic}},"./node_modules/call-bind/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var bind=__webpack_require__("./node_modules/function-bind/index.js"),GetIntrinsic=__webpack_require__("./node_modules/get-intrinsic/index.js"),$apply=GetIntrinsic("%Function.prototype.apply%"),$call=GetIntrinsic("%Function.prototype.call%"),$reflectApply=GetIntrinsic("%Reflect.apply%",!0)||bind.call($call,$apply),$gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",!0),$defineProperty=GetIntrinsic("%Object.defineProperty%",!0),$max=GetIntrinsic("%Math.max%");if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=null}module.exports=function callBind(originalFunction){var func=$reflectApply(bind,$call,arguments);$gOPD&&$defineProperty&&($gOPD(func,"length").configurable&&$defineProperty(func,"length",{value:1+$max(0,originalFunction.length-(arguments.length-1))}));return func};var applyBind=function applyBind(){return $reflectApply(bind,$apply,arguments)};$defineProperty?$defineProperty(module.exports,"apply",{value:applyBind}):module.exports.apply=applyBind},"./node_modules/define-properties/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var keys=__webpack_require__("./node_modules/object-keys/index.js"),hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),toStr=Object.prototype.toString,concat=Array.prototype.concat,origDefineProperty=Object.defineProperty,hasPropertyDescriptors=__webpack_require__("./node_modules/has-property-descriptors/index.js")(),supportsDescriptors=origDefineProperty&&hasPropertyDescriptors,defineProperty=function(object,name,value,predicate){if(name in object)if(!0===predicate){if(object[name]===value)return}else if("function"!=typeof(fn=predicate)||"[object Function]"!==toStr.call(fn)||!predicate())return;var fn;supportsDescriptors?origDefineProperty(object,name,{configurable:!0,enumerable:!1,value:value,writable:!0}):object[name]=value},defineProperties=function(object,map){var predicates=arguments.length>2?arguments[2]:{},props=keys(map);hasSymbols&&(props=concat.call(props,Object.getOwnPropertySymbols(map)));for(var i=0;i=last)return null;if(91===source.charCodeAt(index)){if(!allowBrackets)return null;useBrackets=!0,name=advance()}if(name+=scanIdentifier(last),allowNestedParams)for(58!==source.charCodeAt(index)||"module"!==name&&"external"!==name&&"event"!==name||(name+=advance(),name+=scanIdentifier(last)),91===source.charCodeAt(index)&&93===source.charCodeAt(index+1)&&(name+=advance(),name+=advance());46===source.charCodeAt(index)||47===source.charCodeAt(index)||35===source.charCodeAt(index)||45===source.charCodeAt(index)||126===source.charCodeAt(index);)name+=advance(),name+=scanIdentifier(last);if(useBrackets){if(skipWhiteSpace(last),61===source.charCodeAt(index)){var ch;name+=advance(),skipWhiteSpace(last);for(var bracketDepth=1;index=last||93!==source.charCodeAt(index))return null;name+=advance()}return name}function convertIndex(rangeIndex){return source===originalSource?rangeIndex:function convertUnwrappedCommentIndex(originalSource,unwrappedIndex){for(var match,replacedSource=originalSource.replace(/^\/\*\*?/,""),numSkippedChars=0,matcher=new RegExp(STAR_MATCHER,"g");match=matcher.exec(replacedSource);)if(numSkippedChars+=match[1].length,match.index+match[0].length>unwrappedIndex+numSkippedChars)return unwrappedIndex+numSkippedChars+originalSource.length-replacedSource.length;return originalSource.replace(/\*\/$/,"").replace(/\s*$/,"").length}(originalSource,rangeIndex)}function TagParser(options,title){this._options=options,this._title=title.toLowerCase(),this._tag={title:title,description:null},this._options.lineNumbers&&(this._tag.lineNumber=lineNumber),this._first=index-title.length-1,this._last=0,this._extra={}}function parseTag(options){var parser,tag;if(!function skipToTag(){for(;index=length||(utility.assert(64===source.charCodeAt(index)),0))}())return null;for(tag=(parser=new TagParser(options,function scanTitle(){var ch,title="";for(advance();index=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57);)title+=advance();return title}())).parse();index1&&(this._tag.default=assign.slice(1).join("=")),this._tag.name=assign[0],this._tag.type&&"OptionalType"!==this._tag.type.type&&(this._tag.type={type:"OptionalType",expression:this._tag.type}));else{if(!isNameParameterRequired(this._title))return!0;if(isParamTitle(this._title)&&this._tag.type&&this._tag.type.name)this._extra.name=this._tag.type,this._tag.name=this._tag.type.name,this._tag.type=null;else if(!this.addError("Missing or invalid tag name"))return!1}return!0},TagParser.prototype.parseDescription=function parseDescription(){var description=sliceSource(source,index,this._last).trim();return description&&(/^-\s+/.test(description)&&(description=description.substring(2)),this._tag.description=description),!0},TagParser.prototype.parseCaption=function parseDescription(){var description=sliceSource(source,index,this._last).trim(),captionStart=description.indexOf(""),captionEnd=description.indexOf("");return captionStart>=0&&captionEnd>=0?(this._tag.caption=description.substring(captionStart+9,captionEnd).trim(),this._tag.description=description.substring(captionEnd+10).trim()):this._tag.description=description,!0},TagParser.prototype.parseKind=function parseKind(){var kind,kinds;return kinds={class:!0,constant:!0,event:!0,external:!0,file:!0,function:!0,member:!0,mixin:!0,module:!0,namespace:!0,typedef:!0},kind=sliceSource(source,index,this._last).trim(),this._tag.kind=kind,!(!hasOwnProperty(kinds,kind)&&!this.addError("Invalid kind name '%0'",kind))},TagParser.prototype.parseAccess=function parseAccess(){var access;return access=sliceSource(source,index,this._last).trim(),this._tag.access=access,!("private"!==access&&"protected"!==access&&"public"!==access&&!this.addError("Invalid access name '%0'",access))},TagParser.prototype.parseThis=function parseThis(){var value=sliceSource(source,index,this._last).trim();return value&&"{"===value.charAt(0)?this.parseType()&&"NameExpression"===this._tag.type.type||"UnionType"===this._tag.type.type?(this._tag.name=this._tag.type.name,!0):this.addError("Invalid name for this"):this.parseNamePath()},TagParser.prototype.parseVariation=function parseVariation(){var variation,text;return text=sliceSource(source,index,this._last).trim(),variation=parseFloat(text,10),this._tag.variation=variation,!(isNaN(variation)&&!this.addError("Invalid variation '%0'",text))},TagParser.prototype.ensureEnd=function(){var shouldBeEmpty=sliceSource(source,index,this._last).trim();return!(shouldBeEmpty&&!this.addError("Unknown content '%0'",shouldBeEmpty))},TagParser.prototype.epilogue=function epilogue(){var description;return description=this._tag.description,!(isAllowedOptional(this._title)&&!this._tag.type&&description&&"["===description.charAt(0)&&(this._tag.type=this._extra.name,this._tag.name||(this._tag.name=void 0),!sloppy&&!this.addError("Missing or invalid tag name")))},Rules={access:["parseAccess"],alias:["parseNamePath","ensureEnd"],augments:["parseType","parseNamePathOptional","ensureEnd"],constructor:["parseType","parseNamePathOptional","ensureEnd"],class:["parseType","parseNamePathOptional","ensureEnd"],extends:["parseType","parseNamePathOptional","ensureEnd"],example:["parseCaption"],deprecated:["parseDescription"],global:["ensureEnd"],inner:["ensureEnd"],instance:["ensureEnd"],kind:["parseKind"],mixes:["parseNamePath","ensureEnd"],mixin:["parseNamePathOptional","ensureEnd"],member:["parseType","parseNamePathOptional","ensureEnd"],method:["parseNamePathOptional","ensureEnd"],module:["parseType","parseNamePathOptional","ensureEnd"],func:["parseNamePathOptional","ensureEnd"],function:["parseNamePathOptional","ensureEnd"],var:["parseType","parseNamePathOptional","ensureEnd"],name:["parseNamePath","ensureEnd"],namespace:["parseType","parseNamePathOptional","ensureEnd"],private:["parseType","parseDescription"],protected:["parseType","parseDescription"],public:["parseType","parseDescription"],readonly:["ensureEnd"],requires:["parseNamePath","ensureEnd"],since:["parseDescription"],static:["ensureEnd"],summary:["parseDescription"],this:["parseThis","ensureEnd"],todo:["parseDescription"],typedef:["parseType","parseNamePathOptional"],variation:["parseVariation"],version:["parseDescription"]},TagParser.prototype.parse=function parse(){var i,iz,sequences;if(!this._title&&!this.addError("Missing or invalid title"))return null;for(this._last=function seekContent(){var ch,waiting,last=index;for(waiting=!1;last<(){}[],:*|?!=".indexOf(String.fromCharCode(ch))&&!esutils.code.isWhiteSpace(ch)&&!esutils.code.isLineTerminator(ch)}function Context(previous,index,token,value){this._previous=previous,this._index=index,this._token=token,this._value=value}function maybeAddRange(node,range){return addRange&&(node.range=[range[0]+rangeOffset,range[1]+rangeOffset]),node}function advance(){var ch=source.charAt(index);return index+=1,ch}function scanHexEscape(prefix){var i,len,ch,code=0;for(len="u"===prefix?4:2,i=0;i=length)return token=Token.EOF;switch(ch=source.charCodeAt(index)){case 39:case 34:return token=function scanString(){var quote,ch,code,unescaped,restore,str="";for(quote=source.charAt(index),++index;index=0&&index=length)return Token.ILLEGAL;if(60===source.charCodeAt(index+1))break}value+=advance()}return Token.NAME}())}}function consume(target,text){utility.assert(token===target,text||"consumed token not matched"),next()}function expect(target,message){token!==target&&utility.throwError(message||"unexpected token"),next()}function parseFieldType(){var key,rangeStart=previous;return key=function parseFieldName(){var v=value;return token===Token.NAME||token===Token.STRING?(next(),v):token===Token.NUMBER?(consume(Token.NUMBER),String(v)):void utility.throwError("unexpected token")}(),token===Token.COLON?(consume(Token.COLON),maybeAddRange({type:Syntax.FieldType,key:key,value:parseTypeExpression()},[rangeStart,previous])):maybeAddRange({type:Syntax.FieldType,key:key,value:null},[rangeStart,previous])}function parseTypeName(){var expr,applications,startIndex=index-value.length;return expr=function parseNameExpression(){var name=value,rangeStart=index-name.length;return expect(Token.NAME),token!==Token.COLON||"module"!==name&&"external"!==name&&"event"!==name||(consume(Token.COLON),name+=":"+value,expect(Token.NAME)),maybeAddRange({type:Syntax.NameExpression,name:name},[rangeStart,previous])}(),token===Token.DOT_LT||token===Token.LT?(next(),applications=function parseTypeExpressionList(){var elements=[];for(elements.push(parseTop());token===Token.COMMA;)consume(Token.COMMA),elements.push(parseTop());return elements}(),expect(Token.GT),maybeAddRange({type:Syntax.TypeApplication,expression:expr,applications:applications},[startIndex,previous])):expr}function parseParametersType(){for(var expr,startIndex,nameStartIndex,params=[],optionalSequence=!1,rest=!1,restStartIndex=index-3;token!==Token.RPAREN;)token===Token.REST&&(consume(Token.REST),rest=!0),startIndex=previous,(expr=parseTypeExpression()).type===Syntax.NameExpression&&token===Token.COLON&&(nameStartIndex=previous-expr.name.length,consume(Token.COLON),expr=maybeAddRange({type:Syntax.ParameterType,name:expr.name,expression:parseTypeExpression()},[nameStartIndex,previous])),token===Token.EQUAL?(consume(Token.EQUAL),expr=maybeAddRange({type:Syntax.OptionalType,expression:expr},[startIndex,previous]),optionalSequence=!0):optionalSequence&&utility.throwError("unexpected token"),rest&&(expr=maybeAddRange({type:Syntax.RestType,expression:expr},[restStartIndex,previous])),params.push(expr),token!==Token.RPAREN&&expect(Token.COMMA);return params}function parseFunctionType(){var isNew,thisBinding,params,result,fnType,startIndex=index-value.length;return utility.assert(token===Token.NAME&&"function"===value,"FunctionType should start with 'function'"),consume(Token.NAME),expect(Token.LPAREN),isNew=!1,params=[],thisBinding=null,token!==Token.RPAREN&&(token!==Token.NAME||"this"!==value&&"new"!==value?params=parseParametersType():(isNew="new"===value,consume(Token.NAME),expect(Token.COLON),thisBinding=parseTypeName(),token===Token.COMMA&&(consume(Token.COMMA),params=parseParametersType()))),expect(Token.RPAREN),result=null,token===Token.COLON&&(result=function parseResultType(){return consume(Token.COLON,"ResultType should start with :"),token===Token.NAME&&"void"===value?(consume(Token.NAME),{type:Syntax.VoidLiteral}):parseTypeExpression()}()),fnType=maybeAddRange({type:Syntax.FunctionType,params:params,result:result},[startIndex,previous]),thisBinding&&(fnType.this=thisBinding,isNew&&(fnType.new=!0)),fnType}function parseBasicTypeExpression(){var context,startIndex;switch(token){case Token.STAR:return consume(Token.STAR),maybeAddRange({type:Syntax.AllLiteral},[previous-1,previous]);case Token.LPAREN:return function parseUnionType(){var elements,startIndex=index-1;if(consume(Token.LPAREN,"UnionType should start with ("),elements=[],token!==Token.RPAREN)for(;elements.push(parseTypeExpression()),token!==Token.RPAREN;)expect(Token.PIPE);return consume(Token.RPAREN,"UnionType should end with )"),maybeAddRange({type:Syntax.UnionType,elements:elements},[startIndex,previous])}();case Token.LBRACK:return function parseArrayType(){var elements,restStartIndex,startIndex=index-1;for(consume(Token.LBRACK,"ArrayType should start with ["),elements=[];token!==Token.RBRACK;){if(token===Token.REST){restStartIndex=index-3,consume(Token.REST),elements.push(maybeAddRange({type:Syntax.RestType,expression:parseTypeExpression()},[restStartIndex,previous]));break}elements.push(parseTypeExpression()),token!==Token.RBRACK&&expect(Token.COMMA)}return expect(Token.RBRACK),maybeAddRange({type:Syntax.ArrayType,elements:elements},[startIndex,previous])}();case Token.LBRACE:return function parseRecordType(){var fields,rangeEnd,rangeStart=index-1;if(consume(Token.LBRACE,"RecordType should start with {"),fields=[],token===Token.COMMA)consume(Token.COMMA);else for(;token!==Token.RBRACE;)fields.push(parseFieldType()),token!==Token.RBRACE&&expect(Token.COMMA);return rangeEnd=index,expect(Token.RBRACE),maybeAddRange({type:Syntax.RecordType,fields:fields},[rangeStart,rangeEnd])}();case Token.NAME:if(startIndex=index-value.length,"null"===value)return consume(Token.NAME),maybeAddRange({type:Syntax.NullLiteral},[startIndex,previous]);if("undefined"===value)return consume(Token.NAME),maybeAddRange({type:Syntax.UndefinedLiteral},[startIndex,previous]);if("true"===value||"false"===value)return consume(Token.NAME),maybeAddRange({type:Syntax.BooleanLiteralType,value:"true"===value},[startIndex,previous]);if(context=Context.save(),"function"===value)try{return parseFunctionType()}catch(e){context.restore()}return parseTypeName();case Token.STRING:return next(),maybeAddRange({type:Syntax.StringLiteralType,value:value},[previous-value.length-2,previous]);case Token.NUMBER:return next(),maybeAddRange({type:Syntax.NumericLiteralType,value:value},[previous-String(value).length,previous]);default:utility.throwError("unexpected token")}}function parseTypeExpression(){var expr,rangeStart;return token===Token.QUESTION?(rangeStart=index-1,consume(Token.QUESTION),token===Token.COMMA||token===Token.EQUAL||token===Token.RBRACE||token===Token.RPAREN||token===Token.PIPE||token===Token.EOF||token===Token.RBRACK||token===Token.GT?maybeAddRange({type:Syntax.NullableLiteral},[rangeStart,previous]):maybeAddRange({type:Syntax.NullableType,expression:parseBasicTypeExpression(),prefix:!0},[rangeStart,previous])):token===Token.BANG?(rangeStart=index-1,consume(Token.BANG),maybeAddRange({type:Syntax.NonNullableType,expression:parseBasicTypeExpression(),prefix:!0},[rangeStart,previous])):(rangeStart=previous,expr=parseBasicTypeExpression(),token===Token.BANG?(consume(Token.BANG),maybeAddRange({type:Syntax.NonNullableType,expression:expr,prefix:!1},[rangeStart,previous])):token===Token.QUESTION?(consume(Token.QUESTION),maybeAddRange({type:Syntax.NullableType,expression:expr,prefix:!1},[rangeStart,previous])):token===Token.LBRACK?(consume(Token.LBRACK),expect(Token.RBRACK,"expected an array-style type declaration ("+value+"[])"),maybeAddRange({type:Syntax.TypeApplication,expression:maybeAddRange({type:Syntax.NameExpression,name:"Array"},[rangeStart,previous]),applications:[expr]},[rangeStart,previous])):expr)}function parseTop(){var expr,elements;if(expr=parseTypeExpression(),token!==Token.PIPE)return expr;for(elements=[expr],consume(Token.PIPE);elements.push(parseTypeExpression()),token===Token.PIPE;)consume(Token.PIPE);return maybeAddRange({type:Syntax.UnionType,elements:elements},[0,index])}function stringifyImpl(node,compact,topLevel){var result,i,iz;switch(node.type){case Syntax.NullableLiteral:result="?";break;case Syntax.AllLiteral:result="*";break;case Syntax.NullLiteral:result="null";break;case Syntax.UndefinedLiteral:result="undefined";break;case Syntax.VoidLiteral:result="void";break;case Syntax.UnionType:for(result=topLevel?"":"(",i=0,iz=node.elements.length;i":Precedence.Relational,"<=":Precedence.Relational,">=":Precedence.Relational,in:Precedence.Relational,instanceof:Precedence.Relational,"<<":Precedence.BitwiseSHIFT,">>":Precedence.BitwiseSHIFT,">>>":Precedence.BitwiseSHIFT,"+":Precedence.Additive,"-":Precedence.Additive,"*":Precedence.Multiplicative,"%":Precedence.Multiplicative,"/":Precedence.Multiplicative,"**":Precedence.Exponentiation};var E_TTT=7,S_TFFF=1;function stringRepeat(str,num){var result="";for(num|=0;num>0;num>>>=1,str+=str)1&num&&(result+=str);return result}function endsWithLineTerminator(str){var len=str.length;return len&&esutils.code.isLineTerminator(str.charCodeAt(len-1))}function merge(target,override){var key;for(key in override)override.hasOwnProperty(key)&&(target[key]=override[key]);return target}function updateDeeply(target,override){var key,val;function isHashObject(target){return"object"==typeof target&&target instanceof Object&&!(target instanceof RegExp)}for(key in override)override.hasOwnProperty(key)&&(isHashObject(val=override[key])?isHashObject(target[key])?updateDeeply(target[key],val):target[key]=updateDeeply({},val):target[key]=val);return target}function escapeRegExpCharacter(ch,previousIsBackslash){return 8232==(-2&ch)?(previousIsBackslash?"u":"\\u")+(8232===ch?"2028":"2029"):10===ch||13===ch?(previousIsBackslash?"":"\\")+(10===ch?"n":"r"):String.fromCharCode(ch)}function escapeAllowedCharacter(code,next){var hex;return 8===code?"\\b":12===code?"\\f":9===code?"\\t":(hex=code.toString(16).toUpperCase(),json||code>255?"\\u"+"0000".slice(hex.length)+hex:0!==code||esutils.code.isDecimalDigit(next)?11===code?"\\x0B":"\\x"+"00".slice(hex.length)+hex:"\\0")}function escapeDisallowedCharacter(code){if(92===code)return"\\\\";if(10===code)return"\\n";if(13===code)return"\\r";if(8232===code)return"\\u2028";if(8233===code)return"\\u2029";throw new Error("Incorrectly classified character")}function flattenToString(arr){var i,iz,elem,result="";for(i=0,iz=arr.length;ij&&(spaces=j)}for(void 0!==specialBase?(previousBase=base,"*"===array[1][spaces]&&(specialBase+=" "),base=specialBase):(1&spaces&&--spaces,previousBase=base),i=1,len=array.length;i0){if(save=result,preserveBlankLines){for(result=[],extRange=(comment=stmt.leadingComments[0]).extendedRange,range=comment.range,(count=((prefix=sourceCode.substring(extRange[0],range[0])).match(/\n/g)||[]).length)>0?(result.push(stringRepeat("\n",count)),result.push(addIndent(generateComment(comment)))):(result.push(prefix),result.push(generateComment(comment))),prevRange=range,i=1,len=stmt.leadingComments.length;i0?(result.push(stringRepeat("\n",count)),result.push(addIndent(generateComment(comment)))):(result.push(prefix),result.push(generateComment(comment)));else for(tailingToStatement=!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()),specialBase=stringRepeat(" ",function calculateSpaces(str){var i;for(i=str.length-1;i>=0&&!esutils.code.isLineTerminator(str.charCodeAt(i));--i);return str.length-1-i}(toSourceNodeWhenNeeded([base,result,indent]).toString())),i=0,len=stmt.trailingComments.length;i")),node.expression?(result.push(space),"{"===(expr=this.generateExpression(node.body,Precedence.Assignment,E_TTT)).toString().charAt(0)&&(expr=["(",expr,")"]),result.push(expr)):result.push(this.maybeBlock(node.body,9)),result},CodeGenerator.prototype.generateIterationForStatement=function(operator,stmt,flags){var result=["for"+(stmt.await?noEmptySpace()+"await":"")+space+"("],that=this;return withIndent((function(){stmt.left.type===Syntax.VariableDeclaration?withIndent((function(){result.push(stmt.left.kind+noEmptySpace()),result.push(that.generateStatement(stmt.left.declarations[0],0))})):result.push(that.generateExpression(stmt.left,Precedence.Call,E_TTT)),result=join(result,operator),result=[join(result,that.generateExpression(stmt.right,Precedence.Assignment,E_TTT)),")"]})),result.push(this.maybeBlock(stmt.body,flags)),result},CodeGenerator.prototype.generatePropertyKey=function(expr,computed){var result=[];return computed&&result.push("["),result.push(this.generateExpression(expr,Precedence.Assignment,E_TTT)),computed&&result.push("]"),result},CodeGenerator.prototype.generateAssignment=function(left,right,operator,precedence,flags){return Precedence.Assignment2&&("\n"===(content=sourceCode.substring(range[0]+1,range[1]-1))[0]&&(result=["{"]),result.push(content)),bodyFlags=S_TFFF,8&flags&&(bodyFlags|=16),i=0,iz=stmt.body.length;i0&&(stmt.body[i-1].trailingComments||stmt.body[i].leadingComments||generateBlankLines(stmt.body[i-1].range[1],stmt.body[i].range[0],result))),i===iz-1&&(bodyFlags|=32),fragment=stmt.body[i].leadingComments&&preserveBlankLines?that.generateStatement(stmt.body[i],bodyFlags):addIndent(that.generateStatement(stmt.body[i],bodyFlags)),result.push(fragment),endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())||preserveBlankLines&&i1?withIndent(block):block(),result.push(this.semicolon(flags)),result},ThrowStatement:function(stmt,flags){return[join("throw",this.generateExpression(stmt.argument,Precedence.Sequence,E_TTT)),this.semicolon(flags)]},TryStatement:function(stmt,flags){var result,i,iz,guardedHandlers;if(result=["try",this.maybeBlock(stmt.block,S_TFFF)],result=this.maybeBlockSuffix(stmt.block,result),stmt.handlers)for(i=0,iz=stmt.handlers.length;i0?"\n":""],bodyFlags=17,i=0;i0&&(stmt.body[i-1].trailingComments||stmt.body[i].leadingComments||generateBlankLines(stmt.body[i-1].range[1],stmt.body[i].range[0],result))),fragment=addIndent(this.generateStatement(stmt.body[i],bodyFlags)),result.push(fragment),i+10){for(result.push("("),i=0,iz=length;i=2&&48===fragment.charCodeAt(0))&&result.push(" "),result.push(expr.optional?"?.":"."),result.push(generateIdentifier(expr.property))),parenthesize(result,Precedence.Member,precedence)},MetaProperty:function(expr,precedence,flags){var result;return(result=[]).push("string"==typeof expr.meta?expr.meta:generateIdentifier(expr.meta)),result.push("."),result.push("string"==typeof expr.property?expr.property:generateIdentifier(expr.property)),parenthesize(result,Precedence.Member,precedence)},UnaryExpression:function(expr,precedence,flags){var result,fragment,rightCharCode,leftSource,leftCharCode;return fragment=this.generateExpression(expr.argument,Precedence.Unary,E_TTT),""===space?result=join(expr.operator,fragment):(result=[expr.operator],expr.operator.length>2?result=join(result,fragment):(leftCharCode=(leftSource=toSourceNodeWhenNeeded(result).toString()).charCodeAt(leftSource.length-1),rightCharCode=fragment.toString().charCodeAt(0),(43===leftCharCode||45===leftCharCode)&&leftCharCode===rightCharCode||esutils.code.isIdentifierPartES5(leftCharCode)&&esutils.code.isIdentifierPartES5(rightCharCode)?(result.push(noEmptySpace()),result.push(fragment)):result.push(fragment))),parenthesize(result,Precedence.Unary,precedence)},YieldExpression:function(expr,precedence,flags){var result;return result=expr.delegate?"yield*":"yield",expr.argument&&(result=join(result,this.generateExpression(expr.argument,Precedence.Yield,E_TTT))),parenthesize(result,Precedence.Yield,precedence)},AwaitExpression:function(expr,precedence,flags){return parenthesize(join(expr.all?"await*":"await",this.generateExpression(expr.argument,Precedence.Await,E_TTT)),Precedence.Await,precedence)},UpdateExpression:function(expr,precedence,flags){return expr.prefix?parenthesize([expr.operator,this.generateExpression(expr.argument,Precedence.Unary,E_TTT)],Precedence.Unary,precedence):parenthesize([this.generateExpression(expr.argument,Precedence.Postfix,E_TTT),expr.operator],Precedence.Postfix,precedence)},FunctionExpression:function(expr,precedence,flags){var result=[generateAsyncPrefix(expr,!0),"function"];return expr.id?(result.push(generateStarSuffix(expr)||noEmptySpace()),result.push(generateIdentifier(expr.id))):result.push(generateStarSuffix(expr)||space),result.push(this.generateFunctionBody(expr)),result},ArrayPattern:function(expr,precedence,flags){return this.ArrayExpression(expr,precedence,flags,!0)},ArrayExpression:function(expr,precedence,flags,isPattern){var result,multiline,that=this;return expr.elements.length?(multiline=!isPattern&&expr.elements.length>1,result=["[",multiline?newline:""],withIndent((function(indent){var i,iz;for(i=0,iz=expr.elements.length;i1,withIndent((function(){fragment=that.generateExpression(expr.properties[0],Precedence.Sequence,E_TTT)})),multiline||function hasLineTerminator(str){return/[\r\n]/g.test(str)}(toSourceNodeWhenNeeded(fragment).toString())?(withIndent((function(indent){var i,iz;if(result=["{",newline,indent,fragment],multiline)for(result.push(","+newline),i=1,iz=expr.properties.length;i126))){result+=escapeAllowedCharacter(code,str.charCodeAt(i+1));continue}}result+=String.fromCharCode(code)}if(quote=(single=!("double"===quotes||"auto"===quotes&&doubleQuotes0&&(exponent=+temp.slice(pos+1),temp=temp.slice(0,pos)),point>=0&&(exponent-=temp.length-point-1,temp=+(temp.slice(0,point)+temp.slice(point+1))+""),pos=0;48===temp.charCodeAt(temp.length+pos-1);)--pos;return 0!==pos&&(exponent-=pos,temp=temp.slice(0,pos)),0!==exponent&&(temp+="e"+exponent),(temp.length1e12&&Math.floor(value)===value&&(temp="0x"+value.toString(16)).length0||extra.moz.comprehensionExpressionStartsWithAssignment?result=join(result,fragment):result.push(fragment)})),expr.filter&&(result=join(result,"if"+space),fragment=this.generateExpression(expr.filter,Precedence.Sequence,E_TTT),result=join(result,["(",fragment,")"])),extra.moz.comprehensionExpressionStartsWithAssignment||(fragment=this.generateExpression(expr.body,Precedence.Assignment,E_TTT),result=join(result,fragment)),result.push(expr.type===Syntax.GeneratorExpression?")":"]"),result},ComprehensionBlock:function(expr,precedence,flags){var fragment;return fragment=join(fragment=expr.left.type===Syntax.VariableDeclaration?[expr.left.kind,noEmptySpace(),this.generateStatement(expr.left.declarations[0],0)]:this.generateExpression(expr.left,Precedence.Call,E_TTT),expr.of?"of":"in"),fragment=join(fragment,this.generateExpression(expr.right,Precedence.Sequence,E_TTT)),["for"+space+"(",fragment,")"]},SpreadElement:function(expr,precedence,flags){return["...",this.generateExpression(expr.argument,Precedence.Assignment,E_TTT)]},TaggedTemplateExpression:function(expr,precedence,flags){var itemFlags=3;return 2&flags||(itemFlags=1),parenthesize([this.generateExpression(expr.tag,Precedence.Call,itemFlags),this.generateExpression(expr.quasi,Precedence.Primary,4)],Precedence.TaggedTemplate,precedence)},TemplateElement:function(expr,precedence,flags){return expr.value.raw},TemplateLiteral:function(expr,precedence,flags){var result,i,iz;for(result=["`"],i=0,iz=expr.quasis.length;i=0)return idx}else{var sStr=util.toSetString(aStr);if(has.call(this._set,sStr))return this._set[sStr]}throw new Error('"'+aStr+'" is not in the set.')},ArraySet.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx>>=5)>0&&(digit|=32),encoded+=base64.encode(digit)}while(vlq>0);return encoded},exports.decode=function base64VLQ_decode(aStr,aIndex,aOutParam){var continuation,digit,strLen=aStr.length,result=0,shift=0;do{if(aIndex>=strLen)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(digit=base64.decode(aStr.charCodeAt(aIndex++))))throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1));continuation=!!(32&digit),result+=(digit&=31)<>1;return 1==(1&aValue)?-shifted:shifted}(result),aOutParam.rest=aIndex}},"./node_modules/escodegen/node_modules/source-map/lib/base64.js":function(__unused_webpack_module,exports){var intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");exports.encode=function(number){if(0<=number&&number0?aHigh-mid>1?recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare,aBias):aBias==exports.LEAST_UPPER_BOUND?aHigh1?recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare,aBias):aBias==exports.LEAST_UPPER_BOUND?mid:aLow<0?-1:aLow}exports.GREATEST_LOWER_BOUND=1,exports.LEAST_UPPER_BOUND=2,exports.search=function search(aNeedle,aHaystack,aCompare,aBias){if(0===aHaystack.length)return-1;var index=recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare,aBias||exports.GREATEST_LOWER_BOUND);if(index<0)return-1;for(;index-1>=0&&0===aCompare(aHaystack[index],aHaystack[index-1],!0);)--index;return index}},"./node_modules/escodegen/node_modules/source-map/lib/mapping-list.js":function(__unused_webpack_module,exports,__webpack_require__){var util=__webpack_require__("./node_modules/escodegen/node_modules/source-map/lib/util.js");function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(aCallback,aThisArg){this._array.forEach(aCallback,aThisArg)},MappingList.prototype.add=function MappingList_add(aMapping){!function generatedPositionAfter(mappingA,mappingB){var lineA=mappingA.generatedLine,lineB=mappingB.generatedLine,columnA=mappingA.generatedColumn,columnB=mappingB.generatedColumn;return lineB>lineA||lineB==lineA&&columnB>=columnA||util.compareByGeneratedPositionsInflated(mappingA,mappingB)<=0}(this._last,aMapping)?(this._sorted=!1,this._array.push(aMapping)):(this._last=aMapping,this._array.push(aMapping))},MappingList.prototype.toArray=function MappingList_toArray(){return this._sorted||(this._array.sort(util.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},exports.H=MappingList},"./node_modules/escodegen/node_modules/source-map/lib/quick-sort.js":function(__unused_webpack_module,exports){function swap(ary,x,y){var temp=ary[x];ary[x]=ary[y],ary[y]=temp}function doQuickSort(ary,comparator,p,r){if(p=0){var mapping=this._originalMappings[index];if(void 0===aArgs.column)for(var originalLine=mapping.originalLine;mapping&&mapping.originalLine===originalLine;)mappings.push({line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)}),mapping=this._originalMappings[++index];else for(var originalColumn=mapping.originalColumn;mapping&&mapping.originalLine===line&&mapping.originalColumn==originalColumn;)mappings.push({line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)}),mapping=this._originalMappings[++index]}return mappings},BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.prototype._findSourceIndex=function(aSource){var i,relativeSource=aSource;if(null!=this.sourceRoot&&(relativeSource=util.relative(this.sourceRoot,relativeSource)),this._sources.has(relativeSource))return this._sources.indexOf(relativeSource);for(i=0;i1&&(mapping.source=previousSource+segment[1],previousSource+=segment[1],mapping.originalLine=previousOriginalLine+segment[2],previousOriginalLine=mapping.originalLine,mapping.originalLine+=1,mapping.originalColumn=previousOriginalColumn+segment[3],previousOriginalColumn=mapping.originalColumn,segment.length>4&&(mapping.name=previousName+segment[4],previousName+=segment[4])),generatedMappings.push(mapping),"number"==typeof mapping.originalLine&&originalMappings.push(mapping)}quickSort(generatedMappings,util.compareByGeneratedPositionsDeflated),this.__generatedMappings=generatedMappings,quickSort(originalMappings,util.compareByOriginalPositions),this.__originalMappings=originalMappings},BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName,aColumnName,aComparator,aBias){if(aNeedle[aLineName]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+aNeedle[aLineName]);if(aNeedle[aColumnName]<0)throw new TypeError("Column must be greater than or equal to 0, got "+aNeedle[aColumnName]);return binarySearch.search(aNeedle,aMappings,aComparator,aBias)},BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var index=0;index=0){var mapping=this._generatedMappings[index];if(mapping.generatedLine===needle.generatedLine){var source=util.getArg(mapping,"source",null);null!==source&&(source=this._sources.at(source),source=util.computeSourceURL(this.sourceRoot,source,this._sourceMapURL));var name=util.getArg(mapping,"name",null);return null!==name&&(name=this._names.at(name)),{source:source,line:util.getArg(mapping,"originalLine",null),column:util.getArg(mapping,"originalColumn",null),name:name}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(sc){return null==sc})))},BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(aSource,nullOnMissing){if(!this.sourcesContent)return null;var index=this._findSourceIndex(aSource);if(index>=0)return this.sourcesContent[index];var url,relativeSource=aSource;if(null!=this.sourceRoot&&(relativeSource=util.relative(this.sourceRoot,relativeSource)),null!=this.sourceRoot&&(url=util.urlParse(this.sourceRoot))){var fileUriAbsPath=relativeSource.replace(/^file:\/\//,"");if("file"==url.scheme&&this._sources.has(fileUriAbsPath))return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];if((!url.path||"/"==url.path)&&this._sources.has("/"+relativeSource))return this.sourcesContent[this._sources.indexOf("/"+relativeSource)]}if(nullOnMissing)return null;throw new Error('"'+relativeSource+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(aArgs){var source=util.getArg(aArgs,"source");if((source=this._findSourceIndex(source))<0)return{line:null,column:null,lastColumn:null};var needle={source:source,originalLine:util.getArg(aArgs,"line"),originalColumn:util.getArg(aArgs,"column")},index=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions,util.getArg(aArgs,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(index>=0){var mapping=this._originalMappings[index];if(mapping.source===needle.source)return{line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},IndexedSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),IndexedSourceMapConsumer.prototype.constructor=SourceMapConsumer,IndexedSourceMapConsumer.prototype._version=3,Object.defineProperty(IndexedSourceMapConsumer.prototype,"sources",{get:function(){for(var sources=[],i=0;i0&&aGenerated.column>=0)||aOriginal||aSource||aName)&&!(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource))throw new Error("Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}))},SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){for(var next,mapping,nameIdx,sourceIdx,previousGeneratedColumn=0,previousGeneratedLine=1,previousOriginalColumn=0,previousOriginalLine=0,previousName=0,previousSource=0,result="",mappings=this._mappings.toArray(),i=0,len=mappings.length;i0){if(!util.compareByGeneratedPositionsInflated(mapping,mappings[i-1]))continue;next+=","}next+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn),previousGeneratedColumn=mapping.generatedColumn,null!=mapping.source&&(sourceIdx=this._sources.indexOf(mapping.source),next+=base64VLQ.encode(sourceIdx-previousSource),previousSource=sourceIdx,next+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine),previousOriginalLine=mapping.originalLine-1,next+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn),previousOriginalColumn=mapping.originalColumn,null!=mapping.name&&(nameIdx=this._names.indexOf(mapping.name),next+=base64VLQ.encode(nameIdx-previousName),previousName=nameIdx)),result+=next}return result},SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map((function(source){if(!this._sourcesContents)return null;null!=aSourceRoot&&(source=util.relative(aSourceRoot,source));var key=util.toSetString(source);return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null}),this)},SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(map.file=this._file),null!=this._sourceRoot&&(map.sourceRoot=this._sourceRoot),this._sourcesContents&&(map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)),map},SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())},exports.h=SourceMapGenerator},"./node_modules/escodegen/node_modules/source-map/lib/source-node.js":function(__unused_webpack_module,exports,__webpack_require__){var SourceMapGenerator=__webpack_require__("./node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js").h,util=__webpack_require__("./node_modules/escodegen/node_modules/source-map/lib/util.js"),REGEX_NEWLINE=/(\r?\n)/,isSourceNode="$$$isSourceNode$$$";function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[],this.sourceContents={},this.line=null==aLine?null:aLine,this.column=null==aColumn?null:aColumn,this.source=null==aSource?null:aSource,this.name=null==aName?null:aName,this[isSourceNode]=!0,null!=aChunks&&this.add(aChunks)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer,aRelativePath){var node=new SourceNode,remainingLines=aGeneratedCode.split(REGEX_NEWLINE),remainingLinesIndex=0,shiftNextLine=function(){return getNextLine()+(getNextLine()||"");function getNextLine(){return remainingLinesIndex=0;i--)this.prepend(aChunk[i]);else{if(!aChunk[isSourceNode]&&"string"!=typeof aChunk)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk);this.children.unshift(aChunk)}return this},SourceNode.prototype.walk=function SourceNode_walk(aFn){for(var chunk,i=0,len=this.children.length;i0){for(newChildren=[],i=0;i=0;i--)"."===(part=parts[i])?parts.splice(i,1):".."===part?up++:up>0&&(""===part?(parts.splice(i+1,up),up=0):(parts.splice(i,2),up--));return""===(path=parts.join("/"))&&(path=isAbsolute?"/":"."),url?(url.path=path,urlGenerate(url)):path}function join(aRoot,aPath){""===aRoot&&(aRoot="."),""===aPath&&(aPath=".");var aPathUrl=urlParse(aPath),aRootUrl=urlParse(aRoot);if(aRootUrl&&(aRoot=aRootUrl.path||"/"),aPathUrl&&!aPathUrl.scheme)return aRootUrl&&(aPathUrl.scheme=aRootUrl.scheme),urlGenerate(aPathUrl);if(aPathUrl||aPath.match(dataUrlRegexp))return aPath;if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path)return aRootUrl.host=aPath,urlGenerate(aRootUrl);var joined="/"===aPath.charAt(0)?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath);return aRootUrl?(aRootUrl.path=joined,urlGenerate(aRootUrl)):joined}exports.urlParse=urlParse,exports.urlGenerate=urlGenerate,exports.normalize=normalize,exports.join=join,exports.isAbsolute=function(aPath){return"/"===aPath.charAt(0)||urlRegexp.test(aPath)},exports.relative=function relative(aRoot,aPath){""===aRoot&&(aRoot="."),aRoot=aRoot.replace(/\/$/,"");for(var level=0;0!==aPath.indexOf(aRoot+"/");){var index=aRoot.lastIndexOf("/");if(index<0)return aPath;if((aRoot=aRoot.slice(0,index)).match(/^([^\/]+:\/)?\/*$/))return aPath;++level}return Array(level+1).join("../")+aPath.substr(aRoot.length+1)};var supportsNullProto=!("__proto__"in Object.create(null));function identity(s){return s}function isProtoString(s){if(!s)return!1;var length=s.length;if(length<9)return!1;if(95!==s.charCodeAt(length-1)||95!==s.charCodeAt(length-2)||111!==s.charCodeAt(length-3)||116!==s.charCodeAt(length-4)||111!==s.charCodeAt(length-5)||114!==s.charCodeAt(length-6)||112!==s.charCodeAt(length-7)||95!==s.charCodeAt(length-8)||95!==s.charCodeAt(length-9))return!1;for(var i=length-10;i>=0;i--)if(36!==s.charCodeAt(i))return!1;return!0}function strcmp(aStr1,aStr2){return aStr1===aStr2?0:null===aStr1?1:null===aStr2?-1:aStr1>aStr2?1:-1}exports.toSetString=supportsNullProto?identity:function toSetString(aStr){return isProtoString(aStr)?"$"+aStr:aStr},exports.fromSetString=supportsNullProto?identity:function fromSetString(aStr){return isProtoString(aStr)?aStr.slice(1):aStr},exports.compareByOriginalPositions=function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp=strcmp(mappingA.source,mappingB.source);return 0!==cmp||0!==(cmp=mappingA.originalLine-mappingB.originalLine)||0!==(cmp=mappingA.originalColumn-mappingB.originalColumn)||onlyCompareOriginal||0!==(cmp=mappingA.generatedColumn-mappingB.generatedColumn)||0!==(cmp=mappingA.generatedLine-mappingB.generatedLine)?cmp:strcmp(mappingA.name,mappingB.name)},exports.compareByGeneratedPositionsDeflated=function compareByGeneratedPositionsDeflated(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedLine-mappingB.generatedLine;return 0!==cmp||0!==(cmp=mappingA.generatedColumn-mappingB.generatedColumn)||onlyCompareGenerated||0!==(cmp=strcmp(mappingA.source,mappingB.source))||0!==(cmp=mappingA.originalLine-mappingB.originalLine)||0!==(cmp=mappingA.originalColumn-mappingB.originalColumn)?cmp:strcmp(mappingA.name,mappingB.name)},exports.compareByGeneratedPositionsInflated=function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine;return 0!==cmp||0!==(cmp=mappingA.generatedColumn-mappingB.generatedColumn)||0!==(cmp=strcmp(mappingA.source,mappingB.source))||0!==(cmp=mappingA.originalLine-mappingB.originalLine)||0!==(cmp=mappingA.originalColumn-mappingB.originalColumn)?cmp:strcmp(mappingA.name,mappingB.name)},exports.parseSourceMapInput=function parseSourceMapInput(str){return JSON.parse(str.replace(/^\)]}'[^\n]*\n/,""))},exports.computeSourceURL=function computeSourceURL(sourceRoot,sourceURL,sourceMapURL){if(sourceURL=sourceURL||"",sourceRoot&&("/"!==sourceRoot[sourceRoot.length-1]&&"/"!==sourceURL[0]&&(sourceRoot+="/"),sourceURL=sourceRoot+sourceURL),sourceMapURL){var parsed=urlParse(sourceMapURL);if(!parsed)throw new Error("sourceMapURL could not be parsed");if(parsed.path){var index=parsed.path.lastIndexOf("/");index>=0&&(parsed.path=parsed.path.substring(0,index+1))}sourceURL=join(urlGenerate(parsed),sourceURL)}return normalize(sourceURL)}},"./node_modules/escodegen/node_modules/source-map/source-map.js":function(__unused_webpack_module,exports,__webpack_require__){__webpack_require__("./node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js").h,__webpack_require__("./node_modules/escodegen/node_modules/source-map/lib/source-map-consumer.js"),exports.SourceNode=__webpack_require__("./node_modules/escodegen/node_modules/source-map/lib/source-node.js").SourceNode},"./node_modules/estraverse/estraverse.js":function(__unused_webpack_module,exports){!function clone(exports){"use strict";var Syntax,VisitorOption,VisitorKeys,BREAK,SKIP,REMOVE;function deepCopy(obj){var key,val,ret={};for(key in obj)obj.hasOwnProperty(key)&&(val=obj[key],ret[key]="object"==typeof val&&null!==val?deepCopy(val):val);return ret}function Reference(parent,key){this.parent=parent,this.key=key}function Element(node,path,wrap,ref){this.node=node,this.path=path,this.wrap=wrap,this.ref=ref}function Controller(){}function isNode(node){return null!=node&&("object"==typeof node&&"string"==typeof node.type)}function isProperty(nodeType,key){return(nodeType===Syntax.ObjectExpression||nodeType===Syntax.ObjectPattern)&&"properties"===key}function candidateExistsInLeaveList(leavelist,candidate){for(var i=leavelist.length-1;i>=0;--i)if(leavelist[i].node===candidate)return!0;return!1}function traverse(root,visitor){return(new Controller).traverse(root,visitor)}function extendCommentRange(comment,tokens){var target;return target=function upperBound(array,func){var diff,len,i,current;for(len=array.length,i=0;len;)func(array[current=i+(diff=len>>>1)])?len=diff:(i=current+1,len-=diff+1);return i}(tokens,(function search(token){return token.range[0]>comment.range[0]})),comment.extendedRange=[comment.range[0],comment.range[1]],target!==tokens.length&&(comment.extendedRange[1]=tokens[target].range[0]),(target-=1)>=0&&(comment.extendedRange[0]=tokens[target].range[1]),comment}return Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},VisitorKeys={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},VisitorOption={Break:BREAK={},Skip:SKIP={},Remove:REMOVE={}},Reference.prototype.replace=function replace(node){this.parent[this.key]=node},Reference.prototype.remove=function remove(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},Controller.prototype.path=function path(){var i,iz,j,jz,result;function addToPath(result,path){if(Array.isArray(path))for(j=0,jz=path.length;j=0;)if(candidate=node[key=candidates[current]])if(Array.isArray(candidate)){for(current2=candidate.length;(current2-=1)>=0;)if(candidate[current2]&&!candidateExistsInLeaveList(leavelist,candidate[current2])){if(isProperty(nodeType,candidates[current]))element=new Element(candidate[current2],[key,current2],"Property",null);else{if(!isNode(candidate[current2]))continue;element=new Element(candidate[current2],[key,current2],null,null)}worklist.push(element)}}else if(isNode(candidate)){if(candidateExistsInLeaveList(leavelist,candidate))continue;worklist.push(new Element(candidate,key,null,null))}}}else if(element=leavelist.pop(),ret=this.__execute(visitor.leave,element),this.__state===BREAK||ret===BREAK)return},Controller.prototype.replace=function replace(root,visitor){var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;function removeElem(element){var i,key,nextElem,parent;if(element.ref.remove())for(key=element.ref.key,parent=element.ref.parent,i=worklist.length;i--;)if((nextElem=worklist[i]).ref&&nextElem.ref.parent===parent){if(nextElem.ref.key=0;)if(candidate=node[key=candidates[current]])if(Array.isArray(candidate)){for(current2=candidate.length;(current2-=1)>=0;)if(candidate[current2]){if(isProperty(nodeType,candidates[current]))element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2));else{if(!isNode(candidate[current2]))continue;element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2))}worklist.push(element)}}else isNode(candidate)&&worklist.push(new Element(candidate,key,null,new Reference(node,key)))}}else if(element=leavelist.pop(),void 0!==(target=this.__execute(visitor.leave,element))&&target!==BREAK&&target!==SKIP&&target!==REMOVE&&element.ref.replace(target),this.__state!==REMOVE&&target!==REMOVE||removeElem(element),this.__state===BREAK||target===BREAK)return outer.root;return outer.root},exports.Syntax=Syntax,exports.traverse=traverse,exports.replace=function replace(root,visitor){return(new Controller).replace(root,visitor)},exports.attachComments=function attachComments(tree,providedComments,tokens){var comment,len,i,cursor,comments=[];if(!tree.range)throw new Error("attachComments needs range information");if(!tokens.length){if(providedComments.length){for(i=0,len=providedComments.length;inode.range[0]);)comment.extendedRange[1]===node.range[0]?(node.leadingComments||(node.leadingComments=[]),node.leadingComments.push(comment),comments.splice(cursor,1)):cursor+=1;return cursor===comments.length?VisitorOption.Break:comments[cursor].extendedRange[0]>node.range[1]?VisitorOption.Skip:void 0}}),cursor=0,traverse(tree,{leave:function(node){for(var comment;cursornode.range[1]?VisitorOption.Skip:void 0}}),tree},exports.VisitorKeys=VisitorKeys,exports.VisitorOption=VisitorOption,exports.Controller=Controller,exports.cloneEnvironment=function(){return clone({})},exports}(exports)},"./node_modules/esutils/lib/ast.js":function(module){!function(){"use strict";function isStatement(node){if(null==node)return!1;switch(node.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function trailingStatement(node){switch(node.type){case"IfStatement":return null!=node.alternate?node.alternate:node.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return node.body}return null}module.exports={isExpression:function isExpression(node){if(null==node)return!1;switch(node.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1},isStatement:isStatement,isIterationStatement:function isIterationStatement(node){if(null==node)return!1;switch(node.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1},isSourceElement:function isSourceElement(node){return isStatement(node)||null!=node&&"FunctionDeclaration"===node.type},isProblematicIfStatement:function isProblematicIfStatement(node){var current;if("IfStatement"!==node.type)return!1;if(null==node.alternate)return!1;current=node.consequent;do{if("IfStatement"===current.type&&null==current.alternate)return!0;current=trailingStatement(current)}while(current);return!1},trailingStatement:trailingStatement}}()},"./node_modules/esutils/lib/code.js":function(module){!function(){"use strict";var ES6Regex,ES5Regex,NON_ASCII_WHITESPACES,IDENTIFIER_START,IDENTIFIER_PART,ch;function fromCodePoint(cp){return cp<=65535?String.fromCharCode(cp):String.fromCharCode(Math.floor((cp-65536)/1024)+55296)+String.fromCharCode((cp-65536)%1024+56320)}for(ES5Regex={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},ES6Regex={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},NON_ASCII_WHITESPACES=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],IDENTIFIER_START=new Array(128),ch=0;ch<128;++ch)IDENTIFIER_START[ch]=ch>=97&&ch<=122||ch>=65&&ch<=90||36===ch||95===ch;for(IDENTIFIER_PART=new Array(128),ch=0;ch<128;++ch)IDENTIFIER_PART[ch]=ch>=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57||36===ch||95===ch;module.exports={isDecimalDigit:function isDecimalDigit(ch){return 48<=ch&&ch<=57},isHexDigit:function isHexDigit(ch){return 48<=ch&&ch<=57||97<=ch&&ch<=102||65<=ch&&ch<=70},isOctalDigit:function isOctalDigit(ch){return ch>=48&&ch<=55},isWhiteSpace:function isWhiteSpace(ch){return 32===ch||9===ch||11===ch||12===ch||160===ch||ch>=5760&&NON_ASCII_WHITESPACES.indexOf(ch)>=0},isLineTerminator:function isLineTerminator(ch){return 10===ch||13===ch||8232===ch||8233===ch},isIdentifierStartES5:function isIdentifierStartES5(ch){return ch<128?IDENTIFIER_START[ch]:ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch))},isIdentifierPartES5:function isIdentifierPartES5(ch){return ch<128?IDENTIFIER_PART[ch]:ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch))},isIdentifierStartES6:function isIdentifierStartES6(ch){return ch<128?IDENTIFIER_START[ch]:ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch))},isIdentifierPartES6:function isIdentifierPartES6(ch){return ch<128?IDENTIFIER_PART[ch]:ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch))}}}()},"./node_modules/esutils/lib/keyword.js":function(module,__unused_webpack_exports,__webpack_require__){!function(){"use strict";var code=__webpack_require__("./node_modules/esutils/lib/code.js");function isKeywordES5(id,strict){return!(!strict&&"yield"===id)&&isKeywordES6(id,strict)}function isKeywordES6(id,strict){if(strict&&function isStrictModeReservedWordES6(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}(id))return!0;switch(id.length){case 2:return"if"===id||"in"===id||"do"===id;case 3:return"var"===id||"for"===id||"new"===id||"try"===id;case 4:return"this"===id||"else"===id||"case"===id||"void"===id||"with"===id||"enum"===id;case 5:return"while"===id||"break"===id||"catch"===id||"throw"===id||"const"===id||"yield"===id||"class"===id||"super"===id;case 6:return"return"===id||"typeof"===id||"delete"===id||"switch"===id||"export"===id||"import"===id;case 7:return"default"===id||"finally"===id||"extends"===id;case 8:return"function"===id||"continue"===id||"debugger"===id;case 10:return"instanceof"===id;default:return!1}}function isReservedWordES5(id,strict){return"null"===id||"true"===id||"false"===id||isKeywordES5(id,strict)}function isReservedWordES6(id,strict){return"null"===id||"true"===id||"false"===id||isKeywordES6(id,strict)}function isIdentifierNameES5(id){var i,iz,ch;if(0===id.length)return!1;if(ch=id.charCodeAt(0),!code.isIdentifierStartES5(ch))return!1;for(i=1,iz=id.length;i=iz)return!1;if(!(56320<=(lowCh=id.charCodeAt(i))&&lowCh<=57343))return!1;ch=1024*(ch-55296)+(lowCh-56320)+65536}if(!check(ch))return!1;check=code.isIdentifierPartES6}return!0}module.exports={isKeywordES5:isKeywordES5,isKeywordES6:isKeywordES6,isReservedWordES5:isReservedWordES5,isReservedWordES6:isReservedWordES6,isRestrictedWord:function isRestrictedWord(id){return"eval"===id||"arguments"===id},isIdentifierNameES5:isIdentifierNameES5,isIdentifierNameES6:isIdentifierNameES6,isIdentifierES5:function isIdentifierES5(id,strict){return isIdentifierNameES5(id)&&!isReservedWordES5(id,strict)},isIdentifierES6:function isIdentifierES6(id,strict){return isIdentifierNameES6(id)&&!isReservedWordES6(id,strict)}}}()},"./node_modules/esutils/lib/utils.js":function(__unused_webpack_module,exports,__webpack_require__){!function(){"use strict";exports.ast=__webpack_require__("./node_modules/esutils/lib/ast.js"),exports.code=__webpack_require__("./node_modules/esutils/lib/code.js"),exports.keyword=__webpack_require__("./node_modules/esutils/lib/keyword.js")}()},"./node_modules/for-each/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var isCallable=__webpack_require__("./node_modules/is-callable/index.js"),toStr=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function forEach(list,iterator,thisArg){if(!isCallable(iterator))throw new TypeError("iterator must be a function");var receiver;arguments.length>=3&&(receiver=thisArg),"[object Array]"===toStr.call(list)?function forEachArray(array,iterator,receiver){for(var i=0,len=array.length;i1&&"boolean"!=typeof allowMissing)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,name))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var parts=function stringToPath(string){var first=$strSlice(string,0,1),last=$strSlice(string,-1);if("%"===first&&"%"!==last)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===last&&"%"!==first)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var result=[];return $replace(string,rePropName,(function(match,number,quote,subString){result[result.length]=quote?$replace(subString,reEscapeChar,"$1"):number||match})),result}(name),intrinsicBaseName=parts.length>0?parts[0]:"",intrinsic=getBaseIntrinsic("%"+intrinsicBaseName+"%",allowMissing),intrinsicRealName=intrinsic.name,value=intrinsic.value,skipFurtherCaching=!1,alias=intrinsic.alias;alias&&(intrinsicBaseName=alias[0],$spliceApply(parts,$concat([0,1],alias)));for(var i=1,isOwn=!0;i=parts.length){var desc=$gOPD(value,part);value=(isOwn=!!desc)&&"get"in desc&&!("originalValue"in desc.get)?desc.get:value[part]}else isOwn=hasOwn(value,part),value=value[part];isOwn&&!skipFurtherCaching&&(INTRINSICS[intrinsicRealName]=value)}}return value}},"./node_modules/gopd/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var $gOPD=__webpack_require__("./node_modules/get-intrinsic/index.js")("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch(e){$gOPD=null}module.exports=$gOPD},"./node_modules/has-property-descriptors/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var $defineProperty=__webpack_require__("./node_modules/get-intrinsic/index.js")("%Object.defineProperty%",!0),hasPropertyDescriptors=function hasPropertyDescriptors(){if($defineProperty)try{return $defineProperty({},"a",{value:1}),!0}catch(e){return!1}return!1};hasPropertyDescriptors.hasArrayLengthDefineBug=function hasArrayLengthDefineBug(){if(!hasPropertyDescriptors())return null;try{return 1!==$defineProperty([],"length",{value:1}).length}catch(e){return!0}},module.exports=hasPropertyDescriptors},"./node_modules/has-proto/index.js":function(module){"use strict";var test={foo:{}},$Object=Object;module.exports=function hasProto(){return{__proto__:test}.foo===test.foo&&!({__proto__:null}instanceof $Object)}},"./node_modules/has-symbols/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var origSymbol="undefined"!=typeof Symbol&&Symbol,hasSymbolSham=__webpack_require__("./node_modules/has-symbols/shams.js");module.exports=function hasNativeSymbols(){return"function"==typeof origSymbol&&("function"==typeof Symbol&&("symbol"==typeof origSymbol("foo")&&("symbol"==typeof Symbol("bar")&&hasSymbolSham())))}},"./node_modules/has-symbols/shams.js":function(module){"use strict";module.exports=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var obj={},sym=Symbol("test"),symObj=Object(sym);if("string"==typeof sym)return!1;if("[object Symbol]"!==Object.prototype.toString.call(sym))return!1;if("[object Symbol]"!==Object.prototype.toString.call(symObj))return!1;for(sym in obj[sym]=42,obj)return!1;if("function"==typeof Object.keys&&0!==Object.keys(obj).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(obj).length)return!1;var syms=Object.getOwnPropertySymbols(obj);if(1!==syms.length||syms[0]!==sym)return!1;if(!Object.prototype.propertyIsEnumerable.call(obj,sym))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var descriptor=Object.getOwnPropertyDescriptor(obj,sym);if(42!==descriptor.value||!0!==descriptor.enumerable)return!1}return!0}},"./node_modules/has-tostringtag/shams.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var hasSymbols=__webpack_require__("./node_modules/has-symbols/shams.js");module.exports=function hasToStringTagShams(){return hasSymbols()&&!!Symbol.toStringTag}},"./node_modules/has/src/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var bind=__webpack_require__("./node_modules/function-bind/index.js");module.exports=bind.call(Function.call,Object.prototype.hasOwnProperty)},"./node_modules/html-tags/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";module.exports=__webpack_require__("./node_modules/html-tags/html-tags.json")},"./node_modules/inherits/inherits_browser.js":function(module){"function"==typeof Object.create?module.exports=function inherits(ctor,superCtor){superCtor&&(ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}}},"./node_modules/is-arguments/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var hasToStringTag=__webpack_require__("./node_modules/has-tostringtag/shams.js")(),$toString=__webpack_require__("./node_modules/call-bind/callBound.js")("Object.prototype.toString"),isStandardArguments=function isArguments(value){return!(hasToStringTag&&value&&"object"==typeof value&&Symbol.toStringTag in value)&&"[object Arguments]"===$toString(value)},isLegacyArguments=function isArguments(value){return!!isStandardArguments(value)||null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Array]"!==$toString(value)&&"[object Function]"===$toString(value.callee)},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments,module.exports=supportsStandardArguments?isStandardArguments:isLegacyArguments},"./node_modules/is-callable/index.js":function(module){"use strict";var badArrayLike,isCallableMarker,fnToStr=Function.prototype.toString,reflectApply="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof reflectApply&&"function"==typeof Object.defineProperty)try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply((function(){throw 42}),null,badArrayLike)}catch(_){_!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function isES6ClassFunction(value){try{var fnStr=fnToStr.call(value);return constructorRegex.test(fnStr)}catch(e){return!1}},tryFunctionObject=function tryFunctionToStr(value){try{return!isES6ClassFn(value)&&(fnToStr.call(value),!0)}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function isDocumentDotAll(){return!1};if("object"==typeof document){var all=document.all;toStr.call(all)===toStr.call(document.all)&&(isDDA=function isDocumentDotAll(value){if((isIE68||!value)&&(void 0===value||"object"==typeof value))try{var str=toStr.call(value);return("[object HTMLAllCollection]"===str||"[object HTML document.all class]"===str||"[object HTMLCollection]"===str||"[object Object]"===str)&&null==value("")}catch(e){}return!1})}module.exports=reflectApply?function isCallable(value){if(isDDA(value))return!0;if(!value)return!1;if("function"!=typeof value&&"object"!=typeof value)return!1;try{reflectApply(value,null,badArrayLike)}catch(e){if(e!==isCallableMarker)return!1}return!isES6ClassFn(value)&&tryFunctionObject(value)}:function isCallable(value){if(isDDA(value))return!0;if(!value)return!1;if("function"!=typeof value&&"object"!=typeof value)return!1;if(hasToStringTag)return tryFunctionObject(value);if(isES6ClassFn(value))return!1;var strClass=toStr.call(value);return!("[object Function]"!==strClass&&"[object GeneratorFunction]"!==strClass&&!/^\[object HTML/.test(strClass))&&tryFunctionObject(value)}},"./node_modules/is-generator-function/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var GeneratorFunction,toStr=Object.prototype.toString,fnToStr=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag=__webpack_require__("./node_modules/has-tostringtag/shams.js")(),getProto=Object.getPrototypeOf;module.exports=function isGeneratorFunction(fn){if("function"!=typeof fn)return!1;if(isFnRegex.test(fnToStr.call(fn)))return!0;if(!hasToStringTag)return"[object GeneratorFunction]"===toStr.call(fn);if(!getProto)return!1;if(void 0===GeneratorFunction){var generatorFunc=function(){if(!hasToStringTag)return!1;try{return Function("return function*() {}")()}catch(e){}}();GeneratorFunction=!!generatorFunc&&getProto(generatorFunc)}return getProto(fn)===GeneratorFunction}},"./node_modules/is-nan/implementation.js":function(module){"use strict";module.exports=function isNaN(value){return value!=value}},"./node_modules/is-nan/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var callBind=__webpack_require__("./node_modules/call-bind/index.js"),define=__webpack_require__("./node_modules/define-properties/index.js"),implementation=__webpack_require__("./node_modules/is-nan/implementation.js"),getPolyfill=__webpack_require__("./node_modules/is-nan/polyfill.js"),shim=__webpack_require__("./node_modules/is-nan/shim.js"),polyfill=callBind(getPolyfill(),Number);define(polyfill,{getPolyfill:getPolyfill,implementation:implementation,shim:shim}),module.exports=polyfill},"./node_modules/is-nan/polyfill.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var implementation=__webpack_require__("./node_modules/is-nan/implementation.js");module.exports=function getPolyfill(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:implementation}},"./node_modules/is-nan/shim.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var define=__webpack_require__("./node_modules/define-properties/index.js"),getPolyfill=__webpack_require__("./node_modules/is-nan/polyfill.js");module.exports=function shimNumberIsNaN(){var polyfill=getPolyfill();return define(Number,{isNaN:polyfill},{isNaN:function testIsNaN(){return Number.isNaN!==polyfill}}),polyfill}},"./node_modules/is-plain-object/dist/is-plain-object.js":function(__unused_webpack_module,exports){"use strict";function isObject(o){return"[object Object]"===Object.prototype.toString.call(o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPlainObject=function isPlainObject(o){var ctor,prot;return!1!==isObject(o)&&(void 0===(ctor=o.constructor)||!1!==isObject(prot=ctor.prototype)&&!1!==prot.hasOwnProperty("isPrototypeOf"))}},"./node_modules/is-typed-array/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var whichTypedArray=__webpack_require__("./node_modules/which-typed-array/index.js");module.exports=function isTypedArray(value){return!!whichTypedArray(value)}},"./node_modules/lodash/_DataView.js":function(module,__unused_webpack_exports,__webpack_require__){var DataView=__webpack_require__("./node_modules/lodash/_getNative.js")(__webpack_require__("./node_modules/lodash/_root.js"),"DataView");module.exports=DataView},"./node_modules/lodash/_Hash.js":function(module,__unused_webpack_exports,__webpack_require__){var hashClear=__webpack_require__("./node_modules/lodash/_hashClear.js"),hashDelete=__webpack_require__("./node_modules/lodash/_hashDelete.js"),hashGet=__webpack_require__("./node_modules/lodash/_hashGet.js"),hashHas=__webpack_require__("./node_modules/lodash/_hashHas.js"),hashSet=__webpack_require__("./node_modules/lodash/_hashSet.js");function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++indexarrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1}},"./node_modules/lodash/_listCacheSet.js":function(module,__unused_webpack_exports,__webpack_require__){var assocIndexOf=__webpack_require__("./node_modules/lodash/_assocIndexOf.js");module.exports=function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}},"./node_modules/lodash/_mapCacheClear.js":function(module,__unused_webpack_exports,__webpack_require__){var Hash=__webpack_require__("./node_modules/lodash/_Hash.js"),ListCache=__webpack_require__("./node_modules/lodash/_ListCache.js"),Map=__webpack_require__("./node_modules/lodash/_Map.js");module.exports=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}},"./node_modules/lodash/_mapCacheDelete.js":function(module,__unused_webpack_exports,__webpack_require__){var getMapData=__webpack_require__("./node_modules/lodash/_getMapData.js");module.exports=function mapCacheDelete(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result}},"./node_modules/lodash/_mapCacheGet.js":function(module,__unused_webpack_exports,__webpack_require__){var getMapData=__webpack_require__("./node_modules/lodash/_getMapData.js");module.exports=function mapCacheGet(key){return getMapData(this,key).get(key)}},"./node_modules/lodash/_mapCacheHas.js":function(module,__unused_webpack_exports,__webpack_require__){var getMapData=__webpack_require__("./node_modules/lodash/_getMapData.js");module.exports=function mapCacheHas(key){return getMapData(this,key).has(key)}},"./node_modules/lodash/_mapCacheSet.js":function(module,__unused_webpack_exports,__webpack_require__){var getMapData=__webpack_require__("./node_modules/lodash/_getMapData.js");module.exports=function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this}},"./node_modules/lodash/_mapToArray.js":function(module){module.exports=function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach((function(value,key){result[++index]=[key,value]})),result}},"./node_modules/lodash/_matchesStrictComparable.js":function(module){module.exports=function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}},"./node_modules/lodash/_memoizeCapped.js":function(module,__unused_webpack_exports,__webpack_require__){var memoize=__webpack_require__("./node_modules/lodash/memoize.js");module.exports=function memoizeCapped(func){var result=memoize(func,(function(key){return 500===cache.size&&cache.clear(),key})),cache=result.cache;return result}},"./node_modules/lodash/_nativeCreate.js":function(module,__unused_webpack_exports,__webpack_require__){var nativeCreate=__webpack_require__("./node_modules/lodash/_getNative.js")(Object,"create");module.exports=nativeCreate},"./node_modules/lodash/_nativeKeys.js":function(module,__unused_webpack_exports,__webpack_require__){var nativeKeys=__webpack_require__("./node_modules/lodash/_overArg.js")(Object.keys,Object);module.exports=nativeKeys},"./node_modules/lodash/_nodeUtil.js":function(module,exports,__webpack_require__){module=__webpack_require__.nmd(module);var freeGlobal=__webpack_require__("./node_modules/lodash/_freeGlobal.js"),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&module&&!module.nodeType&&module,freeProcess=freeModule&&freeModule.exports===freeExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}();module.exports=nodeUtil},"./node_modules/lodash/_objectToString.js":function(module){var nativeObjectToString=Object.prototype.toString;module.exports=function objectToString(value){return nativeObjectToString.call(value)}},"./node_modules/lodash/_overArg.js":function(module){module.exports=function overArg(func,transform){return function(arg){return func(transform(arg))}}},"./node_modules/lodash/_root.js":function(module,__unused_webpack_exports,__webpack_require__){var freeGlobal=__webpack_require__("./node_modules/lodash/_freeGlobal.js"),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},"./node_modules/lodash/_setCacheAdd.js":function(module){module.exports=function setCacheAdd(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this}},"./node_modules/lodash/_setCacheHas.js":function(module){module.exports=function setCacheHas(value){return this.__data__.has(value)}},"./node_modules/lodash/_setToArray.js":function(module){module.exports=function setToArray(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=value})),result}},"./node_modules/lodash/_stackClear.js":function(module,__unused_webpack_exports,__webpack_require__){var ListCache=__webpack_require__("./node_modules/lodash/_ListCache.js");module.exports=function stackClear(){this.__data__=new ListCache,this.size=0}},"./node_modules/lodash/_stackDelete.js":function(module){module.exports=function stackDelete(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result}},"./node_modules/lodash/_stackGet.js":function(module){module.exports=function stackGet(key){return this.__data__.get(key)}},"./node_modules/lodash/_stackHas.js":function(module){module.exports=function stackHas(key){return this.__data__.has(key)}},"./node_modules/lodash/_stackSet.js":function(module,__unused_webpack_exports,__webpack_require__){var ListCache=__webpack_require__("./node_modules/lodash/_ListCache.js"),Map=__webpack_require__("./node_modules/lodash/_Map.js"),MapCache=__webpack_require__("./node_modules/lodash/_MapCache.js");module.exports=function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this}},"./node_modules/lodash/_stringToPath.js":function(module,__unused_webpack_exports,__webpack_require__){var memoizeCapped=__webpack_require__("./node_modules/lodash/_memoizeCapped.js"),rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,(function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)})),result}));module.exports=stringToPath},"./node_modules/lodash/_toKey.js":function(module,__unused_webpack_exports,__webpack_require__){var isSymbol=__webpack_require__("./node_modules/lodash/isSymbol.js");module.exports=function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-Infinity?"-0":result}},"./node_modules/lodash/_toSource.js":function(module){var funcToString=Function.prototype.toString;module.exports=function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}},"./node_modules/lodash/eq.js":function(module){module.exports=function eq(value,other){return value===other||value!=value&&other!=other}},"./node_modules/lodash/get.js":function(module,__unused_webpack_exports,__webpack_require__){var baseGet=__webpack_require__("./node_modules/lodash/_baseGet.js");module.exports=function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}},"./node_modules/lodash/hasIn.js":function(module,__unused_webpack_exports,__webpack_require__){var baseHasIn=__webpack_require__("./node_modules/lodash/_baseHasIn.js"),hasPath=__webpack_require__("./node_modules/lodash/_hasPath.js");module.exports=function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}},"./node_modules/lodash/identity.js":function(module){module.exports=function identity(value){return value}},"./node_modules/lodash/isArguments.js":function(module,__unused_webpack_exports,__webpack_require__){var baseIsArguments=__webpack_require__("./node_modules/lodash/_baseIsArguments.js"),isObjectLike=__webpack_require__("./node_modules/lodash/isObjectLike.js"),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,propertyIsEnumerable=objectProto.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")};module.exports=isArguments},"./node_modules/lodash/isArray.js":function(module){var isArray=Array.isArray;module.exports=isArray},"./node_modules/lodash/isArrayLike.js":function(module,__unused_webpack_exports,__webpack_require__){var isFunction=__webpack_require__("./node_modules/lodash/isFunction.js"),isLength=__webpack_require__("./node_modules/lodash/isLength.js");module.exports=function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}},"./node_modules/lodash/isBuffer.js":function(module,exports,__webpack_require__){module=__webpack_require__.nmd(module);var root=__webpack_require__("./node_modules/lodash/_root.js"),stubFalse=__webpack_require__("./node_modules/lodash/stubFalse.js"),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&module&&!module.nodeType&&module,Buffer=freeModule&&freeModule.exports===freeExports?root.Buffer:void 0,isBuffer=(Buffer?Buffer.isBuffer:void 0)||stubFalse;module.exports=isBuffer},"./node_modules/lodash/isFunction.js":function(module,__unused_webpack_exports,__webpack_require__){var baseGetTag=__webpack_require__("./node_modules/lodash/_baseGetTag.js"),isObject=__webpack_require__("./node_modules/lodash/isObject.js");module.exports=function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return"[object Function]"==tag||"[object GeneratorFunction]"==tag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}},"./node_modules/lodash/isLength.js":function(module){module.exports=function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}},"./node_modules/lodash/isObject.js":function(module){module.exports=function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}},"./node_modules/lodash/isObjectLike.js":function(module){module.exports=function isObjectLike(value){return null!=value&&"object"==typeof value}},"./node_modules/lodash/isPlainObject.js":function(module,__unused_webpack_exports,__webpack_require__){var baseGetTag=__webpack_require__("./node_modules/lodash/_baseGetTag.js"),getPrototype=__webpack_require__("./node_modules/lodash/_getPrototype.js"),isObjectLike=__webpack_require__("./node_modules/lodash/isObjectLike.js"),funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);module.exports=function isPlainObject(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}},"./node_modules/lodash/isString.js":function(module,__unused_webpack_exports,__webpack_require__){var baseGetTag=__webpack_require__("./node_modules/lodash/_baseGetTag.js"),isArray=__webpack_require__("./node_modules/lodash/isArray.js"),isObjectLike=__webpack_require__("./node_modules/lodash/isObjectLike.js");module.exports=function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&"[object String]"==baseGetTag(value)}},"./node_modules/lodash/isSymbol.js":function(module,__unused_webpack_exports,__webpack_require__){var baseGetTag=__webpack_require__("./node_modules/lodash/_baseGetTag.js"),isObjectLike=__webpack_require__("./node_modules/lodash/isObjectLike.js");module.exports=function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}},"./node_modules/lodash/isTypedArray.js":function(module,__unused_webpack_exports,__webpack_require__){var baseIsTypedArray=__webpack_require__("./node_modules/lodash/_baseIsTypedArray.js"),baseUnary=__webpack_require__("./node_modules/lodash/_baseUnary.js"),nodeUtil=__webpack_require__("./node_modules/lodash/_nodeUtil.js"),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray},"./node_modules/lodash/keys.js":function(module,__unused_webpack_exports,__webpack_require__){var arrayLikeKeys=__webpack_require__("./node_modules/lodash/_arrayLikeKeys.js"),baseKeys=__webpack_require__("./node_modules/lodash/_baseKeys.js"),isArrayLike=__webpack_require__("./node_modules/lodash/isArrayLike.js");module.exports=function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}},"./node_modules/lodash/mapValues.js":function(module,__unused_webpack_exports,__webpack_require__){var baseAssignValue=__webpack_require__("./node_modules/lodash/_baseAssignValue.js"),baseForOwn=__webpack_require__("./node_modules/lodash/_baseForOwn.js"),baseIteratee=__webpack_require__("./node_modules/lodash/_baseIteratee.js");module.exports=function mapValues(object,iteratee){var result={};return iteratee=baseIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object))})),result}},"./node_modules/lodash/memoize.js":function(module,__unused_webpack_exports,__webpack_require__){var MapCache=__webpack_require__("./node_modules/lodash/_MapCache.js");function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError("Expected a function");var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache,module.exports=memoize},"./node_modules/lodash/property.js":function(module,__unused_webpack_exports,__webpack_require__){var baseProperty=__webpack_require__("./node_modules/lodash/_baseProperty.js"),basePropertyDeep=__webpack_require__("./node_modules/lodash/_basePropertyDeep.js"),isKey=__webpack_require__("./node_modules/lodash/_isKey.js"),toKey=__webpack_require__("./node_modules/lodash/_toKey.js");module.exports=function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}},"./node_modules/lodash/stubArray.js":function(module){module.exports=function stubArray(){return[]}},"./node_modules/lodash/stubFalse.js":function(module){module.exports=function stubFalse(){return!1}},"./node_modules/lodash/toString.js":function(module,__unused_webpack_exports,__webpack_require__){var baseToString=__webpack_require__("./node_modules/lodash/_baseToString.js");module.exports=function toString(value){return null==value?"":baseToString(value)}},"./node_modules/object-is/implementation.js":function(module){"use strict";var numberIsNaN=function(value){return value!=value};module.exports=function is(a,b){return 0===a&&0===b?1/a==1/b:a===b||!(!numberIsNaN(a)||!numberIsNaN(b))}},"./node_modules/object-is/index.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var define=__webpack_require__("./node_modules/define-properties/index.js"),callBind=__webpack_require__("./node_modules/call-bind/index.js"),implementation=__webpack_require__("./node_modules/object-is/implementation.js"),getPolyfill=__webpack_require__("./node_modules/object-is/polyfill.js"),shim=__webpack_require__("./node_modules/object-is/shim.js"),polyfill=callBind(getPolyfill(),Object);define(polyfill,{getPolyfill:getPolyfill,implementation:implementation,shim:shim}),module.exports=polyfill},"./node_modules/object-is/polyfill.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var implementation=__webpack_require__("./node_modules/object-is/implementation.js");module.exports=function getPolyfill(){return"function"==typeof Object.is?Object.is:implementation}},"./node_modules/object-is/shim.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__("./node_modules/object-is/polyfill.js"),define=__webpack_require__("./node_modules/define-properties/index.js");module.exports=function shimObjectIs(){var polyfill=getPolyfill();return define(Object,{is:polyfill},{is:function testObjectIs(){return Object.is!==polyfill}}),polyfill}},"./node_modules/object-keys/implementation.js":function(module,__unused_webpack_exports,__webpack_require__){"use strict";var keysShim;if(!Object.keys){var has=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,isArgs=__webpack_require__("./node_modules/object-keys/isArguments.js"),isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call((function(){}),"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(o){var ctor=o.constructor;return ctor&&ctor.prototype===o},excludedKeys={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var k in window)try{if(!excludedKeys["$"+k]&&has.call(window,k)&&null!==window[k]&&"object"==typeof window[k])try{equalsConstructorPrototype(window[k])}catch(e){return!0}}catch(e){return!0}return!1}();keysShim=function keys(object){var isObject=null!==object&&"object"==typeof object,isFunction="[object Function]"===toStr.call(object),isArguments=isArgs(object),isString=isObject&&"[object String]"===toStr.call(object),theKeys=[];if(!isObject&&!isFunction&&!isArguments)throw new TypeError("Object.keys called on a non-object");var skipProto=hasProtoEnumBug&&isFunction;if(isString&&object.length>0&&!has.call(object,0))for(var i=0;i0)for(var j=0;j=0&&"[object Function]"===toStr.call(value.callee)),isArgs}},"./node_modules/process/browser.js":function(module){var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex1)for(var i=1;i