From 07da57b69278a0a227136a2eb779c2ba2fa89cc9 Mon Sep 17 00:00:00 2001 From: Zaehiel Date: Thu, 21 Sep 2023 10:25:55 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20github-pages=20from=20@=20read?= =?UTF-8?q?yplayerme/visage@1e4e1a518a81ae8b33aa9ecfc461e827cb3b93a8=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.0d0be358.iframe.bundle.js | 1 + docs/130.8a596fcd.iframe.bundle.js | 1 - docs/471.0651b689.iframe.bundle.js | 1 - docs/471.579730df.iframe.bundle.js | 1 + docs/742.9e709736.iframe.bundle.js | 1 - docs/742.c26d2c53.iframe.bundle.js | 1 + ...omponents-Avatar-Examples-stories.a6b07c71.iframe.bundle.js} | 2 +- docs/iframe.html | 2 +- docs/project.json | 2 +- ....iframe.bundle.js => runtime~main.8233e051.iframe.bundle.js} | 2 +- 10 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 docs/130.0d0be358.iframe.bundle.js delete mode 100644 docs/130.8a596fcd.iframe.bundle.js delete mode 100644 docs/471.0651b689.iframe.bundle.js create mode 100644 docs/471.579730df.iframe.bundle.js delete mode 100644 docs/742.9e709736.iframe.bundle.js create mode 100644 docs/742.c26d2c53.iframe.bundle.js rename docs/{components-Avatar-Examples-stories.1bdf10d2.iframe.bundle.js => components-Avatar-Examples-stories.a6b07c71.iframe.bundle.js} (99%) rename docs/{runtime~main.2f3151f2.iframe.bundle.js => runtime~main.8233e051.iframe.bundle.js} (97%) diff --git a/docs/130.0d0be358.iframe.bundle.js b/docs/130.0d0be358.iframe.bundle.js new file mode 100644 index 00000000..a577b6de --- /dev/null +++ b/docs/130.0d0be358.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_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_7__=__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"),three__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/three/build/three.module.js"),_react_three_drei__WEBPACK_IMPORTED_MODULE_8__=__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"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Avatar=function Avatar(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_index__WEBPACK_IMPORTED_MODULE_5__.q,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args),{},{children:args.children}))},Sparkles=function Sparkles(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_react_three_drei__WEBPACK_IMPORTED_MODULE_8__.P,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args))},Template=function Template(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args))},Static=Template.bind({});Static.args={modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("female.glb"),animationSrc:void 0,poseSrc:void 0,environment:"hub",scale:1,shadows:!0,idleRotation:!1,headMovement:!1,ambientLightColor:"#fff5b6",dirLightColor:"#002aff",spotLightColor:"#fff5b6",ambientLightIntensity:.25,dirLightIntensity:5,spotLightIntensity:1,dirLightPosition:new three__WEBPACK_IMPORTED_MODULE_9__.Vector3(-3,5,-5),spotLightPosition:new three__WEBPACK_IMPORTED_MODULE_9__.Vector3(12,10,7.5),spotLightAngle:.314,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")}},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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_6__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args),{},{bloom:pulsatingBloom,effects:{ambientOcclusion:null==args?void 0:args.ambientOcclusion},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Sparkles,{color:"white",count:50,opacity:.9,scale:5,size:.5,speed:.35})}))};Showcase.args={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,ambientLightColor:"#ffffff",dirLightColor:"#ffffff",spotLightColor:"#adbfe5",ambientLightIntensity:0,dirLightIntensity:2.2,spotLightIntensity:.5,environment:"apartment",shadows:!0,emotion:{jawOpen:.1,mouthSmileLeft:.2,mouthSmileRight:.1,mouthPressLeft:.1,cheekSquintLeft:.3,eyeLookOutLeft:.6,eyeLookInRight:.6,mouthDimpleLeft:.3},ambientOcclusion:!1},Showcase.argTypes=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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}},ambientLightColor:{table:{disable:!0}},dirLightColor:{table:{disable:!0}},spotLightColor:{table:{disable:!0}},ambientLightIntensity:{table:{disable:!0}},dirLightIntensity:{table:{disable:!0}},spotLightIntensity:{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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Static.args),{},{emotion:void 0,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,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:{control:!1},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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_6__.jsx)(src_components_FileDropper_FileDropper_component__WEBPACK_IMPORTED_MODULE_2__.s,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args))})}.bind({});_DragNDrop.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Static.args),{},{modelSrc:void 0,animationSrc:void 0,poseSrc:"",environment:"city",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:{ambientLightColor:{control:"color"},dirLightColor:{control:"color"},spotLightColor:{control:"color"},ambientLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},dirLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},spotLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},spotLightAngle:{control:{type:"range",min:0,max:10,step:.01}},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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Static.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Showcase.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Animated.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},HalfBody.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},_DragNDrop.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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={smile:{eyeSquintLeft:.4,eyeSquintRight:.2,mouthSmileLeft:.37,mouthSmileRight:.36,mouthShrugUpper:.27,browInnerUp:.3,browOuterUpLeft:.37,browOuterUpRight:.49}}}}]); \ No newline at end of file diff --git a/docs/130.8a596fcd.iframe.bundle.js b/docs/130.8a596fcd.iframe.bundle.js deleted file mode 100644 index eac4d283..00000000 --- a/docs/130.8a596fcd.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_7__=__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"),three__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/three/build/three.module.js"),_react_three_drei__WEBPACK_IMPORTED_MODULE_8__=__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"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Avatar=function Avatar(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_index__WEBPACK_IMPORTED_MODULE_5__.q,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args),{},{children:args.children}))},Sparkles=function Sparkles(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_react_three_drei__WEBPACK_IMPORTED_MODULE_8__.P,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args))},Template=function Template(args){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args))},Static=Template.bind({});Static.args={modelSrc:(0,src_services__WEBPACK_IMPORTED_MODULE_1__.gT)("female.glb"),animationSrc:void 0,poseSrc:void 0,environment:"hub",scale:1,shadows:!0,idleRotation:!1,headMovement:!1,ambientLightColor:"#fff5b6",dirLightColor:"#002aff",spotLightColor:"#fff5b6",ambientLightIntensity:.25,dirLightIntensity:5,spotLightIntensity:1,dirLightPosition:new three__WEBPACK_IMPORTED_MODULE_9__.Vector3(-3,5,-5),spotLightPosition:new three__WEBPACK_IMPORTED_MODULE_9__.Vector3(12,10,7.5),spotLightAngle:.314,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},style:{background:"rgb(9,20,26)"},onLoaded:function onLoaded(){return console.info("EVENT: static avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading static avatar")}},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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_6__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args),{},{bloom:pulsatingBloom,effects:{ambientOcclusion:null==args?void 0:args.ambientOcclusion},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Sparkles,{color:"white",count:50,opacity:.9,scale:5,size:.5,speed:.35})}))};Showcase.args={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},style:{background:"#282038"},dpr:2,ambientLightColor:"#ffffff",dirLightColor:"#ffffff",spotLightColor:"#adbfe5",ambientLightIntensity:0,dirLightIntensity:2.2,spotLightIntensity:.5,environment:"apartment",shadows:!0,emotion:{jawOpen:.1,mouthSmileLeft:.2,mouthSmileRight:.1,mouthPressLeft:.1,cheekSquintLeft:.3,eyeLookOutLeft:.6,eyeLookInRight:.6,mouthDimpleLeft:.3},ambientOcclusion:!1},Showcase.argTypes=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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}},ambientLightColor:{table:{disable:!0}},dirLightColor:{table:{disable:!0}},spotLightColor:{table:{disable:!0}},ambientLightIntensity:{table:{disable:!0}},dirLightIntensity:{table:{disable:!0}},spotLightIntensity:{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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Static.args),{},{emotion:void 0,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,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:{control:!1},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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_6__.jsx)(src_components_FileDropper_FileDropper_component__WEBPACK_IMPORTED_MODULE_2__.s,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Avatar,(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},args))})}.bind({});_DragNDrop.args=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Static.args),{},{modelSrc:void 0,animationSrc:void 0,poseSrc:"",environment:"city",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:{ambientLightColor:{control:"color"},dirLightColor:{control:"color"},spotLightColor:{control:"color"},ambientLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},dirLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},spotLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},spotLightAngle:{control:{type:"range",min:0,max:10,step:.01}},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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Static.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Showcase.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},Animated.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},HalfBody.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},_DragNDrop.parameters),{},{docs:(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.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_7__.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={smile:{eyeSquintLeft:.4,eyeSquintRight:.2,mouthSmileLeft:.37,mouthSmileRight:.36,mouthShrugUpper:.27,browInnerUp:.3,browOuterUpLeft:.37,browOuterUpRight:.49}}}}]); \ No newline at end of file diff --git a/docs/471.0651b689.iframe.bundle.js b/docs/471.0651b689.iframe.bundle.js deleted file mode 100644 index f2cf6ab4..00000000 --- a/docs/471.0651b689.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[471],{"./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"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),OrbitControls=__webpack_require__("./node_modules/three-stdlib/controls/OrbitControls.js"),services=__webpack_require__("./src/services/index.ts"),progress=Number.POSITIVE_INFINITY,CameraLighting=function CameraLighting(_ref){var cameraTarget=_ref.cameraTarget,cameraInitialDistance=_ref.cameraInitialDistance,cameraZoomTarget=_ref.cameraZoomTarget,_ref$headScale=_ref.headScale,headScale=void 0===_ref$headScale?1:_ref$headScale,ambientLightColor=_ref.ambientLightColor,ambientLightIntensity=_ref.ambientLightIntensity,dirLightPosition=_ref.dirLightPosition,dirLightColor=_ref.dirLightColor,dirLightIntensity=_ref.dirLightIntensity,spotLightPosition=_ref.spotLightPosition,spotLightColor=_ref.spotLightColor,spotLightAngle=_ref.spotLightAngle,spotLightIntensity=_ref.spotLightIntensity,_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_673ef987_esm.z)(),camera=_useThree.camera,gl=_useThree.gl,scene=_useThree.scene,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,react.useEffect)((function(){if(scene.getObjectByName("back-highlight")){var _dirLight=scene.getObjectByName("back-highlight");_dirLight.color.set(dirLightColor),_dirLight.intensity=dirLightIntensity,_dirLight.position.set(dirLightPosition.x,dirLightPosition.y,dirLightPosition.z);var _ambientLight=scene.getObjectByName("ambient-light");_ambientLight.color.set(ambientLightColor),_ambientLight.intensity=ambientLightIntensity;var _spotLight=scene.getObjectByName("spot-light");_spotLight.color.set(spotLightColor),_spotLight.intensity=spotLightIntensity,_spotLight.angle=spotLightAngle,_spotLight.position.set(spotLightPosition.x,spotLightPosition.y,spotLightPosition.z)}else{var dirLight=new three_module.DirectionalLight(dirLightColor,dirLightIntensity);dirLight.name="back-highlight",dirLight.position.set(dirLightPosition.x,dirLightPosition.y,dirLightPosition.z),dirLight.castShadow=!0,dirLight.shadow.bias=-1e-4,dirLight.shadow.mapSize.height=1024,dirLight.shadow.mapSize.width=1024,dirLight.shadow.blurSamples=100;var ambientLight=new three_module.AmbientLight(ambientLightColor,ambientLightIntensity);ambientLight.name="ambient-light",ambientLight.position.set(0,0,0);var spotLight=new three_module.SpotLight(spotLightColor,spotLightIntensity,0,spotLightAngle,0,1);spotLight.name="spot-light",spotLight.position.set(spotLightPosition.x,spotLightPosition.y,spotLightPosition.z),camera.add(ambientLight),camera.add(spotLight),camera.add(dirLight),scene.add(camera)}}),[ambientLightColor,ambientLightIntensity,dirLightPosition,dirLightColor,dirLightIntensity,spotLightPosition,spotLightColor,spotLightIntensity,spotLightAngle,camera,scene]),(0,index_673ef987_esm.A)((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"),dist=__webpack_require__("./node_modules/@react-three/postprocessing/dist/index.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"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),Shadow=function Shadow(){return(0,jsx_runtime.jsx)("group",{position:[0,0,0],children:(0,jsx_runtime.jsxs)("mesh",{receiveShadow:!0,position:[0,0,0],"rotation-x":-Math.PI/2,children:[(0,jsx_runtime.jsx)("planeGeometry",{attach:"geometry",args:[5,5]}),(0,jsx_runtime.jsx)("shadowMaterial",{attach:"material",transparent:!0,opacity:.2})]},"shadow-catcher")})};Shadow.__docgenInfo={description:"",methods:[],displayName:"Shadow"};var Shadow_component=Shadow,Loader_module_loader="Loader_loader__DwtSp",Loader_module_dots="Loader_dots__2HwYS",Loader_module_dot="Loader_dot__8Tb8I",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,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)(dist.dp,{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"),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 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?"city":_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$ambientLightColo=_ref.ambientLightColor,ambientLightColor=void 0===_ref$ambientLightColo?"#fff5b6":_ref$ambientLightColo,_ref$ambientLightInte=_ref.ambientLightIntensity,ambientLightIntensity=void 0===_ref$ambientLightInte?.25:_ref$ambientLightInte,_ref$dirLightPosition=_ref.dirLightPosition,dirLightPosition=void 0===_ref$dirLightPosition?new three_module.Vector3(-3,5,-5):_ref$dirLightPosition,_ref$dirLightColor=_ref.dirLightColor,dirLightColor=void 0===_ref$dirLightColor?"#002aff":_ref$dirLightColor,_ref$dirLightIntensit=_ref.dirLightIntensity,dirLightIntensity=void 0===_ref$dirLightIntensit?5:_ref$dirLightIntensit,_ref$spotLightPositio=_ref.spotLightPosition,spotLightPosition=void 0===_ref$spotLightPositio?new three_module.Vector3(12,10,7.5):_ref$spotLightPositio,_ref$spotLightColor=_ref.spotLightColor,spotLightColor=void 0===_ref$spotLightColor?"#fff5b6":_ref$spotLightColor,_ref$spotLightAngle=_ref.spotLightAngle,spotLightAngle=void 0===_ref$spotLightAngle?.314:_ref$spotLightAngle,_ref$spotLightIntensi=_ref.spotLightIntensity,spotLightIntensity=void 0===_ref$spotLightIntensi?1:_ref$spotLightIntensi,_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,bloom=_ref.bloom,onLoadedEffect=_ref.onLoadedEffect,onLoadedAnimation=_ref.onLoadedAnimation,children=_ref.children,effects=_ref.effects,_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,{modelSrc:modelSrc,animationSrc:animationSrc,scale:scale,idleRotation:idleRotation,onLoaded:onLoaded,headMovement:headMovement,bloom:bloom}):halfBody?(0,jsx_runtime.jsx)(Models.T9,{emotion:emotion,modelSrc:modelSrc,scale:scale,idleRotation:idleRotation,onLoaded:onLoaded,headMovement:headMovement,bloom:bloom}):(0,services.w9)(poseSrc)?(0,jsx_runtime.jsx)(Models.dn,{emotion:emotion,modelSrc:modelSrc,scale:scale,poseSrc:poseSrc,onLoaded:onLoaded,bloom:bloom}):(0,jsx_runtime.jsx)(Models.Pn,{modelSrc:modelSrc,scale:scale,onLoaded:onLoaded,emotion:emotion,bloom:bloom}):null}),[halfBody,animationSrc,modelSrc,scale,poseSrc,idleRotation,emotion,onLoaded,headMovement,bloom]);return(0,react.useEffect)((function(){return(0,services.DK)(onLoading)}),[modelSrc,animationSrc,onLoading]),(0,jsx_runtime.jsxs)(BaseCanvas.u,{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}),(0,jsx_runtime.jsx)(CameraLighting,{cameraTarget:cameraTarget,cameraInitialDistance:cameraInitialDistance,cameraZoomTarget:cameraZoomTarget,ambientLightColor:ambientLightColor,ambientLightIntensity:ambientLightIntensity,dirLightPosition:dirLightPosition,dirLightColor:dirLightColor,dirLightIntensity:dirLightIntensity,spotLightPosition:spotLightPosition,spotLightColor:spotLightColor,spotLightAngle:spotLightAngle,spotLightIntensity:spotLightIntensity,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)(Shadow_component,{}),(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==style?void 0:style.background)&&(0,jsx_runtime.jsx)(Background.l,{color:style.background}),(0,jsx_runtime.jsxs)(dist.xC,{autoClear:!1,children:[(0,jsx_runtime.jsx)(Bloom_component,{luminanceThreshold:null==bloom?void 0:bloom.luminanceThreshold,luminanceSmoothing:null==bloom?void 0:bloom.luminanceSmoothing,intensity:null==bloom?void 0:bloom.intensity,kernelSize:null==bloom?void 0:bloom.kernelSize,mipmapBlur:null==bloom?void 0:bloom.mipmapBlur}),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(null==effects?void 0:effects.ambientOcclusion)&&(0,jsx_runtime.jsx)(dist.K,{blendFunction:build.YQ.MULTIPLY,distanceScaling:!1,radius:.09,bias:.02,intensity:3,samples:20,worldDistanceThreshold:24,worldDistanceFalloff:0,worldProximityThreshold:0,worldProximityFalloff:6})})]})]})},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."},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:"Applies Box background in the scene with a provided image.\nMake sure that image is loadable to prevent bg errors."},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."},bloom:{required:!1,tsType:{name:"BloomConfiguration"},description:"Bloom post-processing effect."},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/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,bloom=_ref.bloom,ref=(0,react.useRef)(null),_React$useState=react.useState(!0),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),animationRunning=_React$useState2[0],setAnimationRunning=_React$useState2[1],scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes,animationMixer=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){var mixer,animationClip,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(mixer=new three_module.AnimationMixer(nodes.Armature),!animationRunning){_context.next=3;break}return _context.abrupt("return",mixer);case 3:return _context.next=5,(0,Animation_service.$)(animationSrc);case 5:return animationClip=_context.sent,(animation=mixer.clipAction(animationClip)).fadeIn(.5),animation.play(),mixer.update(0),_context.abrupt("return",mixer);case 11:case"end":return _context.stop()}}),_callee)}))),[animationRunning,animationSrc,nodes.Armature]);return(0,index_673ef987_esm.A)(function(){var _ref3=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(state,delta){var _yield$animationMixer;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,animationMixer;case 2:if(_context2.t1=_yield$animationMixer=_context2.sent,_context2.t0=null===_context2.t1,_context2.t0){_context2.next=6;break}_context2.t0=void 0===_yield$animationMixer;case 6:if(!_context2.t0){_context2.next=10;break}_context2.next=11;break;case 10:_yield$animationMixer.update(delta);case 11:if(idleRotation){_context2.next=13;break}return _context2.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 _context2.stop()}}),_callee2)})));return function(_x,_x2){return _ref3.apply(this,arguments)}}()),(0,services.bx)({nodes:nodes,enabled:headMovement}),(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 diff --git a/docs/471.579730df.iframe.bundle.js b/docs/471.579730df.iframe.bundle.js new file mode 100644 index 00000000..201b8e6a --- /dev/null +++ b/docs/471.579730df.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[471],{"./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"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),OrbitControls=__webpack_require__("./node_modules/three-stdlib/controls/OrbitControls.js"),services=__webpack_require__("./src/services/index.ts"),progress=Number.POSITIVE_INFINITY,CameraLighting=function CameraLighting(_ref){var cameraTarget=_ref.cameraTarget,cameraInitialDistance=_ref.cameraInitialDistance,cameraZoomTarget=_ref.cameraZoomTarget,_ref$headScale=_ref.headScale,headScale=void 0===_ref$headScale?1:_ref$headScale,ambientLightColor=_ref.ambientLightColor,ambientLightIntensity=_ref.ambientLightIntensity,dirLightPosition=_ref.dirLightPosition,dirLightColor=_ref.dirLightColor,dirLightIntensity=_ref.dirLightIntensity,spotLightPosition=_ref.spotLightPosition,spotLightColor=_ref.spotLightColor,spotLightAngle=_ref.spotLightAngle,spotLightIntensity=_ref.spotLightIntensity,_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_673ef987_esm.z)(),camera=_useThree.camera,gl=_useThree.gl,scene=_useThree.scene,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,react.useEffect)((function(){if(scene.getObjectByName("back-highlight")){var _dirLight=scene.getObjectByName("back-highlight");_dirLight.color.set(dirLightColor),_dirLight.intensity=dirLightIntensity,_dirLight.position.set(dirLightPosition.x,dirLightPosition.y,dirLightPosition.z);var _ambientLight=scene.getObjectByName("ambient-light");_ambientLight.color.set(ambientLightColor),_ambientLight.intensity=ambientLightIntensity;var _spotLight=scene.getObjectByName("spot-light");_spotLight.color.set(spotLightColor),_spotLight.intensity=spotLightIntensity,_spotLight.angle=spotLightAngle,_spotLight.position.set(spotLightPosition.x,spotLightPosition.y,spotLightPosition.z)}else{var dirLight=new three_module.DirectionalLight(dirLightColor,dirLightIntensity);dirLight.name="back-highlight",dirLight.position.set(dirLightPosition.x,dirLightPosition.y,dirLightPosition.z),dirLight.castShadow=!0,dirLight.shadow.bias=-1e-4,dirLight.shadow.mapSize.height=1024,dirLight.shadow.mapSize.width=1024,dirLight.shadow.blurSamples=100;var ambientLight=new three_module.AmbientLight(ambientLightColor,ambientLightIntensity);ambientLight.name="ambient-light",ambientLight.position.set(0,0,0);var spotLight=new three_module.SpotLight(spotLightColor,spotLightIntensity,0,spotLightAngle,0,1);spotLight.name="spot-light",spotLight.position.set(spotLightPosition.x,spotLightPosition.y,spotLightPosition.z),camera.add(ambientLight),camera.add(spotLight),camera.add(dirLight),scene.add(camera)}}),[ambientLightColor,ambientLightIntensity,dirLightPosition,dirLightColor,dirLightIntensity,spotLightPosition,spotLightColor,spotLightIntensity,spotLightAngle,camera,scene]),(0,index_673ef987_esm.A)((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"),dist=__webpack_require__("./node_modules/@react-three/postprocessing/dist/index.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"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),Shadow=function Shadow(){return(0,jsx_runtime.jsx)("group",{position:[0,0,0],children:(0,jsx_runtime.jsxs)("mesh",{receiveShadow:!0,position:[0,0,0],"rotation-x":-Math.PI/2,children:[(0,jsx_runtime.jsx)("planeGeometry",{attach:"geometry",args:[5,5]}),(0,jsx_runtime.jsx)("shadowMaterial",{attach:"material",transparent:!0,opacity:.2})]},"shadow-catcher")})};Shadow.__docgenInfo={description:"",methods:[],displayName:"Shadow"};var Shadow_component=Shadow,Loader_module_loader="Loader_loader__DwtSp",Loader_module_dots="Loader_dots__2HwYS",Loader_module_dot="Loader_dot__8Tb8I",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,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)(dist.dp,{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"),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 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?"city":_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$ambientLightColo=_ref.ambientLightColor,ambientLightColor=void 0===_ref$ambientLightColo?"#fff5b6":_ref$ambientLightColo,_ref$ambientLightInte=_ref.ambientLightIntensity,ambientLightIntensity=void 0===_ref$ambientLightInte?.25:_ref$ambientLightInte,_ref$dirLightPosition=_ref.dirLightPosition,dirLightPosition=void 0===_ref$dirLightPosition?new three_module.Vector3(-3,5,-5):_ref$dirLightPosition,_ref$dirLightColor=_ref.dirLightColor,dirLightColor=void 0===_ref$dirLightColor?"#002aff":_ref$dirLightColor,_ref$dirLightIntensit=_ref.dirLightIntensity,dirLightIntensity=void 0===_ref$dirLightIntensit?5:_ref$dirLightIntensit,_ref$spotLightPositio=_ref.spotLightPosition,spotLightPosition=void 0===_ref$spotLightPositio?new three_module.Vector3(12,10,7.5):_ref$spotLightPositio,_ref$spotLightColor=_ref.spotLightColor,spotLightColor=void 0===_ref$spotLightColor?"#fff5b6":_ref$spotLightColor,_ref$spotLightAngle=_ref.spotLightAngle,spotLightAngle=void 0===_ref$spotLightAngle?.314:_ref$spotLightAngle,_ref$spotLightIntensi=_ref.spotLightIntensity,spotLightIntensity=void 0===_ref$spotLightIntensi?1:_ref$spotLightIntensi,_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,bloom=_ref.bloom,onLoadedEffect=_ref.onLoadedEffect,onLoadedAnimation=_ref.onLoadedAnimation,children=_ref.children,effects=_ref.effects,_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,{modelSrc:modelSrc,animationSrc:animationSrc,scale:scale,idleRotation:idleRotation,onLoaded:onLoaded,headMovement:headMovement,bloom:bloom}):halfBody?(0,jsx_runtime.jsx)(Models.T9,{emotion:emotion,modelSrc:modelSrc,scale:scale,idleRotation:idleRotation,onLoaded:onLoaded,headMovement:headMovement,bloom:bloom}):(0,services.w9)(poseSrc)?(0,jsx_runtime.jsx)(Models.dn,{emotion:emotion,modelSrc:modelSrc,scale:scale,poseSrc:poseSrc,onLoaded:onLoaded,bloom:bloom}):(0,jsx_runtime.jsx)(Models.Pn,{modelSrc:modelSrc,scale:scale,onLoaded:onLoaded,emotion:emotion,bloom:bloom}):null}),[halfBody,animationSrc,modelSrc,scale,poseSrc,idleRotation,emotion,onLoaded,headMovement,bloom]);return(0,react.useEffect)((function(){return(0,services.DK)(onLoading)}),[modelSrc,animationSrc,onLoading]),(0,jsx_runtime.jsxs)(BaseCanvas.u,{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}),(0,jsx_runtime.jsx)(CameraLighting,{cameraTarget:cameraTarget,cameraInitialDistance:cameraInitialDistance,cameraZoomTarget:cameraZoomTarget,ambientLightColor:ambientLightColor,ambientLightIntensity:ambientLightIntensity,dirLightPosition:dirLightPosition,dirLightColor:dirLightColor,dirLightIntensity:dirLightIntensity,spotLightPosition:spotLightPosition,spotLightColor:spotLightColor,spotLightAngle:spotLightAngle,spotLightIntensity:spotLightIntensity,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)(Shadow_component,{}),(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}),(0,jsx_runtime.jsxs)(dist.xC,{autoClear:!1,children:[(0,jsx_runtime.jsx)(Bloom_component,{luminanceThreshold:null==bloom?void 0:bloom.luminanceThreshold,luminanceSmoothing:null==bloom?void 0:bloom.luminanceSmoothing,intensity:null==bloom?void 0:bloom.intensity,kernelSize:null==bloom?void 0:bloom.kernelSize,mipmapBlur:null==bloom?void 0:bloom.mipmapBlur}),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(null==effects?void 0:effects.ambientOcclusion)&&(0,jsx_runtime.jsx)(dist.K,{blendFunction:build.YQ.MULTIPLY,distanceScaling:!1,radius:.09,bias:.02,intensity:3,samples:20,worldDistanceThreshold:24,worldDistanceFalloff:0,worldProximityThreshold:0,worldProximityFalloff:6})})]})]})},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."},bloom:{required:!1,tsType:{name:"BloomConfiguration"},description:"Bloom post-processing effect."},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/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,bloom=_ref.bloom,ref=(0,react.useRef)(null),_React$useState=react.useState(!0),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),animationRunning=_React$useState2[0],setAnimationRunning=_React$useState2[1],scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes,animationMixer=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){var mixer,animationClip,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(mixer=new three_module.AnimationMixer(nodes.Armature),!animationRunning){_context.next=3;break}return _context.abrupt("return",mixer);case 3:return _context.next=5,(0,Animation_service.$)(animationSrc);case 5:return animationClip=_context.sent,(animation=mixer.clipAction(animationClip)).fadeIn(.5),animation.play(),mixer.update(0),_context.abrupt("return",mixer);case 11:case"end":return _context.stop()}}),_callee)}))),[animationRunning,animationSrc,nodes.Armature]);return(0,index_673ef987_esm.A)(function(){var _ref3=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(state,delta){var _yield$animationMixer;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,animationMixer;case 2:if(_context2.t1=_yield$animationMixer=_context2.sent,_context2.t0=null===_context2.t1,_context2.t0){_context2.next=6;break}_context2.t0=void 0===_yield$animationMixer;case 6:if(!_context2.t0){_context2.next=10;break}_context2.next=11;break;case 10:_yield$animationMixer.update(delta);case 11:if(idleRotation){_context2.next=13;break}return _context2.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 _context2.stop()}}),_callee2)})));return function(_x,_x2){return _ref3.apply(this,arguments)}}()),(0,services.bx)({nodes:nodes,enabled:headMovement}),(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 diff --git a/docs/742.9e709736.iframe.bundle.js b/docs/742.9e709736.iframe.bundle.js deleted file mode 100644 index 6b5c7bb2..00000000 --- a/docs/742.9e709736.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[742],{"./src/components/Background/Box/Box.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{x:function(){return Box}});var _home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),three__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/three/build/three.module.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),_excluded=["src"],Box=function Box(_ref){var _ref$src=_ref.src,src=void 0===_ref$src?"":_ref$src,baseProps=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_2__.Z)(_ref,_excluded),ref=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),texture=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__.D)(three__WEBPACK_IMPORTED_MODULE_4__.TextureLoader,src);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("mesh",(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__.Z)({ref:ref,castShadow:!0,receiveShadow:!0},baseProps),{},{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("boxBufferGeometry",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("meshPhysicalMaterial",{map:texture})]}))};Box.__docgenInfo={description:"",methods:[],displayName:"Box",props:{src:{defaultValue:{value:"''",computed:!1},required:!1}}}},"./src/components/Background/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{l:function(){return BackgroundColor}});__webpack_require__("./node_modules/react/index.js");var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),BackgroundColor=function BackgroundColor(_ref){var color=_ref.color;return(0,jsx_runtime.jsx)("color",{attach:"background",args:[color]})};BackgroundColor.__docgenInfo={description:"",methods:[],displayName:"BackgroundColor"};__webpack_require__("./src/components/Background/Box/Box.component.tsx")},"./src/components/BaseCanvas/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{u:function(){return BaseCanvas}});var objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react_three_fiber_esm=(__webpack_require__("./node_modules/react/index.js"),__webpack_require__("./node_modules/@react-three/fiber/dist/react-three-fiber.esm.js")),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),BaseCanvas_module_base_canvas="BaseCanvas_base-canvas__7RHH3",jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),BaseCanvas=function BaseCanvas(_ref){var _ref$children=_ref.children,children=void 0===_ref$children?void 0:_ref$children,_ref$fov=_ref.fov,fov=void 0===_ref$fov?50:_ref$fov,_ref$position=_ref.position,position=void 0===_ref$position?new three_module.Vector3(0,0,5):_ref$position,style=_ref.style,_ref$dpr=_ref.dpr,dpr=void 0===_ref$dpr?[1,2]:_ref$dpr,className=_ref.className;return(0,jsx_runtime.jsx)(react_three_fiber_esm.Xz,{className:"".concat(BaseCanvas_module_base_canvas," ").concat(null!=className?className:""),shadows:"soft",gl:{preserveDrawingBuffer:!0,toneMappingExposure:.5},dpr:dpr,camera:{fov:fov,position:position},resize:{scroll:!0,debounce:{scroll:50,resize:0}},style:(0,objectSpread2.Z)((0,objectSpread2.Z)({},style),{},{background:"transparent"}),children:children},fov)};BaseCanvas.__docgenInfo={description:"",methods:[],displayName:"BaseCanvas",props:{children:{defaultValue:{value:"undefined",computed:!0},required:!1},fov:{defaultValue:{value:"50",computed:!1},required:!1},position:{defaultValue:{value:"new Vector3(0, 0, 5)",computed:!1},required:!1},dpr:{defaultValue:{value:"[1, 2]",computed:!1},required:!1}}}},"./src/components/Capture/Capture.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Capture=function Capture(_ref){var trigger=_ref.trigger,settings=_ref.settings,callBack=_ref.callBack,gl=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__.z)((function(state){return state.gl})),type=(null==settings?void 0:settings.type)||"image/png",quality=(null==settings?void 0:settings.quality)||.1;return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){if(trigger){var _capture=gl.domElement.toDataURL(type,quality);callBack(_capture)}}),[trigger]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{})};Capture.__docgenInfo={description:"",methods:[],displayName:"Capture"},__webpack_exports__.Z=Capture},"./src/components/Models/FloatingModel/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:function(){return FloatingModelContainer}});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"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),Model=__webpack_require__("./src/components/Models/Model/index.ts"),services=__webpack_require__("./src/services/index.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),FloatingModel=function FloatingModel(_ref){var modelSrc=_ref.modelSrc,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,onLoaded=_ref.onLoaded,bloom=_ref.bloom,ref=(0,react.useRef)(null),scene=(0,services.Jr)(modelSrc).scene;return(0,index_673ef987_esm.A)((function(state){var t=state.clock.getElapsedTime();null!=ref&&ref.current&&(ref.current.rotation.y=Math.sin(t/2)/8,ref.current.position.y=(1+Math.sin(t/1.5))/-9)})),(0,jsx_runtime.jsx)(Model.H,{modelRef:ref,scale:scale,scene:scene,onLoaded:onLoaded,bloom:bloom})};FloatingModel.__docgenInfo={description:"",methods:[],displayName:"FloatingModel",props:{scale:{defaultValue:{value:"1.0",computed:!1},required:!1}}};var FloatingModelContainer=function FloatingModelContainer(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)(FloatingModel,(0,objectSpread2.Z)((0,objectSpread2.Z)({},props),{},{setModelFallback:setFallback}))})};FloatingModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"FloatingModelContainer"}},"./src/components/Models/Model/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{H:function(){return Model}});var slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),react=__webpack_require__("./node_modules/react/index.js"),services=__webpack_require__("./src/services/index.ts"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),esm_react=__webpack_require__("./node_modules/jotai/esm/react.mjs"),regeneratorRuntime=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),Animation_service=__webpack_require__("./src/services/Animation.service.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),SpawnEffect=function SpawnEffect(_ref){var onLoadedEffect=_ref.onLoadedEffect,onLoadedEffectFinish=_ref.onLoadedEffectFinish,ref=(0,react.useRef)(null),_React$useState=react.useState(!0),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),effectRunning=_React$useState2[0],setEffectRunning=_React$useState2[1],mountEffectScene=(0,services.Jr)(onLoadedEffect.src).scene,mountEffectNode=(0,index_673ef987_esm.C)(mountEffectScene).nodes;(0,react.useEffect)((function(){effectRunning||(0,services.DK)(onLoadedEffectFinish)}),[onLoadedEffectFinish,effectRunning]);var spawnEffectMixer=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){var animationLoadedEffect,mixer,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,(0,Animation_service.$)((null==onLoadedEffect?void 0:onLoadedEffect.animationSrc)||onLoadedEffect.src);case 2:if(animationLoadedEffect=_context.sent,mixer=new three_module.AnimationMixer(mountEffectNode.Scene),animationLoadedEffect){_context.next=7;break}return setEffectRunning(!1),_context.abrupt("return",mixer);case 7:return(animation=mixer.clipAction(animationLoadedEffect)).setLoop(three_module.LoopRepeat,(null==onLoadedEffect?void 0:onLoadedEffect.loop)||1),animation.clampWhenFinished=!0,animation.play(),mixer.addEventListener("finished",(function(){animation.fadeOut(.5),setEffectRunning(!1)})),_context.abrupt("return",mixer);case 13:case"end":return _context.stop()}}),_callee)}))),[mountEffectNode.Scene,null==onLoadedEffect?void 0:onLoadedEffect.animationSrc,null==onLoadedEffect?void 0:onLoadedEffect.loop,onLoadedEffect.src]);return(0,index_673ef987_esm.A)(function(){var _ref3=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(state,delta){var _yield$spawnEffectMix;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,spawnEffectMixer;case 2:if(_context2.t1=_yield$spawnEffectMix=_context2.sent,_context2.t0=null===_context2.t1,_context2.t0){_context2.next=6;break}_context2.t0=void 0===_yield$spawnEffectMix;case 6:if(!_context2.t0){_context2.next=10;break}_context2.next=11;break;case 10:_yield$spawnEffectMix.update(delta);case 11:case"end":return _context2.stop()}}),_callee2)})));return function(_x,_x2){return _ref3.apply(this,arguments)}}()),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:effectRunning&&(0,jsx_runtime.jsx)("primitive",{modelRef:ref,object:mountEffectScene})})};SpawnEffect.__docgenInfo={description:"",methods:[],displayName:"SpawnEffect"};var SpawnAnimation=function SpawnAnimation(_ref){var avatar=_ref.avatar,onLoadedAnimationFinish=_ref.onLoadedAnimationFinish,onLoadedAnimation=_ref.onLoadedAnimation,_React$useState=react.useState(!0),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),animationRunning=_React$useState2[0],setAnimationRunning=_React$useState2[1];(0,react.useEffect)((function(){animationRunning||(0,services.DK)(onLoadedAnimationFinish)}),[onLoadedAnimationFinish,animationRunning]);var avatarNode=(0,index_673ef987_esm.C)(avatar).nodes,animationMixerAvatar=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){var mixer,animationClip,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(mixer=new three_module.AnimationMixer(avatarNode.Armature),avatarNode.Armature){_context.next=3;break}return _context.abrupt("return",mixer);case 3:return _context.next=5,(0,Animation_service.$)((null==onLoadedAnimation?void 0:onLoadedAnimation.src)||"");case 5:return animationClip=_context.sent,(animation=mixer.clipAction(animationClip)).setLoop(three_module.LoopRepeat,(null==onLoadedAnimation?void 0:onLoadedAnimation.loop)||1),animation.clampWhenFinished=!0,animation.play(),mixer.addEventListener("finished",(function(){animation.fadeOut(.5),setAnimationRunning(!1)})),_context.abrupt("return",mixer);case 12:case"end":return _context.stop()}}),_callee)}))),[avatarNode.Armature,null==onLoadedAnimation?void 0:onLoadedAnimation.loop,null==onLoadedAnimation?void 0:onLoadedAnimation.src]);return(0,index_673ef987_esm.A)(function(){var _ref3=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(state,delta){var _yield$animationMixer;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,animationMixerAvatar;case 2:if(_context2.t1=_yield$animationMixer=_context2.sent,_context2.t0=null===_context2.t1,_context2.t0){_context2.next=6;break}_context2.t0=void 0===_yield$animationMixer;case 6:if(!_context2.t0){_context2.next=10;break}_context2.next=11;break;case 10:_yield$animationMixer.update(delta);case 11:case"end":return _context2.stop()}}),_callee2)})));return function(_x,_x2){return _ref3.apply(this,arguments)}}()),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})};SpawnAnimation.__docgenInfo={description:"",methods:[],displayName:"SpawnAnimation"};var spawnAtom=__webpack_require__("./src/state/spawnAtom.ts"),Spawn=function Spawn(_ref){var _animationProps$onLoa,_animationProps$onLoa2,avatar=_ref.avatar,onSpawnFinish=_ref.onSpawnFinish,animationProps=(0,esm_react.Dv)(spawnAtom.O),usesMountEffect=(0,services.w9)(null==animationProps||null===(_animationProps$onLoa=animationProps.onLoadedEffect)||void 0===_animationProps$onLoa?void 0:_animationProps$onLoa.src),usesMountAnimation=(0,services.w9)(null==animationProps||null===(_animationProps$onLoa2=animationProps.onLoadedAnimation)||void 0===_animationProps$onLoa2?void 0:_animationProps$onLoa2.src),_React$useState=react.useState(usesMountEffect),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),effectRunning=_React$useState2[0],setEffectRunning=_React$useState2[1],_React$useState3=react.useState(usesMountAnimation),_React$useState4=(0,slicedToArray.Z)(_React$useState3,2),animationRunning=_React$useState4[0],setAnimationRunning=_React$useState4[1];(0,react.useEffect)((function(){animationRunning||effectRunning||(0,services.DK)(onSpawnFinish)}),[onSpawnFinish,effectRunning,animationRunning]);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[usesMountEffect&&(0,jsx_runtime.jsx)(SpawnEffect,{onLoadedEffect:animationProps.onLoadedEffect,onLoadedEffectFinish:function onLoadedEffectFinish(){setEffectRunning(!1)}}),usesMountAnimation&&(0,jsx_runtime.jsx)(SpawnAnimation,{onLoadedAnimation:animationProps.onLoadedAnimation,avatar:avatar,onLoadedAnimationFinish:function onLoadedAnimationFinish(){setAnimationRunning(!1)}})]})};Spawn.__docgenInfo={description:"",methods:[],displayName:"Spawn"};var Model=function Model(_ref){var scene=_ref.scene,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,modelRef=_ref.modelRef,onLoaded=_ref.onLoaded,onSpawnAnimationFinish=_ref.onSpawnAnimationFinish,bloom=_ref.bloom,materials=(0,index_673ef987_esm.C)(scene).materials,gl=(0,index_673ef987_esm.z)().gl,_useState=(0,react.useState)(!1),_useState2=(0,slicedToArray.Z)(_useState,2),isTouching=_useState2[0],setIsTouching=_useState2[1],_useState3=(0,react.useState)(null),_useState4=(0,slicedToArray.Z)(_useState3,2),touchEvent=_useState4[0],setTouchEvent=_useState4[1],setTouchingOn=function setTouchingOn(e){window.TouchEvent&&e instanceof TouchEvent&&setTouchEvent(e),setIsTouching(!0)},setTouchingOff=function setTouchingOff(e){window.TouchEvent&&e instanceof TouchEvent&&setTouchEvent(null),setIsTouching(!1)},onTouchMove=(0,react.useCallback)((function(event){if(isTouching&&event instanceof MouseEvent&&(scene.rotation.y+=.005*event.movementX),isTouching&&window.TouchEvent&&event instanceof TouchEvent){var movementX=Math.round(event.touches[0].pageX-touchEvent.touches[0].pageX);scene.rotation.y+=.005*movementX,setTouchEvent(event)}}),[isTouching,touchEvent]);(0,services.Zm)(materials,bloom),scene.traverse((function(object){var node=object;node.isMesh&&(node.castShadow=!0),"SkinnedMesh"===node.type&&(node.receiveShadow=!0)})),(0,react.useEffect)((function(){return(0,services.DK)(onLoaded)}),[scene,materials,onLoaded]),(0,react.useEffect)((function(){return gl.domElement.addEventListener("mousedown",setTouchingOn),gl.domElement.addEventListener("touchstart",setTouchingOn,{passive:!0}),gl.domElement.addEventListener("mouseup",setTouchingOff),gl.domElement.addEventListener("touchend",setTouchingOff),gl.domElement.addEventListener("touchcancel",setTouchingOff),gl.domElement.addEventListener("mousemove",onTouchMove),gl.domElement.addEventListener("touchmove",onTouchMove,{passive:!0}),function(){gl.domElement.removeEventListener("mousedown",setTouchingOn),gl.domElement.removeEventListener("touchstart",setTouchingOn),gl.domElement.removeEventListener("mouseup",setTouchingOff),gl.domElement.removeEventListener("touchend",setTouchingOff),gl.domElement.removeEventListener("touchcancel",setTouchingOff),gl.domElement.removeEventListener("mousemove",onTouchMove),gl.domElement.removeEventListener("touchmove",onTouchMove)}}));var spawnComponent=(0,react.useMemo)((function(){return(0,jsx_runtime.jsx)(Spawn,{avatar:scene,onSpawnFinish:onSpawnAnimationFinish})}),[onSpawnAnimationFinish]);return(0,jsx_runtime.jsxs)("group",{ref:modelRef,dispose:null,rotation:[0,0,0],children:[(0,jsx_runtime.jsx)("primitive",{object:scene,scale:scale}),spawnComponent]})};Model.__docgenInfo={description:"",methods:[],displayName:"Model",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}}},"./src/components/Models/StaticModel/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{P:function(){return StaticModelContainer}});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"),Model=__webpack_require__("./src/components/Models/Model/index.ts"),services=__webpack_require__("./src/services/index.ts"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),StaticModel=function StaticModel(_ref){var modelSrc=_ref.modelSrc,modelRef=_ref.modelRef,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,emotion=_ref.emotion,bloom=_ref.bloom,scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes;return(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})};StaticModel.__docgenInfo={description:"",methods:[],displayName:"StaticModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}};var StaticModelContainer=function StaticModelContainer(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)(StaticModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};StaticModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"StaticModelContainer"}},"./src/components/Scene/Environment.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:function(){return Environment}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_react_three_drei__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@react-three/drei/core/Environment.js"),src_services_Environment_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/services/Environment.service.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Environment=function Environment(_ref){var environment=_ref.environment,config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((function(){return{files:environment in src_services_Environment_service__WEBPACK_IMPORTED_MODULE_1__.s$?(0,src_services_Environment_service__WEBPACK_IMPORTED_MODULE_1__.G2)(environment):environment}}),[environment]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_react_three_drei__WEBPACK_IMPORTED_MODULE_3__.qA,{files:config.files})};Environment.__docgenInfo={description:"",methods:[],displayName:"Environment"}},"./src/services/Animation.service.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{$:function(){return loadAnimationClip}});var _home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),three_stdlib__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/three-stdlib/loaders/FBXLoader.js"),three_stdlib__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/three-stdlib/loaders/GLTFLoader.js");function normaliseFbxAnimation(fbx){for(var index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,tracks=fbx.animations[index].tracks,i=0;i0&&source.every(validateSource);if("string"==typeof source){var fileEndExpression=new RegExp(/(.glb|.fbx|.fbx[?].*|.glb[?].*)$/g),uploadFileExpression=new RegExp(/^data:application\/octet-stream;base64,/g),gltfModelExpression=new RegExp(/^data:model\/gltf-binary;base64,/g);return fileEndExpression.test(source)||uploadFileExpression.test(source)||gltfModelExpression.test(source)}return source instanceof Blob&&"model/gltf-binary"===source.type},isValidFormat=function isValidFormat(source){var isValid=validateSource(source);return source&&!isValid&&console.warn("Provided GLB/FBX is invalid. Check docs for supported formats: https://github.com/readyplayerme/visage"),isValid},clamp=function clamp(value,max,min){return Math.min(Math.max(min,value),max)},lerp=function lerp(start,end){var time=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.05;return start*(1-time)+end*time},normaliseMaterialsConfig=function normaliseMaterialsConfig(materials,bloomConfig){Object.values(materials).forEach((function(material){var mat=material;mat.map&&(mat.map.minFilter=three__WEBPACK_IMPORTED_MODULE_2__.LinearFilter,mat.depthWrite=!0,mat.toneMapped=!1),mat.emissiveMap&&(mat.emissiveIntensity=(null==bloomConfig?void 0:bloomConfig.materialIntensity)||3.3)}))},useHeadMovement=function useHeadMovement(_ref){var nodes=_ref.nodes,_ref$isHalfBody=_ref.isHalfBody,isHalfBody=void 0!==_ref$isHalfBody&&_ref$isHalfBody,_ref$distance=_ref.distance,distance=void 0===_ref$distance?2:_ref$distance,_ref$activeRotation=_ref.activeRotation,activeRotation=void 0===_ref$activeRotation?.2:_ref$activeRotation,_ref$rotationMargin=_ref.rotationMargin,rotationMargin=void 0===_ref$rotationMargin?new three__WEBPACK_IMPORTED_MODULE_2__.Vector2(5,10):_ref$rotationMargin,_ref$enabled=_ref.enabled,enabled=void 0!==_ref$enabled&&_ref$enabled,rad=Math.PI/180,currentPos=new three__WEBPACK_IMPORTED_MODULE_2__.Vector2(0,0),targetPos=new three__WEBPACK_IMPORTED_MODULE_2__.Vector2(0,0),activeDistance=distance-(isHalfBody?1:0),eyeRotationOffsetX=isHalfBody?90*rad:0,neckBoneRotationOffsetX=(isHalfBody?-5:10)*rad,mapRange=function mapRange(value,inMin,inMax,outMin,outMax){return(clamp(value,inMax,inMin)-inMin)*(outMax-outMin)/(inMax-inMin)+outMin};(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__.A)((function(state){if(enabled&&nodes.Neck&&nodes.Head&&nodes.RightEye&&nodes.LeftEye){var cameraToHeadDistance=state.camera.position.distanceTo(nodes.Head.position),cameraRotation=Math.abs(state.camera.rotation.z);cameraToHeadDistance1&&void 0!==arguments[1]?arguments[1]:new Transform;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("group",{children:Object.keys(nodes).map((function(key){var node=nodes[key];return"SkinnedMesh"===node.type?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("skinnedMesh",{castShadow:!0,receiveShadow:!0,scale:transform.scale,position:transform.position,rotation:transform.rotation,geometry:node.geometry,material:node.material,skeleton:node.skeleton,morphTargetInfluences:node.morphTargetInfluences||[]},node.name):"Mesh"===node.type?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("mesh",{castShadow:!0,receiveShadow:!0,scale:transform.scale,position:transform.position,rotation:transform.rotation,geometry:node.geometry,material:node.material,morphTargetInfluences:node.morphTargetInfluences||[]},node.name):null}))})}(nodes))}),[setter,nodes])},triggerCallback=function triggerCallback(callback){"function"==typeof callback&&callback()},expressions={blink:[{morphTarget:"eyesClosed",morphTargetIndex:-1,offset:0,duration:.2},{morphTarget:"eyeSquintLeft",morphTargetIndex:-1,offset:0,duration:.2},{morphTarget:"eyeSquintRight",morphTargetIndex:-1,offset:0,duration:.2}]},useIdleExpression=function useIdleExpression(expression,nodes){var headMesh=nodes.Wolf3D_Head||nodes.Wolf3D_Avatar,selectedExpression=expression in expressions?expressions[expression]:void 0,timeout=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),duration=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(Number.POSITIVE_INFINITY);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){if(null!=headMesh&&headMesh.morphTargetDictionary&&selectedExpression)for(var i=0;isection.offset){var pivot=(duration.current-section.offset)/section.duration*Math.PI,morphInfluence=Math.sin(pivot);headMesh.morphTargetInfluences[section.morphTargetIndex]=morphInfluence}}else headMesh.morphTargetInfluences[section.morphTargetIndex]=0}}}),[null==headMesh?void 0:headMesh.morphTargetInfluences,selectedExpression,duration.current,timeout.current]),setNextInterval=function setNextInterval(){duration.current=0;var delay=3e3*Math.random()+3e3;clearTimeout(timeout.current),timeout.current=setTimeout(setNextInterval,delay)};(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){return selectedExpression&&(timeout.current=setTimeout(setNextInterval,3e3)),function(){clearTimeout(timeout.current)}}),[selectedExpression]),(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__.A)((function(_,delta){headMesh&&selectedExpression&&animateExpression(delta)}))}},"./src/services/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{DK:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.DK},FB:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.FB},Jr:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.Jr},Kx:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.Kx},Zm:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.Zm},bu:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.bu},bx:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.bx},gT:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.gT},t7:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.t7},uZ:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.uZ},w9:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.w9},wx:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.wx},xD:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.xD}});var _Models_service__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/services/Models.service.tsx")},"./src/state/spawnAtom.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{O:function(){return spawnState}});var spawnState=(0,__webpack_require__("./node_modules/jotai/esm/vanilla.mjs").cn)({onLoadedEffect:null,onLoadedAnimation:null})}}]); \ No newline at end of file diff --git a/docs/742.c26d2c53.iframe.bundle.js b/docs/742.c26d2c53.iframe.bundle.js new file mode 100644 index 00000000..1e477b70 --- /dev/null +++ b/docs/742.c26d2c53.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[742],{"./src/components/Background/Box/Box.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{x:function(){return Box}});var _home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),three__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/three/build/three.module.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),_excluded=["src"],Box=function Box(_ref){var _ref$src=_ref.src,src=void 0===_ref$src?"":_ref$src,baseProps=(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_2__.Z)(_ref,_excluded),ref=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),texture=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__.D)(three__WEBPACK_IMPORTED_MODULE_4__.TextureLoader,src);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("mesh",(0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__.Z)((0,_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__.Z)({ref:ref,castShadow:!0,receiveShadow:!0},baseProps),{},{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("boxBufferGeometry",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("meshPhysicalMaterial",{map:texture})]}))};Box.__docgenInfo={description:"",methods:[],displayName:"Box",props:{src:{defaultValue:{value:"''",computed:!1},required:!1}}}},"./src/components/Background/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{l:function(){return BackgroundColor}});__webpack_require__("./node_modules/react/index.js");var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),BackgroundColor=function BackgroundColor(_ref){var color=_ref.color;return(0,jsx_runtime.jsx)("color",{attach:"background",args:[color]})};BackgroundColor.__docgenInfo={description:"",methods:[],displayName:"BackgroundColor"};__webpack_require__("./src/components/Background/Box/Box.component.tsx")},"./src/components/BaseCanvas/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{u:function(){return BaseCanvas}});var objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react_three_fiber_esm=(__webpack_require__("./node_modules/react/index.js"),__webpack_require__("./node_modules/@react-three/fiber/dist/react-three-fiber.esm.js")),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),BaseCanvas_module_base_canvas="BaseCanvas_base-canvas__7RHH3",jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),BaseCanvas=function BaseCanvas(_ref){var _ref$children=_ref.children,children=void 0===_ref$children?void 0:_ref$children,_ref$fov=_ref.fov,fov=void 0===_ref$fov?50:_ref$fov,_ref$position=_ref.position,position=void 0===_ref$position?new three_module.Vector3(0,0,5):_ref$position,style=_ref.style,_ref$dpr=_ref.dpr,dpr=void 0===_ref$dpr?[1,2]:_ref$dpr,className=_ref.className;return(0,jsx_runtime.jsx)(react_three_fiber_esm.Xz,{className:"".concat(BaseCanvas_module_base_canvas," ").concat(null!=className?className:""),shadows:"soft",gl:{preserveDrawingBuffer:!0,toneMappingExposure:.5,alpha:!0},dpr:dpr,camera:{fov:fov,position:position},resize:{scroll:!0,debounce:{scroll:50,resize:0}},style:(0,objectSpread2.Z)((0,objectSpread2.Z)({},style),{},{background:"transparent"}),children:children},fov)};BaseCanvas.__docgenInfo={description:"",methods:[],displayName:"BaseCanvas",props:{children:{defaultValue:{value:"undefined",computed:!0},required:!1},fov:{defaultValue:{value:"50",computed:!1},required:!1},position:{defaultValue:{value:"new Vector3(0, 0, 5)",computed:!1},required:!1},dpr:{defaultValue:{value:"[1, 2]",computed:!1},required:!1}}}},"./src/components/Capture/Capture.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Capture=function Capture(_ref){var trigger=_ref.trigger,settings=_ref.settings,callBack=_ref.callBack,gl=(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_2__.z)((function(state){return state.gl})),type=(null==settings?void 0:settings.type)||"image/png",quality=(null==settings?void 0:settings.quality)||.1;return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){if(trigger){var _capture=gl.domElement.toDataURL(type,quality);callBack(_capture)}}),[trigger]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{})};Capture.__docgenInfo={description:"",methods:[],displayName:"Capture"},__webpack_exports__.Z=Capture},"./src/components/Models/FloatingModel/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:function(){return FloatingModelContainer}});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"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),Model=__webpack_require__("./src/components/Models/Model/index.ts"),services=__webpack_require__("./src/services/index.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),FloatingModel=function FloatingModel(_ref){var modelSrc=_ref.modelSrc,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,onLoaded=_ref.onLoaded,bloom=_ref.bloom,ref=(0,react.useRef)(null),scene=(0,services.Jr)(modelSrc).scene;return(0,index_673ef987_esm.A)((function(state){var t=state.clock.getElapsedTime();null!=ref&&ref.current&&(ref.current.rotation.y=Math.sin(t/2)/8,ref.current.position.y=(1+Math.sin(t/1.5))/-9)})),(0,jsx_runtime.jsx)(Model.H,{modelRef:ref,scale:scale,scene:scene,onLoaded:onLoaded,bloom:bloom})};FloatingModel.__docgenInfo={description:"",methods:[],displayName:"FloatingModel",props:{scale:{defaultValue:{value:"1.0",computed:!1},required:!1}}};var FloatingModelContainer=function FloatingModelContainer(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)(FloatingModel,(0,objectSpread2.Z)((0,objectSpread2.Z)({},props),{},{setModelFallback:setFallback}))})};FloatingModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"FloatingModelContainer"}},"./src/components/Models/Model/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{H:function(){return Model}});var slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),react=__webpack_require__("./node_modules/react/index.js"),services=__webpack_require__("./src/services/index.ts"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),esm_react=__webpack_require__("./node_modules/jotai/esm/react.mjs"),regeneratorRuntime=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),three_module=__webpack_require__("./node_modules/three/build/three.module.js"),Animation_service=__webpack_require__("./src/services/Animation.service.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),SpawnEffect=function SpawnEffect(_ref){var onLoadedEffect=_ref.onLoadedEffect,onLoadedEffectFinish=_ref.onLoadedEffectFinish,ref=(0,react.useRef)(null),_React$useState=react.useState(!0),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),effectRunning=_React$useState2[0],setEffectRunning=_React$useState2[1],mountEffectScene=(0,services.Jr)(onLoadedEffect.src).scene,mountEffectNode=(0,index_673ef987_esm.C)(mountEffectScene).nodes;(0,react.useEffect)((function(){effectRunning||(0,services.DK)(onLoadedEffectFinish)}),[onLoadedEffectFinish,effectRunning]);var spawnEffectMixer=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){var animationLoadedEffect,mixer,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,(0,Animation_service.$)((null==onLoadedEffect?void 0:onLoadedEffect.animationSrc)||onLoadedEffect.src);case 2:if(animationLoadedEffect=_context.sent,mixer=new three_module.AnimationMixer(mountEffectNode.Scene),animationLoadedEffect){_context.next=7;break}return setEffectRunning(!1),_context.abrupt("return",mixer);case 7:return(animation=mixer.clipAction(animationLoadedEffect)).setLoop(three_module.LoopRepeat,(null==onLoadedEffect?void 0:onLoadedEffect.loop)||1),animation.clampWhenFinished=!0,animation.play(),mixer.addEventListener("finished",(function(){animation.fadeOut(.5),setEffectRunning(!1)})),_context.abrupt("return",mixer);case 13:case"end":return _context.stop()}}),_callee)}))),[mountEffectNode.Scene,null==onLoadedEffect?void 0:onLoadedEffect.animationSrc,null==onLoadedEffect?void 0:onLoadedEffect.loop,onLoadedEffect.src]);return(0,index_673ef987_esm.A)(function(){var _ref3=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(state,delta){var _yield$spawnEffectMix;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,spawnEffectMixer;case 2:if(_context2.t1=_yield$spawnEffectMix=_context2.sent,_context2.t0=null===_context2.t1,_context2.t0){_context2.next=6;break}_context2.t0=void 0===_yield$spawnEffectMix;case 6:if(!_context2.t0){_context2.next=10;break}_context2.next=11;break;case 10:_yield$spawnEffectMix.update(delta);case 11:case"end":return _context2.stop()}}),_callee2)})));return function(_x,_x2){return _ref3.apply(this,arguments)}}()),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:effectRunning&&(0,jsx_runtime.jsx)("primitive",{modelRef:ref,object:mountEffectScene})})};SpawnEffect.__docgenInfo={description:"",methods:[],displayName:"SpawnEffect"};var SpawnAnimation=function SpawnAnimation(_ref){var avatar=_ref.avatar,onLoadedAnimationFinish=_ref.onLoadedAnimationFinish,onLoadedAnimation=_ref.onLoadedAnimation,_React$useState=react.useState(!0),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),animationRunning=_React$useState2[0],setAnimationRunning=_React$useState2[1];(0,react.useEffect)((function(){animationRunning||(0,services.DK)(onLoadedAnimationFinish)}),[onLoadedAnimationFinish,animationRunning]);var avatarNode=(0,index_673ef987_esm.C)(avatar).nodes,animationMixerAvatar=(0,react.useMemo)((0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee(){var mixer,animationClip,animation;return(0,regeneratorRuntime.Z)().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(mixer=new three_module.AnimationMixer(avatarNode.Armature),avatarNode.Armature){_context.next=3;break}return _context.abrupt("return",mixer);case 3:return _context.next=5,(0,Animation_service.$)((null==onLoadedAnimation?void 0:onLoadedAnimation.src)||"");case 5:return animationClip=_context.sent,(animation=mixer.clipAction(animationClip)).setLoop(three_module.LoopRepeat,(null==onLoadedAnimation?void 0:onLoadedAnimation.loop)||1),animation.clampWhenFinished=!0,animation.play(),mixer.addEventListener("finished",(function(){animation.fadeOut(.5),setAnimationRunning(!1)})),_context.abrupt("return",mixer);case 12:case"end":return _context.stop()}}),_callee)}))),[avatarNode.Armature,null==onLoadedAnimation?void 0:onLoadedAnimation.loop,null==onLoadedAnimation?void 0:onLoadedAnimation.src]);return(0,index_673ef987_esm.A)(function(){var _ref3=(0,asyncToGenerator.Z)((0,regeneratorRuntime.Z)().mark((function _callee2(state,delta){var _yield$animationMixer;return(0,regeneratorRuntime.Z)().wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,animationMixerAvatar;case 2:if(_context2.t1=_yield$animationMixer=_context2.sent,_context2.t0=null===_context2.t1,_context2.t0){_context2.next=6;break}_context2.t0=void 0===_yield$animationMixer;case 6:if(!_context2.t0){_context2.next=10;break}_context2.next=11;break;case 10:_yield$animationMixer.update(delta);case 11:case"end":return _context2.stop()}}),_callee2)})));return function(_x,_x2){return _ref3.apply(this,arguments)}}()),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})};SpawnAnimation.__docgenInfo={description:"",methods:[],displayName:"SpawnAnimation"};var spawnAtom=__webpack_require__("./src/state/spawnAtom.ts"),Spawn=function Spawn(_ref){var _animationProps$onLoa,_animationProps$onLoa2,avatar=_ref.avatar,onSpawnFinish=_ref.onSpawnFinish,animationProps=(0,esm_react.Dv)(spawnAtom.O),usesMountEffect=(0,services.w9)(null==animationProps||null===(_animationProps$onLoa=animationProps.onLoadedEffect)||void 0===_animationProps$onLoa?void 0:_animationProps$onLoa.src),usesMountAnimation=(0,services.w9)(null==animationProps||null===(_animationProps$onLoa2=animationProps.onLoadedAnimation)||void 0===_animationProps$onLoa2?void 0:_animationProps$onLoa2.src),_React$useState=react.useState(usesMountEffect),_React$useState2=(0,slicedToArray.Z)(_React$useState,2),effectRunning=_React$useState2[0],setEffectRunning=_React$useState2[1],_React$useState3=react.useState(usesMountAnimation),_React$useState4=(0,slicedToArray.Z)(_React$useState3,2),animationRunning=_React$useState4[0],setAnimationRunning=_React$useState4[1];(0,react.useEffect)((function(){animationRunning||effectRunning||(0,services.DK)(onSpawnFinish)}),[onSpawnFinish,effectRunning,animationRunning]);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[usesMountEffect&&(0,jsx_runtime.jsx)(SpawnEffect,{onLoadedEffect:animationProps.onLoadedEffect,onLoadedEffectFinish:function onLoadedEffectFinish(){setEffectRunning(!1)}}),usesMountAnimation&&(0,jsx_runtime.jsx)(SpawnAnimation,{onLoadedAnimation:animationProps.onLoadedAnimation,avatar:avatar,onLoadedAnimationFinish:function onLoadedAnimationFinish(){setAnimationRunning(!1)}})]})};Spawn.__docgenInfo={description:"",methods:[],displayName:"Spawn"};var Model=function Model(_ref){var scene=_ref.scene,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,modelRef=_ref.modelRef,onLoaded=_ref.onLoaded,onSpawnAnimationFinish=_ref.onSpawnAnimationFinish,bloom=_ref.bloom,materials=(0,index_673ef987_esm.C)(scene).materials,gl=(0,index_673ef987_esm.z)().gl,_useState=(0,react.useState)(!1),_useState2=(0,slicedToArray.Z)(_useState,2),isTouching=_useState2[0],setIsTouching=_useState2[1],_useState3=(0,react.useState)(null),_useState4=(0,slicedToArray.Z)(_useState3,2),touchEvent=_useState4[0],setTouchEvent=_useState4[1],setTouchingOn=function setTouchingOn(e){window.TouchEvent&&e instanceof TouchEvent&&setTouchEvent(e),setIsTouching(!0)},setTouchingOff=function setTouchingOff(e){window.TouchEvent&&e instanceof TouchEvent&&setTouchEvent(null),setIsTouching(!1)},onTouchMove=(0,react.useCallback)((function(event){if(isTouching&&event instanceof MouseEvent&&(scene.rotation.y+=.005*event.movementX),isTouching&&window.TouchEvent&&event instanceof TouchEvent){var movementX=Math.round(event.touches[0].pageX-touchEvent.touches[0].pageX);scene.rotation.y+=.005*movementX,setTouchEvent(event)}}),[isTouching,touchEvent]);(0,services.Zm)(materials,bloom),scene.traverse((function(object){var node=object;node.isMesh&&(node.castShadow=!0),"SkinnedMesh"===node.type&&(node.receiveShadow=!0)})),(0,react.useEffect)((function(){return(0,services.DK)(onLoaded)}),[scene,materials,onLoaded]),(0,react.useEffect)((function(){return gl.domElement.addEventListener("mousedown",setTouchingOn),gl.domElement.addEventListener("touchstart",setTouchingOn,{passive:!0}),gl.domElement.addEventListener("mouseup",setTouchingOff),gl.domElement.addEventListener("touchend",setTouchingOff),gl.domElement.addEventListener("touchcancel",setTouchingOff),gl.domElement.addEventListener("mousemove",onTouchMove),gl.domElement.addEventListener("touchmove",onTouchMove,{passive:!0}),function(){gl.domElement.removeEventListener("mousedown",setTouchingOn),gl.domElement.removeEventListener("touchstart",setTouchingOn),gl.domElement.removeEventListener("mouseup",setTouchingOff),gl.domElement.removeEventListener("touchend",setTouchingOff),gl.domElement.removeEventListener("touchcancel",setTouchingOff),gl.domElement.removeEventListener("mousemove",onTouchMove),gl.domElement.removeEventListener("touchmove",onTouchMove)}}));var spawnComponent=(0,react.useMemo)((function(){return(0,jsx_runtime.jsx)(Spawn,{avatar:scene,onSpawnFinish:onSpawnAnimationFinish})}),[onSpawnAnimationFinish]);return(0,jsx_runtime.jsxs)("group",{ref:modelRef,dispose:null,rotation:[0,0,0],children:[(0,jsx_runtime.jsx)("primitive",{object:scene,scale:scale}),spawnComponent]})};Model.__docgenInfo={description:"",methods:[],displayName:"Model",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}}},"./src/components/Models/StaticModel/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{P:function(){return StaticModelContainer}});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"),Model=__webpack_require__("./src/components/Models/Model/index.ts"),services=__webpack_require__("./src/services/index.ts"),index_673ef987_esm=__webpack_require__("./node_modules/@react-three/fiber/dist/index-673ef987.esm.js"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),StaticModel=function StaticModel(_ref){var modelSrc=_ref.modelSrc,modelRef=_ref.modelRef,_ref$scale=_ref.scale,scale=void 0===_ref$scale?1:_ref$scale,setModelFallback=_ref.setModelFallback,onLoaded=_ref.onLoaded,emotion=_ref.emotion,bloom=_ref.bloom,scene=(0,services.Jr)(modelSrc).scene,nodes=(0,index_673ef987_esm.C)(scene).nodes;return(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})};StaticModel.__docgenInfo={description:"",methods:[],displayName:"StaticModel",props:{scale:{defaultValue:{value:"1",computed:!1},required:!1}}};var StaticModelContainer=function StaticModelContainer(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)(StaticModel,(0,objectSpread2.Z)({setModelFallback:setFallback},props))})};StaticModelContainer.__docgenInfo={description:"Contains model to handle suspense fallback.",methods:[],displayName:"StaticModelContainer"}},"./src/components/Scene/Environment.component.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:function(){return Environment}});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_react_three_drei__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@react-three/drei/core/Environment.js"),src_services_Environment_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/services/Environment.service.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js"),Environment=function Environment(_ref){var environment=_ref.environment,config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((function(){return{files:environment in src_services_Environment_service__WEBPACK_IMPORTED_MODULE_1__.s$?(0,src_services_Environment_service__WEBPACK_IMPORTED_MODULE_1__.G2)(environment):environment}}),[environment]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_react_three_drei__WEBPACK_IMPORTED_MODULE_3__.qA,{files:config.files})};Environment.__docgenInfo={description:"",methods:[],displayName:"Environment"}},"./src/services/Animation.service.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{$:function(){return loadAnimationClip}});var _home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),_home_runner_work_visage_visage_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),three_stdlib__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/three-stdlib/loaders/FBXLoader.js"),three_stdlib__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/three-stdlib/loaders/GLTFLoader.js");function normaliseFbxAnimation(fbx){for(var index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,tracks=fbx.animations[index].tracks,i=0;i0&&source.every(validateSource);if("string"==typeof source){var fileEndExpression=new RegExp(/(.glb|.fbx|.fbx[?].*|.glb[?].*)$/g),uploadFileExpression=new RegExp(/^data:application\/octet-stream;base64,/g),gltfModelExpression=new RegExp(/^data:model\/gltf-binary;base64,/g);return fileEndExpression.test(source)||uploadFileExpression.test(source)||gltfModelExpression.test(source)}return source instanceof Blob&&"model/gltf-binary"===source.type},isValidFormat=function isValidFormat(source){var isValid=validateSource(source);return source&&!isValid&&console.warn("Provided GLB/FBX is invalid. Check docs for supported formats: https://github.com/readyplayerme/visage"),isValid},clamp=function clamp(value,max,min){return Math.min(Math.max(min,value),max)},lerp=function lerp(start,end){var time=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.05;return start*(1-time)+end*time},normaliseMaterialsConfig=function normaliseMaterialsConfig(materials,bloomConfig){Object.values(materials).forEach((function(material){var mat=material;mat.map&&(mat.map.minFilter=three__WEBPACK_IMPORTED_MODULE_2__.LinearFilter,mat.depthWrite=!0,mat.toneMapped=!1),mat.emissiveMap&&(mat.emissiveIntensity=(null==bloomConfig?void 0:bloomConfig.materialIntensity)||3.3)}))},useHeadMovement=function useHeadMovement(_ref){var nodes=_ref.nodes,_ref$isHalfBody=_ref.isHalfBody,isHalfBody=void 0!==_ref$isHalfBody&&_ref$isHalfBody,_ref$distance=_ref.distance,distance=void 0===_ref$distance?2:_ref$distance,_ref$activeRotation=_ref.activeRotation,activeRotation=void 0===_ref$activeRotation?.2:_ref$activeRotation,_ref$rotationMargin=_ref.rotationMargin,rotationMargin=void 0===_ref$rotationMargin?new three__WEBPACK_IMPORTED_MODULE_2__.Vector2(5,10):_ref$rotationMargin,_ref$enabled=_ref.enabled,enabled=void 0!==_ref$enabled&&_ref$enabled,rad=Math.PI/180,currentPos=new three__WEBPACK_IMPORTED_MODULE_2__.Vector2(0,0),targetPos=new three__WEBPACK_IMPORTED_MODULE_2__.Vector2(0,0),activeDistance=distance-(isHalfBody?1:0),eyeRotationOffsetX=isHalfBody?90*rad:0,neckBoneRotationOffsetX=(isHalfBody?-5:10)*rad,mapRange=function mapRange(value,inMin,inMax,outMin,outMax){return(clamp(value,inMax,inMin)-inMin)*(outMax-outMin)/(inMax-inMin)+outMin};(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__.A)((function(state){if(enabled&&nodes.Neck&&nodes.Head&&nodes.RightEye&&nodes.LeftEye){var cameraToHeadDistance=state.camera.position.distanceTo(nodes.Head.position),cameraRotation=Math.abs(state.camera.rotation.z);cameraToHeadDistance1&&void 0!==arguments[1]?arguments[1]:new Transform;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("group",{children:Object.keys(nodes).map((function(key){var node=nodes[key];return"SkinnedMesh"===node.type?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("skinnedMesh",{castShadow:!0,receiveShadow:!0,scale:transform.scale,position:transform.position,rotation:transform.rotation,geometry:node.geometry,material:node.material,skeleton:node.skeleton,morphTargetInfluences:node.morphTargetInfluences||[]},node.name):"Mesh"===node.type?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("mesh",{castShadow:!0,receiveShadow:!0,scale:transform.scale,position:transform.position,rotation:transform.rotation,geometry:node.geometry,material:node.material,morphTargetInfluences:node.morphTargetInfluences||[]},node.name):null}))})}(nodes))}),[setter,nodes])},triggerCallback=function triggerCallback(callback){"function"==typeof callback&&callback()},expressions={blink:[{morphTarget:"eyesClosed",morphTargetIndex:-1,offset:0,duration:.2},{morphTarget:"eyeSquintLeft",morphTargetIndex:-1,offset:0,duration:.2},{morphTarget:"eyeSquintRight",morphTargetIndex:-1,offset:0,duration:.2}]},useIdleExpression=function useIdleExpression(expression,nodes){var headMesh=nodes.Wolf3D_Head||nodes.Wolf3D_Avatar,selectedExpression=expression in expressions?expressions[expression]:void 0,timeout=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),duration=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(Number.POSITIVE_INFINITY);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){if(null!=headMesh&&headMesh.morphTargetDictionary&&selectedExpression)for(var i=0;isection.offset){var pivot=(duration.current-section.offset)/section.duration*Math.PI,morphInfluence=Math.sin(pivot);headMesh.morphTargetInfluences[section.morphTargetIndex]=morphInfluence}}else headMesh.morphTargetInfluences[section.morphTargetIndex]=0}}}),[null==headMesh?void 0:headMesh.morphTargetInfluences,selectedExpression,duration.current,timeout.current]),setNextInterval=function setNextInterval(){duration.current=0;var delay=3e3*Math.random()+3e3;clearTimeout(timeout.current),timeout.current=setTimeout(setNextInterval,delay)};(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){return selectedExpression&&(timeout.current=setTimeout(setNextInterval,3e3)),function(){clearTimeout(timeout.current)}}),[selectedExpression]),(0,_react_three_fiber__WEBPACK_IMPORTED_MODULE_3__.A)((function(_,delta){headMesh&&selectedExpression&&animateExpression(delta)}))}},"./src/services/index.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{DK:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.DK},FB:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.FB},Jr:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.Jr},Kx:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.Kx},Zm:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.Zm},bu:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.bu},bx:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.bx},gT:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.gT},t7:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.t7},uZ:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.uZ},w9:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.w9},wx:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.wx},xD:function(){return _Models_service__WEBPACK_IMPORTED_MODULE_0__.xD}});var _Models_service__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/services/Models.service.tsx")},"./src/state/spawnAtom.ts":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{O:function(){return spawnState}});var spawnState=(0,__webpack_require__("./node_modules/jotai/esm/vanilla.mjs").cn)({onLoadedEffect:null,onLoadedAnimation:null})}}]); \ No newline at end of file diff --git a/docs/components-Avatar-Examples-stories.1bdf10d2.iframe.bundle.js b/docs/components-Avatar-Examples-stories.a6b07c71.iframe.bundle.js similarity index 99% rename from docs/components-Avatar-Examples-stories.1bdf10d2.iframe.bundle.js rename to docs/components-Avatar-Examples-stories.a6b07c71.iframe.bundle.js index 253a7f30..28f6cf8d 100644 --- a/docs/components-Avatar-Examples-stories.1bdf10d2.iframe.bundle.js +++ b/docs/components-Avatar-Examples-stories.a6b07c71.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[960,989],{"./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))}}},"./src/components/Avatar/Examples.stories.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Bloom:function(){return Bloom},FloatingSparkles:function(){return FloatingSparkles},IdleBlinking:function(){return IdleBlinking},Posing:function(){return Posing},ReflectiveFloor:function(){return ReflectiveFloor},SpawnEffectAndAnimation:function(){return SpawnEffectAndAnimation},__namedExportsOrder:function(){return __namedExportsOrder},default:function(){return Examples_stories},environmentModel:function(){return environmentModel}});var objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react=__webpack_require__("./node_modules/react/index.js"),core_Sparkles=__webpack_require__("./node_modules/@react-three/drei/core/Sparkles.js"),StatsGl=__webpack_require__("./node_modules/@react-three/drei/core/StatsGl.js"),components_Avatar=__webpack_require__("./src/components/Avatar/index.ts"),services=__webpack_require__("./src/services/index.ts"),Stories_service=__webpack_require__("./src/services/Stories.service.ts"),Environment_service=__webpack_require__("./src/services/Environment.service.ts"),Models=__webpack_require__("./src/components/Models/index.ts"),objectWithoutProperties=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.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");var react_merge_refs_esm=function mergeRefs(refs){return function(value){refs.forEach((function(ref){"function"==typeof ref?ref(value):null!=ref&&(ref.current=value)}))}};class ConvolutionMaterial extends three_module.ShaderMaterial{constructor(texelSize=new three_module.Vector2){super({uniforms:{inputBuffer:new three_module.Uniform(null),depthBuffer:new three_module.Uniform(null),resolution:new three_module.Uniform(new three_module.Vector2),texelSize:new three_module.Uniform(new three_module.Vector2),halfTexelSize:new three_module.Uniform(new three_module.Vector2),kernel:new three_module.Uniform(0),scale:new three_module.Uniform(1),cameraNear:new three_module.Uniform(0),cameraFar:new three_module.Uniform(1),minDepthThreshold:new three_module.Uniform(0),maxDepthThreshold:new three_module.Uniform(1),depthScale:new three_module.Uniform(0),depthToBlurRatioBias:new three_module.Uniform(.25)},fragmentShader:"#include \n #include \n uniform sampler2D inputBuffer;\n uniform sampler2D depthBuffer;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n float depthFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2D(depthBuffer, vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0, min(1.0, depthFactor + 0.25));\n #endif\n \n vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));\n gl_FragColor = sum * 0.25 ;\n\n #include \n #include \n #include \n }",vertexShader:"uniform vec2 texelSize;\n uniform vec2 halfTexelSize;\n uniform float kernel;\n uniform float scale;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n vUv = uv;\n\n vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;\n vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\n vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\n vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\n vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\n\n gl_Position = vec4(position.xy, 1.0, 1.0);\n }",blending:three_module.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(texelSize.x,texelSize.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(x,y){this.uniforms.texelSize.value.set(x,y),this.uniforms.halfTexelSize.value.set(x,y).multiplyScalar(.5)}setResolution(resolution){this.uniforms.resolution.value.copy(resolution)}}class BlurPass{constructor({gl:gl,resolution:resolution,width:width=500,height:height=500,minDepthThreshold:minDepthThreshold=0,maxDepthThreshold:maxDepthThreshold=1,depthScale:depthScale=0,depthToBlurRatioBias:depthToBlurRatioBias=.25}){this.renderToScreen=!1,this.renderTargetA=new three_module.WebGLRenderTarget(resolution,resolution,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,stencilBuffer:!1,depthBuffer:!1,type:three_module.HalfFloatType}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new ConvolutionMaterial,this.convolutionMaterial.setTexelSize(1/width,1/height),this.convolutionMaterial.setResolution(new three_module.Vector2(width,height)),this.scene=new three_module.Scene,this.camera=new three_module.Camera,this.convolutionMaterial.uniforms.minDepthThreshold.value=minDepthThreshold,this.convolutionMaterial.uniforms.maxDepthThreshold.value=maxDepthThreshold,this.convolutionMaterial.uniforms.depthScale.value=depthScale,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=depthToBlurRatioBias,this.convolutionMaterial.defines.USE_DEPTH=depthScale>0;const vertices=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),uvs=new Float32Array([0,0,2,0,0,2]),geometry=new three_module.BufferGeometry;geometry.setAttribute("position",new three_module.BufferAttribute(vertices,3)),geometry.setAttribute("uv",new three_module.BufferAttribute(uvs,2)),this.screen=new three_module.Mesh(geometry,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(renderer,inputBuffer,outputBuffer){const scene=this.scene,camera=this.camera,renderTargetA=this.renderTargetA,renderTargetB=this.renderTargetB;let material=this.convolutionMaterial,uniforms=material.uniforms;uniforms.depthBuffer.value=inputBuffer.depthTexture;const kernel=material.kernel;let destRT,i,l,lastRT=inputBuffer;for(i=0,l=kernel.length-1;i","#include \n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"),shader.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n\t\t\t uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv;\n ${shader.fragmentShader}`,shader.fragmentShader=shader.fragmentShader.replace("#include ","#include \n\n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n\n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n\n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n\n vec4 merge = base;\n\n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv * normalScale);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n\n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n\n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n\n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n\n #endif\n\n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n\n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n\n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n\n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(v){this._tDiffuse.value=v}get tDepth(){return this._tDepth.value}set tDepth(v){this._tDepth.value=v}get distortionMap(){return this._distortionMap.value}set distortionMap(v){this._distortionMap.value=v}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(v){this._tDiffuseBlur.value=v}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(v){this._textureMatrix.value=v}get hasBlur(){return this._hasBlur.value}set hasBlur(v){this._hasBlur.value=v}get mirror(){return this._mirror.value}set mirror(v){this._mirror.value=v}get mixBlur(){return this._mixBlur.value}set mixBlur(v){this._mixBlur.value=v}get mixStrength(){return this._blurStrength.value}set mixStrength(v){this._blurStrength.value=v}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(v){this._minDepthThreshold.value=v}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(v){this._maxDepthThreshold.value=v}get depthScale(){return this._depthScale.value}set depthScale(v){this._depthScale.value=v}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(v){this._depthToBlurRatioBias.value=v}get distortion(){return this._distortion.value}set distortion(v){this._distortion.value=v}get mixContrast(){return this._mixContrast.value}set mixContrast(v){this._mixContrast.value=v}}(0,index_673ef987_esm.e)({MeshReflectorMaterialImpl:MeshReflectorMaterial});const MeshReflectorMaterial_MeshReflectorMaterial=react.forwardRef((({mixBlur:mixBlur=0,mixStrength:mixStrength=1,resolution:resolution=256,blur:blur=[0,0],minDepthThreshold:minDepthThreshold=.9,maxDepthThreshold:maxDepthThreshold=1,depthScale:depthScale=0,depthToBlurRatioBias:depthToBlurRatioBias=.25,mirror:mirror=0,distortion:distortion=1,mixContrast:mixContrast=1,distortionMap:distortionMap,reflectorOffset:reflectorOffset=0,...props},ref)=>{const gl=(0,index_673ef987_esm.z)((({gl:gl})=>gl)),camera=(0,index_673ef987_esm.z)((({camera:camera})=>camera)),scene=(0,index_673ef987_esm.z)((({scene:scene})=>scene)),hasBlur=(blur=Array.isArray(blur)?blur:[blur,blur])[0]+blur[1]>0,materialRef=react.useRef(null),[reflectorPlane]=react.useState((()=>new three_module.Plane)),[normal]=react.useState((()=>new three_module.Vector3)),[reflectorWorldPosition]=react.useState((()=>new three_module.Vector3)),[cameraWorldPosition]=react.useState((()=>new three_module.Vector3)),[rotationMatrix]=react.useState((()=>new three_module.Matrix4)),[lookAtPosition]=react.useState((()=>new three_module.Vector3(0,0,-1))),[clipPlane]=react.useState((()=>new three_module.Vector4)),[view]=react.useState((()=>new three_module.Vector3)),[target]=react.useState((()=>new three_module.Vector3)),[q]=react.useState((()=>new three_module.Vector4)),[textureMatrix]=react.useState((()=>new three_module.Matrix4)),[virtualCamera]=react.useState((()=>new three_module.PerspectiveCamera)),beforeRender=react.useCallback((()=>{var _materialRef$current;const parent=materialRef.current.parent||(null==(_materialRef$current=materialRef.current)?void 0:_materialRef$current.__r3f.parent);if(!parent)return;if(reflectorWorldPosition.setFromMatrixPosition(parent.matrixWorld),cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld),rotationMatrix.extractRotation(parent.matrixWorld),normal.set(0,0,1),normal.applyMatrix4(rotationMatrix),reflectorWorldPosition.addScaledVector(normal,reflectorOffset),view.subVectors(reflectorWorldPosition,cameraWorldPosition),view.dot(normal)>0)return;view.reflect(normal).negate(),view.add(reflectorWorldPosition),rotationMatrix.extractRotation(camera.matrixWorld),lookAtPosition.set(0,0,-1),lookAtPosition.applyMatrix4(rotationMatrix),lookAtPosition.add(cameraWorldPosition),target.subVectors(reflectorWorldPosition,lookAtPosition),target.reflect(normal).negate(),target.add(reflectorWorldPosition),virtualCamera.position.copy(view),virtualCamera.up.set(0,1,0),virtualCamera.up.applyMatrix4(rotationMatrix),virtualCamera.up.reflect(normal),virtualCamera.lookAt(target),virtualCamera.far=camera.far,virtualCamera.updateMatrixWorld(),virtualCamera.projectionMatrix.copy(camera.projectionMatrix),textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),textureMatrix.multiply(virtualCamera.projectionMatrix),textureMatrix.multiply(virtualCamera.matrixWorldInverse),textureMatrix.multiply(parent.matrixWorld),reflectorPlane.setFromNormalAndCoplanarPoint(normal,reflectorWorldPosition),reflectorPlane.applyMatrix4(virtualCamera.matrixWorldInverse),clipPlane.set(reflectorPlane.normal.x,reflectorPlane.normal.y,reflectorPlane.normal.z,reflectorPlane.constant);const projectionMatrix=virtualCamera.projectionMatrix;q.x=(Math.sign(clipPlane.x)+projectionMatrix.elements[8])/projectionMatrix.elements[0],q.y=(Math.sign(clipPlane.y)+projectionMatrix.elements[9])/projectionMatrix.elements[5],q.z=-1,q.w=(1+projectionMatrix.elements[10])/projectionMatrix.elements[14],clipPlane.multiplyScalar(2/clipPlane.dot(q)),projectionMatrix.elements[2]=clipPlane.x,projectionMatrix.elements[6]=clipPlane.y,projectionMatrix.elements[10]=clipPlane.z+1,projectionMatrix.elements[14]=clipPlane.w}),[camera,reflectorOffset]),[fbo1,fbo2,blurpass,reflectorProps]=react.useMemo((()=>{const parameters={minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,type:three_module.HalfFloatType},fbo1=new three_module.WebGLRenderTarget(resolution,resolution,parameters);fbo1.depthBuffer=!0,fbo1.depthTexture=new three_module.DepthTexture(resolution,resolution),fbo1.depthTexture.format=three_module.DepthFormat,fbo1.depthTexture.type=three_module.UnsignedShortType;const fbo2=new three_module.WebGLRenderTarget(resolution,resolution,parameters);return[fbo1,fbo2,new BlurPass({gl:gl,resolution:resolution,width:blur[0],height:blur[1],minDepthThreshold:minDepthThreshold,maxDepthThreshold:maxDepthThreshold,depthScale:depthScale,depthToBlurRatioBias:depthToBlurRatioBias}),{mirror:mirror,textureMatrix:textureMatrix,mixBlur:mixBlur,tDiffuse:fbo1.texture,tDepth:fbo1.depthTexture,tDiffuseBlur:fbo2.texture,hasBlur:hasBlur,mixStrength:mixStrength,minDepthThreshold:minDepthThreshold,maxDepthThreshold:maxDepthThreshold,depthScale:depthScale,depthToBlurRatioBias:depthToBlurRatioBias,distortion:distortion,distortionMap:distortionMap,mixContrast:mixContrast,"defines-USE_BLUR":hasBlur?"":void 0,"defines-USE_DEPTH":depthScale>0?"":void 0,"defines-USE_DISTORTION":distortionMap?"":void 0}]}),[gl,blur,textureMatrix,resolution,mirror,hasBlur,mixBlur,mixStrength,minDepthThreshold,maxDepthThreshold,depthScale,depthToBlurRatioBias,distortion,distortionMap,mixContrast]);return(0,index_673ef987_esm.A)((()=>{var _materialRef$current2;const parent=materialRef.current.parent||(null==(_materialRef$current2=materialRef.current)?void 0:_materialRef$current2.__r3f.parent);if(!parent)return;parent.visible=!1;const currentXrEnabled=gl.xr.enabled,currentShadowAutoUpdate=gl.shadowMap.autoUpdate;beforeRender(),gl.xr.enabled=!1,gl.shadowMap.autoUpdate=!1,gl.setRenderTarget(fbo1),gl.state.buffers.depth.setMask(!0),gl.autoClear||gl.clear(),gl.render(scene,virtualCamera),hasBlur&&blurpass.render(gl,fbo1,fbo2),gl.xr.enabled=currentXrEnabled,gl.shadowMap.autoUpdate=currentShadowAutoUpdate,parent.visible=!0,gl.setRenderTarget(null)})),react.createElement("meshReflectorMaterialImpl",(0,esm_extends.Z)({attach:"material",key:"key"+reflectorProps["defines-USE_BLUR"]+reflectorProps["defines-USE_DEPTH"]+reflectorProps["defines-USE_DISTORTION"],ref:react_merge_refs_esm([materialRef,ref])},reflectorProps,props))}));var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),_excluded=["resolution","mixBlur","mixStrength","metalness","blur","mirror","minDepthThreshold","maxDepthThreshold","depthScale","depthToBlurRatioBias","distortion","mixContrast","reflectorOffset","roughness","color"],FloorReflection=function FloorReflection(_ref){var _ref$resolution=_ref.resolution,resolution=void 0===_ref$resolution?512:_ref$resolution,_ref$mixBlur=_ref.mixBlur,mixBlur=void 0===_ref$mixBlur?.8:_ref$mixBlur,_ref$mixStrength=_ref.mixStrength,mixStrength=void 0===_ref$mixStrength?80:_ref$mixStrength,_ref$metalness=_ref.metalness,metalness=void 0===_ref$metalness?.5:_ref$metalness,_ref$blur=_ref.blur,blur=void 0===_ref$blur?[300,200]:_ref$blur,_ref$mirror=_ref.mirror,mirror=void 0===_ref$mirror?1:_ref$mirror,_ref$minDepthThreshol=_ref.minDepthThreshold,minDepthThreshold=void 0===_ref$minDepthThreshol?.4:_ref$minDepthThreshol,_ref$maxDepthThreshol=_ref.maxDepthThreshold,maxDepthThreshold=void 0===_ref$maxDepthThreshol?1.4:_ref$maxDepthThreshol,_ref$depthScale=_ref.depthScale,depthScale=void 0===_ref$depthScale?1.2:_ref$depthScale,_ref$depthToBlurRatio=_ref.depthToBlurRatioBias,depthToBlurRatioBias=void 0===_ref$depthToBlurRatio?1:_ref$depthToBlurRatio,_ref$distortion=_ref.distortion,distortion=void 0===_ref$distortion?0:_ref$distortion,_ref$mixContrast=_ref.mixContrast,mixContrast=void 0===_ref$mixContrast?1:_ref$mixContrast,_ref$reflectorOffset=_ref.reflectorOffset,reflectorOffset=void 0===_ref$reflectorOffset?0:_ref$reflectorOffset,_ref$roughness=_ref.roughness,roughness=void 0===_ref$roughness?1:_ref$roughness,color=_ref.color,props=(0,objectWithoutProperties.Z)(_ref,_excluded);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("fog",{attach:"fog",args:[color,4,8]}),(0,jsx_runtime.jsx)("group",{position:[0,0,0],children:(0,jsx_runtime.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],children:[(0,jsx_runtime.jsx)("planeGeometry",{args:[20,10]}),(0,jsx_runtime.jsx)(MeshReflectorMaterial_MeshReflectorMaterial,(0,objectSpread2.Z)({resolution:resolution,mixBlur:mixBlur,mixStrength:mixStrength,metalness:metalness,blur:blur,mirror:mirror,minDepthThreshold:minDepthThreshold,maxDepthThreshold:maxDepthThreshold,depthScale:depthScale,depthToBlurRatioBias:depthToBlurRatioBias,distortion:distortion,mixContrast:mixContrast,reflectorOffset:reflectorOffset,roughness:roughness,color:color,envMapIntensity:0},props))]})})]})};FloorReflection.__docgenInfo={description:"",methods:[],displayName:"FloorReflection",props:{resolution:{defaultValue:{value:"512",computed:!1},required:!1},mixBlur:{defaultValue:{value:"0.8",computed:!1},required:!1},mixStrength:{defaultValue:{value:"80",computed:!1},required:!1},metalness:{defaultValue:{value:"0.5",computed:!1},required:!1},blur:{defaultValue:{value:"[300, 200]",computed:!1},required:!1},mirror:{defaultValue:{value:"1",computed:!1},required:!1},minDepthThreshold:{defaultValue:{value:"0.4",computed:!1},required:!1},maxDepthThreshold:{defaultValue:{value:"1.4",computed:!1},required:!1},depthScale:{defaultValue:{value:"1.2",computed:!1},required:!1},depthToBlurRatioBias:{defaultValue:{value:"1",computed:!1},required:!1},distortion:{defaultValue:{value:"0",computed:!1},required:!1},mixContrast:{defaultValue:{value:"1",computed:!1},required:!1},reflectorOffset:{defaultValue:{value:"0",computed:!1},required:!1},roughness:{defaultValue:{value:"1",computed:!1},required:!1}}};var _Bloom$parameters,_Bloom$parameters2,_Bloom$parameters2$do,_FloatingSparkles$par,_FloatingSparkles$par2,_FloatingSparkles$par3,_SpawnEffectAndAnimat,_SpawnEffectAndAnimat2,_SpawnEffectAndAnimat3,_Posing$parameters,_Posing$parameters2,_Posing$parameters2$d,_IdleBlinking$paramet,_IdleBlinking$paramet2,_IdleBlinking$paramet3,_environmentModel$par,_environmentModel$par2,_environmentModel$par3,_ReflectiveFloor$para,_ReflectiveFloor$para2,_ReflectiveFloor$para3,Avatar_stories=__webpack_require__("./src/components/Avatar/Avatar.stories.tsx"),Avatar=function Avatar(args){return(0,jsx_runtime.jsx)(components_Avatar.q,(0,objectSpread2.Z)({},args))},Sparkles=function Sparkles(args){return(0,jsx_runtime.jsx)(core_Sparkles.P,(0,objectSpread2.Z)({},args))},EnvironmentModel=function EnvironmentModel(args){return(0,jsx_runtime.jsx)(Models.R8,(0,objectSpread2.Z)({},args))},Examples_stories={component:Avatar,subcomponents:{Sparkles:Sparkles,EnvironmentModel:EnvironmentModel}},Bloom=function Bloom(args){return(0,jsx_runtime.jsx)(Avatar,{modelSrc:Stories_service.HI.one,cameraTarget:components_Avatar.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,bloom:(0,objectSpread2.Z)({},args),ambientLightColor:"#ffffff",dirLightColor:"#ffffff",spotLightColor:"#adbfe5",ambientLightIntensity:0,dirLightIntensity:2.2,spotLightIntensity:.5,environment:"apartment",style:{background:"rgb(9,20,26)"}})};Bloom.args={luminanceThreshold:1,luminanceSmoothing:1,mipmapBlur:!0,kernelSize:1,intensity:4,materialIntensity:1},Bloom.argTypes=(0,objectSpread2.Z)({luminanceThreshold:{control:{type:"range",step:.01,min:0,max:1}},luminanceSmoothing:{control:{type:"range",step:.01,min:0,max:1}},mipmapBlur:{control:{type:"boolean"}},intensity:{control:{type:"range",min:0,max:100}},materialIntensity:{control:{type:"range",step:.01,min:0,max:1}},kernelSize:{control:{type:"range",min:0,max:4}}},Stories_service.nx);var FloatingSparkles=function FloatingSparkles(args){return(0,jsx_runtime.jsx)(Avatar,{modelSrc:(0,services.gT)("female.glb"),cameraTarget:components_Avatar.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,children:(0,jsx_runtime.jsx)(Sparkles,(0,objectSpread2.Z)({},args))})};FloatingSparkles.args={count:70,scale:4,size:5,speed:.25,opacity:.6,color:"#124cca"},FloatingSparkles.argTypes=(0,objectSpread2.Z)({count:{control:{type:"range",min:0,max:70}},scale:{control:{type:"number"}},size:{control:{type:"range",min:0,max:10}},speed:{control:{type:"range",step:.01,min:0,max:20}},opacity:{control:{type:"range",step:.01,min:0,max:1.1}}},Stories_service.nx);var SpawnEffectAndAnimation=function SpawnEffectAndAnimation(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)((0,objectSpread2.Z)({},args),{},{children:(0,jsx_runtime.jsx)(Sparkles,{color:"white",count:50,opacity:.9,scale:5,size:.5,speed:.35})}))};SpawnEffectAndAnimation.args={onLoadedEffect:{src:(0,services.gT)("spawn-effect.glb"),loop:12},onLoadedAnimation:{src:(0,services.gT)("male-spawn-animation.fbx"),loop:1},cameraTarget:components_Avatar.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,modelSrc:(0,services.gT)("male-emissive.glb"),animationSrc:(0,services.gT)("male-idle.glb"),style:{background:"rgb(9,20,26)"}},SpawnEffectAndAnimation.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{onLoadedEffect:{control:{disable:!1}},onLoadedAnimation:{control:{disable:!1}},modelSrc:{control:{disable:!1}},animationSrc:{control:{disable:!1}}});var Posing=function Posing(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)({},args))};Posing.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Avatar_stories.Static.args),{},{modelSrc:(0,services.gT)("male.glb"),poseSrc:(0,services.gT)("male-pose-standing.glb"),cameraTarget:components_Avatar.b.TARGET.FULL_BODY.MALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,onLoaded:function onLoaded(){return console.info("EVENT: posing avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading posing avatar")},emotion:Stories_service.eE.smile}),Posing.argTypes={headMovement:{control:!1}};var IdleBlinking=function IdleBlinking(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)({},args))};IdleBlinking.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({Comment:"Idle blinking works when avatar includes morph targets for 'ARKit' and 'Eyes Extra'."},Avatar_stories.Static.args),{},{modelSrc:Stories_service.HI.seven,animationSrc:Stories_service.jb.three,cameraTarget:components_Avatar.b.TARGET.FULL_BODY.MALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,headMovement:!0,emotion:Stories_service.eE.smile}),IdleBlinking.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{modelSrc:{options:Object.values({seven:Stories_service.HI.seven}),control:{type:"select"}},animationSrc:{options:Object.values(Stories_service.jb),control:{type:"select"}}});var environmentModel=function environmentModel(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)((0,objectSpread2.Z)({},args),{},{effects:{ambientOcclusion:!0},children:(0,jsx_runtime.jsx)(EnvironmentModel,{environment:args.environmentModel,scale:args.environmentScale})}))};environmentModel.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({environmentModel:"spaceStation"},Avatar_stories.Static.args),{},{fov:50,environmentScale:1,shadows:!0,modelSrc:Stories_service.HI.one,animationSrc:Stories_service.jb.one,environment:"warehouse",onLoaded:function onLoaded(){return console.info("EVENT: environment model loaded")}}),environmentModel.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{onLoading:{table:{disable:!0}},dirLightPosition:{table:{disable:!0}},spotLightPosition:{table:{disable:!0}},scale:{table:{disable:!0}},environmentModel:{options:Object.keys(Environment_service.om),control:{type:"select"}},fov:{control:{type:"range",min:30,max:100,step:1}},environmentScale:{control:{type:"range",min:.01,max:10,step:.01}},ambientLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},dirLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},spotLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},environment:{options:Object.keys(Environment_service.s$),control:{type:"select"}}});var ReflectiveFloor=function ReflectiveFloor(args){return(0,jsx_runtime.jsxs)(Avatar,(0,objectSpread2.Z)((0,objectSpread2.Z)({},args),{},{effects:{ambientOcclusion:!0},style:{background:args.color},children:[(0,jsx_runtime.jsx)(FloorReflection,(0,objectSpread2.Z)({},args)),(null==args?void 0:args.debug)&&(0,jsx_runtime.jsx)(StatsGl.G,{})]}))};ReflectiveFloor.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Avatar_stories.Static.args),{},{fov:50,shadows:!1,modelSrc:Stories_service.HI.one,animationSrc:Stories_service.jb.three,environment:"warehouse",onLoaded:function onLoaded(){return console.info("EVENT: environment model loaded")},resolution:512,mixBlur:.8,mixStrength:80,metalness:.5,blur:[300,200],mirror:1,minDepthThreshold:.4,maxDepthThreshold:1.4,depthScale:1.2,depthToBlurRatioBias:1,distortion:0,mixContrast:1,reflectorOffset:0,roughness:1,color:"rgb(9,20,26)",debug:!1}),ReflectiveFloor.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{fov:{control:{type:"range",min:30,max:100,step:1}},environment:{options:Object.keys(Environment_service.s$),control:{type:"select"}},resolution:{control:{type:"range",min:64,max:2048,step:64}},mixBlur:{control:{type:"range",min:0,max:10,step:.1}},mixStrength:{control:{type:"range",min:0,max:100,step:1}},metalness:{control:{type:"range",min:0,max:1,step:.01}},mirror:{control:{type:"range",min:0,max:1,step:1}},minDepthThreshold:{control:{type:"range",min:0,max:10,step:.01}},maxDepthThreshold:{control:{type:"range",min:0,max:10,step:.01}},depthScale:{control:{type:"range",min:0,max:20,step:.01}},depthToBlurRatioBias:{control:{type:"range",min:0,max:1,step:.01}},distortion:{control:{type:"range",min:0,max:1,step:.01}},mixContrast:{control:{type:"range",min:0,max:1,step:.01}},reflectorOffset:{control:{type:"range",min:0,max:1,step:.01}},roughness:{control:{type:"range",min:0,max:1,step:.01}}}),Bloom.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Bloom.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_Bloom$parameters=Bloom.parameters)||void 0===_Bloom$parameters?void 0:_Bloom$parameters.docs),{},{source:(0,objectSpread2.Z)({originalSource:'(args: BloomConfiguration | undefined) => '},null===(_Bloom$parameters2=Bloom.parameters)||void 0===_Bloom$parameters2||null===(_Bloom$parameters2$do=_Bloom$parameters2.docs)||void 0===_Bloom$parameters2$do?void 0:_Bloom$parameters2$do.source)})}),FloatingSparkles.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},FloatingSparkles.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_FloatingSparkles$par=FloatingSparkles.parameters)||void 0===_FloatingSparkles$par?void 0:_FloatingSparkles$par.docs),{},{source:(0,objectSpread2.Z)({originalSource:"args => \n \n "},null===(_FloatingSparkles$par2=FloatingSparkles.parameters)||void 0===_FloatingSparkles$par2||null===(_FloatingSparkles$par3=_FloatingSparkles$par2.docs)||void 0===_FloatingSparkles$par3?void 0:_FloatingSparkles$par3.source)})}),SpawnEffectAndAnimation.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},SpawnEffectAndAnimation.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_SpawnEffectAndAnimat=SpawnEffectAndAnimation.parameters)||void 0===_SpawnEffectAndAnimat?void 0:_SpawnEffectAndAnimat.docs),{},{source:(0,objectSpread2.Z)({originalSource:'args => \n \n '},null===(_SpawnEffectAndAnimat2=SpawnEffectAndAnimation.parameters)||void 0===_SpawnEffectAndAnimat2||null===(_SpawnEffectAndAnimat3=_SpawnEffectAndAnimat2.docs)||void 0===_SpawnEffectAndAnimat3?void 0:_SpawnEffectAndAnimat3.source)})}),Posing.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Posing.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_Posing$parameters=Posing.parameters)||void 0===_Posing$parameters?void 0:_Posing$parameters.docs),{},{source:(0,objectSpread2.Z)({originalSource:"args => "},null===(_Posing$parameters2=Posing.parameters)||void 0===_Posing$parameters2||null===(_Posing$parameters2$d=_Posing$parameters2.docs)||void 0===_Posing$parameters2$d?void 0:_Posing$parameters2$d.source)})}),IdleBlinking.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},IdleBlinking.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_IdleBlinking$paramet=IdleBlinking.parameters)||void 0===_IdleBlinking$paramet?void 0:_IdleBlinking$paramet.docs),{},{source:(0,objectSpread2.Z)({originalSource:"args => "},null===(_IdleBlinking$paramet2=IdleBlinking.parameters)||void 0===_IdleBlinking$paramet2||null===(_IdleBlinking$paramet3=_IdleBlinking$paramet2.docs)||void 0===_IdleBlinking$paramet3?void 0:_IdleBlinking$paramet3.source)})}),environmentModel.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},environmentModel.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_environmentModel$par=environmentModel.parameters)||void 0===_environmentModel$par?void 0:_environmentModel$par.docs),{},{source:(0,objectSpread2.Z)({originalSource:"(args: AvatarProps & {\n environmentModel: string;\n environmentScale: number;\n}) => \n \n "},null===(_environmentModel$par2=environmentModel.parameters)||void 0===_environmentModel$par2||null===(_environmentModel$par3=_environmentModel$par2.docs)||void 0===_environmentModel$par3?void 0:_environmentModel$par3.source)})}),ReflectiveFloor.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},ReflectiveFloor.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_ReflectiveFloor$para=ReflectiveFloor.parameters)||void 0===_ReflectiveFloor$para?void 0:_ReflectiveFloor$para.docs),{},{source:(0,objectSpread2.Z)({originalSource:"(args: AvatarProps & FloorReflectionProps & {\n debug: boolean;\n}) => \n \n {args?.debug && }\n "},null===(_ReflectiveFloor$para2=ReflectiveFloor.parameters)||void 0===_ReflectiveFloor$para2||null===(_ReflectiveFloor$para3=_ReflectiveFloor$para2.docs)||void 0===_ReflectiveFloor$para3?void 0:_ReflectiveFloor$para3.source)})});var __namedExportsOrder=["Bloom","FloatingSparkles","SpawnEffectAndAnimation","Posing","IdleBlinking","environmentModel","ReflectiveFloor"];Bloom.__docgenInfo={description:"",methods:[],displayName:"Bloom"},FloatingSparkles.__docgenInfo={description:"",methods:[],displayName:"FloatingSparkles"},SpawnEffectAndAnimation.__docgenInfo={description:"",methods:[],displayName:"SpawnEffectAndAnimation"},Posing.__docgenInfo={description:"",methods:[],displayName:"Posing"},IdleBlinking.__docgenInfo={description:"",methods:[],displayName:"IdleBlinking"},environmentModel.__docgenInfo={description:"",methods:[],displayName:"environmentModel",props:{environmentModel:{required:!0,tsType:{name:"string"},description:""},environmentScale:{required:!0,tsType:{name:"number"},description:""}}},ReflectiveFloor.__docgenInfo={description:"",methods:[],displayName:"ReflectiveFloor",props:{debug:{required:!0,tsType:{name:"boolean"},description:""}}}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_readyplayerme_visage=self.webpackChunk_readyplayerme_visage||[]).push([[960,989],{"./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))}}},"./src/components/Avatar/Examples.stories.tsx":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Bloom:function(){return Bloom},FloatingSparkles:function(){return FloatingSparkles},IdleBlinking:function(){return IdleBlinking},Posing:function(){return Posing},ReflectiveFloor:function(){return ReflectiveFloor},SpawnEffectAndAnimation:function(){return SpawnEffectAndAnimation},__namedExportsOrder:function(){return __namedExportsOrder},default:function(){return Examples_stories},environmentModel:function(){return environmentModel}});var objectSpread2=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),react=__webpack_require__("./node_modules/react/index.js"),core_Sparkles=__webpack_require__("./node_modules/@react-three/drei/core/Sparkles.js"),StatsGl=__webpack_require__("./node_modules/@react-three/drei/core/StatsGl.js"),components_Avatar=__webpack_require__("./src/components/Avatar/index.ts"),services=__webpack_require__("./src/services/index.ts"),Stories_service=__webpack_require__("./src/services/Stories.service.ts"),Environment_service=__webpack_require__("./src/services/Environment.service.ts"),Models=__webpack_require__("./src/components/Models/index.ts"),objectWithoutProperties=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),esm_extends=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.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");var react_merge_refs_esm=function mergeRefs(refs){return function(value){refs.forEach((function(ref){"function"==typeof ref?ref(value):null!=ref&&(ref.current=value)}))}};class ConvolutionMaterial extends three_module.ShaderMaterial{constructor(texelSize=new three_module.Vector2){super({uniforms:{inputBuffer:new three_module.Uniform(null),depthBuffer:new three_module.Uniform(null),resolution:new three_module.Uniform(new three_module.Vector2),texelSize:new three_module.Uniform(new three_module.Vector2),halfTexelSize:new three_module.Uniform(new three_module.Vector2),kernel:new three_module.Uniform(0),scale:new three_module.Uniform(1),cameraNear:new three_module.Uniform(0),cameraFar:new three_module.Uniform(1),minDepthThreshold:new three_module.Uniform(0),maxDepthThreshold:new three_module.Uniform(1),depthScale:new three_module.Uniform(0),depthToBlurRatioBias:new three_module.Uniform(.25)},fragmentShader:"#include \n #include \n uniform sampler2D inputBuffer;\n uniform sampler2D depthBuffer;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n float depthFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2D(depthBuffer, vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0, min(1.0, depthFactor + 0.25));\n #endif\n \n vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));\n gl_FragColor = sum * 0.25 ;\n\n #include \n #include \n #include \n }",vertexShader:"uniform vec2 texelSize;\n uniform vec2 halfTexelSize;\n uniform float kernel;\n uniform float scale;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n vUv = uv;\n\n vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;\n vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\n vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\n vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\n vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\n\n gl_Position = vec4(position.xy, 1.0, 1.0);\n }",blending:three_module.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(texelSize.x,texelSize.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(x,y){this.uniforms.texelSize.value.set(x,y),this.uniforms.halfTexelSize.value.set(x,y).multiplyScalar(.5)}setResolution(resolution){this.uniforms.resolution.value.copy(resolution)}}class BlurPass{constructor({gl:gl,resolution:resolution,width:width=500,height:height=500,minDepthThreshold:minDepthThreshold=0,maxDepthThreshold:maxDepthThreshold=1,depthScale:depthScale=0,depthToBlurRatioBias:depthToBlurRatioBias=.25}){this.renderToScreen=!1,this.renderTargetA=new three_module.WebGLRenderTarget(resolution,resolution,{minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,stencilBuffer:!1,depthBuffer:!1,type:three_module.HalfFloatType}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new ConvolutionMaterial,this.convolutionMaterial.setTexelSize(1/width,1/height),this.convolutionMaterial.setResolution(new three_module.Vector2(width,height)),this.scene=new three_module.Scene,this.camera=new three_module.Camera,this.convolutionMaterial.uniforms.minDepthThreshold.value=minDepthThreshold,this.convolutionMaterial.uniforms.maxDepthThreshold.value=maxDepthThreshold,this.convolutionMaterial.uniforms.depthScale.value=depthScale,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=depthToBlurRatioBias,this.convolutionMaterial.defines.USE_DEPTH=depthScale>0;const vertices=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),uvs=new Float32Array([0,0,2,0,0,2]),geometry=new three_module.BufferGeometry;geometry.setAttribute("position",new three_module.BufferAttribute(vertices,3)),geometry.setAttribute("uv",new three_module.BufferAttribute(uvs,2)),this.screen=new three_module.Mesh(geometry,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(renderer,inputBuffer,outputBuffer){const scene=this.scene,camera=this.camera,renderTargetA=this.renderTargetA,renderTargetB=this.renderTargetB;let material=this.convolutionMaterial,uniforms=material.uniforms;uniforms.depthBuffer.value=inputBuffer.depthTexture;const kernel=material.kernel;let destRT,i,l,lastRT=inputBuffer;for(i=0,l=kernel.length-1;i","#include \n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"),shader.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n\t\t\t uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv;\n ${shader.fragmentShader}`,shader.fragmentShader=shader.fragmentShader.replace("#include ","#include \n\n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n\n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n\n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n\n vec4 merge = base;\n\n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv * normalScale);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n\n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n\n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n\n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n\n #endif\n\n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n\n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n\n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n\n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(v){this._tDiffuse.value=v}get tDepth(){return this._tDepth.value}set tDepth(v){this._tDepth.value=v}get distortionMap(){return this._distortionMap.value}set distortionMap(v){this._distortionMap.value=v}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(v){this._tDiffuseBlur.value=v}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(v){this._textureMatrix.value=v}get hasBlur(){return this._hasBlur.value}set hasBlur(v){this._hasBlur.value=v}get mirror(){return this._mirror.value}set mirror(v){this._mirror.value=v}get mixBlur(){return this._mixBlur.value}set mixBlur(v){this._mixBlur.value=v}get mixStrength(){return this._blurStrength.value}set mixStrength(v){this._blurStrength.value=v}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(v){this._minDepthThreshold.value=v}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(v){this._maxDepthThreshold.value=v}get depthScale(){return this._depthScale.value}set depthScale(v){this._depthScale.value=v}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(v){this._depthToBlurRatioBias.value=v}get distortion(){return this._distortion.value}set distortion(v){this._distortion.value=v}get mixContrast(){return this._mixContrast.value}set mixContrast(v){this._mixContrast.value=v}}(0,index_673ef987_esm.e)({MeshReflectorMaterialImpl:MeshReflectorMaterial});const MeshReflectorMaterial_MeshReflectorMaterial=react.forwardRef((({mixBlur:mixBlur=0,mixStrength:mixStrength=1,resolution:resolution=256,blur:blur=[0,0],minDepthThreshold:minDepthThreshold=.9,maxDepthThreshold:maxDepthThreshold=1,depthScale:depthScale=0,depthToBlurRatioBias:depthToBlurRatioBias=.25,mirror:mirror=0,distortion:distortion=1,mixContrast:mixContrast=1,distortionMap:distortionMap,reflectorOffset:reflectorOffset=0,...props},ref)=>{const gl=(0,index_673ef987_esm.z)((({gl:gl})=>gl)),camera=(0,index_673ef987_esm.z)((({camera:camera})=>camera)),scene=(0,index_673ef987_esm.z)((({scene:scene})=>scene)),hasBlur=(blur=Array.isArray(blur)?blur:[blur,blur])[0]+blur[1]>0,materialRef=react.useRef(null),[reflectorPlane]=react.useState((()=>new three_module.Plane)),[normal]=react.useState((()=>new three_module.Vector3)),[reflectorWorldPosition]=react.useState((()=>new three_module.Vector3)),[cameraWorldPosition]=react.useState((()=>new three_module.Vector3)),[rotationMatrix]=react.useState((()=>new three_module.Matrix4)),[lookAtPosition]=react.useState((()=>new three_module.Vector3(0,0,-1))),[clipPlane]=react.useState((()=>new three_module.Vector4)),[view]=react.useState((()=>new three_module.Vector3)),[target]=react.useState((()=>new three_module.Vector3)),[q]=react.useState((()=>new three_module.Vector4)),[textureMatrix]=react.useState((()=>new three_module.Matrix4)),[virtualCamera]=react.useState((()=>new three_module.PerspectiveCamera)),beforeRender=react.useCallback((()=>{var _materialRef$current;const parent=materialRef.current.parent||(null==(_materialRef$current=materialRef.current)?void 0:_materialRef$current.__r3f.parent);if(!parent)return;if(reflectorWorldPosition.setFromMatrixPosition(parent.matrixWorld),cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld),rotationMatrix.extractRotation(parent.matrixWorld),normal.set(0,0,1),normal.applyMatrix4(rotationMatrix),reflectorWorldPosition.addScaledVector(normal,reflectorOffset),view.subVectors(reflectorWorldPosition,cameraWorldPosition),view.dot(normal)>0)return;view.reflect(normal).negate(),view.add(reflectorWorldPosition),rotationMatrix.extractRotation(camera.matrixWorld),lookAtPosition.set(0,0,-1),lookAtPosition.applyMatrix4(rotationMatrix),lookAtPosition.add(cameraWorldPosition),target.subVectors(reflectorWorldPosition,lookAtPosition),target.reflect(normal).negate(),target.add(reflectorWorldPosition),virtualCamera.position.copy(view),virtualCamera.up.set(0,1,0),virtualCamera.up.applyMatrix4(rotationMatrix),virtualCamera.up.reflect(normal),virtualCamera.lookAt(target),virtualCamera.far=camera.far,virtualCamera.updateMatrixWorld(),virtualCamera.projectionMatrix.copy(camera.projectionMatrix),textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),textureMatrix.multiply(virtualCamera.projectionMatrix),textureMatrix.multiply(virtualCamera.matrixWorldInverse),textureMatrix.multiply(parent.matrixWorld),reflectorPlane.setFromNormalAndCoplanarPoint(normal,reflectorWorldPosition),reflectorPlane.applyMatrix4(virtualCamera.matrixWorldInverse),clipPlane.set(reflectorPlane.normal.x,reflectorPlane.normal.y,reflectorPlane.normal.z,reflectorPlane.constant);const projectionMatrix=virtualCamera.projectionMatrix;q.x=(Math.sign(clipPlane.x)+projectionMatrix.elements[8])/projectionMatrix.elements[0],q.y=(Math.sign(clipPlane.y)+projectionMatrix.elements[9])/projectionMatrix.elements[5],q.z=-1,q.w=(1+projectionMatrix.elements[10])/projectionMatrix.elements[14],clipPlane.multiplyScalar(2/clipPlane.dot(q)),projectionMatrix.elements[2]=clipPlane.x,projectionMatrix.elements[6]=clipPlane.y,projectionMatrix.elements[10]=clipPlane.z+1,projectionMatrix.elements[14]=clipPlane.w}),[camera,reflectorOffset]),[fbo1,fbo2,blurpass,reflectorProps]=react.useMemo((()=>{const parameters={minFilter:three_module.LinearFilter,magFilter:three_module.LinearFilter,type:three_module.HalfFloatType},fbo1=new three_module.WebGLRenderTarget(resolution,resolution,parameters);fbo1.depthBuffer=!0,fbo1.depthTexture=new three_module.DepthTexture(resolution,resolution),fbo1.depthTexture.format=three_module.DepthFormat,fbo1.depthTexture.type=three_module.UnsignedShortType;const fbo2=new three_module.WebGLRenderTarget(resolution,resolution,parameters);return[fbo1,fbo2,new BlurPass({gl:gl,resolution:resolution,width:blur[0],height:blur[1],minDepthThreshold:minDepthThreshold,maxDepthThreshold:maxDepthThreshold,depthScale:depthScale,depthToBlurRatioBias:depthToBlurRatioBias}),{mirror:mirror,textureMatrix:textureMatrix,mixBlur:mixBlur,tDiffuse:fbo1.texture,tDepth:fbo1.depthTexture,tDiffuseBlur:fbo2.texture,hasBlur:hasBlur,mixStrength:mixStrength,minDepthThreshold:minDepthThreshold,maxDepthThreshold:maxDepthThreshold,depthScale:depthScale,depthToBlurRatioBias:depthToBlurRatioBias,distortion:distortion,distortionMap:distortionMap,mixContrast:mixContrast,"defines-USE_BLUR":hasBlur?"":void 0,"defines-USE_DEPTH":depthScale>0?"":void 0,"defines-USE_DISTORTION":distortionMap?"":void 0}]}),[gl,blur,textureMatrix,resolution,mirror,hasBlur,mixBlur,mixStrength,minDepthThreshold,maxDepthThreshold,depthScale,depthToBlurRatioBias,distortion,distortionMap,mixContrast]);return(0,index_673ef987_esm.A)((()=>{var _materialRef$current2;const parent=materialRef.current.parent||(null==(_materialRef$current2=materialRef.current)?void 0:_materialRef$current2.__r3f.parent);if(!parent)return;parent.visible=!1;const currentXrEnabled=gl.xr.enabled,currentShadowAutoUpdate=gl.shadowMap.autoUpdate;beforeRender(),gl.xr.enabled=!1,gl.shadowMap.autoUpdate=!1,gl.setRenderTarget(fbo1),gl.state.buffers.depth.setMask(!0),gl.autoClear||gl.clear(),gl.render(scene,virtualCamera),hasBlur&&blurpass.render(gl,fbo1,fbo2),gl.xr.enabled=currentXrEnabled,gl.shadowMap.autoUpdate=currentShadowAutoUpdate,parent.visible=!0,gl.setRenderTarget(null)})),react.createElement("meshReflectorMaterialImpl",(0,esm_extends.Z)({attach:"material",key:"key"+reflectorProps["defines-USE_BLUR"]+reflectorProps["defines-USE_DEPTH"]+reflectorProps["defines-USE_DISTORTION"],ref:react_merge_refs_esm([materialRef,ref])},reflectorProps,props))}));var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),_excluded=["resolution","mixBlur","mixStrength","metalness","blur","mirror","minDepthThreshold","maxDepthThreshold","depthScale","depthToBlurRatioBias","distortion","mixContrast","reflectorOffset","roughness","color"],FloorReflection=function FloorReflection(_ref){var _ref$resolution=_ref.resolution,resolution=void 0===_ref$resolution?512:_ref$resolution,_ref$mixBlur=_ref.mixBlur,mixBlur=void 0===_ref$mixBlur?.8:_ref$mixBlur,_ref$mixStrength=_ref.mixStrength,mixStrength=void 0===_ref$mixStrength?80:_ref$mixStrength,_ref$metalness=_ref.metalness,metalness=void 0===_ref$metalness?.5:_ref$metalness,_ref$blur=_ref.blur,blur=void 0===_ref$blur?[300,200]:_ref$blur,_ref$mirror=_ref.mirror,mirror=void 0===_ref$mirror?1:_ref$mirror,_ref$minDepthThreshol=_ref.minDepthThreshold,minDepthThreshold=void 0===_ref$minDepthThreshol?.4:_ref$minDepthThreshol,_ref$maxDepthThreshol=_ref.maxDepthThreshold,maxDepthThreshold=void 0===_ref$maxDepthThreshol?1.4:_ref$maxDepthThreshol,_ref$depthScale=_ref.depthScale,depthScale=void 0===_ref$depthScale?1.2:_ref$depthScale,_ref$depthToBlurRatio=_ref.depthToBlurRatioBias,depthToBlurRatioBias=void 0===_ref$depthToBlurRatio?1:_ref$depthToBlurRatio,_ref$distortion=_ref.distortion,distortion=void 0===_ref$distortion?0:_ref$distortion,_ref$mixContrast=_ref.mixContrast,mixContrast=void 0===_ref$mixContrast?1:_ref$mixContrast,_ref$reflectorOffset=_ref.reflectorOffset,reflectorOffset=void 0===_ref$reflectorOffset?0:_ref$reflectorOffset,_ref$roughness=_ref.roughness,roughness=void 0===_ref$roughness?1:_ref$roughness,color=_ref.color,props=(0,objectWithoutProperties.Z)(_ref,_excluded);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("fog",{attach:"fog",args:[color,4,8]}),(0,jsx_runtime.jsx)("group",{position:[0,0,0],children:(0,jsx_runtime.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],children:[(0,jsx_runtime.jsx)("planeGeometry",{args:[20,10]}),(0,jsx_runtime.jsx)(MeshReflectorMaterial_MeshReflectorMaterial,(0,objectSpread2.Z)({resolution:resolution,mixBlur:mixBlur,mixStrength:mixStrength,metalness:metalness,blur:blur,mirror:mirror,minDepthThreshold:minDepthThreshold,maxDepthThreshold:maxDepthThreshold,depthScale:depthScale,depthToBlurRatioBias:depthToBlurRatioBias,distortion:distortion,mixContrast:mixContrast,reflectorOffset:reflectorOffset,roughness:roughness,color:color,envMapIntensity:0},props))]})})]})};FloorReflection.__docgenInfo={description:"",methods:[],displayName:"FloorReflection",props:{resolution:{defaultValue:{value:"512",computed:!1},required:!1},mixBlur:{defaultValue:{value:"0.8",computed:!1},required:!1},mixStrength:{defaultValue:{value:"80",computed:!1},required:!1},metalness:{defaultValue:{value:"0.5",computed:!1},required:!1},blur:{defaultValue:{value:"[300, 200]",computed:!1},required:!1},mirror:{defaultValue:{value:"1",computed:!1},required:!1},minDepthThreshold:{defaultValue:{value:"0.4",computed:!1},required:!1},maxDepthThreshold:{defaultValue:{value:"1.4",computed:!1},required:!1},depthScale:{defaultValue:{value:"1.2",computed:!1},required:!1},depthToBlurRatioBias:{defaultValue:{value:"1",computed:!1},required:!1},distortion:{defaultValue:{value:"0",computed:!1},required:!1},mixContrast:{defaultValue:{value:"1",computed:!1},required:!1},reflectorOffset:{defaultValue:{value:"0",computed:!1},required:!1},roughness:{defaultValue:{value:"1",computed:!1},required:!1}}};var _Bloom$parameters,_Bloom$parameters2,_Bloom$parameters2$do,_FloatingSparkles$par,_FloatingSparkles$par2,_FloatingSparkles$par3,_SpawnEffectAndAnimat,_SpawnEffectAndAnimat2,_SpawnEffectAndAnimat3,_Posing$parameters,_Posing$parameters2,_Posing$parameters2$d,_IdleBlinking$paramet,_IdleBlinking$paramet2,_IdleBlinking$paramet3,_environmentModel$par,_environmentModel$par2,_environmentModel$par3,_ReflectiveFloor$para,_ReflectiveFloor$para2,_ReflectiveFloor$para3,Avatar_stories=__webpack_require__("./src/components/Avatar/Avatar.stories.tsx"),Avatar=function Avatar(args){return(0,jsx_runtime.jsx)(components_Avatar.q,(0,objectSpread2.Z)({},args))},Sparkles=function Sparkles(args){return(0,jsx_runtime.jsx)(core_Sparkles.P,(0,objectSpread2.Z)({},args))},EnvironmentModel=function EnvironmentModel(args){return(0,jsx_runtime.jsx)(Models.R8,(0,objectSpread2.Z)({},args))},Examples_stories={component:Avatar,subcomponents:{Sparkles:Sparkles,EnvironmentModel:EnvironmentModel}},Bloom=function Bloom(args){return(0,jsx_runtime.jsx)(Avatar,{modelSrc:Stories_service.HI.one,cameraTarget:components_Avatar.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,bloom:(0,objectSpread2.Z)({},args),ambientLightColor:"#ffffff",dirLightColor:"#ffffff",spotLightColor:"#adbfe5",ambientLightIntensity:0,dirLightIntensity:2.2,spotLightIntensity:.5,environment:"apartment",background:{color:"rgb(9,20,26)"}})};Bloom.args={luminanceThreshold:1,luminanceSmoothing:1,mipmapBlur:!0,kernelSize:1,intensity:4,materialIntensity:1},Bloom.argTypes=(0,objectSpread2.Z)({luminanceThreshold:{control:{type:"range",step:.01,min:0,max:1}},luminanceSmoothing:{control:{type:"range",step:.01,min:0,max:1}},mipmapBlur:{control:{type:"boolean"}},intensity:{control:{type:"range",min:0,max:100}},materialIntensity:{control:{type:"range",step:.01,min:0,max:1}},kernelSize:{control:{type:"range",min:0,max:4}}},Stories_service.nx);var FloatingSparkles=function FloatingSparkles(args){return(0,jsx_runtime.jsx)(Avatar,{modelSrc:(0,services.gT)("female.glb"),cameraTarget:components_Avatar.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,children:(0,jsx_runtime.jsx)(Sparkles,(0,objectSpread2.Z)({},args))})};FloatingSparkles.args={count:70,scale:4,size:5,speed:.25,opacity:.6,color:"#124cca"},FloatingSparkles.argTypes=(0,objectSpread2.Z)({count:{control:{type:"range",min:0,max:70}},scale:{control:{type:"number"}},size:{control:{type:"range",min:0,max:10}},speed:{control:{type:"range",step:.01,min:0,max:20}},opacity:{control:{type:"range",step:.01,min:0,max:1.1}}},Stories_service.nx);var SpawnEffectAndAnimation=function SpawnEffectAndAnimation(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)((0,objectSpread2.Z)({},args),{},{children:(0,jsx_runtime.jsx)(Sparkles,{color:"white",count:50,opacity:.9,scale:5,size:.5,speed:.35})}))};SpawnEffectAndAnimation.args={onLoadedEffect:{src:(0,services.gT)("spawn-effect.glb"),loop:12},onLoadedAnimation:{src:(0,services.gT)("male-spawn-animation.fbx"),loop:1},cameraTarget:components_Avatar.b.TARGET.FULL_BODY.FEMALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,modelSrc:(0,services.gT)("male-emissive.glb"),animationSrc:(0,services.gT)("male-idle.glb"),background:{color:"rgb(9,20,26)"}},SpawnEffectAndAnimation.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{onLoadedEffect:{control:{disable:!1}},onLoadedAnimation:{control:{disable:!1}},modelSrc:{control:{disable:!1}},animationSrc:{control:{disable:!1}}});var Posing=function Posing(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)({},args))};Posing.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Avatar_stories.Static.args),{},{modelSrc:(0,services.gT)("male.glb"),poseSrc:(0,services.gT)("male-pose-standing.glb"),cameraTarget:components_Avatar.b.TARGET.FULL_BODY.MALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,onLoaded:function onLoaded(){return console.info("EVENT: posing avatar loaded")},onLoading:function onLoading(){return console.info("EVENT: loading posing avatar")},emotion:Stories_service.eE.smile}),Posing.argTypes={headMovement:{control:!1}};var IdleBlinking=function IdleBlinking(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)({},args))};IdleBlinking.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({Comment:"Idle blinking works when avatar includes morph targets for 'ARKit' and 'Eyes Extra'."},Avatar_stories.Static.args),{},{modelSrc:Stories_service.HI.seven,animationSrc:Stories_service.jb.three,cameraTarget:components_Avatar.b.TARGET.FULL_BODY.MALE,cameraInitialDistance:components_Avatar.b.CONTROLS.FULL_BODY.MAX_DISTANCE,headMovement:!0,emotion:Stories_service.eE.smile}),IdleBlinking.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{modelSrc:{options:Object.values({seven:Stories_service.HI.seven}),control:{type:"select"}},animationSrc:{options:Object.values(Stories_service.jb),control:{type:"select"}}});var environmentModel=function environmentModel(args){return(0,jsx_runtime.jsx)(Avatar,(0,objectSpread2.Z)((0,objectSpread2.Z)({},args),{},{effects:{ambientOcclusion:!0},children:(0,jsx_runtime.jsx)(EnvironmentModel,{environment:args.environmentModel,scale:args.environmentScale})}))};environmentModel.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({environmentModel:"spaceStation"},Avatar_stories.Static.args),{},{fov:50,environmentScale:1,shadows:!0,modelSrc:Stories_service.HI.one,animationSrc:Stories_service.jb.one,environment:"warehouse",onLoaded:function onLoaded(){return console.info("EVENT: environment model loaded")}}),environmentModel.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{onLoading:{table:{disable:!0}},dirLightPosition:{table:{disable:!0}},spotLightPosition:{table:{disable:!0}},scale:{table:{disable:!0}},environmentModel:{options:Object.keys(Environment_service.om),control:{type:"select"}},fov:{control:{type:"range",min:30,max:100,step:1}},environmentScale:{control:{type:"range",min:.01,max:10,step:.01}},ambientLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},dirLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},spotLightIntensity:{control:{type:"range",min:0,max:20,step:.1}},environment:{options:Object.keys(Environment_service.s$),control:{type:"select"}}});var ReflectiveFloor=function ReflectiveFloor(args){return(0,jsx_runtime.jsxs)(Avatar,(0,objectSpread2.Z)((0,objectSpread2.Z)({},args),{},{effects:{ambientOcclusion:!0},style:{background:args.color},children:[(0,jsx_runtime.jsx)(FloorReflection,(0,objectSpread2.Z)({},args)),(null==args?void 0:args.debug)&&(0,jsx_runtime.jsx)(StatsGl.G,{})]}))};ReflectiveFloor.args=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Avatar_stories.Static.args),{},{fov:50,shadows:!1,modelSrc:Stories_service.HI.one,animationSrc:Stories_service.jb.three,environment:"warehouse",onLoaded:function onLoaded(){return console.info("EVENT: environment model loaded")},resolution:512,mixBlur:.8,mixStrength:80,metalness:.5,blur:[300,200],mirror:1,minDepthThreshold:.4,maxDepthThreshold:1.4,depthScale:1.2,depthToBlurRatioBias:1,distortion:0,mixContrast:1,reflectorOffset:0,roughness:1,color:"rgb(9,20,26)",debug:!1}),ReflectiveFloor.argTypes=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Stories_service.nx),{},{fov:{control:{type:"range",min:30,max:100,step:1}},environment:{options:Object.keys(Environment_service.s$),control:{type:"select"}},resolution:{control:{type:"range",min:64,max:2048,step:64}},mixBlur:{control:{type:"range",min:0,max:10,step:.1}},mixStrength:{control:{type:"range",min:0,max:100,step:1}},metalness:{control:{type:"range",min:0,max:1,step:.01}},mirror:{control:{type:"range",min:0,max:1,step:1}},minDepthThreshold:{control:{type:"range",min:0,max:10,step:.01}},maxDepthThreshold:{control:{type:"range",min:0,max:10,step:.01}},depthScale:{control:{type:"range",min:0,max:20,step:.01}},depthToBlurRatioBias:{control:{type:"range",min:0,max:1,step:.01}},distortion:{control:{type:"range",min:0,max:1,step:.01}},mixContrast:{control:{type:"range",min:0,max:1,step:.01}},reflectorOffset:{control:{type:"range",min:0,max:1,step:.01}},roughness:{control:{type:"range",min:0,max:1,step:.01}}}),Bloom.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Bloom.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_Bloom$parameters=Bloom.parameters)||void 0===_Bloom$parameters?void 0:_Bloom$parameters.docs),{},{source:(0,objectSpread2.Z)({originalSource:'(args: BloomConfiguration | undefined) => '},null===(_Bloom$parameters2=Bloom.parameters)||void 0===_Bloom$parameters2||null===(_Bloom$parameters2$do=_Bloom$parameters2.docs)||void 0===_Bloom$parameters2$do?void 0:_Bloom$parameters2$do.source)})}),FloatingSparkles.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},FloatingSparkles.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_FloatingSparkles$par=FloatingSparkles.parameters)||void 0===_FloatingSparkles$par?void 0:_FloatingSparkles$par.docs),{},{source:(0,objectSpread2.Z)({originalSource:"args => \n \n "},null===(_FloatingSparkles$par2=FloatingSparkles.parameters)||void 0===_FloatingSparkles$par2||null===(_FloatingSparkles$par3=_FloatingSparkles$par2.docs)||void 0===_FloatingSparkles$par3?void 0:_FloatingSparkles$par3.source)})}),SpawnEffectAndAnimation.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},SpawnEffectAndAnimation.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_SpawnEffectAndAnimat=SpawnEffectAndAnimation.parameters)||void 0===_SpawnEffectAndAnimat?void 0:_SpawnEffectAndAnimat.docs),{},{source:(0,objectSpread2.Z)({originalSource:'args => \n \n '},null===(_SpawnEffectAndAnimat2=SpawnEffectAndAnimation.parameters)||void 0===_SpawnEffectAndAnimat2||null===(_SpawnEffectAndAnimat3=_SpawnEffectAndAnimat2.docs)||void 0===_SpawnEffectAndAnimat3?void 0:_SpawnEffectAndAnimat3.source)})}),Posing.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},Posing.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_Posing$parameters=Posing.parameters)||void 0===_Posing$parameters?void 0:_Posing$parameters.docs),{},{source:(0,objectSpread2.Z)({originalSource:"args => "},null===(_Posing$parameters2=Posing.parameters)||void 0===_Posing$parameters2||null===(_Posing$parameters2$d=_Posing$parameters2.docs)||void 0===_Posing$parameters2$d?void 0:_Posing$parameters2$d.source)})}),IdleBlinking.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},IdleBlinking.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_IdleBlinking$paramet=IdleBlinking.parameters)||void 0===_IdleBlinking$paramet?void 0:_IdleBlinking$paramet.docs),{},{source:(0,objectSpread2.Z)({originalSource:"args => "},null===(_IdleBlinking$paramet2=IdleBlinking.parameters)||void 0===_IdleBlinking$paramet2||null===(_IdleBlinking$paramet3=_IdleBlinking$paramet2.docs)||void 0===_IdleBlinking$paramet3?void 0:_IdleBlinking$paramet3.source)})}),environmentModel.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},environmentModel.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_environmentModel$par=environmentModel.parameters)||void 0===_environmentModel$par?void 0:_environmentModel$par.docs),{},{source:(0,objectSpread2.Z)({originalSource:"(args: AvatarProps & {\n environmentModel: string;\n environmentScale: number;\n}) => \n \n "},null===(_environmentModel$par2=environmentModel.parameters)||void 0===_environmentModel$par2||null===(_environmentModel$par3=_environmentModel$par2.docs)||void 0===_environmentModel$par3?void 0:_environmentModel$par3.source)})}),ReflectiveFloor.parameters=(0,objectSpread2.Z)((0,objectSpread2.Z)({},ReflectiveFloor.parameters),{},{docs:(0,objectSpread2.Z)((0,objectSpread2.Z)({},null===(_ReflectiveFloor$para=ReflectiveFloor.parameters)||void 0===_ReflectiveFloor$para?void 0:_ReflectiveFloor$para.docs),{},{source:(0,objectSpread2.Z)({originalSource:"(args: AvatarProps & FloorReflectionProps & {\n debug: boolean;\n}) => \n \n {args?.debug && }\n "},null===(_ReflectiveFloor$para2=ReflectiveFloor.parameters)||void 0===_ReflectiveFloor$para2||null===(_ReflectiveFloor$para3=_ReflectiveFloor$para2.docs)||void 0===_ReflectiveFloor$para3?void 0:_ReflectiveFloor$para3.source)})});var __namedExportsOrder=["Bloom","FloatingSparkles","SpawnEffectAndAnimation","Posing","IdleBlinking","environmentModel","ReflectiveFloor"];Bloom.__docgenInfo={description:"",methods:[],displayName:"Bloom"},FloatingSparkles.__docgenInfo={description:"",methods:[],displayName:"FloatingSparkles"},SpawnEffectAndAnimation.__docgenInfo={description:"",methods:[],displayName:"SpawnEffectAndAnimation"},Posing.__docgenInfo={description:"",methods:[],displayName:"Posing"},IdleBlinking.__docgenInfo={description:"",methods:[],displayName:"IdleBlinking"},environmentModel.__docgenInfo={description:"",methods:[],displayName:"environmentModel",props:{environmentModel:{required:!0,tsType:{name:"string"},description:""},environmentScale:{required:!0,tsType:{name:"number"},description:""}}},ReflectiveFloor.__docgenInfo={description:"",methods:[],displayName:"ReflectiveFloor",props:{debug:{required:!0,tsType:{name:"boolean"},description:""}}}}}]); \ No newline at end of file diff --git a/docs/iframe.html b/docs/iframe.html index 6bad5807..b77ea2b7 100644 --- a/docs/iframe.html +++ b/docs/iframe.html @@ -348,7 +348,7 @@ window['DOCS_OPTIONS'] = {"defaultName":"Docs","autodocs":true};