aptechka 0.9.0 → 0.10.1
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/{Animation-BCA-DBje.cjs → Animation-BInSRYNr.cjs} +1 -1
- package/lib/{Animation-DrSYnbgb.js → Animation-uimN7sdT.js} +1 -1
- package/lib/{Composed-pnupzTOv.js → Composed-Fa7owymK.js} +1 -1
- package/lib/{Composed-7Fe7TW_T.cjs → Composed-Iihn8fT4.cjs} +1 -1
- package/lib/{Damped-CSEZ0qwp.cjs → Damped-Da3EnNN4.cjs} +1 -1
- package/lib/{Damped-C2FuK_3K.js → Damped-yrNXlkDE.js} +1 -1
- package/lib/Derived-CNbsNMn_.cjs +1 -0
- package/lib/Derived-rInkx3e4.js +60 -0
- package/lib/ElementConstructor-OK-6OPjh.cjs +1 -0
- package/lib/{ElementConstructor-CZKbNIQK.js → ElementConstructor-rValMo8f.js} +94 -88
- package/lib/{SourceManager-CmhlHGx7.js → SourceManager--L_rA28b.js} +1 -1
- package/lib/{SourceManager-DYnGpBi1.cjs → SourceManager-D6D2LVKf.cjs} +1 -1
- package/lib/{Store-kzJycezD.cjs → Store-Cr3VaD9G.cjs} +1 -1
- package/lib/{Store-Dsft7GtM.js → Store-Qr3SNOSf.js} +1 -1
- package/lib/{Tweened-BrD2cPSC.js → Tweened-CjgvoOwL.js} +1 -1
- package/lib/{Tweened-D6dAu8Zi.cjs → Tweened-DksN-Rz6.cjs} +1 -1
- package/lib/{Viewport-DRNfjjDY.cjs → Viewport-BBYt1Ivy.cjs} +1 -1
- package/lib/{Viewport-Ud7nellV.js → Viewport-Cgtq2I_K.js} +1 -1
- package/lib/{_createStore-Cf1MyeHa.cjs → _createStore-C75y9luu.cjs} +1 -1
- package/lib/_createStore-D3qHYaSz.js +12 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +1 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.d.ts +3 -3
- package/lib/canvas/index.js +4 -4
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.js +14 -13
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +1 -1
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.d.ts +2 -2
- package/lib/connector/index.js +39 -34
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/{createStylesheet-Di9WRypw.cjs → createStylesheet-9nksoWW0.cjs} +1 -1
- package/lib/{createStylesheet-C2gpLy4r.js → createStylesheet-BrFGJ8Q7.js} +1 -1
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +1 -1
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/element-constructor/ElementConstructor.d.ts +9 -7
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +3 -3
- package/lib/en3/helpers/index.cjs +1 -1
- package/lib/en3/helpers/index.js +2 -2
- package/lib/en3/misc/index.cjs +1 -1
- package/lib/en3/misc/index.js +2 -2
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/{index-BtB-3MG7.js → index-3R8YL-P3.js} +22 -21
- package/lib/index-CyQAdqFu.cjs +9 -0
- package/lib/{instantiate-BPZZn8jK.js → instantiate-D19vO5Ku.js} +27 -25
- package/lib/instantiate-DF1bIAXR.cjs +1 -0
- package/lib/jsx/hooks/animation/createDamped.d.ts +3 -0
- package/lib/jsx/hooks/animation/createTweened.d.ts +3 -0
- package/lib/jsx/hooks/animation/index.cjs +1 -0
- package/lib/jsx/hooks/animation/index.d.ts +2 -0
- package/lib/jsx/hooks/animation/index.js +15 -0
- package/lib/jsx/hooks/basic/createRef.d.ts +3 -0
- package/lib/jsx/hooks/basic/onStoreChange.d.ts +3 -0
- package/lib/jsx/hooks/store/createCached.d.ts +4 -0
- package/lib/jsx/hooks/store/createDerived.d.ts +3 -2
- package/lib/jsx/hooks/store/createDerivedArray.d.ts +2 -1
- package/lib/jsx/hooks/store/index.cjs +1 -1
- package/lib/jsx/hooks/store/index.d.ts +3 -2
- package/lib/jsx/hooks/store/index.js +36 -18
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +5 -3
- package/lib/jsx/index.js +73 -58
- package/lib/jsx/type.d.ts +16 -13
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +1 -1
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +4 -3
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +5 -4
- package/lib/order/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +2 -2
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +3 -2
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +1 -1
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +7 -7
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +2 -2
- package/lib/store/Cached.d.ts +18 -0
- package/lib/store/Derived.d.ts +6 -1
- package/lib/store/DerivedArray.d.ts +6 -1
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +3 -3
- package/lib/store/index.js +121 -32
- package/lib/{tags-BBOGIzDK.cjs → tags-BosXYPYv.cjs} +1 -1
- package/lib/{tags-CefGDQtF.js → tags-D0kLlFdQ.js} +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +3 -2
- package/lib/tweaker/index.cjs +2 -2
- package/lib/tweaker/index.js +6 -5
- package/lib/utils/bytes.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +135 -110
- package/lib/utils/promises.d.ts +1 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +9 -1
- package/lib/Derived-CFnbeEgJ.js +0 -27
- package/lib/Derived-Dko3EP7m.cjs +0 -1
- package/lib/ElementConstructor-9S0f1yAH.cjs +0 -1
- package/lib/Resource-BhF6Tj1p.js +0 -49
- package/lib/Resource-WCQEgLpB.cjs +0 -1
- package/lib/_createStore-Ck9bHolX.js +0 -12
- package/lib/index-DQo2-dnB.cjs +0 -9
- package/lib/instantiate-BWM-ipPW.cjs +0 -1
- package/lib/store/Keyed.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
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-kzJycezD.cjs"),t=require("three"),Zn=require("../../object-CCiXnER2.cjs"),sn=require("../../ticker/index.cjs"),Gn=require("../../Composed-7Fe7TW_T.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;
|
|
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-Cr3VaD9G.cjs"),t=require("three"),Zn=require("../../object-CCiXnER2.cjs"),sn=require("../../ticker/index.cjs"),Gn=require("../../Composed-Iihn8fT4.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;
|
package/lib/en3/helpers/index.js
CHANGED
|
@@ -20,12 +20,12 @@ var s = (m, t, o) => (Xt(m, t, "read from private field"), o ? o.call(m) : t.get
|
|
|
20
20
|
}, x = (m, t, o, e) => (Xt(m, t, "write to private field"), e ? e.call(m, o) : t.set(m, o), o);
|
|
21
21
|
var P = (m, t, o) => (Xt(m, t, "access private method"), o);
|
|
22
22
|
import { e as b } from "../../en3-THFHEReu.js";
|
|
23
|
-
import { S as Z } from "../../Store-
|
|
23
|
+
import { S as Z } from "../../Store-Qr3SNOSf.js";
|
|
24
24
|
import * as Pe from "three";
|
|
25
25
|
import { Light as fn, PointLight as ai, PointLightHelper as ri, DirectionalLight as li, DirectionalLightHelper as ci, SpotLight as hi, SpotLightHelper as pi, HemisphereLight as mi, HemisphereLightHelper as di, Camera as yn, CameraHelper as ui, Mesh as p, Material as fi, Ray as yi, Plane as bi, MathUtils as wi, EventDispatcher as gi, Vector3 as y, MOUSE as Re, TOUCH as Ye, Quaternion as K, Spherical as bn, Vector2 as V, Raycaster as Ei, Object3D as Gt, Euler as Pi, Matrix4 as Dn, MeshBasicMaterial as On, LineBasicMaterial as Mi, CylinderGeometry as F, BoxGeometry as X, BufferGeometry as wn, Float32BufferAttribute as gn, OctahedronGeometry as vt, Line as me, SphereGeometry as Si, TorusGeometry as Ve, PlaneGeometry as xi, DoubleSide as vi, GridHelper as _i } from "three";
|
|
26
26
|
import { a as Ti } from "../../object-D6MVWB4l.js";
|
|
27
27
|
import { ticker as En } from "../../ticker/index.js";
|
|
28
|
-
import { C as Ii } from "../../Composed-
|
|
28
|
+
import { C as Ii } from "../../Composed-Fa7owymK.js";
|
|
29
29
|
import { t as Ai } from "../../traverseMaterials-BKSwwNmo.js";
|
|
30
30
|
const Li = [
|
|
31
31
|
"AddEquation",
|
package/lib/en3/misc/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var D=(o,e,t)=>{if(!e.has(o))throw TypeError("Cannot "+t)};var i=(o,e,t)=>(D(o,e,"read from private field"),t?t.call(o):e.get(o)),s=(o,e,t)=>{if(e.has(o))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(o):e.set(o,t)},c=(o,e,t,r)=>(D(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t);var L=(o,e,t)=>(D(o,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../../loading/index.cjs"),y=require("../../SourceManager-
|
|
1
|
+
"use strict";var D=(o,e,t)=>{if(!e.has(o))throw TypeError("Cannot "+t)};var i=(o,e,t)=>(D(o,e,"read from private field"),t?t.call(o):e.get(o)),s=(o,e,t)=>{if(e.has(o))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(o):e.set(o,t)},c=(o,e,t,r)=>(D(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t);var L=(o,e,t)=>(D(o,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../../loading/index.cjs"),y=require("../../SourceManager-D6D2LVKf.cjs"),b=require("../../Store-Cr3VaD9G.cjs");var u,l,v,k;class z{constructor(e){s(this,v);s(this,u,void 0);s(this,l,void 0);c(this,u,e.material),c(this,l,e.uniforms||{}),i(this,u).userData.uniforms=i(this,l);let t;const r=()=>{t==null||t()};i(this,u).addEventListener("dispose",r),i(this,u).onBeforeCompile=n=>{var d;t==null||t();for(const R in i(this,l))n.uniforms[R]=i(this,l)[R];e.vertextDeclarations&&(n.vertexShader=`
|
|
2
2
|
${e.vertextDeclarations}
|
|
3
3
|
${n.vertexShader}
|
|
4
4
|
`),e.fragmentDeclarations&&(n.fragmentShader=`
|
package/lib/en3/misc/index.js
CHANGED
|
@@ -9,8 +9,8 @@ var e = (o, i, t) => (m(o, i, "read from private field"), t ? t.call(o) : i.get(
|
|
|
9
9
|
}, c = (o, i, t, s) => (m(o, i, "write to private field"), s ? s.call(o, t) : i.set(o, t), t);
|
|
10
10
|
var L = (o, i, t) => (m(o, i, "access private method"), t);
|
|
11
11
|
import { loading as $ } from "../../loading/index.js";
|
|
12
|
-
import { S as z } from "../../SourceManager
|
|
13
|
-
import { S as R } from "../../Store-
|
|
12
|
+
import { S as z } from "../../SourceManager--L_rA28b.js";
|
|
13
|
+
import { S as R } from "../../Store-Qr3SNOSf.js";
|
|
14
14
|
var h, u, S, k;
|
|
15
15
|
class b {
|
|
16
16
|
constructor(i) {
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-Cr3VaD9G.cjs");const r=require("../source/index.cjs");class e extends r.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(t){this.consumerElement.src=t||""}}customElements.get("e-image")||customElements.define("e-image",e);exports.ImageElement=e;
|
package/lib/image/index.js
CHANGED
|
@@ -6,14 +6,15 @@ var e = (s, i, t) => (T(s, i, "read from private field"), t ? t.call(s) : i.get(
|
|
|
6
6
|
if (i.has(s))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
i instanceof WeakSet ? i.add(s) : i.set(s, t);
|
|
9
|
-
}, a = (s, i, t,
|
|
9
|
+
}, a = (s, i, t, o) => (T(s, i, "write to private field"), o ? o.call(s, t) : i.set(s, t), t);
|
|
10
10
|
var g = (s, i, t) => (T(s, i, "access private method"), t);
|
|
11
|
-
import "./Store-
|
|
11
|
+
import "./Store-Qr3SNOSf.js";
|
|
12
12
|
import { i as H } from "./browser-0zX67oeU.js";
|
|
13
13
|
import { a as $, d as D } from "./events-CJTUMSLU.js";
|
|
14
14
|
import { g as B } from "./style-j2TwriJ_.js";
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
15
|
+
import "./ticker/index.js";
|
|
16
|
+
import { e as S, p as R, ax as v, D as I } from "./tags-D0kLlFdQ.js";
|
|
17
|
+
import { c as M } from "./createStylesheet-BrFGJ8Q7.js";
|
|
17
18
|
import { aptechkaTheme as q } from "./theme/index.js";
|
|
18
19
|
const F = M({
|
|
19
20
|
":host": {
|
|
@@ -50,14 +51,14 @@ const F = M({
|
|
|
50
51
|
paddingTop: "var(--gap, 0px)"
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
|
-
var r, c,
|
|
54
|
+
var r, c, l, h, d, u, L, f, k;
|
|
54
55
|
const A = class A extends HTMLElement {
|
|
55
56
|
constructor() {
|
|
56
57
|
super();
|
|
57
58
|
n(this, f);
|
|
58
59
|
n(this, r, null);
|
|
59
60
|
n(this, c, "");
|
|
60
|
-
n(this,
|
|
61
|
+
n(this, l, null);
|
|
61
62
|
n(this, h, !1);
|
|
62
63
|
n(this, d, void 0);
|
|
63
64
|
n(this, u, null);
|
|
@@ -82,8 +83,8 @@ const A = class A extends HTMLElement {
|
|
|
82
83
|
class: "body-inner",
|
|
83
84
|
children: v()
|
|
84
85
|
}),
|
|
85
|
-
ref: (
|
|
86
|
-
a(this,
|
|
86
|
+
ref: (o) => {
|
|
87
|
+
a(this, l, o);
|
|
87
88
|
}
|
|
88
89
|
})
|
|
89
90
|
]
|
|
@@ -107,23 +108,23 @@ const A = class A extends HTMLElement {
|
|
|
107
108
|
return e(this, h);
|
|
108
109
|
}
|
|
109
110
|
open() {
|
|
110
|
-
clearTimeout(e(this, d)), a(this, h, !0), e(this,
|
|
111
|
-
this.classList.add("opened"), e(this,
|
|
111
|
+
clearTimeout(e(this, d)), a(this, h, !0), e(this, l).style.display = "grid", this.classList.add("triggered"), setTimeout(() => {
|
|
112
|
+
this.classList.add("opened"), e(this, l).style.height = e(this, l).scrollHeight + "px", g(this, f, k).call(this);
|
|
112
113
|
}, 0);
|
|
113
114
|
}
|
|
114
115
|
close() {
|
|
115
|
-
a(this, h, !1), e(this,
|
|
116
|
-
this.classList.remove("triggered"), e(this,
|
|
117
|
-
}, B(e(this,
|
|
116
|
+
a(this, h, !1), e(this, l).style.height = "0px", this.classList.remove("opened"), g(this, f, k).call(this), a(this, d, setTimeout(() => {
|
|
117
|
+
this.classList.remove("triggered"), e(this, l).style.display = "none";
|
|
118
|
+
}, B(e(this, l))));
|
|
118
119
|
}
|
|
119
120
|
connectedCallback() {
|
|
120
|
-
e(this, u).observe(e(this,
|
|
121
|
+
e(this, u).observe(e(this, l));
|
|
121
122
|
}
|
|
122
123
|
disconnectedCallback() {
|
|
123
124
|
clearTimeout(e(this, d)), e(this, u).disconnect();
|
|
124
125
|
}
|
|
125
126
|
};
|
|
126
|
-
r = new WeakMap(), c = new WeakMap(),
|
|
127
|
+
r = new WeakMap(), c = new WeakMap(), l = new WeakMap(), h = new WeakMap(), d = new WeakMap(), u = new WeakMap(), L = new WeakMap(), f = new WeakSet(), k = function() {
|
|
127
128
|
D(this), this.dispatchEvent(
|
|
128
129
|
new CustomEvent("selectToggle", {
|
|
129
130
|
bubbles: !0,
|
|
@@ -146,8 +147,8 @@ class O extends HTMLElement {
|
|
|
146
147
|
return e(this, E);
|
|
147
148
|
}
|
|
148
149
|
connectedCallback() {
|
|
149
|
-
var
|
|
150
|
-
const t = (x = (
|
|
150
|
+
var o, x;
|
|
151
|
+
const t = (x = (o = this.assignedSlot) == null ? void 0 : o.getRootNode()) == null ? void 0 : x.host;
|
|
151
152
|
t ? a(this, E, t) : console.log(this, "e-select not found");
|
|
152
153
|
}
|
|
153
154
|
}
|
|
@@ -173,8 +174,8 @@ class j extends O {
|
|
|
173
174
|
onClick: () => {
|
|
174
175
|
g(this, b, z).call(this);
|
|
175
176
|
},
|
|
176
|
-
onKeydown: (
|
|
177
|
-
|
|
177
|
+
onKeydown: (o) => {
|
|
178
|
+
o.code === "Space" && g(this, b, z).call(this);
|
|
178
179
|
},
|
|
179
180
|
children: v()
|
|
180
181
|
}));
|
|
@@ -229,10 +230,10 @@ class U extends O {
|
|
|
229
230
|
super();
|
|
230
231
|
n(this, w, null);
|
|
231
232
|
n(this, p, () => {
|
|
232
|
-
const
|
|
233
|
+
const o = this.selectElement.shadowRoot.querySelector(
|
|
233
234
|
".body slot"
|
|
234
235
|
).assignedElements().find((x) => x.value === this.selectElement.value);
|
|
235
|
-
|
|
236
|
+
o && (e(this, w).innerHTML = o.innerHTML);
|
|
236
237
|
});
|
|
237
238
|
n(this, y, () => {
|
|
238
239
|
this.classList.toggle("opened", this.selectElement.opened);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";var T=(s,i,t)=>{if(!i.has(s))throw TypeError("Cannot "+t)};var e=(s,i,t)=>(T(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>{if(i.has(s))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(s):i.set(s,t)},h=(s,i,t,l)=>(T(s,i,"write to private field"),l?l.call(s,t):i.set(s,t),t);var v=(s,i,t)=>(T(s,i,"access private method"),t);require("./Store-Cr3VaD9G.cjs");const q=require("./browser-CpzFX2xg.cjs"),M=require("./events-BGwqaxVW.cjs"),$=require("./style-At6aDoqG.cjs");require("./ticker/index.cjs");const o=require("./tags-BosXYPYv.cjs"),z=require("./createStylesheet-9nksoWW0.cjs"),D=require("./theme/index.cjs"),R=z.createStylesheet({":host":{position:"relative"},".head":{width:"100%",cursor:"default",background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start",padding:"0",margin:"0"},".body":{boxSizing:"border-box",position:"var(--position, unset)",top:"100%",left:"0",width:"100%",overflow:"hidden",transitionDuration:"var(--duration, var(--duration-short))",transitionProperty:"height",cursor:"default"},".body-inner":{display:"grid",gap:"var(--gap, 0px)",width:"100%",paddingTop:"var(--gap, 0px)"}});var c,d,r,a,u,m,L,E,C;const I=class I extends HTMLElement{constructor(){super();n(this,E);n(this,c,null);n(this,d,"");n(this,r,null);n(this,a,!1);n(this,u,void 0);n(this,m,null);n(this,L,()=>{M.dispatchSizeChangeEvent(this)});q.isBrowser&&(this.attachShadow({mode:"open"}).adoptedStyleSheets.push(R),h(this,c,this.attachInternals()),h(this,m,new ResizeObserver(e(this,L))),o.element(this,{children:[o.button({class:"head",children:o.slot({name:"head"}),onClick:()=>{this.opened?this.close():this.open()}}),o.div({class:"body",style:{height:"0px"},children:o.div({class:"body-inner",children:o.slot()}),ref:l=>{h(this,r,l)}})]}))}get value(){return e(this,d)}set value(t){h(this,d,t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e(this,c).setFormValue(e(this,d))}get internals(){return e(this,c)}get opened(){return e(this,a)}open(){clearTimeout(e(this,u)),h(this,a,!0),e(this,r).style.display="grid",this.classList.add("triggered"),setTimeout(()=>{this.classList.add("opened"),e(this,r).style.height=e(this,r).scrollHeight+"px",v(this,E,C).call(this)},0)}close(){h(this,a,!1),e(this,r).style.height="0px",this.classList.remove("opened"),v(this,E,C).call(this),h(this,u,setTimeout(()=>{this.classList.remove("triggered"),e(this,r).style.display="none"},$.getElementTransitionDurationMS(e(this,r))))}connectedCallback(){e(this,m).observe(e(this,r))}disconnectedCallback(){clearTimeout(e(this,u)),e(this,m).disconnect()}};c=new WeakMap,d=new WeakMap,r=new WeakMap,a=new WeakMap,u=new WeakMap,m=new WeakMap,L=new WeakMap,E=new WeakSet,C=function(){M.dispatchBeforeSizeChangeEvent(this),this.dispatchEvent(new CustomEvent("selectToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,a)}}))},I.formAssociated=!0;let x=I;customElements.get("e-select")||customElements.define("e-select",x);var f;class H extends HTMLElement{constructor(){super(...arguments);n(this,f,null)}get selectElement(){return e(this,f)}connectedCallback(){var l,S;const t=(S=(l=this.assignedSlot)==null?void 0:l.getRootNode())==null?void 0:S.host;t?h(this,f,t):console.log(this,"e-select not found")}}f=new WeakMap;const F=z.createStylesheet({":host":{width:"100%",height:"40px",display:"inline-flex",alignItems:"center"}});var p,w,k;class O extends H{constructor(){super();n(this,w);n(this,p,()=>{this.selectElement.value===this.value?this.style.display="none":this.style.display=""});q.isBrowser&&(this.attachShadow({mode:"open"}).adoptedStyleSheets.push(F),o.element(this,{tabindex:0,onClick:()=>{v(this,w,k).call(this)},onKeydown:l=>{l.code==="Space"&&v(this,w,k).call(this)},children:o.slot()}))}get value(){return(this.hasAttribute("value")?this.getAttribute("value"):this.innerText)||""}connectedCallback(){super.connectedCallback(),this.hasAttribute("default")&&(this.selectElement.value||(this.selectElement.value=this.value)),this.selectElement.addEventListener("change",e(this,p)),setTimeout(()=>{e(this,p).call(this)})}disconnectedCallback(){this.selectElement.removeEventListener("change",e(this,p))}}p=new WeakMap,w=new WeakSet,k=function(){this.selectElement.value=this.value,this.selectElement.close()};customElements.get("e-select-option")||customElements.define("e-select-option",O);const A=`<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
width="32"
|
|
4
|
+
height="32"
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
>
|
|
7
|
+
<path d="m12.37 15.835l6.43-6.63C19.201 8.79 18.958 8 18.43 8H5.57c-.528 0-.771.79-.37 1.205l6.43 6.63c.213.22.527.22.74 0Z" />
|
|
8
|
+
</svg>
|
|
9
|
+
`,P=z.createStylesheet({":host":{width:"100%",height:"40px",display:"inline-flex",alignItems:"center",justifyContent:"space-between"},".default-arrow":{flexShrink:"0",width:"var(--arrow-size, 1em)",height:"var(--arrow-size, 1em)",fill:`var(--arrow-color, ${D.aptechkaTheme.colorMain.var})`,transitionProperty:"transform",transitionDuration:"var(--duration, var(--duration-short))"},":host(.opened) .default-arrow":{transform:"scaleY(-1)"}});var y,g,b;class B extends H{constructor(){super();n(this,y,null);n(this,g,()=>{const l=this.selectElement.shadowRoot.querySelector(".body slot").assignedElements().find(S=>S.value===this.selectElement.value);l&&(e(this,y).innerHTML=l.innerHTML)});n(this,b,()=>{this.classList.toggle("opened",this.selectElement.opened)});q.isBrowser&&(this.attachShadow({mode:"open"}).adoptedStyleSheets.push(P),o.element(this,{children:[o.slot(),o.slot({name:"arrow",children:o.element(A,{class:"default-arrow"})})]}),this.slot="head")}connectedCallback(){super.connectedCallback(),h(this,y,this.querySelector("[data-value-holder]")||this),this.selectElement.addEventListener("change",e(this,g)),e(this,g).call(this),this.selectElement.addEventListener("selectToggle",e(this,b))}disconnectedCallback(){this.selectElement.removeEventListener("change",e(this,g)),this.selectElement.removeEventListener("selectToggle",e(this,b))}}y=new WeakMap,g=new WeakMap,b=new WeakMap;customElements.get("e-select-head")||customElements.define("e-select-head",B);exports.SelectElement=x;exports.SelectHeadElement=B;exports.SelectOptionElement=O;exports.SelectUserElement=H;exports.arrowIcon=A;
|
|
@@ -2,14 +2,14 @@ var _ = Object.defineProperty, F = Object.defineProperties;
|
|
|
2
2
|
var M = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var A = Object.getOwnPropertySymbols;
|
|
4
4
|
var R = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var L = (n, e, l) => e in n ? _(n, e, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[e] = l,
|
|
5
|
+
var L = (n, e, l) => e in n ? _(n, e, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[e] = l, r = (n, e) => {
|
|
6
6
|
for (var l in e || (e = {}))
|
|
7
7
|
R.call(e, l) && L(n, l, e[l]);
|
|
8
8
|
if (A)
|
|
9
9
|
for (var l of A(e))
|
|
10
10
|
D.call(e, l) && L(n, l, e[l]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
12
|
+
}, p = (n, e) => F(n, M(e));
|
|
13
13
|
var H = (n, e, l) => {
|
|
14
14
|
if (!e.has(n))
|
|
15
15
|
throw TypeError("Cannot " + l);
|
|
@@ -19,15 +19,16 @@ var o = (n, e, l) => (H(n, e, "read from private field"), l ? l.call(n) : e.get(
|
|
|
19
19
|
throw TypeError("Cannot add the same private member more than once");
|
|
20
20
|
e instanceof WeakSet ? e.add(n) : e.set(n, l);
|
|
21
21
|
};
|
|
22
|
-
import { E as
|
|
22
|
+
import { E as k } from "./ElementConstructor-rValMo8f.js";
|
|
23
23
|
import { i as I } from "./object-D6MVWB4l.js";
|
|
24
24
|
import { c as K } from "./string-f0Dnk0L1.js";
|
|
25
|
-
import { c as u, n as
|
|
26
|
-
import "./Store-
|
|
25
|
+
import { c as u, n as w, a as y } from "./globals-DMjysUXI.js";
|
|
26
|
+
import "./Store-Qr3SNOSf.js";
|
|
27
|
+
import "./ticker/index.js";
|
|
27
28
|
var v, t, d, m, f;
|
|
28
29
|
class $ extends HTMLElement {
|
|
29
30
|
constructor(l) {
|
|
30
|
-
var
|
|
31
|
+
var h;
|
|
31
32
|
super();
|
|
32
33
|
i(this, v, /* @__PURE__ */ new Set());
|
|
33
34
|
i(this, t, /* @__PURE__ */ new Set());
|
|
@@ -42,10 +43,12 @@ class $ extends HTMLElement {
|
|
|
42
43
|
});
|
|
43
44
|
const s = u.value;
|
|
44
45
|
u.value = this, o(this, m).call(this);
|
|
45
|
-
const C = l == null ? void 0 : l.tag(
|
|
46
|
-
|
|
46
|
+
const C = l == null ? void 0 : l.tag(p(r({}, l.attributes), {
|
|
47
|
+
this: this
|
|
48
|
+
})), E = (h = w.value) != null && h.lightChildren ? "lightChildren" : "children";
|
|
49
|
+
new k(this, p(r({}, w.value), {
|
|
47
50
|
[E]: C
|
|
48
|
-
})), u.value = s,
|
|
51
|
+
})), u.value = s, w.value = null, o(this, f).call(this);
|
|
49
52
|
}
|
|
50
53
|
addConnectCallback(l) {
|
|
51
54
|
o(this, v).add(l);
|
|
@@ -70,7 +73,7 @@ class $ extends HTMLElement {
|
|
|
70
73
|
}
|
|
71
74
|
v = new WeakMap(), t = new WeakMap(), d = new WeakMap(), m = new WeakMap(), f = new WeakMap();
|
|
72
75
|
function j(n, e, ...l) {
|
|
73
|
-
var
|
|
76
|
+
var h;
|
|
74
77
|
l = l.flat().filter((c) => c != null);
|
|
75
78
|
const s = [], C = [];
|
|
76
79
|
e = e || {}, s.push(...l.reverse());
|
|
@@ -78,22 +81,21 @@ function j(n, e, ...l) {
|
|
|
78
81
|
if (E && e.from && (n = e.from, e == null || delete e.from), typeof n == "function")
|
|
79
82
|
if (E) {
|
|
80
83
|
let c = null;
|
|
81
|
-
return I(n) ? c = new n() : c = n(), delete e.children, () => new
|
|
84
|
+
return I(n) ? c = new n() : c = n(), delete e.children, () => new k(c, e).node;
|
|
82
85
|
} else {
|
|
83
|
-
if (n === g)
|
|
84
|
-
return g(
|
|
85
|
-
e.children = s.reverse();
|
|
86
|
+
if (e.children = s.reverse(), n === g)
|
|
87
|
+
return g(e.children);
|
|
86
88
|
const c = {
|
|
87
89
|
noCustomElement: n.noCustomElement,
|
|
88
90
|
onlyRegister: e.__register
|
|
89
91
|
};
|
|
90
92
|
if (e == null || delete e.__register, c.noCustomElement) {
|
|
91
|
-
const T = n(
|
|
93
|
+
const T = n(r({}, e));
|
|
92
94
|
return () => T;
|
|
93
95
|
}
|
|
94
|
-
const
|
|
95
|
-
let a = customElements.get(
|
|
96
|
-
return a || (a = (
|
|
96
|
+
const x = `e-${K(n.name)}`;
|
|
97
|
+
let a = customElements.get(x);
|
|
98
|
+
return a || (a = (h = class extends $ {
|
|
97
99
|
constructor(S) {
|
|
98
100
|
super(
|
|
99
101
|
c.onlyRegister ? {
|
|
@@ -102,7 +104,7 @@ function j(n, e, ...l) {
|
|
|
102
104
|
} : S
|
|
103
105
|
);
|
|
104
106
|
}
|
|
105
|
-
},
|
|
107
|
+
}, h.formAssociated = n.formAssociated, h), customElements.define(x, a)), () => c.onlyRegister ? a : new a({ tag: n, attributes: e });
|
|
106
108
|
}
|
|
107
109
|
for (; s.length; ) {
|
|
108
110
|
const c = s.pop();
|
|
@@ -110,25 +112,25 @@ function j(n, e, ...l) {
|
|
|
110
112
|
}
|
|
111
113
|
if (n === "component") {
|
|
112
114
|
const c = g(C);
|
|
113
|
-
return
|
|
115
|
+
return w.value = e, c.node;
|
|
114
116
|
} else {
|
|
115
117
|
const c = e != null && e.lightChildren ? "lightChildren" : "children";
|
|
116
|
-
return e == null || delete e.children, n ? new
|
|
118
|
+
return e == null || delete e.children, n ? new k(n, p(r({}, e), {
|
|
117
119
|
[c]: C
|
|
118
120
|
})) : null;
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
function g(n) {
|
|
122
|
-
return new
|
|
124
|
+
return new k(document.createDocumentFragment(), {
|
|
123
125
|
children: n
|
|
124
126
|
});
|
|
125
127
|
}
|
|
126
|
-
function
|
|
128
|
+
function P(n, e) {
|
|
127
129
|
const l = e == null ? void 0 : e.children, s = e == null ? void 0 : e.attributes;
|
|
128
|
-
return (/* @__PURE__ */ j(n,
|
|
130
|
+
return (/* @__PURE__ */ j(n, r({}, s), l))();
|
|
129
131
|
}
|
|
130
132
|
export {
|
|
131
133
|
g as F,
|
|
132
134
|
j as h,
|
|
133
|
-
|
|
135
|
+
P as i
|
|
134
136
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var L=Object.defineProperty,T=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var y=(n,e,l)=>e in n?L(n,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[e]=l,i=(n,e)=>{for(var l in e||(e={}))F.call(e,l)&&y(n,l,e[l]);if(g)for(var l of g(e))M.call(e,l)&&y(n,l,e[l]);return n},x=(n,e)=>T(n,_(e));var R=(n,e,l)=>{if(!e.has(n))throw TypeError("Cannot "+l)};var c=(n,e,l)=>(R(n,e,"read from private field"),l?l.call(n):e.get(n)),h=(n,e,l)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,l)};const p=require("./ElementConstructor-OK-6OPjh.cjs"),D=require("./object-CCiXnER2.cjs"),j=require("./string-DhgS_iFl.cjs"),r=require("./globals-bYKki-b9.cjs");require("./Store-Cr3VaD9G.cjs");require("./ticker/index.cjs");var a,d,m,C,u;class H extends HTMLElement{constructor(l){var s;super();h(this,a,new Set);h(this,d,new Set);h(this,m,new Map);h(this,C,()=>{r.contextStack.value.unshift(c(this,m))});h(this,u,()=>{r.contextStack.value=r.contextStack.value.filter(l=>l!==c(this,m))});const o=r.currentComponentElement.value;r.currentComponentElement.value=this,c(this,C).call(this);const f=l==null?void 0:l.tag(x(i({},l.attributes),{this:this})),v=(s=r.nextComponentAttributes.value)!=null&&s.lightChildren?"lightChildren":"children";new p.ElementConstructor(this,x(i({},r.nextComponentAttributes.value),{[v]:f})),r.currentComponentElement.value=o,r.nextComponentAttributes.value=null,c(this,u).call(this)}addConnectCallback(l){c(this,a).add(l)}addDisconnectCallback(l){c(this,d).add(l)}createContext(l,o){c(this,m).set(l,o)}connectedCallback(){r.currentComponentElement.value=this,c(this,a).forEach(l=>{const o=l(this);o&&c(this,d).add(o)}),r.currentComponentElement.value=null,this.addEventListener("beforeChildrenChange",c(this,C)),this.addEventListener("afterChildrenChange",c(this,u))}disconnectedCallback(){c(this,d).forEach(l=>{l(this)}),this.removeEventListener("beforeChildrenChange",c(this,C)),this.removeEventListener("afterChildrenChange",c(this,u))}}a=new WeakMap,d=new WeakMap,m=new WeakMap,C=new WeakMap,u=new WeakMap;function A(n,e,...l){var s;l=l.flat().filter(t=>t!=null);const o=[],f=[];e=e||{},o.push(...l.reverse());const v=n==="instance";if(v&&e.from&&(n=e.from,e==null||delete e.from),typeof n=="function")if(v){let t=null;return D.isESClass(n)?t=new n:t=n(),delete e.children,()=>new p.ElementConstructor(t,e).node}else{if(e.children=o.reverse(),n===k)return k(e.children);const t={noCustomElement:n.noCustomElement,onlyRegister:e.__register};if(e==null||delete e.__register,t.noCustomElement){const q=n(i({},e));return()=>q}const w=`e-${j.camelToKebab(n.name)}`;let E=customElements.get(w);return E||(E=(s=class extends H{constructor(S){super(t.onlyRegister?{tag:n,attributes:e}:S)}},s.formAssociated=n.formAssociated,s),customElements.define(w,E)),()=>t.onlyRegister?E:new E({tag:n,attributes:e})}for(;o.length;){const t=o.pop();Array.isArray(t)?o.push(...t):t!=null&&f.push(t)}if(n==="component"){const t=k(f);return r.nextComponentAttributes.value=e,t.node}else{const t=e!=null&&e.lightChildren?"lightChildren":"children";return e==null||delete e.children,n?new p.ElementConstructor(n,x(i({},e),{[t]:f})):null}}function k(n){return new p.ElementConstructor(document.createDocumentFragment(),{children:n})}function I(n,e){const l=e==null?void 0:e.children,o=e==null?void 0:e.attributes;return A(n,i({},o),l)()}exports.Fragment=k;exports.h=A;exports.instantiate=I;
|