archgine 1.0.68 → 1.0.69
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/environment.worker.js +1 -1
- package/lib/extras/interfaces.d.ts +1 -0
- package/lib/extras/svg-app.d.ts +2 -0
- package/lib/extras/svg-multi-selector.d.ts +2 -0
- package/lib/extras/svg-view.d.ts +2 -0
- package/lib/index.mjs +17 -5
- package/lib/index.umd.js +4 -4
- package/lib/renderer.worker.js +1 -1
- package/package.json +1 -1
|
@@ -4010,7 +4010,7 @@ Fu.__DOMHandler = Eu;
|
|
|
4010
4010
|
Fu.normalizeLineEndings = Le;
|
|
4011
4011
|
Fu.DOMParser = Ie;
|
|
4012
4012
|
var gr = Fu.DOMParser;
|
|
4013
|
-
const Er = "1.0.
|
|
4013
|
+
const Er = "1.0.69";
|
|
4014
4014
|
function vr() {
|
|
4015
4015
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4016
4016
|
}
|
|
@@ -51,6 +51,7 @@ export interface IApp {
|
|
|
51
51
|
multiSelectEnableChanged(v: boolean): void;
|
|
52
52
|
clearSelected(): void;
|
|
53
53
|
socialDistanceEnableChanged(v: boolean): void;
|
|
54
|
+
fnEnableChanged(v?: boolean): void;
|
|
54
55
|
getBoundingBoxById(id: string, viewTrans?: boolean): Box2 | undefined;
|
|
55
56
|
setDummies(dummies: IDummyVo[]): void;
|
|
56
57
|
clearDummies(): void;
|
package/lib/extras/svg-app.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare class SvgApp<Config extends ISvgAppConfig> extends EventDispatche
|
|
|
28
28
|
zoomBox: Box2;
|
|
29
29
|
selectEnable: boolean;
|
|
30
30
|
multiSelectEnable: boolean;
|
|
31
|
+
fnEnable: boolean;
|
|
31
32
|
requestHeader: any;
|
|
32
33
|
private readonly runningHandler;
|
|
33
34
|
private readonly pointerOverHandler;
|
|
@@ -91,6 +92,7 @@ export declare class SvgApp<Config extends ISvgAppConfig> extends EventDispatche
|
|
|
91
92
|
selectEnableChanged(v: boolean): void;
|
|
92
93
|
multiSelectEnableChanged(v: boolean): void;
|
|
93
94
|
socialDistanceEnableChanged(v: boolean): void;
|
|
95
|
+
fnEnableChanged(v?: boolean): void;
|
|
94
96
|
getBoundingBoxById(id: string, viewTrans?: boolean): Box2 | undefined;
|
|
95
97
|
setDummies(dummies: IDummyVo[]): void;
|
|
96
98
|
clearDummies(aeTypes?: string[]): void;
|
|
@@ -14,6 +14,7 @@ export declare class SvgMultiSelector extends EventDispatcher {
|
|
|
14
14
|
graph: DynamicDrawRect;
|
|
15
15
|
selectEnable: boolean;
|
|
16
16
|
multiSelectEnable: boolean;
|
|
17
|
+
fnEnable: boolean;
|
|
17
18
|
controllerTapHandler: (e: IEvent) => void;
|
|
18
19
|
controllerPanStartHandler: (e: IEvent) => void;
|
|
19
20
|
controllerPanMoveHandler: (e: IEvent) => void;
|
|
@@ -23,6 +24,7 @@ export declare class SvgMultiSelector extends EventDispatcher {
|
|
|
23
24
|
bindScene(scene: Scene): void;
|
|
24
25
|
selectEnableChanged(v: boolean): void;
|
|
25
26
|
multiSelectEnableChanged(v: boolean): void;
|
|
27
|
+
fnEnableChanged(v?: boolean): void;
|
|
26
28
|
bindControllerEvents(): void;
|
|
27
29
|
unbindControllerEvents(): void;
|
|
28
30
|
handleControllerTap(e: IEvent): void;
|
package/lib/extras/svg-view.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare class SvgView<Config extends ISvgViewConfig> extends EventDispatc
|
|
|
30
30
|
zoomBox: Box2;
|
|
31
31
|
selectEnable: boolean;
|
|
32
32
|
multiSelectEnable: boolean;
|
|
33
|
+
fnEnable: boolean;
|
|
33
34
|
tween?: Tween;
|
|
34
35
|
animateDuration: number;
|
|
35
36
|
label?: Label;
|
|
@@ -54,6 +55,7 @@ export declare class SvgView<Config extends ISvgViewConfig> extends EventDispatc
|
|
|
54
55
|
zoomToSelectEnableChanged(v: boolean): void;
|
|
55
56
|
selectEnableChanged(v: boolean): void;
|
|
56
57
|
multiSelectEnableChanged(v: boolean): void;
|
|
58
|
+
fnEnableChanged(v?: boolean): void;
|
|
57
59
|
getIntersectObjects(rayCaster: IRaycaster, assetType?: string, out?: HTMLElement[]): HTMLElement[];
|
|
58
60
|
focusAt(position: IVector2, padding?: number): Promise<void>;
|
|
59
61
|
focusAtById(id: string, padding?: number): Promise<void>;
|
package/lib/index.mjs
CHANGED
|
@@ -4010,7 +4010,7 @@ ou.__DOMHandler = Ra;
|
|
|
4010
4010
|
ou.normalizeLineEndings = Cd;
|
|
4011
4011
|
ou.DOMParser = Dd;
|
|
4012
4012
|
var Yx = ou.DOMParser;
|
|
4013
|
-
const Xx = "1.0.
|
|
4013
|
+
const Xx = "1.0.69";
|
|
4014
4014
|
function Zx() {
|
|
4015
4015
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4016
4016
|
}
|
|
@@ -14066,6 +14066,7 @@ class DA extends rr {
|
|
|
14066
14066
|
graph;
|
|
14067
14067
|
selectEnable = !1;
|
|
14068
14068
|
multiSelectEnable = !1;
|
|
14069
|
+
fnEnable = !1;
|
|
14069
14070
|
controllerTapHandler = this.handleControllerTap.bind(this);
|
|
14070
14071
|
controllerPanStartHandler = this.handleControllerPanStart.bind(this);
|
|
14071
14072
|
controllerPanMoveHandler = this.handleControllerPanMove.bind(this);
|
|
@@ -14085,7 +14086,10 @@ class DA extends rr {
|
|
|
14085
14086
|
}
|
|
14086
14087
|
multiSelectEnableChanged(t) {
|
|
14087
14088
|
var e;
|
|
14088
|
-
(e = this.scene) == null || e.clearSelected(), this.multiSelectEnable = !!t, this.controller.enablePan = !this.multiSelectEnable;
|
|
14089
|
+
(e = this.scene) == null || e.clearSelected(), this.multiSelectEnable = !!t, this.controller.enablePan = !this.multiSelectEnable || this.multiSelectEnable && !this.fnEnable;
|
|
14090
|
+
}
|
|
14091
|
+
fnEnableChanged(t) {
|
|
14092
|
+
this.fnEnable = !!t, this.controller.enablePan = !this.multiSelectEnable || this.multiSelectEnable && !this.fnEnable;
|
|
14089
14093
|
}
|
|
14090
14094
|
// controller events
|
|
14091
14095
|
bindControllerEvents() {
|
|
@@ -14104,14 +14108,14 @@ class DA extends rr {
|
|
|
14104
14108
|
});
|
|
14105
14109
|
}
|
|
14106
14110
|
handleControllerPanStart(t) {
|
|
14107
|
-
(t == null ? void 0 : t.type) === ut.PAN_START && this.multiSelectEnable && (this.p1.copy(t.data.screenCoords), Hn.makeEmpty().expandByPoint(this.p1), this.graph.draw(Hn));
|
|
14111
|
+
(t == null ? void 0 : t.type) === ut.PAN_START && this.multiSelectEnable && (this.controller.enablePan || (this.p1.copy(t.data.screenCoords), Hn.makeEmpty().expandByPoint(this.p1), this.graph.draw(Hn)));
|
|
14108
14112
|
}
|
|
14109
14113
|
handleControllerPanMove(t) {
|
|
14110
|
-
(t == null ? void 0 : t.type) === ut.PAN_MOVE && this.multiSelectEnable && (this.p2.copy(t.data.screenCoords), Hn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2), this.graph.draw(Hn));
|
|
14114
|
+
(t == null ? void 0 : t.type) === ut.PAN_MOVE && this.multiSelectEnable && (this.controller.enablePan || (this.p2.copy(t.data.screenCoords), Hn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2), this.graph.draw(Hn)));
|
|
14111
14115
|
}
|
|
14112
14116
|
handleControllerPanEnd(t) {
|
|
14113
14117
|
var a;
|
|
14114
|
-
if ((t == null ? void 0 : t.type) !== ut.PAN_END || !this.multiSelectEnable) return;
|
|
14118
|
+
if ((t == null ? void 0 : t.type) !== ut.PAN_END || !this.multiSelectEnable || this.controller.enablePan) return;
|
|
14115
14119
|
this.p2.copy(t.data.screenCoords), Hn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera);
|
|
14116
14120
|
const e = (a = this.scene) == null ? void 0 : a.getElementsByBox(Hn), i = [];
|
|
14117
14121
|
(e || []).forEach((o) => i.push(o.id)), this.graph.hide(), Hn.makeEmpty(), this.dispatchEvent({ type: "SELECTED", data: { target: e, selected: i } });
|
|
@@ -17203,6 +17207,7 @@ class _b extends rr {
|
|
|
17203
17207
|
zoomBox = new Dt();
|
|
17204
17208
|
selectEnable = !1;
|
|
17205
17209
|
multiSelectEnable = !1;
|
|
17210
|
+
fnEnable = !1;
|
|
17206
17211
|
tween;
|
|
17207
17212
|
animateDuration;
|
|
17208
17213
|
label;
|
|
@@ -17263,6 +17268,9 @@ class _b extends rr {
|
|
|
17263
17268
|
multiSelectEnableChanged(t) {
|
|
17264
17269
|
this.multiSelectEnable = !!t, this.multiSelector.multiSelectEnableChanged(t);
|
|
17265
17270
|
}
|
|
17271
|
+
fnEnableChanged(t) {
|
|
17272
|
+
this.fnEnable = !!t, this.multiSelector.fnEnableChanged(t);
|
|
17273
|
+
}
|
|
17266
17274
|
// ================ events
|
|
17267
17275
|
getIntersectObjects(t, e, i = []) {
|
|
17268
17276
|
return this.scene ? this.scene.getIntersectObjects(t, e, i) : i;
|
|
@@ -17467,6 +17475,7 @@ class $b extends rr {
|
|
|
17467
17475
|
zoomBox = new Dt();
|
|
17468
17476
|
selectEnable = !1;
|
|
17469
17477
|
multiSelectEnable = !1;
|
|
17478
|
+
fnEnable = !1;
|
|
17470
17479
|
requestHeader = {};
|
|
17471
17480
|
runningHandler = this.running.bind(this);
|
|
17472
17481
|
pointerOverHandler = this.handlePointerOver.bind(this);
|
|
@@ -17703,6 +17712,9 @@ class $b extends rr {
|
|
|
17703
17712
|
var e;
|
|
17704
17713
|
(e = this.scene) == null || e.socialDistanceEnableChanged(t);
|
|
17705
17714
|
}
|
|
17715
|
+
fnEnableChanged(t) {
|
|
17716
|
+
this.fnEnable = !!t, this.view.fnEnableChanged(t);
|
|
17717
|
+
}
|
|
17706
17718
|
getBoundingBoxById(t, e = !0) {
|
|
17707
17719
|
var a;
|
|
17708
17720
|
if (!t) return;
|
package/lib/index.umd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),r.entityMap=r.HTML_ENTITIES})(pc);var Su={},zs=di.NAMESPACE,Ou=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,dc=new RegExp("[\\-\\.0-9"+Ou.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),gc=new RegExp("^"+Ou.source+dc.source+"*(?::"+Ou.source+dc.source+"*)?$"),$s=0,zi=1,Jn=2,Gs=3,ts=4,es=5,Ys=6,Qa=7;function rs(r,t){this.message=r,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,rs)}rs.prototype=new Error,rs.prototype.name=rs.name;function yc(){}yc.prototype={parse:function(r,t,e){var i=this.domBuilder;i.startDocument(),xc(t,t={}),Wg(r,t,e,i,this.errorHandler),i.endDocument()}};function Wg(r,t,e,i,a){function o(O){if(O>65535){O-=65536;var vt=55296+(O>>10),Bt=56320+(O&1023);return String.fromCharCode(vt,Bt)}else return String.fromCharCode(O)}function l(O){var vt=O.slice(1,-1);return Object.hasOwnProperty.call(e,vt)?e[vt]:vt.charAt(0)==="#"?o(parseInt(vt.substr(1).replace("x","0x"))):(a.error("entity not found:"+O),O)}function c(O){if(O>L){var vt=r.substring(L,O).replace(/&#?\w+;/g,l);_&&f(L),i.characters(vt,0,O-L),L=O}}function f(O,vt){for(;O>=g&&(vt=E.exec(r));)d=vt.index,g=d+vt[0].length,_.lineNumber++;_.columnNumber=O-d+1}for(var d=0,g=0,E=/.*(?:\r\n?|\n)|.*$/g,_=i.locator,C=[{currentNSMap:t}],R={},L=0;;){try{var N=r.indexOf("<",L);if(N<0){if(!r.substr(L).match(/^\s*$/)){var I=i.doc,W=I.createTextNode(r.substr(L));I.appendChild(W),i.currentElement=W}return}switch(N>L&&c(N),r.charAt(N+1)){case"/":var J=r.indexOf(">",N+3),G=r.substring(N+2,J).replace(/[ \t\n\r]+$/g,""),b=C.pop();J<0?(G=r.substring(N+2).replace(/[\s<].*/,""),a.error("end tag name: "+G+" is not complete:"+b.tagName),J=N+1+G.length):G.match(/\s</)&&(G=G.replace(/[\s<].*/,""),a.error("end tag name: "+G+" maybe not complete"),J=N+1+G.length);var F=b.localNSMap,q=b.tagName==G,K=q||b.tagName&&b.tagName.toLowerCase()==G.toLowerCase();if(K){if(i.endElement(b.uri,b.localName,G),F)for(var tt in F)Object.prototype.hasOwnProperty.call(F,tt)&&i.endPrefixMapping(tt);q||a.fatalError("end tag name: "+G+" is not match the current start tagName:"+b.tagName)}else C.push(b);J++;break;case"?":_&&f(N),J=Yg(r,N,i);break;case"!":_&&f(N),J=Gg(r,N,i,a);break;default:_&&f(N);var Z=new Ec,rt=C[C.length-1].currentNSMap,J=Vg(r,N,Z,rt,l,a),st=Z.length;if(!Z.closed&&$g(r,J,Z.tagName,R)&&(Z.closed=!0,e.nbsp||a.warning("unclosed xml attribute")),_&&st){for(var ct=mc(_,{}),ft=0;ft<st;ft++){var pt=Z[ft];f(pt.offset),pt.locator=mc(_,{})}i.locator=ct,vc(Z,i,rt)&&C.push(Z),i.locator=_}else vc(Z,i,rt)&&C.push(Z);zs.isHTML(Z.uri)&&!Z.closed?J=zg(r,J,Z.tagName,l,i):J++}}catch(O){if(O instanceof rs)throw O;a.error("element parse error: "+O),J=-1}J>L?L=J:c(Math.max(N,L)+1)}}function mc(r,t){return t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber,t}function Vg(r,t,e,i,a,o){function l(_,C,R){e.attributeNames.hasOwnProperty(_)&&o.fatalError("Attribute "+_+" redefined"),e.addValue(_,C.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),R)}for(var c,f,d=++t,g=$s;;){var E=r.charAt(d);switch(E){case"=":if(g===zi)c=r.slice(t,d),g=Gs;else if(g===Jn)g=Gs;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===Gs||g===zi)if(g===zi&&(o.warning('attribute value must after "="'),c=r.slice(t,d)),t=d+1,d=r.indexOf(E,t),d>0)f=r.slice(t,d),l(c,f,t-1),g=es;else throw new Error("attribute value no end '"+E+"' match");else if(g==ts)f=r.slice(t,d),l(c,f,t),o.warning('attribute "'+c+'" missed start quot('+E+")!!"),t=d+1,g=es;else throw new Error('attribute value must after "="');break;case"/":switch(g){case $s:e.setTagName(r.slice(t,d));case es:case Ys:case Qa:g=Qa,e.closed=!0;case ts:case zi:break;case Jn:e.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),g==$s&&e.setTagName(r.slice(t,d)),d;case">":switch(g){case $s:e.setTagName(r.slice(t,d));case es:case Ys:case Qa:break;case ts:case zi:f=r.slice(t,d),f.slice(-1)==="/"&&(e.closed=!0,f=f.slice(0,-1));case Jn:g===Jn&&(f=c),g==ts?(o.warning('attribute "'+f+'" missed quot(")!'),l(c,f,t)):((!zs.isHTML(i[""])||!f.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),l(f,f,t));break;case Gs:throw new Error("attribute value missed!!")}return d;case"":E=" ";default:if(E<=" ")switch(g){case $s:e.setTagName(r.slice(t,d)),g=Ys;break;case zi:c=r.slice(t,d),g=Jn;break;case ts:var f=r.slice(t,d);o.warning('attribute "'+f+'" missed quot(")!!'),l(c,f,t);case es:g=Ys;break}else switch(g){case Jn:e.tagName,(!zs.isHTML(i[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),l(c,c,t),t=d,g=zi;break;case es:o.warning('attribute space is required"'+c+'"!!');case Ys:g=zi,t=d;break;case Gs:g=ts,t=d;break;case Qa:throw new Error("elements closed character '/' and '>' must be connected to")}}d++}}function vc(r,t,e){for(var i=r.tagName,a=null,E=r.length;E--;){var o=r[E],l=o.qName,c=o.value,_=l.indexOf(":");if(_>0)var f=o.prefix=l.slice(0,_),d=l.slice(_+1),g=f==="xmlns"&&d;else d=l,f=null,g=l==="xmlns"&&"";o.localName=d,g!==!1&&(a==null&&(a={},xc(e,e={})),e[g]=a[g]=c,o.uri=zs.XMLNS,t.startPrefixMapping(g,c))}for(var E=r.length;E--;){o=r[E];var f=o.prefix;f&&(f==="xml"&&(o.uri=zs.XML),f!=="xmlns"&&(o.uri=e[f||""]))}var _=i.indexOf(":");_>0?(f=r.prefix=i.slice(0,_),d=r.localName=i.slice(_+1)):(f=null,d=r.localName=i);var C=r.uri=e[f||""];if(t.startElement(C,d,i,r),r.closed){if(t.endElement(C,d,i),a)for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&t.endPrefixMapping(f)}else return r.currentNSMap=e,r.localNSMap=a,!0}function zg(r,t,e,i,a){if(/^(?:script|textarea)$/i.test(e)){var o=r.indexOf("</"+e+">",t),l=r.substring(t+1,o);if(/[&<]/.test(l))return/^script$/i.test(e)?(a.characters(l,0,l.length),o):(l=l.replace(/&#?\w+;/g,i),a.characters(l,0,l.length),o)}return t+1}function $g(r,t,e,i){var a=i[e];return a==null&&(a=r.lastIndexOf("</"+e+">"),a<t&&(a=r.lastIndexOf("</"+e)),i[e]=a),a<t}function xc(r,t){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}function Gg(r,t,e,i){var a=r.charAt(t+2);switch(a){case"-":if(r.charAt(t+3)==="-"){var o=r.indexOf("-->",t+4);return o>t?(e.comment(r,t+4,o-t-4),o+3):(i.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(t+3,6)=="CDATA["){var o=r.indexOf("]]>",t+9);return e.startCDATA(),e.characters(r,t+9,o-t-9),e.endCDATA(),o+3}var l=Xg(r,t),c=l.length;if(c>1&&/!doctype/i.test(l[0][0])){var f=l[1][0],d=!1,g=!1;c>3&&(/^public$/i.test(l[2][0])?(d=l[3][0],g=c>4&&l[4][0]):/^system$/i.test(l[2][0])&&(g=l[3][0]));var E=l[c-1];return e.startDTD(f,d,g),e.endDTD(),E.index+E[0].length}}return-1}function Yg(r,t,e){var i=r.indexOf("?>",t);if(i){var a=r.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return a?(a[0].length,e.processingInstruction(a[1],a[2]),i+2):-1}return-1}function Ec(){this.attributeNames={}}Ec.prototype={setTagName:function(r){if(!gc.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,t,e){if(!gc.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:t,offset:e}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function Xg(r,t){var e,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(r);e=a.exec(r);)if(i.push(e),e[1])return i}Su.XMLReader=yc,Su.ParseError=rs;var Zg=di,Qg=Vi,Ac=pc,wc=Su,Kg=Qg.DOMImplementation,bc=Zg.NAMESPACE,jg=wc.ParseError,Jg=wc.XMLReader;function Tc(r){return r.replace(/\r[\n\u0085]/g,`
|
|
3
3
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
4
4
|
`)}function _c(r){this.options=r||{locator:{}}}_c.prototype.parseFromString=function(r,t){var e=this.options,i=new Jg,a=e.domBuilder||new Xs,o=e.errorHandler,l=e.locator,c=e.xmlns||{},f=/\/x?html?$/.test(t),d=f?Ac.HTML_ENTITIES:Ac.XML_ENTITIES;l&&a.setDocumentLocator(l),i.errorHandler=t0(o,a,l),i.domBuilder=e.domBuilder||a,f&&(c[""]=bc.HTML),c.xml=c.xml||bc.XML;var g=e.normalizeLineEndings||Tc;return r&&typeof r=="string"?i.parse(g(r),c,d):i.errorHandler.error("invalid doc source"),a.doc};function t0(r,t,e){if(!r){if(t instanceof Xs)return t;r=t}var i={},a=r instanceof Function;e=e||{};function o(l){var c=r[l];!c&&a&&(c=r.length==2?function(f){r(l,f)}:r),i[l]=c&&function(f){c("[xmldom "+l+"] "+f+Lu(e))}||function(){}}return o("warning"),o("error"),o("fatalError"),i}function Xs(){this.cdata=!1}function is(r,t){t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber}Xs.prototype={startDocument:function(){this.doc=new Kg().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,t,e,i){var a=this.doc,o=a.createElementNS(r,e||t),l=i.length;Ka(this,o),this.currentElement=o,this.locator&&is(this.locator,o);for(var c=0;c<l;c++){var r=i.getURI(c),f=i.getValue(c),e=i.getQName(c),d=a.createAttributeNS(r,e);this.locator&&is(i.getLocator(c),d),d.value=d.nodeValue=f,o.setAttributeNode(d)}},endElement:function(r,t,e){var i=this.currentElement;i.tagName,this.currentElement=i.parentNode},startPrefixMapping:function(r,t){},endPrefixMapping:function(r){},processingInstruction:function(r,t){var e=this.doc.createProcessingInstruction(r,t);this.locator&&is(this.locator,e),Ka(this,e)},ignorableWhitespace:function(r,t,e){},characters:function(r,t,e){if(r=Cc.apply(this,arguments),r){if(this.cdata)var i=this.doc.createCDATASection(r);else var i=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(r)&&this.doc.appendChild(i),this.locator&&is(this.locator,i)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0)},comment:function(r,t,e){r=Cc.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&is(this.locator,i),Ka(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,t,e){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(r,t,e);this.locator&&is(this.locator,a),Ka(this,a),this.doc.doctype=a}},warning:function(r){console.warn("[xmldom warning] "+r,Lu(this.locator))},error:function(r){console.error("[xmldom error] "+r,Lu(this.locator))},fatalError:function(r){throw new jg(r,this.locator)}};function Lu(r){if(r)return`
|
|
5
|
-
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function Cc(r,t,e){return typeof r=="string"?r.substr(t,e):r.length>=t+e||t?new java.lang.String(r,t,e)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Xs.prototype[r]=function(){return null}});function Ka(r,t){r.currentElement?r.currentElement.appendChild(t):r.doc.appendChild(t)}Za.__DOMHandler=Xs,Za.normalizeLineEndings=Tc,Za.DOMParser=_c;var e0=Za.DOMParser;const r0="1.0.68";function i0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const ns=typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{document:void 0,tinyEngine:void 0};ns.Path2D||bg(ns),ns.DOMParser||(ns.DOMParser=e0);const kt={window:ns,version:r0,isBrowser:i0(),dpr:typeof window<"u"&&window.devicePixelRatio||1,document:ns.document,time:0,deltaTime:0,config:Zn},Zs=(r,t,e)=>Math.max(t,Math.min(e,r)),Dc=(r,t=1e-6)=>Math.abs(r)<t?0:r<0?-1:1,n0=r=>r*(Math.PI/180),s0=(r,t)=>(r%t+t)%t,Nu=(r,t,e)=>(1-e)*r+e*t,a0=r=>{let t=r*(180/Math.PI);return t<0&&(t+=360),t>360&&(t-=360),t},$t={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},o0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ir={h:0,s:0,l:0},ja={h:0,s:0,l:0};function Mu(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}const u0=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Wt{isColor=!0;r=1;g=1;b=1;a=1;constructor(t,e,i,a){return e===void 0&&i===void 0?this.set(t):this.setRGBA(t,e,i,a)}static isColor(t){return typeof t=="string"?u0.test(t):typeof t=="number"?t>=0&&t<=16777215:!1}static getRandomStyle(){return vi.random().getStyle()}static getDarken(t,e=.8){return vi.set(t).getHSL(Ja),vi.setHSL(Ja.h,Ja.s,Ja.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return vi.set(t),vi.getContrastString()}static getArray(t){return vi.set(t).toArray()}static getComplementary(t){return vi.set(t),vi.getComplementaryString()}static getMoreTransparent(t,e){return vi.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,a=1){return this.r=t,this.g=e,this.b=i,this.a=a,this}setHSL(t,e,i,a=1){if(t=s0(t,1),e=Zs(e,0,1),i=Zs(i,0,1),e===0)this.r=this.g=this.b=i;else{const o=i<=.5?i*(1+e):i+e-i*e,l=2*i-o;this.r=Mu(l,o,t+1/3),this.g=Mu(l,o,t),this.b=Mu(l,o,t-1/3)}return this.a=a,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let i;const a=e[1],o=e[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const l=parseFloat(i[1])/360,c=parseInt(i[2],10)/100,f=parseInt(i[3],10)/100,d=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0);return this.setHSL(l,c,f,d)}break}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=e[1],a=i.length;if(a===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this.a=1,this;if(a===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=o0[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("Color: Unknown color "+t),this}clone(){return new Wt(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Wt){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Wt){const e=this.a,i=e*this.r+(1-e)*t.r,a=e*this.g+(1-e)*t.g,o=e*this.b+(1-e)*t.b;return new Wt(i,a,o)}getHex(){return Zs(this.r*255,0,255)<<16^Zs(this.g*255,0,255)<<8^Zs(this.b*255,0,255)<<0}getHSL(t){const e=this.r,i=this.g,a=this.b,o=Math.max(e,i,a),l=Math.min(e,i,a);let c=0,f;const d=(l+o)/2;if(l===o)c=0,f=0;else{const g=o-l;switch(f=d<=.5?g/(o+l):g/(2-o-l),o){case e:c=(i-a)/g+(i<a?6:0);break;case i:c=(a-e)/g+2;break;case a:c=(e-i)/g+4;break}c/=6}return t.h=c,t.s=f,t.l=d,t}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return t+=(255-t)*(255-this.a*255)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Wt){const e=this.toArray(),i=[0,0,0,1];for(let a=0;a<e.length;a++)if(a<3)i[a]=1-e[a];else if(a===3)e[a]>1||e[a]<=0?i[a]=1:i[a]=Math.max(Math.min(parseFloat(e[a].toFixed(2)),1),0);else continue;return t.setRGBA(i[0],i[1],i[2],parseFloat(i[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(typeof t>"u"||t>=1)return this.getHexString();const e=this.getRGBByBg(),i=e.r*t+(1-t),a=e.g*t+(1-t),o=e.b*t+(1-t);return new Wt(i,a,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(Ir),Ir.h+=t,Ir.s+=e,Ir.l+=i,this.setHSL(Ir.h,Ir.s,Ir.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Ir),t.getHSL(ja);const i=Nu(Ir.h,ja.h,e),a=Nu(Ir.s,ja.s,e),o=Nu(Ir.l,ja.l,e);return this.setHSL(i,a,o),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const vi=new Wt,Ja={h:0,s:0,l:0};class P{isVector2=!0;x=0;y=0;z;constructor(t=0,e=0,i){this.x=t,this.y=e,this.z=i||0}static isZero(t){return t.x===0&&t.y===0}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Number.EPSILON&&Math.abs(t.y-e.y)<Number.EPSILON}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),a=new Int32Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),a=new Float64Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getVectors(t){const e=[];for(let i=0,a=t.length;i<a;i++)e.push(new P(t[i].x,t[i].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let i=0,a=t.length;i<a;i++)e.push(P.getString(t[i]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return new P().subVectors(t,e)}static isPointOnSegment(t,e,i){return Dc(this.sub(t,i).cross(this.sub(e,i)))===0&&Dc(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):a0(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),a=0;for(let o=0,l=i.length;o<l;o++){let c=Math.max(0,o-1);o>0?a+=this.getDistance(i[c],i[c+1]):a=0,i[o].l=Math.round(a);let f=this.angle(i[c+1],i[c]);i[o].a=Math.round(f*100)/100}return i}static getClothoidPoints(t,e=100){let i=[],a=t.concat([]);if(!a||a.length<2)return i;a.length===2?(a.push(a[1]),a.unshift(a[0])):a.length===3&&a.splice(2,0,a[1]);for(let o=0;o<a.length-3;o+=3){let l=new P(a[o].x,a[o].y),c=new P(a[o+1].x,a[o+1].y),f=new P(a[o+2].x,a[o+2].y),d=new P(a[o+3].x,a[o+3].y),g=0;g+=l.distanceTo(c),g+=c.distanceTo(f),g+=f.distanceTo(d);let E=Math.min(.5,1/(g/e));for(let _=E;_<1;_+=E){let C=3*(c.x-l.x),R=3*(f.x-c.x)-C,L=d.x-l.x-C-R,N=3*(c.y-l.y),I=3*(f.y-c.y)-N,W=d.y-l.y-N-I,G=L*Math.pow(_,3)+R*Math.pow(_,2)+C*_+l.x,b=W*Math.pow(_,3)+I*Math.pow(_,2)+N*_+l.y;i.push({x:Math.round(G),y:Math.round(b),a:0,l:0})}}return i.unshift({x:a[0].x,y:a[0].y,a:0,l:0}),i.push({x:a[a.length-1].x,y:a[a.length-1].y,a:0,l:0}),i}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let a=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[a],t[a+1]))}return e}static getCircleCenterByChord(t,e,i,a=!0,o=new P){const l=this.getDistance(t,e);if(l===0)return o.x=1/0,o.y=1/0,o;Bu.set((t.x+e.x)/2,(t.y+e.y)/2);const c=Math.sqrt(i*i-l*l/4),f=a?-1:1;return o.x=Bu.x+f*c*(e.y-t.y)/l,o.y=Bu.y-f*c*(e.x-t.x)/l,o}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const a=e.length;for(let o=0,l=a-1;o<a;l=o++){const c=e[o],f=e[l];if(Math.min(c.x,f.x)<=t.x&&t.x<=Math.max(c.x,f.x)&&Math.min(c.y,f.y)<=t.y&&t.y<=Math.max(c.y,f.y)){const d=(f.x-c.x)*(t.y-c.y)-(f.y-c.y)*(t.x-c.x);if(Math.abs(d)<1e-12)return!0}c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(i=!i)}return i}static isPointInPolygonByRay(t,e){let i=0;const a=new P().copy(t),o=new P,l=new P;for(let c=0;c<e.length;c++){c===e.length-1?(o.copy(e[c]),l.copy(e[0])):(o.copy(e[c]),l.copy(e[c+1]));let f=[o.y,l.y].sort((d,g)=>d-g);f[0]<a.y&&f[1]>a.y&&(o.x<a.x||l.x<a.x)&&i++}return i%2===1}static getIntersectionOfSegments(t,e,i,a,o=!1,l=new P){const c=(a.y-i.y)*(e.x-t.x)-(a.x-i.x)*(e.y-t.y);if(c===0)return l.makeEmpty();const f=(a.x-i.x)*(t.y-i.y)-(a.y-i.y)*(t.x-i.x),d=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),g=f/c,E=d/c;return o&&(g<0||g>1||E<0||E>1)?l.makeEmpty():(l.x=t.x+g*(e.x-t.x),l.y=t.y+g*(e.y-t.y),l)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const a=t.length;let o=0;for(let f=0;f<a;f++)t[f].x<t[o].x&&(o=f);let l=o,c;do{i.push(t[l]),c=(l+1)%a;for(let f=0;f<a;f++)this.whichSideOfSegment(t[l],t[f],t[c])>0&&(c=f);l=c}while(l!==o);return e&&i.push(t[o]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let a=0,o=t.length;a<o;a++)i.push({x:e.elements[0]*t[a].x+e.elements[3]*t[a].y+e.elements[6],y:e.elements[1]*t[a].x+e.elements[4]*t[a].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,a=e.length;i<a;i++){const o=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],l=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=o,e[i].y=l}return e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,a=t.elements;return this.x=a[0]*e+a[3]*i+a[6],this.y=a[1]*e+a[4]*i+a[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new P(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Number.EPSILON&&Math.abs(t.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),a=this.x,o=this.y;return this.x=a*e-o*i,this.y=a*i+o*e,this}rotateAround(t,e){const i=Math.cos(e),a=Math.sin(e),o=this.x-t.x,l=this.y-t.y;return this.x=o*i-l*a+t.x,this.y=o*a+l*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e){return this.x=t,this.y=e,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*3)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Bu=new P,l0=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"}));var to={exports:{}};/**
|
|
5
|
+
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function Cc(r,t,e){return typeof r=="string"?r.substr(t,e):r.length>=t+e||t?new java.lang.String(r,t,e)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Xs.prototype[r]=function(){return null}});function Ka(r,t){r.currentElement?r.currentElement.appendChild(t):r.doc.appendChild(t)}Za.__DOMHandler=Xs,Za.normalizeLineEndings=Tc,Za.DOMParser=_c;var e0=Za.DOMParser;const r0="1.0.69";function i0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const ns=typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{document:void 0,tinyEngine:void 0};ns.Path2D||bg(ns),ns.DOMParser||(ns.DOMParser=e0);const kt={window:ns,version:r0,isBrowser:i0(),dpr:typeof window<"u"&&window.devicePixelRatio||1,document:ns.document,time:0,deltaTime:0,config:Zn},Zs=(r,t,e)=>Math.max(t,Math.min(e,r)),Dc=(r,t=1e-6)=>Math.abs(r)<t?0:r<0?-1:1,n0=r=>r*(Math.PI/180),s0=(r,t)=>(r%t+t)%t,Nu=(r,t,e)=>(1-e)*r+e*t,a0=r=>{let t=r*(180/Math.PI);return t<0&&(t+=360),t>360&&(t-=360),t},$t={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},o0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ir={h:0,s:0,l:0},ja={h:0,s:0,l:0};function Mu(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}const u0=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Wt{isColor=!0;r=1;g=1;b=1;a=1;constructor(t,e,i,a){return e===void 0&&i===void 0?this.set(t):this.setRGBA(t,e,i,a)}static isColor(t){return typeof t=="string"?u0.test(t):typeof t=="number"?t>=0&&t<=16777215:!1}static getRandomStyle(){return vi.random().getStyle()}static getDarken(t,e=.8){return vi.set(t).getHSL(Ja),vi.setHSL(Ja.h,Ja.s,Ja.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return vi.set(t),vi.getContrastString()}static getArray(t){return vi.set(t).toArray()}static getComplementary(t){return vi.set(t),vi.getComplementaryString()}static getMoreTransparent(t,e){return vi.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,a=1){return this.r=t,this.g=e,this.b=i,this.a=a,this}setHSL(t,e,i,a=1){if(t=s0(t,1),e=Zs(e,0,1),i=Zs(i,0,1),e===0)this.r=this.g=this.b=i;else{const o=i<=.5?i*(1+e):i+e-i*e,l=2*i-o;this.r=Mu(l,o,t+1/3),this.g=Mu(l,o,t),this.b=Mu(l,o,t-1/3)}return this.a=a,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let i;const a=e[1],o=e[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const l=parseFloat(i[1])/360,c=parseInt(i[2],10)/100,f=parseInt(i[3],10)/100,d=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0);return this.setHSL(l,c,f,d)}break}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=e[1],a=i.length;if(a===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this.a=1,this;if(a===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=o0[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("Color: Unknown color "+t),this}clone(){return new Wt(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Wt){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Wt){const e=this.a,i=e*this.r+(1-e)*t.r,a=e*this.g+(1-e)*t.g,o=e*this.b+(1-e)*t.b;return new Wt(i,a,o)}getHex(){return Zs(this.r*255,0,255)<<16^Zs(this.g*255,0,255)<<8^Zs(this.b*255,0,255)<<0}getHSL(t){const e=this.r,i=this.g,a=this.b,o=Math.max(e,i,a),l=Math.min(e,i,a);let c=0,f;const d=(l+o)/2;if(l===o)c=0,f=0;else{const g=o-l;switch(f=d<=.5?g/(o+l):g/(2-o-l),o){case e:c=(i-a)/g+(i<a?6:0);break;case i:c=(a-e)/g+2;break;case a:c=(e-i)/g+4;break}c/=6}return t.h=c,t.s=f,t.l=d,t}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return t+=(255-t)*(255-this.a*255)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Wt){const e=this.toArray(),i=[0,0,0,1];for(let a=0;a<e.length;a++)if(a<3)i[a]=1-e[a];else if(a===3)e[a]>1||e[a]<=0?i[a]=1:i[a]=Math.max(Math.min(parseFloat(e[a].toFixed(2)),1),0);else continue;return t.setRGBA(i[0],i[1],i[2],parseFloat(i[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(typeof t>"u"||t>=1)return this.getHexString();const e=this.getRGBByBg(),i=e.r*t+(1-t),a=e.g*t+(1-t),o=e.b*t+(1-t);return new Wt(i,a,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(Ir),Ir.h+=t,Ir.s+=e,Ir.l+=i,this.setHSL(Ir.h,Ir.s,Ir.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Ir),t.getHSL(ja);const i=Nu(Ir.h,ja.h,e),a=Nu(Ir.s,ja.s,e),o=Nu(Ir.l,ja.l,e);return this.setHSL(i,a,o),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const vi=new Wt,Ja={h:0,s:0,l:0};class P{isVector2=!0;x=0;y=0;z;constructor(t=0,e=0,i){this.x=t,this.y=e,this.z=i||0}static isZero(t){return t.x===0&&t.y===0}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Number.EPSILON&&Math.abs(t.y-e.y)<Number.EPSILON}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),a=new Int32Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),a=new Float64Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getVectors(t){const e=[];for(let i=0,a=t.length;i<a;i++)e.push(new P(t[i].x,t[i].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let i=0,a=t.length;i<a;i++)e.push(P.getString(t[i]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return new P().subVectors(t,e)}static isPointOnSegment(t,e,i){return Dc(this.sub(t,i).cross(this.sub(e,i)))===0&&Dc(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):a0(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),a=0;for(let o=0,l=i.length;o<l;o++){let c=Math.max(0,o-1);o>0?a+=this.getDistance(i[c],i[c+1]):a=0,i[o].l=Math.round(a);let f=this.angle(i[c+1],i[c]);i[o].a=Math.round(f*100)/100}return i}static getClothoidPoints(t,e=100){let i=[],a=t.concat([]);if(!a||a.length<2)return i;a.length===2?(a.push(a[1]),a.unshift(a[0])):a.length===3&&a.splice(2,0,a[1]);for(let o=0;o<a.length-3;o+=3){let l=new P(a[o].x,a[o].y),c=new P(a[o+1].x,a[o+1].y),f=new P(a[o+2].x,a[o+2].y),d=new P(a[o+3].x,a[o+3].y),g=0;g+=l.distanceTo(c),g+=c.distanceTo(f),g+=f.distanceTo(d);let E=Math.min(.5,1/(g/e));for(let _=E;_<1;_+=E){let C=3*(c.x-l.x),R=3*(f.x-c.x)-C,L=d.x-l.x-C-R,N=3*(c.y-l.y),I=3*(f.y-c.y)-N,W=d.y-l.y-N-I,G=L*Math.pow(_,3)+R*Math.pow(_,2)+C*_+l.x,b=W*Math.pow(_,3)+I*Math.pow(_,2)+N*_+l.y;i.push({x:Math.round(G),y:Math.round(b),a:0,l:0})}}return i.unshift({x:a[0].x,y:a[0].y,a:0,l:0}),i.push({x:a[a.length-1].x,y:a[a.length-1].y,a:0,l:0}),i}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let a=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[a],t[a+1]))}return e}static getCircleCenterByChord(t,e,i,a=!0,o=new P){const l=this.getDistance(t,e);if(l===0)return o.x=1/0,o.y=1/0,o;Bu.set((t.x+e.x)/2,(t.y+e.y)/2);const c=Math.sqrt(i*i-l*l/4),f=a?-1:1;return o.x=Bu.x+f*c*(e.y-t.y)/l,o.y=Bu.y-f*c*(e.x-t.x)/l,o}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const a=e.length;for(let o=0,l=a-1;o<a;l=o++){const c=e[o],f=e[l];if(Math.min(c.x,f.x)<=t.x&&t.x<=Math.max(c.x,f.x)&&Math.min(c.y,f.y)<=t.y&&t.y<=Math.max(c.y,f.y)){const d=(f.x-c.x)*(t.y-c.y)-(f.y-c.y)*(t.x-c.x);if(Math.abs(d)<1e-12)return!0}c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(i=!i)}return i}static isPointInPolygonByRay(t,e){let i=0;const a=new P().copy(t),o=new P,l=new P;for(let c=0;c<e.length;c++){c===e.length-1?(o.copy(e[c]),l.copy(e[0])):(o.copy(e[c]),l.copy(e[c+1]));let f=[o.y,l.y].sort((d,g)=>d-g);f[0]<a.y&&f[1]>a.y&&(o.x<a.x||l.x<a.x)&&i++}return i%2===1}static getIntersectionOfSegments(t,e,i,a,o=!1,l=new P){const c=(a.y-i.y)*(e.x-t.x)-(a.x-i.x)*(e.y-t.y);if(c===0)return l.makeEmpty();const f=(a.x-i.x)*(t.y-i.y)-(a.y-i.y)*(t.x-i.x),d=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),g=f/c,E=d/c;return o&&(g<0||g>1||E<0||E>1)?l.makeEmpty():(l.x=t.x+g*(e.x-t.x),l.y=t.y+g*(e.y-t.y),l)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const a=t.length;let o=0;for(let f=0;f<a;f++)t[f].x<t[o].x&&(o=f);let l=o,c;do{i.push(t[l]),c=(l+1)%a;for(let f=0;f<a;f++)this.whichSideOfSegment(t[l],t[f],t[c])>0&&(c=f);l=c}while(l!==o);return e&&i.push(t[o]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let a=0,o=t.length;a<o;a++)i.push({x:e.elements[0]*t[a].x+e.elements[3]*t[a].y+e.elements[6],y:e.elements[1]*t[a].x+e.elements[4]*t[a].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,a=e.length;i<a;i++){const o=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],l=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=o,e[i].y=l}return e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,a=t.elements;return this.x=a[0]*e+a[3]*i+a[6],this.y=a[1]*e+a[4]*i+a[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new P(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Number.EPSILON&&Math.abs(t.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),a=this.x,o=this.y;return this.x=a*e-o*i,this.y=a*i+o*e,this}rotateAround(t,e){const i=Math.cos(e),a=Math.sin(e),o=this.x-t.x,l=this.y-t.y;return this.x=o*i-l*a+t.x,this.y=o*a+l*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e){return this.x=t,this.y=e,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*3)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Bu=new P,l0=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"}));var to={exports:{}};/**
|
|
6
6
|
* @license
|
|
7
7
|
* Lodash <https://lodash.com/>
|
|
8
8
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -80,7 +80,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
80
80
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
81
81
|
* Licensed under the MIT license */(function(r){(function(t,e,i,a){var o=["","webkit","Moz","MS","ms","o"],l=e.createElement("div"),c="function",f=Math.round,d=Math.abs,g=Date.now;function E(y,x,w){return setTimeout(G(y,w),x)}function _(y,x,w){return Array.isArray(y)?(C(y,w[x],w),!0):!1}function C(y,x,w){var M;if(y)if(y.forEach)y.forEach(x,w);else if(y.length!==a)for(M=0;M<y.length;)x.call(w,y[M],M,y),M++;else for(M in y)y.hasOwnProperty(M)&&x.call(w,y[M],M,y)}function R(y,x,w){var M="DEPRECATED METHOD: "+x+`
|
|
82
82
|
`+w+` AT
|
|
83
|
-
`;return function(){var Y=new Error("get-stack-trace"),j=Y&&Y.stack?Y.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Et=t.console&&(t.console.warn||t.console.log);return Et&&Et.call(t.console,M,j),y.apply(this,arguments)}}var L;typeof Object.assign!="function"?L=function(x){if(x===a||x===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(x),M=1;M<arguments.length;M++){var Y=arguments[M];if(Y!==a&&Y!==null)for(var j in Y)Y.hasOwnProperty(j)&&(w[j]=Y[j])}return w}:L=Object.assign;var N=R(function(x,w,M){for(var Y=Object.keys(w),j=0;j<Y.length;)(!M||M&&x[Y[j]]===a)&&(x[Y[j]]=w[Y[j]]),j++;return x},"extend","Use `assign`."),I=R(function(x,w){return N(x,w,!0)},"merge","Use `assign`.");function W(y,x,w){var M=x.prototype,Y;Y=y.prototype=Object.create(M),Y.constructor=y,Y._super=M,w&&L(Y,w)}function G(y,x){return function(){return y.apply(x,arguments)}}function b(y,x){return typeof y==c?y.apply(x&&x[0]||a,x):y}function F(y,x){return y===a?x:y}function q(y,x,w){C(rt(x),function(M){y.addEventListener(M,w,!1)})}function K(y,x,w){C(rt(x),function(M){y.removeEventListener(M,w,!1)})}function tt(y,x){for(;y;){if(y==x)return!0;y=y.parentNode}return!1}function Z(y,x){return y.indexOf(x)>-1}function rt(y){return y.trim().split(/\s+/g)}function J(y,x,w){if(y.indexOf&&!w)return y.indexOf(x);for(var M=0;M<y.length;){if(w&&y[M][w]==x||!w&&y[M]===x)return M;M++}return-1}function st(y){return Array.prototype.slice.call(y,0)}function ct(y,x,w){for(var M=[],Y=[],j=0;j<y.length;){var Et=y[j][x];J(Y,Et)<0&&M.push(y[j]),Y[j]=Et,j++}return M=M.sort(function(ce,Ee){return ce[x]>Ee[x]}),M}function ft(y,x){for(var w,M,Y=x[0].toUpperCase()+x.slice(1),j=0;j<o.length;){if(w=o[j],M=w?w+Y:x,M in y)return M;j++}return a}var pt=1;function O(){return pt++}function vt(y){var x=y.ownerDocument||y;return x.defaultView||x.parentWindow||t}var Bt=/mobile|tablet|ip(ad|hone|od)|android/i,Re="ontouchstart"in t,be=ft(t,"PointerEvent")!==a,ue=Re&&Bt.test(navigator.userAgent),ve="touch",Vr="pen",Pe="mouse",le="kinect",Oe=25,Gt=1,Zt=2,Ot=4,Vt=8,Le=1,Fe=2,Ze=4,Jt=8,Ne=16,xe=Fe|Ze,Qt=Jt|Ne,oi=xe|Qt,Si=["x","y"],he=["clientX","clientY"];function Lt(y,x){var w=this;this.manager=y,this.callback=x,this.element=y.element,this.target=y.options.inputTarget,this.domHandler=function(M){b(y.options.enable,[y])&&w.handler(M)},this.init()}Lt.prototype={handler:function(){},init:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(vt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(vt(this.element),this.evWin,this.domHandler)}};function or(y){var x,w=y.options.inputClass;return w?x=w:be?x=lr:ue?x=ln:Re?x=wa:x=xt,new x(y,Qe)}function Qe(y,x,w){var M=w.pointers.length,Y=w.changedPointers.length,j=x&Gt&&M-Y===0,Et=x&(Ot|Vt)&&M-Y===0;w.isFirst=!!j,w.isFinal=!!Et,j&&(y.session={}),w.eventType=x,Oi(y,w),y.emit("hammer.input",w),y.recognize(w),y.session.prevInput=w}function Oi(y,x){var w=y.session,M=x.pointers,Y=M.length;w.firstInput||(w.firstInput=ur(x)),Y>1&&!w.firstMultiple?w.firstMultiple=ur(x):Y===1&&(w.firstMultiple=!1);var j=w.firstInput,Et=w.firstMultiple,re=Et?Et.center:j.center,ce=x.center=Ke(M);x.timeStamp=g(),x.deltaTime=x.timeStamp-j.timeStamp,x.angle=Li(re,ce),x.distance=ui(re,ce),Ar(w,x),x.offsetDirection=sn(x.deltaX,x.deltaY);var Ee=nn(x.deltaTime,x.deltaX,x.deltaY);x.overallVelocityX=Ee.x,x.overallVelocityY=Ee.y,x.overallVelocity=d(Ee.x)>d(Ee.y)?Ee.x:Ee.y,x.scale=Et?k(Et.pointers,M):1,x.rotation=Et?Mn(Et.pointers,M):0,x.maxPointers=w.prevInput?x.pointers.length>w.prevInput.maxPointers?x.pointers.length:w.prevInput.maxPointers:x.pointers.length,rn(w,x);var Tr=y.element;tt(x.srcEvent.target,Tr)&&(Tr=x.srcEvent.target),x.target=Tr}function Ar(y,x){var w=x.center,M=y.offsetDelta||{},Y=y.prevDelta||{},j=y.prevInput||{};(x.eventType===Gt||j.eventType===Ot)&&(Y=y.prevDelta={x:j.deltaX||0,y:j.deltaY||0},M=y.offsetDelta={x:w.x,y:w.y}),x.deltaX=Y.x+(w.x-M.x),x.deltaY=Y.y+(w.y-M.y)}function rn(y,x){var w=y.lastInterval||x,M=x.timeStamp-w.timeStamp,Y,j,Et,re;if(x.eventType!=Vt&&(M>Oe||w.velocity===a)){var ce=x.deltaX-w.deltaX,Ee=x.deltaY-w.deltaY,Tr=nn(M,ce,Ee);j=Tr.x,Et=Tr.y,Y=d(Tr.x)>d(Tr.y)?Tr.x:Tr.y,re=sn(ce,Ee),y.lastInterval=x}else Y=w.velocity,j=w.velocityX,Et=w.velocityY,re=w.direction;x.velocity=Y,x.velocityX=j,x.velocityY=Et,x.direction=re}function ur(y){for(var x=[],w=0;w<y.pointers.length;)x[w]={clientX:f(y.pointers[w].clientX),clientY:f(y.pointers[w].clientY)},w++;return{timeStamp:g(),pointers:x,center:Ke(x),deltaX:y.deltaX,deltaY:y.deltaY}}function Ke(y){var x=y.length;if(x===1)return{x:f(y[0].clientX),y:f(y[0].clientY)};for(var w=0,M=0,Y=0;Y<x;)w+=y[Y].clientX,M+=y[Y].clientY,Y++;return{x:f(w/x),y:f(M/x)}}function nn(y,x,w){return{x:x/y||0,y:w/y||0}}function sn(y,x){return y===x?Le:d(y)>=d(x)?y<0?Fe:Ze:x<0?Jt:Ne}function ui(y,x,w){w||(w=Si);var M=x[w[0]]-y[w[0]],Y=x[w[1]]-y[w[1]];return Math.sqrt(M*M+Y*Y)}function Li(y,x,w){w||(w=Si);var M=x[w[0]]-y[w[0]],Y=x[w[1]]-y[w[1]];return Math.atan2(Y,M)*180/Math.PI}function Mn(y,x){return Li(x[1],x[0],he)+Li(y[1],y[0],he)}function k(y,x){return ui(x[0],x[1],he)/ui(y[0],y[1],he)}var it={mousedown:Gt,mousemove:Zt,mouseup:Ot},at="mousedown",Ct="mousemove mouseup";function xt(){this.evEl=at,this.evWin=Ct,this.pressed=!1,Lt.apply(this,arguments)}W(xt,Lt,{handler:function(x){var w=it[x.type];w&Gt&&x.button===0&&(this.pressed=!0),w&Zt&&x.which!==1&&(w=Ot),this.pressed&&(w&Ot&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[x],changedPointers:[x],pointerType:Pe,srcEvent:x}))}});var pe={pointerdown:Gt,pointermove:Zt,pointerup:Ot,pointercancel:Vt,pointerout:Vt},Me={2:ve,3:Vr,4:Pe,5:le},wr="pointerdown",an="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(wr="MSPointerDown",an="MSPointerMove MSPointerUp MSPointerCancel");function lr(){this.evEl=wr,this.evWin=an,Lt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}W(lr,Lt,{handler:function(x){var w=this.store,M=!1,Y=x.type.toLowerCase().replace("ms",""),j=pe[Y],Et=Me[x.pointerType]||x.pointerType,re=Et==ve,ce=J(w,x.pointerId,"pointerId");j&Gt&&(x.button===0||re)?ce<0&&(w.push(x),ce=w.length-1):j&(Ot|Vt)&&(M=!0),!(ce<0)&&(w[ce]=x,this.callback(this.manager,j,{pointers:w,changedPointers:[x],pointerType:Et,srcEvent:x}),M&&w.splice(ce,1))}});var Bn={touchstart:Gt,touchmove:Zt,touchend:Ot,touchcancel:Vt},on="touchstart",li="touchstart touchmove touchend touchcancel";function In(){this.evTarget=on,this.evWin=li,this.started=!1,Lt.apply(this,arguments)}W(In,Lt,{handler:function(x){var w=Bn[x.type];if(w===Gt&&(this.started=!0),!!this.started){var M=Rn.call(this,x,w);w&(Ot|Vt)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:M[0],changedPointers:M[1],pointerType:ve,srcEvent:x})}}});function Rn(y,x){var w=st(y.touches),M=st(y.changedTouches);return x&(Ot|Vt)&&(w=ct(w.concat(M),"identifier")),[w,M]}var un={touchstart:Gt,touchmove:Zt,touchend:Ot,touchcancel:Vt},Al="touchstart touchmove touchend touchcancel";function ln(){this.evTarget=Al,this.targetIds={},Lt.apply(this,arguments)}W(ln,Lt,{handler:function(x){var w=un[x.type],M=wl.call(this,x,w);M&&this.callback(this.manager,w,{pointers:M[0],changedPointers:M[1],pointerType:ve,srcEvent:x})}});function wl(y,x){var w=st(y.touches),M=this.targetIds;if(x&(Gt|Zt)&&w.length===1)return M[w[0].identifier]=!0,[w,w];var Y,j,Et=st(y.changedTouches),re=[],ce=this.target;if(j=w.filter(function(Ee){return tt(Ee.target,ce)}),x===Gt)for(Y=0;Y<j.length;)M[j[Y].identifier]=!0,Y++;for(Y=0;Y<Et.length;)M[Et[Y].identifier]&&re.push(Et[Y]),x&(Ot|Vt)&&delete M[Et[Y].identifier],Y++;if(re.length)return[ct(j.concat(re),"identifier"),re]}var Aa=2500,wo=25;function wa(){Lt.apply(this,arguments);var y=G(this.handler,this);this.touch=new ln(this.manager,y),this.mouse=new xt(this.manager,y),this.primaryTouch=null,this.lastTouches=[]}W(wa,Lt,{handler:function(x,w,M){var Y=M.pointerType==ve,j=M.pointerType==Pe;if(!(j&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(Y)bl.call(this,w,M);else if(j&&Tl.call(this,M))return;this.callback(x,w,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function bl(y,x){y&Gt?(this.primaryTouch=x.changedPointers[0].identifier,bo.call(this,x)):y&(Ot|Vt)&&bo.call(this,x)}function bo(y){var x=y.changedPointers[0];if(x.identifier===this.primaryTouch){var w={x:x.clientX,y:x.clientY};this.lastTouches.push(w);var M=this.lastTouches,Y=function(){var j=M.indexOf(w);j>-1&&M.splice(j,1)};setTimeout(Y,Aa)}}function Tl(y){for(var x=y.srcEvent.clientX,w=y.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var Y=this.lastTouches[M],j=Math.abs(x-Y.x),Et=Math.abs(w-Y.y);if(j<=wo&&Et<=wo)return!0}return!1}var To=ft(l.style,"touchAction"),_o=To!==a,Co="compute",ba="auto",Ta="manipulation",Ni="none",Pn="pan-x",Fn="pan-y",ms=_l();function _a(y,x){this.manager=y,this.set(x)}_a.prototype={set:function(y){y==Co&&(y=this.compute()),_o&&this.manager.element.style&&ms[y]&&(this.manager.element.style[To]=y),this.actions=y.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var y=[];return C(this.manager.recognizers,function(x){b(x.options.enable,[x])&&(y=y.concat(x.getTouchAction()))}),vs(y.join(" "))},preventDefaults:function(y){var x=y.srcEvent,w=y.offsetDirection;if(this.manager.session.prevented){x.preventDefault();return}var M=this.actions,Y=Z(M,Ni)&&!ms[Ni],j=Z(M,Fn)&&!ms[Fn],Et=Z(M,Pn)&&!ms[Pn];if(Y){var re=y.pointers.length===1,ce=y.distance<2,Ee=y.deltaTime<250;if(re&&ce&&Ee)return}if(!(Et&&j)&&(Y||j&&w&xe||Et&&w&Qt))return this.preventSrc(x)},preventSrc:function(y){this.manager.session.prevented=!0,y.preventDefault()}};function vs(y){if(Z(y,Ni))return Ni;var x=Z(y,Pn),w=Z(y,Fn);return x&&w?Ni:x||w?x?Pn:Fn:Z(y,Ta)?Ta:ba}function _l(){if(!_o)return!1;var y={},x=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){y[w]=x?t.CSS.supports("touch-action",w):!0}),y}var Mi=1,je=2,hn=4,hi=8,br=hi,cn=16,hr=32;function zr(y){this.options=L({},this.defaults,y||{}),this.id=O(),this.manager=null,this.options.enable=F(this.options.enable,!0),this.state=Mi,this.simultaneous={},this.requireFail=[]}zr.prototype={defaults:{},set:function(y){return L(this.options,y),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(y){if(_(y,"recognizeWith",this))return this;var x=this.simultaneous;return y=xs(y,this),x[y.id]||(x[y.id]=y,y.recognizeWith(this)),this},dropRecognizeWith:function(y){return _(y,"dropRecognizeWith",this)?this:(y=xs(y,this),delete this.simultaneous[y.id],this)},requireFailure:function(y){if(_(y,"requireFailure",this))return this;var x=this.requireFail;return y=xs(y,this),J(x,y)===-1&&(x.push(y),y.requireFailure(this)),this},dropRequireFailure:function(y){if(_(y,"dropRequireFailure",this))return this;y=xs(y,this);var x=J(this.requireFail,y);return x>-1&&this.requireFail.splice(x,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(y){return!!this.simultaneous[y.id]},emit:function(y){var x=this,w=this.state;function M(Y){x.manager.emit(Y,y)}w<hi&&M(x.options.event+Do(w)),M(x.options.event),y.additionalEvent&&M(y.additionalEvent),w>=hi&&M(x.options.event+Do(w))},tryEmit:function(y){if(this.canEmit())return this.emit(y);this.state=hr},canEmit:function(){for(var y=0;y<this.requireFail.length;){if(!(this.requireFail[y].state&(hr|Mi)))return!1;y++}return!0},recognize:function(y){var x=L({},y);if(!b(this.options.enable,[this,x])){this.reset(),this.state=hr;return}this.state&(br|cn|hr)&&(this.state=Mi),this.state=this.process(x),this.state&(je|hn|hi|cn)&&this.tryEmit(x)},process:function(y){},getTouchAction:function(){},reset:function(){}};function Do(y){return y&cn?"cancel":y&hi?"end":y&hn?"move":y&je?"start":""}function So(y){return y==Ne?"down":y==Jt?"up":y==Fe?"left":y==Ze?"right":""}function xs(y,x){var w=x.manager;return w?w.get(y):y}function Je(){zr.apply(this,arguments)}W(Je,zr,{defaults:{pointers:1},attrTest:function(y){var x=this.options.pointers;return x===0||y.pointers.length===x},process:function(y){var x=this.state,w=y.eventType,M=x&(je|hn),Y=this.attrTest(y);return M&&(w&Vt||!Y)?x|cn:M||Y?w&Ot?x|hi:x&je?x|hn:je:hr}});function kn(){Je.apply(this,arguments),this.pX=null,this.pY=null}W(kn,Je,{defaults:{event:"pan",threshold:10,pointers:1,direction:oi},getTouchAction:function(){var y=this.options.direction,x=[];return y&xe&&x.push(Fn),y&Qt&&x.push(Pn),x},directionTest:function(y){var x=this.options,w=!0,M=y.distance,Y=y.direction,j=y.deltaX,Et=y.deltaY;return Y&x.direction||(x.direction&xe?(Y=j===0?Le:j<0?Fe:Ze,w=j!=this.pX,M=Math.abs(y.deltaX)):(Y=Et===0?Le:Et<0?Jt:Ne,w=Et!=this.pY,M=Math.abs(y.deltaY))),y.direction=Y,w&&M>x.threshold&&Y&x.direction},attrTest:function(y){return Je.prototype.attrTest.call(this,y)&&(this.state&je||!(this.state&je)&&this.directionTest(y))},emit:function(y){this.pX=y.deltaX,this.pY=y.deltaY;var x=So(y.direction);x&&(y.additionalEvent=this.options.event+x),this._super.emit.call(this,y)}});function Es(){Je.apply(this,arguments)}W(Es,Je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ni]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.scale-1)>this.options.threshold||this.state&je)},emit:function(y){if(y.scale!==1){var x=y.scale<1?"in":"out";y.additionalEvent=this.options.event+x}this._super.emit.call(this,y)}});function Hn(){zr.apply(this,arguments),this._timer=null,this._input=null}W(Hn,zr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ba]},process:function(y){var x=this.options,w=y.pointers.length===x.pointers,M=y.distance<x.threshold,Y=y.deltaTime>x.time;if(this._input=y,!M||!w||y.eventType&(Ot|Vt)&&!Y)this.reset();else if(y.eventType&Gt)this.reset(),this._timer=E(function(){this.state=br,this.tryEmit()},x.time,this);else if(y.eventType&Ot)return br;return hr},reset:function(){clearTimeout(this._timer)},emit:function(y){this.state===br&&(y&&y.eventType&Ot?this.manager.emit(this.options.event+"up",y):(this._input.timeStamp=g(),this.manager.emit(this.options.event,this._input)))}});function Ca(){Je.apply(this,arguments)}W(Ca,Je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ni]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.rotation)>this.options.threshold||this.state&je)}});function As(){Je.apply(this,arguments)}W(As,Je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Qt,pointers:1},getTouchAction:function(){return kn.prototype.getTouchAction.call(this)},attrTest:function(y){var x=this.options.direction,w;return x&(xe|Qt)?w=y.overallVelocity:x&xe?w=y.overallVelocityX:x&Qt&&(w=y.overallVelocityY),this._super.attrTest.call(this,y)&&x&y.offsetDirection&&y.distance>this.options.threshold&&y.maxPointers==this.options.pointers&&d(w)>this.options.velocity&&y.eventType&Ot},emit:function(y){var x=So(y.offsetDirection);x&&this.manager.emit(this.options.event+x,y),this.manager.emit(this.options.event,y)}});function Bi(){zr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}W(Bi,zr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ta]},process:function(y){var x=this.options,w=y.pointers.length===x.pointers,M=y.distance<x.threshold,Y=y.deltaTime<x.time;if(this.reset(),y.eventType&Gt&&this.count===0)return this.failTimeout();if(M&&Y&&w){if(y.eventType!=Ot)return this.failTimeout();var j=this.pTime?y.timeStamp-this.pTime<x.interval:!0,Et=!this.pCenter||ui(this.pCenter,y.center)<x.posThreshold;this.pTime=y.timeStamp,this.pCenter=y.center,!Et||!j?this.count=1:this.count+=1,this._input=y;var re=this.count%x.taps;if(re===0)return this.hasRequireFailures()?(this._timer=E(function(){this.state=br,this.tryEmit()},x.interval,this),je):br}return hr},failTimeout:function(){return this._timer=E(function(){this.state=hr},this.options.interval,this),hr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==br&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function $r(y,x){return x=x||{},x.recognizers=F(x.recognizers,$r.defaults.preset),new ws(y,x)}$r.VERSION="2.0.7",$r.defaults={domEvents:!1,touchAction:Co,enable:!0,inputTarget:null,inputClass:null,preset:[[Ca,{enable:!1}],[Es,{enable:!1},["rotate"]],[As,{direction:xe}],[kn,{direction:xe},["swipe"]],[Bi],[Bi,{event:"doubletap",taps:2},["tap"]],[Hn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Cl=1,Da=2;function ws(y,x){this.options=L({},$r.defaults,x||{}),this.options.inputTarget=this.options.inputTarget||y,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=y,this.input=or(this),this.touchAction=new _a(this,this.options.touchAction),bs(this,!0),C(this.options.recognizers,function(w){var M=this.add(new w[0](w[1]));w[2]&&M.recognizeWith(w[2]),w[3]&&M.requireFailure(w[3])},this)}ws.prototype={set:function(y){return L(this.options,y),y.touchAction&&this.touchAction.update(),y.inputTarget&&(this.input.destroy(),this.input.target=y.inputTarget,this.input.init()),this},stop:function(y){this.session.stopped=y?Da:Cl},recognize:function(y){var x=this.session;if(!x.stopped){this.touchAction.preventDefaults(y);var w,M=this.recognizers,Y=x.curRecognizer;(!Y||Y&&Y.state&br)&&(Y=x.curRecognizer=null);for(var j=0;j<M.length;)w=M[j],x.stopped!==Da&&(!Y||w==Y||w.canRecognizeWith(Y))?w.recognize(y):w.reset(),!Y&&w.state&(je|hn|hi)&&(Y=x.curRecognizer=w),j++}},get:function(y){if(y instanceof zr)return y;for(var x=this.recognizers,w=0;w<x.length;w++)if(x[w].options.event==y)return x[w];return null},add:function(y){if(_(y,"add",this))return this;var x=this.get(y.options.event);return x&&this.remove(x),this.recognizers.push(y),y.manager=this,this.touchAction.update(),y},remove:function(y){if(_(y,"remove",this))return this;if(y=this.get(y),y){var x=this.recognizers,w=J(x,y);w!==-1&&(x.splice(w,1),this.touchAction.update())}return this},on:function(y,x){if(y!==a&&x!==a){var w=this.handlers;return C(rt(y),function(M){w[M]=w[M]||[],w[M].push(x)}),this}},off:function(y,x){if(y!==a){var w=this.handlers;return C(rt(y),function(M){x?w[M]&&w[M].splice(J(w[M],x),1):delete w[M]}),this}},emit:function(y,x){this.options.domEvents&&Dl(y,x);var w=this.handlers[y]&&this.handlers[y].slice();if(!(!w||!w.length)){x.type=y,x.preventDefault=function(){x.srcEvent.preventDefault()};for(var M=0;M<w.length;)w[M](x),M++}},destroy:function(){this.element&&bs(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function bs(y,x){var w=y.element;if(w.style){var M;C(y.options.cssProps,function(Y,j){M=ft(w.style,j),x?(y.oldCssProps[M]=w.style[M],w.style[M]=Y):w.style[M]=y.oldCssProps[M]||""}),x||(y.oldCssProps={})}}function Dl(y,x){var w=e.createEvent("Event");w.initEvent(y,!0,!0),w.gesture=x,x.target.dispatchEvent(w)}L($r,{INPUT_START:Gt,INPUT_MOVE:Zt,INPUT_END:Ot,INPUT_CANCEL:Vt,STATE_POSSIBLE:Mi,STATE_BEGAN:je,STATE_CHANGED:hn,STATE_ENDED:hi,STATE_RECOGNIZED:br,STATE_CANCELLED:cn,STATE_FAILED:hr,DIRECTION_NONE:Le,DIRECTION_LEFT:Fe,DIRECTION_RIGHT:Ze,DIRECTION_UP:Jt,DIRECTION_DOWN:Ne,DIRECTION_HORIZONTAL:xe,DIRECTION_VERTICAL:Qt,DIRECTION_ALL:oi,Manager:ws,Input:Lt,TouchAction:_a,TouchInput:ln,MouseInput:xt,PointerEventInput:lr,TouchMouseInput:wa,SingleTouchInput:In,Recognizer:zr,AttrRecognizer:Je,Tap:Bi,Pan:kn,Swipe:As,Pinch:Es,Rotate:Ca,Press:Hn,on:q,off:K,each:C,merge:I,extend:N,assign:L,inherit:W,bindFn:G,prefixed:ft});var Oo=typeof t<"u"?t:typeof self<"u"?self:{};Oo.Hammer=$r,r.exports?r.exports=$r:t[i]=$r})(window,document,"Hammer")})(yf);var I2=yf.exports;const Qi=Fh(I2),mf=new P,qr=new P;class vf extends Ge{name="orbit-controller.ts";isSvg=!1;dom;domOffset=new P;camera;hammer;enabled=!0;enablePan=!0;enableRotate=!0;rotateSpeed=1;enableZoom=!0;minZoom=0;maxZoom=1/0;zoomSpeed=1;zoomChanged=!1;distanceStart=1;distanceEnd=1;state=-1;EPS=1e-6;focus=new P;target=new P;scaled=1;rotateTheta=0;enableDamping=!1;dampingFactor=.05;mouseButtons={LEFT:2,MIDDLE:1,RIGHT:0};isWheeling=!1;finalTimer;rotateStart=new P;rotateEnd=new P;rotateDelta=new P;panStart=new P;panEnd=new P;panOffset=new P;dollyStart=0;dollyOffset=new P;contextMenuHandler=this.handleContextMenu.bind(this);wheelHandler=this.handleWheel.bind(this);pointerDownHandler=this.handlePointerDown.bind(this);pointerUpHandler=this.handlePointerUp.bind(this);pointerMoveHandler=this.handlePointerMove.bind(this);pointerOverHandler=Nt.debounce(this.handlePointerOver.bind(this),100);pointerLeaveHandler=this.handlePointerLeave.bind(this);tapHandler=this.handleTap.bind(this);panHandler=this.handlePan.bind(this);pinchHandler=this.handlePinch.bind(this);pressHandler=this.handlePress.bind(this);swipeHandler=this.handleSwipe.bind(this);hammerInputHandler=this.handleHammerInput.bind(this);constructor(t,e,i=!1){super(),this.isSvg=i,this.dom=t,this.camera=e,this.scaled=e.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,mf.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(mf)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.hammer=new Qi.Manager(this.dom,{domEvents:!0});const t=new Qi.Pan({threshold:0,pointers:0}),e=new Qi.Pinch({threshold:0}),i=new Qi.Tap({event:"singletap",taps:1}),a=new Qi.Press({});this.hammer.add([t,i,a,e]),e.recognizeWith(t),this.hammer.on(["panstart","panmove","panend"].join(" "),this.panHandler),this.hammer.on(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),this.hammer.on("singletap",this.tapHandler),this.hammer.on("press",this.pressHandler),this.hammer.on("swipe",this.swipeHandler),this.hammer.on("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.addEventListener("pointerdown",this.pointerDownHandler),this.dom.addEventListener("pointerleave",this.pointerLeaveHandler))}unbindEvents(){var t,e,i,a,o,l,c,f;(t=this.hammer)==null||t.off(["panstart","panmove","panend"].join(" "),this.panHandler),(e=this.hammer)==null||e.off(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),(i=this.hammer)==null||i.off("singletap",this.tapHandler),(a=this.hammer)==null||a.off("press",this.pressHandler),(o=this.hammer)==null||o.off("swipe",this.swipeHandler),(l=this.hammer)==null||l.off("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.removeEventListener("pointerdown",this.pointerDownHandler),this.dom.removeEventListener("pointerleave",this.pointerLeaveHandler)),(c=this.hammer)==null||c.stop(!0),(f=this.hammer)==null||f.destroy()}setFocus(t,e){this.focus.set(t,e).sub(this.domOffset).unproject(this.camera)}handleTap(t){typeof t.preventDefault=="function"&&t.preventDefault(),qr.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"tap",data:{screenCoords:{x:qr.x,y:qr.y}},e:t})}handleDoubleTap(t){typeof t.preventDefault=="function"&&t.preventDefault(),console.log("【orbitController】DoubleTap: ",t),qr.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"doubletap",data:{screenCoords:{x:qr.x,y:qr.y}}})}handlePress(t){typeof t.preventDefault=="function"&&t.preventDefault(),console.log("【orbitController】Press: ",t)}handlePan(t){var i;if(this.scaled=this.camera.scaled.x,((i=t.pointers)==null?void 0:i.length)!==1)return;typeof t.preventDefault=="function"&&t.preventDefault();const e={type:"panmove",data:{}};(t.isFirst||t.type==="panstart")&&(this.state=2,this.panStart.set(t.center.x,t.center.y),e.type="panstart"),(t.isFinal||t.type==="panend")&&(this.state=-1,e.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),qr.set(t.center.x,t.center.y).sub(this.domOffset),e.data.screenCoords=qr.clone(),this.dispatchEvent(e),this.enablePan&&this.update()}handlePinch(t){typeof t.preventDefault=="function"&&t.preventDefault(),t.type==="pinchstart"&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||t.type==="pinchend")&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let e=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-e).sub(this.camera.position),this.update()}handleRotate(t){typeof t.preventDefault=="function"&&t.preventDefault()}handleSwipe(t){typeof t.preventDefault=="function"&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&typeof t.preventDefault=="function"&&t.preventDefault()}handleWheel(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),!this.enabled||!this.enableZoom||this.state!==-1)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.stopPropagation=="function"&&t.stopPropagation();let e=t.deltaY;(t==null?void 0:t.deltaMode)===1?e*=16:(t==null?void 0:t.deltaMode)===2&&(e*=100),t!=null&&t.ctrlKey&&(e*=10),this.setFocus(t.clientX,t.clientY);let i=this.getZoomScale(e);e<0?this.onDollyIn(i):e>0?this.onDollyOut(i):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout(()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)},500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(t*.03))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled||t.button!==2)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let e=-1;t.button===0?e=this.mouseButtons.LEFT:t.button===1?e=this.mouseButtons.MIDDLE:t.button===2&&(e=this.mouseButtons.RIGHT),e===0&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&this.state===0){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){t.buttons>0||(qr.set(t.clientX,t.clientY).sub(this.domOffset),this.dispatchEvent({type:"pointerover",data:{screenCoords:{x:qr.x,y:qr.y}},e:t}))}onRotate(t,e){this.rotateEnd.set(t,e),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const i=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=i,this.rotateStart.copy(this.rotateEnd),this.update()}}var ot=(r=>(r.CONTEXTMENU="contextmenu",r.LOSTPOINTERCAPTURE="lostpointercapture",r.MOUSEOVER="mouseover",r.MOUSEOUT="mouseout",r.MOUSELEAVE="mouseleave",r.MOUSEENTER="mouseenter",r.MOUSEMOVE="mousemove",r.MOUSEDOWN="mousedown",r.MOUSEUP="mouseup",r.POINTERMOVE="pointermove",r.POINTERDOWN="pointerdown",r.POINTERUP="pointerup",r.POINTERCANCEL="pointercancel",r.POINTEROUT="pointerout",r.POINTERLEAVE="pointerleave",r.POINTEROVER="pointerover",r.POINTERENTER="pointerenter",r.TOUCHSTART="touchstart",r.TOUCHEND="touchend",r.TOUCHMOVE="touchmove",r.TOUCHCANCEL="touchcancel",r.WHEEL="wheel",r.WHEEL_START="wheelstart",r.WHEEL_END="wheelend",r.MOUSEWHEEL="mousewheel",r.CLICK="click",r.DBLCLICK="dblclick",r.CONTEXT_LOST="contextlost",r.CONTEXT_RESTORED="contextrestored",r.CONTROLS_CHANGED="controlschanged",r.TAP="tap",r.SINGLE_TAP="singletap",r.DOUBLE_TAP="doubletap",r.PRESS="press",r.PAN="pan",r.PAN_START="panstart",r.PAN_MOVE="panmove",r.PAN_END="panend",r.ROTATE="rotate",r.ROTATE_START="rotatestart",r.ROTATE_MOVE="rotatemove",r.ROTATE_END="rotateend",r.PINCH="pinch",r.PINCH_START="pinchstart",r.PINCH_MOVE="pinchmove",r.PINCH_END="pinchend",r.PINCH_IN="pinchin",r.PINCH_OUT="pinchout",r.SWIPE="swipe",r.CHANGE_START="change_start",r.CHANGE_END="change_end",r.CAMERA_CHANGED="cameraChanged",r))(ot||{});const sa=new P;class xf extends qc{isCamera=!0;type="Camera2";name="Camera2";params;matrixAutoUpdate=!1;matrixWorldAutoUpdate=!1;projectionMatrix=new se;projectionMatrixInverse=new se;viewMatrix=new se;viewMatrixNeedsUpdate=!0;viewArea=0;left=-1;right=1;top=1;bottom=-1;width=2;height=2;aspect=1;view;constructor(t){super(),this.params=t,this.width=(t==null?void 0:t.width)!==void 0?t.width:2,this.height=(t==null?void 0:t.height)!==void 0?t.height:2,this.aspect=(t==null?void 0:t.aspect)!==void 0?t.aspect:1,(t==null?void 0:t.left)!==void 0&&(this.left=t.left),(t==null?void 0:t.right)!==void 0&&(this.right=t.right),(t==null?void 0:t.top)!==void 0&&(this.top=t.top),(t==null?void 0:t.bottom)!==void 0&&(this.bottom=t.bottom);const e=(this.right+this.left)/2,i=(this.top+this.bottom)/2;if(this.aspect>1){const a=Math.round((this.right-this.left)/2/this.aspect);this.top=i+a,this.bottom=i-a}else if(this.aspect<1){const a=Math.round((this.top-this.bottom)/2*this.aspect);this.left=e-a,this.right=e+a}this.flipY=(t==null?void 0:t.flipY)===!0,this.updateProjectionMatrix(),t!=null&&t.eye&&this.position.fromArray(t.eye),t!=null&&t.up&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,e=1,i=1,a=-1){sa.set(t+e,a+i).multiplyScalar(.5);const o=Math.max((e-t)/this.width,(i-a)/this.height);this.setTRS(sa,0,o)}setByBox(t){if(!t||t.isEmpty()){console.error(`setByBox: ${t==null?void 0:t.toString()}`);return}this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},e=0,i=0){this.position.set(t.x||0,t.y||0),this.rotation.set(e,e),this.scaled.set(i,i),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.width=t||2,this.height=e||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/e;const i=(this.right+this.left)/2,a=(this.top+this.bottom)/2;if(this.aspect>1){const o=Math.round((this.right-this.left)/2/this.aspect);this.top=a+o,this.bottom=a-o}else if(this.aspect<1){const o=Math.round((this.top-this.bottom)/2*this.aspect);this.left=i-o,this.right=i+o}this.updateProjectionMatrix(),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[6],-e[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){this.parent===void 0&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return sa.set(this.width,this.height).multiplyScalar(.5).multiplyScalar(this.scaled.x),this.boundingBox.min.subVectors(this.position,sa),this.boundingBox.max.addVectors(this.position,sa),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return new this.constructor.prototype.constructor().copy(this)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var uo=(r=>(r.UPDATE="update",r))(uo||{});class Gu extends Ge{name="SvgSelectRect";container;el;constructor(t){super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.el=document.createElement("div"),this.el.setAttribute("id",as+"SvgSelectRect"),this.el.setAttribute("class",as+"-svg-select-rect"),this.el.style.display="none",this.container.appendChild(this.el)}destroy(){super.destroy(),this.el&&this.el.remove()}draw(t){Ef.copy(t).getSize(Xu),Yu.copy(Ef.min),this.el.style.display="none",this.el.style.position="absolute",this.el.style.left=Yu.x+"px",this.el.style.top=Yu.y+"px",this.el.style.width=Xu.x+"px",this.el.style.height=Xu.y+"px",this.el.style.display="block",this.el.style.background=new Wt($t.darkBlue).setA(.1).getStyle(),this.el.style.border=$t.darkBlue+" 1px dashed"}hide(){this.el.style.display="none"}}const Ef=new _t,Yu=new P,Xu=new P;class R2 extends Ge{name="SvgMultiSelector";controller;scene;container;p1=new P;p2=new P;graph;selectEnable=!1;multiSelectEnable=!1;controllerTapHandler=this.handleControllerTap.bind(this);controllerPanStartHandler=this.handleControllerPanStart.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPanEndHandler=this.handleControllerPanEnd.bind(this);constructor(t,e){super(),this.container=t,this.controller=e,this.graph=new Gu(t),this.bindControllerEvents()}destroy(){this.unbindControllerEvents(),super.destroy()}bindScene(t){this.scene=t}selectEnableChanged(t){var e;(e=this.scene)==null||e.clearSelected(),this.selectEnable=!!t}multiSelectEnableChanged(t){var e;(e=this.scene)==null||e.clearSelected(),this.multiSelectEnable=!!t,this.controller.enablePan=!this.multiSelectEnable}bindControllerEvents(){this.controller.addEventListener(ot.TAP,this.controllerTapHandler),this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.TAP,this.controllerTapHandler),this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler)}handleControllerTap(t){var i,a,o,l,c,f;if((t==null?void 0:t.type)!==ot.TAP||!this.selectEnable&&!this.multiSelectEnable)return;const e=((i=t==null?void 0:t.e)==null?void 0:i.target)||((o=(a=t==null?void 0:t.e)==null?void 0:a.srcEvent)==null?void 0:o.target)||((c=(l=t==null?void 0:t.e)==null?void 0:l.srcEvent)==null?void 0:c.srcElement);e!=null&&e.id&&(f=this.scene)!=null&&f.isBelongsToAssetType(e==null?void 0:e.id)&&this.dispatchEvent({type:"SELECTED",data:{...t.data,target:[e],selected:[e==null?void 0:e.id]}})}handleControllerPanStart(t){(t==null?void 0:t.type)===ot.PAN_START&&this.multiSelectEnable&&(this.p1.copy(t.data.screenCoords),Tn.makeEmpty().expandByPoint(this.p1),this.graph.draw(Tn))}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&this.multiSelectEnable&&(this.p2.copy(t.data.screenCoords),Tn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Tn))}handleControllerPanEnd(t){var a;if((t==null?void 0:t.type)!==ot.PAN_END||!this.multiSelectEnable)return;this.p2.copy(t.data.screenCoords),Tn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera);const e=(a=this.scene)==null?void 0:a.getElementsByBox(Tn),i=[];(e||[]).forEach(o=>i.push(o.id)),this.graph.hide(),Tn.makeEmpty(),this.dispatchEvent({type:"SELECTED",data:{target:e,selected:i}})}}var Zu=(r=>(r.SELECTED="SELECTED",r))(Zu||{});const Tn=new _t;var _n=(r=>(r.DEFAULT="default",r.INFO="info",r.PRIMARY="primary",r.SUCCESS="success",r.WARNING="warning",r.DANGER="danger",r))(_n||{});class Af{camera;screenCoords=new P;worldCoords=new P;params={Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}};constructor(){}setFromCamera(t,e){return this.camera=e,this.screenCoords.set(t.x,t.y),this.worldCoords.copy(this.screenCoords).unproject(e),this}intersectObjects(t,e=!0,i=[]){for(let a=0,o=t.length;a<o;a++)this.intersectObject(t[a],e,i)}intersectObject(t,e=!1,i=[]){if(!t.selectable||(t.raycast(this,i),!e||t.composeNode))return i;for(let a=0,o=t.children.length;a<o;a++)this.intersectObject(t.children[a],e,i);return i}}var Ye="top",mr="bottom",vr="right",Xe="left",Qu="auto",aa=[Ye,mr,vr,Xe],us="start",oa="end",P2="clippingParents",wf="viewport",ua="popper",F2="reference",bf=aa.reduce(function(r,t){return r.concat([t+"-"+us,t+"-"+oa])},[]),Tf=[].concat(aa,[Qu]).reduce(function(r,t){return r.concat([t,t+"-"+us,t+"-"+oa])},[]),k2="beforeRead",H2="read",U2="afterRead",q2="beforeMain",W2="main",V2="afterMain",z2="beforeWrite",$2="write",G2="afterWrite",Y2=[k2,H2,U2,q2,W2,V2,z2,$2,G2];function ei(r){return r?(r.nodeName||"").toLowerCase():null}function sr(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var t=r.ownerDocument;return t&&t.defaultView||window}return r}function Cn(r){var t=sr(r).Element;return r instanceof t||r instanceof Element}function xr(r){var t=sr(r).HTMLElement;return r instanceof t||r instanceof HTMLElement}function Ku(r){if(typeof ShadowRoot>"u")return!1;var t=sr(r).ShadowRoot;return r instanceof t||r instanceof ShadowRoot}function X2(r){var t=r.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},a=t.attributes[e]||{},o=t.elements[e];!xr(o)||!ei(o)||(Object.assign(o.style,i),Object.keys(a).forEach(function(l){var c=a[l];c===!1?o.removeAttribute(l):o.setAttribute(l,c===!0?"":c)}))})}function Z2(r){var t=r.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var a=t.elements[i],o=t.attributes[i]||{},l=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),c=l.reduce(function(f,d){return f[d]="",f},{});!xr(a)||!ei(a)||(Object.assign(a.style,c),Object.keys(o).forEach(function(f){a.removeAttribute(f)}))})}}const _f={name:"applyStyles",enabled:!0,phase:"write",fn:X2,effect:Z2,requires:["computeStyles"]};function ri(r){return r.split("-")[0]}var Dn=Math.max,lo=Math.min,ls=Math.round;function ju(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Cf(){return!/^((?!chrome|android).)*safari/i.test(ju())}function hs(r,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=r.getBoundingClientRect(),a=1,o=1;t&&xr(r)&&(a=r.offsetWidth>0&&ls(i.width)/r.offsetWidth||1,o=r.offsetHeight>0&&ls(i.height)/r.offsetHeight||1);var l=Cn(r)?sr(r):window,c=l.visualViewport,f=!Cf()&&e,d=(i.left+(f&&c?c.offsetLeft:0))/a,g=(i.top+(f&&c?c.offsetTop:0))/o,E=i.width/a,_=i.height/o;return{width:E,height:_,top:g,right:d+E,bottom:g+_,left:d,x:d,y:g}}function Ju(r){var t=hs(r),e=r.offsetWidth,i=r.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:r.offsetLeft,y:r.offsetTop,width:e,height:i}}function Df(r,t){var e=t.getRootNode&&t.getRootNode();if(r.contains(t))return!0;if(e&&Ku(e)){var i=t;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ti(r){return sr(r).getComputedStyle(r)}function Q2(r){return["table","td","th"].indexOf(ei(r))>=0}function Ki(r){return((Cn(r)?r.ownerDocument:r.document)||window.document).documentElement}function ho(r){return ei(r)==="html"?r:r.assignedSlot||r.parentNode||(Ku(r)?r.host:null)||Ki(r)}function Sf(r){return!xr(r)||Ti(r).position==="fixed"?null:r.offsetParent}function K2(r){var t=/firefox/i.test(ju()),e=/Trident/i.test(ju());if(e&&xr(r)){var i=Ti(r);if(i.position==="fixed")return null}var a=ho(r);for(Ku(a)&&(a=a.host);xr(a)&&["html","body"].indexOf(ei(a))<0;){var o=Ti(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function la(r){for(var t=sr(r),e=Sf(r);e&&Q2(e)&&Ti(e).position==="static";)e=Sf(e);return e&&(ei(e)==="html"||ei(e)==="body"&&Ti(e).position==="static")?t:e||K2(r)||t}function tl(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function ha(r,t,e){return Dn(r,lo(t,e))}function j2(r,t,e){var i=ha(r,t,e);return i>e?e:i}function Of(){return{top:0,right:0,bottom:0,left:0}}function Lf(r){return Object.assign({},Of(),r)}function Nf(r,t){return t.reduce(function(e,i){return e[i]=r,e},{})}var J2=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Lf(typeof t!="number"?t:Nf(t,aa))};function ty(r){var t,e=r.state,i=r.name,a=r.options,o=e.elements.arrow,l=e.modifiersData.popperOffsets,c=ri(e.placement),f=tl(c),d=[Xe,vr].indexOf(c)>=0,g=d?"height":"width";if(!(!o||!l)){var E=J2(a.padding,e),_=Ju(o),C=f==="y"?Ye:Xe,R=f==="y"?mr:vr,L=e.rects.reference[g]+e.rects.reference[f]-l[f]-e.rects.popper[g],N=l[f]-e.rects.reference[f],I=la(o),W=I?f==="y"?I.clientHeight||0:I.clientWidth||0:0,G=L/2-N/2,b=E[C],F=W-_[g]-E[R],q=W/2-_[g]/2+G,K=ha(b,q,F),tt=f;e.modifiersData[i]=(t={},t[tt]=K,t.centerOffset=K-q,t)}}function ey(r){var t=r.state,e=r.options,i=e.element,a=i===void 0?"[data-popper-arrow]":i;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||Df(t.elements.popper,a)&&(t.elements.arrow=a))}const ry={name:"arrow",enabled:!0,phase:"main",fn:ty,effect:ey,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cs(r){return r.split("-")[1]}var iy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ny(r,t){var e=r.x,i=r.y,a=t.devicePixelRatio||1;return{x:ls(e*a)/a||0,y:ls(i*a)/a||0}}function Mf(r){var t,e=r.popper,i=r.popperRect,a=r.placement,o=r.variation,l=r.offsets,c=r.position,f=r.gpuAcceleration,d=r.adaptive,g=r.roundOffsets,E=r.isFixed,_=l.x,C=_===void 0?0:_,R=l.y,L=R===void 0?0:R,N=typeof g=="function"?g({x:C,y:L}):{x:C,y:L};C=N.x,L=N.y;var I=l.hasOwnProperty("x"),W=l.hasOwnProperty("y"),G=Xe,b=Ye,F=window;if(d){var q=la(e),K="clientHeight",tt="clientWidth";if(q===sr(e)&&(q=Ki(e),Ti(q).position!=="static"&&c==="absolute"&&(K="scrollHeight",tt="scrollWidth")),q=q,a===Ye||(a===Xe||a===vr)&&o===oa){b=mr;var Z=E&&q===F&&F.visualViewport?F.visualViewport.height:q[K];L-=Z-i.height,L*=f?1:-1}if(a===Xe||(a===Ye||a===mr)&&o===oa){G=vr;var rt=E&&q===F&&F.visualViewport?F.visualViewport.width:q[tt];C-=rt-i.width,C*=f?1:-1}}var J=Object.assign({position:c},d&&iy),st=g===!0?ny({x:C,y:L},sr(e)):{x:C,y:L};if(C=st.x,L=st.y,f){var ct;return Object.assign({},J,(ct={},ct[b]=W?"0":"",ct[G]=I?"0":"",ct.transform=(F.devicePixelRatio||1)<=1?"translate("+C+"px, "+L+"px)":"translate3d("+C+"px, "+L+"px, 0)",ct))}return Object.assign({},J,(t={},t[b]=W?L+"px":"",t[G]=I?C+"px":"",t.transform="",t))}function sy(r){var t=r.state,e=r.options,i=e.gpuAcceleration,a=i===void 0?!0:i,o=e.adaptive,l=o===void 0?!0:o,c=e.roundOffsets,f=c===void 0?!0:c,d={placement:ri(t.placement),variation:cs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Mf(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Mf(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ay={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sy,data:{}};var co={passive:!0};function oy(r){var t=r.state,e=r.instance,i=r.options,a=i.scroll,o=a===void 0?!0:a,l=i.resize,c=l===void 0?!0:l,f=sr(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(g){g.addEventListener("scroll",e.update,co)}),c&&f.addEventListener("resize",e.update,co),function(){o&&d.forEach(function(g){g.removeEventListener("scroll",e.update,co)}),c&&f.removeEventListener("resize",e.update,co)}}const uy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:oy,data:{}};var ly={left:"right",right:"left",bottom:"top",top:"bottom"};function fo(r){return r.replace(/left|right|bottom|top/g,function(t){return ly[t]})}var hy={start:"end",end:"start"};function Bf(r){return r.replace(/start|end/g,function(t){return hy[t]})}function el(r){var t=sr(r),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function rl(r){return hs(Ki(r)).left+el(r).scrollLeft}function cy(r,t){var e=sr(r),i=Ki(r),a=e.visualViewport,o=i.clientWidth,l=i.clientHeight,c=0,f=0;if(a){o=a.width,l=a.height;var d=Cf();(d||!d&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}return{width:o,height:l,x:c+rl(r),y:f}}function fy(r){var t,e=Ki(r),i=el(r),a=(t=r.ownerDocument)==null?void 0:t.body,o=Dn(e.scrollWidth,e.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),l=Dn(e.scrollHeight,e.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),c=-i.scrollLeft+rl(r),f=-i.scrollTop;return Ti(a||e).direction==="rtl"&&(c+=Dn(e.clientWidth,a?a.clientWidth:0)-o),{width:o,height:l,x:c,y:f}}function il(r){var t=Ti(r),e=t.overflow,i=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+a+i)}function If(r){return["html","body","#document"].indexOf(ei(r))>=0?r.ownerDocument.body:xr(r)&&il(r)?r:If(ho(r))}function ca(r,t){var e;t===void 0&&(t=[]);var i=If(r),a=i===((e=r.ownerDocument)==null?void 0:e.body),o=sr(i),l=a?[o].concat(o.visualViewport||[],il(i)?i:[]):i,c=t.concat(l);return a?c:c.concat(ca(ho(l)))}function nl(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function py(r,t){var e=hs(r,!1,t==="fixed");return e.top=e.top+r.clientTop,e.left=e.left+r.clientLeft,e.bottom=e.top+r.clientHeight,e.right=e.left+r.clientWidth,e.width=r.clientWidth,e.height=r.clientHeight,e.x=e.left,e.y=e.top,e}function Rf(r,t,e){return t===wf?nl(cy(r,e)):Cn(t)?py(t,e):nl(fy(Ki(r)))}function dy(r){var t=ca(ho(r)),e=["absolute","fixed"].indexOf(Ti(r).position)>=0,i=e&&xr(r)?la(r):r;return Cn(i)?t.filter(function(a){return Cn(a)&&Df(a,i)&&ei(a)!=="body"}):[]}function gy(r,t,e,i){var a=t==="clippingParents"?dy(r):[].concat(t),o=[].concat(a,[e]),l=o[0],c=o.reduce(function(f,d){var g=Rf(r,d,i);return f.top=Dn(g.top,f.top),f.right=lo(g.right,f.right),f.bottom=lo(g.bottom,f.bottom),f.left=Dn(g.left,f.left),f},Rf(r,l,i));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function Pf(r){var t=r.reference,e=r.element,i=r.placement,a=i?ri(i):null,o=i?cs(i):null,l=t.x+t.width/2-e.width/2,c=t.y+t.height/2-e.height/2,f;switch(a){case Ye:f={x:l,y:t.y-e.height};break;case mr:f={x:l,y:t.y+t.height};break;case vr:f={x:t.x+t.width,y:c};break;case Xe:f={x:t.x-e.width,y:c};break;default:f={x:t.x,y:t.y}}var d=a?tl(a):null;if(d!=null){var g=d==="y"?"height":"width";switch(o){case us:f[d]=f[d]-(t[g]/2-e[g]/2);break;case oa:f[d]=f[d]+(t[g]/2-e[g]/2);break}}return f}function fa(r,t){t===void 0&&(t={});var e=t,i=e.placement,a=i===void 0?r.placement:i,o=e.strategy,l=o===void 0?r.strategy:o,c=e.boundary,f=c===void 0?P2:c,d=e.rootBoundary,g=d===void 0?wf:d,E=e.elementContext,_=E===void 0?ua:E,C=e.altBoundary,R=C===void 0?!1:C,L=e.padding,N=L===void 0?0:L,I=Lf(typeof N!="number"?N:Nf(N,aa)),W=_===ua?F2:ua,G=r.rects.popper,b=r.elements[R?W:_],F=gy(Cn(b)?b:b.contextElement||Ki(r.elements.popper),f,g,l),q=hs(r.elements.reference),K=Pf({reference:q,element:G,strategy:"absolute",placement:a}),tt=nl(Object.assign({},G,K)),Z=_===ua?tt:q,rt={top:F.top-Z.top+I.top,bottom:Z.bottom-F.bottom+I.bottom,left:F.left-Z.left+I.left,right:Z.right-F.right+I.right},J=r.modifiersData.offset;if(_===ua&&J){var st=J[a];Object.keys(rt).forEach(function(ct){var ft=[vr,mr].indexOf(ct)>=0?1:-1,pt=[Ye,mr].indexOf(ct)>=0?"y":"x";rt[ct]+=st[pt]*ft})}return rt}function yy(r,t){t===void 0&&(t={});var e=t,i=e.placement,a=e.boundary,o=e.rootBoundary,l=e.padding,c=e.flipVariations,f=e.allowedAutoPlacements,d=f===void 0?Tf:f,g=cs(i),E=g?c?bf:bf.filter(function(R){return cs(R)===g}):aa,_=E.filter(function(R){return d.indexOf(R)>=0});_.length===0&&(_=E);var C=_.reduce(function(R,L){return R[L]=fa(r,{placement:L,boundary:a,rootBoundary:o,padding:l})[ri(L)],R},{});return Object.keys(C).sort(function(R,L){return C[R]-C[L]})}function my(r){if(ri(r)===Qu)return[];var t=fo(r);return[Bf(r),t,Bf(t)]}function vy(r){var t=r.state,e=r.options,i=r.name;if(!t.modifiersData[i]._skip){for(var a=e.mainAxis,o=a===void 0?!0:a,l=e.altAxis,c=l===void 0?!0:l,f=e.fallbackPlacements,d=e.padding,g=e.boundary,E=e.rootBoundary,_=e.altBoundary,C=e.flipVariations,R=C===void 0?!0:C,L=e.allowedAutoPlacements,N=t.options.placement,I=ri(N),W=I===N,G=f||(W||!R?[fo(N)]:my(N)),b=[N].concat(G).reduce(function(Pe,le){return Pe.concat(ri(le)===Qu?yy(t,{placement:le,boundary:g,rootBoundary:E,padding:d,flipVariations:R,allowedAutoPlacements:L}):le)},[]),F=t.rects.reference,q=t.rects.popper,K=new Map,tt=!0,Z=b[0],rt=0;rt<b.length;rt++){var J=b[rt],st=ri(J),ct=cs(J)===us,ft=[Ye,mr].indexOf(st)>=0,pt=ft?"width":"height",O=fa(t,{placement:J,boundary:g,rootBoundary:E,altBoundary:_,padding:d}),vt=ft?ct?vr:Xe:ct?mr:Ye;F[pt]>q[pt]&&(vt=fo(vt));var Bt=fo(vt),Re=[];if(o&&Re.push(O[st]<=0),c&&Re.push(O[vt]<=0,O[Bt]<=0),Re.every(function(Pe){return Pe})){Z=J,tt=!1;break}K.set(J,Re)}if(tt)for(var be=R?3:1,ue=function(le){var Oe=b.find(function(Gt){var Zt=K.get(Gt);if(Zt)return Zt.slice(0,le).every(function(Ot){return Ot})});if(Oe)return Z=Oe,"break"},ve=be;ve>0;ve--){var Vr=ue(ve);if(Vr==="break")break}t.placement!==Z&&(t.modifiersData[i]._skip=!0,t.placement=Z,t.reset=!0)}}const xy={name:"flip",enabled:!0,phase:"main",fn:vy,requiresIfExists:["offset"],data:{_skip:!1}};function Ff(r,t,e){return e===void 0&&(e={x:0,y:0}),{top:r.top-t.height-e.y,right:r.right-t.width+e.x,bottom:r.bottom-t.height+e.y,left:r.left-t.width-e.x}}function kf(r){return[Ye,vr,mr,Xe].some(function(t){return r[t]>=0})}function Ey(r){var t=r.state,e=r.name,i=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,l=fa(t,{elementContext:"reference"}),c=fa(t,{altBoundary:!0}),f=Ff(l,i),d=Ff(c,a,o),g=kf(f),E=kf(d);t.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:d,isReferenceHidden:g,hasPopperEscaped:E},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":E})}const Ay={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ey};function wy(r,t,e){var i=ri(r),a=[Xe,Ye].indexOf(i)>=0?-1:1,o=typeof e=="function"?e(Object.assign({},t,{placement:r})):e,l=o[0],c=o[1];return l=l||0,c=(c||0)*a,[Xe,vr].indexOf(i)>=0?{x:c,y:l}:{x:l,y:c}}function by(r){var t=r.state,e=r.options,i=r.name,a=e.offset,o=a===void 0?[0,0]:a,l=Tf.reduce(function(g,E){return g[E]=wy(E,t.rects,o),g},{}),c=l[t.placement],f=c.x,d=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=l}const Ty={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:by};function _y(r){var t=r.state,e=r.name;t.modifiersData[e]=Pf({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Cy={name:"popperOffsets",enabled:!0,phase:"read",fn:_y,data:{}};function Dy(r){return r==="x"?"y":"x"}function Sy(r){var t=r.state,e=r.options,i=r.name,a=e.mainAxis,o=a===void 0?!0:a,l=e.altAxis,c=l===void 0?!1:l,f=e.boundary,d=e.rootBoundary,g=e.altBoundary,E=e.padding,_=e.tether,C=_===void 0?!0:_,R=e.tetherOffset,L=R===void 0?0:R,N=fa(t,{boundary:f,rootBoundary:d,padding:E,altBoundary:g}),I=ri(t.placement),W=cs(t.placement),G=!W,b=tl(I),F=Dy(b),q=t.modifiersData.popperOffsets,K=t.rects.reference,tt=t.rects.popper,Z=typeof L=="function"?L(Object.assign({},t.rects,{placement:t.placement})):L,rt=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,st={x:0,y:0};if(q){if(o){var ct,ft=b==="y"?Ye:Xe,pt=b==="y"?mr:vr,O=b==="y"?"height":"width",vt=q[b],Bt=vt+N[ft],Re=vt-N[pt],be=C?-tt[O]/2:0,ue=W===us?K[O]:tt[O],ve=W===us?-tt[O]:-K[O],Vr=t.elements.arrow,Pe=C&&Vr?Ju(Vr):{width:0,height:0},le=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Of(),Oe=le[ft],Gt=le[pt],Zt=ha(0,K[O],Pe[O]),Ot=G?K[O]/2-be-Zt-Oe-rt.mainAxis:ue-Zt-Oe-rt.mainAxis,Vt=G?-K[O]/2+be+Zt+Gt+rt.mainAxis:ve+Zt+Gt+rt.mainAxis,Le=t.elements.arrow&&la(t.elements.arrow),Fe=Le?b==="y"?Le.clientTop||0:Le.clientLeft||0:0,Ze=(ct=J==null?void 0:J[b])!=null?ct:0,Jt=vt+Ot-Ze-Fe,Ne=vt+Vt-Ze,xe=ha(C?lo(Bt,Jt):Bt,vt,C?Dn(Re,Ne):Re);q[b]=xe,st[b]=xe-vt}if(c){var Qt,oi=b==="x"?Ye:Xe,Si=b==="x"?mr:vr,he=q[F],Lt=F==="y"?"height":"width",or=he+N[oi],Qe=he-N[Si],Oi=[Ye,Xe].indexOf(I)!==-1,Ar=(Qt=J==null?void 0:J[F])!=null?Qt:0,rn=Oi?or:he-K[Lt]-tt[Lt]-Ar+rt.altAxis,ur=Oi?he+K[Lt]+tt[Lt]-Ar-rt.altAxis:Qe,Ke=C&&Oi?j2(rn,he,ur):ha(C?rn:or,he,C?ur:Qe);q[F]=Ke,st[F]=Ke-he}t.modifiersData[i]=st}}const Oy={name:"preventOverflow",enabled:!0,phase:"main",fn:Sy,requiresIfExists:["offset"]};function Ly(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Ny(r){return r===sr(r)||!xr(r)?el(r):Ly(r)}function My(r){var t=r.getBoundingClientRect(),e=ls(t.width)/r.offsetWidth||1,i=ls(t.height)/r.offsetHeight||1;return e!==1||i!==1}function By(r,t,e){e===void 0&&(e=!1);var i=xr(t),a=xr(t)&&My(t),o=Ki(t),l=hs(r,a,e),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(i||!i&&!e)&&((ei(t)!=="body"||il(o))&&(c=Ny(t)),xr(t)?(f=hs(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):o&&(f.x=rl(o))),{x:l.left+c.scrollLeft-f.x,y:l.top+c.scrollTop-f.y,width:l.width,height:l.height}}function Iy(r){var t=new Map,e=new Set,i=[];r.forEach(function(o){t.set(o.name,o)});function a(o){e.add(o.name);var l=[].concat(o.requires||[],o.requiresIfExists||[]);l.forEach(function(c){if(!e.has(c)){var f=t.get(c);f&&a(f)}}),i.push(o)}return r.forEach(function(o){e.has(o.name)||a(o)}),i}function Ry(r){var t=Iy(r);return Y2.reduce(function(e,i){return e.concat(t.filter(function(a){return a.phase===i}))},[])}function Py(r){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(r())})})),t}}function Fy(r){var t=r.reduce(function(e,i){var a=e[i.name];return e[i.name]=a?Object.assign({},a,i,{options:Object.assign({},a.options,i.options),data:Object.assign({},a.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var Hf={placement:"bottom",modifiers:[],strategy:"absolute"};function Uf(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function ky(r){r===void 0&&(r={});var t=r,e=t.defaultModifiers,i=e===void 0?[]:e,a=t.defaultOptions,o=a===void 0?Hf:a;return function(c,f,d){d===void 0&&(d=o);var g={placement:"bottom",orderedModifiers:[],options:Object.assign({},Hf,o),modifiersData:{},elements:{reference:c,popper:f},attributes:{},styles:{}},E=[],_=!1,C={state:g,setOptions:function(I){var W=typeof I=="function"?I(g.options):I;L(),g.options=Object.assign({},o,g.options,W),g.scrollParents={reference:Cn(c)?ca(c):c.contextElement?ca(c.contextElement):[],popper:ca(f)};var G=Ry(Fy([].concat(i,g.options.modifiers)));return g.orderedModifiers=G.filter(function(b){return b.enabled}),R(),C.update()},forceUpdate:function(){if(!_){var I=g.elements,W=I.reference,G=I.popper;if(Uf(W,G)){g.rects={reference:By(W,la(G),g.options.strategy==="fixed"),popper:Ju(G)},g.reset=!1,g.placement=g.options.placement,g.orderedModifiers.forEach(function(rt){return g.modifiersData[rt.name]=Object.assign({},rt.data)});for(var b=0;b<g.orderedModifiers.length;b++){if(g.reset===!0){g.reset=!1,b=-1;continue}var F=g.orderedModifiers[b],q=F.fn,K=F.options,tt=K===void 0?{}:K,Z=F.name;typeof q=="function"&&(g=q({state:g,options:tt,name:Z,instance:C})||g)}}}},update:Py(function(){return new Promise(function(N){C.forceUpdate(),N(g)})}),destroy:function(){L(),_=!0}};if(!Uf(c,f))return C;C.setOptions(d).then(function(N){!_&&d.onFirstUpdate&&d.onFirstUpdate(N)});function R(){g.orderedModifiers.forEach(function(N){var I=N.name,W=N.options,G=W===void 0?{}:W,b=N.effect;if(typeof b=="function"){var F=b({state:g,name:I,instance:C,options:G}),q=function(){};E.push(F||q)}})}function L(){E.forEach(function(N){return N()}),E=[]}return C}}var Hy=[uy,Cy,ay,_f,Ty,xy,Oy,ry,Ay],Uy=ky({defaultModifiers:Hy}),qy="tippy-box",qf="tippy-content",Wy="tippy-backdrop",Wf="tippy-arrow",Vf="tippy-svg-arrow",Sn={passive:!0,capture:!0},zf=function(){return document.body};function Vy(r,t){return{}.hasOwnProperty.call(r,t)}function sl(r,t,e){if(Array.isArray(r)){var i=r[t];return i??(Array.isArray(e)?e[t]:e)}return r}function al(r,t){var e={}.toString.call(r);return e.indexOf("[object")===0&&e.indexOf(t+"]")>-1}function $f(r,t){return typeof r=="function"?r.apply(void 0,t):r}function Gf(r,t){if(t===0)return r;var e;return function(i){clearTimeout(e),e=setTimeout(function(){r(i)},t)}}function zy(r,t){var e=Object.assign({},r);return t.forEach(function(i){delete e[i]}),e}function $y(r){return r.split(/\s+/).filter(Boolean)}function fs(r){return[].concat(r)}function Yf(r,t){r.indexOf(t)===-1&&r.push(t)}function Gy(r){return r.filter(function(t,e){return r.indexOf(t)===e})}function Yy(r){return r.split("-")[0]}function po(r){return[].slice.call(r)}function Xf(r){return Object.keys(r).reduce(function(t,e){return r[e]!==void 0&&(t[e]=r[e]),t},{})}function pa(){return document.createElement("div")}function da(r){return["Element","Fragment"].some(function(t){return al(r,t)})}function Xy(r){return al(r,"NodeList")}function Zy(r){return al(r,"MouseEvent")}function Qy(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function Ky(r){return da(r)?[r]:Xy(r)?po(r):Array.isArray(r)?r:po(document.querySelectorAll(r))}function ol(r,t){r.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function Zf(r,t){r.forEach(function(e){e&&e.setAttribute("data-state",t)})}function jy(r){var t,e=fs(r),i=e[0];return i!=null&&(t=i.ownerDocument)!=null&&t.body?i.ownerDocument:document}function Jy(r,t){var e=t.clientX,i=t.clientY;return r.every(function(a){var o=a.popperRect,l=a.popperState,c=a.props,f=c.interactiveBorder,d=Yy(l.placement),g=l.modifiersData.offset;if(!g)return!0;var E=d==="bottom"?g.top.y:0,_=d==="top"?g.bottom.y:0,C=d==="right"?g.left.x:0,R=d==="left"?g.right.x:0,L=o.top-i+E>f,N=i-o.bottom-_>f,I=o.left-e+C>f,W=e-o.right-R>f;return L||N||I||W})}function ul(r,t,e){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(a){r[i](a,e)})}function Qf(r,t){for(var e=t;e;){var i;if(r.contains(e))return!0;e=e.getRootNode==null||(i=e.getRootNode())==null?void 0:i.host}return!1}var ii={isTouch:!1},Kf=0;function tm(){ii.isTouch||(ii.isTouch=!0,window.performance&&document.addEventListener("mousemove",jf))}function jf(){var r=performance.now();r-Kf<20&&(ii.isTouch=!1,document.removeEventListener("mousemove",jf)),Kf=r}function em(){var r=document.activeElement;if(Qy(r)){var t=r._tippy;r.blur&&!t.state.isVisible&&r.blur()}}function rm(){document.addEventListener("touchstart",tm,Sn),window.addEventListener("blur",em)}var im=typeof window<"u"&&typeof document<"u",nm=im?!!window.msCrypto:!1;function ps(r){var t=r==="destroy"?"n already-":" ";return[r+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Jf(r){var t=/[ \t]{2,}/g,e=/^[ \t]*/gm;return r.replace(t," ").replace(e,"").trim()}function sm(r){return Jf(`
|
|
83
|
+
`;return function(){var Y=new Error("get-stack-trace"),j=Y&&Y.stack?Y.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Et=t.console&&(t.console.warn||t.console.log);return Et&&Et.call(t.console,M,j),y.apply(this,arguments)}}var L;typeof Object.assign!="function"?L=function(x){if(x===a||x===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(x),M=1;M<arguments.length;M++){var Y=arguments[M];if(Y!==a&&Y!==null)for(var j in Y)Y.hasOwnProperty(j)&&(w[j]=Y[j])}return w}:L=Object.assign;var N=R(function(x,w,M){for(var Y=Object.keys(w),j=0;j<Y.length;)(!M||M&&x[Y[j]]===a)&&(x[Y[j]]=w[Y[j]]),j++;return x},"extend","Use `assign`."),I=R(function(x,w){return N(x,w,!0)},"merge","Use `assign`.");function W(y,x,w){var M=x.prototype,Y;Y=y.prototype=Object.create(M),Y.constructor=y,Y._super=M,w&&L(Y,w)}function G(y,x){return function(){return y.apply(x,arguments)}}function b(y,x){return typeof y==c?y.apply(x&&x[0]||a,x):y}function F(y,x){return y===a?x:y}function q(y,x,w){C(rt(x),function(M){y.addEventListener(M,w,!1)})}function K(y,x,w){C(rt(x),function(M){y.removeEventListener(M,w,!1)})}function tt(y,x){for(;y;){if(y==x)return!0;y=y.parentNode}return!1}function Z(y,x){return y.indexOf(x)>-1}function rt(y){return y.trim().split(/\s+/g)}function J(y,x,w){if(y.indexOf&&!w)return y.indexOf(x);for(var M=0;M<y.length;){if(w&&y[M][w]==x||!w&&y[M]===x)return M;M++}return-1}function st(y){return Array.prototype.slice.call(y,0)}function ct(y,x,w){for(var M=[],Y=[],j=0;j<y.length;){var Et=y[j][x];J(Y,Et)<0&&M.push(y[j]),Y[j]=Et,j++}return M=M.sort(function(ce,Ee){return ce[x]>Ee[x]}),M}function ft(y,x){for(var w,M,Y=x[0].toUpperCase()+x.slice(1),j=0;j<o.length;){if(w=o[j],M=w?w+Y:x,M in y)return M;j++}return a}var pt=1;function O(){return pt++}function vt(y){var x=y.ownerDocument||y;return x.defaultView||x.parentWindow||t}var Bt=/mobile|tablet|ip(ad|hone|od)|android/i,Re="ontouchstart"in t,be=ft(t,"PointerEvent")!==a,ue=Re&&Bt.test(navigator.userAgent),ve="touch",Vr="pen",Pe="mouse",le="kinect",Oe=25,Gt=1,Zt=2,Ot=4,Vt=8,Le=1,Fe=2,Ze=4,Jt=8,Ne=16,xe=Fe|Ze,Qt=Jt|Ne,oi=xe|Qt,Si=["x","y"],he=["clientX","clientY"];function Lt(y,x){var w=this;this.manager=y,this.callback=x,this.element=y.element,this.target=y.options.inputTarget,this.domHandler=function(M){b(y.options.enable,[y])&&w.handler(M)},this.init()}Lt.prototype={handler:function(){},init:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(vt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(vt(this.element),this.evWin,this.domHandler)}};function or(y){var x,w=y.options.inputClass;return w?x=w:be?x=lr:ue?x=ln:Re?x=wa:x=xt,new x(y,Qe)}function Qe(y,x,w){var M=w.pointers.length,Y=w.changedPointers.length,j=x&Gt&&M-Y===0,Et=x&(Ot|Vt)&&M-Y===0;w.isFirst=!!j,w.isFinal=!!Et,j&&(y.session={}),w.eventType=x,Oi(y,w),y.emit("hammer.input",w),y.recognize(w),y.session.prevInput=w}function Oi(y,x){var w=y.session,M=x.pointers,Y=M.length;w.firstInput||(w.firstInput=ur(x)),Y>1&&!w.firstMultiple?w.firstMultiple=ur(x):Y===1&&(w.firstMultiple=!1);var j=w.firstInput,Et=w.firstMultiple,re=Et?Et.center:j.center,ce=x.center=Ke(M);x.timeStamp=g(),x.deltaTime=x.timeStamp-j.timeStamp,x.angle=Li(re,ce),x.distance=ui(re,ce),Ar(w,x),x.offsetDirection=sn(x.deltaX,x.deltaY);var Ee=nn(x.deltaTime,x.deltaX,x.deltaY);x.overallVelocityX=Ee.x,x.overallVelocityY=Ee.y,x.overallVelocity=d(Ee.x)>d(Ee.y)?Ee.x:Ee.y,x.scale=Et?k(Et.pointers,M):1,x.rotation=Et?Mn(Et.pointers,M):0,x.maxPointers=w.prevInput?x.pointers.length>w.prevInput.maxPointers?x.pointers.length:w.prevInput.maxPointers:x.pointers.length,rn(w,x);var Tr=y.element;tt(x.srcEvent.target,Tr)&&(Tr=x.srcEvent.target),x.target=Tr}function Ar(y,x){var w=x.center,M=y.offsetDelta||{},Y=y.prevDelta||{},j=y.prevInput||{};(x.eventType===Gt||j.eventType===Ot)&&(Y=y.prevDelta={x:j.deltaX||0,y:j.deltaY||0},M=y.offsetDelta={x:w.x,y:w.y}),x.deltaX=Y.x+(w.x-M.x),x.deltaY=Y.y+(w.y-M.y)}function rn(y,x){var w=y.lastInterval||x,M=x.timeStamp-w.timeStamp,Y,j,Et,re;if(x.eventType!=Vt&&(M>Oe||w.velocity===a)){var ce=x.deltaX-w.deltaX,Ee=x.deltaY-w.deltaY,Tr=nn(M,ce,Ee);j=Tr.x,Et=Tr.y,Y=d(Tr.x)>d(Tr.y)?Tr.x:Tr.y,re=sn(ce,Ee),y.lastInterval=x}else Y=w.velocity,j=w.velocityX,Et=w.velocityY,re=w.direction;x.velocity=Y,x.velocityX=j,x.velocityY=Et,x.direction=re}function ur(y){for(var x=[],w=0;w<y.pointers.length;)x[w]={clientX:f(y.pointers[w].clientX),clientY:f(y.pointers[w].clientY)},w++;return{timeStamp:g(),pointers:x,center:Ke(x),deltaX:y.deltaX,deltaY:y.deltaY}}function Ke(y){var x=y.length;if(x===1)return{x:f(y[0].clientX),y:f(y[0].clientY)};for(var w=0,M=0,Y=0;Y<x;)w+=y[Y].clientX,M+=y[Y].clientY,Y++;return{x:f(w/x),y:f(M/x)}}function nn(y,x,w){return{x:x/y||0,y:w/y||0}}function sn(y,x){return y===x?Le:d(y)>=d(x)?y<0?Fe:Ze:x<0?Jt:Ne}function ui(y,x,w){w||(w=Si);var M=x[w[0]]-y[w[0]],Y=x[w[1]]-y[w[1]];return Math.sqrt(M*M+Y*Y)}function Li(y,x,w){w||(w=Si);var M=x[w[0]]-y[w[0]],Y=x[w[1]]-y[w[1]];return Math.atan2(Y,M)*180/Math.PI}function Mn(y,x){return Li(x[1],x[0],he)+Li(y[1],y[0],he)}function k(y,x){return ui(x[0],x[1],he)/ui(y[0],y[1],he)}var it={mousedown:Gt,mousemove:Zt,mouseup:Ot},at="mousedown",Ct="mousemove mouseup";function xt(){this.evEl=at,this.evWin=Ct,this.pressed=!1,Lt.apply(this,arguments)}W(xt,Lt,{handler:function(x){var w=it[x.type];w&Gt&&x.button===0&&(this.pressed=!0),w&Zt&&x.which!==1&&(w=Ot),this.pressed&&(w&Ot&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[x],changedPointers:[x],pointerType:Pe,srcEvent:x}))}});var pe={pointerdown:Gt,pointermove:Zt,pointerup:Ot,pointercancel:Vt,pointerout:Vt},Me={2:ve,3:Vr,4:Pe,5:le},wr="pointerdown",an="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(wr="MSPointerDown",an="MSPointerMove MSPointerUp MSPointerCancel");function lr(){this.evEl=wr,this.evWin=an,Lt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}W(lr,Lt,{handler:function(x){var w=this.store,M=!1,Y=x.type.toLowerCase().replace("ms",""),j=pe[Y],Et=Me[x.pointerType]||x.pointerType,re=Et==ve,ce=J(w,x.pointerId,"pointerId");j&Gt&&(x.button===0||re)?ce<0&&(w.push(x),ce=w.length-1):j&(Ot|Vt)&&(M=!0),!(ce<0)&&(w[ce]=x,this.callback(this.manager,j,{pointers:w,changedPointers:[x],pointerType:Et,srcEvent:x}),M&&w.splice(ce,1))}});var Bn={touchstart:Gt,touchmove:Zt,touchend:Ot,touchcancel:Vt},on="touchstart",li="touchstart touchmove touchend touchcancel";function In(){this.evTarget=on,this.evWin=li,this.started=!1,Lt.apply(this,arguments)}W(In,Lt,{handler:function(x){var w=Bn[x.type];if(w===Gt&&(this.started=!0),!!this.started){var M=Rn.call(this,x,w);w&(Ot|Vt)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:M[0],changedPointers:M[1],pointerType:ve,srcEvent:x})}}});function Rn(y,x){var w=st(y.touches),M=st(y.changedTouches);return x&(Ot|Vt)&&(w=ct(w.concat(M),"identifier")),[w,M]}var un={touchstart:Gt,touchmove:Zt,touchend:Ot,touchcancel:Vt},Al="touchstart touchmove touchend touchcancel";function ln(){this.evTarget=Al,this.targetIds={},Lt.apply(this,arguments)}W(ln,Lt,{handler:function(x){var w=un[x.type],M=wl.call(this,x,w);M&&this.callback(this.manager,w,{pointers:M[0],changedPointers:M[1],pointerType:ve,srcEvent:x})}});function wl(y,x){var w=st(y.touches),M=this.targetIds;if(x&(Gt|Zt)&&w.length===1)return M[w[0].identifier]=!0,[w,w];var Y,j,Et=st(y.changedTouches),re=[],ce=this.target;if(j=w.filter(function(Ee){return tt(Ee.target,ce)}),x===Gt)for(Y=0;Y<j.length;)M[j[Y].identifier]=!0,Y++;for(Y=0;Y<Et.length;)M[Et[Y].identifier]&&re.push(Et[Y]),x&(Ot|Vt)&&delete M[Et[Y].identifier],Y++;if(re.length)return[ct(j.concat(re),"identifier"),re]}var Aa=2500,wo=25;function wa(){Lt.apply(this,arguments);var y=G(this.handler,this);this.touch=new ln(this.manager,y),this.mouse=new xt(this.manager,y),this.primaryTouch=null,this.lastTouches=[]}W(wa,Lt,{handler:function(x,w,M){var Y=M.pointerType==ve,j=M.pointerType==Pe;if(!(j&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(Y)bl.call(this,w,M);else if(j&&Tl.call(this,M))return;this.callback(x,w,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function bl(y,x){y&Gt?(this.primaryTouch=x.changedPointers[0].identifier,bo.call(this,x)):y&(Ot|Vt)&&bo.call(this,x)}function bo(y){var x=y.changedPointers[0];if(x.identifier===this.primaryTouch){var w={x:x.clientX,y:x.clientY};this.lastTouches.push(w);var M=this.lastTouches,Y=function(){var j=M.indexOf(w);j>-1&&M.splice(j,1)};setTimeout(Y,Aa)}}function Tl(y){for(var x=y.srcEvent.clientX,w=y.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var Y=this.lastTouches[M],j=Math.abs(x-Y.x),Et=Math.abs(w-Y.y);if(j<=wo&&Et<=wo)return!0}return!1}var To=ft(l.style,"touchAction"),_o=To!==a,Co="compute",ba="auto",Ta="manipulation",Ni="none",Pn="pan-x",Fn="pan-y",ms=_l();function _a(y,x){this.manager=y,this.set(x)}_a.prototype={set:function(y){y==Co&&(y=this.compute()),_o&&this.manager.element.style&&ms[y]&&(this.manager.element.style[To]=y),this.actions=y.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var y=[];return C(this.manager.recognizers,function(x){b(x.options.enable,[x])&&(y=y.concat(x.getTouchAction()))}),vs(y.join(" "))},preventDefaults:function(y){var x=y.srcEvent,w=y.offsetDirection;if(this.manager.session.prevented){x.preventDefault();return}var M=this.actions,Y=Z(M,Ni)&&!ms[Ni],j=Z(M,Fn)&&!ms[Fn],Et=Z(M,Pn)&&!ms[Pn];if(Y){var re=y.pointers.length===1,ce=y.distance<2,Ee=y.deltaTime<250;if(re&&ce&&Ee)return}if(!(Et&&j)&&(Y||j&&w&xe||Et&&w&Qt))return this.preventSrc(x)},preventSrc:function(y){this.manager.session.prevented=!0,y.preventDefault()}};function vs(y){if(Z(y,Ni))return Ni;var x=Z(y,Pn),w=Z(y,Fn);return x&&w?Ni:x||w?x?Pn:Fn:Z(y,Ta)?Ta:ba}function _l(){if(!_o)return!1;var y={},x=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){y[w]=x?t.CSS.supports("touch-action",w):!0}),y}var Mi=1,je=2,hn=4,hi=8,br=hi,cn=16,hr=32;function zr(y){this.options=L({},this.defaults,y||{}),this.id=O(),this.manager=null,this.options.enable=F(this.options.enable,!0),this.state=Mi,this.simultaneous={},this.requireFail=[]}zr.prototype={defaults:{},set:function(y){return L(this.options,y),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(y){if(_(y,"recognizeWith",this))return this;var x=this.simultaneous;return y=xs(y,this),x[y.id]||(x[y.id]=y,y.recognizeWith(this)),this},dropRecognizeWith:function(y){return _(y,"dropRecognizeWith",this)?this:(y=xs(y,this),delete this.simultaneous[y.id],this)},requireFailure:function(y){if(_(y,"requireFailure",this))return this;var x=this.requireFail;return y=xs(y,this),J(x,y)===-1&&(x.push(y),y.requireFailure(this)),this},dropRequireFailure:function(y){if(_(y,"dropRequireFailure",this))return this;y=xs(y,this);var x=J(this.requireFail,y);return x>-1&&this.requireFail.splice(x,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(y){return!!this.simultaneous[y.id]},emit:function(y){var x=this,w=this.state;function M(Y){x.manager.emit(Y,y)}w<hi&&M(x.options.event+Do(w)),M(x.options.event),y.additionalEvent&&M(y.additionalEvent),w>=hi&&M(x.options.event+Do(w))},tryEmit:function(y){if(this.canEmit())return this.emit(y);this.state=hr},canEmit:function(){for(var y=0;y<this.requireFail.length;){if(!(this.requireFail[y].state&(hr|Mi)))return!1;y++}return!0},recognize:function(y){var x=L({},y);if(!b(this.options.enable,[this,x])){this.reset(),this.state=hr;return}this.state&(br|cn|hr)&&(this.state=Mi),this.state=this.process(x),this.state&(je|hn|hi|cn)&&this.tryEmit(x)},process:function(y){},getTouchAction:function(){},reset:function(){}};function Do(y){return y&cn?"cancel":y&hi?"end":y&hn?"move":y&je?"start":""}function So(y){return y==Ne?"down":y==Jt?"up":y==Fe?"left":y==Ze?"right":""}function xs(y,x){var w=x.manager;return w?w.get(y):y}function Je(){zr.apply(this,arguments)}W(Je,zr,{defaults:{pointers:1},attrTest:function(y){var x=this.options.pointers;return x===0||y.pointers.length===x},process:function(y){var x=this.state,w=y.eventType,M=x&(je|hn),Y=this.attrTest(y);return M&&(w&Vt||!Y)?x|cn:M||Y?w&Ot?x|hi:x&je?x|hn:je:hr}});function kn(){Je.apply(this,arguments),this.pX=null,this.pY=null}W(kn,Je,{defaults:{event:"pan",threshold:10,pointers:1,direction:oi},getTouchAction:function(){var y=this.options.direction,x=[];return y&xe&&x.push(Fn),y&Qt&&x.push(Pn),x},directionTest:function(y){var x=this.options,w=!0,M=y.distance,Y=y.direction,j=y.deltaX,Et=y.deltaY;return Y&x.direction||(x.direction&xe?(Y=j===0?Le:j<0?Fe:Ze,w=j!=this.pX,M=Math.abs(y.deltaX)):(Y=Et===0?Le:Et<0?Jt:Ne,w=Et!=this.pY,M=Math.abs(y.deltaY))),y.direction=Y,w&&M>x.threshold&&Y&x.direction},attrTest:function(y){return Je.prototype.attrTest.call(this,y)&&(this.state&je||!(this.state&je)&&this.directionTest(y))},emit:function(y){this.pX=y.deltaX,this.pY=y.deltaY;var x=So(y.direction);x&&(y.additionalEvent=this.options.event+x),this._super.emit.call(this,y)}});function Es(){Je.apply(this,arguments)}W(Es,Je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ni]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.scale-1)>this.options.threshold||this.state&je)},emit:function(y){if(y.scale!==1){var x=y.scale<1?"in":"out";y.additionalEvent=this.options.event+x}this._super.emit.call(this,y)}});function Hn(){zr.apply(this,arguments),this._timer=null,this._input=null}W(Hn,zr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ba]},process:function(y){var x=this.options,w=y.pointers.length===x.pointers,M=y.distance<x.threshold,Y=y.deltaTime>x.time;if(this._input=y,!M||!w||y.eventType&(Ot|Vt)&&!Y)this.reset();else if(y.eventType&Gt)this.reset(),this._timer=E(function(){this.state=br,this.tryEmit()},x.time,this);else if(y.eventType&Ot)return br;return hr},reset:function(){clearTimeout(this._timer)},emit:function(y){this.state===br&&(y&&y.eventType&Ot?this.manager.emit(this.options.event+"up",y):(this._input.timeStamp=g(),this.manager.emit(this.options.event,this._input)))}});function Ca(){Je.apply(this,arguments)}W(Ca,Je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ni]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.rotation)>this.options.threshold||this.state&je)}});function As(){Je.apply(this,arguments)}W(As,Je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Qt,pointers:1},getTouchAction:function(){return kn.prototype.getTouchAction.call(this)},attrTest:function(y){var x=this.options.direction,w;return x&(xe|Qt)?w=y.overallVelocity:x&xe?w=y.overallVelocityX:x&Qt&&(w=y.overallVelocityY),this._super.attrTest.call(this,y)&&x&y.offsetDirection&&y.distance>this.options.threshold&&y.maxPointers==this.options.pointers&&d(w)>this.options.velocity&&y.eventType&Ot},emit:function(y){var x=So(y.offsetDirection);x&&this.manager.emit(this.options.event+x,y),this.manager.emit(this.options.event,y)}});function Bi(){zr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}W(Bi,zr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ta]},process:function(y){var x=this.options,w=y.pointers.length===x.pointers,M=y.distance<x.threshold,Y=y.deltaTime<x.time;if(this.reset(),y.eventType&Gt&&this.count===0)return this.failTimeout();if(M&&Y&&w){if(y.eventType!=Ot)return this.failTimeout();var j=this.pTime?y.timeStamp-this.pTime<x.interval:!0,Et=!this.pCenter||ui(this.pCenter,y.center)<x.posThreshold;this.pTime=y.timeStamp,this.pCenter=y.center,!Et||!j?this.count=1:this.count+=1,this._input=y;var re=this.count%x.taps;if(re===0)return this.hasRequireFailures()?(this._timer=E(function(){this.state=br,this.tryEmit()},x.interval,this),je):br}return hr},failTimeout:function(){return this._timer=E(function(){this.state=hr},this.options.interval,this),hr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==br&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function $r(y,x){return x=x||{},x.recognizers=F(x.recognizers,$r.defaults.preset),new ws(y,x)}$r.VERSION="2.0.7",$r.defaults={domEvents:!1,touchAction:Co,enable:!0,inputTarget:null,inputClass:null,preset:[[Ca,{enable:!1}],[Es,{enable:!1},["rotate"]],[As,{direction:xe}],[kn,{direction:xe},["swipe"]],[Bi],[Bi,{event:"doubletap",taps:2},["tap"]],[Hn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Cl=1,Da=2;function ws(y,x){this.options=L({},$r.defaults,x||{}),this.options.inputTarget=this.options.inputTarget||y,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=y,this.input=or(this),this.touchAction=new _a(this,this.options.touchAction),bs(this,!0),C(this.options.recognizers,function(w){var M=this.add(new w[0](w[1]));w[2]&&M.recognizeWith(w[2]),w[3]&&M.requireFailure(w[3])},this)}ws.prototype={set:function(y){return L(this.options,y),y.touchAction&&this.touchAction.update(),y.inputTarget&&(this.input.destroy(),this.input.target=y.inputTarget,this.input.init()),this},stop:function(y){this.session.stopped=y?Da:Cl},recognize:function(y){var x=this.session;if(!x.stopped){this.touchAction.preventDefaults(y);var w,M=this.recognizers,Y=x.curRecognizer;(!Y||Y&&Y.state&br)&&(Y=x.curRecognizer=null);for(var j=0;j<M.length;)w=M[j],x.stopped!==Da&&(!Y||w==Y||w.canRecognizeWith(Y))?w.recognize(y):w.reset(),!Y&&w.state&(je|hn|hi)&&(Y=x.curRecognizer=w),j++}},get:function(y){if(y instanceof zr)return y;for(var x=this.recognizers,w=0;w<x.length;w++)if(x[w].options.event==y)return x[w];return null},add:function(y){if(_(y,"add",this))return this;var x=this.get(y.options.event);return x&&this.remove(x),this.recognizers.push(y),y.manager=this,this.touchAction.update(),y},remove:function(y){if(_(y,"remove",this))return this;if(y=this.get(y),y){var x=this.recognizers,w=J(x,y);w!==-1&&(x.splice(w,1),this.touchAction.update())}return this},on:function(y,x){if(y!==a&&x!==a){var w=this.handlers;return C(rt(y),function(M){w[M]=w[M]||[],w[M].push(x)}),this}},off:function(y,x){if(y!==a){var w=this.handlers;return C(rt(y),function(M){x?w[M]&&w[M].splice(J(w[M],x),1):delete w[M]}),this}},emit:function(y,x){this.options.domEvents&&Dl(y,x);var w=this.handlers[y]&&this.handlers[y].slice();if(!(!w||!w.length)){x.type=y,x.preventDefault=function(){x.srcEvent.preventDefault()};for(var M=0;M<w.length;)w[M](x),M++}},destroy:function(){this.element&&bs(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function bs(y,x){var w=y.element;if(w.style){var M;C(y.options.cssProps,function(Y,j){M=ft(w.style,j),x?(y.oldCssProps[M]=w.style[M],w.style[M]=Y):w.style[M]=y.oldCssProps[M]||""}),x||(y.oldCssProps={})}}function Dl(y,x){var w=e.createEvent("Event");w.initEvent(y,!0,!0),w.gesture=x,x.target.dispatchEvent(w)}L($r,{INPUT_START:Gt,INPUT_MOVE:Zt,INPUT_END:Ot,INPUT_CANCEL:Vt,STATE_POSSIBLE:Mi,STATE_BEGAN:je,STATE_CHANGED:hn,STATE_ENDED:hi,STATE_RECOGNIZED:br,STATE_CANCELLED:cn,STATE_FAILED:hr,DIRECTION_NONE:Le,DIRECTION_LEFT:Fe,DIRECTION_RIGHT:Ze,DIRECTION_UP:Jt,DIRECTION_DOWN:Ne,DIRECTION_HORIZONTAL:xe,DIRECTION_VERTICAL:Qt,DIRECTION_ALL:oi,Manager:ws,Input:Lt,TouchAction:_a,TouchInput:ln,MouseInput:xt,PointerEventInput:lr,TouchMouseInput:wa,SingleTouchInput:In,Recognizer:zr,AttrRecognizer:Je,Tap:Bi,Pan:kn,Swipe:As,Pinch:Es,Rotate:Ca,Press:Hn,on:q,off:K,each:C,merge:I,extend:N,assign:L,inherit:W,bindFn:G,prefixed:ft});var Oo=typeof t<"u"?t:typeof self<"u"?self:{};Oo.Hammer=$r,r.exports?r.exports=$r:t[i]=$r})(window,document,"Hammer")})(yf);var I2=yf.exports;const Qi=Fh(I2),mf=new P,qr=new P;class vf extends Ge{name="orbit-controller.ts";isSvg=!1;dom;domOffset=new P;camera;hammer;enabled=!0;enablePan=!0;enableRotate=!0;rotateSpeed=1;enableZoom=!0;minZoom=0;maxZoom=1/0;zoomSpeed=1;zoomChanged=!1;distanceStart=1;distanceEnd=1;state=-1;EPS=1e-6;focus=new P;target=new P;scaled=1;rotateTheta=0;enableDamping=!1;dampingFactor=.05;mouseButtons={LEFT:2,MIDDLE:1,RIGHT:0};isWheeling=!1;finalTimer;rotateStart=new P;rotateEnd=new P;rotateDelta=new P;panStart=new P;panEnd=new P;panOffset=new P;dollyStart=0;dollyOffset=new P;contextMenuHandler=this.handleContextMenu.bind(this);wheelHandler=this.handleWheel.bind(this);pointerDownHandler=this.handlePointerDown.bind(this);pointerUpHandler=this.handlePointerUp.bind(this);pointerMoveHandler=this.handlePointerMove.bind(this);pointerOverHandler=Nt.debounce(this.handlePointerOver.bind(this),100);pointerLeaveHandler=this.handlePointerLeave.bind(this);tapHandler=this.handleTap.bind(this);panHandler=this.handlePan.bind(this);pinchHandler=this.handlePinch.bind(this);pressHandler=this.handlePress.bind(this);swipeHandler=this.handleSwipe.bind(this);hammerInputHandler=this.handleHammerInput.bind(this);constructor(t,e,i=!1){super(),this.isSvg=i,this.dom=t,this.camera=e,this.scaled=e.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,mf.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(mf)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.hammer=new Qi.Manager(this.dom,{domEvents:!0});const t=new Qi.Pan({threshold:0,pointers:0}),e=new Qi.Pinch({threshold:0}),i=new Qi.Tap({event:"singletap",taps:1}),a=new Qi.Press({});this.hammer.add([t,i,a,e]),e.recognizeWith(t),this.hammer.on(["panstart","panmove","panend"].join(" "),this.panHandler),this.hammer.on(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),this.hammer.on("singletap",this.tapHandler),this.hammer.on("press",this.pressHandler),this.hammer.on("swipe",this.swipeHandler),this.hammer.on("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.addEventListener("pointerdown",this.pointerDownHandler),this.dom.addEventListener("pointerleave",this.pointerLeaveHandler))}unbindEvents(){var t,e,i,a,o,l,c,f;(t=this.hammer)==null||t.off(["panstart","panmove","panend"].join(" "),this.panHandler),(e=this.hammer)==null||e.off(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),(i=this.hammer)==null||i.off("singletap",this.tapHandler),(a=this.hammer)==null||a.off("press",this.pressHandler),(o=this.hammer)==null||o.off("swipe",this.swipeHandler),(l=this.hammer)==null||l.off("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.removeEventListener("pointerdown",this.pointerDownHandler),this.dom.removeEventListener("pointerleave",this.pointerLeaveHandler)),(c=this.hammer)==null||c.stop(!0),(f=this.hammer)==null||f.destroy()}setFocus(t,e){this.focus.set(t,e).sub(this.domOffset).unproject(this.camera)}handleTap(t){typeof t.preventDefault=="function"&&t.preventDefault(),qr.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"tap",data:{screenCoords:{x:qr.x,y:qr.y}},e:t})}handleDoubleTap(t){typeof t.preventDefault=="function"&&t.preventDefault(),console.log("【orbitController】DoubleTap: ",t),qr.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"doubletap",data:{screenCoords:{x:qr.x,y:qr.y}}})}handlePress(t){typeof t.preventDefault=="function"&&t.preventDefault(),console.log("【orbitController】Press: ",t)}handlePan(t){var i;if(this.scaled=this.camera.scaled.x,((i=t.pointers)==null?void 0:i.length)!==1)return;typeof t.preventDefault=="function"&&t.preventDefault();const e={type:"panmove",data:{}};(t.isFirst||t.type==="panstart")&&(this.state=2,this.panStart.set(t.center.x,t.center.y),e.type="panstart"),(t.isFinal||t.type==="panend")&&(this.state=-1,e.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),qr.set(t.center.x,t.center.y).sub(this.domOffset),e.data.screenCoords=qr.clone(),this.dispatchEvent(e),this.enablePan&&this.update()}handlePinch(t){typeof t.preventDefault=="function"&&t.preventDefault(),t.type==="pinchstart"&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||t.type==="pinchend")&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let e=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-e).sub(this.camera.position),this.update()}handleRotate(t){typeof t.preventDefault=="function"&&t.preventDefault()}handleSwipe(t){typeof t.preventDefault=="function"&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&typeof t.preventDefault=="function"&&t.preventDefault()}handleWheel(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),!this.enabled||!this.enableZoom||this.state!==-1)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.stopPropagation=="function"&&t.stopPropagation();let e=t.deltaY;(t==null?void 0:t.deltaMode)===1?e*=16:(t==null?void 0:t.deltaMode)===2&&(e*=100),t!=null&&t.ctrlKey&&(e*=10),this.setFocus(t.clientX,t.clientY);let i=this.getZoomScale(e);e<0?this.onDollyIn(i):e>0?this.onDollyOut(i):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout(()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)},500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(t*.03))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled||t.button!==2)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let e=-1;t.button===0?e=this.mouseButtons.LEFT:t.button===1?e=this.mouseButtons.MIDDLE:t.button===2&&(e=this.mouseButtons.RIGHT),e===0&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&this.state===0){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){t.buttons>0||(qr.set(t.clientX,t.clientY).sub(this.domOffset),this.dispatchEvent({type:"pointerover",data:{screenCoords:{x:qr.x,y:qr.y}},e:t}))}onRotate(t,e){this.rotateEnd.set(t,e),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const i=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=i,this.rotateStart.copy(this.rotateEnd),this.update()}}var ot=(r=>(r.CONTEXTMENU="contextmenu",r.LOSTPOINTERCAPTURE="lostpointercapture",r.MOUSEOVER="mouseover",r.MOUSEOUT="mouseout",r.MOUSELEAVE="mouseleave",r.MOUSEENTER="mouseenter",r.MOUSEMOVE="mousemove",r.MOUSEDOWN="mousedown",r.MOUSEUP="mouseup",r.POINTERMOVE="pointermove",r.POINTERDOWN="pointerdown",r.POINTERUP="pointerup",r.POINTERCANCEL="pointercancel",r.POINTEROUT="pointerout",r.POINTERLEAVE="pointerleave",r.POINTEROVER="pointerover",r.POINTERENTER="pointerenter",r.TOUCHSTART="touchstart",r.TOUCHEND="touchend",r.TOUCHMOVE="touchmove",r.TOUCHCANCEL="touchcancel",r.WHEEL="wheel",r.WHEEL_START="wheelstart",r.WHEEL_END="wheelend",r.MOUSEWHEEL="mousewheel",r.CLICK="click",r.DBLCLICK="dblclick",r.CONTEXT_LOST="contextlost",r.CONTEXT_RESTORED="contextrestored",r.CONTROLS_CHANGED="controlschanged",r.TAP="tap",r.SINGLE_TAP="singletap",r.DOUBLE_TAP="doubletap",r.PRESS="press",r.PAN="pan",r.PAN_START="panstart",r.PAN_MOVE="panmove",r.PAN_END="panend",r.ROTATE="rotate",r.ROTATE_START="rotatestart",r.ROTATE_MOVE="rotatemove",r.ROTATE_END="rotateend",r.PINCH="pinch",r.PINCH_START="pinchstart",r.PINCH_MOVE="pinchmove",r.PINCH_END="pinchend",r.PINCH_IN="pinchin",r.PINCH_OUT="pinchout",r.SWIPE="swipe",r.CHANGE_START="change_start",r.CHANGE_END="change_end",r.CAMERA_CHANGED="cameraChanged",r))(ot||{});const sa=new P;class xf extends qc{isCamera=!0;type="Camera2";name="Camera2";params;matrixAutoUpdate=!1;matrixWorldAutoUpdate=!1;projectionMatrix=new se;projectionMatrixInverse=new se;viewMatrix=new se;viewMatrixNeedsUpdate=!0;viewArea=0;left=-1;right=1;top=1;bottom=-1;width=2;height=2;aspect=1;view;constructor(t){super(),this.params=t,this.width=(t==null?void 0:t.width)!==void 0?t.width:2,this.height=(t==null?void 0:t.height)!==void 0?t.height:2,this.aspect=(t==null?void 0:t.aspect)!==void 0?t.aspect:1,(t==null?void 0:t.left)!==void 0&&(this.left=t.left),(t==null?void 0:t.right)!==void 0&&(this.right=t.right),(t==null?void 0:t.top)!==void 0&&(this.top=t.top),(t==null?void 0:t.bottom)!==void 0&&(this.bottom=t.bottom);const e=(this.right+this.left)/2,i=(this.top+this.bottom)/2;if(this.aspect>1){const a=Math.round((this.right-this.left)/2/this.aspect);this.top=i+a,this.bottom=i-a}else if(this.aspect<1){const a=Math.round((this.top-this.bottom)/2*this.aspect);this.left=e-a,this.right=e+a}this.flipY=(t==null?void 0:t.flipY)===!0,this.updateProjectionMatrix(),t!=null&&t.eye&&this.position.fromArray(t.eye),t!=null&&t.up&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,e=1,i=1,a=-1){sa.set(t+e,a+i).multiplyScalar(.5);const o=Math.max((e-t)/this.width,(i-a)/this.height);this.setTRS(sa,0,o)}setByBox(t){if(!t||t.isEmpty()){console.error(`setByBox: ${t==null?void 0:t.toString()}`);return}this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},e=0,i=0){this.position.set(t.x||0,t.y||0),this.rotation.set(e,e),this.scaled.set(i,i),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.width=t||2,this.height=e||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/e;const i=(this.right+this.left)/2,a=(this.top+this.bottom)/2;if(this.aspect>1){const o=Math.round((this.right-this.left)/2/this.aspect);this.top=a+o,this.bottom=a-o}else if(this.aspect<1){const o=Math.round((this.top-this.bottom)/2*this.aspect);this.left=i-o,this.right=i+o}this.updateProjectionMatrix(),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[6],-e[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){this.parent===void 0&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return sa.set(this.width,this.height).multiplyScalar(.5).multiplyScalar(this.scaled.x),this.boundingBox.min.subVectors(this.position,sa),this.boundingBox.max.addVectors(this.position,sa),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return new this.constructor.prototype.constructor().copy(this)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var uo=(r=>(r.UPDATE="update",r))(uo||{});class Gu extends Ge{name="SvgSelectRect";container;el;constructor(t){super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.el=document.createElement("div"),this.el.setAttribute("id",as+"SvgSelectRect"),this.el.setAttribute("class",as+"-svg-select-rect"),this.el.style.display="none",this.container.appendChild(this.el)}destroy(){super.destroy(),this.el&&this.el.remove()}draw(t){Ef.copy(t).getSize(Xu),Yu.copy(Ef.min),this.el.style.display="none",this.el.style.position="absolute",this.el.style.left=Yu.x+"px",this.el.style.top=Yu.y+"px",this.el.style.width=Xu.x+"px",this.el.style.height=Xu.y+"px",this.el.style.display="block",this.el.style.background=new Wt($t.darkBlue).setA(.1).getStyle(),this.el.style.border=$t.darkBlue+" 1px dashed"}hide(){this.el.style.display="none"}}const Ef=new _t,Yu=new P,Xu=new P;class R2 extends Ge{name="SvgMultiSelector";controller;scene;container;p1=new P;p2=new P;graph;selectEnable=!1;multiSelectEnable=!1;fnEnable=!1;controllerTapHandler=this.handleControllerTap.bind(this);controllerPanStartHandler=this.handleControllerPanStart.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPanEndHandler=this.handleControllerPanEnd.bind(this);constructor(t,e){super(),this.container=t,this.controller=e,this.graph=new Gu(t),this.bindControllerEvents()}destroy(){this.unbindControllerEvents(),super.destroy()}bindScene(t){this.scene=t}selectEnableChanged(t){var e;(e=this.scene)==null||e.clearSelected(),this.selectEnable=!!t}multiSelectEnableChanged(t){var e;(e=this.scene)==null||e.clearSelected(),this.multiSelectEnable=!!t,this.controller.enablePan=!this.multiSelectEnable||this.multiSelectEnable&&!this.fnEnable}fnEnableChanged(t){this.fnEnable=!!t,this.controller.enablePan=!this.multiSelectEnable||this.multiSelectEnable&&!this.fnEnable}bindControllerEvents(){this.controller.addEventListener(ot.TAP,this.controllerTapHandler),this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.TAP,this.controllerTapHandler),this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler)}handleControllerTap(t){var i,a,o,l,c,f;if((t==null?void 0:t.type)!==ot.TAP||!this.selectEnable&&!this.multiSelectEnable)return;const e=((i=t==null?void 0:t.e)==null?void 0:i.target)||((o=(a=t==null?void 0:t.e)==null?void 0:a.srcEvent)==null?void 0:o.target)||((c=(l=t==null?void 0:t.e)==null?void 0:l.srcEvent)==null?void 0:c.srcElement);e!=null&&e.id&&(f=this.scene)!=null&&f.isBelongsToAssetType(e==null?void 0:e.id)&&this.dispatchEvent({type:"SELECTED",data:{...t.data,target:[e],selected:[e==null?void 0:e.id]}})}handleControllerPanStart(t){(t==null?void 0:t.type)===ot.PAN_START&&this.multiSelectEnable&&(this.controller.enablePan||(this.p1.copy(t.data.screenCoords),Tn.makeEmpty().expandByPoint(this.p1),this.graph.draw(Tn)))}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&this.multiSelectEnable&&(this.controller.enablePan||(this.p2.copy(t.data.screenCoords),Tn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Tn)))}handleControllerPanEnd(t){var a;if((t==null?void 0:t.type)!==ot.PAN_END||!this.multiSelectEnable||this.controller.enablePan)return;this.p2.copy(t.data.screenCoords),Tn.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera);const e=(a=this.scene)==null?void 0:a.getElementsByBox(Tn),i=[];(e||[]).forEach(o=>i.push(o.id)),this.graph.hide(),Tn.makeEmpty(),this.dispatchEvent({type:"SELECTED",data:{target:e,selected:i}})}}var Zu=(r=>(r.SELECTED="SELECTED",r))(Zu||{});const Tn=new _t;var _n=(r=>(r.DEFAULT="default",r.INFO="info",r.PRIMARY="primary",r.SUCCESS="success",r.WARNING="warning",r.DANGER="danger",r))(_n||{});class Af{camera;screenCoords=new P;worldCoords=new P;params={Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}};constructor(){}setFromCamera(t,e){return this.camera=e,this.screenCoords.set(t.x,t.y),this.worldCoords.copy(this.screenCoords).unproject(e),this}intersectObjects(t,e=!0,i=[]){for(let a=0,o=t.length;a<o;a++)this.intersectObject(t[a],e,i)}intersectObject(t,e=!1,i=[]){if(!t.selectable||(t.raycast(this,i),!e||t.composeNode))return i;for(let a=0,o=t.children.length;a<o;a++)this.intersectObject(t.children[a],e,i);return i}}var Ye="top",mr="bottom",vr="right",Xe="left",Qu="auto",aa=[Ye,mr,vr,Xe],us="start",oa="end",P2="clippingParents",wf="viewport",ua="popper",F2="reference",bf=aa.reduce(function(r,t){return r.concat([t+"-"+us,t+"-"+oa])},[]),Tf=[].concat(aa,[Qu]).reduce(function(r,t){return r.concat([t,t+"-"+us,t+"-"+oa])},[]),k2="beforeRead",H2="read",U2="afterRead",q2="beforeMain",W2="main",V2="afterMain",z2="beforeWrite",$2="write",G2="afterWrite",Y2=[k2,H2,U2,q2,W2,V2,z2,$2,G2];function ei(r){return r?(r.nodeName||"").toLowerCase():null}function sr(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var t=r.ownerDocument;return t&&t.defaultView||window}return r}function Cn(r){var t=sr(r).Element;return r instanceof t||r instanceof Element}function xr(r){var t=sr(r).HTMLElement;return r instanceof t||r instanceof HTMLElement}function Ku(r){if(typeof ShadowRoot>"u")return!1;var t=sr(r).ShadowRoot;return r instanceof t||r instanceof ShadowRoot}function X2(r){var t=r.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},a=t.attributes[e]||{},o=t.elements[e];!xr(o)||!ei(o)||(Object.assign(o.style,i),Object.keys(a).forEach(function(l){var c=a[l];c===!1?o.removeAttribute(l):o.setAttribute(l,c===!0?"":c)}))})}function Z2(r){var t=r.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var a=t.elements[i],o=t.attributes[i]||{},l=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),c=l.reduce(function(f,d){return f[d]="",f},{});!xr(a)||!ei(a)||(Object.assign(a.style,c),Object.keys(o).forEach(function(f){a.removeAttribute(f)}))})}}const _f={name:"applyStyles",enabled:!0,phase:"write",fn:X2,effect:Z2,requires:["computeStyles"]};function ri(r){return r.split("-")[0]}var Dn=Math.max,lo=Math.min,ls=Math.round;function ju(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Cf(){return!/^((?!chrome|android).)*safari/i.test(ju())}function hs(r,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=r.getBoundingClientRect(),a=1,o=1;t&&xr(r)&&(a=r.offsetWidth>0&&ls(i.width)/r.offsetWidth||1,o=r.offsetHeight>0&&ls(i.height)/r.offsetHeight||1);var l=Cn(r)?sr(r):window,c=l.visualViewport,f=!Cf()&&e,d=(i.left+(f&&c?c.offsetLeft:0))/a,g=(i.top+(f&&c?c.offsetTop:0))/o,E=i.width/a,_=i.height/o;return{width:E,height:_,top:g,right:d+E,bottom:g+_,left:d,x:d,y:g}}function Ju(r){var t=hs(r),e=r.offsetWidth,i=r.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:r.offsetLeft,y:r.offsetTop,width:e,height:i}}function Df(r,t){var e=t.getRootNode&&t.getRootNode();if(r.contains(t))return!0;if(e&&Ku(e)){var i=t;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ti(r){return sr(r).getComputedStyle(r)}function Q2(r){return["table","td","th"].indexOf(ei(r))>=0}function Ki(r){return((Cn(r)?r.ownerDocument:r.document)||window.document).documentElement}function ho(r){return ei(r)==="html"?r:r.assignedSlot||r.parentNode||(Ku(r)?r.host:null)||Ki(r)}function Sf(r){return!xr(r)||Ti(r).position==="fixed"?null:r.offsetParent}function K2(r){var t=/firefox/i.test(ju()),e=/Trident/i.test(ju());if(e&&xr(r)){var i=Ti(r);if(i.position==="fixed")return null}var a=ho(r);for(Ku(a)&&(a=a.host);xr(a)&&["html","body"].indexOf(ei(a))<0;){var o=Ti(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function la(r){for(var t=sr(r),e=Sf(r);e&&Q2(e)&&Ti(e).position==="static";)e=Sf(e);return e&&(ei(e)==="html"||ei(e)==="body"&&Ti(e).position==="static")?t:e||K2(r)||t}function tl(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function ha(r,t,e){return Dn(r,lo(t,e))}function j2(r,t,e){var i=ha(r,t,e);return i>e?e:i}function Of(){return{top:0,right:0,bottom:0,left:0}}function Lf(r){return Object.assign({},Of(),r)}function Nf(r,t){return t.reduce(function(e,i){return e[i]=r,e},{})}var J2=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Lf(typeof t!="number"?t:Nf(t,aa))};function ty(r){var t,e=r.state,i=r.name,a=r.options,o=e.elements.arrow,l=e.modifiersData.popperOffsets,c=ri(e.placement),f=tl(c),d=[Xe,vr].indexOf(c)>=0,g=d?"height":"width";if(!(!o||!l)){var E=J2(a.padding,e),_=Ju(o),C=f==="y"?Ye:Xe,R=f==="y"?mr:vr,L=e.rects.reference[g]+e.rects.reference[f]-l[f]-e.rects.popper[g],N=l[f]-e.rects.reference[f],I=la(o),W=I?f==="y"?I.clientHeight||0:I.clientWidth||0:0,G=L/2-N/2,b=E[C],F=W-_[g]-E[R],q=W/2-_[g]/2+G,K=ha(b,q,F),tt=f;e.modifiersData[i]=(t={},t[tt]=K,t.centerOffset=K-q,t)}}function ey(r){var t=r.state,e=r.options,i=e.element,a=i===void 0?"[data-popper-arrow]":i;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||Df(t.elements.popper,a)&&(t.elements.arrow=a))}const ry={name:"arrow",enabled:!0,phase:"main",fn:ty,effect:ey,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cs(r){return r.split("-")[1]}var iy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ny(r,t){var e=r.x,i=r.y,a=t.devicePixelRatio||1;return{x:ls(e*a)/a||0,y:ls(i*a)/a||0}}function Mf(r){var t,e=r.popper,i=r.popperRect,a=r.placement,o=r.variation,l=r.offsets,c=r.position,f=r.gpuAcceleration,d=r.adaptive,g=r.roundOffsets,E=r.isFixed,_=l.x,C=_===void 0?0:_,R=l.y,L=R===void 0?0:R,N=typeof g=="function"?g({x:C,y:L}):{x:C,y:L};C=N.x,L=N.y;var I=l.hasOwnProperty("x"),W=l.hasOwnProperty("y"),G=Xe,b=Ye,F=window;if(d){var q=la(e),K="clientHeight",tt="clientWidth";if(q===sr(e)&&(q=Ki(e),Ti(q).position!=="static"&&c==="absolute"&&(K="scrollHeight",tt="scrollWidth")),q=q,a===Ye||(a===Xe||a===vr)&&o===oa){b=mr;var Z=E&&q===F&&F.visualViewport?F.visualViewport.height:q[K];L-=Z-i.height,L*=f?1:-1}if(a===Xe||(a===Ye||a===mr)&&o===oa){G=vr;var rt=E&&q===F&&F.visualViewport?F.visualViewport.width:q[tt];C-=rt-i.width,C*=f?1:-1}}var J=Object.assign({position:c},d&&iy),st=g===!0?ny({x:C,y:L},sr(e)):{x:C,y:L};if(C=st.x,L=st.y,f){var ct;return Object.assign({},J,(ct={},ct[b]=W?"0":"",ct[G]=I?"0":"",ct.transform=(F.devicePixelRatio||1)<=1?"translate("+C+"px, "+L+"px)":"translate3d("+C+"px, "+L+"px, 0)",ct))}return Object.assign({},J,(t={},t[b]=W?L+"px":"",t[G]=I?C+"px":"",t.transform="",t))}function sy(r){var t=r.state,e=r.options,i=e.gpuAcceleration,a=i===void 0?!0:i,o=e.adaptive,l=o===void 0?!0:o,c=e.roundOffsets,f=c===void 0?!0:c,d={placement:ri(t.placement),variation:cs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Mf(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Mf(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ay={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sy,data:{}};var co={passive:!0};function oy(r){var t=r.state,e=r.instance,i=r.options,a=i.scroll,o=a===void 0?!0:a,l=i.resize,c=l===void 0?!0:l,f=sr(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(g){g.addEventListener("scroll",e.update,co)}),c&&f.addEventListener("resize",e.update,co),function(){o&&d.forEach(function(g){g.removeEventListener("scroll",e.update,co)}),c&&f.removeEventListener("resize",e.update,co)}}const uy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:oy,data:{}};var ly={left:"right",right:"left",bottom:"top",top:"bottom"};function fo(r){return r.replace(/left|right|bottom|top/g,function(t){return ly[t]})}var hy={start:"end",end:"start"};function Bf(r){return r.replace(/start|end/g,function(t){return hy[t]})}function el(r){var t=sr(r),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function rl(r){return hs(Ki(r)).left+el(r).scrollLeft}function cy(r,t){var e=sr(r),i=Ki(r),a=e.visualViewport,o=i.clientWidth,l=i.clientHeight,c=0,f=0;if(a){o=a.width,l=a.height;var d=Cf();(d||!d&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}return{width:o,height:l,x:c+rl(r),y:f}}function fy(r){var t,e=Ki(r),i=el(r),a=(t=r.ownerDocument)==null?void 0:t.body,o=Dn(e.scrollWidth,e.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),l=Dn(e.scrollHeight,e.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),c=-i.scrollLeft+rl(r),f=-i.scrollTop;return Ti(a||e).direction==="rtl"&&(c+=Dn(e.clientWidth,a?a.clientWidth:0)-o),{width:o,height:l,x:c,y:f}}function il(r){var t=Ti(r),e=t.overflow,i=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+a+i)}function If(r){return["html","body","#document"].indexOf(ei(r))>=0?r.ownerDocument.body:xr(r)&&il(r)?r:If(ho(r))}function ca(r,t){var e;t===void 0&&(t=[]);var i=If(r),a=i===((e=r.ownerDocument)==null?void 0:e.body),o=sr(i),l=a?[o].concat(o.visualViewport||[],il(i)?i:[]):i,c=t.concat(l);return a?c:c.concat(ca(ho(l)))}function nl(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function py(r,t){var e=hs(r,!1,t==="fixed");return e.top=e.top+r.clientTop,e.left=e.left+r.clientLeft,e.bottom=e.top+r.clientHeight,e.right=e.left+r.clientWidth,e.width=r.clientWidth,e.height=r.clientHeight,e.x=e.left,e.y=e.top,e}function Rf(r,t,e){return t===wf?nl(cy(r,e)):Cn(t)?py(t,e):nl(fy(Ki(r)))}function dy(r){var t=ca(ho(r)),e=["absolute","fixed"].indexOf(Ti(r).position)>=0,i=e&&xr(r)?la(r):r;return Cn(i)?t.filter(function(a){return Cn(a)&&Df(a,i)&&ei(a)!=="body"}):[]}function gy(r,t,e,i){var a=t==="clippingParents"?dy(r):[].concat(t),o=[].concat(a,[e]),l=o[0],c=o.reduce(function(f,d){var g=Rf(r,d,i);return f.top=Dn(g.top,f.top),f.right=lo(g.right,f.right),f.bottom=lo(g.bottom,f.bottom),f.left=Dn(g.left,f.left),f},Rf(r,l,i));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function Pf(r){var t=r.reference,e=r.element,i=r.placement,a=i?ri(i):null,o=i?cs(i):null,l=t.x+t.width/2-e.width/2,c=t.y+t.height/2-e.height/2,f;switch(a){case Ye:f={x:l,y:t.y-e.height};break;case mr:f={x:l,y:t.y+t.height};break;case vr:f={x:t.x+t.width,y:c};break;case Xe:f={x:t.x-e.width,y:c};break;default:f={x:t.x,y:t.y}}var d=a?tl(a):null;if(d!=null){var g=d==="y"?"height":"width";switch(o){case us:f[d]=f[d]-(t[g]/2-e[g]/2);break;case oa:f[d]=f[d]+(t[g]/2-e[g]/2);break}}return f}function fa(r,t){t===void 0&&(t={});var e=t,i=e.placement,a=i===void 0?r.placement:i,o=e.strategy,l=o===void 0?r.strategy:o,c=e.boundary,f=c===void 0?P2:c,d=e.rootBoundary,g=d===void 0?wf:d,E=e.elementContext,_=E===void 0?ua:E,C=e.altBoundary,R=C===void 0?!1:C,L=e.padding,N=L===void 0?0:L,I=Lf(typeof N!="number"?N:Nf(N,aa)),W=_===ua?F2:ua,G=r.rects.popper,b=r.elements[R?W:_],F=gy(Cn(b)?b:b.contextElement||Ki(r.elements.popper),f,g,l),q=hs(r.elements.reference),K=Pf({reference:q,element:G,strategy:"absolute",placement:a}),tt=nl(Object.assign({},G,K)),Z=_===ua?tt:q,rt={top:F.top-Z.top+I.top,bottom:Z.bottom-F.bottom+I.bottom,left:F.left-Z.left+I.left,right:Z.right-F.right+I.right},J=r.modifiersData.offset;if(_===ua&&J){var st=J[a];Object.keys(rt).forEach(function(ct){var ft=[vr,mr].indexOf(ct)>=0?1:-1,pt=[Ye,mr].indexOf(ct)>=0?"y":"x";rt[ct]+=st[pt]*ft})}return rt}function yy(r,t){t===void 0&&(t={});var e=t,i=e.placement,a=e.boundary,o=e.rootBoundary,l=e.padding,c=e.flipVariations,f=e.allowedAutoPlacements,d=f===void 0?Tf:f,g=cs(i),E=g?c?bf:bf.filter(function(R){return cs(R)===g}):aa,_=E.filter(function(R){return d.indexOf(R)>=0});_.length===0&&(_=E);var C=_.reduce(function(R,L){return R[L]=fa(r,{placement:L,boundary:a,rootBoundary:o,padding:l})[ri(L)],R},{});return Object.keys(C).sort(function(R,L){return C[R]-C[L]})}function my(r){if(ri(r)===Qu)return[];var t=fo(r);return[Bf(r),t,Bf(t)]}function vy(r){var t=r.state,e=r.options,i=r.name;if(!t.modifiersData[i]._skip){for(var a=e.mainAxis,o=a===void 0?!0:a,l=e.altAxis,c=l===void 0?!0:l,f=e.fallbackPlacements,d=e.padding,g=e.boundary,E=e.rootBoundary,_=e.altBoundary,C=e.flipVariations,R=C===void 0?!0:C,L=e.allowedAutoPlacements,N=t.options.placement,I=ri(N),W=I===N,G=f||(W||!R?[fo(N)]:my(N)),b=[N].concat(G).reduce(function(Pe,le){return Pe.concat(ri(le)===Qu?yy(t,{placement:le,boundary:g,rootBoundary:E,padding:d,flipVariations:R,allowedAutoPlacements:L}):le)},[]),F=t.rects.reference,q=t.rects.popper,K=new Map,tt=!0,Z=b[0],rt=0;rt<b.length;rt++){var J=b[rt],st=ri(J),ct=cs(J)===us,ft=[Ye,mr].indexOf(st)>=0,pt=ft?"width":"height",O=fa(t,{placement:J,boundary:g,rootBoundary:E,altBoundary:_,padding:d}),vt=ft?ct?vr:Xe:ct?mr:Ye;F[pt]>q[pt]&&(vt=fo(vt));var Bt=fo(vt),Re=[];if(o&&Re.push(O[st]<=0),c&&Re.push(O[vt]<=0,O[Bt]<=0),Re.every(function(Pe){return Pe})){Z=J,tt=!1;break}K.set(J,Re)}if(tt)for(var be=R?3:1,ue=function(le){var Oe=b.find(function(Gt){var Zt=K.get(Gt);if(Zt)return Zt.slice(0,le).every(function(Ot){return Ot})});if(Oe)return Z=Oe,"break"},ve=be;ve>0;ve--){var Vr=ue(ve);if(Vr==="break")break}t.placement!==Z&&(t.modifiersData[i]._skip=!0,t.placement=Z,t.reset=!0)}}const xy={name:"flip",enabled:!0,phase:"main",fn:vy,requiresIfExists:["offset"],data:{_skip:!1}};function Ff(r,t,e){return e===void 0&&(e={x:0,y:0}),{top:r.top-t.height-e.y,right:r.right-t.width+e.x,bottom:r.bottom-t.height+e.y,left:r.left-t.width-e.x}}function kf(r){return[Ye,vr,mr,Xe].some(function(t){return r[t]>=0})}function Ey(r){var t=r.state,e=r.name,i=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,l=fa(t,{elementContext:"reference"}),c=fa(t,{altBoundary:!0}),f=Ff(l,i),d=Ff(c,a,o),g=kf(f),E=kf(d);t.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:d,isReferenceHidden:g,hasPopperEscaped:E},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":E})}const Ay={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ey};function wy(r,t,e){var i=ri(r),a=[Xe,Ye].indexOf(i)>=0?-1:1,o=typeof e=="function"?e(Object.assign({},t,{placement:r})):e,l=o[0],c=o[1];return l=l||0,c=(c||0)*a,[Xe,vr].indexOf(i)>=0?{x:c,y:l}:{x:l,y:c}}function by(r){var t=r.state,e=r.options,i=r.name,a=e.offset,o=a===void 0?[0,0]:a,l=Tf.reduce(function(g,E){return g[E]=wy(E,t.rects,o),g},{}),c=l[t.placement],f=c.x,d=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=l}const Ty={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:by};function _y(r){var t=r.state,e=r.name;t.modifiersData[e]=Pf({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Cy={name:"popperOffsets",enabled:!0,phase:"read",fn:_y,data:{}};function Dy(r){return r==="x"?"y":"x"}function Sy(r){var t=r.state,e=r.options,i=r.name,a=e.mainAxis,o=a===void 0?!0:a,l=e.altAxis,c=l===void 0?!1:l,f=e.boundary,d=e.rootBoundary,g=e.altBoundary,E=e.padding,_=e.tether,C=_===void 0?!0:_,R=e.tetherOffset,L=R===void 0?0:R,N=fa(t,{boundary:f,rootBoundary:d,padding:E,altBoundary:g}),I=ri(t.placement),W=cs(t.placement),G=!W,b=tl(I),F=Dy(b),q=t.modifiersData.popperOffsets,K=t.rects.reference,tt=t.rects.popper,Z=typeof L=="function"?L(Object.assign({},t.rects,{placement:t.placement})):L,rt=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,st={x:0,y:0};if(q){if(o){var ct,ft=b==="y"?Ye:Xe,pt=b==="y"?mr:vr,O=b==="y"?"height":"width",vt=q[b],Bt=vt+N[ft],Re=vt-N[pt],be=C?-tt[O]/2:0,ue=W===us?K[O]:tt[O],ve=W===us?-tt[O]:-K[O],Vr=t.elements.arrow,Pe=C&&Vr?Ju(Vr):{width:0,height:0},le=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Of(),Oe=le[ft],Gt=le[pt],Zt=ha(0,K[O],Pe[O]),Ot=G?K[O]/2-be-Zt-Oe-rt.mainAxis:ue-Zt-Oe-rt.mainAxis,Vt=G?-K[O]/2+be+Zt+Gt+rt.mainAxis:ve+Zt+Gt+rt.mainAxis,Le=t.elements.arrow&&la(t.elements.arrow),Fe=Le?b==="y"?Le.clientTop||0:Le.clientLeft||0:0,Ze=(ct=J==null?void 0:J[b])!=null?ct:0,Jt=vt+Ot-Ze-Fe,Ne=vt+Vt-Ze,xe=ha(C?lo(Bt,Jt):Bt,vt,C?Dn(Re,Ne):Re);q[b]=xe,st[b]=xe-vt}if(c){var Qt,oi=b==="x"?Ye:Xe,Si=b==="x"?mr:vr,he=q[F],Lt=F==="y"?"height":"width",or=he+N[oi],Qe=he-N[Si],Oi=[Ye,Xe].indexOf(I)!==-1,Ar=(Qt=J==null?void 0:J[F])!=null?Qt:0,rn=Oi?or:he-K[Lt]-tt[Lt]-Ar+rt.altAxis,ur=Oi?he+K[Lt]+tt[Lt]-Ar-rt.altAxis:Qe,Ke=C&&Oi?j2(rn,he,ur):ha(C?rn:or,he,C?ur:Qe);q[F]=Ke,st[F]=Ke-he}t.modifiersData[i]=st}}const Oy={name:"preventOverflow",enabled:!0,phase:"main",fn:Sy,requiresIfExists:["offset"]};function Ly(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Ny(r){return r===sr(r)||!xr(r)?el(r):Ly(r)}function My(r){var t=r.getBoundingClientRect(),e=ls(t.width)/r.offsetWidth||1,i=ls(t.height)/r.offsetHeight||1;return e!==1||i!==1}function By(r,t,e){e===void 0&&(e=!1);var i=xr(t),a=xr(t)&&My(t),o=Ki(t),l=hs(r,a,e),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(i||!i&&!e)&&((ei(t)!=="body"||il(o))&&(c=Ny(t)),xr(t)?(f=hs(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):o&&(f.x=rl(o))),{x:l.left+c.scrollLeft-f.x,y:l.top+c.scrollTop-f.y,width:l.width,height:l.height}}function Iy(r){var t=new Map,e=new Set,i=[];r.forEach(function(o){t.set(o.name,o)});function a(o){e.add(o.name);var l=[].concat(o.requires||[],o.requiresIfExists||[]);l.forEach(function(c){if(!e.has(c)){var f=t.get(c);f&&a(f)}}),i.push(o)}return r.forEach(function(o){e.has(o.name)||a(o)}),i}function Ry(r){var t=Iy(r);return Y2.reduce(function(e,i){return e.concat(t.filter(function(a){return a.phase===i}))},[])}function Py(r){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(r())})})),t}}function Fy(r){var t=r.reduce(function(e,i){var a=e[i.name];return e[i.name]=a?Object.assign({},a,i,{options:Object.assign({},a.options,i.options),data:Object.assign({},a.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var Hf={placement:"bottom",modifiers:[],strategy:"absolute"};function Uf(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function ky(r){r===void 0&&(r={});var t=r,e=t.defaultModifiers,i=e===void 0?[]:e,a=t.defaultOptions,o=a===void 0?Hf:a;return function(c,f,d){d===void 0&&(d=o);var g={placement:"bottom",orderedModifiers:[],options:Object.assign({},Hf,o),modifiersData:{},elements:{reference:c,popper:f},attributes:{},styles:{}},E=[],_=!1,C={state:g,setOptions:function(I){var W=typeof I=="function"?I(g.options):I;L(),g.options=Object.assign({},o,g.options,W),g.scrollParents={reference:Cn(c)?ca(c):c.contextElement?ca(c.contextElement):[],popper:ca(f)};var G=Ry(Fy([].concat(i,g.options.modifiers)));return g.orderedModifiers=G.filter(function(b){return b.enabled}),R(),C.update()},forceUpdate:function(){if(!_){var I=g.elements,W=I.reference,G=I.popper;if(Uf(W,G)){g.rects={reference:By(W,la(G),g.options.strategy==="fixed"),popper:Ju(G)},g.reset=!1,g.placement=g.options.placement,g.orderedModifiers.forEach(function(rt){return g.modifiersData[rt.name]=Object.assign({},rt.data)});for(var b=0;b<g.orderedModifiers.length;b++){if(g.reset===!0){g.reset=!1,b=-1;continue}var F=g.orderedModifiers[b],q=F.fn,K=F.options,tt=K===void 0?{}:K,Z=F.name;typeof q=="function"&&(g=q({state:g,options:tt,name:Z,instance:C})||g)}}}},update:Py(function(){return new Promise(function(N){C.forceUpdate(),N(g)})}),destroy:function(){L(),_=!0}};if(!Uf(c,f))return C;C.setOptions(d).then(function(N){!_&&d.onFirstUpdate&&d.onFirstUpdate(N)});function R(){g.orderedModifiers.forEach(function(N){var I=N.name,W=N.options,G=W===void 0?{}:W,b=N.effect;if(typeof b=="function"){var F=b({state:g,name:I,instance:C,options:G}),q=function(){};E.push(F||q)}})}function L(){E.forEach(function(N){return N()}),E=[]}return C}}var Hy=[uy,Cy,ay,_f,Ty,xy,Oy,ry,Ay],Uy=ky({defaultModifiers:Hy}),qy="tippy-box",qf="tippy-content",Wy="tippy-backdrop",Wf="tippy-arrow",Vf="tippy-svg-arrow",Sn={passive:!0,capture:!0},zf=function(){return document.body};function Vy(r,t){return{}.hasOwnProperty.call(r,t)}function sl(r,t,e){if(Array.isArray(r)){var i=r[t];return i??(Array.isArray(e)?e[t]:e)}return r}function al(r,t){var e={}.toString.call(r);return e.indexOf("[object")===0&&e.indexOf(t+"]")>-1}function $f(r,t){return typeof r=="function"?r.apply(void 0,t):r}function Gf(r,t){if(t===0)return r;var e;return function(i){clearTimeout(e),e=setTimeout(function(){r(i)},t)}}function zy(r,t){var e=Object.assign({},r);return t.forEach(function(i){delete e[i]}),e}function $y(r){return r.split(/\s+/).filter(Boolean)}function fs(r){return[].concat(r)}function Yf(r,t){r.indexOf(t)===-1&&r.push(t)}function Gy(r){return r.filter(function(t,e){return r.indexOf(t)===e})}function Yy(r){return r.split("-")[0]}function po(r){return[].slice.call(r)}function Xf(r){return Object.keys(r).reduce(function(t,e){return r[e]!==void 0&&(t[e]=r[e]),t},{})}function pa(){return document.createElement("div")}function da(r){return["Element","Fragment"].some(function(t){return al(r,t)})}function Xy(r){return al(r,"NodeList")}function Zy(r){return al(r,"MouseEvent")}function Qy(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function Ky(r){return da(r)?[r]:Xy(r)?po(r):Array.isArray(r)?r:po(document.querySelectorAll(r))}function ol(r,t){r.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function Zf(r,t){r.forEach(function(e){e&&e.setAttribute("data-state",t)})}function jy(r){var t,e=fs(r),i=e[0];return i!=null&&(t=i.ownerDocument)!=null&&t.body?i.ownerDocument:document}function Jy(r,t){var e=t.clientX,i=t.clientY;return r.every(function(a){var o=a.popperRect,l=a.popperState,c=a.props,f=c.interactiveBorder,d=Yy(l.placement),g=l.modifiersData.offset;if(!g)return!0;var E=d==="bottom"?g.top.y:0,_=d==="top"?g.bottom.y:0,C=d==="right"?g.left.x:0,R=d==="left"?g.right.x:0,L=o.top-i+E>f,N=i-o.bottom-_>f,I=o.left-e+C>f,W=e-o.right-R>f;return L||N||I||W})}function ul(r,t,e){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(a){r[i](a,e)})}function Qf(r,t){for(var e=t;e;){var i;if(r.contains(e))return!0;e=e.getRootNode==null||(i=e.getRootNode())==null?void 0:i.host}return!1}var ii={isTouch:!1},Kf=0;function tm(){ii.isTouch||(ii.isTouch=!0,window.performance&&document.addEventListener("mousemove",jf))}function jf(){var r=performance.now();r-Kf<20&&(ii.isTouch=!1,document.removeEventListener("mousemove",jf)),Kf=r}function em(){var r=document.activeElement;if(Qy(r)){var t=r._tippy;r.blur&&!t.state.isVisible&&r.blur()}}function rm(){document.addEventListener("touchstart",tm,Sn),window.addEventListener("blur",em)}var im=typeof window<"u"&&typeof document<"u",nm=im?!!window.msCrypto:!1;function ps(r){var t=r==="destroy"?"n already-":" ";return[r+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Jf(r){var t=/[ \t]{2,}/g,e=/^[ \t]*/gm;return r.replace(t," ").replace(e,"").trim()}function sm(r){return Jf(`
|
|
84
84
|
%ctippy.js
|
|
85
85
|
|
|
86
86
|
%c`+Jf(r)+`
|
|
@@ -100,7 +100,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
100
100
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
101
101
|
|
|
102
102
|
`,`1) content: element.innerHTML
|
|
103
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var c=a.reduce(function(f,d){var g=d&&dm(d,i);return g&&f.push(g),f},[]);return da(r)?c[0]:c}ya.defaultProps=ar,ya.setDefaultProps=hm,ya.currentInput=ii,Object.assign({},_f,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}}),ya.setDefaultProps({render:op});let gm=0;const ji=ya(document.body,{theme:"translucent",animation:"scale",inertia:!0,delay:[200,100],content:"",allowHTML:!0,placement:"left-start",trigger:"manual",arrow:!0});class pl{constructor(t,e){this.container=t,this.text=e,t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.text=e}name="Label";id="Label"+gm++;el;position=new P;get isMounted(){return ji.state.isMounted}get isShown(){return ji.state.isShown}destroy(){this.text="",this.position.identity()}setHtml(t=""){return this.text=t,this}update(t){t&&(this.position.copy(t),ji.show())}async show(t){if(t)return await this.hide(),this.position.copy(t),ji.setContent(this.text),ji.setProps({getReferenceClientRect:()=>({width:0,height:0,right:this.position.x,left:this.position.x,bottom:this.position.y,top:this.position.y,x:this.position.x,y:this.position.y,toJSON(){}})}),ji.clearDelayTimeouts(),ji.show(),new Promise(e=>{Nt.delay(function(){e()},300)})}async hide(){return ji.hide(),new Promise(t=>{Nt.delay(function(){t()},100)})}}let ym=0;class mm extends Ge{name="DummyPoint";id="dummyPoint"+ym++;container;offset=new P;el;label;radius=10;position=new P;worldPosition=new P;userData;constructor(t,e){var a,o;super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,(a=this.userData)!=null&&a.type||Nt.set(this,"userData.type",_n.DEFAULT),this.initDom(),this.setType((o=this.userData)==null?void 0:o.type),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){var t;this.el&&((t=this.el)!=null&&t.parentNode||this.container.appendChild(this.el))}unmount(){var t,e,i,a;(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}setText(t=""){return this.el?(this.el.innerText=t,this):this}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-point"),this.el.setAttribute(as+"-id",(t=this.userData)==null?void 0:t.value)}initLabel(){var t;(t=this.userData)!=null&&t.label&&(this.label=new pl(this.container,this.userData.label))}setActive(t){return t?(ia(this.el,"active"),this.showLabel()):(na(this.el,"active"),this.hideLabel()),this}showLabel(){var t;(t=this.label)==null||t.show(vm.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t||(t=_n.DEFAULT),e&&oo(this.el,e)&&na(this.el,e),this.userData.type=t,ia(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const vm=new P;let xm=0;class Em extends Ge{name="DummyRect";id="dummyRect"+xm++;container;offset=new P;el;radius=10;position=new P;worldPosition=new P;label;userData;constructor(t,e){super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,this.initDom(),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){this.container.appendChild(this.el)}unmount(){var t,e,i,a;this.setText(""),(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-rect"),this.el.setAttribute(as+"-id",((t=this.userData)==null?void 0:t.rmId)||"undefined")}initLabel(){this.label=new pl(this.container,"")}setText(t=""){return this.el.innerText=t,this}setActive(t){return t?ia(this.el,"active"):na(this.el,"active"),this}showLabel(){var t;(t=this.label)==null||t.show(Am.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t=_n.DEFAULT,e&&oo(this.el,e)&&na(this.el,e),this.userData.type=t,ia(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const Am=new P;class wm extends Ge{name="Dummies";container;controller;scene;viewMatrix=new se;dummies=[];rmMap=new Map;mergedMap=new Map;cameraUpdateHandler=this.handleCameraUpdate.bind(this);controllerTapHandler=this.handleControllerTap.bind(this);constructor(t,e){super(),this.container=t,this.controller=e,this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.clearDummies()}bindEvents(){this.controller.camera.addEventListener(uo.UPDATE,this.cameraUpdateHandler),this.controller.addEventListener(ot.TAP,this.controllerTapHandler)}unbindEvents(){this.controller.camera.removeEventListener(uo.UPDATE,this.cameraUpdateHandler),this.controller.removeEventListener(ot.TAP,this.controllerTapHandler)}bindScene(t){this.scene=t}update(t){var e,i,a;if(t){this.viewMatrix.copy(t);for(let o=0,l=(this.dummies||[]).length;o<l;o++){const c=this.dummies[o],f=(i=this.scene)==null?void 0:i.getElementById((e=c.userData)==null?void 0:e.rmId);if(f){const d=(a=this.scene)==null?void 0:a.chef.getElementBoundingBox(f.id);d==null||d.getCenter(Ji),Ji.applyMatrix3(this.viewMatrix).round(),c.position.copy(Ji)}else Ji.copy(c.worldPosition).applyMatrix3(this.viewMatrix).round(),c.update(Ji)}this.mergeDummies()}}setDummies(t){this.clearDummies();for(let e=0,i=(t||[]).length;e<i;e++)this.addDummy(t[e])}addDummy(t){var a,o;const e=new mm(this.container,t);this.dummies.push(e);const i=(a=e.userData)==null?void 0:a.rmId;return i&&(this.rmMap.has(i)||this.rmMap.set(i,[]),(o=this.rmMap.get(i))==null||o.push(e)),e}removeDummy(t){var a;const e=this.dummies.indexOf(t);e>-1&&this.dummies.splice(e,1);const i=(a=t.userData)==null?void 0:a.rmId;if(i){const o=this.mergedMap.get(i);o==null||o.destroy(),this.mergedMap.delete(i);const l=this.rmMap.get(i);if(!l)return;if(l.length===1)this.rmMap.delete(i);else{const c=l.indexOf(t);c>-1&&(l.splice(c,1),this.rmMap.set(i,l))}}t.destroy()}clearDummies(t){var e,i,a;for(let o=(((e=this.dummies)==null?void 0:e.length)||0)-1;o>=0;o--){const l=this.dummies[o];(!t||(i=l==null?void 0:l.userData)!=null&&i.type&&(t!=null&&t.includes((a=l.userData)==null?void 0:a.type)))&&this.removeDummy(l)}t||(this.dummies.length=0,this.mergedMap.clear(),this.rmMap.clear())}mergeDummies(){this.rmMap.forEach((t,e)=>{var a,o,l,c;if((a=this.scene)==null?void 0:a.getElementById(e)){const f=(o=this.scene)==null?void 0:o.chef.getElementBoundingBox(e);if(!f)return;dl.copy(f).applyMatrix3(this.viewMatrix).round(),dl.getSize(Ji);const d=t[0].radius,g=dl.centralArrange(t.length,d*2,d*2);if(Ji.x<d*3||Ji.y<d*3){t.forEach(_=>_.unmount());const E=this.mergedMap.get(e);E==null||E.unmount()}else if(Array.isArray(g))this.mergedMap.has(e)&&((l=this.mergedMap.get(e))==null||l.unmount()),t.forEach((E,_)=>{E.isMounted||E.mount(),E.update(g[_])});else{t.forEach(C=>C.unmount());let E=this.mergedMap.get(e);if(E)E.isMounted||E.mount();else{const C=Nt.cloneDeep(t[0].userData)||{},R=Nt.reduce(t,(N,I)=>{var W,G;return(W=I.userData)!=null&&W.label&&N.push((G=I.userData)==null?void 0:G.label),N},[]);C.label=R.join(", ");const L=Nt.reduce(t,(N,I)=>{var W,G;return(W=I.userData)!=null&&W.value&&N.push((G=I.userData)==null?void 0:G.value),N},[]);C.value=L.join(","),C.rmId=e,E=new Em(this.container,C),this.mergedMap.set(e,E)}E.setText(t.length.toString());const _=Nt.reduce(t,(C,R)=>{var L,N;return(L=R.userData)!=null&&L.label&&C.push((N=R.userData)==null?void 0:N.label),C},[]);(c=E.label)==null||c.setHtml(_.join(", <br />")),E.update(t[0].position)}}})}getDummyById(t){return this.dummies.find(e=>{var i;return((i=e.userData)==null?void 0:i.value)===t})}setActiveByIds(t){var e,i;if(this.resetActives(),!!t&&(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length)))for(let a=0,o=t.length;a<o;a++){const l=this.getDummyById(t[a]);if(l&&l.setActive(!0),l&&((e=l.userData)!=null&&e.rmId)){const c=this.mergedMap.get((i=l.userData)==null?void 0:i.rmId);c&&c.setActive(!0)}}}resetActives(){this.dummies.forEach(t=>t.setActive(!1)),this.mergedMap.forEach(t=>t.setActive(!1))}showDummyLabel(t){if(!t)return;const e=this.getDummyById(t);e&&e.showLabel();const i=this.mergedMap.get(t);i&&i.showLabel()}async hideDummyLabel(){this.dummies.forEach(t=>t.hideLabel()),this.mergedMap.forEach(t=>t.hideLabel())}handleCameraUpdate(){this.update(this.controller.camera.viewMatrix)}handleControllerTap(t){var a,o,l,c,f;if((t==null?void 0:t.type)!==ot.TAP)return;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target)||((f=(c=t==null?void 0:t.e)==null?void 0:c.srcEvent)==null?void 0:f.srcElement),i=e==null?void 0:e.getAttribute(as+"-id");i&&console.warn("【TODO】handleControllerTap: ",i)}}const Ji=new P,dl=new _t;(function(){return window[Qi.prefixed(window,"requestAnimationFrame")]||function(r){window.setTimeout(r,1e3/60)}})();class bm extends Ge{name="DragController";dragFake=!1;container;offset=new P;controller;scene;raycaster;dummies;_els=[];_hms=new Map;_vos=new Map;_elMap=new Map;_panType=_n.SUCCESS;onPanHandler=this.handleOnPan.bind(this);panEndHandler=Nt.debounce(this.handlePanEnd.bind(this),500);constructor(t,e,i=!0){super(),this.container=t;let a=this.container.getBoundingClientRect();this.offset.set(a.left,a.top),this.controller=e,this.dummies=new wm(t,e),this.raycaster=new Af,this.dragFake=i}destroy(){var t;super.destroy();for(let e=(((t=this._els)==null?void 0:t.length)||0)-1;e>=0;e--)this.drop(this._els[e]);this.dummies.destroy()}bindScene(t){var e;this.scene=t,(e=this.dummies)==null||e.bindScene(t)}drag(t,e){t&&(this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,e)))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t),this._elMap.delete(t);const e=this._els.findIndex(i=>i===t);e>-1&&this._els.splice(e,1)}bindEvent(t){if(!t)return;const e=new Qi.Manager(t,{domEvents:!0});e.add(new Qi.Pan({threshold:0,pointers:0})),e.on(["panstart","panmove","panend"].join(" "),this.onPanHandler),this._hms.set(t,e)}unbindEvent(t){if(!t)return;const e=this._hms.get(t);e&&(e.off(["panstart","panmove","panend"].join(" "),this.onPanHandler),e.destroy(),this._hms.delete(t))}handleOnPan(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.srcEvent.stopImmediatePropagation=="function"&&t.srcEvent.stopImmediatePropagation(),!this.controller)return;t.type==="panstart"||t.isFirst?this.controller.enablePan=!1:t.type==="panmove"||t.type==="panend"&&(this.controller.enablePan=!0);const e=this._vos.get(t.target);if(!e)return;const i=Nt.cloneDeep(e);i.type=this._panType;const a=this._getDummy(t.target,i);ma.set(t.center.x,t.center.y).sub(this.offset),a.worldPosition.copy(ma).unproject(this.controller.camera),a.update(ma),this.panEndHandler({type:"panend",e:t})}handlePanEnd(t){if((t==null?void 0:t.type)!=="panend")return;const e=this.getDummies(!0);this.dispatchEvent({type:"panend",data:e})}getDummies(t=!0){const e=[];return this._els.forEach(i=>{var o;let a=this._vos.get(i);if(!(!a||a.type!==_n.SUCCESS)){if(t){const l=this._elMap.get(i);if(!l||!this.controller.camera)return;ma.copy(l.position),this.raycaster.setFromCamera(ma,this.controller.camera);const c=[];if((o=this.scene)==null||o.getIntersectObjects(this.raycaster,$e.RM,c),!(c!=null&&c.length))return;a=Nt.cloneDeep(a),a.rmId=c[0].id}e.push(a)}}),e}setDummiesByVos(t){var e,i;for(let a=0,o=(t||[]).length;a<o;a++){const l=(e=this.dummies)==null?void 0:e.addDummy(t[a]);if(!l)continue;const c=Nt.cloneDeep(t[a]);delete c.rmId,delete c.wsId,this.drag(l.el,c)}(i=this.dummies)==null||i.update(this.controller.camera.viewMatrix)}clearDummies(t){var e,i;for(let a=(((e=this._els)==null?void 0:e.length)||0)-1;a>=0;a--){const o=this._vos.get(this._els[a]);(!t||t&&(o!=null&&o.type)&&t.includes(o.type))&&this.drop(this._els[a])}(i=this.dummies)==null||i.clearDummies(t)}getDummyById(t){return this.dummies.getDummyById(t)}highlightDummies(t){var e;(e=this.dummies)==null||e.setActiveByIds(t)}resetHighlightDummies(){var t;(t=this.dummies)==null||t.resetActives()}showDummyLabel(t){var e;(e=this.dummies)==null||e.showDummyLabel(t)}start(){}_getDummy(t,e){let i=this._elMap.get(t);if(i||(i=this.dummies.addDummy(e).setType(_n.SUCCESS),this._elMap.set(t,i)),i.isMounted||i.mount(),this.dummies.dummies.includes(i)||this.dummies.dummies.push(i),!this._elMap.get(i.el)){this._elMap.set(i.el,i);const o=Nt.cloneDeep(e);delete o.rmId,delete o.wsId,this.drag(i.el,o)}return i}}const ma=new P;var ds=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-ds.Bounce.Out(1-r)},Out:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},InOut:function(r){return r<.5?ds.Bounce.In(r*2)*.5:ds.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),gs=function(){return performance.now()},up=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var a=0,o=e;a<o.length;a++){var l=o[a];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,a=t;i<a.length;i++){var o=a[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=gs()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var o=this._tweens[i[a]],l=!e;o&&o.update(t,l)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),On={Linear:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[a],r[a+1>e?e:a+1],i-a)},Bezier:function(r,t){for(var e=0,i=r.length-1,a=Math.pow,o=On.Utils.Bernstein,l=0;l<=i;l++)e+=a(1-t,i-l)*a(t,l)*r[l]*o(i,l);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(a=Math.floor(i=e*(1+t))),o(r[(a-1+e)%e],r[a],r[(a+1)%e],r[(a+2)%e],i-a)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[a?a-1:0],r[a],r[e<a+1?e:a+1],r[e<a+2?e:a+2],i-a)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=On.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,a){var o=(e-r)*.5,l=(i-t)*.5,c=a*a,f=a*c;return(2*t-2*e+o+l)*f+(-3*t+3*e-2*o-l)*c+o*a+t}}},gl=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),yl=new up,Tm=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ds.Linear.None,this._interpolationFunction=On.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=gl.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=yl,yl.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=gs()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var a={};for(var o in this._valuesEnd)a[o]=this._valuesEnd[o];this._valuesEnd=a}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,a,o){for(var l in i){var c=t[l],f=Array.isArray(c),d=f?"array":typeof c,g=!f&&Array.isArray(i[l]);if(!(d==="undefined"||d==="function")){if(g){var E=i[l];if(E.length===0)continue;for(var _=[c],C=0,R=E.length;C<R;C+=1){var L=this._handleRelativeValue(c,E[C]);if(isNaN(L)){g=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(L)}g&&(i[l]=_)}if((d==="object"||f)&&c&&!g){e[l]=f?[]:{};var N=c;for(var I in N)e[l][I]=N[I];a[l]=f?[]:{};var E=i[l];if(!this._isDynamic){var W={};for(var I in E)W[I]=E[I];i[l]=E=W}this._setupProperties(N,e[l],E,a[l],o)}else(typeof e[l]>"u"||o)&&(e[l]=c),f||(e[l]*=1),g?a[l]=i[l].slice().reverse():a[l]=e[l]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=gs()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=gs()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=ds.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=On.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,a;if(t===void 0&&(t=gs()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var l=t-this._startTime,c=this._duration+((a=this._repeatDelayTime)!==null&&a!==void 0?a:this._delayTime),f=this._duration+this._repeat*c,d=function(){if(i._duration===0||l>f)return 1;var L=Math.trunc(l/c),N=l-L*c,I=Math.min(N/i._duration,1);return I===0&&l===i._duration?1:I},g=d(),E=this._easingFunction(g);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,E),this._onUpdateCallback&&this._onUpdateCallback(this._object,g),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,R=this._chainedTweens.length;C<R;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,a){for(var o in i)if(e[o]!==void 0){var l=e[o]||0,c=i[o],f=Array.isArray(t[o]),d=Array.isArray(c),g=!f&&d;g?t[o]=this._interpolationFunction(c,a):typeof c=="object"&&c?this._updateProperties(t[o],l,c,a):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[o]=l+(c-l)*a))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}(),_m="25.0.0",Cm=gl.nextId,ni=yl,Dm=ni.getAll.bind(ni),Sm=ni.removeAll.bind(ni),Om=ni.add.bind(ni),Lm=ni.remove.bind(ni),Nm=ni.update.bind(ni),yo={Easing:ds,Group:up,Interpolation:On,now:gs,Sequence:gl,nextId:Cm,Tween:Tm,VERSION:_m,getAll:Dm,removeAll:Sm,add:Om,remove:Lm,update:Nm};class Mm extends Ge{name="View";params;visible=!0;cvs;scene;scenes=[];camera;controller;tween;animateDuration;constructor(t={}){super(),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new xf(t.camera||{})}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach(t=>t.destroy()),this.scenes.length=0,super.destroy()}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}saveCameraPosition(t){ys.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(ys))}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);i&&(ys.copy(JSON.parse(i)),this.resetCameraByBoundingBox(ys,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),ys.copy(this.scene.boundingBox).expandByVector(mo.set(t,t)),this.resetCameraByBoundingBox(ys,e))}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}reset(){}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(mo),t.getSize(ml);const a=Math.max(ml.x/this.camera.width,ml.y/this.camera.height),o={x:mo.x,y:mo.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new yo.Tween(t).to(e,this.animateDuration).easing(yo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}computeBoundingBox(t,e=new _t){return!t||!t.length||(e.makeEmpty(),t.forEach(i=>e.union(i.computeBoundingBox()))),e}expandScenesBoundingBox(t,e=new _t){t.forEach(i=>i.boundingBox.union(e))}update(t){this.tween&&this.tween.update(t)}}const Er="camera_position_",mo=new P,ml=new P,ys=new _t;class Bm extends Ge{name="SvgView";params;container;offset=new P;camera;controller;scene;p1=new P;p2=new P;graph;multiSelector;dummiesController;zoomToSelectEnable=!1;zoomBox=new _t;selectEnable=!1;multiSelectEnable=!1;tween;animateDuration;label;controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerWheelStartHandler=this.handlePanStart.bind(this);controllerWheelEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);_currentAssetId;constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.camera||(this.params.camera={}),this.params.camera.flipY=!0,this.animateDuration=this.params.animateDuration||300,this.camera=new xf(this.params.camera),this.container=this.params.containerId?document.getElementById(this.params.containerId):kt.window.document.getElementsByTagName("body")[0];let e=this.container.getBoundingClientRect();this.offset.set(e.left,e.top),this.controller=new vf(this.container,this.camera,!0),this.graph=new Gu(this.container),this.multiSelector=new R2(this.container,this.controller),this.dummiesController=new bm(this.container,this.controller),this.bindControllerEvents(),this.initLabel()}destroy(){var t;this.unbindControllerEvents(),super.destroy(),(t=this.label)==null||t.destroy()}initLabel(){this.label=new pl(this.container,"")}showAssetsLabel(t,e,i){var o,l,c,f,d;if(!e)return;t||(t=(o=this.scene)==null?void 0:o.assetType);const a=(l=this.scene)==null?void 0:l.chef.getElementBoundingBox(e);a&&!a.isEmpty()&&(i||(i=(c=this.scene)==null?void 0:c.getAssetLabelById(t,e),i||(i=e)),(f=this.label)==null||f.setHtml(i),Ln.copy(a.min).applyMatrix3(this.camera.viewMatrix).add(this.offset).round(),(d=this.label)==null||d.show(Ln))}async hideAssetsLabel(){var t;return(t=this.label)==null?void 0:t.hide()}bindScene(t){var e;this.scene=t,this.multiSelector.bindScene(this.scene),(e=this.dummiesController)==null||e.bindScene(this.scene)}resize(){var t,e;(t=this.camera)==null||t.resize(),(e=this.controller)==null||e.resize(),console.log("【svgView】resize: ",this.params.width,this.params.height)}async setByBox(t,e=!0){await this.resetCameraByBoundingBox(t,e)}zoomIn(){this.controller.scaled=this.camera.scaled.x*.9,this.controller.update()}zoomOut(){this.controller.scaled=this.camera.scaled.x*1.1,this.controller.update()}zoomToSelectEnableChanged(t){console.log("TODO: zoomToSelectEnableChanged: ",t),this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}selectEnableChanged(t){this.selectEnable=!!t,this.multiSelector.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.multiSelector.multiSelectEnableChanged(t)}getIntersectObjects(t,e,i=[]){return this.scene?this.scene.getIntersectObjects(t,e,i):i}async focusAt(t,e=500){return this.camera?(Xt.setFromCenterAndSize(t,Ln.set(e*2,e*2)),this.resetCameraByBoundingBox(Xt,!0)):Promise.resolve()}async focusAtById(t,e=500){var a;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);if(console.log("focusAtById: ",t,i==null?void 0:i.toString()),i){i.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(i)||await this.resetCameraByBoundingBox(i,!0);return}}async focusAtDummy(t,e=500){var o,l;const i=this.dummiesController.getDummyById(t),a=(o=i==null?void 0:i.userData)==null?void 0:o.rmId;if(a){const c=(l=this.scene)==null?void 0:l.getBoundingBoxById(a);if(c){c.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(c)||await this.resetCameraByBoundingBox(c,!0);return}}if(i!=null&&i.position&&!(i!=null&&i.position.isEmpty())){Xt.setFromCenterAndSize(i.worldPosition,Ln.set(e*2,e*2)),this.camera.boundingBoxWorld.containsBox(Xt)||await this.resetCameraByBoundingBox(Xt,!0);return}}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return Promise.resolve();if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Ln),t.getSize(vl);const a=Math.max(vl.x/this.camera.width,vl.y/this.camera.height),o={x:Ln.x,y:Ln.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new yo.Tween(t).to(e,this.animateDuration).easing(yo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}fullscreen(){this.scene&&(this.scene&&!this.scene.viewBox.isEmpty()?Xt.copy(this.scene.viewBox):(this.scene.updateMatrixWorld(!0),this.scene.computeBoundingBox(),Xt.copy(this.scene.boundingBox)),this.resetCameraByBoundingBox(Xt,!0))}saveCameraPosition(t){Xt.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(Xt))}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);if(!i)return this.fullscreen();Xt.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Xt,!0)}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.addEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.addEventListener(Zu.SELECTED,this.multiSelectorSelectedHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.removeEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.removeEventListener(Zu.SELECTED,this.multiSelectorSelectedHandler)}handlePanStart(t){if(!((t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START)&&this.zoomToSelectEnable){this.p1.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1),this.graph.draw(Xt);return}}handlePanEnd(t){if(!((t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END)&&this.zoomToSelectEnable){this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera),this.setByBox(Xt),this.graph.hide(),Xt.makeEmpty();return}}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&this.zoomToSelectEnable&&(this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Xt))}handleControllerPointerOver(t){var a,o,l,c,f;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target);let i=e==null?void 0:e.id;(i==null?void 0:i.indexOf("dummy"))>-1?(i=e.getAttribute(as+"-id"),i&&this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:"dummy"},e:t.e})):i&&((c=this.scene)!=null&&c.isBelongsToAssetType(i,$e.WS))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.WS},e:t.e}):i&&((f=this.scene)!=null&&f.isBelongsToAssetType(i,$e.RM))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.RM},e:t.e}):(this._currentAssetId=void 0,this.dispatchEvent({type:"POINTERLEAVE",e:t.e})),this._currentAssetId=i}handleMultiSelectorSelected(t){console.warn("handleMultiSelectorSelected:",t.data),this.dispatchEvent({type:"SELECTED",data:t.data})}setDummies(t){this.dummiesController.setDummiesByVos(t)}clearDummies(t){this.dummiesController.clearDummies(t)}update(t){this.tween&&this.tween.update(t)}}const Xt=new _t,Ln=new P,vl=new P;var Nn=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="POINTEROVER",r.POINTERLEAVE="POINTERLEAVE",r))(Nn||{});class Im extends $u{name="SvgEmptyScene";constructor(t){super(t),this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
|
|
103
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var c=a.reduce(function(f,d){var g=d&&dm(d,i);return g&&f.push(g),f},[]);return da(r)?c[0]:c}ya.defaultProps=ar,ya.setDefaultProps=hm,ya.currentInput=ii,Object.assign({},_f,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}}),ya.setDefaultProps({render:op});let gm=0;const ji=ya(document.body,{theme:"translucent",animation:"scale",inertia:!0,delay:[200,100],content:"",allowHTML:!0,placement:"left-start",trigger:"manual",arrow:!0});class pl{constructor(t,e){this.container=t,this.text=e,t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.text=e}name="Label";id="Label"+gm++;el;position=new P;get isMounted(){return ji.state.isMounted}get isShown(){return ji.state.isShown}destroy(){this.text="",this.position.identity()}setHtml(t=""){return this.text=t,this}update(t){t&&(this.position.copy(t),ji.show())}async show(t){if(t)return await this.hide(),this.position.copy(t),ji.setContent(this.text),ji.setProps({getReferenceClientRect:()=>({width:0,height:0,right:this.position.x,left:this.position.x,bottom:this.position.y,top:this.position.y,x:this.position.x,y:this.position.y,toJSON(){}})}),ji.clearDelayTimeouts(),ji.show(),new Promise(e=>{Nt.delay(function(){e()},300)})}async hide(){return ji.hide(),new Promise(t=>{Nt.delay(function(){t()},100)})}}let ym=0;class mm extends Ge{name="DummyPoint";id="dummyPoint"+ym++;container;offset=new P;el;label;radius=10;position=new P;worldPosition=new P;userData;constructor(t,e){var a,o;super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,(a=this.userData)!=null&&a.type||Nt.set(this,"userData.type",_n.DEFAULT),this.initDom(),this.setType((o=this.userData)==null?void 0:o.type),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){var t;this.el&&((t=this.el)!=null&&t.parentNode||this.container.appendChild(this.el))}unmount(){var t,e,i,a;(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}setText(t=""){return this.el?(this.el.innerText=t,this):this}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-point"),this.el.setAttribute(as+"-id",(t=this.userData)==null?void 0:t.value)}initLabel(){var t;(t=this.userData)!=null&&t.label&&(this.label=new pl(this.container,this.userData.label))}setActive(t){return t?(ia(this.el,"active"),this.showLabel()):(na(this.el,"active"),this.hideLabel()),this}showLabel(){var t;(t=this.label)==null||t.show(vm.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t||(t=_n.DEFAULT),e&&oo(this.el,e)&&na(this.el,e),this.userData.type=t,ia(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const vm=new P;let xm=0;class Em extends Ge{name="DummyRect";id="dummyRect"+xm++;container;offset=new P;el;radius=10;position=new P;worldPosition=new P;label;userData;constructor(t,e){super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,this.initDom(),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){this.container.appendChild(this.el)}unmount(){var t,e,i,a;this.setText(""),(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-rect"),this.el.setAttribute(as+"-id",((t=this.userData)==null?void 0:t.rmId)||"undefined")}initLabel(){this.label=new pl(this.container,"")}setText(t=""){return this.el.innerText=t,this}setActive(t){return t?ia(this.el,"active"):na(this.el,"active"),this}showLabel(){var t;(t=this.label)==null||t.show(Am.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t=_n.DEFAULT,e&&oo(this.el,e)&&na(this.el,e),this.userData.type=t,ia(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const Am=new P;class wm extends Ge{name="Dummies";container;controller;scene;viewMatrix=new se;dummies=[];rmMap=new Map;mergedMap=new Map;cameraUpdateHandler=this.handleCameraUpdate.bind(this);controllerTapHandler=this.handleControllerTap.bind(this);constructor(t,e){super(),this.container=t,this.controller=e,this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.clearDummies()}bindEvents(){this.controller.camera.addEventListener(uo.UPDATE,this.cameraUpdateHandler),this.controller.addEventListener(ot.TAP,this.controllerTapHandler)}unbindEvents(){this.controller.camera.removeEventListener(uo.UPDATE,this.cameraUpdateHandler),this.controller.removeEventListener(ot.TAP,this.controllerTapHandler)}bindScene(t){this.scene=t}update(t){var e,i,a;if(t){this.viewMatrix.copy(t);for(let o=0,l=(this.dummies||[]).length;o<l;o++){const c=this.dummies[o],f=(i=this.scene)==null?void 0:i.getElementById((e=c.userData)==null?void 0:e.rmId);if(f){const d=(a=this.scene)==null?void 0:a.chef.getElementBoundingBox(f.id);d==null||d.getCenter(Ji),Ji.applyMatrix3(this.viewMatrix).round(),c.position.copy(Ji)}else Ji.copy(c.worldPosition).applyMatrix3(this.viewMatrix).round(),c.update(Ji)}this.mergeDummies()}}setDummies(t){this.clearDummies();for(let e=0,i=(t||[]).length;e<i;e++)this.addDummy(t[e])}addDummy(t){var a,o;const e=new mm(this.container,t);this.dummies.push(e);const i=(a=e.userData)==null?void 0:a.rmId;return i&&(this.rmMap.has(i)||this.rmMap.set(i,[]),(o=this.rmMap.get(i))==null||o.push(e)),e}removeDummy(t){var a;const e=this.dummies.indexOf(t);e>-1&&this.dummies.splice(e,1);const i=(a=t.userData)==null?void 0:a.rmId;if(i){const o=this.mergedMap.get(i);o==null||o.destroy(),this.mergedMap.delete(i);const l=this.rmMap.get(i);if(!l)return;if(l.length===1)this.rmMap.delete(i);else{const c=l.indexOf(t);c>-1&&(l.splice(c,1),this.rmMap.set(i,l))}}t.destroy()}clearDummies(t){var e,i,a;for(let o=(((e=this.dummies)==null?void 0:e.length)||0)-1;o>=0;o--){const l=this.dummies[o];(!t||(i=l==null?void 0:l.userData)!=null&&i.type&&(t!=null&&t.includes((a=l.userData)==null?void 0:a.type)))&&this.removeDummy(l)}t||(this.dummies.length=0,this.mergedMap.clear(),this.rmMap.clear())}mergeDummies(){this.rmMap.forEach((t,e)=>{var a,o,l,c;if((a=this.scene)==null?void 0:a.getElementById(e)){const f=(o=this.scene)==null?void 0:o.chef.getElementBoundingBox(e);if(!f)return;dl.copy(f).applyMatrix3(this.viewMatrix).round(),dl.getSize(Ji);const d=t[0].radius,g=dl.centralArrange(t.length,d*2,d*2);if(Ji.x<d*3||Ji.y<d*3){t.forEach(_=>_.unmount());const E=this.mergedMap.get(e);E==null||E.unmount()}else if(Array.isArray(g))this.mergedMap.has(e)&&((l=this.mergedMap.get(e))==null||l.unmount()),t.forEach((E,_)=>{E.isMounted||E.mount(),E.update(g[_])});else{t.forEach(C=>C.unmount());let E=this.mergedMap.get(e);if(E)E.isMounted||E.mount();else{const C=Nt.cloneDeep(t[0].userData)||{},R=Nt.reduce(t,(N,I)=>{var W,G;return(W=I.userData)!=null&&W.label&&N.push((G=I.userData)==null?void 0:G.label),N},[]);C.label=R.join(", ");const L=Nt.reduce(t,(N,I)=>{var W,G;return(W=I.userData)!=null&&W.value&&N.push((G=I.userData)==null?void 0:G.value),N},[]);C.value=L.join(","),C.rmId=e,E=new Em(this.container,C),this.mergedMap.set(e,E)}E.setText(t.length.toString());const _=Nt.reduce(t,(C,R)=>{var L,N;return(L=R.userData)!=null&&L.label&&C.push((N=R.userData)==null?void 0:N.label),C},[]);(c=E.label)==null||c.setHtml(_.join(", <br />")),E.update(t[0].position)}}})}getDummyById(t){return this.dummies.find(e=>{var i;return((i=e.userData)==null?void 0:i.value)===t})}setActiveByIds(t){var e,i;if(this.resetActives(),!!t&&(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length)))for(let a=0,o=t.length;a<o;a++){const l=this.getDummyById(t[a]);if(l&&l.setActive(!0),l&&((e=l.userData)!=null&&e.rmId)){const c=this.mergedMap.get((i=l.userData)==null?void 0:i.rmId);c&&c.setActive(!0)}}}resetActives(){this.dummies.forEach(t=>t.setActive(!1)),this.mergedMap.forEach(t=>t.setActive(!1))}showDummyLabel(t){if(!t)return;const e=this.getDummyById(t);e&&e.showLabel();const i=this.mergedMap.get(t);i&&i.showLabel()}async hideDummyLabel(){this.dummies.forEach(t=>t.hideLabel()),this.mergedMap.forEach(t=>t.hideLabel())}handleCameraUpdate(){this.update(this.controller.camera.viewMatrix)}handleControllerTap(t){var a,o,l,c,f;if((t==null?void 0:t.type)!==ot.TAP)return;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target)||((f=(c=t==null?void 0:t.e)==null?void 0:c.srcEvent)==null?void 0:f.srcElement),i=e==null?void 0:e.getAttribute(as+"-id");i&&console.warn("【TODO】handleControllerTap: ",i)}}const Ji=new P,dl=new _t;(function(){return window[Qi.prefixed(window,"requestAnimationFrame")]||function(r){window.setTimeout(r,1e3/60)}})();class bm extends Ge{name="DragController";dragFake=!1;container;offset=new P;controller;scene;raycaster;dummies;_els=[];_hms=new Map;_vos=new Map;_elMap=new Map;_panType=_n.SUCCESS;onPanHandler=this.handleOnPan.bind(this);panEndHandler=Nt.debounce(this.handlePanEnd.bind(this),500);constructor(t,e,i=!0){super(),this.container=t;let a=this.container.getBoundingClientRect();this.offset.set(a.left,a.top),this.controller=e,this.dummies=new wm(t,e),this.raycaster=new Af,this.dragFake=i}destroy(){var t;super.destroy();for(let e=(((t=this._els)==null?void 0:t.length)||0)-1;e>=0;e--)this.drop(this._els[e]);this.dummies.destroy()}bindScene(t){var e;this.scene=t,(e=this.dummies)==null||e.bindScene(t)}drag(t,e){t&&(this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,e)))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t),this._elMap.delete(t);const e=this._els.findIndex(i=>i===t);e>-1&&this._els.splice(e,1)}bindEvent(t){if(!t)return;const e=new Qi.Manager(t,{domEvents:!0});e.add(new Qi.Pan({threshold:0,pointers:0})),e.on(["panstart","panmove","panend"].join(" "),this.onPanHandler),this._hms.set(t,e)}unbindEvent(t){if(!t)return;const e=this._hms.get(t);e&&(e.off(["panstart","panmove","panend"].join(" "),this.onPanHandler),e.destroy(),this._hms.delete(t))}handleOnPan(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.srcEvent.stopImmediatePropagation=="function"&&t.srcEvent.stopImmediatePropagation(),!this.controller)return;t.type==="panstart"||t.isFirst?this.controller.enablePan=!1:t.type==="panmove"||t.type==="panend"&&(this.controller.enablePan=!0);const e=this._vos.get(t.target);if(!e)return;const i=Nt.cloneDeep(e);i.type=this._panType;const a=this._getDummy(t.target,i);ma.set(t.center.x,t.center.y).sub(this.offset),a.worldPosition.copy(ma).unproject(this.controller.camera),a.update(ma),this.panEndHandler({type:"panend",e:t})}handlePanEnd(t){if((t==null?void 0:t.type)!=="panend")return;const e=this.getDummies(!0);this.dispatchEvent({type:"panend",data:e})}getDummies(t=!0){const e=[];return this._els.forEach(i=>{var o;let a=this._vos.get(i);if(!(!a||a.type!==_n.SUCCESS)){if(t){const l=this._elMap.get(i);if(!l||!this.controller.camera)return;ma.copy(l.position),this.raycaster.setFromCamera(ma,this.controller.camera);const c=[];if((o=this.scene)==null||o.getIntersectObjects(this.raycaster,$e.RM,c),!(c!=null&&c.length))return;a=Nt.cloneDeep(a),a.rmId=c[0].id}e.push(a)}}),e}setDummiesByVos(t){var e,i;for(let a=0,o=(t||[]).length;a<o;a++){const l=(e=this.dummies)==null?void 0:e.addDummy(t[a]);if(!l)continue;const c=Nt.cloneDeep(t[a]);delete c.rmId,delete c.wsId,this.drag(l.el,c)}(i=this.dummies)==null||i.update(this.controller.camera.viewMatrix)}clearDummies(t){var e,i;for(let a=(((e=this._els)==null?void 0:e.length)||0)-1;a>=0;a--){const o=this._vos.get(this._els[a]);(!t||t&&(o!=null&&o.type)&&t.includes(o.type))&&this.drop(this._els[a])}(i=this.dummies)==null||i.clearDummies(t)}getDummyById(t){return this.dummies.getDummyById(t)}highlightDummies(t){var e;(e=this.dummies)==null||e.setActiveByIds(t)}resetHighlightDummies(){var t;(t=this.dummies)==null||t.resetActives()}showDummyLabel(t){var e;(e=this.dummies)==null||e.showDummyLabel(t)}start(){}_getDummy(t,e){let i=this._elMap.get(t);if(i||(i=this.dummies.addDummy(e).setType(_n.SUCCESS),this._elMap.set(t,i)),i.isMounted||i.mount(),this.dummies.dummies.includes(i)||this.dummies.dummies.push(i),!this._elMap.get(i.el)){this._elMap.set(i.el,i);const o=Nt.cloneDeep(e);delete o.rmId,delete o.wsId,this.drag(i.el,o)}return i}}const ma=new P;var ds=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-ds.Bounce.Out(1-r)},Out:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},InOut:function(r){return r<.5?ds.Bounce.In(r*2)*.5:ds.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),gs=function(){return performance.now()},up=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var a=0,o=e;a<o.length;a++){var l=o[a];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,a=t;i<a.length;i++){var o=a[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=gs()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var o=this._tweens[i[a]],l=!e;o&&o.update(t,l)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),On={Linear:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[a],r[a+1>e?e:a+1],i-a)},Bezier:function(r,t){for(var e=0,i=r.length-1,a=Math.pow,o=On.Utils.Bernstein,l=0;l<=i;l++)e+=a(1-t,i-l)*a(t,l)*r[l]*o(i,l);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(a=Math.floor(i=e*(1+t))),o(r[(a-1+e)%e],r[a],r[(a+1)%e],r[(a+2)%e],i-a)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[a?a-1:0],r[a],r[e<a+1?e:a+1],r[e<a+2?e:a+2],i-a)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=On.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,a){var o=(e-r)*.5,l=(i-t)*.5,c=a*a,f=a*c;return(2*t-2*e+o+l)*f+(-3*t+3*e-2*o-l)*c+o*a+t}}},gl=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),yl=new up,Tm=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ds.Linear.None,this._interpolationFunction=On.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=gl.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=yl,yl.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=gs()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var a={};for(var o in this._valuesEnd)a[o]=this._valuesEnd[o];this._valuesEnd=a}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,a,o){for(var l in i){var c=t[l],f=Array.isArray(c),d=f?"array":typeof c,g=!f&&Array.isArray(i[l]);if(!(d==="undefined"||d==="function")){if(g){var E=i[l];if(E.length===0)continue;for(var _=[c],C=0,R=E.length;C<R;C+=1){var L=this._handleRelativeValue(c,E[C]);if(isNaN(L)){g=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(L)}g&&(i[l]=_)}if((d==="object"||f)&&c&&!g){e[l]=f?[]:{};var N=c;for(var I in N)e[l][I]=N[I];a[l]=f?[]:{};var E=i[l];if(!this._isDynamic){var W={};for(var I in E)W[I]=E[I];i[l]=E=W}this._setupProperties(N,e[l],E,a[l],o)}else(typeof e[l]>"u"||o)&&(e[l]=c),f||(e[l]*=1),g?a[l]=i[l].slice().reverse():a[l]=e[l]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=gs()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=gs()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=ds.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=On.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,a;if(t===void 0&&(t=gs()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var l=t-this._startTime,c=this._duration+((a=this._repeatDelayTime)!==null&&a!==void 0?a:this._delayTime),f=this._duration+this._repeat*c,d=function(){if(i._duration===0||l>f)return 1;var L=Math.trunc(l/c),N=l-L*c,I=Math.min(N/i._duration,1);return I===0&&l===i._duration?1:I},g=d(),E=this._easingFunction(g);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,E),this._onUpdateCallback&&this._onUpdateCallback(this._object,g),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,R=this._chainedTweens.length;C<R;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,a){for(var o in i)if(e[o]!==void 0){var l=e[o]||0,c=i[o],f=Array.isArray(t[o]),d=Array.isArray(c),g=!f&&d;g?t[o]=this._interpolationFunction(c,a):typeof c=="object"&&c?this._updateProperties(t[o],l,c,a):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[o]=l+(c-l)*a))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}(),_m="25.0.0",Cm=gl.nextId,ni=yl,Dm=ni.getAll.bind(ni),Sm=ni.removeAll.bind(ni),Om=ni.add.bind(ni),Lm=ni.remove.bind(ni),Nm=ni.update.bind(ni),yo={Easing:ds,Group:up,Interpolation:On,now:gs,Sequence:gl,nextId:Cm,Tween:Tm,VERSION:_m,getAll:Dm,removeAll:Sm,add:Om,remove:Lm,update:Nm};class Mm extends Ge{name="View";params;visible=!0;cvs;scene;scenes=[];camera;controller;tween;animateDuration;constructor(t={}){super(),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new xf(t.camera||{})}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach(t=>t.destroy()),this.scenes.length=0,super.destroy()}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}saveCameraPosition(t){ys.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(ys))}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);i&&(ys.copy(JSON.parse(i)),this.resetCameraByBoundingBox(ys,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),ys.copy(this.scene.boundingBox).expandByVector(mo.set(t,t)),this.resetCameraByBoundingBox(ys,e))}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}reset(){}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(mo),t.getSize(ml);const a=Math.max(ml.x/this.camera.width,ml.y/this.camera.height),o={x:mo.x,y:mo.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new yo.Tween(t).to(e,this.animateDuration).easing(yo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}computeBoundingBox(t,e=new _t){return!t||!t.length||(e.makeEmpty(),t.forEach(i=>e.union(i.computeBoundingBox()))),e}expandScenesBoundingBox(t,e=new _t){t.forEach(i=>i.boundingBox.union(e))}update(t){this.tween&&this.tween.update(t)}}const Er="camera_position_",mo=new P,ml=new P,ys=new _t;class Bm extends Ge{name="SvgView";params;container;offset=new P;camera;controller;scene;p1=new P;p2=new P;graph;multiSelector;dummiesController;zoomToSelectEnable=!1;zoomBox=new _t;selectEnable=!1;multiSelectEnable=!1;fnEnable=!1;tween;animateDuration;label;controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerWheelStartHandler=this.handlePanStart.bind(this);controllerWheelEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);_currentAssetId;constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.camera||(this.params.camera={}),this.params.camera.flipY=!0,this.animateDuration=this.params.animateDuration||300,this.camera=new xf(this.params.camera),this.container=this.params.containerId?document.getElementById(this.params.containerId):kt.window.document.getElementsByTagName("body")[0];let e=this.container.getBoundingClientRect();this.offset.set(e.left,e.top),this.controller=new vf(this.container,this.camera,!0),this.graph=new Gu(this.container),this.multiSelector=new R2(this.container,this.controller),this.dummiesController=new bm(this.container,this.controller),this.bindControllerEvents(),this.initLabel()}destroy(){var t;this.unbindControllerEvents(),super.destroy(),(t=this.label)==null||t.destroy()}initLabel(){this.label=new pl(this.container,"")}showAssetsLabel(t,e,i){var o,l,c,f,d;if(!e)return;t||(t=(o=this.scene)==null?void 0:o.assetType);const a=(l=this.scene)==null?void 0:l.chef.getElementBoundingBox(e);a&&!a.isEmpty()&&(i||(i=(c=this.scene)==null?void 0:c.getAssetLabelById(t,e),i||(i=e)),(f=this.label)==null||f.setHtml(i),Ln.copy(a.min).applyMatrix3(this.camera.viewMatrix).add(this.offset).round(),(d=this.label)==null||d.show(Ln))}async hideAssetsLabel(){var t;return(t=this.label)==null?void 0:t.hide()}bindScene(t){var e;this.scene=t,this.multiSelector.bindScene(this.scene),(e=this.dummiesController)==null||e.bindScene(this.scene)}resize(){var t,e;(t=this.camera)==null||t.resize(),(e=this.controller)==null||e.resize(),console.log("【svgView】resize: ",this.params.width,this.params.height)}async setByBox(t,e=!0){await this.resetCameraByBoundingBox(t,e)}zoomIn(){this.controller.scaled=this.camera.scaled.x*.9,this.controller.update()}zoomOut(){this.controller.scaled=this.camera.scaled.x*1.1,this.controller.update()}zoomToSelectEnableChanged(t){console.log("TODO: zoomToSelectEnableChanged: ",t),this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}selectEnableChanged(t){this.selectEnable=!!t,this.multiSelector.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.multiSelector.multiSelectEnableChanged(t)}fnEnableChanged(t){this.fnEnable=!!t,this.multiSelector.fnEnableChanged(t)}getIntersectObjects(t,e,i=[]){return this.scene?this.scene.getIntersectObjects(t,e,i):i}async focusAt(t,e=500){return this.camera?(Xt.setFromCenterAndSize(t,Ln.set(e*2,e*2)),this.resetCameraByBoundingBox(Xt,!0)):Promise.resolve()}async focusAtById(t,e=500){var a;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);if(console.log("focusAtById: ",t,i==null?void 0:i.toString()),i){i.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(i)||await this.resetCameraByBoundingBox(i,!0);return}}async focusAtDummy(t,e=500){var o,l;const i=this.dummiesController.getDummyById(t),a=(o=i==null?void 0:i.userData)==null?void 0:o.rmId;if(a){const c=(l=this.scene)==null?void 0:l.getBoundingBoxById(a);if(c){c.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(c)||await this.resetCameraByBoundingBox(c,!0);return}}if(i!=null&&i.position&&!(i!=null&&i.position.isEmpty())){Xt.setFromCenterAndSize(i.worldPosition,Ln.set(e*2,e*2)),this.camera.boundingBoxWorld.containsBox(Xt)||await this.resetCameraByBoundingBox(Xt,!0);return}}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return Promise.resolve();if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Ln),t.getSize(vl);const a=Math.max(vl.x/this.camera.width,vl.y/this.camera.height),o={x:Ln.x,y:Ln.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new yo.Tween(t).to(e,this.animateDuration).easing(yo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}fullscreen(){this.scene&&(this.scene&&!this.scene.viewBox.isEmpty()?Xt.copy(this.scene.viewBox):(this.scene.updateMatrixWorld(!0),this.scene.computeBoundingBox(),Xt.copy(this.scene.boundingBox)),this.resetCameraByBoundingBox(Xt,!0))}saveCameraPosition(t){Xt.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(Xt))}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);if(!i)return this.fullscreen();Xt.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Xt,!0)}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.addEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.addEventListener(Zu.SELECTED,this.multiSelectorSelectedHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.removeEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.removeEventListener(Zu.SELECTED,this.multiSelectorSelectedHandler)}handlePanStart(t){if(!((t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START)&&this.zoomToSelectEnable){this.p1.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1),this.graph.draw(Xt);return}}handlePanEnd(t){if(!((t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END)&&this.zoomToSelectEnable){this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera),this.setByBox(Xt),this.graph.hide(),Xt.makeEmpty();return}}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&this.zoomToSelectEnable&&(this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Xt))}handleControllerPointerOver(t){var a,o,l,c,f;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target);let i=e==null?void 0:e.id;(i==null?void 0:i.indexOf("dummy"))>-1?(i=e.getAttribute(as+"-id"),i&&this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:"dummy"},e:t.e})):i&&((c=this.scene)!=null&&c.isBelongsToAssetType(i,$e.WS))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.WS},e:t.e}):i&&((f=this.scene)!=null&&f.isBelongsToAssetType(i,$e.RM))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.RM},e:t.e}):(this._currentAssetId=void 0,this.dispatchEvent({type:"POINTERLEAVE",e:t.e})),this._currentAssetId=i}handleMultiSelectorSelected(t){console.warn("handleMultiSelectorSelected:",t.data),this.dispatchEvent({type:"SELECTED",data:t.data})}setDummies(t){this.dummiesController.setDummiesByVos(t)}clearDummies(t){this.dummiesController.clearDummies(t)}update(t){this.tween&&this.tween.update(t)}}const Xt=new _t,Ln=new P,vl=new P;var Nn=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="POINTEROVER",r.POINTERLEAVE="POINTERLEAVE",r))(Nn||{});class Im extends $u{name="SvgEmptyScene";constructor(t){super(t),this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
|
|
104
104
|
<view id="defaultView" viewBox="-200 -200 500 500" />
|
|
105
105
|
<style>
|
|
106
106
|
/*#svg-loading-fast path {*/
|
|
@@ -149,4 +149,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
149
149
|
<path class="line" d="M103.5 46L187 46" />
|
|
150
150
|
<path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
|
|
151
151
|
</g>
|
|
152
|
-
</svg>`)}}class Rm extends Ge{name="SvgApp";params;renderer;view;scene;loadingScene;emptyScene;mainScene;zoomToSelectEnable=!1;zoomBox=new _t;selectEnable=!1;multiSelectEnable=!1;requestHeader={};runningHandler=this.running.bind(this);pointerOverHandler=this.handlePointerOver.bind(this);pointerLeaveHandler=this.handlePointerLeave.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);dragEndHandler=this.handleDragEnd.bind(this);constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.defaultFill||(this.params.defaultFill=Wt.getMoreTransparent($t.white,.3)),this.params.defaultStroke||(this.params.defaultStroke=Wt.getMoreTransparent($t.darkWhite,.8)),this.params.infoFill||(this.params.infoFill=Wt.getMoreTransparent($t.gray,.3)),this.params.infoStroke||(this.params.infoStroke=Wt.getMoreTransparent($t.darkGray,.8)),this.params.primaryFill||(this.params.primaryFill=Wt.getMoreTransparent($t.blue,.3)),this.params.primaryStroke||(this.params.primaryStroke=Wt.getMoreTransparent($t.darkBlue,.8)),this.params.successFill||(this.params.successFill=Wt.getMoreTransparent($t.green,.3)),this.params.successStroke||(this.params.successStroke=Wt.getMoreTransparent($t.darkGreen,.8)),this.params.warningFill||(this.params.warningFill=Wt.getMoreTransparent($t.yellow,.3)),this.params.warningStroke||(this.params.warningStroke=Wt.getMoreTransparent($t.darkYellow,.8)),this.params.dangerFill||(this.params.dangerFill=Wt.getMoreTransparent($t.red,.3)),this.params.dangerStroke||(this.params.dangerStroke=Wt.getMoreTransparent($t.darkRed,.8)),this.params.activeFill||(this.params.activeFill=Wt.getMoreTransparent($t.brown,.3)),this.params.activeStroke||(this.params.activeStroke=Wt.getMoreTransparent($t.darkBrown,.8)),this.renderer=new S0(t),this.view=new Bm(t),this.trans2LoadingScene()}get isLoadingScene(){var t;return((t=this.scene)==null?void 0:t.name)==="SvgLoadingScene"}destroy(){var t,e;this.unbindAssetsEvents(),super.destroy(),(t=this.view)==null||t.destroy(),(e=this.renderer)==null||e.destroy()}resize(){var t,e;(t=this.renderer)==null||t.resize(),(e=this.view)==null||e.resize()}isScene(t){var e;return((e=this.scene)==null?void 0:e.uuid)===t.uuid}removeScene(t){this.scene=void 0,t==null||t.destroy()}trans2MainScene(){var t,e;(t=this.scene)==null||t.unmount(),this.scene=this.mainScene,this.scene.isMounted||this.scene.mount(),this.view.bindScene(this.scene),(e=this.loadingScene)==null||e.destroy()}trans2LoadingScene(){var e,i;console.log("trans2LoadingScene: ",this.params),this.loadingScene=new B2(this.params),(e=this.scene)==null||e.unmount(),this.scene=this.loadingScene,this.scene.isMounted||this.scene.mount();const t=new _t().copy(this.loadingScene.viewBox).expandByVector(new P(1,1).multiplyScalar(150));console.log("trans2LoadingScene: ",t.toString()),this.view.setByBox(t,!1),(i=this.mainScene)==null||i.destroy()}trans2EmptyScene(){var e,i;console.log("trans2EmptyScene: ",this.params),this.emptyScene=new Im(this.params),(e=this.scene)==null||e.unmount(),this.scene=this.emptyScene,this.scene.isMounted||this.scene.mount();const t=new _t().copy(this.emptyScene.viewBox).expandByVector(new P(1,1).multiplyScalar(150));console.log("trans2EmptyScene: ",t.toString()),this.view.setByBox(t,!1),(i=this.mainScene)==null||i.destroy()}start(){requestAnimationFrame(this.runningHandler)}running(t){this.scene&&(this.scene.update(),this.renderer.render(this.scene,this.view.camera),this.view.update(t),requestAnimationFrame(this.runningHandler))}setRequestHeader(t){return this.requestHeader=t,this}async load(t,e,i=2,a){this.isLoadingScene||this.trans2LoadingScene(),await Pu(this.params.syncDelay);const o=await new $c().setRequestHeader(this.requestHeader).loadAsync(t).catch(()=>{this.trans2EmptyScene()});return this.loadByString(o,e,i)}loadByString(t,e,i=2){if(this.mainScene=new $u(this.params),!this.mainScene.bind(t))return this.trans2EmptyScene(),[];this.view.setByBox(this.mainScene.viewBox);const o=this.mainScene.getLayers(i);return e!=null&&e.length||(e=Nt.map(o,"label")),this.mainScene.showDefaultLayers(e,!0),this.trans2MainScene(),this.bindAssetsEvents(),console.log("svgApp.loadByString: ",o),o}setSkeletons(t){var e;(e=this.scene)==null||e.setSkeletonLayers(t)}getLayers(t=2){var e;return(e=this.scene)==null?void 0:e.getLayers(t)}getLayerVisible(t){var e;return(e=this.scene)==null?void 0:e.getLayerVisible(t)}updateLayersVisibility(t,e=!1,i=!0){var a;(a=this.scene)==null||a.updateLayersVisibility(t,e,i)}selectByIds(t){var e;(e=this.scene)==null||e.selectByIds(t,this.multiSelectEnable)}clearSelectedByIds(t){var e;Array.isArray(t)?t.forEach(i=>{var a;return(a=this.scene)==null?void 0:a.clearSelectedById(i)}):(e=this.scene)==null||e.clearSelectedById(t)}clearSelected(){var t;(t=this.scene)==null||t.clearSelected()}getSelectedIds(){var t;return(t=this.scene)==null?void 0:t.getSelectedIds()}async targetByIds(t,e=100){var i;this.scene&&((i=this.scene)==null||i.selectByIds(t,!1),xl.copy(this.scene.getSelectedBoundingBox()).expandByVector(new P(1,1).multiplyScalar(e)),await Pu(100),xl.isEmpty()||await this.view.setByBox(xl))}linkAssetsByTree(t){var e;(e=this.scene)==null||e.linkAssetsByTree(t)}setViewAreaLimit(t){this.renderer.viewAreaLimit=t}setAssetType(t,e){var i;(i=this.scene)==null||i.setAssetType(t,e)}getAssetIdsByType(t){var e;return(e=this.scene)==null?void 0:e.getAssetIdsByType(t)}clearFill(){var t;(t=this.scene)==null||t.clearFillOrStroke("fill")}clearFillByIds(t){var e;(e=this.scene)==null||e.clearFillOrStrokeByIds(t,"fill")}setFillByIds(t,e){var i;(i=this.scene)==null||i.setFillOrStrokeByIds(t,e,"fill")}clearStroke(){var t;(t=this.scene)==null||t.clearFillOrStroke("stroke")}clearStrokeByIds(t){var e;(e=this.scene)==null||e.clearFillOrStrokeByIds(t,"stroke")}setStrokeByIds(t,e){var i;(i=this.scene)==null||i.setFillOrStrokeByIds(t,e,"stroke")}getLegend(){var t;return(t=this.scene)==null?void 0:t.getLegend()}setAssetLabels(t,e){var i;(i=this.scene)==null||i.setAssetLabels(t,e)}clearAssetLabels(){var t;(t=this.scene)==null||t.clearAssetLabels()}fullscreen(){this.view.fullscreen()}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}focusAt(t,e=1e3){var i;(i=this.view)==null||i.focusAt(t,e)}async focusAtIds(t,e=100){if(!this.scene)return;const i=this.scene.getBoundingBoxByIds(t);i&&(i.expandByVector(new P(1,1).multiplyScalar(e)),await Pu(100),i.isEmpty()||await this.view.setByBox(i))}async focusAtById(t,e=1e3){var i;return(i=this.view)==null?void 0:i.focusAtById(t,e)}async focusAtDummy(t,e=1e3){var i;return(i=this.view)==null?void 0:i.focusAtDummy(t,e)}showAssetsLabel(t,e,i){var a,o,l,c;e?t==="dummy"?(l=(o=(a=this.view)==null?void 0:a.dummiesController)==null?void 0:o.dummies)==null||l.showDummyLabel(e):(c=this.view)==null||c.showAssetsLabel(t,e,i):this.hideAssetsLabel()}hideAssetsLabel(){var t,e,i,a;(i=(e=(t=this.view)==null?void 0:t.dummiesController)==null?void 0:e.dummies)==null||i.hideDummyLabel(),(a=this.view)==null||a.hideAssetsLabel()}highlightAssets(t,e){var i;(i=this.scene)==null||i.highlightAssets(t,e)}resetHighlightAssets(t){var e;(e=this.scene)==null||e.resetHighlightAssets(t)}fontZoomIn(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",1.1)}fontZoomOut(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",.9)}zoomToSelectEnableChanged(t){this.view.zoomToSelectEnableChanged(t)}selectEnableChanged(t){this.selectEnable=!!t,this.view.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.view.multiSelectEnableChanged(t)}socialDistanceEnableChanged(t){var e;(e=this.scene)==null||e.socialDistanceEnableChanged(t)}getBoundingBoxById(t,e=!0){var a;if(!t)return;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);return i&&e&&i.applyMatrix3(this.view.camera.viewMatrix).round(),i}setDummies(t){var e;(e=this.view)==null||e.setDummies(t)}clearDummies(t){var e;(e=this.view)==null||e.clearDummies(t)}highlightDummies(t){var e,i;(i=(e=this.view)==null?void 0:e.dummiesController)==null||i.highlightDummies(t)}resetHighlightDummies(){var t,e;(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.resetHighlightDummies()}bindAssetsEvents(){var t,e;this.view.addEventListener(Nn.POINTEROVER,this.pointerOverHandler),this.view.addEventListener(Nn.POINTERLEAVE,this.pointerLeaveHandler),this.view.addEventListener(Nn.SELECTED,this.multiSelectorSelectedHandler),(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.addEventListener("panend",this.dragEndHandler)}unbindAssetsEvents(){var t,e;this.view.removeEventListener(Nn.POINTEROVER,this.pointerOverHandler),this.view.removeEventListener(Nn.POINTERLEAVE,this.pointerLeaveHandler),this.view.removeEventListener(Nn.SELECTED,this.multiSelectorSelectedHandler),(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.removeEventListener("panend",this.dragEndHandler)}handleMultiSelectorSelected(t){this.dispatchEvent({type:"SELECTED",data:t.data})}handlePointerOver(t){this.dispatchEvent({type:"pointerover",data:t.data,e:t.e})}handlePointerLeave(t){this.dispatchEvent({type:"pointerleave",data:t.data,e:t.e})}handleInitializeStart(){console.log("App.initializeStart ...")}async handleInitializeComplete(t){console.log("App.initializeComplete ...",t),t!=null&&t.data&&this.launch()}handleDragEnd(t){this.dispatchEvent(t)}launch(){console.log("App.launch ...")}}const xl=new _t;var lp=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="pointerover",r.POINTERLEAVE="pointerleave",r.DRAG_END="panend",r))(lp||{}),St=(r=>(r.INIT="init",r.LOAD="load",r.LOADED="loaded",r.GET_LAYERS="getLayers",r.GET_ASSET_IDS_BY_TYPE="getAssetIdsByType",r.SET_FILL_BY_IDS="setFillByIds",r.CLEAR_FILL="clearFill",r.SET_STROKE_BY_IDS="setStrokeByIds",r.CLEAR_STROKE="clearStroke",r.TERMINATE="terminate",r.CAMERA_SYNC="cameraSync",r.ASSET_TYPE_CHANGED="assetTypeChanged",r.SVG_LOADING_TYPE_CHANGED="svgLoadingTypeChanged",r.USED_CACHE_CHANGED="usedCacheChanged",r.DEBOUNCE_CACHE_CHANGED="debounceCacheChanged",r.WIREFRAME_CHANGED="wireframeChanged",r.BG_PASS_CHANGED="bgPass",r.SELECT_ENABLE_CHANGED="selectEnableChanged",r.MULTI_SELECT_ENABLE_CHANGED="multiSelectEnableChanged",r.MULTI_SELECT_BY_RANGE="multiSelectByRange",r.ZOOM_TO_SELECT_ENABLE_CHANGED="zoomToSelectEnableChanged",r.FONT_ZOOM_IN="fontZoomIn",r.FONT_ZOOM_OUT="fontZoomOut",r.CAMERA_CHANGED="cameraChanged",r.SCENES_CHANGED="scenesChanged",r.UPDATE_LAYERS_VISIBILITY="updateLayersVisibility",r.DYNAMIC_LOADED="dynamicLoaded",r.SYNC_TEXTURE_HELPER_CACHED="syncTextureHelperCached",r.INITIALIZATION_START="INITIALIZATION_START",r.INITIALIZATION_COMPLETE="INITIALIZATION_COMPLETE",r.SELECTED="selected",r.SELECT_BY_IDS="selectByIds",r.CLEAR_SELECTED="clearSelected",r.TARGET_BY_IDS="targetByIds",r.TAP="tap",r.SINGLE_TAP="singletap",r.DOUBLE_TAP="doubletap",r.PRESS="press",r.PAN="pan",r.PAN_START="panstart",r.PAN_MOVE="panmove",r.PAN_END="panend",r.ROTATE="rotate",r.ROTATE_START="rotatestart",r.ROTATE_MOVE="rotatemove",r.ROTATE_END="rotateend",r.PINCH="pinch",r.PINCH_START="pinchstart",r.PINCH_MOVE="pinchmove",r.PINCH_END="pinchend",r.PINCH_IN="pinchin",r.PINCH_OUT="pinchout",r.SWIPE="swipe",r))(St||{});class Pm extends Mm{name="OpeView";container;graph;zoomToSelectEnable;multiSelectEnable;rayCaster=new Af;intersects=[];controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);constructor(t={}){super(t),this.container=this.params.cvs?this.params.cvs:this.params.canvasId?document.getElementById(this.params.canvasId):kt.window.document.getElementsByTagName("body")[0],console.warn("opeView.constructor: ",this.container,this.container.tagName),this.controller=new vf(this.container,this.camera),this.bindControllerEvents();let e=this.container.tagName.toLowerCase()!=="body"?this.container.parentNode:this.container;this.graph=new Gu(e)}destroy(){this.unbindControllerEvents(),this.controller&&this.controller.destroy(),super.destroy()}zoomToSelectEnableChanged(t=!1){this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}multiSelectEnableChanged(t=!1){this.multiSelectEnable=t,this.controller.enablePan=!this.multiSelectEnable}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler)}handlePanStart(t){(t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START||(this.zoomToSelectEnable||this.multiSelectEnable)&&(vo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(vo),this.graph.draw(tn))}async handlePanEnd(t){(t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END||((this.zoomToSelectEnable||this.multiSelectEnable)&&(xo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(vo).expandByPoint(xo).unproject(this.controller.camera),this.graph.hide()),this.zoomToSelectEnable&&await this.resetCameraByBoundingBox(tn,!0),this.multiSelectEnable&&this.dispatchEvent({type:St.MULTI_SELECT_BY_RANGE,data:tn.clone()}),tn.makeEmpty())}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&(this.zoomToSelectEnable||this.multiSelectEnable)&&(xo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(vo).expandByPoint(xo),this.graph.draw(tn))}handleControllerPointerOver(t){t==null||t.type,ot.POINTEROVER}handleMultiSelectorSelected(t){}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}}const vo=new P,xo=new P,tn=new _t;function hp(r){return!!(r&&r.constructor&&r.call&&r.apply)}const Fm="children",km="get",Hm="set",El="Changed";class Um extends Ge{name="Node2";userData={};_cache=new Map;_attachedDepsListeners=new Map;constructor(t){super(),this.setAttrs(t)}destroy(){super.destroy(),this._clearCache()}setAttrs(t){if(!t)return this;let e;for(const i in t)i!==Fm&&(e=Hm+i,hp(this[e])?this[e](t[i]):this.setAttr(i,t[i]));return this}setAttr(t,e){Object.hasOwnProperty.call(this,t)&&(this.userData[t]=e,this[t]=e)}getAttrs(){return this.userData||{}}getAttr(t){const e=km+Nt.capitalize(t);return hp(this[e])?this[e]():this.userData[t]}getAttrKey(){return Object.values(this.userData).filter(t=>!(t instanceof Array||t instanceof Object)).join("_")}_getCache(t,e){let i=this._cache.get(t);return(i===void 0||i.dirty===!0)&&(i=e.call(this),this._cache.set(t,i)),i}_clearCache(t){t===void 0?this._cache.clear():this._cache.has(t)&&this._cache.get(t).isMatrix3?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_setProperty(t){Object.hasOwnProperty.call(this,t)&&delete this[t],Object.defineProperty(this,t,{get(){return this.userData[t]},set(e){const i=this.userData[t];this.userData[t]=e,i!==e&&this.dispatchEvent({type:t+El,data:{oldVal:i,newVal:e}})},enumerable:!0,configurable:!0})}computed(t,e,i){if(!this._attachedDepsListeners.get(t)){const a=e.map(o=>o+El).join(",");this.addEventListeners(a,()=>this._clearCache(t)),e.forEach(o=>this._setProperty(o)),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)}watch(t,e){(t||[]).forEach(i=>{this._setProperty(i),this.addEventListener(i+El,e)})}}const Wr=new P;class qm extends Um{isTexture=!0;isRenderTargetTexture=!1;type="Texture";name="Texture";uuid=Uc();originSize=new P;originCenter=new P;size=new P;matrix=new se;matrixAutoUpdate=!0;userData={};version=0;_needsUpdate=!1;image;offset=new P;repeat=new P(1,1);center=new P;rotate=0;scale=1;flipY=!0;constructor(t={}){super(t),this.setAttrs(t)}destroy(){super.destroy()}set needsUpdate(t){t&&(this.version++,this._needsUpdate=!0)}get needsUpdate(){return this._needsUpdate}updateSize(t,e,i,a){return this.originSize.copy(t),this.originCenter.copy(e),this.flipY&&this.originCenter.multiplyScalar(1,-1),this.updateFinalSize(i,a)}updateFinalSize(t,e){t&&!P.isZero(t)&&!P.isEmpty(t)?Wr.copy(t):Wr.copy(this.originSize),Wr.maxXY(1,1);const i=Math.sqrt(Wr.x*Wr.x+Wr.y*Wr.y)/Math.sqrt(e.x*e.x+e.y*e.y);return i>1&&Wr.multiplyScalar(1/i),this.scale=Wr.length()/this.originSize.length(),this.repeat.multiplyScalar(this.originSize.length()/Wr.length()),this.size.copy(Wr),this.offset.copy(this.originSize).multiplyScalar(-.5).add(this.originCenter),this.updateMatrix(),this}reset(t,e){t&&this.originSize.copy(t),e&&this.size.copy(e),this.scale=this.size.x/this.originSize.x,this.repeat.set(1,1),this.center.set(0,0),this.rotate=0,this.offset.copy(this.originSize).multiplyScalar(.5).sub(this.originCenter).multiplyScalar(this.scale),this.updateMatrix()}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotate,this.center.x,this.center.y)}clone(){const t=this.constructor;return new t(this.attrs).copy(this)}copy(t){return this.name=t.name,this.originSize.copy(t.originSize),this.originCenter.copy(t.originCenter),this.size.copy(t.size),this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this.userData=JSON.parse(JSON.stringify(t.userData)),this.image=t.image,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotate=t.rotate,this.scale=t.scale,this.flipY=t.flipY,this}}class en{static cached=new Map;static precisionOptimized=!0;static precisionOptimizeLevels=[.5,.25,1e-4];static initialized=!1;static textureMaxSize=new P;static DEBUG_DisplayCachedTexture=Nt.throttle((t=80,e=.8)=>{let i=Vm();if(i||(i=zm(t,e)),!i)throw new Error("dom not found");$m(i,this.cached)},5e3);static destroy(){Object.values(this.cached).forEach(t=>{t.destroy()}),this.cached=new Map}static has(t){return this.cached.has(t)}static get(t,e){if(t)return!this.precisionOptimized||!e?this.cached.get(t):e&&e<this.precisionOptimizeLevels[2]?this.get(t+"_3"):e&&e<this.precisionOptimizeLevels[1]?this.get(t+"_2"):e&&e<this.precisionOptimizeLevels[0]?this.get(t+"_1"):this.get(t)}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e),e}static remove(t){if(!t||!this.cached.has(t))return;const e=this.cached.get(t);if(e&&e.destroy(),this.cached.delete(t),this.precisionOptimized)for(let i=1,a=this.precisionOptimizeLevels.length;i<=a;i++){const o=t+"_"+i;let l;this.cached.has(o)&&(l=this.cached.get(o),l&&l.destroy(),this.cached.delete(o))}}static clear(){this.destroy()}static setTextureMaxSize(){this.initialized||(this.textureMaxSize.set(kt.config.width,kt.config.height).multiplyScalar(.5).round(),this.initialized=!0)}static getTextureMaxSize(){return this.initialized||this.setTextureMaxSize(),this.textureMaxSize}static getTextureByShape(t,e,i,a){var l;const o=new qm;if(this.setTextureMaxSize(),o.scale=1,o.repeat.set(1,1),o.rotate=0,o.image=void 0,o.version=0,console.warn("getTextureByShape: ============================",t.name),e&&!P.isZero(e)&&!P.isEmpty(e))va.copy(e),t.alignCenter?t.boundingBox.getCenter(xa):xa.set(0,0);else{if(t.isShape&&((l=t.geometry)!=null&&l.boundingBox))Ao.copy(t.geometry.boundingBox);else if(t.boundingBox)Ao.copy(t.boundingBox);else throw new Error("get boundingBox error");Ao.getSize(va),t.alignCenter?t.boundingBox.getCenter(xa):Ao.getCenter(xa)}return i&&!P.isZero(i)&&!P.isEmpty(i)?Ci.copy(i):Ci.copy(va),(Ci.x<cp.x||Ci.y<cp.y)&&Ci.normalize().multiplyScalar(10).round(),ai.copy(this.getTextureMaxSize()),a&&(Ea.set((a==null?void 0:a.shadowBlur)||0,(a==null?void 0:a.shadowBlur)||0),Ci.add(Ea.clone().multiplyScalar(2)),va.multiplyScalar(3),ai.multiplyScalar(.3)),o.updateSize(va,xa,Ci,ai),o}static setPrecisionOptimizeTextures(t,e,i,a,o){if(!this.precisionOptimized)return;let l;for(let c=0,f=this.precisionOptimizeLevels.length;c<f;c++){ai.copy(i.size).multiplyScalar(this.precisionOptimizeLevels[c]);const d=this.getTextureByShape(e,a,ai,o);this.renderShapeTexture(e,d,o),l=t+"_"+(c+1),d.userData.textureKey=l,en.set(l,d)}}static renderShapeTexture(t,e,i){i?(Ea.set(i.shadowBlur||0,i.shadowBlur||0),si.copy(e.originSize).multiplyScalar(-.5).sub(e.originCenter).multiplyScalar(e.scale),t.alignCenter?Eo.copy(e.originSize).multiplyScalar(e.scale):Eo.copy(e.originSize).add(Ea.clone().multiplyScalar(1)).multiplyScalar(e.scale)):si.copy(e.offset).negate().multiplyScalar(e.scale);const a=wi.create(e.size.x,e.size.y),o=wi.getContext2D(a,{alpha:!0});if(t.isText||!t.matrix.hasChange())o.clearRect(0,0,a.width,a.height),o.translate(si.x,si.y),o.scale(e.scale,-e.scale);else{t.matrix.decompose(fp,Wm,pp);const l=1/pp.x;si.sub(fp.multiplyScalar(l,-l)),o.clearRect(0,0,a.width,a.height),o.translate(si.x,si.y),o.scale(l,-l)}i&&(o.shadowColor=$t.black,o.shadowOffsetX=Eo.x,o.shadowOffsetY=Eo.y,o.shadowBlur=Ea.x),t.render(o),e.image=a}static setByShape(t,e,i,a){const o=this.getTextureByShape(e,i,a);return o.userData.textureKey=t,this.renderShapeTexture(e,o),en.set(t,o),e.featureKey=t,o}static setShadowByShape(t,e,i){const a=this.getTextureByShape(e,void 0,void 0,i);return a.userData.textureKey=t,this.renderShapeTexture(e,a,i),en.set(t,a),a}static setPointsByShape(t,e){var d,g,E,_,C;const i=[];e.isGroup?e.traverse(R=>R.isShape?i.push(...R.geometry.points):void 0):e.isShape&&e.geometry.points?i.push(...e.geometry.points):e.boundingBox&&i.push(e.boundingBox.min,e.boundingBox.max);const a=this.getTextureByShape(e),o=((d=e.material)==null?void 0:d.lineWidth)*2||3;Di.set(1,1).multiplyScalar(o),a.size.copy(Di).multiplyScalar(a.scale).multiplyScalar(2).add(Ci),a.offset.sub(Di),a.updateMatrix();const l=wi.create(a.size.x,a.size.y),c=wi.getContext2D(l,{alpha:!0});si.subVectors(a.originSize.clone().multiplyScalar(.5),a.originCenter).add(Di),c.clearRect(0,0,l.width,l.height),c.scale(a.scale,a.scale),c.translate(si.x,si.y);let f=$t.black;e.material?f=((g=e.material)==null?void 0:g.stroke)||((E=e.material)==null?void 0:E.fill):e.isGroup&&e.children.length&&e.children[0].isShape&&(f=((_=e.children[0].material)==null?void 0:_.stroke)||((C=e.children[0].material)==null?void 0:C.fill)),c.fillStyle=Wt.getDarken(f);for(let R=0,L=i.length||0;R<L;R++)ai.copy(i[R]),c.moveTo(ai.x,ai.y),c.arc(ai.x,ai.y,Di.x,0,Math.PI*2);return c.fill(),a.image=l,en.set(t,a),a}static setWireframeByShape(t,e){var c;const i=this.getTextureByShape(e);Di.set(1,1).multiplyScalar(((c=e.mat)==null?void 0:c.lineWidth)||1),i.size.copy(Di).multiplyScalar(i.scale).multiplyScalar(2).add(Ci),i.offset.sub(Di),i.updateMatrix();const a=wi.create(i.size.x,i.size.y),o=wi.getContext2D(a,{alpha:!0}),l=Di.x*i.scale*5;return o.clearRect(0,0,a.width,a.height),o.strokeStyle=$t.darkGray,o.lineWidth=l,o.setLineDash([l*3,l]),o.strokeRect(0,0,i.size.x,i.size.y),i.image=a,en.set(t,i),i}}const cp=new P(10,10),va=new P,xa=new P,Ci=new P,si=new P,Eo=new P,Ea=new P,ai=new P,Di=new P,Ao=new _t,fp=new P,Wm=new P,pp=new P;function Vm(){return window.document.getElementById("DEBUG_Displaycached")}function zm(r=80,t=.8){const e=document.createElement("div");function i(){e.style.opacity="1"}function a(){e.style.opacity=t.toString()}return e.setAttribute("id","DEBUG_Displaycached"),e.style.position="absolute",e.style.width=r+"px",e.style.height="92vh",e.style.background=`rgba(255, 255, 255, ${t})`,e.style.left="20px",e.style.top="20px",e.style.overflow="auto",e.style.padding="6px",e.style.opacity=t.toString(),e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",a),document.body.appendChild(e),e}function $m(r,t){t.forEach((e,i)=>{!e||!e.image||Gm(r,i,e)})}function Gm(r,t,e){let i;for(let a=0,o=r.childNodes.length;a<o;a++)if(r.childNodes[a].getAttribute("id")===t){i=r.childNodes[a];break}i?Xm(i,e):Ym(r,t,e)}function Ym(r,t,e){if(!e.image)return;const i=kt.document.createElement("div");i.setAttribute("id",t),i.style.display="flex",i.style.flexDirection="column";const a=wi.createCanvas({containerId:r.id,width:e.image.width,height:e.image.height,dpr:window.devicePixelRatio});a.style.border=`${$t.yellow} 1px solid`,a.style.maxWidth=parseInt(r.style.width)-2+"px",a.style.maxHeight=parseInt(a.style.maxWidth)/(e.image.width/e.image.height)+"px";const o=a.getContext("2d",{alpha:!0});if(!o)throw new Error("getContext error");o.save(),o.scale(window.devicePixelRatio,window.devicePixelRatio),o.drawImage(e.image,0,0),o.restore(),i.appendChild(a);const l=kt.document.createElement("p");l.innerHTML=e.image.width+" * "+e.image.height,l.innerHTML+="<br/>"+t,l.style.margin="0",l.style.padding="0",l.style.lineHeight="1.2",l.style.fontSize="10px",l.style.padding="3px 0 6px 0",l.style.color=$t.black,i.appendChild(l),r.appendChild(i);function c(){const f=a.toDataURL("image/png",.6),d=document.createElement("a"),g=new MouseEvent("click");d.download=`thumb.${Date.now()}.png`,d.href=f,d.dispatchEvent(g)}i.addEventListener("click",c)}function Xm(r,t){if(!t.image)return;const e=r.querySelector("canvas");if(!e)return;const i=e.getContext("2d",{alpha:!0});if(!i)throw new Error("getContext error");i.clearRect(0,0,e.width,e.height),i.save(),i.scale(window.devicePixelRatio,window.devicePixelRatio),i.drawImage(t.image,0,0),i.restore()}class Zm extends Ge{cvs;worker;view;boundingBox=new _t;viewTapHandler=this.handleViewTap.bind(this);multiSelectByRangeHandler=this.handleMultiSelectByRange.bind(this);workerMessageHandler=this.handleWorkerMessage.bind(this);cameraHandler=this.handleCameraChanged.bind(this);runningHandler=this.running.bind(this);constructor(t={},e){super(),t.workerRender=!0,this.params=t,kt.config=t;const i=wi.createCanvas(t);if(!i.transferControlToOffscreen)throw new Error("not support transferControlToOffscreen");this.cvs=i.transferControlToOffscreen(),this.view=new Pm(t),this.view.camera.name="mainCamera",this.view.camera.resize(),this.worker=e,this.bindEvents()}destroy(){super.destroy(),this.unbindEvents(),this.worker.postMessage({task:St.TERMINATE}),this.worker.terminate()}bindEvents(){var t,e,i,a,o;(e=(t=this.view)==null?void 0:t.controller)==null||e.addEventListener(ot.TAP,this.viewTapHandler),(i=this.view)==null||i.addEventListener(St.MULTI_SELECT_BY_RANGE,this.multiSelectByRangeHandler),(o=(a=this.view)==null?void 0:a.camera)==null||o.addEventListener(uo.UPDATE,this.cameraHandler),this.worker.addEventListener("message",this.workerMessageHandler)}unbindEvents(){var t,e,i,a;(e=(t=this.view)==null?void 0:t.controller)==null||e.removeEventListener(ot.TAP,this.viewTapHandler),(a=(i=this.view)==null?void 0:i.controller)==null||a.removeEventListener(ot.CAMERA_CHANGED,this.cameraHandler),this.worker.removeEventListener("message",this.workerMessageHandler)}async handleViewTap(t){if((t==null?void 0:t.type)!==ot.TAP)return;const e=await this.promiseWorkerResponse(St.TAP,t.data);this.dispatchEvent({type:St.SELECTED,data:e})}handleWorkerMessage(t){var e,i,a,o,l,c;switch(t.data.task){case St.CAMERA_SYNC:if(!((e=t==null?void 0:t.data)!=null&&e.data))break;const f=JSON.parse(t.data.data);(a=(i=this.view)==null?void 0:i.camera)==null||a.fromJSON(f),this.view.camera.computeBoundingBox();break;case St.CAMERA_CHANGED:const{t:d,r:g,s:E}=t.data.data;(l=(o=this.view)==null?void 0:o.camera)==null||l.setTRS(d,g,E);break;case St.SCENES_CHANGED:const{box:_}=t.data.data;if(!_)return;this.boundingBox.fromString(_);break;case"syncTextureHelperCached":(((c=t.data)==null?void 0:c.data)||[]).forEach((C,R)=>en.set(R,C));break;case"pong":console.log("response: pong");break}}handleCameraChanged(t){this.worker.postMessage({task:St.CAMERA_CHANGED,data:t.data})}promiseWorkerResponse(t,e){return new Promise((i,a)=>{const o=c=>{var f;((f=c==null?void 0:c.data)==null?void 0:f.task)===t&&(this.worker.removeEventListener("message",o),this.worker.removeEventListener("error",l),i(c.data.data))},l=c=>{this.worker.removeEventListener("message",o),this.worker.removeEventListener("error",l),a(c.error)};this.worker.addEventListener("message",o),this.worker.addEventListener("error",l),this.worker.postMessage({task:t,data:e})})}async handleMultiSelectByRange(t){return this.promiseWorkerResponse(St.MULTI_SELECT_BY_RANGE,t.data)}resize(){var t;(t=this.view.camera)==null||t.resize()}async load(t,e){return this.promiseWorkerResponse(St.LOAD,{url:t,layers:e})}async getLayers(t=2){return this.promiseWorkerResponse(St.GET_LAYERS,{lv:t})}assetTypeChanged(t=$e.RM){this.params.assetType=t,this.worker.postMessage({task:St.ASSET_TYPE_CHANGED,data:t})}usedCacheChanged(t=!1){this.params.usedCache=t,this.worker.postMessage({task:St.USED_CACHE_CHANGED,data:t})}debounceCacheChanged(t=!1){this.params.debounceCache=t,this.worker.postMessage({task:St.DEBOUNCE_CACHE_CHANGED,data:t})}wireframeChanged(t=!1){this.params.wireframe=t,this.worker.postMessage({task:St.WIREFRAME_CHANGED,data:t})}bgPassChanged(t=!1){this.params.bgPass=t,this.worker.postMessage({task:St.BG_PASS_CHANGED,data:t})}async selectEnableChanged(t=!1){await this.clearSelected(),this.params.selectEnable=t,this.worker.postMessage({task:St.SELECT_ENABLE_CHANGED,data:t})}async multiSelectEnableChanged(t=!1){await this.clearSelected(),this.params.multiSelectEnable=t,this.view.multiSelectEnableChanged(t),this.worker.postMessage({task:St.MULTI_SELECT_ENABLE_CHANGED,data:t})}async zoomToSelectEnableChanged(t=!1){return this.params.zoomToSelectEnable=t,this.view.zoomToSelectEnableChanged(t),this.promiseWorkerResponse(St.ZOOM_TO_SELECT_ENABLE_CHANGED,{data:t})}async svgLoadingTypeChanged(t){return this.params.svgLoadingType=t,this.promiseWorkerResponse(St.SVG_LOADING_TYPE_CHANGED,t)}async fullscreen(){await this.view.resetCameraByBoundingBox(this.boundingBox,!0)}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}updateLayersVisibility(t,e=!1){this.worker.postMessage({task:St.UPDATE_LAYERS_VISIBILITY,data:{ids:t,visible:e}})}clearSelected(t){return this.promiseWorkerResponse(St.CLEAR_SELECTED,{data:t})}selectByIds(t){this.worker.postMessage({task:St.SELECT_BY_IDS,data:t})}targetByIds(t){this.worker.postMessage({task:St.TARGET_BY_IDS,data:t})}async getAssetIdsByType(t){return this.promiseWorkerResponse(St.GET_ASSET_IDS_BY_TYPE,{assetType:t})}setFillByIds(t,e){this.worker.postMessage({task:St.SET_FILL_BY_IDS,data:{ids:t,c:e}})}clearFill(){this.worker.postMessage({task:St.CLEAR_FILL})}setStrokeByIds(t,e){this.worker.postMessage({task:St.SET_STROKE_BY_IDS,data:{ids:t,c:e}})}clearStroke(){this.worker.postMessage({task:St.CLEAR_STROKE})}async fontZoomIn(t=1.1){return this.promiseWorkerResponse(St.FONT_ZOOM_IN,t)}async fontZoomOut(t=.9){return this.promiseWorkerResponse(St.FONT_ZOOM_OUT,t)}start(){const t=this.cvs,e=JSON.stringify(this.params);this.worker.postMessage({task:St.INIT,data:{cvs:t,config:e}},[t]),requestAnimationFrame(this.runningHandler)}running(t){var e;(e=this.view)==null||e.update(t),requestAnimationFrame(this.runningHandler),en.DEBUG_DisplayCachedTexture()}stop(){}}function Qm(r){return new Worker("/environment.worker.js",{type:"module",name:r==null?void 0:r.name})}function Km(r){return new Worker("/renderer.worker.js",{type:"module",name:r==null?void 0:r.name})}jt.AppEnum=lp,jt.AppOffscreen=Zm,jt.AssetTypeEnum=$e,jt.Box2=c0,jt.Color=Wt,jt.ColorsEnum=$t,jt.EnvironmentWorker=Qm,jt.GLOB=kt,jt.LayerTypeEnum=js,jt.Monitor=Ft,jt.RendererWorker=Km,jt.SvgApp=Rm,jt.Vector2=l0,jt.assetTypeConflicts=Mc,jt.defaultConfig=Zn,jt.getAssetLabelByType=Js,jt.getAssetLayerByType=os,Object.defineProperty(jt,Symbol.toStringTag,{value:"Module"})});
|
|
152
|
+
</svg>`)}}class Rm extends Ge{name="SvgApp";params;renderer;view;scene;loadingScene;emptyScene;mainScene;zoomToSelectEnable=!1;zoomBox=new _t;selectEnable=!1;multiSelectEnable=!1;fnEnable=!1;requestHeader={};runningHandler=this.running.bind(this);pointerOverHandler=this.handlePointerOver.bind(this);pointerLeaveHandler=this.handlePointerLeave.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);dragEndHandler=this.handleDragEnd.bind(this);constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.defaultFill||(this.params.defaultFill=Wt.getMoreTransparent($t.white,.3)),this.params.defaultStroke||(this.params.defaultStroke=Wt.getMoreTransparent($t.darkWhite,.8)),this.params.infoFill||(this.params.infoFill=Wt.getMoreTransparent($t.gray,.3)),this.params.infoStroke||(this.params.infoStroke=Wt.getMoreTransparent($t.darkGray,.8)),this.params.primaryFill||(this.params.primaryFill=Wt.getMoreTransparent($t.blue,.3)),this.params.primaryStroke||(this.params.primaryStroke=Wt.getMoreTransparent($t.darkBlue,.8)),this.params.successFill||(this.params.successFill=Wt.getMoreTransparent($t.green,.3)),this.params.successStroke||(this.params.successStroke=Wt.getMoreTransparent($t.darkGreen,.8)),this.params.warningFill||(this.params.warningFill=Wt.getMoreTransparent($t.yellow,.3)),this.params.warningStroke||(this.params.warningStroke=Wt.getMoreTransparent($t.darkYellow,.8)),this.params.dangerFill||(this.params.dangerFill=Wt.getMoreTransparent($t.red,.3)),this.params.dangerStroke||(this.params.dangerStroke=Wt.getMoreTransparent($t.darkRed,.8)),this.params.activeFill||(this.params.activeFill=Wt.getMoreTransparent($t.brown,.3)),this.params.activeStroke||(this.params.activeStroke=Wt.getMoreTransparent($t.darkBrown,.8)),this.renderer=new S0(t),this.view=new Bm(t),this.trans2LoadingScene()}get isLoadingScene(){var t;return((t=this.scene)==null?void 0:t.name)==="SvgLoadingScene"}destroy(){var t,e;this.unbindAssetsEvents(),super.destroy(),(t=this.view)==null||t.destroy(),(e=this.renderer)==null||e.destroy()}resize(){var t,e;(t=this.renderer)==null||t.resize(),(e=this.view)==null||e.resize()}isScene(t){var e;return((e=this.scene)==null?void 0:e.uuid)===t.uuid}removeScene(t){this.scene=void 0,t==null||t.destroy()}trans2MainScene(){var t,e;(t=this.scene)==null||t.unmount(),this.scene=this.mainScene,this.scene.isMounted||this.scene.mount(),this.view.bindScene(this.scene),(e=this.loadingScene)==null||e.destroy()}trans2LoadingScene(){var e,i;console.log("trans2LoadingScene: ",this.params),this.loadingScene=new B2(this.params),(e=this.scene)==null||e.unmount(),this.scene=this.loadingScene,this.scene.isMounted||this.scene.mount();const t=new _t().copy(this.loadingScene.viewBox).expandByVector(new P(1,1).multiplyScalar(150));console.log("trans2LoadingScene: ",t.toString()),this.view.setByBox(t,!1),(i=this.mainScene)==null||i.destroy()}trans2EmptyScene(){var e,i;console.log("trans2EmptyScene: ",this.params),this.emptyScene=new Im(this.params),(e=this.scene)==null||e.unmount(),this.scene=this.emptyScene,this.scene.isMounted||this.scene.mount();const t=new _t().copy(this.emptyScene.viewBox).expandByVector(new P(1,1).multiplyScalar(150));console.log("trans2EmptyScene: ",t.toString()),this.view.setByBox(t,!1),(i=this.mainScene)==null||i.destroy()}start(){requestAnimationFrame(this.runningHandler)}running(t){this.scene&&(this.scene.update(),this.renderer.render(this.scene,this.view.camera),this.view.update(t),requestAnimationFrame(this.runningHandler))}setRequestHeader(t){return this.requestHeader=t,this}async load(t,e,i=2,a){this.isLoadingScene||this.trans2LoadingScene(),await Pu(this.params.syncDelay);const o=await new $c().setRequestHeader(this.requestHeader).loadAsync(t).catch(()=>{this.trans2EmptyScene()});return this.loadByString(o,e,i)}loadByString(t,e,i=2){if(this.mainScene=new $u(this.params),!this.mainScene.bind(t))return this.trans2EmptyScene(),[];this.view.setByBox(this.mainScene.viewBox);const o=this.mainScene.getLayers(i);return e!=null&&e.length||(e=Nt.map(o,"label")),this.mainScene.showDefaultLayers(e,!0),this.trans2MainScene(),this.bindAssetsEvents(),console.log("svgApp.loadByString: ",o),o}setSkeletons(t){var e;(e=this.scene)==null||e.setSkeletonLayers(t)}getLayers(t=2){var e;return(e=this.scene)==null?void 0:e.getLayers(t)}getLayerVisible(t){var e;return(e=this.scene)==null?void 0:e.getLayerVisible(t)}updateLayersVisibility(t,e=!1,i=!0){var a;(a=this.scene)==null||a.updateLayersVisibility(t,e,i)}selectByIds(t){var e;(e=this.scene)==null||e.selectByIds(t,this.multiSelectEnable)}clearSelectedByIds(t){var e;Array.isArray(t)?t.forEach(i=>{var a;return(a=this.scene)==null?void 0:a.clearSelectedById(i)}):(e=this.scene)==null||e.clearSelectedById(t)}clearSelected(){var t;(t=this.scene)==null||t.clearSelected()}getSelectedIds(){var t;return(t=this.scene)==null?void 0:t.getSelectedIds()}async targetByIds(t,e=100){var i;this.scene&&((i=this.scene)==null||i.selectByIds(t,!1),xl.copy(this.scene.getSelectedBoundingBox()).expandByVector(new P(1,1).multiplyScalar(e)),await Pu(100),xl.isEmpty()||await this.view.setByBox(xl))}linkAssetsByTree(t){var e;(e=this.scene)==null||e.linkAssetsByTree(t)}setViewAreaLimit(t){this.renderer.viewAreaLimit=t}setAssetType(t,e){var i;(i=this.scene)==null||i.setAssetType(t,e)}getAssetIdsByType(t){var e;return(e=this.scene)==null?void 0:e.getAssetIdsByType(t)}clearFill(){var t;(t=this.scene)==null||t.clearFillOrStroke("fill")}clearFillByIds(t){var e;(e=this.scene)==null||e.clearFillOrStrokeByIds(t,"fill")}setFillByIds(t,e){var i;(i=this.scene)==null||i.setFillOrStrokeByIds(t,e,"fill")}clearStroke(){var t;(t=this.scene)==null||t.clearFillOrStroke("stroke")}clearStrokeByIds(t){var e;(e=this.scene)==null||e.clearFillOrStrokeByIds(t,"stroke")}setStrokeByIds(t,e){var i;(i=this.scene)==null||i.setFillOrStrokeByIds(t,e,"stroke")}getLegend(){var t;return(t=this.scene)==null?void 0:t.getLegend()}setAssetLabels(t,e){var i;(i=this.scene)==null||i.setAssetLabels(t,e)}clearAssetLabels(){var t;(t=this.scene)==null||t.clearAssetLabels()}fullscreen(){this.view.fullscreen()}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}focusAt(t,e=1e3){var i;(i=this.view)==null||i.focusAt(t,e)}async focusAtIds(t,e=100){if(!this.scene)return;const i=this.scene.getBoundingBoxByIds(t);i&&(i.expandByVector(new P(1,1).multiplyScalar(e)),await Pu(100),i.isEmpty()||await this.view.setByBox(i))}async focusAtById(t,e=1e3){var i;return(i=this.view)==null?void 0:i.focusAtById(t,e)}async focusAtDummy(t,e=1e3){var i;return(i=this.view)==null?void 0:i.focusAtDummy(t,e)}showAssetsLabel(t,e,i){var a,o,l,c;e?t==="dummy"?(l=(o=(a=this.view)==null?void 0:a.dummiesController)==null?void 0:o.dummies)==null||l.showDummyLabel(e):(c=this.view)==null||c.showAssetsLabel(t,e,i):this.hideAssetsLabel()}hideAssetsLabel(){var t,e,i,a;(i=(e=(t=this.view)==null?void 0:t.dummiesController)==null?void 0:e.dummies)==null||i.hideDummyLabel(),(a=this.view)==null||a.hideAssetsLabel()}highlightAssets(t,e){var i;(i=this.scene)==null||i.highlightAssets(t,e)}resetHighlightAssets(t){var e;(e=this.scene)==null||e.resetHighlightAssets(t)}fontZoomIn(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",1.1)}fontZoomOut(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",.9)}zoomToSelectEnableChanged(t){this.view.zoomToSelectEnableChanged(t)}selectEnableChanged(t){this.selectEnable=!!t,this.view.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.view.multiSelectEnableChanged(t)}socialDistanceEnableChanged(t){var e;(e=this.scene)==null||e.socialDistanceEnableChanged(t)}fnEnableChanged(t){this.fnEnable=!!t,this.view.fnEnableChanged(t)}getBoundingBoxById(t,e=!0){var a;if(!t)return;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);return i&&e&&i.applyMatrix3(this.view.camera.viewMatrix).round(),i}setDummies(t){var e;(e=this.view)==null||e.setDummies(t)}clearDummies(t){var e;(e=this.view)==null||e.clearDummies(t)}highlightDummies(t){var e,i;(i=(e=this.view)==null?void 0:e.dummiesController)==null||i.highlightDummies(t)}resetHighlightDummies(){var t,e;(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.resetHighlightDummies()}bindAssetsEvents(){var t,e;this.view.addEventListener(Nn.POINTEROVER,this.pointerOverHandler),this.view.addEventListener(Nn.POINTERLEAVE,this.pointerLeaveHandler),this.view.addEventListener(Nn.SELECTED,this.multiSelectorSelectedHandler),(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.addEventListener("panend",this.dragEndHandler)}unbindAssetsEvents(){var t,e;this.view.removeEventListener(Nn.POINTEROVER,this.pointerOverHandler),this.view.removeEventListener(Nn.POINTERLEAVE,this.pointerLeaveHandler),this.view.removeEventListener(Nn.SELECTED,this.multiSelectorSelectedHandler),(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.removeEventListener("panend",this.dragEndHandler)}handleMultiSelectorSelected(t){this.dispatchEvent({type:"SELECTED",data:t.data})}handlePointerOver(t){this.dispatchEvent({type:"pointerover",data:t.data,e:t.e})}handlePointerLeave(t){this.dispatchEvent({type:"pointerleave",data:t.data,e:t.e})}handleInitializeStart(){console.log("App.initializeStart ...")}async handleInitializeComplete(t){console.log("App.initializeComplete ...",t),t!=null&&t.data&&this.launch()}handleDragEnd(t){this.dispatchEvent(t)}launch(){console.log("App.launch ...")}}const xl=new _t;var lp=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="pointerover",r.POINTERLEAVE="pointerleave",r.DRAG_END="panend",r))(lp||{}),St=(r=>(r.INIT="init",r.LOAD="load",r.LOADED="loaded",r.GET_LAYERS="getLayers",r.GET_ASSET_IDS_BY_TYPE="getAssetIdsByType",r.SET_FILL_BY_IDS="setFillByIds",r.CLEAR_FILL="clearFill",r.SET_STROKE_BY_IDS="setStrokeByIds",r.CLEAR_STROKE="clearStroke",r.TERMINATE="terminate",r.CAMERA_SYNC="cameraSync",r.ASSET_TYPE_CHANGED="assetTypeChanged",r.SVG_LOADING_TYPE_CHANGED="svgLoadingTypeChanged",r.USED_CACHE_CHANGED="usedCacheChanged",r.DEBOUNCE_CACHE_CHANGED="debounceCacheChanged",r.WIREFRAME_CHANGED="wireframeChanged",r.BG_PASS_CHANGED="bgPass",r.SELECT_ENABLE_CHANGED="selectEnableChanged",r.MULTI_SELECT_ENABLE_CHANGED="multiSelectEnableChanged",r.MULTI_SELECT_BY_RANGE="multiSelectByRange",r.ZOOM_TO_SELECT_ENABLE_CHANGED="zoomToSelectEnableChanged",r.FONT_ZOOM_IN="fontZoomIn",r.FONT_ZOOM_OUT="fontZoomOut",r.CAMERA_CHANGED="cameraChanged",r.SCENES_CHANGED="scenesChanged",r.UPDATE_LAYERS_VISIBILITY="updateLayersVisibility",r.DYNAMIC_LOADED="dynamicLoaded",r.SYNC_TEXTURE_HELPER_CACHED="syncTextureHelperCached",r.INITIALIZATION_START="INITIALIZATION_START",r.INITIALIZATION_COMPLETE="INITIALIZATION_COMPLETE",r.SELECTED="selected",r.SELECT_BY_IDS="selectByIds",r.CLEAR_SELECTED="clearSelected",r.TARGET_BY_IDS="targetByIds",r.TAP="tap",r.SINGLE_TAP="singletap",r.DOUBLE_TAP="doubletap",r.PRESS="press",r.PAN="pan",r.PAN_START="panstart",r.PAN_MOVE="panmove",r.PAN_END="panend",r.ROTATE="rotate",r.ROTATE_START="rotatestart",r.ROTATE_MOVE="rotatemove",r.ROTATE_END="rotateend",r.PINCH="pinch",r.PINCH_START="pinchstart",r.PINCH_MOVE="pinchmove",r.PINCH_END="pinchend",r.PINCH_IN="pinchin",r.PINCH_OUT="pinchout",r.SWIPE="swipe",r))(St||{});class Pm extends Mm{name="OpeView";container;graph;zoomToSelectEnable;multiSelectEnable;rayCaster=new Af;intersects=[];controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);constructor(t={}){super(t),this.container=this.params.cvs?this.params.cvs:this.params.canvasId?document.getElementById(this.params.canvasId):kt.window.document.getElementsByTagName("body")[0],console.warn("opeView.constructor: ",this.container,this.container.tagName),this.controller=new vf(this.container,this.camera),this.bindControllerEvents();let e=this.container.tagName.toLowerCase()!=="body"?this.container.parentNode:this.container;this.graph=new Gu(e)}destroy(){this.unbindControllerEvents(),this.controller&&this.controller.destroy(),super.destroy()}zoomToSelectEnableChanged(t=!1){this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}multiSelectEnableChanged(t=!1){this.multiSelectEnable=t,this.controller.enablePan=!this.multiSelectEnable}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler)}handlePanStart(t){(t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START||(this.zoomToSelectEnable||this.multiSelectEnable)&&(vo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(vo),this.graph.draw(tn))}async handlePanEnd(t){(t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END||((this.zoomToSelectEnable||this.multiSelectEnable)&&(xo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(vo).expandByPoint(xo).unproject(this.controller.camera),this.graph.hide()),this.zoomToSelectEnable&&await this.resetCameraByBoundingBox(tn,!0),this.multiSelectEnable&&this.dispatchEvent({type:St.MULTI_SELECT_BY_RANGE,data:tn.clone()}),tn.makeEmpty())}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&(this.zoomToSelectEnable||this.multiSelectEnable)&&(xo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(vo).expandByPoint(xo),this.graph.draw(tn))}handleControllerPointerOver(t){t==null||t.type,ot.POINTEROVER}handleMultiSelectorSelected(t){}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}}const vo=new P,xo=new P,tn=new _t;function hp(r){return!!(r&&r.constructor&&r.call&&r.apply)}const Fm="children",km="get",Hm="set",El="Changed";class Um extends Ge{name="Node2";userData={};_cache=new Map;_attachedDepsListeners=new Map;constructor(t){super(),this.setAttrs(t)}destroy(){super.destroy(),this._clearCache()}setAttrs(t){if(!t)return this;let e;for(const i in t)i!==Fm&&(e=Hm+i,hp(this[e])?this[e](t[i]):this.setAttr(i,t[i]));return this}setAttr(t,e){Object.hasOwnProperty.call(this,t)&&(this.userData[t]=e,this[t]=e)}getAttrs(){return this.userData||{}}getAttr(t){const e=km+Nt.capitalize(t);return hp(this[e])?this[e]():this.userData[t]}getAttrKey(){return Object.values(this.userData).filter(t=>!(t instanceof Array||t instanceof Object)).join("_")}_getCache(t,e){let i=this._cache.get(t);return(i===void 0||i.dirty===!0)&&(i=e.call(this),this._cache.set(t,i)),i}_clearCache(t){t===void 0?this._cache.clear():this._cache.has(t)&&this._cache.get(t).isMatrix3?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_setProperty(t){Object.hasOwnProperty.call(this,t)&&delete this[t],Object.defineProperty(this,t,{get(){return this.userData[t]},set(e){const i=this.userData[t];this.userData[t]=e,i!==e&&this.dispatchEvent({type:t+El,data:{oldVal:i,newVal:e}})},enumerable:!0,configurable:!0})}computed(t,e,i){if(!this._attachedDepsListeners.get(t)){const a=e.map(o=>o+El).join(",");this.addEventListeners(a,()=>this._clearCache(t)),e.forEach(o=>this._setProperty(o)),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)}watch(t,e){(t||[]).forEach(i=>{this._setProperty(i),this.addEventListener(i+El,e)})}}const Wr=new P;class qm extends Um{isTexture=!0;isRenderTargetTexture=!1;type="Texture";name="Texture";uuid=Uc();originSize=new P;originCenter=new P;size=new P;matrix=new se;matrixAutoUpdate=!0;userData={};version=0;_needsUpdate=!1;image;offset=new P;repeat=new P(1,1);center=new P;rotate=0;scale=1;flipY=!0;constructor(t={}){super(t),this.setAttrs(t)}destroy(){super.destroy()}set needsUpdate(t){t&&(this.version++,this._needsUpdate=!0)}get needsUpdate(){return this._needsUpdate}updateSize(t,e,i,a){return this.originSize.copy(t),this.originCenter.copy(e),this.flipY&&this.originCenter.multiplyScalar(1,-1),this.updateFinalSize(i,a)}updateFinalSize(t,e){t&&!P.isZero(t)&&!P.isEmpty(t)?Wr.copy(t):Wr.copy(this.originSize),Wr.maxXY(1,1);const i=Math.sqrt(Wr.x*Wr.x+Wr.y*Wr.y)/Math.sqrt(e.x*e.x+e.y*e.y);return i>1&&Wr.multiplyScalar(1/i),this.scale=Wr.length()/this.originSize.length(),this.repeat.multiplyScalar(this.originSize.length()/Wr.length()),this.size.copy(Wr),this.offset.copy(this.originSize).multiplyScalar(-.5).add(this.originCenter),this.updateMatrix(),this}reset(t,e){t&&this.originSize.copy(t),e&&this.size.copy(e),this.scale=this.size.x/this.originSize.x,this.repeat.set(1,1),this.center.set(0,0),this.rotate=0,this.offset.copy(this.originSize).multiplyScalar(.5).sub(this.originCenter).multiplyScalar(this.scale),this.updateMatrix()}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotate,this.center.x,this.center.y)}clone(){const t=this.constructor;return new t(this.attrs).copy(this)}copy(t){return this.name=t.name,this.originSize.copy(t.originSize),this.originCenter.copy(t.originCenter),this.size.copy(t.size),this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this.userData=JSON.parse(JSON.stringify(t.userData)),this.image=t.image,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotate=t.rotate,this.scale=t.scale,this.flipY=t.flipY,this}}class en{static cached=new Map;static precisionOptimized=!0;static precisionOptimizeLevels=[.5,.25,1e-4];static initialized=!1;static textureMaxSize=new P;static DEBUG_DisplayCachedTexture=Nt.throttle((t=80,e=.8)=>{let i=Vm();if(i||(i=zm(t,e)),!i)throw new Error("dom not found");$m(i,this.cached)},5e3);static destroy(){Object.values(this.cached).forEach(t=>{t.destroy()}),this.cached=new Map}static has(t){return this.cached.has(t)}static get(t,e){if(t)return!this.precisionOptimized||!e?this.cached.get(t):e&&e<this.precisionOptimizeLevels[2]?this.get(t+"_3"):e&&e<this.precisionOptimizeLevels[1]?this.get(t+"_2"):e&&e<this.precisionOptimizeLevels[0]?this.get(t+"_1"):this.get(t)}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e),e}static remove(t){if(!t||!this.cached.has(t))return;const e=this.cached.get(t);if(e&&e.destroy(),this.cached.delete(t),this.precisionOptimized)for(let i=1,a=this.precisionOptimizeLevels.length;i<=a;i++){const o=t+"_"+i;let l;this.cached.has(o)&&(l=this.cached.get(o),l&&l.destroy(),this.cached.delete(o))}}static clear(){this.destroy()}static setTextureMaxSize(){this.initialized||(this.textureMaxSize.set(kt.config.width,kt.config.height).multiplyScalar(.5).round(),this.initialized=!0)}static getTextureMaxSize(){return this.initialized||this.setTextureMaxSize(),this.textureMaxSize}static getTextureByShape(t,e,i,a){var l;const o=new qm;if(this.setTextureMaxSize(),o.scale=1,o.repeat.set(1,1),o.rotate=0,o.image=void 0,o.version=0,console.warn("getTextureByShape: ============================",t.name),e&&!P.isZero(e)&&!P.isEmpty(e))va.copy(e),t.alignCenter?t.boundingBox.getCenter(xa):xa.set(0,0);else{if(t.isShape&&((l=t.geometry)!=null&&l.boundingBox))Ao.copy(t.geometry.boundingBox);else if(t.boundingBox)Ao.copy(t.boundingBox);else throw new Error("get boundingBox error");Ao.getSize(va),t.alignCenter?t.boundingBox.getCenter(xa):Ao.getCenter(xa)}return i&&!P.isZero(i)&&!P.isEmpty(i)?Ci.copy(i):Ci.copy(va),(Ci.x<cp.x||Ci.y<cp.y)&&Ci.normalize().multiplyScalar(10).round(),ai.copy(this.getTextureMaxSize()),a&&(Ea.set((a==null?void 0:a.shadowBlur)||0,(a==null?void 0:a.shadowBlur)||0),Ci.add(Ea.clone().multiplyScalar(2)),va.multiplyScalar(3),ai.multiplyScalar(.3)),o.updateSize(va,xa,Ci,ai),o}static setPrecisionOptimizeTextures(t,e,i,a,o){if(!this.precisionOptimized)return;let l;for(let c=0,f=this.precisionOptimizeLevels.length;c<f;c++){ai.copy(i.size).multiplyScalar(this.precisionOptimizeLevels[c]);const d=this.getTextureByShape(e,a,ai,o);this.renderShapeTexture(e,d,o),l=t+"_"+(c+1),d.userData.textureKey=l,en.set(l,d)}}static renderShapeTexture(t,e,i){i?(Ea.set(i.shadowBlur||0,i.shadowBlur||0),si.copy(e.originSize).multiplyScalar(-.5).sub(e.originCenter).multiplyScalar(e.scale),t.alignCenter?Eo.copy(e.originSize).multiplyScalar(e.scale):Eo.copy(e.originSize).add(Ea.clone().multiplyScalar(1)).multiplyScalar(e.scale)):si.copy(e.offset).negate().multiplyScalar(e.scale);const a=wi.create(e.size.x,e.size.y),o=wi.getContext2D(a,{alpha:!0});if(t.isText||!t.matrix.hasChange())o.clearRect(0,0,a.width,a.height),o.translate(si.x,si.y),o.scale(e.scale,-e.scale);else{t.matrix.decompose(fp,Wm,pp);const l=1/pp.x;si.sub(fp.multiplyScalar(l,-l)),o.clearRect(0,0,a.width,a.height),o.translate(si.x,si.y),o.scale(l,-l)}i&&(o.shadowColor=$t.black,o.shadowOffsetX=Eo.x,o.shadowOffsetY=Eo.y,o.shadowBlur=Ea.x),t.render(o),e.image=a}static setByShape(t,e,i,a){const o=this.getTextureByShape(e,i,a);return o.userData.textureKey=t,this.renderShapeTexture(e,o),en.set(t,o),e.featureKey=t,o}static setShadowByShape(t,e,i){const a=this.getTextureByShape(e,void 0,void 0,i);return a.userData.textureKey=t,this.renderShapeTexture(e,a,i),en.set(t,a),a}static setPointsByShape(t,e){var d,g,E,_,C;const i=[];e.isGroup?e.traverse(R=>R.isShape?i.push(...R.geometry.points):void 0):e.isShape&&e.geometry.points?i.push(...e.geometry.points):e.boundingBox&&i.push(e.boundingBox.min,e.boundingBox.max);const a=this.getTextureByShape(e),o=((d=e.material)==null?void 0:d.lineWidth)*2||3;Di.set(1,1).multiplyScalar(o),a.size.copy(Di).multiplyScalar(a.scale).multiplyScalar(2).add(Ci),a.offset.sub(Di),a.updateMatrix();const l=wi.create(a.size.x,a.size.y),c=wi.getContext2D(l,{alpha:!0});si.subVectors(a.originSize.clone().multiplyScalar(.5),a.originCenter).add(Di),c.clearRect(0,0,l.width,l.height),c.scale(a.scale,a.scale),c.translate(si.x,si.y);let f=$t.black;e.material?f=((g=e.material)==null?void 0:g.stroke)||((E=e.material)==null?void 0:E.fill):e.isGroup&&e.children.length&&e.children[0].isShape&&(f=((_=e.children[0].material)==null?void 0:_.stroke)||((C=e.children[0].material)==null?void 0:C.fill)),c.fillStyle=Wt.getDarken(f);for(let R=0,L=i.length||0;R<L;R++)ai.copy(i[R]),c.moveTo(ai.x,ai.y),c.arc(ai.x,ai.y,Di.x,0,Math.PI*2);return c.fill(),a.image=l,en.set(t,a),a}static setWireframeByShape(t,e){var c;const i=this.getTextureByShape(e);Di.set(1,1).multiplyScalar(((c=e.mat)==null?void 0:c.lineWidth)||1),i.size.copy(Di).multiplyScalar(i.scale).multiplyScalar(2).add(Ci),i.offset.sub(Di),i.updateMatrix();const a=wi.create(i.size.x,i.size.y),o=wi.getContext2D(a,{alpha:!0}),l=Di.x*i.scale*5;return o.clearRect(0,0,a.width,a.height),o.strokeStyle=$t.darkGray,o.lineWidth=l,o.setLineDash([l*3,l]),o.strokeRect(0,0,i.size.x,i.size.y),i.image=a,en.set(t,i),i}}const cp=new P(10,10),va=new P,xa=new P,Ci=new P,si=new P,Eo=new P,Ea=new P,ai=new P,Di=new P,Ao=new _t,fp=new P,Wm=new P,pp=new P;function Vm(){return window.document.getElementById("DEBUG_Displaycached")}function zm(r=80,t=.8){const e=document.createElement("div");function i(){e.style.opacity="1"}function a(){e.style.opacity=t.toString()}return e.setAttribute("id","DEBUG_Displaycached"),e.style.position="absolute",e.style.width=r+"px",e.style.height="92vh",e.style.background=`rgba(255, 255, 255, ${t})`,e.style.left="20px",e.style.top="20px",e.style.overflow="auto",e.style.padding="6px",e.style.opacity=t.toString(),e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",a),document.body.appendChild(e),e}function $m(r,t){t.forEach((e,i)=>{!e||!e.image||Gm(r,i,e)})}function Gm(r,t,e){let i;for(let a=0,o=r.childNodes.length;a<o;a++)if(r.childNodes[a].getAttribute("id")===t){i=r.childNodes[a];break}i?Xm(i,e):Ym(r,t,e)}function Ym(r,t,e){if(!e.image)return;const i=kt.document.createElement("div");i.setAttribute("id",t),i.style.display="flex",i.style.flexDirection="column";const a=wi.createCanvas({containerId:r.id,width:e.image.width,height:e.image.height,dpr:window.devicePixelRatio});a.style.border=`${$t.yellow} 1px solid`,a.style.maxWidth=parseInt(r.style.width)-2+"px",a.style.maxHeight=parseInt(a.style.maxWidth)/(e.image.width/e.image.height)+"px";const o=a.getContext("2d",{alpha:!0});if(!o)throw new Error("getContext error");o.save(),o.scale(window.devicePixelRatio,window.devicePixelRatio),o.drawImage(e.image,0,0),o.restore(),i.appendChild(a);const l=kt.document.createElement("p");l.innerHTML=e.image.width+" * "+e.image.height,l.innerHTML+="<br/>"+t,l.style.margin="0",l.style.padding="0",l.style.lineHeight="1.2",l.style.fontSize="10px",l.style.padding="3px 0 6px 0",l.style.color=$t.black,i.appendChild(l),r.appendChild(i);function c(){const f=a.toDataURL("image/png",.6),d=document.createElement("a"),g=new MouseEvent("click");d.download=`thumb.${Date.now()}.png`,d.href=f,d.dispatchEvent(g)}i.addEventListener("click",c)}function Xm(r,t){if(!t.image)return;const e=r.querySelector("canvas");if(!e)return;const i=e.getContext("2d",{alpha:!0});if(!i)throw new Error("getContext error");i.clearRect(0,0,e.width,e.height),i.save(),i.scale(window.devicePixelRatio,window.devicePixelRatio),i.drawImage(t.image,0,0),i.restore()}class Zm extends Ge{cvs;worker;view;boundingBox=new _t;viewTapHandler=this.handleViewTap.bind(this);multiSelectByRangeHandler=this.handleMultiSelectByRange.bind(this);workerMessageHandler=this.handleWorkerMessage.bind(this);cameraHandler=this.handleCameraChanged.bind(this);runningHandler=this.running.bind(this);constructor(t={},e){super(),t.workerRender=!0,this.params=t,kt.config=t;const i=wi.createCanvas(t);if(!i.transferControlToOffscreen)throw new Error("not support transferControlToOffscreen");this.cvs=i.transferControlToOffscreen(),this.view=new Pm(t),this.view.camera.name="mainCamera",this.view.camera.resize(),this.worker=e,this.bindEvents()}destroy(){super.destroy(),this.unbindEvents(),this.worker.postMessage({task:St.TERMINATE}),this.worker.terminate()}bindEvents(){var t,e,i,a,o;(e=(t=this.view)==null?void 0:t.controller)==null||e.addEventListener(ot.TAP,this.viewTapHandler),(i=this.view)==null||i.addEventListener(St.MULTI_SELECT_BY_RANGE,this.multiSelectByRangeHandler),(o=(a=this.view)==null?void 0:a.camera)==null||o.addEventListener(uo.UPDATE,this.cameraHandler),this.worker.addEventListener("message",this.workerMessageHandler)}unbindEvents(){var t,e,i,a;(e=(t=this.view)==null?void 0:t.controller)==null||e.removeEventListener(ot.TAP,this.viewTapHandler),(a=(i=this.view)==null?void 0:i.controller)==null||a.removeEventListener(ot.CAMERA_CHANGED,this.cameraHandler),this.worker.removeEventListener("message",this.workerMessageHandler)}async handleViewTap(t){if((t==null?void 0:t.type)!==ot.TAP)return;const e=await this.promiseWorkerResponse(St.TAP,t.data);this.dispatchEvent({type:St.SELECTED,data:e})}handleWorkerMessage(t){var e,i,a,o,l,c;switch(t.data.task){case St.CAMERA_SYNC:if(!((e=t==null?void 0:t.data)!=null&&e.data))break;const f=JSON.parse(t.data.data);(a=(i=this.view)==null?void 0:i.camera)==null||a.fromJSON(f),this.view.camera.computeBoundingBox();break;case St.CAMERA_CHANGED:const{t:d,r:g,s:E}=t.data.data;(l=(o=this.view)==null?void 0:o.camera)==null||l.setTRS(d,g,E);break;case St.SCENES_CHANGED:const{box:_}=t.data.data;if(!_)return;this.boundingBox.fromString(_);break;case"syncTextureHelperCached":(((c=t.data)==null?void 0:c.data)||[]).forEach((C,R)=>en.set(R,C));break;case"pong":console.log("response: pong");break}}handleCameraChanged(t){this.worker.postMessage({task:St.CAMERA_CHANGED,data:t.data})}promiseWorkerResponse(t,e){return new Promise((i,a)=>{const o=c=>{var f;((f=c==null?void 0:c.data)==null?void 0:f.task)===t&&(this.worker.removeEventListener("message",o),this.worker.removeEventListener("error",l),i(c.data.data))},l=c=>{this.worker.removeEventListener("message",o),this.worker.removeEventListener("error",l),a(c.error)};this.worker.addEventListener("message",o),this.worker.addEventListener("error",l),this.worker.postMessage({task:t,data:e})})}async handleMultiSelectByRange(t){return this.promiseWorkerResponse(St.MULTI_SELECT_BY_RANGE,t.data)}resize(){var t;(t=this.view.camera)==null||t.resize()}async load(t,e){return this.promiseWorkerResponse(St.LOAD,{url:t,layers:e})}async getLayers(t=2){return this.promiseWorkerResponse(St.GET_LAYERS,{lv:t})}assetTypeChanged(t=$e.RM){this.params.assetType=t,this.worker.postMessage({task:St.ASSET_TYPE_CHANGED,data:t})}usedCacheChanged(t=!1){this.params.usedCache=t,this.worker.postMessage({task:St.USED_CACHE_CHANGED,data:t})}debounceCacheChanged(t=!1){this.params.debounceCache=t,this.worker.postMessage({task:St.DEBOUNCE_CACHE_CHANGED,data:t})}wireframeChanged(t=!1){this.params.wireframe=t,this.worker.postMessage({task:St.WIREFRAME_CHANGED,data:t})}bgPassChanged(t=!1){this.params.bgPass=t,this.worker.postMessage({task:St.BG_PASS_CHANGED,data:t})}async selectEnableChanged(t=!1){await this.clearSelected(),this.params.selectEnable=t,this.worker.postMessage({task:St.SELECT_ENABLE_CHANGED,data:t})}async multiSelectEnableChanged(t=!1){await this.clearSelected(),this.params.multiSelectEnable=t,this.view.multiSelectEnableChanged(t),this.worker.postMessage({task:St.MULTI_SELECT_ENABLE_CHANGED,data:t})}async zoomToSelectEnableChanged(t=!1){return this.params.zoomToSelectEnable=t,this.view.zoomToSelectEnableChanged(t),this.promiseWorkerResponse(St.ZOOM_TO_SELECT_ENABLE_CHANGED,{data:t})}async svgLoadingTypeChanged(t){return this.params.svgLoadingType=t,this.promiseWorkerResponse(St.SVG_LOADING_TYPE_CHANGED,t)}async fullscreen(){await this.view.resetCameraByBoundingBox(this.boundingBox,!0)}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}updateLayersVisibility(t,e=!1){this.worker.postMessage({task:St.UPDATE_LAYERS_VISIBILITY,data:{ids:t,visible:e}})}clearSelected(t){return this.promiseWorkerResponse(St.CLEAR_SELECTED,{data:t})}selectByIds(t){this.worker.postMessage({task:St.SELECT_BY_IDS,data:t})}targetByIds(t){this.worker.postMessage({task:St.TARGET_BY_IDS,data:t})}async getAssetIdsByType(t){return this.promiseWorkerResponse(St.GET_ASSET_IDS_BY_TYPE,{assetType:t})}setFillByIds(t,e){this.worker.postMessage({task:St.SET_FILL_BY_IDS,data:{ids:t,c:e}})}clearFill(){this.worker.postMessage({task:St.CLEAR_FILL})}setStrokeByIds(t,e){this.worker.postMessage({task:St.SET_STROKE_BY_IDS,data:{ids:t,c:e}})}clearStroke(){this.worker.postMessage({task:St.CLEAR_STROKE})}async fontZoomIn(t=1.1){return this.promiseWorkerResponse(St.FONT_ZOOM_IN,t)}async fontZoomOut(t=.9){return this.promiseWorkerResponse(St.FONT_ZOOM_OUT,t)}start(){const t=this.cvs,e=JSON.stringify(this.params);this.worker.postMessage({task:St.INIT,data:{cvs:t,config:e}},[t]),requestAnimationFrame(this.runningHandler)}running(t){var e;(e=this.view)==null||e.update(t),requestAnimationFrame(this.runningHandler),en.DEBUG_DisplayCachedTexture()}stop(){}}function Qm(r){return new Worker("/environment.worker.js",{type:"module",name:r==null?void 0:r.name})}function Km(r){return new Worker("/renderer.worker.js",{type:"module",name:r==null?void 0:r.name})}jt.AppEnum=lp,jt.AppOffscreen=Zm,jt.AssetTypeEnum=$e,jt.Box2=c0,jt.Color=Wt,jt.ColorsEnum=$t,jt.EnvironmentWorker=Qm,jt.GLOB=kt,jt.LayerTypeEnum=js,jt.Monitor=Ft,jt.RendererWorker=Km,jt.SvgApp=Rm,jt.Vector2=l0,jt.assetTypeConflicts=Mc,jt.defaultConfig=Zn,jt.getAssetLabelByType=Js,jt.getAssetLayerByType=os,Object.defineProperty(jt,Symbol.toStringTag,{value:"Module"})});
|
package/lib/renderer.worker.js
CHANGED
|
@@ -4035,7 +4035,7 @@ var Gw = Vx((La) => {
|
|
|
4035
4035
|
Pa.normalizeLineEndings = Od;
|
|
4036
4036
|
Pa.DOMParser = Md;
|
|
4037
4037
|
var T_ = Pa.DOMParser;
|
|
4038
|
-
const C_ = "1.0.
|
|
4038
|
+
const C_ = "1.0.69";
|
|
4039
4039
|
function S_() {
|
|
4040
4040
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4041
4041
|
}
|