aptechka 0.14.0 → 0.16.0
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-De9aUv3b.cjs → Animation-DI864E0i.cjs} +1 -1
- package/lib/{Animation-NAGXiFv5.js → Animation-w6BLTCum.js} +1 -1
- package/lib/{Damped-DbJKrUIf.js → Damped-DEHDEq-b.js} +1 -1
- package/lib/{Damped-DYJ6Z0xo.cjs → Damped-ipnDc0iX.cjs} +1 -1
- package/lib/Store-CDb6RMce.cjs +1 -0
- package/lib/Store-OTdcl6SX.js +134 -0
- package/lib/{Tweened-BkkD9s4n.cjs → Tweened-B1TfANfR.cjs} +1 -1
- package/lib/{Tweened-DOSHLCZa.js → Tweened-C52xXDLY.js} +1 -1
- package/lib/{Viewport-Cv4TRGiv.cjs → Viewport-BDPsnAF4.cjs} +1 -1
- package/lib/{Viewport-B55BvLsV.js → Viewport-taEXS8Uv.js} +1 -1
- 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 -7
- package/lib/canvas/index.js +49 -48
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +2 -2
- 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/en3/index.cjs +8 -1
- package/lib/en3/index.js +372 -4
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/jss-CjccJC-K.js +21 -0
- package/lib/jss-GJLvaNfT.cjs +1 -0
- 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/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +838 -460
- 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 +15 -21
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +576 -608
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +154 -62
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +71 -37
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +59 -56
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +1 -34
- package/lib/Composed-C_4slJQ6.cjs +0 -1
- package/lib/Composed-CfWa-69I.js +0 -31
- package/lib/Derived-BIBU-y7Z.cjs +0 -1
- package/lib/Derived-Vo_RsJfi.js +0 -23
- package/lib/SourceManager-B6wZpXUZ.js +0 -104
- package/lib/SourceManager-CfHcGLUa.cjs +0 -1
- package/lib/Store-C46i0nvr.js +0 -137
- package/lib/Store-npaZHvX4.cjs +0 -1
- package/lib/createStylesheet-C68ja-RS.js +0 -8
- package/lib/createStylesheet-Csfmh-MH.cjs +0 -1
- package/lib/element-constructor/index.cjs +0 -1
- package/lib/element-constructor/index.js +0 -135
- package/lib/en3/helpers/index.cjs +0 -1
- package/lib/en3/helpers/index.js +0 -1870
- package/lib/en3/libs/index.cjs +0 -1
- package/lib/en3/libs/index.js +0 -200
- package/lib/en3/loaders/index.cjs +0 -1
- package/lib/en3/loaders/index.js +0 -1742
- package/lib/en3/misc/index.cjs +0 -10
- package/lib/en3/misc/index.js +0 -110
- package/lib/en3/utils/index.cjs +0 -1
- package/lib/en3/utils/index.js +0 -20
- package/lib/en3-C1fLmsjs.cjs +0 -8
- package/lib/en3-sK9Z-fp2.js +0 -344
- package/lib/tags-6_ETuR75.cjs +0 -1
- package/lib/tags-zft1DGBz.js +0 -833
- package/lib/traverseMaterials-BlZbRhgW.js +0 -29
- package/lib/traverseMaterials-CD_3_56D.cjs +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { E as c, f as n, g as p, h as u, j as b, k as h, m as f, n as g, o as y, p as v, q as k, r as x, t as $, u as q, v as T, b as w, w as C, x as E, y as K, z as S, A as V, B as z, a_ as A, C as B, D, F, G, H, I, J, d as L, K as M, L as N, e as O, M as P, N as Q, aZ as R, O as U, P as W, Q as X, R as Y, S as Z, aY as _, T as j, U as aa, V as sa, W as ea, X as ta, Y as ra, Z as oa, _ as la, $ as ia, a0 as da, a1 as ma, aV as ca, a2 as na, a3 as pa, a4 as ua, i as ba, a5 as ha, a6 as fa, l as ga, a7 as ya, a8 as va, a9 as ka, aa as xa, ab as $a, ac as qa, ad as Ta, ae as wa, af as Ca, ag as Ea, ah as Ka, ai as Sa, aj as Va, ak as za, al as Aa, am as Ba, an as Da, ao as Fa, ap as Ga, aq as Ha, ar as Ia, as as Ja, at as La, au as Ma, av as Na, aw as Oa, ax as Pa, ay as Qa, az as Ra, aA as Ua, a as Wa, aB as Xa, aC as Ya, c as Za, aD as _a, s as ja, aE as as, aF as ss, aG as es, aH as ts, aI as rs, aJ as os, aK as ls, aL as is, aM as ds, aN as ms, aO as cs, aP as ns, aQ as ps, aR as us, aS as bs, aT as hs, aU as fs, aW as gs, aX as ys } from "../tags-zft1DGBz.js";
|
|
2
|
-
import { c as ks } from "../createStylesheet-C68ja-RS.js";
|
|
3
|
-
import { c as o } from "../string-f0Dnk0L1.js";
|
|
4
|
-
function i(s, e) {
|
|
5
|
-
const r = (e == null ? void 0 : e.prefix) || "", t = {
|
|
6
|
-
style: {}
|
|
7
|
-
};
|
|
8
|
-
for (const a in s)
|
|
9
|
-
t[a] = {
|
|
10
|
-
var: `var(--${r}${o(a)})`,
|
|
11
|
-
value: s[a]
|
|
12
|
-
}, t.style[`--${r}${o(a)}`] = s[a];
|
|
13
|
-
return t;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
c as ElementConstructor,
|
|
17
|
-
n as a,
|
|
18
|
-
p as abbr,
|
|
19
|
-
u as address,
|
|
20
|
-
b as area,
|
|
21
|
-
h as article,
|
|
22
|
-
f as aside,
|
|
23
|
-
g as audio,
|
|
24
|
-
y as b,
|
|
25
|
-
v as base,
|
|
26
|
-
k as bdi,
|
|
27
|
-
x as bdo,
|
|
28
|
-
$ as blockquote,
|
|
29
|
-
q as body,
|
|
30
|
-
T as br,
|
|
31
|
-
w as button,
|
|
32
|
-
C as canvas,
|
|
33
|
-
E as caption,
|
|
34
|
-
K as cite,
|
|
35
|
-
S as code,
|
|
36
|
-
V as col,
|
|
37
|
-
z as colgroup,
|
|
38
|
-
A as contents,
|
|
39
|
-
ks as createStylesheet,
|
|
40
|
-
i as createTheme,
|
|
41
|
-
B as data,
|
|
42
|
-
D as datalist,
|
|
43
|
-
F as dd,
|
|
44
|
-
G as del,
|
|
45
|
-
H as details,
|
|
46
|
-
I as dfn,
|
|
47
|
-
J as dialog,
|
|
48
|
-
L as div,
|
|
49
|
-
M as dl,
|
|
50
|
-
N as dt,
|
|
51
|
-
O as element,
|
|
52
|
-
P as em,
|
|
53
|
-
Q as embed,
|
|
54
|
-
R as empty,
|
|
55
|
-
U as fieldset,
|
|
56
|
-
W as figcaption,
|
|
57
|
-
X as figure,
|
|
58
|
-
Y as footer,
|
|
59
|
-
Z as form,
|
|
60
|
-
_ as fragment,
|
|
61
|
-
j as h1,
|
|
62
|
-
aa as h2,
|
|
63
|
-
sa as h3,
|
|
64
|
-
ea as h4,
|
|
65
|
-
ta as h5,
|
|
66
|
-
ra as h6,
|
|
67
|
-
oa as head,
|
|
68
|
-
la as header,
|
|
69
|
-
ia as hgroup,
|
|
70
|
-
da as hr,
|
|
71
|
-
ma as html,
|
|
72
|
-
ca as htmlVar,
|
|
73
|
-
na as i,
|
|
74
|
-
pa as iframe,
|
|
75
|
-
ua as img,
|
|
76
|
-
ba as input,
|
|
77
|
-
ha as ins,
|
|
78
|
-
fa as kbd,
|
|
79
|
-
ga as label,
|
|
80
|
-
ya as legend,
|
|
81
|
-
va as li,
|
|
82
|
-
ka as link,
|
|
83
|
-
xa as main,
|
|
84
|
-
$a as map,
|
|
85
|
-
qa as mark,
|
|
86
|
-
Ta as menu,
|
|
87
|
-
wa as meta,
|
|
88
|
-
Ca as meter,
|
|
89
|
-
Ea as nav,
|
|
90
|
-
Ka as noscript,
|
|
91
|
-
Sa as object,
|
|
92
|
-
Va as ol,
|
|
93
|
-
za as optgroup,
|
|
94
|
-
Aa as option,
|
|
95
|
-
Ba as output,
|
|
96
|
-
Da as p,
|
|
97
|
-
Fa as picture,
|
|
98
|
-
Ga as pre,
|
|
99
|
-
Ha as progress,
|
|
100
|
-
Ia as q,
|
|
101
|
-
Ja as rp,
|
|
102
|
-
La as rt,
|
|
103
|
-
Ma as ruby,
|
|
104
|
-
Na as s,
|
|
105
|
-
Oa as samp,
|
|
106
|
-
Pa as script,
|
|
107
|
-
Qa as search,
|
|
108
|
-
Ra as section,
|
|
109
|
-
Ua as select,
|
|
110
|
-
Wa as slot,
|
|
111
|
-
Xa as small,
|
|
112
|
-
Ya as source,
|
|
113
|
-
Za as span,
|
|
114
|
-
_a as strong,
|
|
115
|
-
ja as style,
|
|
116
|
-
as as sub,
|
|
117
|
-
ss as summary,
|
|
118
|
-
es as sup,
|
|
119
|
-
ts as table,
|
|
120
|
-
rs as tbody,
|
|
121
|
-
os as td,
|
|
122
|
-
ls as template,
|
|
123
|
-
is as textarea,
|
|
124
|
-
ds as tfoot,
|
|
125
|
-
ms as th,
|
|
126
|
-
cs as thead,
|
|
127
|
-
ns as time,
|
|
128
|
-
ps as title,
|
|
129
|
-
us as tr,
|
|
130
|
-
bs as track,
|
|
131
|
-
hs as u,
|
|
132
|
-
fs as ul,
|
|
133
|
-
gs as video,
|
|
134
|
-
ys as wbr
|
|
135
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var On=Object.defineProperty;var qt=Object.getOwnPropertySymbols;var Dn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Bt=m=>{throw TypeError(m)};var Ut=(m,n,a)=>n in m?On(m,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):m[n]=a,se=(m,n)=>{for(var a in n||(n={}))Dn.call(n,a)&&Ut(m,a,n[a]);if(qt)for(var a of qt(n))Cn.call(n,a)&&Ut(m,a,n[a]);return m};var St=(m,n,a)=>n.has(m)||Bt("Cannot "+a);var s=(m,n,a)=>(St(m,n,"read from private field"),a?a.call(m):n.get(m)),f=(m,n,a)=>n.has(m)?Bt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(m):n.set(m,a),x=(m,n,a,e)=>(St(m,n,"write to private field"),e?e.call(m,a):n.set(m,a),a),E=(m,n,a)=>(St(m,n,"access private method"),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../../en3-C1fLmsjs.cjs"),X=require("../../Store-npaZHvX4.cjs"),t=require("three"),jn=require("../../object-CCiXnER2.cjs"),Wt=require("../../ticker/index.cjs"),kn=require("../../Composed-C_4slJQ6.cjs"),Rn=require("../../traverseMaterials-CD_3_56D.cjs");function Hn(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 de=Hn(t),Yn=["AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation"],cn=["ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor"],zn=[...cn,"SrcAlphaSaturateFactor"],Nn=["NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending"],Xn=["NeverDepth","AlwaysDepth","EqualDepth","LessDepth","LessEqualDepth ","GreaterEqualDepth ","GreaterDepth","NotEqualDepth"],Zn=["NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc ","GreaterStencilFunc","NotEqualStencilFunc ","GreaterEqualStencilFunc","AlwaysStencilFunc"],Pt=["ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp"],Gn=["FrontSide","BackSide","DoubleSide"],Fn=["TangentSpaceNormalMap","ObjectSpaceNormalMap"],Vn=["round","bevel","miter"],Qn=["NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","AgXToneMapping","NeutralToneMapping","CustomToneMapping"],qn={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:zn},blendDstAlpha:{type:"number",min:0,max:1,step:.001},blendEquation:{type:"select",variants:Yn},blendEquationAlpha:{type:"number",min:0,max:1,step:.001},blending:{type:"select",variants:Nn},blendSrc:{type:"select",variants:cn},blendSrcAlpha:{type:"number",min:0,max:1,step:.001},depthFunc:{type:"select",variants:Xn},stencilFunc:{type:"select",variants:Zn},stencilRef:{type:"number",min:0,step:1},stencilFail:{type:"select",variants:Pt},stencilZFail:{type:"select",variants:Pt},stencilZPass:{type:"select",variants:Pt},opacity:{type:"number",min:0,max:1,step:1e-4},side:{type:"select",variants:Gn},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:Fn},wireframeLinejoin:{type:"select",variants:Vn},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:Qn},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}},Un=new Set(["stencilFuncMask","needsUpdate","version","wireframeLinewidth","position","scale","rotation","coordinateSystem","aspect","autoUpdate","up"]);var Le,ne,M,ln,hn,pn,mn,un,_t,It,ye,be;class he{constructor(n,a){f(this,M);f(this,Le);f(this,ne,[]);x(this,Le,n);const e=se(se({},qn),a==null?void 0:a.optionsCatalog),r=new Set([...Un,...(a==null?void 0:a.skipKeys)||[]]),c=(a==null?void 0:a.folderName)||s(this,Le).name,i=a==null?void 0:a.afterChange;E(this,M,ln).call(this,{subject:s(this,Le),skipKeys:r,optionsCatalog:e,folderKey:c,afterChange:i})}destroy(){s(this,ne).forEach(n=>{n.close()})}}Le=new WeakMap,ne=new WeakMap,M=new WeakSet,ln=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 u=a[l],p=E(this,M,ye).call(this,u),d=`${e}.${l}`,w=r[l];typeof p=="number"?(w==null?void 0:w.type)==="select"?E(this,M,_t).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):E(this,M,hn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof de.Vector2||p instanceof de.Vector3?E(this,M,pn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):typeof p=="boolean"&&!l.startsWith("is")&&!l.startsWith("matrix")?E(this,M,mn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof de.Color?E(this,M,un).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):w&&(w==null?void 0:w.type)==="select"&&E(this,M,_t).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c})}},hn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(E(this,M,ye).call(this,a),{passport:{name:n,manager:se({type:"number"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=u.current),i==null||i()}),s(this,ne).push(l)},pn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=p=>{const d=[p.x,p.y];return p instanceof de.Vector3&&d.push(p.z),d},u=new X.Store(l(E(this,M,ye).call(this,a)),{passport:{name:n,manager:se({type:"number"},c)}});u.subscribe(p=>{E(this,M,be).call(this,e,r,(d,w)=>d[w].set(...p.current)),i==null||i()}),s(this,ne).push(u)},mn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(E(this,M,ye).call(this,a),{passport:{name:n,manager:se({type:"boolean"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=u.current),i==null||i()}),s(this,ne).push(l)},un=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(`#${E(this,M,ye).call(this,a).getHexString()}`,{passport:{name:n,manager:se({type:"color"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=new de.Color(u.current)),i==null||i()}),s(this,ne).push(l)},_t=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=c==null?void 0:c.variants;if(l){let u=null;for(const d of l)a===de[d]&&(u=d);const p=new X.Store(u||E(this,M,ye).call(this,a),{passport:{name:n,manager:se({},c)}});p.subscribe(d=>{typeof d.current=="string"&&(d.current[0]===d.current[0].toUpperCase()?E(this,M,be).call(this,e,r,(w,L)=>w[L]=de[d.current]):E(this,M,be).call(this,e,r,(w,L)=>w[L]=d.current)),i==null||i()}),s(this,ne).push(p)}},It=function(n){return jn.isObject(n)&&"value"in n},ye=function(n){return E(this,M,It).call(this,n)?n.value:n},be=function(n,a,e){E(this,M,It).call(this,n[a])?e(n[a],"value"):e(n,a)};var g,re,ge,Me,Ee,qe,U,Oe,bt,Ue;class Ot{constructor(n,a){f(this,Oe);f(this,g);f(this,re,[]);f(this,ge);f(this,Me);f(this,Ee);f(this,qe,!0);f(this,U,[]);f(this,Ue,()=>{s(this,U).forEach(n=>{"update"in n&&n.update()})});var l,u;x(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,U).push(p);const d=(u=s(this,g).shadow)==null?void 0:u.camera;if(d instanceof t.Camera){const w=new t.CameraHelper(d);s(this,U).push(w)}}if(s(this,U).forEach(p=>{y.en3.view.add(p)}),x(this,ge,new X.Store([i.position.x,i.position.y,i.position.z],{passport:{name:`${r}.Transformation.Position`,manager:{type:"number",step:c}}})),x(this,Me,new X.Store([i.rotation.x,i.rotation.y,i.rotation.z],{passport:{name:`${r}.Transformation.Rotation`,manager:{type:"number",step:c,ease:.01}}})),x(this,Ee,new X.Store([i.scale.x,i.scale.y,i.scale.z],{passport:{name:`${r}.Transformation.Scale`,manager:{type:"number",step:c}}})),this.save(),x(this,qe,!1),s(this,ge).subscribe(p=>{E(this,Oe,bt).call(this,"position",p.current)}),s(this,Me).subscribe(p=>{E(this,Oe,bt).call(this,"rotation",p.current)}),s(this,Ee).subscribe(p=>{E(this,Oe,bt).call(this,"scale",p.current)}),e){if(s(this,re).push(new he(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,re).push(new he(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,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Shadow`,afterChange:()=>{p.needsUpdate=!0}})),p.camera&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Shadow.Camera`,afterChange:()=>{p.camera.updateProjectionMatrix()}}))}}s(this,U).length&&Wt.ticker.subscribe(s(this,Ue))}get object3d(){return s(this,g)}get helpers(){return s(this,U)}get raycasterTarget(){return s(this,U)[0]||s(this,g)}destroy(){s(this,re).forEach(n=>n.destroy()),s(this,ge).close(),s(this,Me).close(),s(this,Ee).close(),s(this,g).userData.controlled=!1,s(this,U).forEach(n=>{n&&"dispose"in n&&(n.dispose(),y.en3.view.remove(n))}),Wt.ticker.unsubscribe(s(this,Ue))}save(){const n=(a,e)=>{(!s(this,qe)||a.initial===a.current)&&(a.current=[e.x,e.y,e.z])};n(s(this,ge),s(this,g).position),n(s(this,Me),s(this,g).rotation),n(s(this,Ee),s(this,g).scale)}}g=new WeakMap,re=new WeakMap,ge=new WeakMap,Me=new WeakMap,Ee=new WeakMap,qe=new WeakMap,U=new WeakMap,Oe=new WeakSet,bt=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)},Ue=new WeakMap;const Kt={type:"change"},xt={type:"start"},$t={type:"end"},ut=new t.Ray,Jt=new t.Plane,Bn=Math.cos(70*t.MathUtils.DEG2RAD);class Wn 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",Et),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Et),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(Kt),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(),P=new t.Vector3,N=new t.Quaternion,ie=new t.Vector3,F=2*Math.PI;return function(Ln=null){const Vt=e.object.position;o.copy(Vt).sub(e.target),o.applyQuaternion(h),l.setFromVector3(o),e.autoRotate&&c===r.NONE&&me(gt(Ln)),e.enableDamping?(l.theta+=u.theta*e.dampingFactor,l.phi+=u.phi*e.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let J=e.minAzimuthAngle,ee=e.maxAzimuthAngle;isFinite(J)&&isFinite(ee)&&(J<-Math.PI?J+=F:J>Math.PI&&(J-=F),ee<-Math.PI?ee+=F:ee>Math.PI&&(ee-=F),J<=ee?l.theta=Math.max(J,Math.min(ee,l.theta)):l.theta=l.theta>(J+ee)/2?Math.max(J,l.theta):Math.min(ee,l.theta)),l.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,l.phi)),l.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(d,e.dampingFactor):e.target.add(d),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=oe(l.radius);else{const te=l.radius;l.radius=oe(l.radius*p),Xe=te!=l.radius}if(o.setFromSpherical(l),o.applyQuaternion(b),Vt.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(u.theta*=1-e.dampingFactor,u.phi*=1-e.dampingFactor,d.multiplyScalar(1-e.dampingFactor)):(u.set(0,0,0),d.set(0,0,0)),e.zoomToCursor&&ve){let te=null;if(e.object.isPerspectiveCamera){const Ze=o.length();te=oe(Ze*p);const mt=Ze-te;e.object.position.addScaledVector(K,mt),e.object.updateMatrixWorld(),Xe=!!mt}else if(e.object.isOrthographicCamera){const Ze=new t.Vector3(k.x,k.y,0);Ze.unproject(e.object);const mt=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),e.object.updateProjectionMatrix(),Xe=mt!==e.object.zoom;const Qt=new t.Vector3(k.x,k.y,0);Qt.unproject(e.object),e.object.position.sub(Qt).add(Ze),e.object.updateMatrixWorld(),te=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;te!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(te).add(e.object.position):(ut.origin.copy(e.object.position),ut.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(ut.direction))<Bn?n.lookAt(e.target):(Jt.setFromNormalAndCoplanarPoint(e.object.up,e.target),ut.intersectPlane(Jt,e.target))))}else if(e.object.isOrthographicCamera){const te=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),te!==e.object.zoom&&(e.object.updateProjectionMatrix(),Xe=!0)}return p=1,ve=!1,Xe||P.distanceToSquared(e.object.position)>i||8*(1-N.dot(e.object.quaternion))>i||ie.distanceToSquared(e.target)>i?(e.dispatchEvent(Kt),P.copy(e.object.position),N.copy(e.object.quaternion),ie.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Gt),e.domElement.removeEventListener("pointerdown",Yt),e.domElement.removeEventListener("pointercancel",Ne),e.domElement.removeEventListener("wheel",zt),e.domElement.removeEventListener("pointermove",Mt),e.domElement.removeEventListener("pointerup",Ne),e.domElement.getRootNode().removeEventListener("keydown",Nt,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",Et),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,u=new t.Spherical;let p=1;const d=new t.Vector3,w=new t.Vector2,L=new t.Vector2,W=new t.Vector2,Z=new t.Vector2,O=new t.Vector2,j=new t.Vector2,D=new t.Vector2,T=new t.Vector2,_=new t.Vector2,K=new t.Vector3,k=new t.Vector2;let ve=!1;const I=[],pe={};let ze=!1;function gt(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 me(o){u.theta-=o}function _e(o){u.phi-=o}const G=function(){const o=new t.Vector3;return function(b,P){o.setFromMatrixColumn(P,0),o.multiplyScalar(-b),d.add(o)}}(),Y=function(){const o=new t.Vector3;return function(b,P){e.screenSpacePanning===!0?o.setFromMatrixColumn(P,1):(o.setFromMatrixColumn(P,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(b),d.add(o)}}(),q=function(){const o=new t.Vector3;return function(b,P){const N=e.domElement;if(e.object.isPerspectiveCamera){const ie=e.object.position;o.copy(ie).sub(e.target);let F=o.length();F*=Math.tan(e.object.fov/2*Math.PI/180),G(2*b*F/N.clientHeight,e.object.matrix),Y(2*P*F/N.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(G(b*(e.object.right-e.object.left)/e.object.zoom/N.clientWidth,e.object.matrix),Y(P*(e.object.top-e.object.bottom)/e.object.zoom/N.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function z(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 $(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 A(o,h){if(!e.zoomToCursor)return;ve=!0;const b=e.domElement.getBoundingClientRect(),P=o-b.left,N=h-b.top,ie=b.width,F=b.height;k.x=P/ie*2-1,k.y=-(N/F)*2+1,K.set(k.x,k.y,1).unproject(e.object).sub(e.object.position).normalize()}function oe(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function ue(o){w.set(o.clientX,o.clientY)}function Ie(o){A(o.clientX,o.clientX),D.set(o.clientX,o.clientY)}function ht(o){Z.set(o.clientX,o.clientY)}function pt(o){L.set(o.clientX,o.clientY),W.subVectors(L,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;me(2*Math.PI*W.x/h.clientHeight),_e(2*Math.PI*W.y/h.clientHeight),w.copy(L),e.update()}function fn(o){T.set(o.clientX,o.clientY),_.subVectors(T,D),_.y>0?z(Te(_.y)):_.y<0&&$(Te(_.y)),D.copy(T),e.update()}function yn(o){O.set(o.clientX,o.clientY),j.subVectors(O,Z).multiplyScalar(e.panSpeed),q(j.x,j.y),Z.copy(O),e.update()}function bn(o){A(o.clientX,o.clientY),o.deltaY<0?$(Te(o.deltaY)):o.deltaY>0&&z(Te(o.deltaY)),e.update()}function wn(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?me(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?me(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(-e.keyPanSpeed,0),h=!0;break}h&&(o.preventDefault(),e.update())}function Dt(o){if(I.length===1)w.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);w.set(b,P)}}function Ct(o){if(I.length===1)Z.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);Z.set(b,P)}}function jt(o){const h=Ae(o),b=o.pageX-h.x,P=o.pageY-h.y,N=Math.sqrt(b*b+P*P);D.set(0,N)}function gn(o){e.enableZoom&&jt(o),e.enablePan&&Ct(o)}function Mn(o){e.enableZoom&&jt(o),e.enableRotate&&Dt(o)}function kt(o){if(I.length==1)L.set(o.pageX,o.pageY);else{const b=Ae(o),P=.5*(o.pageX+b.x),N=.5*(o.pageY+b.y);L.set(P,N)}W.subVectors(L,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;me(2*Math.PI*W.x/h.clientHeight),_e(2*Math.PI*W.y/h.clientHeight),w.copy(L)}function Rt(o){if(I.length===1)O.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);O.set(b,P)}j.subVectors(O,Z).multiplyScalar(e.panSpeed),q(j.x,j.y),Z.copy(O)}function Ht(o){const h=Ae(o),b=o.pageX-h.x,P=o.pageY-h.y,N=Math.sqrt(b*b+P*P);T.set(0,N),_.set(0,Math.pow(T.y/D.y,e.zoomSpeed)),z(_.y),D.copy(T);const ie=(o.pageX+h.x)*.5,F=(o.pageY+h.y)*.5;A(ie,F)}function En(o){e.enableZoom&&Ht(o),e.enablePan&&Rt(o)}function Sn(o){e.enableZoom&&Ht(o),e.enableRotate&&kt(o)}function Yt(o){e.enabled!==!1&&(I.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",Mt),e.domElement.addEventListener("pointerup",Ne)),!An(o)&&(_n(o),o.pointerType==="touch"?Zt(o):Pn(o)))}function Mt(o){e.enabled!==!1&&(o.pointerType==="touch"?Tn(o):xn(o))}function Ne(o){switch(In(o),I.length){case 0:e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",Mt),e.domElement.removeEventListener("pointerup",Ne),e.dispatchEvent($t),c=r.NONE;break;case 1:const h=I[0],b=pe[h];Zt({pointerId:h,pageX:b.x,pageY:b.y});break}}function Pn(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;ht(o),c=r.PAN}else{if(e.enableRotate===!1)return;ue(o),c=r.ROTATE}break;case t.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;ue(o),c=r.ROTATE}else{if(e.enablePan===!1)return;ht(o),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(xt)}function xn(o){switch(c){case r.ROTATE:if(e.enableRotate===!1)return;pt(o);break;case r.DOLLY:if(e.enableZoom===!1)return;fn(o);break;case r.PAN:if(e.enablePan===!1)return;yn(o);break}}function zt(o){e.enabled===!1||e.enableZoom===!1||c!==r.NONE||(o.preventDefault(),e.dispatchEvent(xt),bn(vn(o)),e.dispatchEvent($t))}function vn(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 Nt(o){o.key==="Control"&&(ze=!0,e.domElement.getRootNode().addEventListener("keyup",Xt,{passive:!0,capture:!0}))}function Xt(o){o.key==="Control"&&(ze=!1,e.domElement.getRootNode().removeEventListener("keyup",Xt,{passive:!0,capture:!0}))}function Et(o){e.enabled===!1||e.enablePan===!1||wn(o)}function Zt(o){switch(Ft(o),I.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;Dt(o),c=r.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;Ct(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;gn(o),c=r.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Mn(o),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(xt)}function Tn(o){switch(Ft(o),c){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;kt(o),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;Rt(o),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;En(o),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Sn(o),e.update();break;default:c=r.NONE}}function Gt(o){e.enabled!==!1&&o.preventDefault()}function _n(o){I.push(o.pointerId)}function In(o){delete pe[o.pointerId];for(let h=0;h<I.length;h++)if(I[h]==o.pointerId){I.splice(h,1);return}}function An(o){for(let h=0;h<I.length;h++)if(I[h]==o.pointerId)return!0;return!1}function Ft(o){let h=pe[o.pointerId];h===void 0&&(h=new t.Vector2,pe[o.pointerId]=h),h.set(o.pageX,o.pageY)}function Ae(o){const h=o.pointerId===I[0]?I[1]:I[0];return pe[h]}e.domElement.addEventListener("contextmenu",Gt),e.domElement.addEventListener("pointerdown",Yt),e.domElement.addEventListener("pointercancel",Ne),e.domElement.addEventListener("wheel",zt,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Nt,{passive:!0,capture:!0}),this.update()}}const fe=new t.Raycaster,H=new t.Vector3,ae=new t.Vector3,v=new t.Quaternion,en={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},vt={type:"change"},tn={type:"mouseDown",mode:null},nn={type:"mouseUp",mode:null},on={type:"objectChange"};class Kn 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 oo;this._gizmo=e,this.add(e);const r=new io;this._plane=r,this.add(r);const c=this;function i(T,_){let K=_;Object.defineProperty(c,T,{get:function(){return K!==void 0?K:_},set:function(k){K!==k&&(K=k,r[T]=k,e[T]=k,c.dispatchEvent({type:T+"-changed",value:k}),c.dispatchEvent(vt))}}),c[T]=_,r[T]=_,e[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,u=new t.Vector3,p=new t.Quaternion,d=new t.Quaternion,w=new t.Vector3,L=new t.Quaternion,W=new t.Vector3,Z=new t.Vector3,O=new t.Vector3,j=0,D=new t.Vector3;i("worldPosition",l),i("worldPositionStart",u),i("worldQuaternion",p),i("worldQuaternionStart",d),i("cameraPosition",w),i("cameraQuaternion",L),i("pointStart",W),i("pointEnd",Z),i("rotationAxis",O),i("rotationAngle",j),i("eye",D),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=$n.bind(this),this._onPointerDown=eo.bind(this),this._onPointerHover=Jn.bind(this),this._onPointerMove=to.bind(this),this._onPointerUp=no.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&&fe.setFromCamera(n,this.camera);const a=Tt(this._gizmo.picker[this.mode],fe);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&&fe.setFromCamera(n,this.camera);const a=Tt(this._plane,fe,!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,tn.mode=this.mode,this.dispatchEvent(tn)}}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&&fe.setFromCamera(n,this.camera);const i=Tt(this._plane,fe,!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(v.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(H.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(H.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),ae.set(l,l,l)}else H.copy(this.pointStart),ae.copy(this.pointEnd),H.applyQuaternion(this._worldQuaternionInv),ae.applyQuaternion(this._worldQuaternionInv),ae.divide(H),a.search("X")===-1&&(ae.x=1),a.search("Y")===-1&&(ae.y=1),a.search("Z")===-1&&(ae.z=1);r.scale.copy(this._scaleStart).multiply(ae),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(H.setFromMatrixPosition(this.camera.matrixWorld));let u=!1;a==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(H.copy(this.rotationAxis).cross(this.eye))*l):(a==="X"||a==="Y"||a==="Z")&&(this.rotationAxis.copy(en[a]),H.copy(en[a]),c==="local"&&H.applyQuaternion(this.worldQuaternion),H.cross(this.eye),H.length()===0?u=!0:this.rotationAngle=this._offset.dot(H.normalize())*l),(a==="E"||u)&&(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(v.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(v.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(vt),this.dispatchEvent(on)}}pointerUp(n){n!==null&&n.button!==0||(this.dragging&&this.axis!==null&&(nn.mode=this.mode,this.dispatchEvent(nn)),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(vt),this.dispatchEvent(on),this.pointStart.copy(this.pointEnd))}getRaycaster(){return fe}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 $n(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 Jn(m){if(this.enabled)switch(m.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(m));break}}function eo(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 to(m){this.enabled&&this.pointerMove(this._getPointer(m))}function no(m){this.enabled&&(this.domElement.releasePointerCapture(m.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(m)))}function Tt(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 dt=new t.Euler,S=new t.Vector3(0,1,0),sn=new t.Vector3(0,0,0),an=new t.Matrix4,ft=new t.Quaternion,wt=new t.Quaternion,B=new t.Vector3,rn=new t.Matrix4,Ve=new t.Vector3(1,0,0),we=new t.Vector3(0,1,0),Qe=new t.Vector3(0,0,1),yt=new t.Vector3,Ge=new t.Vector3,Fe=new t.Vector3;class oo 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 u=n.clone();u.color.setHex(16711680),u.opacity=.5;const p=n.clone();p.color.setHex(65280),p.opacity=.5;const d=n.clone();d.color.setHex(255),d.opacity=.5;const w=n.clone();w.opacity=.25;const L=n.clone();L.color.setHex(16776960),L.opacity=.25,n.clone().color.setHex(16776960);const Z=n.clone();Z.color.setHex(7895160);const O=new t.CylinderGeometry(0,.04,.1,12);O.translate(0,.05,0);const j=new t.BoxGeometry(.08,.08,.08);j.translate(0,.04,0);const D=new t.BufferGeometry;D.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const T=new t.CylinderGeometry(.0075,.0075,.5,3);T.translate(0,.25,0);function _(Y,q){const z=new t.TorusGeometry(Y,.0075,3,64,q*Math.PI*2);return z.rotateY(Math.PI/2),z.rotateX(Math.PI/2),z}function K(){const Y=new t.BufferGeometry;return Y.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),Y}const k={X:[[new t.Mesh(O,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(O,c),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(T,c),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(O,i),[0,.5,0]],[new t.Mesh(O,i),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(T,i)]],Z:[[new t.Mesh(O,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(O,l),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(T,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),d.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),u.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]]]},I={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(K(),r),null,null,null,"helper"]],X:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(D,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(D,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},pe={XYZE:[[new t.Mesh(_(.5,1),Z),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(_(.5,.5),c)]],Y:[[new t.Mesh(_(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(_(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(_(.75,1),L),null,[0,Math.PI/2,0]]]},ze={AXIS:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},gt={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(j,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(T,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(j,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(j,i),[0,.5,0]],[new t.Mesh(T,i)],[new t.Mesh(j,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(j,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(T,l),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(j,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),u),[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())]]},me={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(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(D,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(D,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function G(Y){const q=new t.Object3D;for(const z in Y)for(let $=Y[z].length;$--;){const A=Y[z][$][0].clone(),oe=Y[z][$][1],ue=Y[z][$][2],Ie=Y[z][$][3],ht=Y[z][$][4];A.name=z,A.tag=ht,oe&&A.position.set(oe[0],oe[1],oe[2]),ue&&A.rotation.set(ue[0],ue[1],ue[2]),Ie&&A.scale.set(Ie[0],Ie[1],Ie[2]),A.updateMatrix();const pt=A.geometry.clone();pt.applyMatrix4(A.matrix),A.geometry=pt,A.renderOrder=1/0,A.position.set(0,0,0),A.rotation.set(0,0,0),A.scale.set(1,1,1),q.add(A)}return q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=G(k)),this.add(this.gizmo.rotate=G(pe)),this.add(this.gizmo.scale=G(Te)),this.add(this.picker.translate=G(ve)),this.add(this.picker.rotate=G(gt)),this.add(this.picker.scale=G(me)),this.add(this.helper.translate=G(I)),this.add(this.helper.rotate=G(ze)),this.add(this.helper.scale=G(_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:wt;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"&&(v.setFromEuler(dt.set(0,0,0)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(v.setFromEuler(dt.set(0,0,Math.PI/2)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(v.setFromEuler(dt.set(0,Math.PI/2,0)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(v.setFromEuler(dt.set(0,Math.PI/2,0)),S.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(an.lookAt(sn,S,we)),i.quaternion.multiply(v),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),H.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),H.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(H),i.visible=this.dragging):(i.quaternion.copy(e),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(S.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(S.copy(we).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(S.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(S.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(S.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(S.copy(we).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(ft.copy(e),S.copy(this.eye).applyQuaternion(v.copy(e).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(an.lookAt(this.eye,sn,we)),i.name==="X"&&(v.setFromAxisAngle(Ve,Math.atan2(-S.y,S.z)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v)),i.name==="Y"&&(v.setFromAxisAngle(we,Math.atan2(S.x,S.z)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v)),i.name==="Z"&&(v.setFromAxisAngle(Qe,Math.atan2(S.y,S.x)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v))),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(u){return i.name===u}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(n)}}class io 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"),yt.copy(Ve).applyQuaternion(a==="local"?this.worldQuaternion:wt),Ge.copy(we).applyQuaternion(a==="local"?this.worldQuaternion:wt),Fe.copy(Qe).applyQuaternion(a==="local"?this.worldQuaternion:wt),S.copy(Ge),this.mode){case"translate":case"scale":switch(this.axis){case"X":S.copy(this.eye).cross(yt),B.copy(yt).cross(S);break;case"Y":S.copy(this.eye).cross(Ge),B.copy(Ge).cross(S);break;case"Z":S.copy(this.eye).cross(Fe),B.copy(Fe).cross(S);break;case"XY":B.copy(Fe);break;case"YZ":B.copy(yt);break;case"XZ":S.copy(Fe),B.copy(Ge);break;case"XYZ":case"E":B.set(0,0,0);break}break;case"rotate":default:B.set(0,0,0)}B.length()===0?this.quaternion.copy(this.cameraQuaternion):(rn.lookAt(H.set(0,0,0),B,S),this.quaternion.setFromRotationMatrix(rn)),super.updateMatrixWorld(n)}}var V,Se;class so{constructor(){f(this,V);f(this,Se);x(this,V,new Wn(y.en3.camera,y.en3.webglRenderer.domElement)),x(this,Se,new X.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",invisible:!0}}}));let n=!0;s(this,Se).subscribe(a=>{s(this,V).target.set(...a.current),n&&s(this,V).update()}),s(this,V).addEventListener("change",()=>{n=!1,s(this,Se).current=[s(this,V).target.x,s(this,V).target.y,s(this,V).target.z],n=!0})}get controls(){return s(this,V)}destroy(){s(this,V).dispose(),s(this,Se).close()}}V=new WeakMap,Se=new WeakMap;var R,Be,We,Ke,$e,Je,et,tt,nt;class ao{constructor(){f(this,R,null);f(this,Be,new X.Store(y.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));f(this,We,new X.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));f(this,Ke,new X.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));f(this,$e,new X.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));f(this,Je,new X.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));f(this,et,new X.Store(!0,{passport:{name:"Helpers.Grid.Visible",manager:{type:"boolean"}}}));f(this,tt);f(this,nt,n=>{n.key==="g"&&(s(this,R).visible=!s(this,R).visible)});x(this,tt,new kn.Composed([s(this,Be),s(this,We),s(this,Ke),s(this,$e),s(this,Je),s(this,et)],()=>{s(this,R)&&(y.en3.view.remove(s(this,R)),s(this,R).dispose()),x(this,R,new t.GridHelper(s(this,Be).current,s(this,We).current,s(this,Ke).current,s(this,$e).current)),s(this,R).rotation.x=s(this,Je).current?Math.PI/2:0,s(this,R).visible=s(this,et).current,y.en3.view.add(s(this,R))})),addEventListener("keydown",s(this,nt))}get helper(){return s(this,R)}destroy(){s(this,tt).close(),s(this,R)&&(y.en3.view.remove(s(this,R)),s(this,R).dispose()),removeEventListener("keydown",s(this,nt))}}R=new WeakMap,Be=new WeakMap,We=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap;var C,Q,ce,le,ot,De,it,st,At;class ro{constructor(){f(this,st);f(this,C);f(this,Q,[]);f(this,ce,null);f(this,le,n=>{if(n.child.name.startsWith("T.")&&!s(this,Q).find(a=>a.object3d===n.child)){const a=new Ot(n.child);s(this,Q).push(a),y.en3.raycaster.add(a.raycasterTarget,{eventDispatcher:a.raycasterTarget}),a.raycasterTarget.addEventListener("pointerDown",s(this,De)),a.object3d.addEventListener("childadded",s(this,le))}});f(this,ot,n=>{const a=E(this,st,At).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,le)),x(this,Q,s(this,Q).filter(e=>e!==a)))});f(this,De,n=>{const a=E(this,st,At).call(this,n.target);a&&(x(this,ce,s(this,Q).find(e=>e.object3d===(a==null?void 0:a.object3d))||null),s(this,ce)&&s(this,C).attach(s(this,ce).object3d))});f(this,it,n=>{n.key==="t"?s(this,C).setMode("translate"):n.key==="r"?s(this,C).setMode("rotate"):n.key==="s"?s(this,C).setMode("scale"):n.key==="Escape"?s(this,C).detach():n.key==="+"||n.key==="="?s(this,C).setSize(s(this,C).size+.1):n.key==="-"||n.key==="_"?s(this,C).setSize(s(this,C).size-.1):n.key==="h"&&s(this,Q).forEach(a=>{a.helpers.forEach(e=>{e.visible=!e.visible})})});x(this,C,new Kn(y.en3.camera,y.en3.webglRenderer.domElement)),s(this,C).addEventListener("objectChange",n=>{s(this,ce)&&s(this,ce).save()}),y.en3.view.add(s(this,C)),y.en3.scene.addEventListener("childadded",s(this,le)),y.en3.scene.addEventListener("childremoved",s(this,ot)),window.addEventListener("keydown",s(this,it))}get controls(){return s(this,C)}destroy(){y.en3.scene.removeEventListener("childadded",s(this,le)),y.en3.scene.removeEventListener("childremoved",s(this,ot)),window.removeEventListener("keydown",s(this,it)),s(this,C).dispose(),s(this,Q).forEach(n=>{n.raycasterTarget.removeEventListener("pointerDown",s(this,De)),n.object3d.removeEventListener("childadded",s(this,le)),n.destroy()}),x(this,Q,[])}}C=new WeakMap,Q=new WeakMap,ce=new WeakMap,le=new WeakMap,ot=new WeakMap,De=new WeakMap,it=new WeakMap,st=new WeakSet,At=function(n){return s(this,Q).find(e=>e.object3d===n||e.raycasterTarget===n)};var Ce,je,ke,Re,xe,Lt,dn;class co{constructor(){f(this,xe);f(this,Ce);f(this,je);f(this,ke);f(this,Re,[]);x(this,Ce,y.en3.composer.addPass=y.en3.composer.addPass.bind(y.en3.composer)),y.en3.composer.addPass=(...n)=>{E(this,xe,Lt).call(this,n[0]),s(this,Ce).call(this,...n)},x(this,je,y.en3.composer.removePass=y.en3.composer.removePass.bind(y.en3.composer)),y.en3.composer.removePass=(...n)=>{E(this,xe,dn).call(this,n[0]),s(this,je).call(this,...n)},x(this,ke,y.en3.composer.insertPass=y.en3.composer.insertPass.bind(y.en3.composer)),y.en3.composer.insertPass=(...n)=>{E(this,xe,Lt).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,xe=new WeakSet,Lt=function(n){s(this,Re).push(new he(n,{folderName:`EffectComposer.${n.constructor.name}`,skipKeys:["renderToScreen","needsSwap","nMips","oldClearAlpha","clearColor","resolution"]})),"uniforms"in n&&s(this,Re).push(new he(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"]}))},dn=function(n){};var at,rt,ct,lt,He,Pe,Ye;class lo{constructor(){f(this,at);f(this,rt);f(this,ct,null);f(this,lt);f(this,He);f(this,Pe);f(this,Ye);x(this,at,new he(y.en3.webglRenderer,{folderName:"Renderer"})),x(this,rt,new he(y.en3.webglRenderer.shadowMap,{folderName:"Renderer.shadowMap",optionsCatalog:{type:{type:"select",variants:["BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap"]}},afterChange:()=>{y.en3.webglRenderer.shadowMap.needsUpdate=!0,Rn.traverseMaterials(y.en3.scene,n=>{n.needsUpdate=!0})}})),y.en3.composer&&x(this,ct,new co),x(this,lt,new ao),x(this,He,new Ot(y.en3.camera)),x(this,Pe,new so),s(this,Pe).controls.addEventListener("change",()=>{s(this,He).save()}),x(this,Ye,new ro),s(this,Ye).controls.addEventListener("dragging-changed",n=>{s(this,Pe).controls.enabled=!n.value})}destroy(){var n;s(this,at).destroy(),s(this,rt).destroy(),(n=s(this,ct))==null||n.destroy(),s(this,lt).destroy(),s(this,He).destroy(),s(this,Pe).destroy(),s(this,Ye).destroy()}}at=new WeakMap,rt=new WeakMap,ct=new WeakMap,lt=new WeakMap,He=new WeakMap,Pe=new WeakMap,Ye=new WeakMap;exports.En3Helpers=lo;exports.En3Object3dManager=Ot;
|