archgine 1.0.29 → 1.0.30
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/index.mjs +5 -3
- package/lib/index.umd.js +2 -2
- package/package.json +1 -1
|
@@ -3999,7 +3999,7 @@ Ms.__DOMHandler = yi;
|
|
|
3999
3999
|
Ms.normalizeLineEndings = Vc;
|
|
4000
4000
|
Ms.DOMParser = Gc;
|
|
4001
4001
|
var Uy = Ms.DOMParser;
|
|
4002
|
-
const qy = "1.0.
|
|
4002
|
+
const qy = "1.0.30";
|
|
4003
4003
|
function ky() {
|
|
4004
4004
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4005
4005
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -3995,7 +3995,7 @@ uu.__DOMHandler = ka;
|
|
|
3995
3995
|
uu.normalizeLineEndings = ig;
|
|
3996
3996
|
uu.DOMParser = rg;
|
|
3997
3997
|
var Cb = uu.DOMParser;
|
|
3998
|
-
const Db = "1.0.
|
|
3998
|
+
const Db = "1.0.30";
|
|
3999
3999
|
function Sb() {
|
|
4000
4000
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4001
4001
|
}
|
|
@@ -14112,8 +14112,10 @@ class Cg extends fE {
|
|
|
14112
14112
|
return this.assetsMap.hasOwnProperty(t) || this.setAssetsMap(t, this.assetsMap), this.assetsMap[t];
|
|
14113
14113
|
}
|
|
14114
14114
|
getElementById(t) {
|
|
14115
|
-
if (t)
|
|
14116
|
-
|
|
14115
|
+
if (!t) return;
|
|
14116
|
+
const e = this.getAssetsByType(this.assetType);
|
|
14117
|
+
if (!(!e || !Object.hasOwnProperty.call(e, t)))
|
|
14118
|
+
return e[t];
|
|
14117
14119
|
}
|
|
14118
14120
|
getAssetIdsByType(t) {
|
|
14119
14121
|
const e = this.getAssetsByType(t), r = [];
|
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:""}),i.entityMap=i.HTML_ENTITIES})(Nc);var Ou={},Gs=lr.NAMESPACE,Mu=/[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]/,Oc=new RegExp("[\\-\\.0-9"+Mu.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Mc=new RegExp("^"+Mu.source+Oc.source+"*(?::"+Mu.source+Oc.source+"*)?$"),Xs=0,Hr=1,Qn=2,Ys=3,Jn=4,ts=5,Zs=6,Ja=7;function es(i,t){this.message=i,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,es)}es.prototype=new Error,es.prototype.name=es.name;function Bc(){}Bc.prototype={parse:function(i,t,e){var r=this.domBuilder;r.startDocument(),Lc(t,t={}),b0(i,t,e,r,this.errorHandler),r.endDocument()}};function b0(i,t,e,r,s){function o(B){if(B>65535){B-=65536;var mt=55296+(B>>10),Mt=56320+(B&1023);return String.fromCharCode(mt,Mt)}else return String.fromCharCode(B)}function u(B){var mt=B.slice(1,-1);return Object.hasOwnProperty.call(e,mt)?e[mt]:mt.charAt(0)==="#"?o(parseInt(mt.substr(1).replace("x","0x"))):(s.error("entity not found:"+B),B)}function h(B){if(B>C){var mt=i.substring(C,B).replace(/&#?\w+;/g,u);E&&c(C),r.characters(mt,0,B-C),C=B}}function c(B,mt){for(;B>=g&&(mt=x.exec(i));)p=mt.index,g=p+mt[0].length,E.lineNumber++;E.columnNumber=B-p+1}for(var p=0,g=0,x=/.*(?:\r\n?|\n)|.*$/g,E=r.locator,w=[{currentNSMap:t}],M={},C=0;;){try{var _=i.indexOf("<",C);if(_<0){if(!i.substr(C).match(/^\s*$/)){var I=r.doc,W=I.createTextNode(i.substr(C));I.appendChild(W),r.currentElement=W}return}switch(_>C&&h(_),i.charAt(_+1)){case"/":var J=i.indexOf(">",_+3),H=i.substring(_+2,J).replace(/[ \t\n\r]+$/g,""),A=w.pop();J<0?(H=i.substring(_+2).replace(/[\s<].*/,""),s.error("end tag name: "+H+" is not complete:"+A.tagName),J=_+1+H.length):H.match(/\s</)&&(H=H.replace(/[\s<].*/,""),s.error("end tag name: "+H+" maybe not complete"),J=_+1+H.length);var V=A.localNSMap,F=A.tagName==H,K=F||A.tagName&&A.tagName.toLowerCase()==H.toLowerCase();if(K){if(r.endElement(A.uri,A.localName,H),V)for(var Z in V)Object.prototype.hasOwnProperty.call(V,Z)&&r.endPrefixMapping(Z);F||s.fatalError("end tag name: "+H+" is not match the current start tagName:"+A.tagName)}else w.push(A);J++;break;case"?":E&&c(_),J=_0(i,_,r);break;case"!":E&&c(_),J=T0(i,_,r,s);break;default:E&&c(_);var G=new Rc,j=w[w.length-1].currentNSMap,J=E0(i,_,G,j,u,s),nt=G.length;if(!G.closed&&A0(i,J,G.tagName,M)&&(G.closed=!0,e.nbsp||s.warning("unclosed xml attribute")),E&&nt){for(var ht=Ic(E,{}),gt=0;gt<nt;gt++){var ct=G[gt];c(ct.offset),ct.locator=Ic(E,{})}r.locator=ht,Pc(G,r,j)&&w.push(G),r.locator=E}else Pc(G,r,j)&&w.push(G);Gs.isHTML(G.uri)&&!G.closed?J=w0(i,J,G.tagName,u,r):J++}}catch(B){if(B instanceof es)throw B;s.error("element parse error: "+B),J=-1}J>C?C=J:h(Math.max(_,C)+1)}}function Ic(i,t){return t.lineNumber=i.lineNumber,t.columnNumber=i.columnNumber,t}function E0(i,t,e,r,s,o){function u(E,w,M){e.attributeNames.hasOwnProperty(E)&&o.fatalError("Attribute "+E+" redefined"),e.addValue(E,w.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),M)}for(var h,c,p=++t,g=Xs;;){var x=i.charAt(p);switch(x){case"=":if(g===Hr)h=i.slice(t,p),g=Ys;else if(g===Qn)g=Ys;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===Ys||g===Hr)if(g===Hr&&(o.warning('attribute value must after "="'),h=i.slice(t,p)),t=p+1,p=i.indexOf(x,t),p>0)c=i.slice(t,p),u(h,c,t-1),g=ts;else throw new Error("attribute value no end '"+x+"' match");else if(g==Jn)c=i.slice(t,p),u(h,c,t),o.warning('attribute "'+h+'" missed start quot('+x+")!!"),t=p+1,g=ts;else throw new Error('attribute value must after "="');break;case"/":switch(g){case Xs:e.setTagName(i.slice(t,p));case ts:case Zs:case Ja:g=Ja,e.closed=!0;case Jn:case Hr:break;case Qn:e.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),g==Xs&&e.setTagName(i.slice(t,p)),p;case">":switch(g){case Xs:e.setTagName(i.slice(t,p));case ts:case Zs:case Ja:break;case Jn:case Hr:c=i.slice(t,p),c.slice(-1)==="/"&&(e.closed=!0,c=c.slice(0,-1));case Qn:g===Qn&&(c=h),g==Jn?(o.warning('attribute "'+c+'" missed quot(")!'),u(h,c,t)):((!Gs.isHTML(r[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),u(c,c,t));break;case Ys:throw new Error("attribute value missed!!")}return p;case"":x=" ";default:if(x<=" ")switch(g){case Xs:e.setTagName(i.slice(t,p)),g=Zs;break;case Hr:h=i.slice(t,p),g=Qn;break;case Jn:var c=i.slice(t,p);o.warning('attribute "'+c+'" missed quot(")!!'),u(h,c,t);case ts:g=Zs;break}else switch(g){case Qn:e.tagName,(!Gs.isHTML(r[""])||!h.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+h+'" missed value!! "'+h+'" instead2!!'),u(h,h,t),t=p,g=Hr;break;case ts:o.warning('attribute space is required"'+h+'"!!');case Zs:g=Hr,t=p;break;case Ys:g=Jn,t=p;break;case Ja:throw new Error("elements closed character '/' and '>' must be connected to")}}p++}}function Pc(i,t,e){for(var r=i.tagName,s=null,x=i.length;x--;){var o=i[x],u=o.qName,h=o.value,E=u.indexOf(":");if(E>0)var c=o.prefix=u.slice(0,E),p=u.slice(E+1),g=c==="xmlns"&&p;else p=u,c=null,g=u==="xmlns"&&"";o.localName=p,g!==!1&&(s==null&&(s={},Lc(e,e={})),e[g]=s[g]=h,o.uri=Gs.XMLNS,t.startPrefixMapping(g,h))}for(var x=i.length;x--;){o=i[x];var c=o.prefix;c&&(c==="xml"&&(o.uri=Gs.XML),c!=="xmlns"&&(o.uri=e[c||""]))}var E=r.indexOf(":");E>0?(c=i.prefix=r.slice(0,E),p=i.localName=r.slice(E+1)):(c=null,p=i.localName=r);var w=i.uri=e[c||""];if(t.startElement(w,p,r,i),i.closed){if(t.endElement(w,p,r),s)for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&t.endPrefixMapping(c)}else return i.currentNSMap=e,i.localNSMap=s,!0}function w0(i,t,e,r,s){if(/^(?:script|textarea)$/i.test(e)){var o=i.indexOf("</"+e+">",t),u=i.substring(t+1,o);if(/[&<]/.test(u))return/^script$/i.test(e)?(s.characters(u,0,u.length),o):(u=u.replace(/&#?\w+;/g,r),s.characters(u,0,u.length),o)}return t+1}function A0(i,t,e,r){var s=r[e];return s==null&&(s=i.lastIndexOf("</"+e+">"),s<t&&(s=i.lastIndexOf("</"+e)),r[e]=s),s<t}function Lc(i,t){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])}function T0(i,t,e,r){var s=i.charAt(t+2);switch(s){case"-":if(i.charAt(t+3)==="-"){var o=i.indexOf("-->",t+4);return o>t?(e.comment(i,t+4,o-t-4),o+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(t+3,6)=="CDATA["){var o=i.indexOf("]]>",t+9);return e.startCDATA(),e.characters(i,t+9,o-t-9),e.endCDATA(),o+3}var u=C0(i,t),h=u.length;if(h>1&&/!doctype/i.test(u[0][0])){var c=u[1][0],p=!1,g=!1;h>3&&(/^public$/i.test(u[2][0])?(p=u[3][0],g=h>4&&u[4][0]):/^system$/i.test(u[2][0])&&(g=u[3][0]));var x=u[h-1];return e.startDTD(c,p,g),e.endDTD(),x.index+x[0].length}}return-1}function _0(i,t,e){var r=i.indexOf("?>",t);if(r){var s=i.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,e.processingInstruction(s[1],s[2]),r+2):-1}return-1}function Rc(){this.attributeNames={}}Rc.prototype={setTagName:function(i){if(!Mc.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,t,e){if(!Mc.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:t,offset:e}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function C0(i,t){var e,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=t,s.exec(i);e=s.exec(i);)if(r.push(e),e[1])return r}Ou.XMLReader=Bc,Ou.ParseError=es;var D0=lr,S0=kr,Fc=Nc,Uc=Ou,N0=S0.DOMImplementation,kc=D0.NAMESPACE,O0=Uc.ParseError,M0=Uc.XMLReader;function Hc(i){return i.replace(/\r[\n\u0085]/g,`
|
|
3
3
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
4
4
|
`)}function qc(i){this.options=i||{locator:{}}}qc.prototype.parseFromString=function(i,t){var e=this.options,r=new M0,s=e.domBuilder||new js,o=e.errorHandler,u=e.locator,h=e.xmlns||{},c=/\/x?html?$/.test(t),p=c?Fc.HTML_ENTITIES:Fc.XML_ENTITIES;u&&s.setDocumentLocator(u),r.errorHandler=B0(o,s,u),r.domBuilder=e.domBuilder||s,c&&(h[""]=kc.HTML),h.xml=h.xml||kc.XML;var g=e.normalizeLineEndings||Hc;return i&&typeof i=="string"?r.parse(g(i),h,p):r.errorHandler.error("invalid doc source"),s.doc};function B0(i,t,e){if(!i){if(t instanceof js)return t;i=t}var r={},s=i instanceof Function;e=e||{};function o(u){var h=i[u];!h&&s&&(h=i.length==2?function(c){i(u,c)}:i),r[u]=h&&function(c){h("[xmldom "+u+"] "+c+Bu(e))}||function(){}}return o("warning"),o("error"),o("fatalError"),r}function js(){this.cdata=!1}function is(i,t){t.lineNumber=i.lineNumber,t.columnNumber=i.columnNumber}js.prototype={startDocument:function(){this.doc=new N0().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,t,e,r){var s=this.doc,o=s.createElementNS(i,e||t),u=r.length;to(this,o),this.currentElement=o,this.locator&&is(this.locator,o);for(var h=0;h<u;h++){var i=r.getURI(h),c=r.getValue(h),e=r.getQName(h),p=s.createAttributeNS(i,e);this.locator&&is(r.getLocator(h),p),p.value=p.nodeValue=c,o.setAttributeNode(p)}},endElement:function(i,t,e){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(i,t){},endPrefixMapping:function(i){},processingInstruction:function(i,t){var e=this.doc.createProcessingInstruction(i,t);this.locator&&is(this.locator,e),to(this,e)},ignorableWhitespace:function(i,t,e){},characters:function(i,t,e){if(i=Wc.apply(this,arguments),i){if(this.cdata)var r=this.doc.createCDATASection(i);else var r=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(i)&&this.doc.appendChild(r),this.locator&&is(this.locator,r)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,t,e){i=Wc.apply(this,arguments);var r=this.doc.createComment(i);this.locator&&is(this.locator,r),to(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,t,e){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(i,t,e);this.locator&&is(this.locator,s),to(this,s),this.doc.doctype=s}},warning:function(i){console.warn("[xmldom warning] "+i,Bu(this.locator))},error:function(i){console.error("[xmldom error] "+i,Bu(this.locator))},fatalError:function(i){throw new O0(i,this.locator)}};function Bu(i){if(i)return`
|
|
5
|
-
@`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function Wc(i,t,e){return typeof i=="string"?i.substr(t,e):i.length>=t+e||t?new java.lang.String(i,t,e)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){js.prototype[i]=function(){return null}});function to(i,t){i.currentElement?i.currentElement.appendChild(t):i.doc.appendChild(t)}Qa.__DOMHandler=js,Qa.normalizeLineEndings=Hc,Qa.DOMParser=qc;var I0=Qa.DOMParser;const P0="1.0.29";function L0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const rs=typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{document:void 0,tinyEngine:void 0};rs.Path2D||e0(rs),rs.DOMParser||(rs.DOMParser=I0);const _t={window:rs,version:P0,isBrowser:L0(),dpr:typeof window<"u"&&window.devicePixelRatio||1,document:rs.document,time:0,deltaTime:0,config:Xn},Ks=(i,t,e)=>Math.max(t,Math.min(e,i)),qr=(i,t=1e-6)=>Math.abs(i)<t?0:i<0?-1:1,eo=i=>i*(Math.PI/180),R0=(i,t)=>(i%t+t)%t,Iu=(i,t,e)=>(1-e)*i+e*t,F0=i=>{let t=i*(180/Math.PI);return t<0&&(t+=360),t>360&&(t-=360),t},Rt={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)"},U0={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},Ci={h:0,s:0,l:0},io={h:0,s:0,l:0};function Pu(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}const k0=/^#([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 Ft{isColor=!0;r=1;g=1;b=1;a=1;constructor(t,e,r,s){return e===void 0&&r===void 0?this.set(t):this.setRGBA(t,e,r,s)}static isColor(t){return typeof t=="string"?k0.test(t):typeof t=="number"?t>=0&&t<=16777215:!1}static getRandomStyle(){return pr.random().getStyle()}static getDarken(t,e=.8){return pr.set(t).getHSL(ro),pr.setHSL(ro.h,ro.s,ro.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return pr.set(t),pr.getContrastString()}static getArray(t){return pr.set(t).toArray()}static getComplementary(t){return pr.set(t),pr.getComplementaryString()}static getMoreTransparent(t,e){return pr.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,r){return this.setRGBA(t,e,r,this.a)}setRGBA(t,e,r,s=1){return this.r=t,this.g=e,this.b=r,this.a=s,this}setHSL(t,e,r,s=1){if(t=R0(t,1),e=Ks(e,0,1),r=Ks(r,0,1),e===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+e):r+e-r*e,u=2*r-o;this.r=Pu(u,o,t+1/3),this.g=Pu(u,o,t),this.b=Pu(u,o,t-1/3)}return this.a=s,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const s=e[1],o=e[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const u=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,p=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0);return this.setHSL(u,h,c,p)}break}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=e[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this.a=1,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=U0[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("Color: Unknown color "+t),this}clone(){return new Ft(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 Ft){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Ft){const e=this.a,r=e*this.r+(1-e)*t.r,s=e*this.g+(1-e)*t.g,o=e*this.b+(1-e)*t.b;return new Ft(r,s,o)}getHex(){return Ks(this.r*255,0,255)<<16^Ks(this.g*255,0,255)<<8^Ks(this.b*255,0,255)<<0}getHSL(t){const e=this.r,r=this.g,s=this.b,o=Math.max(e,r,s),u=Math.min(e,r,s);let h=0,c;const p=(u+o)/2;if(u===o)h=0,c=0;else{const g=o-u;switch(c=p<=.5?g/(o+u):g/(2-o-u),o){case e:h=(r-s)/g+(r<s?6:0);break;case r:h=(s-e)/g+2;break;case s:h=(e-r)/g+4;break}h/=6}return t.h=h,t.s=c,t.l=p,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 Ft){const e=this.toArray(),r=[0,0,0,1];for(let s=0;s<e.length;s++)if(s<3)r[s]=1-e[s];else if(s===3)e[s]>1||e[s]<=0?r[s]=1:r[s]=Math.max(Math.min(parseFloat(e[s].toFixed(2)),1),0);else continue;return t.setRGBA(r[0],r[1],r[2],parseFloat(r[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(typeof t>"u"||t>=1)return this.getHexString();const e=this.getRGBByBg(),r=e.r*t+(1-t),s=e.g*t+(1-t),o=e.b*t+(1-t);return new Ft(r,s,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,r){return this.getHSL(Ci),Ci.h+=t,Ci.s+=e,Ci.l+=r,this.setHSL(Ci.h,Ci.s,Ci.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,r){return this.r=t.r+(e.r-t.r)*r,this.g=t.g+(e.g-t.g)*r,this.b=t.b+(e.b-t.b)*r,this}lerpHSL(t,e){this.getHSL(Ci),t.getHSL(io);const r=Iu(Ci.h,io.h,e),s=Iu(Ci.s,io.s,e),o=Iu(Ci.l,io.l,e);return this.setHSL(r,s,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 pr=new Ft,ro={h:0,s:0,l:0};class R{isVector2=!0;x=0;y=0;z;constructor(t=0,e=0,r){this.x=t,this.y=e,this.z=r||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,r=!0){return r?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 r=new ArrayBuffer(t.length*e*4),s=new Int32Array(r);for(let o=0,u=t.length;o<u;o++)s[o*2]=t[o].x,s[o*2+1]=t[o].y;return s}static getFloat64Array(t,e=2){const r=new ArrayBuffer(t.length*e*8),s=new Float64Array(r);for(let o=0,u=t.length;o<u;o++)s[o*2]=t[o].x,s[o*2+1]=t[o].y;return s}static getVectors(t){const e=[];for(let r=0,s=t.length;r<s;r++)e.push(new R(t[r].x,t[r].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let r=0,s=t.length;r<s;r++)e.push(R.getString(t[r]));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.y+t.y*e.x}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return new R().subVectors(t,e)}static isPointOnSegment(t,e,r){return qr(this.sub(t,r).cross(this.sub(e,r)))===0&&qr(this.sub(t,r).dot(this.sub(e,r)))<=0}static angle(t,e,r){return r?Math.atan2(t.y-e.y,t.x-e.x):F0(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let r=this.getClothoidPoints(t,e),s=0;for(let o=0,u=r.length;o<u;o++){let h=Math.max(0,o-1);o>0?s+=this.getDistance(r[h],r[h+1]):s=0,r[o].l=Math.round(s);let c=this.angle(r[h+1],r[h]);r[o].a=Math.round(c*100)/100}return r}static getClothoidPoints(t,e=100){let r=[],s=t.concat([]);if(!s||s.length<2)return r;s.length===2?(s.push(s[1]),s.unshift(s[0])):s.length===3&&s.splice(2,0,s[1]);for(let o=0;o<s.length-3;o+=3){let u=new R(s[o].x,s[o].y),h=new R(s[o+1].x,s[o+1].y),c=new R(s[o+2].x,s[o+2].y),p=new R(s[o+3].x,s[o+3].y),g=0;g+=u.distanceTo(h),g+=h.distanceTo(c),g+=c.distanceTo(p);let x=Math.min(.5,1/(g/e));for(let E=x;E<1;E+=x){let w=3*(h.x-u.x),M=3*(c.x-h.x)-w,C=p.x-u.x-w-M,_=3*(h.y-u.y),I=3*(c.y-h.y)-_,W=p.y-u.y-_-I,H=C*Math.pow(E,3)+M*Math.pow(E,2)+w*E+u.x,A=W*Math.pow(E,3)+I*Math.pow(E,2)+_*E+u.y;r.push({x:Math.round(H),y:Math.round(A),a:0,l:0})}}return r.unshift({x:s[0].x,y:s[0].y,a:0,l:0}),r.push({x:s[s.length-1].x,y:s[s.length-1].y,a:0,l:0}),r}static getClothoidLength(t){let e=0;if(t.length>2)for(let r=0;r<t.length;r++){let s=Math.max(0,r-1);r>0&&(e+=this.getDistance(t[s],t[s+1]))}return e}static getCircleCenterByChord(t,e,r,s=!0,o=new R){const u=this.getDistance(t,e);if(u===0)return o.x=1/0,o.y=1/0,o;Lu.set((t.x+e.x)/2,(t.y+e.y)/2);const h=Math.sqrt(r*r-u*u/4),c=s?-1:1;return o.x=Lu.x+c*h*(e.y-t.y)/u,o.y=Lu.y-c*h*(e.x-t.x)/u,o}static isPointInCircle(t,e,r){return this.getDistance(r,t)<e}static isPointInPolygonByRay(t,e){let r=0;const s=new R().copy(t),o=new R,u=new R;for(let h=0;h<e.length;h++){h===e.length-1?(o.copy(e[h]),u.copy(e[0])):(o.copy(e[h]),u.copy(e[h+1]));let c=[o.y,u.y].sort((p,g)=>p-g);c[0]<s.y&&c[1]>s.y&&(o.x<s.x||u.x<s.x)&&r++}return r%2===1}static whichSideOfSegment(t,e,r){return(e.x-t.x)*(r.y-t.y)-(r.x-t.x)*(e.y-t.y)}static getIntersectionOfSegments(t,e,r,s,o=!1,u=new R){const h=(s.y-r.y)*(e.x-t.x)-(s.x-r.x)*(e.y-t.y);if(h===0)return u.makeEmpty();const c=(s.x-r.x)*(t.y-r.y)-(s.y-r.y)*(t.x-r.x),p=(e.x-t.x)*(t.y-r.y)-(e.y-t.y)*(t.x-r.x),g=c/h,x=p/h;return o&&(g<0||g>1||x<0||x>1)?u.makeEmpty():(u.x=t.x+g*(e.x-t.x),u.y=t.y+g*(e.y-t.y),u)}static getConvexHullByGrahamScan(t,e=!1,r=[]){if(!t||!t.length)return r;const s=t.length;let o=0;for(let c=0;c<s;c++)t[c].x<t[o].x&&(o=c);let u=o,h;do{r.push(t[u]),h=(u+1)%s;for(let c=0;c<s;c++)this.whichSideOfSegment(t[u],t[c],t[h])>0&&(h=c);u=h}while(u!==o);return e&&r.push(t[o]),r}static getPointsWithMatrix3(t,e){const r=[];if(!t)return r;for(let s=0,o=t.length;s<o;s++)r.push({x:e.elements[0]*t[s].x+e.elements[3]*t[s].y+e.elements[6],y:e.elements[1]*t[s].x+e.elements[4]*t[s].y+e.elements[7]});return r}static getPointsApplyMatrix3(t,e=[]){for(let r=0,s=e.length;r<s;r++){const o=t.elements[0]*e[r].x+t.elements[3]*e[r].y+t.elements[6],u=t.elements[1]*e[r].x+t.elements[4]*e[r].y+t.elements[7];e[r].x=o,e[r].y=u}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,r=this.y,s=t.elements;return this.x=s[0]*e+s[3]*r+s[6],this.y=s[1]*e+s[4]*r+s[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))}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 R(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,r=this.y-t.y;return e*e+r*r}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.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,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.max(this.x,t),this.y=Math.max(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),r=Math.sin(t),s=this.x,o=this.y;return this.x=s*e-o*r,this.y=s*r+o*e,this}rotateAround(t,e){const r=Math.cos(e),s=Math.sin(e),o=this.x-t.x,u=this.y-t.y;return this.x=o*r-u*s+t.x,this.y=o*s+u*r+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 Lu=new R,H0=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));var no={exports:{}};/**
|
|
5
|
+
@`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function Wc(i,t,e){return typeof i=="string"?i.substr(t,e):i.length>=t+e||t?new java.lang.String(i,t,e)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){js.prototype[i]=function(){return null}});function to(i,t){i.currentElement?i.currentElement.appendChild(t):i.doc.appendChild(t)}Qa.__DOMHandler=js,Qa.normalizeLineEndings=Hc,Qa.DOMParser=qc;var I0=Qa.DOMParser;const P0="1.0.30";function L0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const rs=typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{document:void 0,tinyEngine:void 0};rs.Path2D||e0(rs),rs.DOMParser||(rs.DOMParser=I0);const _t={window:rs,version:P0,isBrowser:L0(),dpr:typeof window<"u"&&window.devicePixelRatio||1,document:rs.document,time:0,deltaTime:0,config:Xn},Ks=(i,t,e)=>Math.max(t,Math.min(e,i)),qr=(i,t=1e-6)=>Math.abs(i)<t?0:i<0?-1:1,eo=i=>i*(Math.PI/180),R0=(i,t)=>(i%t+t)%t,Iu=(i,t,e)=>(1-e)*i+e*t,F0=i=>{let t=i*(180/Math.PI);return t<0&&(t+=360),t>360&&(t-=360),t},Rt={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)"},U0={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},Ci={h:0,s:0,l:0},io={h:0,s:0,l:0};function Pu(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}const k0=/^#([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 Ft{isColor=!0;r=1;g=1;b=1;a=1;constructor(t,e,r,s){return e===void 0&&r===void 0?this.set(t):this.setRGBA(t,e,r,s)}static isColor(t){return typeof t=="string"?k0.test(t):typeof t=="number"?t>=0&&t<=16777215:!1}static getRandomStyle(){return pr.random().getStyle()}static getDarken(t,e=.8){return pr.set(t).getHSL(ro),pr.setHSL(ro.h,ro.s,ro.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return pr.set(t),pr.getContrastString()}static getArray(t){return pr.set(t).toArray()}static getComplementary(t){return pr.set(t),pr.getComplementaryString()}static getMoreTransparent(t,e){return pr.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,r){return this.setRGBA(t,e,r,this.a)}setRGBA(t,e,r,s=1){return this.r=t,this.g=e,this.b=r,this.a=s,this}setHSL(t,e,r,s=1){if(t=R0(t,1),e=Ks(e,0,1),r=Ks(r,0,1),e===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+e):r+e-r*e,u=2*r-o;this.r=Pu(u,o,t+1/3),this.g=Pu(u,o,t),this.b=Pu(u,o,t-1/3)}return this.a=s,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const s=e[1],o=e[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const u=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,p=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0);return this.setHSL(u,h,c,p)}break}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=e[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this.a=1,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=U0[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("Color: Unknown color "+t),this}clone(){return new Ft(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 Ft){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Ft){const e=this.a,r=e*this.r+(1-e)*t.r,s=e*this.g+(1-e)*t.g,o=e*this.b+(1-e)*t.b;return new Ft(r,s,o)}getHex(){return Ks(this.r*255,0,255)<<16^Ks(this.g*255,0,255)<<8^Ks(this.b*255,0,255)<<0}getHSL(t){const e=this.r,r=this.g,s=this.b,o=Math.max(e,r,s),u=Math.min(e,r,s);let h=0,c;const p=(u+o)/2;if(u===o)h=0,c=0;else{const g=o-u;switch(c=p<=.5?g/(o+u):g/(2-o-u),o){case e:h=(r-s)/g+(r<s?6:0);break;case r:h=(s-e)/g+2;break;case s:h=(e-r)/g+4;break}h/=6}return t.h=h,t.s=c,t.l=p,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 Ft){const e=this.toArray(),r=[0,0,0,1];for(let s=0;s<e.length;s++)if(s<3)r[s]=1-e[s];else if(s===3)e[s]>1||e[s]<=0?r[s]=1:r[s]=Math.max(Math.min(parseFloat(e[s].toFixed(2)),1),0);else continue;return t.setRGBA(r[0],r[1],r[2],parseFloat(r[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(typeof t>"u"||t>=1)return this.getHexString();const e=this.getRGBByBg(),r=e.r*t+(1-t),s=e.g*t+(1-t),o=e.b*t+(1-t);return new Ft(r,s,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,r){return this.getHSL(Ci),Ci.h+=t,Ci.s+=e,Ci.l+=r,this.setHSL(Ci.h,Ci.s,Ci.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,r){return this.r=t.r+(e.r-t.r)*r,this.g=t.g+(e.g-t.g)*r,this.b=t.b+(e.b-t.b)*r,this}lerpHSL(t,e){this.getHSL(Ci),t.getHSL(io);const r=Iu(Ci.h,io.h,e),s=Iu(Ci.s,io.s,e),o=Iu(Ci.l,io.l,e);return this.setHSL(r,s,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 pr=new Ft,ro={h:0,s:0,l:0};class R{isVector2=!0;x=0;y=0;z;constructor(t=0,e=0,r){this.x=t,this.y=e,this.z=r||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,r=!0){return r?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 r=new ArrayBuffer(t.length*e*4),s=new Int32Array(r);for(let o=0,u=t.length;o<u;o++)s[o*2]=t[o].x,s[o*2+1]=t[o].y;return s}static getFloat64Array(t,e=2){const r=new ArrayBuffer(t.length*e*8),s=new Float64Array(r);for(let o=0,u=t.length;o<u;o++)s[o*2]=t[o].x,s[o*2+1]=t[o].y;return s}static getVectors(t){const e=[];for(let r=0,s=t.length;r<s;r++)e.push(new R(t[r].x,t[r].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let r=0,s=t.length;r<s;r++)e.push(R.getString(t[r]));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.y+t.y*e.x}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return new R().subVectors(t,e)}static isPointOnSegment(t,e,r){return qr(this.sub(t,r).cross(this.sub(e,r)))===0&&qr(this.sub(t,r).dot(this.sub(e,r)))<=0}static angle(t,e,r){return r?Math.atan2(t.y-e.y,t.x-e.x):F0(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let r=this.getClothoidPoints(t,e),s=0;for(let o=0,u=r.length;o<u;o++){let h=Math.max(0,o-1);o>0?s+=this.getDistance(r[h],r[h+1]):s=0,r[o].l=Math.round(s);let c=this.angle(r[h+1],r[h]);r[o].a=Math.round(c*100)/100}return r}static getClothoidPoints(t,e=100){let r=[],s=t.concat([]);if(!s||s.length<2)return r;s.length===2?(s.push(s[1]),s.unshift(s[0])):s.length===3&&s.splice(2,0,s[1]);for(let o=0;o<s.length-3;o+=3){let u=new R(s[o].x,s[o].y),h=new R(s[o+1].x,s[o+1].y),c=new R(s[o+2].x,s[o+2].y),p=new R(s[o+3].x,s[o+3].y),g=0;g+=u.distanceTo(h),g+=h.distanceTo(c),g+=c.distanceTo(p);let x=Math.min(.5,1/(g/e));for(let E=x;E<1;E+=x){let w=3*(h.x-u.x),M=3*(c.x-h.x)-w,C=p.x-u.x-w-M,_=3*(h.y-u.y),I=3*(c.y-h.y)-_,W=p.y-u.y-_-I,H=C*Math.pow(E,3)+M*Math.pow(E,2)+w*E+u.x,A=W*Math.pow(E,3)+I*Math.pow(E,2)+_*E+u.y;r.push({x:Math.round(H),y:Math.round(A),a:0,l:0})}}return r.unshift({x:s[0].x,y:s[0].y,a:0,l:0}),r.push({x:s[s.length-1].x,y:s[s.length-1].y,a:0,l:0}),r}static getClothoidLength(t){let e=0;if(t.length>2)for(let r=0;r<t.length;r++){let s=Math.max(0,r-1);r>0&&(e+=this.getDistance(t[s],t[s+1]))}return e}static getCircleCenterByChord(t,e,r,s=!0,o=new R){const u=this.getDistance(t,e);if(u===0)return o.x=1/0,o.y=1/0,o;Lu.set((t.x+e.x)/2,(t.y+e.y)/2);const h=Math.sqrt(r*r-u*u/4),c=s?-1:1;return o.x=Lu.x+c*h*(e.y-t.y)/u,o.y=Lu.y-c*h*(e.x-t.x)/u,o}static isPointInCircle(t,e,r){return this.getDistance(r,t)<e}static isPointInPolygonByRay(t,e){let r=0;const s=new R().copy(t),o=new R,u=new R;for(let h=0;h<e.length;h++){h===e.length-1?(o.copy(e[h]),u.copy(e[0])):(o.copy(e[h]),u.copy(e[h+1]));let c=[o.y,u.y].sort((p,g)=>p-g);c[0]<s.y&&c[1]>s.y&&(o.x<s.x||u.x<s.x)&&r++}return r%2===1}static whichSideOfSegment(t,e,r){return(e.x-t.x)*(r.y-t.y)-(r.x-t.x)*(e.y-t.y)}static getIntersectionOfSegments(t,e,r,s,o=!1,u=new R){const h=(s.y-r.y)*(e.x-t.x)-(s.x-r.x)*(e.y-t.y);if(h===0)return u.makeEmpty();const c=(s.x-r.x)*(t.y-r.y)-(s.y-r.y)*(t.x-r.x),p=(e.x-t.x)*(t.y-r.y)-(e.y-t.y)*(t.x-r.x),g=c/h,x=p/h;return o&&(g<0||g>1||x<0||x>1)?u.makeEmpty():(u.x=t.x+g*(e.x-t.x),u.y=t.y+g*(e.y-t.y),u)}static getConvexHullByGrahamScan(t,e=!1,r=[]){if(!t||!t.length)return r;const s=t.length;let o=0;for(let c=0;c<s;c++)t[c].x<t[o].x&&(o=c);let u=o,h;do{r.push(t[u]),h=(u+1)%s;for(let c=0;c<s;c++)this.whichSideOfSegment(t[u],t[c],t[h])>0&&(h=c);u=h}while(u!==o);return e&&r.push(t[o]),r}static getPointsWithMatrix3(t,e){const r=[];if(!t)return r;for(let s=0,o=t.length;s<o;s++)r.push({x:e.elements[0]*t[s].x+e.elements[3]*t[s].y+e.elements[6],y:e.elements[1]*t[s].x+e.elements[4]*t[s].y+e.elements[7]});return r}static getPointsApplyMatrix3(t,e=[]){for(let r=0,s=e.length;r<s;r++){const o=t.elements[0]*e[r].x+t.elements[3]*e[r].y+t.elements[6],u=t.elements[1]*e[r].x+t.elements[4]*e[r].y+t.elements[7];e[r].x=o,e[r].y=u}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,r=this.y,s=t.elements;return this.x=s[0]*e+s[3]*r+s[6],this.y=s[1]*e+s[4]*r+s[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))}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 R(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,r=this.y-t.y;return e*e+r*r}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.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,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.max(this.x,t),this.y=Math.max(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),r=Math.sin(t),s=this.x,o=this.y;return this.x=s*e-o*r,this.y=s*r+o*e,this}rotateAround(t,e){const r=Math.cos(e),s=Math.sin(e),o=this.x-t.x,u=this.y-t.y;return this.x=o*r-u*s+t.x,this.y=o*s+u*r+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 Lu=new R,H0=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));var no={exports:{}};/**
|
|
6
6
|
* @license
|
|
7
7
|
* Lodash <https://lodash.com/>
|
|
8
8
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -36,7 +36,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
36
36
|
`;function C2(i,t){let e="";return t.format&&t.indentBy.length>0&&(e=_2),lf(i,t,"",e)}function lf(i,t,e,r){let s="",o=!1;for(let u=0;u<i.length;u++){const h=i[u],c=D2(h);if(c===void 0)continue;let p="";if(e.length===0?p=c:p=`${e}.${c}`,c===t.textNodeName){let M=h[c];S2(p,t)||(M=t.tagValueProcessor(c,M),M=cf(M,t)),o&&(s+=r),s+=M,o=!1;continue}else if(c===t.cdataPropName){o&&(s+=r),s+=`<![CDATA[${h[c][0][t.textNodeName]}]]>`,o=!1;continue}else if(c===t.commentPropName){s+=r+`<!--${h[c][0][t.textNodeName]}-->`,o=!0;continue}else if(c[0]==="?"){const M=hf(h[":@"],t),C=c==="?xml"?"":r;let _=h[c][0][t.textNodeName];_=_.length!==0?" "+_:"",s+=C+`<${c}${_}${M}?>`,o=!0;continue}let g=r;g!==""&&(g+=t.indentBy);const x=hf(h[":@"],t),E=r+`<${c}${x}`,w=lf(h[c],t,p,g);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?s+=E+">":s+=E+"/>":(!w||w.length===0)&&t.suppressEmptyNode?s+=E+"/>":w&&w.endsWith(">")?s+=E+`>${w}${r}</${c}>`:(s+=E+">",w&&r!==""&&(w.includes("/>")||w.includes("</"))?s+=r+t.indentBy+w+r:s+=w,s+=`</${c}>`),o=!0}return s}function D2(i){const t=Object.keys(i);for(let e=0;e<t.length;e++){const r=t[e];if(i.hasOwnProperty(r)&&r!==":@")return r}}function hf(i,t){let e="";if(i&&!t.ignoreAttributes)for(let r in i){if(!i.hasOwnProperty(r))continue;let s=t.attributeValueProcessor(r,i[r]);s=cf(s,t),s===!0&&t.suppressBooleanAttributes?e+=` ${r.substr(t.attributeNamePrefix.length)}`:e+=` ${r.substr(t.attributeNamePrefix.length)}="${s}"`}return e}function S2(i,t){i=i.substr(0,i.length-t.textNodeName.length-1);let e=i.substr(i.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===i||t.stopNodes[r]==="*."+e)return!0;return!1}function cf(i,t){if(i&&i.length>0&&t.processEntities)for(let e=0;e<t.entities.length;e++){const r=t.entities[e];i=i.replace(r.regex,r.val)}return i}var N2=C2;const O2=N2,M2={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(i,t){return t},attributeValueProcessor:function(i,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Wr(i){this.options=Object.assign({},M2,i),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=P2),this.processTextOrObjNode=B2,this.options.format?(this.indentate=I2,this.tagEndChar=`>
|
|
37
37
|
`,this.newLine=`
|
|
38
38
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Wr.prototype.build=function(i){return this.options.preserveOrder?O2(i,this.options):(Array.isArray(i)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(i={[this.options.arrayNodeName]:i}),this.j2x(i,0).val)},Wr.prototype.j2x=function(i,t){let e="",r="";for(let s in i)if(Object.prototype.hasOwnProperty.call(i,s))if(typeof i[s]>"u")this.isAttribute(s)&&(r+="");else if(i[s]===null)this.isAttribute(s)?r+="":s[0]==="?"?r+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(i[s]instanceof Date)r+=this.buildTextValNode(i[s],s,"",t);else if(typeof i[s]!="object"){const o=this.isAttribute(s);if(o)e+=this.buildAttrPairStr(o,""+i[s]);else if(s===this.options.textNodeName){let u=this.options.tagValueProcessor(s,""+i[s]);r+=this.replaceEntitiesValue(u)}else r+=this.buildTextValNode(i[s],s,"",t)}else if(Array.isArray(i[s])){const o=i[s].length;let u="",h="";for(let c=0;c<o;c++){const p=i[s][c];if(!(typeof p>"u"))if(p===null)s[0]==="?"?r+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(typeof p=="object")if(this.options.oneListGroup){const g=this.j2x(p,t+1);u+=g.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(h+=g.attrStr)}else u+=this.processTextOrObjNode(p,s,t);else if(this.options.oneListGroup){let g=this.options.tagValueProcessor(s,p);g=this.replaceEntitiesValue(g),u+=g}else u+=this.buildTextValNode(p,s,"",t)}this.options.oneListGroup&&(u=this.buildObjectNode(u,s,h,t)),r+=u}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const o=Object.keys(i[s]),u=o.length;for(let h=0;h<u;h++)e+=this.buildAttrPairStr(o[h],""+i[s][o[h]])}else r+=this.processTextOrObjNode(i[s],s,t);return{attrStr:e,val:r}},Wr.prototype.buildAttrPairStr=function(i,t){return t=this.options.attributeValueProcessor(i,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+i:" "+i+'="'+t+'"'};function B2(i,t,e){const r=this.j2x(i,e+1);return i[this.options.textNodeName]!==void 0&&Object.keys(i).length===1?this.buildTextValNode(i[this.options.textNodeName],t,r.attrStr,e):this.buildObjectNode(r.val,t,r.attrStr,e)}Wr.prototype.buildObjectNode=function(i,t,e,r){if(i==="")return t[0]==="?"?this.indentate(r)+"<"+t+e+"?"+this.tagEndChar:this.indentate(r)+"<"+t+e+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",s=""),(e||e==="")&&i.indexOf("<")===-1?this.indentate(r)+"<"+t+e+o+">"+i+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(r)+`<!--${i}-->`+this.newLine:this.indentate(r)+"<"+t+e+o+this.tagEndChar+i+this.indentate(r)+s}},Wr.prototype.closeTag=function(i){let t="";return this.options.unpairedTags.indexOf(i)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${i}`,t},Wr.prototype.buildTextValNode=function(i,t,e,r){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${i}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(r)+`<!--${i}-->`+this.newLine;if(t[0]==="?")return this.indentate(r)+"<"+t+e+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,i);return s=this.replaceEntitiesValue(s),s===""?this.indentate(r)+"<"+t+e+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+e+">"+s+"</"+t+this.tagEndChar}},Wr.prototype.replaceEntitiesValue=function(i){if(i&&i.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const e=this.options.entities[t];i=i.replace(e.regex,e.val)}return i};function I2(i){return this.options.indentBy.repeat(i)}function P2(i){return i.startsWith(this.options.attributeNamePrefix)&&i!==this.options.textNodeName?i.substr(this.attrPrefixLen):!1}var L2=Wr,ff={XMLParser:T2,XMLValidator:Gu,XMLBuilder:L2};class Zi extends _t.window.Path2D{vertices=[];commands=[];constructor(t){return super(t),this}destroy(){this.vertices.length=0}getVertices2(){return this.vertices}setVertices2(t){if(!t||!t.length)return this;const e=t.length;for(let r=0;r<e;r++)r?this.lineTo(t[r].x,t[r].y):this.moveTo(t[r].x,t[r].y);return R.equals(t[0],t[e-1])||this.lineTo(t[0].x,t[0].y),this}clone(){const t=this.constructor;return new t(this).copy(this)}copy(t){return this.vertices=at.cloneDeep(t.vertices),this.commands=at.cloneDeep(t.commands),this}rebuild(t){if(!this.commands||!this.commands.length)return this;this.vertices.length=0;const e=this.commands;this.commands=[];let r;for(let s=0,o=e.length;s<o;s++)switch(r=e[s],r.cmd){case"arc":this.arc(r.x,r.y,r.r,r.start,r.end,r.ccw);break;case"arcTo":this.arcTo(r.x1,r.y1,r.x2,r.y2,r.r);break;case"bezierCurveTo":this.bezierCurveTo(r.cp1x,r.cp1y,r.cp2x,r.cp2y,r.x,r.y);break;case"closePath":this.closePath();break;case"ellipse":this.ellipse(r.x,r.y,r.rx,r.ry,r.angle,r.start,r.end,r.ccw);break;case"lineTo":this.lineTo(r.x,r.y);break;case"moveTo":this.moveTo(r.x,r.y);break;case"quadraticCurveTo":this.quadraticCurveTo(r.cpx,r.cpy,r.x,r.y);break;case"rect":this.rect(r.x,r.y,r.width,r.height);break;case"roundRect":this.roundRect(r.x,r.y,r.width,r.height,r.radii);break;default:console.error(`unsupported type '${r.cmd}'`);break}return this}addPath(t){return super.addPath(t),typeof t.getVertices2=="function"&&(this.vertices=this.vertices.concat(t.getVertices2())),this}arc(t,e,r,s,o,u){super.arc(t,e,r,s,o,u);const h=[{x:t-r,y:e-r},{x:t-r,y:e+r},{x:t+r,y:e+r},{x:t+r,y:e-r}];return this.commands.push({cmd:"arc",x:t,y:e,start:s,end:o,ccw:u,points:h}),this}arcTo(t,e,r,s,o){super.arcTo(t,e,r,s,o);const u=[{x:t,y:e},{x:r,y:s}];return this.commands.push({cmd:"arcTo",x1:t,y1:e,x2:r,y2:s,r:o,points:u}),this.vertices.push(...u),this}bezierCurveTo(t,e,r,s,o,u){super.bezierCurveTo(t,e,r,s,o,u);const h=[{x:t,y:e},{x:r,y:s},{x:o,y:u}];return this.commands.push({cmd:"bezierCurveTo",cp1x:t,cp1y:e,cp2x:r,cp2y:s,x:o,y:u,points:h}),this.vertices.push(...h),this}closePath(){return super.closePath(),this.commands.push({cmd:"closePath"}),this}ellipse(t,e,r,s,o,u,h,c){super.ellipse(t,e,r,s,o,u,h,c);const p=Math.max(r,s),g=[{x:t-p,y:e-p},{x:t+p,y:e+p}];return this.commands.push({cmd:"ellipse",x:t,y:e,rx:r,ry:s,angle:o,start:u,end:h,ccw:c,points:g}),this.vertices.push(...g),this}lineTo(t,e){super.lineTo(t,e);const r=[{x:t,y:e}];return this.commands.push({cmd:"lineTo",x:t,y:e,points:r}),this.vertices.push(...r),this}moveTo(t,e){super.moveTo(t,e);const r=[{x:t,y:e}];return this.commands.push({cmd:"moveTo",x:t,y:e,points:r}),this.vertices.push(...r),this}quadraticCurveTo(t,e,r,s){super.quadraticCurveTo(t,e,r,s);const o=[{x:t,y:e},{x:r,y:s}];return this.commands.push({cmd:"quadraticCurveTo",cpx:t,cpy:e,x:r,y:s,points:o}),this.vertices.push(...o),this}rect(t,e,r,s){super.rect(t,e,r,s);const o=[{x:t,y:e},{x:t+r,y:e},{x:t+r,y:e+s},{x:t,y:e+s}];return this.commands.push({cmd:"rect",x:t,y:e,width:r,height:s,points:o}),this.vertices.push(...o),this}roundRect(t,e,r,s,o){super.roundRect(t,e,r,s,o);const u=[{x:t,y:e},{x:t+r,y:e+s}];return this.commands.push({cmd:"roundRect",x:t,y:e,width:r,height:s,radii:o,points:u}),this.vertices.push(...u),this}}class Ku extends lo{type="Group2";isGroup=!0;version=0;versions=[];params;alignCenter=!1;dynamically=!1;usedCache=!1;wireframe=!1;showPoints=!1;constructor(t={}){t.name===void 0&&(t.name="Group2"),super(t),this.params=t,t.usedCache!==void 0&&(this.usedCache=t.usedCache),t.wireframe!==void 0&&(this.wireframe=t.wireframe),t.showPoints!==void 0&&(this.showPoints=t.showPoints),t.alignCenter!==void 0&&(this.alignCenter=t.alignCenter),t.dynamically!==void 0&&(this.dynamically=t.dynamically)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}clone(t=!0){const e=this.constructor;return new e(this.params).copy(this,t)}copy(t,e=!0){return super.copy(t,e),this.params=t.params,this.alignCenter=t.alignCenter,this.dynamically=t.dynamically,this.usedCache=t.usedCache,this.wireframe=t.wireframe,this.showPoints=t.showPoints,this}composeWireframeGeometryPath(t){return this.traverse(e=>{!e.isShape||!e.geometry||!e.geometry.path||t.addPath(e.geometry.path)}),t}set needsUpdate(t){t&&this.version++,this.dispatchEvent({type:"needsUpdateChanged"})}generateFeaturesKey(){return this.featureKey=this.name+this.version,this.featureKey}render(t){if(!(!this.visible||!this.composeNode))for(let e=0,r=this.children.length;e<r;e++)this.children[e].render(t)}}var na={};const R2="bold|bolder|lighter|[1-9]00",F2="italic|oblique",U2="small-caps",k2="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",H2="px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q",pf=`'([^']+)'|"([^"]+)"|[\\w\\s-]+`,q2=new RegExp(`(${R2}) +`,"i"),W2=new RegExp(`(${F2}) +`,"i"),V2=new RegExp(`(${U2}) +`,"i"),z2=new RegExp(`(${k2}) +`,"i"),$2=new RegExp(`([\\d\\.]+)(${H2}) *((?:${pf})( *, *(?:${pf}))*)`),Qu={},G2=16;var X2=i=>{if(Qu[i])return Qu[i];const t=$2.exec(i);if(!t)return;const e={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(t[1]),unit:t[2],family:t[3].replace(/["']/g,"").replace(/ *, */g,",")};let r,s,o,u;const h=i.substring(0,t.index);switch((r=q2.exec(h))&&(e.weight=r[1]),(s=W2.exec(h))&&(e.style=s[1]),(o=V2.exec(h))&&(e.variant=o[1]),(u=z2.exec(h))&&(e.stretch=u[1]),e.unit){case"pt":e.size/=.75;break;case"pc":e.size*=16;break;case"in":e.size*=96;break;case"cm":e.size*=96/2.54;break;case"mm":e.size*=96/25.4;break;case"%":break;case"em":case"rem":e.size*=G2/.75;break;case"q":e.size*=96/25.4/4;break}return Qu[i]=e};const Y2=X2;na.parseFont=Y2,na.createCanvas=function(i,t){return Object.assign(document.createElement("canvas"),{width:i,height:t})},na.createImageData=function(i,t,e){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(i);case 2:return new ImageData(i,t);default:return new ImageData(i,t,e)}},na.loadImage=function(i,t){return new Promise(function(e,r){const s=Object.assign(document.createElement("img"),t);function o(){s.onload=null,s.onerror=null}s.onload=function(){o(),e(s)},s.onerror=function(){o(),r(new Error('Failed to load the image "'+i+'"'))},s.src=i})};class mr{static cached=new Map;static cachedCanvas=new Map;static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(t){var s;if(!((s=_t.window)!=null&&s.document))throw new Error("environment not support");let e;t.containerId&&(e=_t.window.document.getElementById(t.containerId)),e||(e=_t.window.document.getElementsByTagName("body")[0]);let r;if(t.canvasId&&(r=_t.window.document.getElementById(t.canvasId)||void 0),t.width||(t.width=e==null?void 0:e.offsetWidth),t.height||(t.height=e==null?void 0:e.offsetHeight),t.dpr||(t.dpr=_t.dpr),r)this.resizeCanvas(r,t.width,t.height,t.dpr);else{if(r=this.createHtmlCanvas(t.width,t.height,t.dpr),!r)throw new Error("error environment");t.canvasId&&r.setAttribute("id",t.canvasId),e==null||e.appendChild(r)}return r.style.background=t.background||"transparent",r}static getContext2D(t,e={}){const r={alpha:!0,willReadFrequently:!!e.willReadFrequently},s=t.getContext("2d",r);if(!s)throw new Error("getContext2D error");return s.scale(e.dpr||1,e.dpr||1),s}static createNodeCanvas(t,e){var s;let r;return(s=_t.window)!=null&&s.document?r=_t.window.document.createElement("canvas"):r=new na.Canvas(t,e),this.resizeCanvas(r,t,e,_t.window.devicePixelRatio),r.uuid=qu(),r}static resizeCanvas(t,e,r,s=1){t instanceof OffscreenCanvas?(t.width=e,t.height=r):t instanceof HTMLCanvasElement?(t.setAttribute("width",(e*s).toString()),t.setAttribute("height",(r*s).toString()),t.style.width=e+"px",t.style.height=r+"px",t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.imageRendering="pixelated",t.style.transform="translateZ(0)"):(t.width=e,t.height=r)}static async getImageBitmapByCanvasAsync(t){if(t)return t instanceof OffscreenCanvas?t.transferToImageBitmap():t instanceof HTMLCanvasElement?await createImageBitmap(t):void 0}static get(t,e,r,s=1){let o=this.cached.get(t);return o||(o=this.create(e,r,s),this.set(t,o)),this.resizeCanvas(o,e,r,s),o}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e)}static remove(t){this.cached.has(t)&&this.cached.delete(t)}static create(t,e,r=1){var s;if((s=_t.window)!=null&&s.OffscreenCanvas)return new OffscreenCanvas(t,e);throw new Error("environment does not support")}static createHtmlCanvas(t,e,r=1){if(!_t.window.document)throw new Error("environment does not support");const s=_t.window.document.createElement("canvas");return this.resizeCanvas(s,t,e,r),s}static measureText(t,e,r=new R){if(!t)throw new Error("input error");const o=this.get("measureText",1,1).getContext("2d");if(!o)throw new Error("bufferCtx not found");e.render(o);const u=o.measureText(t);if(!u)throw new Error("measureText error");const h=u.actualBoundingBoxRight+u.actualBoundingBoxLeft,c=u.actualBoundingBoxAscent+u.actualBoundingBoxDescent;return r.set(h,c),r}}function df(i){return!!(i&&i.constructor&&i.call&&i.apply)}const Z2="children",j2="get",K2="set",Ju="Changed";class tl extends Si{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 r in t)r!==Z2&&(e=K2+r,df(this[e])?this[e](t[r]):this.setAttr(r,t[r]));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=j2+at.capitalize(t);return df(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 r=this._cache.get(t);return(r===void 0||r.dirty===!0)&&(r=e.call(this),this._cache.set(t,r)),r}_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 r=this.userData[t];this.userData[t]=e,r!==e&&this.dispatchEvent({type:t+Ju,data:{oldVal:r,newVal:e}})},enumerable:!0,configurable:!0})}computed(t,e,r){if(!this._attachedDepsListeners.get(t)){const s=e.map(o=>o+Ju).join(",");this.addEventListeners(s,()=>this._clearCache(t)),e.forEach(o=>this._setProperty(o)),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}watch(t,e){(t||[]).forEach(r=>{this._setProperty(r),this.addEventListener(r+Ju,e)})}}const Oi=new R;class Q2 extends tl{isTexture=!0;isRenderTargetTexture=!1;type="Texture";name="Texture";uuid=qu();originSize=new R;originCenter=new R;size=new R;matrix=new kt;matrixAutoUpdate=!0;userData={};version=0;_needsUpdate=!1;image;offset=new R;repeat=new R(1,1);center=new R;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,r,s){return this.originSize.copy(t),this.originCenter.copy(e),this.updateFinalSize(r,s)}updateFinalSize(t,e){t&&!R.isZero(t)&&!R.isEmpty(t)?Oi.copy(t):Oi.copy(this.originSize),Oi.maxXY(1,1);const r=Math.sqrt(Oi.x*Oi.x+Oi.y*Oi.y)/Math.sqrt(e.x*e.x+e.y*e.y);return r>1&&Oi.multiplyScalar(1/r),this.scale=Oi.length()/this.originSize.length(),this.repeat.multiplyScalar(this.originSize.length()/Oi.length()),this.size.copy(Oi),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}}const gf=new R(10,10),sa=new R,aa=new R,yr=new R,xn=new R,co=new R,oa=new R,ji=new R,vr=new R,fo=new Ot;class xr{static cached=new Map;static precisionOptimized=!0;static precisionOptimizeLevels=[.5,.25,1e-4];static initialized=!1;static textureMaxSize=new R;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 r=1,s=this.precisionOptimizeLevels.length;r<=s;r++){const o=t+"_"+r;let u;this.cached.has(o)&&(u=this.cached.get(o),u&&u.destroy(),this.cached.delete(o))}}static clear(){this.destroy()}static setTextureMaxSize(){this.initialized||(this.textureMaxSize.set(_t.config.width,_t.config.height).multiplyScalar(.5).round(),this.initialized=!0)}static getTextureMaxSize(){return this.initialized||this.setTextureMaxSize(),this.textureMaxSize}static getTextureByShape(t,e,r,s){var u;const o=new Q2;if(this.setTextureMaxSize(),o.scale=1,o.repeat.set(1,1),o.rotate=0,o.image=void 0,o.version=0,e&&!R.isZero(e)&&!R.isEmpty(e))sa.copy(e),t.alignCenter?aa.copy(t.centerPoint):aa.set(0,0);else{if(t.isShape&&((u=t.geometry)!=null&&u.boundingBox))fo.copy(t.geometry.boundingBox);else if(t.isGroup&&t.boundingBox)fo.copy(t.boundingBox);else throw new Error("get boundingBox error");fo.getSize(sa),t.alignCenter?aa.copy(t.centerPoint):fo.getCenter(aa)}return r&&!R.isZero(r)&&!R.isEmpty(r)?yr.copy(r):yr.copy(sa),(yr.x<gf.x||yr.y<gf.y)&&yr.normalize().multiplyScalar(10).round(),ji.copy(this.getTextureMaxSize()),s&&(oa.set((s==null?void 0:s.shadowBlur)||0,(s==null?void 0:s.shadowBlur)||0),yr.add(oa.clone().multiplyScalar(2)),sa.multiplyScalar(3),ji.multiplyScalar(.3)),o.updateSize(sa,aa,yr,ji),o}static setPrecisionOptimizeTextures(t,e,r,s,o){if(!this.precisionOptimized)return;let u;for(let h=0,c=this.precisionOptimizeLevels.length;h<c;h++){ji.copy(r.size).multiplyScalar(this.precisionOptimizeLevels[h]);const p=this.getTextureByShape(e,s,ji,o);this.renderShapeTexture(e,p,o),u=t+"_"+(h+1),p.userData.textureKey=u,xr.set(u,p)}}static renderShapeTexture(t,e,r){r?(oa.set(r.shadowBlur||0,r.shadowBlur||0),xn.copy(e.originSize).multiplyScalar(-.5).sub(e.originCenter).multiplyScalar(e.scale),t.alignCenter?co.copy(e.originSize).multiplyScalar(e.scale):co.copy(e.originSize).add(oa.clone().multiplyScalar(1)).multiplyScalar(e.scale)):xn.copy(e.offset).negate().multiplyScalar(e.scale);const s=mr.create(e.size.x,e.size.y),o=mr.getContext2D(s,{alpha:!0});o.clearRect(0,0,s.width,s.height),o.translate(xn.x,xn.y),o.scale(e.scale,e.scale),r&&(o.shadowColor=Rt.black,o.shadowOffsetX=co.x,o.shadowOffsetY=co.y,o.shadowBlur=oa.x),t.render(o),e.image=s}static setByShape(t,e,r,s){const o=this.getTextureByShape(e,r,s);return o.userData.textureKey=t,this.renderShapeTexture(e,o),xr.set(t,o),this.setPrecisionOptimizeTextures(t,e,o,r),o}static setShadowByShape(t,e,r){const s=this.getTextureByShape(e,void 0,void 0,r);return s.userData.textureKey=t,this.renderShapeTexture(e,s,r),xr.set(t,s),s}static setPointsByShape(t,e){var p,g,x,E,w;const r=[];e.isGroup?e.traverse(M=>M.isShape?r.push(...M.geometry.points):void 0):e.isShape&&e.geometry.points?r.push(...e.geometry.points):e.boundingBox&&r.push(e.boundingBox.min,e.boundingBox.max);const s=this.getTextureByShape(e),o=((p=e.material)==null?void 0:p.lineWidth)*2||3;vr.set(1,1).multiplyScalar(o),s.size.copy(vr).multiplyScalar(s.scale).multiplyScalar(2).add(yr),s.offset.sub(vr),s.updateMatrix();const u=mr.create(s.size.x,s.size.y),h=mr.getContext2D(u,{alpha:!0});xn.subVectors(s.originSize.clone().multiplyScalar(.5),s.originCenter).add(vr),h.clearRect(0,0,u.width,u.height),h.scale(s.scale,s.scale),h.translate(xn.x,xn.y);let c=Rt.black;e.material?c=((g=e.material)==null?void 0:g.stroke)||((x=e.material)==null?void 0:x.fill):e.isGroup&&e.children.length&&e.children[0].isShape&&(c=((E=e.children[0].material)==null?void 0:E.stroke)||((w=e.children[0].material)==null?void 0:w.fill)),h.fillStyle=Ft.getDarken(c);for(let M=0,C=r.length||0;M<C;M++)ji.copy(r[M]),h.moveTo(ji.x,ji.y),h.arc(ji.x,ji.y,vr.x,0,Math.PI*2);return h.fill(),s.image=u,xr.set(t,s),s}static setWireframeByShape(t,e){var h;const r=this.getTextureByShape(e);vr.set(1,1).multiplyScalar(((h=e.material)==null?void 0:h.lineWidth)||1),r.size.copy(vr).multiplyScalar(r.scale).multiplyScalar(2).add(yr),r.offset.sub(vr),r.updateMatrix();const s=mr.create(r.size.x,r.size.y),o=mr.getContext2D(s,{alpha:!0}),u=vr.x*r.scale*5;return o.clearRect(0,0,s.width,s.height),o.strokeStyle=Rt.darkGray,o.lineWidth=u,o.setLineDash([u*3,u]),o.strokeRect(0,0,r.size.x,r.size.y),r.image=s,xr.set(t,r),r}static DEBUG_DisplayCachedTexture=at.throttle((t=80,e=.8)=>{let r=J2();if(r||(r=ty(t,e)),!r)throw new Error("dom not found");ey(r,this.cached)},5e3)}function J2(){return window.document.getElementById("DEBUG_Displaycached")}function ty(i=80,t=.8){const e=document.createElement("div");function r(){e.style.opacity="1"}function s(){e.style.opacity=t.toString()}return e.setAttribute("id","DEBUG_Displaycached"),e.style.position="absolute",e.style.width=i+"px",e.style.height="92vh",e.style.background=`rgba(0, 0, 0, ${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",r),e.addEventListener("mouseleave",s),document.body.appendChild(e),e}function ey(i,t){t.forEach((e,r)=>{!e||!e.image||iy(i,r,e)})}function iy(i,t,e){let r;for(let s=0,o=i.childNodes.length;s<o;s++)if(i.childNodes[s].getAttribute("id")===t){r=i.childNodes[s];break}r?ny(r,e):ry(i,t,e)}function ry(i,t,e){if(!e.image)return;const r=_t.document.createElement("div");r.setAttribute("id",t),r.style.display="flex",r.style.flexDirection="column";const s=mr.createCanvas({containerId:i.id,width:e.image.width,height:e.image.height,dpr:window.devicePixelRatio});s.style.border="#000000 1px solid",s.style.maxWidth=parseInt(i.style.width)-2+"px",s.style.maxHeight=parseInt(s.style.maxWidth)/(e.image.width/e.image.height)+"px";const o=s.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(),r.appendChild(s);const u=_t.document.createElement("p");u.innerHTML=e.image.width+" * "+e.image.height,u.innerHTML+="<br/>"+t,u.style.margin="0",u.style.padding="0",u.style.lineHeight="1.2",u.style.fontSize="12px",u.style.padding="3px 0 6px 0",r.appendChild(u),i.appendChild(r);function h(){const c=s.toDataURL("image/png",.6),p=document.createElement("a"),g=new MouseEvent("click");p.download=`thumb.${Date.now()}.png`,p.href=c,p.dispatchEvent(g)}r.addEventListener("click",h)}function ny(i,t){if(!t.image)return;const e=i.querySelector("canvas");if(!e)return;const r=e.getContext("2d",{alpha:!0});if(!r)throw new Error("getContext error");r.clearRect(0,0,e.width,e.height),r.save(),r.scale(window.devicePixelRatio,window.devicePixelRatio),r.drawImage(t.image,0,0),r.restore()}const sy=new Ot,br=new R,ss=new kt,mf=new kt,el=new kt;class il extends lo{isShape=!0;type="Shape";geometry;material;usedCache=!1;showPoints=!1;wireframe=!1;selected=!1;alignCenter=!1;dynamically=!1;composeNode=!1;matrixAutoUpdate=!1;version=0;needsUpdateChangedHandler=this.handleNeedsUpdateChanged.bind(this);constructor(t={}){t.name===void 0&&(t.name="Shape"),t.stroke===void 0&&(t.stroke=Rt.darkGray),super(t),t.visible===void 0&&(t.visible=!0),t.fixed!==void 0&&(this.fixed=t.fixed),t.usedCache!==void 0&&(this.usedCache=t.usedCache),t.dynamically!==void 0&&(this.dynamically=t.dynamically),t.castShadow!==void 0&&(this.castShadow=t.castShadow),t.showPoints!==void 0&&(this.showPoints=t.showPoints),t.wireframe!==void 0&&(this.wireframe=t.wireframe),t.alignCenter!==void 0&&(this.alignCenter=t.alignCenter),t.composeNode!==void 0&&(this.composeNode=t.composeNode),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.id!==void 0&&(this.userData.id=t.id)}set needsUpdate(t){t&&this.version++,this.dispatchEvent({type:"needsUpdateChanged"})}destroy(){this.unbindEvents(),super.destroy()}bindEvents(){this.geometry&&!this.geometry.hasEventListener("needsUpdateChanged",this.needsUpdateChangedHandler)&&this.geometry&&this.geometry.addEventListener("needsUpdateChanged",this.needsUpdateChangedHandler),this.material&&!this.material.hasEventListener("needsUpdateChanged",this.needsUpdateChangedHandler)&&this.material&&this.material.addEventListener("needsUpdateChanged",this.needsUpdateChangedHandler)}unbindEvents(){this.geometry&&this.geometry.removeEventListener("needsUpdateChanged",this.needsUpdateChangedHandler),this.material&&this.material.removeEventListener("needsUpdateChanged",this.needsUpdateChangedHandler)}handleNeedsUpdateChanged(){this.needsUpdate=!0}bindGeoMtl(t,e){this.geometry=t,this.material=e,this.bindEvents(),this.setup()}setup(){return this.computeBoundingBox(),this.generateFeaturesKey(),this}computeBoundingBox(){if(this.centerPoint.set(0,0),this.boundingBox.copy(this.geometry.computeBoundingBox()),!this.children||!this.children.length)return this.boundingBox;const t=[];t.push(...R.getPointsApplyMatrix3(this.matrixWorld,this.geometry.getBoundingPoints()));for(let e=0,r=this.children.length;e<r;e++)if(sy.copy(this.children[e].computeBoundingBox()),this.children[e].isShape&&this.children[e].geometry.points){if(ss.copy(this.children[e].matrixWorld),this.children[e].isText){const s=this.children[e].material.fontSize/12||1;mf.makeScale(s,s).invert(),ss.multiply(el.copy(this.children[e].matrix).invert().premultiply(mf))}this.children[e].alignCenter&&(br.copy(this.children[e].centerPoint).negate(),el.makeTranslation(br.x,br.y),ss.multiply(el)),t.push(...R.getPointsApplyMatrix3(ss,this.children[e].geometry.getBoundingPoints()))}return this.boundingBox.setFromPoints(R.getPointsApplyMatrix3(this.matrixWorldInverse,t)),this.alignCenter&&this.boundingBox.getCenter(this.centerPoint),this.alignCenter&&this.boundingBox.translate(br.copy(this.centerPoint).negate()),this.boundingBox.ceil(),this.boundingBox}generateFeaturesKey(){return this.featureKey=(this.geometry.featureKey||"G")+"_"+(this.material.featureKey||"M"),this.featureKey}render(t){if(this.visible&&(this.renderFill(t),this.renderStroke(t),this.renderMaterialMap(t),this.composeNode))for(let e=0,r=this.children.length;e<r;e++)this.children[e].render(t)}renderFill(t){!this.geometry.path||!this.material.hasFill||(t.fillStyle=this.material.fill,t.fill(this.geometry.path))}renderStroke(t){!this.geometry||!this.geometry.path||this.material.hasStroke&&(t.strokeStyle=this.material.stroke,t.lineWidth=this.material.lineWidth,this.material.lineDash&&t.setLineDash(this.material.lineDash),this.material.lineCap&&(t.lineCap=this.material.lineCap),t.lineDashOffset=this.material.lineDashOffset,t.stroke(this.geometry.path))}renderMaterialMap(t){!this.material.map||!this.material.map.image||!this.geometry||!this.geometry.path||(t.save(),this.geometry.path.closePath(),t.clip(this.geometry.path),t.rotate(-this.material.map.rotate),t.scale(this.material.map.scale,this.material.map.scale),t.drawImage(this.material.map.image,this.material.map.offset.x||0,this.material.map.offset.y||0),t.restore())}raycast(t,e=[]){var r;return super.raycast(t,e),!this.selectable||!this.boundingBox||this.boundingBox.isEmpty()||!this.boundingBoxWorld.containsPoint(t.worldCoords)||(br.copy(t.worldCoords).applyMatrix3(ss.copy(this.matrixWorld).invert()),(r=this.geometry)!=null&&r.isPointInPath(br)&&e.push(this),console.warn("Shape.raycast: ",this.name,this.boundingBox.min.round().toString(),this.boundingBox.max.round().toString(),t.worldCoords.round().toString()),e.includes(this)||((!this.usedCache||!xr.has(this.featureKey))&&xr.setByShape(this.featureKey,this),this.isPointInPathByTexture(t)&&e.push(this))),e}isPointInPathByTexture(t){const e=xr.get(this.featureKey);if(!e||!e.image)throw new Error("raycastByPixel error");return br.copy(t.worldCoords).applyMatrix3(ss.copy(this.matrixWorld).multiply(e.matrix).invert()).round(),mr.getContext2D(e.image,{alpha:!0}).getImageData(br.x,br.y,1,1).data[3]>0}copy(t,e=!0){return super.copy(t,e),this.geometry=t.geometry,this.material=t.material,this.usedCache=t.usedCache,this.showPoints=t.showPoints,this.wireframe=t.wireframe,this.selected=t.selected,this.alignCenter=t.alignCenter,this.dynamically=t.dynamically,this.composeNode=t.composeNode,this.matrixAutoUpdate=t.matrixAutoUpdate,this}}class Ne{static stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);static buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);static hexChars="0123456789abcdef";static hexOut=[];static onePassHasher=new Ne;_dataLength=0;_bufferLength=0;_state=new Int32Array(4);_buffer=new ArrayBuffer(68);_buffer8;_buffer32;constructor(){this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(t,e=!1){return this.onePassHasher.start().appendStr(t).end(e)}static hashAsciiStr(t,e=!1){return this.onePassHasher.start().appendAsciiStr(t).end(e)}static _hex(t){const e=Ne.hexChars,r=Ne.hexOut;let s,o,u,h;for(h=0;h<4;h+=1)for(o=h*8,s=t[h],u=0;u<8;u+=2)r[o+1+u]=e.charAt(s&15),s>>>=4,r[o+0+u]=e.charAt(s&15),s>>>=4;return r.join("")}static _md5cycle(t,e){let r=t[0],s=t[1],o=t[2],u=t[3];r+=(s&o|~s&u)+e[0]-680876936|0,r=(r<<7|r>>>25)+s|0,u+=(r&s|~r&o)+e[1]-389564586|0,u=(u<<12|u>>>20)+r|0,o+=(u&r|~u&s)+e[2]+606105819|0,o=(o<<17|o>>>15)+u|0,s+=(o&u|~o&r)+e[3]-1044525330|0,s=(s<<22|s>>>10)+o|0,r+=(s&o|~s&u)+e[4]-176418897|0,r=(r<<7|r>>>25)+s|0,u+=(r&s|~r&o)+e[5]+1200080426|0,u=(u<<12|u>>>20)+r|0,o+=(u&r|~u&s)+e[6]-1473231341|0,o=(o<<17|o>>>15)+u|0,s+=(o&u|~o&r)+e[7]-45705983|0,s=(s<<22|s>>>10)+o|0,r+=(s&o|~s&u)+e[8]+1770035416|0,r=(r<<7|r>>>25)+s|0,u+=(r&s|~r&o)+e[9]-1958414417|0,u=(u<<12|u>>>20)+r|0,o+=(u&r|~u&s)+e[10]-42063|0,o=(o<<17|o>>>15)+u|0,s+=(o&u|~o&r)+e[11]-1990404162|0,s=(s<<22|s>>>10)+o|0,r+=(s&o|~s&u)+e[12]+1804603682|0,r=(r<<7|r>>>25)+s|0,u+=(r&s|~r&o)+e[13]-40341101|0,u=(u<<12|u>>>20)+r|0,o+=(u&r|~u&s)+e[14]-1502002290|0,o=(o<<17|o>>>15)+u|0,s+=(o&u|~o&r)+e[15]+1236535329|0,s=(s<<22|s>>>10)+o|0,r+=(s&u|o&~u)+e[1]-165796510|0,r=(r<<5|r>>>27)+s|0,u+=(r&o|s&~o)+e[6]-1069501632|0,u=(u<<9|u>>>23)+r|0,o+=(u&s|r&~s)+e[11]+643717713|0,o=(o<<14|o>>>18)+u|0,s+=(o&r|u&~r)+e[0]-373897302|0,s=(s<<20|s>>>12)+o|0,r+=(s&u|o&~u)+e[5]-701558691|0,r=(r<<5|r>>>27)+s|0,u+=(r&o|s&~o)+e[10]+38016083|0,u=(u<<9|u>>>23)+r|0,o+=(u&s|r&~s)+e[15]-660478335|0,o=(o<<14|o>>>18)+u|0,s+=(o&r|u&~r)+e[4]-405537848|0,s=(s<<20|s>>>12)+o|0,r+=(s&u|o&~u)+e[9]+568446438|0,r=(r<<5|r>>>27)+s|0,u+=(r&o|s&~o)+e[14]-1019803690|0,u=(u<<9|u>>>23)+r|0,o+=(u&s|r&~s)+e[3]-187363961|0,o=(o<<14|o>>>18)+u|0,s+=(o&r|u&~r)+e[8]+1163531501|0,s=(s<<20|s>>>12)+o|0,r+=(s&u|o&~u)+e[13]-1444681467|0,r=(r<<5|r>>>27)+s|0,u+=(r&o|s&~o)+e[2]-51403784|0,u=(u<<9|u>>>23)+r|0,o+=(u&s|r&~s)+e[7]+1735328473|0,o=(o<<14|o>>>18)+u|0,s+=(o&r|u&~r)+e[12]-1926607734|0,s=(s<<20|s>>>12)+o|0,r+=(s^o^u)+e[5]-378558|0,r=(r<<4|r>>>28)+s|0,u+=(r^s^o)+e[8]-2022574463|0,u=(u<<11|u>>>21)+r|0,o+=(u^r^s)+e[11]+1839030562|0,o=(o<<16|o>>>16)+u|0,s+=(o^u^r)+e[14]-35309556|0,s=(s<<23|s>>>9)+o|0,r+=(s^o^u)+e[1]-1530992060|0,r=(r<<4|r>>>28)+s|0,u+=(r^s^o)+e[4]+1272893353|0,u=(u<<11|u>>>21)+r|0,o+=(u^r^s)+e[7]-155497632|0,o=(o<<16|o>>>16)+u|0,s+=(o^u^r)+e[10]-1094730640|0,s=(s<<23|s>>>9)+o|0,r+=(s^o^u)+e[13]+681279174|0,r=(r<<4|r>>>28)+s|0,u+=(r^s^o)+e[0]-358537222|0,u=(u<<11|u>>>21)+r|0,o+=(u^r^s)+e[3]-722521979|0,o=(o<<16|o>>>16)+u|0,s+=(o^u^r)+e[6]+76029189|0,s=(s<<23|s>>>9)+o|0,r+=(s^o^u)+e[9]-640364487|0,r=(r<<4|r>>>28)+s|0,u+=(r^s^o)+e[12]-421815835|0,u=(u<<11|u>>>21)+r|0,o+=(u^r^s)+e[15]+530742520|0,o=(o<<16|o>>>16)+u|0,s+=(o^u^r)+e[2]-995338651|0,s=(s<<23|s>>>9)+o|0,r+=(o^(s|~u))+e[0]-198630844|0,r=(r<<6|r>>>26)+s|0,u+=(s^(r|~o))+e[7]+1126891415|0,u=(u<<10|u>>>22)+r|0,o+=(r^(u|~s))+e[14]-1416354905|0,o=(o<<15|o>>>17)+u|0,s+=(u^(o|~r))+e[5]-57434055|0,s=(s<<21|s>>>11)+o|0,r+=(o^(s|~u))+e[12]+1700485571|0,r=(r<<6|r>>>26)+s|0,u+=(s^(r|~o))+e[3]-1894986606|0,u=(u<<10|u>>>22)+r|0,o+=(r^(u|~s))+e[10]-1051523|0,o=(o<<15|o>>>17)+u|0,s+=(u^(o|~r))+e[1]-2054922799|0,s=(s<<21|s>>>11)+o|0,r+=(o^(s|~u))+e[8]+1873313359|0,r=(r<<6|r>>>26)+s|0,u+=(s^(r|~o))+e[15]-30611744|0,u=(u<<10|u>>>22)+r|0,o+=(r^(u|~s))+e[6]-1560198380|0,o=(o<<15|o>>>17)+u|0,s+=(u^(o|~r))+e[13]+1309151649|0,s=(s<<21|s>>>11)+o|0,r+=(o^(s|~u))+e[4]-145523070|0,r=(r<<6|r>>>26)+s|0,u+=(s^(r|~o))+e[11]-1120210379|0,u=(u<<10|u>>>22)+r|0,o+=(r^(u|~s))+e[2]+718787259|0,o=(o<<15|o>>>17)+u|0,s+=(u^(o|~r))+e[9]-343485551|0,s=(s<<21|s>>>11)+o|0,t[0]=r+t[0]|0,t[1]=s+t[1]|0,t[2]=o+t[2]|0,t[3]=u+t[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(Ne.stateIdentity),this}appendStr(t){const e=this._buffer8,r=this._buffer32;let s=this._bufferLength,o,u;for(u=0;u<t.length;u+=1){if(o=t.charCodeAt(u),o<128)e[s++]=o;else if(o<2048)e[s++]=(o>>>6)+192,e[s++]=o&63|128;else if(o<55296||o>56319)e[s++]=(o>>>12)+224,e[s++]=o>>>6&63|128,e[s++]=o&63|128;else{if(o=(o-55296)*1024+(t.charCodeAt(++u)-56320)+65536,o>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");e[s++]=(o>>>18)+240,e[s++]=o>>>12&63|128,e[s++]=o>>>6&63|128,e[s++]=o&63|128}s>=64&&(this._dataLength+=64,Ne._md5cycle(this._state,r),s-=64,r[0]=r[16])}return this._bufferLength=s,this}appendAsciiStr(t){const e=this._buffer8,r=this._buffer32;let s=this._bufferLength,o,u=0;for(;;){for(o=Math.min(t.length-u,64-s);o--;)e[s++]=t.charCodeAt(u++);if(s<64)break;this._dataLength+=64,Ne._md5cycle(this._state,r),s=0}return this._bufferLength=s,this}appendByteArray(t){const e=this._buffer8,r=this._buffer32;let s=this._bufferLength,o,u=0;for(;;){for(o=Math.min(t.length-u,64-s);o--;)e[s++]=t[u++];if(s<64)break;this._dataLength+=64,Ne._md5cycle(this._state,r),s=0}return this._bufferLength=s,this}getState(){const t=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[t[0],t[1],t[2],t[3]]}}setState(t){const e=t.buffer,r=t.state,s=this._state;let o;for(this._dataLength=t.length,this._bufferLength=t.buflen,s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3],o=0;o<e.length;o+=1)this._buffer8[o]=e.charCodeAt(o)}end(t=!1){const e=this._bufferLength,r=this._buffer8,s=this._buffer32,o=(e>>2)+1;this._dataLength+=e;const u=this._dataLength*8;if(r[e]=128,r[e+1]=r[e+2]=r[e+3]=0,s.set(Ne.buffer32Identity.subarray(o),o),e>55&&(Ne._md5cycle(this._state,s),s.set(Ne.buffer32Identity)),u<=4294967295)s[14]=u;else{const h=u.toString(16).match(/(.*?)(.{0,8})$/);if(h===null)return;const c=parseInt(h[2],16),p=parseInt(h[1],16)||0;s[14]=c,s[15]=p}return Ne._md5cycle(this._state,s),t?this._state:Ne._hex(this._state)}}if(Ne.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592")throw new Error("Md5 self test failed.");let ay=0;const rl=new R,yf=new R,as=new kt,Mi=new R,li=new R,Bi=new R,vf=new R,xf=new R,bf=new R,nl=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];class Ef extends tl{isGeometry=!0;id=ay++;name="Geometry2D";matrix=new kt;boundingBox=new Ot;path;pointsPath;featureKey="";version=0;points;pointsSplits=0;lineWidth=0;padding;radius=0;position=new R;rotation=new R;scaled=new R(1,1);animations=[];constructor(t={}){super(t),this.watch(["points","lineWidth","padding","radius"],()=>this.needsUpdate=!0)}set needsUpdate(t){t&&this.version++,this.dispatchEvent({type:"needsUpdateChanged"})}destroy(){super.destroy()}applyMatrix3(t){t.decompose(vf,xf,bf),this.position.add(vf),this.rotation.add(xf),this.scaled.add(bf)}updateMatrix(){this.matrix.compose(this.position,this.rotation,this.scaled),this.needsUpdate=!0}translate(t,e){return as.makeTranslation(t,e),this.applyMatrix3(as),this}rotate(t){return as.makeRotation(t),this.applyMatrix3(as),this}scale(t,e){return as.makeScale(t,e),this.applyMatrix3(as),this}setPointsSplits(t=0){return this.pointsSplits=t,this}setPath(t){return t?(t instanceof Zi||(t=new Zi().copy(t)),this.setAttr("path",t),this.setAttr("points",t.getVertices2()),this.path=t,this.points=t.getVertices2(),this.computeBoundingBox(),this.generateFeatureKey(),this):this}setFromPoints(t,e=0){return!t||!t.length?this:(this.setAttr("points",t),this.setAttr("pointsSplits",t),this.points=t,this.pointsSplits=e,this.recomputePath(),this.computeBoundingBox(),this.generateFeatureKey(),this)}setFromSvgPath(t){if(!t||!t.length)return this;const e=new _t.window.Path2D;let r=t;r=r.replace(new RegExp(" ","g"),",");for(let x=0,E=nl.length;x<E;x++)r=r.replace(new RegExp(nl[x],"g"),"|"+nl[x]);const s=r.split("|"),o=[];let u=0,h=0;const c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let p,g="";for(let x=1,E=s.length;x<E;x++){let w=s[x],M=w.charAt(0);for(w=w.slice(1),o.length=0;p=c.exec(w);)o.push(p[0]);const C=[];for(let I=0,W=o.length;I<W;I++){if(o[I]==="00"){C.push(0,0);continue}let H=parseFloat(o[I]);isNaN(H)?C.push(0):C.push(H)}let _=[];for(;C.length>0&&!isNaN(C[0]);){let I=u,W=h,H,A,V,F,K,Z,G,j,J;switch(M){case"M":I=u=C.shift()||0,W=h=C.shift()||0,e.moveTo(u,h);break;case"m":let nt=C.shift()||0,ht=C.shift()||0;u+=nt,h+=ht,g==="z"&&(u=I+nt,h=W+ht),e.moveTo(u,h);break;case"l":u+=C.shift()||0,h+=C.shift()||0,e.lineTo(u,h);break;case"L":u=C.shift()||0,h=C.shift()||0,e.lineTo(u,h);break;case"h":u+=C.shift()||0,e.lineTo(u,h);break;case"H":u=C.shift()||0,e.lineTo(u,h);break;case"v":h+=C.shift()||0,e.lineTo(u,h);break;case"V":h=C.shift()||0,e.lineTo(u,h);break;case"C":_.length=0,_.push(C.shift()||0,C.shift()||0,C.shift()||0,C.shift()||0),u=C.shift()||0,h=C.shift()||0,e.bezierCurveTo(_[0],_[1],_[2],_[3],u,h);break;case"c":_.length=0,_.push(u+(C.shift()||0),h+(C.shift()||0),u+(C.shift()||0),h+(C.shift()||0)),u+=C.shift()||0,h+=C.shift()||0,e.bezierCurveTo(_[0],_[1],_[2],_[3],u,h);break;case"S":H=u,A=h,g==="C"&&(H=u+(u-_[2]),A=h+(h-_[3])),_.length=0,_.push(H,A,C.shift()||0,C.shift()||0),u=C.shift()||0,h=C.shift()||0,e.bezierCurveTo(_[0],_[1],_[2],_[3],u,h);break;case"s":H=u,A=h,g==="C"&&(H=u+(u-_[2]),A=h+(h-_[3])),_.length=0,_.push(H,A,u+(C.shift()||0),h+(C.shift()||0)),u+=C.shift()||0,h+=C.shift()||0,e.bezierCurveTo(_[0],_[1],_[2],_[3],u,h);break;case"Q":_.length=0,_.push(C.shift()||0,C.shift()||0),u=C.shift()||0,h=C.shift()||0,e.quadraticCurveTo(_[0],_[1],u,h);break;case"q":_.length=0,_.push(u+(C.shift()||0),h+(C.shift()||0)),u+=C.shift()||0,h+=C.shift()||0,e.quadraticCurveTo(_[0],_[1],u,h);break;case"T":H=u,A=h,g==="Q"&&(H=u+(u-_[0]),A=h+(h-_[1])),u=C.shift()||0,h=C.shift()||0,e.quadraticCurveTo(H,A,u,h);break;case"t":H=u,A=h,g==="Q"&&(H=u+(u-_[0]),A=h+(h-_[1])),u+=C.shift()||0,h+=C.shift()||0,e.quadraticCurveTo(H,A,u,h);break;case"A":V=C.shift()||0,F=C.shift()||0,K=C.shift()||0,Z=C.shift()||0,G=C.shift()||0,j=u,J=h,u=C.shift()||0,h=C.shift()||0,_=wf(j,J,u,h,Z,G,V,F,K),e.arc(_[0],_[1],_[2]>_[3]?_[2]:_[3],_[4],_[4]+_[5]);break;case"a":V=C.shift()||0,F=C.shift()||0,K=C.shift()||0,Z=C.shift()||0,G=C.shift()||0,j=u,J=h,u+=C.shift()||0,h+=C.shift()||0,_=wf(j,J,u,h,Z,G,V,F,K),e.arc(_[0],_[1],_[2]>_[3]?_[2]:_[3],_[4],_[4]+_[5]);break;default:C.shift()}}g=M,(M==="z"||M==="Z")&&e.closePath()}return this.setPath(e)}computeBoundingBox(){return this.boundingBox||(this.boundingBox=new Ot),this.boundingBox.makeEmpty(),this.points!==void 0?this.boundingBox.setFromPoints(this.points):this.boundingBox.makeEmpty(),this.lineWidth&&this.boundingBox.expandByVector(rl.set(this.lineWidth,+this.lineWidth)),this.boundingBox.validate()||console.error(`${this.name}.computeBoundingBox: min/max have NaN values.`),this.boundingBox}getBoundingPoints(){let t=[];return this.points&&(t=at.cloneDeep(this.points)),this.boundingBox&&this.boundingBox.validate()&&!this.boundingBox.isEmpty()&&t.push(this.boundingBox.min,this.boundingBox.max),t}generateFeatureKey(){!this.points||!this.points.length||(this.featureKey=Ne.hashStr(R.getStrings(this.points)))}recomputePointsPath(t){var e,r,s;if(!(!this.points||!this.points.length)){this.pointsPath=new _t.window.Path;for(let o=0,u=this.points.length;o<u;o++)(e=this.pointsPath)==null||e.moveTo(this.points[o].x,this.points[o].y),(r=this.pointsPath)==null||r.arc(this.points[o].x,this.points[o].y,t,0,Math.PI*2,!1);(s=this.path)==null||s.addPath(this.pointsPath)}}isPointInBoundingBox(t){return this.boundingBox?this.boundingBox.containsPoint(t):!1}isPointInPolygonByRay(t){let e=!1;if(!this.path)return e;Mi.copy(t);const r=this.path.getVertices2();for(let s=0,o=r.length;s<o;s++){if(li.copy(r[s]),s===r.length-1?Bi.copy(r[0]):Bi.copy(r[s+1]),R.isPointOnSegment(li,Bi,Mi))return!0;qr(li.y-Mi.y)>0!=qr(Bi.y-Mi.y)>0&&qr(Mi.x-(Mi.y-li.y)*(li.x-Bi.x)/(li.y-Bi.y)-li.x)<0&&(e=!e)}return e}isPointInPolygonByRAngle(t){let e=0;if(!this.path)return!1;Mi.copy(t);const r=this.path.getVertices2();for(let s=0,o=r.length;s<o;s++){if(li.copy(r[s]),s===r.length-1?Bi.copy(r[0]):Bi.copy(r[s+1]),R.isPointOnSegment(li,Bi,Mi))return!0;rl.subVectors(Bi,li),yf.subVectors(Mi,li);let u=qr(rl.cross(yf)),h=qr(li.y-Mi.y),c=qr(Bi.y-Mi.y);u>0&&h<=0&&c>0&&e--,u<0&&h>0&&c<=0&&e++}return e!==0}clone(){const t=this.constructor,e=new t(this.userData).copy(this);return this.path&&(e.path=this.path.clone()),e}copy(t){return this.name=t.name,this.matrix.copy(t.matrix),this.boundingBox.copy(t.boundingBox),this.path=t.path,this.pointsSplits=t.pointsSplits,this.setFromPoints(this.points,this.pointsSplits),this}}function wf(i,t,e,r,s,o,u,h,c){let p=c*(Math.PI/180),g=Math.cos(p)*(i-e)/2+Math.sin(p)*(t-r)/2,x=-1*Math.sin(p)*(i-e)/2+Math.cos(p)*(t-r)/2,E=g*g/(u*u)+x*x/(h*h);E>1&&(u*=Math.sqrt(E),h*=Math.sqrt(E));let w=Math.sqrt((u*u*(h*h)-u*u*(x*x)-h*h*(g*g))/(u*u*(x*x)+h*h*(g*g)));s===o&&(w*=-1),isNaN(w)&&(w=0);let M=w*u*x/h,C=w*-h*g/u,_=(i+e)/2+Math.cos(p)*M-Math.sin(p)*C,I=(t+r)/2+Math.sin(p)*M+Math.cos(p)*C,W=function(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])},H=function(G,j){return(G[0]*j[0]+G[1]*j[1])/(W(G)*W(j))},A=function(G,j){return(G[0]*j[1]<G[1]*j[0]?-1:1)*Math.acos(H(G,j))},V=A([1,0],[(g-M)/u,(x-C)/h]),F=[(g-M)/u,(x-C)/h],K=[(-1*g-M)/u,(-1*x-C)/h],Z=A(F,K);return H(F,K)<=-1&&(Z=Math.PI),H(F,K)>=1&&(Z=0),o===0&&Z>0&&(Z=Z-2*Math.PI),o===1&&Z<0&&(Z=Z+2*Math.PI),[_,I,u,h,V,Z,p,o]}class Af extends Ef{isPolygonGeometry2D=!0;name="PolygonGeometry2D";constructor(t={}){super(t),this.setAttrs(t),this.setFromPoints(this.points)}recomputePath(){var t,e;if(!(!this.points||!this.points.length)){this.path=new Zi;for(let r=0,s=this.points.length;r<s;r++)r?(e=this.path)==null||e.lineTo(this.points[r].x,this.points[r].y):(t=this.path)==null||t.moveTo(this.points[r].x,this.points[r].y);this.path.closePath()}}isPointInPath(t){return this.isPointInBoundingBox(t)?this.isPointInPolygonByRAngle(t):!1}}let oy=0;class sl extends tl{isMaterial=!0;name="Material2";id=oy++;featureKey="Material2";version=0;visible=!0;wireframe=!1;fill="";stroke="";selectedColor=new Ft;lineWidth=0;lineDash;lineDashOffset=0;lineCap="round";map;constructor(t={}){super(t),this.setAttrs(t),this.watch(["visible","fill","stroke","lineWidth"],()=>this.needsUpdate=!0),this.generateFeatureKey()}destroy(){this.dispatchEvent({type:"destroy"}),super.destroy()}clone(){const t=this.constructor;return new t(this.userData).copy(this)}copy(t){return this.visible=t.visible,this.wireframe=t.wireframe,this.fill=t.fill,this.stroke=t.stroke,this.lineWidth=t.lineWidth,this.lineDash=t.lineDash?at.cloneDeep(t.lineDash):void 0,this.lineDashOffset=t.lineDashOffset,this.lineCap=t.lineCap,this.map=t.map,this}generateFeatureKey(){const t=[];t.push(this.fill||""),t.push(this.stroke||""),t.push(this.lineWidth||0),t.push(this.lineDash?this.lineDash.join(","):""),this.featureKey=t.join("_")}set needsUpdate(t){t&&this.version++,this.dispatchEvent({type:"needsUpdateChanged"})}get hasFill(){return this.computed("hasFill",["fill"],()=>!!this.fill)}get hasStroke(){return this.computed("hasStroke",["stroke","lineWidth"],()=>!!this.stroke&&!!this.lineWidth)}}const al=new R;class uy extends Ef{isRectGeometry2D=!0;name="RectGeometry2D";width=0;height=0;constructor(t={}){super(t),this.setAttrs(t),this.recomputePath()}setSize(t,e){return this.width=t,this.height=e,this}recomputePath(){const t=new Zi;al.set(this.width*.5,this.height*.5).sub(this.position).negate(),t.rect(al.x,al.y,this.width,this.height),t.closePath(),this.path=t,this.points=t.getVertices2()}isPointInPath(t){return this.isPointInBoundingBox(t)}}class ly extends il{isMesh=!0;type="Mesh2";geometry;material;usedCache=!1;bufferCtx;selected=!1;constructor(t=new uy,e=new sl){super(),this.geometry=t,this.material=e,this.setup(),this.bindEvents()}destroy(){super.destroy(),this.geometry.destroy(),this.material.destroy()}clone(t=!0){const e=this.constructor;return new e(this.geometry.clone(),this.material.clone()).copy(this,t)}copy(t,e=!0){return this.type=t.type,this.usedCache=t.usedCache,this.selected=t.selected,super.copy(t,e),this}}class Tf extends il{isSvg=!0;matrixAutoUpdate=!1;composeNode=!0;constructor(t={}){t.name===void 0&&(t.name="Svg"),t.flipY===void 0&&(t.flipY=!0),t.alignCenter===void 0&&(t.alignCenter=!0),super(t),t.id!==void 0&&(this.userData.id=t.id),this.composeNode=!0;let e;if(t.parsedSvg?e=t.parsedSvg:t.svg&&(e=ll.parse(t.svg)),!e||!e.length)throw new Error("svg parse error");let r;for(let s=0,o=e.length;s<o;s++){r=e[s];const u={...t};r.fill!==void 0&&(u.fill=r.fill),r.stroke!==void 0&&(u.stroke=r.stroke),r.lineWidth!==void 0&&(u.lineWidth=r.lineWidth),r.id!==void 0&&(u.id=r.id);const h=new Af(u);h.name=this.name+"Geo"+s,h.setPath(r.path);const c=new sl(u);if(c.name=this.name+"Mtl"+s,s===0)this.geometry=h,this.material=c,this.matrixAutoUpdate=!1,r.id!==void 0&&(this.name=r.id);else{const p=new ly(h,c);p.matrixAutoUpdate=!1,r.id!==void 0?p.name=r.id:p.name=(this.userData.id||this.name)+s,p.dynamically=this.dynamically,p.usedCache=this.usedCache,p.castShadow=this.castShadow,p.showPoints=this.showPoints,p.wireframe=this.wireframe,this.add(p)}}this.computeBoundingBox(),this.generateFeaturesKey()}destroy(){super.destroy()}copy(t,e=!0){return this.matrixAutoUpdate=t.matrixAutoUpdate,this.composeNode=t.composeNode,super.copy(t,e),this}}const _f="center",hy="top",Cf="middle",ua="normal",cy="word";class fy extends sl{isTextMaterial2=!0;name="TextMaterial2";text;textFill;fontFamily="Arial";fontSize=12;fontStyle=ua;fontWeight=ua;fontVariant=ua;textDecoration="";textAlign=_f;verticalAlign=hy;textBaseline=Cf;lineHeight=1;letterSpacing=0;wrap=cy;ellipsis=!1;constructor(t={}){t.textFill===void 0&&(t.textFill=Rt.black),t.fontFamily===void 0&&(t.fontFamily="Arial"),t.fontSize===void 0&&(t.fontSize=12),t.fontStyle===void 0&&(t.fontStyle=ua),t.fontWeight===void 0&&(t.fontWeight=ua),t.textAlign===void 0&&(t.textAlign=_f),t.textBaseline===void 0&&(t.textBaseline=Cf),super(t),this.setAttrs(t),this.generateFeatureKey()}}class py extends il{isText=!0;type="Text";size=new R;constructor(t={}){if(t.name===void 0&&(t.name="Text"),t.fontSize===void 0&&(t.fontSize=12),super(t),t.fixed&&(this.fixed=!0),t.rotated!==void 0){const s=eo(t.rotated);this.rotation.set(s,s)}const e=new Af(t),r=new fy(t);this.bindGeoMtl(e,r),this.wireframe=t.wireframe||!1}computeBoundingBox(){if(!this.material.text)return this.boundingBox;mr.measureText(this.material.text||"",this,this.size);const t=[];return t.push({x:-this.size.x/2,y:-this.size.y/2}),t.push({x:t[0].x,y:t[0].y+this.size.y}),t.push({x:t[1].x+this.size.x,y:t[1].y}),t.push({x:t[2].x,y:t[0].y}),this.geometry.setFromPoints(t),super.computeBoundingBox()}render(t){this.visible&&this.material.text&&(t.font=`${this.material.fontWeight} ${this.material.fontSize}px ${this.material.fontFamily}`,t.fillStyle=this.material.fill||Rt.black,t.textAlign=this.material.textAlign,t.textBaseline=this.material.textBaseline,t.fillText(this.material.text,0,0))}}class Ii{constructor(t,e,r){this.root=t,this.name=e,this.value=r}static textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};static empty(t){return new Ii(t,"EMPTY","")}getDefinition(){const t=this.toString(),e=/#([^)'"]+)/.exec(t),r=(e==null?void 0:e[1])||t;return this.root.definitions[r]}setValue(t){return this.value=t,this}getValue(t){return typeof t>"u"||this.hasValue()?this.value:t}hasValue(t){const e=this.value;return e!==null&&e!==""&&(t||e!==0)&&typeof e<"u"}split(t=" "){return this.toString().replace(/(?!\u3000)\s+/gm," ").trim().split(t).map(e=>new Ii(this.root,this.name,e))}isString(t){const e=typeof this.value=="string";return!e||!t?e:t.test(this.value)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const t=this.toString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}getNumber(t){if(!this.hasValue())return typeof t>"u"?0:parseFloat(t);const{value:e}=this;let r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}getPixels(t,e=!1){if(!this.hasValue())return 0;const r=typeof t=="boolean",{width:s,height:o}=_t.config;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(s,o);case this.isString(/vmax$/):return this.getNumber()/100*Math.max(s,o);case this.isString(/vw$/):return this.getNumber()/100*s;case this.isString(/vh$/):return this.getNumber()/100*o;case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&r):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*Math.min(s,o);default:{const u=this.getNumber();return e&&u<1?u*Math.min(s,o):u}}}getDpi(){return 96}getRem(){return this.root.rootEmSize}getEm(){return this.root.emSize}getUnits(){return this.toString().replace(/[0-9.-]/g,"")}toString(t){return typeof t>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(t)}}let Pi=class jh{static ignoreChildTypes=["title"];type="";definitions;attributes={};styles={};stylesSpecificity={};parent=null;children=[];root;node;constructor(t,e){!e||e.nodeType!==1||(this.node=e,t===null?(this.root=this,this.definitions={}):this.root=t,this.init())}get id(){return this.getAttribute("id").toString()}init(){this.addAttributes(),this.addStyle(),this.addDefinitions(),Array.from(this.node.childNodes).forEach(t=>{t.nodeType===1&&this.add(t)})}addAttributes(){Array.from(this.node.attributes).forEach(t=>{this.attributes[t.nodeName]=new Ii(this.root,t.nodeName,t.value)})}addStyle(){const{styles:t,stylesSpecificity:e}=this.root;let r;for(const s in t)if(!s.startsWith("@")&&this.matchesSelector(s)){const o=t[s],u=e[s];if(o)for(const h in o){let c=this.stylesSpecificity[h];typeof c>"u"&&(c="000"),u&&u>=c&&(r=o[h],r&&(this.styles[h]=r),this.stylesSpecificity[h]=u)}}this.getAttribute("style").hasValue()&&this.getAttribute("style").toString().split(";").map(o=>o.trim()).forEach(o=>{if(!o)return;const[u,h]=o.split(":").map(c=>c.trim());u&&(this.styles[u]=new Ii(this.root,u,h))})}addDefinitions(){const t=this.getAttribute("id");t.hasValue()&&(this.root.definitions[t.toString()]||(this.root.definitions[t.toString()]=this))}getStyle(t,e=!1,r=!1){const s=this.styles[t];if(s)return s;const o=this.getAttribute(t);if(o.hasValue())return this.styles[t]=o,o;if(!r&&this.parent){const u=this.parent.getStyle(t);if(u.hasValue())return u}if(e){const u=new Ii(this.root,t,"");return this.styles[t]=u,u}return Ii.empty(this.root)}getAttribute(t,e=!1){const r=this.attributes[t];if(!r&&e){const s=new Ii(this.root,t,"");return this.attributes[t]=s,s}return r||Ii.empty(this.root)}getHrefAttribute(){let t;for(const e in this.attributes)if(e==="href"||e.endsWith(":href")){t=this.attributes[e];break}return t||Ii.empty(this.root)}add(t){const e=t instanceof jh?t:this.root.createElement(t);e.parent=this,jh.ignoreChildTypes.includes(e.type)||this.children.push(e)}traverse(t){t(this);const e=this.children;for(let r=0,s=e.length;r<s;r++)e[r].traverse(t)}getById(t){if(this.getAttribute("id").toString()===t)return this;for(let e=0,r=this.children.length;e<r;e++){let s=this.children[e].getById(t);if(s)return s}}getByIds(t){let e=[];return t!=null&&t.length&&t.forEach(r=>{let s=this.getById(r);s&&e.push(s)}),e}getByType(t){if(this.type===t)return this;for(let e=0,r=this.children.length;e<r;e++){let s=this.children[e].getByType(t);if(s)return s}}getRotateRad(t,e=!1){for(;t<0;)t+=360;for(;t>360;)t-=360;return e||(t=360-t),eo(t)}getMatrix(){const t=new kt,e=this.getStyle("transform",!1,!0),r=this.getAttribute("x"),s=this.getAttribute("y"),o=r.hasValue()?r.getPixels("x"):0,u=s.hasValue()?s.getPixels("y"):0;if((o||u)&&t.makeTranslation(o,u),e.hasValue()){je.identity();let h=hm(e.toString());h.forEach(c=>{if(c==="none")return;const[p,g]=Fu(c);let x=Ru(g);p==="scale"&&je.scale(x[0],x[1])}),h.forEach(c=>{if(c==="none")return;const[p,g]=Fu(c);let x=Ru(g);p==="translate"&&(Ki.set(x[0],x[1]).applyMatrix3(je),je.getScale(dy),je.translate(Ki.x,Ki.y))}),h.forEach(c=>{if(c==="none")return;const[p,g]=Fu(c);let x=Ru(g);if(p==="rotate")if(x[1]||x[2]){je.getTransition(Df),je.getScale(Sf);const E=Sf.x<0?-1:1,w=this.getRotateRad(x[0],E<0);Ki.set(x[1],x[2]),Ki.equals(Df)||Ki.applyMatrix3(je),je.translate(-Ki.x,-Ki.y),je.rotate(w),je.translate(Ki.x,Ki.y)}else je.rotate(eo(x[0]))}),t.premultiply(je)}return t}matchesSelector(t){var s;const{node:e}=this;if(typeof e.matches=="function")return e.matches(t);const r=(s=e.getAttribute)==null?void 0:s.call(e,"class");return!r||r===""?!1:r.split(" ").some(o=>`.${o}`===t)}};const je=new kt,dy=new R,Ki=new R,Df=new R,Sf=new R,po={};class Nf extends Pi{type="unknown";constructor(t,e){super(t,e),process.env.NODE_ENV!=="production"&&(po[e.nodeName]||(po[e.nodeName]=0),po[e.nodeName]||console.error(`${e.nodeName} implemented not yet.`),po[e.nodeName]++)}}class gy extends Pi{type="defs";constructor(t,e){super(t,e)}}class my extends Pi{type="style";constructor(t,e){super(t,e),at.replace(Array.from(e.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""),/(?!\u3000)\s+/gm," ").split("}").forEach(o=>{const u=at.trim(o);if(!u)return;const h=u.split("{"),c=h[0].split(","),p=h[1].split(";");c.forEach(g=>{const x=at.trim(g);if(!x)return;const E=this.root.styles[x]||{};p.forEach(w=>{const M=w.indexOf(":"),C=w.substr(0,M).trim(),_=w.substr(M+1,w.length-M).trim();C&&_&&(E[C]=new Ii(this.root,C,_))}),this.root.styles[x]=E,this.root.stylesSpecificity[x]=lm(x)})})}}class yy extends Pi{type="view";constructor(t,e){super(t,e)}}class vy extends Pi{type="symbol";constructor(t,e){super(t,e)}}const ie=" ";function xy(i){let t="";Array.isArray(i)||(i=[i]);for(let e=0;e<i.length;e++){const r=i[e];if(r.type===k.CLOSE_PATH)t+="z";else if(r.type===k.HORIZ_LINE_TO)t+=(r.relative?"h":"H")+r.x;else if(r.type===k.VERT_LINE_TO)t+=(r.relative?"v":"V")+r.y;else if(r.type===k.MOVE_TO)t+=(r.relative?"m":"M")+r.x+ie+r.y;else if(r.type===k.LINE_TO)t+=(r.relative?"l":"L")+r.x+ie+r.y;else if(r.type===k.CURVE_TO)t+=(r.relative?"c":"C")+r.x1+ie+r.y1+ie+r.x2+ie+r.y2+ie+r.x+ie+r.y;else if(r.type===k.SMOOTH_CURVE_TO)t+=(r.relative?"s":"S")+r.x2+ie+r.y2+ie+r.x+ie+r.y;else if(r.type===k.QUAD_TO)t+=(r.relative?"q":"Q")+r.x1+ie+r.y1+ie+r.x+ie+r.y;else if(r.type===k.SMOOTH_QUAD_TO)t+=(r.relative?"t":"T")+r.x+ie+r.y;else if(r.type===k.ARC)t+=(r.relative?"a":"A")+r.rX+ie+r.rY+ie+r.xRot+ie+ +r.lArcFlag+ie+ +r.sweepFlag+ie+r.x+ie+r.y;else throw new Error(`Unexpected command type "${r==null?void 0:r.type}" at index ${e}.`)}return t}function ol([i,t],e){return[i*Math.cos(e)-t*Math.sin(e),i*Math.sin(e)+t*Math.cos(e)]}function Li(...i){for(let t=0;t<i.length;t++)if(typeof i[t]!="number")throw new Error(`assertNumbers arguments[${t}] is not a number. ${typeof i[t]} == typeof ${i[t]}`);return!0}const Vr=Math.PI;function ul(i,t,e){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;let{rX:r,rY:s}=i;const{x:o,y:u}=i;r=Math.abs(i.rX),s=Math.abs(i.rY);const[h,c]=ol([(t-o)/2,(e-u)/2],-i.xRot/180*Vr),p=Math.pow(h,2)/Math.pow(r,2)+Math.pow(c,2)/Math.pow(s,2);1<p&&(r*=Math.sqrt(p),s*=Math.sqrt(p)),i.rX=r,i.rY=s;const g=Math.pow(r,2)*Math.pow(c,2)+Math.pow(s,2)*Math.pow(h,2),x=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(s,2)-g)/g)),E=r*c/s*x,w=-s*h/r*x,M=ol([E,w],i.xRot/180*Vr);i.cX=M[0]+(t+o)/2,i.cY=M[1]+(e+u)/2,i.phi1=Math.atan2((c-w)/s,(h-E)/r),i.phi2=Math.atan2((-c-w)/s,(-h-E)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*Vr),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*Vr),i.phi1*=180/Vr,i.phi2*=180/Vr}function Of(i,t,e){Li(i,t,e);const r=i*i+t*t-e*e;if(0>r)return[];if(r===0)return[[i*e/(i*i+t*t),t*e/(i*i+t*t)]];const s=Math.sqrt(r);return[[(i*e+t*s)/(i*i+t*t),(t*e-i*s)/(i*i+t*t)],[(i*e-t*s)/(i*i+t*t),(t*e+i*s)/(i*i+t*t)]]}const Er=Math.PI/180;function Mf(i,t,e){return(1-e)*i+e*t}function Bf(i,t,e,r){return i+Math.cos(r/180*Vr)*t+Math.sin(r/180*Vr)*e}function If(i,t,e,r){const o=t-i,u=e-t,h=r-e,c=3*o+3*h-6*u,p=(u-o)*6,g=3*o;return Math.abs(c)<1e-6?[-g/p]:by(p/c,g/c,1e-6)}function Pf(i,t,e,r,s){const o=1-s,u=o*o*o,h=3*o*o*s,c=3*o*s*s,p=s*s*s;return i*u+t*h+e*c+r*p}function by(i,t,e=1e-6){const r=i*i/4-t;if(r<-e)return[];if(r<=e)return[-i/2];const s=Math.sqrt(r);return[-(i/2)-s,-(i/2)+s]}function Ey(i,t,e){i.cX||ul(i,t,e);const r=Math.min(i.phi1,i.phi2),s=Math.max(i.phi1,i.phi2),o=s-r,u=Math.ceil(o/90),h=new Array(u);let c=t,p=e;for(let g=0;g<u;g++){const x=Mf(i.phi1,i.phi2,g/u),E=Mf(i.phi1,i.phi2,(g+1)/u),w=E-x,M=4/3*Math.tan(w*Er/4),[C,_]=[Math.cos(x*Er)-M*Math.sin(x*Er),Math.sin(x*Er)+M*Math.cos(x*Er)],[I,W]=[Math.cos(E*Er),Math.sin(E*Er)],[H,A]=[I+M*Math.sin(E*Er),W-M*Math.cos(E*Er)],V={relative:i.relative,type:k.CURVE_TO},F=(K,Z)=>{const[G,j]=ol([K*i.rX,Z*i.rY],i.xRot);return[i.cX+G,i.cY+j]};[V.x1,V.y1]=F(C,_),[V.x2,V.y2]=F(H,A),[V.x,V.y]=F(I,W),i.relative&&(V.x1-=c,V.y1-=p,V.x2-=c,V.y2-=p,V.x-=c,V.y-=p),[c,p]=[V.x,V.y],h[g]=V}return h}function wy(i=1e13){Li(i);function t(e){return Math.round(e*i)/i}return function(r){return"x1"in r&&typeof r.x1<"u"&&(r.x1=t(r.x1)),"y1"in r&&typeof r.y1<"u"&&(r.y1=t(r.y1)),"x2"in r&&typeof r.x2<"u"&&(r.x2=t(r.x2)),"y2"in r&&typeof r.y2<"u"&&(r.y2=t(r.y2)),"x"in r&&typeof r.x<"u"&&(r.x=t(r.x)),"y"in r&&typeof r.y<"u"&&(r.y=t(r.y)),"rX"in r&&typeof r.rX<"u"&&(r.rX=t(r.rX)),"rY"in r&&typeof r.rY<"u"&&(r.rY=t(r.rY)),r}}function Lf(){return Ri((i,t,e)=>(i.relative&&(typeof i.x1<"u"&&(i.x1+=t),typeof i.y1<"u"&&(i.y1+=e),typeof i.x2<"u"&&(i.x2+=t),typeof i.y2<"u"&&(i.y2+=e),typeof i.x<"u"&&(i.x+=t),typeof i.y<"u"&&(i.y+=e),i.relative=!1),i))}function Ay(){return Ri((i,t,e)=>(i.relative||(typeof i.x1<"u"&&(i.x1-=t),typeof i.y1<"u"&&(i.y1-=e),typeof i.x2<"u"&&(i.x2-=t),typeof i.y2<"u"&&(i.y2-=e),typeof i.x<"u"&&(i.x-=t),typeof i.y<"u"&&(i.y-=e),i.relative=!0),i))}function Ty(i=!0,t=!0,e=!0){return Ri((r,s,o,u,h)=>{if(isNaN(u)&&!(r.type&k.MOVE_TO))throw new Error("path must start with moveto");return t&&r.type&k.HORIZ_LINE_TO&&(r.type=k.LINE_TO,r.y=r.relative?0:o),e&&r.type&k.VERT_LINE_TO&&(r.type=k.LINE_TO,r.x=r.relative?0:s),i&&r.type&k.CLOSE_PATH&&(r.type=k.LINE_TO,r.x=r.relative?u-s:u,r.y=r.relative?h-o:h),r.type&k.ARC&&(r.rX===0||r.rY===0)&&(r.type=k.LINE_TO,delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag),r})}function Rf(){let i=NaN,t=NaN,e=NaN,r=NaN;return Ri((s,o,u)=>(s.type&k.SMOOTH_CURVE_TO&&(s.type=k.CURVE_TO,i=isNaN(i)?o:i,t=isNaN(t)?u:t,s.x1=s.relative?o-i:2*o-i,s.y1=s.relative?u-t:2*u-t),s.type&k.CURVE_TO?(i=s.relative?o+s.x2:s.x2,t=s.relative?u+s.y2:s.y2):(i=NaN,t=NaN),s.type&k.SMOOTH_QUAD_TO&&(s.type=k.QUAD_TO,e=isNaN(e)?o:e,r=isNaN(r)?u:r,s.x1=s.relative?o-e:2*o-e,s.y1=s.relative?u-r:2*u-r),s.type&k.QUAD_TO?(e=s.relative?o+s.x1:s.x1,r=s.relative?u+s.y1:s.y1):(e=NaN,r=NaN),s))}function Ff(){let i=NaN,t=NaN;return Ri((e,r,s)=>{if(e.type&k.SMOOTH_QUAD_TO&&(e.type=k.QUAD_TO,i=isNaN(i)?r:i,t=isNaN(t)?s:t,e.x1=e.relative?r-i:2*r-i,e.y1=e.relative?s-t:2*s-t),e.type&k.QUAD_TO){i=e.relative?r+e.x1:e.x1,t=e.relative?s+e.y1:e.y1;const o=e.x1,u=e.y1;e.type=k.CURVE_TO,e.x1=((e.relative?0:r)+o*2)/3,e.y1=((e.relative?0:s)+u*2)/3,e.x2=(e.x+o*2)/3,e.y2=(e.y+u*2)/3}else i=NaN,t=NaN;return e})}function Ri(i){let t=0,e=0,r=NaN,s=NaN;return function(u){if(isNaN(r)&&!(u.type&k.MOVE_TO))throw new Error("path must start with moveto");const h=i(u,t,e,r,s);return u.type&k.CLOSE_PATH&&(t=r,e=s),"x"in u&&typeof u.x<"u"&&(t=u.relative?t+u.x:u.x),"y"in u&&typeof u.y<"u"&&(e=u.relative?e+u.y:u.y),u.type&k.MOVE_TO&&(r=t,s=e),h}}function _y(i=0){Li(i);let t=NaN,e=NaN,r=NaN,s=NaN;return Ri((o,u,h,c,p)=>{const g=Math.abs;let x=!1,E=0,w=0;if(o.type&k.SMOOTH_CURVE_TO&&(E=isNaN(t)?0:u-t,w=isNaN(e)?0:h-e),o.type&(k.CURVE_TO|k.SMOOTH_CURVE_TO)?(t=o.relative?u+o.x2:o.x2,e=o.relative?h+o.y2:o.y2):(t=NaN,e=NaN),o.type&k.SMOOTH_QUAD_TO?(r=isNaN(r)?u:2*u-r,s=isNaN(s)?h:2*h-s):o.type&k.QUAD_TO?(r=o.relative?u+o.x1:o.x1,s=o.relative?h+o.y1:o.y2):(r=NaN,s=NaN),o.type&k.LINE_COMMANDS||o.type&k.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&k.CURVE_TO||o.type&k.SMOOTH_CURVE_TO||o.type&k.QUAD_TO||o.type&k.SMOOTH_QUAD_TO){const M=typeof o.x>"u"?0:o.relative?o.x:o.x-u,C=typeof o.y>"u"?0:o.relative?o.y:o.y-h;E=isNaN(r)?typeof o.x1>"u"?E:o.relative?o.x:o.x1-u:r-u,w=isNaN(s)?typeof o.y1>"u"?w:o.relative?o.y:o.y1-h:s-h;const _=typeof o.x2>"u"?0:o.relative?o.x:o.x2-u,I=typeof o.y2>"u"?0:o.relative?o.y:o.y2-h;g(M)<=i&&g(C)<=i&&g(E)<=i&&g(w)<=i&&g(_)<=i&&g(I)<=i&&(x=!0)}return o.type&k.CLOSE_PATH&&g(u-c)<=i&&g(h-p)<=i&&(x=!0),x?[]:o})}function zr(i,t,e,r,s,o){return Li(i,t,e,r,s,o),Ri((u,h,c,p)=>{const g=u.x1,x=u.x2,E=u.relative&&!isNaN(p),w=typeof u.x<"u"?u.x:E?0:h,M=typeof u.y<"u"?u.y:E?0:c;u.type&k.HORIZ_LINE_TO&&t!==0&&(u.type=k.LINE_TO,u.y=u.relative?0:c),u.type&k.VERT_LINE_TO&&e!==0&&(u.type=k.LINE_TO,u.x=u.relative?0:h),typeof u.x<"u"&&(u.x=u.x*i+M*e+(E?0:s)),typeof u.y<"u"&&(u.y=w*t+u.y*r+(E?0:o)),typeof u.x1<"u"&&(u.x1=u.x1*i+u.y1*e+(E?0:s)),typeof u.y1<"u"&&(u.y1=g*t+u.y1*r+(E?0:o)),typeof u.x2<"u"&&(u.x2=u.x2*i+u.y2*e+(E?0:s)),typeof u.y2<"u"&&(u.y2=x*t+u.y2*r+(E?0:o));function C(I){return I*I}const _=i*r-t*e;if(typeof u.xRot<"u"&&(i!==1||t!==0||e!==0||r!==1))if(_===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=k.LINE_TO;else{const I=u.xRot*Math.PI/180,W=Math.sin(I),H=Math.cos(I),A=1/C(u.rX),V=1/C(u.rY),F=C(H)*A+C(W)*V,K=2*W*H*(A-V),Z=C(W)*A+C(H)*V,G=F*r*r-K*t*r+Z*t*t,j=K*(i*r+t*e)-2*(F*e*r+Z*i*t),J=F*e*e-K*i*e+Z*i*i,nt=(Math.atan2(j,G-J)+Math.PI)%Math.PI/2,ht=Math.sin(nt),gt=Math.cos(nt);u.rX=Math.abs(_)/Math.sqrt(G*C(gt)+j*ht*gt+J*C(ht)),u.rY=Math.abs(_)/Math.sqrt(G*C(ht)-j*ht*gt+J*C(gt)),u.xRot=nt*180/Math.PI}return typeof u.sweepFlag<"u"&&0>_&&(u.sweepFlag=+!u.sweepFlag),u})}function Cy(i,t=0,e=0){Li(i,t,e);const r=Math.sin(i),s=Math.cos(i);return zr(s,r,-r,s,t-t*s+e*r,e-t*r-e*s)}function Dy(i,t=0){return Li(i,t),zr(1,0,0,1,i,t)}function Sy(i,t=i){return Li(i,t),zr(i,0,0,t,0,0)}function Ny(i){return Li(i),zr(1,0,Math.atan(i),1,0,0)}function Oy(i){return Li(i),zr(1,Math.atan(i),0,1,0,0)}function My(i=0){return Li(i),zr(-1,0,0,1,i,0)}function By(i=0){return Li(i),zr(1,0,0,-1,0,i)}function Iy(){return Ri((i,t,e)=>k.ARC===i.type?Ey(i,i.relative?0:t,i.relative?0:e):i)}function Py(){return Ri((i,t,e)=>(i.relative&&(t=0,e=0),k.ARC===i.type&&ul(i,t,e),i))}function Uf(){return i=>({...i})}function Ly(){const i=Uf(),t=Lf(),e=Ff(),r=Rf(),s=Ri((o,u,h)=>{const c=r(e(t(i(o))));function p(x){x>s.maxX&&(s.maxX=x),x<s.minX&&(s.minX=x)}function g(x){x>s.maxY&&(s.maxY=x),x<s.minY&&(s.minY=x)}if(c.type&k.DRAWING_COMMANDS&&(p(u),g(h)),c.type&k.HORIZ_LINE_TO&&p(c.x),c.type&k.VERT_LINE_TO&&g(c.y),c.type&k.LINE_TO&&(p(c.x),g(c.y)),c.type&k.CURVE_TO){p(c.x),g(c.y);const x=If(u,c.x1,c.x2,c.x);for(const w of x)0<w&&1>w&&p(Pf(u,c.x1,c.x2,c.x,w));const E=If(h,c.y1,c.y2,c.y);for(const w of E)0<w&&1>w&&g(Pf(h,c.y1,c.y2,c.y,w))}if(c.type&k.ARC){p(c.x),g(c.y),ul(c,u,h);const x=c.xRot/180*Math.PI,E=Math.cos(x)*c.rX,w=Math.sin(x)*c.rX,M=-Math.sin(x)*c.rY,C=Math.cos(x)*c.rY,[_,I]=c.phi1<c.phi2?[c.phi1,c.phi2]:-180>c.phi2?[c.phi2+360,c.phi1+360]:[c.phi2,c.phi1],W=([V,F])=>{const Z=Math.atan2(F,V)*180/Math.PI;return Z<_?Z+360:Z},H=Of(M,-E,0).map(W);for(const V of H)V>_&&V<I&&p(Bf(c.cX,E,M,V));const A=Of(C,-w,0).map(W);for(const V of A)V>_&&V<I&&g(Bf(c.cY,w,C,V))}return o});return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}const ce={ROUND:wy,TO_ABS:Lf,TO_REL:Ay,NORMALIZE_HVZ:Ty,NORMALIZE_ST:Rf,QT_TO_C:Ff,INFO:Ri,SANITIZE:_y,MATRIX:zr,ROTATE:Cy,TRANSLATE:Dy,SCALE:Sy,SKEW_X:Ny,SKEW_Y:Oy,X_AXIS_SYMMETRY:My,Y_AXIS_SYMMETRY:By,A_TO_C:Iy,ANNOTATE_ARCS:Py,CLONE:Uf,CALCULATE_BOUNDS:Ly};class kf{round(t){return this.transform(ce.ROUND(t))}toAbs(){return this.transform(ce.TO_ABS())}toRel(){return this.transform(ce.TO_REL())}normalizeHVZ(t,e,r){return this.transform(ce.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(ce.NORMALIZE_ST())}qtToC(){return this.transform(ce.QT_TO_C())}aToC(){return this.transform(ce.A_TO_C())}sanitize(t){return this.transform(ce.SANITIZE(t))}translate(t,e){return this.transform(ce.TRANSLATE(t,e))}scale(t,e){return this.transform(ce.SCALE(t,e))}rotate(t,e,r){return this.transform(ce.ROTATE(t,e,r))}matrix(t,e,r,s,o,u){return this.transform(ce.MATRIX(t,e,r,s,o,u))}skewX(t){return this.transform(ce.SKEW_X(t))}skewY(t){return this.transform(ce.SKEW_Y(t))}xSymmetry(t){return this.transform(ce.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(ce.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(ce.ANNOTATE_ARCS())}}const Ry=i=>i===" "||i===" "||i==="\r"||i===`
|
|
39
|
-
`,Hf=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;class Fy extends kf{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];constructor(){super()}finish(t=[]){if(this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=s=>{e.push(s),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let s=0;s<t.length;s++){const o=t[s],u=this.curCommandType===k.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),h=Hf(o)&&(this.curNumber==="0"&&o==="0"||u);if(Hf(o)&&!h){this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(o==="e"||o==="E"){this.curNumber+=o,this.curNumberHasExp=!0;continue}if((o==="-"||o==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=o;continue}if(o==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!u){this.curNumber+=o,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError(`Invalid number ending at ${s}`);if(this.curCommandType===k.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError(`Expected positive number, got "${c}" at index "${s}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${s}"`)}this.curArgs.push(c),this.curArgs.length===Uy[this.curCommandType]&&(k.HORIZ_LINE_TO===this.curCommandType?r({type:k.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):k.VERT_LINE_TO===this.curCommandType?r({type:k.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===k.MOVE_TO||this.curCommandType===k.LINE_TO||this.curCommandType===k.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),k.MOVE_TO===this.curCommandType&&(this.curCommandType=k.LINE_TO)):this.curCommandType===k.CURVE_TO?r({type:k.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===k.SMOOTH_CURVE_TO?r({type:k.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===k.QUAD_TO?r({type:k.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===k.ARC&&r({type:k.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Ry(o)){if(o===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(o==="+"||o==="-"||o==="."){this.curNumber=o,this.curNumberHasDecimal=o===".";continue}if(h){this.curNumber=o,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${s}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${o}" at index ${s}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,o==="z"||o==="Z"){e.push({type:k.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(o==="h"||o==="H")this.curCommandType=k.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=k.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=k.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=k.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=k.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=k.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=k.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=k.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else if(o==="a"||o==="A")this.curCommandType=k.ARC,this.curCommandRelative=o==="a";else throw new SyntaxError(`Unexpected character "${o}" at index ${s}.`)}}return e}transform(t){return Object.create(this,{parse:{value(r,s=[]){const o=Object.getPrototypeOf(this).parse.call(this,r);for(const u of o){const h=t(u);Array.isArray(h)?s.push(...h):s.push(h)}return s}}})}}class k extends kf{commands;constructor(t){super(),typeof t=="string"?this.commands=k.parse(t):this.commands=t}encode(){return k.encode(this.commands)}getBounds(){const t=ce.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const s=t(r);Array.isArray(s)?e.push(...s):e.push(s)}return this.commands=e,this}static encode(t){return xy(t)}static parse(t){const e=new Fy,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=k.LINE_TO|k.HORIZ_LINE_TO|k.VERT_LINE_TO;static DRAWING_COMMANDS=k.HORIZ_LINE_TO|k.VERT_LINE_TO|k.LINE_TO|k.CURVE_TO|k.SMOOTH_CURVE_TO|k.QUAD_TO|k.SMOOTH_QUAD_TO|k.ARC}const Uy={[k.MOVE_TO]:2,[k.LINE_TO]:2,[k.HORIZ_LINE_TO]:1,[k.VERT_LINE_TO]:1,[k.CLOSE_PATH]:0,[k.QUAD_TO]:4,[k.SMOOTH_QUAD_TO]:2,[k.CURVE_TO]:6,[k.SMOOTH_CURVE_TO]:4,[k.ARC]:7},bn=new R,os=new R;class ky extends Pi{type="path";pathData;paths=[];_i=-1;_command;_previousCommand;_start=new R;_control=new R;_current=new R;_ps=[];_angles=[];constructor(t,e){super(t,e),this.initPaths()}initPaths(){var r,s;let t=this.getAttribute("d").toString().replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"");if(this.pathData=new k(t),!((s=(r=this.pathData)==null?void 0:r.commands)!=null&&s.length))return;this._reset();const e=new Zi;for(;!this._isEnd();){const o=this._next();switch(o.type){case k.MOVE_TO:this.moveTo(e);break;case k.LINE_TO:this.lineTo(e);break;case k.HORIZ_LINE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.VERT_LINE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.CURVE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.SMOOTH_CURVE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.QUAD_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.SMOOTH_QUAD_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.ARC:this.arc(e);break;case k.CLOSE_PATH:this.closePath(e);break;default:console.error(`path ${o} implemented not yet.`);break}}this.paths.push(e)}moveTo(t){return bn.copy(this._getAsCurrentPoint()),this._start.copy(this._current),t.moveTo(bn.x,bn.y),this}lineTo(t){return os.copy(this._getAsCurrentPoint()),t.lineTo(os.x,os.y),this}arc(t){bn.copy(this._current),os.copy(this._getAsCurrentPoint());const e=bn.x,r=bn.y,s=os.x,o=os.y,u=this._command.lArcFlag,h=this._command.sweepFlag,c=this._command.rX,p=this._command.rY,g=this._command.xRot;let x=Hy(e,r,s,o,u,h,c,p,g),E=x[2]>x[3]?x[2]:x[3];return t.arc(x[0],x[1],E,x[4],x[4]+x[5],!!(x[7]-1)),this}closePath(t){return this._current.copy(this._start),t.closePath(),this}_reset(){this._i=-1,this._command=void 0,this._previousCommand=void 0,this._start.set(0,0),this._control.set(0,0),this._current.set(0,0),this._ps.length=0,this._angles.length=0}_isEnd(){var t;return this._i>=(((t=this.pathData.commands)==null?void 0:t.length)||0)-1}_next(){const t=this.pathData.commands[++this._i];return this._previousCommand=this._command,this._command=t,this._command}_getAsCurrentPoint(t,e){return bn.copy(this._current),this._current.copy(this._getPoint(t,e)),this._current}_getPoint(t="x",e="y"){return this._makeAbsolute(new R(this._command[t],this._command[e]))}_makeAbsolute(t){return this._command.relative?t.add(this._current):t}_getAsControlPoint(t,e){return this._control.copy(this._getPoint(t,e)),this._control}_getReflectedControlPoint(){var e;const t=(e=this._previousCommand)==null?void 0:e.type;return t!==k.CURVE_TO&&t!==k.SMOOTH_CURVE_TO&&t!==k.QUAD_TO&&t!==k.SMOOTH_QUAD_TO?this._current:(this._current.set(this._command.cx,this._command.cy),this._control.set(this._command.ox,this._command.oy),new R(2*this._current.x-this._control.x,2*this._current.y-this._control.y))}}function Hy(i,t,e,r,s,o,u,h,c){let p=c*(Math.PI/180),g=Math.cos(p)*(i-e)/2+Math.sin(p)*(t-r)/2,x=-1*Math.sin(p)*(i-e)/2+Math.cos(p)*(t-r)/2,E=g*g/(u*u)+x*x/(h*h);E>1&&(u*=Math.sqrt(E),h*=Math.sqrt(E));let w=Math.sqrt((u*u*(h*h)-u*u*(x*x)-h*h*(g*g))/(u*u*(x*x)+h*h*(g*g)));s===o&&(w*=-1),isNaN(w)&&(w=0);let M=w*u*x/h,C=w*-h*g/u,_=(i+e)/2+Math.cos(p)*M-Math.sin(p)*C,I=(t+r)/2+Math.sin(p)*M+Math.cos(p)*C,W=function(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])},H=function(G,j){return(G[0]*j[0]+G[1]*j[1])/(W(G)*W(j))},A=function(G,j){return(G[0]*j[1]<G[1]*j[0]?-1:1)*Math.acos(H(G,j))},V=A([1,0],[(g-M)/u,(x-C)/h]),F=[(g-M)/u,(x-C)/h],K=[(-1*g-M)/u,(-1*x-C)/h],Z=A(F,K);return H(F,K)<=-1&&(Z=Math.PI),H(F,K)>=1&&(Z=0),o===0&&Z>0&&(Z=Z-2*Math.PI),o===1&&Z<0&&(Z=Z+2*Math.PI),[_,I,u,h,V,Z,p,o]}class qy extends Pi{type="g";constructor(t,e){super(t,e)}}class Wy extends Pi{type="use";symbolId;cachedElement;constructor(t,e){super(t,e),this.symbolId=at.replace(this.getHrefAttribute().toString()||"","#",""),this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition())}}class Vy extends Pi{type="circle";paths=[];constructor(t,e){super(t,e),this.initPath()}initPath(){this.paths.length=0;const t=new Zi,e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),s=this.getAttribute("r").getPixels();s>0&&t.arc(e,r,s,0,Math.PI*2,!1),this.paths.push(t)}}class zy extends Pi{type="text";text;fontSize;constructor(t,e){super(t,e),this.text=this.getTextFromNode()}getTextFromNode(t){const e=t||this.node,r=Array.from(e.parentNode.childNodes),s=r.indexOf(e),o=r.length-1;let u=(e.textContent||"").replace(/(?!\u3000)\s+/gm," ");return s===0&&(u=at.trimStart(u)),s===o&&(u=at.trimEnd(u)),u}getFontSize(){var e;const t=(e=this.parent)==null?void 0:e.getStyle("font-size").getPixels(!0);return t?this.text==="Mechanical Room"?20:t:12}}const $y={view:yy,defs:gy,style:my,symbol:vy,path:ky,g:qy,use:Wy,circle:Vy,text:zy,unknown:Nf};class Gy extends Pi{type="svg";definitions={};rootEmSize=qf;emSize=qf;constructor(t){super(null,t),this.definitions={}}createElement(t){const e=t.nodeName.replace(/^[^:]+:/,""),r=$y[e];return r?new r(this,t):new Nf(this,t)}}const qf=16;class ll extends Jc{parsedData={};data={};constructor(t){super(t)}static parse(t,e){const r=[];return t&&(av(t,r),cv(r)),r}load(t,e,r,s){const o=this,u=new _m(o.manager);u.setPath(o.path),u.setRequestHeader(o.requestHeader),u.setWithCredentials(o.withCredentials),u.load(t,function(h){try{e&&e(h)}catch(c){s?s(c):console.error(c),o.manager.itemError(t)}},r,s)}parseFile(t){if(!t)return;const e=new ff.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",parseAttributeValue:!0});return this.parsedData=e.parse(t),this.parsedData}static trans2Ro(t,e=!0){let s=new ff.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",parseAttributeValue:!0}).parse(t),o=Xy(s);return ha(o,"svg",void 0,s.svg,e)}static getSvgElement(t){let e=new _t.window.DOMParser().parseFromString(t,"image/svg+xml");return new Gy(e.documentElement)}selectById(t){this.data}}function Xy(i){var e,r,s,o,u,h,c,p,g,x;let t={};return(e=i.svg)!=null&&e.view&&(t.view=Yy((r=i.svg)==null?void 0:r.view)),(s=i.svg)!=null&&s.viewBox&&(t.viewBox=new Ot().setFromMinMaxString((o=i.svg)==null?void 0:o.viewBox)),(u=i.svg)!=null&&u.version&&(t.version=(h=i.svg)==null?void 0:h.version),(c=i.svg)!=null&&c.archibusversion&&(t.userData={version:(p=i.svg)==null?void 0:p.archibusversion}),(g=i.svg)!=null&&g.defs&&(t.defs=Zy((x=i.svg)==null?void 0:x.defs)),t}function Yy(i){return{id:i.id,units:i.units,viewBox:new Ot().setFromMinMaxString(i.viewBox)}}function Zy(i){let t={};return t.style=jy(i==null?void 0:i.style),t.symbol=Ky(i==null?void 0:i.symbol),t}const En={};function jy(i){const t=/\.([^\s{]+)\s*\{\s*([^}]+)\s*\}/g;let e;for(;(e=t.exec(i))!==null;){const r=e[1],s=e[2];En[r]={};const o=/([^:]+):\s*([^;]+);?/g;let u;for(;(u=o.exec(s))!==null;){const h=at.camelCase(u[1].trim()),c=u[2].trim();En[r][h]=c}}return En}function Ky(i){let t={};if(!(i!=null&&i.length))return t;for(let e=0,r=i.length;e<r;e++){let s=i[e];s.id&&(t[s.id]=ha({defs:{symbol:t}},"symbol",void 0,i[e],!0))}return t}const la=["use","path","circle","text"];function ha(i,t,e,r,s){let o;if(typeof r!="object")return o;if(Array.isArray(r)){o=new Ku({name:e.id,userData:{id:e.id}});for(let u=0,h=r.length;u<h;u++){let c=ha(i,t,e,r[u],s);c&&o.add(c)}return t==="text"&&o.children.length===1?(o=o.children[0],o.updateMatrix(),o):(o.updateMatrix(),o)}if(!t||t==="svg"||t==="g"||t==="symbol"){if(o=new Ku({name:r.id,userData:{id:r.id,tag:t}}),zf(r,s,o),r.style=Wf(i,e,r),r.g){let u=ha(i,"g",r,r.g,s);u&&o.add(u)}for(let u=0,h=la.length;u<h;u++)if(r[la[u]]){let c=ha(i,la[u],r,r[la[u]],s);c&&o.add(c)}return o}if(la.includes(t)){r.style=Wf(i,e,r);const u=tv(i,t,r);return u?(zf(r,s,u),u):void 0}return o}function Wf(i,t,e){let r={};return t&&(En[t==null?void 0:t.class]&&at.merge(r,En[t.class]),Vf(i,t,r)),En[e.class]&&at.merge(r,En[e.class]),Vf(i,e,r),r}function Vf(i,t,e){t.style&&at.merge(e,t.style);let r=parseFloat(at.get(t,"stroke-width")||"")||0;return r>0&&(e.strokeWidth=Jy(i,r)),e}const Qy=new Ot,go=new R;function Jy(i,t){var r,s,o;if(!t)return t;if(!((r=i==null?void 0:i.view)!=null&&r.viewBox))return 1;Qy.copy((s=i==null?void 0:i.view)==null?void 0:s.viewBox).getSize(go);let e=Math.round(t/100*((go==null?void 0:go.length())||1));return((o=i==null?void 0:i.view)==null?void 0:o.units)==="inches"&&(e=Math.max(Math.ceil(e/25),1)),e}function tv(i,t,e){var p,g,x,E;let r,s=e.fill||((p=e.style)==null?void 0:p.fill)||void 0,o=e.fillOpacity||((g=e.style)==null?void 0:g.fillOpacity)||void 0;s&&o&&(s=new Ft(s).setA(o).getStyle());let u=e.strokeWidth||((x=e.style)==null?void 0:x.strokeWidth)||1,h=e.stroke||((E=e.style)==null?void 0:E.stroke)||Rt.black;const c=[{name:"path",fill:s,lineWidth:u,stroke:h}];if(t==="path"){let w=Gf(e.d,!0);if(!Array.isArray(w))return c[0].path=w,$f(t,e,c);r=new Ku({name:e.id,userData:{id:e.id,tag:t}});for(let M=0,C=w.length;M<C;M++){let _=at.cloneDeep(c);_[0].path=w[M];const I=$f(t,e,_);r.add(I),I.updateMatrix()}return r}return t==="use"?iv(i,t,e):t==="text"?rv(t,e):t==="circle"?nv(t,e,c):r}function zf(i,t,e){if((i.selectable===!0||i.selectable==="true")&&e.setSelectable(!0),i.x!==void 0&&!isNaN(Number(i.x))&&(e.position.x=i.x),i.y!==void 0&&!isNaN(Number(i.y))&&(e.position.y=i.y*(t?-1:1)),i.transform){let r=ev(i.transform);r.tx&&(e.position.x=r.tx),r.ty&&(e.position.y=r.ty*(t?-1:1)),r.rx&&(e.position.x=r.rx),r.ry&&(e.position.y=r.ry*(t?-1:1)),r.ra&&(e.rotation.x=eo(r.ra*(t?-1:1))),r.sx&&(e.scaled.x=r.sx),r.sy&&(e.scaled.y=r.sy)}return e.updateMatrix(),e}function ev(i){const t={},e=/(\w+)\(([^)]+)\)/g;let r;for(;(r=e.exec(i))!==null;){const[s,o,u]=r,h=u.split(",").map(Number);switch(o){case"scale":t.sx=h[0],t.sy=h.length>1?h[1]:h[0];break;case"translate":isNaN(Number(h[0]))||(t.tx=h[0]),h.length>1&&!isNaN(Number(h[1]))&&(t.ty=h[1]);break;case"rotate":t.ra=h[0],t.rx=h[1],t.ry=h[2];break}}return t}function iv(i,t,e){var o,u;let r,s=at.get(e,"xlink:href");if(at.startsWith(s,"#")&&(s=s.substring(1)),(o=i.defs)!=null&&o.symbol&&((u=i.defs)!=null&&u.symbol[s]))return r=i.defs.symbol[s].clone(),at.merge(r.userData,{id:e.id,tag:t}),r}function $f(i,t,e){return new Tf({name:t.id||i,parsedSvg:e,composeNode:!0,userData:{id:t.id,tag:i}})}function rv(i,t){let e=at.get(t,"#text");if(e)return new py({text:e,fontSize:20,fill:Rt.black,wireframe:!1,flipY:!0,userData:{id:t.id,tag:i}})}function nv(i,t,e){return e[0].cx=t.cx,e[0].cy=t.cy,e[0].r=t.r,Zf(e[0]),new Tf({name:t.id||i,parsedSvg:e,composeNode:!0,alignCenter:!0,userData:{id:t.id,tag:i}})}const sv=["x","y","lineWidth","width","height","rx","cx","cy","r"];function av(i,t=[]){if(!i)throw new Error("input error");const e=i.match(/<(\w+)([^<]+)>/g);if(!e||!e.length)return t;let r="",s=[],o="";for(let u=0,h=e.length;u<h;u++)r=e[u].replace(/[<>]/g,""),s=r.split(" "),!(!s||!s.length)&&(o=s[0],!(o!=="path"&&o!=="clipPath"&&o!=="rect"&&o!=="circle"&&o!=="text"&&o!=="polygon")&&(r.indexOf("class")>=0&&(e[u]=lv(i,e[u])),hv(e[u],t)));return t}function ov(i){const t=/<style>([\s\S]*?)<\/style>/,e=i.match(t);if(e&&e.length>1)return e[1]}function uv(i){const t={},e=ov(i);if(!e)return t;const r=/\.([\w-]+)\s*\{([\s\S]*?)\}/g;let s;for(;(s=r.exec(e))!==null;){const o=s[1],u=s[2];t[o]={};const h=/([\w-]+)\s*:\s*([^;]+)/g;let c;for(;(c=h.exec(u))!==null;){const p=c[1],g=c[2];t[o][p]=g.trim()}}return t}function lv(i,t){let e=t.match(/class="([^"]+)"/);if(!e)return t;const r=e[0],s=uv(i),o=[];return Object.keys(s).forEach(u=>{Object.keys(s[u]).forEach(h=>{o.push(h+'="'+s[u][h]+'"')})}),!o||!o.length||(t=t.replaceAll(r,o.join(" "))),t}function hv(i,t=[]){const r=i.replace(/[<>]/g,"").split(" ");if(!r||!r.length)return t;const s={name:""};let o="",u=!1;for(let h=0,c=r.length;h<c;h++)if(u=r[h].indexOf("=")>=0,!h)s.name=r[h];else if(u){const p=r[h].split("=");p[0]==="stroke-width"?p[0]="lineWidth":p[0]==="stroke-linecap"&&(p[0]="strokeLinecap"),s[p[0]]=p[1].replace(/\"/g,""),o=p[0]}else u||(s[o]+=" "+r[h].replace(/\"/g,""));for(const h in s)sv.indexOf(h)>=0&&(s[h]=parseFloat(s[h]));return t.push(s),t}function cv(i=[],t){for(let e=0,r=i.length;e<r;e++)switch(i[e].name){case"path":fv(i[e]);break;case"clipPath":break;case"rect":dv(i[e]);break;case"circle":Zf(i[e]);break;case"text":break;case"polygon":gv(i[e]);break;default:delete i[e].path;break}return i}const us=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];function fv(i){!i.d||!i.d.length||(i.path=Gf(i.d,!1))}const pv=100;function Gf(i,t=!1){i=at.trim(i),i=i.replace(new RegExp(" ","g"),",").replace(new RegExp("M","g"),"|M");const e=at.split(i,"|");if(e!=null&&e.length&&e[0]===""&&e.shift(),!t||e.length<=pv*2){let u=[];for(let h=0,c=e.length;h<c;h++){let p=e[h];for(let x=0,E=us.length;x<E;x++)p=p.replace(new RegExp(us[x],"g"),"|"+us[x]);let g=p.split("|");g!=null&&g.length&&g[0]===""&&g.shift(),u=u.concat(g)}return Xf(u)}let r=[];for(let u=0,h=e.length;u<h;u++){let c=/M\s*(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)/g.exec(e[u]);c&&(c==null?void 0:c.length)>3&&r.push({x:parseFloat(c[1]),y:parseFloat(c[3]),cms:e[u]})}r=at.sortBy(r,u=>R.getLength({x:u.x,y:u.y}));let s=at.chunk(r,Math.floor(r.length/10)),o=[];for(let u=0,h=s.length;u<h;u++){let c=[];for(let p=0,g=s[u].length;p<g;p++){let x=s[u][p].cms;for(let w=0,M=us.length;w<M;w++)x=x.replace(new RegExp(us[w],"g"),"|"+us[w]);let E=x.split("|");E!=null&&E.length&&E[0]===""&&E.shift(),c=c.concat(E)}o.push(Xf(c))}return o}function Xf(i){let t=new Zi;const e=[];let r=0,s=0;const o=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let u,h="";for(let c=0,p=i.length;c<p;c++){let g=i[c],x=g.charAt(0);for(g=g.slice(1),e.length=0;u=o.exec(g);)e.push(u[0]);const E=[];for(let M=0,C=e.length;M<C;M++){if(e[M]==="00"){E.push(0,0);continue}let _=parseFloat(e[M]);isNaN(_)?E.push(0):E.push(_)}let w=[];for(;E.length>0&&!isNaN(E[0]);){let M=r,C=s,_,I,W,H,A,V,F,K,Z;switch(x){case"M":M=r=E.shift()||0,C=s=E.shift()||0,t.moveTo(r,s);break;case"m":let G=E.shift()||0,j=E.shift()||0;r+=G,s+=j,h==="z"&&(r=M+G,s=C+j),t.moveTo(r,s);break;case"l":r+=E.shift()||0,s+=E.shift()||0,t.lineTo(r,s);break;case"L":r=E.shift()||0,s=E.shift()||0,t.lineTo(r,s);break;case"h":r+=E.shift()||0,t.lineTo(r,s);break;case"H":r=E.shift()||0,t.lineTo(r,s);break;case"v":s+=E.shift()||0,t.lineTo(r,s);break;case"V":s=E.shift()||0,t.lineTo(r,s);break;case"C":w.length=0,w.push(E.shift()||0,E.shift()||0,E.shift()||0,E.shift()||0),r=E.shift()||0,s=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"c":w.length=0,w.push(r+(E.shift()||0),s+(E.shift()||0),r+(E.shift()||0),s+(E.shift()||0)),r+=E.shift()||0,s+=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"S":_=r,I=s,h==="C"&&(_=r+(r-w[2]),I=s+(s-w[3])),w.length=0,w.push(_,I,E.shift()||0,E.shift()||0),r=E.shift()||0,s=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"s":_=r,I=s,h==="C"&&(_=r+(r-w[2]),I=s+(s-w[3])),w.length=0,w.push(_,I,r+(E.shift()||0),s+(E.shift()||0)),r+=E.shift()||0,s+=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"Q":w.length=0,w.push(E.shift()||0,E.shift()||0),r=E.shift()||0,s=E.shift()||0,t.quadraticCurveTo(w[0],w[1],r,s);break;case"q":w.length=0,w.push(r+(E.shift()||0),s+(E.shift()||0)),r+=E.shift()||0,s+=E.shift()||0,t.quadraticCurveTo(w[0],w[1],r,s);break;case"T":_=r,I=s,h==="Q"&&(_=r+(r-w[0]),I=s+(s-w[1])),r=E.shift()||0,s=E.shift()||0,t.quadraticCurveTo(_,I,r,s);break;case"t":_=r,I=s,h==="Q"&&(_=r+(r-w[0]),I=s+(s-w[1])),r+=E.shift()||0,s+=E.shift()||0,t.quadraticCurveTo(_,I,r,s);break;case"A":W=E.shift()||0,H=E.shift()||0,A=E.shift()||0,V=E.shift()||0,F=E.shift()||0,K=r,Z=s,r=E.shift()||0,s=E.shift()||0,w=Yf(K,Z,r,s,V,F,W,H,A),t.arc(w[0],w[1],w[2]>w[3]?w[2]:w[3],w[4],w[4]+w[5],!!(w[7]-1));break;case"a":W=E.shift()||0,H=E.shift()||0,A=E.shift()||0,V=E.shift()||0,F=E.shift()||0,K=r,Z=s,r+=E.shift()||0,s+=E.shift()||0,w=Yf(K,Z,r,s,V,F,W,H,A),t.arc(w[0],w[1],w[2]>w[3]?w[2]:w[3],w[4],w[4]+w[5],!!(w[7]-1)),console.log("arc: ",g,K,Z,r,s,V,F,W,H,A);break;case"z":t.closePath();break;default:E.shift()}}h=x,(x==="z"||x==="Z")&&t.closePath()}return t}function Yf(i,t,e,r,s,o,u,h,c){let p=c*(Math.PI/180),g=Math.cos(p)*(i-e)/2+Math.sin(p)*(t-r)/2,x=-1*Math.sin(p)*(i-e)/2+Math.cos(p)*(t-r)/2,E=g*g/(u*u)+x*x/(h*h);E>1&&(u*=Math.sqrt(E),h*=Math.sqrt(E));let w=Math.sqrt((u*u*(h*h)-u*u*(x*x)-h*h*(g*g))/(u*u*(x*x)+h*h*(g*g)));s===o&&(w*=-1),isNaN(w)&&(w=0);let M=w*u*x/h,C=w*-h*g/u,_=(i+e)/2+Math.cos(p)*M-Math.sin(p)*C,I=(t+r)/2+Math.sin(p)*M+Math.cos(p)*C,W=function(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])},H=function(G,j){return(G[0]*j[0]+G[1]*j[1])/(W(G)*W(j))},A=function(G,j){return(G[0]*j[1]<G[1]*j[0]?-1:1)*Math.acos(H(G,j))},V=A([1,0],[(g-M)/u,(x-C)/h]),F=[(g-M)/u,(x-C)/h],K=[(-1*g-M)/u,(-1*x-C)/h],Z=A(F,K);return H(F,K)<=-1&&(Z=Math.PI),H(F,K)>=1&&(Z=0),o===0&&Z>0&&(Z=Z-2*Math.PI),o===1&&Z<0&&(Z=Z+2*Math.PI),[_,I,u,h,V,Z,p,o]}function dv(i){i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0||(i.path=new Zi,i.path.moveTo(i.x,i.y),i.path.lineTo(i.x+i.width,i.y),i.path.lineTo(i.x+i.width,i.y+i.height),i.path.lineTo(i.x,i.y+i.height),i.path.lineTo(i.x,i.y))}function Zf(i){i.cx===void 0||i.cy===void 0||i.r===void 0||(i.path=new Zi,i.path.arc(i.cx,i.cy,i.r,0,Math.PI*2,!1))}function gv(i){if(i.points===void 0)return;i.path=new Zi;const t=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,e=i.points.match(t);if(e)for(let r=0,s=e.length;r<s;r++){const o=e[r].split(","),u=parseFloat(o[0]),h=parseFloat(o[1]);r?i.path.lineTo(u,h):i.path.moveTo(u,h)}}const ls="ae",jf="-",mo="rm-assets",Kf="rm-labels";function mv(i){return i+jf+oo.ASSETS}function Qf(i){return i+jf+oo.LABELS}const yv={rm:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],su:[mo,Kf,"eq-assets","eq-labels","fn-assets","fn-labels"],eq:[mo,Kf,"su-assets","su-labels","fn-assets","fn-labels"]};class vv{svg;svgRoot;layers=[];elementsMap={};boundingBoxMap={};boundingBox=new Ot;svgSkeletons=[];data;_exceptTypes=["view"];_exceptIds=["viewer","mirror"];_lvi=0;bindSvg(t){return this.svg=t,this.svgRoot=Gc(this.svg),this.layers=this.getLayers(2),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(t){var e;if(!this.svg)throw new Error("please bind svg first");return t===2&&((e=this.layers)!=null&&e.length)?this.layers:(this.layers=this._getSvgLayer(this.svg,t),this.layers)}_getSvgLayer(t,e=0,r=0,s=[]){var h;let o,u=t.id;if(this._exceptTypes.includes(t.tagName)||t.tagName==="defs")return this._lvi--,s;if(e&&this._lvi>e)return s;u&&!this._exceptIds.includes(u)&&(o={id:u,label:u,children:[]},s.push(o)),this._lvi++;for(let c=0,p=t.children.length;c<p;c++)o?this._getSvgLayer(t.children[c],e,this._lvi,o.children):this._getSvgLayer(t.children[c],e,this._lvi,s);return((h=o==null?void 0:o.children)==null?void 0:h.length)===0&&delete o.children,this._lvi=r,s}getElementsMap(t,e={}){return this.traverseSvg(t,r=>{r!==t&&r.id&&(e[r.id]=r)}),e}computeBoundingBoxMap(){return Object.keys(this.boundingBoxMap).length?this.boundingBoxMap:(this.traverseSvg(this.svg,t=>{if(!t.id)return;const e=t.getBoundingClientRect();if(!e.width||!e.height)return;const r=new Ot(new R(e.left,e.top),new R(e.right,e.bottom));this.boundingBoxMap[t.id]=r.round(),this.boundingBox.expandByBox(r)}),this.boundingBoxMap)}updateLayersVisibility(t,e=!1){if(console.log("updateLayersVisibility: ",t,e,Object.keys(this.elementsMap).length),!this.elementsMap)throw new Error("please bind svg first");this._updateAllLayersVisibility(!e),t!=null&&t.length||(t=["background"]);for(let r=0,s=t.length;r<s;r++){const o=this.getElementById(t[r]);o&&this._updateLayersVisibility(o,e,!0,!0)}}_updateAllLayersVisibility(t=!1){Object.values(this.elementsMap).forEach(e=>{e.tagName==="svg"||e.tagName==="symbol"||!e.getAttribute("id")||(e.style.display=t?"block":"none")})}_updateLayersVisibility(t,e=!1,r=!1,s=!1){var o,u;if(!(!t||t.tagName==="svg"||!t.getAttribute("id"))){if(t.style.display=e?"block":"none",r&&e){let h=t.parentElement;for(;h&&h.tagName!=="svg";)h.style.display=e?"block":"none",h=h.parentElement}if(s&&((o=t.children)==null?void 0:o.length)>0)for(let h=0,c=(u=t.children)==null?void 0:u.length;h<c;h++)this._updateLayersVisibility(t.children[h],e,!1,!0)}}updateVisibilityByAssetType(t,e=!1,r){r||(r=yv[t]),this.updateLayersVisibility(r,!e)}updateVisibilityByAssetTypes(t,e=!1,r){if(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length))for(let s=0,o=t.length;s<o;s++)this.updateVisibilityByAssetType(t[s],e,r)}getElementById(t){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[t]}getElementBoundingBox(t){return this.boundingBoxMap[t]}findSkeletonByPath(t=[]){let e=0,r;const s=Object.keys(this.elementsMap);for(let o=0,u=s.length;o<u;o++){const h=this.elementsMap[s[o]];if(!h)continue;const c=h.getAttribute("d");c&&(c.length<e||(e=c.length,r=h.id?h:h.parent))}return r&&t.push(r),t}setTextInChildren2(t,e){var s;let r;((s=t==null?void 0:t.children)==null?void 0:s.length)<2?(r=zc("text"),r.setAttribute("dy","1em"),t.appendChild(r)):r=t.children[t.children.length-1],r.innerHTML=e}traverseSvg(t,e){var r;if(!this._exceptTypes.includes(t.tagName)&&!(t.tagName!=="svg"&&t.tagName!=="defs"&&!t.id)&&!(t.tagName==="g"&&((r=t.children)==null?void 0:r.length)===0)){this._exceptIds.includes(t.id)||e(t);for(let s=0,o=t.children.length;s<o;s++)this.traverseSvg(t.children[s],e)}}traverseSvgTLayers(t,e){var r;if(Array.isArray(t)){for(let s=0,o=t.length;s<o;s++)this.traverseSvgTLayers(t[s],e);return}if(e(t),!!((r=t.children)!=null&&r.length))for(let s=0,o=t.children.length;s<o;s++)this.traverseSvgTLayers(t.children[s],e)}getLabelElementsByType(t,e={}){const r=this.getElementById(Qf(t));return r&&this.getElementsMap(r,e),e}getLabelElementById(t,e="rm"){if(!t)return;const r=this.getElementById(t);if(!r)return;let s=r.getAttribute("aid");return s||(s="l-"+e+"-"+t),this.getElementById(s)}setLabelsById(t,e,r="rm"){var u,h;const s=this.getLabelElementById(t,r);if(!s)return;const o=((u=s.children)==null?void 0:u.length)||0;for(let c=0,p=((e==null?void 0:e.length)||0)-(o-1);c<p;c++){const g=zc("text");g.setAttribute("x","0"),g.setAttribute("y",o+c+"em"),s.appendChild(g)}for(let c=1,p=(h=s.children)==null?void 0:h.length;c<p;c++)s.children[c].textContent=e&&c<=e.length?e[c-1]:""}clearAssetLabelsByType(t="rm"){var s;const e=this.getLabelElementsByType(t),r=at.keys(e);for(let o=0,u=r.length;o<u;o++){const h=e[r[o]];for(let c=1,p=((s=h.children)==null?void 0:s.length)||0;c<p;c++)h.children[c].textContent=""}}setElementState2selected(t,e=!1){var s;if(!t)return;if(t.tagName==="use"){const o=this._getSymbolBox(t);if(!o)return;e?(s=t.parentNode)==null||s.insertBefore(o,t):t.parentNode&&t.parentNode.contains(o)&&t.parentNode.removeChild(o);return}let r=t.getAttribute("class");r||(r=""),e?r="primary":r=at.replace(r,"primary","").trim(),t.setAttribute("class",r)}_getSymbolBox(t){var c;if(!t)return;const e=(c=t.getAttribute("xlink:href"))==null?void 0:c.substring(1);if(!e)return;const r=t.id+"-boundingBox";let s=this.getElementById(r);if(s)return s;let o=this.getElementById(e);if(!o)return;const u=this.getElementBoundingBox(t.id);if(!u||u.isEmpty())return;s=document.createElementNS("http://www.w3.org/2000/svg","rect"),s.setAttribute("id",r),s.setAttribute("class","selected"),s.setAttribute("x",u.min.x.toString()),s.setAttribute("y",u.min.y.toString());const h=new R;return u.getSize(h),s.setAttribute("width",h.x.toString()),s.setAttribute("height",h.y.toString()),o.getAttribute("transform")&&s.setAttribute("transform",o.getAttribute("transform")||""),o.getAttribute("style")&&s.setAttribute("style",o.getAttribute("style")||""),this.elementsMap[s.id]=s,s}fontZoom(t,e=1){const r=this.getElementById(t);if(!r)return;let s=r.getAttribute("font-size");s||(s="12");const o=/(\d+)([a-zA-Z%]+)/.exec(s),u=o&&(o==null?void 0:o.length)>2?o[2]:"";let h=Math.round(parseFloat(s)*e*100)/100;r.setAttribute("font-size",h+u)}}class xv{name="SvgPainter";params;chef;constructor(t={},e){this.params=t,this.chef=e}drawSocialDistanceCircles(t,e="http://www.w3.org/2000/svg"){var w,M,C;if(!t)return;const r=em(t),s=$c(t),o=2*r,u=(M=(w=this.params.socialDistance)==null?void 0:w.colors)!=null&&M.length?(C=this.params.socialDistance)==null?void 0:C.colors:[Rt.green,Rt.red],h=this.getRadius(s),c=t.querySelector(`#${mo}`),p=c==null?void 0:c.querySelectorAll("path");if(!c||!(p!=null&&p.length))return;let g,x;const E=new Array;for(let _=0,I=(p==null?void 0:p.length)||0;_<I;_++){if(g=p[_],x=g.getAttribute("id"),!x)continue;const W=this.chef.getElementBoundingBox(x);if(!W)continue;const H=new R;W.getCenter(H),E.push({id:x,cp:H})}for(let _=0,I=E.length;_<I;_++){E[_].color=u[0];for(let W=0,H=I;W<H;W++)E[_]!==E[W]&&R.getDistance(E[_].cp,E[W].cp)<h*2&&(E[_].color=u[1])}for(let _=0,I=E.length;_<I;_++){let W=this.createCircle(E[_],h,o,e);c.appendChild(W)}}clearSocialDistanceCircles(t){if(!t)return;const e=t.querySelector(`#${mo}`),r=e==null?void 0:e.querySelectorAll("circle");if(!(!e||!(r!=null&&r.length)))for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s].getAttribute("id");u&&(u==null?void 0:u.indexOf("_circle"))>-1&&e.removeChild(r[s])}}getRadius(t){var r,s,o;let e=((s=(r=this.params)==null?void 0:r.socialDistance)==null?void 0:s.radius)||3;return((o=this.params)==null?void 0:o.displayUnits)==="imperial"?t==="Metres"||t==="m"?e/=3.28084:t==="cm"?e=e/3.28084*100:t==="mm"?e=e/3.28084*1e3:(t==="INCH"||t==="inches")&&(e*=12):t==="INCH"||t==="inches"?e=e*3.28084*12:t==="cm"?e*=100:t==="mm"&&(e*=1e3),e}createCircle(t,e,r,s){const o=document.createElementNS(s,"circle");return o.setAttributeNS(null,"id",t.id+"_circle"),o.setAttributeNS(null,"cx",t.cp.x),o.setAttributeNS(null,"cy",t.cp.y),o.setAttributeNS(null,"r",String(e)),o.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${t.color};stroke-width:${r}px;`),o}}const bv=function(i){return(i||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function yo(i,t){if(!i||!t)return!1;if(t.indexOf(" ")!==-1)throw new Error("className should not contain space.");return i.classList?i.classList.contains(t):(" "+i.className+" ").indexOf(" "+t+" ")>-1}function ca(i,t){if(!i)return;let e=i.className;const r=(t||"").split(" ");for(let s=0,o=r.length;s<o;s++){const u=r[s];u&&(i.classList?i.classList.add(u):yo(i,u)||(e+=" "+u))}i.classList||(i.className=e)}function fa(i,t){if(!i||!t)return;const e=t.split(" ");let r=" "+i.className+" ";for(let s=0,o=e.length;s<o;s++){const u=e[s];u&&(i.classList?i.classList.remove(u):yo(i,u)&&(r=r.replace(" "+u+" "," ")))}i.classList||(i.className=bv(r))}class Jf extends Em{isSvgScene=!0;name="SvgScene";dynamically=!0;params;socialDistanceEnable=!1;container;svg;svgStr="";svgRoot;viewBox=new Ot;chef;defaultLayers=[];skeletonLayers=[];currentLayers=[];assetType;assetsMap={};legend=[];selectedList=[];painter;_lastHighlightType="";_lastHighlightIds=[];clickSvgElementHandler=this.handleClickSvgElement.bind(this);constructor(t={}){super(),this.params=t,this.assetType=t.assetType||Yi.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):_t.window.document.getElementsByTagName("body")[0],this.chef=new vv,this.painter=new xv(t,this.chef)}get isMounted(){var t;return((t=this.container.querySelectorAll("svg"))==null?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),(t=this.camera)==null||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),!this.chef||!this.svg?this.boundingBox:(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),console.warn("svgScene.computeBoundingBox: ",this.chef.boundingBox.toString()),this.boundingBox)}async load(t){return new ll().loadAsync(t)}bind(t){if(this.svgStr=t,this.svg=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,console.warn("bind: ",this.name),!this.svg)throw new Error("svg load failed");let e=this.svg.getAttribute("viewBox");e&&(cm(e,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=Gc(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),console.log(this.name,"viewBox -> ",e,this.viewBox.toString()),this.setAssetsMap(this.assetType,this.assetsMap))}appendStyles(){var e;let t=(e=this.svg)==null?void 0:e.querySelector("style");t&&(t.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),t.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),t.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),t.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),t.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),t.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),t.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){t!=null&&t.length&&(this.defaultLayers=t)}setSkeletonLayers(t){t!=null&&t.length&&(this.skeletonLayers=t)}setCurrentLayers(t){t!=null&&t.length&&(this.currentLayers=t)}showDefaultLayers(t,e=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,e)}updateLayersVisibility(t,e=!1){this.chef.updateLayersVisibility(t,e)}setAssetType(t,e){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),this.updateLayersVisibility(this.defaultLayers,!0),this.chef.updateVisibilityByAssetTypes(t,!0,e)}isBelongsToAssetType(t,e){e||(e=this.assetType);const r=this.getAssetsByType(e);return r==null?void 0:r.hasOwnProperty(t)}setAssetsMap(t,e={}){const r=this.chef.getElementById(mv(t));return r&&(e[t]=this.chef.getElementsMap(r)),e}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(t)return this.getAssetsByType(this.assetType)[t]}getAssetIdsByType(t){const e=this.getAssetsByType(t),r=[];return e?at.keys(e):r}clearFillOrStroke(t="fill"){const e=this.getAssetsByType(this.assetType),r=at.keys(e);let s;for(let o=0,u=r.length;o<u;o++)s=e[r[o]],!(!s||!s.hasAttribute(t))&&(s.removeAttribute(t),t==="stroke"&&s.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,e="fill"){const r=this.getAssetsByType(this.assetType),s=at.keys(r);let o;for(let u=0,h=s.length;u<h;u++)t!=null&&t.length&&!t.includes(s[u])||(o=r[s[u]],!(!o||!o.hasAttribute(e))&&(o.removeAttribute(e),e==="stroke"&&o.removeAttribute("stroke-width")));this.clearLegendBy(e)}setFillOrStrokeByIds(t,e,r="fill"){const s=this.getAssetsByType(this.assetType),o=at.keys(s);let u;for(let h=0,c=o.length;h<c;h++)t.includes(o[h])&&(u=s[o[h]],u&&(u.setAttribute(r,e),r==="stroke"&&u.setAttribute("stroke-width","7"),this.addLegend(r,e,o[h])))}addLegend(t,e,r){let s=this.legend.find(o=>o.color===e);s||(s={type:t,color:e,ids:[]},this.legend.push(s)),s.ids.push(r)}clearLegendBy(t){var e;t||(this.legend.length=0);for(let r=((e=this.legend)==null?void 0:e.length)-1;r>=0;r--)this.legend[r].type===t&&this.legend.splice(r,r)}getLegend(){return this.legend}showSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,e){this.chef.setLabelsById(t,e,this.assetType)}getAssetLabelsMap(t){var s,o;if(!t)return;const e=Qf(t);let r=this.getAssetsByType(e);if(!r||!((s=Object.keys(r))!=null&&s.length)){let u=this.chef.getElementById(e);if(u||(u=this.chef.getElementById(t+"-txt-label")),!u)return;r=this.chef.getElementsMap(u),this.assetsMap[e]=r}if(!(!r||!((o=Object.keys(r))!=null&&o.length)))return r}getAssetLabelById(t,e){var u,h;const r=this.getAssetLabelsMap(t);if(!r)return;let s=r[e];if(s&&((u=s==null?void 0:s.childNodes)!=null&&u.length))return s.childNodes[0].textContent||"";const o="l-"+t+"-"+e;if(s=r[o],s&&((h=s==null?void 0:s.children)!=null&&h.length))return s.children[0].textContent||""}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var s;const e=(s=this.svg)==null?void 0:s.querySelector("#"+t);if(!e)return;e.querySelectorAll("[id]").forEach(o=>{o instanceof SVGElement&&o.addEventListener("click",this.clickSvgElementHandler)})}handleClickSvgElement(t){var e;typeof t.preventDefault=="function"&&t.preventDefault(),console.warn("svgScene.handleClickSvgElement: ",(e=t==null?void 0:t.target)==null?void 0:e.id,t==null?void 0:t.target),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,e){var s;this.resetHighlightAssets(t);const r=this.getAssetsByType(t);!r||!((s=Object.keys(r))!=null&&s.length)||(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(e)?e:[e],this._lastHighlightIds.forEach(o=>{o&&r[o]&&ca(r[o],"active")}))}resetHighlightAssets(t){var r;const e=this.getAssetsByType(t||this._lastHighlightType);!e||!((r=Object.keys(e))!=null&&r.length)||(this._lastHighlightIds.forEach(s=>{s&&e[s]&&fa(e[s],"active")}),this._lastHighlightIds.length=0)}getIntersectObjects(t,e=Yi.RM,r=[]){r.length=0;const s=[],o=this.getAssetsByType(e),u=at.keys(o);for(let c=0,p=u.length;c<p;c++){const g=this.chef.getElementBoundingBox(o[u[c]].id);g&&g.containsPoint(t.worldCoords)&&s.push(o[u[c]])}const h=at.sortBy(s,c=>{var p;return(p=this.chef.getElementBoundingBox(c.id))==null?void 0:p.getArea()});return r.push(...h),r}clearSelected(){var t,e;if((t=this.selectedList)!=null&&t.length)for(let r=((e=this.selectedList)==null?void 0:e.length)-1;r>=0;r--){let s=this.selectedList[r];this.selectedList.splice(r,1),this.chef.setElementState2selected(s,!1)}}clearSelectedById(t){var r,s;let e=(r=this.selectedList)==null?void 0:r.findIndex(o=>o.getAttribute("id")===t);e>-1&&(this.chef.setElementState2selected(this.selectedList[e],!1),(s=this.selectedList)==null||s.splice(e,1))}selectByIds(t,e=!1){Array.isArray(t)||(t=[t]),e||this.clearSelected();const r=at.uniq(at.map(this.selectedList,o=>o.getAttribute("id")||"")),s=this.getAssetsByType(this.assetType);for(let o=t.length-1;o>=0;o--)r.includes(t[o])?(this.clearSelectedById(t[o]),t.splice(o,1)):Object.hasOwnProperty.call(s,t[o])&&this.selectedList.push(s[t[o]]);this.selectedList.forEach(o=>{this.chef.setElementState2selected(o,!0)})}getSelectedIds(){var e;if(!((e=this.selectedList)!=null&&e.length))return;const t=[];for(let r=0,s=this.selectedList.length;r<s;r++)this.selectedList[r].id&&t.push(this.selectedList[r].id);return t}getSelectedBoundingBox(){var e;const t=new Ot;return(e=this.selectedList)!=null&&e.length?(this.selectedList.forEach(r=>{const s=this.chef.boundingBoxMap[r.id];s&&t.expandByBox(s)}),t):t.copy(this.boundingBox)}getElementsByBox(t){const e=[],r=Object.keys(this.chef.boundingBoxMap),s=this.getAssetsByType(this.assetType);for(let o=0,u=r.length;o<u;o++)if(s.hasOwnProperty(r[o])&&!(r[o].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[r[o]])){const h=s[r[o]];h&&e.push(h)}return e}getBoundingBoxById(t){return new Ot().copy(this.chef.boundingBoxMap[t])}onBeforeRender(){}fullscreen(t=1e3,e=!1){}update(){}}class Ev extends Jf{name="SvgLoadingScene";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="0 0 100 100">
|
|
39
|
+
`,Hf=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;class Fy extends kf{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];constructor(){super()}finish(t=[]){if(this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=s=>{e.push(s),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let s=0;s<t.length;s++){const o=t[s],u=this.curCommandType===k.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),h=Hf(o)&&(this.curNumber==="0"&&o==="0"||u);if(Hf(o)&&!h){this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(o==="e"||o==="E"){this.curNumber+=o,this.curNumberHasExp=!0;continue}if((o==="-"||o==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=o;continue}if(o==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!u){this.curNumber+=o,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError(`Invalid number ending at ${s}`);if(this.curCommandType===k.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError(`Expected positive number, got "${c}" at index "${s}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${s}"`)}this.curArgs.push(c),this.curArgs.length===Uy[this.curCommandType]&&(k.HORIZ_LINE_TO===this.curCommandType?r({type:k.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):k.VERT_LINE_TO===this.curCommandType?r({type:k.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===k.MOVE_TO||this.curCommandType===k.LINE_TO||this.curCommandType===k.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),k.MOVE_TO===this.curCommandType&&(this.curCommandType=k.LINE_TO)):this.curCommandType===k.CURVE_TO?r({type:k.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===k.SMOOTH_CURVE_TO?r({type:k.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===k.QUAD_TO?r({type:k.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===k.ARC&&r({type:k.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Ry(o)){if(o===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(o==="+"||o==="-"||o==="."){this.curNumber=o,this.curNumberHasDecimal=o===".";continue}if(h){this.curNumber=o,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${s}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${o}" at index ${s}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,o==="z"||o==="Z"){e.push({type:k.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(o==="h"||o==="H")this.curCommandType=k.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=k.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=k.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=k.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=k.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=k.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=k.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=k.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else if(o==="a"||o==="A")this.curCommandType=k.ARC,this.curCommandRelative=o==="a";else throw new SyntaxError(`Unexpected character "${o}" at index ${s}.`)}}return e}transform(t){return Object.create(this,{parse:{value(r,s=[]){const o=Object.getPrototypeOf(this).parse.call(this,r);for(const u of o){const h=t(u);Array.isArray(h)?s.push(...h):s.push(h)}return s}}})}}class k extends kf{commands;constructor(t){super(),typeof t=="string"?this.commands=k.parse(t):this.commands=t}encode(){return k.encode(this.commands)}getBounds(){const t=ce.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const s=t(r);Array.isArray(s)?e.push(...s):e.push(s)}return this.commands=e,this}static encode(t){return xy(t)}static parse(t){const e=new Fy,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=k.LINE_TO|k.HORIZ_LINE_TO|k.VERT_LINE_TO;static DRAWING_COMMANDS=k.HORIZ_LINE_TO|k.VERT_LINE_TO|k.LINE_TO|k.CURVE_TO|k.SMOOTH_CURVE_TO|k.QUAD_TO|k.SMOOTH_QUAD_TO|k.ARC}const Uy={[k.MOVE_TO]:2,[k.LINE_TO]:2,[k.HORIZ_LINE_TO]:1,[k.VERT_LINE_TO]:1,[k.CLOSE_PATH]:0,[k.QUAD_TO]:4,[k.SMOOTH_QUAD_TO]:2,[k.CURVE_TO]:6,[k.SMOOTH_CURVE_TO]:4,[k.ARC]:7},bn=new R,os=new R;class ky extends Pi{type="path";pathData;paths=[];_i=-1;_command;_previousCommand;_start=new R;_control=new R;_current=new R;_ps=[];_angles=[];constructor(t,e){super(t,e),this.initPaths()}initPaths(){var r,s;let t=this.getAttribute("d").toString().replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"");if(this.pathData=new k(t),!((s=(r=this.pathData)==null?void 0:r.commands)!=null&&s.length))return;this._reset();const e=new Zi;for(;!this._isEnd();){const o=this._next();switch(o.type){case k.MOVE_TO:this.moveTo(e);break;case k.LINE_TO:this.lineTo(e);break;case k.HORIZ_LINE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.VERT_LINE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.CURVE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.SMOOTH_CURVE_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.QUAD_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.SMOOTH_QUAD_TO:console.error(`path ${o.type} implemented not yet.`);break;case k.ARC:this.arc(e);break;case k.CLOSE_PATH:this.closePath(e);break;default:console.error(`path ${o} implemented not yet.`);break}}this.paths.push(e)}moveTo(t){return bn.copy(this._getAsCurrentPoint()),this._start.copy(this._current),t.moveTo(bn.x,bn.y),this}lineTo(t){return os.copy(this._getAsCurrentPoint()),t.lineTo(os.x,os.y),this}arc(t){bn.copy(this._current),os.copy(this._getAsCurrentPoint());const e=bn.x,r=bn.y,s=os.x,o=os.y,u=this._command.lArcFlag,h=this._command.sweepFlag,c=this._command.rX,p=this._command.rY,g=this._command.xRot;let x=Hy(e,r,s,o,u,h,c,p,g),E=x[2]>x[3]?x[2]:x[3];return t.arc(x[0],x[1],E,x[4],x[4]+x[5],!!(x[7]-1)),this}closePath(t){return this._current.copy(this._start),t.closePath(),this}_reset(){this._i=-1,this._command=void 0,this._previousCommand=void 0,this._start.set(0,0),this._control.set(0,0),this._current.set(0,0),this._ps.length=0,this._angles.length=0}_isEnd(){var t;return this._i>=(((t=this.pathData.commands)==null?void 0:t.length)||0)-1}_next(){const t=this.pathData.commands[++this._i];return this._previousCommand=this._command,this._command=t,this._command}_getAsCurrentPoint(t,e){return bn.copy(this._current),this._current.copy(this._getPoint(t,e)),this._current}_getPoint(t="x",e="y"){return this._makeAbsolute(new R(this._command[t],this._command[e]))}_makeAbsolute(t){return this._command.relative?t.add(this._current):t}_getAsControlPoint(t,e){return this._control.copy(this._getPoint(t,e)),this._control}_getReflectedControlPoint(){var e;const t=(e=this._previousCommand)==null?void 0:e.type;return t!==k.CURVE_TO&&t!==k.SMOOTH_CURVE_TO&&t!==k.QUAD_TO&&t!==k.SMOOTH_QUAD_TO?this._current:(this._current.set(this._command.cx,this._command.cy),this._control.set(this._command.ox,this._command.oy),new R(2*this._current.x-this._control.x,2*this._current.y-this._control.y))}}function Hy(i,t,e,r,s,o,u,h,c){let p=c*(Math.PI/180),g=Math.cos(p)*(i-e)/2+Math.sin(p)*(t-r)/2,x=-1*Math.sin(p)*(i-e)/2+Math.cos(p)*(t-r)/2,E=g*g/(u*u)+x*x/(h*h);E>1&&(u*=Math.sqrt(E),h*=Math.sqrt(E));let w=Math.sqrt((u*u*(h*h)-u*u*(x*x)-h*h*(g*g))/(u*u*(x*x)+h*h*(g*g)));s===o&&(w*=-1),isNaN(w)&&(w=0);let M=w*u*x/h,C=w*-h*g/u,_=(i+e)/2+Math.cos(p)*M-Math.sin(p)*C,I=(t+r)/2+Math.sin(p)*M+Math.cos(p)*C,W=function(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])},H=function(G,j){return(G[0]*j[0]+G[1]*j[1])/(W(G)*W(j))},A=function(G,j){return(G[0]*j[1]<G[1]*j[0]?-1:1)*Math.acos(H(G,j))},V=A([1,0],[(g-M)/u,(x-C)/h]),F=[(g-M)/u,(x-C)/h],K=[(-1*g-M)/u,(-1*x-C)/h],Z=A(F,K);return H(F,K)<=-1&&(Z=Math.PI),H(F,K)>=1&&(Z=0),o===0&&Z>0&&(Z=Z-2*Math.PI),o===1&&Z<0&&(Z=Z+2*Math.PI),[_,I,u,h,V,Z,p,o]}class qy extends Pi{type="g";constructor(t,e){super(t,e)}}class Wy extends Pi{type="use";symbolId;cachedElement;constructor(t,e){super(t,e),this.symbolId=at.replace(this.getHrefAttribute().toString()||"","#",""),this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition())}}class Vy extends Pi{type="circle";paths=[];constructor(t,e){super(t,e),this.initPath()}initPath(){this.paths.length=0;const t=new Zi,e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),s=this.getAttribute("r").getPixels();s>0&&t.arc(e,r,s,0,Math.PI*2,!1),this.paths.push(t)}}class zy extends Pi{type="text";text;fontSize;constructor(t,e){super(t,e),this.text=this.getTextFromNode()}getTextFromNode(t){const e=t||this.node,r=Array.from(e.parentNode.childNodes),s=r.indexOf(e),o=r.length-1;let u=(e.textContent||"").replace(/(?!\u3000)\s+/gm," ");return s===0&&(u=at.trimStart(u)),s===o&&(u=at.trimEnd(u)),u}getFontSize(){var e;const t=(e=this.parent)==null?void 0:e.getStyle("font-size").getPixels(!0);return t?this.text==="Mechanical Room"?20:t:12}}const $y={view:yy,defs:gy,style:my,symbol:vy,path:ky,g:qy,use:Wy,circle:Vy,text:zy,unknown:Nf};class Gy extends Pi{type="svg";definitions={};rootEmSize=qf;emSize=qf;constructor(t){super(null,t),this.definitions={}}createElement(t){const e=t.nodeName.replace(/^[^:]+:/,""),r=$y[e];return r?new r(this,t):new Nf(this,t)}}const qf=16;class ll extends Jc{parsedData={};data={};constructor(t){super(t)}static parse(t,e){const r=[];return t&&(av(t,r),cv(r)),r}load(t,e,r,s){const o=this,u=new _m(o.manager);u.setPath(o.path),u.setRequestHeader(o.requestHeader),u.setWithCredentials(o.withCredentials),u.load(t,function(h){try{e&&e(h)}catch(c){s?s(c):console.error(c),o.manager.itemError(t)}},r,s)}parseFile(t){if(!t)return;const e=new ff.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",parseAttributeValue:!0});return this.parsedData=e.parse(t),this.parsedData}static trans2Ro(t,e=!0){let s=new ff.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",parseAttributeValue:!0}).parse(t),o=Xy(s);return ha(o,"svg",void 0,s.svg,e)}static getSvgElement(t){let e=new _t.window.DOMParser().parseFromString(t,"image/svg+xml");return new Gy(e.documentElement)}selectById(t){this.data}}function Xy(i){var e,r,s,o,u,h,c,p,g,x;let t={};return(e=i.svg)!=null&&e.view&&(t.view=Yy((r=i.svg)==null?void 0:r.view)),(s=i.svg)!=null&&s.viewBox&&(t.viewBox=new Ot().setFromMinMaxString((o=i.svg)==null?void 0:o.viewBox)),(u=i.svg)!=null&&u.version&&(t.version=(h=i.svg)==null?void 0:h.version),(c=i.svg)!=null&&c.archibusversion&&(t.userData={version:(p=i.svg)==null?void 0:p.archibusversion}),(g=i.svg)!=null&&g.defs&&(t.defs=Zy((x=i.svg)==null?void 0:x.defs)),t}function Yy(i){return{id:i.id,units:i.units,viewBox:new Ot().setFromMinMaxString(i.viewBox)}}function Zy(i){let t={};return t.style=jy(i==null?void 0:i.style),t.symbol=Ky(i==null?void 0:i.symbol),t}const En={};function jy(i){const t=/\.([^\s{]+)\s*\{\s*([^}]+)\s*\}/g;let e;for(;(e=t.exec(i))!==null;){const r=e[1],s=e[2];En[r]={};const o=/([^:]+):\s*([^;]+);?/g;let u;for(;(u=o.exec(s))!==null;){const h=at.camelCase(u[1].trim()),c=u[2].trim();En[r][h]=c}}return En}function Ky(i){let t={};if(!(i!=null&&i.length))return t;for(let e=0,r=i.length;e<r;e++){let s=i[e];s.id&&(t[s.id]=ha({defs:{symbol:t}},"symbol",void 0,i[e],!0))}return t}const la=["use","path","circle","text"];function ha(i,t,e,r,s){let o;if(typeof r!="object")return o;if(Array.isArray(r)){o=new Ku({name:e.id,userData:{id:e.id}});for(let u=0,h=r.length;u<h;u++){let c=ha(i,t,e,r[u],s);c&&o.add(c)}return t==="text"&&o.children.length===1?(o=o.children[0],o.updateMatrix(),o):(o.updateMatrix(),o)}if(!t||t==="svg"||t==="g"||t==="symbol"){if(o=new Ku({name:r.id,userData:{id:r.id,tag:t}}),zf(r,s,o),r.style=Wf(i,e,r),r.g){let u=ha(i,"g",r,r.g,s);u&&o.add(u)}for(let u=0,h=la.length;u<h;u++)if(r[la[u]]){let c=ha(i,la[u],r,r[la[u]],s);c&&o.add(c)}return o}if(la.includes(t)){r.style=Wf(i,e,r);const u=tv(i,t,r);return u?(zf(r,s,u),u):void 0}return o}function Wf(i,t,e){let r={};return t&&(En[t==null?void 0:t.class]&&at.merge(r,En[t.class]),Vf(i,t,r)),En[e.class]&&at.merge(r,En[e.class]),Vf(i,e,r),r}function Vf(i,t,e){t.style&&at.merge(e,t.style);let r=parseFloat(at.get(t,"stroke-width")||"")||0;return r>0&&(e.strokeWidth=Jy(i,r)),e}const Qy=new Ot,go=new R;function Jy(i,t){var r,s,o;if(!t)return t;if(!((r=i==null?void 0:i.view)!=null&&r.viewBox))return 1;Qy.copy((s=i==null?void 0:i.view)==null?void 0:s.viewBox).getSize(go);let e=Math.round(t/100*((go==null?void 0:go.length())||1));return((o=i==null?void 0:i.view)==null?void 0:o.units)==="inches"&&(e=Math.max(Math.ceil(e/25),1)),e}function tv(i,t,e){var p,g,x,E;let r,s=e.fill||((p=e.style)==null?void 0:p.fill)||void 0,o=e.fillOpacity||((g=e.style)==null?void 0:g.fillOpacity)||void 0;s&&o&&(s=new Ft(s).setA(o).getStyle());let u=e.strokeWidth||((x=e.style)==null?void 0:x.strokeWidth)||1,h=e.stroke||((E=e.style)==null?void 0:E.stroke)||Rt.black;const c=[{name:"path",fill:s,lineWidth:u,stroke:h}];if(t==="path"){let w=Gf(e.d,!0);if(!Array.isArray(w))return c[0].path=w,$f(t,e,c);r=new Ku({name:e.id,userData:{id:e.id,tag:t}});for(let M=0,C=w.length;M<C;M++){let _=at.cloneDeep(c);_[0].path=w[M];const I=$f(t,e,_);r.add(I),I.updateMatrix()}return r}return t==="use"?iv(i,t,e):t==="text"?rv(t,e):t==="circle"?nv(t,e,c):r}function zf(i,t,e){if((i.selectable===!0||i.selectable==="true")&&e.setSelectable(!0),i.x!==void 0&&!isNaN(Number(i.x))&&(e.position.x=i.x),i.y!==void 0&&!isNaN(Number(i.y))&&(e.position.y=i.y*(t?-1:1)),i.transform){let r=ev(i.transform);r.tx&&(e.position.x=r.tx),r.ty&&(e.position.y=r.ty*(t?-1:1)),r.rx&&(e.position.x=r.rx),r.ry&&(e.position.y=r.ry*(t?-1:1)),r.ra&&(e.rotation.x=eo(r.ra*(t?-1:1))),r.sx&&(e.scaled.x=r.sx),r.sy&&(e.scaled.y=r.sy)}return e.updateMatrix(),e}function ev(i){const t={},e=/(\w+)\(([^)]+)\)/g;let r;for(;(r=e.exec(i))!==null;){const[s,o,u]=r,h=u.split(",").map(Number);switch(o){case"scale":t.sx=h[0],t.sy=h.length>1?h[1]:h[0];break;case"translate":isNaN(Number(h[0]))||(t.tx=h[0]),h.length>1&&!isNaN(Number(h[1]))&&(t.ty=h[1]);break;case"rotate":t.ra=h[0],t.rx=h[1],t.ry=h[2];break}}return t}function iv(i,t,e){var o,u;let r,s=at.get(e,"xlink:href");if(at.startsWith(s,"#")&&(s=s.substring(1)),(o=i.defs)!=null&&o.symbol&&((u=i.defs)!=null&&u.symbol[s]))return r=i.defs.symbol[s].clone(),at.merge(r.userData,{id:e.id,tag:t}),r}function $f(i,t,e){return new Tf({name:t.id||i,parsedSvg:e,composeNode:!0,userData:{id:t.id,tag:i}})}function rv(i,t){let e=at.get(t,"#text");if(e)return new py({text:e,fontSize:20,fill:Rt.black,wireframe:!1,flipY:!0,userData:{id:t.id,tag:i}})}function nv(i,t,e){return e[0].cx=t.cx,e[0].cy=t.cy,e[0].r=t.r,Zf(e[0]),new Tf({name:t.id||i,parsedSvg:e,composeNode:!0,alignCenter:!0,userData:{id:t.id,tag:i}})}const sv=["x","y","lineWidth","width","height","rx","cx","cy","r"];function av(i,t=[]){if(!i)throw new Error("input error");const e=i.match(/<(\w+)([^<]+)>/g);if(!e||!e.length)return t;let r="",s=[],o="";for(let u=0,h=e.length;u<h;u++)r=e[u].replace(/[<>]/g,""),s=r.split(" "),!(!s||!s.length)&&(o=s[0],!(o!=="path"&&o!=="clipPath"&&o!=="rect"&&o!=="circle"&&o!=="text"&&o!=="polygon")&&(r.indexOf("class")>=0&&(e[u]=lv(i,e[u])),hv(e[u],t)));return t}function ov(i){const t=/<style>([\s\S]*?)<\/style>/,e=i.match(t);if(e&&e.length>1)return e[1]}function uv(i){const t={},e=ov(i);if(!e)return t;const r=/\.([\w-]+)\s*\{([\s\S]*?)\}/g;let s;for(;(s=r.exec(e))!==null;){const o=s[1],u=s[2];t[o]={};const h=/([\w-]+)\s*:\s*([^;]+)/g;let c;for(;(c=h.exec(u))!==null;){const p=c[1],g=c[2];t[o][p]=g.trim()}}return t}function lv(i,t){let e=t.match(/class="([^"]+)"/);if(!e)return t;const r=e[0],s=uv(i),o=[];return Object.keys(s).forEach(u=>{Object.keys(s[u]).forEach(h=>{o.push(h+'="'+s[u][h]+'"')})}),!o||!o.length||(t=t.replaceAll(r,o.join(" "))),t}function hv(i,t=[]){const r=i.replace(/[<>]/g,"").split(" ");if(!r||!r.length)return t;const s={name:""};let o="",u=!1;for(let h=0,c=r.length;h<c;h++)if(u=r[h].indexOf("=")>=0,!h)s.name=r[h];else if(u){const p=r[h].split("=");p[0]==="stroke-width"?p[0]="lineWidth":p[0]==="stroke-linecap"&&(p[0]="strokeLinecap"),s[p[0]]=p[1].replace(/\"/g,""),o=p[0]}else u||(s[o]+=" "+r[h].replace(/\"/g,""));for(const h in s)sv.indexOf(h)>=0&&(s[h]=parseFloat(s[h]));return t.push(s),t}function cv(i=[],t){for(let e=0,r=i.length;e<r;e++)switch(i[e].name){case"path":fv(i[e]);break;case"clipPath":break;case"rect":dv(i[e]);break;case"circle":Zf(i[e]);break;case"text":break;case"polygon":gv(i[e]);break;default:delete i[e].path;break}return i}const us=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];function fv(i){!i.d||!i.d.length||(i.path=Gf(i.d,!1))}const pv=100;function Gf(i,t=!1){i=at.trim(i),i=i.replace(new RegExp(" ","g"),",").replace(new RegExp("M","g"),"|M");const e=at.split(i,"|");if(e!=null&&e.length&&e[0]===""&&e.shift(),!t||e.length<=pv*2){let u=[];for(let h=0,c=e.length;h<c;h++){let p=e[h];for(let x=0,E=us.length;x<E;x++)p=p.replace(new RegExp(us[x],"g"),"|"+us[x]);let g=p.split("|");g!=null&&g.length&&g[0]===""&&g.shift(),u=u.concat(g)}return Xf(u)}let r=[];for(let u=0,h=e.length;u<h;u++){let c=/M\s*(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)/g.exec(e[u]);c&&(c==null?void 0:c.length)>3&&r.push({x:parseFloat(c[1]),y:parseFloat(c[3]),cms:e[u]})}r=at.sortBy(r,u=>R.getLength({x:u.x,y:u.y}));let s=at.chunk(r,Math.floor(r.length/10)),o=[];for(let u=0,h=s.length;u<h;u++){let c=[];for(let p=0,g=s[u].length;p<g;p++){let x=s[u][p].cms;for(let w=0,M=us.length;w<M;w++)x=x.replace(new RegExp(us[w],"g"),"|"+us[w]);let E=x.split("|");E!=null&&E.length&&E[0]===""&&E.shift(),c=c.concat(E)}o.push(Xf(c))}return o}function Xf(i){let t=new Zi;const e=[];let r=0,s=0;const o=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let u,h="";for(let c=0,p=i.length;c<p;c++){let g=i[c],x=g.charAt(0);for(g=g.slice(1),e.length=0;u=o.exec(g);)e.push(u[0]);const E=[];for(let M=0,C=e.length;M<C;M++){if(e[M]==="00"){E.push(0,0);continue}let _=parseFloat(e[M]);isNaN(_)?E.push(0):E.push(_)}let w=[];for(;E.length>0&&!isNaN(E[0]);){let M=r,C=s,_,I,W,H,A,V,F,K,Z;switch(x){case"M":M=r=E.shift()||0,C=s=E.shift()||0,t.moveTo(r,s);break;case"m":let G=E.shift()||0,j=E.shift()||0;r+=G,s+=j,h==="z"&&(r=M+G,s=C+j),t.moveTo(r,s);break;case"l":r+=E.shift()||0,s+=E.shift()||0,t.lineTo(r,s);break;case"L":r=E.shift()||0,s=E.shift()||0,t.lineTo(r,s);break;case"h":r+=E.shift()||0,t.lineTo(r,s);break;case"H":r=E.shift()||0,t.lineTo(r,s);break;case"v":s+=E.shift()||0,t.lineTo(r,s);break;case"V":s=E.shift()||0,t.lineTo(r,s);break;case"C":w.length=0,w.push(E.shift()||0,E.shift()||0,E.shift()||0,E.shift()||0),r=E.shift()||0,s=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"c":w.length=0,w.push(r+(E.shift()||0),s+(E.shift()||0),r+(E.shift()||0),s+(E.shift()||0)),r+=E.shift()||0,s+=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"S":_=r,I=s,h==="C"&&(_=r+(r-w[2]),I=s+(s-w[3])),w.length=0,w.push(_,I,E.shift()||0,E.shift()||0),r=E.shift()||0,s=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"s":_=r,I=s,h==="C"&&(_=r+(r-w[2]),I=s+(s-w[3])),w.length=0,w.push(_,I,r+(E.shift()||0),s+(E.shift()||0)),r+=E.shift()||0,s+=E.shift()||0,t.bezierCurveTo(w[0],w[1],w[2],w[3],r,s);break;case"Q":w.length=0,w.push(E.shift()||0,E.shift()||0),r=E.shift()||0,s=E.shift()||0,t.quadraticCurveTo(w[0],w[1],r,s);break;case"q":w.length=0,w.push(r+(E.shift()||0),s+(E.shift()||0)),r+=E.shift()||0,s+=E.shift()||0,t.quadraticCurveTo(w[0],w[1],r,s);break;case"T":_=r,I=s,h==="Q"&&(_=r+(r-w[0]),I=s+(s-w[1])),r=E.shift()||0,s=E.shift()||0,t.quadraticCurveTo(_,I,r,s);break;case"t":_=r,I=s,h==="Q"&&(_=r+(r-w[0]),I=s+(s-w[1])),r+=E.shift()||0,s+=E.shift()||0,t.quadraticCurveTo(_,I,r,s);break;case"A":W=E.shift()||0,H=E.shift()||0,A=E.shift()||0,V=E.shift()||0,F=E.shift()||0,K=r,Z=s,r=E.shift()||0,s=E.shift()||0,w=Yf(K,Z,r,s,V,F,W,H,A),t.arc(w[0],w[1],w[2]>w[3]?w[2]:w[3],w[4],w[4]+w[5],!!(w[7]-1));break;case"a":W=E.shift()||0,H=E.shift()||0,A=E.shift()||0,V=E.shift()||0,F=E.shift()||0,K=r,Z=s,r+=E.shift()||0,s+=E.shift()||0,w=Yf(K,Z,r,s,V,F,W,H,A),t.arc(w[0],w[1],w[2]>w[3]?w[2]:w[3],w[4],w[4]+w[5],!!(w[7]-1)),console.log("arc: ",g,K,Z,r,s,V,F,W,H,A);break;case"z":t.closePath();break;default:E.shift()}}h=x,(x==="z"||x==="Z")&&t.closePath()}return t}function Yf(i,t,e,r,s,o,u,h,c){let p=c*(Math.PI/180),g=Math.cos(p)*(i-e)/2+Math.sin(p)*(t-r)/2,x=-1*Math.sin(p)*(i-e)/2+Math.cos(p)*(t-r)/2,E=g*g/(u*u)+x*x/(h*h);E>1&&(u*=Math.sqrt(E),h*=Math.sqrt(E));let w=Math.sqrt((u*u*(h*h)-u*u*(x*x)-h*h*(g*g))/(u*u*(x*x)+h*h*(g*g)));s===o&&(w*=-1),isNaN(w)&&(w=0);let M=w*u*x/h,C=w*-h*g/u,_=(i+e)/2+Math.cos(p)*M-Math.sin(p)*C,I=(t+r)/2+Math.sin(p)*M+Math.cos(p)*C,W=function(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])},H=function(G,j){return(G[0]*j[0]+G[1]*j[1])/(W(G)*W(j))},A=function(G,j){return(G[0]*j[1]<G[1]*j[0]?-1:1)*Math.acos(H(G,j))},V=A([1,0],[(g-M)/u,(x-C)/h]),F=[(g-M)/u,(x-C)/h],K=[(-1*g-M)/u,(-1*x-C)/h],Z=A(F,K);return H(F,K)<=-1&&(Z=Math.PI),H(F,K)>=1&&(Z=0),o===0&&Z>0&&(Z=Z-2*Math.PI),o===1&&Z<0&&(Z=Z+2*Math.PI),[_,I,u,h,V,Z,p,o]}function dv(i){i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0||(i.path=new Zi,i.path.moveTo(i.x,i.y),i.path.lineTo(i.x+i.width,i.y),i.path.lineTo(i.x+i.width,i.y+i.height),i.path.lineTo(i.x,i.y+i.height),i.path.lineTo(i.x,i.y))}function Zf(i){i.cx===void 0||i.cy===void 0||i.r===void 0||(i.path=new Zi,i.path.arc(i.cx,i.cy,i.r,0,Math.PI*2,!1))}function gv(i){if(i.points===void 0)return;i.path=new Zi;const t=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,e=i.points.match(t);if(e)for(let r=0,s=e.length;r<s;r++){const o=e[r].split(","),u=parseFloat(o[0]),h=parseFloat(o[1]);r?i.path.lineTo(u,h):i.path.moveTo(u,h)}}const ls="ae",jf="-",mo="rm-assets",Kf="rm-labels";function mv(i){return i+jf+oo.ASSETS}function Qf(i){return i+jf+oo.LABELS}const yv={rm:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],su:[mo,Kf,"eq-assets","eq-labels","fn-assets","fn-labels"],eq:[mo,Kf,"su-assets","su-labels","fn-assets","fn-labels"]};class vv{svg;svgRoot;layers=[];elementsMap={};boundingBoxMap={};boundingBox=new Ot;svgSkeletons=[];data;_exceptTypes=["view"];_exceptIds=["viewer","mirror"];_lvi=0;bindSvg(t){return this.svg=t,this.svgRoot=Gc(this.svg),this.layers=this.getLayers(2),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(t){var e;if(!this.svg)throw new Error("please bind svg first");return t===2&&((e=this.layers)!=null&&e.length)?this.layers:(this.layers=this._getSvgLayer(this.svg,t),this.layers)}_getSvgLayer(t,e=0,r=0,s=[]){var h;let o,u=t.id;if(this._exceptTypes.includes(t.tagName)||t.tagName==="defs")return this._lvi--,s;if(e&&this._lvi>e)return s;u&&!this._exceptIds.includes(u)&&(o={id:u,label:u,children:[]},s.push(o)),this._lvi++;for(let c=0,p=t.children.length;c<p;c++)o?this._getSvgLayer(t.children[c],e,this._lvi,o.children):this._getSvgLayer(t.children[c],e,this._lvi,s);return((h=o==null?void 0:o.children)==null?void 0:h.length)===0&&delete o.children,this._lvi=r,s}getElementsMap(t,e={}){return this.traverseSvg(t,r=>{r!==t&&r.id&&(e[r.id]=r)}),e}computeBoundingBoxMap(){return Object.keys(this.boundingBoxMap).length?this.boundingBoxMap:(this.traverseSvg(this.svg,t=>{if(!t.id)return;const e=t.getBoundingClientRect();if(!e.width||!e.height)return;const r=new Ot(new R(e.left,e.top),new R(e.right,e.bottom));this.boundingBoxMap[t.id]=r.round(),this.boundingBox.expandByBox(r)}),this.boundingBoxMap)}updateLayersVisibility(t,e=!1){if(console.log("updateLayersVisibility: ",t,e,Object.keys(this.elementsMap).length),!this.elementsMap)throw new Error("please bind svg first");this._updateAllLayersVisibility(!e),t!=null&&t.length||(t=["background"]);for(let r=0,s=t.length;r<s;r++){const o=this.getElementById(t[r]);o&&this._updateLayersVisibility(o,e,!0,!0)}}_updateAllLayersVisibility(t=!1){Object.values(this.elementsMap).forEach(e=>{e.tagName==="svg"||e.tagName==="symbol"||!e.getAttribute("id")||(e.style.display=t?"block":"none")})}_updateLayersVisibility(t,e=!1,r=!1,s=!1){var o,u;if(!(!t||t.tagName==="svg"||!t.getAttribute("id"))){if(t.style.display=e?"block":"none",r&&e){let h=t.parentElement;for(;h&&h.tagName!=="svg";)h.style.display=e?"block":"none",h=h.parentElement}if(s&&((o=t.children)==null?void 0:o.length)>0)for(let h=0,c=(u=t.children)==null?void 0:u.length;h<c;h++)this._updateLayersVisibility(t.children[h],e,!1,!0)}}updateVisibilityByAssetType(t,e=!1,r){r||(r=yv[t]),this.updateLayersVisibility(r,!e)}updateVisibilityByAssetTypes(t,e=!1,r){if(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length))for(let s=0,o=t.length;s<o;s++)this.updateVisibilityByAssetType(t[s],e,r)}getElementById(t){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[t]}getElementBoundingBox(t){return this.boundingBoxMap[t]}findSkeletonByPath(t=[]){let e=0,r;const s=Object.keys(this.elementsMap);for(let o=0,u=s.length;o<u;o++){const h=this.elementsMap[s[o]];if(!h)continue;const c=h.getAttribute("d");c&&(c.length<e||(e=c.length,r=h.id?h:h.parent))}return r&&t.push(r),t}setTextInChildren2(t,e){var s;let r;((s=t==null?void 0:t.children)==null?void 0:s.length)<2?(r=zc("text"),r.setAttribute("dy","1em"),t.appendChild(r)):r=t.children[t.children.length-1],r.innerHTML=e}traverseSvg(t,e){var r;if(!this._exceptTypes.includes(t.tagName)&&!(t.tagName!=="svg"&&t.tagName!=="defs"&&!t.id)&&!(t.tagName==="g"&&((r=t.children)==null?void 0:r.length)===0)){this._exceptIds.includes(t.id)||e(t);for(let s=0,o=t.children.length;s<o;s++)this.traverseSvg(t.children[s],e)}}traverseSvgTLayers(t,e){var r;if(Array.isArray(t)){for(let s=0,o=t.length;s<o;s++)this.traverseSvgTLayers(t[s],e);return}if(e(t),!!((r=t.children)!=null&&r.length))for(let s=0,o=t.children.length;s<o;s++)this.traverseSvgTLayers(t.children[s],e)}getLabelElementsByType(t,e={}){const r=this.getElementById(Qf(t));return r&&this.getElementsMap(r,e),e}getLabelElementById(t,e="rm"){if(!t)return;const r=this.getElementById(t);if(!r)return;let s=r.getAttribute("aid");return s||(s="l-"+e+"-"+t),this.getElementById(s)}setLabelsById(t,e,r="rm"){var u,h;const s=this.getLabelElementById(t,r);if(!s)return;const o=((u=s.children)==null?void 0:u.length)||0;for(let c=0,p=((e==null?void 0:e.length)||0)-(o-1);c<p;c++){const g=zc("text");g.setAttribute("x","0"),g.setAttribute("y",o+c+"em"),s.appendChild(g)}for(let c=1,p=(h=s.children)==null?void 0:h.length;c<p;c++)s.children[c].textContent=e&&c<=e.length?e[c-1]:""}clearAssetLabelsByType(t="rm"){var s;const e=this.getLabelElementsByType(t),r=at.keys(e);for(let o=0,u=r.length;o<u;o++){const h=e[r[o]];for(let c=1,p=((s=h.children)==null?void 0:s.length)||0;c<p;c++)h.children[c].textContent=""}}setElementState2selected(t,e=!1){var s;if(!t)return;if(t.tagName==="use"){const o=this._getSymbolBox(t);if(!o)return;e?(s=t.parentNode)==null||s.insertBefore(o,t):t.parentNode&&t.parentNode.contains(o)&&t.parentNode.removeChild(o);return}let r=t.getAttribute("class");r||(r=""),e?r="primary":r=at.replace(r,"primary","").trim(),t.setAttribute("class",r)}_getSymbolBox(t){var c;if(!t)return;const e=(c=t.getAttribute("xlink:href"))==null?void 0:c.substring(1);if(!e)return;const r=t.id+"-boundingBox";let s=this.getElementById(r);if(s)return s;let o=this.getElementById(e);if(!o)return;const u=this.getElementBoundingBox(t.id);if(!u||u.isEmpty())return;s=document.createElementNS("http://www.w3.org/2000/svg","rect"),s.setAttribute("id",r),s.setAttribute("class","selected"),s.setAttribute("x",u.min.x.toString()),s.setAttribute("y",u.min.y.toString());const h=new R;return u.getSize(h),s.setAttribute("width",h.x.toString()),s.setAttribute("height",h.y.toString()),o.getAttribute("transform")&&s.setAttribute("transform",o.getAttribute("transform")||""),o.getAttribute("style")&&s.setAttribute("style",o.getAttribute("style")||""),this.elementsMap[s.id]=s,s}fontZoom(t,e=1){const r=this.getElementById(t);if(!r)return;let s=r.getAttribute("font-size");s||(s="12");const o=/(\d+)([a-zA-Z%]+)/.exec(s),u=o&&(o==null?void 0:o.length)>2?o[2]:"";let h=Math.round(parseFloat(s)*e*100)/100;r.setAttribute("font-size",h+u)}}class xv{name="SvgPainter";params;chef;constructor(t={},e){this.params=t,this.chef=e}drawSocialDistanceCircles(t,e="http://www.w3.org/2000/svg"){var w,M,C;if(!t)return;const r=em(t),s=$c(t),o=2*r,u=(M=(w=this.params.socialDistance)==null?void 0:w.colors)!=null&&M.length?(C=this.params.socialDistance)==null?void 0:C.colors:[Rt.green,Rt.red],h=this.getRadius(s),c=t.querySelector(`#${mo}`),p=c==null?void 0:c.querySelectorAll("path");if(!c||!(p!=null&&p.length))return;let g,x;const E=new Array;for(let _=0,I=(p==null?void 0:p.length)||0;_<I;_++){if(g=p[_],x=g.getAttribute("id"),!x)continue;const W=this.chef.getElementBoundingBox(x);if(!W)continue;const H=new R;W.getCenter(H),E.push({id:x,cp:H})}for(let _=0,I=E.length;_<I;_++){E[_].color=u[0];for(let W=0,H=I;W<H;W++)E[_]!==E[W]&&R.getDistance(E[_].cp,E[W].cp)<h*2&&(E[_].color=u[1])}for(let _=0,I=E.length;_<I;_++){let W=this.createCircle(E[_],h,o,e);c.appendChild(W)}}clearSocialDistanceCircles(t){if(!t)return;const e=t.querySelector(`#${mo}`),r=e==null?void 0:e.querySelectorAll("circle");if(!(!e||!(r!=null&&r.length)))for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s].getAttribute("id");u&&(u==null?void 0:u.indexOf("_circle"))>-1&&e.removeChild(r[s])}}getRadius(t){var r,s,o;let e=((s=(r=this.params)==null?void 0:r.socialDistance)==null?void 0:s.radius)||3;return((o=this.params)==null?void 0:o.displayUnits)==="imperial"?t==="Metres"||t==="m"?e/=3.28084:t==="cm"?e=e/3.28084*100:t==="mm"?e=e/3.28084*1e3:(t==="INCH"||t==="inches")&&(e*=12):t==="INCH"||t==="inches"?e=e*3.28084*12:t==="cm"?e*=100:t==="mm"&&(e*=1e3),e}createCircle(t,e,r,s){const o=document.createElementNS(s,"circle");return o.setAttributeNS(null,"id",t.id+"_circle"),o.setAttributeNS(null,"cx",t.cp.x),o.setAttributeNS(null,"cy",t.cp.y),o.setAttributeNS(null,"r",String(e)),o.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${t.color};stroke-width:${r}px;`),o}}const bv=function(i){return(i||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function yo(i,t){if(!i||!t)return!1;if(t.indexOf(" ")!==-1)throw new Error("className should not contain space.");return i.classList?i.classList.contains(t):(" "+i.className+" ").indexOf(" "+t+" ")>-1}function ca(i,t){if(!i)return;let e=i.className;const r=(t||"").split(" ");for(let s=0,o=r.length;s<o;s++){const u=r[s];u&&(i.classList?i.classList.add(u):yo(i,u)||(e+=" "+u))}i.classList||(i.className=e)}function fa(i,t){if(!i||!t)return;const e=t.split(" ");let r=" "+i.className+" ";for(let s=0,o=e.length;s<o;s++){const u=e[s];u&&(i.classList?i.classList.remove(u):yo(i,u)&&(r=r.replace(" "+u+" "," ")))}i.classList||(i.className=bv(r))}class Jf extends Em{isSvgScene=!0;name="SvgScene";dynamically=!0;params;socialDistanceEnable=!1;container;svg;svgStr="";svgRoot;viewBox=new Ot;chef;defaultLayers=[];skeletonLayers=[];currentLayers=[];assetType;assetsMap={};legend=[];selectedList=[];painter;_lastHighlightType="";_lastHighlightIds=[];clickSvgElementHandler=this.handleClickSvgElement.bind(this);constructor(t={}){super(),this.params=t,this.assetType=t.assetType||Yi.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):_t.window.document.getElementsByTagName("body")[0],this.chef=new vv,this.painter=new xv(t,this.chef)}get isMounted(){var t;return((t=this.container.querySelectorAll("svg"))==null?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),(t=this.camera)==null||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),!this.chef||!this.svg?this.boundingBox:(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),console.warn("svgScene.computeBoundingBox: ",this.chef.boundingBox.toString()),this.boundingBox)}async load(t){return new ll().loadAsync(t)}bind(t){if(this.svgStr=t,this.svg=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,console.warn("bind: ",this.name),!this.svg)throw new Error("svg load failed");let e=this.svg.getAttribute("viewBox");e&&(cm(e,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=Gc(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),console.log(this.name,"viewBox -> ",e,this.viewBox.toString()),this.setAssetsMap(this.assetType,this.assetsMap))}appendStyles(){var e;let t=(e=this.svg)==null?void 0:e.querySelector("style");t&&(t.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),t.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),t.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),t.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),t.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),t.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),t.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){t!=null&&t.length&&(this.defaultLayers=t)}setSkeletonLayers(t){t!=null&&t.length&&(this.skeletonLayers=t)}setCurrentLayers(t){t!=null&&t.length&&(this.currentLayers=t)}showDefaultLayers(t,e=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,e)}updateLayersVisibility(t,e=!1){this.chef.updateLayersVisibility(t,e)}setAssetType(t,e){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),this.updateLayersVisibility(this.defaultLayers,!0),this.chef.updateVisibilityByAssetTypes(t,!0,e)}isBelongsToAssetType(t,e){e||(e=this.assetType);const r=this.getAssetsByType(e);return r==null?void 0:r.hasOwnProperty(t)}setAssetsMap(t,e={}){const r=this.chef.getElementById(mv(t));return r&&(e[t]=this.chef.getElementsMap(r)),e}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(!t)return;const e=this.getAssetsByType(this.assetType);if(!(!e||!Object.hasOwnProperty.call(e,t)))return e[t]}getAssetIdsByType(t){const e=this.getAssetsByType(t),r=[];return e?at.keys(e):r}clearFillOrStroke(t="fill"){const e=this.getAssetsByType(this.assetType),r=at.keys(e);let s;for(let o=0,u=r.length;o<u;o++)s=e[r[o]],!(!s||!s.hasAttribute(t))&&(s.removeAttribute(t),t==="stroke"&&s.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,e="fill"){const r=this.getAssetsByType(this.assetType),s=at.keys(r);let o;for(let u=0,h=s.length;u<h;u++)t!=null&&t.length&&!t.includes(s[u])||(o=r[s[u]],!(!o||!o.hasAttribute(e))&&(o.removeAttribute(e),e==="stroke"&&o.removeAttribute("stroke-width")));this.clearLegendBy(e)}setFillOrStrokeByIds(t,e,r="fill"){const s=this.getAssetsByType(this.assetType),o=at.keys(s);let u;for(let h=0,c=o.length;h<c;h++)t.includes(o[h])&&(u=s[o[h]],u&&(u.setAttribute(r,e),r==="stroke"&&u.setAttribute("stroke-width","7"),this.addLegend(r,e,o[h])))}addLegend(t,e,r){let s=this.legend.find(o=>o.color===e);s||(s={type:t,color:e,ids:[]},this.legend.push(s)),s.ids.push(r)}clearLegendBy(t){var e;t||(this.legend.length=0);for(let r=((e=this.legend)==null?void 0:e.length)-1;r>=0;r--)this.legend[r].type===t&&this.legend.splice(r,r)}getLegend(){return this.legend}showSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,e){this.chef.setLabelsById(t,e,this.assetType)}getAssetLabelsMap(t){var s,o;if(!t)return;const e=Qf(t);let r=this.getAssetsByType(e);if(!r||!((s=Object.keys(r))!=null&&s.length)){let u=this.chef.getElementById(e);if(u||(u=this.chef.getElementById(t+"-txt-label")),!u)return;r=this.chef.getElementsMap(u),this.assetsMap[e]=r}if(!(!r||!((o=Object.keys(r))!=null&&o.length)))return r}getAssetLabelById(t,e){var u,h;const r=this.getAssetLabelsMap(t);if(!r)return;let s=r[e];if(s&&((u=s==null?void 0:s.childNodes)!=null&&u.length))return s.childNodes[0].textContent||"";const o="l-"+t+"-"+e;if(s=r[o],s&&((h=s==null?void 0:s.children)!=null&&h.length))return s.children[0].textContent||""}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var s;const e=(s=this.svg)==null?void 0:s.querySelector("#"+t);if(!e)return;e.querySelectorAll("[id]").forEach(o=>{o instanceof SVGElement&&o.addEventListener("click",this.clickSvgElementHandler)})}handleClickSvgElement(t){var e;typeof t.preventDefault=="function"&&t.preventDefault(),console.warn("svgScene.handleClickSvgElement: ",(e=t==null?void 0:t.target)==null?void 0:e.id,t==null?void 0:t.target),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,e){var s;this.resetHighlightAssets(t);const r=this.getAssetsByType(t);!r||!((s=Object.keys(r))!=null&&s.length)||(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(e)?e:[e],this._lastHighlightIds.forEach(o=>{o&&r[o]&&ca(r[o],"active")}))}resetHighlightAssets(t){var r;const e=this.getAssetsByType(t||this._lastHighlightType);!e||!((r=Object.keys(e))!=null&&r.length)||(this._lastHighlightIds.forEach(s=>{s&&e[s]&&fa(e[s],"active")}),this._lastHighlightIds.length=0)}getIntersectObjects(t,e=Yi.RM,r=[]){r.length=0;const s=[],o=this.getAssetsByType(e),u=at.keys(o);for(let c=0,p=u.length;c<p;c++){const g=this.chef.getElementBoundingBox(o[u[c]].id);g&&g.containsPoint(t.worldCoords)&&s.push(o[u[c]])}const h=at.sortBy(s,c=>{var p;return(p=this.chef.getElementBoundingBox(c.id))==null?void 0:p.getArea()});return r.push(...h),r}clearSelected(){var t,e;if((t=this.selectedList)!=null&&t.length)for(let r=((e=this.selectedList)==null?void 0:e.length)-1;r>=0;r--){let s=this.selectedList[r];this.selectedList.splice(r,1),this.chef.setElementState2selected(s,!1)}}clearSelectedById(t){var r,s;let e=(r=this.selectedList)==null?void 0:r.findIndex(o=>o.getAttribute("id")===t);e>-1&&(this.chef.setElementState2selected(this.selectedList[e],!1),(s=this.selectedList)==null||s.splice(e,1))}selectByIds(t,e=!1){Array.isArray(t)||(t=[t]),e||this.clearSelected();const r=at.uniq(at.map(this.selectedList,o=>o.getAttribute("id")||"")),s=this.getAssetsByType(this.assetType);for(let o=t.length-1;o>=0;o--)r.includes(t[o])?(this.clearSelectedById(t[o]),t.splice(o,1)):Object.hasOwnProperty.call(s,t[o])&&this.selectedList.push(s[t[o]]);this.selectedList.forEach(o=>{this.chef.setElementState2selected(o,!0)})}getSelectedIds(){var e;if(!((e=this.selectedList)!=null&&e.length))return;const t=[];for(let r=0,s=this.selectedList.length;r<s;r++)this.selectedList[r].id&&t.push(this.selectedList[r].id);return t}getSelectedBoundingBox(){var e;const t=new Ot;return(e=this.selectedList)!=null&&e.length?(this.selectedList.forEach(r=>{const s=this.chef.boundingBoxMap[r.id];s&&t.expandByBox(s)}),t):t.copy(this.boundingBox)}getElementsByBox(t){const e=[],r=Object.keys(this.chef.boundingBoxMap),s=this.getAssetsByType(this.assetType);for(let o=0,u=r.length;o<u;o++)if(s.hasOwnProperty(r[o])&&!(r[o].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[r[o]])){const h=s[r[o]];h&&e.push(h)}return e}getBoundingBoxById(t){return new Ot().copy(this.chef.boundingBoxMap[t])}onBeforeRender(){}fullscreen(t=1e3,e=!1){}update(){}}class Ev extends Jf{name="SvgLoadingScene";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="0 0 100 100">
|
|
40
40
|
<view id="defaultView" viewBox="0 0 100 100" />
|
|
41
41
|
<style> #svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}
|
|
42
42
|
@keyframes svg-loading-fast {
|