aptechka 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/en3/core/en3.d.ts +3 -0
- package/lib/en3/helpers/En3ComposerManager.d.ts +5 -0
- package/lib/en3/helpers/En3ParametersManager.d.ts +12 -1
- package/lib/en3/helpers/index.cjs +1 -1
- package/lib/en3/helpers/index.js +941 -736
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +1 -1
- package/lib/en3/loaders/index.cjs +1 -1
- package/lib/en3/loaders/index.js +1 -1
- package/lib/en3/utils/index.cjs +1 -1
- package/lib/en3/utils/index.js +2 -2
- package/lib/en3-CBBYE8rb.cjs +8 -0
- package/lib/en3-sDqjL5Mg.js +349 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +2 -2
- package/lib/order/index.js +1 -1
- package/lib/store/Store.d.ts +1 -0
- package/lib/{traverseMaterials-Crv7f9BJ.cjs → traverseMaterials-BtBXV88O.cjs} +1 -1
- package/lib/{traverseMaterials-B87RMkV0.js → traverseMaterials-M-N1989i.js} +1 -1
- package/lib/tweaker/index.cjs +2 -2
- package/lib/tweaker/index.js +73 -73
- package/package.json +1 -1
- package/lib/en3-BQMd-J6t.cjs +0 -8
- package/lib/en3-CsNHRA0v.js +0 -343
package/lib/en3/core/en3.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ElementOrSelector } from '../../utils';
|
|
|
2
2
|
import { WebGLRenderer, WebGLRendererParameters } from 'three';
|
|
3
3
|
import { En3View, En3ViewOptions } from './En3View';
|
|
4
4
|
import { En3Raycaster } from './En3Raycaster';
|
|
5
|
+
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
5
6
|
|
|
6
7
|
export interface En3Options {
|
|
7
8
|
webGLRendererParameters?: WebGLRendererParameters;
|
|
@@ -10,6 +11,7 @@ export interface En3Options {
|
|
|
10
11
|
view?: En3ViewOptions;
|
|
11
12
|
cacheAssets?: boolean;
|
|
12
13
|
zIndex?: number;
|
|
14
|
+
composer?: typeof EffectComposer;
|
|
13
15
|
}
|
|
14
16
|
declare class En3 {
|
|
15
17
|
#private;
|
|
@@ -25,6 +27,7 @@ declare class En3 {
|
|
|
25
27
|
get height(): number;
|
|
26
28
|
get pixelRatio(): number;
|
|
27
29
|
get cacheAssets(): boolean;
|
|
30
|
+
get composer(): EffectComposer;
|
|
28
31
|
setup(options?: En3Options): void;
|
|
29
32
|
destroy(): void;
|
|
30
33
|
createView(viewName: string, viewOptions?: En3ViewOptions): En3View;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { StoreManagers } from '../../store';
|
|
2
|
+
|
|
3
|
+
export type OptionsCatalog = {
|
|
4
|
+
[key: string]: StoreManagers[keyof StoreManagers];
|
|
5
|
+
};
|
|
6
|
+
export interface En3ParametersManagerOptions {
|
|
7
|
+
optionsCatalog?: OptionsCatalog;
|
|
8
|
+
folderName?: string;
|
|
9
|
+
skipKeys?: Array<string>;
|
|
10
|
+
afterChange?: () => void;
|
|
11
|
+
}
|
|
1
12
|
export declare class En3ParametersManager {
|
|
2
13
|
#private;
|
|
3
|
-
constructor(subject: any);
|
|
14
|
+
constructor(subject: any, options?: En3ParametersManagerOptions);
|
|
4
15
|
destroy(): void;
|
|
5
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var xn=Object.defineProperty;var Gt=Object.getOwnPropertySymbols;var vn=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable;var Ft=(p,o,s)=>o in p?xn(p,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):p[o]=s,st=(p,o)=>{for(var s in o||(o={}))vn.call(o,s)&&Ft(p,s,o[s]);if(Gt)for(var s of Gt(o))Tn.call(o,s)&&Ft(p,s,o[s]);return p};var gt=(p,o,s)=>{if(!o.has(p))throw TypeError("Cannot "+s)};var a=(p,o,s)=>(gt(p,o,"read from private field"),s?s.call(p):o.get(p)),u=(p,o,s)=>{if(o.has(p))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(p):o.set(p,s)},S=(p,o,s,e)=>(gt(p,o,"write to private field"),e?e.call(p,s):o.set(p,s),s);var _=(p,o,s)=>(gt(p,o,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../en3-BQMd-J6t.cjs"),X=require("../../Store-6s0YXK4o.cjs"),t=require("three"),_n=require("../../traverseMaterials-Crv7f9BJ.cjs"),Nt=require("../../ticker/index.cjs"),On=require("../../Composed-Dx2hs-va.cjs");function In(p){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const s in p)if(s!=="default"){const e=Object.getOwnPropertyDescriptor(p,s);Object.defineProperty(o,s,e.get?e:{enumerable:!0,get:()=>p[s]})}}return o.default=p,Object.freeze(o)}const G=In(t),Ln=["AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation"],tn=["ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor"],An=[...tn,"SrcAlphaSaturateFactor"],Dn=["NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending"],jn=["NeverDepth","AlwaysDepth","EqualDepth","LessDepth","LessEqualDepth ","GreaterEqualDepth ","GreaterDepth","NotEqualDepth"],kn=["NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc ","GreaterStencilFunc","NotEqualStencilFunc ","GreaterEqualStencilFunc","AlwaysStencilFunc"],Mt=["ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp"],Hn=["FrontSide","BackSide","DoubleSide"],Rn=["TangentSpaceNormalMap","ObjectSpaceNormalMap"],Yn=["round","bevel","miter"],Cn=["NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","AgXToneMapping","NeutralToneMapping","CustomToneMapping"],zn=["BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap"],ke={intensity:{type:"number",min:0,max:20,step:1e-4},renderOrder:{type:"number",step:1},alphaTest:{type:"number",min:0,max:1,step:.001},blendAlpha:{type:"number",min:0,max:1,step:.001},blendDst:{type:"select",variants:An},blendDstAlpha:{type:"number",min:0,max:1,step:.001},blendEquation:{type:"select",variants:Ln},blendEquationAlpha:{type:"number",min:0,max:1,step:.001},blending:{type:"select",variants:Dn},blendSrc:{type:"select",variants:tn},blendSrcAlpha:{type:"number",min:0,max:1,step:.001},depthFunc:{type:"select",variants:jn},stencilFunc:{type:"select",variants:kn},stencilRef:{type:"number",min:0,step:1},stencilFail:{type:"select",variants:Mt},stencilZFail:{type:"select",variants:Mt},stencilZPass:{type:"select",variants:Mt},opacity:{type:"number",min:0,max:1,step:1e-4},side:{type:"select",variants:Hn},roughness:{type:"number",min:0,max:1,step:1e-4},metalness:{type:"number",min:0,max:1,step:1e-4},lightMapIntensity:{type:"number",min:0,max:20,step:1e-4},aoMapIntensity:{type:"number",min:0,max:20,step:1e-4},bumpScale:{type:"number",min:0,step:1e-4},normalMapType:{type:"select",variants:Rn},wireframeLinejoin:{type:"select",variants:Yn},envMapIntensity:{type:"number",min:0,max:20,step:1e-4},emissiveIntensity:{type:"number",min:0,max:20,step:1e-4},fov:{type:"number",min:0,max:180,step:1},zoom:{type:"number",min:0,step:1e-4},near:{type:"number",min:0,step:1e-4},far:{type:"number",min:0,step:1},filmGauge:{type:"number",min:0,step:1e-4},filmOffset:{type:"number",min:0,step:1e-4},distance:{type:"number",min:0,step:.1},decay:{type:"number",min:0,step:1e-5,ease:.001},focus:{type:"number",min:0,max:1,step:1e-5},bias:{type:"number",min:0,max:.01,step:1e-6,ease:.01},blurSamples:{type:"number",min:0,step:1},normalBias:{type:"number",min:0,step:.001,ease:.01},radius:{type:"number",min:0,step:.001,ease:.01},penumbra:{type:"number",min:0,max:1,step:1e-6},power:{type:"number",min:0,step:.001,ease:.01},angle:{type:"number",min:0,step:1e-6,ease:.001},toneMapping:{type:"select",variants:Cn},toneMappingExposure:{type:"number",min:0,step:.001,ease:.1},mapSize:{type:"number",min:0,step:1}},Xn={type:{type:"select",variants:zn}},Zn=new Set(["stencilFuncMask","needsUpdate","version","wireframeLinewidth","position","scale","rotation","coordinateSystem","aspect","autoUpdate","up"]);var L,oe,ie,de,mt,on,ut,sn,dt,an,ft,rn,ze,xt;class nn{constructor(o){u(this,ie);u(this,mt);u(this,ut);u(this,dt);u(this,ft);u(this,ze);u(this,L,void 0);u(this,oe,[]);if(S(this,L,o),a(this,L)instanceof G.Object3D){if(_(this,ie,de).call(this,a(this,L),`${a(this,L).name}.Parameters`,ke,a(this,L)instanceof G.Camera?()=>{P.en3.view.resize()}:void 0),a(this,L)instanceof G.Mesh){const s=a(this,L).material;s instanceof G.Material&&_(this,ie,de).call(this,s,`${a(this,L).name}.Parameters.Material`,ke,()=>{s.needsUpdate=!0})}else if(a(this,L)instanceof G.Light){const s=a(this,L).shadow;if(s){_(this,ie,de).call(this,s,`${a(this,L).name}.Parameters.Shadow`,ke,()=>{s.needsUpdate=!0});const e=s.camera;e&&_(this,ie,de).call(this,e,`${a(this,L).name}.Parameters.Shadow.Camera`,ke,()=>{s.camera.updateProjectionMatrix()})}}}else if(a(this,L)instanceof G.WebGLRenderer){const s=a(this,L);_(this,ie,de).call(this,s,"Renderer",ke),_(this,ie,de).call(this,s.shadowMap,"Renderer.shadowMap",Xn,()=>{s.shadowMap.needsUpdate=!0,_n.traverseMaterials(P.en3.scene,e=>{e.needsUpdate=!0})})}}destroy(){a(this,oe).forEach(o=>{o.close()})}}L=new WeakMap,oe=new WeakMap,ie=new WeakSet,de=function(o,s,e,r){for(const c in o){if(c.startsWith("_")||Zn.has(c))continue;const i=o[c],l=`${s}.${c}`,m=e[c];typeof i=="number"?(m==null?void 0:m.type)==="select"?_(this,ze,xt).call(this,l,i,o,c,m,r):_(this,mt,on).call(this,l,i,o,c,m,r):i instanceof G.Vector2||i instanceof G.Vector3?_(this,ut,sn).call(this,l,i,o,c,m,r):typeof i=="boolean"&&!c.startsWith("is")&&!c.startsWith("matrix")?_(this,dt,an).call(this,l,i,o,c,r):i instanceof G.Color?_(this,ft,rn).call(this,l,i,o,c,r):m&&(m==null?void 0:m.type)==="select"&&_(this,ze,xt).call(this,l,i,o,c,m,r)}},mt=new WeakSet,on=function(o,s,e,r,c,i){const l=new X.Store(s,{passport:{name:o,manager:st({type:"number"},c)}});l.subscribe(m=>{e[r]=m.current,i==null||i()}),a(this,oe).push(l)},ut=new WeakSet,sn=function(o,s,e,r,c,i){const l=d=>{const y=[d.x,d.y];return d instanceof G.Vector3&&y.push(d.z),y},m=new X.Store(l(s),{passport:{name:o,manager:st({type:"number"},c)}});m.subscribe(d=>{e[r].set(...d.current),i==null||i()}),a(this,oe).push(m)},dt=new WeakSet,an=function(o,s,e,r,c){const i=new X.Store(s,{passport:{name:o,manager:{type:"boolean"}}});i.subscribe(l=>{e[r]=l.current,c==null||c()}),a(this,oe).push(i)},ft=new WeakSet,rn=function(o,s,e,r,c){const i=new X.Store(`#${s.getHexString()}`,{passport:{name:o,manager:{type:"color"}}});i.subscribe(l=>{e[r]=new G.Color(l.current),c==null||c()}),a(this,oe).push(i)},ze=new WeakSet,xt=function(o,s,e,r,c,i){const l=c.variants;let m=null;for(const y of l)s===G[y]&&(m=y);const d=new X.Store(m||s,{passport:{name:o,manager:st({},c)}});d.subscribe(y=>{typeof y.current=="string"&&(y.current[0]===y.current[0].toUpperCase()?e[r]=G[y.current]:e[r]=y.current),i==null||i()}),a(this,oe).push(d)};var g,Xe,ye,be,we,Ze,B,Te,ht,Ge;class Tt{constructor(o,s){u(this,Te);u(this,g,void 0);u(this,Xe,null);u(this,ye,void 0);u(this,be,void 0);u(this,we,void 0);u(this,Ze,!0);u(this,B,[]);u(this,Ge,()=>{a(this,B).forEach(o=>{"update"in o&&o.update()})});var l,m;S(this,g,o);let e=!1;o.name.startsWith("T.")&&(o.name=o.name.slice(2)),o.name.includes("P.")&&(e=!0,o.name=o.name.replace("P.",""));const r=o.name;a(this,g).userData.controlled=!0;const c=(s==null?void 0:s.step)||1e-4,i=((l=o.userData)==null?void 0:l.box)||o;if(a(this,g)instanceof t.Light){let d;a(this,g)instanceof t.PointLight?d=new t.PointLightHelper(a(this,g),100):a(this,g)instanceof t.DirectionalLight?(a(this,g).scale.setScalar(100),d=new t.DirectionalLightHelper(a(this,g),1)):a(this,g)instanceof t.SpotLight?d=new t.SpotLightHelper(a(this,g)):a(this,g)instanceof t.HemisphereLight&&(d=new t.HemisphereLightHelper(a(this,g),100)),a(this,B).push(d);const y=(m=a(this,g).shadow)==null?void 0:m.camera;if(y instanceof t.Camera){const R=new t.CameraHelper(y);a(this,B).push(R)}}a(this,B).forEach(d=>{P.en3.view.add(d)}),S(this,ye,new X.Store([i.position.x,i.position.y,i.position.z],{passport:{name:`${r}.Transformation.Position`,manager:{type:"number",step:c}}})),S(this,be,new X.Store([i.rotation.x,i.rotation.y,i.rotation.z],{passport:{name:`${r}.Transformation.Rotation`,manager:{type:"number",step:c,ease:.01}}})),S(this,we,new X.Store([i.scale.x,i.scale.y,i.scale.z],{passport:{name:`${r}.Transformation.Scale`,manager:{type:"number",step:c}}})),this.save(),S(this,Ze,!1),a(this,ye).subscribe(d=>{_(this,Te,ht).call(this,"position",d.current)}),a(this,be).subscribe(d=>{_(this,Te,ht).call(this,"rotation",d.current)}),a(this,we).subscribe(d=>{_(this,Te,ht).call(this,"scale",d.current)}),e&&S(this,Xe,new nn(a(this,g))),a(this,B).length&&Nt.ticker.subscribe(a(this,Ge))}get object3d(){return a(this,g)}get helpers(){return a(this,B)}get raycasterTarget(){return a(this,B)[0]||a(this,g)}destroy(){var o;(o=a(this,Xe))==null||o.destroy(),a(this,ye).close(),a(this,be).close(),a(this,we).close(),a(this,g).userData.controlled=!1,a(this,B).forEach(s=>{s&&"dispose"in s&&(s.dispose(),P.en3.view.remove(s))}),Nt.ticker.unsubscribe(a(this,Ge))}save(){const o=(s,e)=>{(!a(this,Ze)||s.initial===s.current)&&(s.current=[e.x,e.y,e.z])};o(a(this,ye),a(this,g).position),o(a(this,be),a(this,g).rotation),o(a(this,we),a(this,g).scale)}}g=new WeakMap,Xe=new WeakMap,ye=new WeakMap,be=new WeakMap,we=new WeakMap,Ze=new WeakMap,B=new WeakMap,Te=new WeakSet,ht=function(o,s){const e=a(this,g).userData.box;if(e){const r=c=>({x:s[0]-c.x,y:s[1]-c.y,z:s[2]-c.z});o==="position"?e.setPositionStep("_manager","+",r(e.getIncludedPositionSteps("_manager"))):o==="rotation"?e.setRotationStep("_manager","+",r(e.getIncludedRotationSteps("_manager"))):o==="scale"&&e.setScaleStep("_manager","+",r(e.getIncludedScaleSteps("_manager")))}else a(this,g)[o].set(...s)},Ge=new WeakMap;const Qt={type:"change"},Et={type:"start"},Vt={type:"end"},at=new t.Ray,qt=new t.Plane,Gn=Math.cos(70*t.MathUtils.DEG2RAD);class Fn extends t.EventDispatcher{constructor(o,s){super(),this.object=o,this.domElement=s,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new t.Vector3,this.cursor=new t.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:t.MOUSE.ROTATE,MIDDLE:t.MOUSE.DOLLY,RIGHT:t.MOUSE.PAN},this.touches={ONE:t.TOUCH.ROTATE,TWO:t.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(n){n.addEventListener("keydown",wt),this._domElementKeyEvents=n},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",wt),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Qt),e.update(),c=r.NONE},this.update=function(){const n=new t.Vector3,h=new t.Quaternion().setFromUnitVectors(o.up,new t.Vector3(0,1,0)),f=h.clone().invert(),w=new t.Vector3,z=new t.Quaternion,ae=new t.Vector3,Q=2*Math.PI;return function(Pn=null){const Xt=e.object.position;n.copy(Xt).sub(e.target),n.applyQuaternion(h),l.setFromVector3(n),e.autoRotate&&c===r.NONE&&pe(yt(Pn)),e.enableDamping?(l.theta+=m.theta*e.dampingFactor,l.phi+=m.phi*e.dampingFactor):(l.theta+=m.theta,l.phi+=m.phi);let ee=e.minAzimuthAngle,te=e.maxAzimuthAngle;isFinite(ee)&&isFinite(te)&&(ee<-Math.PI?ee+=Q:ee>Math.PI&&(ee-=Q),te<-Math.PI?te+=Q:te>Math.PI&&(te-=Q),ee<=te?l.theta=Math.max(ee,Math.min(te,l.theta)):l.theta=l.theta>(ee+te)/2?Math.max(ee,l.theta):Math.min(te,l.theta)),l.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,l.phi)),l.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(y,e.dampingFactor):e.target.add(y),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let De=!1;if(e.zoomToCursor&&Ee||e.object.isOrthographicCamera)l.radius=se(l.radius);else{const ne=l.radius;l.radius=se(l.radius*d),De=ne!=l.radius}if(n.setFromSpherical(l),n.applyQuaternion(f),Xt.copy(e.target).add(n),e.object.lookAt(e.target),e.enableDamping===!0?(m.theta*=1-e.dampingFactor,m.phi*=1-e.dampingFactor,y.multiplyScalar(1-e.dampingFactor)):(m.set(0,0,0),y.set(0,0,0)),e.zoomToCursor&&Ee){let ne=null;if(e.object.isPerspectiveCamera){const je=n.length();ne=se(je*d);const it=je-ne;e.object.position.addScaledVector($,it),e.object.updateMatrixWorld(),De=!!it}else if(e.object.isOrthographicCamera){const je=new t.Vector3(j.x,j.y,0);je.unproject(e.object);const it=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/d)),e.object.updateProjectionMatrix(),De=it!==e.object.zoom;const Zt=new t.Vector3(j.x,j.y,0);Zt.unproject(e.object),e.object.position.sub(Zt).add(je),e.object.updateMatrixWorld(),ne=n.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;ne!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(ne).add(e.object.position):(at.origin.copy(e.object.position),at.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(at.direction))<Gn?o.lookAt(e.target):(qt.setFromNormalAndCoplanarPoint(e.object.up,e.target),at.intersectPlane(qt,e.target))))}else if(e.object.isOrthographicCamera){const ne=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/d)),ne!==e.object.zoom&&(e.object.updateProjectionMatrix(),De=!0)}return d=1,Ee=!1,De||w.distanceToSquared(e.object.position)>i||8*(1-z.dot(e.object.quaternion))>i||ae.distanceToSquared(e.target)>i?(e.dispatchEvent(Qt),w.copy(e.object.position),z.copy(e.object.quaternion),ae.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Ct),e.domElement.removeEventListener("pointerdown",jt),e.domElement.removeEventListener("pointercancel",Ae),e.domElement.removeEventListener("wheel",kt),e.domElement.removeEventListener("pointermove",bt),e.domElement.removeEventListener("pointerup",Ae),e.domElement.getRootNode().removeEventListener("keydown",Ht,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",wt),e._domElementKeyEvents=null)};const e=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=r.NONE;const i=1e-6,l=new t.Spherical,m=new t.Spherical;let d=1;const y=new t.Vector3,R=new t.Vector2,Z=new t.Vector2,K=new t.Vector2,F=new t.Vector2,O=new t.Vector2,D=new t.Vector2,I=new t.Vector2,E=new t.Vector2,x=new t.Vector2,$=new t.Vector3,j=new t.Vector2;let Ee=!1;const v=[],he={};let Le=!1;function yt(n){return n!==null?2*Math.PI/60*e.autoRotateSpeed*n:2*Math.PI/60/60*e.autoRotateSpeed}function Se(n){const h=Math.abs(n*.01);return Math.pow(.95,e.zoomSpeed*h)}function pe(n){m.theta-=n}function Pe(n){m.phi-=n}const N=function(){const n=new t.Vector3;return function(f,w){n.setFromMatrixColumn(w,0),n.multiplyScalar(-f),y.add(n)}}(),Y=function(){const n=new t.Vector3;return function(f,w){e.screenSpacePanning===!0?n.setFromMatrixColumn(w,1):(n.setFromMatrixColumn(w,0),n.crossVectors(e.object.up,n)),n.multiplyScalar(f),y.add(n)}}(),U=function(){const n=new t.Vector3;return function(f,w){const z=e.domElement;if(e.object.isPerspectiveCamera){const ae=e.object.position;n.copy(ae).sub(e.target);let Q=n.length();Q*=Math.tan(e.object.fov/2*Math.PI/180),N(2*f*Q/z.clientHeight,e.object.matrix),Y(2*w*Q/z.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(N(f*(e.object.right-e.object.left)/e.object.zoom/z.clientWidth,e.object.matrix),Y(w*(e.object.top-e.object.bottom)/e.object.zoom/z.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function C(n){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?d/=n:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function J(n){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?d*=n:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function T(n,h){if(!e.zoomToCursor)return;Ee=!0;const f=e.domElement.getBoundingClientRect(),w=n-f.left,z=h-f.top,ae=f.width,Q=f.height;j.x=w/ae*2-1,j.y=-(z/Q)*2+1,$.set(j.x,j.y,1).unproject(e.object).sub(e.object.position).normalize()}function se(n){return Math.max(e.minDistance,Math.min(e.maxDistance,n))}function me(n){R.set(n.clientX,n.clientY)}function xe(n){T(n.clientX,n.clientX),I.set(n.clientX,n.clientY)}function nt(n){F.set(n.clientX,n.clientY)}function ot(n){Z.set(n.clientX,n.clientY),K.subVectors(Z,R).multiplyScalar(e.rotateSpeed);const h=e.domElement;pe(2*Math.PI*K.x/h.clientHeight),Pe(2*Math.PI*K.y/h.clientHeight),R.copy(Z),e.update()}function cn(n){E.set(n.clientX,n.clientY),x.subVectors(E,I),x.y>0?C(Se(x.y)):x.y<0&&J(Se(x.y)),I.copy(E),e.update()}function ln(n){O.set(n.clientX,n.clientY),D.subVectors(O,F).multiplyScalar(e.panSpeed),U(D.x,D.y),F.copy(O),e.update()}function hn(n){T(n.clientX,n.clientY),n.deltaY<0?J(Se(n.deltaY)):n.deltaY>0&&C(Se(n.deltaY)),e.update()}function pn(n){let h=!1;switch(n.code){case e.keys.UP:n.ctrlKey||n.metaKey||n.shiftKey?Pe(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,e.keyPanSpeed),h=!0;break;case e.keys.BOTTOM:n.ctrlKey||n.metaKey||n.shiftKey?Pe(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,-e.keyPanSpeed),h=!0;break;case e.keys.LEFT:n.ctrlKey||n.metaKey||n.shiftKey?pe(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(e.keyPanSpeed,0),h=!0;break;case e.keys.RIGHT:n.ctrlKey||n.metaKey||n.shiftKey?pe(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(-e.keyPanSpeed,0),h=!0;break}h&&(n.preventDefault(),e.update())}function _t(n){if(v.length===1)R.set(n.pageX,n.pageY);else{const h=ve(n),f=.5*(n.pageX+h.x),w=.5*(n.pageY+h.y);R.set(f,w)}}function Ot(n){if(v.length===1)F.set(n.pageX,n.pageY);else{const h=ve(n),f=.5*(n.pageX+h.x),w=.5*(n.pageY+h.y);F.set(f,w)}}function It(n){const h=ve(n),f=n.pageX-h.x,w=n.pageY-h.y,z=Math.sqrt(f*f+w*w);I.set(0,z)}function mn(n){e.enableZoom&&It(n),e.enablePan&&Ot(n)}function un(n){e.enableZoom&&It(n),e.enableRotate&&_t(n)}function Lt(n){if(v.length==1)Z.set(n.pageX,n.pageY);else{const f=ve(n),w=.5*(n.pageX+f.x),z=.5*(n.pageY+f.y);Z.set(w,z)}K.subVectors(Z,R).multiplyScalar(e.rotateSpeed);const h=e.domElement;pe(2*Math.PI*K.x/h.clientHeight),Pe(2*Math.PI*K.y/h.clientHeight),R.copy(Z)}function At(n){if(v.length===1)O.set(n.pageX,n.pageY);else{const h=ve(n),f=.5*(n.pageX+h.x),w=.5*(n.pageY+h.y);O.set(f,w)}D.subVectors(O,F).multiplyScalar(e.panSpeed),U(D.x,D.y),F.copy(O)}function Dt(n){const h=ve(n),f=n.pageX-h.x,w=n.pageY-h.y,z=Math.sqrt(f*f+w*w);E.set(0,z),x.set(0,Math.pow(E.y/I.y,e.zoomSpeed)),C(x.y),I.copy(E);const ae=(n.pageX+h.x)*.5,Q=(n.pageY+h.y)*.5;T(ae,Q)}function dn(n){e.enableZoom&&Dt(n),e.enablePan&&At(n)}function fn(n){e.enableZoom&&Dt(n),e.enableRotate&&Lt(n)}function jt(n){e.enabled!==!1&&(v.length===0&&(e.domElement.setPointerCapture(n.pointerId),e.domElement.addEventListener("pointermove",bt),e.domElement.addEventListener("pointerup",Ae)),!Sn(n)&&(Mn(n),n.pointerType==="touch"?Yt(n):yn(n)))}function bt(n){e.enabled!==!1&&(n.pointerType==="touch"?gn(n):bn(n))}function Ae(n){switch(En(n),v.length){case 0:e.domElement.releasePointerCapture(n.pointerId),e.domElement.removeEventListener("pointermove",bt),e.domElement.removeEventListener("pointerup",Ae),e.dispatchEvent(Vt),c=r.NONE;break;case 1:const h=v[0],f=he[h];Yt({pointerId:h,pageX:f.x,pageY:f.y});break}}function yn(n){let h;switch(n.button){case 0:h=e.mouseButtons.LEFT;break;case 1:h=e.mouseButtons.MIDDLE;break;case 2:h=e.mouseButtons.RIGHT;break;default:h=-1}switch(h){case t.MOUSE.DOLLY:if(e.enableZoom===!1)return;xe(n),c=r.DOLLY;break;case t.MOUSE.ROTATE:if(n.ctrlKey||n.metaKey||n.shiftKey){if(e.enablePan===!1)return;nt(n),c=r.PAN}else{if(e.enableRotate===!1)return;me(n),c=r.ROTATE}break;case t.MOUSE.PAN:if(n.ctrlKey||n.metaKey||n.shiftKey){if(e.enableRotate===!1)return;me(n),c=r.ROTATE}else{if(e.enablePan===!1)return;nt(n),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(Et)}function bn(n){switch(c){case r.ROTATE:if(e.enableRotate===!1)return;ot(n);break;case r.DOLLY:if(e.enableZoom===!1)return;cn(n);break;case r.PAN:if(e.enablePan===!1)return;ln(n);break}}function kt(n){e.enabled===!1||e.enableZoom===!1||c!==r.NONE||(n.preventDefault(),e.dispatchEvent(Et),hn(wn(n)),e.dispatchEvent(Vt))}function wn(n){const h=n.deltaMode,f={clientX:n.clientX,clientY:n.clientY,deltaY:n.deltaY};switch(h){case 1:f.deltaY*=16;break;case 2:f.deltaY*=100;break}return n.ctrlKey&&!Le&&(f.deltaY*=10),f}function Ht(n){n.key==="Control"&&(Le=!0,e.domElement.getRootNode().addEventListener("keyup",Rt,{passive:!0,capture:!0}))}function Rt(n){n.key==="Control"&&(Le=!1,e.domElement.getRootNode().removeEventListener("keyup",Rt,{passive:!0,capture:!0}))}function wt(n){e.enabled===!1||e.enablePan===!1||pn(n)}function Yt(n){switch(zt(n),v.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;_t(n),c=r.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;Ot(n),c=r.TOUCH_PAN;break;default:c=r.NONE}break;case 2:switch(e.touches.TWO){case t.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;mn(n),c=r.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;un(n),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(Et)}function gn(n){switch(zt(n),c){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;Lt(n),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;At(n),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;dn(n),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;fn(n),e.update();break;default:c=r.NONE}}function Ct(n){e.enabled!==!1&&n.preventDefault()}function Mn(n){v.push(n.pointerId)}function En(n){delete he[n.pointerId];for(let h=0;h<v.length;h++)if(v[h]==n.pointerId){v.splice(h,1);return}}function Sn(n){for(let h=0;h<v.length;h++)if(v[h]==n.pointerId)return!0;return!1}function zt(n){let h=he[n.pointerId];h===void 0&&(h=new t.Vector2,he[n.pointerId]=h),h.set(n.pageX,n.pageY)}function ve(n){const h=n.pointerId===v[0]?v[1]:v[0];return he[h]}e.domElement.addEventListener("contextmenu",Ct),e.domElement.addEventListener("pointerdown",jt),e.domElement.addEventListener("pointercancel",Ae),e.domElement.addEventListener("wheel",kt,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Ht,{passive:!0,capture:!0}),this.update()}}const ue=new t.Raycaster,H=new t.Vector3,re=new t.Vector3,M=new t.Quaternion,Ut={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},St={type:"change"},Bt={type:"mouseDown",mode:null},Wt={type:"mouseUp",mode:null},Kt={type:"objectChange"};class Nn extends t.Object3D{constructor(o,s){super(),s===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),s=document),this.isTransformControls=!0,this.visible=!1,this.domElement=s,this.domElement.style.touchAction="none";const e=new Wn;this._gizmo=e,this.add(e);const r=new Kn;this._plane=r,this.add(r);const c=this;function i(E,x){let $=x;Object.defineProperty(c,E,{get:function(){return $!==void 0?$:x},set:function(j){$!==j&&($=j,r[E]=j,e[E]=j,c.dispatchEvent({type:E+"-changed",value:j}),c.dispatchEvent(St))}}),c[E]=x,r[E]=x,e[E]=x}i("camera",o),i("object",void 0),i("enabled",!0),i("axis",null),i("mode","translate"),i("translationSnap",null),i("rotationSnap",null),i("scaleSnap",null),i("space","world"),i("size",1),i("dragging",!1),i("showX",!0),i("showY",!0),i("showZ",!0);const l=new t.Vector3,m=new t.Vector3,d=new t.Quaternion,y=new t.Quaternion,R=new t.Vector3,Z=new t.Quaternion,K=new t.Vector3,F=new t.Vector3,O=new t.Vector3,D=0,I=new t.Vector3;i("worldPosition",l),i("worldPositionStart",m),i("worldQuaternion",d),i("worldQuaternionStart",y),i("cameraPosition",R),i("cameraQuaternion",Z),i("pointStart",K),i("pointEnd",F),i("rotationAxis",O),i("rotationAngle",D),i("eye",I),this._offset=new t.Vector3,this._startNorm=new t.Vector3,this._endNorm=new t.Vector3,this._cameraScale=new t.Vector3,this._parentPosition=new t.Vector3,this._parentQuaternion=new t.Quaternion,this._parentQuaternionInv=new t.Quaternion,this._parentScale=new t.Vector3,this._worldScaleStart=new t.Vector3,this._worldQuaternionInv=new t.Quaternion,this._worldScale=new t.Vector3,this._positionStart=new t.Vector3,this._quaternionStart=new t.Quaternion,this._scaleStart=new t.Vector3,this._getPointer=Qn.bind(this),this._onPointerDown=qn.bind(this),this._onPointerHover=Vn.bind(this),this._onPointerMove=Un.bind(this),this._onPointerUp=Bn.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(o){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(o)}pointerHover(o){if(this.object===void 0||this.dragging===!0)return;o!==null&&ue.setFromCamera(o,this.camera);const s=Pt(this._gizmo.picker[this.mode],ue);s?this.axis=s.object.name:this.axis=null}pointerDown(o){if(!(this.object===void 0||this.dragging===!0||o!=null&&o.button!==0)&&this.axis!==null){o!==null&&ue.setFromCamera(o,this.camera);const s=Pt(this._plane,ue,!0);s&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(s.point).sub(this.worldPositionStart)),this.dragging=!0,Bt.mode=this.mode,this.dispatchEvent(Bt)}}pointerMove(o){const s=this.axis,e=this.mode,r=this.object;let c=this.space;if(e==="scale"?c="local":(s==="E"||s==="XYZE"||s==="XYZ")&&(c="world"),r===void 0||s===null||this.dragging===!1||o!==null&&o.button!==-1)return;o!==null&&ue.setFromCamera(o,this.camera);const i=Pt(this._plane,ue,!0);if(i){if(this.pointEnd.copy(i.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&s!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),s.indexOf("X")===-1&&(this._offset.x=0),s.indexOf("Y")===-1&&(this._offset.y=0),s.indexOf("Z")===-1&&(this._offset.z=0),c==="local"&&s!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(c==="local"&&(r.position.applyQuaternion(M.copy(this._quaternionStart).invert()),s.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),c==="world"&&(r.parent&&r.position.add(H.setFromMatrixPosition(r.parent.matrixWorld)),s.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(H.setFromMatrixPosition(r.parent.matrixWorld))));else if(e==="scale"){if(s.search("XYZ")!==-1){let l=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(l*=-1),re.set(l,l,l)}else H.copy(this.pointStart),re.copy(this.pointEnd),H.applyQuaternion(this._worldQuaternionInv),re.applyQuaternion(this._worldQuaternionInv),re.divide(H),s.search("X")===-1&&(re.x=1),s.search("Y")===-1&&(re.y=1),s.search("Z")===-1&&(re.z=1);r.scale.copy(this._scaleStart).multiply(re),this.scaleSnap&&(s.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Z")!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const l=20/this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));let m=!1;s==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(H.copy(this.rotationAxis).cross(this.eye))*l):(s==="X"||s==="Y"||s==="Z")&&(this.rotationAxis.copy(Ut[s]),H.copy(Ut[s]),c==="local"&&H.applyQuaternion(this.worldQuaternion),H.cross(this.eye),H.length()===0?m=!0:this.rotationAngle=this._offset.dot(H.normalize())*l),(s==="E"||m)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),c==="local"&&s!=="E"&&s!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(M.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(M.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(St),this.dispatchEvent(Kt)}}pointerUp(o){o!==null&&o.button!==0||(this.dragging&&this.axis!==null&&(Wt.mode=this.mode,this.dispatchEvent(Wt)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(o){o.geometry&&o.geometry.dispose(),o.material&&o.material.dispose()})}attach(o){return this.object=o,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(St),this.dispatchEvent(Kt),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ue}getMode(){return this.mode}setMode(o){this.mode=o}setTranslationSnap(o){this.translationSnap=o}setRotationSnap(o){this.rotationSnap=o}setScaleSnap(o){this.scaleSnap=o}setSize(o){this.size=o}setSpace(o){this.space=o}}function Qn(p){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:p.button};{const o=this.domElement.getBoundingClientRect();return{x:(p.clientX-o.left)/o.width*2-1,y:-(p.clientY-o.top)/o.height*2+1,button:p.button}}}function Vn(p){if(this.enabled)switch(p.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(p));break}}function qn(p){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(p.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(p)),this.pointerDown(this._getPointer(p)))}function Un(p){this.enabled&&this.pointerMove(this._getPointer(p))}function Bn(p){this.enabled&&(this.domElement.releasePointerCapture(p.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(p)))}function Pt(p,o,s){const e=o.intersectObject(p,!0);for(let r=0;r<e.length;r++)if(e[r].object.visible||s)return e[r];return!1}const rt=new t.Euler,b=new t.Vector3(0,1,0),$t=new t.Vector3(0,0,0),Jt=new t.Matrix4,ct=new t.Quaternion,pt=new t.Quaternion,W=new t.Vector3,en=new t.Matrix4,Ye=new t.Vector3(1,0,0),fe=new t.Vector3(0,1,0),Ce=new t.Vector3(0,0,1),lt=new t.Vector3,He=new t.Vector3,Re=new t.Vector3;class Wn extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const o=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=o.clone();e.opacity=.15;const r=s.clone();r.opacity=.5;const c=o.clone();c.color.setHex(16711680);const i=o.clone();i.color.setHex(65280);const l=o.clone();l.color.setHex(255);const m=o.clone();m.color.setHex(16711680),m.opacity=.5;const d=o.clone();d.color.setHex(65280),d.opacity=.5;const y=o.clone();y.color.setHex(255),y.opacity=.5;const R=o.clone();R.opacity=.25;const Z=o.clone();Z.color.setHex(16776960),Z.opacity=.25,o.clone().color.setHex(16776960);const F=o.clone();F.color.setHex(7895160);const O=new t.CylinderGeometry(0,.04,.1,12);O.translate(0,.05,0);const D=new t.BoxGeometry(.08,.08,.08);D.translate(0,.04,0);const I=new t.BufferGeometry;I.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const E=new t.CylinderGeometry(.0075,.0075,.5,3);E.translate(0,.25,0);function x(Y,U){const C=new t.TorusGeometry(Y,.0075,3,64,U*Math.PI*2);return C.rotateY(Math.PI/2),C.rotateX(Math.PI/2),C}function $(){const Y=new t.BufferGeometry;return Y.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),Y}const j={X:[[new t.Mesh(O,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(O,c),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(E,c),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(O,i),[0,.5,0]],[new t.Mesh(O,i),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(E,i)]],Z:[[new t.Mesh(O,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(O,l),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(E,l),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),R.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),y.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),m.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},Ee={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.2,0),e)]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]]},v={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new t.Line($(),r),null,null,null,"helper"]],X:[[new t.Line(I,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(I,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(I,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},he={XYZE:[[new t.Mesh(x(.5,1),F),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(x(.5,.5),c)]],Y:[[new t.Mesh(x(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(x(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(x(.75,1),Z),null,[0,Math.PI/2,0]]]},Le={AXIS:[[new t.Line(I,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},yt={XYZE:[[new t.Mesh(new t.SphereGeometry(.25,10,8),e)]],X:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[Math.PI/2,0,0]]],Z:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,0,-Math.PI/2]]],E:[[new t.Mesh(new t.TorusGeometry(.75,.1,2,24),e)]]},Se={X:[[new t.Mesh(D,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(E,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(D,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(D,i),[0,.5,0]],[new t.Mesh(E,i)],[new t.Mesh(D,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(D,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(E,l),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(D,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),y),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),m),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),R.clone())]]},pe={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.2),e),[0,0,0]]]},Pe={X:[[new t.Line(I,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(I,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(I,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function N(Y){const U=new t.Object3D;for(const C in Y)for(let J=Y[C].length;J--;){const T=Y[C][J][0].clone(),se=Y[C][J][1],me=Y[C][J][2],xe=Y[C][J][3],nt=Y[C][J][4];T.name=C,T.tag=nt,se&&T.position.set(se[0],se[1],se[2]),me&&T.rotation.set(me[0],me[1],me[2]),xe&&T.scale.set(xe[0],xe[1],xe[2]),T.updateMatrix();const ot=T.geometry.clone();ot.applyMatrix4(T.matrix),T.geometry=ot,T.renderOrder=1/0,T.position.set(0,0,0),T.rotation.set(0,0,0),T.scale.set(1,1,1),U.add(T)}return U}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=N(j)),this.add(this.gizmo.rotate=N(he)),this.add(this.gizmo.scale=N(Se)),this.add(this.picker.translate=N(Ee)),this.add(this.picker.rotate=N(yt)),this.add(this.picker.scale=N(pe)),this.add(this.helper.translate=N(v)),this.add(this.helper.rotate=N(Le)),this.add(this.helper.scale=N(Pe)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(o){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:pt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let r=[];r=r.concat(this.picker[this.mode].children),r=r.concat(this.gizmo[this.mode].children),r=r.concat(this.helper[this.mode].children);for(let c=0;c<r.length;c++){const i=r[c];i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition);let l;if(this.camera.isOrthographicCamera?l=(this.camera.top-this.camera.bottom)/this.camera.zoom:l=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(l*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(M.setFromEuler(rt.set(0,0,0)),i.quaternion.copy(e).multiply(M),Math.abs(b.copy(Ye).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(M.setFromEuler(rt.set(0,0,Math.PI/2)),i.quaternion.copy(e).multiply(M),Math.abs(b.copy(fe).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(M.setFromEuler(rt.set(0,Math.PI/2,0)),i.quaternion.copy(e).multiply(M),Math.abs(b.copy(Ce).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(M.setFromEuler(rt.set(0,Math.PI/2,0)),b.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(Jt.lookAt($t,b,fe)),i.quaternion.multiply(M),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),H.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),H.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(H),i.visible=this.dragging):(i.quaternion.copy(e),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(b.copy(Ye).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(b.copy(fe).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(b.copy(Ce).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(b.copy(Ce).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(b.copy(Ye).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(b.copy(fe).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(ct.copy(e),b.copy(this.eye).applyQuaternion(M.copy(e).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(Jt.lookAt(this.eye,$t,fe)),i.name==="X"&&(M.setFromAxisAngle(Ye,Math.atan2(-b.y,b.z)),M.multiplyQuaternions(ct,M),i.quaternion.copy(M)),i.name==="Y"&&(M.setFromAxisAngle(fe,Math.atan2(b.x,b.z)),M.multiplyQuaternions(ct,M),i.quaternion.copy(M)),i.name==="Z"&&(M.setFromAxisAngle(Ce,Math.atan2(b.y,b.x)),M.multiplyQuaternions(ct,M),i.quaternion.copy(M))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some(function(m){return i.name===m}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(o)}}class Kn extends t.Mesh{constructor(){super(new t.PlaneGeometry(1e5,1e5,2,2),new t.MeshBasicMaterial({visible:!1,wireframe:!0,side:t.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(o){let s=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(s="local"),lt.copy(Ye).applyQuaternion(s==="local"?this.worldQuaternion:pt),He.copy(fe).applyQuaternion(s==="local"?this.worldQuaternion:pt),Re.copy(Ce).applyQuaternion(s==="local"?this.worldQuaternion:pt),b.copy(He),this.mode){case"translate":case"scale":switch(this.axis){case"X":b.copy(this.eye).cross(lt),W.copy(lt).cross(b);break;case"Y":b.copy(this.eye).cross(He),W.copy(He).cross(b);break;case"Z":b.copy(this.eye).cross(Re),W.copy(Re).cross(b);break;case"XY":W.copy(Re);break;case"YZ":W.copy(lt);break;case"XZ":b.copy(Re),W.copy(He);break;case"XYZ":case"E":W.set(0,0,0);break}break;case"rotate":default:W.set(0,0,0)}W.length()===0?this.quaternion.copy(this.cameraQuaternion):(en.lookAt(H.set(0,0,0),W,b),this.quaternion.setFromRotationMatrix(en)),super.updateMatrixWorld(o)}}var V,ge;class $n{constructor(){u(this,V,void 0);u(this,ge,void 0);S(this,V,new Fn(P.en3.camera,P.en3.webglRenderer.domElement)),S(this,ge,new X.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",step:1e-4,ease:10}}}));let o=!0;a(this,ge).subscribe(s=>{a(this,V).target.set(...s.current),o&&a(this,V).update()}),a(this,V).addEventListener("change",()=>{o=!1,a(this,ge).current=[a(this,V).target.x,a(this,V).target.y,a(this,V).target.z],o=!0})}get controls(){return a(this,V)}destroy(){a(this,V).dispose(),a(this,ge).close()}}V=new WeakMap,ge=new WeakMap;var k,Fe,Ne,Qe,Ve,qe,Ue,Be,We;class Jn{constructor(){u(this,k,null);u(this,Fe,new X.Store(P.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));u(this,Ne,new X.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));u(this,Qe,new X.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));u(this,Ve,new X.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));u(this,qe,new X.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));u(this,Ue,new X.Store(!0,{passport:{name:"Helpers.Grid.Visible",manager:{type:"boolean"}}}));u(this,Be,void 0);u(this,We,o=>{o.key==="g"&&(a(this,k).visible=!a(this,k).visible)});S(this,Be,new On.Composed([a(this,Fe),a(this,Ne),a(this,Qe),a(this,Ve),a(this,qe),a(this,Ue)],()=>{a(this,k)&&(P.en3.view.remove(a(this,k)),a(this,k).dispose()),S(this,k,new t.GridHelper(a(this,Fe).current,a(this,Ne).current,a(this,Qe).current,a(this,Ve).current)),a(this,k).rotation.x=a(this,qe).current?Math.PI/2:0,a(this,k).visible=a(this,Ue).current,P.en3.view.add(a(this,k))})),addEventListener("keydown",a(this,We))}get helper(){return a(this,k)}destroy(){a(this,Be).close(),a(this,k)&&(P.en3.view.remove(a(this,k)),a(this,k).dispose()),removeEventListener("keydown",a(this,We))}}k=new WeakMap,Fe=new WeakMap,Ne=new WeakMap,Qe=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ue=new WeakMap,Be=new WeakMap,We=new WeakMap;var A,q,ce,le,Ke,_e,$e,Je,vt;class eo{constructor(){u(this,Je);u(this,A,void 0);u(this,q,[]);u(this,ce,null);u(this,le,o=>{if(o.child.name.startsWith("T.")&&!a(this,q).find(s=>s.object3d===o.child)){const s=new Tt(o.child);a(this,q).push(s),P.en3.raycaster.add(s.raycasterTarget,{eventDispatcher:s.raycasterTarget}),s.raycasterTarget.addEventListener("pointerDown",a(this,_e)),s.object3d.addEventListener("childadded",a(this,le))}});u(this,Ke,o=>{const s=_(this,Je,vt).call(this,o.child);s&&(P.en3.raycaster.remove(s.raycasterTarget),s.destroy(),s.raycasterTarget.removeEventListener("pointerDown",a(this,_e)),s.object3d.removeEventListener("childadded",a(this,le)),S(this,q,a(this,q).filter(e=>e!==s)))});u(this,_e,o=>{const s=_(this,Je,vt).call(this,o.target);s&&(S(this,ce,a(this,q).find(e=>e.object3d===(s==null?void 0:s.object3d))||null),a(this,ce)&&a(this,A).attach(a(this,ce).object3d))});u(this,$e,o=>{o.key==="t"?a(this,A).setMode("translate"):o.key==="r"?a(this,A).setMode("rotate"):o.key==="s"?a(this,A).setMode("scale"):o.key==="Escape"?a(this,A).detach():o.key==="+"||o.key==="="?a(this,A).setSize(a(this,A).size+.1):o.key==="-"||o.key==="_"?a(this,A).setSize(a(this,A).size-.1):o.key==="h"&&a(this,q).forEach(s=>{s.helpers.forEach(e=>{e.visible=!e.visible})})});S(this,A,new Nn(P.en3.camera,P.en3.webglRenderer.domElement)),a(this,A).addEventListener("objectChange",o=>{a(this,ce)&&a(this,ce).save()}),P.en3.view.add(a(this,A)),P.en3.scene.addEventListener("childadded",a(this,le)),P.en3.scene.addEventListener("childremoved",a(this,Ke)),window.addEventListener("keydown",a(this,$e))}get controls(){return a(this,A)}destroy(){P.en3.scene.removeEventListener("childadded",a(this,le)),P.en3.scene.removeEventListener("childremoved",a(this,Ke)),window.removeEventListener("keydown",a(this,$e)),a(this,A).dispose(),a(this,q).forEach(o=>{o.raycasterTarget.removeEventListener("pointerDown",a(this,_e)),o.object3d.removeEventListener("childadded",a(this,le)),o.destroy()}),S(this,q,[])}}A=new WeakMap,q=new WeakMap,ce=new WeakMap,le=new WeakMap,Ke=new WeakMap,_e=new WeakMap,$e=new WeakMap,Je=new WeakSet,vt=function(o){return a(this,q).find(e=>e.object3d===o||e.raycasterTarget===o)};var et,tt,Oe,Me,Ie;class to{constructor(){u(this,et,void 0);u(this,tt,void 0);u(this,Oe,void 0);u(this,Me,void 0);u(this,Ie,void 0);S(this,et,new nn(P.en3.webglRenderer)),S(this,tt,new Jn),S(this,Oe,new Tt(P.en3.camera)),S(this,Me,new $n),a(this,Me).controls.addEventListener("change",()=>{a(this,Oe).save()}),S(this,Ie,new eo),a(this,Ie).controls.addEventListener("dragging-changed",o=>{a(this,Me).controls.enabled=!o.value})}destroy(){a(this,et).destroy(),a(this,tt).destroy(),a(this,Oe).destroy(),a(this,Me).destroy(),a(this,Ie).destroy()}}et=new WeakMap,tt=new WeakMap,Oe=new WeakMap,Me=new WeakMap,Ie=new WeakMap;exports.En3Helpers=to;exports.En3Object3dManager=Tt;
|
|
1
|
+
"use strict";var zn=Object.defineProperty;var nn=Object.getOwnPropertySymbols;var Nn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable;var on=(m,n,a)=>n in m?zn(m,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):m[n]=a,ae=(m,n)=>{for(var a in n||(n={}))Nn.call(n,a)&&on(m,a,n[a]);if(nn)for(var a of nn(n))Xn.call(n,a)&&on(m,a,n[a]);return m};var Ot=(m,n,a)=>{if(!n.has(m))throw TypeError("Cannot "+a)};var s=(m,n,a)=>(Ot(m,n,"read from private field"),a?a.call(m):n.get(m)),u=(m,n,a)=>{if(n.has(m))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(m):n.set(m,a)},P=(m,n,a,e)=>(Ot(m,n,"write to private field"),e?e.call(m,a):n.set(m,a),a);var M=(m,n,a)=>(Ot(m,n,"access private method"),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../../en3-CBBYE8rb.cjs"),N=require("../../Store-6s0YXK4o.cjs"),t=require("three"),Zn=require("../../object-CCiXnER2.cjs"),sn=require("../../ticker/index.cjs"),Gn=require("../../Composed-Dx2hs-va.cjs"),Fn=require("../../traverseMaterials-BtBXV88O.cjs");function Vn(m){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const a in m)if(a!=="default"){const e=Object.getOwnPropertyDescriptor(m,a);Object.defineProperty(n,a,e.get?e:{enumerable:!0,get:()=>m[a]})}}return n.default=m,Object.freeze(n)}const fe=Vn(t),Qn=["AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation"],yn=["ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor"],qn=[...yn,"SrcAlphaSaturateFactor"],Un=["NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending"],Bn=["NeverDepth","AlwaysDepth","EqualDepth","LessDepth","LessEqualDepth ","GreaterEqualDepth ","GreaterDepth","NotEqualDepth"],Wn=["NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc ","GreaterStencilFunc","NotEqualStencilFunc ","GreaterEqualStencilFunc","AlwaysStencilFunc"],Dt=["ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp"],Kn=["FrontSide","BackSide","DoubleSide"],$n=["TangentSpaceNormalMap","ObjectSpaceNormalMap"],Jn=["round","bevel","miter"],eo=["NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","AgXToneMapping","NeutralToneMapping","CustomToneMapping"],to={intensity:{type:"number",min:0,max:20,step:1e-4},renderOrder:{type:"number",step:1},alphaTest:{type:"number",min:0,max:1,step:.001},blendAlpha:{type:"number",min:0,max:1,step:.001},blendDst:{type:"select",variants:qn},blendDstAlpha:{type:"number",min:0,max:1,step:.001},blendEquation:{type:"select",variants:Qn},blendEquationAlpha:{type:"number",min:0,max:1,step:.001},blending:{type:"select",variants:Un},blendSrc:{type:"select",variants:yn},blendSrcAlpha:{type:"number",min:0,max:1,step:.001},depthFunc:{type:"select",variants:Bn},stencilFunc:{type:"select",variants:Wn},stencilRef:{type:"number",min:0,step:1},stencilFail:{type:"select",variants:Dt},stencilZFail:{type:"select",variants:Dt},stencilZPass:{type:"select",variants:Dt},opacity:{type:"number",min:0,max:1,step:1e-4},side:{type:"select",variants:Kn},roughness:{type:"number",min:0,max:1,step:1e-4},metalness:{type:"number",min:0,max:1,step:1e-4},lightMapIntensity:{type:"number",min:0,max:20,step:1e-4},aoMapIntensity:{type:"number",min:0,max:20,step:1e-4},bumpScale:{type:"number",min:0,step:1e-4},normalMapType:{type:"select",variants:$n},wireframeLinejoin:{type:"select",variants:Jn},envMapIntensity:{type:"number",min:0,max:20,step:1e-4},emissiveIntensity:{type:"number",min:0,max:20,step:1e-4},fov:{type:"number",min:0,max:180,step:1},zoom:{type:"number",min:0,step:1e-4},near:{type:"number",min:0,step:1e-4},far:{type:"number",min:0,step:1},filmGauge:{type:"number",min:0,step:1e-4},filmOffset:{type:"number",min:0,step:1e-4},distance:{type:"number",min:0,step:.1},decay:{type:"number",min:0,step:1e-5,ease:.001},focus:{type:"number",min:0,max:1,step:1e-5},bias:{type:"number",min:0,max:.01,step:1e-6,ease:.01},blurSamples:{type:"number",min:0,step:1},normalBias:{type:"number",min:0,step:.001,ease:.01},radius:{type:"number",min:0,step:.001,ease:.01},penumbra:{type:"number",min:0,max:1,step:1e-6},power:{type:"number",min:0,step:.001,ease:.01},angle:{type:"number",min:0,step:1e-6,ease:.001},toneMapping:{type:"select",variants:eo},toneMappingExposure:{type:"number",min:0,step:.001,ease:.1},mapSize:{type:"number",min:0,step:1},damp:{type:"number",min:0,max:1,step:1e-6},strength:{type:"number",min:0,step:.01},threshold:{type:"number",min:0,max:1,step:1e-4}},no=new Set(["stencilFuncMask","needsUpdate","version","wireframeLinewidth","position","scale","rotation","coordinateSystem","aspect","autoUpdate","up"]);var Le,te,St,bn,Pt,wn,xt,gn,vt,Mn,Tt,En,qe,Rt,Ue,Ht,ne,be,oe,we;class pe{constructor(n,a){u(this,St);u(this,Pt);u(this,xt);u(this,vt);u(this,Tt);u(this,qe);u(this,Ue);u(this,ne);u(this,oe);u(this,Le,void 0);u(this,te,[]);P(this,Le,n);const e=ae(ae({},to),a==null?void 0:a.optionsCatalog),r=new Set([...no,...(a==null?void 0:a.skipKeys)||[]]),c=(a==null?void 0:a.folderName)||s(this,Le).name,i=a==null?void 0:a.afterChange;M(this,St,bn).call(this,{subject:s(this,Le),skipKeys:r,optionsCatalog:e,folderKey:c,afterChange:i})}destroy(){s(this,te).forEach(n=>{n.close()})}}Le=new WeakMap,te=new WeakMap,St=new WeakSet,bn=function(n){const{subject:a,folderKey:e,optionsCatalog:r,afterChange:c,skipKeys:i}=n;for(const l in a){if(l.startsWith("_")||i.has(l))continue;const d=a[l],p=M(this,ne,be).call(this,d),f=`${e}.${l}`,w=r[l];typeof p=="number"?(w==null?void 0:w.type)==="select"?M(this,qe,Rt).call(this,{name:f,value:d,subject:a,key:l,managerOptions:w,afterChange:c}):M(this,Pt,wn).call(this,{name:f,value:d,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof fe.Vector2||p instanceof fe.Vector3?M(this,xt,gn).call(this,{name:f,value:d,subject:a,key:l,managerOptions:w,afterChange:c}):typeof p=="boolean"&&!l.startsWith("is")&&!l.startsWith("matrix")?M(this,vt,Mn).call(this,{name:f,value:d,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof fe.Color?M(this,Tt,En).call(this,{name:f,value:d,subject:a,key:l,managerOptions:w,afterChange:c}):w&&(w==null?void 0:w.type)==="select"&&M(this,qe,Rt).call(this,{name:f,value:d,subject:a,key:l,managerOptions:w,afterChange:c})}},Pt=new WeakSet,wn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new N.Store(M(this,ne,be).call(this,a),{passport:{name:n,manager:ae({type:"number"},c)}});l.subscribe(d=>{M(this,oe,we).call(this,e,r,(p,f)=>p[f]=d.current),i==null||i()}),s(this,te).push(l)},xt=new WeakSet,gn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=p=>{const f=[p.x,p.y];return p instanceof fe.Vector3&&f.push(p.z),f},d=new N.Store(l(M(this,ne,be).call(this,a)),{passport:{name:n,manager:ae({type:"number"},c)}});d.subscribe(p=>{M(this,oe,we).call(this,e,r,(f,w)=>f[w].set(...p.current)),i==null||i()}),s(this,te).push(d)},vt=new WeakSet,Mn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new N.Store(M(this,ne,be).call(this,a),{passport:{name:n,manager:ae({type:"boolean"},c)}});l.subscribe(d=>{M(this,oe,we).call(this,e,r,(p,f)=>p[f]=d.current),i==null||i()}),s(this,te).push(l)},Tt=new WeakSet,En=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new N.Store(`#${M(this,ne,be).call(this,a).getHexString()}`,{passport:{name:n,manager:ae({type:"color"},c)}});l.subscribe(d=>{M(this,oe,we).call(this,e,r,(p,f)=>p[f]=new fe.Color(d.current)),i==null||i()}),s(this,te).push(l)},qe=new WeakSet,Rt=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=c==null?void 0:c.variants;if(l){let d=null;for(const f of l)a===fe[f]&&(d=f);const p=new N.Store(d||M(this,ne,be).call(this,a),{passport:{name:n,manager:ae({},c)}});p.subscribe(f=>{typeof f.current=="string"&&(f.current[0]===f.current[0].toUpperCase()?M(this,oe,we).call(this,e,r,(w,A)=>w[A]=fe[f.current]):M(this,oe,we).call(this,e,r,(w,A)=>w[A]=f.current)),i==null||i()}),s(this,te).push(p)}},Ue=new WeakSet,Ht=function(n){return Zn.isObject(n)&&"value"in n},ne=new WeakSet,be=function(n){return M(this,Ue,Ht).call(this,n)?n.value:n},oe=new WeakSet,we=function(n,a,e){M(this,Ue,Ht).call(this,n[a])?e(n[a],"value"):e(n,a)};var g,ce,Me,Ee,Se,Be,q,Oe,Mt,We;class Nt{constructor(n,a){u(this,Oe);u(this,g,void 0);u(this,ce,[]);u(this,Me,void 0);u(this,Ee,void 0);u(this,Se,void 0);u(this,Be,!0);u(this,q,[]);u(this,We,()=>{s(this,q).forEach(n=>{"update"in n&&n.update()})});var l,d;P(this,g,n);let e=!1;n.name.startsWith("T.")&&(n.name=n.name.slice(2)),n.name.includes("P.")&&(e=!0,n.name=n.name.replace("P.",""));const r=n.name;s(this,g).userData.controlled=!0;const c=(a==null?void 0:a.step)||1e-4,i=((l=n.userData)==null?void 0:l.box)||n;if(s(this,g)instanceof t.Light){let p;s(this,g)instanceof t.PointLight?p=new t.PointLightHelper(s(this,g),100):s(this,g)instanceof t.DirectionalLight?(s(this,g).scale.setScalar(100),p=new t.DirectionalLightHelper(s(this,g),1)):s(this,g)instanceof t.SpotLight?p=new t.SpotLightHelper(s(this,g)):s(this,g)instanceof t.HemisphereLight&&(p=new t.HemisphereLightHelper(s(this,g),100)),s(this,q).push(p);const f=(d=s(this,g).shadow)==null?void 0:d.camera;if(f instanceof t.Camera){const w=new t.CameraHelper(f);s(this,q).push(w)}}if(s(this,q).forEach(p=>{y.en3.view.add(p)}),P(this,Me,new N.Store([i.position.x,i.position.y,i.position.z],{passport:{name:`${r}.Transformation.Position`,manager:{type:"number",step:c}}})),P(this,Ee,new N.Store([i.rotation.x,i.rotation.y,i.rotation.z],{passport:{name:`${r}.Transformation.Rotation`,manager:{type:"number",step:c,ease:.01}}})),P(this,Se,new N.Store([i.scale.x,i.scale.y,i.scale.z],{passport:{name:`${r}.Transformation.Scale`,manager:{type:"number",step:c}}})),this.save(),P(this,Be,!1),s(this,Me).subscribe(p=>{M(this,Oe,Mt).call(this,"position",p.current)}),s(this,Ee).subscribe(p=>{M(this,Oe,Mt).call(this,"rotation",p.current)}),s(this,Se).subscribe(p=>{M(this,Oe,Mt).call(this,"scale",p.current)}),e){if(s(this,ce).push(new pe(s(this,g),{folderName:`${s(this,g).name}.Parameters`,afterChange:s(this,g)instanceof t.Camera?()=>{y.en3.view.resize()}:void 0})),s(this,g)instanceof t.Mesh){const p=s(this,g).material;p instanceof t.Material&&s(this,ce).push(new pe(p,{folderName:`${s(this,g).name}.Parameters.Material`,afterChange:()=>{p.needsUpdate=!0}}))}else if(s(this,g)instanceof t.Light){const p=s(this,g).shadow;p&&s(this,ce).push(new pe(p,{folderName:`${s(this,g).name}.Parameters.Shadow`,afterChange:()=>{p.needsUpdate=!0}})),p.camera&&s(this,ce).push(new pe(p,{folderName:`${s(this,g).name}.Parameters.Shadow.Camera`,afterChange:()=>{p.camera.updateProjectionMatrix()}}))}}s(this,q).length&&sn.ticker.subscribe(s(this,We))}get object3d(){return s(this,g)}get helpers(){return s(this,q)}get raycasterTarget(){return s(this,q)[0]||s(this,g)}destroy(){s(this,ce).forEach(n=>n.destroy()),s(this,Me).close(),s(this,Ee).close(),s(this,Se).close(),s(this,g).userData.controlled=!1,s(this,q).forEach(n=>{n&&"dispose"in n&&(n.dispose(),y.en3.view.remove(n))}),sn.ticker.unsubscribe(s(this,We))}save(){const n=(a,e)=>{(!s(this,Be)||a.initial===a.current)&&(a.current=[e.x,e.y,e.z])};n(s(this,Me),s(this,g).position),n(s(this,Ee),s(this,g).rotation),n(s(this,Se),s(this,g).scale)}}g=new WeakMap,ce=new WeakMap,Me=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Be=new WeakMap,q=new WeakMap,Oe=new WeakSet,Mt=function(n,a){const e=s(this,g).userData.box;if(e){const r=c=>({x:a[0]-c.x,y:a[1]-c.y,z:a[2]-c.z});n==="position"?e.setPositionStep("_manager","+",r(e.getIncludedPositionSteps("_manager"))):n==="rotation"?e.setRotationStep("_manager","+",r(e.getIncludedRotationSteps("_manager"))):n==="scale"&&e.setScaleStep("_manager","+",r(e.getIncludedScaleSteps("_manager")))}else s(this,g)[n].set(...a)},We=new WeakMap;const an={type:"change"},Ct={type:"start"},rn={type:"end"},yt=new t.Ray,cn=new t.Plane,oo=Math.cos(70*t.MathUtils.DEG2RAD);class io extends t.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new t.Vector3,this.cursor=new t.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:t.MOUSE.ROTATE,MIDDLE:t.MOUSE.DOLLY,RIGHT:t.MOUSE.PAN},this.touches={ONE:t.TOUCH.ROTATE,TWO:t.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",Lt),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Lt),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(an),e.update(),c=r.NONE},this.update=function(){const o=new t.Vector3,h=new t.Quaternion().setFromUnitVectors(n.up,new t.Vector3(0,1,0)),b=h.clone().invert(),S=new t.Vector3,z=new t.Quaternion,se=new t.Vector3,G=2*Math.PI;return function(Yn=null){const en=e.object.position;o.copy(en).sub(e.target),o.applyQuaternion(h),l.setFromVector3(o),e.autoRotate&&c===r.NONE&&ue(It(Yn)),e.enableDamping?(l.theta+=d.theta*e.dampingFactor,l.phi+=d.phi*e.dampingFactor):(l.theta+=d.theta,l.phi+=d.phi);let $=e.minAzimuthAngle,J=e.maxAzimuthAngle;isFinite($)&&isFinite(J)&&($<-Math.PI?$+=G:$>Math.PI&&($-=G),J<-Math.PI?J+=G:J>Math.PI&&(J-=G),$<=J?l.theta=Math.max($,Math.min(J,l.theta)):l.theta=l.theta>($+J)/2?Math.max($,l.theta):Math.min(J,l.theta)),l.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,l.phi)),l.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(f,e.dampingFactor):e.target.add(f),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let Xe=!1;if(e.zoomToCursor&&ve||e.object.isOrthographicCamera)l.radius=ie(l.radius);else{const ee=l.radius;l.radius=ie(l.radius*p),Xe=ee!=l.radius}if(o.setFromSpherical(l),o.applyQuaternion(b),en.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(d.theta*=1-e.dampingFactor,d.phi*=1-e.dampingFactor,f.multiplyScalar(1-e.dampingFactor)):(d.set(0,0,0),f.set(0,0,0)),e.zoomToCursor&&ve){let ee=null;if(e.object.isPerspectiveCamera){const Ze=o.length();ee=ie(Ze*p);const ft=Ze-ee;e.object.position.addScaledVector(W,ft),e.object.updateMatrixWorld(),Xe=!!ft}else if(e.object.isOrthographicCamera){const Ze=new t.Vector3(j.x,j.y,0);Ze.unproject(e.object);const ft=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),e.object.updateProjectionMatrix(),Xe=ft!==e.object.zoom;const tn=new t.Vector3(j.x,j.y,0);tn.unproject(e.object),e.object.position.sub(tn).add(Ze),e.object.updateMatrixWorld(),ee=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;ee!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(ee).add(e.object.position):(yt.origin.copy(e.object.position),yt.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(yt.direction))<oo?n.lookAt(e.target):(cn.setFromNormalAndCoplanarPoint(e.object.up,e.target),yt.intersectPlane(cn,e.target))))}else if(e.object.isOrthographicCamera){const ee=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),ee!==e.object.zoom&&(e.object.updateProjectionMatrix(),Xe=!0)}return p=1,ve=!1,Xe||S.distanceToSquared(e.object.position)>i||8*(1-z.dot(e.object.quaternion))>i||se.distanceToSquared(e.target)>i?(e.dispatchEvent(an),S.copy(e.object.position),z.copy(e.object.quaternion),se.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",$t),e.domElement.removeEventListener("pointerdown",qt),e.domElement.removeEventListener("pointercancel",Ne),e.domElement.removeEventListener("wheel",Ut),e.domElement.removeEventListener("pointermove",At),e.domElement.removeEventListener("pointerup",Ne),e.domElement.getRootNode().removeEventListener("keydown",Bt,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",Lt),e._domElementKeyEvents=null)};const e=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=r.NONE;const i=1e-6,l=new t.Spherical,d=new t.Spherical;let p=1;const f=new t.Vector3,w=new t.Vector2,A=new t.Vector2,B=new t.Vector2,X=new t.Vector2,L=new t.Vector2,C=new t.Vector2,O=new t.Vector2,v=new t.Vector2,T=new t.Vector2,W=new t.Vector3,j=new t.Vector2;let ve=!1;const _=[],me={};let ze=!1;function It(o){return o!==null?2*Math.PI/60*e.autoRotateSpeed*o:2*Math.PI/60/60*e.autoRotateSpeed}function Te(o){const h=Math.abs(o*.01);return Math.pow(.95,e.zoomSpeed*h)}function ue(o){d.theta-=o}function _e(o){d.phi-=o}const Z=function(){const o=new t.Vector3;return function(b,S){o.setFromMatrixColumn(S,0),o.multiplyScalar(-b),f.add(o)}}(),H=function(){const o=new t.Vector3;return function(b,S){e.screenSpacePanning===!0?o.setFromMatrixColumn(S,1):(o.setFromMatrixColumn(S,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(b),f.add(o)}}(),Q=function(){const o=new t.Vector3;return function(b,S){const z=e.domElement;if(e.object.isPerspectiveCamera){const se=e.object.position;o.copy(se).sub(e.target);let G=o.length();G*=Math.tan(e.object.fov/2*Math.PI/180),Z(2*b*G/z.clientHeight,e.object.matrix),H(2*S*G/z.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(Z(b*(e.object.right-e.object.left)/e.object.zoom/z.clientWidth,e.object.matrix),H(S*(e.object.top-e.object.bottom)/e.object.zoom/z.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function Y(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?p/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function K(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?p*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function I(o,h){if(!e.zoomToCursor)return;ve=!0;const b=e.domElement.getBoundingClientRect(),S=o-b.left,z=h-b.top,se=b.width,G=b.height;j.x=S/se*2-1,j.y=-(z/G)*2+1,W.set(j.x,j.y,1).unproject(e.object).sub(e.object.position).normalize()}function ie(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function de(o){w.set(o.clientX,o.clientY)}function Ie(o){I(o.clientX,o.clientX),O.set(o.clientX,o.clientY)}function ut(o){X.set(o.clientX,o.clientY)}function dt(o){A.set(o.clientX,o.clientY),B.subVectors(A,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;ue(2*Math.PI*B.x/h.clientHeight),_e(2*Math.PI*B.y/h.clientHeight),w.copy(A),e.update()}function Pn(o){v.set(o.clientX,o.clientY),T.subVectors(v,O),T.y>0?Y(Te(T.y)):T.y<0&&K(Te(T.y)),O.copy(v),e.update()}function xn(o){L.set(o.clientX,o.clientY),C.subVectors(L,X).multiplyScalar(e.panSpeed),Q(C.x,C.y),X.copy(L),e.update()}function vn(o){I(o.clientX,o.clientY),o.deltaY<0?K(Te(o.deltaY)):o.deltaY>0&&Y(Te(o.deltaY)),e.update()}function Tn(o){let h=!1;switch(o.code){case e.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?_e(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Q(0,e.keyPanSpeed),h=!0;break;case e.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?_e(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Q(0,-e.keyPanSpeed),h=!0;break;case e.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?ue(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Q(e.keyPanSpeed,0),h=!0;break;case e.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?ue(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Q(-e.keyPanSpeed,0),h=!0;break}h&&(o.preventDefault(),e.update())}function Xt(o){if(_.length===1)w.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),S=.5*(o.pageY+h.y);w.set(b,S)}}function Zt(o){if(_.length===1)X.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),S=.5*(o.pageY+h.y);X.set(b,S)}}function Gt(o){const h=Ae(o),b=o.pageX-h.x,S=o.pageY-h.y,z=Math.sqrt(b*b+S*S);O.set(0,z)}function _n(o){e.enableZoom&&Gt(o),e.enablePan&&Zt(o)}function In(o){e.enableZoom&&Gt(o),e.enableRotate&&Xt(o)}function Ft(o){if(_.length==1)A.set(o.pageX,o.pageY);else{const b=Ae(o),S=.5*(o.pageX+b.x),z=.5*(o.pageY+b.y);A.set(S,z)}B.subVectors(A,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;ue(2*Math.PI*B.x/h.clientHeight),_e(2*Math.PI*B.y/h.clientHeight),w.copy(A)}function Vt(o){if(_.length===1)L.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),S=.5*(o.pageY+h.y);L.set(b,S)}C.subVectors(L,X).multiplyScalar(e.panSpeed),Q(C.x,C.y),X.copy(L)}function Qt(o){const h=Ae(o),b=o.pageX-h.x,S=o.pageY-h.y,z=Math.sqrt(b*b+S*S);v.set(0,z),T.set(0,Math.pow(v.y/O.y,e.zoomSpeed)),Y(T.y),O.copy(v);const se=(o.pageX+h.x)*.5,G=(o.pageY+h.y)*.5;I(se,G)}function An(o){e.enableZoom&&Qt(o),e.enablePan&&Vt(o)}function Ln(o){e.enableZoom&&Qt(o),e.enableRotate&&Ft(o)}function qt(o){e.enabled!==!1&&(_.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",At),e.domElement.addEventListener("pointerup",Ne)),!Hn(o)&&(kn(o),o.pointerType==="touch"?Kt(o):On(o)))}function At(o){e.enabled!==!1&&(o.pointerType==="touch"?jn(o):Dn(o))}function Ne(o){switch(Rn(o),_.length){case 0:e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",At),e.domElement.removeEventListener("pointerup",Ne),e.dispatchEvent(rn),c=r.NONE;break;case 1:const h=_[0],b=me[h];Kt({pointerId:h,pageX:b.x,pageY:b.y});break}}function On(o){let h;switch(o.button){case 0:h=e.mouseButtons.LEFT;break;case 1:h=e.mouseButtons.MIDDLE;break;case 2:h=e.mouseButtons.RIGHT;break;default:h=-1}switch(h){case t.MOUSE.DOLLY:if(e.enableZoom===!1)return;Ie(o),c=r.DOLLY;break;case t.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enablePan===!1)return;ut(o),c=r.PAN}else{if(e.enableRotate===!1)return;de(o),c=r.ROTATE}break;case t.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;de(o),c=r.ROTATE}else{if(e.enablePan===!1)return;ut(o),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(Ct)}function Dn(o){switch(c){case r.ROTATE:if(e.enableRotate===!1)return;dt(o);break;case r.DOLLY:if(e.enableZoom===!1)return;Pn(o);break;case r.PAN:if(e.enablePan===!1)return;xn(o);break}}function Ut(o){e.enabled===!1||e.enableZoom===!1||c!==r.NONE||(o.preventDefault(),e.dispatchEvent(Ct),vn(Cn(o)),e.dispatchEvent(rn))}function Cn(o){const h=o.deltaMode,b={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(h){case 1:b.deltaY*=16;break;case 2:b.deltaY*=100;break}return o.ctrlKey&&!ze&&(b.deltaY*=10),b}function Bt(o){o.key==="Control"&&(ze=!0,e.domElement.getRootNode().addEventListener("keyup",Wt,{passive:!0,capture:!0}))}function Wt(o){o.key==="Control"&&(ze=!1,e.domElement.getRootNode().removeEventListener("keyup",Wt,{passive:!0,capture:!0}))}function Lt(o){e.enabled===!1||e.enablePan===!1||Tn(o)}function Kt(o){switch(Jt(o),_.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;Xt(o),c=r.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;Zt(o),c=r.TOUCH_PAN;break;default:c=r.NONE}break;case 2:switch(e.touches.TWO){case t.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;_n(o),c=r.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;In(o),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(Ct)}function jn(o){switch(Jt(o),c){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;Ft(o),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;Vt(o),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;An(o),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Ln(o),e.update();break;default:c=r.NONE}}function $t(o){e.enabled!==!1&&o.preventDefault()}function kn(o){_.push(o.pointerId)}function Rn(o){delete me[o.pointerId];for(let h=0;h<_.length;h++)if(_[h]==o.pointerId){_.splice(h,1);return}}function Hn(o){for(let h=0;h<_.length;h++)if(_[h]==o.pointerId)return!0;return!1}function Jt(o){let h=me[o.pointerId];h===void 0&&(h=new t.Vector2,me[o.pointerId]=h),h.set(o.pageX,o.pageY)}function Ae(o){const h=o.pointerId===_[0]?_[1]:_[0];return me[h]}e.domElement.addEventListener("contextmenu",$t),e.domElement.addEventListener("pointerdown",qt),e.domElement.addEventListener("pointercancel",Ne),e.domElement.addEventListener("wheel",Ut,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Bt,{passive:!0,capture:!0}),this.update()}}const ye=new t.Raycaster,R=new t.Vector3,re=new t.Vector3,x=new t.Quaternion,ln={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},jt={type:"change"},hn={type:"mouseDown",mode:null},pn={type:"mouseUp",mode:null},mn={type:"objectChange"};class so extends t.Object3D{constructor(n,a){super(),a===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),a=document),this.isTransformControls=!0,this.visible=!1,this.domElement=a,this.domElement.style.touchAction="none";const e=new po;this._gizmo=e,this.add(e);const r=new mo;this._plane=r,this.add(r);const c=this;function i(v,T){let W=T;Object.defineProperty(c,v,{get:function(){return W!==void 0?W:T},set:function(j){W!==j&&(W=j,r[v]=j,e[v]=j,c.dispatchEvent({type:v+"-changed",value:j}),c.dispatchEvent(jt))}}),c[v]=T,r[v]=T,e[v]=T}i("camera",n),i("object",void 0),i("enabled",!0),i("axis",null),i("mode","translate"),i("translationSnap",null),i("rotationSnap",null),i("scaleSnap",null),i("space","world"),i("size",1),i("dragging",!1),i("showX",!0),i("showY",!0),i("showZ",!0);const l=new t.Vector3,d=new t.Vector3,p=new t.Quaternion,f=new t.Quaternion,w=new t.Vector3,A=new t.Quaternion,B=new t.Vector3,X=new t.Vector3,L=new t.Vector3,C=0,O=new t.Vector3;i("worldPosition",l),i("worldPositionStart",d),i("worldQuaternion",p),i("worldQuaternionStart",f),i("cameraPosition",w),i("cameraQuaternion",A),i("pointStart",B),i("pointEnd",X),i("rotationAxis",L),i("rotationAngle",C),i("eye",O),this._offset=new t.Vector3,this._startNorm=new t.Vector3,this._endNorm=new t.Vector3,this._cameraScale=new t.Vector3,this._parentPosition=new t.Vector3,this._parentQuaternion=new t.Quaternion,this._parentQuaternionInv=new t.Quaternion,this._parentScale=new t.Vector3,this._worldScaleStart=new t.Vector3,this._worldQuaternionInv=new t.Quaternion,this._worldScale=new t.Vector3,this._positionStart=new t.Vector3,this._quaternionStart=new t.Quaternion,this._scaleStart=new t.Vector3,this._getPointer=ao.bind(this),this._onPointerDown=co.bind(this),this._onPointerHover=ro.bind(this),this._onPointerMove=lo.bind(this),this._onPointerUp=ho.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(n){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(n)}pointerHover(n){if(this.object===void 0||this.dragging===!0)return;n!==null&&ye.setFromCamera(n,this.camera);const a=kt(this._gizmo.picker[this.mode],ye);a?this.axis=a.object.name:this.axis=null}pointerDown(n){if(!(this.object===void 0||this.dragging===!0||n!=null&&n.button!==0)&&this.axis!==null){n!==null&&ye.setFromCamera(n,this.camera);const a=kt(this._plane,ye,!0);a&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(a.point).sub(this.worldPositionStart)),this.dragging=!0,hn.mode=this.mode,this.dispatchEvent(hn)}}pointerMove(n){const a=this.axis,e=this.mode,r=this.object;let c=this.space;if(e==="scale"?c="local":(a==="E"||a==="XYZE"||a==="XYZ")&&(c="world"),r===void 0||a===null||this.dragging===!1||n!==null&&n.button!==-1)return;n!==null&&ye.setFromCamera(n,this.camera);const i=kt(this._plane,ye,!0);if(i){if(this.pointEnd.copy(i.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&a!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),a.indexOf("X")===-1&&(this._offset.x=0),a.indexOf("Y")===-1&&(this._offset.y=0),a.indexOf("Z")===-1&&(this._offset.z=0),c==="local"&&a!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(c==="local"&&(r.position.applyQuaternion(x.copy(this._quaternionStart).invert()),a.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),c==="world"&&(r.parent&&r.position.add(R.setFromMatrixPosition(r.parent.matrixWorld)),a.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(R.setFromMatrixPosition(r.parent.matrixWorld))));else if(e==="scale"){if(a.search("XYZ")!==-1){let l=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(l*=-1),re.set(l,l,l)}else R.copy(this.pointStart),re.copy(this.pointEnd),R.applyQuaternion(this._worldQuaternionInv),re.applyQuaternion(this._worldQuaternionInv),re.divide(R),a.search("X")===-1&&(re.x=1),a.search("Y")===-1&&(re.y=1),a.search("Z")===-1&&(re.z=1);r.scale.copy(this._scaleStart).multiply(re),this.scaleSnap&&(a.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Z")!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const l=20/this.worldPosition.distanceTo(R.setFromMatrixPosition(this.camera.matrixWorld));let d=!1;a==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(R.copy(this.rotationAxis).cross(this.eye))*l):(a==="X"||a==="Y"||a==="Z")&&(this.rotationAxis.copy(ln[a]),R.copy(ln[a]),c==="local"&&R.applyQuaternion(this.worldQuaternion),R.cross(this.eye),R.length()===0?d=!0:this.rotationAngle=this._offset.dot(R.normalize())*l),(a==="E"||d)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),c==="local"&&a!=="E"&&a!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(x.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(x.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(jt),this.dispatchEvent(mn)}}pointerUp(n){n!==null&&n.button!==0||(this.dragging&&this.axis!==null&&(pn.mode=this.mode,this.dispatchEvent(pn)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(n){n.geometry&&n.geometry.dispose(),n.material&&n.material.dispose()})}attach(n){return this.object=n,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(jt),this.dispatchEvent(mn),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ye}getMode(){return this.mode}setMode(n){this.mode=n}setTranslationSnap(n){this.translationSnap=n}setRotationSnap(n){this.rotationSnap=n}setScaleSnap(n){this.scaleSnap=n}setSize(n){this.size=n}setSpace(n){this.space=n}}function ao(m){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:m.button};{const n=this.domElement.getBoundingClientRect();return{x:(m.clientX-n.left)/n.width*2-1,y:-(m.clientY-n.top)/n.height*2+1,button:m.button}}}function ro(m){if(this.enabled)switch(m.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(m));break}}function co(m){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(m.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(m)),this.pointerDown(this._getPointer(m)))}function lo(m){this.enabled&&this.pointerMove(this._getPointer(m))}function ho(m){this.enabled&&(this.domElement.releasePointerCapture(m.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(m)))}function kt(m,n,a){const e=n.intersectObject(m,!0);for(let r=0;r<e.length;r++)if(e[r].object.visible||a)return e[r];return!1}const bt=new t.Euler,E=new t.Vector3(0,1,0),un=new t.Vector3(0,0,0),dn=new t.Matrix4,wt=new t.Quaternion,Et=new t.Quaternion,U=new t.Vector3,fn=new t.Matrix4,Ve=new t.Vector3(1,0,0),ge=new t.Vector3(0,1,0),Qe=new t.Vector3(0,0,1),gt=new t.Vector3,Ge=new t.Vector3,Fe=new t.Vector3;class po extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const n=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),a=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=n.clone();e.opacity=.15;const r=a.clone();r.opacity=.5;const c=n.clone();c.color.setHex(16711680);const i=n.clone();i.color.setHex(65280);const l=n.clone();l.color.setHex(255);const d=n.clone();d.color.setHex(16711680),d.opacity=.5;const p=n.clone();p.color.setHex(65280),p.opacity=.5;const f=n.clone();f.color.setHex(255),f.opacity=.5;const w=n.clone();w.opacity=.25;const A=n.clone();A.color.setHex(16776960),A.opacity=.25,n.clone().color.setHex(16776960);const X=n.clone();X.color.setHex(7895160);const L=new t.CylinderGeometry(0,.04,.1,12);L.translate(0,.05,0);const C=new t.BoxGeometry(.08,.08,.08);C.translate(0,.04,0);const O=new t.BufferGeometry;O.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const v=new t.CylinderGeometry(.0075,.0075,.5,3);v.translate(0,.25,0);function T(H,Q){const Y=new t.TorusGeometry(H,.0075,3,64,Q*Math.PI*2);return Y.rotateY(Math.PI/2),Y.rotateX(Math.PI/2),Y}function W(){const H=new t.BufferGeometry;return H.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),H}const j={X:[[new t.Mesh(L,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(L,c),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(v,c),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(L,i),[0,.5,0]],[new t.Mesh(L,i),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(v,i)]],Z:[[new t.Mesh(L,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(L,l),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(v,l),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),w.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),f.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),p.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},ve={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.2,0),e)]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]]},_={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new t.Line(W(),r),null,null,null,"helper"]],X:[[new t.Line(O,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(O,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(O,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},me={XYZE:[[new t.Mesh(T(.5,1),X),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(T(.5,.5),c)]],Y:[[new t.Mesh(T(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(T(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(T(.75,1),A),null,[0,Math.PI/2,0]]]},ze={AXIS:[[new t.Line(O,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},It={XYZE:[[new t.Mesh(new t.SphereGeometry(.25,10,8),e)]],X:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[Math.PI/2,0,0]]],Z:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,0,-Math.PI/2]]],E:[[new t.Mesh(new t.TorusGeometry(.75,.1,2,24),e)]]},Te={X:[[new t.Mesh(C,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(v,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(C,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(C,i),[0,.5,0]],[new t.Mesh(v,i)],[new t.Mesh(C,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(C,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(v,l),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(C,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),f),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),p),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),w.clone())]]},ue={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.2),e),[0,0,0]]]},_e={X:[[new t.Line(O,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(O,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(O,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Z(H){const Q=new t.Object3D;for(const Y in H)for(let K=H[Y].length;K--;){const I=H[Y][K][0].clone(),ie=H[Y][K][1],de=H[Y][K][2],Ie=H[Y][K][3],ut=H[Y][K][4];I.name=Y,I.tag=ut,ie&&I.position.set(ie[0],ie[1],ie[2]),de&&I.rotation.set(de[0],de[1],de[2]),Ie&&I.scale.set(Ie[0],Ie[1],Ie[2]),I.updateMatrix();const dt=I.geometry.clone();dt.applyMatrix4(I.matrix),I.geometry=dt,I.renderOrder=1/0,I.position.set(0,0,0),I.rotation.set(0,0,0),I.scale.set(1,1,1),Q.add(I)}return Q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Z(j)),this.add(this.gizmo.rotate=Z(me)),this.add(this.gizmo.scale=Z(Te)),this.add(this.picker.translate=Z(ve)),this.add(this.picker.rotate=Z(It)),this.add(this.picker.scale=Z(ue)),this.add(this.helper.translate=Z(_)),this.add(this.helper.rotate=Z(ze)),this.add(this.helper.scale=Z(_e)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(n){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Et;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let r=[];r=r.concat(this.picker[this.mode].children),r=r.concat(this.gizmo[this.mode].children),r=r.concat(this.helper[this.mode].children);for(let c=0;c<r.length;c++){const i=r[c];i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition);let l;if(this.camera.isOrthographicCamera?l=(this.camera.top-this.camera.bottom)/this.camera.zoom:l=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(l*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(x.setFromEuler(bt.set(0,0,0)),i.quaternion.copy(e).multiply(x),Math.abs(E.copy(Ve).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(x.setFromEuler(bt.set(0,0,Math.PI/2)),i.quaternion.copy(e).multiply(x),Math.abs(E.copy(ge).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(x.setFromEuler(bt.set(0,Math.PI/2,0)),i.quaternion.copy(e).multiply(x),Math.abs(E.copy(Qe).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(x.setFromEuler(bt.set(0,Math.PI/2,0)),E.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(dn.lookAt(un,E,ge)),i.quaternion.multiply(x),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),R.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),R.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(R),i.visible=this.dragging):(i.quaternion.copy(e),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(E.copy(Ve).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(E.copy(ge).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(E.copy(Qe).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(E.copy(Qe).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(E.copy(Ve).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(E.copy(ge).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(wt.copy(e),E.copy(this.eye).applyQuaternion(x.copy(e).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(dn.lookAt(this.eye,un,ge)),i.name==="X"&&(x.setFromAxisAngle(Ve,Math.atan2(-E.y,E.z)),x.multiplyQuaternions(wt,x),i.quaternion.copy(x)),i.name==="Y"&&(x.setFromAxisAngle(ge,Math.atan2(E.x,E.z)),x.multiplyQuaternions(wt,x),i.quaternion.copy(x)),i.name==="Z"&&(x.setFromAxisAngle(Qe,Math.atan2(E.y,E.x)),x.multiplyQuaternions(wt,x),i.quaternion.copy(x))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some(function(d){return i.name===d}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(n)}}class mo extends t.Mesh{constructor(){super(new t.PlaneGeometry(1e5,1e5,2,2),new t.MeshBasicMaterial({visible:!1,wireframe:!0,side:t.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(n){let a=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(a="local"),gt.copy(Ve).applyQuaternion(a==="local"?this.worldQuaternion:Et),Ge.copy(ge).applyQuaternion(a==="local"?this.worldQuaternion:Et),Fe.copy(Qe).applyQuaternion(a==="local"?this.worldQuaternion:Et),E.copy(Ge),this.mode){case"translate":case"scale":switch(this.axis){case"X":E.copy(this.eye).cross(gt),U.copy(gt).cross(E);break;case"Y":E.copy(this.eye).cross(Ge),U.copy(Ge).cross(E);break;case"Z":E.copy(this.eye).cross(Fe),U.copy(Fe).cross(E);break;case"XY":U.copy(Fe);break;case"YZ":U.copy(gt);break;case"XZ":E.copy(Fe),U.copy(Ge);break;case"XYZ":case"E":U.set(0,0,0);break}break;case"rotate":default:U.set(0,0,0)}U.length()===0?this.quaternion.copy(this.cameraQuaternion):(fn.lookAt(R.set(0,0,0),U,E),this.quaternion.setFromRotationMatrix(fn)),super.updateMatrixWorld(n)}}var F,Pe;class uo{constructor(){u(this,F,void 0);u(this,Pe,void 0);P(this,F,new io(y.en3.camera,y.en3.webglRenderer.domElement)),P(this,Pe,new N.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",invisible:!0}}}));let n=!0;s(this,Pe).subscribe(a=>{s(this,F).target.set(...a.current),n&&s(this,F).update()}),s(this,F).addEventListener("change",()=>{n=!1,s(this,Pe).current=[s(this,F).target.x,s(this,F).target.y,s(this,F).target.z],n=!0})}get controls(){return s(this,F)}destroy(){s(this,F).dispose(),s(this,Pe).close()}}F=new WeakMap,Pe=new WeakMap;var k,Ke,$e,Je,et,tt,nt,ot,it;class fo{constructor(){u(this,k,null);u(this,Ke,new N.Store(y.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));u(this,$e,new N.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));u(this,Je,new N.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));u(this,et,new N.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));u(this,tt,new N.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));u(this,nt,new N.Store(!0,{passport:{name:"Helpers.Grid.Visible",manager:{type:"boolean"}}}));u(this,ot,void 0);u(this,it,n=>{n.key==="g"&&(s(this,k).visible=!s(this,k).visible)});P(this,ot,new Gn.Composed([s(this,Ke),s(this,$e),s(this,Je),s(this,et),s(this,tt),s(this,nt)],()=>{s(this,k)&&(y.en3.view.remove(s(this,k)),s(this,k).dispose()),P(this,k,new t.GridHelper(s(this,Ke).current,s(this,$e).current,s(this,Je).current,s(this,et).current)),s(this,k).rotation.x=s(this,tt).current?Math.PI/2:0,s(this,k).visible=s(this,nt).current,y.en3.view.add(s(this,k))})),addEventListener("keydown",s(this,it))}get helper(){return s(this,k)}destroy(){s(this,ot).close(),s(this,k)&&(y.en3.view.remove(s(this,k)),s(this,k).dispose()),removeEventListener("keydown",s(this,it))}}k=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,ot=new WeakMap,it=new WeakMap;var D,V,le,he,st,De,at,rt,Yt;class yo{constructor(){u(this,rt);u(this,D,void 0);u(this,V,[]);u(this,le,null);u(this,he,n=>{if(n.child.name.startsWith("T.")&&!s(this,V).find(a=>a.object3d===n.child)){const a=new Nt(n.child);s(this,V).push(a),y.en3.raycaster.add(a.raycasterTarget,{eventDispatcher:a.raycasterTarget}),a.raycasterTarget.addEventListener("pointerDown",s(this,De)),a.object3d.addEventListener("childadded",s(this,he))}});u(this,st,n=>{const a=M(this,rt,Yt).call(this,n.child);a&&(y.en3.raycaster.remove(a.raycasterTarget),a.destroy(),a.raycasterTarget.removeEventListener("pointerDown",s(this,De)),a.object3d.removeEventListener("childadded",s(this,he)),P(this,V,s(this,V).filter(e=>e!==a)))});u(this,De,n=>{const a=M(this,rt,Yt).call(this,n.target);a&&(P(this,le,s(this,V).find(e=>e.object3d===(a==null?void 0:a.object3d))||null),s(this,le)&&s(this,D).attach(s(this,le).object3d))});u(this,at,n=>{n.key==="t"?s(this,D).setMode("translate"):n.key==="r"?s(this,D).setMode("rotate"):n.key==="s"?s(this,D).setMode("scale"):n.key==="Escape"?s(this,D).detach():n.key==="+"||n.key==="="?s(this,D).setSize(s(this,D).size+.1):n.key==="-"||n.key==="_"?s(this,D).setSize(s(this,D).size-.1):n.key==="h"&&s(this,V).forEach(a=>{a.helpers.forEach(e=>{e.visible=!e.visible})})});P(this,D,new so(y.en3.camera,y.en3.webglRenderer.domElement)),s(this,D).addEventListener("objectChange",n=>{s(this,le)&&s(this,le).save()}),y.en3.view.add(s(this,D)),y.en3.scene.addEventListener("childadded",s(this,he)),y.en3.scene.addEventListener("childremoved",s(this,st)),window.addEventListener("keydown",s(this,at))}get controls(){return s(this,D)}destroy(){y.en3.scene.removeEventListener("childadded",s(this,he)),y.en3.scene.removeEventListener("childremoved",s(this,st)),window.removeEventListener("keydown",s(this,at)),s(this,D).dispose(),s(this,V).forEach(n=>{n.raycasterTarget.removeEventListener("pointerDown",s(this,De)),n.object3d.removeEventListener("childadded",s(this,he)),n.destroy()}),P(this,V,[])}}D=new WeakMap,V=new WeakMap,le=new WeakMap,he=new WeakMap,st=new WeakMap,De=new WeakMap,at=new WeakMap,rt=new WeakSet,Yt=function(n){return s(this,V).find(e=>e.object3d===n||e.raycasterTarget===n)};var Ce,je,ke,Re,ct,zt,_t,Sn;class bo{constructor(){u(this,ct);u(this,_t);u(this,Ce,void 0);u(this,je,void 0);u(this,ke,void 0);u(this,Re,[]);P(this,Ce,y.en3.composer.addPass=y.en3.composer.addPass.bind(y.en3.composer)),y.en3.composer.addPass=(...n)=>{M(this,ct,zt).call(this,n[0]),s(this,Ce).call(this,...n)},P(this,je,y.en3.composer.removePass=y.en3.composer.removePass.bind(y.en3.composer)),y.en3.composer.removePass=(...n)=>{M(this,_t,Sn).call(this,n[0]),s(this,je).call(this,...n)},P(this,ke,y.en3.composer.insertPass=y.en3.composer.insertPass.bind(y.en3.composer)),y.en3.composer.insertPass=(...n)=>{M(this,ct,zt).call(this,n[0]),s(this,ke).call(this,...n)}}destroy(){y.en3.composer.addPass=s(this,Ce),y.en3.composer.removePass=s(this,je),y.en3.composer.insertPass=s(this,ke),s(this,Re).forEach(n=>{n.destroy()})}}Ce=new WeakMap,je=new WeakMap,ke=new WeakMap,Re=new WeakMap,ct=new WeakSet,zt=function(n){s(this,Re).push(new pe(n,{folderName:`EffectComposer.${n.constructor.name}`,skipKeys:["renderToScreen","needsSwap","nMips","oldClearAlpha","clearColor","resolution"]})),"uniforms"in n&&s(this,Re).push(new pe(n.uniforms,{folderName:`EffectComposer.${n.constructor.name}.Uniforms`,optionsCatalog:{maxblur:{type:"number",min:0,max:1,step:1e-5,ease:.1},aperture:{type:"number",min:0,max:.01,step:1e-6},focus:{type:"number",min:0,step:.01}},skipKeys:["time","resolution"]}))},_t=new WeakSet,Sn=function(n){};var lt,ht,pt,mt,He,xe,Ye;class wo{constructor(){u(this,lt,void 0);u(this,ht,void 0);u(this,pt,null);u(this,mt,void 0);u(this,He,void 0);u(this,xe,void 0);u(this,Ye,void 0);P(this,lt,new pe(y.en3.webglRenderer,{folderName:"Renderer"})),P(this,ht,new pe(y.en3.webglRenderer.shadowMap,{folderName:"Renderer.shadowMap",optionsCatalog:{type:{type:"select",variants:["BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap"]}},afterChange:()=>{y.en3.webglRenderer.shadowMap.needsUpdate=!0,Fn.traverseMaterials(y.en3.scene,n=>{n.needsUpdate=!0})}})),y.en3.composer&&P(this,pt,new bo),P(this,mt,new fo),P(this,He,new Nt(y.en3.camera)),P(this,xe,new uo),s(this,xe).controls.addEventListener("change",()=>{s(this,He).save()}),P(this,Ye,new yo),s(this,Ye).controls.addEventListener("dragging-changed",n=>{s(this,xe).controls.enabled=!n.value})}destroy(){var n;s(this,lt).destroy(),s(this,ht).destroy(),(n=s(this,pt))==null||n.destroy(),s(this,mt).destroy(),s(this,He).destroy(),s(this,xe).destroy(),s(this,Ye).destroy()}}lt=new WeakMap,ht=new WeakMap,pt=new WeakMap,mt=new WeakMap,He=new WeakMap,xe=new WeakMap,Ye=new WeakMap;exports.En3Helpers=wo;exports.En3Object3dManager=Nt;
|