From 0262ef8e42dc2fd642bdd3754fec78b8877ac468 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Mon, 22 Sep 2025 17:26:08 +0200 Subject: [PATCH] gaming --- .../add-runtime-mir.svg | 46 ++ .../2025-10-10-how-rust-compiles/index.html | 424 ++++++++++++++++++ slides/2025-10-10-how-rust-compiles/me.png | Bin 0 -> 26282 bytes .../reveal.js-mermaid-plugin_11-6-0.js | 47 ++ 4 files changed, 517 insertions(+) create mode 100644 slides/2025-10-10-how-rust-compiles/add-runtime-mir.svg create mode 100644 slides/2025-10-10-how-rust-compiles/index.html create mode 100644 slides/2025-10-10-how-rust-compiles/me.png create mode 100644 slides/2025-10-10-how-rust-compiles/reveal.js-mermaid-plugin_11-6-0.js diff --git a/slides/2025-10-10-how-rust-compiles/add-runtime-mir.svg b/slides/2025-10-10-how-rust-compiles/add-runtime-mir.svg new file mode 100644 index 0000000..c26ab2b --- /dev/null +++ b/slides/2025-10-10-how-rust-compiles/add-runtime-mir.svg @@ -0,0 +1,46 @@ + + + + + + +Mir_0_3 + + + +bb0__0_3 + + +0 + +StorageLive(_3) +_3 = copy _1 +StorageLive(_4) +_4 = copy _2 + +_0 = core::num::<impl u8>::wrapping_add(move _3, move _4) + + + +bb1__0_3 + + +1 + +StorageDead(_4) +StorageDead(_3) + +return + + + +bb0__0_3->bb1__0_3 + + +return + + + diff --git a/slides/2025-10-10-how-rust-compiles/index.html b/slides/2025-10-10-how-rust-compiles/index.html new file mode 100644 index 0000000..a30d663 --- /dev/null +++ b/slides/2025-10-10-how-rust-compiles/index.html @@ -0,0 +1,424 @@ + + + + + + + how rust compiles + + + + + + + + + + +
+
+
+

how rust compiles

+
+
+
+
+ the rust compilation model has surprising effects + +
+
+
+
+

introduction to me

+
+
+
Noratrieb (she/her)
+ contributing to the compiler since 2021 +
+
+
+ +
+
+
+
+

behind cargo build

+

cargo vs rustc

+
+

+                    $ cargo build
+                
+
cargo
+
+
rustc (clap)
+
rustc (tokio)
+
rustc (tracing)
+
rustc (yourcrate)
+
+
+
+
+

so you want to compile a crate

+
+
+

so you want to compile a crate

+

source code:

+

+              #[no_mangle]
+              pub fn add(a: u8, b: u8) -> u8 {
+                a.wrapping_add(b)
+              }
+            
+
+
+

so you want to compile a crate

+

MIR

+ +
+
+ +
+
+ +
+
+

codegen units

+

+fn main() {}
+          
+
+
+              %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true, 'fontSize': '25px' }}}%%
+              flowchart LR
+                mainmir["main (MIR)"]
+
+                subgraph mycgu1[my CGU 1]
+                  mainll["main (LLVM IR)"]
+                end
+
+                mycgu1 --> mycgu1.rcgu.o
+
+                mainmir --> mainll
+
+                mycgu1.rcgu.o --> my_binary
+                std["std (and others)"] --> my_binary
+            
+
+
+
+

codegen units (but more)

+

+fn main() {}
+fn foo1() {}
+fn foo2() {}
+          
+
+
+              %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true, 'fontSize': '25px' }}}%%
+              flowchart LR
+                mainmir["main (MIR)"]
+                foo1mir["foo1 (MIR)"]
+                foo2mir["foo2 (MIR)"]
+
+                subgraph mycgu1[my CGU 1]
+                  mainll["main (LLVM IR)"]
+                end
+                subgraph mycgu2[my CGU 2]
+                  foo1ll["foo1 (LLVM IR)"]
+                  foo2ll["foo2 (LLVM IR)"]
+                end
+                
+                mycgu1 --> mycgu1.rcgu.o
+                mycgu2 --> mycgu2.rcgu.o
+
+                mainmir --> mainll
+                foo1mir --> foo1ll
+                foo2mir --> foo2ll
+
+                mycgu1.rcgu.o --> my_binary
+                mycgu2.rcgu.o --> my_binary
+                std["std (and others)"] --> my_binary
+            
+
+
+
+

codegen units (cross-crate)

+
+

+fn add() {}
+          
+

+fn main() { math::add() }
+          
+
+
+
+              %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true, 'fontSize': '25px' }}}%%
+              flowchart LR
+                subgraph crate math
+                  addmir["add (MIR)"]
+
+                  subgraph mathcgu1[math CGU 1]
+                    addll["add (LLVM IR)"]
+                  end
+
+                  addmir --> addll
+
+                  mathcgu1 --> mathcgu1.rcgu.o
+
+                  mathcgu1.rcgu.o --> libmath.rlib
+                end
+
+                subgraph my crate
+                  mainmir["main (MIR)"]
+
+                  subgraph mycgu1[my CGU 1]
+                    mainll["main (LLVM IR)"]
+                  end
+
+                  mycgu1 --> mycgu1.rcgu.o
+
+                  mainmir --> mainll
+
+                  mycgu1.rcgu.o --> my_binary
+                  libmath.rlib --> my_binary
+                  std["std (and others)"] --> my_binary
+                end
+            
+
+
+
+ +
+
+

instantiating generics

+

+            fn add<T: Add>(a: T, b: T) -> T::Output { a + b }
+            fn main() {
+              add(0_u16, 0_u16);
+              add(0_u32, 0_u32);
+            }
+          
+
+
+              %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true, 'fontSize': '25px' }}}%%
+              flowchart LR
+                addmir["add (MIR)"]
+                useitmir["main (MIR)"]
+
+                subgraph mycgu1[my CGU 1]
+                  addu16ll["add_u16 (LLVM IR)"]
+                  addu32ll["add_u32 (LLVM IR)"]
+                  useitll["main (LLVM IR)"]
+                end
+
+                mycgu1 --> mycgu1.rcgu.o
+
+                addmir -->|instantiate with T=u16| addu16ll
+                addmir -->|instantiate with T=u32| addu32ll
+                useitmir --> useitll
+
+                mycgu1.rcgu.o --> my_binary
+                std["std (and others)"] --> my_binary
+            
+
+
+
+

generics (cross-crate)

+
+

+            pub fn add<T: Add>(a: T, b: T) -> T::Output {
+              a + b
+            }
+          
+

+            fn main() {
+              add(0_u16, 0_u16);
+              add(0_u32, 0_u32);
+            }
+          
+
+
+
+              %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true, 'fontSize': '25px' }}}%%
+              flowchart LR
+                subgraph crate math
+                  addmir["add (MIR)"]
+                end
+
+                subgraph my crate
+                  mainmir["main (MIR)"]
+                end
+
+                subgraph my crate
+                  subgraph mycgu1[my CGU 1]
+                    addu16ll["add_u16 (LLVM IR)"]
+                    addu32ll["add_u32 (LLVM IR)"]
+                    mainll["main (LLVM IR)"]
+                  end
+
+                  mainmir --> mainll
+                  addmir --> addu16ll
+                  addmir --> addu32ll
+                  mycgu1 --> mycgu1.rcgu.o
+                  mycgu1.rcgu.o --> my_binary
+                  std["std (and others)"] --> my_binary
+                end
+            
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + + + + + + + + + + diff --git a/slides/2025-10-10-how-rust-compiles/me.png b/slides/2025-10-10-how-rust-compiles/me.png new file mode 100644 index 0000000000000000000000000000000000000000..a94a5c6980eef2bec07a03699f77412c0f7d3ae9 GIT binary patch literal 26282 zcmeAS@N?(olHy`uVBq!ia0y~yU_1lD983%h4A*z^Uu0lNEA(`645^s&W^eignU|H% zf9`v!bvnE>yqe!c>fX5ow&stLz! z;bdWQbniGJ#KF?kCooY}fP+O=QOR3DfWykkWtxM6KuOD}#z7G{hql~eU|MLp<-aOO-ie0r9J;qHv4pX`R|;(SxV>F7bXf!RJDms=n-@)?tGx1p0_3~NxJ@Mz?S2$ zDzd-K6u$dADqSIQJ!AO&eOI!iIa<^fDw+sK?-ZOdub-VI^xijHfdiZWChPOh&)B|G zp~ZLm#0}RK=IK1te02Ed?dg9WcP*P%$8Q^ z5#PN#3cff0w0Lgd@Lf^K`^IkKIZ4~YWZsmF0wF1{xGuAx>Pi2!gN>9U>%;AaIgyyyf-qWmDXA;%qx~e&v+ce|}KhYtZ#U#L?y2f)yUWD?a`^cC{cfV3L#G z9PhTGllncj>5qSe-OgZ2`uWADW@%vc@03iZD^ISw`Bkkw=k|8;hUbcW69p%R{QSE! z`u*8^w|3oIl=159)tB$@|JG1_5|uJHbAsv9zdNIg9$#A%vLrTs-k*m*T#G(&PIY#< z7Lm}iJX!ny*Uj~RGybh>yXcocyL0`X+UI|lOvqhVn#Pn|bF{vG(?!k*iH6pc7w_}_ zcg?ABY89AhDwb*Z-~YRQYw^k0`#WcK-sL-Ec2pyH(&VGx)ABp5ubjK)sUZFT=ac14 zN-sASAChbCSktI+;!(eR%sG!%uX{a=`!-ssYVGPcA@{&9fvs7~i+@$B)wWNQ+2xOa z%KXdcctcuXqAAzGoIlmy?dJ5Y4cq4#bfR{XNnohxpS~hZeoqrj9&A%1riOj8(+qsy`wXuSe9p% zQRrpfc>#(`Bo?MB^c>oG<-GcOy`{=u-=y2g?U0>gd%eD6;mPGYkDa~xQtkEJC0f(} zKE7D=g{IS*&hCfBbqn`*ft~fbkk?3;&ZzbMun;T+0cw7H{&ac^h)y$?h zp-0{6pZvZ35@*z2-4Q)xG0mU9YL`uzd-ED&ZHdQALw0Or<(Mk0pW+%Sm-~M4f{XG3 z3w12S^KOQ}E8c10qIE<# z(R%iZs*5@A6|-NheUM|jaeCDOhWk8cbX1yjEvue7EV(uPU8In9!R~2%TVe`+9lm<@t=C}@i=OFC^HzFhzJ@qE^_XOkTR zr^dm}k@2NcfBMnig8OH0 zFSov}U~nzfv(xhWnNaT<$#>JL7#SBVwV56fnk$#Gu~DsVze$Tq=t516Y^`H6nl8B9 zf0t|M-m*L7;{VMj{e_*rUAJ=*y2E*9+s&Bdeg7_g+h;fZ{Mp;lIWO{#aL=4?_akLn zVeP_effLJ$OP>`y4>oO~@I6#Yrr#zkWVR&%3vA{o3VMxBZb?apK&~^Edvy z6TSWV!lnoF{<*x75v)2Ukbd>DmBMN-1>yO9y86qL3l)`Dcila-TW4Eh{`rS}2l;l- zHho(($I|BJmKpz#f9y|c{c`PzyW_;LOBdNE9(`J}bN*dFMHOb zmzU1Z?|ph%UhmG&n^%^9KAGTjqHEO}1ylWQPQ~35cyyO42^`|veOp6)vzL#;rd7*g zKlR)9=uE5RKV+f$Y}q1jPsQUGdrl`cA1LsbTrJrfT0xR!1)y`aKV5Ou=e<dD4ul-)FD|G2l8zch<$E8n3P3C9}*_g(c>3p=sLygJzE#-;m3R9v45-k?cZzGoK$0wj7@P3{rT=JcT-es-p&OclP^B)++aV;-*`e%RLiSN`2!NlJ)46bcK!di-!E?Ou0IK?vQw|T%IlI`DR6e_x2<1i zot|&H>jc~8kJ77yQ*VV&cMMoM)#r<2iD2@b=dUtC9n_Vd)qi>bDiSykI*DfLoaL$9 zeRj830JGMmd-M0E-q5@CFlN#Hr>_gPsC{ha_xX78SW3)+pgRmfU8@&I)tl))eb4s1 z&Zh8bVoKnO$CY}DDVkkUCFQd;?6SW+Kec4STHnO$6GNUpI<&Wb&-aHF8T&4LF)8I; zsNMZte3If{r;W2KBx1cxmNHItJRqUJOlcz5tvTDdcnTw_w;V|IUZ&o zTNm+vet>1<$`1;gZoGe&aZ50|d&Q~g;_p&ZoxfM}q&(g~d-p>Ih zEr)hKvGuh(t#=Gm~|gruST>E+WeUvw}NJH34Kq<~}l+Zd(^ zb*|Vt_wY0E|27>u`>cvC9okZ~acQQ`vO}g{9_HFTe%RVG=l`*b;WcID#eFAI9*fo9 zO1Kns&#>Iq_#0E2PV{58Nvm|0D~C^)J98vV%BZJSyL)9p)S20-X&V;0iY3komU^>L zp=Wx~#HArA@zLk6_w5P!*EQX=)KYe*_?&nTHsMw;X7Sf6XB`!A%odnqM57rc;|b^4@JoLJ`xGX~G8+s_@z6Zzcv;CA`F>fHM)|GwQ@HtqhCOV3gZ z?F8ra=$$X^$GugCKJL3|& z+}PR(35%##*QZWyjb3dW{^zk}WJXiE;5pT^Lc+#dPMn$*G@&$yN9vSny+Pf^(+@2# z?tP#0U(xz_a)WT|8})AC?M%j1&$ql{XZsPC@o#6N^I9{Pa;BLPE8fLTJnM38%6#9r z-0eH9x=*r6By%Vp^0*elcFEG!L1MFruE_J`TNd4mR!TXAT}yiYBS^Pib*|L{9joW- zfV>Vzv4{VqWLV0YuHUoHcs|E7m4k^Fx8K{dHDOPgzM<=y1Z7Ue-+On<%e<8m z3)R&3mNe8?4t0)-I%6!dHc>@G$bGX!vS+YF*EXX$T@x3r)a$;Rxv_{RIaMcYT5&kBC;x2e z=G=L9PUIqUiG+Hsk~P^&uC~4CShKQwnb*@u^(o#hMNefue7(J=Ys=S+P^S|rEpI1( zzLmR9`0j7F+rNL^l@;sR5%SqdL(kXJ^I*Iq$1H18%Sqldof3QXHYH7ERcz_~F?r$Q zxreKFe9?|OVG}BOFttP6NdDaYp9TN;d;|5ZZtr8wj=6kXBH7n@Rn#XNjakbwq^4ap z;y7?xrrbSH>8xmEOJJCmh3>XAxh-Zqwc00U=N>&7aONm;?^%Bnso;&Ni%qpNEIAem zTKb32zuaW#wrZ6KSC>LY*CI`>AdyfJ@Bc?qS+{gA`+p=YJOAC=m;lwyKI=@joDdVK zJijaPm+;Bu%aT{0UDKSQX6adxuqTaG_c-^%#BJ05WcUV(I3CC-Zje@9(zQsdE44(7 z$>4~=`iNOk=?fK8ZaBU2m553ST_U;2a)qU%#CcVwv+Gsz__|jXBtQTDhPNv7R`6c; zozIS)dMZ{uan-6vdg7Ndr{!+)-ZH7r^m~J8QpUuq-&TlUGnsaI;@oLoKD~=p3JccT z*1CPuTFm1ds=vwO@+o!}xtD8HrdCE(Qh_snE{AmCfg@PYBdoHLG&6M2j{7TdI) z(+jvF=5zjjvX9&Jdos4c&E?4{a&BTLc`LMkXY5+MZOyVSVdf3XG@A~5usLhcZ+_Gx zbmFR{mVGT3o@;tBC@>$8IVPVhb7}KB8)dN`vsFdWJi41s@NCy?o-DA*GO}Q%;^n1I zCOv;v7OY-tprp+6c!h7u>Rs%~Yr2$DH%|@PZ4!A+?s%~xgG`GILmmU0f=$Cm)t>z1 zHNlR7ae{$`bJp7J&X;K86PGBj*jqWl)O3nr@WYquQd(?0`|on`I!K2mKc4w%=7!r1 z8DJJCAh!{%DIQ?nP%UtZ|C z%|fK3BZoP{gJo*e@hMWgEf)`;n4~$)dR9+Mq5oPXZp9Sc+a+zf&Y|0L*&3!R{P7pr z`v2thwG0sq8ys&q2J&%Ka@-ZT)tz=hw8co1L6}u|$tfudwd^k*-I*NECuJ($UnLpb ztE&1W{L;m+=)?dniR*tPgLw|$d^<~L`m_yF*%6+{tr>o77x`+=z+>Pe?^_-mQXLqr zE6^ojED*%-rv{*v8#%b`bm)3OM26ILm= zg)vF_9XT;4o_K8hT9(0ZW>r?c?95dHPREiC@+{Wk3cLDgUskTIp_Rg)c#FP`5oSB@ zym`DgQttnQTbtH)6iO_Nbd7Y$2)*2Nv|-KNL)R1BCL69haqW+z(6&vJ`efhVyPl;j zb)ZOV(PbCm&5IcfR<3$(*|+k2G;`*xrI|g3ZW(7+U)^GQe`BFx?TXB;tfmzl?HN@a z%TjwTORUejrE}eP#1~$w|N2H!^m{<5-C;Hh4(qPOJCh}{7iP}k?2i5YbX#4{ z6~iCLVt*(JHnUCANqH`OFf2Myzfe*7oOJn@^3#qCeoiA#MhO}YMqW0lQxgT4F`XP5d+6u;>t zB=NslA;T*5&Dx*aFU)w^&@-X%$9pTW_hviGD^w+-j%El=&K1zQH0`oru(pU^pJd*- zB|O2#3pMVGw`^GUvUJ_6du#KIdUqaKb+`U@hE;aKMAI#m&y=Q}Zz)!*yXM#VvvtW! zWjS95<_F4=|MnN{oZpeO@L^H#e?IT#tS=WGIX0LY<;TmlyRAw#%2=_3In?JmC_D^TGHJN5|?7hb&S5K?_jdK!a)bb=}o+wT%bX+rUtA32m zNnN%o&920Zww39EInh5p%sFO#q))Kf#MxxW2_gS&6I+T;UgCKbCLLrtN$dPEW|hj- zQCtjr)IHyOPU1dv|H;qGIkaJ#+=1QVyY8lLDF^TFgq#uDiEAX^(;m)Os-*=NHw_FZ=_CMrmo!eBEC98POUzgix>JzNu%x)XmrS_Gh_h=6%+oDx2 zCntq(j)=b$HGRceb92Fl`lCPM0@svoak;$3s%ifLgYyU7HYP`BbSVkljxcjGGd#9w zS&FLSgwFLTiv$iamLJcEmOn4GTF6HCnQ_v-t6>836!;F@SNg)!GQW94b$I=@9b1;J z%-T9Lde))~I?=O@yKg-6k-9DG+^yrjS;RGSR%6h;Gv~6@c1`L_TjFFf`@`}>t7k^k z9X?agwy3|nx90H;?Y2{|BmCSyow_HJlb0pJV0W}a=J9le8pcE4WRtc`SQgpMddZ|W zK$9cjsNn~xtvzi^B72pUq8Y{7mMXfkJu{sUVfXpE`Mp4s(A(=2cY#~-1$q}>f7*Iz zSMC9Z^T)!Yb6FGJKQY7{_+i`A&S=5>P@*M_!Gz;>=B$O85kAejC-s+TOnZKHlW_L7 zCPAjF-}9&3`n4f(QwERjCLLGldaqeK4={9R?evauo|UzvBqa3m8435gTNfB+X#1_u zWo7xL@W)=JFL&P_flD&suU>{eoR@v#=^=&__x5G6zk1QW&~;iJmy1}kj^`weE)K-jjo7F;^cn+Al{(Qw}%DQw1W0HjHjittlOEgyfifDZE($H_sffq`r1J20l{W|sh zbNKo=UY2<;9Cqy4Bh%~VKgXi*!-IorJGRK2-BnrLzd85F?YqyvRaUegHaN|yn&#nf zZBES8r`vVJj-R`3aMWPU*=1aZ{5n5uxN&6Lt;b0WD)$|>M!)P@=sIm_#x$cXtzQkS zt#^ASdUq_Uczld^`Q@9}uP?uU@vTh#vhN2r*Ros7`fVe$A9Uccmt67f26%lY8~{YUQ?R2D293uwpwbDcLgN{(Jq;w{PCO z`R-j_RJ;BEfa3?Gf1fY8ad%phW9;GY_Z^gWh6I@$Jd=JXOn@O=<)y^wX@zOt|8$mU zELpX}V%J8KnQTTp!P!-7US*j3Njh;Z);W;N-E!gBtOTi4-X%er3v(Q@N=vr}XuK%Q zSbx>>!Mg{N=N@paR(zY55M_4wO!}d1KAE>}w>p(=XJYXPG&#O8OgnvZnDCrm$T-FOp}1iEK; zeJXZbvEn^TOTQ53s~z80`^|rpvA(i+uEDMovuY2#^1C2vQXIT`RqslPd4|U|dqs^T zJ;meaT`)0V5KpzdyXKi)(C>zeNvv-DCz%*>=Dh1_F!Wn~`SRt<7c)XaLswt5va#8d zf8TD|xs`KLH%6_sIj?QKoXd%0ZCI?>FT-Ptv_A8+AH4OSN7{rV<;0}xaSp5x(ii>E zT^;&bln>R0~?0Bf`yyvlc)8*R#RlNMSb*g7yS`Aj#J;x>d{rv9jEKUzzCU?w2f+ucI z#mA-7e(ML^~uYLP7PA87<@9*bte_hl((KPhhl|4+8lJcH?>@J&D zU;O0@ceDFfizHr;RWc`zMdz|EG)!Qq)9T_lbltM=@^iPi7m~p-vd3Zy4XS*ut$TiG z`XY_G{q@UZUW90E-Lq%S{fn}E$4~3;zjN{8#+RiWiQ(bbHzptdV*MrTQ&&ai!+B{l zB0pcp!=D(D_bXS)U5s=w+?0P}23I!I#H~hi>RjWS6qW?7G|J~-`&yf{ zHEON?o)3o}JWx3Qd8xpLvuW0Ke|~7M-*afw*>&7Loj<3RTu~_2NNU~UG->-cF{Wex zl{hx)ma>;NF$(Pdmi%~a`P$@|(_SBRo^QG#)TAf*@?^@UJM zzTmZe(=Jc6cATWR+kEDgE&I(?!n#s z+9Jz7$9~LOw9CrvOIqEn4^wsn^5w3_H zp~rY9&H6UCCT`OW9-#+X{fa(QLY~fDna#i0`)vH(GOM|uw03uQd3svfwbE&icYJ<+ z{=Ha%zmcQ9`efuEanG)VoXc0rX2)@x z@g5OS+C72C?|69BRQr^T5q@*6uHL*U$<-PXT52J~%*<>hTD6rcGFaYCOm^}G9w8EF-z&~p&-cMVYagAqkFpuJ<)iWcq zpIa2ln8z#$w7z2EE5OpVsA8VEQ%Lx=E7Gek3n%`6d5>AYU*`LVzOd*oER~Uej$Sbh zdi3?mqys3Q! zWk0dcVm@XOxg^ACnvYuX&X|>f4{vTx=a;p*lEo~qxZ;z#w=lm__wn8CaS}F36IO2N zTDGtD`QD=;JFd0~M0qkkp6_*OeacVOzUtP;RvKB0!@C(~giP7as<>(4CuygwTE*)p zB%D&*_uOrs=T~pE<)bUd!l@5s#8x+Nwz7O(WVI^T)9J6rq%RNK<=1`xc+10TZeFYF zQ;*J_r~iG7u>0G-{JxRXiv+cOn?5{o_piv(O!(vNIV<#P{)ayihF;wU=aT<)E{YL2 z>gz0);qlRDr(_b_K>?-H#&^W|=k6Arak8V*I{oXXKKEN$8*fG2JG8;X^?%W`W5>I{ zN9Vr$_M~WMu4vg=PxDu=ZieJohIy3Vh&HIMQQovHE_z>Y_WB z_g4D;*8jPO`w-)-G6##*nVwsGZ6=yJXEg@8h&kPO{^{$^n$&y6o2ut0x?X$yv8Sg; zM^`uZ6!YtsFEuB(uQum9_v_fd%i1qrxE#@6Ih$Kg;Ml{QO;4468*H+eZgB9z`wWw+ z$H#h0ta7*Cwzjr*cXO+;n=hBF$EjLScrSO?n*ssr)5<*>wUb^*cPP4S6Z&;mwpQ={ zD#hJTjd_ay{rNd@;zaB6cPc`im%7V#|Gk+$Klkb?@$&`uZT`KQk?;FxzQ63hjDP2x zjJ6b}o;+0$>zD7`w^T`2F~!yOnn6)yj@&)R@NePbDIYiepO-b`Usvjmy1!K`qXSl* zc=Kk>_1ACTym|Bb_3Kx!l(KFMRZKJ9cW9PpiegK<6&v%-9gbBWbDNgE{P(Y}@3Gyl z7s`PmiY@2uey=%x*~tFm(uK+Fw|;xs^H*8be?OA__+e}I>B*;GX1qLlc`y5|T;3O6 z&5Zl@*;FQeTee6u?AoJkH{AE!WuAA=Z};)^?^EW#kUOL16dBv*YBtA5ZS%+Z91ANZ zo;-Q--o1Ou?tLXCB`>VjcWe+1W=Zi?-X!Iu{qlvAQie}!?D6NH=i1lTWoE8iy?XWf z_3KqndkHis&vkyz)}LdutM%c$x7HSKUe4=X|4e1!>6dq}-`kz-_h_9$%R82I{WEta zm@J*rId%Hc1ha$e>9Jzb(+^v}dHb%Y;#SVO+{wq@v7~>^@Vr=%68Y_C&22OBV-oAv zty>nfa#FIjfx&|ktKJD)zMCX;6|LX8{>iJ`)1z{oEnPzSQXZ8vZGQZab@P+Jq@L)l zS?@PQoadLTUH5;%+{>vPkJZ+#_xYFgEiFvw)E;)HjD({ScyY@=mibyuQ-kP5ueu}g8Z@JZV z*Kpm5B+%@${JHy)CtZ4t#g3lX5;-^C^3$WnZ)%knv@ZR7f7;%o^Y-%4H!Q3RufNLK zzVlJ5&z=bv&+a(k18d-v9+q%2v!eEE#{`@ceV?mfQUZ(rq} z>Lpjh-t-l|-@>odeSi0N#);RtHWvQL@0qK+w#2l3O~{Ice*B3!R+YMpif^=wo}HPw zbLY->e)(lVE9X86U!<{a-8wg=iU0onOP^PHEbVfk+>7Ausj7xItxk9zQuh{iNz`s^ z+Hm(-RqBr;7tgg#WesOKcHrpkV*hw=agK*4PIyE|N9%}jw;x^@;32S$f5sHG(r;hB z^z`+a-959ne`;oJ{W-4-t|_5Qo~3%aMmY+K`j!@$NvChzIPKJDU8SEP8nbWwveGG= zU03*{LS_E0NAmew9zJVcJk$K!e7oEAC$4>I+aR|(`NCbv6E?lgyEA9yX&YHt%{rUb zd@w;lz(Z|vbas%J>UCYCV*SI$Iju9BbeA7gnl1ME^2Vvv3x7^62?I|m*zet*V!CrbqT0y_my^YWF%KUnCu$XzCUtgMHi;3&^owoxE*JL`s zF&8&ka*kj2@3W8Lw%5YGU0$Sc_2~z_<%=U%?s~d@FMG>`$2+!d+qQ7w!gJ^Rx)vGD z?79Bhw)$I6e!hO>k1PwZw%XJmJ2XqSB`Ur4Z>y{LAEYv0Yx0z4gE)_tPn%wB-hJx4 zb)&$yT{Wz(Q%sg#zxnUhzRCJLayPedvSh!HG%R>5F?YkJY58-jKJWbJ%;UQK&+Y8g z9ghCXySLxA;AYMY3_dey>QZ45S4)|`AeplN|NiFY=IZ|M`KA&!tvdI~63uhD%cge)@9Jr<2t+FO9sWHc9 ziZ6@t$0ntji|#CVc)`Tih^ypis$rG%%~C0aO`3+^A9rd`)p%p2J@dxx?f3s5HqQTQ zkuC4gV7O0s#?G8QPuIuItM5)cw`!H{+-aJxluqyKF5J`?wbl13uf&7+v-e7(*05W% zy2VM!V;x(HiAoe(2QZvjn18-|QN*WQRZp$2Cqw1jw|Lo4iK_`IwX}_0_H0qBiGBLU zv{!py{5@HqvEA1xTUDV)eA2@AcmF2bo^r!TrS(n!yLcZFv-Rbr*0=W6J~RLK=BNH% zqnbNT=36%xnfv}{pZEWMN~OX4<=bK=ia0%2eYt=2GUa<=?@NU_9?xEVxqIcR`HE4l zL1%nh{;u8jXysxP{*}+p7VnJFnwqu3wfErB*=kQ>r=Lh_a4!8W$MbxW{jPe=Io@IW z<{wR|$aZVI{_4lAiQ?5UZ*9+gyDwq=TmF3Q)13Q`{Z|jZus{Ea;q<@ttE%i~KRvas zaIR>J{i5yVn?EM6vRb!9^ZogIL0iMlEm$+>XvmIL2W%HATFgBcl(N7~hOhl@p7|l6 z*KP_8ey4+#Hc5zIVXMgvGv3JmEU$Z2%)(PSxvIx6p5bnGXWJXwe~)3MU;Fdd$K(F_ zKi~K3(FMb(^XK*{i=7r%JsG^MwVIRTfMw)A*}mH=e!UL7E_79{R!^`)jK|z9CpxQ} zTkzG9hXr%&>*qcHDYdOtps%<0XU$W$XV)E&O8T8Yq!GE!FUtSohMsdt>IMzCKX4ZrW`(?-kxDnO%7yKO~uJ z)GfqMss8`)B|3Na%bfPRpN~50$IRFn7ocLE|Nqa8o5``aOKc7^sB_=^{ycy2@vfbv zrYlQs=AN5)%Q5l#UcZ<#vOjHS)ddRZT(w#2%&=zGH_;wvle;S#Q@=ZXcFw)KyxJ}L zU#iBsLkD}Ngio9{xurr;`0VmclO_mkVvX#XdF1iE>Hv|a+LyANrP{hKtkX)Ac@^97 zzW8?@>oV!BUnEYc{rmTA{l3aSSLM=ozOmtW`10Px;Ju40BR3e_@q5XVsrcV~d;Qd@ zT+*e*llQE9UvT+fxz)R0{QFOCTF-gtn&~>P4a#41IsW^1Wu0hhTA?X__WsM#ZKcy~ zGkM*eH8fLPL;XZHeRQ%?eYRB~nF(ee-+lS2FK>50uXt)@^vlNOH6MN_mKc6YkttYQ^=?;9{5*bS9U91 zd7G1*&^-P9^GA*4%h$JV=H$sLpQswT@4rQ&N576eW5fO>EBrN9Ju6$4uXQS*S?+`3 zvEYlUOCyuSPcQ%f@t(Wz#G?gzo+8sO)EF?FUb%vCbNTkAaTB+0nwI|Sm{iIcWs{zF z?SKCld~f#H_U-x0nLl1t39oNkqo1ql6L^2=%l*q<-V)N;!}0fgm(jHa+^LF^TxQv+ zFU5oB>n=NV)>5o-gKqG~r(v@LG{1J~_y!)|)%Nv7WcQQc|8KADHr4lx|9C%MzAwm` zE30({!=2_2Os-eI-N--wV>W}ylRJt%`Q}TLN==1l_sn|sOYKc)kkdIG&&ID^IxHJ* zUtJblprZV&zT|(9*NM=*3qvBRHqC9S(|*s@@;*4^>|@5Zkgoxc=iF3t;rVk?z#zek z|DmSyr70<2PhAj_ny~bI(3u(QpNTGr zzG|(@ibigezk60)dv;#_`j*84_txEZ3Y?mrwEF4pFW1grT=(#F_v0=Xl?8??R#m;d zwe{xBn``$cNgR7vP+=pt{`%_@D{p(_9?mpIllG@2EQujMpBxCgIO8OT%vl%i%)fa$ zlUAKM7Jhfn+S3np*DFXoUhU2QuJxJuHisOiY5RB*MGj4txc-560mBQ{2Wl-vcgt3J zSYO=hf4z*?=5Wx2S>7yVU+=74bJS^btY7~2&AzTt%%A^!6KZuzOiEgGMKW8MLorY! zcx8x&NK{PBoS8E@Tb=gq-7Awmt1Bq>AcIWCd-J-N;mPm11P*PkO*a23vm!iTN&T*R z$>f4n<@GbGr?1fBU(`M6+MD;rYzd5q6j~0OvPSF{{H4oK=Wx07+1YhV7Jq%4P_E%I z_pSX8g*V^rXC^o}awWgn60tW-{d@s?&0oFl+%0?g6OUZ_!v8MTr`!Lx%!b^JH*;cR zV_%l+n$!?sA{84MX<1P)o9ol^2}>r3if}UX^zQY#u))3G&po<-v+s2sCEmrLC6FhM z+_U1T1zm-@vneH+7jECo(k@$=sC3%+jkojh`d=TC_inyyA6Yj+ zq&VK@OH=vj1z|iNQc5acCudIX`lT4t@PX&pZaE)atxrrX+5&8h9U{BCE;6LZ?O*t8 zcT?MilA5PE{~gUDjhfy86>iAQ^;)F>Cxg6YPjQsSyAG-LmSrj&dJ$6 z{k7!r#%5;Qwg!H(5;*kt_xJgBwY#3~y~e}JWT7i%8@=t|O@6u6k8|!XJoc_w zoyGOn%`402>)KzD3oldUy4kd6=drCbSMuQa?%cfX)wkm#*Io;Dos~D`V&KGSMt_>J9v8ox_uAejr@$7*wIZ7XV?laaKU1?FCw($Gw_~m^vj4MU_)EpNwxClNe zy3Ea8FVAE4ZC>!dd4i|YMSN4EO}1`#ah#UNp0-Y>Z~4(ZjdQY+jSUPwJnGiJx3gG% z_SvMK%vo|05*F3p)?B@{hhz6kkM7pAb-S-L=-of8xBPp_`xi@FtE=ABL|;mJcX;P* z>((u^zA^I1Su*jz;i!mAR=}%1)s!EEq~_jzAXlMD_kY!KB)Zn zz5f6A+->UDE|~i6E_iroo9N_SO4+OAYE@1(7)~?&T9@%~(*HQ&Syya$1zOimxa#v~ z{ks25Oa}tC%zb=!&*6iSxpR&li<*;d{~=pH>W!|?=Szk;$1lFoR#u-LG_iGAi&y!l zh}n;i$=TQa`SbJh>^L5_=JNOVu0AfBZF^(k12lY>NIA92dB|;Op~K7r$4SUHkOxpRx7S1Megy+A6@r{^s>A`=+VbTMFJSk}G$Q~Lg-JbFCM=gWoI zEA4w?_4#BM^NOiv>MZx4Z&&c(z_shopFR6xo$)j0=CZTDnHcUw%*?BEmt$HO^{MN} zRug3i_wu!Gu7lbR{DSZJFib) zrfS~e($4eKcACB{xxPr_)z9bi|2OCVf7$h5-(HP07M0ce!)|O%pX|f+I;JetEL6<& zWf^bd^D(c7?jo~(4$ zEz5ru*H6gLt$RK5-^Q=!GcH`d`TSKzUnR>SwO=v&)Z{m=oH||S?4E7!uVhreZ=EUq zxzkO|(RAS>2B#NatA79b|3e2+$Sm1H|I{ipOv^nU#8}r{QKG| zMm7Icnlu+EhI*!Pvp&qIzW?&x#bpv-vuDNL^K-O#@$y%5aQ@$%Pp{q{@DY~FSba%q zTB>)|-HR6!H{a9|^R5=`KYsc4?b~53i!@vhiyxC;sm^jBd%11dD^AUg4A=J^tPb19 zsXg=d_cM7(R_%wA{(du_KfgogoI2CPm`jHW_MZE8cy9CJx7Ozj4>BZPIizN!yIL@!T4nq0{UtA2@7w=On|?U@`Mpy|QXVFo z{f%i_v?BRW&+tqGN4f|Facl_w>{gscdI?rwX zZ&hg;AN*p$vvkJ!=dWMB9DG$xl5yejtOZH}=QCsTP8i;na4m;7LL4PKsn`p9h6kfX-}7ItmP)}Cx0zT8@7 z9%K1&$NL8|s^d>fhitWo*&xV~xchABj^YVTAxt;`RvbC+F@oLuJKhN#&U%M7|HB6-C-;5ruZ##6t(%(0x zbI+`Zo4;>Ybol2CkG=c;Pucn?w66I;z?Y2b`xBOHNAq0Vc1xyd=8cobog|hY{gb3s zQ=9tg*()EX6ATQua@M7(NlW;pc&|!K);*ki_wc>EdZUmVYfZDxK0p1oZ2!+^v&*VW zA4+p1sw@_LqP0i2E3uZDee*^KMd7vg&fL9O(i$o8?Q8Awvp3#!HHFMRTY14;;Oz3G z*0k+QlxIx;%5v5yOJUU~FRLnb3v+RPnO8DbR`#C?>(SVxs?eajT)bL&LQ>6M8XtiU&L+K4?J;%`)u9}7X$s*=Zkl{@m)^(ck9!WAT6bpUhRk1mhW3!=(?@s+8nXl zjoRlI{YB{@T7zZM(2;AVgW$6J~DP3iX??>BU9*)c&eIG=NB@JaKi!x~{8 z{%+IP>DhX4R<jL}XR|x3noP{2W&|ylpCwytU?>x%>G!uOxFTq2>aecp* zzx&G{m2O+;>*cGwY0|1a=GB{@E%Vi3nD!`Wu{cBY$0OM$Z*MRB@2wgjAoG6vC6kyw z?M+dB-}jciikM%zpmw^3weRJneeuWpY>S+Vch0&0{(txWAKZ=t*Ysz_zCSN_?_yr* z)nDn7BG$+ETa=U>x&8O!qaz_Xk!uy6w>W47h6+4zO!;VE|Kr=uf6e)C>{FAaFaNw{ zqV)UYqrWR(aIsz8xl!lXVTt)iD&&vtTXbkq5_bd}!>rVqT9db%J=_v>{{3dzH<#qt zj$U1|%QH)nMQ@(er^4jB({f)QEIazJ;LYvr{0r5qqSvfnl$UdTui?G=EyX7?=Xteo zH3~#Y#u(fD0<&LI{BHv z%_$Rh?na}JtKpy z)cq|hPMvb%jt*Dds?n93n>+gv+wGKi`*R}OjP4XOxBFa_U1p}i(GHpm*NY5RKlIOk zx;%?fp;6bLmrFifecvnlL(3)PY5B7Cu`_o5^SOT`U&bQ(yp4Eq$D4|bxOEjTOjs7k zFRbss5b*PI)<%ZtWVRPh3~OXkpRUjgZ$7_#)vB=9@A6*$T6*o}hcXMB-mM24L}a7C z`P^@8mSvu=;};V@_mo#_n6zt#majxx(5loO`;1J5qyNgs|5&v)Y_4hJiD#*W%O2gk zSJpG%{e^E!S^lp>pBr)u13#}@u_`Jw=xxXL-L1NJXZ6p0d|$@4cH934F-irssacw$ zE6oYmHZ7v^W(+O8EC z!QddfI?mTQI8-tGsKS~h6L#;k+B>H&%xGD4zJuebzx;P4{;yot8)_%ApzT?-?{e?J ze=2hQS+`_bj73BnH~i_`Aw6ri^sL8{>+Zj`zFiJ#g)rXEe&uK}{m;3x<(HG{CLg{u zr`^lx^UW<%d;WdiHos!AUh|reALq`NpXZgS%lb2cCPwnT;OZe-m zv?FcFr#ZTNbu~3EmFLI(IC>?0ciBF(svQi9XR}ME{S^BsQ6G6ZtI+Euo9g5&sePr{ zZ}+DN?YjHnjAX?(os0k#5%=x+y&lX49UtWrZ5R&tYk28Ydp=G5xSZckucu4B`upZ7 z7wtcu(me5~JU@0tZrsIRO(%c-pB|@T7!#Z@r~l=q`ahSKw$GQhuC9CW!tcG|ukdrn zBIm~JeDKn+=Xlob(!URxS{zgs{k?m?(YoAWB^NhC%}=A6&%Uqj|J{A8qe3U_*>oL- ze5EH$4~~n7>Qnt|coVgM^USl0xbQt7Ts$`C=kP`E%GOoX$=%^Z;OwsX%%D=KTdbUlnl#BY&?O(TN z22Xy~T^6O=Pe1Tg?b`PDYGP0Jdd0QzDa)6Y-SITwxK#Sx{_OL@RO?2DJ*^iWa+Q3W ze6+J_ZI-F`$`ikfdv~;l9y=zw`Rf;jNvjiByykZ=v}<)R`xkz_-cD}T{U3`sU8XIb zS=`*deV-q5!J>H^mwoMbIXjJ)xZdDj zV79TUS=Ku@_3HumzwLEYO~0C9wL0+&f4TjSjDPQbX{!lDG91{j{C4{7I|;XW9pY`R z*VbRSc1~WmWT(T_&yw43)@re)?ELhdpV45??dnfmGc;yY2)w!bV2@9{ePjEIg>11t|e}ido6eGiDX&An^n)VroEbdrlZg@e#h$7|K2do@nPE9 zRjRd1VvcToNKc_jewcrl^DWi?6|2{3xX;XqS+pl~nxq4Ro58x( zX{!TPobtcZHkXM{hr3!UizSRN@W|EfHQWvQZ^GhqW^H!7o@Dgr;hnc((Sg>{(z9}U z45q}@pPGKfY*|6h?I%nBv>i*)6Ex^OG3^r1zN#mx=K1=fRh6qV**Ehpig0ptM0G>y)}#KHvUW?IKem6h(AqoSR3!eKncYt5oHmEESBH=k%ac(96Da2DIKqisP}h|Deqz@v)rVDO5H@e ziL4A3y4yZ8yT6)yK2+n%R4wm7>$S7jR&FYtlk2_8rr4+R zua~py>o&T$CZFAQbld0fj0<-&Q++RZl*~&>yhsAtRg?>S2_O= z&MLnxl*hL0yW4XEY_Qf|Lu7> zF@CvaR5j=3s!a?GA%7XZoW1hVgD*rhZ#Lt#Yhlk5q@R4hzEz36f$hMxjV3(4`z=bQ zq@Ojo`Npu($7asz*C7HNy2rODc?Zr|SN@XQU1{t0N4F9$uDREsKtFo4B)jjqU$%bAf-{33H`E7n5x?p%Jgug`l<%>h}G7SAHP8qI0 z@rfbqVViQ>lg6 zhKAm?JZp8n@BDjyk3q$e62;B!6IVr>3vjRNoYLPP=buQvoBD9_b2h%& zeu<0>-Y?H4+iZkPdFJBWek(Pl78TD) zsWTU8v?ab!vVJd>A3QO2E7S7Luk6!gJr7Nuyfy#djG*|LjOEX>mDRs*{~lIy-ata) z@l~H%&N7xJLxa^Pn7Xc2SSML{-7PF@c=P&v|GdCGu`}*HJb#4Y=~G{;F2ieGQ~pIx zih5{yy|z`ZD1BOqGtkoNnl zdkv>cD{lGrUux3f%02HzX7doWe`7RGi}~JG*_0JMJ51-Q?$14{0fzFcLnJ_ta1U##todp_JQjvYu26h|5a2S|LN%Zll%U8 z&E{R@5xe$e=B9{*g&SU)u3dlZ=S~fEt?t4FwwHoA7G8aqY5#ZUiO%cF>&mu15)_zq zR&(asg0kqa%NN6DJ1Cg28F%ZnbnRx&7f?9+?37G(-@}ZO;%-#hPIfR5PZNt| zm~gez+~l2b)wgWF{H@jp7d34T?PqUa#GxatBxKUdC$nN_`1U<}iW!+)JDc0No!zx> z_P=_&?kt1z#EEA2^Ep^PC*@5HUF-M7;@hgooTUE|yw;9gU0k8vIsu`33isHZUeqWx z|8k+n^mv*2qXUX(1Gh?ZH=f$;C^3`0 zXzKap{(kq4@wJ;71--r49i5bEwdwb6i|l7VRFDj5mS1FM@9zI2`))lJZBtUeYWQH1gMq{{@yL`? zk#BR?WCrJK)>)^S!|A&$JpbZ^WAp5m{$+S2;k<_T&7L*=kzyYE>y90l<6oD_vqS8B z_^vl>nn!QzevvQntK0Q;ddF6cYNfCZW!nQ*_umuXa69@%DO!6*a+2BUPt&HG&WL$5 z>9mGfuWanB&C#Fvl5cJ5ZRb$DGeM~P*6r&xx3e50;=01Owq7yM`h0)+cAxxE*?W5h zwHX*DG({bXd-PHy^2laGc6--@b7MSwmQHibk}R0=Y_sDvUQ780)s1`QjlU(CiMBK~ z=!!+WD)R{3afv4~=1ZU96s`!32U86+QW#b&TDUf?RLrfq9LZ=n7 zs~5~^a;P{Gtg-3FDb_iEcv^OU`4hI*qb!4AY2%b*mxNB-V+!QRuwJsJVN)O{&x+%Z zZ7kU=G&GhT{D1!5T)X3icgmUHzuWmO?v8?9lagc8a*c_LGCKRcr#)2>nk~@VF=aU9l_ocm&l=yqp?6vHwP3%3XHX$xN(G3Z2;-ZxpBPvfjFzfu-rdyK_nD z)oI^;Yl`zWRR7^%y#MyEuY6TcKySh9j$aWyFQ;T}+2Z&{Xz7%&&s+8!e8Z%>M&RM4 zS7M4P)3#jWzTWa>!({KuXEBeyS|AX|I#7^1htXaiO=S zXXjMrZ>~944zDUKUKwF~^`E`tt2Sekg|taYQ-q%Ljgcxxa~sFoCx^AO(E{fq_c%p6qhd7TPbROu(cJOttkmy3{w)&Uy?S>P zX6DKM+Og&v(}o8-n4Pv=k6OCLs%(!{*%oK%=B`RhC1HgJzn(6SOkTRAbob9(m8oT3 z9cJ!TtxTH>3%^) ztM?}AC>9+M5Z)T7UazI+c5B9hRf2NaVhg66+OgAR7F*$bk7zkHK4zAf_$}NT8BLB@DJ6&eS`3kx1mA)-}NMX^-glR#IeU67VJPN$|hE3s-;^~a5 z7iOL9ojPR)r)G88Uw`Gi)qRcY9-8DB&FDC>t(V~U$7`Lp8h4MKTBe?KsXX*`|wam6dX z?K}G&ReaM0HVFs{%ANEI&fmV%Gh5Qzv|WldEq7Dc?6Yz+?|E7P|4etvu5o& za>jV^i5Uy3@4pK6oZ-CIcbRRaqW3lT^{m^}6ZhI!TmQKfQ9t8k-zq)E1>8zfo34B; z%etm`MmH@d(Aa&g%;i<>X{uANoH5?JMZMnA@KcC>nVoIJM!hTYSu-Pw$`WEqMH$>h z&rY}+*;$&ba>By2%V)ho*^iTkydhVLuH9L3MRkg>wtuhD;!U3?T+PxKs#P^x(`oC)8l&GVYX}g>G&T|MRugQ9;?fKg8bg^jY%2u7J7Cq0dTzI11zb_z` z)#164$LeiYtv zRLHX7L08)D1KP(WAB4qRpQXEL(xhAO3U1DOprpx}dc|mGa(ZxM2uW-@L6v{jpD9y!=; zu~cQ9hv;hcRp)NJyD|Sd+Y)Bg-#dwg5c5w96&A-F0d1Z=eEnj`E;?AD@ zSF3k(?|tQL&XczN?u@++6Iv%Y?M{e3Dp~CM>E!z2#Js8J^F-#aw|dN8w|j@j)2{Qo z{xtly`}bpU^wgiu-}Dynoqu-vdC}6-q3IR=%m>e}J>Zm@SMh4Ky57olObdiLZstyU z5t{zr?V{7G=%+t78OQSPbH2ZiTk`bu^QM&rfzs>FZT*wC+h(%1ZSc1ASLGL5dMf|8 zyWEsNA1~jrG$fqyfuvKJ_*#qP-Qio7Ea{tlZu+^K=2 z*Xj#-m(-NsmemRKH?b>pT@}Ke&Ev8A+0K=f-tWJM76|BZ+GNILIx#y8cVm6?fGk^AAdUw^_&o?ZWVn8Ce$LTf>F){7hW z_x-q=v*zsIa)v5iMec>>lg|A6c{x5^#Quzc%a5Hc8Z%^N>JyjUoVJf)l|qW5Qryhl zR?}ocVp$K=aYS}>>`46g^lEterrg|3d>4#4B0KsTD_*r<-(QaY3KXx$SU~18Exg3)A#6qvh zkwGCvag)Tf+fHDHNtd#Yqiu_h%e1zMIxGxMVoKi0KR&X3{SeGCv2~&j3!{^mQn%oj z6tEgGv(Ie`4kw&a7OHbQHq3YG(8+ns3t_ZXZW3VNi0sheRgUCf_#@(!lE@_v*3JEv z32eXEEmi@RADS&El6aIO1NarWC$`Rmn9uz=MUew+;olTR4uMSqks0C+0xwo^Gkoa& zbdz<;gyQ7Q#fO70-<-H3Z))uBHz8))OOM`Jy!6kj#YyKxV{%(BFoSH~Y8%JJYH*;n2HFGtKO+jP0$Q zIezXgulx0J@ow8Sd{yj<+z+}>ekrgvpByCQ)Fv$XUz^DkPXHJ^rp(%BFxy;ei zE1V{8V!JHcsG45qc)}^->ZFi@!1-lbODaCGEqrxyl}yS14?pvbyo#qLO|{G#pMiUFf`3G4=Derc(W_;`?mW z_M8%L>6>pIuJ`A-{JnR1h8LSBv?@#r`c$R8;9lC>f+@$RsEOOJXfCuks(ka@A9bN^ zyd04nU2gIX*Q1$YD;-uo`p;oP~(VvvFX@Ht#uC$S_HX1j4+$!<+t@o zNNBhqNJdR>$KzcGXYM_sA=;JI`HG`z?Ue9XrxOY(3%RADx0vYVu3V?8(e&Bta%}X~ zNw0*Q*c7>A9~52Zbtz`3d0x2FKq2K}#*!&~6jQQ2x~8%DY@KH;%{`6CUr<+jco$&1802byc3X@t@TylRhkBnJeJbqLe85PVlj2 z(p5S4V|!|*Pf9y;K1zv0k$aw}X70Nc>lW#@EnBI#P}eFra{0rjHw8DvDW)7WK36&6 z_lD}3ukPKJI^(Rbw``rCSI5%XZ|~bldmr0-M^0eVgWf4dF6y(jaukl0@cY|N@%SC- zZQT5E%k{LQC1qE(7lCZJS7Fl+}Xmm>GQ0HIBjH$Q7rul~P8z1@bNfAhvCAyqf#7x9(W-^?crvEI{pa1d6gClnW)DK^p z?jQH>VzvGEg^QYF=i1cfZTT#BRD1cnSly?EB4_Omcb?h0(s+9R+)ZWAK7iuG_wtNg z$-DQ=^5LH^Iqz3a?n-li^Jy|ax=-tuZ|gpFa^cDM@l`M7?SF;xf9u_2QupZV&)4oX z6Y|f-@1Gxkchl)uEv+MMk6xy$`JL@Q)1$We_dl+;OfOnqrY_rCWS*w~?aj_Oi@JXr zzeCRUpNW|{=XI7V`|o2bSG(6wXpyXbx$^W~4fP`uOZDwbf99{N|NZ}LT#Zqp;iOhR z(^+hO9<$gk&zuq_U-aI{T-JRQO#CC^VVcb{uX=cgv zX_+y0WuN}Cm+!k#b7iVKw_xz)=WS~Gee*3$O)@jiHcip{`{S&f7~4dprCVavb!wZp zzq|WqdvyNK?>{&X|2jDJ`mRk5WoxJW|5$B*I<)5GP3hz3>;FF4yrufOzV^DmpKrha zSNAh)M;LQi!?m~#?$6zq_opB4U&?;_&NX&LZud(TGp;>-7{T`K*z@;$cYbJ;@3#@~ zuKR!K`mx~VyHy98V*h=;+kbCg{p#+&H*Yp>yzUqOI%#6{-Kgka%lqp>c~8!s{msy8 zxsh_Q^W@1hC!YKgaA(6FJ0>TwT@A%@(|)r3|8P*+Jp6s>cf`B#2lF=XMdEGmFQR+OgiI}?$$qJ?QVfh7kr&K+IJs( ze<>{HcdzyPy<5NB4CH%fH%+Q4@6{L4|Kc;aG{w#2YW5U;Kitl}ZTh)0DQQ1W9eLUP zSpCeh@U&g;0u8@Ed;Y$D*Di@CdTWp-c4{rIKy!m?iIoZ$4civw; z%^yo{^(cmz(eF)a?n>Gua<`s>j~E^x3H+ za}MQZ9nP-Iu1$P=aPOa2pRUdF7gjGh<|cG=qDz^=yi>;}Ek60CqUb`9?Q&^FZo5gP z>mD3@e^too)748}hTj)#n5Zo-by&~&vT)nfjY65)hBD`Qjs$1<+w@GD6s&pkYFGB{ zJ6m@~7v_c+Y~MHOf@sZsZ{x*2$y@)w^tr5&Jmuxre(CuB*J+0~B(<&luw|i|z@`h_ zL0*b3kH5Q@>N422ipF2yo)YAH*<{hnAn~B0gV__STe|%i5*sJ9&RexqcWLk9upI(@ zuNATsZ-MH%V>8mCVmLIVm2WTb|HJfx!AVSHb$`~(b+tFQuWi+15?{om$nCiC_V&B` z0@PlwjFx}0N{@Geuvxj7dAPtP0hiuuZ{O7&kKr)q;XcX0p~zQ$KXTvSlc&VHXKOog zwdk}s)b=g8IivJ6t9WmJ!BHNj0}pM&HP?s~uU>jKX6cTgJ2e}&p8L)NYKKW}>D&1B z;oEuB4t<-yio4~6mi5)HZ1Fdr(w1(C)SNcQ>)^Vau&&ih&t950^(?#738#p+*_v;T z{53CE)vvmm zx2&`<`eUtB_8F<)3bzlH?#SMqH`TgVW$Vvx$60r8n!I-E;w`HLHVMdny>a#1yH}@L z1->4g#kKmCHeY%Ex_i~H@0~sR=hQ{{vsX&IjeUL1OZSTHK2rRKOLI=tj89S5il?uR zDDIfhs*$ZzVcwxw-tm@K^g`T=O<#llZU1if_rpV{qg!`>ozbh9zFp2&v_C#$?``DO}y%}m+q|J%B(e&+{9p>3)y zIt}bof?_Y9ICpjH-nDU?WOvtIEPLRzXXl51>-YcgC{Ch++52y2%Fem= z;s2f8oh`ZYPGSlIv%WX+Zz)&MIr8nt4mwu!$(m1RbH6YDo2bmA$Sn}IJA0AF z!kq1iA1j_G-QTqRxP9fGNX74WA2c*fYx(o<-`b+@X@|Zsx9B)bc^f_F*AMl1;sHD7 z{J;KO;#k$;5OD^Eg&!yT*KH2G7ZmGyLLr55fv)TBPy4;iL&F8_I3gJ`PRn0=w^~ne ziohm@3)5z=j$Z*|AB_<&(|_X(R#RoUepgF?(+MVrY}Va9b9tAlu7o zU*F+g<;@`vQuX@Nk(I$O&Q!HbU}fO{_u@@7Nc2s0E4iA=;1Ch$6>s_V&B=qE^Y7OEKKH9=|J=IFrCa}>`5ydZyo=5tWc=r^W|W7&!s7n=Oa1~R#aI`Jb7eNrm@|W6FjPy4DY^qSFD)AxZt!_-`)w;9}2RS z!$GCO&6T(Ahz1pC?hsh_z^Uu-vE5Syj!7);35@zLU;WA7Yvr{cGYq{}9Gh{@WNxNZ zYTL5cJ(;)VvzMhw%*r!3dxr(t,"name",{value:e,configurable:!0}),l=(t,e)=>function(){return e||(0,t[i(t)[0]])((e={exports:{}}).exports,e),e.exports},h=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},u=(t,e,a,o)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let l of i(e))s.call(t,l)||l===a||r(t,l,{get:()=>e[l],enumerable:!(o=n(e,l))||o.enumerable});return t},d=(t,e,r)=>(u(t,e,"default"),r&&u(r,e,"default")),p=(t,n,i)=>(i=null!=t?e(a(t)):{},u(!n&&t&&t.__esModule?i:r(i,"default",{value:t,enumerable:!0}),t)),g=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs=n()}(t,(function(){var t=6e4,e=36e5,r="millisecond",n="second",i="minute",a="hour",s="day",l="week",c="month",h="quarter",u="year",d="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o((function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}),"ordinal")},y=o((function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t}),"m"),v={s:y,z:o((function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+y(n,2,"0")+":"+y(i,2,"0")}),"z"),m:o((function t(e,r){if(e.date()1)return t(s[0])}else{var o=e.name;b[o]=e,i=o}return!n&&i&&(x=i),i||!n&&x}),"t"),_=o((function(t,e){if(k(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new C(r)}),"O"),E=v;E.l=T,E.i=k,E.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var C=function(){function m(t){this.$L=T(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}o(m,"M");var y=m.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(E.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(g);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(t,e){var r=_(t);return this.startOf(e)<=r&&r<=this.endOf(e)},y.isAfter=function(t,e){return _(t){}),"trace"),debug:o(((...t)=>{}),"debug"),info:o(((...t)=>{}),"info"),warn:o(((...t)=>{}),"warn"),error:o(((...t)=>{}),"error"),fatal:o(((...t)=>{}),"fatal")},v=o((function(t="fatal"){let e=m.fatal;"string"==typeof t?t.toLowerCase()in m&&(e=m[t]):"number"==typeof t&&(e=t),y.trace=()=>{},y.debug=()=>{},y.info=()=>{},y.warn=()=>{},y.error=()=>{},y.fatal=()=>{},e<=m.fatal&&(y.fatal=console.error?console.error.bind(console,x("FATAL"),"color: orange"):console.log.bind(console,"",x("FATAL"))),e<=m.error&&(y.error=console.error?console.error.bind(console,x("ERROR"),"color: orange"):console.log.bind(console,"",x("ERROR"))),e<=m.warn&&(y.warn=console.warn?console.warn.bind(console,x("WARN"),"color: orange"):console.log.bind(console,"",x("WARN"))),e<=m.info&&(y.info=console.info?console.info.bind(console,x("INFO"),"color: lightblue"):console.log.bind(console,"",x("INFO"))),e<=m.debug&&(y.debug=console.debug?console.debug.bind(console,x("DEBUG"),"color: lightgreen"):console.log.bind(console,"",x("DEBUG"))),e<=m.trace&&(y.trace=console.debug?console.debug.bind(console,x("TRACE"),"color: lightgreen"):console.log.bind(console,"",x("TRACE")))}),"setLogLevel"),x=o((t=>`%c${(0,f.default)().format("ss.SSS")} : ${t} : `),"format"),b=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,w=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,k=/\s*%%.*\n/gm,T=class extends Error{static{o(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}},_={},E=o((function(t,e){t=t.replace(b,"").replace(w,"").replace(k,"\n");for(const[r,{detector:n}]of Object.entries(_)){if(n(t,e))return r}throw new T(`No diagram type detected matching given configuration for text: ${t}`)}),"detectType"),C=o(((...t)=>{for(const{id:e,detector:r,loader:n}of t)S(e,r,n)}),"registerLazyLoadedDiagrams"),S=o(((t,e,r)=>{_[t]&&y.warn(`Detector with key ${t} already exists. Overwriting.`),_[t]={detector:e,loader:r},y.debug(`Detector with key ${t} added${r?" with loader":""}`)}),"addDetector"),A=o((t=>_[t].loader),"getDiagramLoader"),L=o(((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>L(t,e,i))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||r<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach((i=>{"object"!=typeof e[i]||void 0!==t[i]&&"object"!=typeof t[i]?(n||"object"!=typeof t[i]&&"object"!=typeof e[i])&&(t[i]=e[i]):(void 0===t[i]&&(t[i]=Array.isArray(e[i])?[]:{}),t[i]=L(t[i],e[i],{depth:r-1,clobber:n}))})),t)}),"assignWithDepth"),N=L,I={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:o((t=>t>=255?255:t<0?0:t),"r"),g:o((t=>t>=255?255:t<0?0:t),"g"),b:o((t=>t>=255?255:t<0?0:t),"b"),h:o((t=>t%360),"h"),s:o((t=>t>=100?100:t<0?0:t),"s"),l:o((t=>t>=100?100:t<0?0:t),"l"),a:o((t=>t>=1?1:t<0?0:t),"a")},toLinear:o((t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92}),"toLinear"),hue2rgb:o(((t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t)),"hue2rgb"),hsl2rgb:o((({h:t,s:e,l:r},n)=>{if(!e)return 2.55*r;t/=360,e/=100;const i=(r/=100)<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return 255*I.hue2rgb(a,i,t+1/3);case"g":return 255*I.hue2rgb(a,i,t);case"b":return 255*I.hue2rgb(a,i,t-1/3)}}),"hsl2rgb"),rgb2hsl:o((({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if("l"===n)return 100*s;if(i===a)return 0;const o=i-a;if("s"===n)return 100*(s>.5?o/(2-i-a):o/(i+a));switch(i){case t:return 60*((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t))),"clamp"),round:o((t=>Math.round(1e10*t)/1e10),"round")},unit:{dec2hex:o((t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}),"dec2hex")}},M={};for(let t=0;t<=255;t++)M[t]=R.unit.dec2hex(t);var D,O=0,P=1,B=2,$=class{static{o(this,"Type")}constructor(){this.type=O}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=O}is(t){return this.type===t}},F=class{static{o(this,"Channels")}constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new $}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=O,this}_ensureHSL(){const t=this.data,{h:e,s:r,l:n}=t;void 0===e&&(t.h=R.channel.rgb2hsl(t,"h")),void 0===r&&(t.s=R.channel.rgb2hsl(t,"s")),void 0===n&&(t.l=R.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:r,b:n}=t;void 0===e&&(t.r=R.channel.hsl2rgb(t,"r")),void 0===r&&(t.g=R.channel.hsl2rgb(t,"g")),void 0===n&&(t.b=R.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(B)||void 0===e?(this._ensureHSL(),R.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(B)||void 0===e?(this._ensureHSL(),R.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(B)||void 0===e?(this._ensureHSL(),R.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(P)||void 0===e?(this._ensureRGB(),R.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(P)||void 0===e?(this._ensureRGB(),R.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(P)||void 0===e?(this._ensureRGB(),R.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(P),this.changed=!0,this.data.r=t}set g(t){this.type.set(P),this.changed=!0,this.data.g=t}set b(t){this.type.set(P),this.changed=!0,this.data.b=t}set h(t){this.type.set(B),this.changed=!0,this.data.h=t}set s(t){this.type.set(B),this.changed=!0,this.data.s=t}set l(t){this.type.set(B),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}},z=new F({r:0,g:0,b:0,a:0},"transparent"),U={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:o((t=>{if(35!==t.charCodeAt(0))return;const e=t.match(U.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4==0,s=i>4,o=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return z.set({r:(n>>l*(c+3)&h)*o,g:(n>>l*(c+2)&h)*o,b:(n>>l*(c+1)&h)*o,a:a?(n&h)*o/255:1},t)}),"parse"),stringify:o((t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${M[Math.round(e)]}${M[Math.round(r)]}${M[Math.round(n)]}${M[Math.round(255*i)]}`:`#${M[Math.round(e)]}${M[Math.round(r)]}${M[Math.round(n)]}`}),"stringify")},G=U,q={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:o((t=>{const e=t.match(q.hueRe);if(e){const[,t,r]=e;switch(r){case"grad":return R.channel.clamp.h(.9*parseFloat(t));case"rad":return R.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return R.channel.clamp.h(360*parseFloat(t))}}return R.channel.clamp.h(parseFloat(t))}),"_hue2deg"),parse:o((t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const r=t.match(q.re);if(!r)return;const[,n,i,a,s,o]=r;return z.set({h:q._hue2deg(n),s:R.channel.clamp.s(parseFloat(i)),l:R.channel.clamp.l(parseFloat(a)),a:s?R.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)}),"parse"),stringify:o((t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${R.lang.round(e)}, ${R.lang.round(r)}%, ${R.lang.round(n)}%, ${i})`:`hsl(${R.lang.round(e)}, ${R.lang.round(r)}%, ${R.lang.round(n)}%)`}),"stringify")},j=q,W={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:o((t=>{t=t.toLowerCase();const e=W.colors[t];if(e)return G.parse(e)}),"parse"),stringify:o((t=>{const e=G.stringify(t);for(const t in W.colors)if(W.colors[t]===e)return t}),"stringify")},Y=W,H={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:o((t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const r=t.match(H.re);if(!r)return;const[,n,i,a,s,o,l,c,h]=r;return z.set({r:R.channel.clamp.r(i?2.55*parseFloat(n):parseFloat(n)),g:R.channel.clamp.g(s?2.55*parseFloat(a):parseFloat(a)),b:R.channel.clamp.b(l?2.55*parseFloat(o):parseFloat(o)),a:c?R.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)}),"parse"),stringify:o((t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${R.lang.round(e)}, ${R.lang.round(r)}, ${R.lang.round(n)}, ${R.lang.round(i)})`:`rgb(${R.lang.round(e)}, ${R.lang.round(r)}, ${R.lang.round(n)})`}),"stringify")},V=H,X={format:{keyword:Y,hex:G,rgb:V,rgba:V,hsl:j,hsla:j},parse:o((t=>{if("string"!=typeof t)return t;const e=G.parse(t)||V.parse(t)||j.parse(t)||Y.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)}),"parse"),stringify:o((t=>!t.changed&&t.color?t.color:t.type.is(B)||void 0===t.data.r?j.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?V.stringify(t):G.stringify(t)),"stringify")},K=o(((t,e)=>{const r=X.parse(t);for(const t in e)r[t]=R.channel.clamp[t](e[t]);return X.stringify(r)}),"change"),Z=K,Q=o(((t,e,r=0,n=1)=>{if("number"!=typeof t)return Z(t,{a:e});const i=z.set({r:R.channel.clamp.r(t),g:R.channel.clamp.g(e),b:R.channel.clamp.b(r),a:R.channel.clamp.a(n)});return X.stringify(i)}),"rgba"),J=Q,tt=o(((t,e)=>R.lang.round(X.parse(t)[e])),"channel"),et=o((t=>{const{r:e,g:r,b:n}=X.parse(t),i=.2126*R.channel.toLinear(e)+.7152*R.channel.toLinear(r)+.0722*R.channel.toLinear(n);return R.lang.round(i)}),"luminance"),rt=et,nt=o((t=>rt(t)>=.5),"isLight"),it=o((t=>!nt(t)),"isDark"),at=o(((t,e,r)=>{const n=X.parse(t),i=n[e],a=R.channel.clamp[e](i+r);return i!==a&&(n[e]=a),X.stringify(n)}),"adjustChannel"),st=o(((t,e)=>at(t,"l",e)),"lighten"),ot=o(((t,e)=>at(t,"l",-e)),"darken"),lt=o(((t,e)=>{const r=X.parse(t),n={};for(const t in e)e[t]&&(n[t]=r[t]+e[t]);return Z(t,n)}),"adjust"),ct=lt,ht=o(((t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=X.parse(t),{r:o,g:l,b:c,a:h}=X.parse(e),u=r/100,d=2*u-1,p=s-h,g=((d*p==-1?d:(d+p)/(1+d*p))+1)/2,f=1-g;return J(n*g+o*f,i*g+l*f,a*g+c*f,s*u+h*(1-u))}),"mix"),ut=o(((t,e=100)=>{const r=X.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,ht(r,t,e)}),"invert"),dt="#ffffff",pt="#f2f2f2",gt=o(((t,e)=>ct(t,e?{s:-40,l:10}:{s:-40,l:-10})),"mkBorder"),ft=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ct(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ct(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ut(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ut(this.tertiaryColor),this.lineColor=this.lineColor||ut(this.background),this.arrowheadColor=this.arrowheadColor||ut(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ut(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||ot(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},mt=o((t=>{const e=new ft;return e.calculate(t),e}),"getThemeVariables"),yt=class{static{o(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=ct(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.background),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.tertiaryColor),this.lineColor=ut(this.background),this.textColor=ut(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(ut("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=J(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=ot("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ot(this.sectionBkgColor,10),this.taskBorderColor=J(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=J(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=st(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=st(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=st(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ct(this.primaryColor,{h:64}),this.fillType3=ct(this.secondaryColor,{h:64}),this.fillType4=ct(this.primaryColor,{h:-64}),this.fillType5=ct(this.secondaryColor,{h:-64}),this.fillType6=ct(this.primaryColor,{h:128}),this.fillType7=ct(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330});for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},vt=o((t=>{const e=new yt;return e.calculate(t),e}),"getThemeVariables"),xt=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ct(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ct(this.primaryColor,{h:-160}),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.tertiaryColor),this.lineColor=ut(this.background),this.textColor=ut(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=J(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let t=0;t{"calculated"===this[t]&&(this[t]=void 0)})),"object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},bt=o((t=>{const e=new xt;return e.calculate(t),e}),"getThemeVariables"),wt=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=st("#cde498",10),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.primaryColor),this.lineColor=ut(this.background),this.textColor=ut(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=ot(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},kt=o((t=>{const e=new wt;return e.calculate(t),e}),"getThemeVariables"),Tt=class{static{o(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ct(this.primaryColor,{h:-160}),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.tertiaryColor),this.lineColor=ut(this.background),this.textColor=ut(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},_t={base:{getThemeVariables:mt},dark:{getThemeVariables:vt},default:{getThemeVariables:bt},forest:{getThemeVariables:kt},neutral:{getThemeVariables:o((t=>{const e=new Tt;return e.calculate(t),e}),"getThemeVariables")}},Et={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Ct={...Et,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:_t.default.getThemeVariables(),sequence:{...Et.sequence,messageFont:o((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont"),noteFont:o((function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}}),"noteFont"),actorFont:o((function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}),"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Et.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Et.c4,useWidth:void 0,personFont:o((function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}}),"personFont"),external_personFont:o((function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}}),"external_personFont"),systemFont:o((function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}}),"systemFont"),external_systemFont:o((function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}}),"external_systemFont"),system_dbFont:o((function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}}),"system_dbFont"),external_system_dbFont:o((function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}}),"external_system_dbFont"),system_queueFont:o((function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}}),"system_queueFont"),external_system_queueFont:o((function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}}),"external_system_queueFont"),containerFont:o((function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}}),"containerFont"),external_containerFont:o((function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}}),"external_containerFont"),container_dbFont:o((function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}}),"container_dbFont"),external_container_dbFont:o((function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}}),"external_container_dbFont"),container_queueFont:o((function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}}),"container_queueFont"),external_container_queueFont:o((function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}}),"external_container_queueFont"),componentFont:o((function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}}),"componentFont"),external_componentFont:o((function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}}),"external_componentFont"),component_dbFont:o((function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}}),"component_dbFont"),external_component_dbFont:o((function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}}),"external_component_dbFont"),component_queueFont:o((function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}}),"component_queueFont"),external_component_queueFont:o((function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}}),"external_component_queueFont"),boundaryFont:o((function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}}),"boundaryFont"),messageFont:o((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont")},pie:{...Et.pie,useWidth:984},xyChart:{...Et.xyChart,useWidth:void 0},requirement:{...Et.requirement,useWidth:void 0},packet:{...Et.packet},radar:{...Et.radar}},St=o(((t,e="")=>Object.keys(t).reduce(((r,n)=>Array.isArray(t[n])?r:"object"==typeof t[n]&&null!==t[n]?[...r,e+n,...St(t[n],"")]:[...r,e+n]),[])),"keyify"),At=new Set(St(Ct,"")),Lt=Ct,Nt=o((t=>{if(y.debug("sanitizeDirective called with",t),"object"==typeof t&&null!=t)if(Array.isArray(t))t.forEach((t=>Nt(t)));else{for(const e of Object.keys(t)){if(y.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!At.has(e)||null==t[e]){y.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"==typeof t[e]){y.debug("sanitizing object",e),Nt(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(y.debug("sanitizing css option",e),t[e]=It(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}y.debug("After sanitization",t)}}),"sanitizeDirective"),It=o((t=>{let e=0,r=0;for(const n of t){if(e{let r=N({},t),n={};for(const t of e)qt(t),n=N(n,t);if(r=N(r,n),n.theme&&n.theme in _t){const t=N({},D),e=N(t.themeVariables||{},n.themeVariables);r.theme&&r.theme in _t&&(r.themeVariables=_t[r.theme].getThemeVariables(e))}return Xt(Ot=r),Ot}),"updateCurrentConfig"),Bt=o((t=>(Mt=N({},Rt),Mt=N(Mt,t),t.theme&&_t[t.theme]&&(Mt.themeVariables=_t[t.theme].getThemeVariables(t.themeVariables)),Pt(Mt,Dt),Mt)),"setSiteConfig"),$t=o((t=>{D=N({},t)}),"saveConfigFromInitialize"),Ft=o((t=>(Mt=N(Mt,t),Pt(Mt,Dt),Mt)),"updateSiteConfig"),zt=o((()=>N({},Mt)),"getSiteConfig"),Ut=o((t=>(Xt(t),N(Ot,t),Gt())),"setConfig"),Gt=o((()=>N({},Ot)),"getConfig"),qt=o((t=>{t&&(["secure",...Mt.secure??[]].forEach((e=>{Object.hasOwn(t,e)&&(y.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])})),Object.keys(t).forEach((e=>{e.startsWith("__")&&delete t[e]})),Object.keys(t).forEach((e=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&qt(t[e])})))}),"sanitize"),jt=o((t=>{Nt(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Dt.push(t),Pt(Mt,Dt)}),"addDirective"),Wt=o(((t=Mt)=>{Pt(t,Dt=[])}),"reset"),Yt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Ht={},Vt=o((t=>{Ht[t]||(y.warn(Yt[t]),Ht[t]=!0)}),"issueWarning"),Xt=o((t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Vt("LAZY_LOAD_DEPRECATED")}),"checkConfig"),{entries:Kt,setPrototypeOf:Zt,isFrozen:Qt,getPrototypeOf:Jt,getOwnPropertyDescriptor:te}=Object,{freeze:ee,seal:re,create:ne}=Object,{apply:ie,construct:ae}="undefined"!=typeof Reflect&&Reflect;ee||(ee=o((function(t){return t}),"freeze")),re||(re=o((function(t){return t}),"seal")),ie||(ie=o((function(t,e,r){return t.apply(e,r)}),"apply")),ae||(ae=o((function(t,e){return new t(...e)}),"construct"));var se=be(Array.prototype.forEach),oe=be(Array.prototype.lastIndexOf),le=be(Array.prototype.pop),ce=be(Array.prototype.push),he=be(Array.prototype.splice),ue=be(String.prototype.toLowerCase),de=be(String.prototype.toString),pe=be(String.prototype.match),ge=be(String.prototype.replace),fe=be(String.prototype.indexOf),me=be(String.prototype.trim),ye=be(Object.prototype.hasOwnProperty),ve=be(RegExp.prototype.test),xe=we(TypeError);function be(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:ue;Zt&&Zt(t,null);let n=e.length;for(;n--;){let i=e[n];if("string"==typeof i){const t=r(i);t!==i&&(Qt(e)||(e[n]=t),i=t)}t[i]=!0}return t}function Te(t){for(let e=0;e/gm),Fe=re(/\$\{[\w\W]*/gm),ze=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ue=re(/^aria-[\-\w]+$/),Ge=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qe=re(/^(?:\w+script|data):/i),je=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),We=re(/^html$/i),Ye=re(/^[a-z][.\w]*(-[.\w]+)+$/i),He=Object.freeze({__proto__:null,ARIA_ATTR:Ue,ATTR_WHITESPACE:je,CUSTOM_ELEMENT:Ye,DATA_ATTR:ze,DOCTYPE_NAME:We,ERB_EXPR:$e,IS_ALLOWED_URI:Ge,IS_SCRIPT_OR_DATA:qe,MUSTACHE_EXPR:Be,TMPLIT_EXPR:Fe}),Ve=1,Xe=3,Ke=7,Ze=8,Qe=9,Je=o((function(){return"undefined"==typeof window?null:window}),"getGlobal"),tr=o((function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(r=e.getAttribute(n));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}),"_createTrustedTypesPolicy"),er=o((function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}}),"_createHooksMap");function rr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Je();const e=o((t=>rr(t)),"DOMPurify");if(e.version="3.2.4",e.removed=[],!t||!t.document||t.document.nodeType!==Qe||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=t,f=c.prototype,m=Ee(f,"cloneNode"),y=Ee(f,"remove"),v=Ee(f,"nextSibling"),x=Ee(f,"childNodes"),b=Ee(f,"parentNode");if("function"==typeof s){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let w,k="";const{implementation:T,createNodeIterator:_,createDocumentFragment:E,getElementsByTagName:C}=r,{importNode:S}=n;let A=er();e.isSupported="function"==typeof Kt&&"function"==typeof b&&T&&void 0!==T.createHTMLDocument;const{MUSTACHE_EXPR:L,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:R,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=He;let{IS_ALLOWED_URI:B}=He,$=null;const F=ke({},[...Ce,...Se,...Ae,...Ne,...Re]);let z=null;const U=ke({},[...Me,...De,...Oe,...Pe]);let G=Object.seal(ne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,j=null,W=!0,Y=!0,H=!1,V=!0,X=!1,K=!0,Z=!1,Q=!1,J=!1,tt=!1,et=!1,rt=!1,nt=!0,it=!1;const at="user-content-";let st=!0,ot=!1,lt={},ct=null;const ht=ke({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ut=null;const dt=ke({},["audio","video","img","source","image","track"]);let pt=null;const gt=ke({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let vt=yt,xt=!1,bt=null;const wt=ke({},[ft,mt,yt],de);let kt=ke({},["mi","mo","mn","ms","mtext"]),Tt=ke({},["annotation-xml"]);const _t=ke({},["title","style","font","a","script"]);let Et=null;const Ct=["application/xhtml+xml","text/html"],St="text/html";let At=null,Lt=null;const Nt=r.createElement("form"),It=o((function(t){return t instanceof RegExp||t instanceof Function}),"isRegexOrFunction"),Rt=o((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt||Lt!==t){if(t&&"object"==typeof t||(t={}),t=_e(t),Et=-1===Ct.indexOf(t.PARSER_MEDIA_TYPE)?St:t.PARSER_MEDIA_TYPE,At="application/xhtml+xml"===Et?de:ue,$=ye(t,"ALLOWED_TAGS")?ke({},t.ALLOWED_TAGS,At):F,z=ye(t,"ALLOWED_ATTR")?ke({},t.ALLOWED_ATTR,At):U,bt=ye(t,"ALLOWED_NAMESPACES")?ke({},t.ALLOWED_NAMESPACES,de):wt,pt=ye(t,"ADD_URI_SAFE_ATTR")?ke(_e(gt),t.ADD_URI_SAFE_ATTR,At):gt,ut=ye(t,"ADD_DATA_URI_TAGS")?ke(_e(dt),t.ADD_DATA_URI_TAGS,At):dt,ct=ye(t,"FORBID_CONTENTS")?ke({},t.FORBID_CONTENTS,At):ht,q=ye(t,"FORBID_TAGS")?ke({},t.FORBID_TAGS,At):{},j=ye(t,"FORBID_ATTR")?ke({},t.FORBID_ATTR,At):{},lt=!!ye(t,"USE_PROFILES")&&t.USE_PROFILES,W=!1!==t.ALLOW_ARIA_ATTR,Y=!1!==t.ALLOW_DATA_ATTR,H=t.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,X=t.SAFE_FOR_TEMPLATES||!1,K=!1!==t.SAFE_FOR_XML,Z=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,rt=t.RETURN_TRUSTED_TYPE||!1,J=t.FORCE_BODY||!1,nt=!1!==t.SANITIZE_DOM,it=t.SANITIZE_NAMED_PROPS||!1,st=!1!==t.KEEP_CONTENT,ot=t.IN_PLACE||!1,B=t.ALLOWED_URI_REGEXP||Ge,vt=t.NAMESPACE||yt,kt=t.MATHML_TEXT_INTEGRATION_POINTS||kt,Tt=t.HTML_INTEGRATION_POINTS||Tt,G=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&It(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&It(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(G.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(Y=!1),et&&(tt=!0),lt&&($=ke({},Re),z=[],!0===lt.html&&(ke($,Ce),ke(z,Me)),!0===lt.svg&&(ke($,Se),ke(z,De),ke(z,Pe)),!0===lt.svgFilters&&(ke($,Ae),ke(z,De),ke(z,Pe)),!0===lt.mathMl&&(ke($,Ne),ke(z,Oe),ke(z,Pe))),t.ADD_TAGS&&($===F&&($=_e($)),ke($,t.ADD_TAGS,At)),t.ADD_ATTR&&(z===U&&(z=_e(z)),ke(z,t.ADD_ATTR,At)),t.ADD_URI_SAFE_ATTR&&ke(pt,t.ADD_URI_SAFE_ATTR,At),t.FORBID_CONTENTS&&(ct===ht&&(ct=_e(ct)),ke(ct,t.FORBID_CONTENTS,At)),st&&($["#text"]=!0),Z&&ke($,["html","head","body"]),$.table&&(ke($,["tbody"]),delete q.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=t.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=tr(g,i)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));ee&&ee(t),Lt=t}}),"_parseConfig"),Mt=ke({},[...Se,...Ae,...Le]),Dt=ke({},[...Ne,...Ie]),Ot=o((function(t){let e=b(t);e&&e.tagName||(e={namespaceURI:vt,tagName:"template"});const r=ue(t.tagName),n=ue(e.tagName);return!!bt[t.namespaceURI]&&(t.namespaceURI===mt?e.namespaceURI===yt?"svg"===r:e.namespaceURI===ft?"svg"===r&&("annotation-xml"===n||kt[n]):Boolean(Mt[r]):t.namespaceURI===ft?e.namespaceURI===yt?"math"===r:e.namespaceURI===mt?"math"===r&&Tt[n]:Boolean(Dt[r]):t.namespaceURI===yt?!(e.namespaceURI===mt&&!Tt[n])&&(!(e.namespaceURI===ft&&!kt[n])&&(!Dt[r]&&(_t[r]||!Mt[r]))):!("application/xhtml+xml"!==Et||!bt[t.namespaceURI]))}),"_checkValidNamespace"),Pt=o((function(t){ce(e.removed,{element:t});try{b(t).removeChild(t)}catch(e){y(t)}}),"_forceRemove"),Bt=o((function(t,r){try{ce(e.removed,{attribute:r.getAttributeNode(t),from:r})}catch(t){ce(e.removed,{attribute:null,from:r})}if(r.removeAttribute(t),"is"===t)if(tt||et)try{Pt(r)}catch(t){}else try{r.setAttribute(t,"")}catch(t){}}),"_removeAttribute"),$t=o((function(t){let e=null,n=null;if(J)t=""+t;else{const e=pe(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Et&&vt===yt&&(t=''+t+"");const i=w?w.createHTML(t):t;if(vt===yt)try{e=(new p).parseFromString(i,Et)}catch(t){}if(!e||!e.documentElement){e=T.createDocument(vt,"template",null);try{e.documentElement.innerHTML=xt?k:i}catch(t){}}const a=e.body||e.documentElement;return t&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),vt===yt?C.call(e,Z?"html":"body")[0]:Z?e.documentElement:a}),"_initDocument"),Ft=o((function(t){return _.call(t.ownerDocument||t,t,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)}),"_createNodeIterator"),zt=o((function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof u)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}),"_isClobbered"),Ut=o((function(t){return"function"==typeof l&&t instanceof l}),"_isNode");function Gt(t,r,n){se(t,(t=>{t.call(e,r,n,Lt)}))}o(Gt,"_executeHooks");const qt=o((function(t){let r=null;if(Gt(A.beforeSanitizeElements,t,null),zt(t))return Pt(t),!0;const n=At(t.nodeName);if(Gt(A.uponSanitizeElement,t,{tagName:n,allowedTags:$}),t.hasChildNodes()&&!Ut(t.firstElementChild)&&ve(/<[/\w]/g,t.innerHTML)&&ve(/<[/\w]/g,t.textContent))return Pt(t),!0;if(t.nodeType===Ke)return Pt(t),!0;if(K&&t.nodeType===Ze&&ve(/<[/\w]/g,t.data))return Pt(t),!0;if(!$[n]||q[n]){if(!q[n]&&Wt(n)){if(G.tagNameCheck instanceof RegExp&&ve(G.tagNameCheck,n))return!1;if(G.tagNameCheck instanceof Function&&G.tagNameCheck(n))return!1}if(st&&!ct[n]){const e=b(t)||t.parentNode,r=x(t)||t.childNodes;if(r&&e){for(let n=r.length-1;n>=0;--n){const i=m(r[n],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,v(t))}}}return Pt(t),!0}return t instanceof c&&!Ot(t)?(Pt(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!ve(/<\/no(script|embed|frames)/i,t.innerHTML)?(X&&t.nodeType===Xe&&(r=t.textContent,se([L,N,I],(t=>{r=ge(r,t," ")})),t.textContent!==r&&(ce(e.removed,{element:t.cloneNode()}),t.textContent=r)),Gt(A.afterSanitizeElements,t,null),!1):(Pt(t),!0)}),"_sanitizeElements"),jt=o((function(t,e,n){if(nt&&("id"===e||"name"===e)&&(n in r||n in Nt))return!1;if(Y&&!j[e]&&ve(R,e));else if(W&&ve(M,e));else if(!z[e]||j[e]){if(!(Wt(t)&&(G.tagNameCheck instanceof RegExp&&ve(G.tagNameCheck,t)||G.tagNameCheck instanceof Function&&G.tagNameCheck(t))&&(G.attributeNameCheck instanceof RegExp&&ve(G.attributeNameCheck,e)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(e))||"is"===e&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&ve(G.tagNameCheck,n)||G.tagNameCheck instanceof Function&&G.tagNameCheck(n))))return!1}else if(pt[e]);else if(ve(B,ge(n,O,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==fe(n,"data:")||!ut[t]){if(H&&!ve(D,ge(n,O,"")));else if(n)return!1}else;return!0}),"_isValidAttribute"),Wt=o((function(t){return"annotation-xml"!==t&&pe(t,P)}),"_isBasicCustomElement"),Yt=o((function(t){Gt(A.beforeSanitizeAttributes,t,null);const{attributes:r}=t;if(!r||zt(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let i=r.length;for(;i--;){const a=r[i],{name:s,namespaceURI:o,value:l}=a,c=At(s);let h="value"===s?l:me(l);if(n.attrName=c,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,Gt(A.uponSanitizeAttribute,t,n),h=n.attrValue,!it||"id"!==c&&"name"!==c||(Bt(s,t),h=at+h),K&&ve(/((--!?|])>)|<\/(style|title)/i,h)){Bt(s,t);continue}if(n.forceKeepAttr)continue;if(Bt(s,t),!n.keepAttr)continue;if(!V&&ve(/\/>/i,h)){Bt(s,t);continue}X&&se([L,N,I],(t=>{h=ge(h,t," ")}));const u=At(t.nodeName);if(jt(u,c,h)){if(w&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(o);else switch(g.getAttributeType(u,c)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}try{o?t.setAttributeNS(o,s,h):t.setAttribute(s,h),zt(t)?Pt(t):le(e.removed)}catch(t){}}}Gt(A.afterSanitizeAttributes,t,null)}),"_sanitizeAttributes"),Ht=o((function t(e){let r=null;const n=Ft(e);for(Gt(A.beforeSanitizeShadowDOM,e,null);r=n.nextNode();)Gt(A.uponSanitizeShadowNode,r,null),qt(r),Yt(r),r.content instanceof a&&t(r.content);Gt(A.afterSanitizeShadowDOM,e,null)}),"_sanitizeShadowDOM");return e.sanitize=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,s=null,o=null,c=null;if(xt=!t,xt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ut(t)){if("function"!=typeof t.toString)throw xe("toString is not a function");if("string"!=typeof(t=t.toString()))throw xe("dirty is not a string, aborting")}if(!e.isSupported)return t;if(Q||Rt(r),e.removed=[],"string"==typeof t&&(ot=!1),ot){if(t.nodeName){const e=At(t.nodeName);if(!$[e]||q[e])throw xe("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)i=$t("\x3c!----\x3e"),s=i.ownerDocument.importNode(t,!0),s.nodeType===Ve&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!tt&&!X&&!Z&&-1===t.indexOf("<"))return w&&rt?w.createHTML(t):t;if(i=$t(t),!i)return tt?null:rt?k:""}i&&J&&Pt(i.firstChild);const h=Ft(ot?t:i);for(;o=h.nextNode();)qt(o),Yt(o),o.content instanceof a&&Ht(o.content);if(ot)return t;if(tt){if(et)for(c=E.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(z.shadowroot||z.shadowrootmode)&&(c=S.call(n,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&$["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ve(We,i.ownerDocument.doctype.name)&&(u="\n"+u),X&&se([L,N,I],(t=>{u=ge(u,t," ")})),w&&rt?w.createHTML(u):u},e.setConfig=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Rt(t),Q=!0},e.clearConfig=function(){Lt=null,Q=!1},e.isValidAttribute=function(t,e,r){Lt||Rt({});const n=At(t),i=At(e);return jt(n,i,r)},e.addHook=function(t,e){"function"==typeof e&&ce(A[t],e)},e.removeHook=function(t,e){if(void 0!==e){const r=oe(A[t],e);return-1===r?void 0:he(A[t],r,1)[0]}return le(A[t])},e.removeHooks=function(t){A[t]=[]},e.removeAllHooks=function(){A=er()},e}o(rr,"createDOMPurify");var nr=rr(),ir=//gi,ar=o((t=>{if(!t)return[""];return fr(t).replace(/\\n/g,"#br#").split("#br#")}),"getRows"),sr=(()=>{let t=!1;return()=>{t||(or(),t=!0)}})();function or(){const t="data-temp-href-target";nr.addHook("beforeSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")})),nr.addHook("afterSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))}))}o(or,"setupDompurifyHooks");var lr=o((t=>{sr();return nr.sanitize(t)}),"removeScript"),cr=o(((t,e)=>{if(!1!==e.flowchart?.htmlLabels){const r=e.securityLevel;"antiscript"===r||"strict"===r?t=lr(t):"loose"!==r&&(t=(t=(t=fr(t)).replace(//g,">")).replace(/=/g,"="),t=gr(t))}return t}),"sanitizeMore"),hr=o(((t,e)=>t?t=e.dompurifyConfig?nr.sanitize(cr(t,e),e.dompurifyConfig).toString():nr.sanitize(cr(t,e),{FORBID_TAGS:["style"]}).toString():t),"sanitizeText"),ur=o(((t,e)=>"string"==typeof t?hr(t,e):t.flat().map((t=>hr(t,e)))),"sanitizeTextOrArray"),dr=o((t=>ir.test(t)),"hasBreaks"),pr=o((t=>t.split(ir)),"splitBreaks"),gr=o((t=>t.replace(/#br#/g,"
")),"placeholderToBreak"),fr=o((t=>t.replace(ir,"#br#")),"breakToPlaceholder"),mr=o((t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e}),"getUrl"),yr=o((t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),vr=o((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.max(...e)}),"getMax"),xr=o((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.min(...e)}),"getMin"),br=o((function(t){const e=t.split(/(,)/),r=[];for(let t=0;t0&&t+1Math.max(0,t.split(e).length-1)),"countOccurrence"),kr=o(((t,e)=>{const r=wr(t,"~"),n=wr(e,"~");return 1===r&&1===n}),"shouldCombineSets"),Tr=o((t=>{const e=wr(t,"~");let r=!1;if(e<=1)return t;e%2!=0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")}),"processSet"),_r=o((()=>void 0!==window.MathMLElement),"isMathMLSupported"),Er=/\$\$(.*)\$\$/g,Cr=o((t=>(t.match(Er)?.length??0)>0),"hasKatex"),Sr=o((async(t,e)=>{t=await Ar(t,e);const r=document.createElement("div");r.innerHTML=t,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";document.querySelector("body")?.insertAdjacentElement("beforeend",r);const n={width:r.clientWidth,height:r.clientHeight};return r.remove(),n}),"calculateMathMLDimensions"),Ar=o((async(t,e)=>{if(!Cr(t))return t;if(!(_r()||e.legacyMathML||e.forceLegacyMathML))return t.replace(Er,"MathML is unsupported in this environment.");const{default:r}=await Promise.resolve().then((function(){return $B})),n=e.forceLegacyMathML||!_r()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(ir).map((t=>Cr(t)?`
${t}
`:`
${t}
`)).join("").replace(Er,((t,e)=>r.renderToString(e,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,"")))}),"renderKatex"),Lr={getRows:ar,sanitizeText:hr,sanitizeTextOrArray:ur,hasBreaks:dr,splitBreaks:pr,lineBreakRegex:ir,removeScript:lr,getUrl:mr,evaluate:yr,getMax:vr,getMin:xr},Nr=o((function(t,e){for(let r of e)t.attr(r[0],r[1])}),"d3Attrs"),Ir=o((function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n}),"calculateSvgSizeAttrs"),Rr=o((function(t,e,r,n){const i=Ir(e,r,n);Nr(t,i)}),"configureSvgSize"),Mr=o((function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;y.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;y.info(`Graph bounds: ${o}x${l}`,t),o=a+2*r,l=s+2*r,y.info(`Calculated bounds: ${o}x${l}`),Rr(e,l,o,n);const c=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",c)}),"setupGraphViewbox"),Dr={},Or=o(((t,e,r)=>{let n="";return t in Dr&&Dr[t]?n=Dr[t](r):y.warn(`No theme found for ${t}`),` & {\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n fill: ${r.textColor}\n }\n @keyframes edge-animation-frame {\n from {\n stroke-dashoffset: 0;\n }\n }\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n & .edge-animation-slow {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 50s linear infinite;\n stroke-linecap: round;\n }\n & .edge-animation-fast {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 20s linear infinite;\n stroke-linecap: round;\n }\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${r.errorBkgColor};\n }\n & .error-text {\n fill: ${r.errorTextColor};\n stroke: ${r.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\n }\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${r.lineColor};\n stroke: ${r.lineColor};\n }\n & .marker.cross {\n stroke: ${r.lineColor};\n }\n\n & svg {\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${n}\n\n ${e}\n`}),"getStyles"),Pr=o(((t,e)=>{void 0!==e&&(Dr[t]=e)}),"addStylesForDiagram"),Br=Or,$r={};h($r,{clear:()=>qr,getAccDescription:()=>Hr,getAccTitle:()=>Wr,getDiagramTitle:()=>Xr,setAccDescription:()=>Yr,setAccTitle:()=>jr,setDiagramTitle:()=>Vr});var Fr="",zr="",Ur="",Gr=o((t=>hr(t,Gt())),"sanitizeText"),qr=o((()=>{Fr="",Ur="",zr=""}),"clear"),jr=o((t=>{Fr=Gr(t).replace(/^\s+/g,"")}),"setAccTitle"),Wr=o((()=>Fr),"getAccTitle"),Yr=o((t=>{Ur=Gr(t).replace(/\n\s+/g,"\n")}),"setAccDescription"),Hr=o((()=>Ur),"getAccDescription"),Vr=o((t=>{zr=Gr(t)}),"setDiagramTitle"),Xr=o((()=>zr),"getDiagramTitle"),Kr=y,Zr=v,Qr=Gt,Jr=Ut,tn=Rt,en=o((t=>hr(t,Qr())),"sanitizeText"),rn=Mr,nn=o((()=>$r),"getCommonDb"),an={},sn=o(((t,e,r)=>{an[t]&&Kr.warn(`Diagram with id ${t} already registered. Overwriting.`),an[t]=e,r&&S(t,r),Pr(t,e.styles),e.injectUtils?.(Kr,Zr,Qr,en,rn,nn(),(()=>{}))}),"registerDiagram"),on=o((t=>{if(t in an)return an[t];throw new ln(t)}),"getDiagram"),ln=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}};function cn(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r=i)&&(r=i)}return r}function hn(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function un(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function dn(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function pn(t){let e,r,n;function i(t,n,i=0,a=t.length){if(i>>1;r(t[e],n)<0?i=e+1:a=e}while(i>>1;r(t[e],n)<=0?i=e+1:a=e}while(ir&&n(t[s-1],e)>-n(t[s],e)?s-1:s}return 2!==t.length?(e=un,r=o(((e,r)=>un(t(e),r)),"compare2"),n=o(((e,r)=>t(e)-r),"delta")):(e=t===un||t===dn?t:gn,r=t,n=t),o(i,"left"),o(a,"right"),o(s,"center"),{left:i,center:s,right:a}}function gn(){return 0}function fn(t){return null===t?NaN:+t}o(cn,"max"),o(hn,"min"),o(un,"ascending"),o(dn,"descending"),o(pn,"bisector"),o(gn,"zero"),o(fn,"number");var mn=pn(un),yn=mn.right;mn.left,pn(fn).center;var vn=yn,xn=class extends Map{static{o(this,"InternMap")}constructor(t,e=Tn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,r]of t)this.set(e,r)}get(t){return super.get(bn(this,t))}has(t){return super.has(bn(this,t))}set(t,e){return super.set(wn(this,t),e)}delete(t){return super.delete(kn(this,t))}};function bn({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function wn({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function kn({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Tn(t){return null!==t&&"object"==typeof t?t.valueOf():t}o(bn,"intern_get"),o(wn,"intern_set"),o(kn,"intern_delete"),o(Tn,"keyof");var _n=Math.sqrt(50),En=Math.sqrt(10),Cn=Math.sqrt(2);function Sn(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=_n?10:a>=En?5:a>=Cn?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/s,o=Math.round(t*c),l=Math.round(e*c),o/ce&&--l,c=-c):(c=Math.pow(10,i)*s,o=Math.round(t/c),l=Math.round(e/c),o*ce&&--l),l0))return[];if((t=+t)===(e=+e))return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let t=0;t+t(e)}function Bn(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function $n(){return!this.__axis}function Fn(t,e){var r=[],n=null,i=null,a=6,s=6,l=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,h=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",d=1===t||3===t?Dn:On;function p(o){var p=null==n?e.ticks?e.ticks.apply(e,r):e.domain():n,g=null==i?e.tickFormat?e.tickFormat.apply(e,r):Rn:i,f=Math.max(a,0)+l,m=e.range(),y=+m[0]+c,v=+m[m.length-1]+c,x=(e.bandwidth?Bn:Pn)(e.copy(),c),b=o.selection?o.selection():o,w=b.selectAll(".domain").data([null]),k=b.selectAll(".tick").data(p,e).order(),T=k.exit(),_=k.enter().append("g").attr("class","tick"),E=k.select("line"),C=k.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(_),E=E.merge(_.append("line").attr("stroke","currentColor").attr(u+"2",h*a)),C=C.merge(_.append("text").attr("fill","currentColor").attr(u,h*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),o!==b&&(w=w.transition(o),k=k.transition(o),E=E.transition(o),C=C.transition(o),T=T.transition(o).attr("opacity",Mn).attr("transform",(function(t){return isFinite(t=x(t))?d(t+c):this.getAttribute("transform")})),_.attr("opacity",Mn).attr("transform",(function(t){var e=this.parentNode.__axis;return d((e&&isFinite(e=e(t))?e:x(t))+c)}))),T.remove(),w.attr("d",4===t||2===t?s?"M"+h*s+","+y+"H"+c+"V"+v+"H"+h*s:"M"+c+","+y+"V"+v:s?"M"+y+","+h*s+"V"+c+"H"+v+"V"+h*s:"M"+y+","+c+"H"+v),k.attr("opacity",1).attr("transform",(function(t){return d(x(t)+c)})),E.attr(u+"2",h*a),C.attr(u,h*f).text(g),b.filter($n).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each((function(){this.__axis=x}))}return o(p,"axis"),p.scale=function(t){return arguments.length?(e=t,p):e},p.ticks=function(){return r=Array.from(arguments),p},p.tickArguments=function(t){return arguments.length?(r=null==t?[]:Array.from(t),p):r.slice()},p.tickValues=function(t){return arguments.length?(n=null==t?null:Array.from(t),p):n&&n.slice()},p.tickFormat=function(t){return arguments.length?(i=t,p):i},p.tickSize=function(t){return arguments.length?(a=s=+t,p):a},p.tickSizeInner=function(t){return arguments.length?(a=+t,p):a},p.tickSizeOuter=function(t){return arguments.length?(s=+t,p):s},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p.offset=function(t){return arguments.length?(c=+t,p):c},p}function zn(t){return Fn(1,t)}function Un(t){return Fn(3,t)}function Gn(){}function qn(t){return null==t?Gn:function(){return this.querySelector(t)}}function jn(t){"function"!=typeof t&&(t=qn(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=w&&(w=b+1);!(x=m[w])&&++w=0;)(n=i[a])&&(s&&4^n.compareDocumentPosition(s)&&s.parentNode.insertBefore(n,s),s=n);return this}function bi(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=wi),o(e,"compareNode");for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function ki(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ti(){return Array.from(this)}function _i(){for(var t=this._groups,e=0,r=t.length;e=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),Li.hasOwnProperty(e)?{space:Li[e],local:t}:t}function Ii(t){return function(){this.removeAttribute(t)}}function Ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Mi(t,e){return function(){this.setAttribute(t,e)}}function Di(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Oi(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function Pi(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Bi(t,e){var r=Ni(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?Ri:Ii:"function"==typeof e?r.local?Pi:Oi:r.local?Di:Mi)(r,e))}function $i(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fi(t){return function(){this.style.removeProperty(t)}}function zi(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Ui(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function Gi(t,e,r){return arguments.length>1?this.each((null==e?Fi:"function"==typeof e?Ui:zi)(t,e,null==r?"":r)):qi(this.node(),t)}function qi(t,e){return t.style.getPropertyValue(e)||$i(t).getComputedStyle(t,null).getPropertyValue(e)}function ji(t){return function(){delete this[t]}}function Wi(t,e){return function(){this[t]=e}}function Yi(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function Hi(t,e){return arguments.length>1?this.each((null==e?ji:"function"==typeof e?Yi:Wi)(t,e)):this.node()[t]}function Vi(t){return t.trim().split(/^|\s+/)}function Xi(t){return t.classList||new Ki(t)}function Ki(t){this._node=t,this._names=Vi(t.getAttribute("class")||"")}function Zi(t,e){for(var r=Xi(t),n=-1,i=e.length;++n=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}function La(t){return function(){var e=this.__on;if(e){for(var r,n=0,i=-1,a=e.length;n=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))}),"remove"),contains:o((function(t){return this._names.indexOf(t)>=0}),"contains")},o(Zi,"classedAdd"),o(Qi,"classedRemove"),o(Ji,"classedTrue"),o(ta,"classedFalse"),o(ea,"classedFunction"),o(ra,"default"),o(na,"textRemove"),o(ia,"textConstant"),o(aa,"textFunction"),o(sa,"default"),o(oa,"htmlRemove"),o(la,"htmlConstant"),o(ca,"htmlFunction"),o(ha,"default"),o(ua,"raise"),o(da,"default"),o(pa,"lower"),o(ga,"default"),o(fa,"creatorInherit"),o(ma,"creatorFixed"),o(ya,"default"),o(va,"default"),o(xa,"constantNull"),o(ba,"default"),o(wa,"remove"),o(ka,"default"),o(Ta,"selection_cloneShallow"),o(_a,"selection_cloneDeep"),o(Ea,"default"),o(Ca,"default"),o(Sa,"contextListener"),o(Aa,"parseTypenames"),o(La,"onRemove"),o(Na,"onAdd"),o(Ia,"default"),o(Ra,"dispatchEvent"),o(Ma,"dispatchConstant"),o(Da,"dispatchFunction"),o(Oa,"default"),o(Pa,"default");var Ba=[null];function $a(t,e){this._groups=t,this._parents=e}function Fa(){return new $a([[document.documentElement]],Ba)}function za(){return this}o($a,"Selection"),o(Fa,"selection"),o(za,"selection_selection"),$a.prototype=Fa.prototype={constructor:$a,select:jn,selectAll:Xn,selectChild:ei,selectChildren:ai,filter:si,data:gi,enter:li,exit:mi,join:yi,merge:vi,selection:za,order:xi,sort:bi,call:ki,nodes:Ti,node:_i,size:Ei,empty:Ci,each:Si,attr:Bi,style:Gi,property:Hi,classed:ra,text:sa,html:ha,raise:da,lower:ga,append:va,insert:ba,remove:ka,clone:Ea,datum:Ca,on:Ia,dispatch:Oa,[Symbol.iterator]:Pa};var Ua=Fa;function Ga(t){return"string"==typeof t?new $a([[document.querySelector(t)]],[document.documentElement]):new $a([[t]],Ba)}function qa(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function ja(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Wa(){}o(Ga,"default"),o(qa,"default"),o(ja,"extend"),o(Wa,"Color");var Ya=.7,Ha=1/Ya,Va="\\s*([+-]?\\d+)\\s*",Xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ka="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Za=/^#([0-9a-f]{3,8})$/,Qa=new RegExp(`^rgb\\(${Va},${Va},${Va}\\)$`),Ja=new RegExp(`^rgb\\(${Ka},${Ka},${Ka}\\)$`),ts=new RegExp(`^rgba\\(${Va},${Va},${Va},${Xa}\\)$`),es=new RegExp(`^rgba\\(${Ka},${Ka},${Ka},${Xa}\\)$`),rs=new RegExp(`^hsl\\(${Xa},${Ka},${Ka}\\)$`),ns=new RegExp(`^hsla\\(${Xa},${Ka},${Ka},${Xa}\\)$`),is={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};function as(){return this.rgb().formatHex()}function ss(){return this.rgb().formatHex8()}function os(){return ks(this).formatHsl()}function ls(){return this.rgb().formatRgb()}function cs(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Za.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?hs(e):3===r?new gs(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?us(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?us(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Qa.exec(t))?new gs(e[1],e[2],e[3],1):(e=Ja.exec(t))?new gs(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ts.exec(t))?us(e[1],e[2],e[3],e[4]):(e=es.exec(t))?us(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rs.exec(t))?ws(e[1],e[2]/100,e[3]/100,1):(e=ns.exec(t))?ws(e[1],e[2]/100,e[3]/100,e[4]):is.hasOwnProperty(t)?hs(is[t]):"transparent"===t?new gs(NaN,NaN,NaN,0):null}function hs(t){return new gs(t>>16&255,t>>8&255,255&t,1)}function us(t,e,r,n){return n<=0&&(t=e=r=NaN),new gs(t,e,r,n)}function ds(t){return t instanceof Wa||(t=cs(t)),t?new gs((t=t.rgb()).r,t.g,t.b,t.opacity):new gs}function ps(t,e,r,n){return 1===arguments.length?ds(t):new gs(t,e,r,null==n?1:n)}function gs(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function fs(){return`#${bs(this.r)}${bs(this.g)}${bs(this.b)}`}function ms(){return`#${bs(this.r)}${bs(this.g)}${bs(this.b)}${bs(255*(isNaN(this.opacity)?1:this.opacity))}`}function ys(){const t=vs(this.opacity);return`${1===t?"rgb(":"rgba("}${xs(this.r)}, ${xs(this.g)}, ${xs(this.b)}${1===t?")":`, ${t})`}`}function vs(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bs(t){return((t=xs(t))<16?"0":"")+t.toString(16)}function ws(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _s(t,e,r,n)}function ks(t){if(t instanceof _s)return new _s(t.h,t.s,t.l,t.opacity);if(t instanceof Wa||(t=cs(t)),!t)return new _s;if(t instanceof _s)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(s=e===a?(r-n)/o+6*(r0&&l<1?0:s,new _s(s,o,l,t.opacity)}function Ts(t,e,r,n){return 1===arguments.length?ks(t):new _s(t,e,r,null==n?1:n)}function _s(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Es(t){return(t=(t||0)%360)<0?t+360:t}function Cs(t){return Math.max(0,Math.min(1,t||0))}function Ss(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}qa(Wa,cs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:as,formatHex:as,formatHex8:ss,formatHsl:os,formatRgb:ls,toString:ls}),o(as,"color_formatHex"),o(ss,"color_formatHex8"),o(os,"color_formatHsl"),o(ls,"color_formatRgb"),o(cs,"color"),o(hs,"rgbn"),o(us,"rgba"),o(ds,"rgbConvert"),o(ps,"rgb"),o(gs,"Rgb"),qa(gs,ps,ja(Wa,{brighter(t){return t=null==t?Ha:Math.pow(Ha,t),new gs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ya:Math.pow(Ya,t),new gs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new gs(xs(this.r),xs(this.g),xs(this.b),vs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fs,formatHex:fs,formatHex8:ms,formatRgb:ys,toString:ys})),o(fs,"rgb_formatHex"),o(ms,"rgb_formatHex8"),o(ys,"rgb_formatRgb"),o(vs,"clampa"),o(xs,"clampi"),o(bs,"hex"),o(ws,"hsla"),o(ks,"hslConvert"),o(Ts,"hsl"),o(_s,"Hsl"),qa(_s,Ts,ja(Wa,{brighter(t){return t=null==t?Ha:Math.pow(Ha,t),new _s(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ya:Math.pow(Ya,t),new _s(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new gs(Ss(t>=240?t-240:t+120,i,n),Ss(t,i,n),Ss(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new _s(Es(this.h),Cs(this.s),Cs(this.l),vs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=vs(this.opacity);return`${1===t?"hsl(":"hsla("}${Es(this.h)}, ${100*Cs(this.s)}%, ${100*Cs(this.l)}%${1===t?")":`, ${t})`}`}})),o(Es,"clamph"),o(Cs,"clampt"),o(Ss,"hsl2rgb");var As=Math.PI/180,Ls=180/Math.PI,Ns=.96422,Is=.82521,Rs=4/29,Ms=6/29,Ds=3*Ms*Ms;function Os(t){if(t instanceof Bs)return new Bs(t.l,t.a,t.b,t.opacity);if(t instanceof js)return Ws(t);t instanceof gs||(t=ds(t));var e,r,n=Us(t.r),i=Us(t.g),a=Us(t.b),s=$s((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=s:(e=$s((.4360747*n+.3850649*i+.1430804*a)/Ns),r=$s((.0139322*n+.0971045*i+.7141733*a)/Is)),new Bs(116*s-16,500*(e-s),200*(s-r),t.opacity)}function Ps(t,e,r,n){return 1===arguments.length?Os(t):new Bs(t,e,r,null==n?1:n)}function Bs(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function $s(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ds+Rs}function Fs(t){return t>Ms?t*t*t:Ds*(t-Rs)}function zs(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Us(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gs(t){if(t instanceof js)return new js(t.h,t.c,t.l,t.opacity);if(t instanceof Bs||(t=Os(t)),0===t.a&&0===t.b)return new js(NaN,0()=>t),"default");function Hs(t,e){return function(r){return t+r*e}}function Vs(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Xs(t,e){var r=e-t;return r?Hs(t,r>180||r<-180?r-360*Math.round(r/360):r):Ys(isNaN(t)?e:t)}function Ks(t){return 1==(t=+t)?Zs:function(e,r){return r-e?Vs(e,r,t):Ys(isNaN(e)?r:e)}}function Zs(t,e){var r=e-t;return r?Hs(t,r):Ys(isNaN(t)?e:t)}function Qs(t){return function(e,r){var n=t((e=qs(e)).h,(r=qs(r)).h),i=Zs(e.c,r.c),a=Zs(e.l,r.l),s=Zs(e.opacity,r.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=a(t),e.opacity=s(t),e+""}}}o(Hs,"linear"),o(Vs,"exponential"),o(Xs,"hue"),o(Ks,"gamma"),o(Zs,"nogamma"),o(Qs,"hcl");var Js=Qs(Xs);function to(t,e,r,n,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*r+(1+3*t+3*a-3*s)*n+s*i)/6}o(to,"basis"),o((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],s=n>0?t[n-1]:2*i-a,o=na&&(i=e.slice(a,i),o[s]?o[s]+=i:o[++s]=i),(r=r[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,l.push({i:s,x:so(r,n)})),a=co.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:so(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}function l(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:so(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}function c(t,e,r,n,a,s){if(t!==r||e!==n){var o=a.push(i(a)+"scale(",null,",",null,")");s.push({i:o-4,x:so(t,r)},{i:o-2,x:so(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}return o(i,"pop"),o(a,"translate"),o(s,"rotate"),o(l,"skewX"),o(c,"scale"),function(e,r){var n=[],i=[];return e=t(e),r=t(r),a(e.translateX,e.translateY,r.translateX,r.translateY,n,i),s(e.rotate,r.rotate,n,i),l(e.skewX,r.skewX,n,i),c(e.scaleX,e.scaleY,r.scaleX,r.scaleY,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++re&&(r=t,t=e,e=r),function(r){return Math.max(t,Math.min(e,r))}}function Do(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?Oo:Do,i=a=null,d}function d(e){return null==e||isNaN(e=+e)?r:(i||(i=n(s.map(t),l,c)))(t(h(e)))}return o(u,"rescale"),o(d,"scale"),d.invert=function(r){return h(e((a||(a=n(l,s.map(t),so)))(r)))},d.domain=function(t){return arguments.length?(s=Array.from(t,Lo),u()):s.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),u()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),c=fo,u()},d.clamp=function(t){return arguments.length?(h=!!t||Io,u()):h!==Io},d.interpolate=function(t){return arguments.length?(c=t,u()):c},d.unknown=function(t){return arguments.length?(r=t,d):r},function(r,n){return t=r,e=n,u()}}function $o(){return Bo()(Io,Io)}function Fo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function zo(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Uo(t){return(t=zo(Math.abs(t)))?t[1]:NaN}function Go(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function qo(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}o(Io,"identity"),o(Ro,"normalize"),o(Mo,"clamper"),o(Do,"bimap"),o(Oo,"polymap"),o(Po,"copy"),o(Bo,"transformer"),o($o,"continuous"),o(Fo,"default"),o(zo,"formatDecimalParts"),o(Uo,"default"),o(Go,"default"),o(qo,"default");var jo,Wo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Yo(t){if(!(e=Wo.exec(t)))throw new Error("invalid format: "+t);var e;return new Ho({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ho(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Vo(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}function Xo(t,e){var r=zo(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(jo=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+zo(t,Math.max(0,e+a-1))[0]}function Ko(t,e){var r=zo(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}o(Yo,"formatSpecifier"),Yo.prototype=Ho.prototype,o(Ho,"FormatSpecifier"),Ho.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},o(Vo,"default"),o(Xo,"default"),o(Ko,"default");var Zo={"%":o(((t,e)=>(100*t).toFixed(e)),"%"),b:o((t=>Math.round(t).toString(2)),"b"),c:o((t=>t+""),"c"),d:Fo,e:o(((t,e)=>t.toExponential(e)),"e"),f:o(((t,e)=>t.toFixed(e)),"f"),g:o(((t,e)=>t.toPrecision(e)),"g"),o:o((t=>Math.round(t).toString(8)),"o"),p:o(((t,e)=>Ko(100*t,e)),"p"),r:Ko,s:Xo,X:o((t=>Math.round(t).toString(16).toUpperCase()),"X"),x:o((t=>Math.round(t).toString(16)),"x")};function Qo(t){return t}o(Qo,"default");var Jo,tl,el,rl=Array.prototype.map,nl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function il(t){var e=void 0===t.grouping||void 0===t.thousands?Qo:Go(rl.call(t.grouping,Number),t.thousands+""),r=void 0===t.currency?"":t.currency[0]+"",n=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Qo:qo(rl.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var h=(t=Yo(t)).fill,u=t.align,d=t.sign,p=t.symbol,g=t.zero,f=t.width,m=t.comma,y=t.precision,v=t.trim,x=t.type;"n"===x?(m=!0,x="g"):Zo[x]||(void 0===y&&(y=12),v=!0,x="g"),(g||"0"===h&&"="===u)&&(g=!0,h="0",u="=");var b="$"===p?r:"#"===p&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w="$"===p?n:/[%p]/.test(x)?s:"",k=Zo[x],T=/[defgprs%]/.test(x);function _(t){var r,n,s,o=b,p=w;if("c"===x)p=k(t)+p,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:k(Math.abs(t),y),v&&(t=Vo(t)),_&&0==+t&&"+"!==d&&(_=!1),o=(_?"("===d?d:l:"-"===d||"("===d?"":d)+o,p=("s"===x?nl[8+jo/3]:"")+p+(_&&"("===d?")":""),T)for(r=-1,n=t.length;++r(s=t.charCodeAt(r))||s>57){p=(46===s?i+t.slice(r+1):t.slice(r))+p,t=t.slice(0,r);break}}m&&!g&&(t=e(t,1/0));var E=o.length+t.length+p.length,C=E>1)+o+t+p+C.slice(E);break;default:t=C+o+t+p}return a(t)}return y=void 0===y?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),o(_,"format"),_.toString=function(){return t+""},_}function u(t,e){var r=h(((t=Yo(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(Uo(e)/3))),i=Math.pow(10,-n),a=nl[8+n/3];return function(t){return r(i*t)+a}}return o(h,"newFormat"),o(u,"formatPrefix"),{format:h,formatPrefix:u}}function al(t){return Jo=il(t),tl=Jo.format,el=Jo.formatPrefix,Jo}function sl(t){return Math.max(0,-Uo(Math.abs(t)))}function ol(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Uo(e)/3)))-Uo(Math.abs(t)))}function ll(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Uo(e)-Uo(t))+1}function cl(t,e,r,n){var i,a=Nn(t,e,r);switch((n=Yo(null==n?",f":n)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(i=ol(a,s))||(n.precision=i),el(n,s);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=ll(a,Math.max(Math.abs(t),Math.abs(e))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=sl(a))||(n.precision=i-2*("%"===n.type))}return tl(n)}function hl(t){var e=t.domain;return t.ticks=function(t){var r=e();return An(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return cl(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,i,a=e(),s=0,o=a.length-1,l=a[s],c=a[o],h=10;for(c0;){if((i=Ln(l,c,r))===n)return a[s]=l,a[o]=c,e(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}n=i}return t},t}function ul(){var t=$o();return t.copy=function(){return Po(t,ul())},Eo.apply(t,arguments),hl(t)}o(il,"default"),al({thousands:",",grouping:[3],currency:["$",""]}),o(al,"defaultLocale"),o(sl,"default"),o(ol,"default"),o(ll,"default"),o(cl,"tickFormat"),o(hl,"linearish"),o(ul,"linear");var dl=new Date,pl=new Date;function gl(t,e,r,n){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return o(i,"interval"),i.floor=e=>(t(e=new Date(+e)),e),i.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),i.round=t=>{const e=i(t),r=i.ceil(t);return t-e(e(t=new Date(+t),null==r?1:Math.floor(r)),t),i.range=(r,n,a)=>{const s=[];if(r=i.ceil(r),a=null==a?1:Math.floor(a),!(r0))return s;let o;do{s.push(o=new Date(+r)),e(r,a),t(r)}while(ogl((e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),((t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););})),r&&(i.count=(e,n)=>(dl.setTime(+e),pl.setTime(+n),t(dl),t(pl),Math.floor(r(dl,pl))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?e=>n(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}o(gl,"timeInterval");var fl=gl((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));fl.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?gl((e=>{e.setTime(Math.floor(e/t)*t)}),((e,r)=>{e.setTime(+e+r*t)}),((e,r)=>(r-e)/t)):fl:null),fl.range;var ml=1e3,yl=6e4,vl=36e5,xl=864e5,bl=6048e5,wl=2592e6,kl=31536e6,Tl=gl((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*ml)}),((t,e)=>(e-t)/ml),(t=>t.getUTCSeconds()));Tl.range;var _l=gl((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ml)}),((t,e)=>{t.setTime(+t+e*yl)}),((t,e)=>(e-t)/yl),(t=>t.getMinutes()));_l.range;var El=gl((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*yl)}),((t,e)=>(e-t)/yl),(t=>t.getUTCMinutes()));El.range;var Cl=gl((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ml-t.getMinutes()*yl)}),((t,e)=>{t.setTime(+t+e*vl)}),((t,e)=>(e-t)/vl),(t=>t.getHours()));Cl.range;var Sl=gl((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*vl)}),((t,e)=>(e-t)/vl),(t=>t.getUTCHours()));Sl.range;var Al=gl((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yl)/xl),(t=>t.getDate()-1));Al.range;var Ll=gl((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/xl),(t=>t.getUTCDate()-1));Ll.range;var Nl=gl((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/xl),(t=>Math.floor(t/xl)));function Il(t){return gl((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yl)/bl))}Nl.range,o(Il,"timeWeekday");var Rl=Il(0),Ml=Il(1),Dl=Il(2),Ol=Il(3),Pl=Il(4),Bl=Il(5),$l=Il(6);function Fl(t){return gl((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/bl))}Rl.range,Ml.range,Dl.range,Ol.range,Pl.range,Bl.range,$l.range,o(Fl,"utcWeekday");var zl=Fl(0),Ul=Fl(1),Gl=Fl(2),ql=Fl(3),jl=Fl(4),Wl=Fl(5),Yl=Fl(6);zl.range,Ul.range,Gl.range,ql.range,jl.range,Wl.range,Yl.range;var Hl=gl((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));Hl.range;var Vl=gl((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Vl.range;var Xl=gl((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));Xl.every=t=>isFinite(t=Math.floor(t))&&t>0?gl((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,r)=>{e.setFullYear(e.getFullYear()+r*t)})):null,Xl.range;var Kl=gl((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function Zl(t,e,r,n,i,a){const s=[[Tl,1,ml],[Tl,5,5e3],[Tl,15,15e3],[Tl,30,3e4],[a,1,yl],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,vl],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,xl],[n,2,1728e5],[r,1,bl],[e,1,wl],[e,3,7776e6],[t,1,kl]];function l(t,e,r){const n=et)).right(s,i);if(a===s.length)return t.every(Nn(e/kl,r/kl,n));if(0===a)return fl.every(Math.max(Nn(e,r,n),1));const[o,l]=s[i/s[a-1][2]isFinite(t=Math.floor(t))&&t>0?gl((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null,Kl.range,o(Zl,"ticker"),Zl(Kl,Vl,zl,Nl,Sl,El);var[Ql,Jl]=Zl(Xl,Hl,Rl,Al,Cl,_l);function tc(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ec(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function rc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function nc(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,c=t.shortMonths,h=dc(i),u=pc(i),d=dc(a),p=pc(a),g=dc(s),f=pc(s),m=dc(l),y=pc(l),v=dc(c),x=pc(c),b={a:D,A:O,b:P,B:B,c:null,d:Dc,e:Dc,f:Fc,g:Kc,G:Qc,H:Oc,I:Pc,j:Bc,L:$c,m:zc,M:Uc,p:$,q:F,Q:wh,s:kh,S:Gc,u:qc,U:jc,V:Yc,w:Hc,W:Vc,x:null,X:null,y:Xc,Y:Zc,Z:Jc,"%":bh},w={a:z,A:U,b:G,B:q,c:null,d:th,e:th,f:ah,g:mh,G:vh,H:eh,I:rh,j:nh,L:ih,m:sh,M:oh,p:j,q:W,Q:wh,s:kh,S:lh,u:ch,U:hh,V:dh,w:ph,W:gh,x:null,X:null,y:fh,Y:yh,Z:xh,"%":bh},k={a:S,A:A,b:L,B:N,c:I,d:_c,e:_c,f:Nc,g:bc,G:xc,H:Cc,I:Cc,j:Ec,L:Lc,m:Tc,M:Sc,p:C,q:kc,Q:Rc,s:Mc,S:Ac,u:fc,U:mc,V:yc,w:gc,W:vc,x:R,X:M,y:bc,Y:xc,Z:wc,"%":Ic};function T(t,e){return function(r){var n,i,a,s=[],o=-1,l=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++o53)return null;"w"in a||(a.w=1),"Z"in a?(i=(n=ec(rc(a.y,0,1))).getUTCDay(),n=i>4||0===i?Ul.ceil(n):Ul(n),n=Ll.offset(n,7*(a.V-1)),a.y=n.getUTCFullYear(),a.m=n.getUTCMonth(),a.d=n.getUTCDate()+(a.w+6)%7):(i=(n=tc(rc(a.y,0,1))).getDay(),n=i>4||0===i?Ml.ceil(n):Ml(n),n=Al.offset(n,7*(a.V-1)),a.y=n.getFullYear(),a.m=n.getMonth(),a.d=n.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?ec(rc(a.y,0,1)).getUTCDay():tc(rc(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,ec(a)):tc(a)}}function E(t,e,r,n){for(var i,a,s=0,o=e.length,l=r.length;s=l)return-1;if(37===(i=e.charCodeAt(s++))){if(i=e.charAt(s++),!(a=k[i in sc?e.charAt(s++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function C(t,e,r){var n=h.exec(e.slice(r));return n?(t.p=u.get(n[0].toLowerCase()),r+n[0].length):-1}function S(t,e,r){var n=g.exec(e.slice(r));return n?(t.w=f.get(n[0].toLowerCase()),r+n[0].length):-1}function A(t,e,r){var n=d.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1}function L(t,e,r){var n=v.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1}function N(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1}function I(t,r,n){return E(t,e,r,n)}function R(t,e,n){return E(t,r,e,n)}function M(t,e,r){return E(t,n,e,r)}function D(t){return s[t.getDay()]}function O(t){return a[t.getDay()]}function P(t){return c[t.getMonth()]}function B(t){return l[t.getMonth()]}function $(t){return i[+(t.getHours()>=12)]}function F(t){return 1+~~(t.getMonth()/3)}function z(t){return s[t.getUTCDay()]}function U(t){return a[t.getUTCDay()]}function G(t){return c[t.getUTCMonth()]}function q(t){return l[t.getUTCMonth()]}function j(t){return i[+(t.getUTCHours()>=12)]}function W(t){return 1+~~(t.getUTCMonth()/3)}return b.x=T(r,b),b.X=T(n,b),b.c=T(e,b),w.x=T(r,w),w.X=T(n,w),w.c=T(e,w),o(T,"newFormat"),o(_,"newParse"),o(E,"parseSpecifier"),o(C,"parsePeriod"),o(S,"parseShortWeekday"),o(A,"parseWeekday"),o(L,"parseShortMonth"),o(N,"parseMonth"),o(I,"parseLocaleDateTime"),o(R,"parseLocaleDate"),o(M,"parseLocaleTime"),o(D,"formatShortWeekday"),o(O,"formatWeekday"),o(P,"formatShortMonth"),o(B,"formatMonth"),o($,"formatPeriod"),o(F,"formatQuarter"),o(z,"formatUTCShortWeekday"),o(U,"formatUTCWeekday"),o(G,"formatUTCShortMonth"),o(q,"formatUTCMonth"),o(j,"formatUTCPeriod"),o(W,"formatUTCQuarter"),{format:o((function(t){var e=T(t+="",b);return e.toString=function(){return t},e}),"format"),parse:o((function(t){var e=_(t+="",!1);return e.toString=function(){return t},e}),"parse"),utcFormat:o((function(t){var e=T(t+="",w);return e.toString=function(){return t},e}),"utcFormat"),utcParse:o((function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}),"utcParse")}}o(tc,"localDate"),o(ec,"utcDate"),o(rc,"newDate"),o(nc,"formatLocale");var ic,ac,sc={"-":"",_:" ",0:"0"},oc=/^\s*\d+/,lc=/^%/,cc=/[\\^$*+?|[\]().{}]/g;function hc(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[t.toLowerCase(),e])))}function gc(t,e,r){var n=oc.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function fc(t,e,r){var n=oc.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function mc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function yc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function vc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function xc(t,e,r){var n=oc.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function bc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function wc(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function kc(t,e,r){var n=oc.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function Tc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function _c(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ec(t,e,r){var n=oc.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Cc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Sc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Ac(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Lc(t,e,r){var n=oc.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Nc(t,e,r){var n=oc.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ic(t,e,r){var n=lc.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Rc(t,e,r){var n=oc.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Mc(t,e,r){var n=oc.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Dc(t,e){return hc(t.getDate(),e,2)}function Oc(t,e){return hc(t.getHours(),e,2)}function Pc(t,e){return hc(t.getHours()%12||12,e,2)}function Bc(t,e){return hc(1+Al.count(Xl(t),t),e,3)}function $c(t,e){return hc(t.getMilliseconds(),e,3)}function Fc(t,e){return $c(t,e)+"000"}function zc(t,e){return hc(t.getMonth()+1,e,2)}function Uc(t,e){return hc(t.getMinutes(),e,2)}function Gc(t,e){return hc(t.getSeconds(),e,2)}function qc(t){var e=t.getDay();return 0===e?7:e}function jc(t,e){return hc(Rl.count(Xl(t)-1,t),e,2)}function Wc(t){var e=t.getDay();return e>=4||0===e?Pl(t):Pl.ceil(t)}function Yc(t,e){return t=Wc(t),hc(Pl.count(Xl(t),t)+(4===Xl(t).getDay()),e,2)}function Hc(t){return t.getDay()}function Vc(t,e){return hc(Ml.count(Xl(t)-1,t),e,2)}function Xc(t,e){return hc(t.getFullYear()%100,e,2)}function Kc(t,e){return hc((t=Wc(t)).getFullYear()%100,e,2)}function Zc(t,e){return hc(t.getFullYear()%1e4,e,4)}function Qc(t,e){var r=t.getDay();return hc((t=r>=4||0===r?Pl(t):Pl.ceil(t)).getFullYear()%1e4,e,4)}function Jc(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hc(e/60|0,"0",2)+hc(e%60,"0",2)}function th(t,e){return hc(t.getUTCDate(),e,2)}function eh(t,e){return hc(t.getUTCHours(),e,2)}function rh(t,e){return hc(t.getUTCHours()%12||12,e,2)}function nh(t,e){return hc(1+Ll.count(Kl(t),t),e,3)}function ih(t,e){return hc(t.getUTCMilliseconds(),e,3)}function ah(t,e){return ih(t,e)+"000"}function sh(t,e){return hc(t.getUTCMonth()+1,e,2)}function oh(t,e){return hc(t.getUTCMinutes(),e,2)}function lh(t,e){return hc(t.getUTCSeconds(),e,2)}function ch(t){var e=t.getUTCDay();return 0===e?7:e}function hh(t,e){return hc(zl.count(Kl(t)-1,t),e,2)}function uh(t){var e=t.getUTCDay();return e>=4||0===e?jl(t):jl.ceil(t)}function dh(t,e){return t=uh(t),hc(jl.count(Kl(t),t)+(4===Kl(t).getUTCDay()),e,2)}function ph(t){return t.getUTCDay()}function gh(t,e){return hc(Ul.count(Kl(t)-1,t),e,2)}function fh(t,e){return hc(t.getUTCFullYear()%100,e,2)}function mh(t,e){return hc((t=uh(t)).getUTCFullYear()%100,e,2)}function yh(t,e){return hc(t.getUTCFullYear()%1e4,e,4)}function vh(t,e){var r=t.getUTCDay();return hc((t=r>=4||0===r?jl(t):jl.ceil(t)).getUTCFullYear()%1e4,e,4)}function xh(){return"+0000"}function bh(){return"%"}function wh(t){return+t}function kh(t){return Math.floor(+t/1e3)}function Th(t){return ic=nc(t),ac=ic.format,ic.parse,ic.utcFormat,ic.utcParse,ic}function _h(t,e){var r,n=0,i=(t=t.slice()).length-1,a=t[n],s=t[i];return s1?0:t<-1?Uh:Math.acos(t)}function Wh(t){return t>=1?Gh:t<=-1?-Gh:Math.asin(t)}o(jh,"acos"),o(Wh,"asin");var Yh=Math.PI,Hh=2*Yh,Vh=1e-6,Xh=Hh-Vh;function Kh(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Kh;const r=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;eVh)if(Math.abs(h*o-l*c)>Vh&&i){let d=r-a,p=n-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan((Yh-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>Vh&&this._append`L${t+x*c},${e+x*h}`,this._append`A${i},${i},0,0,${+(h*d>c*p)},${this._x1=t+b*o},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,r,n,i,a){if(t=+t,e=+e,a=!!a,(r=+r)<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,c=e+o,h=1^a,u=a?n-i:i-n;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Vh||Math.abs(this._y1-c)>Vh)&&this._append`L${l},${c}`,r&&(u<0&&(u=u%Hh+Hh),u>Xh?this._append`A${r},${r},0,1,${h},${t-s},${e-o}A${r},${r},0,1,${h},${this._x1=l},${this._y1=c}`:u>Vh&&this._append`A${r},${r},0,${+(u>=Yh)},${h},${this._x1=t+r*Math.cos(i)},${this._y1=e+r*Math.sin(i)}`)}rect(t,e,r,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}};function Jh(){return new Qh}function tu(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{const t=Math.floor(r);if(!(t>=0))throw new RangeError(`invalid digits: ${r}`);e=t}return t},()=>new Qh(e)}function eu(t){return t.innerRadius}function ru(t){return t.outerRadius}function nu(t){return t.startAngle}function iu(t){return t.endAngle}function au(t){return t&&t.padAngle}function su(t,e,r,n,i,a,s,o){var l=r-t,c=n-e,h=s-i,u=o-a,d=u*l-h*c;if(!(d*dN*N+I*I&&(_=C,E=S),{cx:_,cy:E,x01:-h,y01:-u,x11:_*(i/w-1),y11:E*(i/w-1)}}function lu(){var t=eu,e=ru,r=Rh(0),n=null,i=nu,a=iu,s=au,l=null,c=tu(h);function h(){var o,h,u=+t.apply(this,arguments),d=+e.apply(this,arguments),p=i.apply(this,arguments)-Gh,g=a.apply(this,arguments)-Gh,f=Mh(g-p),m=g>p;if(l||(l=o=c()),dzh)if(f>qh-zh)l.moveTo(d*Oh(p),d*$h(p)),l.arc(0,0,d,p,g,!m),u>zh&&(l.moveTo(u*Oh(g),u*$h(g)),l.arc(0,0,u,g,p,m));else{var y,v,x=p,b=g,w=p,k=g,T=f,_=f,E=s.apply(this,arguments)/2,C=E>zh&&(n?+n.apply(this,arguments):Fh(u*u+d*d)),S=Bh(Mh(d-u)/2,+r.apply(this,arguments)),A=S,L=S;if(C>zh){var N=Wh(C/u*$h(E)),I=Wh(C/d*$h(E));(T-=2*N)>zh?(w+=N*=m?1:-1,k-=N):(T=0,w=k=(p+g)/2),(_-=2*I)>zh?(x+=I*=m?1:-1,b-=I):(_=0,x=b=(p+g)/2)}var R=d*Oh(x),M=d*$h(x),D=u*Oh(k),O=u*$h(k);if(S>zh){var P,B=d*Oh(b),$=d*$h(b),F=u*Oh(w),z=u*$h(w);if(fzh?L>zh?(y=ou(F,z,R,M,d,L,m),v=ou(B,$,D,O,d,L,m),l.moveTo(y.cx+y.x01,y.cy+y.y01),Lzh&&T>zh?A>zh?(y=ou(D,O,B,$,u,-A,m),v=ou(R,M,F,z,u,-A,m),l.lineTo(y.cx+y.x01,y.cy+y.y01),At?1:e>=t?0:NaN}function mu(t){return t}function yu(){var t=mu,e=fu,r=null,n=Rh(0),i=Rh(qh),a=Rh(0);function s(s){var o,l,c,h,u,d=(s=uu(s)).length,p=0,g=new Array(d),f=new Array(d),m=+n.apply(this,arguments),y=Math.min(qh,Math.max(-qh,i.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,a.apply(this,arguments)),x=v*(y<0?-1:1);for(o=0;o0&&(p+=u);for(null!=e?g.sort((function(t,r){return e(f[t],f[r])})):null!=r&&g.sort((function(t,e){return r(s[t],s[e])})),o=0,c=p?(y-d*x)/p:0;o0?u*c:0)+x,f[l]={data:s[l],index:o,value:u,startAngle:m,endAngle:h,padAngle:v};return f}return o(s,"pie"),s.value=function(e){return arguments.length?(t="function"==typeof e?e:Rh(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,r=null,s):e},s.sort=function(t){return arguments.length?(r=t,e=null,s):r},s.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:Rh(+t),s):n},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Rh(+t),s):i},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Rh(+t),s):a},s}o(Jh,"path"),Jh.prototype=Qh.prototype,o(tu,"withPath"),o(eu,"arcInnerRadius"),o(ru,"arcOuterRadius"),o(nu,"arcStartAngle"),o(iu,"arcEndAngle"),o(au,"arcPadAngle"),o(su,"intersect"),o(ou,"cornerTangents"),o(lu,"default"),o(cu,"Linear"),cu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}),"point")},o(hu,"default"),o(uu,"default"),o(du,"x"),o(pu,"y"),o(gu,"default"),o(fu,"default"),o(mu,"default"),o(yu,"default");var vu=class{static{o(this,"Bump")}constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}};function xu(t){return new vu(t,!0)}function bu(t){return new vu(t,!1)}function wu(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ku(t){this._context=t}function Tu(t){return new ku(t)}function _u(){}function Eu(t){this._context=t}function Cu(t){return new Eu(t)}function Su(t){this._context=t}function Au(t){return new Su(t)}function Lu(t,e){this._basis=new ku(t),this._beta=e}o(xu,"bumpX"),o(bu,"bumpY"),o(wu,"point"),o(ku,"Basis"),ku.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 3:wu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:wu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},o(Tu,"default"),o(_u,"default"),o(Eu,"BasisClosed"),Eu.prototype={areaStart:_u,areaEnd:_u,lineStart:o((function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:wu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},o(Cu,"default"),o(Su,"BasisOpen"),Su.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:wu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},o(Au,"default"),o(Lu,"Bundle"),Lu.prototype={lineStart:o((function(){this._x=[],this._y=[],this._basis.lineStart()}),"lineStart"),lineEnd:o((function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],s=t[r]-i,o=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*s),this._beta*e[l]+(1-this._beta)*(a+n*o));this._x=this._y=null,this._basis.lineEnd()}),"lineEnd"),point:o((function(t,e){this._x.push(+t),this._y.push(+e)}),"point")};var Nu=o((function t(e){function r(t){return 1===e?new ku(t):new Lu(t,e)}return o(r,"bundle"),r.beta=function(e){return t(+e)},r}),"custom")(.85);function Iu(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Ru(t,e){this._context=t,this._k=(1-e)/6}o(Iu,"point"),o(Ru,"Cardinal"),Ru.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Iu(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Iu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var Mu=o((function t(e){function r(t){return new Ru(t,e)}return o(r,"cardinal"),r.tension=function(e){return t(+e)},r}),"custom")(0);function Du(t,e){this._context=t,this._k=(1-e)/6}o(Du,"CardinalClosed"),Du.prototype={areaStart:_u,areaEnd:_u,lineStart:o((function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Iu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var Ou=o((function t(e){function r(t){return new Du(t,e)}return o(r,"cardinal"),r.tension=function(e){return t(+e)},r}),"custom")(0);function Pu(t,e){this._context=t,this._k=(1-e)/6}o(Pu,"CardinalOpen"),Pu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Iu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var Bu=o((function t(e){function r(t){return new Pu(t,e)}return o(r,"cardinal"),r.tension=function(e){return t(+e)},r}),"custom")(0);function $u(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>zh){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>zh){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Fu(t,e){this._context=t,this._alpha=e}o($u,"point"),o(Fu,"CatmullRom"),Fu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:$u(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var zu=o((function t(e){function r(t){return e?new Fu(t,e):new Ru(t,0)}return o(r,"catmullRom"),r.alpha=function(e){return t(+e)},r}),"custom")(.5);function Uu(t,e){this._context=t,this._alpha=e}o(Uu,"CatmullRomClosed"),Uu.prototype={areaStart:_u,areaEnd:_u,lineStart:o((function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}}),"lineEnd"),point:o((function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:$u(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var Gu=o((function t(e){function r(t){return e?new Uu(t,e):new Du(t,0)}return o(r,"catmullRom"),r.alpha=function(e){return t(+e)},r}),"custom")(.5);function qu(t,e){this._context=t,this._alpha=e}o(qu,"CatmullRomOpen"),qu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:$u(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var ju=o((function t(e){function r(t){return e?new qu(t,e):new Pu(t,0)}return o(r,"catmullRom"),r.alpha=function(e){return t(+e)},r}),"custom")(.5);function Wu(t){this._context=t}function Yu(t){return new Wu(t)}function Hu(t){return t<0?-1:1}function Vu(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(Hu(a)+Hu(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Xu(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ku(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function Zu(t){this._context=t}function Qu(t){this._context=new Ju(t)}function Ju(t){this._context=t}function td(t){return new Zu(t)}function ed(t){return new Qu(t)}function rd(t){this._context=t}function nd(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}),"point")},o(sd,"default"),o(od,"stepBefore"),o(ld,"stepAfter");var cd={value:o((()=>{}),"value")};function hd(){for(var t,e=0,r=arguments.length,n={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function pd(t,e){for(var r,n=0,i=t.length;n0)for(var r,n,i=new Array(r),a=0;a=0&&e._call.call(void 0,t),e=e._next;--vd}function Id(){kd=(wd=_d.now())+Td,vd=xd=0;try{Nd()}finally{vd=0,Md(),kd=0}}function Rd(){var t=_d.now(),e=t-wd;e>1e3&&(Td-=e,wd=t)}function Md(){for(var t,e,r=fd,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:fd=e);md=t,Dd(n)}function Dd(t){vd||(xd&&(xd=clearTimeout(xd)),t-kd>24?(t<1/0&&(xd=setTimeout(Id,t-_d.now()-Td)),bd&&(bd=clearInterval(bd))):(bd||(wd=_d.now(),bd=setInterval(Rd,1e3)),vd=1,Ed(Id)))}function Od(t,e,r){var n=new Ad;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}o(Cd,"now"),o(Sd,"clearNow"),o(Ad,"Timer"),Ad.prototype=Ld.prototype={constructor:Ad,restart:o((function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?Cd():+r)+(null==e?0:+e),this._next||md===this||(md?md._next=this:fd=this,md=this),this._call=t,this._time=r,Dd()}),"restart"),stop:o((function(){this._call&&(this._call=null,this._time=1/0,Dd())}),"stop")},o(Ld,"timer"),o(Nd,"timerFlush"),o(Id,"wake"),o(Rd,"poke"),o(Md,"nap"),o(Dd,"sleep"),o(Od,"default");var Pd=yd("start","end","cancel","interrupt"),Bd=[];function $d(t,e,r,n,i,a){var s=t.__transition;if(s){if(r in s)return}else t.__transition={};Gd(t,r,{name:e,index:n,group:i,on:Pd,tween:Bd,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Fd(t,e){var r=Ud(t,e);if(r.state>0)throw new Error("too late; already scheduled");return r}function zd(t,e){var r=Ud(t,e);if(r.state>3)throw new Error("too late; already running");return r}function Ud(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Gd(t,e,r){var n,i=t.__transition;function a(t){r.state=1,r.timer.restart(s,r.delay,r.time),r.delay<=t&&s(t-r.delay)}function s(a){var o,h,u,d;if(1!==r.state)return c();for(o in i)if((d=i[o]).name===r.name){if(3===d.state)return Od(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[o]):+o2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete a[i]):s=!1;s&&delete t.__transition}}function jd(t){return this.each((function(){qd(this,t)}))}function Wd(t,e){var r,n;return function(){var i=zd(this,t),a=i.tween;if(a!==r)for(var s=0,o=(n=r=a).length;s=0&&(t=t.slice(0,e)),!t||"start"===t}))}function wp(t,e,r){var n,i,a=bp(e)?Fd:zd;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function kp(t,e){var r=this._id;return arguments.length<2?Ud(this.node(),r).on.on(t):this.each(wp(r,t,e))}function Tp(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function _p(){return this.on("end.remove",Tp(this._id))}function Ep(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=qn(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s{const{securityLevel:e}=Qr();let r=Ga("body");if("sandbox"===e){const e=Ga(`#i${t}`);r=Ga((e.node()?.contentDocument??document).body)}return r.select(`#${t}`)}),"selectSvgElement");function sg(t){return null==t}function og(t){return"object"==typeof t&&null!==t}function lg(t){return Array.isArray(t)?t:sg(t)?[]:[t]}function cg(t,e){var r,n,i,a;if(e)for(r=0,n=(a=Object.keys(e)).length;ro&&(e=n-o+(a=" ... ").length),r-n>o&&(r=n+o-(s=" ...").length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}function yg(t,e){return dg.repeat(" ",e-t.length)+t}function vg(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var r,n=/\r?\n|\r|\0/g,i=[0],a=[],s=-1;r=n.exec(t.buffer);)a.push(r.index),i.push(r.index+r[0].length),t.position<=r.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,a.length).toString().length,u=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(s-o<0);o++)l=mg(t.buffer,i[s-o],a[s-o],t.position-(i[s]-i[s-o]),u),c=dg.repeat(" ",e.indent)+yg((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=mg(t.buffer,i[s],a[s],t.position,u),c+=dg.repeat(" ",e.indent)+yg((t.line+1).toString(),h)+" | "+l.str+"\n",c+=dg.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(s+o>=a.length);o++)l=mg(t.buffer,i[s+o],a[s+o],t.position-(i[s]-i[s+o]),u),c+=dg.repeat(" ",e.indent)+yg((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}o(mg,"getLine"),o(yg,"padStart"),o(vg,"makeSnippet");var xg=vg,bg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],wg=["scalar","sequence","mapping"];function kg(t){var e={};return null!==t&&Object.keys(t).forEach((function(r){t[r].forEach((function(t){e[String(t)]=r}))})),e}function Tg(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===bg.indexOf(e))throw new fg('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=kg(e.styleAliases||null),-1===wg.indexOf(this.kind))throw new fg('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}o(kg,"compileStyleAliases"),o(Tg,"Type$1");var _g=Tg;function Eg(t,e){var r=[];return t[e].forEach((function(t){var e=r.length;r.forEach((function(r,n){r.tag===t.tag&&r.kind===t.kind&&r.multi===t.multi&&(e=n)})),r[e]=t})),r}function Cg(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}for(o(n,"collectType"),t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)}),"binary"),octal:o((function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}),"octal"),decimal:o((function(t){return t.toString(10)}),"decimal"),hexadecimal:o((function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}),"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Vg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xg(t){return null!==t&&!(!Vg.test(t)||"_"===t[t.length-1])}function Kg(t){var e,r;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:r*parseFloat(e,10)}o(Xg,"resolveYamlFloat"),o(Kg,"constructYamlFloat");var Zg=/^[-+]?[0-9]+e/;function Qg(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(dg.isNegativeZero(t))return"-0.0";return r=t.toString(10),Zg.test(r)?r.replace("e",".e"):r}function Jg(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||dg.isNegativeZero(t))}o(Qg,"representYamlFloat"),o(Jg,"isFloat");var tf=new _g("tag:yaml.org,2002:float",{kind:"scalar",resolve:Xg,construct:Kg,predicate:Jg,represent:Qg,defaultStyle:"lowercase"}),ef=Rg.extend({implicit:[Pg,zg,Hg,tf]}),rf=ef,nf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),af=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function sf(t){return null!==t&&(null!==nf.exec(t)||null!==af.exec(t))}function of(t){var e,r,n,i,a,s,o,l,c=0,h=null;if(null===(e=nf.exec(t))&&(e=af.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),l=new Date(Date.UTC(r,n,i,a,s,o,c)),h&&l.setTime(l.getTime()-h),l}function lf(t){return t.toISOString()}o(sf,"resolveYamlTimestamp"),o(of,"constructYamlTimestamp"),o(lf,"representYamlTimestamp");var cf=new _g("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:sf,construct:of,instanceOf:Date,represent:lf});function hf(t){return"<<"===t||null===t}o(hf,"resolveYamlMerge");var uf=new _g("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hf}),df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function pf(t){if(null===t)return!1;var e,r,n=0,i=t.length,a=df;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8==0}function gf(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=df,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(255&s)),s=s<<6|a.indexOf(n.charAt(e));return 0===(r=i%4*6)?(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)):18===r?(o.push(s>>10&255),o.push(s>>2&255)):12===r&&o.push(s>>4&255),new Uint8Array(o)}function ff(t){var e,r,n="",i=0,a=t.length,s=df;for(e=0;e>18&63],n+=s[i>>12&63],n+=s[i>>6&63],n+=s[63&i]),i=(i<<8)+t[e];return 0===(r=a%3)?(n+=s[i>>18&63],n+=s[i>>12&63],n+=s[i>>6&63],n+=s[63&i]):2===r?(n+=s[i>>10&63],n+=s[i>>4&63],n+=s[i<<2&63],n+=s[64]):1===r&&(n+=s[i>>2&63],n+=s[i<<4&63],n+=s[64],n+=s[64]),n}function mf(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}o(pf,"resolveYamlBinary"),o(gf,"constructYamlBinary"),o(ff,"representYamlBinary"),o(mf,"isBinary");var yf=new _g("tag:yaml.org,2002:binary",{kind:"scalar",resolve:pf,construct:gf,predicate:mf,represent:ff}),vf=Object.prototype.hasOwnProperty,xf=Object.prototype.toString;function bf(t){if(null===t)return!0;var e,r,n,i,a,s=[],o=t;for(e=0,r=o.length;e>10),56320+(t-65536&1023))}o($f,"_class"),o(Ff,"is_EOL"),o(zf,"is_WHITE_SPACE"),o(Uf,"is_WS_OR_EOL"),o(Gf,"is_FLOW_INDICATOR"),o(qf,"fromHexCode"),o(jf,"escapedHexLen"),o(Wf,"fromDecimalCode"),o(Yf,"simpleEscapeSequence"),o(Hf,"charFromCodepoint");var Vf,Xf=new Array(256),Kf=new Array(256);for(Vf=0;Vf<256;Vf++)Xf[Vf]=Yf(Vf)?1:0,Kf[Vf]=Yf(Vf);function Zf(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||If,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Qf(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=xg(r),new fg(e,r)}function Jf(t,e){throw Qf(t,e)}function tm(t,e){t.onWarning&&t.onWarning.call(null,Qf(t,e))}o(Zf,"State$1"),o(Qf,"generateError"),o(Jf,"throwError"),o(tm,"throwWarning");var em={YAML:o((function(t,e,r){var n,i,a;null!==t.version&&Jf(t,"duplication of %YAML directive"),1!==r.length&&Jf(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&Jf(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),1!==i&&Jf(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&tm(t,"unsupported YAML version of the document")}),"handleYamlDirective"),TAG:o((function(t,e,r){var n,i;2!==r.length&&Jf(t,"TAG directive accepts exactly two arguments"),n=r[0],i=r[1],Pf.test(n)||Jf(t,"ill-formed tag handle (first argument) of the TAG directive"),Rf.call(t.tagMap,n)&&Jf(t,'there is a previously declared suffix for "'+n+'" tag handle'),Bf.test(i)||Jf(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){Jf(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}),"handleTagDirective")};function rm(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=dg.repeat("\n",e-1))}function cm(t,e,r){var n,i,a,s,o,l,c,h,u=t.kind,d=t.result;if(Uf(h=t.input.charCodeAt(t.position))||Gf(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(Uf(n=t.input.charCodeAt(t.position+1))||r&&Gf(n)))return!1;for(t.kind="scalar",t.result="",i=a=t.position,s=!1;0!==h;){if(58===h){if(Uf(n=t.input.charCodeAt(t.position+1))||r&&Gf(n))break}else if(35===h){if(Uf(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&om(t)||r&&Gf(h))break;if(Ff(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,sm(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}t.position=a,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(rm(t,i,a,!1),lm(t,t.line-o),i=a=t.position,s=!1),zf(h)||(a=t.position+1),h=t.input.charCodeAt(++t.position)}return rm(t,i,a,!1),!!t.result||(t.kind=u,t.result=d,!1)}function hm(t,e){var r,n,i;if(39!==(r=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(r=t.input.charCodeAt(t.position));)if(39===r){if(rm(t,n,t.position,!0),39!==(r=t.input.charCodeAt(++t.position)))return!0;n=t.position,t.position++,i=t.position}else Ff(r)?(rm(t,n,i,!0),lm(t,sm(t,!1,e)),n=i=t.position):t.position===t.lineStart&&om(t)?Jf(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Jf(t,"unexpected end of the stream within a single quoted scalar")}function um(t,e){var r,n,i,a,s,o;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return rm(t,r,t.position,!0),t.position++,!0;if(92===o){if(rm(t,r,t.position,!0),Ff(o=t.input.charCodeAt(++t.position)))sm(t,!1,e);else if(o<256&&Xf[o])t.result+=Kf[o],t.position++;else if((s=jf(o))>0){for(i=s,a=0;i>0;i--)(s=qf(o=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+s:Jf(t,"expected hexadecimal character");t.result+=Hf(a),t.position++}else Jf(t,"unknown escape sequence");r=n=t.position}else Ff(o)?(rm(t,r,n,!0),lm(t,sm(t,!1,e)),r=n=t.position):t.position===t.lineStart&&om(t)?Jf(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Jf(t,"unexpected end of the stream within a double quoted scalar")}function dm(t,e){var r,n,i,a,s,o,l,c,h,u,d,p,g=!0,f=t.tag,m=t.anchor,y=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))s=93,c=!1,a=[];else{if(123!==p)return!1;s=125,c=!0,a={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),p=t.input.charCodeAt(++t.position);0!==p;){if(sm(t,!0,e),(p=t.input.charCodeAt(t.position))===s)return t.position++,t.tag=f,t.anchor=m,t.kind=c?"mapping":"sequence",t.result=a,!0;g?44===p&&Jf(t,"expected the node content, but found ','"):Jf(t,"missed comma between flow collection entries"),d=null,o=l=!1,63===p&&Uf(t.input.charCodeAt(t.position+1))&&(o=l=!0,t.position++,sm(t,!0,e)),r=t.line,n=t.lineStart,i=t.position,xm(t,e,1,!1,!0),u=t.tag,h=t.result,sm(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==r||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),sm(t,!0,e),xm(t,e,1,!1,!0),d=t.result),c?im(t,a,y,u,h,d,r,n,i):o?a.push(im(t,null,y,u,h,d,r,n,i)):a.push(h),sm(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(g=!0,p=t.input.charCodeAt(++t.position)):g=!1}Jf(t,"unexpected end of the stream within a flow collection")}function pm(t,e){var r,n,i,a,s=1,o=!1,l=!1,c=e,h=0,u=!1;if(124===(a=t.input.charCodeAt(t.position)))n=!1;else{if(62!==a)return!1;n=!0}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)1===s?s=43===a?3:2:Jf(t,"repeat of a chomping mode identifier");else{if(!((i=Wf(a))>=0))break;0===i?Jf(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Jf(t,"repeat of an indentation width identifier"):(c=e+i-1,l=!0)}if(zf(a)){do{a=t.input.charCodeAt(++t.position)}while(zf(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!Ff(a)&&0!==a)}for(;0!==a;){for(am(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndentc&&(c=t.lineIndent),Ff(a))h++;else{if(t.lineIndente)&&0!==n)Jf(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),xm(t,e,4,!0,i)&&(y?f=t.result:m=t.result),y||(im(t,d,p,g,f,m,s,o,l),g=f=m=null),sm(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&0!==c)Jf(t,"bad indentation of a mapping entry");else if(t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l"),null!==t.result&&u.kind!==t.kind&&Jf(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+u.kind+'", not "'+t.kind+'"'),u.resolve(t.result,t.tag)?(t.result=u.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):Jf(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||m}function bm(t){var e,r,n,i,a=t.position,s=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(sm(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(s=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!Uf(i);)i=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&Jf(t,"directive name must not be less than one character in length");0!==i;){for(;zf(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!Ff(i));break}if(Ff(i))break;for(e=t.position;0!==i&&!Uf(i);)i=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==i&&am(t),Rf.call(em,r)?em[r](t,r,n):tm(t,'unknown document directive "'+r+'"')}sm(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,sm(t,!0,-1)):s&&Jf(t,"directives end mark is expected"),xm(t,t.lineIndent-1,4,!1,!0),sm(t,!0,-1),t.checkLineBreaks&&Df.test(t.input.slice(a,t.position))&&tm(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&om(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,sm(t,!0,-1)):t.position=55296&&n<=56319&&e+1=56320&&r<=57343?1024*(n-55296)+r-56320+65536:n}function jm(t){return/^\n* /.test(t)}o(Mm,"State"),o(Dm,"indentString"),o(Om,"generateNextLine"),o(Pm,"testImplicitResolving"),o(Bm,"isWhitespace"),o($m,"isPrintable"),o(Fm,"isNsCharOrWhitespace"),o(zm,"isPlainSafe"),o(Um,"isPlainSafeFirst"),o(Gm,"isPlainSafeLast"),o(qm,"codePointAt"),o(jm,"needIndentIndicator");function Wm(t,e,r,n,i,a,s,o){var l,c=0,h=null,u=!1,d=!1,p=-1!==n,g=-1,f=Um(qm(t,0))&&Gm(qm(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(!$m(c=qm(t,l)))return 5;f=f&&zm(c,h,o),h=c}else{for(l=0;l=65536?l+=2:l++){if(10===(c=qm(t,l)))u=!0,p&&(d=d||l-g-1>n&&" "!==t[g+1],g=l);else if(!$m(c))return 5;f=f&&zm(c,h,o),h=c}d=d||p&&l-g-1>n&&" "!==t[g+1]}return u||d?r>9&&jm(t)?5:s?2===a?5:2:d?4:3:!f||s||i(t)?2===a?5:2:1}function Ym(t,e,r,n,i){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==Lm.indexOf(e)||Nm.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),l=n||t.flowLevel>-1&&r>=t.flowLevel;function c(e){return Pm(t,e)}switch(o(c,"testAmbiguity"),Wm(e,l,t.indent,s,c,t.quotingType,t.forceQuotes&&!n,i)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+Hm(e,t.indent)+Vm(Dm(e,a));case 4:return">"+Hm(e,t.indent)+Vm(Dm(Xm(e,s),a));case 5:return'"'+Zm(e)+'"';default:throw new fg("impossible error: invalid scalar style")}}()}function Hm(t,e){var r=jm(t)?String(e):"",n="\n"===t[t.length-1];return r+(n&&("\n"===t[t.length-2]||"\n"===t)?"+":n?"":"-")+"\n"}function Vm(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Xm(t,e){for(var r,n,i,a=/(\n+)([^\n]*)/g,s=(r=-1!==(r=t.indexOf("\n"))?r:t.length,a.lastIndex=r,Km(t.slice(0,r),e)),o="\n"===t[0]||" "===t[0];i=a.exec(t);){var l=i[1],c=i[2];n=" "===c[0],s+=l+(o||n||""===c?"":"\n")+Km(c,e),o=n}return s}function Km(t,e){if(""===t||" "===t[0])return t;for(var r,n,i=/ [^ ]/g,a=0,s=0,o=0,l="";r=i.exec(t);)(o=r.index)-a>e&&(n=s>a?s:o,l+="\n"+t.slice(a,n),a=n+1),s=o;return l+="\n",t.length-a>e&&s>a?l+=t.slice(a,s)+"\n"+t.slice(s+1):l+=t.slice(a),l.slice(1)}function Zm(t){for(var e,r="",n=0,i=0;i=65536?i+=2:i++)n=qm(t,i),!(e=Am[n])&&$m(n)?(r+=t[i],n>=65536&&(r+=t[i+1])):r+=e||Rm(n);return r}function Qm(t,e,r){var n,i,a,s="",o=t.tag;for(n=0,i=r.length;n1024&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ny(t,e,s,!1,!1)&&(l+=o+=t.dump));t.tag=c,t.dump="{"+l+"}"}function ey(t,e,r,n){var i,a,s,o,l,c,h="",u=t.tag,d=Object.keys(r);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new fg("sortKeys must be a boolean or a function");for(i=0,a=d.length;i1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=Om(t,e)),ny(t,e+1,o,!0,l)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",h+=c+=t.dump));t.tag=u,t.dump=h||"{}"}function ry(t,e,r){var n,i,a,s,o,l;for(a=0,s=(i=r?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+l+'" style');n=o.represent[l](e,l)}t.dump=n}return!0}return!1}function ny(t,e,r,n,i,a,s){t.tag=null,t.dump=r,ry(t,r,!1)||ry(t,r,!0);var o,l=Em.call(t.dump),c=n;n&&(n=t.flowLevel<0||t.flowLevel>e);var h,u,d="[object Object]"===l||"[object Array]"===l;if(d&&(u=-1!==(h=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||u||2!==t.indent&&e>0)&&(i=!1),u&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(d&&u&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),"[object Object]"===l)n&&0!==Object.keys(t.dump).length?(ey(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(ty(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else if("[object Array]"===l)n&&0!==t.dump.length?(t.noArrayIndent&&!s&&e>0?Jm(t,e-1,t.dump,i):Jm(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(Qm(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(t.skipInvalid)return!1;throw new fg("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&Ym(t,t.dump,e,a,c)}null!==t.tag&&"?"!==t.tag&&(o=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),o="!"===t.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",t.dump=o+" "+t.dump)}return!0}function iy(t,e){var r,n,i=[],a=[];for(ay(t,i,a),r=0,n=a.length;r100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function l(t){var e=Math.abs(t);return e>=a?Math.round(t/a)+"d":e>=i?Math.round(t/i)+"h":e>=n?Math.round(t/n)+"m":e>=r?Math.round(t/r)+"s":t+"ms"}function c(t){var e=Math.abs(t);return e>=a?h(t,e,a,"day"):e>=i?h(t,e,i,"hour"):e>=n?h(t,e,n,"minute"):e>=r?h(t,e,r,"second"):t+" ms"}function h(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}e.exports=function(t,e){e=e||{};var r=typeof t;if("string"===r&&t.length>0)return s(t);if("number"===r&&isFinite(t))return e.long?c(t):l(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))},o(s,"parse"),o(l,"fmtShort"),o(c,"fmtLong"),o(h,"plural")}}),cy=l({"../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/common.js"(t,e){function r(t){function e(t){let e=0;for(let r=0;r{if("%%"===e)return"%";s++;const a=r.formatters[i];if("function"==typeof a){const r=t[s];e=a.call(n,r),t.splice(s,1),s--}return e})),r.formatArgs.call(n,t);(n.log||r.log).apply(n,t)}return o(l,"debug"),l.namespace=t,l.useColors=r.useColors(),l.color=r.selectColor(t),l.extend=n,l.destroy=r.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:o((()=>null!==s?s:(i!==r.namespaces&&(i=r.namespaces,a=r.enabled(t)),a)),"get"),set:o((t=>{s=t}),"set")}),"function"==typeof r.init&&r.init(l),l}function n(t,e){const n=r(this.namespace+(void 0===e?":":e)+t);return n.log=this.log,n}function i(t){r.save(t),r.namespaces=t,r.names=[],r.skips=[];const e=("string"==typeof t?t:"").trim().replace(" ",",").split(",").filter(Boolean);for(const t of e)"-"===t[0]?r.skips.push(t.slice(1)):r.names.push(t)}function a(t,e){let r=0,n=0,i=-1,a=0;for(;r"-"+t))].join(",");return r.enable(""),t}function l(t){for(const e of r.skips)if(a(t,e))return!1;for(const e of r.names)if(a(t,e))return!0;return!1}function c(t){return t instanceof Error?t.stack||t.message:t}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=l,r.humanize=ly(),r.destroy=h,Object.keys(t).forEach((e=>{r[e]=t[e]})),r.names=[],r.skips=[],r.formatters={},o(e,"selectColor"),r.selectColor=e,o(r,"createDebug"),o(n,"extend"),o(i,"enable"),o(a,"matchesTemplate"),o(s,"disable"),o(l,"enabled"),o(c,"coerce"),o(h,"destroy"),r.enable(r.load()),r}o(r,"setup"),e.exports=r}}),hy=l({"../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/browser.js"(t,e){function r(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),t.splice(i,0,r)}function i(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(t){}}function a(){let e;try{e=t.storage.getItem("debug")}catch(t){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}function s(){try{return localStorage}catch(t){}}t.formatArgs=n,t.save=i,t.load=a,t.useColors=r,t.storage=s(),t.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],o(r,"useColors"),o(n,"formatArgs"),t.log=console.debug||console.log||(()=>{}),o(i,"save"),o(a,"load"),o(s,"localstorage"),e.exports=cy()(t);var{formatters:l}=e.exports;l.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}}),uy=Object.freeze({left:0,top:0,width:16,height:16}),dy=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),py=Object.freeze({...uy,...dy}),gy=Object.freeze({...py,body:"",hidden:!1}),fy=Object.freeze({width:null,height:null}),my=Object.freeze({...fy,...dy}),yy=o(((t,e,r,n="")=>{const i=t.split(":");if("@"===t.slice(0,1)){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const t=i.pop(),r=i.pop(),a={provider:i.length>0?i[0]:n,prefix:r,name:t};return e&&!vy(a)?null:a}const a=i[0],s=a.split("-");if(s.length>1){const t={provider:n,prefix:s.shift(),name:s.join("-")};return e&&!vy(t)?null:t}if(r&&""===n){const t={provider:n,prefix:"",name:a};return e&&!vy(t,r)?null:t}return null}),"stringToIcon"),vy=o(((t,e)=>!!t&&!(!(e&&""===t.prefix||t.prefix)||!t.name)),"validateIconName");function xy(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function by(t,e){const r=xy(t,e);for(const n in gy)n in dy?n in t&&!(n in r)&&(r[n]=dy[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function wy(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(t){if(r[t])return i[t]=[];if(!(t in i)){i[t]=null;const e=n[t]&&n[t].parent,r=e&&a(e);r&&(i[t]=[e].concat(r))}return i[t]}return o(a,"resolve"),(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function ky(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(t){a=by(n[t]||i[t],a)}return o(s,"parse"),s(e),r.forEach(s),by(t,a)}function Ty(t,e){if(t.icons[e])return ky(t,e,[]);const r=wy(t,[e])[e];return r?ky(t,e,r):null}o(xy,"mergeIconTransformations"),o(by,"mergeIconData"),o(wy,"getIconsTree"),o(ky,"internalGetIconData"),o(Ty,"getIconData");var _y=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ey=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Cy(t,e,r){if(1===e)return t;if(r=r||100,"number"==typeof t)return Math.ceil(t*e*r)/r;if("string"!=typeof t)return t;const n=t.split(_y);if(null===n||!n.length)return t;const i=[];let a=n.shift(),s=Ey.test(a);for(;;){if(s){const t=parseFloat(a);isNaN(t)?i.push(a):i.push(Math.ceil(t*e*r)/r)}else i.push(a);if(a=n.shift(),void 0===a)return i.join("");s=!s}}function Sy(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(-1===s)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function Ay(t,e){return t?""+t+""+e:e}function Ly(t,e,r){const n=Sy(t);return Ay(n.defs,e+n.content+r)}o(Cy,"calculateSize"),o(Sy,"splitSVGDefs"),o(Ay,"mergeDefsAndContent"),o(Ly,"wrapSVGContent");var Ny=o((t=>"unset"===t||"undefined"===t||"none"===t),"isUnsetKeyword");function Iy(t,e){const r={...py,...t},n={...my,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach((t=>{const e=[],r=t.hFlip,n=t.vFlip;let s,o=t.rotate;switch(r?n?o+=2:(e.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),e.push("scale(-1 1)"),i.top=i.left=0):n&&(e.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),e.push("scale(1 -1)"),i.top=i.left=0),o<0&&(o-=4*Math.floor(o/4)),o%=4,o){case 1:s=i.height/2+i.top,e.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:e.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:s=i.width/2+i.left,e.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),e.length&&(a=Ly(a,'',""))}));const s=n.width,l=n.height,c=i.width,h=i.height;let u,d;null===s?(d=null===l?"1em":"auto"===l?h:l,u=Cy(d,c/h)):(u="auto"===s?c:s,d=null===l?Cy(u,h/c):"auto"===l?h:l);const p={},g=o(((t,e)=>{Ny(e)||(p[t]=e.toString())}),"setAttr");g("width",u),g("height",d);const f=[i.left,i.top,c,h];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:a}}o(Iy,"iconToSVG");var Ry=/\sid="(\S+)"/g,My="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),Dy=0;function Oy(t,e=My){const r=[];let n;for(;n=Ry.exec(t);)r.push(n[1]);if(!r.length)return t;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return r.forEach((r=>{const n="function"==typeof e?e(r):e+(Dy++).toString(),a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+n+i+"$3")})),t=t.replace(new RegExp(i,"g"),"")}function Py(t,e){let r=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)r+=" "+t+'="'+e[t]+'"';return'"+t+""}o(Oy,"replaceIDs"),o(Py,"iconToHTML"),p(hy(),1);var By={body:'?',height:80,width:80},$y=new Map,Fy=new Map,zy=o((t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(y.debug("Registering icon pack:",e.name),"loader"in e)Fy.set(e.name,e.loader);else{if(!("icons"in e))throw y.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');$y.set(e.name,e.icons)}}}),"registerIconPacks"),Uy=o((async(t,e)=>{const r=yy(t,!0,void 0!==e);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=$y.get(n);if(!i){const t=Fy.get(n);if(!t)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await t(),prefix:n},$y.set(n,i)}catch(t){throw y.error(t),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Ty(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a}),"getRegisteredIconData"),Gy=o((async(t,e)=>{let r;try{r=await Uy(t,e?.fallbackPrefix)}catch(t){y.error(t),r=By}const n=Iy(r,e);return Py(Oy(n.body),n.attributes)}),"getIconSVG"),qy=o((({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:e+r}}),"getSubGraphTitleMargins"),jy=l({"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/constants.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BLANK_URL=t.relativeFirstCharacters=t.whitespaceEscapeCharsRegex=t.urlSchemeRegex=t.ctrlCharactersRegex=t.htmlCtrlEntityRegex=t.htmlEntitiesRegex=t.invalidProtocolRegex=void 0,t.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,t.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,t.htmlCtrlEntityRegex=/&(newline|tab);/gi,t.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,t.urlSchemeRegex=/^.+(:|:)/gim,t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[".","/"],t.BLANK_URL="about:blank"}}),Wy=l({"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeUrl=void 0;var e=jy();function r(t){return e.relativeFirstCharacters.indexOf(t[0])>-1}function n(t){return t.replace(e.ctrlCharactersRegex,"").replace(e.htmlEntitiesRegex,(function(t,e){return String.fromCharCode(e)}))}function i(t){return URL.canParse(t)}function a(t){try{return decodeURIComponent(t)}catch(e){return t}}function s(t){if(!t)return e.BLANK_URL;var s,o=a(t.trim());do{s=(o=a(o=n(o).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim())).match(e.ctrlCharactersRegex)||o.match(e.htmlEntitiesRegex)||o.match(e.htmlCtrlEntityRegex)||o.match(e.whitespaceEscapeCharsRegex)}while(s&&s.length>0);var l=o;if(!l)return e.BLANK_URL;if(r(l))return l;var c=l.trimStart(),h=c.match(e.urlSchemeRegex);if(!h)return l;var u=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var d=c.replace(/\\/g,"/");if("mailto:"===u||u.includes("://"))return d;if("http:"===u||"https:"===u){if(!i(d))return e.BLANK_URL;var p=new URL(d);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return d}o(r,"isRelativeUrlWithoutProtocol"),o(n,"decodeHtmlCharacters"),o(i,"isValidUrl"),o(a,"decodeURI"),o(s,"sanitizeUrl"),t.sanitizeUrl=s}}),Yy="object"==typeof global&&global&&global.Object===Object&&global,Hy="object"==typeof self&&self&&self.Object===Object&&self,Vy=Yy||Hy||Function("return this")(),Xy=Vy.Symbol,Ky=Object.prototype,Zy=Ky.hasOwnProperty,Qy=Ky.toString,Jy=Xy?Xy.toStringTag:void 0;function tv(t){var e=Zy.call(t,Jy),r=t[Jy];try{t[Jy]=void 0;var n=!0}catch(t){}var i=Qy.call(t);return n&&(e?t[Jy]=r:delete t[Jy]),i}o(tv,"getRawTag");var ev=tv,rv=Object.prototype.toString;function nv(t){return rv.call(t)}o(nv,"objectToString");var iv=nv,av=Xy?Xy.toStringTag:void 0;function sv(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":av&&av in Object(t)?ev(t):iv(t)}o(sv,"baseGetTag");var ov=sv;function lv(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}o(lv,"isObject");var cv=lv;function hv(t){if(!cv(t))return!1;var e=ov(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}o(hv,"isFunction");var uv,dv=hv,pv=Vy["__core-js_shared__"],gv=(uv=/[^.]+$/.exec(pv&&pv.keys&&pv.keys.IE_PROTO||""))?"Symbol(src)_1."+uv:"";function fv(t){return!!gv&&gv in t}o(fv,"isMasked");var mv=fv,yv=Function.prototype.toString;function vv(t){if(null!=t){try{return yv.call(t)}catch(t){}try{return t+""}catch(t){}}return""}o(vv,"toSource");var xv=vv,bv=/^\[object .+?Constructor\]$/,wv=Function.prototype,kv=Object.prototype,Tv=wv.toString,_v=kv.hasOwnProperty,Ev=RegExp("^"+Tv.call(_v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cv(t){return!(!cv(t)||mv(t))&&(dv(t)?Ev:bv).test(xv(t))}o(Cv,"baseIsNative");var Sv=Cv;function Av(t,e){return null==t?void 0:t[e]}o(Av,"getValue");var Lv=Av;function Nv(t,e){var r=Lv(t,e);return Sv(r)?r:void 0}o(Nv,"getNative");var Iv=Nv,Rv=Iv(Object,"create");function Mv(){this.__data__=Rv?Rv(null):{},this.size=0}o(Mv,"hashClear");var Dv=Mv;function Ov(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}o(Ov,"hashDelete");var Pv=Ov,Bv=Object.prototype.hasOwnProperty;function $v(t){var e=this.__data__;if(Rv){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Bv.call(e,t)?e[t]:void 0}o($v,"hashGet");var Fv=$v,zv=Object.prototype.hasOwnProperty;function Uv(t){var e=this.__data__;return Rv?void 0!==e[t]:zv.call(e,t)}o(Uv,"hashHas");var Gv=Uv;function qv(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Rv&&void 0===e?"__lodash_hash_undefined__":e,this}o(qv,"hashSet");var jv=qv;function Wv(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1}o(ix,"listCacheHas");var ax=ix;function sx(t,e){var r=this.__data__,n=Qv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}o(sx,"listCacheSet");var ox=sx;function lx(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}o(Nb,"isLength");var Ib=Nb;function Rb(t){return null!=t&&Ib(t.length)&&!dv(t)}o(Rb,"isArrayLike");var Mb=Rb;function Db(t){return wb(t)&&Mb(t)}o(Db,"isArrayLikeObject");var Ob=Db;function Pb(){return!1}o(Pb,"stubFalse");var Bb=Pb,$b="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fb=$b&&"object"==typeof module&&module&&!module.nodeType&&module,zb=Fb&&Fb.exports===$b?Vy.Buffer:void 0,Ub=(zb?zb.isBuffer:void 0)||Bb,Gb=Function.prototype,qb=Object.prototype,jb=Gb.toString,Wb=qb.hasOwnProperty,Yb=jb.call(Object);function Hb(t){if(!wb(t)||"[object Object]"!=ov(t))return!1;var e=gb(t);if(null===e)return!0;var r=Wb.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&jb.call(r)==Yb}o(Hb,"isPlainObject");var Vb=Hb,Xb={};function Kb(t){return wb(t)&&Ib(t.length)&&!!Xb[ov(t)]}Xb["[object Float32Array]"]=Xb["[object Float64Array]"]=Xb["[object Int8Array]"]=Xb["[object Int16Array]"]=Xb["[object Int32Array]"]=Xb["[object Uint8Array]"]=Xb["[object Uint8ClampedArray]"]=Xb["[object Uint16Array]"]=Xb["[object Uint32Array]"]=!0,Xb["[object Arguments]"]=Xb["[object Array]"]=Xb["[object ArrayBuffer]"]=Xb["[object Boolean]"]=Xb["[object DataView]"]=Xb["[object Date]"]=Xb["[object Error]"]=Xb["[object Function]"]=Xb["[object Map]"]=Xb["[object Number]"]=Xb["[object Object]"]=Xb["[object RegExp]"]=Xb["[object Set]"]=Xb["[object String]"]=Xb["[object WeakMap]"]=!1,o(Kb,"baseIsTypedArray");var Zb=Kb;function Qb(t){return function(e){return t(e)}}o(Qb,"baseUnary");var Jb=Qb,tw="object"==typeof exports&&exports&&!exports.nodeType&&exports,ew=tw&&"object"==typeof module&&module&&!module.nodeType&&module,rw=ew&&ew.exports===tw&&Yy.process,nw=function(){try{var t=ew&&ew.require&&ew.require("util").types;return t||rw&&rw.binding&&rw.binding("util")}catch(t){}}(),iw=nw&&nw.isTypedArray,aw=iw?Jb(iw):Zb;function sw(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}o(sw,"safeGet");var ow=sw,lw=Object.prototype.hasOwnProperty;function cw(t,e,r){var n=t[e];lw.call(t,e)&&Kv(n,r)&&(void 0!==r||e in t)||Wx(t,e,r)}o(cw,"assignValue");var hw=cw;function uw(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}o(jw,"shortOut");var Ww=jw(Gw);function Yw(t,e){return Ww(zw(t,e,Ow),t+"")}o(Yw,"baseRest");var Hw=Yw;function Vw(t,e,r){if(!cv(r))return!1;var n=typeof e;return!!("number"==n?Mb(r)&&yw(e,r.length):"string"==n&&e in r)&&Kv(r[e],t)}o(Vw,"isIterateeCall");var Xw=Vw;function Kw(t){return Hw((function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&Xw(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++nt.args));Nt(t),n=N(n,[...t])}else n=r.args;if(!n)return;let i=E(t,e);const a="config";return void 0!==n[a]&&("flowchart-v2"===i&&(i="flowchart"),n[i]=n[a],delete n[a]),n}),"detectInit"),ik=o((function(t,e=null){try{const r=new RegExp(`[%]{2}(?![{]${rk.source})(?=[}][%]{2}).*\n`,"ig");let n;t=t.trim().replace(r,"").replace(/'/gm,'"'),y.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const i=[];for(;null!==(n=w.exec(t));)if(n.index===w.lastIndex&&w.lastIndex++,n&&!e||e&&n[1]?.match(e)||e&&n[2]?.match(e)){const t=n[1]?n[1]:n[2],e=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:t,args:e})}return 0===i.length?{type:t,args:null}:1===i.length?i[0]:i}catch(r){return y.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}}),"detectDirective"),ak=o((function(t){return t.replace(w,"")}),"removeDirectives"),sk=o((function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1}),"isSubstringInArray");function ok(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return ek[r]??e}function lk(t,e){const r=t.trim();if(r)return"loose"!==e.securityLevel?(0,tk.sanitizeUrl)(r):r}o(ok,"interpolateToCurve"),o(lk,"formatUrl");var ck=o(((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let e=0;e{r+=hk(t,e),e=t}));return gk(t,r/2)}function dk(t){return 1===t.length?t[0]:uk(t)}o(hk,"distance"),o(uk,"traverseEdge"),o(dk,"calcLabelPosition");var pk=o(((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r}),"roundNumber"),gk=o(((t,e)=>{let r,n=e;for(const e of t){if(r){const t=hk(e,r);if(0===t)return r;if(t=1)return{x:e.x,y:e.y};if(i>0&&i<1)return{x:pk((1-i)*r.x+i*e.x,5),y:pk((1-i)*r.y+i*e.y,5)}}}r=e}throw new Error("Could not find a suitable point for the given distance")}),"calculatePoint"),fk=o(((t,e,r)=>{y.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const n=gk(e,25),i=t?10:5,a=Math.atan2(e[0].y-n.y,e[0].x-n.x),s={x:0,y:0};return s.x=Math.sin(a)*i+(e[0].x+n.x)/2,s.y=-Math.cos(a)*i+(e[0].y+n.y)/2,s}),"calcCardinalityPosition");function mk(t,e,r){const n=structuredClone(r);y.info("our points",n),"start_left"!==e&&"start_right"!==e&&n.reverse();const i=gk(n,25+t),a=10+.5*t,s=Math.atan2(n[0].y-i.y,n[0].x-i.x),o={x:0,y:0};return"start_left"===e?(o.x=Math.sin(s+Math.PI)*a+(n[0].x+i.x)/2,o.y=-Math.cos(s+Math.PI)*a+(n[0].y+i.y)/2):"end_right"===e?(o.x=Math.sin(s-Math.PI)*a+(n[0].x+i.x)/2-5,o.y=-Math.cos(s-Math.PI)*a+(n[0].y+i.y)/2-5):"end_left"===e?(o.x=Math.sin(s)*a+(n[0].x+i.x)/2-5,o.y=-Math.cos(s)*a+(n[0].y+i.y)/2-5):(o.x=Math.sin(s)*a+(n[0].x+i.x)/2,o.y=-Math.cos(s)*a+(n[0].y+i.y)/2),o}function yk(t){let e="",r="";for(const n of t)void 0!==n&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}o(mk,"calcTerminalLabelPosition"),o(yk,"getStylesFromArray");var vk=0,xk=o((()=>(vk++,"id-"+Math.random().toString(36).substr(2,12)+"-"+vk)),"generateId");function bk(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ibk(t.length)),"random"),kk=o((function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}}),"getTextObj"),Tk=o((function(t,e){const r=e.text.replace(Lr.lineBreakRegex," "),[,n]=Dk(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.attr("fill",e.fill),a.text(r),i}),"drawSimpleText"),_k=Ax(((t,e,r)=>{if(!t)return t;if(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Lr.lineBreakRegex.test(t))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach(((t,s)=>{const o=Sk(`${t} `,r),l=Sk(a,r);if(o>e){const{hyphenatedStrings:n,remainingWord:s}=Ek(t,e,"-",r);i.push(a,...n),a=s}else l+o>=e?(i.push(a),a=t):a=[a,t].filter(Boolean).join(" ");s+1===n.length&&i.push(a)})),i.filter((t=>""!==t)).join(r.joinWith)}),((t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`)),Ek=Ax(((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach(((t,o)=>{const l=`${s}${t}`;if(Sk(l,n)>=e){const t=o+1,e=i.length===t,n=`${l}${r}`;a.push(e?l:n),s=""}else s=l})),{hyphenatedStrings:a,remainingWord:s}}),((t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`));function Ck(t,e){return Lk(t,e).height}function Sk(t,e){return Lk(t,e).width}o(Ck,"calculateTextHeight"),o(Sk,"calculateTextWidth");var Ak,Lk=Ax(((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Dk(r),s=["sans-serif",n],o=t.split(Lr.lineBreakRegex),l=[],c=Ga("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const t of s){let e=0;const r={width:0,height:0,lineHeight:0};for(const n of o){const s=kk();s.text=n||"​";const o=Tk(h,s).style("font-size",a).style("font-weight",i).style("font-family",t),l=(o._groups||o)[0][0].getBBox();if(0===l.width&&0===l.height)throw new Error("svg element not in render tree");r.width=Math.round(Math.max(r.width,l.width)),e=Math.round(l.height),r.height+=e,r.lineHeight=Math.round(Math.max(r.lineHeight,e))}l.push(r)}h.remove();return l[isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`)),Nk=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},Ik=o((function(t){return Ak=Ak||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ak.innerHTML=t,unescape(Ak.textContent)}),"entityDecode");function Rk(t){return"str"in t}o(Rk,"isDetailedError");var Mk=o(((t,e,r,n)=>{if(!n)return;const i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)}),"insertTitle"),Dk=o((t=>{if("number"==typeof t)return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]}),"parseFontSize");function Ok(t,e){return Jw({},t,e)}o(Ok,"cleanAndMerge");var Pk={assignWithDepth:N,wrapLabel:_k,calculateTextHeight:Ck,calculateTextWidth:Sk,calculateTextDimensions:Lk,cleanAndMerge:Ok,detectInit:nk,detectDirective:ik,isSubstringInArray:sk,interpolateToCurve:ok,calcLabelPosition:dk,calcCardinalityPosition:fk,calcTerminalLabelPosition:mk,formatUrl:lk,getStylesFromArray:yk,generateId:xk,random:wk,runFunc:ck,entityDecode:Ik,insertTitle:Mk,parseFontSize:Dk,InitIDGenerator:Nk},Bk=o((function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})),e}),"encodeEntities"),$k=o((function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")}),"decodeEntities"),Fk=o(((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`),"getEdgeId");function zk(t){return t??null}function Uk(t){for(var e=[],r=1;rnull),"exec")};function Yk(t,e=""){let r="string"==typeof t?t:t.source;const n={replace:o(((t,e)=>{let i="string"==typeof e?e:e.source;return i=i.replace(Hk.caret,"$1"),r=r.replace(t,i),n}),"replace"),getRegex:o((()=>new RegExp(r,e)),"getRegex")};return n}o(Yk,"edit");var Hk={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o((t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`)),"listItemRegex"),nextBulletRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),"nextBulletRegex"),hrRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),"hrRegex"),fencesBeginRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`)),"fencesBeginRegex"),headingBeginRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`)),"headingBeginRegex"),htmlBeginRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")),"htmlBeginRegex")},Vk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xk=/(?:[*+-]|\d{1,9}[.)])/,Kk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Zk=Yk(Kk).replace(/bull/g,Xk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Qk=Yk(Kk).replace(/bull/g,Xk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tT=/(?!\s*\])(?:\\.|[^\[\]\\])+/,eT=Yk(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",tT).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rT=Yk(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xk).getRegex(),nT="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",iT=/|$))/,aT=Yk("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",iT).replace("tag",nT).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sT=Yk(Jk).replace("hr",Vk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",nT).getRegex(),oT={blockquote:Yk(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sT).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:eT,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Vk,html:aT,lheading:Zk,list:rT,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:sT,table:Wk,text:/^[^\n]+/},lT=Yk("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",nT).getRegex(),cT={...oT,lheading:Qk,table:lT,paragraph:Yk(Jk).replace("hr",Vk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lT).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",nT).getRegex()},hT={...oT,html:Yk("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",iT).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Yk(Jk).replace("hr",Vk).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Zk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uT=/^( {2,}|\\)\n(?!\s*$)/,dT=/[\p{P}\p{S}]/u,pT=/[\s\p{P}\p{S}]/u,gT=/[^\s\p{P}\p{S}]/u,fT=Yk(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pT).getRegex(),mT=/(?!~)[\p{P}\p{S}]/u,yT=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vT=Yk(yT,"u").replace(/punct/g,dT).getRegex(),xT=Yk(yT,"u").replace(/punct/g,mT).getRegex(),bT="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wT=Yk(bT,"gu").replace(/notPunctSpace/g,gT).replace(/punctSpace/g,pT).replace(/punct/g,dT).getRegex(),kT=Yk(bT,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,mT).getRegex(),TT=Yk("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gT).replace(/punctSpace/g,pT).replace(/punct/g,dT).getRegex(),_T=Yk(/\\(punct)/,"gu").replace(/punct/g,dT).getRegex(),ET=Yk(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),CT=Yk(iT).replace("(?:--\x3e|$)","--\x3e").getRegex(),ST=Yk("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",CT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),AT=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,LT=Yk(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",AT).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NT=Yk(/^!?\[(label)\]\[(ref)\]/).replace("label",AT).replace("ref",tT).getRegex(),IT=Yk(/^!?\[(ref)\](?:\[\])?/).replace("ref",tT).getRegex(),RT={_backpedal:Wk,anyPunctuation:_T,autolink:ET,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:uT,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Wk,emStrongLDelim:vT,emStrongRDelimAst:wT,emStrongRDelimUnd:TT,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:LT,nolink:IT,punctuation:fT,reflink:NT,reflinkSearch:Yk("reflink|nolink(?!\\()","g").replace("reflink",NT).replace("nolink",IT).getRegex(),tag:ST,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},FT=o((t=>$T[t]),"getEscapeReplacement");function zT(t,e){if(e){if(Hk.escapeTest.test(t))return t.replace(Hk.escapeReplace,FT)}else if(Hk.escapeTestNoEncode.test(t))return t.replace(Hk.escapeReplaceNoEncode,FT);return t}function UT(t){try{t=encodeURI(t).replace(Hk.percentDecode,"%")}catch{return null}return t}function GT(t,e){const r=t.replace(Hk.findPipe,((t,e,r)=>{let n=!1,i=e;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})),n=r.split(Hk.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length{const e=t.match(r.other.beginningSpace);if(null===e)return t;const[n]=e;return n.length>=i.length?t.slice(i.length):t})).join("\n")}o(zT,"escape"),o(UT,"cleanUrl"),o(GT,"splitCells"),o(qT,"rtrim"),o(jT,"findClosingBracket"),o(WT,"outputLink"),o(YT,"indentCodeCompensation");var HT=class{static{o(this,"_Tokenizer")}options;rules;lexer;constructor(t){this.options=t||qk}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:qT(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],r=YT(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=qT(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:qT(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=qT(e[0],"\n").split("\n"),r="",n="";const i=[];for(;t.length>0;){let e=!1;const a=[];let s;for(s=0;s1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let s=!1;for(;t;){let r=!1,n="",o="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;n=e[0],t=t.substring(n.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(t=>" ".repeat(3*t.length))),c=t.split("\n",1)[0],h=!l.trim(),u=0;if(this.options.pedantic?(u=2,o=l.trimStart()):h?u=e[1].length+1:(u=e[2].search(this.rules.other.nonSpaceChar),u=u>4?1:u,o=l.slice(u),u+=e[1].length),h&&this.rules.other.blankLine.test(c)&&(n+=c+"\n",t=t.substring(c.length+1),r=!0),!r){const e=this.rules.other.nextBulletRegex(u),r=this.rules.other.hrRegex(u),i=this.rules.other.fencesBeginRegex(u),a=this.rules.other.headingBeginRegex(u),s=this.rules.other.htmlBeginRegex(u);for(;t;){const d=t.split("\n",1)[0];let p;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),p=c):p=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(a.test(c))break;if(s.test(c))break;if(e.test(c))break;if(r.test(c))break;if(p.search(this.rules.other.nonSpaceChar)>=u||!c.trim())o+="\n"+p.slice(u);else{if(h)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(a.test(l))break;if(r.test(l))break;o+="\n"+c}h||c.trim()||(h=!0),n+=d+"\n",t=t.substring(d.length+1),l=p.slice(u)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(s=!0));let d,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(o),p&&(d="[ ] "!==p[0],o=o.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:n,task:!!p,checked:d,loose:!1,text:o,tokens:[]}),i.raw+=n}const o=i.items.at(-1);if(!o)return;o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t"space"===t.type)),r=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));i.loose=r}if(i.loose)for(let t=0;t({text:t,tokens:this.lexer.inline(t),header:!1,align:a.align[e]}))));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=qT(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=jT(e[2],"()");if(t>-1){const r=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(r);t&&(r=t[1],n=t[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),WT(e,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const t=e[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=r[0].charAt(0);return{type:"text",raw:t,text:t}}return WT(r,t,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!n)return;if(n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const r=[...n[0]].length-1;let i,a,s=r,o=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+r);null!=(n=l.exec(e));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){s+=a;continue}if((n[5]||n[6])&&r%3&&!((r+a)%3)){o+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+o);const e=[...n[0]][0].length,l=t.slice(0,r+n.index+e+a);if(Math.min(r,a)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,r;return"@"===e[2]?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,r;if("@"===e[2])t=e[0],r="mailto:"+t;else{let n;do{n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(n!==e[0]);t=e[0],r="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},VT=class t{static{o(this,"_Lexer")}tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||qk,this.options.tokenizer=this.options.tokenizer||new HT,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:Hk,block:PT.normal,inline:BT.normal};this.options.pedantic?(e.block=PT.pedantic,e.inline=BT.pedantic):this.options.gfm&&(e.block=PT.gfm,this.options.breaks?e.inline=BT.breaks:e.inline=BT.gfm),this.tokenizer.rules=e}static get rules(){return{block:PT,inline:BT}}static lex(e,r){return new t(r).lex(e)}static lexInline(e,r){return new t(r).inlineTokens(e)}lex(t){t=t.replace(Hk.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0))))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);const r=e.at(-1);1===n.raw.length&&void 0!==r?r.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.at(-1).src=r.text):e.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}let i=t;if(this.options.extensions?.startBlock){let e=1/0;const r=t.slice(1);let n;this.options.extensions.startBlock.forEach((t=>{n=t.call({lexer:this},r),"number"==typeof n&&n>=0&&(e=Math.min(e,n))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){const a=e.at(-1);r&&"paragraph"===a?.type?(a.raw+="\n"+n.raw,a.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(n),r=i.length!==t.length,t=t.substring(n.raw.length)}else if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);const r=e.at(-1);"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):e.push(n)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let r=t,n=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(r));)t.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,a="";for(;t;){let n;if(i||(a=""),i=!1,this.options.extensions?.inline?.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0))))continue;if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length);const r=e.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,r,a)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),e.push(n);continue}let s=t;if(this.options.extensions?.startInline){let e=1/0;const r=t.slice(1);let n;this.options.extensions.startInline.forEach((t=>{n=t.call({lexer:this},r),"number"==typeof n&&n>=0&&(e=Math.min(e,n))})),e<1/0&&e>=0&&(s=t.substring(0,e+1))}if(n=this.tokenizer.inlineText(s)){t=t.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0;const r=e.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):e.push(n)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}},XT=class{static{o(this,"_Renderer")}options;parser;constructor(t){this.options=t||qk}space(t){return""}code({text:t,lang:e,escaped:r}){const n=(e||"").match(Hk.notSpaceStart)?.[0],i=t.replace(Hk.endingNewline,"")+"\n";return n?'
'+(r?i:zT(i,!0))+"
\n":"
"+(r?i:zT(i,!0))+"
\n"}blockquote({tokens:t}){return`
\n${this.parser.parse(t)}
\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)}\n`}hr(t){return"
\n"}list(t){const e=t.ordered,r=t.start;let n="";for(let e=0;e\n"+n+"\n"}listitem(t){let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=r+" "+zT(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`
  • ${e}
  • \n`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    \n`}table(t){let e="",r="";for(let e=0;e${n}`),"\n\n"+e+"\n"+n+"
    \n"}tablerow({text:t}){return`\n${t}\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`\n`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${zT(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:r}){const n=this.parser.parseInline(r),i=UT(t);if(null===i)return n;let a='
    ",a}image({href:t,title:e,text:r}){const n=UT(t);if(null===n)return zT(r);let i=`${r}{const i=t[n].flat(1/0);r=r.concat(this.walkTokens(i,e))})):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const r=e.renderers[t.name];e.renderers[t.name]=r?function(...e){let n=t.renderer.apply(this,e);return!1===n&&(n=r.apply(this,e)),n}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const r=e[t.level];r?r.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),r.extensions=e),t.renderer){const e=this.defaults.renderer||new XT(this.defaults);for(const r in t.renderer){if(!(r in e))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,i=t.renderer[n],a=e[n];e[n]=(...t)=>{let r=i.apply(e,t);return!1===r&&(r=a.apply(e,t)),r||""}}r.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new HT(this.defaults);for(const r in t.tokenizer){if(!(r in e))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,i=t.tokenizer[n],a=e[n];e[n]=(...t)=>{let r=i.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new QT;for(const r in t.hooks){if(!(r in e))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const n=r,i=t.hooks[n],a=e[n];QT.passThroughHooks.has(r)?e[n]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>a.call(e,t)));const r=i.call(e,t);return a.call(e,r)}:e[n]=(...t)=>{let r=i.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,n=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(n.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return VT.lex(t,e??this.defaults)}parser(t,e){return ZT.parse(t,e??this.defaults)}parseMarkdown(t){const e=o(((e,r)=>{const n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===n.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==e)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const s=i.hooks?i.hooks.provideLexer():t?VT.lex:VT.lexInline,o=i.hooks?i.hooks.provideParser():t?ZT.parse:ZT.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(e):e).then((t=>s(t,i))).then((t=>i.hooks?i.hooks.processAllTokens(t):t)).then((t=>i.walkTokens?Promise.all(this.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>o(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let t=s(e,i);i.hooks&&(t=i.hooks.processAllTokens(t)),i.walkTokens&&this.walkTokens(t,i.walkTokens);let r=o(t,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(t){return a(t)}}),"parse");return e}onError(t,e){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="

    An error occurred:

    "+zT(r.message+"",!0)+"
    ";return e?Promise.resolve(t):t}if(e)return Promise.reject(r);throw r}}},t_=new JT;function e_(t,e){return t_.parse(t,e)}function r_(t,{markdownAutoWrap:e}){const r=Uk(t.replace(//g,"\n").replace(/\n{2,}/g,"\n"));return!1===e?r.replace(/ /g," "):r}function n_(t,e={}){const r=r_(t,e),n=e_.lexer(r),i=[[]];let a=0;function s(t,e="normal"){if("text"===t.type){t.text.split("\n").forEach(((t,r)=>{0!==r&&(a++,i.push([])),t.split(" ").forEach((t=>{(t=t.replace(/'/g,"'"))&&i[a].push({content:t,type:e})}))}))}else"strong"===t.type||"em"===t.type?t.tokens.forEach((e=>{s(e,t.type)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})}return o(s,"processNode"),n.forEach((t=>{"paragraph"===t.type?t.tokens?.forEach((t=>{s(t)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})})),i}function i_(t,{markdownAutoWrap:e}={}){const r=e_.lexer(t);function n(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"
    ").replace(/ /g," "):t.text.replace(/\n */g,"
    "):"strong"===t.type?`${t.tokens?.map(n).join("")}`:"em"===t.type?`${t.tokens?.map(n).join("")}`:"paragraph"===t.type?`

    ${t.tokens?.map(n).join("")}

    `:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:`Unsupported markdown: ${t.type}`}return o(n,"output"),r.map(n).join("")}function a_(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map((t=>t.segment)):[...t]}function s_(t,e){return o_(t,[],a_(e.content),e.type)}function o_(t,e,r,n){if(0===r.length)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?o_(t,s,a,n):(0===e.length&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}function l_(t,e){if(t.some((({content:t})=>t.includes("\n"))))throw new Error("splitLineToFitWidth does not support newlines in the line");return c_(t,e)}function c_(t,e,r=[],n=[]){if(0===t.length)return n.length>0&&r.push(n),r.length>0?r:[];let i="";" "===t[0].content&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(""!==i&&s.push({content:i,type:"normal"}),s.push(a),e(s))return c_(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[n,i]=s_(e,a);r.push([n]),i.content&&t.unshift(i)}return c_(t,e,r)}function h_(t,e){e&&t.attr("style",e)}async function u_(t,e,r,n,i=!1){const a=t.append("foreignObject");a.attr("width",10*r+"px"),a.attr("height",10*r+"px");const s=a.append("xhtml:div");let o=e.label;e.label&&Cr(e.label)&&(o=await Ar(e.label.replace(Lr.lineBreakRegex,"\n"),Qr()));const l=e.isNode?"nodeLabel":"edgeLabel",c=s.append("span");c.html(o),h_(c,e.labelStyle),c.attr("class",`${l} ${n}`),h_(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",r+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let h=s.node().getBoundingClientRect();return h.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),h=s.node().getBoundingClientRect()),a.node()}function d_(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function p_(t,e,r){const n=t.append("text"),i=d_(n,1,e);m_(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}function g_(t,e,r){const n=t.append("text"),i=d_(n,1,e);m_(i,[{content:r,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function f_(t,e,r,n=!1){const i=e.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),s=i.append("text").attr("y","-10.1");let l=0;for(const e of r){const r=o((e=>p_(i,1.1,e)<=t),"checkWidth"),n=r(e)?[e]:l_(e,r);for(const t of n){m_(d_(s,l,1.1),t),l++}}if(n){const t=s.node().getBBox(),e=2;return a.attr("x",t.x-e).attr("y",t.y-e).attr("width",t.width+2*e).attr("height",t.height+2*e),i.node()}return s.node()}function m_(t,e){t.text(""),e.forEach(((e,r)=>{const n=t.append("tspan").attr("font-style","em"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===r?n.text(e.content):n.text(" "+e.content)}))}function y_(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,(t=>``))}o(e_,"marked"),e_.options=e_.setOptions=function(t){return t_.setOptions(t),e_.defaults=t_.defaults,jk(e_.defaults),e_},e_.getDefaults=Gk,e_.defaults=qk,e_.use=function(...t){return t_.use(...t),e_.defaults=t_.defaults,jk(e_.defaults),e_},e_.walkTokens=function(t,e){return t_.walkTokens(t,e)},e_.parseInline=t_.parseInline,e_.Parser=ZT,e_.parser=ZT.parse,e_.Renderer=XT,e_.TextRenderer=KT,e_.Lexer=VT,e_.lexer=VT.lex,e_.Tokenizer=HT,e_.Hooks=QT,e_.parse=e_,e_.options,e_.setOptions,e_.use,e_.walkTokens,e_.parseInline,ZT.parse,VT.lex,o(r_,"preprocessMarkdown"),o(n_,"markdownToLines"),o(i_,"markdownToHTML"),o(a_,"splitTextToChars"),o(s_,"splitWordToFitWidth"),o(o_,"splitWordToFitWidthRecursion"),o(l_,"splitLineToFitWidth"),o(c_,"splitLineToFitWidthRecursion"),o(h_,"applyStyle"),o(u_,"addHtmlSpan"),o(d_,"createTspan"),o(p_,"computeWidthOfText"),o(g_,"computeDimensionOfText"),o(f_,"createFormattedText"),o(m_,"updateTextContentAndStyles"),o(y_,"replaceIconSubstring");var v_=o((async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(y.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",l),a){const n=i_(e,c),a=y_($k(n)),h=e.replace(/\\\\/g,"\\"),u={isNode:s,label:Cr(e)?h:a,labelStyle:r.replace("fill:","color:")};return await u_(t,u,o,i,l)}{const n=f_(o,t,n_(e.replace(//g,"
    ").replace("
    ","
    "),c),!!e&&l);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ga(n).attr("style",t)}else{const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ga(n).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ga(n).select("text").attr("style",e)}return n}}),"createText"),x_=o((async(t,e,r)=>{let n;const i=e.useHtmlLabels||yr(Qr()?.htmlLabels);n=r||"node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",zk(e.labelStyle));let l;l=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];const c=await v_(s,hr($k(l),Qr()),{useHtmlLabels:i,width:e.width||Qr().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let h=c.getBBox();const u=(e?.padding??0)/2;if(i){const t=c.children[0],e=Ga(c),r=t.getElementsByTagName("img");if(r){const t=""===l.replace(/]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=Qr().fontSize?Qr().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[n=Lt.fontSize]=Dk(t),i=n*r+"px";e.style.minWidth=i,e.style.maxWidth=i}else e.style.width="100%";r(e)}o(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return i?s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):s.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:u,label:s}}),"labelHelper"),b_=o((async(t,e,r)=>{const n=r.useHtmlLabels||yr(Qr()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await v_(i,hr($k(e),Qr()),{useHtmlLabels:n,width:r.width||Qr()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(yr(Qr()?.flowchart?.htmlLabels)){const t=a.children[0],e=Ga(a);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}}),"insertLabel"),w_=o(((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height}),"updateNodeBounds"),k_=o(((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||"")),"getNodeClasses");function T_(t){const e=t.map(((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`));return e.push("Z"),e.join(" ")}function __(t,e,r,n,i,a){const s=[],o=r-t,l=n-e,c=o/a,h=2*Math.PI/c,u=e+l/2;for(let e=0;e<=50;e++){const r=t+e/50*o,n=u+i*Math.sin(h*(r-t));s.push({x:r,y:n})}return s}function E_(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;i2&&n.push(t)}const i=[];e=Math.max(e,.1);const a=[];for(const t of n)for(let e=0;et.ymine.ymin?1:t.xe.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!a.length)return i;let s=[],o=a[0].ymin,l=0;for(;s.length||a.length;){if(a.length){let t=-1;for(let e=0;eo);e++)t=e;a.splice(0,t+1).forEach((t=>{s.push({s:o,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=o))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==r||l%e==0)&&s.length>1)for(let t=0;t=s.length)break;const r=s[t].edge,n=s[e].edge;i.push([[Math.round(r.x),o],[Math.round(n.x),o]])}o+=r,s.forEach((t=>{t.edge.x=t.edge.x+r*t.edge.islope})),l++}return i}(s,a,n);if(i){for(const t of s)C_(t,o,-i);!function(t,e,r){const n=[];t.forEach((t=>n.push(...t))),C_(n,e,r)}(l,o,-i)}return l}function L_(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&((null===(r=e.randomizer)||void 0===r?void 0:r.next())||Math.random())>.7&&(a=i),A_(t,i,n,a||1)}o(T_,"createPathFromPoints"),o(__,"generateFullSineWavePoints"),o(E_,"generateCirclePoints"),o(C_,"t"),o(S_,"e"),o(A_,"s"),o(L_,"n");var N_=class{static{o(this,"o")}constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const r=L_(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){const r=[];for(const n of t)r.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return r}};function I_(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}o(I_,"a");var R_=class extends N_{static{o(this,"h")}fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);const n=L_(t,Object.assign({},e,{hachureGap:r})),i=Math.PI/180*e.hachureAngle,a=[],s=.5*r*Math.cos(i),o=.5*r*Math.sin(i);for(const[t,e]of n)I_([t,e])&&a.push([[t[0]-s,t[1]+o],[...e]],[[t[0]+s,t[1]-o],[...e]]);return{type:"fillSketch",ops:this.renderLines(a,e)}}},M_=class extends N_{static{o(this,"r")}fillPolygons(t,e){const r=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),i=this._fillPolygons(t,n);return r.ops=r.ops.concat(i.ops),r}},D_=class{static{o(this,"i")}constructor(t){this.helper=t}fillPolygons(t,e){const r=L_(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){const r=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);const a=n/4;for(const s of t){const t=I_(s),o=t/n,l=Math.ceil(o)-1,c=t-l*n,h=(s[0][0]+s[1][0])/2-n/4,u=Math.min(s[0][1],s[1][1]);for(let t=0;t{const a=I_(t),s=Math.floor(a/(r+n)),o=(a+n-s*(r+n))/2;let l=t[0],c=t[1];l[0]>c[0]&&(l=t[1],c=t[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let t=0;t{const i=I_(t),a=Math.round(i/(2*e));let s=t[0],o=t[1];s[0]>o[0]&&(s=t[1],o=t[0]);const l=Math.atan((o[1]-s[1])/(o[0]-s[0]));for(let t=0;tn%2?t+r:t+e));a.push({key:"C",data:t}),e=t[4],r=t[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const t=o.map(((t,n)=>n%2?t+r:t+e));a.push({key:"Q",data:t}),e=t[2],r=t[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const t=o.map(((t,n)=>n%2?t+r:t+e));a.push({key:"S",data:t}),e=t[2],r=t[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function q_(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:c,data:h}of t){switch(c){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let t=0,a=0;"C"===r||"S"===r?(t=n+(n-o),a=i+(i-l)):(t=n,a=i),e.push({key:"C",data:[t,a,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[t,a]=h;let s=0,c=0;"Q"===r||"T"===r?(s=n+(n-o),c=i+(i-l)):(s=n,c=i);const u=n+2*(s-n)/3,d=i+2*(c-i)/3,p=t+2*(s-t)/3,g=a+2*(c-a)/3;e.push({key:"C",data:[u,d,p,g,t,a]}),o=s,l=c,n=t,i=a;break}case"Q":{const[t,r,a,s]=h,c=n+2*(t-n)/3,u=i+2*(r-i)/3,d=a+2*(t-a)/3,p=s+2*(r-s)/3;e.push({key:"C",data:[c,u,d,p,a,s]}),o=t,l=r,n=a,i=s;break}case"A":{const t=Math.abs(h[0]),r=Math.abs(h[1]),a=h[2],s=h[3],o=h[4],l=h[5],c=h[6];0===t||0===r?(e.push({key:"C",data:[n,i,l,c,l,c]}),n=l,i=c):n===l&&i===c||(W_(n,i,l,c,t,r,a,s,o).forEach((function(t){e.push({key:"C",data:t})})),n=l,i=c);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=c}return e}function j_(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function W_(t,e,r,n,i,a,s,o,l,c){const h=(u=s,Math.PI*u/180);var u;let d=[],p=0,g=0,f=0,m=0;if(c)[p,g,f,m]=c;else{[t,e]=j_(t,e,-h),[r,n]=j_(r,n,-h);const s=(t-r)/2,c=(e-n)/2;let u=s*s/(i*i)+c*c/(a*a);u>1&&(u=Math.sqrt(u),i*=u,a*=u);const d=i*i,y=a*a,v=d*y-d*c*c-y*s*s,x=d*c*c+y*s*s,b=(o===l?-1:1)*Math.sqrt(Math.abs(v/x));f=b*i*c/a+(t+r)/2,m=b*-a*s/i+(e+n)/2,p=Math.asin(parseFloat(((e-m)/a).toFixed(9))),g=Math.asin(parseFloat(((n-m)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const t=g,e=r,o=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=W_(r=f+i*Math.cos(g),n=m+a*Math.sin(g),e,o,i,a,s,0,l,[g,t,f,m])}y=g-p;const v=Math.cos(p),x=Math.sin(p),b=Math.cos(g),w=Math.sin(g),k=Math.tan(y/4),T=4/3*i*k,_=4/3*a*k,E=[t,e],C=[t+T*x,e-_*v],S=[r+T*w,n-_*b],A=[r,n];if(C[0]=2*E[0]-C[0],C[1]=2*E[1]-C[1],c)return[C,S,A].concat(d);{d=[C,S,A].concat(d);const t=[];for(let e=0;e2){const i=[];for(let e=0;e2*Math.PI&&(p=0,g=2*Math.PI);const f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),y=dE(m,c,h,u,d,p,g,1,l);if(!l.disableMultiStroke){const t=dE(m,c,h,u,d,p,g,1.5,l);y.push(...t)}return s&&(o?y.push(...oE(c,h,c+u*Math.cos(p),h+d*Math.sin(p),l),...oE(c,h,c+u*Math.cos(g),h+d*Math.sin(g),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(p),h+d*Math.sin(p)]})),{type:"path",ops:y}}function tE(t,e){const r=q_(G_(U_(t))),n=[];let i=[0,0],a=[0,0];for(const{key:t,data:s}of r)switch(t){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...oE(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[t,r,i,o,l,c]=s;n.push(...pE(t,r,i,o,l,c,a,e)),a=[l,c];break}case"Z":n.push(...oE(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function eE(t,e){const r=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,i=n.length;if(i>2){r.push({op:"move",data:[n[0][0]+sE(t,e),n[0][1]+sE(t,e)]});for(let a=1;a500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>l&&(u=c/10);const d=u/2,p=.2+.2*iE(i);let g=i.bowing*i.maxRandomnessOffset*(n-e)/200,f=i.bowing*i.maxRandomnessOffset*(t-r)/200;g=sE(g,i,h),f=sE(f,i,h);const m=[],y=o((()=>sE(d,i,h)),"M"),v=o((()=>sE(u,i,h)),"k"),x=i.preserveVertices;return a&&(s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:sE(u,i,h)),e+(x?0:sE(u,i,h))]})),s?m.push({op:"bcurveTo",data:[g+t+(r-t)*p+y(),f+e+(n-e)*p+y(),g+t+2*(r-t)*p+y(),f+e+2*(n-e)*p+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[g+t+(r-t)*p+v(),f+e+(n-e)*p+v(),g+t+2*(r-t)*p+v(),f+e+2*(n-e)*p+v(),r+(x?0:v()),n+(x?0:v())]}),m}function cE(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+sE(e,r),t[0][1]+sE(e,r)]),n.push([t[0][0]+sE(e,r),t[0][1]+sE(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+21&&i.push(r)):i.push(r),i.push(t[e+3])}else{const n=.5,a=t[e+0],s=t[e+1],o=t[e+2],l=t[e+3],c=vE(a,s,n),h=vE(s,o,n),u=vE(o,l,n),d=vE(c,h,n),p=vE(h,u,n),g=vE(d,p,n);xE([a,c,d,g],0,r,i),xE([g,p,u,l],0,r,i)}var a,s;return i}function bE(t,e){return wE(t,0,t.length,e)}function wE(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,c=1;for(let n=e+1;nl&&(l=e,c=n)}return Math.sqrt(l)>n?(wE(t,e,c+1,n,a),wE(t,c,r,n,a)):(a.length||a.push(s),a.push(o)),a}function kE(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let r=0;r0?wE(n,0,n.length,r):n}o(H_,"v"),o(V_,"S"),o(X_,"O"),o(K_,"L"),o(Z_,"T"),o(Q_,"D"),o(J_,"A"),o(tE,"_"),o(eE,"I"),o(rE,"C"),o(nE,"z"),o(iE,"W"),o(aE,"E"),o(sE,"G"),o(oE,"$"),o(lE,"R"),o(cE,"j"),o(hE,"q"),o(uE,"F"),o(dE,"V"),o(pE,"Z"),o(gE,"Q"),o(fE,"H"),o(mE,"N"),o(yE,"B"),o(vE,"J"),o(xE,"K"),o(bE,"U"),o(wE,"X"),o(kE,"Y");var TE="none",_E=class{static{o(this,"et")}constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,n,i){const a=this._o(i);return this._d("line",[H_(t,e,r,n,a)],a)}rectangle(t,e,r,n,i){const a=this._o(i),s=[],o=X_(t,e,r,n,a);if(a.fill){const i=[[t,e],[t+r,e],[t+r,e+n],[t,e+n]];"solid"===a.fillStyle?s.push(eE([i],a)):s.push(rE([i],a))}return a.stroke!==TE&&s.push(o),this._d("rectangle",s,a)}ellipse(t,e,r,n,i){const a=this._o(i),s=[],o=Z_(r,n,a),l=Q_(t,e,a,o);if(a.fill)if("solid"===a.fillStyle){const r=Q_(t,e,a,o).opset;r.type="fillPath",s.push(r)}else s.push(rE([l.estimatedPoints],a));return a.stroke!==TE&&s.push(l.opset),this._d("ellipse",s,a)}circle(t,e,r,n){const i=this.ellipse(t,e,r,r,n);return i.shape="circle",i}linearPath(t,e){const r=this._o(e);return this._d("linearPath",[V_(t,!1,r)],r)}arc(t,e,r,n,i,a,s=!1,o){const l=this._o(o),c=[],h=J_(t,e,r,n,i,a,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){const s=Object.assign({},l);s.disableMultiStroke=!0;const o=J_(t,e,r,n,i,a,!0,!1,s);o.type="fillPath",c.push(o)}else c.push(function(t,e,r,n,i,a,s){const o=t,l=e;let c=Math.abs(r/2),h=Math.abs(n/2);c+=sE(.01*c,s),h+=sE(.01*h,s);let u=i,d=a;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/s.curveStepCount,g=[];for(let t=u;t<=d;t+=p)g.push([o+c*Math.cos(t),l+h*Math.sin(t)]);return g.push([o+c*Math.cos(d),l+h*Math.sin(d)]),g.push([o,l]),rE([g],s)}(t,e,r,n,i,a,l));return l.stroke!==TE&&c.push(h),this._d("arc",c,l)}curve(t,e){const r=this._o(e),n=[],i=K_(t,r);if(r.fill&&r.fill!==TE)if("solid"===r.fillStyle){const e=K_(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],i=t;if(i.length){const t="number"==typeof i[0][0]?[i]:i;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...kE(fE([n[0],n[0],n[1],n[2]]),10,(1+r.roughness)/2)):e.push(...kE(fE(n),10,(1+r.roughness)/2))}e.length&&n.push(rE([e],r))}return r.stroke!==TE&&n.push(i),this._d("curve",n,r)}polygon(t,e){const r=this._o(e),n=[],i=V_(t,!0,r);return r.fill&&("solid"===r.fillStyle?n.push(eE([t],r)):n.push(rE([t],r))),r.stroke!==TE&&n.push(i),this._d("polygon",n,r)}path(t,e){const r=this._o(e),n=[];if(!t)return this._d("path",n,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&"transparent"!==r.fill&&r.fill!==TE,a=r.stroke!==TE,s=!!(r.simplification&&r.simplification<1),l=function(t,e,r){const n=q_(G_(U_(t))),i=[];let a=[],s=[0,0],l=[];const c=o((()=>{l.length>=4&&a.push(...kE(l,1)),l=[]}),"i"),h=o((()=>{c(),a.length&&(i.push(a),a=[])}),"c");for(const{key:t,data:e}of n)switch(t){case"M":h(),s=[e[0],e[1]],a.push(s);break;case"L":c(),a.push([e[0],e[1]]);break;case"C":if(!l.length){const t=a.length?a[a.length-1]:s;l.push([t[0],t[1]])}l.push([e[0],e[1]]),l.push([e[2],e[3]]),l.push([e[4],e[5]]);break;case"Z":c(),a.push([s[0],s[1]])}if(h(),!r)return i;const u=[];for(const t of i){const e=bE(t,r);e.length&&u.push(e)}return u}(t,0,s?4-4*(r.simplification||1):(1+r.roughness)/2),c=tE(t,r);if(i)if("solid"===r.fillStyle)if(1===l.length){const e=tE(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(eE(l,r));else n.push(rE(l,r));return a&&(s?l.forEach((t=>{n.push(V_(t,!1,r))})):n.push(c)),this._d("path",n,r)}opsToPath(t,e){let r="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":r+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":r+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":r+=`L${t[0]} ${t[1]} `}}return r.trim()}toPaths(t){const e=t.sets||[],r=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:TE};break;case"fillPath":e={d:this.opsToPath(t),stroke:TE,strokeWidth:0,fill:r.fill||TE};break;case"fillSketch":e=this.fillSketch(t,r)}e&&n.push(e)}return n}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||TE,strokeWidth:r,fill:TE}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}},EE=class{static{o(this,"st")}constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new _E(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),n=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,a,i),n.restore();break;case"fillPath":{n.save(),n.fillStyle=r.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,i,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,r)}}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=n,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof r&&r>=0?n.data.map((t=>+t.toFixed(r))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,n,i){const a=this.gen.line(t,e,r,n,i);return this.draw(a),a}rectangle(t,e,r,n,i){const a=this.gen.rectangle(t,e,r,n,i);return this.draw(a),a}ellipse(t,e,r,n,i){const a=this.gen.ellipse(t,e,r,n,i);return this.draw(a),a}circle(t,e,r,n){const i=this.gen.circle(t,e,r,n);return this.draw(i),i}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,n,i,a,s=!1,o){const l=this.gen.arc(t,e,r,n,i,a,s,o);return this.draw(l),l}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){const r=this.gen.path(t,e);return this.draw(r),r}},CE="http://www.w3.org/2000/svg",SE=class{static{o(this,"ot")}constructor(t,e){this.svg=t,this.gen=new _E(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,i=n.createElementNS(CE,"g"),a=t.options.fixedDecimalPlaceDigits;for(const s of e){let e=null;switch(s.type){case"path":e=n.createElementNS(CE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke",r.stroke),e.setAttribute("stroke-width",r.strokeWidth+""),e.setAttribute("fill","none"),r.strokeLineDash&&e.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(CE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",r.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,s,r)}e&&i.appendChild(e)}return i}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2);const i=t.createElementNS(CE,"path");return i.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",n+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,n,i){const a=this.gen.line(t,e,r,n,i);return this.draw(a)}rectangle(t,e,r,n,i){const a=this.gen.rectangle(t,e,r,n,i);return this.draw(a)}ellipse(t,e,r,n,i){const a=this.gen.ellipse(t,e,r,n,i);return this.draw(a)}circle(t,e,r,n){const i=this.gen.circle(t,e,r,n);return this.draw(i)}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,n,i,a,s=!1,o){const l=this.gen.arc(t,e,r,n,i,a,s,o);return this.draw(l)}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r)}path(t,e){const r=this.gen.path(t,e);return this.draw(r)}},AE={canvas:o(((t,e)=>new EE(t,e)),"canvas"),svg:o(((t,e)=>new SE(t,e)),"svg"),generator:o((t=>new _E(t)),"generator"),newSeed:o((()=>_E.newSeed()),"newSeed")},LE=o(((t,e)=>{var r,n,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),r=0===o?0:c*s/o,n=c):(s<0&&(l=-l),r=l,n=0===s?0:l*o/s),{x:i+r,y:a+n}}),"intersectRect"),NE=LE;function IE(t,e){e&&t.attr("style",e)}async function RE(t){const e=Ga(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div");let n=t.label;t.label&&Cr(t.label)&&(n=await Ar(t.label.replace(Lr.lineBreakRegex,"\n"),Qr()));const i=t.isNode?"nodeLabel":"edgeLabel";return r.html('"+n+""),IE(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}o(IE,"applyStyle"),o(RE,"addHtmlLabel");var ME=o((async(t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),yr(Qr().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),y.info("vertexText"+i);const t={isNode:n,label:$k(i).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``)),labelStyle:e?e.replace("fill:","color:"):e};return await RE(t)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let n=[];n="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const e of n){const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),r?n.setAttribute("class","title-row"):n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}return t}}),"createLabel"),DE=ME,OE=o(((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" ")),"createRoundedRectPathD"),PE=o((t=>{const{handDrawnSeed:e}=Qr();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}}),"solidStateFill"),BE=o((t=>{const e=$E([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}}),"compileStyles"),$E=o((t=>{const e=new Map;return t.forEach((t=>{const[r,n]=t.split(":");e.set(r.trim(),n?.trim())})),e}),"styles2Map"),FE=o((t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t),"isLabelStyle"),zE=o((t=>{const{stylesArray:e}=BE(t),r=[],n=[],i=[],a=[];return e.forEach((t=>{const e=t[0];FE(e)?r.push(t.join(":")+" !important"):(n.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&a.push(t.join(":")+" !important"))})),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}}),"styles2String"),UE=o(((t,e)=>{const{themeVariables:r,handDrawnSeed:n}=Qr(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=BE(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e)}),"userNodeOverrides"),GE=o((async(t,e)=>{y.info("Creating subgraph rect for ",e.id,e);const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=zE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=yr(r.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await v_(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0});let f=g.getBBox();if(yr(r.flowchart.htmlLabels)){const t=g.children[0],e=Ga(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const m=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-m/2,b=e.y-v/2;let w;if(y.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=AE.svg(u),r=UE(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),n=t.path(OE(x,b,m,v,0),r);w=u.insert((()=>(y.debug("Rough node insert CXC",n),n)),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=u.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",m).attr("height",v);const{subGraphTitleTopMargin:k}=qy(r);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+k})`),o){const t=p.select("span");t&&t.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return NE(e,t)},{cluster:u,labelBBox:f}}),"rect"),qE=o(((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return NE(e,t)},{cluster:r,labelBBox:{width:0,height:0}}}),"noteGroup"),jE=o((async(t,e)=>{const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,c=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const p=u.node().appendChild(await DE(e.label,e.labelStyle,void 0,!0));let g=p.getBBox();if(yr(r.flowchart.htmlLabels)){const t=p.children[0],e=Ga(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}const f=0*e.padding,m=f/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+f;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height+f,x=e.height+f-g.height-6,b=e.x-y/2,w=e.y-v/2;e.width=y;const k=e.y-e.height/2-m+g.height+2;let T;if("handDrawn"===e.look){const t=e.cssClasses.includes("statediagram-cluster-alt"),r=AE.svg(c),n=e.rx||e.ry?r.path(OE(b,w,y,v,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):r.rectangle(b,w,y,v,{seed:i});T=c.insert((()=>n),":first-child");const h=r.rectangle(b,k,y,x,{fill:t?a:s,fillStyle:t?"hachure":"solid",stroke:l,seed:i});T=c.insert((()=>n),":first-child"),d=c.insert((()=>h))}else{T=h.insert("rect",":first-child");const t="outer";T.attr("class",t).attr("x",b).attr("y",w).attr("width",y).attr("height",v).attr("data-look",e.look),d.attr("class","inner").attr("x",b).attr("y",k).attr("width",y).attr("height",x)}u.attr("transform",`translate(${e.x-g.width/2}, ${w+1-(yr(r.flowchart.htmlLabels)?0:3)})`);const _=T.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(t){return NE(e,t)},{cluster:c,labelBBox:g}}),"roundedWithTitle"),WE=o((async(t,e)=>{y.info("Creating subgraph rect for ",e.id,e);const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=zE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=yr(r.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await v_(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0,width:e.width});let f=g.getBBox();if(yr(r.flowchart.htmlLabels)){const t=g.children[0],e=Ga(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const m=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-m/2,b=e.y-v/2;let w;if(y.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=AE.svg(u),r=UE(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),n=t.path(OE(x,b,m,v,e.rx),r);w=u.insert((()=>(y.debug("Rough node insert CXC",n),n)),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=u.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",m).attr("height",v);const{subGraphTitleTopMargin:k}=qy(r);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+k})`),o){const t=p.select("span");t&&t.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return NE(e,t)},{cluster:u,labelBBox:f}}),"kanbanSection"),YE=o(((t,e)=>{const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,c=e.width+l;e.diff=-e.padding;const h=e.height+l,u=e.x-c/2,d=e.y-h/2;let p;if(e.width=c,"handDrawn"===e.look){const t=AE.svg(s).rectangle(u,d,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert((()=>t),":first-child")}else{p=o.insert("rect",":first-child");const t="divider";p.attr("class",t).attr("x",u).attr("y",d).attr("width",c).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return NE(e,t)},{cluster:s,labelBBox:{}}}),"divider"),HE={rect:GE,squareRect:GE,roundedWithTitle:jE,noteGroup:qE,divider:YE,kanbanSection:WE},VE=new Map,XE=o((async(t,e)=>{const r=e.shape||"rect",n=await HE[r](t,e);return VE.set(e.id,n),n}),"insertCluster"),KE=o((()=>{VE=new Map}),"clear");function ZE(t,e){return t.intersect(e)}o(ZE,"intersectNode");var QE=ZE;function JE(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);n.x0}o(nC,"intersectLine"),o(iC,"sameSign");var aC=nC;function sC(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,c=i-t.height/2-o;for(let n=0;n1&&a.sort((function(t,e){let n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return ac),":first-child");return h.attr("class","anchor").attr("style",zk(s)),w_(e,h),e.intersect=function(t){return y.info("Circle intersect",e,1,t),oC.circle(e,1,t)},a}function cC(t,e,r,n,i,a,s){const o=(t+r)/2,l=(e+n)/2,c=Math.atan2(n-e,r-t),h=(r-t)/2/i,u=(n-e)/2/a,d=Math.sqrt(h**2+u**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-d**2),g=o+p*a*Math.sin(c)*(s?-1:1),f=l-p*i*Math.cos(c)*(s?-1:1),m=Math.atan2((e-f)/a,(t-g)/i);let y=Math.atan2((n-f)/a,(r-g)/i)-m;s&&y<0&&(y+=2*Math.PI),!s&&y>0&&(y-=2*Math.PI);const v=[];for(let t=0;t<20;t++){const e=m+t/19*y,r=g+i*Math.cos(e),n=f+a*Math.sin(e);v.push({x:r,y:n})}return v}async function hC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=a.width+e.padding+20,o=a.height+e.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:h}=e,u=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...cC(-s/2,-o/2,-s/2,o/2,c,l,!1),{x:s/2,y:o/2},...cC(s/2,o/2,s/2,-o/2,c,l,!0)],d=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=T_(u),f=d.path(g,p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),m.attr("transform",`translate(${c/2}, 0)`),w_(e,m),e.intersect=function(t){return oC.polygon(e,u,t)},i}function uC(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}async function dC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=a.height+e.padding,o=a.width+e.padding+12,l=-s,c=[{x:12,y:l},{x:o,y:l},{x:o,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let h;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=T_(c),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&h.attr("style",u)}else h=uC(i,o,s,c);return n&&h.attr("style",n),w_(e,h),e.intersect=function(t){return oC.polygon(e,c,t)},i}function pC(t,e){const{nodeStyles:r}=zE(e);e.label="";const n=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=AE.svg(n),l=UE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=T_(s),h=o.path(c,l),u=n.insert((()=>h),":first-child");return i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),r&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(t){return oC.polygon(e,s,t)},n}async function gC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s}=await x_(t,e,k_(e)),o=a.width/2+s;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=t.circle(0,0,2*o,r);l=i.insert((()=>n),":first-child"),l.attr("class","basic label-container").attr("style",zk(c))}else l=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",o).attr("cx",0).attr("cy",0);return w_(e,l),e.intersect=function(t){return y.info("Circle intersect",e,o,t),oC.circle(e,o,t)},i}function fC(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=2*t;return`M ${-n/2*e},${n/2*r} L ${n/2*e},${-n/2*r}\n M ${n/2*e},${n/2*r} L ${-n/2*e},${-n/2*r}`}function mC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:s}=e,o=AE.svg(i),l=UE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,2*a,l),h=fC(a),u=o.path(h,l),d=i.insert((()=>c),":first-child");return d.insert((()=>u)),s&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",s),n&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",n),w_(e,d),e.intersect=function(t){y.info("crossedCircle intersect",e,{radius:a,point:t});return oC.circle(e,a,t)},i}function yC(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;iv),":first-child").attr("stroke-opacity",0),x.insert((()=>m),":first-child"),x.attr("class","text"),h&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(${c}, 0)`),s.attr("transform",`translate(${-o/2+c-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),w_(e,x),e.intersect=function(t){return oC.polygon(e,d,t)},i}function xC(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;iv),":first-child").attr("stroke-opacity",0),x.insert((()=>m),":first-child"),x.attr("class","text"),h&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(${-c}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),w_(e,x),e.intersect=function(t){return oC.polygon(e,d,t)},i}function wC(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;iw),":first-child").attr("stroke-opacity",0),k.insert((()=>y),":first-child"),k.insert((()=>x),":first-child"),k.attr("class","text"),h&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${c-c/4}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),w_(e,k),e.intersect=function(t){return oC.polygon(e,p,t)},i}async function TC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(80,1.25*(a.width+2*(e.padding??0)),e?.width??0),o=Math.max(20,a.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=AE.svg(i),u=UE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=s-l,p=o/4,g=[{x:d,y:0},{x:p,y:0},{x:0,y:o/2},{x:p,y:o},{x:d,y:o},...E_(-d,-o/2,l,50,270,90)],f=T_(g),m=h.path(f,u),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",c),n&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(${-s/2}, ${-o/2})`),w_(e,y),e.intersect=function(t){return oC.polygon(e,g,t)},i}o(lC,"anchor"),o(cC,"generateArcPoints"),o(hC,"bowTieRect"),o(uC,"insertPolygonShape"),o(dC,"card"),o(pC,"choice"),o(gC,"circle"),o(fC,"createLine"),o(mC,"crossedCircle"),o(yC,"generateCirclePoints"),o(vC,"curlyBraceLeft"),o(xC,"generateCirclePoints"),o(bC,"curlyBraceRight"),o(wC,"generateCirclePoints"),o(kC,"curlyBraces"),o(TC,"curvedTrapezoid");var _C=o(((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n].join(" ")),"createCylinderPathD"),EC=o(((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n].join(" ")),"createOuterCylinderPathD"),CC=o(((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createInnerCylinderPathD");async function SC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+e.padding,e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(a.height+c+e.padding,e.height??0);let u;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=EC(0,0,o,h,l,c),n=CC(0,c,o,h,l,c),a=t.path(r,UE(e,{})),s=t.path(n,UE(e,{fill:"none"}));u=i.insert((()=>s),":first-child"),u=i.insert((()=>a),":first-child"),u.attr("class","basic label-container"),d&&u.attr("style",d)}else{const t=_C(0,0,o,h,l,c);u=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",zk(d)).attr("style",n)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),w_(e,u),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+(e.padding??0)/1.5-(a.y-(a.top??0))})`),e.intersect=function(t){const r=oC.rect(e,t),n=r.x-(e.x??0);if(0!=l&&(Math.abs(n)<(e.width??0)/2||Math.abs(n)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-n*n/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),r.y+=i}return r},i}async function AC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=a.width+e.padding,l=a.height+e.padding,c=.2*l,h=-o/2,u=-l/2-c/2,{cssStyles:d}=e,p=AE.svg(i),g=UE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:u+c},{x:-h,y:u+c},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+c}],m=p.polygon(f.map((t=>[t.x,t.y])),g),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",d),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),s.attr("transform",`translate(${h+(e.padding??0)/2-(a.x-(a.left??0))}, ${u+c+(e.padding??0)/2-(a.y-(a.top??0))})`),w_(e,y),e.intersect=function(t){return oC.rect(e,t)},i}async function LC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s}=await x_(t,e,k_(e)),o=a.width/2+s+5,l=a.width/2+s;let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{roughness:.2,strokeWidth:2.5}),n=UE(e,{roughness:.2,strokeWidth:1.5}),a=t.circle(0,0,2*o,r),s=t.circle(0,0,2*l,n);c=i.insert("g",":first-child"),c.attr("class",zk(e.cssClasses)).attr("style",zk(h)),c.node()?.appendChild(a),c.node()?.appendChild(s)}else{c=i.insert("g",":first-child");const t=c.insert("circle",":first-child"),e=c.insert("circle");c.attr("class","basic label-container").attr("style",n),t.attr("class","outer-circle").attr("style",n).attr("r",o).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0)}return w_(e,c),e.intersect=function(t){return y.info("DoubleCircle intersect",e,o,t),oC.circle(e,o,t)},i}function NC(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zE(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=AE.svg(a),{nodeBorder:l}=r,c=UE(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);const h=o.circle(0,0,14,c),u=a.insert((()=>h),":first-child");return u.selectAll("path").attr("style",`fill: ${l} !important;`),s&&s.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),w_(e,u),e.intersect=function(t){y.info("filledCircle intersect",e,{radius:7,point:t});return oC.circle(e,7,t)},a}async function IC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=a.width+(e.padding??0),l=o+a.height,c=o+a.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:u}=e,d=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=T_(h),f=d.path(g,p),m=i.insert((()=>f),":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",u),n&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",n),e.width=o,e.height=l,w_(e,m),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-l/2+(e.padding??0)/2+(a.y-(a.top??0))})`),e.intersect=function(t){return y.info("Triangle intersect",e,h,t),oC.polygon(e,h,t)},i}function RC(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=zE(e);e.label="";const s=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===r&&(l=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));const h=-1*l/2,u=-1*c/2,d=AE.svg(s),p=UE(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=d.rectangle(h,u,l,c,p),f=s.insert((()=>g),":first-child");o&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",o),a&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",a),w_(e,f);const m=n?.padding??0;return e.width&&e.height&&(e.width+=m/2||0,e.height+=m/2||0),e.intersect=function(t){return oC.rect(e,t)},s}async function MC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(80,a.width+2*(e.padding??0),e?.width??0),o=Math.max(50,a.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=AE.svg(i),u=UE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=[{x:-s/2,y:-o/2},{x:s/2-l,y:-o/2},...E_(-s/2+l,0,l,50,90,270),{x:s/2-l,y:o/2},{x:-s/2,y:o/2}],p=T_(d),g=h.path(p,u),f=i.insert((()=>g),":first-child");return f.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",c),n&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",n),w_(e,f),e.intersect=function(t){y.info("Pill intersect",e,{radius:l,point:t});return oC.polygon(e,d,t)},i}o(SC,"cylinder"),o(AC,"dividedRectangle"),o(LC,"doublecircle"),o(NC,"filledCircle"),o(IC,"flippedTriangle"),o(RC,"forkJoin"),o(MC,"halfRoundedRectangle");var DC=o(((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" ")),"createHexagonPathD");async function OC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=a.height+e.padding,o=s/4,l=a.width+2*o+e.padding,c=[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}];let h;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=DC(0,0,l,s,o),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),u&&h.attr("style",u)}else h=uC(i,l,s,c);return n&&h.attr("style",n),e.width=l,e.height=s,w_(e,h),e.intersect=function(t){return oC.polygon(e,c,t)},i}async function PC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await x_(t,e,k_(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,l=AE.svg(i),c=UE(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],u=T_(h),d=l.path(u,c),p=i.insert((()=>d),":first-child");return p.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",o),n&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),w_(e,p),e.intersect=function(t){y.info("Pill intersect",e,{points:h});return oC.polygon(e,h,t)},i}async function BC(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await x_(t,e,"icon-shape default"),d="t"===e.pos,p=o,g=o,{nodeBorder:f}=r,{stylesMap:m}=BE(e),v=-g/2,x=-p/2,b=e.label?8:0,w=AE.svg(c),k=UE(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");const T=w.rectangle(v,x,g,p,k),_=Math.max(g,h.width),E=p+h.height+b,C=w.rectangle(-_/2,-E/2,_,E,{...k,fill:"transparent",stroke:"none"}),S=c.insert((()=>T),":first-child"),A=c.insert((()=>C));if(e.icon){const t=c.append("g");t.html(`${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const r=t.node().getBBox(),n=r.width,i=r.height,a=r.x,s=r.y;t.attr("transform",`translate(${-n/2-a},${d?h.height/2+b/2-i/2-s:-h.height/2-b/2-i/2-s})`),t.attr("style",`color: ${m.get("stroke")??f};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-E/2:E/2-h.height})`),S.attr("transform",`translate(0,${d?h.height/2+b/2:-h.height/2-b/2})`),w_(e,A),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=d?[{x:r-h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2+h.height+b},{x:r+g/2,y:n-i/2+h.height+b},{x:r+g/2,y:n+i/2},{x:r-g/2,y:n+i/2},{x:r-g/2,y:n-i/2+h.height+b},{x:r-h.width/2,y:n-i/2+h.height+b}]:[{x:r-g/2,y:n-i/2},{x:r+g/2,y:n-i/2},{x:r+g/2,y:n-i/2+p},{x:r+h.width/2,y:n-i/2+p},{x:r+h.width/2/2,y:n+i/2},{x:r-h.width/2,y:n+i/2},{x:r-h.width/2,y:n-i/2+p},{x:r-g/2,y:n-i/2+p}];return oC.polygon(e,a,t)},c}async function $C(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await x_(t,e,"icon-shape default"),d=e.label?8:0,p="t"===e.pos,{nodeBorder:g,mainBkg:f}=r,{stylesMap:m}=BE(e),v=AE.svg(c),x=UE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=m.get("fill");x.stroke=b??f;const w=c.append("g");e.icon&&w.html(`${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const k=w.node().getBBox(),T=k.width,_=k.height,E=k.x,C=k.y,S=Math.max(T,_)*Math.SQRT2+40,A=v.circle(0,0,S,x),L=Math.max(S,h.width),N=S+h.height+d,I=v.rectangle(-L/2,-N/2,L,N,{...x,fill:"transparent",stroke:"none"}),R=c.insert((()=>A),":first-child"),M=c.insert((()=>I));return w.attr("transform",`translate(${-T/2-E},${p?h.height/2+d/2-_/2-C:-h.height/2-d/2-_/2-C})`),w.attr("style",`color: ${m.get("stroke")??g};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),R.attr("transform",`translate(0,${p?h.height/2+d/2:-h.height/2-d/2})`),w_(e,M),e.intersect=function(t){y.info("iconSquare intersect",e,t);return oC.rect(e,t)},c}async function FC(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await x_(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:m,mainBkg:v}=r,{stylesMap:x}=BE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=AE.svg(c),_=UE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(OE(b,w,f,g,5),_),S=Math.max(f,h.width),A=g+h.height+k,L=T.rectangle(-S/2,-A/2,S,A,{..._,fill:"transparent",stroke:"none"}),N=c.insert((()=>C),":first-child").attr("class","icon-shape2"),I=c.insert((()=>L));if(e.icon){const t=c.append("g");t.html(`${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const r=t.node().getBBox(),n=r.width,i=r.height,a=r.x,s=r.y;t.attr("transform",`translate(${-n/2-a},${p?h.height/2+k/2-i/2-s:-h.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),w_(e,I),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=p?[{x:r-h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2+h.height+k},{x:r+f/2,y:n-i/2+h.height+k},{x:r+f/2,y:n+i/2},{x:r-f/2,y:n+i/2},{x:r-f/2,y:n-i/2+h.height+k},{x:r-h.width/2,y:n-i/2+h.height+k}]:[{x:r-f/2,y:n-i/2},{x:r+f/2,y:n-i/2},{x:r+f/2,y:n-i/2+g},{x:r+h.width/2,y:n-i/2+g},{x:r+h.width/2/2,y:n+i/2},{x:r-h.width/2,y:n+i/2},{x:r-h.width/2,y:n-i/2+g},{x:r-f/2,y:n-i/2+g}];return oC.polygon(e,a,t)},c}async function zC(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await x_(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:m,mainBkg:v}=r,{stylesMap:x}=BE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=AE.svg(c),_=UE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(OE(b,w,f,g,.1),_),S=Math.max(f,h.width),A=g+h.height+k,L=T.rectangle(-S/2,-A/2,S,A,{..._,fill:"transparent",stroke:"none"}),N=c.insert((()=>C),":first-child"),I=c.insert((()=>L));if(e.icon){const t=c.append("g");t.html(`${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const r=t.node().getBBox(),n=r.width,i=r.height,a=r.x,s=r.y;t.attr("transform",`translate(${-n/2-a},${p?h.height/2+k/2-i/2-s:-h.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),w_(e,I),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=p?[{x:r-h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2+h.height+k},{x:r+f/2,y:n-i/2+h.height+k},{x:r+f/2,y:n+i/2},{x:r-f/2,y:n+i/2},{x:r-f/2,y:n-i/2+h.height+k},{x:r-h.width/2,y:n-i/2+h.height+k}]:[{x:r-f/2,y:n-i/2},{x:r+f/2,y:n-i/2},{x:r+f/2,y:n-i/2+g},{x:r+h.width/2,y:n-i/2+g},{x:r+h.width/2/2,y:n+i/2},{x:r-h.width/2,y:n+i/2},{x:r-h.width/2,y:n-i/2+g},{x:r-f/2,y:n-i/2+g}];return oC.polygon(e,a,t)},c}async function UC(t,e,{config:{flowchart:r}}){const n=new Image;n.src=e?.img??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=zE(e);e.labelStyle=s;const o=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;const l=Math.max(e.label?o??0:0,e?.assetWidth??i),c="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:l,h="on"===e.constraint?c/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(c,o??0);const{shapeSvg:u,bbox:d,label:p}=await x_(t,e,"image-shape default"),g="t"===e.pos,f=-c/2,m=-h/2,v=e.label?8:0,x=AE.svg(u),b=UE(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(f,m,c,h,b),k=Math.max(c,d.width),T=h+d.height+v,_=x.rectangle(-k/2,-T/2,k,T,{...b,fill:"none",stroke:"none"}),E=u.insert((()=>w),":first-child"),C=u.insert((()=>_));if(e.img){const t=u.append("image");t.attr("href",e.img),t.attr("width",c),t.attr("height",h),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-c/2},${g?T/2-h:-T/2})`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-h/2-d.height/2-v/2:h/2-d.height/2+v/2})`),E.attr("transform",`translate(0,${g?d.height/2+v/2:-d.height/2-v/2})`),w_(e,C),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=g?[{x:r-d.width/2,y:n-i/2},{x:r+d.width/2,y:n-i/2},{x:r+d.width/2,y:n-i/2+d.height+v},{x:r+c/2,y:n-i/2+d.height+v},{x:r+c/2,y:n+i/2},{x:r-c/2,y:n+i/2},{x:r-c/2,y:n-i/2+d.height+v},{x:r-d.width/2,y:n-i/2+d.height+v}]:[{x:r-c/2,y:n-i/2},{x:r+c/2,y:n-i/2},{x:r+c/2,y:n-i/2+h},{x:r+d.width/2,y:n-i/2+h},{x:r+d.width/2/2,y:n+i/2},{x:r-d.width/2,y:n+i/2},{x:r-d.width/2,y:n-i/2+h},{x:r-c/2,y:n-i/2+h}];return oC.polygon(e,a,t)},u}async function GC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}async function qC(t,e,r){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await x_(t,e,k_(e)),o=Math.max(s.width+2*r.labelPaddingX,e?.width||0),l=Math.max(s.height+2*r.labelPaddingY,e?.height||0),c=-o/2,h=-l/2;let u,{rx:d,ry:p}=e;const{cssStyles:g}=e;if(r?.rx&&r.ry&&(d=r.rx,p=r.ry),"handDrawn"===e.look){const t=AE.svg(a),r=UE(e,{}),n=d||p?t.path(OE(c,h,o,l,d||0),r):t.rectangle(c,h,o,l,r);u=a.insert((()=>n),":first-child"),u.attr("class","basic label-container").attr("style",zk(g))}else u=a.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",i).attr("rx",zk(d)).attr("ry",zk(p)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return w_(e,u),e.intersect=function(t){return oC.rect(e,t)},a}async function jC(t,e){const{shapeSvg:r,bbox:n,label:i}=await x_(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-n.height/2-(n.y-(n.top??0))})`),w_(e,a),e.intersect=function(t){return oC.rect(e,t)},r}async function WC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),o=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}async function YC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),o=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}function HC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),l=[{x:s,y:0},{x:0,y:o+3.5},{x:s-14,y:o+3.5},{x:0,y:2*o},{x:s,y:o-3.5},{x:14,y:o-3.5}],c=AE.svg(i),h=UE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=T_(l),d=c.path(u,h),p=i.insert((()=>d),":first-child");return a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),n&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",n),p.attr("transform",`translate(-${s/2},${-o})`),w_(e,p),e.intersect=function(t){y.info("lightningBolt intersect",e,t);return oC.polygon(e,l,t)},i}o(OC,"hexagon"),o(PC,"hourglass"),o(BC,"icon"),o($C,"iconCircle"),o(FC,"iconRounded"),o(zC,"iconSquare"),o(UC,"imageSquare"),o(GC,"inv_trapezoid"),o(qC,"drawRect"),o(jC,"labelRect"),o(WC,"lean_left"),o(YC,"lean_right"),o(HC,"lightningBolt");var VC=o(((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createCylinderPathD"),XC=o(((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createOuterCylinderPathD"),KC=o(((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createInnerCylinderPathD");async function ZC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+(e.padding??0),e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(a.height+c+(e.padding??0),e.height??0),u=.1*h;let d;const{cssStyles:p}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=XC(0,0,o,h,l,c,u),n=KC(0,c,o,h,l,c),a=UE(e,{}),s=t.path(r,a),g=t.path(n,a);i.insert((()=>g),":first-child").attr("class","line"),d=i.insert((()=>s),":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{const t=VC(0,0,o,h,l,c,u);d=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",zk(p)).attr("style",n)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),w_(e,d),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+c-(a.y-(a.top??0))})`),e.intersect=function(t){const r=oC.rect(e,t),n=r.x-(e.x??0);if(0!=l&&(Math.abs(n)<(e.width??0)/2||Math.abs(n)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-n*n/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),r.y+=i}return r},i}async function QC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,{cssStyles:u}=e,d=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:h/2},...__(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,c,.8),{x:o/2+o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:-h/2},{x:-o/2,y:-h/2},{x:-o/2,y:h/2*1.1},{x:-o/2,y:-h/2}],f=d.polygon(g.map((t=>[t.x,t.y])),p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),m.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c/2-(a.y-(a.top??0))})`),w_(e,m),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function JC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=AE.svg(i),p=UE(e,{}),g=[{x:c-5,y:h+5},{x:c-5,y:h+l+5},{x:c+o-5,y:h+l+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h+l-5},{x:c+o+5,y:h+l-5},{x:c+o+5,y:h-5},{x:c+5,y:h-5},{x:c+5,y:h},{x:c,y:h},{x:c,y:h+5}],f=[{x:c,y:h+5},{x:c+o-5,y:h+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h},{x:c,y:h}];"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=T_(g),y=d.path(m,p),v=T_(f),x=d.path(v,{...p,fill:"none"}),b=i.insert((()=>x),":first-child");return b.insert((()=>y),":first-child"),b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",n),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),w_(e,b),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function tS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,u=-o/2,d=-h/2,{cssStyles:p}=e,g=__(u-5,d+h+5,u+o-5,d+h+5,c,.8),f=g?.[g.length-1],m=[{x:u-5,y:d+5},{x:u-5,y:d+h+5},...g,{x:u+o-5,y:f.y-5},{x:u+o,y:f.y-5},{x:u+o,y:f.y-10},{x:u+o+5,y:f.y-10},{x:u+o+5,y:d-5},{x:u+5,y:d-5},{x:u+5,y:d},{x:u,y:d},{x:u,y:d+5}],y=[{x:u,y:d+5},{x:u+o-5,y:d+5},{x:u+o-5,y:f.y-5},{x:u+o,y:f.y-5},{x:u+o,y:d},{x:u,y:d}],v=AE.svg(i),x=UE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=T_(m),w=v.path(b,x),k=T_(y),T=v.path(k,x),_=i.insert((()=>w),":first-child");return _.insert((()=>T)),_.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-c/2-(a.y-(a.top??0))})`),w_(e,_),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function eS(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n;e.useHtmlLabels||!1!==Gt().flowchart?.htmlLabels||(e.centerLabel=!0);const{shapeSvg:a,bbox:s}=await x_(t,e,k_(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=AE.svg(a),p=UE(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=d.rectangle(c,h,o,l,p),f=a.insert((()=>g),":first-child");return f.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",i),w_(e,f),e.intersect=function(t){return oC.rect(e,t)},a}o(ZC,"linedCylinder"),o(QC,"linedWaveEdgedRect"),o(JC,"multiRect"),o(tS,"multiWaveEdgedRectangle"),o(eS,"note");var rS=o(((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" ")),"createDecisionBoxPathD");async function nS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=a.width+e.padding+(a.height+e.padding),o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=rS(0,0,s),a=t.path(n,r);l=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${s/2})`),c&&l.attr("style",c)}else l=uC(i,s,s,o);return n&&l.attr("style",n),w_(e,l),e.intersect=function(t){return y.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",oC.polygon(e,o,t)),oC.polygon(e,o,t)},i}async function iS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=-Math.max(a.width+(e.padding??0),e?.width??0)/2,l=-Math.max(a.height+(e.padding??0),e?.height??0)/2,c=l/2,h=[{x:o+c,y:l},{x:o,y:0},{x:o+c,y:-l},{x:-o,y:-l},{x:-o,y:l}],{cssStyles:u}=e,d=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=T_(h),f=d.path(g,p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),m.attr("transform",`translate(${-c/2},0)`),s.attr("transform",`translate(${-c/2-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),w_(e,m),e.intersect=function(t){return oC.polygon(e,h,t)},i}async function aS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);let i;e.labelStyle=r,i=e.cssClasses?"node "+e.cssClasses:"node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,c=e.label,h=o.node().appendChild(await DE(c,e.labelStyle,!0,!0));let u={width:0,height:0};if(yr(Qr()?.flowchart?.htmlLabels)){const t=h.children[0],e=Ga(h);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}y.info("Text 2",l);const d=l||[],p=h.getBBox(),g=o.node().appendChild(await DE(d.join?d.join("
    "):d,e.labelStyle,!0,!0)),f=g.children[0],m=Ga(g);u=f.getBoundingClientRect(),m.attr("width",u.width),m.attr("height",u.height);const v=(e.padding||0)/2;Ga(g).attr("transform","translate( "+(u.width>p.width?0:(p.width-u.width)/2)+", "+(p.height+v+5)+")"),Ga(h).attr("transform","translate( "+(u.width(y.debug("Rough node insert CXC",n),i)),":first-child"),T=a.insert((()=>(y.debug("Rough node insert CXC",n),n)),":first-child")}else T=s.insert("rect",":first-child"),_=s.insert("line"),T.attr("class","outer title-state").attr("style",n).attr("x",-u.width/2-v).attr("y",-u.height/2-v).attr("width",u.width+(e.padding||0)).attr("height",u.height+(e.padding||0)),_.attr("class","divider").attr("x1",-u.width/2-v).attr("x2",u.width/2+v).attr("y1",-u.height/2-v+p.height+v).attr("y2",-u.height/2-v+p.height+v);return w_(e,T),e.intersect=function(t){return oC.rect(e,t)},a}async function sS(t,e){return qC(t,e,{rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function oS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=e?.padding??0,l=Math.max(a.width+2*(e.padding??0),e?.width??0),c=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-a.width/2-o,u=-a.height/2-o,{cssStyles:d}=e,p=AE.svg(i),g=UE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:u},{x:h+l+8,y:u},{x:h+l+8,y:u+c},{x:h-8,y:u+c},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+c}],m=p.polygon(f.map((t=>[t.x,t.y])),g),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container").attr("style",zk(d)),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),s.attr("transform",`translate(${-l/2+4+(e.padding??0)-(a.x-(a.left??0))},${-c/2+(e.padding??0)-(a.y-(a.top??0))})`),w_(e,y),e.intersect=function(t){return oC.rect(e,t)},i}async function lS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-l/2}],f=T_(g),m=d.path(f,p),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",u),n&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(0, ${l/4})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))}, ${-l/4+(e.padding??0)-(a.y-(a.top??0))})`),w_(e,y),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function cS(t,e){return qC(t,e,{rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function hS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=a.height+e.padding,o=a.width+s/4+e.padding;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=OE(-o/2,-s/2,o,s,s/2),a=t.path(n,r);l=i.insert((()=>a),":first-child"),l.attr("class","basic label-container").attr("style",zk(c))}else l=i.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",n).attr("rx",s/2).attr("ry",s/2).attr("x",-o/2).attr("y",-s/2).attr("width",o).attr("height",s);return w_(e,l),e.intersect=function(t){return oC.rect(e,t)},i}async function uS(t,e){return qC(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function dS(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l}=r,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=AE.svg(c),u=UE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=h.circle(0,0,14,{...u,stroke:s,strokeWidth:2}),p=o??l,g=h.circle(0,0,5,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),f=c.insert((()=>d),":first-child");return f.insert((()=>g)),a&&f.selectAll("path").attr("style",a),i&&f.selectAll("path").attr("style",i),w_(e,f),e.intersect=function(t){return oC.circle(e,7,t)},c}function pS(t,e,{config:{themeVariables:r}}){const{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if("handDrawn"===e.look){const t=AE.svg(i).circle(0,0,14,PE(n));a=i.insert((()=>t)),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return w_(e,a),e.intersect=function(t){return oC.circle(e,7,t)},i}async function gS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=(e?.padding||0)/2,o=a.width+e.padding,l=a.height+e.padding,c=-a.width/2-s,h=-a.height/2-s,u=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=t.rectangle(c-8,h,o+16,l,r),a=t.line(c,h,c,h+l,r),s=t.line(c+o,h,c+o,h+l,r);i.insert((()=>a),":first-child"),i.insert((()=>s),":first-child");const u=i.insert((()=>n),":first-child"),{cssStyles:d}=e;u.attr("class","basic label-container").attr("style",zk(d)),w_(e,u)}else{const t=uC(i,o,l,u);n&&t.attr("style",n),w_(e,t)}return e.intersect=function(t){return oC.polygon(e,u,t)},i}async function fS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=-s/2,c=-o/2,h=.2*o,u=.2*o,{cssStyles:d}=e,p=AE.svg(i),g=UE(e,{}),f=[{x:l-h/2,y:c},{x:l+s+h/2,y:c},{x:l+s+h/2,y:c+o},{x:l-h/2,y:c+o}],m=[{x:l+s-h/2,y:c+o},{x:l+s+h/2,y:c+o},{x:l+s+h/2,y:c+o-u}];"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=T_(f),v=p.path(y,g),x=T_(m),b=p.path(x,{...g,fillStyle:"solid"}),w=i.insert((()=>b),":first-child");return w.insert((()=>v),":first-child"),w.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",d),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),w_(e,w),e.intersect=function(t){return oC.polygon(e,f,t)},i}async function mS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=.2*o,u=.2*l,d=l+c,{cssStyles:p}=e,g=AE.svg(i),f=UE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-o/2*.1,y:d/2},...__(-o/2-o/2*.1,d/2,o/2+o/2*.1,d/2,c,.8),{x:o/2+o/2*.1,y:-d/2},{x:-o/2-o/2*.1,y:-d/2}],y=-o/2+o/2*.1,v=-d/2-.4*u,x=[{x:y+o-h,y:1.4*(v+l)},{x:y+o,y:v+l-u},{x:y+o,y:.9*(v+l)},...__(y+o,1.3*(v+l),y+o-h,1.5*(v+l),.03*-l,.5)],b=T_(m),w=g.path(b,f),k=T_(x),T=g.path(k,{...f,fillStyle:"solid"}),_=i.insert((()=>T),":first-child");return _.insert((()=>w),":first-child"),_.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c/2-(a.y-(a.top??0))})`),w_(e,_),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function yS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(a.width+e.padding,e?.width||0),o=Math.max(a.height+e.padding,e?.height||0),l=-s/2,c=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",o),w_(e,h),e.intersect=function(t){return oC.rect(e,t)},i}o(nS,"question"),o(iS,"rect_left_inv_arrow"),o(aS,"rectWithTitle"),o(sS,"roundedRect"),o(oS,"shadedProcess"),o(lS,"slopedRect"),o(cS,"squareRect"),o(hS,"stadium"),o(uS,"state"),o(dS,"stateEnd"),o(pS,"stateStart"),o(gS,"subroutine"),o(fS,"taggedRect"),o(mS,"taggedWaveEdgedRectangle"),o(yS,"text");var vS=o(((t,e,r,n,i,a)=>`M${t},${e}\n a${i},${a} 0,0,1 0,${-n}\n l${r},0\n a${i},${a} 0,0,1 0,${n}\n M${r},${-n}\n a${i},${a} 0,0,0 0,${n}\n l${-r},0`),"createCylinderPathD"),xS=o(((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" ")),"createOuterCylinderPathD"),bS=o(((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" ")),"createInnerCylinderPathD");async function wS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s,halfPadding:o}=await x_(t,e,k_(e)),l="neo"===e.look?2*o:o,c=a.height+l,h=c/2,u=h/(2.5+c/50),d=a.width+u+l,{cssStyles:p}=e;let g;if("handDrawn"===e.look){const t=AE.svg(i),r=xS(0,0,d,c,u,h),n=bS(0,0,d,c,u,h),a=t.path(r,UE(e,{})),s=t.path(n,UE(e,{fill:"none"}));g=i.insert((()=>s),":first-child"),g=i.insert((()=>a),":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const t=vS(0,0,d,c,u,h);g=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",zk(p)).attr("style",n),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-d/2}, ${c/2} )`),s.attr("transform",`translate(${-a.width/2-u-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),w_(e,g),e.intersect=function(t){const r=oC.rect(e,t),n=r.y-(e.y??0);if(0!=h&&(Math.abs(n)<(e.height??0)/2||Math.abs(n)==(e.height??0)/2&&Math.abs(r.x-(e.x??0))>(e.width??0)/2-u)){let i=u*u*(1-n*n/(h*h));0!=i&&(i=Math.sqrt(Math.abs(i))),i=u-i,t.x-(e.x??0)>0&&(i=-i),r.x+=i}return r},i}async function kS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=a.width+e.padding,o=a.height+e.padding,l=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}async function TS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(60,a.width+2*(e.padding??0),e?.width??0),o=Math.max(20,a.height+2*(e.padding??0),e?.height??0),{cssStyles:l}=e,c=AE.svg(i),h=UE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=[{x:-s/2*.8,y:-o/2},{x:s/2*.8,y:-o/2},{x:s/2,y:-o/2*.6},{x:s/2,y:o/2},{x:-s/2,y:o/2},{x:-s/2,y:-o/2*.6}],d=T_(u),p=c.path(d,h),g=i.insert((()=>p),":first-child");return g.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",l),n&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",n),w_(e,g),e.intersect=function(t){return oC.polygon(e,u,t)},i}async function _S(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=yr(Qr().flowchart?.htmlLabels),l=a.width+(e.padding??0),c=l+a.height,h=l+a.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:d}=e,p=AE.svg(i),g=UE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=T_(u),m=p.path(f,g),v=i.insert((()=>m),":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",d),n&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",n),e.width=l,e.height=c,w_(e,v),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${c/2-(a.height+(e.padding??0)/(o?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(t){return y.info("Triangle intersect",e,u,t),oC.polygon(e,u,t)},i}async function ES(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/8,h=l+c,{cssStyles:u}=e,d=70-o,p=d>0?d/2:0,g=AE.svg(i),f=UE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-p,y:h/2},...__(-o/2-p,h/2,o/2+p,h/2,c,.8),{x:o/2+p,y:-h/2},{x:-o/2-p,y:-h/2}],y=T_(m),v=g.path(y,f),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c-(a.y-(a.top??0))})`),w_(e,x),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function CS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=s/o;let c=s,h=o;c>h*l?h=c/l:c=h*l,c=Math.max(c,100),h=Math.max(h,50);const u=Math.min(.2*h,h/4),d=h+2*u,{cssStyles:p}=e,g=AE.svg(i),f=UE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-c/2,y:d/2},...__(-c/2,d/2,c/2,d/2,u,1),{x:c/2,y:-d/2},...__(c/2,-d/2,-c/2,-d/2,u,-1)],y=T_(m),v=g.path(y,f),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",p),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),w_(e,x),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function SS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=AE.svg(i),p=UE(e,{}),g=[{x:c-5,y:h-5},{x:c-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-5}],f=`M${c-5},${h-5} L${c+o},${h-5} L${c+o},${h+l} L${c-5},${h+l} L${c-5},${h-5}\n M${c-5},${h} L${c+o},${h}\n M${c},${h-5} L${c},${h+l}`;"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=d.path(f,p),y=i.insert((()=>m),":first-child");return y.attr("transform","translate(2.5, 2.5)"),y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),s.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),w_(e,y),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function AS(t,e){const r=e;if(r.alias&&(e.label=r.alias),"handDrawn"===e.look){const{themeVariables:r}=Gt(),{background:n}=r,i={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${n}`]};await AS(t,i)}const n=Gt();e.useHtmlLabels=n.htmlLabels;let i=n.er?.diagramPadding??10,a=n.er?.entityPadding??6;const{cssStyles:s}=e,{labelStyles:o}=zE(e);if(0===r.attributes.length&&e.label){const r={rx:0,ry:0,labelPaddingX:i,labelPaddingY:1.5*i,classes:""};Sk(e.label,n)+2*r.labelPaddingX0){const t=h.width+2*i-(p+g+f+m);p+=t/x,g+=t/x,f>0&&(f+=t/x),m>0&&(m+=t/x)}const w=p+g+f+m,k=AE.svg(c),T=UE(e,{});"handDrawn"!==e.look&&(T.roughness=0,T.fillStyle="solid");const _=Math.max(b.width+2*i,e?.width||0,w),E=Math.max(b.height+(d[0]||u)+a,e?.height||0),C=-_/2,S=-E/2;c.selectAll("g:not(:first-child)").each(((t,e,r)=>{const n=Ga(r[e]),s=n.attr("transform");let o=0,l=0;if(s){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);t&&(o=parseFloat(t[1]),l=parseFloat(t[2]),n.attr("class").includes("attribute-name")?o+=p:n.attr("class").includes("attribute-keys")?o+=p+g:n.attr("class").includes("attribute-comment")&&(o+=p+g+f))}n.attr("transform",`translate(${C+i/2+o}, ${l+S+h.height+a/2})`)})),c.select(".name").attr("transform","translate("+-h.width/2+", "+(S+a/2)+")");const A=k.rectangle(C,S,_,E,T),L=c.insert((()=>A),":first-child").attr("style",s.join("")),{themeVariables:N}=Gt(),{rowEven:I,rowOdd:R,nodeBorder:M}=N;d.push(0);for(const[t,e]of d.entries()){if(0===t&&d.length>1)continue;const r=t%2==0&&0!==e,n=k.rectangle(C,h.height+S+e,_,h.height,{...T,fill:r?I:R,stroke:M});c.insert((()=>n),"g.label").attr("style",s.join("")).attr("class","row-rect-"+(t%2==0?"even":"odd"))}let D=k.line(C,h.height+S,_+C,h.height+S,T);c.insert((()=>D)).attr("class","divider"),D=k.line(p+C,h.height+S,p+C,E+S,T),c.insert((()=>D)).attr("class","divider"),y&&(D=k.line(p+g+C,h.height+S,p+g+C,E+S,T),c.insert((()=>D)).attr("class","divider")),v&&(D=k.line(p+g+f+C,h.height+S,p+g+f+C,E+S,T),c.insert((()=>D)).attr("class","divider"));for(const t of d)D=k.line(C,h.height+S+t,_+C,h.height+S+t,T),c.insert((()=>D)).attr("class","divider");return w_(e,L),e.intersect=function(t){return oC.rect(e,t)},c}async function LS(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==br(e)&&(e=(e=br(e)).replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await v_(o,e,{width:Sk(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let t=l.children[0];for(t.textContent=t.textContent.replaceAll("<","<").replaceAll(">",">");t.childNodes[0];)t=t.childNodes[0],t.textContent=t.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(yr(r.htmlLabels)){const t=l.children[0];t.style.textAlign="start";const e=Ga(l);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}return c}async function NS(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",k_(e)).attr("id",e.domId||e.id);let o=null,l=null,c=null,h=null,u=0,d=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const t=e.annotations[0];await IS(o,{text:`«${t}»`},0);u=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await IS(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();d=g.height,c=s.insert("g").attr("class","members-group text");let f=0;for(const t of e.members){f+=await IS(c,t,f,[t.parseClassifier()])+a}p=c.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let m=0;for(const t of e.methods){m+=await IS(h,t,m,[t.parseClassifier()])+a}let y=s.node().getBBox();if(null!==o){const t=o.node().getBBox();o.attr("transform",`translate(${-t.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${u})`),y=s.node().getBBox(),c.attr("transform",`translate(0, ${u+d+2*i})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${u+d+(p?p+4*i:2*i)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}async function IS(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Gt();let s="useHtmlLabels"in e?e.useHtmlLabels:yr(a.htmlLabels)??!0,l="";l="text"in e?e.text:e.label,!s&&l.startsWith("\\")&&(l=l.substring(1)),Cr(l)&&(s=!0);const c=await v_(i,en($k(l)),{width:Sk(l,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let h,u=1;if(s){const t=c.children[0],e=Ga(c);u=t.innerHTML.split("
    ").length,t.innerHTML.includes("")&&(u+=t.innerHTML.split("").length-1);const r=t.getElementsByTagName("img");if(r){const t=""===l.replace(/]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,r=5,n=parseInt(t,10)*r+"px";e.style.minWidth=n,e.style.maxWidth=n}else e.style.width="100%";r(e)}o(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{n.includes("font-weight: bolder")&&Ga(c).selectAll("tspan").attr("font-weight",""),u=c.children.length;const t=c.children[0];if(""===c.textContent||c.textContent.includes(">")){t.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim();" "===l[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))}"undefined"===t.textContent&&(t.textContent=""),h=c.getBBox()}return i.attr("transform","translate(0,"+(-h.height/(2*u)+r)+")"),h.height}async function RS(t,e){const r=Qr(),n=r.class.padding??12,i=n,a=e.useHtmlLabels??yr(r.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:l}=await NS(t,e,r,a,i),{labelStyles:c,nodeStyles:h}=zE(e);e.labelStyle=c,e.cssStyles=s.styles||"";const u=s.styles?.join(";")||h||"";e.cssStyles||(e.cssStyles=u.replaceAll("!important","").split(";"));const d=0===s.members.length&&0===s.methods.length&&!r.class?.hideEmptyMembersBox,p=AE.svg(o),g=UE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=l.width;let m=l.height;0===s.members.length&&0===s.methods.length?m+=i:s.members.length>0&&0===s.methods.length&&(m+=2*i);const y=-f/2,v=-m/2,x=p.rectangle(y-n,v-n-(d?n:0===s.members.length&&0===s.methods.length?-n/2:0),f+2*n,m+2*n+(d?2*n:0===s.members.length&&0===s.methods.length?-n:0),g),b=o.insert((()=>x),":first-child");b.attr("class","basic label-container");const w=b.node().getBBox();o.selectAll(".text").each(((t,e,r)=>{const i=Ga(r[e]),l=i.attr("transform");let c=0;if(l){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);t&&(c=parseFloat(t[2]))}let h=c+v+n-(d?n:0===s.members.length&&0===s.methods.length?-n/2:0);a||(h-=4);let u=y;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(u=-i.node()?.getBBox().width/2||0,o.selectAll("text").each((function(t,e,r){"middle"===window.getComputedStyle(r[e]).textAnchor&&(u=0)}))),i.attr("transform",`translate(${u}, ${h})`)}));const k=o.select(".annotation-group").node().getBBox().height-(d?n/2:0)||0,T=o.select(".label-group").node().getBBox().height-(d?n/2:0)||0,_=o.select(".members-group").node().getBBox().height-(d?n/2:0)||0;if(s.members.length>0||s.methods.length>0||d){const t=p.line(w.x,k+T+v+n,w.x+w.width,k+T+v+n,g);o.insert((()=>t)).attr("class","divider").attr("style",u)}if(d||s.members.length>0||s.methods.length>0){const t=p.line(w.x,k+T+_+v+2*i+n,w.x+w.width,k+T+_+v+n+2*i,g);o.insert((()=>t)).attr("class","divider").attr("style",u)}if("handDrawn"!==s.look&&o.selectAll("path").attr("style",u),b.select(":nth-child(2)").attr("style",u),o.selectAll(".divider").select("path").attr("style",u),e.labelStyle?o.selectAll("span").attr("style",e.labelStyle):o.selectAll("span").attr("style",u),!a){const t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(u);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}else if(c){const e=t.exec(c);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}}}return w_(e,b),e.intersect=function(t){return oC.rect(e,t)},o}async function MS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const i=e,a=e,s="verifyMethod"in e,o=k_(e),l=t.insert("g").attr("class",o).attr("id",e.domId??e.id);let c;c=s?await DS(l,`<<${i.type}>>`,0,e.labelStyle):await DS(l,"<<Element>>",0,e.labelStyle);let h=c;const u=await DS(l,i.name,h,e.labelStyle+"; font-weight: bold;");if(h+=u+20,s){h+=await DS(l,""+(i.requirementId?`Id: ${i.requirementId}`:""),h,e.labelStyle);h+=await DS(l,""+(i.text?`Text: ${i.text}`:""),h,e.labelStyle);h+=await DS(l,""+(i.risk?`Risk: ${i.risk}`:""),h,e.labelStyle),await DS(l,""+(i.verifyMethod?`Verification: ${i.verifyMethod}`:""),h,e.labelStyle)}else{h+=await DS(l,""+(a.type?`Type: ${a.type}`:""),h,e.labelStyle),await DS(l,""+(a.docRef?`Doc Ref: ${a.docRef}`:""),h,e.labelStyle)}const d=(l.node()?.getBBox().width??200)+20,p=(l.node()?.getBBox().height??200)+20,g=-d/2,f=-p/2,m=AE.svg(l),y=UE(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const v=m.rectangle(g,f,d,p,y),x=l.insert((()=>v),":first-child");if(x.attr("class","basic label-container").attr("style",n),l.selectAll(".label").each(((t,e,r)=>{const n=Ga(r[e]),i=n.attr("transform");let a=0,s=0;if(i){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);t&&(a=parseFloat(t[1]),s=parseFloat(t[2]))}const o=s-p/2;let l=g+10;0!==e&&1!==e||(l=a),n.attr("transform",`translate(${l}, ${o+20})`)})),h>c+u+20){const t=m.line(g,f+c+u+20,g+d,f+c+u+20,y);l.insert((()=>t)).attr("style",n)}return w_(e,x),e.intersect=function(t){return oC.rect(e,t)},l}async function DS(t,e,r,n=""){if(""===e)return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Qr(),s=a.htmlLabels??!0,o=await v_(i,en($k(e)),{width:Sk(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const t=o.children[0],e=Ga(o);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}else{const t=o.children[0];for(const e of t.children)e.textContent=e.textContent.replaceAll(">",">").replaceAll("<","<"),n&&e.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}o(wS,"tiltedCylinder"),o(kS,"trapezoid"),o(TS,"trapezoidalPentagon"),o(_S,"triangle"),o(ES,"waveEdgedRectangle"),o(CS,"waveRectangle"),o(SS,"windowPane"),o(AS,"erBox"),o(LS,"addText"),o(NS,"textHelper"),o(IS,"addText"),o(RS,"classBox"),o(MS,"requirementBox"),o(DS,"addText");var OS=o((t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}}),"colorFromPriority");async function PS(t,e,{config:r}){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n||"";const a=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:o,label:l}=await x_(t,e,k_(e)),c=e.padding||10;let h,u="";"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(u=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),h=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let p,g;({label:p,bbox:g}=h?await b_(h,"ticket"in e&&e.ticket||"",d):await b_(s,"ticket"in e&&e.ticket||"",d));const{label:f,bbox:m}=await b_(s,"assigned"in e&&e.assigned||"",d);e.width=a;const y=e?.width||0,v=Math.max(g.height,m.height)/2,x=Math.max(o.height+20,e?.height||0)+v,b=-y/2,w=-x/2;let k;l.attr("transform","translate("+(c-y/2)+", "+(-v-o.height/2)+")"),p.attr("transform","translate("+(c-y/2)+", "+(-v+o.height/2)+")"),f.attr("transform","translate("+(c+y/2-m.width-20)+", "+(-v+o.height/2)+")");const{rx:T,ry:_}=e,{cssStyles:E}=e;if("handDrawn"===e.look){const t=AE.svg(s),r=UE(e,{}),n=T||_?t.path(OE(b,w,y,x,T||0),r):t.rectangle(b,w,y,x,r);k=s.insert((()=>n),":first-child"),k.attr("class","basic label-container").attr("style",E||null)}else{k=s.insert("rect",":first-child"),k.attr("class","basic label-container __APA__").attr("style",i).attr("rx",T??5).attr("ry",_??5).attr("x",b).attr("y",w).attr("width",y).attr("height",x);const t="priority"in e&&e.priority;if(t){const e=s.append("line"),r=b+2,n=w+Math.floor((T??0)/2),i=w+x-Math.floor((T??0)/2);e.attr("x1",r).attr("y1",n).attr("x2",r).attr("y2",i).attr("stroke-width","4").attr("stroke",OS(t))}}return w_(e,k),e.height=x,e.intersect=function(t){return oC.rect(e,t)},s}o(PS,"kanbanItem");var BS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:cS},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:sS},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:hS},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:gS},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:SC},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:gC},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:nS},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:OC},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:YC},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:WC},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:kS},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:GC},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:LC},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:yS},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:dC},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:oS},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:pS},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:dS},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:RC},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:PC},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:vC},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:bC},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:kC},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:HC},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ES},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:MC},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:wS},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ZC},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:TC},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:AC},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:_S},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:SS},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:NC},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:TS},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:IC},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:lS},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:tS},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:JC},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:hC},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:mC},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:mS},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:fS},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:CS},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:iS},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:QC}],$S=o((()=>{const t={state:uS,choice:pC,note:eS,rectWithTitle:aS,labelRect:jC,iconSquare:zC,iconCircle:$C,icon:BC,iconRounded:FC,imageSquare:UC,anchor:lC,kanbanItem:PS,classBox:RS,erBox:AS,requirementBox:MS},e=[...Object.entries(t),...BS.flatMap((t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map((e=>[e,t.handler]))))];return Object.fromEntries(e)}),"generateShapeMap"),FS=$S();function zS(t){return t in FS}o(zS,"isValidShape");var US=new Map;async function GS(t,e,r){let n,i;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?FS[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;"sandbox"===r.config.securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),US.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}o(GS,"insertNode");var qS=o(((t,e)=>{US.set(e.id,t)}),"setNodeElem"),jS=o((()=>{US.clear()}),"clear"),WS=o((t=>{const e=US.get(t.id);y.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r}),"positionNode"),YS={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function HS(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=VS(t),e=VS(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}o(HS,"calculateDeltaAndAngle");var VS=o((t=>Array.isArray(t)?{x:t[0],y:t[1]}:t),"pointTransformer"),XS=o((t=>({x:o((function(e,r,n){let i=0;const a=VS(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(YS,t.arrowTypeEnd)){const{angle:e,deltaX:r}=HS(n[n.length-1],n[n.length-2]);i=YS[t.arrowTypeEnd]*Math.cos(e)*(r>=0?1:-1)}const s=Math.abs(VS(e).x-VS(n[n.length-1]).x),o=Math.abs(VS(e).y-VS(n[n.length-1]).y),l=Math.abs(VS(e).x-VS(n[0]).x),c=Math.abs(VS(e).y-VS(n[0]).y),h=YS[t.arrowTypeStart],u=YS[t.arrowTypeEnd];if(s0&&o0&&c=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(YS,t.arrowTypeEnd)){const{angle:e,deltaY:r}=HS(n[n.length-1],n[n.length-2]);i=YS[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(r>=0?1:-1)}const s=Math.abs(VS(e).y-VS(n[n.length-1]).y),o=Math.abs(VS(e).x-VS(n[n.length-1]).x),l=Math.abs(VS(e).y-VS(n[0]).y),c=Math.abs(VS(e).x-VS(n[0]).x),h=YS[t.arrowTypeStart],u=YS[t.arrowTypeEnd];if(s0&&o0&&c{e.arrowTypeStart&&QS(t,"start",e.arrowTypeStart,r,n,i,a),e.arrowTypeEnd&&QS(t,"end",e.arrowTypeEnd,r,n,i,a)}),"addEdgeMarkers"),ZS={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},QS=o(((t,e,r,n,i,a,s)=>{const o=ZS[r];if(!o)return void y.warn(`Unknown arrow type: ${r}`);const l=`${i}_${a}-${o.type}${"start"===e?"Start":"End"}`;if(s&&""!==s.trim()){const r=`${l}_${s.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(r)){const t=document.getElementById(l);if(t){const e=t.cloneNode(!0);e.id=r;e.querySelectorAll("path, circle, line").forEach((t=>{t.setAttribute("stroke",s),o.fill&&t.setAttribute("fill",s)})),t.parentNode?.appendChild(e)}}t.attr(`marker-${e}`,`url(${n}#${r})`)}else t.attr(`marker-${e}`,`url(${n}#${l})`)}),"addEdgeMarker"),JS=new Map,tA=new Map,eA=o((()=>{JS.clear(),tA.clear()}),"clear"),rA=o((t=>t?t.reduce(((t,e)=>t+";"+e),""):""),"getLabelStyles"),nA=o((async(t,e)=>{let r=yr(Qr().flowchart.htmlLabels);const n=await v_(t,e.label,{style:rA(e.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1});y.info("abc82",e,e.labelType);const i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(n);let s,o=n.getBBox();if(r){const t=n.children[0],e=Ga(n);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}if(a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),JS.set(e.id,i),e.width=o.width,e.height=o.height,e.startLabelLeft){const r=await DE(e.startLabelLeft,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).startLeft=n,iA(s,e.startLabelLeft)}if(e.startLabelRight){const r=await DE(e.startLabelRight,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=n.node().appendChild(r),i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).startRight=n,iA(s,e.startLabelRight)}if(e.endLabelLeft){const r=await DE(e.endLabelLeft,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).endLeft=n,iA(s,e.endLabelLeft)}if(e.endLabelRight){const r=await DE(e.endLabelRight,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).endRight=n,iA(s,e.endLabelRight)}return n}),"insertEdgeLabel");function iA(t,e){Qr().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}o(iA,"setTerminalWidth");var aA=o(((t,e)=>{y.debug("Moving label abc88 ",t.id,t.label,JS.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Qr(),{subGraphTitleTotalMargin:i}=qy(n);if(t.label){const n=JS.get(t.id);let a=t.x,s=t.y;if(r){const n=Pk.calcLabelPosition(r);y.debug("Moving label "+t.label+" from (",a,",",s,") to (",n.x,",",n.y,") abc88"),e.updatedPath&&(a=n.x,s=n.y)}n.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=tA.get(t.id).startLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.startLabelRight){const e=tA.get(t.id).startRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelLeft){const e=tA.get(t.id).endLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelRight){const e=tA.get(t.id).endRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}}),"positionEdgeLabel"),sA=o(((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),oA=o(((t,e,r)=>{y.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let t=r.y{y.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach((t=>{if(y.info("abc88 checking point",t,e),sA(e,t)||i)y.warn("abc88 outside",t,n),n=t,i||r.push(t);else{const a=oA(e,n,t);y.debug("abc88 inside",t,n,a),y.debug("abc88 intersection",a,e);let s=!1;r.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),r.some((t=>t.x===a.x&&t.y===a.y))?y.warn("abc88 no intersect",a,r):r.push(a),i=!0}})),y.debug("returning points",r),r}),"cutPathAtIntersect");function cA(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}o(cA,"extractCornerPoints");var hA=o((function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=r/Math.sqrt(n*n+i*i);return{x:e.x-a*n,y:e.y-a*i}}),"findAdjacentPoint"),uA=o((function(t){const{cornerPointPositions:e}=cA(t),r=[];for(let n=0;n10&&Math.abs(i.y-e.y)>=10){y.debug("Corner point fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));const t=5;u=a.x===s.x?{x:l<0?s.x-t+h:s.x+t-h,y:c<0?s.y-h:s.y+h}:{x:l<0?s.x-h:s.x+h,y:c<0?s.y-t+h:s.y+t-h}}else y.debug("Corner point skipping fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));r.push(u,o)}else r.push(t[n]);return r}),"fixCorners"),dA=o((function(t,e,r,n,i,a,s){const{handDrawnSeed:o}=Qr();let l=e.points,c=!1;const h=i;var u=a;const d=[];for(const t in e.cssCompiledStyles)FE(t)||d.push(e.cssCompiledStyles[t]);u.intersect&&h.intersect&&(l=l.slice(1,e.points.length-1),l.unshift(h.intersect(l[0])),y.debug("Last point APA12",e.start,"--\x3e",e.end,l[l.length-1],u,u.intersect(l[l.length-1])),l.push(u.intersect(l[l.length-1]))),e.toCluster&&(y.info("to cluster abc88",r.get(e.toCluster)),l=lA(e.points,r.get(e.toCluster).node),c=!0),e.fromCluster&&(y.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(l,null,2)),l=lA(l.reverse(),r.get(e.fromCluster).node).reverse(),c=!0);let p=l.filter((t=>!Number.isNaN(t.y)));p=uA(p);let g=Tu;switch(g=hu,e.curve){case"linear":g=hu;break;case"basis":default:g=Tu;break;case"cardinal":g=Mu;break;case"bumpX":g=xu;break;case"bumpY":g=bu;break;case"catmullRom":g=zu;break;case"monotoneX":g=td;break;case"monotoneY":g=ed;break;case"natural":g=id;break;case"step":g=sd;break;case"stepAfter":g=ld;break;case"stepBefore":g=od}const{x:f,y:m}=XS(e),v=gu().x(f).y(m).curve(g);let x,b;switch(e.thickness){case"normal":default:x="edge-thickness-normal";break;case"thick":x="edge-thickness-thick";break;case"invisible":x="edge-thickness-invisible"}switch(e.pattern){case"solid":default:x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}let w=v(p);const k=Array.isArray(e.style)?e.style:[e.style];let T=k.find((t=>t?.startsWith("stroke:")));if("handDrawn"===e.look){const r=AE.svg(t);Object.assign([],p);x+=" transition",b=Ga(r.path(w,{roughness:.3,seed:o})).select("path").attr("id",e.id).attr("class"," "+x+(e.classes?" "+e.classes:"")).attr("style",k?k.reduce(((t,e)=>t+";"+e),""):"");let n=b.attr("d");b.attr("d",n),t.node().appendChild(b.node())}else{const r=d.join(";"),n=k?k.reduce(((t,e)=>t+e+";"),""):"";let i="";e.animate&&(i=" edge-animation-fast"),e.animation&&(i=" edge-animation-"+e.animation);const a=r?r+";"+n+";":n;b=t.append("path").attr("d",w).attr("id",e.id).attr("class"," "+x+(e.classes?" "+e.classes:"")+(i??"")).attr("style",a),T=a.match(/stroke:([^;]+)/)?.[1]}let _="";(Qr().flowchart.arrowMarkerAbsolute||Qr().state.arrowMarkerAbsolute)&&(_=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,_=_.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),y.info("arrowTypeStart",e.arrowTypeStart),y.info("arrowTypeEnd",e.arrowTypeEnd),KS(b,e,_,s,n,T);let E={};return c&&(E.updatedPath=l),E.originalPath=e.points,E}),"insertEdge"),pA=o(((t,e,r,n)=>{e.forEach((e=>{LA[e](t,r,n)}))}),"insertMarkers"),gA=o(((t,e,r)=>{y.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),fA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),mA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),yA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),vA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),xA=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"point"),bA=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"circle"),wA=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")}),"cross"),kA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb"),TA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")}),"only_one"),_A=o(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")}),"zero_or_one"),EA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")}),"one_or_more"),CA=o(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}),"zero_or_more"),SA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d","M0,0\n L20,10\n M20,10\n L0,20")}),"requirement_arrow"),AA=o(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)}),"requirement_contains"),LA={extension:gA,composition:fA,aggregation:mA,dependency:yA,lollipop:vA,point:xA,circle:bA,cross:wA,barb:kA,only_one:TA,zero_or_one:_A,one_or_more:EA,zero_or_more:CA,requirement_arrow:SA,requirement_contains:AA},NA=pA,IA={common:Lr,getConfig:Gt,insertCluster:XE,insertEdge:dA,insertEdgeLabel:nA,insertMarkers:NA,insertNode:GS,interpolateToCurve:ok,labelHelper:x_,log:y,positionEdgeLabel:aA},RA={},MA=o((t=>{for(const e of t)RA[e.name]=e}),"registerLayoutLoaders");o((()=>{MA([{name:"dagre",loader:o((async()=>await Promise.resolve().then((function(){return EH}))),"loader")}])}),"registerDefaultLayoutLoaders")();var DA=o((async(t,e)=>{if(!(t.layoutAlgorithm in RA))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=RA[t.layoutAlgorithm];return(await r.loader()).render(t,e,IA,{algorithm:r.algorithm})}),"render"),OA=o(((t="",{fallback:e="dagre"}={})=>{if(t in RA)return t;if(e in RA)return y.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)}),"getRegisteredLayoutAlgorithm"),PA=pb(Object.keys,Object),BA=Object.prototype.hasOwnProperty;function $A(t){if(!yb(t))return PA(t);var e=[];for(var r in Object(t))BA.call(t,r)&&"constructor"!=r&&e.push(r);return e}o($A,"baseKeys");var FA=$A,zA=Iv(Vy,"DataView"),UA=Iv(Vy,"Promise"),GA=Iv(Vy,"Set"),qA=Iv(Vy,"WeakMap"),jA="[object Map]",WA="[object Promise]",YA="[object Set]",HA="[object WeakMap]",VA="[object DataView]",XA=xv(zA),KA=xv(hx),ZA=xv(UA),QA=xv(GA),JA=xv(qA),tL=ov;(zA&&tL(new zA(new ArrayBuffer(1)))!=VA||hx&&tL(new hx)!=jA||UA&&tL(UA.resolve())!=WA||GA&&tL(new GA)!=YA||qA&&tL(new qA)!=HA)&&(tL=o((function(t){var e=ov(t),r="[object Object]"==e?t.constructor:void 0,n=r?xv(r):"";if(n)switch(n){case XA:return VA;case KA:return jA;case ZA:return WA;case QA:return YA;case JA:return HA}return e}),"getTag"));var eL=tL,rL=Object.prototype.hasOwnProperty;function nL(t){if(null==t)return!0;if(Mb(t)&&(Lb(t)||"string"==typeof t||"function"==typeof t.splice||Ub(t)||aw(t)||Ab(t)))return!t.length;var e=eL(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(yb(t))return!FA(t).length;for(var r in t)if(rL.call(t,r))return!1;return!0}o(nL,"isEmpty");var iL=nL,aL={id:"c4",detector:o((t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return sX}));return{id:"c4",diagram:t}}),"loader")},sL="flowchart",oL=o(((t,e)=>"dagre-wrapper"!==e?.flowchart?.defaultRenderer&&"elk"!==e?.flowchart?.defaultRenderer&&/^\s*graph/.test(t)),"detector"),lL={id:sL,detector:oL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return wX}));return{id:sL,diagram:t}}),"loader")},cL="flowchart-v2",hL=o(((t,e)=>"dagre-d3"!==e?.flowchart?.defaultRenderer&&("elk"===e?.flowchart?.defaultRenderer&&(e.layout="elk"),!(!/^\s*graph/.test(t)||"dagre-wrapper"!==e?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(t))),"detector"),uL={id:cL,detector:hL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return wX}));return{id:cL,diagram:t}}),"loader")},dL={id:"er",detector:o((t=>/^\s*erDiagram/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return LX}));return{id:"er",diagram:t}}),"loader")},pL="gitGraph",gL={id:pL,detector:o((t=>/^\s*gitGraph/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return int}));return{id:pL,diagram:t}}),"loader")},fL="gantt",mL={id:fL,detector:o((t=>/^\s*gantt/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Fit}));return{id:fL,diagram:t}}),"loader")},yL="info",vL={id:yL,detector:o((t=>/^\s*info/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Wit}));return{id:yL,diagram:t}}),"loader")},xL={id:"pie",detector:o((t=>/^\s*pie/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return oat}));return{id:"pie",diagram:t}}),"loader")},bL="quadrantChart",wL={id:bL,detector:o((t=>/^\s*quadrantChart/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Pat}));return{id:bL,diagram:t}}),"loader")},kL="xychart",TL={id:kL,detector:o((t=>/^\s*xychart-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Rst}));return{id:kL,diagram:t}}),"loader")},_L="requirement",EL={id:_L,detector:o((t=>/^\s*requirement(Diagram)?/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return zst}));return{id:_L,diagram:t}}),"loader")},CL="sequence",SL={id:CL,detector:o((t=>/^\s*sequenceDiagram/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Vot}));return{id:CL,diagram:t}}),"loader")},AL="class",LL=o(((t,e)=>"dagre-wrapper"!==e?.class?.defaultRenderer&&/^\s*classDiagram/.test(t)),"detector"),NL={id:AL,detector:LL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return clt}));return{id:AL,diagram:t}}),"loader")},IL="classDiagram",RL=o(((t,e)=>!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==e?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(t)),"detector"),ML={id:IL,detector:RL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return ult}));return{id:IL,diagram:t}}),"loader")},DL="state",OL=o(((t,e)=>"dagre-wrapper"!==e?.state?.defaultRenderer&&/^\s*stateDiagram/.test(t)),"detector"),PL={id:DL,detector:OL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Cct}));return{id:DL,diagram:t}}),"loader")},BL="stateDiagram",$L=o(((t,e)=>!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==e?.state?.defaultRenderer)),"detector"),FL={id:BL,detector:$L,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Act}));return{id:BL,diagram:t}}),"loader")},zL="journey",UL={id:zL,detector:o((t=>/^\s*journey/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return fht}));return{id:zL,diagram:t}}),"loader")},GL=o(((t,e,r)=>{y.debug("rendering svg for syntax error\n");const n=ag(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Rr(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)}),"draw"),qL={draw:GL},jL=qL,WL={db:{},renderer:qL,parser:{parse:o((()=>{}),"parse")}},YL="flowchart-elk",HL=o(((t,e={})=>!!(/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&"elk"===e?.flowchart?.defaultRenderer)&&(e.layout="elk",!0)),"detector"),VL={id:YL,detector:HL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return wX}));return{id:YL,diagram:t}}),"loader")},XL="timeline",KL={id:XL,detector:o((t=>/^\s*timeline/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return iut}));return{id:XL,diagram:t}}),"loader")},ZL="mindmap",QL={id:ZL,detector:o((t=>/^\s*mindmap/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return DCt}));return{id:ZL,diagram:t}}),"loader")},JL="kanban",tN={id:JL,detector:o((t=>/^\s*kanban/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return iSt}));return{id:JL,diagram:t}}),"loader")},eN="sankey",rN={id:eN,detector:o((t=>/^\s*sankey-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return uAt}));return{id:eN,diagram:t}}),"loader")},nN="packet",iN={id:nN,detector:o((t=>/^\s*packet-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return SAt}));return{id:nN,diagram:t}}),"loader")},aN="radar",sN={id:aN,detector:o((t=>/^\s*radar-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return rLt}));return{id:aN,diagram:t}}),"loader")},oN="block",lN={id:oN,detector:o((t=>/^\s*block-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return TIt}));return{id:oN,diagram:t}}),"loader")},cN="architecture",hN={id:cN,detector:o((t=>/^\s*architecture/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return LRt}));return{id:cN,diagram:t}}),"loader")},uN=!1,dN=o((()=>{uN||(uN=!0,sn("error",WL,(t=>"error"===t.toLowerCase().trim())),sn("---",{db:{clear:o((()=>{}),"clear")},styles:{},renderer:{draw:o((()=>{}),"draw")},parser:{parse:o((()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")}),"parse")},init:o((()=>null),"init")},(t=>t.toLowerCase().trimStart().startsWith("---"))),C(aL,tN,ML,NL,dL,mL,vL,xL,EL,SL,VL,uL,lL,QL,KL,gL,FL,PL,UL,wL,rN,iN,TL,lN,hN,sN))}),"addDiagrams"),pN=o((async()=>{y.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(_).map((async([t,{detector:e,loader:r}])=>{if(r)try{on(t)}catch{try{const{diagram:t,id:n}=await r();sn(n,t,e)}catch(e){throw y.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete _[t],e}}})))).filter((t=>"rejected"===t.status));if(t.length>0){y.error(`Failed to load ${t.length} external diagrams`);for(const e of t)y.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}}),"loadRegisteredDiagrams"),gN="comm",fN="rule",mN="decl",yN=Math.abs,vN=String.fromCharCode;function xN(t){return t.trim()}function bN(t,e,r){return t.replace(e,r)}function wN(t,e,r){return t.indexOf(e,r)}function kN(t,e){return 0|t.charCodeAt(e)}function TN(t,e,r){return t.slice(e,r)}function _N(t){return t.length}function EN(t){return t.length}function CN(t,e){return e.push(t),t}o(xN,"trim"),o(bN,"replace"),o(wN,"indexof"),o(kN,"charat"),o(TN,"substr"),o(_N,"strlen"),o(EN,"sizeof"),o(CN,"append");var SN=1,AN=1,LN=0,NN=0,IN=0,RN="";function MN(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:SN,column:AN,length:s,return:"",siblings:o}}function DN(){return IN}function ON(){return IN=NN>0?kN(RN,--NN):0,AN--,10===IN&&(AN=1,SN--),IN}function PN(){return IN=NN2||zN(IN)>3?"":" "}function WN(t,e){for(;--e&&PN()&&!(IN<48||IN>102||IN>57&&IN<65||IN>70&&IN<97););return FN(t,$N()+(e<6&&32==BN()&&32==PN()))}function YN(t){for(;PN();)switch(IN){case t:return NN;case 34:case 39:34!==t&&39!==t&&YN(IN);break;case 40:41===t&&YN(t);break;case 92:PN()}return NN}function HN(t,e){for(;PN()&&t+IN!==57&&(t+IN!==84||47!==BN()););return"/*"+FN(e,NN-1)+"*"+vN(47===t?t:PN())}function VN(t){for(;!zN(BN());)PN();return FN(t,NN)}function XN(t){return GN(KN("",null,null,null,[""],t=UN(t),0,[0],t))}function KN(t,e,r,n,i,a,s,o,l){for(var c=0,h=0,u=s,d=0,p=0,g=0,f=1,m=1,y=1,v=0,x="",b=i,w=a,k=n,T=x;m;)switch(g=v,v=PN()){case 40:if(108!=g&&58==kN(T,u-1)){-1!=wN(T+=bN(qN(v),"&","&\f"),"&\f",yN(c?o[c-1]:0))&&(y=-1);break}case 34:case 39:case 91:T+=qN(v);break;case 9:case 10:case 13:case 32:T+=jN(g);break;case 92:T+=WN($N()-1,7);continue;case 47:switch(BN()){case 42:case 47:CN(QN(HN(PN(),$N()),e,r,l),l),5!=zN(g||1)&&5!=zN(BN()||1)||!_N(T)||" "===TN(T,-1,void 0)||(T+=" ");break;default:T+="/"}break;case 123*f:o[c++]=_N(T)*y;case 125*f:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+h:-1==y&&(T=bN(T,/\f/g,"")),p>0&&(_N(T)-u||0===f&&47===g)&&CN(p>32?JN(T+";",n,r,u-1,l):JN(bN(T," ","")+";",n,r,u-2,l),l);break;case 59:T+=";";default:if(CN(k=ZN(T,e,r,c,h,i,o,x,b=[],w=[],u,a),a),123===v)if(0===h)KN(T,e,k,k,b,a,u,o,w);else{switch(d){case 99:if(110===kN(T,3))break;case 108:if(97===kN(T,2))break;default:h=0;case 100:case 109:case 115:}h?KN(t,k,k,n&&CN(ZN(t,k,k,0,0,i,o,x,i,b=[],u,w),w),i,w,u,o,n?b:w):KN(T,k,k,k,[""],w,0,o,w)}}c=h=p=0,f=y=1,x=T="",u=s;break;case 58:u=1+_N(T),p=g;default:if(f<1)if(123==v)--f;else if(125==v&&0==f++&&125==ON())continue;switch(T+=vN(v),v*f){case 38:y=h>0?1:(T+="\f",-1);break;case 44:o[c++]=(_N(T)-1)*y,y=1;break;case 64:45===BN()&&(T+=qN(PN())),d=BN(),h=u=_N(x=T+=VN($N())),v++;break;case 45:45===g&&2==_N(T)&&(f=0)}}return a}function ZN(t,e,r,n,i,a,s,o,l,c,h,u){for(var d=i-1,p=0===i?a:[""],g=EN(p),f=0,m=0,y=0;f0?p[v]+" "+x:bN(x,/&\f/g,p[v])))&&(l[y++]=b);return MN(t,e,r,0===i?fN:o,l,c,h,u)}function QN(t,e,r,n){return MN(t,e,r,gN,vN(DN()),TN(t,2,-2),0,n)}function JN(t,e,r,n,i){return MN(t,e,r,mN,TN(t,0,n),TN(t,n+1,-1),n,i)}function tI(t,e){for(var r="",n=0;n{aI.forEach((t=>{t()})),aI=[]}),"attachFunctions"),oI=o((t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()),"cleanupComments");function lI(t){const e=t.match(b);if(!e)return{text:t,metadata:{}};let r=oy(e[1],{schema:sy})??{};r="object"!=typeof r||Array.isArray(r)?{}:r;const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}o(lI,"extractFrontMatter");var cI=o((t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,((t,e,r)=>"<"+e+r.replace(/="([^"]*)"/g,"='$1'")+">"))),"cleanupText"),hI=o((t=>{const{text:e,metadata:r}=lI(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}}),"processFrontmatter"),uI=o((t=>{const e=Pk.detectInit(t)??{},r=Pk.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some((({type:t})=>"wrap"===t)):"wrap"===r?.type&&(e.wrap=!0),{text:ak(t),directive:e}}),"processDirectives");function dI(t){const e=cI(t),r=hI(e),n=uI(r.text),i=Ok(r.config,n.directive);return{code:t=oI(n.text),title:r.title,config:i}}function pI(t){const e=(new TextEncoder).encode(t),r=Array.from(e,(t=>String.fromCodePoint(t))).join("");return btoa(r)}o(dI,"preprocessDiagram"),o(pI,"toBase64");var gI=["foreignobject"],fI=["dominant-baseline"];function mI(t){const e=dI(t);return Wt(),jt(e.config??{}),e}async function yI(t,e){dN();try{const{code:e,config:r}=mI(t);return{diagramType:(await AI(e)).type,config:r}}catch(t){if(e?.suppressErrors)return!1;throw t}}o(mI,"processAndSetConfigs"),o(yI,"parse");var vI=o(((t,e,r=[])=>`\n.${t} ${e} { ${r.join(" !important; ")} !important; }`),"cssImportantStyles"),xI=o(((t,e=new Map)=>{let r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const n=["> *","span"],i=["rect","polygon","ellipse","circle","path"],a=t.htmlLabels??t.flowchart?.htmlLabels?n:i;e.forEach((t=>{iL(t.styles)||a.forEach((e=>{r+=vI(t.id,e,t.styles)})),iL(t.textStyles)||(r+=vI(t.id,"tspan",(t?.textStyles||[]).map((t=>t.replace("color","fill")))))}))}return r}),"createCssStyles"),bI=o(((t,e,r,n)=>{const i=xI(t,r);return tI(XN(`${n}{${Br(e,i,t.themeVariables)}}`),eI)}),"createUserStyles"),wI=o(((t="",e,r)=>{let n=t;return r||e||(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=$k(n),n=n.replace(/
    /g,"
    "),n}),"cleanUpSvgCode"),kI=o(((t="",e)=>``),"putIntoIFrame"),TI=o(((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&s.attr("xmlns:xlink",i),s.append("g"),t}),"appendDivSvgG");function _I(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}o(_I,"sandboxedIframe");var EI=o(((t,e,r,n)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(n)?.remove()}),"removeExistingElements"),CI=o((async function(e,r,n){dN();const i=mI(r);r=i.code;const a=Gt();y.debug(a),r.length>(a?.maxTextSize??5e4)&&(r="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const s="#"+e,l="i"+e,c="#"+l,h="d"+e,u="#"+h,d=o((()=>{const t=Ga(g?c:u).node();t&&"remove"in t&&t.remove()}),"removeTempElements");let p=Ga("body");const g="sandbox"===a.securityLevel,f="loose"===a.securityLevel,m=a.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),g){const t=_I(Ga(n),l);p=Ga(t.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=Ga(n);TI(p,e,h,`font-family: ${m}`,"http://www.w3.org/1999/xlink")}else{if(EI(document,e,h,l),g){const t=_I(Ga("body"),l);p=Ga(t.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=Ga("body");TI(p,e,h)}let v,x;try{v=await iI.fromText(r,{title:i.title})}catch(t){if(a.suppressErrorRendering)throw d(),t;v=await iI.fromText("error"),x=t}const b=p.select(u).node(),w=v.type,k=b.firstChild,T=k.firstChild,_=v.renderer.getClasses?.(r,v),E=bI(a,w,_,s),C=document.createElement("style");C.innerHTML=E,k.insertBefore(C,T);try{await v.renderer.draw(r,e,t,v)}catch(n){throw a.suppressErrorRendering?d():jL.draw(r,e,t),n}const S=p.select(`${u} svg`),A=v.db.getAccTitle?.(),L=v.db.getAccDescription?.();LI(w,S,A,L),p.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let N=p.select(u).node().innerHTML;if(y.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),N=wI(N,g,yr(a.arrowMarkerAbsolute)),g){const t=p.select(u+" svg").node();N=kI(N,t)}else f||(N=nr.sanitize(N,{ADD_TAGS:gI,ADD_ATTR:fI,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(sI(),x)throw x;return d(),{diagramType:w,svg:N,bindFunctions:v.db.bindFunctions}}),"render");function SI(t={}){const e=N({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),$t(e),e?.theme&&e.theme in _t?e.themeVariables=_t[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=_t.default.getThemeVariables(e.themeVariables));const r="object"==typeof e?Bt(e):zt();v(r.logLevel),dN()}o(SI,"initialize");var AI=o(((t,e={})=>{const{code:r}=dI(t);return iI.fromText(r,e)}),"getDiagramFromText");function LI(t,e,r,n){rI(e,t),nI(e,r,n,e.attr("id"))}o(LI,"addA11yInfo");var NI=Object.freeze({render:CI,parse:yI,getDiagramFromText:AI,initialize:SI,getConfig:Gt,setConfig:Ut,getSiteConfig:zt,updateSiteConfig:Ft,reset:o((()=>{Wt()}),"reset"),globalReset:o((()=>{Wt(Rt)}),"globalReset"),defaultConfig:Rt});v(Gt().logLevel),Wt(Gt());var II=o(((t,e,r)=>{y.warn(t),Rk(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))}),"handleError"),RI=o((async function(t={querySelector:".mermaid"}){try{await MI(t)}catch(e){if(Rk(e)&&y.error(e.str),jI.parseError&&jI.parseError(e),!t.suppressErrors)throw y.error("Use the suppressErrors option to suppress these errors"),e}}),"run"),MI=o((async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=NI.getConfig();let i;if(y.debug((t?"":"No ")+"Callback function found"),r)i=r;else{if(!e)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(e)}y.debug(`Found ${i.length} diagrams`),void 0!==n?.startOnLoad&&(y.debug("Start On Load: "+n?.startOnLoad),NI.updateSiteConfig({startOnLoad:n?.startOnLoad}));const a=new Pk.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const e of Array.from(i)){if(y.info("Rendering diagram: "+e.id),e.getAttribute("data-processed"))continue;e.setAttribute("data-processed","true");const r=`mermaid-${a.next()}`;s=e.innerHTML,s=Uk(Pk.entityDecode(s)).trim().replace(//gi,"
    ");const n=Pk.detectInit(s);n&&y.debug("Detected early reinit: ",n);try{const{svg:n,bindFunctions:i}=await qI(r,s,e);e.innerHTML=n,t&&await t(r),i&&i(e)}catch(t){II(t,o,jI.parseError)}}if(o.length>0)throw o[0]}),"runThrowsErrors"),DI=o((function(t){NI.initialize(t)}),"initialize"),OI=o((async function(t,e,r){y.warn("mermaid.init is deprecated. Please use run instead."),t&&DI(t);const n={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof e?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await RI(n)}),"init"),PI=o((async(t,{lazyLoad:e=!0}={})=>{dN(),C(...t),!1===e&&await pN()}),"registerExternalDiagrams"),BI=o((function(){if(jI.startOnLoad){const{startOnLoad:t}=NI.getConfig();t&&jI.run().catch((t=>y.error("Mermaid failed to initialize",t)))}}),"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",BI,!1);var $I=o((function(t){jI.parseError=t}),"setParseErrorHandler"),FI=[],zI=!1,UI=o((async()=>{if(!zI){for(zI=!0;FI.length>0;){const t=FI.shift();if(t)try{await t()}catch(t){y.error("Error executing queue",t)}}zI=!1}}),"executeQueue"),GI=o((async(t,e)=>new Promise(((r,n)=>{const i=o((()=>new Promise(((i,a)=>{NI.parse(t,e).then((t=>{i(t),r(t)}),(t=>{y.error("Error parsing",t),jI.parseError?.(t),a(t),n(t)}))}))),"performCall");FI.push(i),UI().catch(n)}))),"parse"),qI=o(((t,e,r)=>new Promise(((n,i)=>{const a=o((()=>new Promise(((a,s)=>{NI.render(t,e,r).then((t=>{a(t),n(t)}),(t=>{y.error("Error parsing",t),jI.parseError?.(t),s(t),i(t)}))}))),"performCall");FI.push(a),UI().catch(i)}))),"render"),jI={startOnLoad:!0,mermaidAPI:NI,parse:GI,render:qI,init:OI,run:RI,registerExternalDiagrams:PI,registerLayoutLoaders:MA,initialize:DI,parseError:void 0,contentLoaded:BI,setParseErrorHandler:$I,detectType:E,registerIconPacks:zy},WI=jI;function YI(t){let{beforeRender:e,afterRender:r}=t;return function(t){ +/*! Check if previously processed */ +/*! + * Wait for document loaded before starting the execution + */ +/*! + * reveal.js Mermaid plugin + */ +return async function(t){let{el:e,beforeRender:r,afterRender:n}=t;if(!1===await(null==r?void 0:r(e)))return;const i=e.textContent.trim();try{const{svg:t}=await WI.render(`mermaid-${Math.random().toString(36).substring(2)}`,i);e.innerHTML=t,await(null==n?void 0:n(e))}catch(t){let r="";null!=t&&t.str&&(r=t.str),null!=t&&t.message&&(r=t.message),console.error(r,{error:t,graphDefinition:i,el:e}),e.innerHTML=r}}({el:t,beforeRender:e,afterRender:r})}}const HI={id:"mermaid",init:function(t){const{...e}=t.getConfig().mermaid||{},{...r}=t.getConfig().mermaidPlugin||{},n=YI({beforeRender:r.beforeRender,afterRender:r.afterRender});WI.initialize({startOnLoad:!1,...e});const i=t.getRevealElement().querySelectorAll(".mermaid");Array.from(i).forEach((function(t){n(t)}))}};var VI=class t{static{o(this,"SourceLocation")}constructor(t,e,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=e,this.end=r}static range(e,r){return r?e&&e.loc&&r.loc&&e.loc.lexer===r.loc.lexer?new t(e.loc.lexer,e.loc.start,r.loc.end):null:e&&e.loc}},XI=class t{static{o(this,"Token")}constructor(t,e){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=e}range(e,r){return new t(r,VI.range(this,e))}},KI=class t{static{o(this,"ParseError")}constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,i,a="KaTeX parse error: "+e,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,i=s.end,n===o.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var l=o.slice(n,i).replace(/[^]/g,"$&̲");a+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+l+(i+15":">","<":"<",'"':""","'":"'"},rR=/[&><"']/g;function nR(t){return String(t).replace(rR,(t=>eR[t]))}o(nR,"escape");var iR=o((function t(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?t(e.body[0]):e:"font"===e.type?t(e.body):e}),"getBaseElem"),aR=o((function(t){var e=iR(t);return"mathord"===e.type||"textord"===e.type||"atom"===e.type}),"isCharacterBox"),sR=o((function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t}),"assert"),oR={contains:ZI,deflt:QI,escape:nR,hyphenate:tR,getBaseElem:iR,isCharacterBox:aR,protocolFromUrl:o((function(t){var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?":"!==e[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?e[1].toLowerCase():null:"_relative"}),"protocolFromUrl")},lR={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:o((t=>"#"+t),"cliProcessor")},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:o(((t,e)=>(e.push(t),e)),"cliProcessor")},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:o((t=>Math.max(0,t)),"processor"),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:o((t=>Math.max(0,t)),"processor"),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:o((t=>Math.max(0,t)),"processor"),cli:"-e, --max-expand ",cliProcessor:o((t=>"Infinity"===t?1/0:parseInt(t)),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};function cR(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}o(cR,"getDefaultValue");var hR=class{static{o(this,"Settings")}constructor(t){for(var e in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{},lR)if(lR.hasOwnProperty(e)){var r=lR[e];this[e]=void 0!==t[e]?r.processor?r.processor(t[e]):t[e]:cR(r)}}reportNonstrict(t,e,r){var n=this.strict;if("function"==typeof n&&(n=n(t,e,r)),n&&"ignore"!==n){if(!0===n||"error"===n)throw new KI("LaTeX-incompatible input and strict mode is set to 'error': "+e+" ["+t+"]",r);"warn"===n?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+e+" ["+t+"]")}}useStrictBehavior(t,e,r){var n=this.strict;if("function"==typeof n)try{n=n(t,e,r)}catch(t){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+e+" ["+t+"]"),!1)))}isTrusted(t){if(t.url&&!t.protocol){var e=oR.protocolFromUrl(t.url);if(null==e)return!1;t.protocol=e}var r="function"==typeof this.trust?this.trust(t):this.trust;return Boolean(r)}},uR=class{static{o(this,"Style")}constructor(t,e,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=e,this.cramped=r}sup(){return dR[pR[this.id]]}sub(){return dR[gR[this.id]]}fracNum(){return dR[fR[this.id]]}fracDen(){return dR[mR[this.id]]}cramp(){return dR[yR[this.id]]}text(){return dR[vR[this.id]]}isTight(){return this.size>=2}},dR=[new uR(0,0,!1),new uR(1,0,!0),new uR(2,1,!1),new uR(3,1,!0),new uR(4,2,!1),new uR(5,2,!0),new uR(6,3,!1),new uR(7,3,!0)],pR=[4,5,4,5,6,7,6,7],gR=[5,5,5,5,7,7,7,7],fR=[2,3,4,5,6,7,6,7],mR=[3,3,5,5,7,7,7,7],yR=[1,1,3,3,5,5,7,7],vR=[0,1,2,3,2,3,2,3],xR={DISPLAY:dR[0],TEXT:dR[2],SCRIPT:dR[4],SCRIPTSCRIPT:dR[6]},bR=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function wR(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}o(wR,"scriptFromCodepoint");var kR=[];function TR(t){for(var e=0;e=kR[e]&&t<=kR[e+1])return!0;return!1}bR.forEach((t=>t.blocks.forEach((t=>kR.push(...t))))),o(TR,"supportedCodepoint");var _R=80,ER=o((function(t,e){return"M95,"+(622+t+e)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+t/2.075+" -"+t+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+t)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtMain"),CR=o((function(t,e){return"M263,"+(601+t+e)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+t/2.084+" -"+t+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+t)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtSize1"),SR=o((function(t,e){return"M983 "+(10+t+e)+"\nl"+t/3.13+" -"+t+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+t)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtSize2"),AR=o((function(t,e){return"M424,"+(2398+t+e)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+t/4.223+" -"+t+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+t)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+t)+" "+e+"\nh400000v"+(40+t)+"h-400000z"}),"sqrtSize3"),LR=o((function(t,e){return"M473,"+(2713+t+e)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+t/5.298+" -"+t+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+t)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+t)+" "+e+"h400000v"+(40+t)+"H1017.7z"}),"sqrtSize4"),NR=o((function(t){return"M400000 "+t+" H0 L"+t/2+" 0 l65 45 L145 "+(t-80)+" H400000z"}),"phasePath"),IR=o((function(t,e,r){return"M702 "+(t+e)+"H400000"+(40+t)+"\nH742v"+(r-54-e-t)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+e+"H400000v"+(40+t)+"H742z"}),"sqrtTall"),RR=o((function(t,e,r){e*=1e3;var n="";switch(t){case"sqrtMain":n=ER(e,_R);break;case"sqrtSize1":n=CR(e,_R);break;case"sqrtSize2":n=SR(e,_R);break;case"sqrtSize3":n=AR(e,_R);break;case"sqrtSize4":n=LR(e,_R);break;case"sqrtTall":n=IR(e,_R,r)}return n}),"sqrtPath"),MR=o((function(t,e){switch(t){case"⎜":return"M291 0 H417 V"+e+" H291z M291 0 H417 V"+e+" H291z";case"∣":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z";case"∥":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145zM367 0 H410 V"+e+" H367z M367 0 H410 V"+e+" H367z";case"⎟":return"M457 0 H583 V"+e+" H457z M457 0 H583 V"+e+" H457z";case"⎢":return"M319 0 H403 V"+e+" H319z M319 0 H403 V"+e+" H319z";case"⎥":return"M263 0 H347 V"+e+" H263z M263 0 H347 V"+e+" H263z";case"⎪":return"M384 0 H504 V"+e+" H384z M384 0 H504 V"+e+" H384z";case"⏐":return"M312 0 H355 V"+e+" H312z M312 0 H355 V"+e+" H312z";case"‖":return"M257 0 H300 V"+e+" H257z M257 0 H300 V"+e+" H257zM478 0 H521 V"+e+" H478z M478 0 H521 V"+e+" H478z";default:return""}}),"innerPath"),DR={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},OR=o((function(t,e){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+e+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+e+" v1759 h84z";case"vert":return"M145 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+e+" v585 h43z";case"doublevert":return"M145 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+e+" v585 h43z\nM367 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+e+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+e+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+e+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+e+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+e+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+" v602 h84z\nM403 1759 V0 H319 V1759 v"+e+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+e+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(e+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(e+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(e+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(e+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}),"tallDelim"),PR=class{static{o(this,"DocumentFragment")}constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return oR.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),e=0;et.toText()),"toText");return this.children.map(t).join("")}},BR={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},$R={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},FR={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function zR(t,e){BR[t]=e}function UR(t,e,r){if(!BR[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=BR[e][n];if(!i&&t[0]in FR&&(n=FR[t[0]].charCodeAt(0),i=BR[e][n]),i||"text"!==r||TR(n)&&(i=BR[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}o(zR,"setFontMetrics"),o(UR,"getCharacterMetrics");var GR={};function qR(t){var e;if(!GR[e=t>=5?0:t>=3?1:2]){var r=GR[e]={cssEmPerMu:$R.quad[e]/18};for(var n in $R)$R.hasOwnProperty(n)&&(r[n]=$R[n][e])}return GR[e]}o(qR,"getGlobalMetrics");var jR=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],WR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],YR=o((function(t,e){return e.size<2?t:jR[t-1][e.size-1]}),"sizeAtStyle"),HR=class t{static{o(this,"Options")}constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||t.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=WR[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new t(r)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:YR(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:WR[t-1]})}havingBaseStyle(e){e=e||this.style.text();var r=YR(t.BASESIZE,e);return this.size===r&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=qR(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};HR.BASESIZE=6;var VR={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},XR={ex:!0,em:!0,mu:!0},KR=o((function(t){return"string"!=typeof t&&(t=t.unit),t in VR||t in XR||"ex"===t}),"validUnit"),ZR=o((function(t,e){var r;if(t.unit in VR)r=VR[t.unit]/e.fontMetrics().ptPerEm/e.sizeMultiplier;else if("mu"===t.unit)r=e.fontMetrics().cssEmPerMu;else{var n;if(n=e.style.isTight()?e.havingStyle(e.style.text()):e,"ex"===t.unit)r=n.fontMetrics().xHeight;else{if("em"!==t.unit)throw new KI("Invalid unit: '"+t.unit+"'");r=n.fontMetrics().quad}n!==e&&(r*=n.sizeMultiplier/e.sizeMultiplier)}return Math.min(t.number*r,e.maxSize)}),"calculateSize"),QR=o((function(t){return+t.toFixed(4)+"em"}),"makeEm"),JR=o((function(t){return t.filter((t=>t)).join(" ")}),"createClass"),tM=o((function(t,e,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},e){e.style.isTight()&&this.classes.push("mtight");var n=e.getColor();n&&(this.style.color=n)}}),"initNode"),eM=o((function(t){var e=document.createElement(t);for(var r in e.className=JR(this.classes),this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&e.setAttribute(n,this.attributes[n]);for(var i=0;i"}),"toMarkup"),nM=class{static{o(this,"Span")}constructor(t,e,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,tM.call(this,t,r,n),this.children=e||[]}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return oR.contains(this.classes,t)}toNode(){return eM.call(this,"span")}toMarkup(){return rM.call(this,"span")}},iM=class{static{o(this,"Anchor")}constructor(t,e,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,tM.call(this,e,n),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return oR.contains(this.classes,t)}toNode(){return eM.call(this,"a")}toMarkup(){return rM.call(this,"a")}},aM=class{static{o(this,"Img")}constructor(t,e,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=e,this.src=t,this.classes=["mord"],this.style=r}hasClass(t){return oR.contains(this.classes,t)}toNode(){var t=document.createElement("img");for(var e in t.src=this.src,t.alt=this.alt,t.className="mord",this.style)this.style.hasOwnProperty(e)&&(t.style[e]=this.style[e]);return t}toMarkup(){var t=''+oR.escape(this.alt)+'0&&((e=document.createElement("span")).style.marginRight=QR(this.italic)),this.classes.length>0&&((e=e||document.createElement("span")).className=JR(this.classes)),this.style)this.style.hasOwnProperty(r)&&((e=e||document.createElement("span")).style[r]=this.style[r]);return e?(e.appendChild(t),e):t}toMarkup(){var t=!1,e="0&&(r+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(n)&&(r+=oR.hyphenate(n)+":"+this.style[n]+";");r&&(t=!0,e+=' style="'+oR.escape(r)+'"');var i=oR.escape(this.text);return t?(e+=">",e+=i,e+=""):i}},lM=class{static{o(this,"SvgNode")}constructor(t,e){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=e||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);for(var r=0;r':''}},hM=class{static{o(this,"LineNode")}constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","line");for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);return t}toMarkup(){var t=" but got "+String(t)+".")}o(uM,"assertSymbolDomNode"),o(dM,"assertSpan");var pM={bin:1,close:1,inner:1,open:1,punct:1,rel:1},gM={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},fM={math:{},text:{}};function mM(t,e,r,n,i,a){fM[t][i]={font:e,group:r,replace:n},a&&n&&(fM[t][n]=fM[t][i])}o(mM,"defineSymbol");var yM="math",vM="text",xM="main",bM="ams",wM="accent-token",kM="bin",TM="close",_M="inner",EM="mathord",CM="op-token",SM="open",AM="punct",LM="rel",NM="spacing",IM="textord";mM(yM,xM,LM,"≡","\\equiv",!0),mM(yM,xM,LM,"≺","\\prec",!0),mM(yM,xM,LM,"≻","\\succ",!0),mM(yM,xM,LM,"∼","\\sim",!0),mM(yM,xM,LM,"⊥","\\perp"),mM(yM,xM,LM,"⪯","\\preceq",!0),mM(yM,xM,LM,"⪰","\\succeq",!0),mM(yM,xM,LM,"≃","\\simeq",!0),mM(yM,xM,LM,"∣","\\mid",!0),mM(yM,xM,LM,"≪","\\ll",!0),mM(yM,xM,LM,"≫","\\gg",!0),mM(yM,xM,LM,"≍","\\asymp",!0),mM(yM,xM,LM,"∥","\\parallel"),mM(yM,xM,LM,"⋈","\\bowtie",!0),mM(yM,xM,LM,"⌣","\\smile",!0),mM(yM,xM,LM,"⊑","\\sqsubseteq",!0),mM(yM,xM,LM,"⊒","\\sqsupseteq",!0),mM(yM,xM,LM,"≐","\\doteq",!0),mM(yM,xM,LM,"⌢","\\frown",!0),mM(yM,xM,LM,"∋","\\ni",!0),mM(yM,xM,LM,"∝","\\propto",!0),mM(yM,xM,LM,"⊢","\\vdash",!0),mM(yM,xM,LM,"⊣","\\dashv",!0),mM(yM,xM,LM,"∋","\\owns"),mM(yM,xM,AM,".","\\ldotp"),mM(yM,xM,AM,"⋅","\\cdotp"),mM(yM,xM,IM,"#","\\#"),mM(vM,xM,IM,"#","\\#"),mM(yM,xM,IM,"&","\\&"),mM(vM,xM,IM,"&","\\&"),mM(yM,xM,IM,"ℵ","\\aleph",!0),mM(yM,xM,IM,"∀","\\forall",!0),mM(yM,xM,IM,"ℏ","\\hbar",!0),mM(yM,xM,IM,"∃","\\exists",!0),mM(yM,xM,IM,"∇","\\nabla",!0),mM(yM,xM,IM,"♭","\\flat",!0),mM(yM,xM,IM,"ℓ","\\ell",!0),mM(yM,xM,IM,"♮","\\natural",!0),mM(yM,xM,IM,"♣","\\clubsuit",!0),mM(yM,xM,IM,"℘","\\wp",!0),mM(yM,xM,IM,"♯","\\sharp",!0),mM(yM,xM,IM,"♢","\\diamondsuit",!0),mM(yM,xM,IM,"ℜ","\\Re",!0),mM(yM,xM,IM,"♡","\\heartsuit",!0),mM(yM,xM,IM,"ℑ","\\Im",!0),mM(yM,xM,IM,"♠","\\spadesuit",!0),mM(yM,xM,IM,"§","\\S",!0),mM(vM,xM,IM,"§","\\S"),mM(yM,xM,IM,"¶","\\P",!0),mM(vM,xM,IM,"¶","\\P"),mM(yM,xM,IM,"†","\\dag"),mM(vM,xM,IM,"†","\\dag"),mM(vM,xM,IM,"†","\\textdagger"),mM(yM,xM,IM,"‡","\\ddag"),mM(vM,xM,IM,"‡","\\ddag"),mM(vM,xM,IM,"‡","\\textdaggerdbl"),mM(yM,xM,TM,"⎱","\\rmoustache",!0),mM(yM,xM,SM,"⎰","\\lmoustache",!0),mM(yM,xM,TM,"⟯","\\rgroup",!0),mM(yM,xM,SM,"⟮","\\lgroup",!0),mM(yM,xM,kM,"∓","\\mp",!0),mM(yM,xM,kM,"⊖","\\ominus",!0),mM(yM,xM,kM,"⊎","\\uplus",!0),mM(yM,xM,kM,"⊓","\\sqcap",!0),mM(yM,xM,kM,"∗","\\ast"),mM(yM,xM,kM,"⊔","\\sqcup",!0),mM(yM,xM,kM,"◯","\\bigcirc",!0),mM(yM,xM,kM,"∙","\\bullet",!0),mM(yM,xM,kM,"‡","\\ddagger"),mM(yM,xM,kM,"≀","\\wr",!0),mM(yM,xM,kM,"⨿","\\amalg"),mM(yM,xM,kM,"&","\\And"),mM(yM,xM,LM,"⟵","\\longleftarrow",!0),mM(yM,xM,LM,"⇐","\\Leftarrow",!0),mM(yM,xM,LM,"⟸","\\Longleftarrow",!0),mM(yM,xM,LM,"⟶","\\longrightarrow",!0),mM(yM,xM,LM,"⇒","\\Rightarrow",!0),mM(yM,xM,LM,"⟹","\\Longrightarrow",!0),mM(yM,xM,LM,"↔","\\leftrightarrow",!0),mM(yM,xM,LM,"⟷","\\longleftrightarrow",!0),mM(yM,xM,LM,"⇔","\\Leftrightarrow",!0),mM(yM,xM,LM,"⟺","\\Longleftrightarrow",!0),mM(yM,xM,LM,"↦","\\mapsto",!0),mM(yM,xM,LM,"⟼","\\longmapsto",!0),mM(yM,xM,LM,"↗","\\nearrow",!0),mM(yM,xM,LM,"↩","\\hookleftarrow",!0),mM(yM,xM,LM,"↪","\\hookrightarrow",!0),mM(yM,xM,LM,"↘","\\searrow",!0),mM(yM,xM,LM,"↼","\\leftharpoonup",!0),mM(yM,xM,LM,"⇀","\\rightharpoonup",!0),mM(yM,xM,LM,"↙","\\swarrow",!0),mM(yM,xM,LM,"↽","\\leftharpoondown",!0),mM(yM,xM,LM,"⇁","\\rightharpoondown",!0),mM(yM,xM,LM,"↖","\\nwarrow",!0),mM(yM,xM,LM,"⇌","\\rightleftharpoons",!0),mM(yM,bM,LM,"≮","\\nless",!0),mM(yM,bM,LM,"","\\@nleqslant"),mM(yM,bM,LM,"","\\@nleqq"),mM(yM,bM,LM,"⪇","\\lneq",!0),mM(yM,bM,LM,"≨","\\lneqq",!0),mM(yM,bM,LM,"","\\@lvertneqq"),mM(yM,bM,LM,"⋦","\\lnsim",!0),mM(yM,bM,LM,"⪉","\\lnapprox",!0),mM(yM,bM,LM,"⊀","\\nprec",!0),mM(yM,bM,LM,"⋠","\\npreceq",!0),mM(yM,bM,LM,"⋨","\\precnsim",!0),mM(yM,bM,LM,"⪹","\\precnapprox",!0),mM(yM,bM,LM,"≁","\\nsim",!0),mM(yM,bM,LM,"","\\@nshortmid"),mM(yM,bM,LM,"∤","\\nmid",!0),mM(yM,bM,LM,"⊬","\\nvdash",!0),mM(yM,bM,LM,"⊭","\\nvDash",!0),mM(yM,bM,LM,"⋪","\\ntriangleleft"),mM(yM,bM,LM,"⋬","\\ntrianglelefteq",!0),mM(yM,bM,LM,"⊊","\\subsetneq",!0),mM(yM,bM,LM,"","\\@varsubsetneq"),mM(yM,bM,LM,"⫋","\\subsetneqq",!0),mM(yM,bM,LM,"","\\@varsubsetneqq"),mM(yM,bM,LM,"≯","\\ngtr",!0),mM(yM,bM,LM,"","\\@ngeqslant"),mM(yM,bM,LM,"","\\@ngeqq"),mM(yM,bM,LM,"⪈","\\gneq",!0),mM(yM,bM,LM,"≩","\\gneqq",!0),mM(yM,bM,LM,"","\\@gvertneqq"),mM(yM,bM,LM,"⋧","\\gnsim",!0),mM(yM,bM,LM,"⪊","\\gnapprox",!0),mM(yM,bM,LM,"⊁","\\nsucc",!0),mM(yM,bM,LM,"⋡","\\nsucceq",!0),mM(yM,bM,LM,"⋩","\\succnsim",!0),mM(yM,bM,LM,"⪺","\\succnapprox",!0),mM(yM,bM,LM,"≆","\\ncong",!0),mM(yM,bM,LM,"","\\@nshortparallel"),mM(yM,bM,LM,"∦","\\nparallel",!0),mM(yM,bM,LM,"⊯","\\nVDash",!0),mM(yM,bM,LM,"⋫","\\ntriangleright"),mM(yM,bM,LM,"⋭","\\ntrianglerighteq",!0),mM(yM,bM,LM,"","\\@nsupseteqq"),mM(yM,bM,LM,"⊋","\\supsetneq",!0),mM(yM,bM,LM,"","\\@varsupsetneq"),mM(yM,bM,LM,"⫌","\\supsetneqq",!0),mM(yM,bM,LM,"","\\@varsupsetneqq"),mM(yM,bM,LM,"⊮","\\nVdash",!0),mM(yM,bM,LM,"⪵","\\precneqq",!0),mM(yM,bM,LM,"⪶","\\succneqq",!0),mM(yM,bM,LM,"","\\@nsubseteqq"),mM(yM,bM,kM,"⊴","\\unlhd"),mM(yM,bM,kM,"⊵","\\unrhd"),mM(yM,bM,LM,"↚","\\nleftarrow",!0),mM(yM,bM,LM,"↛","\\nrightarrow",!0),mM(yM,bM,LM,"⇍","\\nLeftarrow",!0),mM(yM,bM,LM,"⇏","\\nRightarrow",!0),mM(yM,bM,LM,"↮","\\nleftrightarrow",!0),mM(yM,bM,LM,"⇎","\\nLeftrightarrow",!0),mM(yM,bM,LM,"△","\\vartriangle"),mM(yM,bM,IM,"ℏ","\\hslash"),mM(yM,bM,IM,"▽","\\triangledown"),mM(yM,bM,IM,"◊","\\lozenge"),mM(yM,bM,IM,"Ⓢ","\\circledS"),mM(yM,bM,IM,"®","\\circledR"),mM(vM,bM,IM,"®","\\circledR"),mM(yM,bM,IM,"∡","\\measuredangle",!0),mM(yM,bM,IM,"∄","\\nexists"),mM(yM,bM,IM,"℧","\\mho"),mM(yM,bM,IM,"Ⅎ","\\Finv",!0),mM(yM,bM,IM,"⅁","\\Game",!0),mM(yM,bM,IM,"‵","\\backprime"),mM(yM,bM,IM,"▲","\\blacktriangle"),mM(yM,bM,IM,"▼","\\blacktriangledown"),mM(yM,bM,IM,"■","\\blacksquare"),mM(yM,bM,IM,"⧫","\\blacklozenge"),mM(yM,bM,IM,"★","\\bigstar"),mM(yM,bM,IM,"∢","\\sphericalangle",!0),mM(yM,bM,IM,"∁","\\complement",!0),mM(yM,bM,IM,"ð","\\eth",!0),mM(vM,xM,IM,"ð","ð"),mM(yM,bM,IM,"╱","\\diagup"),mM(yM,bM,IM,"╲","\\diagdown"),mM(yM,bM,IM,"□","\\square"),mM(yM,bM,IM,"□","\\Box"),mM(yM,bM,IM,"◊","\\Diamond"),mM(yM,bM,IM,"¥","\\yen",!0),mM(vM,bM,IM,"¥","\\yen",!0),mM(yM,bM,IM,"✓","\\checkmark",!0),mM(vM,bM,IM,"✓","\\checkmark"),mM(yM,bM,IM,"ℶ","\\beth",!0),mM(yM,bM,IM,"ℸ","\\daleth",!0),mM(yM,bM,IM,"ℷ","\\gimel",!0),mM(yM,bM,IM,"ϝ","\\digamma",!0),mM(yM,bM,IM,"ϰ","\\varkappa"),mM(yM,bM,SM,"┌","\\@ulcorner",!0),mM(yM,bM,TM,"┐","\\@urcorner",!0),mM(yM,bM,SM,"└","\\@llcorner",!0),mM(yM,bM,TM,"┘","\\@lrcorner",!0),mM(yM,bM,LM,"≦","\\leqq",!0),mM(yM,bM,LM,"⩽","\\leqslant",!0),mM(yM,bM,LM,"⪕","\\eqslantless",!0),mM(yM,bM,LM,"≲","\\lesssim",!0),mM(yM,bM,LM,"⪅","\\lessapprox",!0),mM(yM,bM,LM,"≊","\\approxeq",!0),mM(yM,bM,kM,"⋖","\\lessdot"),mM(yM,bM,LM,"⋘","\\lll",!0),mM(yM,bM,LM,"≶","\\lessgtr",!0),mM(yM,bM,LM,"⋚","\\lesseqgtr",!0),mM(yM,bM,LM,"⪋","\\lesseqqgtr",!0),mM(yM,bM,LM,"≑","\\doteqdot"),mM(yM,bM,LM,"≓","\\risingdotseq",!0),mM(yM,bM,LM,"≒","\\fallingdotseq",!0),mM(yM,bM,LM,"∽","\\backsim",!0),mM(yM,bM,LM,"⋍","\\backsimeq",!0),mM(yM,bM,LM,"⫅","\\subseteqq",!0),mM(yM,bM,LM,"⋐","\\Subset",!0),mM(yM,bM,LM,"⊏","\\sqsubset",!0),mM(yM,bM,LM,"≼","\\preccurlyeq",!0),mM(yM,bM,LM,"⋞","\\curlyeqprec",!0),mM(yM,bM,LM,"≾","\\precsim",!0),mM(yM,bM,LM,"⪷","\\precapprox",!0),mM(yM,bM,LM,"⊲","\\vartriangleleft"),mM(yM,bM,LM,"⊴","\\trianglelefteq"),mM(yM,bM,LM,"⊨","\\vDash",!0),mM(yM,bM,LM,"⊪","\\Vvdash",!0),mM(yM,bM,LM,"⌣","\\smallsmile"),mM(yM,bM,LM,"⌢","\\smallfrown"),mM(yM,bM,LM,"≏","\\bumpeq",!0),mM(yM,bM,LM,"≎","\\Bumpeq",!0),mM(yM,bM,LM,"≧","\\geqq",!0),mM(yM,bM,LM,"⩾","\\geqslant",!0),mM(yM,bM,LM,"⪖","\\eqslantgtr",!0),mM(yM,bM,LM,"≳","\\gtrsim",!0),mM(yM,bM,LM,"⪆","\\gtrapprox",!0),mM(yM,bM,kM,"⋗","\\gtrdot"),mM(yM,bM,LM,"⋙","\\ggg",!0),mM(yM,bM,LM,"≷","\\gtrless",!0),mM(yM,bM,LM,"⋛","\\gtreqless",!0),mM(yM,bM,LM,"⪌","\\gtreqqless",!0),mM(yM,bM,LM,"≖","\\eqcirc",!0),mM(yM,bM,LM,"≗","\\circeq",!0),mM(yM,bM,LM,"≜","\\triangleq",!0),mM(yM,bM,LM,"∼","\\thicksim"),mM(yM,bM,LM,"≈","\\thickapprox"),mM(yM,bM,LM,"⫆","\\supseteqq",!0),mM(yM,bM,LM,"⋑","\\Supset",!0),mM(yM,bM,LM,"⊐","\\sqsupset",!0),mM(yM,bM,LM,"≽","\\succcurlyeq",!0),mM(yM,bM,LM,"⋟","\\curlyeqsucc",!0),mM(yM,bM,LM,"≿","\\succsim",!0),mM(yM,bM,LM,"⪸","\\succapprox",!0),mM(yM,bM,LM,"⊳","\\vartriangleright"),mM(yM,bM,LM,"⊵","\\trianglerighteq"),mM(yM,bM,LM,"⊩","\\Vdash",!0),mM(yM,bM,LM,"∣","\\shortmid"),mM(yM,bM,LM,"∥","\\shortparallel"),mM(yM,bM,LM,"≬","\\between",!0),mM(yM,bM,LM,"⋔","\\pitchfork",!0),mM(yM,bM,LM,"∝","\\varpropto"),mM(yM,bM,LM,"◀","\\blacktriangleleft"),mM(yM,bM,LM,"∴","\\therefore",!0),mM(yM,bM,LM,"∍","\\backepsilon"),mM(yM,bM,LM,"▶","\\blacktriangleright"),mM(yM,bM,LM,"∵","\\because",!0),mM(yM,bM,LM,"⋘","\\llless"),mM(yM,bM,LM,"⋙","\\gggtr"),mM(yM,bM,kM,"⊲","\\lhd"),mM(yM,bM,kM,"⊳","\\rhd"),mM(yM,bM,LM,"≂","\\eqsim",!0),mM(yM,xM,LM,"⋈","\\Join"),mM(yM,bM,LM,"≑","\\Doteq",!0),mM(yM,bM,kM,"∔","\\dotplus",!0),mM(yM,bM,kM,"∖","\\smallsetminus"),mM(yM,bM,kM,"⋒","\\Cap",!0),mM(yM,bM,kM,"⋓","\\Cup",!0),mM(yM,bM,kM,"⩞","\\doublebarwedge",!0),mM(yM,bM,kM,"⊟","\\boxminus",!0),mM(yM,bM,kM,"⊞","\\boxplus",!0),mM(yM,bM,kM,"⋇","\\divideontimes",!0),mM(yM,bM,kM,"⋉","\\ltimes",!0),mM(yM,bM,kM,"⋊","\\rtimes",!0),mM(yM,bM,kM,"⋋","\\leftthreetimes",!0),mM(yM,bM,kM,"⋌","\\rightthreetimes",!0),mM(yM,bM,kM,"⋏","\\curlywedge",!0),mM(yM,bM,kM,"⋎","\\curlyvee",!0),mM(yM,bM,kM,"⊝","\\circleddash",!0),mM(yM,bM,kM,"⊛","\\circledast",!0),mM(yM,bM,kM,"⋅","\\centerdot"),mM(yM,bM,kM,"⊺","\\intercal",!0),mM(yM,bM,kM,"⋒","\\doublecap"),mM(yM,bM,kM,"⋓","\\doublecup"),mM(yM,bM,kM,"⊠","\\boxtimes",!0),mM(yM,bM,LM,"⇢","\\dashrightarrow",!0),mM(yM,bM,LM,"⇠","\\dashleftarrow",!0),mM(yM,bM,LM,"⇇","\\leftleftarrows",!0),mM(yM,bM,LM,"⇆","\\leftrightarrows",!0),mM(yM,bM,LM,"⇚","\\Lleftarrow",!0),mM(yM,bM,LM,"↞","\\twoheadleftarrow",!0),mM(yM,bM,LM,"↢","\\leftarrowtail",!0),mM(yM,bM,LM,"↫","\\looparrowleft",!0),mM(yM,bM,LM,"⇋","\\leftrightharpoons",!0),mM(yM,bM,LM,"↶","\\curvearrowleft",!0),mM(yM,bM,LM,"↺","\\circlearrowleft",!0),mM(yM,bM,LM,"↰","\\Lsh",!0),mM(yM,bM,LM,"⇈","\\upuparrows",!0),mM(yM,bM,LM,"↿","\\upharpoonleft",!0),mM(yM,bM,LM,"⇃","\\downharpoonleft",!0),mM(yM,xM,LM,"⊶","\\origof",!0),mM(yM,xM,LM,"⊷","\\imageof",!0),mM(yM,bM,LM,"⊸","\\multimap",!0),mM(yM,bM,LM,"↭","\\leftrightsquigarrow",!0),mM(yM,bM,LM,"⇉","\\rightrightarrows",!0),mM(yM,bM,LM,"⇄","\\rightleftarrows",!0),mM(yM,bM,LM,"↠","\\twoheadrightarrow",!0),mM(yM,bM,LM,"↣","\\rightarrowtail",!0),mM(yM,bM,LM,"↬","\\looparrowright",!0),mM(yM,bM,LM,"↷","\\curvearrowright",!0),mM(yM,bM,LM,"↻","\\circlearrowright",!0),mM(yM,bM,LM,"↱","\\Rsh",!0),mM(yM,bM,LM,"⇊","\\downdownarrows",!0),mM(yM,bM,LM,"↾","\\upharpoonright",!0),mM(yM,bM,LM,"⇂","\\downharpoonright",!0),mM(yM,bM,LM,"⇝","\\rightsquigarrow",!0),mM(yM,bM,LM,"⇝","\\leadsto"),mM(yM,bM,LM,"⇛","\\Rrightarrow",!0),mM(yM,bM,LM,"↾","\\restriction"),mM(yM,xM,IM,"‘","`"),mM(yM,xM,IM,"$","\\$"),mM(vM,xM,IM,"$","\\$"),mM(vM,xM,IM,"$","\\textdollar"),mM(yM,xM,IM,"%","\\%"),mM(vM,xM,IM,"%","\\%"),mM(yM,xM,IM,"_","\\_"),mM(vM,xM,IM,"_","\\_"),mM(vM,xM,IM,"_","\\textunderscore"),mM(yM,xM,IM,"∠","\\angle",!0),mM(yM,xM,IM,"∞","\\infty",!0),mM(yM,xM,IM,"′","\\prime"),mM(yM,xM,IM,"△","\\triangle"),mM(yM,xM,IM,"Γ","\\Gamma",!0),mM(yM,xM,IM,"Δ","\\Delta",!0),mM(yM,xM,IM,"Θ","\\Theta",!0),mM(yM,xM,IM,"Λ","\\Lambda",!0),mM(yM,xM,IM,"Ξ","\\Xi",!0),mM(yM,xM,IM,"Π","\\Pi",!0),mM(yM,xM,IM,"Σ","\\Sigma",!0),mM(yM,xM,IM,"Υ","\\Upsilon",!0),mM(yM,xM,IM,"Φ","\\Phi",!0),mM(yM,xM,IM,"Ψ","\\Psi",!0),mM(yM,xM,IM,"Ω","\\Omega",!0),mM(yM,xM,IM,"A","Α"),mM(yM,xM,IM,"B","Β"),mM(yM,xM,IM,"E","Ε"),mM(yM,xM,IM,"Z","Ζ"),mM(yM,xM,IM,"H","Η"),mM(yM,xM,IM,"I","Ι"),mM(yM,xM,IM,"K","Κ"),mM(yM,xM,IM,"M","Μ"),mM(yM,xM,IM,"N","Ν"),mM(yM,xM,IM,"O","Ο"),mM(yM,xM,IM,"P","Ρ"),mM(yM,xM,IM,"T","Τ"),mM(yM,xM,IM,"X","Χ"),mM(yM,xM,IM,"¬","\\neg",!0),mM(yM,xM,IM,"¬","\\lnot"),mM(yM,xM,IM,"⊤","\\top"),mM(yM,xM,IM,"⊥","\\bot"),mM(yM,xM,IM,"∅","\\emptyset"),mM(yM,bM,IM,"∅","\\varnothing"),mM(yM,xM,EM,"α","\\alpha",!0),mM(yM,xM,EM,"β","\\beta",!0),mM(yM,xM,EM,"γ","\\gamma",!0),mM(yM,xM,EM,"δ","\\delta",!0),mM(yM,xM,EM,"ϵ","\\epsilon",!0),mM(yM,xM,EM,"ζ","\\zeta",!0),mM(yM,xM,EM,"η","\\eta",!0),mM(yM,xM,EM,"θ","\\theta",!0),mM(yM,xM,EM,"ι","\\iota",!0),mM(yM,xM,EM,"κ","\\kappa",!0),mM(yM,xM,EM,"λ","\\lambda",!0),mM(yM,xM,EM,"μ","\\mu",!0),mM(yM,xM,EM,"ν","\\nu",!0),mM(yM,xM,EM,"ξ","\\xi",!0),mM(yM,xM,EM,"ο","\\omicron",!0),mM(yM,xM,EM,"π","\\pi",!0),mM(yM,xM,EM,"ρ","\\rho",!0),mM(yM,xM,EM,"σ","\\sigma",!0),mM(yM,xM,EM,"τ","\\tau",!0),mM(yM,xM,EM,"υ","\\upsilon",!0),mM(yM,xM,EM,"ϕ","\\phi",!0),mM(yM,xM,EM,"χ","\\chi",!0),mM(yM,xM,EM,"ψ","\\psi",!0),mM(yM,xM,EM,"ω","\\omega",!0),mM(yM,xM,EM,"ε","\\varepsilon",!0),mM(yM,xM,EM,"ϑ","\\vartheta",!0),mM(yM,xM,EM,"ϖ","\\varpi",!0),mM(yM,xM,EM,"ϱ","\\varrho",!0),mM(yM,xM,EM,"ς","\\varsigma",!0),mM(yM,xM,EM,"φ","\\varphi",!0),mM(yM,xM,kM,"∗","*",!0),mM(yM,xM,kM,"+","+"),mM(yM,xM,kM,"−","-",!0),mM(yM,xM,kM,"⋅","\\cdot",!0),mM(yM,xM,kM,"∘","\\circ",!0),mM(yM,xM,kM,"÷","\\div",!0),mM(yM,xM,kM,"±","\\pm",!0),mM(yM,xM,kM,"×","\\times",!0),mM(yM,xM,kM,"∩","\\cap",!0),mM(yM,xM,kM,"∪","\\cup",!0),mM(yM,xM,kM,"∖","\\setminus",!0),mM(yM,xM,kM,"∧","\\land"),mM(yM,xM,kM,"∨","\\lor"),mM(yM,xM,kM,"∧","\\wedge",!0),mM(yM,xM,kM,"∨","\\vee",!0),mM(yM,xM,IM,"√","\\surd"),mM(yM,xM,SM,"⟨","\\langle",!0),mM(yM,xM,SM,"∣","\\lvert"),mM(yM,xM,SM,"∥","\\lVert"),mM(yM,xM,TM,"?","?"),mM(yM,xM,TM,"!","!"),mM(yM,xM,TM,"⟩","\\rangle",!0),mM(yM,xM,TM,"∣","\\rvert"),mM(yM,xM,TM,"∥","\\rVert"),mM(yM,xM,LM,"=","="),mM(yM,xM,LM,":",":"),mM(yM,xM,LM,"≈","\\approx",!0),mM(yM,xM,LM,"≅","\\cong",!0),mM(yM,xM,LM,"≥","\\ge"),mM(yM,xM,LM,"≥","\\geq",!0),mM(yM,xM,LM,"←","\\gets"),mM(yM,xM,LM,">","\\gt",!0),mM(yM,xM,LM,"∈","\\in",!0),mM(yM,xM,LM,"","\\@not"),mM(yM,xM,LM,"⊂","\\subset",!0),mM(yM,xM,LM,"⊃","\\supset",!0),mM(yM,xM,LM,"⊆","\\subseteq",!0),mM(yM,xM,LM,"⊇","\\supseteq",!0),mM(yM,bM,LM,"⊈","\\nsubseteq",!0),mM(yM,bM,LM,"⊉","\\nsupseteq",!0),mM(yM,xM,LM,"⊨","\\models"),mM(yM,xM,LM,"←","\\leftarrow",!0),mM(yM,xM,LM,"≤","\\le"),mM(yM,xM,LM,"≤","\\leq",!0),mM(yM,xM,LM,"<","\\lt",!0),mM(yM,xM,LM,"→","\\rightarrow",!0),mM(yM,xM,LM,"→","\\to"),mM(yM,bM,LM,"≱","\\ngeq",!0),mM(yM,bM,LM,"≰","\\nleq",!0),mM(yM,xM,NM," ","\\ "),mM(yM,xM,NM," ","\\space"),mM(yM,xM,NM," ","\\nobreakspace"),mM(vM,xM,NM," ","\\ "),mM(vM,xM,NM," "," "),mM(vM,xM,NM," ","\\space"),mM(vM,xM,NM," ","\\nobreakspace"),mM(yM,xM,NM,null,"\\nobreak"),mM(yM,xM,NM,null,"\\allowbreak"),mM(yM,xM,AM,",",","),mM(yM,xM,AM,";",";"),mM(yM,bM,kM,"⊼","\\barwedge",!0),mM(yM,bM,kM,"⊻","\\veebar",!0),mM(yM,xM,kM,"⊙","\\odot",!0),mM(yM,xM,kM,"⊕","\\oplus",!0),mM(yM,xM,kM,"⊗","\\otimes",!0),mM(yM,xM,IM,"∂","\\partial",!0),mM(yM,xM,kM,"⊘","\\oslash",!0),mM(yM,bM,kM,"⊚","\\circledcirc",!0),mM(yM,bM,kM,"⊡","\\boxdot",!0),mM(yM,xM,kM,"△","\\bigtriangleup"),mM(yM,xM,kM,"▽","\\bigtriangledown"),mM(yM,xM,kM,"†","\\dagger"),mM(yM,xM,kM,"⋄","\\diamond"),mM(yM,xM,kM,"⋆","\\star"),mM(yM,xM,kM,"◃","\\triangleleft"),mM(yM,xM,kM,"▹","\\triangleright"),mM(yM,xM,SM,"{","\\{"),mM(vM,xM,IM,"{","\\{"),mM(vM,xM,IM,"{","\\textbraceleft"),mM(yM,xM,TM,"}","\\}"),mM(vM,xM,IM,"}","\\}"),mM(vM,xM,IM,"}","\\textbraceright"),mM(yM,xM,SM,"{","\\lbrace"),mM(yM,xM,TM,"}","\\rbrace"),mM(yM,xM,SM,"[","\\lbrack",!0),mM(vM,xM,IM,"[","\\lbrack",!0),mM(yM,xM,TM,"]","\\rbrack",!0),mM(vM,xM,IM,"]","\\rbrack",!0),mM(yM,xM,SM,"(","\\lparen",!0),mM(yM,xM,TM,")","\\rparen",!0),mM(vM,xM,IM,"<","\\textless",!0),mM(vM,xM,IM,">","\\textgreater",!0),mM(yM,xM,SM,"⌊","\\lfloor",!0),mM(yM,xM,TM,"⌋","\\rfloor",!0),mM(yM,xM,SM,"⌈","\\lceil",!0),mM(yM,xM,TM,"⌉","\\rceil",!0),mM(yM,xM,IM,"\\","\\backslash"),mM(yM,xM,IM,"∣","|"),mM(yM,xM,IM,"∣","\\vert"),mM(vM,xM,IM,"|","\\textbar",!0),mM(yM,xM,IM,"∥","\\|"),mM(yM,xM,IM,"∥","\\Vert"),mM(vM,xM,IM,"∥","\\textbardbl"),mM(vM,xM,IM,"~","\\textasciitilde"),mM(vM,xM,IM,"\\","\\textbackslash"),mM(vM,xM,IM,"^","\\textasciicircum"),mM(yM,xM,LM,"↑","\\uparrow",!0),mM(yM,xM,LM,"⇑","\\Uparrow",!0),mM(yM,xM,LM,"↓","\\downarrow",!0),mM(yM,xM,LM,"⇓","\\Downarrow",!0),mM(yM,xM,LM,"↕","\\updownarrow",!0),mM(yM,xM,LM,"⇕","\\Updownarrow",!0),mM(yM,xM,CM,"∐","\\coprod"),mM(yM,xM,CM,"⋁","\\bigvee"),mM(yM,xM,CM,"⋀","\\bigwedge"),mM(yM,xM,CM,"⨄","\\biguplus"),mM(yM,xM,CM,"⋂","\\bigcap"),mM(yM,xM,CM,"⋃","\\bigcup"),mM(yM,xM,CM,"∫","\\int"),mM(yM,xM,CM,"∫","\\intop"),mM(yM,xM,CM,"∬","\\iint"),mM(yM,xM,CM,"∭","\\iiint"),mM(yM,xM,CM,"∏","\\prod"),mM(yM,xM,CM,"∑","\\sum"),mM(yM,xM,CM,"⨂","\\bigotimes"),mM(yM,xM,CM,"⨁","\\bigoplus"),mM(yM,xM,CM,"⨀","\\bigodot"),mM(yM,xM,CM,"∮","\\oint"),mM(yM,xM,CM,"∯","\\oiint"),mM(yM,xM,CM,"∰","\\oiiint"),mM(yM,xM,CM,"⨆","\\bigsqcup"),mM(yM,xM,CM,"∫","\\smallint"),mM(vM,xM,_M,"…","\\textellipsis"),mM(yM,xM,_M,"…","\\mathellipsis"),mM(vM,xM,_M,"…","\\ldots",!0),mM(yM,xM,_M,"…","\\ldots",!0),mM(yM,xM,_M,"⋯","\\@cdots",!0),mM(yM,xM,_M,"⋱","\\ddots",!0),mM(yM,xM,IM,"⋮","\\varvdots"),mM(yM,xM,wM,"ˊ","\\acute"),mM(yM,xM,wM,"ˋ","\\grave"),mM(yM,xM,wM,"¨","\\ddot"),mM(yM,xM,wM,"~","\\tilde"),mM(yM,xM,wM,"ˉ","\\bar"),mM(yM,xM,wM,"˘","\\breve"),mM(yM,xM,wM,"ˇ","\\check"),mM(yM,xM,wM,"^","\\hat"),mM(yM,xM,wM,"⃗","\\vec"),mM(yM,xM,wM,"˙","\\dot"),mM(yM,xM,wM,"˚","\\mathring"),mM(yM,xM,EM,"","\\@imath"),mM(yM,xM,EM,"","\\@jmath"),mM(yM,xM,IM,"ı","ı"),mM(yM,xM,IM,"ȷ","ȷ"),mM(vM,xM,IM,"ı","\\i",!0),mM(vM,xM,IM,"ȷ","\\j",!0),mM(vM,xM,IM,"ß","\\ss",!0),mM(vM,xM,IM,"æ","\\ae",!0),mM(vM,xM,IM,"œ","\\oe",!0),mM(vM,xM,IM,"ø","\\o",!0),mM(vM,xM,IM,"Æ","\\AE",!0),mM(vM,xM,IM,"Œ","\\OE",!0),mM(vM,xM,IM,"Ø","\\O",!0),mM(vM,xM,wM,"ˊ","\\'"),mM(vM,xM,wM,"ˋ","\\`"),mM(vM,xM,wM,"ˆ","\\^"),mM(vM,xM,wM,"˜","\\~"),mM(vM,xM,wM,"ˉ","\\="),mM(vM,xM,wM,"˘","\\u"),mM(vM,xM,wM,"˙","\\."),mM(vM,xM,wM,"¸","\\c"),mM(vM,xM,wM,"˚","\\r"),mM(vM,xM,wM,"ˇ","\\v"),mM(vM,xM,wM,"¨",'\\"'),mM(vM,xM,wM,"˝","\\H"),mM(vM,xM,wM,"◯","\\textcircled");var RM={"--":!0,"---":!0,"``":!0,"''":!0};mM(vM,xM,IM,"–","--",!0),mM(vM,xM,IM,"–","\\textendash"),mM(vM,xM,IM,"—","---",!0),mM(vM,xM,IM,"—","\\textemdash"),mM(vM,xM,IM,"‘","`",!0),mM(vM,xM,IM,"‘","\\textquoteleft"),mM(vM,xM,IM,"’","'",!0),mM(vM,xM,IM,"’","\\textquoteright"),mM(vM,xM,IM,"“","``",!0),mM(vM,xM,IM,"“","\\textquotedblleft"),mM(vM,xM,IM,"”","''",!0),mM(vM,xM,IM,"”","\\textquotedblright"),mM(yM,xM,IM,"°","\\degree",!0),mM(vM,xM,IM,"°","\\degree"),mM(vM,xM,IM,"°","\\textdegree",!0),mM(yM,xM,IM,"£","\\pounds"),mM(yM,xM,IM,"£","\\mathsterling",!0),mM(vM,xM,IM,"£","\\pounds"),mM(vM,xM,IM,"£","\\textsterling",!0),mM(yM,bM,IM,"✠","\\maltese"),mM(vM,bM,IM,"✠","\\maltese");var MM,DM,OM='0123456789/@."';for(DM=0;DM0)return tD(i,l,n,e,a.concat(c));if(o){var h,u;if("boldsymbol"===o){var d=rD(i,n,e,a,r);h=d.fontName,u=[d.fontClass]}else s?(h=yD[o].fontName,u=[o]):(h=mD(o,e.fontWeight,e.fontShape),u=[o,e.fontWeight,e.fontShape]);if(JM(i,h,n).metrics)return tD(i,h,n,e,a.concat(u));if(RM.hasOwnProperty(i)&&"Typewriter"===h.slice(0,10)){for(var p=[],g=0;g{if(JR(t.classes)!==JR(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(1===t.classes.length){var r=t.classes[0];if("mbin"===r||"mord"===r)return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0}),"canCombine"),aD=o((t=>{for(var e=0;ee&&(e=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>n&&(n=a.maxFontSize)}t.height=e,t.depth=r,t.maxFontSize=n}),"sizeElementFromChildren"),oD=o((function(t,e,r,n){var i=new nM(t,e,r,n);return sD(i),i}),"makeSpan"),lD=o(((t,e,r,n)=>new nM(t,e,r,n)),"makeSvgSpan"),cD=o((function(t,e,r){var n=oD([t],[],e);return n.height=Math.max(r||e.fontMetrics().defaultRuleThickness,e.minRuleThickness),n.style.borderBottomWidth=QR(n.height),n.maxFontSize=1,n}),"makeLineSpan"),hD=o((function(t,e,r,n){var i=new iM(t,e,r,n);return sD(i),i}),"makeAnchor"),uD=o((function(t){var e=new PR(t);return sD(e),e}),"makeFragment"),dD=o((function(t,e){return t instanceof PR?oD([],[t],e):t}),"wrapFragment"),pD=o((function(t){if("individualShift"===t.positionType){for(var e=t.children,r=[e[0]],n=-e[0].shift-e[0].elem.depth,i=n,a=1;a{var r=oD(["mspace"],[],e),n=ZR(t,e);return r.style.marginRight=QR(n),r}),"makeGlue"),mD=o((function(t,e,r){var n="";switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return n+"-"+("textbf"===e&&"textit"===r?"BoldItalic":"textbf"===e?"Bold":"textit"===e?"Italic":"Regular")}),"retrieveTextFontName"),yD={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},vD={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},xD=o((function(t,e){var[r,n,i]=vD[t],a=new cM(r),s=new lM([a],{width:QR(n),height:QR(i),style:"width:"+QR(n),viewBox:"0 0 "+1e3*n+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),o=lD(["overlay"],[s],e);return o.height=i,o.style.height=QR(i),o.style.width=QR(n),o}),"staticSvg"),bD={fontMap:yD,makeSymbol:tD,mathsym:eD,makeSpan:oD,makeSvgSpan:lD,makeLineSpan:cD,makeAnchor:hD,makeFragment:uD,wrapFragment:dD,makeVList:gD,makeOrd:nD,makeGlue:fD,staticSvg:xD,svgData:vD,tryCombineChars:aD},wD={number:3,unit:"mu"},kD={number:4,unit:"mu"},TD={number:5,unit:"mu"},_D={mord:{mop:wD,mbin:kD,mrel:TD,minner:wD},mop:{mord:wD,mop:wD,mrel:TD,minner:wD},mbin:{mord:kD,mop:kD,mopen:kD,minner:kD},mrel:{mord:TD,mop:TD,mopen:TD,minner:TD},mopen:{},mclose:{mop:wD,mbin:kD,mrel:TD,minner:wD},mpunct:{mord:wD,mop:wD,mrel:TD,mopen:wD,mclose:wD,mpunct:wD,minner:wD},minner:{mord:wD,mop:wD,mbin:kD,mrel:TD,mopen:wD,mpunct:wD,minner:wD}},ED={mord:{mop:wD},mop:{mord:wD,mop:wD},mbin:{},mrel:{},mopen:{},mclose:{mop:wD},mpunct:{},minner:{mop:wD}},CD={},SD={},AD={};function LD(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var r=e.classes[0],n=t.classes[0];"mbin"===r&&oR.contains(OD,n)?e.classes[0]="mord":"mbin"===n&&oR.contains(DD,r)&&(t.classes[0]="mord")}),{node:h},u,d),FD(i,((t,e)=>{var r=GD(e),n=GD(t),i=r&&n?t.hasClass("mtight")?ED[r][n]:_D[r][n]:null;if(i)return bD.makeGlue(i,l)}),{node:h},u,d),i}),"buildExpression"),FD=o((function t(e,r,n,i,a){i&&e.push(i);for(var s=0;sr=>{e.splice(t+1,0,r),s++})(s)}}i&&e.pop()}),"traverseNonSpaceNodes"),zD=o((function(t){return t instanceof PR||t instanceof iM||t instanceof nM&&t.hasClass("enclosing")?t:null}),"checkPartialGroup"),UD=o((function t(e,r){var n=zD(e);if(n){var i=n.children;if(i.length){if("right"===r)return t(i[i.length-1],"right");if("left"===r)return t(i[0],"left")}}return e}),"getOutermostNode"),GD=o((function(t,e){return t?(e&&(t=UD(t,e)),BD[t.classes[0]]||null):null}),"getTypeOfDomTree"),qD=o((function(t,e){var r=["nulldelimiter"].concat(t.baseSizingClasses());return MD(e.concat(r))}),"makeNullDelimiter"),jD=o((function(t,e,r){if(!t)return MD();if(SD[t.type]){var n=SD[t.type](t,e);if(r&&e.size!==r.size){n=MD(e.sizingClasses(r),[n],e);var i=e.sizeMultiplier/r.sizeMultiplier;n.height*=i,n.depth*=i}return n}throw new KI("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function WD(t,e){var r=MD(["base"],t,e),n=MD(["strut"]);return n.style.height=QR(r.height+r.depth),r.depth&&(n.style.verticalAlign=QR(-r.depth)),r.children.unshift(n),r}function YD(t,e){var r=null;1===t.length&&"tag"===t[0].type&&(r=t[0].tag,t=t[0].body);var n,i=$D(t,e,"root");2===i.length&&i[1].hasClass("tag")&&(n=i.pop());for(var a,s=[],o=[],l=0;l0&&(s.push(WD(o,e)),o=[]),s.push(i[l]));o.length>0&&s.push(WD(o,e)),r?((a=WD($D(r,e,!0))).classes=["tag"],s.push(a)):n&&s.push(n);var h=MD(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),a){var u=a.children[0];u.style.height=QR(h.height+h.depth),h.depth&&(u.style.verticalAlign=QR(-h.depth))}return h}function HD(t){return new PR(t)}o(WD,"buildHTMLUnbreakable"),o(YD,"buildHTML"),o(HD,"newDocumentFragment");var VD=class{static{o(this,"MathNode")}constructor(t,e,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=e||[],this.classes=r||[]}setAttribute(t,e){this.attributes[t]=e}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);this.classes.length>0&&(t.className=JR(this.classes));for(var r=0;r0&&(t+=' class ="'+oR.escape(JR(this.classes))+'"'),t+=">";for(var r=0;r"}toText(){return this.children.map((t=>t.toText())).join("")}},XD=class{static{o(this,"TextNode")}constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return oR.escape(this.toText())}toText(){return this.text}},KD=class{static{o(this,"SpaceNode")}constructor(t){this.width=void 0,this.character=void 0,this.width=t,this.character=t>=.05555&&t<=.05556?" ":t>=.1666&&t<=.1667?" ":t>=.2222&&t<=.2223?" ":t>=.2777&&t<=.2778?"  ":t>=-.05556&&t<=-.05555?" ⁣":t>=-.1667&&t<=-.1666?" ⁣":t>=-.2223&&t<=-.2222?" ⁣":t>=-.2778&&t<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",QR(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},ZD={MathNode:VD,TextNode:XD,SpaceNode:KD,newDocumentFragment:HD},QD=o((function(t,e,r){return!fM[e][t]||!fM[e][t].replace||55349===t.charCodeAt(0)||RM.hasOwnProperty(t)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(t=fM[e][t].replace),new ZD.TextNode(t)}),"makeText"),JD=o((function(t){return 1===t.length?t[0]:new ZD.MathNode("mrow",t)}),"makeRow"),tO=o((function(t,e){if("texttt"===e.fontFamily)return"monospace";if("textsf"===e.fontFamily)return"textit"===e.fontShape&&"textbf"===e.fontWeight?"sans-serif-bold-italic":"textit"===e.fontShape?"sans-serif-italic":"textbf"===e.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===e.fontShape&&"textbf"===e.fontWeight)return"bold-italic";if("textit"===e.fontShape)return"italic";if("textbf"===e.fontWeight)return"bold";var r=e.font;if(!r||"mathnormal"===r)return null;var n=t.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===t.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";var i=t.text;return oR.contains(["\\imath","\\jmath"],i)?null:(fM[n][i]&&fM[n][i].replace&&(i=fM[n][i].replace),UR(i,bD.fontMap[r].fontName,n)?bD.fontMap[r].variant:null)}),"getVariant"),eO=o((function(t,e,r){if(1===t.length){var n=nO(t[0],e);return r&&n instanceof VD&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var i,a=[],s=0;s0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(o),i=o}return a}),"buildExpression"),rO=o((function(t,e,r){return JD(eO(t,e,r))}),"buildExpressionRow"),nO=o((function(t,e){if(!t)return new ZD.MathNode("mrow");if(AD[t.type])return AD[t.type](t,e);throw new KI("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function iO(t,e,r,n,i){var a,s=eO(t,r);a=1===s.length&&s[0]instanceof VD&&oR.contains(["mrow","mtable"],s[0].type)?s[0]:new ZD.MathNode("mrow",s);var o=new ZD.MathNode("annotation",[new ZD.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new ZD.MathNode("semantics",[a,o]),c=new ZD.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return bD.makeSpan([h],[c])}o(iO,"buildMathML");var aO=o((function(t){return new HR({style:t.displayMode?xR.DISPLAY:xR.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})}),"optionsFromSettings"),sO=o((function(t,e){if(e.displayMode){var r=["katex-display"];e.leqno&&r.push("leqno"),e.fleqn&&r.push("fleqn"),t=bD.makeSpan(r,[t])}return t}),"displayWrap"),oO=o((function(t,e,r){var n,i=aO(r);if("mathml"===r.output)return iO(t,e,i,r.displayMode,!0);if("html"===r.output){var a=YD(t,i);n=bD.makeSpan(["katex"],[a])}else{var s=iO(t,e,i,r.displayMode,!1),o=YD(t,i);n=bD.makeSpan(["katex"],[s,o])}return sO(n,r)}),"buildTree"),lO=o((function(t,e,r){var n=YD(t,aO(r)),i=bD.makeSpan(["katex"],[n]);return sO(i,r)}),"buildHTMLTree"),cO={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},hO=o((function(t){var e=new ZD.MathNode("mo",[new ZD.TextNode(cO[t.replace(/^\\/,"")])]);return e.setAttribute("stretchy","true"),e}),"mathMLnode"),uO={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},dO=o((function(t){return"ordgroup"===t.type?t.body.length:1}),"groupLength"),pO=o((function(t,e){function r(){var r=4e5,n=t.label.slice(1);if(oR.contains(["widehat","widecheck","widetilde","utilde"],n)){var i,a,s,o=dO(t.base);if(o>5)"widehat"===n||"widecheck"===n?(i=420,r=2364,s=.42,a=n+"4"):(i=312,r=2340,s=.34,a="tilde4");else{var l=[1,1,2,2,3,3][o];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],a=n+l):(r=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],s=[0,.26,.286,.3,.306,.34][l],a="tilde"+l)}var c=new cM(a),h=new lM([c],{width:"100%",height:QR(s),viewBox:"0 0 "+r+" "+i,preserveAspectRatio:"none"});return{span:bD.makeSvgSpan([],[h],e),minWidth:0,height:s}}var u,d,p=[],g=uO[n],[f,m,y]=g,v=y/1e3,x=f.length;if(1===x)u=["hide-tail"],d=[g[3]];else if(2===x)u=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");u=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}for(var b=0;b0&&(n.style.minWidth=QR(i)),n}),"svgSpan"),gO=o((function(t,e,r,n,i){var a,s=t.height+t.depth+r+n;if(/fbox|color|angl/.test(e)){if(a=bD.makeSpan(["stretchy",e],[],i),"fbox"===e){var o=i.color&&i.getColor();o&&(a.style.borderColor=o)}}else{var l=[];/^[bx]cancel$/.test(e)&&l.push(new hM({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&l.push(new hM({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new lM(l,{width:"100%",height:QR(s)});a=bD.makeSvgSpan([],[c],i)}return a.height=s,a.style.height=QR(s),a}),"encloseSpan"),fO={encloseSpan:gO,mathMLnode:hO,svgSpan:pO};function mO(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function yO(t){var e=vO(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function vO(t){return t&&("atom"===t.type||gM.hasOwnProperty(t.type))?t:null}o(mO,"assertNodeType"),o(yO,"assertSymbolNodeType"),o(vO,"checkSymbolNodeType");var xO=o(((t,e)=>{var r,n,i;t&&"supsub"===t.type?(r=(n=mO(t.base,"accent")).base,t.base=r,i=dM(jD(t,e)),t.base=n):r=(n=mO(t,"accent")).base;var a=jD(r,e.havingCrampedStyle()),s=0;if(n.isShifty&&oR.isCharacterBox(r)){var o=oR.getBaseElem(r);s=uM(jD(o,e.havingCrampedStyle())).skew}var l,c="\\c"===n.label,h=c?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight);if(n.isStretchy)l=fO.svgSpan(n,e),l=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+QR(2*s)+")",marginLeft:QR(2*s)}:void 0}]},e);else{var u,d;"\\vec"===n.label?(u=bD.staticSvg("vec",e),d=bD.svgData.vec[1]):((u=uM(u=bD.makeOrd({mode:n.mode,text:n.label},e,"textord"))).italic=0,d=u.width,c&&(h+=u.depth)),l=bD.makeSpan(["accent-body"],[u]);var p="\\textcircled"===n.label;p&&(l.classes.push("accent-full"),h=a.height);var g=s;p||(g-=d/2),l.style.left=QR(g),"\\textcircled"===n.label&&(l.style.top=".2em"),l=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:l}]},e)}var f=bD.makeSpan(["mord","accent"],[l],e);return i?(i.children[0]=f,i.height=Math.max(f.height,i.height),i.classes[0]="mord",i):f}),"htmlBuilder$a"),bO=o(((t,e)=>{var r=t.isStretchy?fO.mathMLnode(t.label):new ZD.MathNode("mo",[QD(t.label,t.mode)]),n=new ZD.MathNode("mover",[nO(t.base,e),r]);return n.setAttribute("accent","true"),n}),"mathmlBuilder$9"),wO=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((t=>"\\"+t)).join("|"));LD({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:o(((t,e)=>{var r=ID(e[0]),n=!wO.test(t.funcName),i=!n||"\\widehat"===t.funcName||"\\widetilde"===t.funcName||"\\widecheck"===t.funcName;return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}}),"handler"),htmlBuilder:xO,mathmlBuilder:bO}),LD({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:o(((t,e)=>{var r=e[0],n=t.parser.mode;return"math"===n&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}}),"handler"),htmlBuilder:xO,mathmlBuilder:bO}),LD({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}}),"handler"),htmlBuilder:o(((t,e)=>{var r=jD(t.base,e),n=fO.svgSpan(t,e),i="\\utilde"===t.label?.12:0,a=bD.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return bD.makeSpan(["mord","accentunder"],[a],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=fO.mathMLnode(t.label),n=new ZD.MathNode("munder",[nO(t.base,e),r]);return n.setAttribute("accentunder","true"),n}),"mathmlBuilder")});var kO=o((t=>{var e=new ZD.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e}),"paddedNode");LD({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r,n=e.style,i=e.havingStyle(n.sup()),a=bD.wrapFragment(jD(t.body,i,e),e),s="\\x"===t.label.slice(0,2)?"x":"cd";a.classes.push(s+"-arrow-pad"),t.below&&(i=e.havingStyle(n.sub()),(r=bD.wrapFragment(jD(t.below,i,e),e)).classes.push(s+"-arrow-pad"));var o,l=fO.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,h=-e.fontMetrics().axisHeight-.5*l.height-.111;if((a.depth>.25||"\\xleftequilibrium"===t.label)&&(h-=a.depth),r){var u=-e.fontMetrics().axisHeight+r.height+.5*l.height+.111;o=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c},{type:"elem",elem:r,shift:u}]},e)}else o=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c}]},e);return o.children[0].children[0].children[1].classes.push("svg-align"),bD.makeSpan(["mrel","x-arrow"],[o],e)},mathmlBuilder(t,e){var r,n=fO.mathMLnode(t.label);if(n.setAttribute("minsize","x"===t.label.charAt(0)?"1.75em":"3.0em"),t.body){var i=kO(nO(t.body,e));if(t.below){var a=kO(nO(t.below,e));r=new ZD.MathNode("munderover",[n,a,i])}else r=new ZD.MathNode("mover",[n,i])}else if(t.below){var s=kO(nO(t.below,e));r=new ZD.MathNode("munder",[n,s])}else r=kO(),r=new ZD.MathNode("mover",[n,r]);return r}});var TO=bD.makeSpan;function _O(t,e){var r=$D(t.body,e,!0);return TO([t.mclass],r,e)}function EO(t,e){var r,n=eO(t.body,e);return"minner"===t.mclass?r=new ZD.MathNode("mpadded",n):"mord"===t.mclass?t.isCharacterBox?(r=n[0]).type="mi":r=new ZD.MathNode("mi",n):(t.isCharacterBox?(r=n[0]).type="mo":r=new ZD.MathNode("mo",n),"mbin"===t.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===t.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===t.mclass||"mclose"===t.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===t.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}o(_O,"htmlBuilder$9"),o(EO,"mathmlBuilder$8"),LD({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:RD(i),isCharacterBox:oR.isCharacterBox(i)}},htmlBuilder:_O,mathmlBuilder:EO});var CO=o((t=>{var e="ordgroup"===t.type&&t.body.length?t.body[0]:t;return"atom"!==e.type||"bin"!==e.family&&"rel"!==e.family?"mord":"m"+e.family}),"binrelClass");LD({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:CO(e[0]),body:RD(e[1]),isCharacterBox:oR.isCharacterBox(e[1])}}}),LD({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var r,{parser:n,funcName:i}=t,a=e[1],s=e[0];r="\\stackrel"!==i?CO(a):"mrel";var o={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:RD(a)},l={type:"supsub",mode:s.mode,base:o,sup:"\\underset"===i?null:s,sub:"\\underset"===i?s:null};return{type:"mclass",mode:n.mode,mclass:r,body:[l],isCharacterBox:oR.isCharacterBox(l)}},htmlBuilder:_O,mathmlBuilder:EO}),LD({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:CO(e[0]),body:RD(e[0])}},htmlBuilder(t,e){var r=$D(t.body,e,!0),n=bD.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=eO(t.body,e),n=new ZD.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var SO={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},AO=o((()=>({type:"styling",body:[],mode:"math",style:"display"})),"newCell"),LO=o((t=>"textord"===t.type&&"@"===t.text),"isStartOfArrow"),NO=o(((t,e)=>("mathord"===t.type||"atom"===t.type)&&t.text===e),"isLabelEnd");function IO(t,e,r){var n=SO[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:n,mode:"math",family:"rel"},a={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[e[0]],[]),r.callFunction("\\Big",[i],[]),r.callFunction("\\\\cdright",[e[1]],[])]};return r.callFunction("\\\\cdparent",[a],[]);case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return r.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}function RO(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===e[e.length-1].length&&e.pop();break}throw new KI("Expected \\\\ or \\cr or \\end",t.nextToken)}t.consume()}for(var n=[],i=[n],a=0;a-1);else{if(!("<>AV".indexOf(c)>-1))throw new KI('Expected one of "<>AV=|." after @',s[l]);for(var u=0;u<2;u++){for(var d=!0,p=l+1;pnew ZD.MathNode("mrow",[nO(t.fragment,e)])}),LD({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=mO(e[0],"ordgroup").body,i="",a=0;a=1114111)throw new KI("\\@char with invalid code point "+i);return o<=65535?s=String.fromCharCode(o):(o-=65536,s=String.fromCharCode(55296+(o>>10),56320+(1023&o))),{type:"textord",mode:r.mode,text:s}}});var MO=o(((t,e)=>{var r=$D(t.body,e.withColor(t.color),!1);return bD.makeFragment(r)}),"htmlBuilder$8"),DO=o(((t,e)=>{var r=eO(t.body,e.withColor(t.color)),n=new ZD.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n}),"mathmlBuilder$7");LD({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=mO(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:RD(i)}},htmlBuilder:MO,mathmlBuilder:DO}),LD({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=mO(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:MO,mathmlBuilder:DO}),LD({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i="["===n.gullet.future().text?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&mO(i,"size").value}},htmlBuilder(t,e){var r=bD.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=QR(ZR(t.size,e)))),r},mathmlBuilder(t,e){var r=new ZD.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",QR(ZR(t.size,e)))),r}});var OO={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},PO=o((t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new KI("Expected a control sequence",t);return e}),"checkControlSequence"),BO=o((t=>{var e=t.gullet.popToken();return"="===e.text&&" "===(e=t.gullet.popToken()).text&&(e=t.gullet.popToken()),e}),"getRHS"),$O=o(((t,e,r,n)=>{var i=t.gullet.macros.get(r.text);null==i&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)}),"letCommand");LD({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(OO[n.text])return"\\global"!==r&&"\\\\globallong"!==r||(n.text=OO[n.text]),mO(e.parseFunction(),"internal");throw new KI("Invalid token after macro prefix",n)}}),LD({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new KI("Expected a control sequence",n);for(var a,s=0,o=[[]];"{"!==e.gullet.future().text;)if("#"===(n=e.gullet.popToken()).text){if("{"===e.gullet.future().text){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new KI('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new KI('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if("EOF"===n.text)throw new KI("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),"\\edef"!==r&&"\\xdef"!==r||(l=e.gullet.expandTokens(l)).reverse(),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===OO[r]),{type:"internal",mode:e.mode}}}),LD({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=PO(e.gullet.popToken());e.gullet.consumeSpaces();var i=BO(e);return $O(e,n,i,"\\\\globallet"===r),{type:"internal",mode:e.mode}}}),LD({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=PO(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return $O(e,n,a,"\\\\globalfuture"===r),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var FO=o((function(t,e,r){var n=UR(fM.math[t]&&fM.math[t].replace||t,e,r);if(!n)throw new Error("Unsupported symbol "+t+" and font size "+e+".");return n}),"getMetrics"),zO=o((function(t,e,r,n){var i=r.havingBaseStyle(e),a=bD.makeSpan(n.concat(i.sizingClasses(r)),[t],r),s=i.sizeMultiplier/r.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=i.sizeMultiplier,a}),"styleWrap"),UO=o((function(t,e,r){var n=e.havingBaseStyle(r),i=(1-e.sizeMultiplier/n.sizeMultiplier)*e.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=QR(i),t.height-=i,t.depth+=i}),"centerSpan"),GO=o((function(t,e,r,n,i,a){var s=bD.makeSymbol(t,"Main-Regular",i,n),o=zO(s,e,n,a);return r&&UO(o,n,e),o}),"makeSmallDelim"),qO=o((function(t,e,r,n){return bD.makeSymbol(t,"Size"+e+"-Regular",r,n)}),"mathrmSize"),jO=o((function(t,e,r,n,i,a){var s=qO(t,e,i,n),o=zO(bD.makeSpan(["delimsizing","size"+e],[s],n),xR.TEXT,n,a);return r&&UO(o,n,xR.TEXT),o}),"makeLargeDelim"),WO=o((function(t,e,r){var n;return n="Size1-Regular"===e?"delim-size1":"delim-size4",{type:"elem",elem:bD.makeSpan(["delimsizinginner",n],[bD.makeSpan([],[bD.makeSymbol(t,e,r)])])}}),"makeGlyphSpan"),YO=o((function(t,e,r){var n=BR["Size4-Regular"][t.charCodeAt(0)]?BR["Size4-Regular"][t.charCodeAt(0)][4]:BR["Size1-Regular"][t.charCodeAt(0)][4],i=new cM("inner",MR(t,Math.round(1e3*e))),a=new lM([i],{width:QR(n),height:QR(e),style:"width:"+QR(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*e),preserveAspectRatio:"xMinYMin"}),s=bD.makeSvgSpan([],[a],r);return s.height=e,s.style.height=QR(e),s.style.width=QR(n),{type:"elem",elem:s}}),"makeInner"),HO={type:"kern",size:-.008},VO=["|","\\lvert","\\rvert","\\vert"],XO=["\\|","\\lVert","\\rVert","\\Vert"],KO=o((function(t,e,r,n,i,a){var s,o,l,c,h="",u=0;s=l=c=t,o=null;var d="Size1-Regular";"\\uparrow"===t?l=c="⏐":"\\Uparrow"===t?l=c="‖":"\\downarrow"===t?s=l="⏐":"\\Downarrow"===t?s=l="‖":"\\updownarrow"===t?(s="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===t?(s="\\Uparrow",l="‖",c="\\Downarrow"):oR.contains(VO,t)?(l="∣",h="vert",u=333):oR.contains(XO,t)?(l="∥",h="doublevert",u=556):"["===t||"\\lbrack"===t?(s="⎡",l="⎢",c="⎣",d="Size4-Regular",h="lbrack",u=667):"]"===t||"\\rbrack"===t?(s="⎤",l="⎥",c="⎦",d="Size4-Regular",h="rbrack",u=667):"\\lfloor"===t||"⌊"===t?(l=s="⎢",c="⎣",d="Size4-Regular",h="lfloor",u=667):"\\lceil"===t||"⌈"===t?(s="⎡",l=c="⎢",d="Size4-Regular",h="lceil",u=667):"\\rfloor"===t||"⌋"===t?(l=s="⎥",c="⎦",d="Size4-Regular",h="rfloor",u=667):"\\rceil"===t||"⌉"===t?(s="⎤",l=c="⎥",d="Size4-Regular",h="rceil",u=667):"("===t||"\\lparen"===t?(s="⎛",l="⎜",c="⎝",d="Size4-Regular",h="lparen",u=875):")"===t||"\\rparen"===t?(s="⎞",l="⎟",c="⎠",d="Size4-Regular",h="rparen",u=875):"\\{"===t||"\\lbrace"===t?(s="⎧",o="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(s="⎫",o="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===t||"⟮"===t?(s="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===t||"⟯"===t?(s="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===t||"⎰"===t?(s="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==t&&"⎱"!==t||(s="⎫",c="⎩",l="⎪",d="Size4-Regular");var p=FO(s,d,i),g=p.height+p.depth,f=FO(l,d,i),m=f.height+f.depth,y=FO(c,d,i),v=y.height+y.depth,x=0,b=1;if(null!==o){var w=FO(o,d,i);x=w.height+w.depth,b=2}var k=g+v+x,T=k+Math.max(0,Math.ceil((e-k)/(b*m)))*b*m,_=n.fontMetrics().axisHeight;r&&(_*=n.sizeMultiplier);var E=T/2-_,C=[];if(h.length>0){var S=T-g-v,A=Math.round(1e3*T),L=OR(h,Math.round(1e3*S)),N=new cM(h,L),I=(u/1e3).toFixed(3)+"em",R=(A/1e3).toFixed(3)+"em",M=new lM([N],{width:I,height:R,viewBox:"0 0 "+u+" "+A}),D=bD.makeSvgSpan([],[M],n);D.height=A/1e3,D.style.width=I,D.style.height=R,C.push({type:"elem",elem:D})}else{if(C.push(WO(c,d,i)),C.push(HO),null===o){var O=T-g-v+.016;C.push(YO(l,O,n))}else{var P=(T-g-v-x)/2+.016;C.push(YO(l,P,n)),C.push(HO),C.push(WO(o,d,i)),C.push(HO),C.push(YO(l,P,n))}C.push(HO),C.push(WO(s,d,i))}var B=n.havingBaseStyle(xR.TEXT),$=bD.makeVList({positionType:"bottom",positionData:E,children:C},B);return zO(bD.makeSpan(["delimsizing","mult"],[$],B),xR.TEXT,n,a)}),"makeStackedDelim"),ZO=.08,QO=o((function(t,e,r,n,i){var a=RR(t,n,r),s=new cM(t,a),o=new lM([s],{width:"400em",height:QR(e),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return bD.makeSvgSpan(["hide-tail"],[o],i)}),"sqrtSvg"),JO=o((function(t,e){var r,n,i=e.havingBaseSizing(),a=cP("\\surd",t*i.sizeMultiplier,oP,i),s=i.sizeMultiplier,o=Math.max(0,e.minRuleThickness-e.fontMetrics().sqrtRuleThickness),l=0,c=0,h=0;return"small"===a.type?(t<1?s=1:t<1.4&&(s=.7),c=(1+o)/s,(r=QO("sqrtMain",l=(1+o+ZO)/s,h=1e3+1e3*o+80,o,e)).style.minWidth="0.853em",n=.833/s):"large"===a.type?(h=1080*nP[a.size],c=(nP[a.size]+o)/s,l=(nP[a.size]+o+ZO)/s,(r=QO("sqrtSize"+a.size,l,h,o,e)).style.minWidth="1.02em",n=1/s):(l=t+o+ZO,c=t+o,h=Math.floor(1e3*t+o)+80,(r=QO("sqrtTall",l,h,o,e)).style.minWidth="0.742em",n=1.056),r.height=c,r.style.height=QR(l),{span:r,advanceWidth:n,ruleWidth:(e.fontMetrics().sqrtRuleThickness+o)*s}}),"makeSqrtImage"),tP=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],eP=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],rP=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],nP=[0,1.2,1.8,2.4,3],iP=o((function(t,e,r,n,i){if("<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),oR.contains(tP,t)||oR.contains(rP,t))return jO(t,e,!1,r,n,i);if(oR.contains(eP,t))return KO(t,nP[e],!1,r,n,i);throw new KI("Illegal delimiter: '"+t+"'")}),"makeSizedDelim"),aP=[{type:"small",style:xR.SCRIPTSCRIPT},{type:"small",style:xR.SCRIPT},{type:"small",style:xR.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],sP=[{type:"small",style:xR.SCRIPTSCRIPT},{type:"small",style:xR.SCRIPT},{type:"small",style:xR.TEXT},{type:"stack"}],oP=[{type:"small",style:xR.SCRIPTSCRIPT},{type:"small",style:xR.SCRIPT},{type:"small",style:xR.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],lP=o((function(t){if("small"===t.type)return"Main-Regular";if("large"===t.type)return"Size"+t.size+"-Regular";if("stack"===t.type)return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")}),"delimTypeToFont"),cP=o((function(t,e,r,n){for(var i=Math.min(2,3-n.style.size);ie)return r[i]}return r[r.length-1]}),"traverseSequence"),hP=o((function(t,e,r,n,i,a){var s;"<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),s=oR.contains(rP,t)?aP:oR.contains(tP,t)?oP:sP;var o=cP(t,e,s,n);return"small"===o.type?GO(t,o.style,r,n,i,a):"large"===o.type?jO(t,o.size,r,n,i,a):KO(t,e,r,n,i,a)}),"makeCustomSizedDelim"),uP=o((function(t,e,r,n,i,a){var s=n.fontMetrics().axisHeight*n.sizeMultiplier,o=5/n.fontMetrics().ptPerEm,l=Math.max(e-s,r+s),c=Math.max(l/500*901,2*l-o);return hP(t,c,!0,n,i,a)}),"makeLeftRightDelim"),dP={sqrtImage:JO,sizedDelim:iP,sizeToMaxHeight:nP,customSizedDelim:hP,leftRightDelim:uP},pP={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},gP=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function fP(t,e){var r=vO(t);if(r&&oR.contains(gP,r.text))return r;throw new KI(r?"Invalid delimiter '"+r.text+"' after '"+e.funcName+"'":"Invalid delimiter type '"+t.type+"'",t)}function mP(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}o(fP,"checkDelimiter"),LD({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:o(((t,e)=>{var r=fP(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:pP[t.funcName].size,mclass:pP[t.funcName].mclass,delim:r.text}}),"handler"),htmlBuilder:o(((t,e)=>"."===t.delim?bD.makeSpan([t.mclass]):dP.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass])),"htmlBuilder"),mathmlBuilder:o((t=>{var e=[];"."!==t.delim&&e.push(QD(t.delim,t.mode));var r=new ZD.MathNode("mo",e);"mopen"===t.mclass||"mclose"===t.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=QR(dP.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}),"mathmlBuilder")}),o(mP,"assertParsed"),LD({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new KI("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:fP(e[0],t).text,color:r}}),"handler")}),LD({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var r=fP(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=mO(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}}),"handler"),htmlBuilder:o(((t,e)=>{mP(t);for(var r,n,i=$D(t.body,e,!0,["mopen","mclose"]),a=0,s=0,o=!1,l=0;l{mP(t);var r=eO(t.body,e);if("."!==t.left){var n=new ZD.MathNode("mo",[QD(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if("."!==t.right){var i=new ZD.MathNode("mo",[QD(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return JD(r)}),"mathmlBuilder")}),LD({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var r=fP(e[0],t);if(!t.parser.leftrightDepth)throw new KI("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}}),"handler"),htmlBuilder:o(((t,e)=>{var r;if("."===t.delim)r=qD(e,[]);else{r=dP.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r="\\vert"===t.delim||"|"===t.delim?QD("|","text"):QD(t.delim,t.mode),n=new ZD.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}),"mathmlBuilder")});var yP=o(((t,e)=>{var r,n,i=bD.wrapFragment(jD(t.body,e),e),a=t.label.slice(1),s=e.sizeMultiplier,o=0,l=oR.isCharacterBox(t.body);if("sout"===a)(r=bD.makeSpan(["stretchy","sout"])).height=e.fontMetrics().defaultRuleThickness/s,o=-.5*e.fontMetrics().xHeight;else if("phase"===a){var c=ZR({number:.6,unit:"pt"},e),h=ZR({number:.35,unit:"ex"},e);s/=e.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+h;i.style.paddingLeft=QR(u/2+c);var d=Math.floor(1e3*u*s),p=NR(d),g=new lM([new cM("phase",p)],{width:"400em",height:QR(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(r=bD.makeSvgSpan(["hide-tail"],[g],e)).style.height=QR(u),o=i.depth+c+h}else{/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var f=0,m=0,y=0;/box/.test(a)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=f=e.fontMetrics().fboxsep+("colorbox"===a?0:y)):"angl"===a?(f=4*(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness)),m=Math.max(0,.25-i.depth)):m=f=l?.2:0,r=fO.encloseSpan(i,a,f,m,e),/fbox|boxed|fcolorbox/.test(a)?(r.style.borderStyle="solid",r.style.borderWidth=QR(y)):"angl"===a&&.049!==y&&(r.style.borderTopWidth=QR(y),r.style.borderRightWidth=QR(y)),o=i.depth+m,t.backgroundColor&&(r.style.backgroundColor=t.backgroundColor,t.borderColor&&(r.style.borderColor=t.borderColor))}if(t.backgroundColor)n=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:o},{type:"elem",elem:i,shift:0}]},e);else{var v=/cancel|phase/.test(a)?["svg-align"]:[];n=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:r,shift:o,wrapperClasses:v}]},e)}return/cancel/.test(a)&&(n.height=i.height,n.depth=i.depth),/cancel/.test(a)&&!l?bD.makeSpan(["mord","cancel-lap"],[n],e):bD.makeSpan(["mord"],[n],e)}),"htmlBuilder$7"),vP=o(((t,e)=>{var r=0,n=new ZD.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[nO(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===t.label){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n}),"mathmlBuilder$6");LD({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=mO(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:yP,mathmlBuilder:vP}),LD({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=mO(e[0],"color-token").color,s=mO(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:yP,mathmlBuilder:vP}),LD({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),LD({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:yP,mathmlBuilder:vP}),LD({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var xP={};function bP(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{if(!t.parser.settings.displayMode)throw new KI("{"+t.envName+"} can be used only in display mode.")}),"validateAmsEnvironmentContext");function EP(t){if(-1===t.indexOf("ed"))return-1===t.indexOf("*")}function CP(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:l,autoTag:c,singleRow:h,emptySingleRow:u,maxNumCols:d,leqno:p}=e;if(t.gullet.beginGroup(),h||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var g=t.gullet.expandMacroAsText("\\arraystretch");if(null==g)s=1;else if(!(s=parseFloat(g))||s<0)throw new KI("Invalid \\arraystretch: "+g)}t.gullet.beginGroup();var f=[],m=[f],y=[],v=[],x=null!=c?[]:void 0;function b(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new XI("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(Boolean(c)&&"1"===t.gullet.macros.get("\\@eqnsw")))}for(o(b,"beginRow"),o(w,"endRow"),b(),v.push(TP(t));;){var k=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},r&&(k={type:"styling",mode:t.mode,style:r,body:[k]}),f.push(k);var T=t.fetch().text;if("&"===T){if(d&&f.length===d){if(h||l)throw new KI("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else{if("\\end"===T){w(),1===f.length&&"styling"===k.type&&0===k.body[0].body.length&&(m.length>1||!u)&&m.pop(),v.length0&&(v+=.25),c.push({pos:v,isDashed:t[e]})}for(o(x,"setHLinePos"),x(a[0]),r=0;r0&&(k<(C+=y)&&(k=C),C=0),t.addJot&&(k+=g),T.height=w,T.depth=k,v+=w,T.pos=v,v+=k+C,l[r]=T,x(a[r+1])}var S,A,L=v/2+e.fontMetrics().axisHeight,N=t.cols||[],I=[],R=[];if(t.tags&&t.tags.some((t=>t)))for(r=0;r=s)){var G=void 0;(n>0||t.hskipBeforeAndAfter)&&0!==(G=oR.deflt(B.pregap,d))&&((S=bD.makeSpan(["arraycolsep"],[])).style.width=QR(G),I.push(S));var q=[];for(r=0;r0){for(var H=bD.makeLineSpan("hline",e,h),V=bD.makeLineSpan("hdashline",e,h),X=[{type:"elem",elem:l,shift:0}];c.length>0;){var K=c.pop(),Z=K.pos-L;K.isDashed?X.push({type:"elem",elem:V,shift:Z}):X.push({type:"elem",elem:H,shift:Z})}l=bD.makeVList({positionType:"individualShift",children:X},e)}if(0===R.length)return bD.makeSpan(["mord"],[l],e);var Q=bD.makeVList({positionType:"individualShift",children:R},e);return Q=bD.makeSpan(["tag"],[Q],e),bD.makeFragment([l,Q])}),"htmlBuilder"),LP={c:"center ",l:"left ",r:"right "},NP=o((function(t,e){for(var r=[],n=new ZD.MathNode("mtd",[],["mtr-glue"]),i=new ZD.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var p=t.cols,g="",f=!1,m=0,y=p.length;"separator"===p[0].type&&(u+="top ",m=1),"separator"===p[p.length-1].type&&(u+="bottom ",y-=1);for(var v=m;v0?"left ":"",u+=T[T.length-1].length>0?"right ":"";for(var _=1;_-1?"alignat":"align",a="split"===t.envName,s=CP(t.parser,{cols:n,addJot:!0,autoTag:a?void 0:EP(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),o=0,l={type:"ordgroup",mode:t.mode,body:[]};if(e[0]&&"ordgroup"===e[0].type){for(var c="",h=0;h0&&u&&(g=1),n[d]={type:"align",align:p,pregap:g,postgap:0}}return s.colSeparationType=u?"align":"alignat",s}),"alignedHandler");bP({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=(vO(e[0])?[e[0]]:mO(e[0],"ordgroup").body).map((function(t){var e=yO(t).text;if(-1!=="lcr".indexOf(e))return{type:"align",align:e};if("|"===e)return{type:"separator",separator:"|"};if(":"===e)return{type:"separator",separator:":"};throw new KI("Unknown column alignment: "+e,t)})),n={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return CP(t.parser,n,SP(t.envName))},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===t.envName.charAt(t.envName.length-1)){var i=t.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,-1==="lcr".indexOf(r))throw new KI("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=CP(t.parser,n,SP(t.envName)),s=Math.max(0,...a.body.map((t=>t.length)));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e=CP(t.parser,{arraystretch:.5},"script");return e.colSeparationType="small",e},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=(vO(e[0])?[e[0]]:mO(e[0],"ordgroup").body).map((function(t){var e=yO(t).text;if(-1!=="lc".indexOf(e))return{type:"align",align:e};throw new KI("Unknown column alignment: "+e,t)}));if(r.length>1)throw new KI("{subarray} can contain only one column");var n={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if((n=CP(t.parser,n,"script")).body.length>0&&n.body[0].length>1)throw new KI("{subarray} can contain only one column");return n},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e=CP(t.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},SP(t.envName));return{type:"leftright",mode:t.mode,body:[e],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:IP,htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){oR.contains(["gather","gather*"],t.envName)&&_P(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:EP(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return CP(t.parser,e,"display")},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:IP,htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){_P(t);var e={autoTag:EP(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return CP(t.parser,e,"display")},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["CD"],props:{numArgs:0},handler:t=>(_P(t),RO(t.parser)),htmlBuilder:AP,mathmlBuilder:NP}),kP("\\nonumber","\\gdef\\@eqnsw{0}"),kP("\\notag","\\nonumber"),LD({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new KI(t.funcName+" valid only within array environment")}});var RP=xP;LD({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if("ordgroup"!==i.type)throw new KI("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return jD(t.body,n)}),"htmlBuilder$5"),DP=o(((t,e)=>{var r=t.font,n=e.withFont(r);return nO(t.body,n)}),"mathmlBuilder$4"),OP={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};LD({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=ID(e[0]),a=n;return a in OP&&(a=OP[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}}),"handler"),htmlBuilder:MP,mathmlBuilder:DP}),LD({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:o(((t,e)=>{var{parser:r}=t,n=e[0],i=oR.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:CO(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}),"handler")}),LD({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:o(((t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}}),"handler"),htmlBuilder:MP,mathmlBuilder:DP});var PP=o(((t,e)=>{var r=e;return"display"===t?r=r.id>=xR.SCRIPT.id?r.text():xR.DISPLAY:"text"===t&&r.size===xR.DISPLAY.size?r=xR.TEXT:"script"===t?r=xR.SCRIPT:"scriptscript"===t&&(r=xR.SCRIPTSCRIPT),r}),"adjustStyle"),BP=o(((t,e)=>{var r,n=PP(t.size,e.style),i=n.fracNum(),a=n.fracDen();r=e.havingStyle(i);var s=jD(t.numer,r,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?3*u:7*u,g=e.fontMetrics().denom1):(h>0?(d=e.fontMetrics().num2,p=u):(d=e.fontMetrics().num3,p=3*u),g=e.fontMetrics().denom2),c){var b=e.fontMetrics().axisHeight;d-s.depth-(b+.5*h){var r=new ZD.MathNode("mfrac",[nO(t.numer,e),nO(t.denom,e)]);if(t.hasBarLine){if(t.barSize){var n=ZR(t.barSize,e);r.setAttribute("linethickness",QR(n))}}else r.setAttribute("linethickness","0px");var i=PP(t.size,e.style);if(i.size!==e.style.size){r=new ZD.MathNode("mstyle",[r]);var a=i.size===xR.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(null!=t.leftDelim||null!=t.rightDelim){var s=[];if(null!=t.leftDelim){var o=new ZD.MathNode("mo",[new ZD.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(r),null!=t.rightDelim){var l=new ZD.MathNode("mo",[new ZD.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return JD(s)}return r}),"mathmlBuilder$3");LD({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:o(((t,e)=>{var r,{parser:n,funcName:i}=t,a=e[0],s=e[1],o=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":r=!0;break;case"\\\\atopfrac":r=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r=!1,o="(",l=")";break;case"\\\\bracefrac":r=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":r=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:n.mode,continued:!1,numer:a,denom:s,hasBarLine:r,leftDelim:o,rightDelim:l,size:c,barSize:null}}),"handler"),htmlBuilder:BP,mathmlBuilder:$P}),LD({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}),"handler")}),LD({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var e,{parser:r,funcName:n,token:i}=t;switch(n){case"\\over":e="\\frac";break;case"\\choose":e="\\binom";break;case"\\atop":e="\\\\atopfrac";break;case"\\brace":e="\\\\bracefrac";break;case"\\brack":e="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:e,token:i}}});var FP=["display","text","script","scriptscript"],zP=o((function(t){var e=null;return t.length>0&&(e="."===(e=t)?null:e),e}),"delimFromValue");LD({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var r,{parser:n}=t,i=e[4],a=e[5],s=ID(e[0]),o="atom"===s.type&&"open"===s.family?zP(s.text):null,l=ID(e[1]),c="atom"===l.type&&"close"===l.family?zP(l.text):null,h=mO(e[2],"size"),u=null;r=!!h.isBlank||(u=h.value).number>0;var d="auto",p=e[3];if("ordgroup"===p.type){if(p.body.length>0){var g=mO(p.body[0],"textord");d=FP[Number(g.text)]}}else p=mO(p,"textord"),d=FP[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:r,barSize:u,leftDelim:o,rightDelim:c,size:d}},htmlBuilder:BP,mathmlBuilder:$P}),LD({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:mO(e[0],"size").value,token:i}}}),LD({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=sR(mO(e[1],"infix").size),s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}}),"handler"),htmlBuilder:BP,mathmlBuilder:$P});var UP=o(((t,e)=>{var r,n,i=e.style;"supsub"===t.type?(r=t.sup?jD(t.sup,e.havingStyle(i.sup()),e):jD(t.sub,e.havingStyle(i.sub()),e),n=mO(t.base,"horizBrace")):n=mO(t,"horizBrace");var a,s=jD(n.base,e.havingBaseStyle(xR.DISPLAY)),o=fO.svgSpan(n,e);if(n.isOver?(a=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e)).children[0].children[0].children[1].classes.push("svg-align"):(a=bD.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=bD.makeSpan(["mord",n.isOver?"mover":"munder"],[a],e);a=n.isOver?bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},e):bD.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return bD.makeSpan(["mord",n.isOver?"mover":"munder"],[a],e)}),"htmlBuilder$3");LD({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:UP,mathmlBuilder:o(((t,e)=>{var r=fO.mathMLnode(t.label);return new ZD.MathNode(t.isOver?"mover":"munder",[nO(t.base,e),r])}),"mathmlBuilder$2")}),LD({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[1],i=mO(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:RD(n)}:r.formatUnsupportedCmd("\\href")}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.body,e,!1);return bD.makeAnchor(t.href,[],r,e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=rO(t.body,e);return r instanceof VD||(r=new VD("mrow",[r])),r.setAttribute("href",t.href),r}),"mathmlBuilder")}),LD({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=mO(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;anew ZD.MathNode("mrow",eO(t.body,e))}),LD({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:o(((t,e)=>{var r,{parser:n,funcName:i,token:a}=t,s=mO(e[0],"raw").string,o=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=s,r={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,r={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,r={command:"\\htmlStyle",style:s};break;case"\\htmlData":for(var c=s.split(","),h=0;h{var r=$D(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=bD.makeSpan(n,r,e);for(var a in t.attributes)"class"!==a&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>rO(t.body,e)),"mathmlBuilder")}),LD({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:RD(e[0]),mathml:RD(e[1])}}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.html,e,!1);return bD.makeFragment(r)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>rO(t.mathml,e)),"mathmlBuilder")});var GP=o((function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var e=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!e)throw new KI("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(e[1]+e[2]),unit:e[3]};if(!KR(r))throw new KI("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r}),"sizeData");LD({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:o(((t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=mO(r[0],"raw").string.split(","),c=0;c{var r=ZR(t.height,e),n=0;t.totalheight.number>0&&(n=ZR(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=ZR(t.width,e));var a={height:QR(r+n)};i>0&&(a.width=QR(i)),n>0&&(a.verticalAlign=QR(-n));var s=new aM(t.src,t.alt,a);return s.height=r,s.depth=n,s}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=new ZD.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=ZR(t.height,e),i=0;if(t.totalheight.number>0&&(i=ZR(t.totalheight,e)-n,r.setAttribute("valign",QR(-i))),r.setAttribute("height",QR(n+i)),t.width.number>0){var a=ZR(t.width,e);r.setAttribute("width",QR(a))}return r.setAttribute("src",t.src),r}),"mathmlBuilder")}),LD({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=mO(e[0],"size");if(r.settings.strict){var a="m"===n[1],s="mu"===i.value.unit;a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+i.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder:(t,e)=>bD.makeGlue(t.dimension,e),mathmlBuilder(t,e){var r=ZR(t.dimension,e);return new ZD.SpaceNode(r)}}),LD({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}}),"handler"),htmlBuilder:o(((t,e)=>{var r;"clap"===t.alignment?(r=bD.makeSpan([],[jD(t.body,e)]),r=bD.makeSpan(["inner"],[r],e)):r=bD.makeSpan(["inner"],[jD(t.body,e)]);var n=bD.makeSpan(["fix"],[]),i=bD.makeSpan([t.alignment],[r,n],e),a=bD.makeSpan(["strut"]);return a.style.height=QR(i.height+i.depth),i.depth&&(a.style.verticalAlign=QR(-i.depth)),i.children.unshift(a),i=bD.makeSpan(["thinbox"],[i],e),bD.makeSpan(["mord","vbox"],[i],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=new ZD.MathNode("mpadded",[nO(t.body,e)]);if("rlap"!==t.alignment){var n="llap"===t.alignment?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}),"mathmlBuilder")}),LD({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a="\\("===r?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}}),LD({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new KI("Mismatched "+t.funcName)}});var qP=o(((t,e)=>{switch(e.style.size){case xR.DISPLAY.size:return t.display;case xR.TEXT.size:return t.text;case xR.SCRIPT.size:return t.script;case xR.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}}),"chooseMathStyle");LD({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:o(((t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:RD(e[0]),text:RD(e[1]),script:RD(e[2]),scriptscript:RD(e[3])}}),"handler"),htmlBuilder:o(((t,e)=>{var r=qP(t,e),n=$D(r,e,!1);return bD.makeFragment(n)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=qP(t,e);return rO(r,e)}),"mathmlBuilder")});var jP=o(((t,e,r,n,i,a,s)=>{t=bD.makeSpan([],[t]);var o,l,c,h=r&&oR.isCharacterBox(r);if(e){var u=jD(e,n.havingStyle(i.sup()),n);l={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var d=jD(r,n.havingStyle(i.sub()),n);o={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}if(l&&o){var p=n.fontMetrics().bigOpSpacing5+o.elem.height+o.elem.depth+o.kern+t.depth+s;c=bD.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:QR(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:QR(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(o){var g=t.height-s;c=bD.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:QR(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t}]},n)}else{if(!l)return t;var f=t.depth+s;c=bD.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:QR(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}var m=[c];if(o&&0!==a&&!h){var y=bD.makeSpan(["mspace"],[],n);y.style.marginRight=QR(a),m.unshift(y)}return bD.makeSpan(["mop","op-limits"],m,n)}),"assembleSupSub"),WP=["\\smallint"],YP=o(((t,e)=>{var r,n,i,a=!1;"supsub"===t.type?(r=t.sup,n=t.sub,i=mO(t.base,"op"),a=!0):i=mO(t,"op");var s,o=e.style,l=!1;if(o.size===xR.DISPLAY.size&&i.symbol&&!oR.contains(WP,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",h="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(h=i.name.slice(1),i.name="oiint"===h?"\\iint":"\\iiint"),s=bD.makeSymbol(i.name,c,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var u=s.italic,d=bD.staticSvg(h+"Size"+(l?"2":"1"),e);s=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},e),i.name="\\"+h,s.classes.unshift("mop"),s.italic=u}}else if(i.body){var p=$D(i.body,e,!0);1===p.length&&p[0]instanceof oM?(s=p[0]).classes[0]="mop":s=bD.makeSpan(["mop"],p,e)}else{for(var g=[],f=1;f{var r;if(t.symbol)r=new VD("mo",[QD(t.name,t.mode)]),oR.contains(WP,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new VD("mo",eO(t.body,e));else{r=new VD("mi",[new XD(t.name.slice(1))]);var n=new VD("mo",[QD("⁡","text")]);r=t.parentIsSupSub?new VD("mrow",[r,n]):HD([r,n])}return r}),"mathmlBuilder$1"),VP={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};LD({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=n;return 1===i.length&&(i=VP[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}}),"handler"),htmlBuilder:YP,mathmlBuilder:HP}),LD({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:RD(n)}}),"handler"),htmlBuilder:YP,mathmlBuilder:HP});var XP={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};LD({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:YP,mathmlBuilder:HP}),LD({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:YP,mathmlBuilder:HP}),LD({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return 1===n.length&&(n=XP[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:YP,mathmlBuilder:HP});var KP=o(((t,e)=>{var r,n,i,a,s=!1;if("supsub"===t.type?(r=t.sup,n=t.sub,i=mO(t.base,"operatorname"),s=!0):i=mO(t,"operatorname"),i.body.length>0){for(var o=i.body.map((t=>{var e=t.text;return"string"==typeof e?{type:"textord",mode:t.mode,text:e}:t})),l=$D(o,e.withFont("mathrm"),!0),c=0;c{for(var r=eO(t.body,e.withFont("mathrm")),n=!0,i=0;it.toText())).join("");r=[new ZD.TextNode(o)]}var l=new ZD.MathNode("mi",r);l.setAttribute("mathvariant","normal");var c=new ZD.MathNode("mo",[QD("⁡","text")]);return t.parentIsSupSub?new ZD.MathNode("mrow",[l,c]):ZD.newDocumentFragment([l,c])}),"mathmlBuilder");function QP(t,e,r){for(var n=$D(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:RD(i),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}}),"handler"),htmlBuilder:KP,mathmlBuilder:ZP}),kP("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ND({type:"ordgroup",htmlBuilder:(t,e)=>t.semisimple?bD.makeFragment($D(t.body,e,!1)):bD.makeSpan(["mord"],$D(t.body,e,!0),e),mathmlBuilder:(t,e)=>rO(t.body,e,!0)}),LD({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=jD(t.body,e.havingCrampedStyle()),n=bD.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return bD.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new ZD.MathNode("mo",[new ZD.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new ZD.MathNode("mover",[nO(t.body,e),r]);return n.setAttribute("accent","true"),n}}),LD({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:RD(n)}}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.body,e.withPhantom(),!1);return bD.makeFragment(r)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=eO(t.body,e);return new ZD.MathNode("mphantom",r)}),"mathmlBuilder")}),LD({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}}),"handler"),htmlBuilder:o(((t,e)=>{var r=bD.makeSpan([],[jD(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=eO(RD(t.body),e),n=new ZD.MathNode("mphantom",r),i=new ZD.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}),"mathmlBuilder")}),LD({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}}),"handler"),htmlBuilder:o(((t,e)=>{var r=bD.makeSpan(["inner"],[jD(t.body,e.withPhantom())]),n=bD.makeSpan(["fix"],[]);return bD.makeSpan(["mord","rlap"],[r,n],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=eO(RD(t.body),e),n=new ZD.MathNode("mphantom",r),i=new ZD.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}),"mathmlBuilder")}),LD({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=mO(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=jD(t.body,e),n=ZR(t.dy,e);return bD.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new ZD.MathNode("mpadded",[nO(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),LD({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),LD({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=mO(e[0],"size"),s=mO(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&mO(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=bD.makeSpan(["mord","rule"],[],e),n=ZR(t.width,e),i=ZR(t.height,e),a=t.shift?ZR(t.shift,e):0;return r.style.borderRightWidth=QR(n),r.style.borderTopWidth=QR(i),r.style.bottom=QR(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=1.125*i*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=ZR(t.width,e),n=ZR(t.height,e),i=t.shift?ZR(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new ZD.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",QR(r)),s.setAttribute("height",QR(n));var o=new ZD.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",QR(i)):(o.setAttribute("height",QR(i)),o.setAttribute("depth",QR(-i))),o.setAttribute("voffset",QR(i)),o}}),o(QP,"sizingGroup");var JP=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],tB=o(((t,e)=>{var r=e.havingSize(t.size);return QP(t.body,r,e)}),"htmlBuilder");LD({type:"sizing",names:JP,props:{numArgs:0,allowedInText:!0},handler:o(((t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:JP.indexOf(n)+1,body:a}}),"handler"),htmlBuilder:tB,mathmlBuilder:o(((t,e)=>{var r=e.havingSize(t.size),n=eO(t.body,r),i=new ZD.MathNode("mstyle",n);return i.setAttribute("mathsize",QR(r.sizeMultiplier)),i}),"mathmlBuilder")}),LD({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:o(((t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&mO(r[0],"ordgroup");if(s)for(var o="",l=0;l{var r=bD.makeSpan([],[jD(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new ZD.MathNode("mpadded",[nO(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}),"mathmlBuilder")}),LD({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=jD(t.body,e.havingCrampedStyle());0===r.height&&(r.height=e.fontMetrics().xHeight),r=bD.wrapFragment(r,e);var n=e.fontMetrics().defaultRuleThickness,i=n;e.style.idr.height+r.depth+a&&(a=(a+h-r.height-r.depth)/2);var u=o.height-r.height-a-l;r.style.paddingLeft=QR(c);var d=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:o},{type:"kern",size:l}]},e);if(t.index){var p=e.havingStyle(xR.SCRIPTSCRIPT),g=jD(t.index,p,e),f=.6*(d.height-d.depth),m=bD.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:g}]},e),y=bD.makeSpan(["root"],[m]);return bD.makeSpan(["mord","sqrt"],[y,d],e)}return bD.makeSpan(["mord","sqrt"],[d],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new ZD.MathNode("mroot",[nO(r,e),nO(n,e)]):new ZD.MathNode("msqrt",[nO(r,e)])}});var eB={display:xR.DISPLAY,text:xR.TEXT,script:xR.SCRIPT,scriptscript:xR.SCRIPTSCRIPT};LD({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=eB[t.style],n=e.havingStyle(r).withFont("");return QP(t.body,n,e)},mathmlBuilder(t,e){var r=eB[t.style],n=e.havingStyle(r),i=eO(t.body,n),a=new ZD.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[t.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var rB=o((function(t,e){var r=t.base;return r?"op"===r.type?r.limits&&(e.style.size===xR.DISPLAY.size||r.alwaysHandleSupSub)?YP:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(e.style.size===xR.DISPLAY.size||r.limits)?KP:null:"accent"===r.type?oR.isCharacterBox(r.base)?xO:null:"horizBrace"===r.type&&!t.sub===r.isOver?UP:null:null}),"htmlBuilderDelegate");ND({type:"supsub",htmlBuilder(t,e){var r=rB(t,e);if(r)return r(t,e);var n,i,a,{base:s,sup:o,sub:l}=t,c=jD(s,e),h=e.fontMetrics(),u=0,d=0,p=s&&oR.isCharacterBox(s);if(o){var g=e.havingStyle(e.style.sup());n=jD(o,g,e),p||(u=c.height-g.fontMetrics().supDrop*g.sizeMultiplier/e.sizeMultiplier)}if(l){var f=e.havingStyle(e.style.sub());i=jD(l,f,e),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/e.sizeMultiplier)}a=e.style===xR.DISPLAY?h.sup1:e.style.cramped?h.sup3:h.sup2;var m,y=e.sizeMultiplier,v=QR(.5/h.ptPerEm/y),x=null;if(i){var b=t.base&&"op"===t.base.type&&t.base.name&&("\\oiint"===t.base.name||"\\oiiint"===t.base.name);(c instanceof oM||b)&&(x=QR(-c.italic))}if(n&&i){u=Math.max(u,a,n.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var w=4*h.defaultRuleThickness;if(u-n.depth-(i.height-d)0&&(u+=k,d-=k)}var T=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:n,shift:-u,marginRight:v}];m=bD.makeVList({positionType:"individualShift",children:T},e)}else if(i){d=Math.max(d,h.sub1,i.height-.8*h.xHeight);var _=[{type:"elem",elem:i,marginLeft:x,marginRight:v}];m=bD.makeVList({positionType:"shift",positionData:d,children:_},e)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,a,n.depth+.25*h.xHeight),m=bD.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:v}]},e)}var E=GD(c,"right")||"mord";return bD.makeSpan([E],[c,bD.makeSpan(["msupsub"],[m])],e)},mathmlBuilder(t,e){var r,n=!1;t.base&&"horizBrace"===t.base.type&&!!t.sup===t.base.isOver&&(n=!0,r=t.base.isOver),!t.base||"op"!==t.base.type&&"operatorname"!==t.base.type||(t.base.parentIsSupSub=!0);var i,a=[nO(t.base,e)];if(t.sub&&a.push(nO(t.sub,e)),t.sup&&a.push(nO(t.sup,e)),n)i=r?"mover":"munder";else if(t.sub)if(t.sup){var s=t.base;i=s&&"op"===s.type&&s.limits&&e.style===xR.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(e.style===xR.DISPLAY||s.limits)?"munderover":"msubsup"}else{var o=t.base;i=o&&"op"===o.type&&o.limits&&(e.style===xR.DISPLAY||o.alwaysHandleSupSub)||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(o.limits||e.style===xR.DISPLAY)?"munder":"msub"}else{var l=t.base;i=l&&"op"===l.type&&l.limits&&(e.style===xR.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||e.style===xR.DISPLAY)?"mover":"msup"}return new ZD.MathNode(i,a)}}),ND({type:"atom",htmlBuilder:(t,e)=>bD.mathsym(t.text,t.mode,e,["m"+t.family]),mathmlBuilder(t,e){var r=new ZD.MathNode("mo",[QD(t.text,t.mode)]);if("bin"===t.family){var n=tO(t,e);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===t.family?r.setAttribute("separator","true"):"open"!==t.family&&"close"!==t.family||r.setAttribute("stretchy","false");return r}});var nB={mi:"italic",mn:"normal",mtext:"normal"};ND({type:"mathord",htmlBuilder:(t,e)=>bD.makeOrd(t,e,"mathord"),mathmlBuilder(t,e){var r=new ZD.MathNode("mi",[QD(t.text,t.mode,e)]),n=tO(t,e)||"italic";return n!==nB[r.type]&&r.setAttribute("mathvariant",n),r}}),ND({type:"textord",htmlBuilder:(t,e)=>bD.makeOrd(t,e,"textord"),mathmlBuilder(t,e){var r,n=QD(t.text,t.mode,e),i=tO(t,e)||"normal";return r="text"===t.mode?new ZD.MathNode("mtext",[n]):/[0-9]/.test(t.text)?new ZD.MathNode("mn",[n]):"\\prime"===t.text?new ZD.MathNode("mo",[n]):new ZD.MathNode("mi",[n]),i!==nB[r.type]&&r.setAttribute("mathvariant",i),r}});var iB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},aB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ND({type:"spacing",htmlBuilder(t,e){if(aB.hasOwnProperty(t.text)){var r=aB[t.text].className||"";if("text"===t.mode){var n=bD.makeOrd(t,e,"textord");return n.classes.push(r),n}return bD.makeSpan(["mspace",r],[bD.mathsym(t.text,t.mode,e)],e)}if(iB.hasOwnProperty(t.text))return bD.makeSpan(["mspace",iB[t.text]],[],e);throw new KI('Unknown type of space "'+t.text+'"')},mathmlBuilder(t,e){if(!aB.hasOwnProperty(t.text)){if(iB.hasOwnProperty(t.text))return new ZD.MathNode("mspace");throw new KI('Unknown type of space "'+t.text+'"')}return new ZD.MathNode("mtext",[new ZD.TextNode(" ")])}});var sB=o((()=>{var t=new ZD.MathNode("mtd",[]);return t.setAttribute("width","50%"),t}),"pad");ND({type:"tag",mathmlBuilder(t,e){var r=new ZD.MathNode("mtable",[new ZD.MathNode("mtr",[sB(),new ZD.MathNode("mtd",[rO(t.body,e)]),sB(),new ZD.MathNode("mtd",[rO(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var oB={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},lB={"\\textbf":"textbf","\\textmd":"textmd"},cB={"\\textit":"textit","\\textup":"textup"},hB=o(((t,e)=>{var r=t.font;return r?oB[r]?e.withTextFontFamily(oB[r]):lB[r]?e.withTextFontWeight(lB[r]):"\\emph"===r?"textit"===e.fontShape?e.withTextFontShape("textup"):e.withTextFontShape("textit"):e.withTextFontShape(cB[r]):e}),"optionsWithFont");LD({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:RD(i),font:n}},htmlBuilder(t,e){var r=hB(t,e),n=$D(t.body,r,!0);return bD.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=hB(t,e);return rO(t.body,r)}}),LD({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=jD(t.body,e),n=bD.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=bD.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return bD.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new ZD.MathNode("mo",[new ZD.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new ZD.MathNode("munder",[nO(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),LD({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=jD(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return bD.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder:(t,e)=>new ZD.MathNode("mpadded",[nO(t.body,e)],["vcenter"])}),LD({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new KI("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=uB(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" ")),"makeVerb"),dB=CD,pB=new RegExp("[̀-ͯ]+$"),gB=class{static{o(this,"Lexer")}constructor(t,e){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=e,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(t,e){this.catcodes[t]=e}lex(){var t=this.input,e=this.tokenRegex.lastIndex;if(e===t.length)return new XI("EOF",new VI(this,e,e));var r=this.tokenRegex.exec(t);if(null===r||r.index!==e)throw new KI("Unexpected character: '"+t[e]+"'",new XI(t[e],new VI(this,e,e+1)));var n=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[n]){var i=t.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new XI(n,new VI(this,e,this.tokenRegex.lastIndex))}},fB=class{static{o(this,"Namespace")}constructor(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=e,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new KI("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var e in t)t.hasOwnProperty(e)&&(null==t[e]?delete this.current[e]:this.current[e]=t[e])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,e,r){if(void 0===r&&(r=!1),r){for(var n=0;n0&&(this.undefStack[this.undefStack.length-1][t]=e)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}null==e?delete this.current[t]:this.current[t]=e}},mB=wP;kP("\\noexpand",(function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}})),kP("\\expandafter",(function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}})),kP("\\@firstoftwo",(function(t){return{tokens:t.consumeArgs(2)[0],numArgs:0}})),kP("\\@secondoftwo",(function(t){return{tokens:t.consumeArgs(2)[1],numArgs:0}})),kP("\\@ifnextchar",(function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return 1===e[0].length&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}})),kP("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),kP("\\TextOrMath",(function(t){var e=t.consumeArgs(2);return"text"===t.mode?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}}));var yB={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};kP("\\char",(function(t){var e,r=t.popToken(),n="";if("'"===r.text)e=8,r=t.popToken();else if('"'===r.text)e=16,r=t.popToken();else if("`"===r.text)if("\\"===(r=t.popToken()).text[0])n=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new KI("\\char` missing argument");n=r.text.charCodeAt(0)}else e=10;if(e){if(null==(n=yB[r.text])||n>=e)throw new KI("Invalid base-"+e+" digit "+r.text);for(var i;null!=(i=yB[t.future().text])&&i{var n=t.consumeArg().tokens;if(1!==n.length)throw new KI("\\newcommand's first argument must be a macro name");var i=n[0].text,a=t.isDefined(i);if(a&&!e)throw new KI("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!r)throw new KI("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(n=t.consumeArg().tokens).length&&"["===n[0].text){for(var o="",l=t.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)o+=l.text,l=t.expandNextToken();if(!o.match(/^\s*[0-9]+\s*$/))throw new KI("Invalid number of arguments: "+o);s=parseInt(o),n=t.consumeArg().tokens}return t.macros.set(i,{tokens:n,numArgs:s}),""}),"newcommand");kP("\\newcommand",(t=>vB(t,!1,!0))),kP("\\renewcommand",(t=>vB(t,!0,!1))),kP("\\providecommand",(t=>vB(t,!0,!0))),kP("\\message",(t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map((t=>t.text)).join("")),""})),kP("\\errmessage",(t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map((t=>t.text)).join("")),""})),kP("\\show",(t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),dB[r],fM.math[r],fM.text[r]),""})),kP("\\bgroup","{"),kP("\\egroup","}"),kP("~","\\nobreakspace"),kP("\\lq","`"),kP("\\rq","'"),kP("\\aa","\\r a"),kP("\\AA","\\r A"),kP("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),kP("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),kP("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),kP("ℬ","\\mathscr{B}"),kP("ℰ","\\mathscr{E}"),kP("ℱ","\\mathscr{F}"),kP("ℋ","\\mathscr{H}"),kP("ℐ","\\mathscr{I}"),kP("ℒ","\\mathscr{L}"),kP("ℳ","\\mathscr{M}"),kP("ℛ","\\mathscr{R}"),kP("ℭ","\\mathfrak{C}"),kP("ℌ","\\mathfrak{H}"),kP("ℨ","\\mathfrak{Z}"),kP("\\Bbbk","\\Bbb{k}"),kP("·","\\cdotp"),kP("\\llap","\\mathllap{\\textrm{#1}}"),kP("\\rlap","\\mathrlap{\\textrm{#1}}"),kP("\\clap","\\mathclap{\\textrm{#1}}"),kP("\\mathstrut","\\vphantom{(}"),kP("\\underbar","\\underline{\\text{#1}}"),kP("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),kP("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),kP("\\ne","\\neq"),kP("≠","\\neq"),kP("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),kP("∉","\\notin"),kP("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),kP("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),kP("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),kP("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),kP("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),kP("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),kP("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),kP("⟂","\\perp"),kP("‼","\\mathclose{!\\mkern-0.8mu!}"),kP("∌","\\notni"),kP("⌜","\\ulcorner"),kP("⌝","\\urcorner"),kP("⌞","\\llcorner"),kP("⌟","\\lrcorner"),kP("©","\\copyright"),kP("®","\\textregistered"),kP("️","\\textregistered"),kP("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),kP("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),kP("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),kP("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),kP("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),kP("⋮","\\vdots"),kP("\\varGamma","\\mathit{\\Gamma}"),kP("\\varDelta","\\mathit{\\Delta}"),kP("\\varTheta","\\mathit{\\Theta}"),kP("\\varLambda","\\mathit{\\Lambda}"),kP("\\varXi","\\mathit{\\Xi}"),kP("\\varPi","\\mathit{\\Pi}"),kP("\\varSigma","\\mathit{\\Sigma}"),kP("\\varUpsilon","\\mathit{\\Upsilon}"),kP("\\varPhi","\\mathit{\\Phi}"),kP("\\varPsi","\\mathit{\\Psi}"),kP("\\varOmega","\\mathit{\\Omega}"),kP("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),kP("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),kP("\\boxed","\\fbox{$\\displaystyle{#1}$}"),kP("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),kP("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),kP("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var xB={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};kP("\\dots",(function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in xB?e=xB[r]:("\\not"===r.slice(0,4)||r in fM.math&&oR.contains(["bin","rel"],fM.math[r].group))&&(e="\\dotsb"),e}));var bB={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};kP("\\dotso",(function(t){return t.future().text in bB?"\\ldots\\,":"\\ldots"})),kP("\\dotsc",(function(t){var e=t.future().text;return e in bB&&","!==e?"\\ldots\\,":"\\ldots"})),kP("\\cdots",(function(t){return t.future().text in bB?"\\@cdots\\,":"\\@cdots"})),kP("\\dotsb","\\cdots"),kP("\\dotsm","\\cdots"),kP("\\dotsi","\\!\\cdots"),kP("\\dotsx","\\ldots\\,"),kP("\\DOTSI","\\relax"),kP("\\DOTSB","\\relax"),kP("\\DOTSX","\\relax"),kP("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),kP("\\,","\\tmspace+{3mu}{.1667em}"),kP("\\thinspace","\\,"),kP("\\>","\\mskip{4mu}"),kP("\\:","\\tmspace+{4mu}{.2222em}"),kP("\\medspace","\\:"),kP("\\;","\\tmspace+{5mu}{.2777em}"),kP("\\thickspace","\\;"),kP("\\!","\\tmspace-{3mu}{.1667em}"),kP("\\negthinspace","\\!"),kP("\\negmedspace","\\tmspace-{4mu}{.2222em}"),kP("\\negthickspace","\\tmspace-{5mu}{.277em}"),kP("\\enspace","\\kern.5em "),kP("\\enskip","\\hskip.5em\\relax"),kP("\\quad","\\hskip1em\\relax"),kP("\\qquad","\\hskip2em\\relax"),kP("\\tag","\\@ifstar\\tag@literal\\tag@paren"),kP("\\tag@paren","\\tag@literal{({#1})}"),kP("\\tag@literal",(t=>{if(t.macros.get("\\df@tag"))throw new KI("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),kP("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),kP("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),kP("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),kP("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),kP("\\newline","\\\\\\relax"),kP("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var wB=QR(BR["Main-Regular"]["T".charCodeAt(0)][1]-.7*BR["Main-Regular"]["A".charCodeAt(0)][1]);kP("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+wB+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),kP("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+wB+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),kP("\\hspace","\\@ifstar\\@hspacer\\@hspace"),kP("\\@hspace","\\hskip #1\\relax"),kP("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),kP("\\ordinarycolon",":"),kP("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),kP("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),kP("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),kP("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),kP("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),kP("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),kP("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),kP("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),kP("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),kP("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),kP("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),kP("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),kP("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),kP("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),kP("∷","\\dblcolon"),kP("∹","\\eqcolon"),kP("≔","\\coloneqq"),kP("≕","\\eqqcolon"),kP("⩴","\\Coloneqq"),kP("\\ratio","\\vcentcolon"),kP("\\coloncolon","\\dblcolon"),kP("\\colonequals","\\coloneqq"),kP("\\coloncolonequals","\\Coloneqq"),kP("\\equalscolon","\\eqqcolon"),kP("\\equalscoloncolon","\\Eqqcolon"),kP("\\colonminus","\\coloneq"),kP("\\coloncolonminus","\\Coloneq"),kP("\\minuscolon","\\eqcolon"),kP("\\minuscoloncolon","\\Eqcolon"),kP("\\coloncolonapprox","\\Colonapprox"),kP("\\coloncolonsim","\\Colonsim"),kP("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),kP("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),kP("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),kP("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),kP("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),kP("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),kP("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),kP("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),kP("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),kP("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),kP("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),kP("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),kP("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),kP("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),kP("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),kP("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),kP("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),kP("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),kP("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),kP("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),kP("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),kP("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),kP("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),kP("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),kP("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),kP("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),kP("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),kP("\\imath","\\html@mathml{\\@imath}{ı}"),kP("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),kP("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),kP("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),kP("⟦","\\llbracket"),kP("⟧","\\rrbracket"),kP("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),kP("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),kP("⦃","\\lBrace"),kP("⦄","\\rBrace"),kP("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),kP("⦵","\\minuso"),kP("\\darr","\\downarrow"),kP("\\dArr","\\Downarrow"),kP("\\Darr","\\Downarrow"),kP("\\lang","\\langle"),kP("\\rang","\\rangle"),kP("\\uarr","\\uparrow"),kP("\\uArr","\\Uparrow"),kP("\\Uarr","\\Uparrow"),kP("\\N","\\mathbb{N}"),kP("\\R","\\mathbb{R}"),kP("\\Z","\\mathbb{Z}"),kP("\\alef","\\aleph"),kP("\\alefsym","\\aleph"),kP("\\Alpha","\\mathrm{A}"),kP("\\Beta","\\mathrm{B}"),kP("\\bull","\\bullet"),kP("\\Chi","\\mathrm{X}"),kP("\\clubs","\\clubsuit"),kP("\\cnums","\\mathbb{C}"),kP("\\Complex","\\mathbb{C}"),kP("\\Dagger","\\ddagger"),kP("\\diamonds","\\diamondsuit"),kP("\\empty","\\emptyset"),kP("\\Epsilon","\\mathrm{E}"),kP("\\Eta","\\mathrm{H}"),kP("\\exist","\\exists"),kP("\\harr","\\leftrightarrow"),kP("\\hArr","\\Leftrightarrow"),kP("\\Harr","\\Leftrightarrow"),kP("\\hearts","\\heartsuit"),kP("\\image","\\Im"),kP("\\infin","\\infty"),kP("\\Iota","\\mathrm{I}"),kP("\\isin","\\in"),kP("\\Kappa","\\mathrm{K}"),kP("\\larr","\\leftarrow"),kP("\\lArr","\\Leftarrow"),kP("\\Larr","\\Leftarrow"),kP("\\lrarr","\\leftrightarrow"),kP("\\lrArr","\\Leftrightarrow"),kP("\\Lrarr","\\Leftrightarrow"),kP("\\Mu","\\mathrm{M}"),kP("\\natnums","\\mathbb{N}"),kP("\\Nu","\\mathrm{N}"),kP("\\Omicron","\\mathrm{O}"),kP("\\plusmn","\\pm"),kP("\\rarr","\\rightarrow"),kP("\\rArr","\\Rightarrow"),kP("\\Rarr","\\Rightarrow"),kP("\\real","\\Re"),kP("\\reals","\\mathbb{R}"),kP("\\Reals","\\mathbb{R}"),kP("\\Rho","\\mathrm{P}"),kP("\\sdot","\\cdot"),kP("\\sect","\\S"),kP("\\spades","\\spadesuit"),kP("\\sub","\\subset"),kP("\\sube","\\subseteq"),kP("\\supe","\\supseteq"),kP("\\Tau","\\mathrm{T}"),kP("\\thetasym","\\vartheta"),kP("\\weierp","\\wp"),kP("\\Zeta","\\mathrm{Z}"),kP("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),kP("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),kP("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),kP("\\bra","\\mathinner{\\langle{#1}|}"),kP("\\ket","\\mathinner{|{#1}\\rangle}"),kP("\\braket","\\mathinner{\\langle{#1}\\rangle}"),kP("\\Bra","\\left\\langle#1\\right|"),kP("\\Ket","\\left|#1\\right\\rangle");var kB=o((t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=o((e=>r=>{t&&(r.macros.set("|",s),i.length&&r.macros.set("\\|",l));var a=e;!e&&i.length&&("|"===r.future().text&&(r.popToken(),a=!0));return{tokens:a?i:n,numArgs:0}}),"midMacro");e.macros.set("|",c(!1)),i.length&&e.macros.set("\\|",c(!0));var h=e.consumeArg().tokens,u=e.expandTokens([...a,...h,...r]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}}),"braketHelper");kP("\\bra@ket",kB(!1)),kP("\\bra@set",kB(!0)),kP("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),kP("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),kP("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),kP("\\angln","{\\angl n}"),kP("\\blue","\\textcolor{##6495ed}{#1}"),kP("\\orange","\\textcolor{##ffa500}{#1}"),kP("\\pink","\\textcolor{##ff00af}{#1}"),kP("\\red","\\textcolor{##df0030}{#1}"),kP("\\green","\\textcolor{##28ae7b}{#1}"),kP("\\gray","\\textcolor{gray}{#1}"),kP("\\purple","\\textcolor{##9d38bd}{#1}"),kP("\\blueA","\\textcolor{##ccfaff}{#1}"),kP("\\blueB","\\textcolor{##80f6ff}{#1}"),kP("\\blueC","\\textcolor{##63d9ea}{#1}"),kP("\\blueD","\\textcolor{##11accd}{#1}"),kP("\\blueE","\\textcolor{##0c7f99}{#1}"),kP("\\tealA","\\textcolor{##94fff5}{#1}"),kP("\\tealB","\\textcolor{##26edd5}{#1}"),kP("\\tealC","\\textcolor{##01d1c1}{#1}"),kP("\\tealD","\\textcolor{##01a995}{#1}"),kP("\\tealE","\\textcolor{##208170}{#1}"),kP("\\greenA","\\textcolor{##b6ffb0}{#1}"),kP("\\greenB","\\textcolor{##8af281}{#1}"),kP("\\greenC","\\textcolor{##74cf70}{#1}"),kP("\\greenD","\\textcolor{##1fab54}{#1}"),kP("\\greenE","\\textcolor{##0d923f}{#1}"),kP("\\goldA","\\textcolor{##ffd0a9}{#1}"),kP("\\goldB","\\textcolor{##ffbb71}{#1}"),kP("\\goldC","\\textcolor{##ff9c39}{#1}"),kP("\\goldD","\\textcolor{##e07d10}{#1}"),kP("\\goldE","\\textcolor{##a75a05}{#1}"),kP("\\redA","\\textcolor{##fca9a9}{#1}"),kP("\\redB","\\textcolor{##ff8482}{#1}"),kP("\\redC","\\textcolor{##f9685d}{#1}"),kP("\\redD","\\textcolor{##e84d39}{#1}"),kP("\\redE","\\textcolor{##bc2612}{#1}"),kP("\\maroonA","\\textcolor{##ffbde0}{#1}"),kP("\\maroonB","\\textcolor{##ff92c6}{#1}"),kP("\\maroonC","\\textcolor{##ed5fa6}{#1}"),kP("\\maroonD","\\textcolor{##ca337c}{#1}"),kP("\\maroonE","\\textcolor{##9e034e}{#1}"),kP("\\purpleA","\\textcolor{##ddd7ff}{#1}"),kP("\\purpleB","\\textcolor{##c6b9fc}{#1}"),kP("\\purpleC","\\textcolor{##aa87ff}{#1}"),kP("\\purpleD","\\textcolor{##7854ab}{#1}"),kP("\\purpleE","\\textcolor{##543b78}{#1}"),kP("\\mintA","\\textcolor{##f5f9e8}{#1}"),kP("\\mintB","\\textcolor{##edf2df}{#1}"),kP("\\mintC","\\textcolor{##e0e5cc}{#1}"),kP("\\grayA","\\textcolor{##f6f7f7}{#1}"),kP("\\grayB","\\textcolor{##f0f1f2}{#1}"),kP("\\grayC","\\textcolor{##e3e5e6}{#1}"),kP("\\grayD","\\textcolor{##d6d8da}{#1}"),kP("\\grayE","\\textcolor{##babec2}{#1}"),kP("\\grayF","\\textcolor{##888d93}{#1}"),kP("\\grayG","\\textcolor{##626569}{#1}"),kP("\\grayH","\\textcolor{##3b3e40}{#1}"),kP("\\grayI","\\textcolor{##21242c}{#1}"),kP("\\kaBlue","\\textcolor{##314453}{#1}"),kP("\\kaGreen","\\textcolor{##71B307}{#1}");var TB={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},_B=class{static{o(this,"MacroExpander")}constructor(t,e,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=e,this.expansionCount=0,this.feed(t),this.macros=new fB(mB,e.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new gB(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var e,r,n;if(t){if(this.consumeSpaces(),"["!==this.future().text)return null;e=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:e,end:r}=this.consumeArg());return this.pushToken(new XI("EOF",r.loc)),this.pushTokens(n),e.range(r,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(t){var e=[],r=t&&t.length>0;r||this.consumeSpaces();var n,i=this.future(),a=0,s=0;do{if(n=this.popToken(),e.push(n),"{"===n.text)++a;else if("}"===n.text){if(-1===--a)throw new KI("Extra }",n)}else if("EOF"===n.text)throw new KI("Unexpected end of input in a macro argument, expected '"+(t&&r?t[s]:"}")+"'",n);if(t&&r)if((0===a||1===a&&"{"===t[s])&&n.text===t[s]){if(++s===t.length){e.splice(-s,s);break}}else s=0}while(0!==a||r);return"{"===i.text&&"}"===e[e.length-1].text&&(e.pop(),e.shift()),e.reverse(),{tokens:e,start:i,end:n}}consumeArgs(t,e){if(e){if(e.length!==t+1)throw new KI("The length of delimiters doesn't match the number of args!");for(var r=e[0],n=0;nthis.settings.maxExpand)throw new KI("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var e=this.popToken(),r=e.text,n=e.noexpand?null:this._getExpansion(r);if(null==n||t&&n.unexpandable){if(t&&null==n&&"\\"===r[0]&&!this.isDefined(r))throw new KI("Undefined control sequence: "+r);return this.pushToken(e),!1}this.countExpansion(1);var i=n.tokens,a=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var o=i[s];if("#"===o.text){if(0===s)throw new KI("Incomplete placeholder at end of macro body",o);if("#"===(o=i[--s]).text)i.splice(s+1,1);else{if(!/^[1-9]$/.test(o.text))throw new KI("Not a valid argument number",o);i.splice(s,2,...a[+o.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new XI(t)]):void 0}expandTokens(t){var e=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(!1===this.expandOnce(!0)){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),e.push(n)}return this.countExpansion(e.length),e}expandMacroAsText(t){var e=this.expandMacro(t);return e?e.map((t=>t.text)).join(""):e}_getExpansion(t){var e=this.macros.get(t);if(null==e)return e;if(1===t.length){var r=this.lexer.catcodes[t];if(null!=r&&13!==r)return}var n="function"==typeof e?e(this):e;if("string"==typeof n){var i=0;if(-1!==n.indexOf("#"))for(var a=n.replace(/##/g,"");-1!==a.indexOf("#"+(i+1));)++i;for(var s=new gB(n,this.settings),o=[],l=s.lex();"EOF"!==l.text;)o.push(l),l=s.lex();return o.reverse(),{tokens:o,numArgs:i}}return n}isDefined(t){return this.macros.has(t)||dB.hasOwnProperty(t)||fM.math.hasOwnProperty(t)||fM.text.hasOwnProperty(t)||TB.hasOwnProperty(t)}isExpandable(t){var e=this.macros.get(t);return null!=e?"string"==typeof e||"function"==typeof e||!e.unexpandable:dB.hasOwnProperty(t)&&!dB[t].primitive}},EB=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,CB=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),SB={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},AB={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},LB=class t{static{o(this,"Parser")}constructor(t,e){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new _B(t,e,this.mode),this.settings=e,this.leftrightDepth=0}expect(t,e){if(void 0===e&&(e=!0),this.fetch().text!==t)throw new KI("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());e&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var e=this.nextToken;this.consume(),this.gullet.pushToken(new XI("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=e,r}parseExpression(e,r){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==t.endOfExpression.indexOf(i.text))break;if(r&&i.text===r)break;if(e&&dB[i.text]&&dB[i.text].infix)break;var a=this.parseAtom(r);if(!a)break;"internal"!==a.type&&n.push(a)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(t){for(var e,r=-1,n=0;n=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',t);var s,o=fM[this.mode][e].group,l=VI.range(t);if(pM.hasOwnProperty(o)){var c=o;s={type:"atom",mode:this.mode,family:c,loc:l,text:e}}else s={type:o,mode:this.mode,loc:l,text:e};i=s}else{if(!(e.charCodeAt(0)>=128))return null;this.settings.strict&&(TR(e.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+e[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+e[0]+'" ('+e.charCodeAt(0)+")",t)),i={type:"textord",mode:"text",loc:VI.range(t),text:e}}if(this.consume(),a)for(var h=0;h2?e[2]:void 0;for(i&&Xw(e[0],e[1],i)&&(n=1);++ro))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=2&r?new dF:void 0;for(a.set(t,e),a.set(e,t);++ue}o(Jz,"baseGt");var tU=Jz;function eU(t){return t&&t.length?Qz(t,Ow,tU):void 0}o(eU,"max");var rU=eU;function nU(t,e,r,n){if(!cv(t))return t;for(var i=-1,a=(e=gz(e,t)).length,s=a-1,o=t;null!=o&&++i0&&r(o)?e>1?dU(o,e-1,r,n,i):i$(i,o):n||(i[i.length]=o)}return i}o(dU,"baseFlatten");var pU=dU;function gU(t){return(null==t?0:t.length)?pU(t,1):[]}o(gU,"flatten");var fU=gU;function mU(t){return Ww(zw(t,void 0,fU),t+"")}o(mU,"flatRest");var yU=mU((function(t,e){return null==t?{}:lU(t,e)})),vU=yU;function xU(t,e,r,n){var i=-1,a=null==t?0:t.length;for(n&&a&&(r=t[++i]);++i-1}o(MU,"arrayIncludes");var DU=MU;function OU(t,e,r){for(var n=-1,i=null==t?0:t.length;++n=200){var c=e?null:FU(t);if(c)return kF(c);s=!1,i=mF,l=new dF}else l=e?[]:o;t:for(;++ni?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n=200&&(a=mF,s=!1,e=new dF(e));t:for(;++i-1?i[a?e[s]:s]:void 0}}o(FG,"createFind");var zG=FG,UG=Math.max;function GG(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:aG(r);return i<0&&(i=UG(n+i,0)),CU(t,Pz(e),i)}o(GG,"findIndex");var qG=zG(GG);function jG(t){return t&&t.length?t[0]:void 0}o(jG,"head");var WG=jG;function YG(t,e){return pU(Gz(t,e),1)}o(YG,"flatMap");var HG=YG;function VG(t,e){return null==t?t:Xx(t,rF(e),Sw)}o(VG,"forIn");var XG=VG;function KG(t,e){return t&&Q$(t,rF(e))}o(KG,"forOwn");var ZG=KG,QG=Object.prototype.hasOwnProperty,JG=TG((function(t,e,r){QG.call(t,r)?t[r].push(e):Wx(t,r,[e])})),tq=JG,eq=Object.prototype.hasOwnProperty;function rq(t,e){return null!=t&&eq.call(t,e)}o(rq,"baseHas");var nq=rq;function iq(t,e){return null!=t&&_z(t,e,nq)}o(iq,"has");var aq=iq;function sq(t){return"string"==typeof t||!Lb(t)&&wb(t)&&"[object String]"==ov(t)}o(sq,"isString");var oq=sq,lq=Math.max;function cq(t,e,r,n){t=Mb(t)?t:Yz(t),r=r&&!n?aG(r):0;var i=t.length;return r<0&&(r=lq(i+r,0)),oq(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&RU(t,e,r)>-1}o(cq,"includes");var hq=cq,uq=Math.max;function dq(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:aG(r);return i<0&&(i=uq(n+i,0)),RU(t,e,i)}o(dq,"indexOf");var pq=dq;function gq(t){return wb(t)&&"[object RegExp]"==ov(t)}o(gq,"baseIsRegExp");var fq=gq,mq=nw&&nw.isRegExp,yq=mq?Jb(mq):fq;function vq(t,e){return te||a&&s&&l&&!o&&!c||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!c&&t=o?l:l*("desc"==r[n]?-1:1)}return t.index-e.index}o(Rq,"compareMultiple");var Mq=Rq;function Dq(t,e,r){e=e.length?sz(e,(function(t){return Lb(t)?function(e){return vz(e,1===t.length?t[0]:t)}:t})):[Ow];var n=-1;e=sz(e,Jb(Pz));var i=zz(t,(function(t,r,i){return{criteria:sz(e,(function(e){return e(t)})),index:++n,value:t}}));return Lq(i,(function(t,e){return Mq(t,e,r)}))}o(Dq,"baseOrderBy");var Oq=Dq,Pq=Nz("length"),Bq="[\\ud800-\\udfff]",$q="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Fq="\\ud83c[\\udffb-\\udfff]",zq="[^\\ud800-\\udfff]",Uq="(?:\\ud83c[\\udde6-\\uddff]){2}",Gq="[\\ud800-\\udbff][\\udc00-\\udfff]",qq="(?:"+$q+"|"+Fq+")"+"?",jq="[\\ufe0e\\ufe0f]?",Wq=jq+qq+("(?:\\u200d(?:"+[zq,Uq,Gq].join("|")+")"+jq+qq+")*"),Yq="(?:"+[zq+$q+"?",$q,Uq,Gq,Bq].join("|")+")",Hq=RegExp(Fq+"(?="+Fq+")|"+Yq+Wq,"g");function Vq(t){for(var e=Hq.lastIndex=0;Hq.test(t);)++e;return e}o(Vq,"unicodeSize");var Xq=Vq;function Kq(t){return pG(t)?Xq(t):Pq(t)}o(Kq,"stringSize");var Zq=Kq,Qq=Math.ceil,Jq=Math.max;function tj(t,e,r,n){for(var i=-1,a=Jq(Qq((e-t)/(r||1)),0),s=Array(a);a--;)s[n?a:++i]=t,t+=r;return s}o(tj,"baseRange");var ej=tj;function rj(t){return function(e,r,n){return n&&"number"!=typeof n&&Xw(e,r,n)&&(r=n=void 0),e=nG(e),void 0===r?(r=e,e=0):r=nG(r),n=void 0===n?e1&&Xw(t,e[0],e[1])?e=[]:r>2&&Xw(e[0],e[1],e[2])&&(e=[e[0]]),Oq(t,pU(e,1),[])})),pj=dj;function gj(t){return t&&t.length?UU(t):[]}o(gj,"uniq");var fj=gj;function mj(t,e){return t&&t.length?UU(t,Pz(e)):[]}o(mj,"uniqBy");var yj=mj,vj=0;function xj(t){var e=++vj;return dz(t)+e}o(xj,"uniqueId");var bj=xj;function wj(t,e,r){for(var n=-1,i=t.length,a=e.length,s={};++n1?n.setNode(t,e):n.setNode(t)})),this}setNode(t,e){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Ej,this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=o((t=>this.removeEdge(this._edgeObjs[t])),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],iF(this.children(t),(t=>{this.setParent(t)})),delete this._children[t]),iF(zB(this._in[t]),e),delete this._in[t],delete this._preds[t],iF(zB(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Vz(e))e=Ej;else{for(var r=e+="";!Vz(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==Ej)return e}}children(t){if(Vz(t)&&(t=Ej),this._isCompound){var e=this._children[t];if(e)return zB(e)}else{if(t===Ej)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return zB(e)}successors(t){var e=this._sucs[t];if(e)return zB(e)}neighbors(t){var e=this.predecessors(t);if(e)return GU(e,this.successors(t))}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;iF(this._nodes,(function(r,n){t(n)&&e.setNode(n,r)})),iF(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))}));var n={};function i(t){var a=r.parent(t);return void 0===a||e.hasNode(a)?(n[t]=a,a):a in n?n[a]:i(a)}return o(i,"findParent"),this._isCompound&&iF(e.nodes(),(function(t){e.setParent(t,i(t))})),e}setDefaultEdgeLabel(t){return dv(t)||(t=Nx(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Yz(this._edgeObjs)}setPath(t,e){var r=this,n=arguments;return _U(t,(function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i})),this}setEdge(){var t,e,r,n,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(t=a.v,e=a.w,r=a.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=a,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,Vz(r)||(r=""+r);var s=Lj(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return i&&(this._edgeLabels[s]=n),this;if(!Vz(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[s]=i?n:this._defaultEdgeLabelFn(t,e,r);var o=Nj(this._isDirected,t,e,r);return t=o.v,e=o.w,Object.freeze(o),this._edgeObjs[s]=o,Sj(this._preds[e],t),Sj(this._sucs[t],e),this._in[e][s]=o,this._out[t][s]=o,this._edgeCount++,this}edge(t,e,r){var n=1===arguments.length?Ij(this._isDirected,arguments[0]):Lj(this._isDirected,t,e,r);return this._edgeLabels[n]}hasEdge(t,e,r){var n=1===arguments.length?Ij(this._isDirected,arguments[0]):Lj(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(t,e,r){var n=1===arguments.length?Ij(this._isDirected,arguments[0]):Lj(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Aj(this._preds[e],t),Aj(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this}inEdges(t,e){var r=this._in[t];if(r){var n=Yz(r);return e?$z(n,(function(t){return t.v===e})):n}}outEdges(t,e){var r=this._out[t];if(r){var n=Yz(r);return e?$z(n,(function(t){return t.w===e})):n}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}; +/*! Bundled license information: + + lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + */function Sj(t,e){t[e]?t[e]++:t[e]=1}function Aj(t,e){--t[e]||delete t[e]}function Lj(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+""+a+""+(Vz(n)?"\0":n)}function Nj(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function Ij(t,e){return Lj(t,e.v,e.w,e.name)}function Rj(t,e,r,n){var i;do{i=bj(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Mj(t){var e=(new Cj).setGraph(t.graph());return iF(t.nodes(),(function(r){e.setNode(r,t.node(r))})),iF(t.edges(),(function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})})),e}function Dj(t){var e=new Cj({multigraph:t.isMultigraph()}).setGraph(t.graph());return iF(t.nodes(),(function(r){t.children(r).length||e.setNode(r,t.node(r))})),iF(t.edges(),(function(r){e.setEdge(r,t.edge(r))})),e}function Oj(t,e){var r,n,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;if(!s&&!o)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),r=c*s/o,n=c):(s<0&&(l=-l),r=l,n=l*o/s),{x:i+r,y:a+n}}function Pj(t){var e=Gz(nj(zj(t)+1),(function(){return[]}));return iF(t.nodes(),(function(r){var n=t.node(r),i=n.rank;Vz(i)||(e[i][n.order]=r)})),e}function Bj(t){var e=wq(Gz(t.nodes(),(function(e){return t.node(e).rank})));iF(t.nodes(),(function(r){var n=t.node(r);aq(n,"rank")&&(n.rank-=e)}))}function $j(t){var e=wq(Gz(t.nodes(),(function(e){return t.node(e).rank}))),r=[];iF(t.nodes(),(function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)}));var n=0,i=t.graph().nodeRankFactor;iF(r,(function(e,r){Vz(e)&&r%i!=0?--n:n&&iF(e,(function(e){t.node(e).rank+=n}))}))}function Fj(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Rj(t,"border",i,e)}function zj(t){return rU(Gz(t.nodes(),(function(e){var r=t.node(e).rank;if(!Vz(r))return r})))}function Uj(t,e){var r={lhs:[],rhs:[]};return iF(t,(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)})),r}function Gj(t,e){var r=_G();try{return e()}finally{console.log(t+" time: "+(_G()-r)+"ms")}}function qj(t,e){return e()}function jj(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&iF(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a0;--o)if(n=e[o].dequeue()){i=i.concat(sW(t,e,r,n,!0));break}}return i}function sW(t,e,r,n,i){var a=i?[]:void 0;return iF(t.inEdges(n.v),(function(n){var s=t.edge(n),o=t.node(n.v);i&&a.push({v:n.v,w:n.w}),o.out-=s,lW(e,r,o)})),iF(t.outEdges(n.v),(function(n){var i=t.edge(n),a=n.w,s=t.node(a);s.in-=i,lW(e,r,s)})),t.removeNode(n.v),a}function oW(t,e){var r=new Cj,n=0,i=0;iF(t.nodes(),(function(t){r.setNode(t,{v:t,in:0,out:0})})),iF(t.edges(),(function(t){var a=r.edge(t.v,t.w)||0,s=e(t),o=a+s;r.setEdge(t.v,t.w,o),i=Math.max(i,r.node(t.v).out+=s),n=Math.max(n,r.node(t.w).in+=s)}));var a=nj(i+n+3).map((function(){return new tW})),s=n+1;return iF(r.nodes(),(function(t){lW(a,s,r.node(t))})),{graph:r,buckets:a,zeroIdx:s}}function lW(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function cW(t){var e="greedy"===t.graph().acyclicer?iW(t,r(t)):hW(t);function r(t){return function(e){return t.edge(e).weight}}iF(e,(function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,bj("rev"))})),o(r,"weightFn")}function hW(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,iF(t.outEdges(a),(function(t){Object.prototype.hasOwnProperty.call(r,t.w)?e.push(t):i(t.w)})),delete r[a])}return o(i,"dfs"),iF(t.nodes(),i),e}function uW(t){iF(t.edges(),(function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}}))}function dW(t){t.graph().dummyChains=[],iF(t.edges(),(function(e){pW(t,e)}))}function pW(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,s=e.name,o=t.edge(e),l=o.labelRank;if(a!==n+1){t.removeEdge(e);var c,h,u=void 0;for(h=0,++n;ns.lim&&(o=s,l=!0);var c=$z(e.edges(),(function(e){return l===$W(t,t.node(e.v),o)&&l!==$W(t,t.node(e.w),o)}));return Tq(c,(function(t){return mW(e,t)}))}function OW(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),IW(t),AW(t,e),PW(t,e)}function PW(t,e){var r=qG(t.nodes(),(function(t){return!e.node(t).parent})),n=CW(t,r);n=n.slice(1),iF(n,(function(r){var n=t.node(r).parent,i=e.edge(r,n),a=!1;i||(i=e.edge(n,r),a=!0),e.node(r).rank=e.node(n).rank+(a?i.minlen:-i.minlen)}))}function BW(t,e,r){return t.hasEdge(e,r)}function $W(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function FW(t){switch(t.graph().ranker){case"network-simplex":default:GW(t);break;case"tight-tree":UW(t);break;case"longest-path":zW(t)}}o(iW,"greedyFAS"),o(aW,"doGreedyFAS"),o(sW,"removeNode"),o(oW,"buildState"),o(lW,"assignBucket"),o(cW,"run"),o(hW,"dfsFAS"),o(uW,"undo"),o(dW,"run"),o(pW,"normalizeEdge"),o(gW,"undo"),o(fW,"longestPath"),o(mW,"slack"),o(yW,"feasibleTree"),o(vW,"tightTree"),o(xW,"findMinSlackEdge"),o(bW,"shiftRanks"),wW.CycleException=kW,o(wW,"topsort"),o(kW,"CycleException"),kW.prototype=new Error,o(TW,"dfs"),o(_W,"doDfs"),o(EW,"postorder"),o(CW,"preorder"),SW.initLowLimValues=IW,SW.initCutValues=AW,SW.calcCutValue=NW,SW.leaveEdge=MW,SW.enterEdge=DW,SW.exchangeEdges=OW,o(SW,"networkSimplex"),o(AW,"initCutValues"),o(LW,"assignCutValue"),o(NW,"calcCutValue"),o(IW,"initLowLimValues"),o(RW,"dfsAssignLowLim"),o(MW,"leaveEdge"),o(DW,"enterEdge"),o(OW,"exchangeEdges"),o(PW,"updateRanks"),o(BW,"isTreeEdge"),o($W,"isDescendant"),o(FW,"rank");var zW=fW;function UW(t){fW(t),yW(t)}function GW(t){SW(t)}function qW(t){var e=Rj(t,"root",{},"_root"),r=WW(t),n=rU(Yz(r))-1,i=2*n+1;t.graph().nestingRoot=e,iF(t.edges(),(function(e){t.edge(e).minlen*=i}));var a=YW(t)+1;iF(t.children(),(function(s){jW(t,e,i,a,n,r,s)})),t.graph().nodeRankFactor=i}function jW(t,e,r,n,i,a,s){var o=t.children(s);if(o.length){var l=Fj(t,"_bt"),c=Fj(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(c,s),h.borderBottom=c,iF(o,(function(o){jW(t,e,r,n,i,a,o);var h=t.node(o),u=h.borderTop?h.borderTop:o,d=h.borderBottom?h.borderBottom:o,p=h.borderTop?n:2*n,g=u!==d?1:i-a[s]+1;t.setEdge(l,u,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,c,{weight:p,minlen:g,nestingEdge:!0})})),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}else s!==e&&t.setEdge(e,s,{weight:0,minlen:r})}function WW(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&iF(a,(function(t){r(t,i+1)})),e[n]=i}return o(r,"dfs"),iF(t.children(),(function(t){r(t,1)})),e}function YW(t){return _U(t.edges(),(function(e,r){return e+t.edge(r).weight}),0)}function HW(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,iF(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}function VW(t,e,r){var n,i={};iF(r,(function(r){for(var a,s,o=t.parent(r);o;){if((a=t.parent(o))?(s=i[a],i[a]=o):(s=n,n=o),s&&s!==o)return void e.setEdge(s,o);o=a}}))}function XW(t,e,r){var n=KW(t),i=new Cj({compound:!0}).setGraph({root:n}).setDefaultNodeLabel((function(e){return t.node(e)}));return iF(t.nodes(),(function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),iF(t[r](a),(function(e){var r=e.v===a?e.w:e.v,n=i.edge(r,a),s=Vz(n)?0:n.weight;i.setEdge(r,a,{weight:t.edge(e).weight+s})})),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),i}function KW(t){for(var e;t.hasNode(e=bj("_root")););return e}function ZW(t,e){for(var r=0,n=1;n0;)e%2&&(r+=o[e+1]),o[e=e-1>>1]+=t.weight;l+=t.weight*r}))),l}function JW(t){var e={},r=$z(t.nodes(),(function(e){return!t.children(e).length})),n=rU(Gz(r,(function(e){return t.node(e).rank}))),i=Gz(nj(n+1),(function(){return[]}));function a(r){if(!aq(e,r)){e[r]=!0;var n=t.node(r);i[n.rank].push(r),iF(t.successors(r),a)}}o(a,"dfs");var s=pj(r,(function(e){return t.node(e).rank}));return iF(s,a),i}function tY(t,e){return Gz(e,(function(e){var r=t.inEdges(e);if(r.length){var n=_U(r,(function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}}),{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}}))}function eY(t,e){var r={};return iF(t,(function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};Vz(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)})),iF(e.edges(),(function(t){var e=r[t.v],n=r[t.w];Vz(e)||Vz(n)||(n.indegree++,e.out.push(r[t.w]))})),rY($z(r,(function(t){return!t.indegree})))}function rY(t){var e=[];function r(t){return function(e){e.merged||(Vz(e.barycenter)||Vz(t.barycenter)||e.barycenter>=t.barycenter)&&nY(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(o(r,"handleIn"),o(n,"handleOut");t.length;){var i=t.pop();e.push(i),iF(i.in.reverse(),r(i)),iF(i.out,n(i))}return Gz($z(e,(function(t){return!t.merged})),(function(t){return vU(t,["vs","i","barycenter","weight"])}))}function nY(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function iY(t,e){var r=Uj(t,(function(t){return Object.prototype.hasOwnProperty.call(t,"barycenter")})),n=r.lhs,i=pj(r.rhs,(function(t){return-t.i})),a=[],s=0,o=0,l=0;n.sort(sY(!!e)),l=aY(a,i,l),iF(n,(function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,o+=t.weight,l=aY(a,i,l)}));var c={vs:fU(a)};return o&&(c.barycenter=s/o,c.weight=o),c}function aY(t,e,r){for(var n;e.length&&(n=K$(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function sY(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function oY(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=$z(i,(function(t){return t!==s&&t!==o})));var c=tY(t,i);iF(c,(function(e){if(t.children(e.v).length){var i=oY(t,e.v,r,n);l[e.v]=i,Object.prototype.hasOwnProperty.call(i,"barycenter")&&cY(e,i)}}));var h=eY(c,r);lY(h,l);var u=iY(h,n);if(s&&(u.vs=fU([s,u.vs,o]),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+d.order+p.order)/(u.weight+2),u.weight+=2}return u}function lY(t,e){iF(t,(function(t){t.vs=fU(t.vs.map((function(t){return e[t]?e[t].vs:t})))}))}function cY(t,e){Vz(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function hY(t){var e=zj(t),r=uY(t,nj(1,e+1),"inEdges"),n=uY(t,nj(e-1,-1,-1),"outEdges"),i=JW(t);pY(t,i);for(var a,s=Number.POSITIVE_INFINITY,o=0,l=0;l<4;++o,++l){dY(o%2?r:n,o%4>=2);var c=ZW(t,i=Pj(t));cl||c>e[i].lim));for(a=i,i=n;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function mY(t){var e={},r=0;function n(i){var a=r;iF(t.children(i),n),e[i]={low:a,lim:r++}}return o(n,"dfs"),iF(t.children(),n),e}function yY(t,e){var r={};function n(e,n){var i=0,a=0,s=e.length,o=K$(n);return iF(n,(function(e,l){var c=xY(t,e),h=c?t.node(c).order:s;(c||e===o)&&(iF(n.slice(a,l+1),(function(e){iF(t.predecessors(e),(function(n){var a=t.node(n),s=a.order;!(ss)&&bY(r,e,o)}))}))}function i(e,r){var i,a=-1,s=0;return iF(r,(function(o,l){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,s,l,a,i),s=l,a=i)}n(r,s,r.length,i,e.length)})),r}return o(n,"scan"),o(i,"visitLayer"),_U(e,i),r}function xY(t,e){if(t.node(e).dummy)return qG(t.predecessors(e),(function(e){return t.node(e).dummy}))}function bY(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function wY(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function kY(t,e,r,n){var i={},a={},s={};return iF(e,(function(t){iF(t,(function(t,e){i[t]=t,a[t]=t,s[t]=e}))})),iF(e,(function(t){var e=-1;iF(t,(function(t){var o=n(t);if(o.length)for(var l=((o=pj(o,(function(t){return s[t]}))).length-1)/2,c=Math.floor(l),h=Math.ceil(l);c<=h;++c){var u=o[c];a[t]===t&&e{var e=r(" buildLayoutGraph",(()=>jY(t)));r(" runLayout",(()=>DY(e,r))),r(" updateInputGraph",(()=>OY(t,e)))}))}function DY(t,e){e(" makeSpaceForEdgeLabels",(()=>WY(t))),e(" removeSelfEdges",(()=>tH(t))),e(" acyclic",(()=>cW(t))),e(" nestingGraph.run",(()=>qW(t))),e(" rank",(()=>FW(Dj(t)))),e(" injectEdgeLabelProxies",(()=>YY(t))),e(" removeEmptyRanks",(()=>$j(t))),e(" nestingGraph.cleanup",(()=>HW(t))),e(" normalizeRanks",(()=>Bj(t))),e(" assignRankMinMax",(()=>HY(t))),e(" removeEdgeLabelProxies",(()=>VY(t))),e(" normalize.run",(()=>dW(t))),e(" parentDummyChains",(()=>gY(t))),e(" addBorderSegments",(()=>jj(t))),e(" order",(()=>hY(t))),e(" insertSelfEdges",(()=>eH(t))),e(" adjustCoordinateSystem",(()=>Yj(t))),e(" position",(()=>IY(t))),e(" positionSelfEdges",(()=>rH(t))),e(" removeBorderNodes",(()=>JY(t))),e(" normalize.undo",(()=>gW(t))),e(" fixupEdgeLabelCoords",(()=>ZY(t))),e(" undoCoordinateSystem",(()=>Hj(t))),e(" translateGraph",(()=>XY(t))),e(" assignNodeIntersects",(()=>KY(t))),e(" reversePoints",(()=>QY(t))),e(" acyclic.undo",(()=>uW(t)))}function OY(t,e){iF(t.nodes(),(function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))})),iF(t.edges(),(function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}o(UW,"tightTreeRanker"),o(GW,"networkSimplexRanker"),o(qW,"run"),o(jW,"dfs"),o(WW,"treeDepths"),o(YW,"sumWeights"),o(HW,"cleanup"),o(VW,"addSubgraphConstraints"),o(XW,"buildLayerGraph"),o(KW,"createRootNode"),o(ZW,"crossCount"),o(QW,"twoLayerCrossCount"),o(JW,"initOrder"),o(tY,"barycenter"),o(eY,"resolveConflicts"),o(rY,"doResolveConflicts"),o(nY,"mergeEntries"),o(iY,"sort"),o(aY,"consumeUnsortable"),o(sY,"compareWithBias"),o(oY,"sortSubgraph"),o(lY,"expandSubgraphs"),o(cY,"mergeBarycenters"),o(hY,"order"),o(uY,"buildLayerGraphs"),o(dY,"sweepLayerGraphs"),o(pY,"assignOrder"),o(gY,"parentDummyChains"),o(fY,"findPath"),o(mY,"postorder"),o(yY,"findType1Conflicts"),o(vY,"findType2Conflicts"),o(xY,"findOtherInnerSegmentNode"),o(bY,"addConflict"),o(wY,"hasConflict"),o(kY,"verticalAlignment"),o(TY,"horizontalCompaction"),o(_Y,"buildBlockGraph"),o(EY,"findSmallestWidthAlignment"),o(CY,"alignCoordinates"),o(SY,"balance"),o(AY,"positionX"),o(LY,"sep"),o(NY,"width"),o(IY,"position"),o(RY,"positionY"),o(MY,"layout"),o(DY,"runLayout"),o(OY,"updateInputGraph");var PY=["nodesep","edgesep","ranksep","marginx","marginy"],BY={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$Y=["acyclicer","ranker","rankdir","align"],FY=["width","height"],zY={width:0,height:0},UY=["minlen","weight","width","height","labeloffset"],GY={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},qY=["labelpos"];function jY(t){var e=new Cj({multigraph:!0,compound:!0}),r=iH(t.graph());return e.setGraph(Jw({},BY,nH(r,PY),vU(r,$Y))),iF(t.nodes(),(function(r){var n=iH(t.node(r));e.setNode(r,V$(nH(n,FY),zY)),e.setParent(r,t.parent(r))})),iF(t.edges(),(function(r){var n=iH(t.edge(r));e.setEdge(r,Jw({},GY,nH(n,UY),vU(n,qY)))})),e}function WY(t){var e=t.graph();e.ranksep/=2,iF(t.edges(),(function(r){var n=t.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}function YY(t){iF(t.edges(),(function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Rj(t,"edge-proxy",i,"_ep")}}))}function HY(t){var e=0;iF(t.nodes(),(function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=rU(e,n.maxRank))})),t.graph().maxRank=e}function VY(t){iF(t.nodes(),(function(e){var r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))}))}function XY(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,l=a.marginy||0;function c(t){var a=t.x,s=t.y,o=t.width,l=t.height;e=Math.min(e,a-o/2),r=Math.max(r,a+o/2),n=Math.min(n,s-l/2),i=Math.max(i,s+l/2)}o(c,"getExtremes"),iF(t.nodes(),(function(e){c(t.node(e))})),iF(t.edges(),(function(e){var r=t.edge(e);Object.prototype.hasOwnProperty.call(r,"x")&&c(r)})),e-=s,n-=l,iF(t.nodes(),(function(r){var i=t.node(r);i.x-=e,i.y-=n})),iF(t.edges(),(function(r){var i=t.edge(r);iF(i.points,(function(t){t.x-=e,t.y-=n})),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=e),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=n)})),a.width=r-e+s,a.height=i-n+l}function KY(t){iF(t.edges(),(function(e){var r,n,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=a),i.points.unshift(Oj(a,r)),i.points.push(Oj(s,n))}))}function ZY(t){iF(t.edges(),(function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}function QY(t){iF(t.edges(),(function(e){var r=t.edge(e);r.reversed&&r.points.reverse()}))}function JY(t){iF(t.nodes(),(function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(K$(r.borderLeft)),s=t.node(K$(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}})),iF(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}function tH(t){iF(t.edges(),(function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}function eH(t){var e=Pj(t);iF(e,(function(e){var r=0;iF(e,(function(e,n){var i=t.node(e);i.order=n+r,iF(i.selfEdges,(function(e){Rj(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:n+ ++r,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}function rH(t){iF(t.nodes(),(function(e){var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}}))}function nH(t,e){return Kz(vU(t,e),Number)}function iH(t){var e={};return iF(t,(function(t,r){e[r.toLowerCase()]=t})),e}function aH(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:sH(t),edges:oH(t)};return Vz(t.graph())||(e.value=j$(t.graph())),e}function sH(t){return Gz(t.nodes(),(function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Vz(r)||(i.value=r),Vz(n)||(i.parent=n),i}))}function oH(t){return Gz(t.edges(),(function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Vz(e.name)||(n.name=e.name),Vz(r)||(n.value=r),n}))}o(jY,"buildLayoutGraph"),o(WY,"makeSpaceForEdgeLabels"),o(YY,"injectEdgeLabelProxies"),o(HY,"assignRankMinMax"),o(VY,"removeEdgeLabelProxies"),o(XY,"translateGraph"),o(KY,"assignNodeIntersects"),o(ZY,"fixupEdgeLabelCoords"),o(QY,"reversePointsForReversedEdges"),o(JY,"removeBorderNodes"),o(tH,"removeSelfEdges"),o(eH,"insertSelfEdges"),o(rH,"positionSelfEdges"),o(nH,"selectNumberAttrs"),o(iH,"canonicalize"),o(aH,"write"),o(sH,"writeNodes"),o(oH,"writeEdges");var lH=new Map,cH=new Map,hH=new Map,uH=o((()=>{cH.clear(),hH.clear(),lH.clear()}),"clear"),dH=o(((t,e)=>{const r=cH.get(e)||[];return y.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)}),"isDescendant"),pH=o(((t,e)=>{const r=cH.get(e)||[];return y.info("Descendants of ",e," is ",r),y.info("Edge is ",t),t.v!==e&&t.w!==e&&(r?r.includes(t.v)||dH(t.v,e)||dH(t.w,e)||r.includes(t.w):(y.debug("Tilt, ",e,",not in descendants"),!1))}),"edgeInCluster"),gH=o(((t,e,r,n)=>{y.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),y.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach((i=>{if(e.children(i).length>0)gH(i,e,r,n);else{const a=e.node(i);y.info("cp ",i," to ",n," with parent ",t),r.setNode(i,a),n!==e.parent(i)&&(y.warn("Setting parent",i,e.parent(i)),r.setParent(i,e.parent(i))),t!==n&&i!==t?(y.debug("Setting parent",i,t),r.setParent(i,t)):(y.info("In copy ",t,"root",n,"data",e.node(t),n),y.debug("Not Setting parent for node=",i,"cluster!==rootId",t!==n,"node!==clusterId",i!==t));const s=e.edges(i);y.debug("Copying Edges",s),s.forEach((i=>{y.info("Edge",i);const a=e.edge(i.v,i.w,i.name);y.info("Edge data",a,n);try{pH(i,n)?(y.info("Copying as ",i.v,i.w,a,i.name),r.setEdge(i.v,i.w,a,i.name),y.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):y.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",n," clusterId:",t)}catch(t){y.error(t)}}))}y.debug("Removing node",i),e.removeNode(i)}))}),"copy"),fH=o(((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)hH.set(i,t),n=[...n,...fH(i,e)];return n}),"extractDescendants"),mH=o(((t,e,r)=>{const n=t.edges().filter((t=>t.v===e||t.w===e)),i=t.edges().filter((t=>t.v===r||t.w===r)),a=n.map((t=>({v:t.v===e?r:t.v,w:t.w===e?e:t.w}))),s=i.map((t=>({v:t.v,w:t.w})));return a.filter((t=>s.some((e=>t.v===e.v&&t.w===e.w))))}),"findCommonEdges"),yH=o(((t,e,r)=>{const n=e.children(t);if(y.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const t of n){const n=yH(t,e,r),a=mH(e,r,n);if(n){if(!(a.length>0))return n;i=n}}return i}),"findNonClusterChild"),vH=o((t=>lH.has(t)&&lH.get(t).externalConnections&&lH.has(t)?lH.get(t).id:t),"getAnchorId"),xH=o(((t,e)=>{if(!t||e>10)y.debug("Opting out, no graph ");else{y.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(y.warn("Cluster identified",e," Replacement id in edges: ",yH(e,t,e)),cH.set(e,fH(e,t)),lH.set(e,{id:yH(e,t,e),clusterData:t.node(e)}))})),t.nodes().forEach((function(e){const r=t.children(e),n=t.edges();r.length>0?(y.debug("Cluster identified",e,cH),n.forEach((t=>{dH(t.v,e)^dH(t.w,e)&&(y.warn("Edge: ",t," leaves cluster ",e),y.warn("Descendants of XXX ",e,": ",cH.get(e)),lH.get(e).externalConnections=!0)}))):y.debug("Not a cluster ",e,cH)}));for(let e of lH.keys()){const r=lH.get(e).id,n=t.parent(r);n!==e&&lH.has(n)&&!lH.get(n).externalConnections&&(lH.get(e).id=n)}t.edges().forEach((function(e){const r=t.edge(e);y.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),y.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let n=e.v,i=e.w;if(y.warn("Fix XXX",lH,"ids:",e.v,e.w,"Translating: ",lH.get(e.v)," --- ",lH.get(e.w)),lH.get(e.v)||lH.get(e.w)){if(y.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),n=vH(e.v),i=vH(e.w),t.removeEdge(e.v,e.w,e.name),n!==e.v){const i=t.parent(n);lH.get(i).externalConnections=!0,r.fromCluster=e.v}if(i!==e.w){const n=t.parent(i);lH.get(n).externalConnections=!0,r.toCluster=e.w}y.warn("Fix Replacing with XXX",n,i,e.name),t.setEdge(n,i,r,e.name)}})),y.warn("Adjusted Graph",aH(t)),bH(t,0),y.trace(lH)}}),"adjustClustersAndEdges"),bH=o(((t,e)=>{if(y.warn("extractor - ",e,aH(t),t.children("D")),e>10)return void y.error("Bailing out");let r=t.nodes(),n=!1;for(const e of r){const r=t.children(e);n=n||r.length>0}if(n){y.debug("Nodes = ",r,e);for(const n of r)if(y.debug("Extracting node",n,lH,lH.has(n)&&!lH.get(n).externalConnections,!t.parent(n),t.node(n),t.children("D")," Depth ",e),lH.has(n))if(!lH.get(n).externalConnections&&t.children(n)&&t.children(n).length>0){y.warn("Cluster without external connections, without a parent and with children",n,e);let r="TB"===t.graph().rankdir?"LR":"TB";lH.get(n)?.clusterData?.dir&&(r=lH.get(n).clusterData.dir,y.warn("Fixing dir",lH.get(n).clusterData.dir,r));const i=new Cj({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));y.warn("Old graph before copy",aH(t)),gH(n,t,i,n),t.setNode(n,{clusterNode:!0,id:n,clusterData:lH.get(n).clusterData,label:lH.get(n).label,graph:i}),y.warn("New graph after copy node: (",n,")",aH(i)),y.debug("Old graph after copy",aH(t))}else y.warn("Cluster ** ",n," **not meeting the criteria !externalConnections:",!lH.get(n).externalConnections," no parent: ",!t.parent(n)," children ",t.children(n)&&t.children(n).length>0,t.children("D"),e),y.debug(lH);else y.debug("Not a cluster",n,e);r=t.nodes(),y.warn("New list of nodes",r);for(const n of r){const r=t.node(n);y.warn(" Now next level",n,r),r?.clusterNode&&bH(r.graph,e+1)}}else y.debug("Done, no node has children",t.nodes())}),"extractor"),wH=o(((t,e)=>{if(0===e.length)return[];let r=Object.assign([],e);return e.forEach((e=>{const n=t.children(e),i=wH(t,n);r=[...r,...i]})),r}),"sorter"),kH=o((t=>wH(t,t.children())),"sortNodesByHierarchy"),TH=o((async(t,e,r,n,i,a)=>{y.warn("Graph in recursive render:XAX",aH(e),i);const s=e.graph().rankdir;y.trace("Dir in recursive render - dir:",s);const l=t.insert("g").attr("class","root");e.nodes()?y.info("Recursive render XXX",e.nodes()):y.info("No nodes found for",e),e.edges().length>0&&y.info("Recursive edges",e.edge(e.edges()[0]));const c=l.insert("g").attr("class","clusters"),h=l.insert("g").attr("class","edgePaths"),u=l.insert("g").attr("class","edgeLabels"),d=l.insert("g").attr("class","nodes");await Promise.all(e.nodes().map((async function(t){const o=e.node(t);if(void 0!==i){const r=JSON.parse(JSON.stringify(i.clusterData));y.trace("Setting data for parent cluster XXX\n Node.id = ",t,"\n data=",r.height,"\nParent cluster",i.height),e.setNode(i.id,r),e.parent(t)||(y.trace("Setting parent",t,i.id),e.setParent(t,i.id,r))}if(y.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),o?.clusterNode){y.info("Cluster identified XBX",t,o.width,e.node(t));const{ranksep:i,nodesep:s}=e.graph();o.graph.setGraph({...o.graph.graph(),ranksep:i+25,nodesep:s});const l=await TH(d,o.graph,r,n,e.node(t),a),c=l.elem;w_(o,c),o.diff=l.diff||0,y.info("New compound node after recursive render XAX",t,"width",o.width,"height",o.height),qS(c,o)}else e.children(t).length>0?(y.trace("Cluster - the non recursive path XBX",t,o.id,o,o.width,"Graph:",e),y.trace(yH(o.id,e)),lH.set(o.id,{id:yH(o.id,e),node:o})):(y.trace("Node - the non recursive path XAX",t,d,e.node(t),s),await GS(d,e.node(t),{config:a,dir:s}))})));const p=o((async()=>{const t=e.edges().map((async function(t){const r=e.edge(t.v,t.w,t.name);y.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),y.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),y.info("Fix",lH,"ids:",t.v,t.w,"Translating: ",lH.get(t.v),lH.get(t.w)),await nA(u,r)}));await Promise.all(t)}),"processEdges");await p(),y.info("Graph before layout:",JSON.stringify(aH(e))),y.info("############################################# XXX"),y.info("### Layout ### XXX"),y.info("############################################# XXX"),MY(e),y.info("Graph after layout:",JSON.stringify(aH(e)));let g=0,{subGraphTitleTotalMargin:f}=qy(a);return await Promise.all(kH(e).map((async function(t){const r=e.node(t);if(y.info("Position XBX => "+t+": ("+r.x,","+r.y,") width: ",r.width," height: ",r.height),r?.clusterNode)r.y+=f,y.info("A tainted cluster node XBX1",t,r.id,r.width,r.height,r.x,r.y,e.parent(t)),lH.get(r.id).node=r,WS(r);else if(e.children(t).length>0){y.info("A pure cluster node XBX1",t,r.id,r.x,r.y,r.width,r.height,e.parent(t)),r.height+=f,e.node(r.parentId);const n=r?.padding/2||0,i=r?.labelBBox?.height||0,a=i-n||0;y.debug("OffsetY",a,"labelHeight",i,"halfPadding",n),await XE(c,r),lH.get(r.id).node=r}else{const t=e.node(r.parentId);r.y+=f/2,y.info("A regular node XBX1 - using the padding",r.id,"parent",r.parentId,r.width,r.height,r.x,r.y,"offsetY",r.offsetY,"parent",t,t?.offsetY,r),WS(r)}}))),e.edges().forEach((function(t){const i=e.edge(t);y.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(i),i),i.points.forEach((t=>t.y+=f/2));const a=e.node(t.v);var s=e.node(t.w);const o=dA(h,i,lH,r,a,s,n);aA(i,o)})),e.nodes().forEach((function(t){const r=e.node(t);y.info(t,r.type,r.diff),r.isGroup&&(g=r.diff)})),y.warn("Returning from recursive render XAX",l,g),{elem:l,diff:g}}),"recursiveRender"),_H=o((async(t,e)=>{const r=new Cj({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.config?.flowchart?.nodeSpacing||t.nodeSpacing,ranksep:t.config?.rankSpacing||t.config?.flowchart?.rankSpacing||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),n=e.select("g");NA(n,t.markers,t.type,t.diagramId),jS(),eA(),KE(),uH(),t.nodes.forEach((t=>{r.setNode(t.id,{...t}),t.parentId&&r.setParent(t.id,t.parentId)})),y.debug("Edges:",t.edges),t.edges.forEach((t=>{if(t.start===t.end){const e=t.start,n=e+"---"+e+"---1",i=e+"---"+e+"---2",a=r.node(e);r.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(n,a.parentId),r.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(i,a.parentId);const s=structuredClone(t),o=structuredClone(t),l=structuredClone(t);s.label="",s.arrowTypeEnd="none",s.id=e+"-cyclic-special-1",o.arrowTypeStart="none",o.arrowTypeEnd="none",o.id=e+"-cyclic-special-mid",l.label="",a.isGroup&&(s.fromCluster=e,l.toCluster=e),l.id=e+"-cyclic-special-2",l.arrowTypeStart="none",r.setEdge(e,n,s,e+"-cyclic-special-0"),r.setEdge(n,i,o,e+"-cyclic-special-1"),r.setEdge(i,e,l,e+"-cyc{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)r.attr(t,e.attrs[t]);return e.class&&r.attr("class",e.class),r}),"drawRect"),AH=o(((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};SH(t,r).lower()}),"drawBackgroundRect"),LH=o(((t,e)=>{const r=e.text.replace(ir," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(r),n}),"drawText"),NH=o(((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=(0,CH.sanitizeUrl)(n);i.attr("xlink:href",a)}),"drawImage"),IH=o(((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=(0,CH.sanitizeUrl)(n);i.attr("xlink:href",`#${a}`)}),"drawEmbeddedImage"),RH=o((()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0})),"getNoteRect"),MH=o((()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0})),"getTextObj"),DH=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],l=[1,64],h=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],f=[1,29],m=[1,30],y=[1,31],v=[1,32],x=[1,33],b=[1,34],w=[1,35],k=[1,36],T=[1,37],_=[1,38],E=[1,39],C=[1,40],S=[1,41],A=[1,42],L=[1,43],N=[1,44],I=[1,45],R=[1,46],M=[1,47],D=[1,48],O=[1,50],P=[1,51],B=[1,52],$=[1,53],F=[1,54],z=[1,55],U=[1,56],G=[1,57],q=[1,58],j=[1,59],W=[1,60],Y=[14,42],H=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],V=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],X=[1,82],K=[1,83],Z=[1,84],Q=[1,85],J=[12,14,42],tt=[12,14,33,42],et=[12,14,33,42,76,77,79,80],rt=[12,33],nt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],it={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 3:n.setDirection("TB");break;case 4:n.setDirection("BT");break;case 5:n.setDirection("RL");break;case 6:n.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:n.setC4Type(a[o-3]);break;case 19:n.setTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 20:n.setAccDescription(a[o].substring(15)),this.$=a[o].substring(15);break;case 21:this.$=a[o].trim(),n.setTitle(this.$);break;case 22:case 23:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 28:a[o].splice(2,0,"ENTERPRISE"),n.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 29:a[o].splice(2,0,"SYSTEM"),n.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 30:n.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 31:a[o].splice(2,0,"CONTAINER"),n.addContainerBoundary(...a[o]),this.$=a[o];break;case 32:n.addDeploymentNode("node",...a[o]),this.$=a[o];break;case 33:n.addDeploymentNode("nodeL",...a[o]),this.$=a[o];break;case 34:n.addDeploymentNode("nodeR",...a[o]),this.$=a[o];break;case 35:n.popBoundaryParseStack();break;case 39:n.addPersonOrSystem("person",...a[o]),this.$=a[o];break;case 40:n.addPersonOrSystem("external_person",...a[o]),this.$=a[o];break;case 41:n.addPersonOrSystem("system",...a[o]),this.$=a[o];break;case 42:n.addPersonOrSystem("system_db",...a[o]),this.$=a[o];break;case 43:n.addPersonOrSystem("system_queue",...a[o]),this.$=a[o];break;case 44:n.addPersonOrSystem("external_system",...a[o]),this.$=a[o];break;case 45:n.addPersonOrSystem("external_system_db",...a[o]),this.$=a[o];break;case 46:n.addPersonOrSystem("external_system_queue",...a[o]),this.$=a[o];break;case 47:n.addContainer("container",...a[o]),this.$=a[o];break;case 48:n.addContainer("container_db",...a[o]),this.$=a[o];break;case 49:n.addContainer("container_queue",...a[o]),this.$=a[o];break;case 50:n.addContainer("external_container",...a[o]),this.$=a[o];break;case 51:n.addContainer("external_container_db",...a[o]),this.$=a[o];break;case 52:n.addContainer("external_container_queue",...a[o]),this.$=a[o];break;case 53:n.addComponent("component",...a[o]),this.$=a[o];break;case 54:n.addComponent("component_db",...a[o]),this.$=a[o];break;case 55:n.addComponent("component_queue",...a[o]),this.$=a[o];break;case 56:n.addComponent("external_component",...a[o]),this.$=a[o];break;case 57:n.addComponent("external_component_db",...a[o]),this.$=a[o];break;case 58:n.addComponent("external_component_queue",...a[o]),this.$=a[o];break;case 60:n.addRel("rel",...a[o]),this.$=a[o];break;case 61:n.addRel("birel",...a[o]),this.$=a[o];break;case 62:n.addRel("rel_u",...a[o]),this.$=a[o];break;case 63:n.addRel("rel_d",...a[o]),this.$=a[o];break;case 64:n.addRel("rel_l",...a[o]),this.$=a[o];break;case 65:n.addRel("rel_r",...a[o]),this.$=a[o];break;case 66:n.addRel("rel_b",...a[o]),this.$=a[o];break;case 67:a[o].splice(0,1),n.addRel("rel",...a[o]),this.$=a[o];break;case 68:n.updateElStyle("update_el_style",...a[o]),this.$=a[o];break;case 69:n.updateRelStyle("update_rel_style",...a[o]),this.$=a[o];break;case 70:n.updateLayoutConfig("update_layout_config",...a[o]),this.$=a[o];break;case 71:this.$=[a[o]];break;case 72:a[o].unshift(a[o-1]),this.$=a[o];break;case 73:case 75:this.$=a[o].trim();break;case 74:let t={};t[a[o-1].trim()]=a[o].trim(),this.$=t;break;case 76:this.$=""}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{14:[1,74]},t(Y,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:h,38:u,39:d,40:p,41:g,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W}),t(Y,[2,14]),t(H,[2,16],{12:[1,76]}),t(Y,[2,36],{12:[1,77]}),t(V,[2,19]),t(V,[2,20]),{25:[1,78]},{27:[1,79]},t(V,[2,23]),{35:80,75:81,76:X,77:K,79:Z,80:Q},{35:86,75:81,76:X,77:K,79:Z,80:Q},{35:87,75:81,76:X,77:K,79:Z,80:Q},{35:88,75:81,76:X,77:K,79:Z,80:Q},{35:89,75:81,76:X,77:K,79:Z,80:Q},{35:90,75:81,76:X,77:K,79:Z,80:Q},{35:91,75:81,76:X,77:K,79:Z,80:Q},{35:92,75:81,76:X,77:K,79:Z,80:Q},{35:93,75:81,76:X,77:K,79:Z,80:Q},{35:94,75:81,76:X,77:K,79:Z,80:Q},{35:95,75:81,76:X,77:K,79:Z,80:Q},{35:96,75:81,76:X,77:K,79:Z,80:Q},{35:97,75:81,76:X,77:K,79:Z,80:Q},{35:98,75:81,76:X,77:K,79:Z,80:Q},{35:99,75:81,76:X,77:K,79:Z,80:Q},{35:100,75:81,76:X,77:K,79:Z,80:Q},{35:101,75:81,76:X,77:K,79:Z,80:Q},{35:102,75:81,76:X,77:K,79:Z,80:Q},{35:103,75:81,76:X,77:K,79:Z,80:Q},{35:104,75:81,76:X,77:K,79:Z,80:Q},t(J,[2,59]),{35:105,75:81,76:X,77:K,79:Z,80:Q},{35:106,75:81,76:X,77:K,79:Z,80:Q},{35:107,75:81,76:X,77:K,79:Z,80:Q},{35:108,75:81,76:X,77:K,79:Z,80:Q},{35:109,75:81,76:X,77:K,79:Z,80:Q},{35:110,75:81,76:X,77:K,79:Z,80:Q},{35:111,75:81,76:X,77:K,79:Z,80:Q},{35:112,75:81,76:X,77:K,79:Z,80:Q},{35:113,75:81,76:X,77:K,79:Z,80:Q},{35:114,75:81,76:X,77:K,79:Z,80:Q},{35:115,75:81,76:X,77:K,79:Z,80:Q},{20:116,29:49,30:61,32:62,34:s,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{12:[1,118],33:[1,117]},{35:119,75:81,76:X,77:K,79:Z,80:Q},{35:120,75:81,76:X,77:K,79:Z,80:Q},{35:121,75:81,76:X,77:K,79:Z,80:Q},{35:122,75:81,76:X,77:K,79:Z,80:Q},{35:123,75:81,76:X,77:K,79:Z,80:Q},{35:124,75:81,76:X,77:K,79:Z,80:Q},{35:125,75:81,76:X,77:K,79:Z,80:Q},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(Y,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(Y,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:l,37:h,38:u,39:d,40:p,41:g,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W}),t(V,[2,21]),t(V,[2,22]),t(J,[2,39]),t(tt,[2,71],{75:81,35:132,76:X,77:K,79:Z,80:Q}),t(et,[2,73]),{78:[1,133]},t(et,[2,75]),t(et,[2,76]),t(J,[2,40]),t(J,[2,41]),t(J,[2,42]),t(J,[2,43]),t(J,[2,44]),t(J,[2,45]),t(J,[2,46]),t(J,[2,47]),t(J,[2,48]),t(J,[2,49]),t(J,[2,50]),t(J,[2,51]),t(J,[2,52]),t(J,[2,53]),t(J,[2,54]),t(J,[2,55]),t(J,[2,56]),t(J,[2,57]),t(J,[2,58]),t(J,[2,60]),t(J,[2,61]),t(J,[2,62]),t(J,[2,63]),t(J,[2,64]),t(J,[2,65]),t(J,[2,66]),t(J,[2,67]),t(J,[2,68]),t(J,[2,69]),t(J,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(rt,[2,28]),t(rt,[2,29]),t(rt,[2,30]),t(rt,[2,31]),t(rt,[2,32]),t(rt,[2,33]),t(rt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(Y,[2,38]),t(tt,[2,72]),t(et,[2,74]),t(J,[2,24]),t(J,[2,35]),t(nt,[2,25]),t(nt,[2,26],{12:[1,138]}),t(nt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},at=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 73:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 16:case 70:break;case 14:c;break;case 15:return 12;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:case 53:return this.begin("rel_u"),66;case 54:case 55:return this.begin("rel_d"),67;case 56:case 57:return this.begin("rel_l"),68;case 58:case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:case 79:this.popState(),this.popState();break;case 69:case 71:return 80;case 72:this.begin("string");break;case 74:case 80:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}}),"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return t}();function st(){this.yy={}}return it.lexer=at,o(st,"Parser"),st.prototype=it,it.Parser=st,new st}();DH.parser=DH;var OH,PH=DH,BH=[],$H=[""],FH="global",zH="",UH=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],GH=[],qH="",jH=!1,WH=4,YH=2,HH=o((function(){return OH}),"getC4Type"),VH=o((function(t){let e=hr(t,Qr());OH=e}),"setC4Type"),XH=o((function(t,e,r,n,i,a,s,o,l){if(null==t||null==e||null==r||null==n)return;let c={};const h=GH.find((t=>t.from===e&&t.to===r));if(h?c=h:GH.push(c),c.type=t,c.from=e,c.to=r,c.label={text:n},null==i)c.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];c[t]={text:e}}else c.techn={text:i};if(null==a)c.descr={text:""};else if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]={text:e}}else c.descr={text:a};if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]=e}else c.sprite=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.tags=o;if("object"==typeof l){let[t,e]=Object.entries(l)[0];c[t]=e}else c.link=l;c.wrap=vV()}),"addRel"),KH=o((function(t,e,r,n,i,a,s){if(null===e||null===r)return;let o={};const l=BH.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,BH.push(o)),o.label=null==r?{text:""}:{text:r},null==n)o.descr={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]={text:e}}else o.descr={text:n};if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.sprite=i;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.tags=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=FH,o.wrap=vV()}),"addPersonOrSystem"),ZH=o((function(t,e,r,n,i,a,s,o){if(null===e||null===r)return;let l={};const c=BH.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,BH.push(l)),l.label=null==r?{text:""}:{text:r},null==n)l.techn={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.techn={text:n};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=vV(),l.typeC4Shape={text:t},l.parentBoundary=FH}),"addContainer"),QH=o((function(t,e,r,n,i,a,s,o){if(null===e||null===r)return;let l={};const c=BH.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,BH.push(l)),l.label=null==r?{text:""}:{text:r},null==n)l.techn={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.techn={text:n};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=vV(),l.typeC4Shape={text:t},l.parentBoundary=FH}),"addComponent"),JH=o((function(t,e,r,n,i){if(null===t||null===e)return;let a={};const s=UH.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,UH.push(a)),a.label=null==e?{text:""}:{text:e},null==r)a.type={text:"system"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]={text:e}}else a.type={text:r};if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]=e}else a.tags=n;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=FH,a.wrap=vV(),zH=FH,FH=t,$H.push(zH)}),"addPersonOrSystemBoundary"),tV=o((function(t,e,r,n,i){if(null===t||null===e)return;let a={};const s=UH.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,UH.push(a)),a.label=null==e?{text:""}:{text:e},null==r)a.type={text:"container"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]={text:e}}else a.type={text:r};if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]=e}else a.tags=n;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=FH,a.wrap=vV(),zH=FH,FH=t,$H.push(zH)}),"addContainerBoundary"),eV=o((function(t,e,r,n,i,a,s,o){if(null===e||null===r)return;let l={};const c=UH.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,UH.push(l)),l.label=null==r?{text:""}:{text:r},null==n)l.type={text:"node"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.type={text:n};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.nodeType=t,l.parentBoundary=FH,l.wrap=vV(),zH=FH,FH=e,$H.push(zH)}),"addDeploymentNode"),rV=o((function(){FH=zH,$H.pop(),zH=$H.pop(),$H.push(zH)}),"popBoundaryParseStack"),nV=o((function(t,e,r,n,i,a,s,o,l,c,h){let u=BH.find((t=>t.alias===e));if(void 0!==u||(u=UH.find((t=>t.alias===e)),void 0!==u)){if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];u[t]=e}else u.bgColor=r;if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];u[t]=e}else u.fontColor=n;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];u[t]=e}else u.borderColor=i;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];u[t]=e}else u.shadowing=a;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];u[t]=e}else u.shape=s;if(null!=o)if("object"==typeof o){let[t,e]=Object.entries(o)[0];u[t]=e}else u.sprite=o;if(null!=l)if("object"==typeof l){let[t,e]=Object.entries(l)[0];u[t]=e}else u.techn=l;if(null!=c)if("object"==typeof c){let[t,e]=Object.entries(c)[0];u[t]=e}else u.legendText=c;if(null!=h)if("object"==typeof h){let[t,e]=Object.entries(h)[0];u[t]=e}else u.legendSprite=h}}),"updateElStyle"),iV=o((function(t,e,r,n,i,a,s){const o=GH.find((t=>t.from===e&&t.to===r));if(void 0!==o){if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]=e}else o.textColor=n;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.lineColor=i;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(a);if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(s)}}),"updateRelStyle"),aV=o((function(t,e,r){let n=WH,i=YH;if("object"==typeof e){const t=Object.values(e)[0];n=parseInt(t)}else n=parseInt(e);if("object"==typeof r){const t=Object.values(r)[0];i=parseInt(t)}else i=parseInt(r);n>=1&&(WH=n),i>=1&&(YH=i)}),"updateLayoutConfig"),sV=o((function(){return WH}),"getC4ShapeInRow"),oV=o((function(){return YH}),"getC4BoundaryInRow"),lV=o((function(){return FH}),"getCurrentBoundaryParse"),cV=o((function(){return zH}),"getParentBoundaryParse"),hV=o((function(t){return null==t?BH:BH.filter((e=>e.parentBoundary===t))}),"getC4ShapeArray"),uV=o((function(t){return BH.find((e=>e.alias===t))}),"getC4Shape"),dV=o((function(t){return Object.keys(hV(t))}),"getC4ShapeKeys"),pV=o((function(t){return null==t?UH:UH.filter((e=>e.parentBoundary===t))}),"getBoundaries"),gV=pV,fV=o((function(){return GH}),"getRels"),mV=o((function(){return qH}),"getTitle"),yV=o((function(t){jH=t}),"setWrap"),vV=o((function(){return jH}),"autoWrap"),xV=o((function(){BH=[],UH=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],zH="",FH="global",$H=[""],GH=[],$H=[""],qH="",jH=!1,WH=4,YH=2}),"clear"),bV=o((function(t){let e=hr(t,Qr());qH=e}),"setTitle"),wV={addPersonOrSystem:KH,addPersonOrSystemBoundary:JH,addContainer:ZH,addContainerBoundary:tV,addComponent:QH,addDeploymentNode:eV,popBoundaryParseStack:rV,addRel:XH,updateElStyle:nV,updateRelStyle:iV,updateLayoutConfig:aV,autoWrap:vV,setWrap:yV,getC4ShapeArray:hV,getC4Shape:uV,getC4ShapeKeys:dV,getBoundaries:pV,getBoundarys:gV,getCurrentBoundaryParse:lV,getParentBoundaryParse:cV,getRels:fV,getTitle:mV,getC4Type:HH,getC4ShapeInRow:sV,getC4BoundaryInRow:oV,setAccTitle:jr,getAccTitle:Wr,getAccDescription:Hr,setAccDescription:Yr,getConfig:o((()=>Qr().c4),"getConfig"),clear:xV,LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:bV,setC4Type:VH},kV=p(Wy(),1),TV=o((function(t,e){return SH(t,e)}),"drawRect"),_V=o((function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:(0,kV.sanitizeUrl)(a);s.attr("xlink:href",o)}),"drawImage"),EV=o(((t,e,r)=>{const n=t.append("g");let i=0;for(let t of e){let e=t.textColor?t.textColor:"#444444",a=t.lineColor?t.lineColor:"#444444",s=t.offsetX?parseInt(t.offsetX):0,o=t.offsetY?parseInt(t.offsetY):0,l="";if(0===i){let e=n.append("line");e.attr("x1",t.startPoint.x),e.attr("y1",t.startPoint.y),e.attr("x2",t.endPoint.x),e.attr("y2",t.endPoint.y),e.attr("stroke-width","1"),e.attr("stroke",a),e.style("fill","none"),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)"),i=-1}else{let e=n.append("path");e.attr("fill","none").attr("stroke-width","1").attr("stroke",a).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",t.startPoint.x).replaceAll("starty",t.startPoint.y).replaceAll("controlx",t.startPoint.x+(t.endPoint.x-t.startPoint.x)/2-(t.endPoint.x-t.startPoint.x)/4).replaceAll("controly",t.startPoint.y+(t.endPoint.y-t.startPoint.y)/2).replaceAll("stopx",t.endPoint.x).replaceAll("stopy",t.endPoint.y)),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)")}let c=r.messageFont();BV(r)(t.label.text,n,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+o,t.label.width,t.label.height,{fill:e},c),t.techn&&""!==t.techn.text&&(c=r.messageFont(),BV(r)("["+t.techn.text+"]",n,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+r.messageFontSize+5+o,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:e,"font-style":"italic"},c))}}),"drawRels"),CV=o((function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};TV(n,l);let c=r.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=s,BV(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},c),e.type&&""!==e.type.text&&(c=r.boundaryFont(),c.fontColor=s,BV(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},c)),e.descr&&""!==e.descr.text&&(c=r.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=s,BV(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},c))}),"drawBoundary"),SV=o((function(t,e,r){let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="}const o=t.append("g");o.attr("class","person-man");const l=RH();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},TV(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2))}let c=PV(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",c.fontFamily).attr("font-size",c.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":_V(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s)}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,BV(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&""!==e.techn?.text?BV(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&""!==e.type.text&&BV(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&""!==e.descr.text&&(h=r.personFont(),h.fontColor=a,BV(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height}),"drawC4Shape"),AV=o((function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")}),"insertDatabaseIcon"),LV=o((function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")}),"insertComputerIcon"),NV=o((function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")}),"insertClockIcon"),IV=o((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")}),"insertArrowHead"),RV=o((function(t){t.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")}),"insertArrowEnd"),MV=o((function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"insertArrowFilledHead"),DV=o((function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)}),"insertDynamicNumber"),OV=o((function(t){const e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),e.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")}),"insertArrowCrossHead"),PV=o(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"getC4ShapeFont"),BV=function(){function t(t,e,r,i,a,s,o){n(e.append("text").attr("x",r+a/2).attr("y",i+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,r,i,a,s,o,l){const{fontSize:c,fontFamily:h,fontWeight:u}=l,d=t.split(Lr.lineBreakRegex);for(let t=0;t=this.data.widthLimit||r>=this.data.widthLimit||this.nextData.cnt>UV)&&(e=this.nextData.startx+t.margin+qV.nextLinePaddingX,n=this.nextData.stopy+2*t.margin,this.nextData.stopx=r=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=n+t.height,this.nextData.cnt=1),t.x=e,t.y=n,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",n,Math.min),this.updateVal(this.data,"stopx",r,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",n,Math.min),this.updateVal(this.nextData,"stopx",r,Math.max),this.updateVal(this.nextData,"stopy",i,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},WV(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},WV=o((function(t){N(qV,t),t.fontFamily&&(qV.personFontFamily=qV.systemFontFamily=qV.messageFontFamily=t.fontFamily),t.fontSize&&(qV.personFontSize=qV.systemFontSize=qV.messageFontSize=t.fontSize),t.fontWeight&&(qV.personFontWeight=qV.systemFontWeight=qV.messageFontWeight=t.fontWeight)}),"setConf"),YV=o(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"c4ShapeFont"),HV=o((t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight})),"boundaryFont"),VV=o((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");function XV(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=_k(e[t].text,i,n),e[t].textLines=e[t].text.split(Lr.lineBreakRegex).length,e[t].width=i,e[t].height=Ck(e[t].text,n);else{let r=e[t].text.split(Lr.lineBreakRegex);e[t].textLines=r.length;let i=0;e[t].height=0,e[t].width=0;for(const a of r)e[t].width=Math.max(Sk(a,n),e[t].width),i=Ck(a,n),e[t].height=e[t].height+i}}o(XV,"calcC4ShapeTextWH");var KV=o((function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=qV.c4ShapeMargin-35;let n=e.wrap&&qV.wrap,i=HV(qV);i.fontSize=i.fontSize+2,i.fontWeight="bold",XV("label",e,n,i,Sk(e.label.text,i)),$V.drawBoundary(t,e,qV)}),"drawBoundary"),ZV=o((function(t,e,r,n){let i=0;for(const a of n){i=0;const n=r[a];let s=YV(qV,n.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,n.typeC4Shape.width=Sk("«"+n.typeC4Shape.text+"»",s),n.typeC4Shape.height=s.fontSize+2,n.typeC4Shape.Y=qV.c4ShapePadding,i=n.typeC4Shape.Y+n.typeC4Shape.height-4,n.image={width:0,height:0,Y:0},n.typeC4Shape.text){case"person":case"external_person":n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height}n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let o=n.wrap&&qV.wrap,l=qV.width-2*qV.c4ShapePadding,c=YV(qV,n.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",XV("label",n,o,c,l),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&""!==n.type.text){n.type.text="["+n.type.text+"]",XV("type",n,o,YV(qV,n.typeC4Shape.text),l),n.type.Y=i+5,i=n.type.Y+n.type.height}else if(n.techn&&""!==n.techn.text){n.techn.text="["+n.techn.text+"]",XV("techn",n,o,YV(qV,n.techn.text),l),n.techn.Y=i+5,i=n.techn.Y+n.techn.height}let h=i,u=n.label.width;if(n.descr&&""!==n.descr.text){XV("descr",n,o,YV(qV,n.typeC4Shape.text),l),n.descr.Y=i+20,i=n.descr.Y+n.descr.height,u=Math.max(n.label.width,n.descr.width),h=i-5*n.descr.textLines}u+=qV.c4ShapePadding,n.width=Math.max(n.width||qV.width,u,qV.width),n.height=Math.max(n.height||qV.height,h,qV.height),n.margin=n.margin||qV.c4ShapeMargin,t.insert(n),$V.drawC4Shape(e,n,qV)}t.bumpLastMargin(qV.c4ShapeMargin)}),"drawC4ShapeArray"),QV=class{static{o(this,"Point")}constructor(t,e){this.x=t,this.y=e}},JV=o((function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),c=Math.abs(n-a),h=c/l,u=t.height/t.width,d=null;return n==a&&ri?d=new QV(r,o):r==i&&na&&(d=new QV(s,n)),r>i&&n=h?new QV(r,o+h*t.width/2):new QV(s-l/c*t.height/2,n+t.height):r=h?new QV(r+t.width,o+h*t.width/2):new QV(s+l/c*t.height/2,n+t.height):ra?d=u>=h?new QV(r+t.width,o-h*t.width/2):new QV(s+t.height/2*l/c,n):r>i&&n>a&&(d=u>=h?new QV(r,o-t.width/2*h):new QV(s-t.height/2*l/c,n)),d}),"getIntersectPoint"),tX=o((function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=JV(t,r);return r.x=t.x+t.width/2,r.y=t.y+t.height/2,{startPoint:n,endPoint:JV(e,r)}}),"getIntersectPoints"),eX=o((function(t,e,r,n){let i=0;for(let t of e){i+=1;let e=t.wrap&&qV.wrap,a=VV(qV);"C4Dynamic"===n.db.getC4Type()&&(t.label.text=i+": "+t.label.text);let s=Sk(t.label.text,a);XV("label",t,e,a,s),t.techn&&""!==t.techn.text&&(s=Sk(t.techn.text,a),XV("techn",t,e,a,s)),t.descr&&""!==t.descr.text&&(s=Sk(t.descr.text,a),XV("descr",t,e,a,s));let o=r(t.from),l=r(t.to),c=tX(o,l);t.startPoint=c.startPoint,t.endPoint=c.endPoint}$V.drawRels(t,e,qV)}),"drawRels");function rX(t,e,r,n,i){let a=new jV(i);a.data.widthLimit=r.data.widthLimit/Math.min(GV,n.length);for(let[s,o]of n.entries()){let n=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=n,n=o.image.Y+o.image.height);let l=o.wrap&&qV.wrap,c=HV(qV);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",XV("label",o,l,c,a.data.widthLimit),o.label.Y=n+8,n=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",XV("type",o,l,HV(qV),a.data.widthLimit),o.type.Y=n+5,n=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=HV(qV);t.fontSize=t.fontSize-2,XV("descr",o,l,t,a.data.widthLimit),o.descr.Y=n+20,n=o.descr.Y+o.descr.height}if(0==s||s%GV==0){let t=r.data.startx+qV.diagramMarginX,e=r.data.stopy+qV.diagramMarginY+n;a.setData(t,t,e,e)}else{let t=a.data.stopx!==a.data.startx?a.data.stopx+qV.diagramMarginX:a.data.startx,e=a.data.starty;a.setData(t,t,e,e)}a.name=o.alias;let h=i.db.getC4ShapeArray(o.alias),u=i.db.getC4ShapeKeys(o.alias);u.length>0&&ZV(a,t,h,u),e=o.alias;let d=i.db.getBoundarys(e);d.length>0&&rX(t,e,a,d,i),"global"!==o.alias&&KV(t,o,a),r.data.stopy=Math.max(a.data.stopy+qV.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+qV.c4ShapeMargin,r.data.stopx),FV=Math.max(FV,r.data.stopx),zV=Math.max(zV,r.data.stopy)}}o(rX,"drawInsideBoundary");var nX=o((function(t,e,r,n){qV=Qr().c4;const i=Qr().securityLevel;let a;"sandbox"===i&&(a=Ga("#i"+e));const s=Ga("sandbox"===i?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(qV.wrap),UV=o.getC4ShapeInRow(),GV=o.getC4BoundaryInRow(),y.debug(`C:${JSON.stringify(qV,null,2)}`);const l="sandbox"===i?s.select(`[id="${e}"]`):Ga(`[id="${e}"]`);$V.insertComputerIcon(l),$V.insertDatabaseIcon(l),$V.insertClockIcon(l);let c=new jV(n);c.setData(qV.diagramMarginX,qV.diagramMarginX,qV.diagramMarginY,qV.diagramMarginY),c.data.widthLimit=screen.availWidth,FV=qV.diagramMarginX,zV=qV.diagramMarginY;const h=n.db.getTitle();rX(l,"",c,n.db.getBoundarys(""),n),$V.insertArrowHead(l),$V.insertArrowEnd(l),$V.insertArrowCrossHead(l),$V.insertArrowFilledHead(l),eX(l,n.db.getRels(),n.db.getC4Shape,n),c.data.stopx=FV,c.data.stopy=zV;const u=c.data;let d=u.stopy-u.starty+2*qV.diagramMarginY;const p=u.stopx-u.startx+2*qV.diagramMarginX;h&&l.append("text").text(h).attr("x",(u.stopx-u.startx)/2-4*qV.diagramMarginX).attr("y",u.starty+qV.diagramMarginY),Rr(l,d,p,qV.useMaxWidth);const g=h?60:0;l.attr("viewBox",u.startx-qV.diagramMarginX+" -"+(qV.diagramMarginY+g)+" "+p+" "+(d+g)),y.debug("models:",u)}),"draw"),iX={drawPersonOrSystemArray:ZV,drawBoundary:KV,setConf:WV,draw:nX},aX={parser:PH,db:wV,renderer:iX,styles:o((t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`),"getStyles"),init:o((({c4:t,wrap:e})=>{iX.setConf(t),wV.setWrap(e)}),"init")},sX=Object.freeze({__proto__:null,diagram:aX}),oX=o(((t,e)=>{let r;"sandbox"===e&&(r=Ga("#i"+t));return Ga("sandbox"===e?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)}),"getDiagramElement"),lX=o(((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=cX(t,e);Rr(t,a,i,n);const l=hX(s,o,i,a,e);t.attr("viewBox",l),y.debug(`viewBox configured: ${l} with padding: ${e}`)}),"setupViewPortForSVG"),cX=o(((t,e)=>{const r=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+2*e,height:r.height+2*e,x:r.x,y:r.y}}),"calculateDimensionsWithPadding"),hX=o(((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`),"createViewBox"),uX=class{constructor(){this.vertexCounter=0,this.config=Qr(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=jr,this.setAccDescription=Yr,this.setDiagramTitle=Vr,this.getAccTitle=Wr,this.getAccDescription=Hr,this.getDiagramTitle=Xr,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{o(this,"FlowDB")}sanitizeText(t){return Lr.sanitizeText(t,this.config)}lookUpDomId(t){for(const e of this.vertices.values())if(e.id===t)return e.domId;return t}addVertex(t,e,r,n,i,a,s={},o){if(!t||0===t.trim().length)return;let l;if(void 0!==o){let t;t=o.includes("\n")?o+"\n":"{\n"+o+"\n}",l=oy(t,{schema:sy})}const c=this.edges.find((e=>e.id===t));if(c){const t=l;return void 0!==t?.animate&&(c.animate=t.animate),void(void 0!==t?.animation&&(c.animation=t.animation))}let h,u=this.vertices.get(t);if(void 0===u&&(u={id:t,labelType:"text",domId:"flowchart-"+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,u)),this.vertexCounter++,void 0!==e?(this.config=Qr(),h=this.sanitizeText(e.text.trim()),u.labelType=e.type,h.startsWith('"')&&h.endsWith('"')&&(h=h.substring(1,h.length-1)),u.text=h):void 0===u.text&&(u.text=t),void 0!==r&&(u.type=r),null!=n&&n.forEach((t=>{u.styles.push(t)})),null!=i&&i.forEach((t=>{u.classes.push(t)})),void 0!==a&&(u.dir=a),void 0===u.props?u.props=s:void 0!==s&&Object.assign(u.props,s),void 0!==l){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes("_"))throw new Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!zS(l.shape))throw new Error(`No such shape: ${l.shape}.`);u.type=l?.shape}l?.label&&(u.text=l?.label),l?.icon&&(u.icon=l?.icon,l.label?.trim()||u.text!==t||(u.text="")),l?.form&&(u.form=l?.form),l?.pos&&(u.pos=l?.pos),l?.img&&(u.img=l?.img,l.label?.trim()||u.text!==t||(u.text="")),l?.constraint&&(u.constraint=l.constraint),l.w&&(u.assetWidth=Number(l.w)),l.h&&(u.assetHeight=Number(l.h))}}addSingleLink(t,e,r,n){const i={start:t,end:e,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};y.info("abc78 Got edge...",i);const a=r.text;if(void 0!==a&&(i.text=this.sanitizeText(a.text.trim()),i.text.startsWith('"')&&i.text.endsWith('"')&&(i.text=i.text.substring(1,i.text.length-1)),i.labelType=a.type),void 0!==r&&(i.type=r.type,i.stroke=r.stroke,i.length=r.length>10?10:r.length),n&&!this.edges.some((t=>t.id===n)))i.id=n,i.isUserDefinedId=!0;else{const t=this.edges.filter((t=>t.start===i.start&&t.end===i.end));0===t.length?i.id=Fk(i.start,i.end,{counter:0,prefix:"L"}):i.id=Fk(i.start,i.end,{counter:t.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);y.info("Pushing edge..."),this.edges.push(i)}isLinkData(t){return null!==t&&"object"==typeof t&&"id"in t&&"string"==typeof t.id}addLink(t,e,r){const n=this.isLinkData(r)?r.id.replace("@",""):void 0;y.info("addLink",t,e,n);for(const i of t)for(const a of e){const s=i===t[t.length-1],o=a===e[0];s&&o?this.addSingleLink(i,a,r,n):this.addSingleLink(i,a,r,void 0)}}updateLinkInterpolate(t,e){t.forEach((t=>{"default"===t?this.edges.defaultInterpolate=e:this.edges[t].interpolate=e}))}updateLink(t,e){t.forEach((t=>{if("number"==typeof t&&t>=this.edges.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?this.edges.defaultStyle=e:(this.edges[t].style=e,(this.edges[t]?.style?.length??0)>0&&!this.edges[t]?.style?.some((t=>t?.startsWith("fill")))&&this.edges[t]?.style?.push("fill:none"))}))}addClass(t,e){const r=e.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((t=>{let e=this.classes.get(t);void 0===e&&(e={id:t,styles:[],textStyles:[]},this.classes.set(t,e)),null!=r&&r.forEach((t=>{if(/color/.exec(t)){const r=t.replace("fill","bgFill");e.textStyles.push(r)}e.styles.push(t)}))}))}setDirection(t){this.direction=t,/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")}setClass(t,e){for(const r of t.split(",")){const t=this.vertices.get(r);t&&t.classes.push(e);const n=this.edges.find((t=>t.id===r));n&&n.classes.push(e);const i=this.subGraphLookup.get(r);i&&i.classes.push(e)}}setTooltip(t,e){if(void 0!==e){e=this.sanitizeText(e);for(const r of t.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(r):r,e)}}setClickFun(t,e,r){const n=this.lookUpDomId(t);if("loose"!==Qr().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof r){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{const t=document.querySelector(`[id="${n}"]`);null!==t&&t.addEventListener("click",(()=>{Pk.runFunc(e,...i)}),!1)})))}setLink(t,e,r){t.split(",").forEach((t=>{const n=this.vertices.get(t);void 0!==n&&(n.link=Pk.formatUrl(e,this.config),n.linkTarget=r)})),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,e,r){t.split(",").forEach((t=>{this.setClickFun(t,e,r)})),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((e=>{e(t)}))}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let e=Ga(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Ga("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Ga(t).select("svg").selectAll("g.node").on("mouseover",(t=>{const r=Ga(t.currentTarget);if(null===r.attr("title"))return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(r.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(e.html().replace(/<br\/>/g,"
    ")),r.classed("hover",!0)})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0);Ga(t.currentTarget).classed("hover",!1)}))}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=Qr(),qr()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,e,r){let n=t.text.trim(),i=r.text;t===r&&/\s/.exec(r.text)&&(n=void 0);const a=o((t=>{const e={boolean:{},number:{},string:{}},r=[];let n;const i=t.filter((function(t){const i=typeof t;return t.stmt&&"dir"===t.stmt?(n=t.value,!1):""!==t.trim()&&(i in e?!e[i].hasOwnProperty(t)&&(e[i][t]=!0):!r.includes(t)&&r.push(t))}));return{nodeList:i,dir:n}}),"uniq"),{nodeList:s,dir:l}=a(e.flat());if("gen-1"===this.version)for(let t=0;t2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=e,this.subGraphs[e].id===t)return{result:!0,count:0};let n=0,i=1;for(;n=0){const r=this.indexNodes2(t,e);if(r.result)return{result:!0,count:i+r.count};i+=r.count}n+=1}return{result:!1,count:i}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}destructStartLink(t){let e=t.trim(),r="arrow_open";switch(e[0]){case"<":r="arrow_point",e=e.slice(1);break;case"x":r="arrow_cross",e=e.slice(1);break;case"o":r="arrow_circle",e=e.slice(1)}let n="normal";return e.includes("=")&&(n="thick"),e.includes(".")&&(n="dotted"),{type:r,stroke:n}}countChar(t,e){const r=e.length;let n=0;for(let i=0;i":n="arrow_point",e.startsWith("<")&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",e.startsWith("o")&&(n="double_"+n,r=r.slice(1))}let i="normal",a=r.length-1;r.startsWith("=")&&(i="thick"),r.startsWith("~")&&(i="invisible");const s=this.countChar(".",r);return s&&(i="dotted",a=s),{type:n,stroke:i,length:a}}destructLink(t,e){const r=this.destructEndLink(t);let n;if(e){if(n=this.destructStartLink(e),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===n.type)n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return"double_arrow"===n.type&&(n.type="double_arrow_point"),n.length=r.length,n}return r}exists(t,e){for(const r of t)if(r.nodes.includes(e))return!0;return!1}makeUniq(t,e){const r=[];return t.nodes.forEach(((n,i)=>{this.exists(e,n)||r.push(t.nodes[i])})),{nodes:r}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return"circle"===t.form?"iconCircle":"square"===t.form?"iconSquare":"rounded"===t.form?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,e){return t.find((t=>t.id===e))}destructEdgeType(t){let e="none",r="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":r=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),r=e}return{arrowTypeStart:e,arrowTypeEnd:r}}addNodeFromVertex(t,e,r,n,i,a){const s=r.get(t.id),o=n.get(t.id)??!1,l=this.findNode(e,t.id);if(l)l.cssStyles=t.styles,l.cssCompiledStyles=this.getCompiledStyles(t.classes),l.cssClasses=t.classes.join(" ");else{const r={id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};o?e.push({...r,isGroup:!0,shape:"rect"}):e.push({...r,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let e=[];for(const r of t){const t=this.classes.get(r);t?.styles&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),t?.textStyles&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}getData(){const t=Qr(),e=[],r=[],n=this.getSubGraphs(),i=new Map,a=new Map;for(let t=n.length-1;t>=0;t--){const e=n[t];e.nodes.length>0&&a.set(e.id,!0);for(const t of e.nodes)i.set(t,e.id)}for(let r=n.length-1;r>=0;r--){const a=n[r];e.push({id:a.id,label:a.title,labelStyle:"",parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:t.look})}this.getVertices().forEach((r=>{this.addNodeFromVertex(r,e,i,a,t,t.look||"classic")}));const s=this.getEdges();return s.forEach(((e,n)=>{const{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(e.type),o=[...s.defaultStyle??[]];e.style&&o.push(...e.style);const l={id:Fk(e.start,e.end,{counter:n,prefix:"L"},e.id),isUserDefinedId:e.isUserDefinedId,start:e.start,end:e.end,type:e.type??"normal",label:e.text,labelpos:"c",thickness:e.stroke,minlen:e.length,classes:"invisible"===e?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":i,arrowTypeEnd:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":a,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(e.classes),labelStyle:o,style:o,pattern:e.stroke,look:t.look,animate:e.animate,animation:e.animation,curve:e.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};r.push(l)})),{nodes:e,edges:r,other:{},config:t}}defaultConfig(){return tn.flowchart}},dX=o((function(t,e){return e.db.getClasses()}),"getClasses"),pX=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Qr();let o;"sandbox"===i&&(o=Ga("#i"+e));const l="sandbox"===i?o.nodes()[0].contentDocument:document;y.debug("Before getData: ");const c=n.db.getData();y.debug("Data: ",c);const h=oX(e,i),u=n.db.getDirection();c.type=n.type,c.layoutAlgorithm=OA(s),"dagre"===c.layoutAlgorithm&&"elk"===s&&y.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=u,c.nodeSpacing=a?.nodeSpacing||50,c.rankSpacing=a?.rankSpacing||50,c.markers=["point","circle","cross"],c.diagramId=e,y.debug("REF1:",c),await DA(c,h);const d=c.config.flowchart?.diagramPadding??8;Pk.insertTitle(h,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),lX(h,d,"flowchart",a?.useMaxWidth||!1);for(const t of c.nodes){const r=Ga(`#${e} [id="${t.id}"]`);if(!r||!t.link)continue;const n=l.createElementNS("http://www.w3.org/2000/svg","a");n.setAttributeNS("http://www.w3.org/2000/svg","class",t.cssClasses),n.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===i?n.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):t.linkTarget&&n.setAttributeNS("http://www.w3.org/2000/svg","target",t.linkTarget);const a=r.insert((function(){return n}),":first-child"),s=r.select(".label-container");s&&a.append((function(){return s.node()}));const o=r.select(".label");o&&a.append((function(){return o.node()}))}}),"draw"),gX={getClasses:dX,draw:pX},fX=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],a=[2,2],s=[1,13],l=[1,14],c=[1,15],h=[1,16],u=[1,23],d=[1,25],p=[1,26],g=[1,27],f=[1,49],m=[1,48],y=[1,29],v=[1,30],x=[1,31],b=[1,32],w=[1,33],k=[1,44],T=[1,46],_=[1,42],E=[1,47],C=[1,43],S=[1,50],A=[1,45],L=[1,51],N=[1,52],I=[1,34],R=[1,35],M=[1,36],D=[1,37],O=[1,57],P=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],B=[1,61],$=[1,60],F=[1,62],z=[8,9,11,75,77,78],U=[1,78],G=[1,91],q=[1,96],j=[1,95],W=[1,92],Y=[1,88],H=[1,94],V=[1,90],X=[1,97],K=[1,93],Z=[1,98],Q=[1,89],J=[8,9,10,11,40,75,77,78],tt=[8,9,10,11,40,46,75,77,78],et=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],rt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],nt=[44,60,89,102,105,106,109,111,114,115,116],it=[1,121],at=[1,122],st=[1,124],ot=[1,123],lt=[44,60,62,74,89,102,105,106,109,111,114,115,116],ct=[1,133],ht=[1,147],ut=[1,148],dt=[1,149],pt=[1,150],gt=[1,135],ft=[1,137],mt=[1,141],yt=[1,142],vt=[1,143],xt=[1,144],bt=[1,145],wt=[1,146],kt=[1,151],Tt=[1,152],_t=[1,131],Et=[1,132],Ct=[1,139],St=[1,134],At=[1,138],Lt=[1,136],Nt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],It=[1,154],Rt=[1,156],Mt=[8,9,11],Dt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Ot=[1,176],Pt=[1,172],Bt=[1,173],$t=[1,177],Ft=[1,174],zt=[1,175],Ut=[77,116,119],Gt=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],qt=[10,106],jt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Wt=[1,247],Yt=[1,245],Ht=[1,249],Vt=[1,243],Xt=[1,244],Kt=[1,246],Zt=[1,248],Qt=[1,250],Jt=[1,268],te=[8,9,11,106],ee=[8,9,10,11,60,84,105,106,109,110,111,112],re={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(a[o])||a[o].length>0)&&a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 183:case 44:case 54:case 76:case 181:this.$=a[o];break;case 11:n.setDirection("TB"),this.$="TB";break;case 12:n.setDirection(a[o-1]),this.$=a[o-1];break;case 27:this.$=a[o-1].nodes;break;case 33:this.$=n.addSubGraph(a[o-6],a[o-1],a[o-4]);break;case 34:this.$=n.addSubGraph(a[o-3],a[o-1],a[o-3]);break;case 35:this.$=n.addSubGraph(void 0,a[o-1],void 0);break;case 37:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 38:case 39:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 43:case 133:this.$=a[o-1]+a[o];break;case 45:n.addVertex(a[o-1][a[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),n.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 46:n.addLink(a[o-2].stmt,a[o],a[o-1]),this.$={stmt:a[o],nodes:a[o].concat(a[o-2].nodes)};break;case 47:n.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 48:this.$={stmt:a[o-1],nodes:a[o-1]};break;case 49:n.addVertex(a[o-1][a[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),this.$={stmt:a[o-1],nodes:a[o-1],shapeData:a[o]};break;case 50:this.$={stmt:a[o],nodes:a[o]};break;case 51:case 128:case 130:this.$=[a[o]];break;case 52:n.addVertex(a[o-5][a[o-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[o-4]),this.$=a[o-5].concat(a[o]);break;case 53:this.$=a[o-4].concat(a[o]);break;case 55:this.$=a[o-2],n.setClass(a[o-2],a[o]);break;case 56:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"square");break;case 57:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"doublecircle");break;case 58:this.$=a[o-5],n.addVertex(a[o-5],a[o-2],"circle");break;case 59:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"ellipse");break;case 60:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"stadium");break;case 61:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"subroutine");break;case 62:this.$=a[o-7],n.addVertex(a[o-7],a[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[o-5],a[o-3]]]));break;case 63:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"cylinder");break;case 64:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"round");break;case 65:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"diamond");break;case 66:this.$=a[o-5],n.addVertex(a[o-5],a[o-2],"hexagon");break;case 67:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"odd");break;case 68:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"trapezoid");break;case 69:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"inv_trapezoid");break;case 70:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"lean_right");break;case 71:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"lean_left");break;case 72:this.$=a[o],n.addVertex(a[o]);break;case 73:a[o-1].text=a[o],this.$=a[o-1];break;case 74:case 75:a[o-2].text=a[o-1],this.$=a[o-2];break;case 77:var l=n.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1]};break;case 78:l=n.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1],id:a[o-3]};break;case 79:case 86:case 101:case 103:this.$={text:a[o],type:"text"};break;case 80:case 87:case 102:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 81:case 88:this.$={text:a[o],type:"string"};break;case 82:case 89:case 104:this.$={text:a[o],type:"markdown"};break;case 83:l=n.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 84:l=n.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length,id:a[o-1]};break;case 85:this.$=a[o-1];break;case 105:this.$=a[o-4],n.addClass(a[o-2],a[o]);break;case 106:this.$=a[o-4],n.setClass(a[o-2],a[o]);break;case 107:case 115:this.$=a[o-1],n.setClickEvent(a[o-1],a[o]);break;case 108:case 116:this.$=a[o-3],n.setClickEvent(a[o-3],a[o-2]),n.setTooltip(a[o-3],a[o]);break;case 109:this.$=a[o-2],n.setClickEvent(a[o-2],a[o-1],a[o]);break;case 110:this.$=a[o-4],n.setClickEvent(a[o-4],a[o-3],a[o-2]),n.setTooltip(a[o-4],a[o]);break;case 111:this.$=a[o-2],n.setLink(a[o-2],a[o]);break;case 112:this.$=a[o-4],n.setLink(a[o-4],a[o-2]),n.setTooltip(a[o-4],a[o]);break;case 113:this.$=a[o-4],n.setLink(a[o-4],a[o-2],a[o]);break;case 114:this.$=a[o-6],n.setLink(a[o-6],a[o-4],a[o]),n.setTooltip(a[o-6],a[o-2]);break;case 117:this.$=a[o-1],n.setLink(a[o-1],a[o]);break;case 118:this.$=a[o-3],n.setLink(a[o-3],a[o-2]),n.setTooltip(a[o-3],a[o]);break;case 119:this.$=a[o-3],n.setLink(a[o-3],a[o-2],a[o]);break;case 120:this.$=a[o-5],n.setLink(a[o-5],a[o-4],a[o]),n.setTooltip(a[o-5],a[o-2]);break;case 121:this.$=a[o-4],n.addVertex(a[o-2],void 0,void 0,a[o]);break;case 122:this.$=a[o-4],n.updateLink([a[o-2]],a[o]);break;case 123:this.$=a[o-4],n.updateLink(a[o-2],a[o]);break;case 124:this.$=a[o-8],n.updateLinkInterpolate([a[o-6]],a[o-2]),n.updateLink([a[o-6]],a[o]);break;case 125:this.$=a[o-8],n.updateLinkInterpolate(a[o-6],a[o-2]),n.updateLink(a[o-6],a[o]);break;case 126:this.$=a[o-6],n.updateLinkInterpolate([a[o-4]],a[o]);break;case 127:this.$=a[o-6],n.updateLinkInterpolate(a[o-4],a[o]);break;case 129:case 131:a[o-2].push(a[o]),this.$=a[o-2];break;case 182:case 184:this.$=a[o-1]+""+a[o];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"}}}),"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:O,15:53,18:56},t(P,[2,3]),t(P,[2,4]),t(P,[2,5]),t(P,[2,6]),t(P,[2,7]),t(P,[2,8]),{8:B,9:$,11:F,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:B,9:$,11:F,21:67},{8:B,9:$,11:F,21:68},{8:B,9:$,11:F,21:69},{8:B,9:$,11:F,21:70},{8:B,9:$,11:F,21:71},{8:B,9:$,10:[1,72],11:F,21:73},t(P,[2,36]),{35:[1,74]},{37:[1,75]},t(P,[2,39]),t(z,[2,50],{18:76,39:77,10:O,40:U}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:G,44:q,60:j,80:[1,86],89:W,95:[1,83],97:[1,84],101:85,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q,120:87},t(P,[2,185]),t(P,[2,186]),t(P,[2,187]),t(P,[2,188]),t(J,[2,51]),t(J,[2,54],{46:[1,99]}),t(tt,[2,72],{113:112,29:[1,100],44:f,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:m,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:k,102:T,105:_,106:E,109:C,111:S,114:A,115:L,116:N}),t(et,[2,181]),t(et,[2,142]),t(et,[2,143]),t(et,[2,144]),t(et,[2,145]),t(et,[2,146]),t(et,[2,147]),t(et,[2,148]),t(et,[2,149]),t(et,[2,150]),t(et,[2,151]),t(et,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,113]},t(rt,[2,26],{18:114,10:O}),t(P,[2,27]),{42:115,43:38,44:f,45:39,47:40,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(P,[2,40]),t(P,[2,41]),t(P,[2,42]),t(nt,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:it,81:at,116:st,119:ot},{75:[1,125],77:[1,126]},t(lt,[2,83]),t(P,[2,28]),t(P,[2,29]),t(P,[2,30]),t(P,[2,31]),t(P,[2,32]),{10:ct,12:ht,14:ut,27:dt,28:127,32:pt,44:gt,60:ft,75:mt,80:[1,129],81:[1,130],83:140,84:yt,85:vt,86:xt,87:bt,88:wt,89:kt,90:Tt,91:128,105:_t,109:Et,111:Ct,114:St,115:At,116:Lt},t(Nt,a,{5:153}),t(P,[2,37]),t(P,[2,38]),t(z,[2,48],{44:It}),t(z,[2,49],{18:155,10:O,40:Rt}),t(J,[2,44]),{44:f,47:157,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{102:[1,158],103:159,105:[1,160]},{44:f,47:161,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{44:f,47:162,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(Mt,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(Mt,[2,115],{120:167,10:[1,166],14:G,44:q,60:j,89:W,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q}),t(Mt,[2,117],{10:[1,168]}),t(Dt,[2,183]),t(Dt,[2,170]),t(Dt,[2,171]),t(Dt,[2,172]),t(Dt,[2,173]),t(Dt,[2,174]),t(Dt,[2,175]),t(Dt,[2,176]),t(Dt,[2,177]),t(Dt,[2,178]),t(Dt,[2,179]),t(Dt,[2,180]),{44:f,47:169,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{30:170,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:178,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:180,50:[1,179],67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:181,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:182,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:183,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{109:[1,184]},{30:185,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:186,65:[1,187],67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:188,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:189,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:190,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},t(et,[2,182]),t(i,[2,20]),t(rt,[2,25]),t(z,[2,46],{39:191,18:192,10:O,40:U}),t(nt,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{77:[1,196],79:197,116:st,119:ot},t(Ut,[2,79]),t(Ut,[2,81]),t(Ut,[2,82]),t(Ut,[2,168]),t(Ut,[2,169]),{76:198,79:120,80:it,81:at,116:st,119:ot},t(lt,[2,84]),{8:B,9:$,10:ct,11:F,12:ht,14:ut,21:200,27:dt,29:[1,199],32:pt,44:gt,60:ft,75:mt,83:140,84:yt,85:vt,86:xt,87:bt,88:wt,89:kt,90:Tt,91:201,105:_t,109:Et,111:Ct,114:St,115:At,116:Lt},t(Gt,[2,101]),t(Gt,[2,103]),t(Gt,[2,104]),t(Gt,[2,157]),t(Gt,[2,158]),t(Gt,[2,159]),t(Gt,[2,160]),t(Gt,[2,161]),t(Gt,[2,162]),t(Gt,[2,163]),t(Gt,[2,164]),t(Gt,[2,165]),t(Gt,[2,166]),t(Gt,[2,167]),t(Gt,[2,90]),t(Gt,[2,91]),t(Gt,[2,92]),t(Gt,[2,93]),t(Gt,[2,94]),t(Gt,[2,95]),t(Gt,[2,96]),t(Gt,[2,97]),t(Gt,[2,98]),t(Gt,[2,99]),t(Gt,[2,100]),{6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,202],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},{10:O,18:203},{44:[1,204]},t(J,[2,43]),{10:[1,205],44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:112,114:A,115:L,116:N},{10:[1,206]},{10:[1,207],106:[1,208]},t(qt,[2,128]),{10:[1,209],44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:112,114:A,115:L,116:N},{10:[1,210],44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:112,114:A,115:L,116:N},{80:[1,211]},t(Mt,[2,109],{10:[1,212]}),t(Mt,[2,111],{10:[1,213]}),{80:[1,214]},t(Dt,[2,184]),{80:[1,215],98:[1,216]},t(J,[2,55],{113:112,44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,114:A,115:L,116:N}),{31:[1,217],67:Ot,82:218,116:$t,117:Ft,118:zt},t(jt,[2,86]),t(jt,[2,88]),t(jt,[2,89]),t(jt,[2,153]),t(jt,[2,154]),t(jt,[2,155]),t(jt,[2,156]),{49:[1,219],67:Ot,82:218,116:$t,117:Ft,118:zt},{30:220,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{51:[1,221],67:Ot,82:218,116:$t,117:Ft,118:zt},{53:[1,222],67:Ot,82:218,116:$t,117:Ft,118:zt},{55:[1,223],67:Ot,82:218,116:$t,117:Ft,118:zt},{57:[1,224],67:Ot,82:218,116:$t,117:Ft,118:zt},{60:[1,225]},{64:[1,226],67:Ot,82:218,116:$t,117:Ft,118:zt},{66:[1,227],67:Ot,82:218,116:$t,117:Ft,118:zt},{30:228,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{31:[1,229],67:Ot,82:218,116:$t,117:Ft,118:zt},{67:Ot,69:[1,230],71:[1,231],82:218,116:$t,117:Ft,118:zt},{67:Ot,69:[1,233],71:[1,232],82:218,116:$t,117:Ft,118:zt},t(z,[2,45],{18:155,10:O,40:Rt}),t(z,[2,47],{44:It}),t(nt,[2,75]),t(nt,[2,74]),{62:[1,234],67:Ot,82:218,116:$t,117:Ft,118:zt},t(nt,[2,77]),t(Ut,[2,80]),{77:[1,235],79:197,116:st,119:ot},{30:236,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},t(Nt,a,{5:237}),t(Gt,[2,102]),t(P,[2,35]),{43:238,44:f,45:39,47:40,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{10:O,18:239},{10:Wt,60:Yt,84:Ht,92:240,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{10:Wt,60:Yt,84:Ht,92:251,104:[1,252],105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{10:Wt,60:Yt,84:Ht,92:253,104:[1,254],105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{105:[1,255]},{10:Wt,60:Yt,84:Ht,92:256,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{44:f,47:257,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(Mt,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(Mt,[2,116]),t(Mt,[2,118],{10:[1,261]}),t(Mt,[2,119]),t(tt,[2,56]),t(jt,[2,87]),t(tt,[2,57]),{51:[1,262],67:Ot,82:218,116:$t,117:Ft,118:zt},t(tt,[2,64]),t(tt,[2,59]),t(tt,[2,60]),t(tt,[2,61]),{109:[1,263]},t(tt,[2,63]),t(tt,[2,65]),{66:[1,264],67:Ot,82:218,116:$t,117:Ft,118:zt},t(tt,[2,67]),t(tt,[2,68]),t(tt,[2,70]),t(tt,[2,69]),t(tt,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(nt,[2,78]),{31:[1,265],67:Ot,82:218,116:$t,117:Ft,118:zt},{6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,266],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},t(J,[2,53]),{43:267,44:f,45:39,47:40,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(Mt,[2,121],{106:Jt}),t(te,[2,130],{108:269,10:Wt,60:Yt,84:Ht,105:Vt,109:Xt,110:Kt,111:Zt,112:Qt}),t(ee,[2,132]),t(ee,[2,134]),t(ee,[2,135]),t(ee,[2,136]),t(ee,[2,137]),t(ee,[2,138]),t(ee,[2,139]),t(ee,[2,140]),t(ee,[2,141]),t(Mt,[2,122],{106:Jt}),{10:[1,270]},t(Mt,[2,123],{106:Jt}),{10:[1,271]},t(qt,[2,129]),t(Mt,[2,105],{106:Jt}),t(Mt,[2,106],{113:112,44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,114:A,115:L,116:N}),t(Mt,[2,110]),t(Mt,[2,112],{10:[1,272]}),t(Mt,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:B,9:$,11:F,21:277},t(P,[2,34]),t(J,[2,52]),{10:Wt,60:Yt,84:Ht,105:Vt,107:278,108:242,109:Xt,110:Kt,111:Zt,112:Qt},t(ee,[2,133]),{14:G,44:q,60:j,89:W,101:279,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q,120:87},{14:G,44:q,60:j,89:W,101:280,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q,120:87},{98:[1,281]},t(Mt,[2,120]),t(tt,[2,58]),{30:282,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},t(tt,[2,66]),t(Nt,a,{5:283}),t(te,[2,131],{108:269,10:Wt,60:Yt,84:Ht,105:Vt,109:Xt,110:Kt,111:Zt,112:Qt}),t(Mt,[2,126],{120:167,10:[1,284],14:G,44:q,60:j,89:W,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q}),t(Mt,[2,127],{120:167,10:[1,285],14:G,44:q,60:j,89:W,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q}),t(Mt,[2,114]),{31:[1,286],67:Ot,82:218,116:$t,117:Ft,118:zt},{6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,287],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},{10:Wt,60:Yt,84:Ht,92:288,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{10:Wt,60:Yt,84:Ht,92:289,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},t(tt,[2,62]),t(P,[2,33]),t(Mt,[2,124],{106:Jt}),t(Mt,[2,125],{106:Jt})],defaultActions:{},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},ne=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),e.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const r=/\n\s*/g;return e.yytext=e.yytext.replace(r,"
    "),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 18:return 96;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 34:return 88;case 35:case 36:case 37:return t.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:case 41:case 42:case 43:return 98;case 44:return this.popState(),13;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:case 102:return 111;case 62:return 46;case 63:return 60;case 64:case 103:return 44;case 65:return 8;case 66:return 106;case 67:case 101:return 115;case 68:case 71:case 74:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:case 73:case 76:return 119;case 72:return this.pushState("thickEdgeText"),75;case 75:return this.pushState("dottedEdgeText"),75;case 77:return 77;case 78:return this.popState(),53;case 79:case 115:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return t}();function ie(){this.yy={}}return re.lexer=ne,o(ie,"Parser"),ie.prototype=re,re.Parser=ie,new ie}();fX.parser=fX;var mX=fX,yX=Object.assign({},mX);yX.parse=t=>{const e=t.replace(/}\s*\n/g,"}\n");return mX.parse(e)};var vX=yX,xX=o(((t,e)=>{const r=tt,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return J(n,i,a,e)}),"fade"),bX={parser:vX,get db(){return new uX},renderer:gX,styles:o((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${t.lineColor} !important;\n stroke-width: 0;\n stroke: ${t.lineColor};\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${xX(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n padding: 2px;\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n`),"getStyles"),init:o((t=>{t.flowchart||(t.flowchart={}),t.layout&&Jr({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Jr({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})}),"init")},wX=Object.freeze({__proto__:null,diagram:bX}),kX=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,20],l=[1,21],c=[1,22],h=[1,23],u=[1,24],d=[1,19],p=[1,25],g=[1,26],f=[1,18],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],k=[1,42],T=[1,43],_=[1,52],E=[40,50,68,69],C=[1,63],S=[1,61],A=[1,58],L=[1,62],N=[1,64],I=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],R=[63,64,65,66,67],M=[1,81],D=[1,80],O=[1,78],P=[1,79],B=[6,10,42,47],$=[6,10,13,41,42,47,48,49],F=[1,89],z=[1,88],U=[1,87],G=[19,56],q=[1,98],j=[1,97],W=[19,56,58,60],Y={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:case 55:case 78:case 62:case 63:case 66:this.$=a[o];break;case 8:n.addEntity(a[o-4]),n.addEntity(a[o-2]),n.addRelationship(a[o-4],a[o],a[o-2],a[o-3]);break;case 9:n.addEntity(a[o-8]),n.addEntity(a[o-4]),n.addRelationship(a[o-8],a[o],a[o-4],a[o-5]),n.setClass([a[o-8]],a[o-6]),n.setClass([a[o-4]],a[o-2]);break;case 10:n.addEntity(a[o-6]),n.addEntity(a[o-2]),n.addRelationship(a[o-6],a[o],a[o-2],a[o-3]),n.setClass([a[o-6]],a[o-4]);break;case 11:n.addEntity(a[o-6]),n.addEntity(a[o-4]),n.addRelationship(a[o-6],a[o],a[o-4],a[o-5]),n.setClass([a[o-4]],a[o-2]);break;case 12:n.addEntity(a[o-3]),n.addAttributes(a[o-3],a[o-1]);break;case 13:n.addEntity(a[o-5]),n.addAttributes(a[o-5],a[o-1]),n.setClass([a[o-5]],a[o-3]);break;case 14:n.addEntity(a[o-2]);break;case 15:n.addEntity(a[o-4]),n.setClass([a[o-4]],a[o-2]);break;case 16:n.addEntity(a[o]);break;case 17:n.addEntity(a[o-2]),n.setClass([a[o-2]],a[o]);break;case 18:n.addEntity(a[o-6],a[o-4]),n.addAttributes(a[o-6],a[o-1]);break;case 19:n.addEntity(a[o-8],a[o-6]),n.addAttributes(a[o-8],a[o-1]),n.setClass([a[o-8]],a[o-3]);break;case 20:n.addEntity(a[o-5],a[o-3]);break;case 21:n.addEntity(a[o-7],a[o-5]),n.setClass([a[o-7]],a[o-2]);break;case 22:n.addEntity(a[o-3],a[o-1]);break;case 23:n.addEntity(a[o-5],a[o-3]),n.setClass([a[o-5]],a[o]);break;case 24:case 25:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=a[o-3],n.addClass(a[o-2],a[o-1]);break;case 37:case 38:case 56:case 64:case 43:this.$=[a[o]];break;case 39:case 40:this.$=a[o-2].concat([a[o]]);break;case 41:this.$=a[o-2],n.setClass(a[o-1],a[o]);break;case 42:this.$=a[o-3],n.addCssStyles(a[o-2],a[o-1]);break;case 44:case 65:a[o-2].push(a[o]),this.$=a[o-2];break;case 46:this.$=a[o-1]+a[o];break;case 54:case 76:case 77:case 67:this.$=a[o].replace(/"/g,"");break;case 57:a[o].push(a[o-1]),this.$=a[o];break;case 58:this.$={type:a[o-1],name:a[o]};break;case 59:this.$={type:a[o-2],name:a[o-1],keys:a[o]};break;case 60:this.$={type:a[o-2],name:a[o-1],comment:a[o]};break;case 61:this.$={type:a[o-3],name:a[o-2],keys:a[o-1],comment:a[o]};break;case 68:this.$={cardA:a[o],relType:a[o-1],cardB:a[o-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.Identification.IDENTIFYING}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:l,35:c,36:h,37:u,40:d,43:p,44:g,50:f},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:27,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:l,35:c,36:h,37:u,40:d,43:p,44:g,50:f},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:m,64:y,65:v,66:x,67:b}),{23:[1,38]},{25:[1,39]},{27:[1,40]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(w,[2,54]),t(w,[2,55]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:41,40:k,41:T},{16:44,40:k,41:T},{16:45,40:k,41:T},t(e,[2,4]),{11:46,40:d,50:f},{16:47,40:k,41:T},{18:48,19:[1,49],51:50,52:51,56:_},{11:53,40:d,50:f},{62:54,68:[1,55],69:[1,56]},t(E,[2,69]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:C,38:57,41:S,42:A,45:59,46:60,48:L,49:N},t(I,[2,37]),t(I,[2,38]),{16:65,40:k,41:T,42:A},{13:C,38:66,41:S,42:A,45:59,46:60,48:L,49:N},{13:[1,67],15:[1,68]},t(e,[2,17],{61:32,12:69,17:[1,70],42:A,63:m,64:y,65:v,66:x,67:b}),{19:[1,71]},t(e,[2,14]),{18:72,19:[2,56],51:50,52:51,56:_},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:m,64:y,65:v,66:x,67:b},t(R,[2,74]),t(R,[2,75]),{6:M,10:D,39:77,42:O,47:P},{40:[1,82],41:[1,83]},t(B,[2,43],{46:84,13:C,41:S,48:L,49:N}),t($,[2,45]),t($,[2,50]),t($,[2,51]),t($,[2,52]),t($,[2,53]),t(e,[2,41],{42:A}),{6:M,10:D,39:85,42:O,47:P},{14:86,40:F,50:z,70:U},{16:90,40:k,41:T},{11:91,40:d,50:f},{18:92,19:[1,93],51:50,52:51,56:_},t(e,[2,12]),{19:[2,57]},t(G,[2,58],{54:94,55:95,57:96,59:q,60:j}),t([19,56,59,60],[2,63]),t(e,[2,22],{15:[1,100],17:[1,99]}),t([40,50],[2,68]),t(e,[2,36]),{13:C,41:S,45:101,46:60,48:L,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(I,[2,39]),t(I,[2,40]),t($,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,76]),t(e,[2,77]),t(e,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},t(e,[2,15]),t(G,[2,59],{55:106,58:[1,107],60:j}),t(G,[2,60]),t(W,[2,64]),t(G,[2,67]),t(W,[2,66]),{18:108,19:[1,109],51:50,52:51,56:_},{16:110,40:k,41:T},t(B,[2,44],{46:84,13:C,41:S,48:L,49:N}),{14:111,40:F,50:z,70:U},{16:112,40:k,41:T},{14:113,40:F,50:z,70:U},t(e,[2,13]),t(G,[2,61]),{57:114,59:q},{19:[1,115]},t(e,[2,20]),t(e,[2,23],{17:[1,116],42:A}),t(e,[2,11]),{13:[1,117],42:A},t(e,[2,10]),t(W,[2,65]),t(e,[2,18]),{18:118,19:[1,119],51:50,52:51,56:_},{14:120,40:F,50:z,70:U},{19:[1,121]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},H=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:case 23:case 28:case 35:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:case 19:case 38:return 49;case 20:case 37:return 42;case 21:return 15;case 22:case 36:return 13;case 24:return 59;case 25:case 26:return 56;case 27:return 60;case 29:return this.popState(),19;case 30:case 73:return e.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 39:return this.begin("style"),37;case 40:return 43;case 41:case 45:case 46:case 59:return 63;case 42:case 43:case 44:case 52:case 54:case 61:return 65;case 47:case 48:case 49:case 50:case 51:case 53:case 60:return 64;case 55:case 56:case 57:case 58:return 66;case 62:return 67;case 63:case 66:case 67:case 68:return 68;case 64:case 65:return 69;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 74:return 6}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74],inclusive:!0}}};return t}();function V(){this.yy={}}return Y.lexer=H,o(V,"Parser"),V.prototype=Y,Y.Parser=V,new V}();kX.parser=kX;var TX=kX,_X=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=jr,this.getAccTitle=Wr,this.setAccDescription=Yr,this.getAccDescription=Hr,this.setDiagramTitle=Vr,this.getDiagramTitle=Xr,this.getConfig=o((()=>Qr().er),"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{o(this,"ErDB")}addEntity(t,e=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&e&&(this.entities.get(t).alias=e,y.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:Qr().look??"default",cssClasses:"default",cssStyles:[]}),y.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const r=this.addEntity(t);let n;for(n=e.length-1;n>=0;n--)e[n].keys||(e[n].keys=[]),e[n].comment||(e[n].comment=""),r.attributes.push(e[n]),y.debug("Added attribute ",e[n].name)}addRelationship(t,e,r,n){const i=this.entities.get(t),a=this.entities.get(r);if(!i||!a)return;const s={entityA:i.id,roleA:e,entityB:a.id,relSpec:n};this.relationships.push(s),y.debug("Added new relationship :",s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const r of t){const t=this.classes.get(r);t?.styles&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),t?.textStyles&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}addCssStyles(t,e){for(const r of t){const t=this.entities.get(r);if(!e||!t)return;for(const r of e)t.cssStyles.push(r)}}addClass(t,e){t.forEach((t=>{let r=this.classes.get(t);void 0===r&&(r={id:t,styles:[],textStyles:[]},this.classes.set(t,r)),e&&e.forEach((function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");r.textStyles.push(e)}r.styles.push(t)}))}))}setClass(t,e){for(const r of t){const t=this.entities.get(r);if(t)for(const r of e)t.cssClasses+=" "+r}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],qr()}getData(){const t=[],e=[],r=Qr();for(const e of this.entities.keys()){const r=this.entities.get(e);r&&(r.cssCompiledStyles=this.getCompiledStyles(r.cssClasses.split(" ")),t.push(r))}let n=0;for(const t of this.relationships){const i={id:Fk(t.entityA,t.entityB,{prefix:"id",counter:n++}),type:"normal",curve:"basis",start:t.entityA,end:t.entityB,label:t.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:t.relSpec.cardB.toLowerCase(),arrowTypeEnd:t.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==t.relSpec.relType?"solid":"dashed",look:r.look};e.push(i)}return{nodes:t,edges:e,other:{},config:r,direction:"TB"}}},EX={};h(EX,{draw:()=>CX});var CX=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Qr(),o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=OA(s),o.config.flowchart.nodeSpacing=a?.nodeSpacing||140,o.config.flowchart.rankSpacing=a?.rankSpacing||80,o.direction=n.db.getDirection(),o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await DA(o,l),"elk"===o.layoutAlgorithm&&l.select(".edges").lower();const c=l.selectAll('[id*="-background"]');Array.from(c).length>0&&c.each((function(){const t=Ga(this),e=t.attr("id").replace("-background",""),r=l.select(`#${CSS.escape(e)}`);if(!r.empty()){const e=r.attr("transform");t.attr("transform",e)}}));Pk.insertTitle(l,"erDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,"erDiagram",a?.useMaxWidth??!0)}),"draw"),SX=o(((t,e)=>{const r=tt,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return J(n,i,a,e)}),"fade"),AX={parser:TX,get db(){return new _X},renderer:EX,styles:o((t=>`\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${SX(t.tertiaryColor,.5)};\n }\n\n .edgeLabel .label {\n fill: ${t.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n`),"getStyles")},LX=Object.freeze({__proto__:null,diagram:AX}),NX=class{constructor(t){this.init=t,this.records=this.init()}static{o(this,"ImperativeState")}reset(){this.records=this.init()}};function IX(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}o(IX,"populateCommonDb");var RX=l({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){var e;function r(){if(void 0===e)throw new Error("No runtime abstraction layer installed");return e}Object.defineProperty(t,"__esModule",{value:!0}),o(r,"RAL"),function(t){function r(t){if(void 0===t)throw new Error("No runtime abstraction layer provided");e=t}o(r,"install"),t.install=r}(r||(r={})),t.default=r}}),MX=l({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){function e(t){return!0===t||!1===t}function r(t){return"string"==typeof t||t instanceof String}function n(t){return"number"==typeof t||t instanceof Number}function i(t){return t instanceof Error}function a(t){return"function"==typeof t}function s(t){return Array.isArray(t)}function l(t){return s(t)&&t.every((t=>r(t)))}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,o(e,"boolean"),t.boolean=e,o(r,"string"),t.string=r,o(n,"number"),t.number=n,o(i,"error"),t.error=i,o(a,"func"),t.func=a,o(s,"array"),t.array=s,o(l,"stringArray"),t.stringArray=l}}),DX=l({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e,r=RX();!function(t){const e={dispose(){}};t.None=function(){return e}}(e||(t.Event=e={}));var n=class{static{o(this,"CallbackList")}add(t,e=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(e),Array.isArray(r)&&r.push({dispose:o((()=>this.remove(t,e)),"dispose")})}remove(t,e=null){if(!this._callbacks)return;let r=!1;for(let n=0,i=this._callbacks.length;n{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);const a={dispose:o((()=>{this._callbacks&&(this._callbacks.remove(e,r),a.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}),"dispose")};return Array.isArray(i)&&i.push(a),a}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};t.Emitter=i,i._noop=function(){}}}),OX=l({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e,r=RX(),n=MX(),i=DX();!function(t){function e(e){const r=e;return r&&(r===t.None||r===t.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),o(e,"is"),t.is=e}(e||(t.CancellationToken=e={}));var a=Object.freeze((function(t,e){const n=(0,r.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}})),s=class{static{o(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{o(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=e.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=e.None}};t.CancellationTokenSource=l}}),PX={};h(PX,{AbstractAstReflection:()=>GX,AbstractCstNode:()=>i7,AbstractLangiumParser:()=>d7,AbstractParserErrorMessageProvider:()=>g7,AbstractThreadedAsyncParser:()=>O9,AstUtils:()=>fQ,BiMap:()=>x8,Cancellation:()=>G7,CompositeCstNodeImpl:()=>s7,ContextCache:()=>C8,CstNodeBuilder:()=>n7,CstUtils:()=>BX,DEFAULT_TOKENIZE_OPTIONS:()=>J8,DONE_RESULT:()=>KX,DatatypeSymbol:()=>c7,DefaultAstNodeDescriptionProvider:()=>q8,DefaultAstNodeLocator:()=>W8,DefaultAsyncParser:()=>D9,DefaultCommentProvider:()=>M9,DefaultConfigurationProvider:()=>V8,DefaultDocumentBuilder:()=>X8,DefaultDocumentValidator:()=>F8,DefaultHydrator:()=>$9,DefaultIndexManager:()=>K8,DefaultJsonSerializer:()=>M8,DefaultLangiumDocumentFactory:()=>u8,DefaultLangiumDocuments:()=>d8,DefaultLexer:()=>t9,DefaultLexerErrorMessageProvider:()=>Q8,DefaultLinker:()=>g8,DefaultNameProvider:()=>m8,DefaultReferenceDescriptionProvider:()=>j8,DefaultReferences:()=>y8,DefaultScopeComputation:()=>b8,DefaultScopeProvider:()=>L8,DefaultServiceRegistry:()=>D8,DefaultTokenBuilder:()=>z7,DefaultValueConverter:()=>U7,DefaultWorkspaceLock:()=>B9,DefaultWorkspaceManager:()=>Z8,Deferred:()=>J7,Disposable:()=>H8,DisposableCache:()=>_8,DocumentCache:()=>S8,DocumentState:()=>o8,DocumentValidator:()=>P8,EMPTY_SCOPE:()=>T8,EMPTY_STREAM:()=>XX,EmptyFileSystem:()=>ett,EmptyFileSystemProvider:()=>ttt,ErrorWithLocation:()=>TK,GrammarAST:()=>EK,GrammarUtils:()=>kK,IndentationAwareLexer:()=>Q9,IndentationAwareTokenBuilder:()=>Z9,JSDocDocumentationProvider:()=>R9,LangiumCompletionParser:()=>m7,LangiumParser:()=>p7,LangiumParserErrorMessageProvider:()=>f7,LeafCstNodeImpl:()=>a7,LexingMode:()=>V9,MapScope:()=>k8,Module:()=>I9,MultiMap:()=>v8,OperationCancelled:()=>V7,ParserWorker:()=>P9,Reduction:()=>QX,RegExpUtils:()=>NQ,RootCstNodeImpl:()=>l7,SimpleCache:()=>E8,StreamImpl:()=>YX,StreamScope:()=>w8,TextDocument:()=>Z7,TreeStreamImpl:()=>eK,URI:()=>c8,UriUtils:()=>s8,ValidationCategory:()=>R8,ValidationRegistry:()=>$8,ValueConverter:()=>F7,WorkspaceCache:()=>A8,assertUnreachable:()=>_K,createCompletionParser:()=>P7,createDefaultCoreModule:()=>F9,createDefaultSharedCoreModule:()=>z9,createGrammarConfig:()=>UJ,createLangiumParser:()=>B7,createParser:()=>x7,delayNextTick:()=>q7,diagnosticData:()=>O8,eagerLoad:()=>q9,getDiagnosticRange:()=>z8,indentationBuilderDefaultOptions:()=>K9,inject:()=>U9,interruptAndCheck:()=>K7,isAstNode:()=>$X,isAstNodeDescription:()=>zX,isAstNodeWithComment:()=>N8,isCompositeCstNode:()=>qX,isIMultiModeLexerDefinition:()=>r9,isJSDoc:()=>a9,isLeafCstNode:()=>jX,isLinkingError:()=>UX,isNamed:()=>f8,isOperationCancelled:()=>X7,isReference:()=>FX,isRootCstNode:()=>WX,isTokenTypeArray:()=>e9,isTokenTypeDictionary:()=>n9,loadGrammarFromJson:()=>att,parseJSDoc:()=>i9,prepareLangiumParser:()=>$7,setInterruptionPeriod:()=>H7,startCancelableOperation:()=>Y7,stream:()=>ZX,toDiagnosticData:()=>G8,toDiagnosticSeverity:()=>U8});var BX={};function $X(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$type}function FX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$refText}function zX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.name&&"string"==typeof t.type&&"string"==typeof t.path}function UX(t){return"object"==typeof t&&null!==t&&$X(t.container)&&FX(t.reference)&&"string"==typeof t.message}h(BX,{DefaultNameRegexp:()=>cK,RangeComparison:()=>JX,compareRange:()=>oK,findCommentNode:()=>uK,findDeclarationNodeAtOffset:()=>hK,findLeafNodeAtOffset:()=>pK,findLeafNodeBeforeOffset:()=>gK,flattenCst:()=>nK,getInteriorNodes:()=>xK,getNextNode:()=>yK,getPreviousNode:()=>mK,getStartlineNode:()=>vK,inRange:()=>lK,isChildNode:()=>iK,isCommentNode:()=>dK,streamCst:()=>rK,toDocumentSegment:()=>sK,tokenToRange:()=>aK}),o($X,"isAstNode"),o(FX,"isReference"),o(zX,"isAstNodeDescription"),o(UX,"isLinkingError");var GX=class{static{o(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}isInstance(t,e){return $X(t)&&this.isSubtype(t.$type,e)}isSubtype(t,e){if(t===e)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});const n=r[e];if(void 0!==n)return n;{const n=this.computeIsSubtype(t,e);return r[e]=n,n}}getAllSubTypes(t){const e=this.allSubtypes[t];if(e)return e;{const e=this.getAllTypes(),r=[];for(const n of e)this.isSubtype(n,t)&&r.push(n);return this.allSubtypes[t]=r,r}}};function qX(t){return"object"==typeof t&&null!==t&&Array.isArray(t.content)}function jX(t){return"object"==typeof t&&null!==t&&"object"==typeof t.tokenType}function WX(t){return qX(t)&&"string"==typeof t.fullText}o(qX,"isCompositeCstNode"),o(jX,"isLeafCstNode"),o(WX,"isRootCstNode");var YX=class t{static{o(this,"StreamImpl")}constructor(t,e){this.startFn=t,this.nextFn=e}iterator(){const t={state:this.startFn(),next:o((()=>this.nextFn(t.state)),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){const t=this.iterator();return Boolean(t.next().done)}count(){const t=this.iterator();let e=0,r=t.next();for(;!r.done;)e++,r=t.next();return e}toArray(){const t=[],e=this.iterator();let r;do{r=e.next(),void 0!==r.value&&t.push(r.value)}while(!r.done);return t}toSet(){return new Set(this)}toMap(t,e){const r=this.map((r=>[t?t(r):r,e?e(r):r]));return new Map(r)}toString(){return this.join()}concat(e){return new t((()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()})),(t=>{let e;if(!t.firstDone){do{if(e=this.nextFn(t.first),!e.done)return e}while(!e.done);t.firstDone=!0}do{if(e=t.iterator.next(),!e.done)return e}while(!e.done);return KX}))}join(t=","){const e=this.iterator();let r,n="",i=!1;do{r=e.next(),r.done||(i&&(n+=t),n+=HX(r.value)),i=!0}while(!r.done);return n}indexOf(t,e=0){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(n>=e&&i.value===t)return n;i=r.next(),n++}return-1}every(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(!t(r.value))return!1;r=e.next()}return!0}some(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(t(r.value))return!0;r=e.next()}return!1}forEach(t){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)t(n.value,r),n=e.next(),r++}map(e){return new t(this.startFn,(t=>{const{done:r,value:n}=this.nextFn(t);return r?KX:{done:!1,value:e(n)}}))}filter(e){return new t(this.startFn,(t=>{let r;do{if(r=this.nextFn(t),!r.done&&e(r.value))return r}while(!r.done);return KX}))}nonNullable(){return this.filter((t=>null!=t))}reduce(t,e){const r=this.iterator();let n=e,i=r.next();for(;!i.done;)n=void 0===n?i.value:t(n,i.value),i=r.next();return n}reduceRight(t,e){return this.recursiveReduce(this.iterator(),t,e)}recursiveReduce(t,e,r){const n=t.next();if(n.done)return r;const i=this.recursiveReduce(t,e,r);return void 0===i?n.value:e(i,n.value)}find(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(t(r.value))return r.value;r=e.next()}}findIndex(t){const e=this.iterator();let r=0,n=e.next();for(;!n.done;){if(t(n.value))return r;n=e.next(),r++}return-1}includes(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(r.value===t)return!0;r=e.next()}return!1}flatMap(e){return new t((()=>({this:this.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:r,value:n}=this.nextFn(t.this);if(!r){const r=e(n);if(!VX(r))return{done:!1,value:r};t.iterator=r[Symbol.iterator]()}}while(t.iterator);return KX}))}flat(e){if(void 0===e&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new t((()=>({this:r.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:e,value:n}=r.nextFn(t.this);if(!e){if(!VX(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return KX}))}head(){const t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new t((()=>{const t=this.startFn();for(let r=0;r({size:0,state:this.startFn()})),(t=>(t.size++,t.size>e?KX:this.nextFn(t.state))))}distinct(e){return new t((()=>({set:new Set,internalState:this.startFn()})),(t=>{let r;do{if(r=this.nextFn(t.internalState),!r.done){const n=e?e(r.value):r.value;if(!t.set.has(n))return t.set.add(n),r}}while(!r.done);return KX}))}exclude(t,e){const r=new Set;for(const n of t){const t=e?e(n):n;r.add(t)}return this.filter((t=>{const n=e?e(t):t;return!r.has(n)}))}};function HX(t){return"string"==typeof t?t:void 0===t?"undefined":"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}function VX(t){return!!t&&"function"==typeof t[Symbol.iterator]}o(HX,"toString"),o(VX,"isIterable");var XX=new YX((()=>{}),(()=>KX)),KX=Object.freeze({done:!0,value:void 0});function ZX(...t){if(1===t.length){const e=t[0];if(e instanceof YX)return e;if(VX(e))return new YX((()=>e[Symbol.iterator]()),(t=>t.next()));if("number"==typeof e.length)return new YX((()=>({index:0})),(t=>t.index1?new YX((()=>({collIndex:0,arrIndex:0})),(e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:(null==r?void 0:r.includeRoot)?[[t][Symbol.iterator]()]:[e(t)[Symbol.iterator]()],pruned:!1})),(t=>{for(t.pruned&&(t.iterators.pop(),t.pruned=!1);t.iterators.length>0;){const r=t.iterators[t.iterators.length-1].next();if(!r.done)return t.iterators.push(e(r.value)[Symbol.iterator]()),r;t.iterators.pop()}return KX}))}iterator(){const t={state:this.startFn(),next:o((()=>this.nextFn(t.state)),"next"),prune:o((()=>{t.state.pruned=!0}),"prune"),[Symbol.iterator]:()=>t};return t}};function rK(t){return new eK(t,(t=>qX(t)?t.content:[]),{includeRoot:!0})}function nK(t){return rK(t).filter(jX)}function iK(t,e){for(;t.container;)if((t=t.container)===e)return!0;return!1}function aK(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function sK(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}function oK(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return JX.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineJX.After}!function(t){function e(t){return t.reduce(((t,e)=>t+e),0)}function r(t){return t.reduce(((t,e)=>t*e),0)}function n(t){return t.reduce(((t,e)=>Math.min(t,e)))}function i(t){return t.reduce(((t,e)=>Math.max(t,e)))}o(e,"sum"),t.sum=e,o(r,"product"),t.product=r,o(n,"min"),t.min=n,o(i,"max"),t.max=i}(QX||(QX={})),o(rK,"streamCst"),o(nK,"flattenCst"),o(iK,"isChildNode"),o(aK,"tokenToRange"),o(sK,"toDocumentSegment"),(tK=JX||(JX={}))[tK.Before=0]="Before",tK[tK.After=1]="After",tK[tK.OverlapFront=2]="OverlapFront",tK[tK.OverlapBack=3]="OverlapBack",tK[tK.Inside=4]="Inside",tK[tK.Outside=5]="Outside",o(oK,"compareRange"),o(lK,"inRange");var cK=/^[\w\p{L}]$/u;function hK(t,e,r=cK){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return pK(t,e)}}function uK(t,e){if(t){const r=mK(t,!0);if(r&&dK(r,e))return r;if(WX(t)){const r=t.content.findIndex((t=>!t.hidden));for(let n=r-1;n>=0;n--){const r=t.content[n];if(dK(r,e))return r}}}}function dK(t,e){return jX(t)&&e.includes(t.tokenType.name)}function pK(t,e){if(jX(t))return t;if(qX(t)){const r=fK(t,e,!1);if(r)return pK(r,e)}}function gK(t,e){if(jX(t))return t;if(qX(t)){const r=fK(t,e,!0);if(r)return gK(r,e)}}function fK(t,e,r){let n,i=0,a=t.content.length-1;for(;i<=a;){const s=Math.floor((i+a)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(n=r?o:void 0,i=s+1):a=s-1}return n}function mK(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const t=r.content[n];if(e||!t.hidden)return t}t=r}}function yK(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nfJ,findNameAssignment:()=>mJ,findNodeForKeyword:()=>pJ,findNodeForProperty:()=>hJ,findNodesForKeyword:()=>dJ,findNodesForKeywordInternal:()=>gJ,findNodesForProperty:()=>cJ,getActionAtElement:()=>vJ,getActionType:()=>AJ,getAllReachableRules:()=>aJ,getCrossReferenceTerminal:()=>oJ,getEntryRule:()=>nJ,getExplicitRuleType:()=>CJ,getHiddenRules:()=>iJ,getRuleType:()=>NJ,getRuleTypeName:()=>LJ,getTypeName:()=>SJ,isArrayCardinality:()=>bJ,isArrayOperator:()=>wJ,isCommentTerminal:()=>lJ,isDataType:()=>_J,isDataTypeRule:()=>kJ,isOptionalCardinality:()=>xJ,terminalRegex:()=>IJ});var TK=class extends Error{static{o(this,"ErrorWithLocation")}constructor(t,e){super(t?`${e} at ${t.range.start.line}:${t.range.start.character}`:e)}};function _K(t){throw new Error("Error! The input value was not handled.")}o(_K,"assertUnreachable");var EK={};h(EK,{AbstractElement:()=>FK,AbstractRule:()=>SK,AbstractType:()=>LK,Action:()=>MZ,Alternatives:()=>OZ,ArrayLiteral:()=>UK,ArrayType:()=>qK,Assignment:()=>BZ,BooleanLiteral:()=>WK,CharacterRange:()=>FZ,Condition:()=>IK,Conjunction:()=>HK,CrossReference:()=>UZ,Disjunction:()=>XK,EndOfFile:()=>qZ,Grammar:()=>ZK,GrammarImport:()=>JK,Group:()=>WZ,InferredType:()=>eZ,Interface:()=>nZ,Keyword:()=>HZ,LangiumGrammarAstReflection:()=>pQ,LangiumGrammarTerminals:()=>CK,NamedArgument:()=>aZ,NegatedToken:()=>XZ,Negation:()=>oZ,NumberLiteral:()=>cZ,Parameter:()=>uZ,ParameterReference:()=>pZ,ParserRule:()=>fZ,ReferenceType:()=>yZ,RegexToken:()=>ZZ,ReturnType:()=>xZ,RuleCall:()=>JZ,SimpleType:()=>wZ,StringLiteral:()=>TZ,TerminalAlternatives:()=>eQ,TerminalGroup:()=>nQ,TerminalRule:()=>EZ,TerminalRuleCall:()=>aQ,Type:()=>SZ,TypeAttribute:()=>LZ,TypeDefinition:()=>OK,UnionType:()=>IZ,UnorderedGroup:()=>oQ,UntilToken:()=>cQ,ValueLiteral:()=>BK,Wildcard:()=>uQ,isAbstractElement:()=>zK,isAbstractRule:()=>AK,isAbstractType:()=>NK,isAction:()=>DZ,isAlternatives:()=>PZ,isArrayLiteral:()=>GK,isArrayType:()=>jK,isAssignment:()=>$Z,isBooleanLiteral:()=>YK,isCharacterRange:()=>zZ,isCondition:()=>RK,isConjunction:()=>VK,isCrossReference:()=>GZ,isDisjunction:()=>KK,isEndOfFile:()=>jZ,isFeatureName:()=>MK,isGrammar:()=>QK,isGrammarImport:()=>tZ,isGroup:()=>YZ,isInferredType:()=>rZ,isInterface:()=>iZ,isKeyword:()=>VZ,isNamedArgument:()=>sZ,isNegatedToken:()=>KZ,isNegation:()=>lZ,isNumberLiteral:()=>hZ,isParameter:()=>dZ,isParameterReference:()=>gZ,isParserRule:()=>mZ,isPrimitiveType:()=>DK,isReferenceType:()=>vZ,isRegexToken:()=>QZ,isReturnType:()=>bZ,isRuleCall:()=>tQ,isSimpleType:()=>kZ,isStringLiteral:()=>_Z,isTerminalAlternatives:()=>rQ,isTerminalGroup:()=>iQ,isTerminalRule:()=>CZ,isTerminalRuleCall:()=>sQ,isType:()=>AZ,isTypeAttribute:()=>NZ,isTypeDefinition:()=>PK,isUnionType:()=>RZ,isUnorderedGroup:()=>lQ,isUntilToken:()=>hQ,isValueLiteral:()=>$K,isWildcard:()=>dQ,reflection:()=>gQ});var CK={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},SK="AbstractRule";function AK(t){return gQ.isInstance(t,SK)}o(AK,"isAbstractRule");var LK="AbstractType";function NK(t){return gQ.isInstance(t,LK)}o(NK,"isAbstractType");var IK="Condition";function RK(t){return gQ.isInstance(t,IK)}function MK(t){return DK(t)||"current"===t||"entry"===t||"extends"===t||"false"===t||"fragment"===t||"grammar"===t||"hidden"===t||"import"===t||"interface"===t||"returns"===t||"terminal"===t||"true"===t||"type"===t||"infer"===t||"infers"===t||"with"===t||"string"==typeof t&&/\^?[_a-zA-Z][\w_]*/.test(t)}function DK(t){return"string"===t||"number"===t||"boolean"===t||"Date"===t||"bigint"===t}o(RK,"isCondition"),o(MK,"isFeatureName"),o(DK,"isPrimitiveType");var OK="TypeDefinition";function PK(t){return gQ.isInstance(t,OK)}o(PK,"isTypeDefinition");var BK="ValueLiteral";function $K(t){return gQ.isInstance(t,BK)}o($K,"isValueLiteral");var FK="AbstractElement";function zK(t){return gQ.isInstance(t,FK)}o(zK,"isAbstractElement");var UK="ArrayLiteral";function GK(t){return gQ.isInstance(t,UK)}o(GK,"isArrayLiteral");var qK="ArrayType";function jK(t){return gQ.isInstance(t,qK)}o(jK,"isArrayType");var WK="BooleanLiteral";function YK(t){return gQ.isInstance(t,WK)}o(YK,"isBooleanLiteral");var HK="Conjunction";function VK(t){return gQ.isInstance(t,HK)}o(VK,"isConjunction");var XK="Disjunction";function KK(t){return gQ.isInstance(t,XK)}o(KK,"isDisjunction");var ZK="Grammar";function QK(t){return gQ.isInstance(t,ZK)}o(QK,"isGrammar");var JK="GrammarImport";function tZ(t){return gQ.isInstance(t,JK)}o(tZ,"isGrammarImport");var eZ="InferredType";function rZ(t){return gQ.isInstance(t,eZ)}o(rZ,"isInferredType");var nZ="Interface";function iZ(t){return gQ.isInstance(t,nZ)}o(iZ,"isInterface");var aZ="NamedArgument";function sZ(t){return gQ.isInstance(t,aZ)}o(sZ,"isNamedArgument");var oZ="Negation";function lZ(t){return gQ.isInstance(t,oZ)}o(lZ,"isNegation");var cZ="NumberLiteral";function hZ(t){return gQ.isInstance(t,cZ)}o(hZ,"isNumberLiteral");var uZ="Parameter";function dZ(t){return gQ.isInstance(t,uZ)}o(dZ,"isParameter");var pZ="ParameterReference";function gZ(t){return gQ.isInstance(t,pZ)}o(gZ,"isParameterReference");var fZ="ParserRule";function mZ(t){return gQ.isInstance(t,fZ)}o(mZ,"isParserRule");var yZ="ReferenceType";function vZ(t){return gQ.isInstance(t,yZ)}o(vZ,"isReferenceType");var xZ="ReturnType";function bZ(t){return gQ.isInstance(t,xZ)}o(bZ,"isReturnType");var wZ="SimpleType";function kZ(t){return gQ.isInstance(t,wZ)}o(kZ,"isSimpleType");var TZ="StringLiteral";function _Z(t){return gQ.isInstance(t,TZ)}o(_Z,"isStringLiteral");var EZ="TerminalRule";function CZ(t){return gQ.isInstance(t,EZ)}o(CZ,"isTerminalRule");var SZ="Type";function AZ(t){return gQ.isInstance(t,SZ)}o(AZ,"isType");var LZ="TypeAttribute";function NZ(t){return gQ.isInstance(t,LZ)}o(NZ,"isTypeAttribute");var IZ="UnionType";function RZ(t){return gQ.isInstance(t,IZ)}o(RZ,"isUnionType");var MZ="Action";function DZ(t){return gQ.isInstance(t,MZ)}o(DZ,"isAction");var OZ="Alternatives";function PZ(t){return gQ.isInstance(t,OZ)}o(PZ,"isAlternatives");var BZ="Assignment";function $Z(t){return gQ.isInstance(t,BZ)}o($Z,"isAssignment");var FZ="CharacterRange";function zZ(t){return gQ.isInstance(t,FZ)}o(zZ,"isCharacterRange");var UZ="CrossReference";function GZ(t){return gQ.isInstance(t,UZ)}o(GZ,"isCrossReference");var qZ="EndOfFile";function jZ(t){return gQ.isInstance(t,qZ)}o(jZ,"isEndOfFile");var WZ="Group";function YZ(t){return gQ.isInstance(t,WZ)}o(YZ,"isGroup");var HZ="Keyword";function VZ(t){return gQ.isInstance(t,HZ)}o(VZ,"isKeyword");var XZ="NegatedToken";function KZ(t){return gQ.isInstance(t,XZ)}o(KZ,"isNegatedToken");var ZZ="RegexToken";function QZ(t){return gQ.isInstance(t,ZZ)}o(QZ,"isRegexToken");var JZ="RuleCall";function tQ(t){return gQ.isInstance(t,JZ)}o(tQ,"isRuleCall");var eQ="TerminalAlternatives";function rQ(t){return gQ.isInstance(t,eQ)}o(rQ,"isTerminalAlternatives");var nQ="TerminalGroup";function iQ(t){return gQ.isInstance(t,nQ)}o(iQ,"isTerminalGroup");var aQ="TerminalRuleCall";function sQ(t){return gQ.isInstance(t,aQ)}o(sQ,"isTerminalRuleCall");var oQ="UnorderedGroup";function lQ(t){return gQ.isInstance(t,oQ)}o(lQ,"isUnorderedGroup");var cQ="UntilToken";function hQ(t){return gQ.isInstance(t,cQ)}o(hQ,"isUntilToken");var uQ="Wildcard";function dQ(t){return gQ.isInstance(t,uQ)}o(dQ,"isWildcard");var pQ=class extends GX{static{o(this,"LangiumGrammarAstReflection")}getAllTypes(){return[FK,SK,LK,MZ,OZ,UK,qK,BZ,WK,FZ,IK,HK,UZ,XK,qZ,ZK,JK,WZ,eZ,nZ,HZ,aZ,XZ,oZ,cZ,uZ,pZ,fZ,yZ,ZZ,xZ,JZ,wZ,TZ,eQ,nQ,EZ,aQ,SZ,LZ,OK,IZ,oQ,cQ,BK,uQ]}computeIsSubtype(t,e){switch(t){case MZ:case OZ:case BZ:case FZ:case UZ:case qZ:case WZ:case HZ:case XZ:case ZZ:case JZ:case eQ:case nQ:case aQ:case oQ:case cQ:case uQ:return this.isSubtype(FK,e);case UK:case cZ:case TZ:return this.isSubtype(BK,e);case qK:case yZ:case wZ:case IZ:return this.isSubtype(OK,e);case WK:return this.isSubtype(IK,e)||this.isSubtype(BK,e);case HK:case XK:case oZ:case pZ:return this.isSubtype(IK,e);case eZ:case nZ:case SZ:return this.isSubtype(LK,e);case fZ:return this.isSubtype(SK,e)||this.isSubtype(LK,e);case EZ:return this.isSubtype(SK,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;switch(e){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return LK;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return SK;case"Grammar:usedGrammars":return ZK;case"NamedArgument:parameter":case"ParameterReference:parameter":return uZ;case"TerminalRuleCall:rule":return EZ;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case FK:return{name:FK,properties:[{name:"cardinality"},{name:"lookahead"}]};case UK:return{name:UK,properties:[{name:"elements",defaultValue:[]}]};case qK:return{name:qK,properties:[{name:"elementType"}]};case WK:return{name:WK,properties:[{name:"true",defaultValue:!1}]};case HK:return{name:HK,properties:[{name:"left"},{name:"right"}]};case XK:return{name:XK,properties:[{name:"left"},{name:"right"}]};case ZK:return{name:ZK,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case JK:return{name:JK,properties:[{name:"path"}]};case eZ:return{name:eZ,properties:[{name:"name"}]};case nZ:return{name:nZ,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case aZ:return{name:aZ,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case oZ:return{name:oZ,properties:[{name:"value"}]};case cZ:return{name:cZ,properties:[{name:"value"}]};case uZ:return{name:uZ,properties:[{name:"name"}]};case pZ:return{name:pZ,properties:[{name:"parameter"}]};case fZ:return{name:fZ,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case yZ:return{name:yZ,properties:[{name:"referenceType"}]};case xZ:return{name:xZ,properties:[{name:"name"}]};case wZ:return{name:wZ,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case TZ:return{name:TZ,properties:[{name:"value"}]};case EZ:return{name:EZ,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case SZ:return{name:SZ,properties:[{name:"name"},{name:"type"}]};case LZ:return{name:LZ,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case IZ:return{name:IZ,properties:[{name:"types",defaultValue:[]}]};case MZ:return{name:MZ,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case OZ:return{name:OZ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case BZ:return{name:BZ,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case FZ:return{name:FZ,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case UZ:return{name:UZ,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case qZ:return{name:qZ,properties:[{name:"cardinality"},{name:"lookahead"}]};case WZ:return{name:WZ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case HZ:return{name:HZ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case XZ:return{name:XZ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case ZZ:return{name:ZZ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case JZ:return{name:JZ,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case eQ:return{name:eQ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case nQ:return{name:nQ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case aQ:return{name:aQ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case oQ:return{name:oQ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case cQ:return{name:cQ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case uQ:return{name:uQ,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:t,properties:[]}}}},gQ=new pQ,fQ={};function mQ(t){for(const[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach(((r,n)=>{$X(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=n)})):$X(r)&&(r.$container=t,r.$containerProperty=e))}function yQ(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function vQ(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function xQ(t){const e=bQ(t).$document;if(!e)throw new Error("AST node has no document.");return e}function bQ(t){for(;t.$container;)t=t.$container;return t}function wQ(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=null==e?void 0:e.range;return new YX((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndexwQ(t,e)))}function TQ(t,e){if(!t)throw new Error("Root node must be an AstNode.");return(null==e?void 0:e.range)&&!_Q(t,e.range)?new eK(t,(()=>[])):new eK(t,(t=>wQ(t,e)),{includeRoot:!0})}function _Q(t,e){var r;if(!e)return!0;const n=null===(r=t.$cstNode)||void 0===r?void 0:r.range;return!!n&&lK(n,e)}function EQ(t){return new YX((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndex{EQ(e).forEach((e=>{e.reference.ref===t&&r.push(e.reference)}))})),ZX(r)}function SQ(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const t of r.properties)void 0!==t.defaultValue&&void 0===n[t.name]&&(n[t.name]=AQ(t.defaultValue))}function AQ(t){return Array.isArray(t)?[...t.map(AQ)]:t}function LQ(t,e){const r={$type:t.$type};for(const[n,i]of Object.entries(t))if(!n.startsWith("$"))if($X(i))r[n]=LQ(i,e);else if(FX(i))r[n]=e(r,n,i.$refNode,i.$refText);else if(Array.isArray(i)){const t=[];for(const a of i)$X(a)?t.push(LQ(a,e)):FX(a)?t.push(e(r,n,a.$refNode,a.$refText)):t.push(a);r[n]=t}else r[n]=i;return mQ(r),r}h(fQ,{assignMandatoryProperties:()=>SQ,copyAstNode:()=>LQ,findLocalReferences:()=>CQ,findRootNode:()=>bQ,getContainerOfType:()=>yQ,getDocument:()=>xQ,hasContainerOfType:()=>vQ,linkContentToContainer:()=>mQ,streamAllContents:()=>kQ,streamAst:()=>TQ,streamContents:()=>wQ,streamReferences:()=>EQ}),o(mQ,"linkContentToContainer"),o(yQ,"getContainerOfType"),o(vQ,"hasContainerOfType"),o(xQ,"getDocument"),o(bQ,"findRootNode"),o(wQ,"streamContents"),o(kQ,"streamAllContents"),o(TQ,"streamAst"),o(_Q,"isAstNodeInRange"),o(EQ,"streamReferences"),o(CQ,"findLocalReferences"),o(SQ,"assignMandatoryProperties"),o(AQ,"copyDefaultValue"),o(LQ,"copyAstNode");var NQ={};function IQ(t){return t.charCodeAt(0)}function RQ(t,e){Array.isArray(t)?t.forEach((function(t){e.push(t)})):e.push(t)}function MQ(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e],t[e]=!0}function DQ(t){if(void 0===t)throw Error("Internal Error - Should never get here!");return!0}function OQ(){throw Error("Internal Error - Should never get here!")}function PQ(t){return"Character"===t.type}h(NQ,{NEWLINE_REGEXP:()=>WQ,escapeRegExp:()=>JQ,getCaseInsensitivePattern:()=>tJ,getTerminalParts:()=>XQ,isMultilineComment:()=>KQ,isWhitespace:()=>QQ,partialMatches:()=>eJ,partialRegExp:()=>rJ,whitespaceCharacters:()=>ZQ}),o(IQ,"cc"),o(RQ,"insertToSet"),o(MQ,"addFlag"),o(DQ,"ASSERT_EXISTS"),o(OQ,"ASSERT_NEVER_REACH_HERE"),o(PQ,"isCharacter");var BQ=[];for(let t=IQ("0");t<=IQ("9");t++)BQ.push(t);var $Q=[IQ("_")].concat(BQ);for(let t=IQ("a");t<=IQ("z");t++)$Q.push(t);for(let t=IQ("A");t<=IQ("Z");t++)$Q.push(t);var FQ=[IQ(" "),IQ("\f"),IQ("\n"),IQ("\r"),IQ("\t"),IQ("\v"),IQ("\t"),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ(" "),IQ("\u2028"),IQ("\u2029"),IQ(" "),IQ(" "),IQ(" "),IQ("\ufeff")],zQ=/[0-9a-fA-F]/,UQ=/[0-9]/,GQ=/[1-9]/,qQ=class{static{o(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");const e=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":MQ(r,"global");break;case"i":MQ(r,"ignoreCase");break;case"m":MQ(r,"multiLine");break;case"u":MQ(r,"unicode");break;case"y":MQ(r,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:e,loc:this.loc(0)}}disjunction(){const t=[],e=this.idx;for(t.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(e)}}alternative(){const t=[],e=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(e)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":let e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}DQ(e);const r=this.disjunction();return this.consumeChar(")"),{type:e,value:r,loc:this.loc(t)}}return OQ()}quantifier(t=!1){let e;const r=this.idx;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":const r=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:r,atMost:r};break;case",":let t;this.isDigit()?(t=this.integerIncludingZero(),e={atLeast:r,atMost:t}):e={atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;DQ(e)}if(!0!==t||void 0!==e)return DQ(e)?("?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e.loc=this.loc(r),e):void 0}atom(){let t;const e=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}if(void 0===t&&this.isPatternCharacter()&&(t=this.patternCharacter()),DQ(t))return t.loc=this.loc(e),this.isQuantifier()&&(t.quantifier=this.quantifier()),t}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[IQ("\n"),IQ("\r"),IQ("\u2028"),IQ("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,e=!1;switch(this.popChar()){case"d":t=BQ;break;case"D":t=BQ,e=!0;break;case"s":t=FQ;break;case"S":t=FQ,e=!0;break;case"w":t=$Q;break;case"W":t=$Q,e=!0}if(DQ(t))return{type:"Set",value:t,complement:e}}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=IQ("\f");break;case"n":t=IQ("\n");break;case"r":t=IQ("\r");break;case"t":t=IQ("\t");break;case"v":t=IQ("\v")}if(DQ(t))return{type:"Character",value:t}}controlLetterEscapeAtom(){this.consumeChar("c");const t=this.popChar();if(!1===/[a-zA-Z]/.test(t))throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:IQ("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:IQ(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:IQ(this.popChar())}}}characterClass(){const t=[];let e=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),e=!0);this.isClassAtom();){const e=this.classAtom();if(e.type,PQ(e)&&this.isRangeDash()){this.consumeChar("-");const r=this.classAtom();if(r.type,PQ(r)){if(r.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(t){return{begin:t,end:this.idx}}},jQ=class{static{o(this,"BaseRegExpVisitor")}visitChildren(t){for(const e in t){const r=t[e];t.hasOwnProperty(e)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach((t=>{this.visit(t)}),this))}}visit(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t)}this.visitChildren(t)}visitPattern(t){}visitFlags(t){}visitDisjunction(t){}visitAlternative(t){}visitStartAnchor(t){}visitEndAnchor(t){}visitWordBoundary(t){}visitNonWordBoundary(t){}visitLookahead(t){}visitNegativeLookahead(t){}visitCharacter(t){}visitSet(t){}visitGroup(t){}visitGroupBackReference(t){}visitQuantifier(t){}},WQ=/\r?\n/gm,YQ=new qQ,HQ=class extends jQ{static{o(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(t){this.multiline=!1,this.regex=t,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(t){t.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(t){const e=String.fromCharCode(t.value);if(this.multiline||"\n"!==e||(this.multiline=!0),t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=JQ(e);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitSet(t){if(!this.multiline){const e=this.regex.substring(t.loc.begin,t.loc.end),r=new RegExp(e);this.multiline=Boolean("\n".match(r))}if(t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=this.regex.substring(t.loc.begin,t.loc.end);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitChildren(t){if("Group"===t.type){if(t.quantifier)return}super.visitChildren(t)}},VQ=new HQ;function XQ(t){try{"string"!=typeof t&&(t=t.source),t=`/${t}/`;const e=YQ.pattern(t),r=[];for(const n of e.value.value)VQ.reset(t),VQ.visit(n),r.push({start:VQ.startRegexp,end:VQ.endRegex});return r}catch(t){return[]}}function KQ(t){try{return"string"==typeof t&&(t=new RegExp(t)),t=t.toString(),VQ.reset(t),VQ.visit(YQ.pattern(t)),VQ.multiline}catch(t){return!1}}o(XQ,"getTerminalParts"),o(KQ,"isMultilineComment");var ZQ="\f\n\r\t\v              \u2028\u2029   \ufeff".split("");function QQ(t){const e="string"==typeof t?new RegExp(t):t;return ZQ.some((t=>e.test(t)))}function JQ(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tJ(t){return Array.prototype.map.call(t,(t=>/\w/.test(t)?`[${t.toLowerCase()}${t.toUpperCase()}]`:JQ(t))).join("")}function eJ(t,e){const r=rJ(t),n=e.match(r);return!!n&&n[0].length>0}function rJ(t){"string"==typeof t&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let t,a="";function s(t){a+=r.substr(n,t),n+=t}function l(t){a+="(?:"+r.substr(n,t)+"|$)",n+=t}for(o(s,"appendRaw"),o(l,"appendOptional");n",n)-n+1);break;default:l(2)}break;case"[":t=/\[(?:\\.|.)*?\]/g,t.lastIndex=n,t=t.exec(r)||[],l(t[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":t=/\{\d+,?\d*\}/g,t.lastIndex=n,t=t.exec(r),t?s(t[0].length):l(1);break;case"(":if("?"===r[n+1])switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":t=n,n+=3,i(),a+=r.substr(t,n-t);break;case"<":switch(r[n+3]){case"=":case"!":t=n,n+=4,i(),a+=r.substr(t,n-t);break;default:s(r.indexOf(">",n)-n+1),a+=i()+"|$)"}}else s(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1)}return a}return o(i,"process"),new RegExp(i(),t.flags)}function nJ(t){return t.rules.find((t=>mZ(t)&&t.entry))}function iJ(t){return t.rules.filter((t=>CZ(t)&&t.hidden))}function aJ(t,e){const r=new Set,n=nJ(t);if(!n)return new Set(t.rules);const i=[n].concat(iJ(t));for(const t of i)sJ(t,r,e);const a=new Set;for(const e of t.rules)(r.has(e.name)||CZ(e)&&e.hidden)&&a.add(e);return a}function sJ(t,e,r){e.add(t.name),kQ(t).forEach((t=>{if(tQ(t)||r&&sQ(t)){const n=t.rule.ref;n&&!e.has(n.name)&&sJ(n,e,r)}}))}function oJ(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=mJ(t.type.ref);return null==e?void 0:e.terminal}}function lJ(t){return t.hidden&&!QQ(IJ(t))}function cJ(t,e){return t&&e?uJ(t,e,t.astNode,!0):[]}function hJ(t,e,r){if(!t||!e)return;const n=uJ(t,e,t.astNode,!0);return 0!==n.length?n[r=void 0!==r?Math.max(0,Math.min(r,n.length-1)):0]:void 0}function uJ(t,e,r,n){if(!n){const r=yQ(t.grammarSource,$Z);if(r&&r.feature===e)return[t]}return qX(t)&&t.astNode===r?t.content.flatMap((t=>uJ(t,e,r,!1))):[]}function dJ(t,e){return t?gJ(t,e,null==t?void 0:t.astNode):[]}function pJ(t,e,r){if(!t)return;const n=gJ(t,e,null==t?void 0:t.astNode);return 0!==n.length?n[r=void 0!==r?Math.max(0,Math.min(r,n.length-1)):0]:void 0}function gJ(t,e,r){if(t.astNode!==r)return[];if(VZ(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=rK(t).iterator();let i;const a=[];do{if(i=n.next(),!i.done){const t=i.value;t.astNode===r?VZ(t.grammarSource)&&t.grammarSource.value===e&&a.push(t):n.prune()}}while(!i.done);return a}function fJ(t){var e;const r=t.astNode;for(;r===(null===(e=t.container)||void 0===e?void 0:e.astNode);){const e=yQ(t.grammarSource,$Z);if(e)return e;t=t.container}}function mJ(t){let e=t;return rZ(e)&&(DZ(e.$container)?e=e.$container.$container:mZ(e.$container)?e=e.$container:_K(e.$container)),yJ(t,e,new Map)}function yJ(t,e,r){var n;function i(e,n){let i;return yQ(e,$Z)||(i=yJ(n,n,r)),r.set(t,i),i}if(o(i,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of kQ(e)){if($Z(a)&&"name"===a.feature.toLowerCase())return r.set(t,a),a;if(tQ(a)&&mZ(a.rule.ref))return i(a,a.rule.ref);if(kZ(a)&&(null===(n=a.typeRef)||void 0===n?void 0:n.ref))return i(a,a.typeRef.ref)}}function vJ(t){const e=t.$container;if(YZ(e)){const r=e.elements;for(let e=r.indexOf(t)-1;e>=0;e--){const t=r[e];if(DZ(t))return t;{const t=kQ(r[e]).find(DZ);if(t)return t}}}return zK(e)?vJ(e):void 0}function xJ(t,e){return"?"===t||"*"===t||YZ(e)&&Boolean(e.guardCondition)}function bJ(t){return"*"===t||"+"===t}function wJ(t){return"+="===t}function kJ(t){return TJ(t,new Set)}function TJ(t,e){if(e.has(t))return!0;e.add(t);for(const r of kQ(t))if(tQ(r)){if(!r.rule.ref)return!1;if(mZ(r.rule.ref)&&!TJ(r.rule.ref,e))return!1}else{if($Z(r))return!1;if(DZ(r))return!1}return Boolean(t.definition)}function _J(t){return EJ(t.type,new Set)}function EJ(t,e){if(e.has(t))return!0;if(e.add(t),jK(t))return!1;if(vZ(t))return!1;if(RZ(t))return t.types.every((t=>EJ(t,e)));if(kZ(t)){if(void 0!==t.primitiveType)return!0;if(void 0!==t.stringType)return!0;if(void 0!==t.typeRef){const r=t.typeRef.ref;return!!AZ(r)&&EJ(r.type,e)}return!1}return!1}function CJ(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(mZ(e))return e.name;if(iZ(e)||AZ(e))return e.name}}}function SJ(t){var e;if(mZ(t))return kJ(t)?t.name:null!==(e=CJ(t))&&void 0!==e?e:t.name;if(iZ(t)||AZ(t)||bZ(t))return t.name;if(DZ(t)){const e=AJ(t);if(e)return e}else if(rZ(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function AJ(t){var e;return t.inferredType?t.inferredType.name:(null===(e=t.type)||void 0===e?void 0:e.ref)?SJ(t.type.ref):void 0}function LJ(t){var e,r,n;return CZ(t)?null!==(r=null===(e=t.type)||void 0===e?void 0:e.name)&&void 0!==r?r:"string":kJ(t)?t.name:null!==(n=CJ(t))&&void 0!==n?n:t.name}function NJ(t){var e,r,n;return CZ(t)?null!==(r=null===(e=t.type)||void 0===e?void 0:e.name)&&void 0!==r?r:"string":null!==(n=CJ(t))&&void 0!==n?n:t.name}function IJ(t){const e={s:!1,i:!1,u:!1},r=MJ(t.definition,e),n=Object.entries(e).filter((([,t])=>t)).map((([t])=>t)).join("");return new RegExp(r,n)}o(QQ,"isWhitespace"),o(JQ,"escapeRegExp"),o(tJ,"getCaseInsensitivePattern"),o(eJ,"partialMatches"),o(rJ,"partialRegExp"),o(nJ,"getEntryRule"),o(iJ,"getHiddenRules"),o(aJ,"getAllReachableRules"),o(sJ,"ruleDfs"),o(oJ,"getCrossReferenceTerminal"),o(lJ,"isCommentTerminal"),o(cJ,"findNodesForProperty"),o(hJ,"findNodeForProperty"),o(uJ,"findNodesForPropertyInternal"),o(dJ,"findNodesForKeyword"),o(pJ,"findNodeForKeyword"),o(gJ,"findNodesForKeywordInternal"),o(fJ,"findAssignment"),o(mJ,"findNameAssignment"),o(yJ,"findNameAssignmentInternal"),o(vJ,"getActionAtElement"),o(xJ,"isOptionalCardinality"),o(bJ,"isArrayCardinality"),o(wJ,"isArrayOperator"),o(kJ,"isDataTypeRule"),o(TJ,"isDataTypeRuleInternal"),o(_J,"isDataType"),o(EJ,"isDataTypeInternal"),o(CJ,"getExplicitRuleType"),o(SJ,"getTypeName"),o(AJ,"getActionType"),o(LJ,"getRuleTypeName"),o(NJ,"getRuleType"),o(IJ,"terminalRegex");var RJ=/[\s\S]/.source;function MJ(t,e){if(rQ(t))return DJ(t);if(iQ(t))return OJ(t);if(zZ(t))return $J(t);if(sQ(t)){const e=t.rule.ref;if(!e)throw new Error("Missing rule reference.");return zJ(MJ(e.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}if(KZ(t))return BJ(t);if(hQ(t))return PJ(t);if(QZ(t)){const r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),zJ(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}if(dQ(t))return zJ(RJ,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${null==t?void 0:t.$type}`)}function DJ(t){return zJ(t.elements.map((t=>MJ(t))).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function OJ(t){return zJ(t.elements.map((t=>MJ(t))).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function PJ(t){return zJ(`${RJ}*?${MJ(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function BJ(t){return zJ(`(?!${MJ(t.terminal)})${RJ}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function $J(t){return t.right?zJ(`[${FJ(t.left)}-${FJ(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):zJ(FJ(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function FJ(t){return JQ(t.value)}function zJ(t,e){var r;return(!1!==e.wrap||e.lookahead)&&(t=`(${null!==(r=e.lookahead)&&void 0!==r?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function UJ(t){const e=[],r=t.Grammar;for(const t of r.rules)CZ(t)&&lJ(t)&&KQ(IJ(t))&&e.push(t.name);return{multilineCommentRules:e,nameRegexp:cK}}function GJ(t){console&&console.error&&console.error(`Error: ${t}`)}function qJ(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function jJ(t){const e=(new Date).getTime(),r=t();return{time:(new Date).getTime()-e,value:r}}function WJ(t){function e(){}o(e,"FakeConstructor"),e.prototype=t;const r=new e;function n(){return typeof r.bar}return o(n,"fakeAccess"),n(),n(),t}function YJ(t){return HJ(t)?t.LABEL:t.name}function HJ(t){return oq(t.LABEL)&&""!==t.LABEL}o(MJ,"abstractElementToRegex"),o(DJ,"terminalAlternativesToRegex"),o(OJ,"terminalGroupToRegex"),o(PJ,"untilTokenToRegex"),o(BJ,"negateTokenToRegex"),o($J,"characterRangeToRegex"),o(FJ,"keywordToRegex"),o(zJ,"withCardinality"),o(UJ,"createGrammarConfig"),o(GJ,"PRINT_ERROR"),o(qJ,"PRINT_WARNING"),o(jJ,"timer"),o(WJ,"toFastProperties"),o(YJ,"tokenLabel"),o(HJ,"hasTokenLabel");var VJ=class{static{o(this,"AbstractProduction")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),iF(this.definition,(e=>{e.accept(t)}))}},XJ=class extends VJ{static{o(this,"NonTerminal")}constructor(t){super([]),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}set definition(t){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(t){t.visit(this)}},KJ=class extends VJ{static{o(this,"Rule")}constructor(t){super(t.definition),this.orgText="",lG(this,Sq(t,(t=>void 0!==t)))}},ZJ=class extends VJ{static{o(this,"Alternative")}constructor(t){super(t.definition),this.ignoreAmbiguities=!1,lG(this,Sq(t,(t=>void 0!==t)))}},QJ=class extends VJ{static{o(this,"Option")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},JJ=class extends VJ{static{o(this,"RepetitionMandatory")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},t0=class extends VJ{static{o(this,"RepetitionMandatoryWithSeparator")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},e0=class extends VJ{static{o(this,"Repetition")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},r0=class extends VJ{static{o(this,"RepetitionWithSeparator")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},n0=class extends VJ{static{o(this,"Alternation")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,lG(this,Sq(t,(t=>void 0!==t)))}},i0=class{static{o(this,"Terminal")}constructor(t){this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}accept(t){t.visit(this)}};function a0(t){return Gz(t,s0)}function s0(t){function e(t){return Gz(t,s0)}if(o(e,"convertDefinition"),t instanceof XJ){const e={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return oq(t.label)&&(e.label=t.label),e}if(t instanceof ZJ)return{type:"Alternative",definition:e(t.definition)};if(t instanceof QJ)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof JJ)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof t0)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:s0(new i0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof r0)return{type:"RepetitionWithSeparator",idx:t.idx,separator:s0(new i0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof e0)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof n0)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof i0){const e={type:"Terminal",name:t.terminalType.name,label:YJ(t.terminalType),idx:t.idx};oq(t.label)&&(e.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(e.pattern=yq(r)?r.source:r),e}if(t instanceof KJ)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}o(a0,"serializeGrammar"),o(s0,"serializeProduction");var o0=class{static{o(this,"GAstVisitor")}visit(t){const e=t;switch(e.constructor){case XJ:return this.visitNonTerminal(e);case ZJ:return this.visitAlternative(e);case QJ:return this.visitOption(e);case JJ:return this.visitRepetitionMandatory(e);case t0:return this.visitRepetitionMandatoryWithSeparator(e);case r0:return this.visitRepetitionWithSeparator(e);case e0:return this.visitRepetition(e);case n0:return this.visitAlternation(e);case i0:return this.visitTerminal(e);case KJ:return this.visitRule(e);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}};function l0(t){return t instanceof ZJ||t instanceof QJ||t instanceof e0||t instanceof JJ||t instanceof t0||t instanceof r0||t instanceof i0||t instanceof KJ}function c0(t,e=[]){return!!(t instanceof QJ||t instanceof e0||t instanceof r0)||(t instanceof n0?uj(t.definition,(t=>c0(t,e))):!(t instanceof XJ&&hq(e,t))&&(t instanceof VJ&&(t instanceof XJ&&e.push(t),$G(t.definition,(t=>c0(t,e))))))}function h0(t){return t instanceof n0}function u0(t){if(t instanceof XJ)return"SUBRULE";if(t instanceof QJ)return"OPTION";if(t instanceof n0)return"OR";if(t instanceof JJ)return"AT_LEAST_ONE";if(t instanceof t0)return"AT_LEAST_ONE_SEP";if(t instanceof r0)return"MANY_SEP";if(t instanceof e0)return"MANY";if(t instanceof i0)return"CONSUME";throw Error("non exhaustive match")}o(l0,"isSequenceProd"),o(c0,"isOptionalProd"),o(h0,"isBranchingProd"),o(u0,"getProductionDslName");var d0=class{static{o(this,"RestWalker")}walk(t,e=[]){iF(t.definition,((r,n)=>{const i=NG(t.definition,n+1);if(r instanceof XJ)this.walkProdRef(r,i,e);else if(r instanceof i0)this.walkTerminal(r,i,e);else if(r instanceof ZJ)this.walkFlat(r,i,e);else if(r instanceof QJ)this.walkOption(r,i,e);else if(r instanceof JJ)this.walkAtLeastOne(r,i,e);else if(r instanceof t0)this.walkAtLeastOneSep(r,i,e);else if(r instanceof r0)this.walkManySep(r,i,e);else if(r instanceof e0)this.walkMany(r,i,e);else{if(!(r instanceof n0))throw Error("non exhaustive match");this.walkOr(r,i,e)}}))}walkTerminal(t,e,r){}walkProdRef(t,e,r){}walkFlat(t,e,r){const n=e.concat(r);this.walk(t,n)}walkOption(t,e,r){const n=e.concat(r);this.walk(t,n)}walkAtLeastOne(t,e,r){const n=[new QJ({definition:t.definition})].concat(e,r);this.walk(t,n)}walkAtLeastOneSep(t,e,r){const n=p0(t,e,r);this.walk(t,n)}walkMany(t,e,r){const n=[new QJ({definition:t.definition})].concat(e,r);this.walk(t,n)}walkManySep(t,e,r){const n=p0(t,e,r);this.walk(t,n)}walkOr(t,e,r){const n=e.concat(r);iF(t.definition,(t=>{const e=new ZJ({definition:[t]});this.walk(e,n)}))}};function p0(t,e,r){return[new QJ({definition:[new i0({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function g0(t){if(t instanceof XJ)return g0(t.referencedRule);if(t instanceof i0)return y0(t);if(l0(t))return f0(t);if(h0(t))return m0(t);throw Error("non exhaustive match")}function f0(t){let e=[];const r=t.definition;let n,i=0,a=r.length>i,s=!0;for(;a&&s;)n=r[i],s=c0(n),e=e.concat(g0(n)),i+=1,a=r.length>i;return fj(e)}function m0(t){const e=Gz(t.definition,(t=>g0(t)));return fj(fU(e))}function y0(t){return[t.terminalType]}o(p0,"restForRepetitionWithSeparator"),o(g0,"first"),o(f0,"firstForSequence"),o(m0,"firstForBranching"),o(y0,"firstForTerminal");var v0="_~IN~_",x0=class extends d0{static{o(this,"ResyncFollowsWalker")}constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,e,r){}walkProdRef(t,e,r){const n=w0(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(r),a=g0(new ZJ({definition:i}));this.follows[n]=a}};function b0(t){const e={};return iF(t,(t=>{const r=new x0(t).startWalking();lG(e,r)})),e}function w0(t,e){return t.name+e+v0}o(b0,"computeAllProdsFollows"),o(w0,"buildBetweenProdsFollowPrefix");var k0={},T0=new qQ;function _0(t){const e=t.toString();if(k0.hasOwnProperty(e))return k0[e];{const t=T0.pattern(e);return k0[e]=t,t}}function E0(){k0={}}o(_0,"getRegExpAst"),o(E0,"clearRegExpParserCache");var C0="Complement Sets are not supported for first char optimization",S0='Unable to use "first char" lexer optimizations:\n';function A0(t,e=!1){try{const e=_0(t);return L0(e.value,{},e.flags.ignoreCase)}catch(r){if(r.message===C0)e&&qJ(`${S0}\tUnable to optimize: < ${t.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),GJ(`${S0}\n\tFailed parsing: < ${t.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function L0(t,e,r){switch(t.type){case"Disjunction":for(let n=0;n{if("number"==typeof t)N0(t,e,r);else{const n=t;if(!0===r)for(let t=n.from;t<=n.to;t++)N0(t,e,r);else{for(let t=n.from;t<=n.to&&t=f1){const t=n.from>=f1?n.from:f1,r=n.to,i=y1(t),a=y1(r);for(let t=i;t<=a;t++)e[t]=t}}}}));break;case"Group":L0(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}const s=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===M0(a)||"Group"!==a.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return Yz(e)}function N0(t,e,r){const n=y1(t);e[n]=n,!0===r&&I0(t,e)}function I0(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const t=y1(n.charCodeAt(0));e[t]=t}else{const t=r.toLowerCase();if(t!==r){const r=y1(t.charCodeAt(0));e[r]=r}}}function R0(t,e){return qG(t.value,(t=>{if("number"==typeof t)return hq(e,t);{const r=t;return void 0!==qG(e,(t=>r.from<=t&&t<=r.to))}}))}function M0(t){const e=t.quantifier;return!(!e||0!==e.atLeast)||!!t.value&&(Lb(t.value)?$G(t.value,M0):M0(t.value))}o(A0,"getOptimizedStartCodesIndices"),o(L0,"firstCharOptimizedIndices"),o(N0,"addOptimizedIdxToResult"),o(I0,"handleIgnoreCase"),o(R0,"findCode"),o(M0,"isWholeOptional");var D0=class extends jQ{static{o(this,"CharCodeFinder")}constructor(t){super(),this.targetCharCodes=t,this.found=!1}visitChildren(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}super.visitChildren(t)}}visitCharacter(t){hq(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?void 0===R0(t,this.targetCharCodes)&&(this.found=!0):void 0!==R0(t,this.targetCharCodes)&&(this.found=!0)}};function O0(t,e){if(e instanceof RegExp){const r=_0(e),n=new D0(t);return n.visit(r),n.found}return void 0!==qG(e,(e=>hq(t,e.charCodeAt(0))))}o(O0,"canMatchCharCode");var P0="PATTERN",B0="defaultMode",$0="modes",F0="boolean"==typeof new RegExp("(?:)").sticky;function z0(t,e){const r=(e=V$(e,{useSticky:F0,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:o(((t,e)=>e()),"tracer")})).tracer;let n;r("initCharCodeToOptimizedIndexMap",(()=>{v1()})),r("Reject Lexer.NA",(()=>{n=aj(t,(t=>t.PATTERN===$1.NA))}));let i,a,s,l,c,h,u,d,p,g,f,m=!1;r("Transform Patterns",(()=>{m=!1,i=Gz(n,(t=>{const r=t.PATTERN;if(yq(r)){const t=r.source;return 1!==t.length||"^"===t||"$"===t||"."===t||r.ignoreCase?2!==t.length||"\\"!==t[0]||hq(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],t[1])?e.useSticky?i1(r):n1(r):t[1]:t}if(dv(r))return m=!0,{exec:r};if("object"==typeof r)return m=!0,r;if("string"==typeof r){if(1===r.length)return r;{const t=r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),n=new RegExp(t);return e.useSticky?i1(n):n1(n)}}throw Error("non exhaustive match")}))})),r("misc mapping",(()=>{a=Gz(n,(t=>t.tokenTypeIdx)),s=Gz(n,(t=>{const e=t.GROUP;if(e!==$1.SKIPPED){if(oq(e))return e;if(Vz(e))return!1;throw Error("non exhaustive match")}})),l=Gz(n,(t=>{const e=t.LONGER_ALT;if(e){const t=Lb(e)?Gz(e,(t=>pq(n,t))):[pq(n,e)];return t}})),c=Gz(n,(t=>t.PUSH_MODE)),h=Gz(n,(t=>aq(t,"POP_MODE")))})),r("Line Terminator Handling",(()=>{const t=p1(e.lineTerminatorCharacters);u=Gz(n,(t=>!1)),"onlyOffset"!==e.positionTracking&&(u=Gz(n,(e=>aq(e,"LINE_BREAKS")?!!e.LINE_BREAKS:!1===u1(e,t)&&O0(t,e.PATTERN))))})),r("Misc Mapping #2",(()=>{d=Gz(n,l1),p=Gz(i,c1),g=_U(n,((t,e)=>{const r=e.GROUP;return oq(r)&&r!==$1.SKIPPED&&(t[r]=[]),t}),{}),f=Gz(i,((t,e)=>({pattern:i[e],longerAlt:l[e],canLineTerminator:u[e],isCustom:d[e],short:p[e],group:s[e],push:c[e],pop:h[e],tokenTypeIdx:a[e],tokenType:n[e]})))}));let y=!0,v=[];return e.safeMode||r("First Char Optimization",(()=>{v=_U(n,((t,r,n)=>{if("string"==typeof r.PATTERN){const e=y1(r.PATTERN.charCodeAt(0));g1(t,e,f[n])}else if(Lb(r.START_CHARS_HINT)){let e;iF(r.START_CHARS_HINT,(r=>{const i=y1("string"==typeof r?r.charCodeAt(0):r);e!==i&&(e=i,g1(t,i,f[n]))}))}else if(yq(r.PATTERN))if(r.PATTERN.unicode)y=!1,e.ensureOptimizations&&GJ(`${S0}\tUnable to analyze < ${r.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=A0(r.PATTERN,e.ensureOptimizations);iL(i)&&(y=!1),iF(i,(e=>{g1(t,e,f[n])}))}else e.ensureOptimizations&&GJ(`${S0}\tTokenType: <${r.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return t}),[])})),{emptyGroups:g,patternIdxToConfig:f,charCodeToPatternIdxToConfig:v,hasCustom:m,canBeOptimized:y}}function U0(t,e){let r=[];const n=q0(t);r=r.concat(n.errors);const i=j0(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(G0(a)),r=r.concat(Q0(a)),r=r.concat(J0(a,e)),r=r.concat(t1(a)),r}function G0(t){let e=[];const r=$z(t,(t=>yq(t.PATTERN)));return e=e.concat(Y0(r)),e=e.concat(X0(r)),e=e.concat(K0(r)),e=e.concat(Z0(r)),e=e.concat(H0(r)),e}function q0(t){const e=$z(t,(t=>!aq(t,P0)));return{errors:Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- missing static 'PATTERN' property",type:D1.MISSING_PATTERN,tokenTypes:[t]}))),valid:AG(t,e)}}function j0(t){const e=$z(t,(t=>{const e=t.PATTERN;return!(yq(e)||dv(e)||aq(e,"exec")||oq(e))}));return{errors:Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:D1.INVALID_PATTERN,tokenTypes:[t]}))),valid:AG(t,e)}}o(z0,"analyzeTokenTypes"),o(U0,"validatePatterns"),o(G0,"validateRegExpPattern"),o(q0,"findMissingPatterns"),o(j0,"findInvalidPatterns");var W0=/[^\\][$]/;function Y0(t){class e extends jQ{static{o(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(t){this.found=!0}}const r=$z(t,(t=>{const r=t.PATTERN;try{const t=_0(r),n=new e;return n.visit(t),n.found}catch(t){return W0.test(r.source)}}));return Gz(r,(t=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:D1.EOI_ANCHOR_FOUND,tokenTypes:[t]})))}function H0(t){const e=$z(t,(t=>t.PATTERN.test("")));return Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:D1.EMPTY_MATCH_PATTERN,tokenTypes:[t]})))}o(Y0,"findEndOfInputAnchor"),o(H0,"findEmptyMatchRegExps");var V0=/[^\\[][\^]|^\^/;function X0(t){class e extends jQ{static{o(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(t){this.found=!0}}const r=$z(t,(t=>{const r=t.PATTERN;try{const t=_0(r),n=new e;return n.visit(t),n.found}catch(t){return V0.test(r.source)}}));return Gz(r,(t=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:D1.SOI_ANCHOR_FOUND,tokenTypes:[t]})))}function K0(t){const e=$z(t,(t=>{const e=t.PATTERN;return e instanceof RegExp&&(e.multiline||e.global)}));return Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:D1.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]})))}function Z0(t){const e=[];let r=Gz(t,(r=>_U(t,((t,n)=>(r.PATTERN.source!==n.PATTERN.source||hq(e,n)||n.PATTERN===$1.NA||(e.push(n),t.push(n)),t)),[])));r=yG(r);const n=$z(r,(t=>t.length>1));return Gz(n,(t=>{const e=Gz(t,(t=>t.name));return{message:`The same RegExp pattern ->${WG(t).PATTERN}<-has been used in all of the following Token Types: ${e.join(", ")} <-`,type:D1.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}}))}function Q0(t){const e=$z(t,(t=>{if(!aq(t,"GROUP"))return!1;const e=t.GROUP;return e!==$1.SKIPPED&&e!==$1.NA&&!oq(e)}));return Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:D1.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]})))}function J0(t,e){const r=$z(t,(t=>void 0!==t.PUSH_MODE&&!hq(e,t.PUSH_MODE)));return Gz(r,(t=>({message:`Token Type: ->${t.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${t.PUSH_MODE}<-which does not exist`,type:D1.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]})))}function t1(t){const e=[],r=_U(t,((t,e,r)=>{const n=e.PATTERN;return n===$1.NA||(oq(n)?t.push({str:n,idx:r,tokenType:e}):yq(n)&&r1(n)&&t.push({str:n.source,idx:r,tokenType:e})),t}),[]);return iF(t,((t,n)=>{iF(r,(({str:r,idx:i,tokenType:a})=>{if(n${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${t.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:r,type:D1.UNREACHABLE_PATTERN,tokenTypes:[t,a]})}}))})),e}function e1(t,e){if(yq(e)){const r=e.exec(t);return null!==r&&0===r.index}if(dv(e))return e(t,0,[],{});if(aq(e,"exec"))return e.exec(t,0,[],{});if("string"==typeof e)return e===t;throw Error("non exhaustive match")}function r1(t){return void 0===qG([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(e=>-1!==t.source.indexOf(e)))}function n1(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function i1(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function a1(t,e,r){const n=[];return aq(t,B0)||n.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:D1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),aq(t,$0)||n.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:D1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),aq(t,$0)&&aq(t,B0)&&!aq(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a defaultMode: <${t.defaultMode}>which does not exist\n`,type:D1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),aq(t,$0)&&iF(t.modes,((t,e)=>{iF(t,((r,i)=>{if(Vz(r))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${e}> at index: <${i}>\n`,type:D1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(aq(r,"LONGER_ALT")){const i=Lb(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];iF(i,(i=>{Vz(i)||hq(t,i)||n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${e}>\n`,type:D1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),n}function s1(t,e,r){const n=[];let i=!1;const a=yG(fU(Yz(t.modes))),s=aj(a,(t=>t.PATTERN===$1.NA)),o=p1(r);return e&&iF(s,(t=>{const e=u1(t,o);if(!1!==e){const r={message:d1(t,e),type:e.issue,tokenType:t};n.push(r)}else aq(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):O0(o,t.PATTERN)&&(i=!0)})),e&&!i&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:D1.NO_LINE_BREAKS_FLAGS}),n}function o1(t){const e={},r=zB(t);return iF(r,(r=>{const n=t[r];if(!Lb(n))throw Error("non exhaustive match");e[r]=[]})),e}function l1(t){const e=t.PATTERN;if(yq(e))return!1;if(dv(e))return!0;if(aq(e,"exec"))return!0;if(oq(e))return!1;throw Error("non exhaustive match")}function c1(t){return!(!oq(t)||1!==t.length)&&t.charCodeAt(0)}o(X0,"findStartOfInputAnchor"),o(K0,"findUnsupportedFlags"),o(Z0,"findDuplicatePatterns"),o(Q0,"findInvalidGroupType"),o(J0,"findModesThatDoNotExist"),o(t1,"findUnreachablePatterns"),o(e1,"testTokenType"),o(r1,"noMetaChar"),o(n1,"addStartOfInput"),o(i1,"addStickyFlag"),o(a1,"performRuntimeChecks"),o(s1,"performWarningRuntimeChecks"),o(o1,"cloneEmptyGroups"),o(l1,"isCustomPattern"),o(c1,"isShortPattern");var h1={test:o((function(t){const e=t.length;for(let r=this.lastIndex;r Token Type\n\t Root cause: ${e.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===D1.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${t.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function p1(t){return Gz(t,(t=>oq(t)?t.charCodeAt(0):t))}function g1(t,e,r){void 0===t[e]?t[e]=[r]:t[e].push(r)}o(u1,"checkLineBreaksIssues"),o(d1,"buildLineBreakIssueMessage"),o(p1,"getCharCodes"),o(g1,"addToMapOfArrays");var f1=256,m1=[];function y1(t){return t255?255+~~(t/255):t}}function x1(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx||!0===e.isParent&&!0===e.categoryMatchesMap[r]}function b1(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}o(y1,"charCodeToOptimizedIndex"),o(v1,"initCharCodeToOptimizedIndexMap"),o(x1,"tokenStructuredMatcher"),o(b1,"tokenStructuredMatcherNoCategories");var w1=1,k1={};function T1(t){const e=_1(t);E1(e),S1(e),C1(e),iF(e,(t=>{t.isParent=t.categoryMatches.length>0}))}function _1(t){let e=j$(t),r=t,n=!0;for(;n;){r=yG(fU(Gz(r,(t=>t.CATEGORIES))));const t=AG(r,e);e=e.concat(t),iL(t)?n=!1:r=t}return e}function E1(t){iF(t,(t=>{L1(t)||(k1[w1]=t,t.tokenTypeIdx=w1++),N1(t)&&!Lb(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),N1(t)||(t.CATEGORIES=[]),I1(t)||(t.categoryMatches=[]),R1(t)||(t.categoryMatchesMap={})}))}function C1(t){iF(t,(t=>{t.categoryMatches=[],iF(t.categoryMatchesMap,((e,r)=>{t.categoryMatches.push(k1[r].tokenTypeIdx)}))}))}function S1(t){iF(t,(t=>{A1([],t)}))}function A1(t,e){iF(t,(t=>{e.categoryMatchesMap[t.tokenTypeIdx]=!0})),iF(e.CATEGORIES,(r=>{const n=t.concat(e);hq(n,r)||A1(n,r)}))}function L1(t){return aq(t,"tokenTypeIdx")}function N1(t){return aq(t,"CATEGORIES")}function I1(t){return aq(t,"categoryMatches")}function R1(t){return aq(t,"categoryMatchesMap")}function M1(t){return aq(t,"tokenTypeIdx")}o(T1,"augmentTokenTypes"),o(_1,"expandCategories"),o(E1,"assignTokenDefaultProps"),o(C1,"assignCategoriesTokensProp"),o(S1,"assignCategoriesMapProp"),o(A1,"singleAssignCategoriesToksMap"),o(L1,"hasShortKeyProperty"),o(N1,"hasCategoriesProperty"),o(I1,"hasExtendingTokensTypesProperty"),o(R1,"hasExtendingTokensTypesMapProperty"),o(M1,"isTokenType");var D1,O1,P1={buildUnableToPopLexerModeMessage:t=>`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(t,e,r,n,i)=>`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`};(O1=D1||(D1={}))[O1.MISSING_PATTERN=0]="MISSING_PATTERN",O1[O1.INVALID_PATTERN=1]="INVALID_PATTERN",O1[O1.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",O1[O1.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",O1[O1.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",O1[O1.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",O1[O1.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",O1[O1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",O1[O1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",O1[O1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",O1[O1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",O1[O1.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",O1[O1.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",O1[O1.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",O1[O1.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",O1[O1.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",O1[O1.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",O1[O1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var B1={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:P1,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(B1);var $1=class{static{o(this,"Lexer")}constructor(t,e=B1){if(this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(t,e)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:n,value:i}=jJ(e),a=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,i}return e()},"boolean"==typeof e)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=lG({},B1,e);const r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let r,n=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===B1.lineTerminatorsPattern)this.config.lineTerminatorsPattern=h1;else if(this.config.lineTerminatorCharacters===B1.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(e.safeMode&&e.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Lb(t)?r={modes:{defaultMode:j$(t)},defaultMode:B0}:(n=!1,r=j$(t))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(a1(r,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(s1(r,this.trackStartLines,this.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},iF(r.modes,((t,e)=>{r.modes[e]=aj(t,(t=>Vz(t)))}));const i=zB(r.modes);if(iF(r.modes,((t,r)=>{this.TRACE_INIT(`Mode: <${r}> processing`,(()=>{if(this.modes.push(r),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(U0(t,i))})),iL(this.lexerDefinitionErrors)){let n;T1(t),this.TRACE_INIT("analyzeTokenTypes",(()=>{n=z0(t,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[r]=n.patternIdxToConfig,this.charCodeToPatternIdxToConfig[r]=n.charCodeToPatternIdxToConfig,this.emptyGroups=lG({},this.emptyGroups,n.emptyGroups),this.hasCustom=n.hasCustom||this.hasCustom,this.canModeBeOptimized[r]=n.canBeOptimized}}))})),this.defaultMode=r.defaultMode,!iL(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const t=Gz(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}iF(this.lexerDefinitionWarning,(t=>{qJ(t.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(F0?(this.chopInput=Ow,this.match=this.matchWithTest):(this.updateLastIndex=$U,this.match=this.matchWithExec),n&&(this.handleModes=$U),!1===this.trackStartLines&&(this.computeNewColumn=Ow),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=$U),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)})),this.TRACE_INIT("Failed Optimization Warnings",(()=>{const t=_U(this.canModeBeOptimized,((t,e,r)=>(!1===e&&t.push(r),t)),[]);if(e.ensureOptimizations&&!iL(t))throw Error(`Lexer Modes: < ${t.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{E0()})),this.TRACE_INIT("toFastProperties",(()=>{WJ(this)}))}))}tokenize(t,e=this.defaultMode){if(!iL(this.lexerDefinitionErrors)){const t=Gz(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(t,e)}tokenizeInternal(t,e){let r,n,i,a,s,l,c,h,u,d,p,g,f,m,y;const v=t,x=v.length;let b=0,w=0;const k=this.hasCustom?0:Math.floor(t.length/10),T=new Array(k),_=[];let E=this.trackStartLines?1:void 0,C=this.trackStartLines?1:void 0;const S=o1(this.emptyGroups),A=this.trackStartLines,L=this.config.lineTerminatorsPattern;let N=0,I=[],R=[];const M=[],D=[];let O;function P(){return I}function B(t){const e=y1(t),r=R[e];return void 0===r?D:r}Object.freeze(D),o(P,"getPossiblePatternsSlow"),o(B,"getPossiblePatternsOptimized");const $=o((t=>{if(1===M.length&&void 0===t.tokenType.PUSH_MODE){const e=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(t);_.push({offset:t.startOffset,line:t.startLine,column:t.startColumn,length:t.image.length,message:e})}else{M.pop();const t=K$(M);I=this.patternIdxToConfig[t],R=this.charCodeToPatternIdxToConfig[t],N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=R&&e?B:P}}),"pop_mode");function F(t){M.push(t),R=this.charCodeToPatternIdxToConfig[t],I=this.patternIdxToConfig[t],N=I.length,N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=R&&e?B:P}let z;o(F,"push_mode"),F.call(this,e);const U=this.config.recoveryEnabled;for(;bl.length){l=a,c=h,z=e;break}}}break}}if(null!==l){if(u=l.length,d=z.group,void 0!==d&&(p=z.tokenTypeIdx,g=this.createTokenInstance(l,b,p,z.tokenType,E,C,u),this.handlePayload(g,c),!1===d?w=this.addToken(T,w,g):S[d].push(g)),t=this.chopInput(t,u),b+=u,C=this.computeNewColumn(C,u),!0===A&&!0===z.canLineTerminator){let t,e,r=0;L.lastIndex=0;do{t=L.test(l),!0===t&&(e=L.lastIndex-1,r++)}while(!0===t);0!==r&&(E+=r,C=u-e,this.updateTokenEndLineColumnLocation(g,d,e,r,E,C,u))}this.handleModes(z,$,F,g)}else{const e=b,r=E,i=C;let a=!1===U;for(;!1===a&&b`Expecting ${z1(t)?`--\x3e ${F1(t)} <--`:`token of type --\x3e ${t.name} <--`} but found --\x3e '${e.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:t,ruleName:e})=>"Redundant input, expecting EOF but found: "+t.image,buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",s="\nbut found: '"+WG(e).image+"'";if(n)return a+n+s;{const e=_U(t,((t,e)=>t.concat(e)),[]),r=Gz(e,(t=>`[${Gz(t,(t=>F1(t))).join(", ")}]`));return a+`one of these possible Token sequences:\n${Gz(r,((t,e)=>` ${e+1}. ${t}`)).join("\n")}`+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",a="\nbut found: '"+WG(e).image+"'";if(r)return i+r+a;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${Gz(t,(t=>`[${Gz(t,(t=>F1(t))).join(",")}]`)).join(" ,")}>`+a}};Object.freeze(t2);var e2={buildRuleNotFoundError:(t,e)=>"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"},r2={buildDuplicateFoundError(t,e){function r(t){return t instanceof i0?t.terminalType.name:t instanceof XJ?t.nonTerminalName:""}o(r,"getExtraProductionArgument");const n=t.name,i=WG(e),a=i.idx,s=u0(i),l=r(i);let c=`->${s}${a>0?a:""}<- ${l?`with argument: ->${l}<-`:""}\n appears more than once (${e.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:t=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(t){const e=Gz(t.prefixPath,(t=>F1(t))).join(", "),r=0===t.alternation.idx?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(t){const e=Gz(t.prefixPath,(t=>F1(t))).join(", "),r=0===t.alternation.idx?"":t.alternation.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return n+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",n},buildEmptyRepetitionError(t){let e=u0(t.repetition);0!==t.repetition.idx&&(e+=t.repetition.idx);return`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:t=>"deprecated",buildEmptyAlternationError:t=>`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:t=>`An Alternation cannot have more than 256 alternatives:\n inside <${t.topLevelRule.name}> Rule.\n has ${t.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(t){const e=t.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${e}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${e} --\x3e ${Gz(t.leftRecursionPath,(t=>t.name)).concat([e]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:t=>"deprecated",buildDuplicateRuleNameError(t){let e;e=t.topLevelRule instanceof KJ?t.topLevelRule.name:t.topLevelRule;return`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function n2(t,e){const r=new s2(t,e);return r.resolveRefs(),r.errors}o(n2,"resolveGrammar");var i2,a2,s2=class extends o0{static{o(this,"GastRefResolverVisitor")}constructor(t,e){super(),this.nameToTopRule=t,this.errMsgProvider=e,this.errors=[]}resolveRefs(){iF(Yz(this.nameToTopRule),(t=>{this.currTopLevel=t,t.accept(this)}))}visitNonTerminal(t){const e=this.nameToTopRule[t.nonTerminalName];if(e)t.referencedRule=e;else{const e=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:e,type:n5.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}},o2=class extends d0{static{o(this,"AbstractNextPossibleTokensWalker")}constructor(t,e){super(),this.topProd=t,this.path=e,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=j$(this.path.ruleStack).reverse(),this.occurrenceStack=j$(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,e=[]){this.found||super.walk(t,e)}walkProdRef(t,e,r){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){const n=e.concat(r);this.updateExpectedNext(),this.walk(t.referencedRule,n)}}updateExpectedNext(){iL(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},l2=class extends o2{static{o(this,"NextAfterTokenWalker")}constructor(t,e){super(t,e),this.path=e,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,e,r){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){const t=e.concat(r),n=new ZJ({definition:t});this.possibleTokTypes=g0(n),this.found=!0}}},c2=class extends d0{static{o(this,"AbstractNextTerminalAfterProductionWalker")}constructor(t,e){super(),this.topRule=t,this.occurrence=e,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},h2=class extends c2{static{o(this,"NextTerminalAfterManyWalker")}walkMany(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkMany(t,e,r)}},u2=class extends c2{static{o(this,"NextTerminalAfterManySepWalker")}walkManySep(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkManySep(t,e,r)}},d2=class extends c2{static{o(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOne(t,e,r)}},p2=class extends c2{static{o(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOneSep(t,e,r)}};function g2(t,e,r=[]){r=j$(r);let n=[],i=0;function a(e){return e.concat(NG(t,i+1))}function s(t){const i=g2(a(t),e,r);return n.concat(i)}for(o(a,"remainingPathWith"),o(s,"getAlternativesForProd");r.length{!1===iL(t.definition)&&(n=s(t.definition))})),n;if(!(e instanceof i0))throw Error("non exhaustive match");r.push(e.terminalType)}}i++}return n.push({partialPath:r,suffixDef:NG(t,i)}),n}function f2(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-n-1,h=[],u=[];for(u.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!iL(u);){const t=u.pop();if(t===s){o&&K$(u).idx<=c&&u.pop();continue}const n=t.def,d=t.idx,p=t.ruleStack,g=t.occurrenceStack;if(iL(n))continue;const f=n[0];if(f===i){const t={idx:d,def:NG(n),ruleStack:RG(p),occurrenceStack:RG(g)};u.push(t)}else if(f instanceof i0)if(d=0;t--){const e={idx:d,def:f.definition[t].definition.concat(NG(n)),ruleStack:p,occurrenceStack:g};u.push(e),u.push(s)}else if(f instanceof ZJ)u.push({idx:d,def:f.definition.concat(NG(n)),ruleStack:p,occurrenceStack:g});else{if(!(f instanceof KJ))throw Error("non exhaustive match");u.push(m2(f,d,p,g))}}return h}function m2(t,e,r,n){const i=j$(r);i.push(t.name);const a=j$(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}function y2(t){if(t instanceof QJ||"Option"===t)return i2.OPTION;if(t instanceof e0||"Repetition"===t)return i2.REPETITION;if(t instanceof JJ||"RepetitionMandatory"===t)return i2.REPETITION_MANDATORY;if(t instanceof t0||"RepetitionMandatoryWithSeparator"===t)return i2.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof r0||"RepetitionWithSeparator"===t)return i2.REPETITION_WITH_SEPARATOR;if(t instanceof n0||"Alternation"===t)return i2.ALTERNATION;throw Error("non exhaustive match")}function v2(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=y2(n);return a===i2.ALTERNATION?L2(e,r,i):N2(e,r,a,i)}function x2(t,e,r,n,i,a){const s=L2(t,e,r);return a(s,n,M2(s)?b1:x1,i)}function b2(t,e,r,n,i,a){const s=N2(t,e,i,r),o=M2(s)?b1:x1;return a(s[0],o,n)}function w2(t,e,r,n){const i=t.length,a=$G(t,(t=>$G(t,(t=>1===t.length))));if(e)return function(e){const n=Gz(e,(t=>t.GATE));for(let e=0;efU(t))),r=_U(e,((t,e,r)=>(iF(e,(e=>{aq(t,e.tokenTypeIdx)||(t[e.tokenTypeIdx]=r),iF(e.categoryMatches,(e=>{aq(t,e)||(t[e]=r)}))})),t)),{});return function(){const t=this.LA(1);return r[t.tokenTypeIdx]}}return function(){for(let e=0;e1===t.length)),i=t.length;if(n&&!r){const e=fU(t);if(1===e.length&&iL(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=_U(e,((t,e,r)=>(t[e.tokenTypeIdx]=!0,iF(e.categoryMatches,(e=>{t[e]=!0})),t)),[]);return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){t:for(let r=0;rg2([t],1))),n=E2(r.length),i=Gz(r,(t=>{const e={};return iF(t,(t=>{const r=C2(t.partialPath);iF(r,(t=>{e[t]=!0}))})),e}));let a=r;for(let t=1;t<=e;t++){const r=a;a=E2(r.length);for(let s=0;s{const e=C2(t.partialPath);iF(e,(t=>{i[s][t]=!0}))}))}}}}return n}function L2(t,e,r,n){const i=new _2(t,i2.ALTERNATION,n);return e.accept(i),A2(i.result,r)}function N2(t,e,r,n){const i=new _2(t,r);e.accept(i);const a=i.result,s=new T2(e,t,r).startWalking();return A2([new ZJ({definition:a}),new ZJ({definition:s})],n)}function I2(t,e){t:for(let r=0;r{const n=e[r];return t===n||n.categoryMatchesMap[t.tokenTypeIdx]}))}function M2(t){return $G(t,(t=>$G(t,(t=>$G(t,(t=>iL(t.categoryMatches)))))))}function D2(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Gz(e,(t=>Object.assign({type:n5.CUSTOM_LOOKAHEAD_VALIDATION},t)))}function O2(t,e,r,n){const i=HG(t,(t=>P2(t,r))),a=Q2(t,e,r),s=HG(t,(t=>V2(t,r))),o=HG(t,(e=>z2(e,t,n,r)));return i.concat(a,s,o)}function P2(t,e){const r=new F2;t.accept(r);const n=r.allProductions,i=tq(n,B2),a=Sq(i,(t=>t.length>1));return Gz(Yz(a),(r=>{const n=WG(r),i=e.buildDuplicateFoundError(t,r),a=u0(n),s={message:i,type:n5.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:n.idx},o=$2(n);return o&&(s.parameter=o),s}))}function B2(t){return`${u0(t)}_#_${t.idx}_#_${$2(t)}`}function $2(t){return t instanceof i0?t.terminalType.name:t instanceof XJ?t.nonTerminalName:""}o(E2,"initializeArrayOfArrays"),o(C2,"pathToHashKeys"),o(S2,"isUniquePrefixHash"),o(A2,"lookAheadSequenceFromAlternatives"),o(L2,"getLookaheadPathsForOr"),o(N2,"getLookaheadPathsForOptionalProd"),o(I2,"containsPath"),o(R2,"isStrictPrefixOfPath"),o(M2,"areTokenCategoriesNotUsed"),o(D2,"validateLookahead"),o(O2,"validateGrammar"),o(P2,"validateDuplicateProductions"),o(B2,"identifyProductionForDuplicates"),o($2,"getExtraProductionArgument");var F2=class extends o0{static{o(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}};function z2(t,e,r,n){const i=[];if(_U(e,((e,r)=>r.name===t.name?e+1:e),0)>1){const e=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:e,type:n5.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function U2(t,e,r){const n=[];let i;return hq(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:n5.INVALID_RULE_OVERRIDE,ruleName:t})),n}function G2(t,e,r,n=[]){const i=[],a=q2(e.definition);if(iL(a))return[];{const e=t.name;hq(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:n5.LEFT_RECURSION,ruleName:e});const s=AG(a,n.concat([t])),o=HG(s,(e=>{const i=j$(n);return i.push(e),G2(t,e,r,i)}));return i.concat(o)}}function q2(t){let e=[];if(iL(t))return e;const r=WG(t);if(r instanceof XJ)e.push(r.referencedRule);else if(r instanceof ZJ||r instanceof QJ||r instanceof JJ||r instanceof t0||r instanceof r0||r instanceof e0)e=e.concat(q2(r.definition));else if(r instanceof n0)e=fU(Gz(r.definition,(t=>q2(t.definition))));else if(!(r instanceof i0))throw Error("non exhaustive match");const n=c0(r),i=t.length>1;if(n&&i){const r=NG(t);return e.concat(q2(r))}return e}o(z2,"validateRuleDoesNotAlreadyExist"),o(U2,"validateRuleIsOverridden"),o(G2,"validateNoLeftRecursion"),o(q2,"getFirstNoneTerminal");var j2=class extends o0{static{o(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function W2(t,e){const r=new j2;t.accept(r);const n=r.alternations;return HG(n,(r=>{const n=RG(r.definition);return HG(n,((n,i)=>{const a=f2([n],[],x1,1);return iL(a)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:r,emptyChoiceIdx:i}),type:n5.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:r.idx,alternative:i+1}]:[]}))}))}function Y2(t,e,r){const n=new j2;t.accept(n);let i=n.alternations;i=aj(i,(t=>!0===t.ignoreAmbiguities));return HG(i,(n=>{const i=n.idx,a=n.maxLookahead||e,s=L2(i,t,a,n),o=K2(s,n,t,r),l=Z2(s,n,t,r);return o.concat(l)}))}o(W2,"validateEmptyOrAlternative"),o(Y2,"validateAmbiguousAlternationAlternatives");var H2=class extends o0{static{o(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}};function V2(t,e){const r=new j2;t.accept(r);const n=r.alternations;return HG(n,(r=>r.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:r}),type:n5.TOO_MANY_ALTS,ruleName:t.name,occurrence:r.idx}]:[]))}function X2(t,e,r){const n=[];return iF(t,(t=>{const i=new H2;t.accept(i);const a=i.allProductions;iF(a,(i=>{const a=y2(i),s=i.maxLookahead||e,o=N2(i.idx,t,a,s)[0];if(iL(fU(o))){const e=r.buildEmptyRepetitionError({topLevelRule:t,repetition:i});n.push({message:e,type:n5.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}}))})),n}function K2(t,e,r,n){const i=[],a=_U(t,((r,n,a)=>(!0===e.definition[a].ignoreAmbiguities||iF(n,(n=>{const s=[a];iF(t,((t,r)=>{a!==r&&I2(t,n)&&!0!==e.definition[r].ignoreAmbiguities&&s.push(r)})),s.length>1&&!I2(i,n)&&(i.push(n),r.push({alts:s,path:n}))})),r)),[]);return Gz(a,(t=>{const i=Gz(t.alts,(t=>t+1));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:n5.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:t.alts}}))}function Z2(t,e,r,n){const i=_U(t,((t,e,r)=>{const n=Gz(e,(t=>({idx:r,path:t})));return t.concat(n)}),[]);return yG(HG(i,(t=>{if(!0===e.definition[t.idx].ignoreAmbiguities)return[];const a=t.idx,s=t.path,o=$z(i,(t=>!0!==e.definition[t.idx].ignoreAmbiguities&&t.idx{const i=[t.idx+1,a+1],s=0===e.idx?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:n5.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:s,alternatives:i}}))})))}function Q2(t,e,r){const n=[],i=Gz(e,(t=>t.name));return iF(t,(t=>{const e=t.name;if(hq(i,e)){const i=r.buildNamespaceConflictError(t);n.push({message:i,type:n5.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}})),n}function J2(t){const e=V$(t,{errMsgProvider:e2}),r={};return iF(t.rules,(t=>{r[t.name]=t})),n2(r,e.errMsgProvider)}function t4(t){return O2((t=V$(t,{errMsgProvider:r2})).rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}o(V2,"validateTooManyAlts"),o(X2,"validateSomeNonEmptyLookaheadPath"),o(K2,"checkAlternativesAmbiguities"),o(Z2,"checkPrefixAlternativesAmbiguities"),o(Q2,"checkTerminalAndNoneTerminalsNameSpace"),o(J2,"resolveGrammar"),o(t4,"validateGrammar");var e4="MismatchedTokenException",r4="NoViableAltException",n4="EarlyExitException",i4="NotAllInputParsedException",a4=[e4,r4,n4,i4];function s4(t){return hq(a4,t.name)}Object.freeze(a4),o(s4,"isRecognitionException");var o4=class extends Error{static{o(this,"RecognitionException")}constructor(t,e){super(t),this.token=e,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},l4=class extends o4{static{o(this,"MismatchedTokenException")}constructor(t,e,r){super(t,e),this.previousToken=r,this.name=e4}},c4=class extends o4{static{o(this,"NoViableAltException")}constructor(t,e,r){super(t,e),this.previousToken=r,this.name=r4}},h4=class extends o4{static{o(this,"NotAllInputParsedException")}constructor(t,e){super(t,e),this.name=i4}},u4=class extends o4{static{o(this,"EarlyExitException")}constructor(t,e,r){super(t,e),this.previousToken=r,this.name=n4}},d4={},p4="InRuleRecoveryException",g4=class extends Error{static{o(this,"InRuleRecoveryException")}constructor(t){super(t),this.name=p4}},f4=class{static{o(this,"Recoverable")}initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=aq(t,"recoveryEnabled")?t.recoveryEnabled:a5.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=m4)}getTokenToInsert(t){const e=Q1(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,e,r,n){const i=this.findReSyncTokenType(),a=this.exportLexerState(),s=[];let l=!1;const c=this.LA(1);let h=this.LA(1);const u=o((()=>{const t=this.LA(0),e=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:t,ruleName:this.getCurrRuleFullName()}),r=new l4(e,c,this.LA(0));r.resyncedTokens=RG(s),this.SAVE_ERROR(r)}),"generateErrorMessage");for(;!l;){if(this.tokenMatcher(h,n))return void u();if(r.call(this))return u(),void t.apply(this,e);this.tokenMatcher(h,i)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,s))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(t,e,r){return!1!==r&&(!this.tokenMatcher(this.LA(1),t)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,e))))}getFollowsForInRuleRecovery(t,e){const r=this.getCurrentGrammarPath(t,e);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(t,e){if(this.canRecoverWithSingleTokenInsertion(t,e)){return this.getTokenToInsert(t)}if(this.canRecoverWithSingleTokenDeletion(t)){const t=this.SKIP_TOKEN();return this.consumeToken(),t}throw new g4("sad sad panda")}canPerformInRuleRecovery(t,e){return this.canRecoverWithSingleTokenInsertion(t,e)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,e){if(!this.canTokenTypeBeInsertedInRecovery(t))return!1;if(iL(e))return!1;const r=this.LA(1);return void 0!==qG(e,(t=>this.tokenMatcher(r,t)))}canRecoverWithSingleTokenDeletion(t){if(!this.canTokenTypeBeDeletedInRecovery(t))return!1;return this.tokenMatcher(this.LA(2),t)}isInCurrentRuleReSyncSet(t){const e=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(e);return hq(r,t)}findReSyncTokenType(){const t=this.flattenFollowSet();let e=this.LA(1),r=2;for(;;){const n=qG(t,(t=>J1(e,t)));if(void 0!==n)return n;e=this.LA(r),r++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return d4;const t=this.getLastExplicitRuleShortName(),e=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:e,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const t=this.RULE_STACK,e=this.RULE_OCCURRENCE_STACK;return Gz(t,((r,n)=>0===n?d4:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:e[n],inRule:this.shortRuleNameToFullName(t[n-1])}))}flattenFollowSet(){const t=Gz(this.buildFullFollowKeyStack(),(t=>this.getFollowSetFromFollowKey(t)));return fU(t)}getFollowSetFromFollowKey(t){if(t===d4)return[Z1];const e=t.ruleName+t.idxInCallingRule+v0+t.inRule;return this.resyncFollows[e]}addToResyncTokens(t,e){return this.tokenMatcher(t,Z1)||e.push(t),e}reSyncTo(t){const e=[];let r=this.LA(1);for(;!1===this.tokenMatcher(r,t);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,e);return RG(e)}attemptInRepetitionRecovery(t,e,r,n,i,a,s){}getCurrentGrammarPath(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:j$(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}}getHumanReadableRuleStack(){return Gz(this.RULE_STACK,(t=>this.shortRuleNameToFullName(t)))}};function m4(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(void 0===l){const t=this.getCurrRuleFullName();l=new a(this.getGAstProductions()[t],i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,h=l.occurrence;const u=l.isEndOfRule;1===this.RULE_STACK.length&&u&&void 0===c&&(c=Z1,h=1),void 0!==c&&void 0!==h&&this.shouldInRepetitionRecoveryBeTried(c,h,s)&&this.tryInRepetitionRecovery(t,e,r,c)}o(m4,"attemptInRepetitionRecovery");var y4=1024,v4=1280,x4=1536;function b4(t,e,r){return r|e|t}o(b4,"getKeyForAutomaticLookahead");var w4=class{static{o(this,"LLkLookaheadStrategy")}constructor(t){var e;this.maxLookahead=null!==(e=null==t?void 0:t.maxLookahead)&&void 0!==e?e:a5.maxLookahead}validate(t){const e=this.validateNoLeftRecursion(t.rules);if(iL(e)){const r=this.validateEmptyOrAlternatives(t.rules),n=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...e,...r,...n,...i]}return e}validateNoLeftRecursion(t){return HG(t,(t=>G2(t,t,r2)))}validateEmptyOrAlternatives(t){return HG(t,(t=>W2(t,r2)))}validateAmbiguousAlternationAlternatives(t,e){return HG(t,(t=>Y2(t,e,r2)))}validateSomeNonEmptyLookaheadPath(t,e){return X2(t,e,r2)}buildLookaheadForAlternation(t){return x2(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,w2)}buildLookaheadForOptional(t){return b2(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,y2(t.prodType),k2)}},k4=class{static{o(this,"LooksAhead")}initLooksAhead(t){this.dynamicTokensEnabled=aq(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:a5.dynamicTokensEnabled,this.maxLookahead=aq(t,"maxLookahead")?t.maxLookahead:a5.maxLookahead,this.lookaheadStrategy=aq(t,"lookaheadStrategy")?t.lookaheadStrategy:new w4({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){iF(t,(t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,(()=>{const{alternation:e,repetition:r,option:n,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:s}=E4(t);iF(e,(e=>{const r=0===e.idx?"":e.idx;this.TRACE_INIT(`${u0(e)}${r}`,(()=>{const r=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:e.idx,rule:t,maxLookahead:e.maxLookahead||this.maxLookahead,hasPredicates:e.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),n=b4(this.fullRuleNameToShort[t.name],256,e.idx);this.setLaFuncCache(n,r)}))})),iF(r,(e=>{this.computeLookaheadFunc(t,e.idx,768,"Repetition",e.maxLookahead,u0(e))})),iF(n,(e=>{this.computeLookaheadFunc(t,e.idx,512,"Option",e.maxLookahead,u0(e))})),iF(i,(e=>{this.computeLookaheadFunc(t,e.idx,y4,"RepetitionMandatory",e.maxLookahead,u0(e))})),iF(a,(e=>{this.computeLookaheadFunc(t,e.idx,x4,"RepetitionMandatoryWithSeparator",e.maxLookahead,u0(e))})),iF(s,(e=>{this.computeLookaheadFunc(t,e.idx,v4,"RepetitionWithSeparator",e.maxLookahead,u0(e))}))}))}))}computeLookaheadFunc(t,e,r,n,i,a){this.TRACE_INIT(`${a}${0===e?"":e}`,(()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:e,rule:t,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),s=b4(this.fullRuleNameToShort[t.name],r,e);this.setLaFuncCache(s,a)}))}getKeyForAutomaticLookahead(t,e){return b4(this.getLastExplicitRuleShortName(),t,e)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,e){this.lookAheadFuncsCache.set(t,e)}},T4=class extends o0{static{o(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}},_4=new T4;function E4(t){_4.reset(),t.accept(_4);const e=_4.dslMethods;return _4.reset(),e}function C4(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsett.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${e.join("\n\n").replace(/\n/g,"\n\t")}`)}}),"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function O4(t,e,r){const n=o((function(){}),"derivedConstructor");R4(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return iF(e,(t=>{i[t]=M4})),n.prototype=i,n.prototype.constructor=n,n}function P4(t,e){return B4(t,e)}function B4(t,e){const r=$z(e,(e=>!1===dv(t[e]))),n=Gz(r,(e=>({msg:`Missing visitor method: <${e}> on ${t.constructor.name} CST Visitor.`,type:N4.MISSING_METHOD,methodName:e})));return yG(n)}o(R4,"defineNameProp"),o(M4,"defaultVisit"),o(D4,"createBaseSemanticVisitorConstructor"),o(O4,"createBaseVisitorConstructorWithDefaults"),(I4=N4||(N4={}))[I4.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",I4[I4.MISSING_METHOD=1]="MISSING_METHOD",o(P4,"validateVisitor"),o(B4,"validateMissingCstMethods");var $4=class{static{o(this,"TreeBuilder")}initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=aq(t,"nodeLocationTracking")?t.nodeLocationTracking:a5.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=S4,this.setNodeLocationFromNode=S4,this.cstPostRule=$U,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=$U,this.setNodeLocationFromNode=$U,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=C4,this.setNodeLocationFromNode=C4,this.cstPostRule=$U,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=$U,this.setNodeLocationFromNode=$U,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${t.nodeLocationTracking}"`);this.setNodeLocationFromToken=$U,this.setNodeLocationFromNode=$U,this.cstPostRule=$U,this.setInitialNodeLocation=$U}else this.cstInvocationStateUpdate=$U,this.cstFinallyStateUpdate=$U,this.cstPostTerminal=$U,this.cstPostNonTerminal=$U,this.cstPostRule=$U}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(t){const e=this.LA(1);t.location={startOffset:e.startOffset,startLine:e.startLine,startColumn:e.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){const e={name:t,children:Object.create(null)};this.setInitialNodeLocation(e),this.CST_STACK.push(e)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){const e=this.LA(0),r=t.location;r.startOffset<=e.startOffset==!0?(r.endOffset=e.endOffset,r.endLine=e.endLine,r.endColumn=e.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(t){const e=this.LA(0),r=t.location;r.startOffset<=e.startOffset==!0?r.endOffset=e.endOffset:r.startOffset=NaN}cstPostTerminal(t,e){const r=this.CST_STACK[this.CST_STACK.length-1];A4(r,e,t),this.setNodeLocationFromToken(r.location,e)}cstPostNonTerminal(t,e){const r=this.CST_STACK[this.CST_STACK.length-1];L4(r,e,t),this.setNodeLocationFromNode(r.location,t.location)}getBaseCstVisitorConstructor(){if(Vz(this.baseCstVisitorConstructor)){const t=D4(this.className,zB(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Vz(this.baseCstVisitorWithDefaultsConstructor)){const t=O4(this.className,zB(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-1]}getPreviousExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-2]}getLastExplicitRuleOccurrenceIndex(){const t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]}},F4=class{static{o(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):r5}LA(t){const e=this.currIdx+t;return e<0||this.tokVectorLength<=e?r5:this.tokVector[e]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},z4=class{static{o(this,"RecognizerApi")}ACTION(t){return t.call(this)}consume(t,e,r){return this.consumeInternal(e,t,r)}subrule(t,e,r){return this.subruleInternal(e,t,r)}option(t,e){return this.optionInternal(e,t)}or(t,e){return this.orInternal(e,t)}many(t,e){return this.manyInternal(t,e)}atLeastOne(t,e){return this.atLeastOneInternal(t,e)}CONSUME(t,e){return this.consumeInternal(t,0,e)}CONSUME1(t,e){return this.consumeInternal(t,1,e)}CONSUME2(t,e){return this.consumeInternal(t,2,e)}CONSUME3(t,e){return this.consumeInternal(t,3,e)}CONSUME4(t,e){return this.consumeInternal(t,4,e)}CONSUME5(t,e){return this.consumeInternal(t,5,e)}CONSUME6(t,e){return this.consumeInternal(t,6,e)}CONSUME7(t,e){return this.consumeInternal(t,7,e)}CONSUME8(t,e){return this.consumeInternal(t,8,e)}CONSUME9(t,e){return this.consumeInternal(t,9,e)}SUBRULE(t,e){return this.subruleInternal(t,0,e)}SUBRULE1(t,e){return this.subruleInternal(t,1,e)}SUBRULE2(t,e){return this.subruleInternal(t,2,e)}SUBRULE3(t,e){return this.subruleInternal(t,3,e)}SUBRULE4(t,e){return this.subruleInternal(t,4,e)}SUBRULE5(t,e){return this.subruleInternal(t,5,e)}SUBRULE6(t,e){return this.subruleInternal(t,6,e)}SUBRULE7(t,e){return this.subruleInternal(t,7,e)}SUBRULE8(t,e){return this.subruleInternal(t,8,e)}SUBRULE9(t,e){return this.subruleInternal(t,9,e)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,e,r=s5){if(hq(this.definedRulesNames,t)){const e={message:r2.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:n5.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(e)}this.definedRulesNames.push(t);const n=this.defineRule(t,e,r);return this[t]=n,n}OVERRIDE_RULE(t,e,r=s5){const n=U2(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const i=this.defineRule(t,e,r);return this[t]=i,i}BACKTRACK(t,e){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(s4(t))return!1;throw t}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return a0(Yz(this.gastProductionsCache))}},U4=class{static{o(this,"RecognizerEngine")}initRecognizerEngine(t,e){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=b1,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},aq(e,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Lb(t)){if(iL(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Lb(t))this.tokensMap=_U(t,((t,e)=>(t[e.name]=e,t)),{});else if(aq(t,"modes")&&$G(fU(Yz(t.modes)),M1)){const e=fU(Yz(t.modes)),r=fj(e);this.tokensMap=_U(r,((t,e)=>(t[e.name]=e,t)),{})}else{if(!cv(t))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=j$(t)}this.tokensMap.EOF=Z1;const r=aq(t,"modes")?fU(Yz(t.modes)):Yz(t),n=$G(r,(t=>iL(t.categoryMatches)));this.tokenMatcher=n?b1:x1,T1(Yz(this.tokensMap))}defineRule(t,e,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=aq(r,"resyncEnabled")?r.resyncEnabled:s5.resyncEnabled,i=aq(r,"recoveryValueFunc")?r.recoveryValueFunc:s5.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let s;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=t,this.fullRuleNameToShort[t]=a,s=!0===this.outputCst?o((function(...r){try{this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,r);const n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}catch(t){return this.invokeRuleCatch(t,n,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTry"):o((function(...r){try{return this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,r)}catch(t){return this.invokeRuleCatch(t,n,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTryCst");return Object.assign(s,{ruleName:t,originalGrammarAction:e})}invokeRuleCatch(t,e,r){const n=1===this.RULE_STACK.length,i=e&&!this.isBackTracking()&&this.recoveryEnabled;if(s4(t)){const e=t;if(i){const n=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(n)){if(e.resyncedTokens=this.reSyncTo(n),this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];return t.recoveredNode=!0,t}return r(t)}if(this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];t.recoveredNode=!0,e.partialCstResult=t}throw e}if(n)return this.moveToTerminatedState(),r(t);throw e}throw t}optionInternal(t,e){const r=this.getKeyForAutomaticLookahead(512,e);return this.optionInternalLogic(t,e,r)}optionInternalLogic(t,e,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=o((()=>e.call(this)&&t.call(this)),"lookAheadFunc")}}else n=t;if(!0===i.call(this))return n.call(this)}atLeastOneInternal(t,e){const r=this.getKeyForAutomaticLookahead(y4,t);return this.atLeastOneInternalLogic(t,e,r)}atLeastOneInternalLogic(t,e,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=o((()=>t.call(this)&&e.call(this)),"lookAheadFunc")}}else n=e;if(!0!==i.call(this))throw this.raiseEarlyExitException(t,i2.REPETITION_MANDATORY,e.ERR_MSG);{let t=this.doSingleRepetition(n);for(;!0===i.call(this)&&!0===t;)t=this.doSingleRepetition(n)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,e],i,y4,t,d2)}atLeastOneSepFirstInternal(t,e){const r=this.getKeyForAutomaticLookahead(x4,t);this.atLeastOneSepFirstInternalLogic(t,e,r)}atLeastOneSepFirstInternalLogic(t,e,r){const n=e.DEF,i=e.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(t,i2.REPETITION_MANDATORY_WITH_SEPARATOR,e.ERR_MSG);{n.call(this);const e=o((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,n,p2],e,x4,t,p2)}}manyInternal(t,e){const r=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,e,r)}manyInternalLogic(t,e,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=o((()=>t.call(this)&&e.call(this)),"lookaheadFunction")}}else n=e;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[t,e],i,768,t,h2,a)}manySepFirstInternal(t,e){const r=this.getKeyForAutomaticLookahead(v4,t);this.manySepFirstInternalLogic(t,e,r)}manySepFirstInternalLogic(t,e,r){const n=e.DEF,i=e.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){n.call(this);const e=o((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,n,u2],e,v4,t,u2)}}repetitionSepSecondInternal(t,e,r,n,i){for(;r();)this.CONSUME(e),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,e,r,n,i],r,x4,t,i)}doSingleRepetition(t){const e=this.getLexerPosition();t.call(this);return this.getLexerPosition()>e}orInternal(t,e){const r=this.getKeyForAutomaticLookahead(256,e),n=Lb(t)?t:t.DEF,i=this.getLaFuncFromCache(r).call(this,n);if(void 0!==i){return n[i].ALT.call(this)}this.raiseNoAltException(e,t.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new h4(e,t))}}subruleInternal(t,e,r){let n;try{const i=void 0!==r?r.ARGS:void 0;return this.subruleIdx=e,n=t.apply(this,i),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:t.ruleName),n}catch(e){throw this.subruleInternalError(e,r,t.ruleName)}}subruleInternalError(t,e,r){throw s4(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==e&&void 0!==e.LABEL?e.LABEL:r),delete t.partialCstResult),t}consumeInternal(t,e,r){let n;try{const e=this.LA(1);!0===this.tokenMatcher(e,t)?(this.consumeToken(),n=e):this.consumeInternalError(t,e,r)}catch(r){n=this.consumeInternalRecovery(t,e,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:t.name,n),n}consumeInternalError(t,e,r){let n;const i=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:e,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new l4(n,e,i))}consumeInternalRecovery(t,e,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;{const n=this.getFollowsForInRuleRecovery(t,e);try{return this.tryInRuleRecovery(t,n)}catch(t){throw t.name===p4?r:t}}}saveRecogState(){const t=this.errors,e=j$(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK}ruleInvocationStateUpdate(t,e,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]}shortRuleNameToFullName(t){return this.shortRuleNameToFull[t]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Z1)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},G4=class{static{o(this,"ErrorHandler")}initErrorHandler(t){this._errors=[],this.errorMessageProvider=aq(t,"errorMessageProvider")?t.errorMessageProvider:a5.errorMessageProvider}SAVE_ERROR(t){if(s4(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:j$(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return j$(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,e,r){const n=this.getCurrRuleFullName(),i=N2(t,this.getGAstProductions()[n],e,this.maxLookahead)[0],a=[];for(let t=1;t<=this.maxLookahead;t++)a.push(this.LA(t));const s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new u4(s,this.LA(1),this.LA(0)))}raiseNoAltException(t,e){const r=this.getCurrRuleFullName(),n=L2(t,this.getGAstProductions()[r],this.maxLookahead),i=[];for(let t=1;t<=this.maxLookahead;t++)i.push(this.LA(t));const a=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:n,actual:i,previous:a,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new c4(s,this.LA(1),a))}},q4=class{static{o(this,"ContentAssist")}initContentAssist(){}computeContentAssist(t,e){const r=this.gastProductionsCache[t];if(Vz(r))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return f2([r],e,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){const e=WG(t.ruleStack),r=this.getGAstProductions()[e];return new l2(r,t).startWalking()}},j4={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(j4);var W4=Math.pow(2,8)-1,Y4=X1({name:"RECORDING_PHASE_TOKEN",pattern:$1.NA});T1([Y4]);var H4=Q1(Y4,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(H4);var V4={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},X4=class{static{o(this,"GastRecorder")}initGastRecorder(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let t=0;t<10;t++){const e=t>0?t:"";this[`CONSUME${e}`]=function(e,r){return this.consumeInternalRecord(e,t,r)},this[`SUBRULE${e}`]=function(e,r){return this.subruleInternalRecord(e,t,r)},this[`OPTION${e}`]=function(e){return this.optionInternalRecord(e,t)},this[`OR${e}`]=function(e){return this.orInternalRecord(e,t)},this[`MANY${e}`]=function(e){this.manyInternalRecord(t,e)},this[`MANY_SEP${e}`]=function(e){this.manySepFirstInternalRecord(t,e)},this[`AT_LEAST_ONE${e}`]=function(e){this.atLeastOneInternalRecord(t,e)},this[`AT_LEAST_ONE_SEP${e}`]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}}this.consume=function(t,e,r){return this.consumeInternalRecord(e,t,r)},this.subrule=function(t,e,r){return this.subruleInternalRecord(e,t,r)},this.option=function(t,e){return this.optionInternalRecord(e,t)},this.or=function(t,e){return this.orInternalRecord(e,t)},this.many=function(t,e){this.manyInternalRecord(t,e)},this.atLeastOne=function(t,e){this.atLeastOneInternalRecord(t,e)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD}))}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(()=>{const t=this;for(let e=0;e<10;e++){const r=e>0?e:"";delete t[`CONSUME${r}`],delete t[`SUBRULE${r}`],delete t[`OPTION${r}`],delete t[`OR${r}`],delete t[`MANY${r}`],delete t[`MANY_SEP${r}`],delete t[`AT_LEAST_ONE${r}`],delete t[`AT_LEAST_ONE_SEP${r}`]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA}))}ACTION_RECORD(t){}BACKTRACK_RECORD(t,e){return()=>!0}LA_RECORD(t){return r5}topLevelRuleRecord(t,e){try{const r=new KJ({definition:[],name:t});return r.name=t,this.recordingProdStack.push(r),e.call(this),this.recordingProdStack.pop(),r}catch(t){if(!0!==t.KNOWN_RECORDER_ERROR)try{t.message=t.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(e){throw t}throw t}}optionInternalRecord(t,e){return K4.call(this,QJ,t,e)}atLeastOneInternalRecord(t,e){K4.call(this,JJ,e,t)}atLeastOneSepFirstInternalRecord(t,e){K4.call(this,t0,e,t,true)}manyInternalRecord(t,e){K4.call(this,e0,e,t)}manySepFirstInternalRecord(t,e){K4.call(this,r0,e,t,true)}orInternalRecord(t,e){return Z4.call(this,t,e)}subruleInternalRecord(t,e,r){if(J4(e),!t||!1===aq(t,"ruleName")){const r=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw r.KNOWN_RECORDER_ERROR=!0,r}const n=K$(this.recordingProdStack),i=t.ruleName,a=new XJ({idx:e,nonTerminalName:i,label:null==r?void 0:r.LABEL,referencedRule:void 0});return n.definition.push(a),this.outputCst?V4:j4}consumeInternalRecord(t,e,r){if(J4(e),!L1(t)){const r=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw r.KNOWN_RECORDER_ERROR=!0,r}const n=K$(this.recordingProdStack),i=new i0({idx:e,terminalType:t,label:null==r?void 0:r.LABEL});return n.definition.push(i),H4}};function K4(t,e,r,n=!1){J4(r);const i=K$(this.recordingProdStack),a=dv(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),aq(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),j4}function Z4(t,e){J4(e);const r=K$(this.recordingProdStack),n=!1===Lb(t),i=!1===n?t:t.DEF,a=new n0({definition:[],idx:e,ignoreAmbiguities:n&&!0===t.IGNORE_AMBIGUITIES});aq(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=uj(i,(t=>dv(t.GATE)));return a.hasPredicates=s,r.definition.push(a),iF(i,(t=>{const e=new ZJ({definition:[]});a.definition.push(e),aq(t,"IGNORE_AMBIGUITIES")?e.ignoreAmbiguities=t.IGNORE_AMBIGUITIES:aq(t,"GATE")&&(e.ignoreAmbiguities=!0),this.recordingProdStack.push(e),t.ALT.call(this),this.recordingProdStack.pop()})),j4}function Q4(t){return 0===t?"":`${t}`}function J4(t){if(t<0||t>W4){const e=new Error(`Invalid DSL Method idx value: <${t}>\n\tIdx value must be a none negative value smaller than ${W4+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}o(K4,"recordProd"),o(Z4,"recordOrProd"),o(Q4,"getIdxSuffix"),o(J4,"assertMethodIdxIsValid");var t5=class{static{o(this,"PerformanceTracer")}initPerformanceTracer(t){if(aq(t,"traceInitPerf")){const e=t.traceInitPerf,r="number"==typeof e;this.traceInitMaxIdent=r?e:1/0,this.traceInitPerf=r?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=a5.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:n,value:i}=jJ(e),a=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,i}return e()}};function e5(t,e){e.forEach((e=>{const r=e.prototype;Object.getOwnPropertyNames(r).forEach((n=>{if("constructor"===n)return;const i=Object.getOwnPropertyDescriptor(r,n);i&&(i.get||i.set)?Object.defineProperty(t.prototype,n,i):t.prototype[n]=e.prototype[n]}))}))}o(e5,"applyMixins");var r5=Q1(Z1,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(r5);var n5,i5,a5=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:t2,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),s5=Object.freeze({recoveryValueFunc:o((()=>{}),"recoveryValueFunc"),resyncEnabled:!0});function o5(t){return function(){return t}}(i5=n5||(n5={}))[i5.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",i5[i5.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",i5[i5.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",i5[i5.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",i5[i5.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",i5[i5.LEFT_RECURSION=5]="LEFT_RECURSION",i5[i5.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",i5[i5.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",i5[i5.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",i5[i5.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",i5[i5.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",i5[i5.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",i5[i5.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",i5[i5.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION",o(o5,"EMPTY_ALT");var l5=class t{static{o(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",(()=>{WJ(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),iF(this.definedRulesNames,(t=>{const e=this[t].originalGrammarAction;let r;this.TRACE_INIT(`${t} Rule`,(()=>{r=this.topLevelRuleRecord(t,e)})),this.gastProductionsCache[t]=r}))}finally{this.disableRecording()}}));let n=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{n=J2({rules:Yz(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)})),this.TRACE_INIT("Grammar Validations",(()=>{if(iL(n)&&!1===this.skipValidations){const t=t4({rules:Yz(this.gastProductionsCache),tokenTypes:Yz(this.tokensMap),errMsgProvider:r2,grammarName:r}),e=D2({lookaheadStrategy:this.lookaheadStrategy,rules:Yz(this.gastProductionsCache),tokenTypes:Yz(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(t,e)}})),iL(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const t=b0(Yz(this.gastProductionsCache));this.resyncFollows=t})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var t,e;null===(e=(t=this.lookaheadStrategy).initialize)||void 0===e||e.call(t,{rules:Yz(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Yz(this.gastProductionsCache))}))),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!iL(this.definitionErrors))throw e=Gz(this.definitionErrors,(t=>t.message)),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)}))}constructor(t,e){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(e),r.initLexerAdapter(),r.initLooksAhead(e),r.initRecognizerEngine(t,e),r.initRecoverable(e),r.initTreeBuilder(e),r.initContentAssist(),r.initGastRecorder(e),r.initPerformanceTracer(e),aq(e,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=aq(e,"skipValidations")?e.skipValidations:a5.skipValidations}};l5.DEFER_DEFINITION_ERRORS_HANDLING=!1,e5(l5,[f4,k4,$4,F4,U4,z4,G4,q4,X4,t5]);var c5=class extends l5{static{o(this,"EmbeddedActionsParser")}constructor(t,e=a5){const r=j$(e);r.outputCst=!1,super(t,r)}};function h5(t,e,r){return`${t.name}_${e}_${r}`}o(h5,"buildATNKey");var u5=class{static{o(this,"AbstractTransition")}constructor(t){this.target=t}isEpsilon(){return!1}},d5=class extends u5{static{o(this,"AtomTransition")}constructor(t,e){super(t),this.tokenType=e}},p5=class extends u5{static{o(this,"EpsilonTransition")}constructor(t){super(t)}isEpsilon(){return!0}},g5=class extends u5{static{o(this,"RuleTransition")}constructor(t,e,r){super(t),this.rule=e,this.followState=r}isEpsilon(){return!0}};function f5(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};m5(e,t);const r=t.length;for(let n=0;ny5(t,e,r)));return L5(t,e,n,r,...i)}function T5(t,e,r){const n=P5(t,e,r,{type:1});A5(t,n);return S5(t,e,r,L5(t,e,n,r,_5(t,e,r)))}function _5(t,e,r){const n=$z(Gz(r.definition,(r=>y5(t,e,r))),(t=>void 0!==t));return 1===n.length?n[0]:0===n.length?void 0:I5(t,n)}function E5(t,e,r,n,i){const a=n.left,s=n.right,o=P5(t,e,r,{type:11});A5(t,o);const l=P5(t,e,r,{type:12});return a.loopback=o,l.loopback=o,t.decisionMap[h5(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,O5(s,o),void 0===i?(O5(o,a),O5(o,l)):(O5(o,l),O5(o,i.left),O5(i.right,a)),{left:a,right:l}}function C5(t,e,r,n,i){const a=n.left,s=n.right,o=P5(t,e,r,{type:10});A5(t,o);const l=P5(t,e,r,{type:12}),c=P5(t,e,r,{type:9});return o.loopback=c,l.loopback=c,O5(o,a),O5(o,l),O5(s,c),void 0!==i?(O5(c,l),O5(c,i.left),O5(i.right,a)):O5(c,o),t.decisionMap[h5(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function S5(t,e,r,n){const i=n.left;return O5(i,n.right),t.decisionMap[h5(e,"Option",r.idx)]=i,n}function A5(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function L5(t,e,r,n,...i){const a=P5(t,e,n,{type:8,start:r});r.end=a;for(const t of i)void 0!==t?(O5(r,t.left),O5(t.right,a)):O5(r,a);const s={left:r,right:a};return t.decisionMap[h5(e,N5(n),n.idx)]=r,s}function N5(t){if(t instanceof n0)return"Alternation";if(t instanceof QJ)return"Option";if(t instanceof e0)return"Repetition";if(t instanceof r0)return"RepetitionWithSeparator";if(t instanceof JJ)return"RepetitionMandatory";if(t instanceof t0)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function I5(t,e){const r=e.length;for(let n=0;nt.alt))}get key(){let t="";for(const e in this.map)t+=e+":";return t}};function U5(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map((t=>t.stateNumber.toString())).join("_")}`}function G5(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return void 0!==a||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}o(U5,"getATNConfigKey"),o(G5,"createDFACache");var q5,j5,W5,Y5,H5,V5,X5,K5,Z5,Q5,J5,t3,e3,r3,n3,i3,a3,s3,o3,l3,c3,h3,u3,d3,p3,g3,f3,m3,y3,v3,x3,b3,w3,k3,T3,_3,E3,C3,S3,A3,L3,N3,I3,R3,M3,D3,O3,P3,B3,$3,F3,z3,U3,G3,q3,j3,W3,Y3,H3,V3,X3,K3,Z3,Q3,J3,t6,e6,r6,n6,i6,a6,s6,o6,l6,c6,h6,u6,d6,p6,g6,f6,m6,y6,v6,x6,b6,w6,k6,T6,_6,E6,C6,S6=class{static{o(this,"PredicateSet")}constructor(){this.predicates=[]}is(t){return t>=this.predicates.length||this.predicates[t]}set(t,e){this.predicates[t]=e}toString(){let t="";const e=this.predicates.length;for(let r=0;rconsole.log(t)}initialize(t){this.atn=f5(t.rules),this.dfas=I6(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){const{prodOccurrence:e,rule:r,hasPredicates:n,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,o=h5(r,"Alternation",e),l=this.atn.decisionMap[o].decision,c=Gz(v2({maxLookahead:1,occurrence:e,prodType:"Alternation",rule:r}),(t=>Gz(t,(t=>t[0]))));if(N6(c,!1)&&!i){const t=_U(c,((t,e,r)=>(iF(e,(e=>{e&&(t[e.tokenTypeIdx]=r,iF(e.categoryMatches,(e=>{t[e]=r})))})),t)),{});return n?function(e){var r;const n=this.LA(1),i=t[n.tokenTypeIdx];if(void 0!==e&&void 0!==i){const t=null===(r=e[i])||void 0===r?void 0:r.GATE;if(void 0!==t&&!1===t.call(this))return}return i}:function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return n?function(t){const e=new S6,r=void 0===t?0:t.length;for(let n=0;nGz(t,(t=>t[0]))));if(N6(c)&&c[0][0]&&!i){const t=c[0],e=fU(t);if(1===e.length&&iL(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=_U(e,((t,e)=>(void 0!==e&&(t[e.tokenTypeIdx]=!0,iF(e.categoryMatches,(e=>{t[e]=!0}))),t)),{});return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){const t=R6.call(this,a,l,A6,s);return"object"!=typeof t&&0===t}}};function N6(t,e=!0){const r=new Set;for(const n of t){const t=new Set;for(const i of n){if(void 0===i){if(e)break;return!1}const n=[i.tokenTypeIdx].concat(i.categoryMatches);for(const e of n)if(r.has(e)){if(!t.has(e))return!1}else r.add(e),t.add(e)}}return!0}function I6(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nF1(t))).join(", "),r=0===t.production.idx?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${B6(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return n+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",n}function B6(t){if(t instanceof XJ)return"SUBRULE";if(t instanceof QJ)return"OPTION";if(t instanceof n0)return"OR";if(t instanceof JJ)return"AT_LEAST_ONE";if(t instanceof t0)return"AT_LEAST_ONE_SEP";if(t instanceof r0)return"MANY_SEP";if(t instanceof e0)return"MANY";if(t instanceof i0)return"CONSUME";throw Error("non exhaustive match")}function $6(t,e,r){const n=HG(e.configs.elements,(t=>t.state.transitions)),i=yj(n.filter((t=>t instanceof d5)).map((t=>t.tokenType)),(t=>t.tokenTypeIdx));return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function F6(t,e){return t.edges[e.tokenTypeIdx]}function z6(t,e,r){const n=new z5,i=[];for(const a of t.elements){if(!1===r.is(a.alt))continue;if(7===a.state.type){i.push(a);continue}const t=a.state.transitions.length;for(let r=0;r0&&!X6(a))for(const t of i)a.add(t);return a}function U6(t,e){if(t instanceof d5&&J1(e,t.tokenType))return t.target}function G6(t,e){let r;for(const n of t.elements)if(!0===e.is(n.alt))if(void 0===r)r=n.alt;else if(r!==n.alt)return;return r}function q6(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function j6(t,e,r,n){return n=W6(t,n),e.edges[r.tokenTypeIdx]=n,n}function W6(t,e){if(e===F5)return e;const r=e.configs.key,n=t.states[r];return void 0!==n?n:(e.configs.finalize(),t.states[r]=e,e)}function Y6(t){const e=new z5,r=t.transitions.length;for(let n=0;n0){const r=[...t.stack];H6({state:r.pop(),alt:t.alt,stack:r},e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}function t7(t){for(const e of Array.from(t.values()))if(1===Object.keys(e).length)return!0;return!1}o(N6,"isLL1Sequence"),o(I6,"initATNSimulator"),o(R6,"adaptivePredict"),o(M6,"performLookahead"),o(D6,"computeLookaheadTarget"),o(O6,"reportLookaheadAmbiguity"),o(P6,"buildAmbiguityError"),o(B6,"getProductionDslName"),o($6,"buildAdaptivePredictError"),o(F6,"getExistingTargetState"),o(z6,"computeReachSet"),o(U6,"getReachableTarget"),o(G6,"getUniqueAlt"),o(q6,"newDFAState"),o(j6,"addDFAEdge"),o(W6,"addDFAState"),o(Y6,"computeStartState"),o(H6,"closure"),o(V6,"getEpsilonTarget"),o(X6,"hasConfigInRuleStopState"),o(K6,"allConfigsInRuleStopStates"),o(Z6,"hasConflictTerminatingPrediction"),o(Q6,"getConflictingAltSets"),o(J6,"hasConflictingAltSet"),o(t7,"hasStateAssociatedWithOneAlt"),function(t){function e(t){return"string"==typeof t}o(e,"is"),t.is=e}(q5||(q5={})),function(t){function e(t){return"string"==typeof t}o(e,"is"),t.is=e}(j5||(j5={})),function(t){function e(e){return"number"==typeof e&&t.MIN_VALUE<=e&&e<=t.MAX_VALUE}t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,o(e,"is"),t.is=e}(W5||(W5={})),function(t){function e(e){return"number"==typeof e&&t.MIN_VALUE<=e&&e<=t.MAX_VALUE}t.MIN_VALUE=0,t.MAX_VALUE=2147483647,o(e,"is"),t.is=e}(Y5||(Y5={})),function(t){function e(t,e){return t===Number.MAX_VALUE&&(t=Y5.MAX_VALUE),e===Number.MAX_VALUE&&(e=Y5.MAX_VALUE),{line:t,character:e}}function r(t){let e=t;return e7.objectLiteral(e)&&e7.uinteger(e.line)&&e7.uinteger(e.character)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(H5||(H5={})),function(t){function e(t,e,r,n){if(e7.uinteger(t)&&e7.uinteger(e)&&e7.uinteger(r)&&e7.uinteger(n))return{start:H5.create(t,e),end:H5.create(r,n)};if(H5.is(t)&&H5.is(e))return{start:t,end:e};throw new Error(`Range#create called with invalid arguments[${t}, ${e}, ${r}, ${n}]`)}function r(t){let e=t;return e7.objectLiteral(e)&&H5.is(e.start)&&H5.is(e.end)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(V5||(V5={})),function(t){function e(t,e){return{uri:t,range:e}}function r(t){let e=t;return e7.objectLiteral(e)&&V5.is(e.range)&&(e7.string(e.uri)||e7.undefined(e.uri))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(X5||(X5={})),function(t){function e(t,e,r,n){return{targetUri:t,targetRange:e,targetSelectionRange:r,originSelectionRange:n}}function r(t){let e=t;return e7.objectLiteral(e)&&V5.is(e.targetRange)&&e7.string(e.targetUri)&&V5.is(e.targetSelectionRange)&&(V5.is(e.originSelectionRange)||e7.undefined(e.originSelectionRange))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(K5||(K5={})),function(t){function e(t,e,r,n){return{red:t,green:e,blue:r,alpha:n}}function r(t){const e=t;return e7.objectLiteral(e)&&e7.numberRange(e.red,0,1)&&e7.numberRange(e.green,0,1)&&e7.numberRange(e.blue,0,1)&&e7.numberRange(e.alpha,0,1)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(Z5||(Z5={})),function(t){function e(t,e){return{range:t,color:e}}function r(t){const e=t;return e7.objectLiteral(e)&&V5.is(e.range)&&Z5.is(e.color)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(Q5||(Q5={})),function(t){function e(t,e,r){return{label:t,textEdit:e,additionalTextEdits:r}}function r(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.label)&&(e7.undefined(e.textEdit)||u3.is(e))&&(e7.undefined(e.additionalTextEdits)||e7.typedArray(e.additionalTextEdits,u3.is))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(J5||(J5={})),(e3=t3||(t3={})).Comment="comment",e3.Imports="imports",e3.Region="region",function(t){function e(t,e,r,n,i,a){const s={startLine:t,endLine:e};return e7.defined(r)&&(s.startCharacter=r),e7.defined(n)&&(s.endCharacter=n),e7.defined(i)&&(s.kind=i),e7.defined(a)&&(s.collapsedText=a),s}function r(t){const e=t;return e7.objectLiteral(e)&&e7.uinteger(e.startLine)&&e7.uinteger(e.startLine)&&(e7.undefined(e.startCharacter)||e7.uinteger(e.startCharacter))&&(e7.undefined(e.endCharacter)||e7.uinteger(e.endCharacter))&&(e7.undefined(e.kind)||e7.string(e.kind))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(r3||(r3={})),function(t){function e(t,e){return{location:t,message:e}}function r(t){let e=t;return e7.defined(e)&&X5.is(e.location)&&e7.string(e.message)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(n3||(n3={})),(a3=i3||(i3={})).Error=1,a3.Warning=2,a3.Information=3,a3.Hint=4,(o3=s3||(s3={})).Unnecessary=1,o3.Deprecated=2,function(t){function e(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.href)}o(e,"is"),t.is=e}(l3||(l3={})),function(t){function e(t,e,r,n,i,a){let s={range:t,message:e};return e7.defined(r)&&(s.severity=r),e7.defined(n)&&(s.code=n),e7.defined(i)&&(s.source=i),e7.defined(a)&&(s.relatedInformation=a),s}function r(t){var e;let r=t;return e7.defined(r)&&V5.is(r.range)&&e7.string(r.message)&&(e7.number(r.severity)||e7.undefined(r.severity))&&(e7.integer(r.code)||e7.string(r.code)||e7.undefined(r.code))&&(e7.undefined(r.codeDescription)||e7.string(null===(e=r.codeDescription)||void 0===e?void 0:e.href))&&(e7.string(r.source)||e7.undefined(r.source))&&(e7.undefined(r.relatedInformation)||e7.typedArray(r.relatedInformation,n3.is))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(c3||(c3={})),function(t){function e(t,e,...r){let n={title:t,command:e};return e7.defined(r)&&r.length>0&&(n.arguments=r),n}function r(t){let e=t;return e7.defined(e)&&e7.string(e.title)&&e7.string(e.command)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(h3||(h3={})),function(t){function e(t,e){return{range:t,newText:e}}function r(t,e){return{range:{start:t,end:t},newText:e}}function n(t){return{range:t,newText:""}}function i(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.newText)&&V5.is(e.range)}o(e,"replace"),t.replace=e,o(r,"insert"),t.insert=r,o(n,"del"),t.del=n,o(i,"is"),t.is=i}(u3||(u3={})),function(t){function e(t,e,r){const n={label:t};return void 0!==e&&(n.needsConfirmation=e),void 0!==r&&(n.description=r),n}function r(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.label)&&(e7.boolean(e.needsConfirmation)||void 0===e.needsConfirmation)&&(e7.string(e.description)||void 0===e.description)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(d3||(d3={})),function(t){function e(t){const e=t;return e7.string(e)}o(e,"is"),t.is=e}(p3||(p3={})),function(t){function e(t,e,r){return{range:t,newText:e,annotationId:r}}function r(t,e,r){return{range:{start:t,end:t},newText:e,annotationId:r}}function n(t,e){return{range:t,newText:"",annotationId:e}}function i(t){const e=t;return u3.is(e)&&(d3.is(e.annotationId)||p3.is(e.annotationId))}o(e,"replace"),t.replace=e,o(r,"insert"),t.insert=r,o(n,"del"),t.del=n,o(i,"is"),t.is=i}(g3||(g3={})),function(t){function e(t,e){return{textDocument:t,edits:e}}function r(t){let e=t;return e7.defined(e)&&k3.is(e.textDocument)&&Array.isArray(e.edits)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(f3||(f3={})),function(t){function e(t,e,r){let n={kind:"create",uri:t};return void 0===e||void 0===e.overwrite&&void 0===e.ignoreIfExists||(n.options=e),void 0!==r&&(n.annotationId=r),n}function r(t){let e=t;return e&&"create"===e.kind&&e7.string(e.uri)&&(void 0===e.options||(void 0===e.options.overwrite||e7.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||e7.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||p3.is(e.annotationId))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(m3||(m3={})),function(t){function e(t,e,r,n){let i={kind:"rename",oldUri:t,newUri:e};return void 0===r||void 0===r.overwrite&&void 0===r.ignoreIfExists||(i.options=r),void 0!==n&&(i.annotationId=n),i}function r(t){let e=t;return e&&"rename"===e.kind&&e7.string(e.oldUri)&&e7.string(e.newUri)&&(void 0===e.options||(void 0===e.options.overwrite||e7.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||e7.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||p3.is(e.annotationId))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(y3||(y3={})),function(t){function e(t,e,r){let n={kind:"delete",uri:t};return void 0===e||void 0===e.recursive&&void 0===e.ignoreIfNotExists||(n.options=e),void 0!==r&&(n.annotationId=r),n}function r(t){let e=t;return e&&"delete"===e.kind&&e7.string(e.uri)&&(void 0===e.options||(void 0===e.options.recursive||e7.boolean(e.options.recursive))&&(void 0===e.options.ignoreIfNotExists||e7.boolean(e.options.ignoreIfNotExists)))&&(void 0===e.annotationId||p3.is(e.annotationId))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(v3||(v3={})),function(t){function e(t){let e=t;return e&&(void 0!==e.changes||void 0!==e.documentChanges)&&(void 0===e.documentChanges||e.documentChanges.every((t=>e7.string(t.kind)?m3.is(t)||y3.is(t)||v3.is(t):f3.is(t))))}o(e,"is"),t.is=e}(x3||(x3={})),function(t){function e(t){return{uri:t}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(b3||(b3={})),function(t){function e(t,e){return{uri:t,version:e}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)&&e7.integer(e.version)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(w3||(w3={})),function(t){function e(t,e){return{uri:t,version:e}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)&&(null===e.version||e7.integer(e.version))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(k3||(k3={})),function(t){function e(t,e,r,n){return{uri:t,languageId:e,version:r,text:n}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)&&e7.string(e.languageId)&&e7.integer(e.version)&&e7.string(e.text)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(T3||(T3={})),function(t){function e(e){const r=e;return r===t.PlainText||r===t.Markdown}t.PlainText="plaintext",t.Markdown="markdown",o(e,"is"),t.is=e}(_3||(_3={})),function(t){function e(t){const e=t;return e7.objectLiteral(t)&&_3.is(e.kind)&&e7.string(e.value)}o(e,"is"),t.is=e}(E3||(E3={})),(S3=C3||(C3={})).Text=1,S3.Method=2,S3.Function=3,S3.Constructor=4,S3.Field=5,S3.Variable=6,S3.Class=7,S3.Interface=8,S3.Module=9,S3.Property=10,S3.Unit=11,S3.Value=12,S3.Enum=13,S3.Keyword=14,S3.Snippet=15,S3.Color=16,S3.File=17,S3.Reference=18,S3.Folder=19,S3.EnumMember=20,S3.Constant=21,S3.Struct=22,S3.Event=23,S3.Operator=24,S3.TypeParameter=25,(L3=A3||(A3={})).PlainText=1,L3.Snippet=2,(N3||(N3={})).Deprecated=1,function(t){function e(t,e,r){return{newText:t,insert:e,replace:r}}function r(t){const e=t;return e&&e7.string(e.newText)&&V5.is(e.insert)&&V5.is(e.replace)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(I3||(I3={})),(M3=R3||(R3={})).asIs=1,M3.adjustIndentation=2,function(t){function e(t){const e=t;return e&&(e7.string(e.detail)||void 0===e.detail)&&(e7.string(e.description)||void 0===e.description)}o(e,"is"),t.is=e}(D3||(D3={})),function(t){function e(t){return{label:t}}o(e,"create"),t.create=e}(O3||(O3={})),function(t){function e(t,e){return{items:t||[],isIncomplete:!!e}}o(e,"create"),t.create=e}(P3||(P3={})),function(t){function e(t){return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function r(t){const e=t;return e7.string(e)||e7.objectLiteral(e)&&e7.string(e.language)&&e7.string(e.value)}o(e,"fromPlainText"),t.fromPlainText=e,o(r,"is"),t.is=r}(B3||(B3={})),function(t){function e(t){let e=t;return!!e&&e7.objectLiteral(e)&&(E3.is(e.contents)||B3.is(e.contents)||e7.typedArray(e.contents,B3.is))&&(void 0===t.range||V5.is(t.range))}o(e,"is"),t.is=e}($3||($3={})),function(t){function e(t,e){return e?{label:t,documentation:e}:{label:t}}o(e,"create"),t.create=e}(F3||(F3={})),function(t){function e(t,e,...r){let n={label:t};return e7.defined(e)&&(n.documentation=e),e7.defined(r)?n.parameters=r:n.parameters=[],n}o(e,"create"),t.create=e}(z3||(z3={})),(G3=U3||(U3={})).Text=1,G3.Read=2,G3.Write=3,function(t){function e(t,e){let r={range:t};return e7.number(e)&&(r.kind=e),r}o(e,"create"),t.create=e}(q3||(q3={})),(W3=j3||(j3={})).File=1,W3.Module=2,W3.Namespace=3,W3.Package=4,W3.Class=5,W3.Method=6,W3.Property=7,W3.Field=8,W3.Constructor=9,W3.Enum=10,W3.Interface=11,W3.Function=12,W3.Variable=13,W3.Constant=14,W3.String=15,W3.Number=16,W3.Boolean=17,W3.Array=18,W3.Object=19,W3.Key=20,W3.Null=21,W3.EnumMember=22,W3.Struct=23,W3.Event=24,W3.Operator=25,W3.TypeParameter=26,(Y3||(Y3={})).Deprecated=1,function(t){function e(t,e,r,n,i){let a={name:t,kind:e,location:{uri:n,range:r}};return i&&(a.containerName=i),a}o(e,"create"),t.create=e}(H3||(H3={})),function(t){function e(t,e,r,n){return void 0!==n?{name:t,kind:e,location:{uri:r,range:n}}:{name:t,kind:e,location:{uri:r}}}o(e,"create"),t.create=e}(V3||(V3={})),function(t){function e(t,e,r,n,i,a){let s={name:t,detail:e,kind:r,range:n,selectionRange:i};return void 0!==a&&(s.children=a),s}function r(t){let e=t;return e&&e7.string(e.name)&&e7.number(e.kind)&&V5.is(e.range)&&V5.is(e.selectionRange)&&(void 0===e.detail||e7.string(e.detail))&&(void 0===e.deprecated||e7.boolean(e.deprecated))&&(void 0===e.children||Array.isArray(e.children))&&(void 0===e.tags||Array.isArray(e.tags))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(X3||(X3={})),(Z3=K3||(K3={})).Empty="",Z3.QuickFix="quickfix",Z3.Refactor="refactor",Z3.RefactorExtract="refactor.extract",Z3.RefactorInline="refactor.inline",Z3.RefactorRewrite="refactor.rewrite",Z3.Source="source",Z3.SourceOrganizeImports="source.organizeImports",Z3.SourceFixAll="source.fixAll",(J3=Q3||(Q3={})).Invoked=1,J3.Automatic=2,function(t){function e(t,e,r){let n={diagnostics:t};return null!=e&&(n.only=e),null!=r&&(n.triggerKind=r),n}function r(t){let e=t;return e7.defined(e)&&e7.typedArray(e.diagnostics,c3.is)&&(void 0===e.only||e7.typedArray(e.only,e7.string))&&(void 0===e.triggerKind||e.triggerKind===Q3.Invoked||e.triggerKind===Q3.Automatic)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(t6||(t6={})),function(t){function e(t,e,r){let n={title:t},i=!0;return"string"==typeof e?(i=!1,n.kind=e):h3.is(e)?n.command=e:n.edit=e,i&&void 0!==r&&(n.kind=r),n}function r(t){let e=t;return e&&e7.string(e.title)&&(void 0===e.diagnostics||e7.typedArray(e.diagnostics,c3.is))&&(void 0===e.kind||e7.string(e.kind))&&(void 0!==e.edit||void 0!==e.command)&&(void 0===e.command||h3.is(e.command))&&(void 0===e.isPreferred||e7.boolean(e.isPreferred))&&(void 0===e.edit||x3.is(e.edit))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(e6||(e6={})),function(t){function e(t,e){let r={range:t};return e7.defined(e)&&(r.data=e),r}function r(t){let e=t;return e7.defined(e)&&V5.is(e.range)&&(e7.undefined(e.command)||h3.is(e.command))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(r6||(r6={})),function(t){function e(t,e){return{tabSize:t,insertSpaces:e}}function r(t){let e=t;return e7.defined(e)&&e7.uinteger(e.tabSize)&&e7.boolean(e.insertSpaces)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(n6||(n6={})),function(t){function e(t,e,r){return{range:t,target:e,data:r}}function r(t){let e=t;return e7.defined(e)&&V5.is(e.range)&&(e7.undefined(e.target)||e7.string(e.target))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(i6||(i6={})),function(t){function e(t,e){return{range:t,parent:e}}function r(e){let r=e;return e7.objectLiteral(r)&&V5.is(r.range)&&(void 0===r.parent||t.is(r.parent))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(a6||(a6={})),(o6=s6||(s6={})).namespace="namespace",o6.type="type",o6.class="class",o6.enum="enum",o6.interface="interface",o6.struct="struct",o6.typeParameter="typeParameter",o6.parameter="parameter",o6.variable="variable",o6.property="property",o6.enumMember="enumMember",o6.event="event",o6.function="function",o6.method="method",o6.macro="macro",o6.keyword="keyword",o6.modifier="modifier",o6.comment="comment",o6.string="string",o6.number="number",o6.regexp="regexp",o6.operator="operator",o6.decorator="decorator",(c6=l6||(l6={})).declaration="declaration",c6.definition="definition",c6.readonly="readonly",c6.static="static",c6.deprecated="deprecated",c6.abstract="abstract",c6.async="async",c6.modification="modification",c6.documentation="documentation",c6.defaultLibrary="defaultLibrary",function(t){function e(t){const e=t;return e7.objectLiteral(e)&&(void 0===e.resultId||"string"==typeof e.resultId)&&Array.isArray(e.data)&&(0===e.data.length||"number"==typeof e.data[0])}o(e,"is"),t.is=e}(h6||(h6={})),function(t){function e(t,e){return{range:t,text:e}}function r(t){const e=t;return null!=e&&V5.is(e.range)&&e7.string(e.text)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(u6||(u6={})),function(t){function e(t,e,r){return{range:t,variableName:e,caseSensitiveLookup:r}}function r(t){const e=t;return null!=e&&V5.is(e.range)&&e7.boolean(e.caseSensitiveLookup)&&(e7.string(e.variableName)||void 0===e.variableName)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(d6||(d6={})),function(t){function e(t,e){return{range:t,expression:e}}function r(t){const e=t;return null!=e&&V5.is(e.range)&&(e7.string(e.expression)||void 0===e.expression)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(p6||(p6={})),function(t){function e(t,e){return{frameId:t,stoppedLocation:e}}function r(t){const e=t;return e7.defined(e)&&V5.is(t.stoppedLocation)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(g6||(g6={})),function(t){function e(t){return 1===t||2===t}t.Type=1,t.Parameter=2,o(e,"is"),t.is=e}(f6||(f6={})),function(t){function e(t){return{value:t}}function r(t){const e=t;return e7.objectLiteral(e)&&(void 0===e.tooltip||e7.string(e.tooltip)||E3.is(e.tooltip))&&(void 0===e.location||X5.is(e.location))&&(void 0===e.command||h3.is(e.command))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(m6||(m6={})),function(t){function e(t,e,r){const n={position:t,label:e};return void 0!==r&&(n.kind=r),n}function r(t){const e=t;return e7.objectLiteral(e)&&H5.is(e.position)&&(e7.string(e.label)||e7.typedArray(e.label,m6.is))&&(void 0===e.kind||f6.is(e.kind))&&void 0===e.textEdits||e7.typedArray(e.textEdits,u3.is)&&(void 0===e.tooltip||e7.string(e.tooltip)||E3.is(e.tooltip))&&(void 0===e.paddingLeft||e7.boolean(e.paddingLeft))&&(void 0===e.paddingRight||e7.boolean(e.paddingRight))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(y6||(y6={})),function(t){function e(t){return{kind:"snippet",value:t}}o(e,"createSnippet"),t.createSnippet=e}(v6||(v6={})),function(t){function e(t,e,r,n){return{insertText:t,filterText:e,range:r,command:n}}o(e,"create"),t.create=e}(x6||(x6={})),function(t){function e(t){return{items:t}}o(e,"create"),t.create=e}(b6||(b6={})),(k6=w6||(w6={})).Invoked=0,k6.Automatic=1,function(t){function e(t,e){return{range:t,text:e}}o(e,"create"),t.create=e}(T6||(T6={})),function(t){function e(t,e){return{triggerKind:t,selectedCompletionInfo:e}}o(e,"create"),t.create=e}(_6||(_6={})),function(t){function e(t){const e=t;return e7.objectLiteral(e)&&j5.is(e.uri)&&e7.string(e.name)}o(e,"is"),t.is=e}(E6||(E6={})),function(t){function e(t,e,r,n){return new r7(t,e,r,n)}function r(t){let e=t;return!!(e7.defined(e)&&e7.string(e.uri)&&(e7.undefined(e.languageId)||e7.string(e.languageId))&&e7.uinteger(e.lineCount)&&e7.func(e.getText)&&e7.func(e.positionAt)&&e7.func(e.offsetAt))}function n(t,e){let r=t.getText(),n=i(e,((t,e)=>{let r=t.range.start.line-e.range.start.line;return 0===r?t.range.start.character-e.range.start.character:r})),a=r.length;for(let e=n.length-1;e>=0;e--){let i=n[e],s=t.offsetAt(i.range.start),o=t.offsetAt(i.range.end);if(!(o<=a))throw new Error("Overlapping edit");r=r.substring(0,s)+i.newText+r.substring(o,r.length),a=s}return r}function i(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),a=t.slice(r);i(n,e),i(a,e);let s=0,o=0,l=0;for(;s0&&t.push(e.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let e=this.getLineOffsets(),r=0,n=e.length;if(0===n)return H5.create(0,t);for(;rt?n=i:r=i+1}let i=r-1;return H5.create(i,t-e[i])}offsetAt(t){let e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;let r=e[t.line],n=t.line+1=0&&e.content.splice(r,1)}}addHiddenNodes(t){const e=[];for(const r of t){const t=new a7(r.startOffset,r.image.length,aK(r),r.tokenType,!0);t.root=this.rootNode,e.push(t)}let r=this.current,n=!1;if(r.content.length>0)r.content.push(...e);else{for(;r.container;){const t=r.container.content.indexOf(r);if(t>0){r.container.content.splice(t,0,...e),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...e)}}construct(t){const e=this.current;"string"==typeof t.$type&&(this.current.astNode=t),t.$cstNode=e;const r=this.nodeStack.pop();0===(null==r?void 0:r.content.length)&&this.removeNode(r)}},i7=class{static{o(this,"AbstractCstNode")}get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var t,e;const r="string"==typeof(null===(t=this._astNode)||void 0===t?void 0:t.$type)?this._astNode:null===(e=this.container)||void 0===e?void 0:e.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(t){this._astNode=t}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}},a7=class extends i7{static{o(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(t,e,r,n,i=!1){super(),this._hidden=i,this._offset=t,this._tokenType=n,this._length=e,this._range=r}},s7=class extends i7{static{o(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new o7(this)}get children(){return this.content}get offset(){var t,e;return null!==(e=null===(t=this.firstNonHiddenNode)||void 0===t?void 0:t.offset)&&void 0!==e?e:0}get length(){return this.end-this.offset}get end(){var t,e;return null!==(e=null===(t=this.lastNonHiddenNode)||void 0===t?void 0:t.end)&&void 0!==e?e:0}get range(){const t=this.firstNonHiddenNode,e=this.lastNonHiddenNode;if(t&&e){if(void 0===this._rangeCache){const{range:r}=t,{range:n}=e;this._rangeCache={start:r.start,end:n.end.line=0;t--){const e=this.content[t];if(!e.hidden)return e}return this.content[this.content.length-1]}},o7=class t extends Array{static{o(this,"CstNodeContainer")}constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,e,...r){return this.addParents(r),super.splice(t,e,...r)}addParents(t){for(const e of t)e.container=this.parent}},l7=class extends s7{static{o(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(t){super(),this._text="",this._text=null!=t?t:""}},c7=Symbol("Datatype");function h7(t){return t.$type===c7}o(h7,"isDataTypeNode");var u7=o((t=>t.endsWith("​")?t:t+"​"),"withRuleSuffix"),d7=class{static{o(this,"AbstractLangiumParser")}constructor(t){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=t.parser.Lexer;const e=this.lexer.definition,r="production"===t.LanguageMetaData.mode;this.wrapper=new v7(e,Object.assign(Object.assign({},t.parser.ParserConfig),{skipValidations:r,errorMessageProvider:t.parser.ParserErrorMessageProvider}))}alternatives(t,e){this.wrapper.wrapOr(t,e)}optional(t,e){this.wrapper.wrapOption(t,e)}many(t,e){this.wrapper.wrapMany(t,e)}atLeastOne(t,e){this.wrapper.wrapAtLeastOne(t,e)}getRule(t){return this.allRules.get(t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},p7=class extends d7{static{o(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(t){super(t),this.nodeBuilder=new n7,this.stack=[],this.assignmentMap=new Map,this.linker=t.references.Linker,this.converter=t.parser.ValueConverter,this.astReflection=t.shared.AstReflection}rule(t,e){const r=this.computeRuleType(t),n=this.wrapper.DEFINE_RULE(u7(t.name),this.startImplementation(r,e).bind(this));return this.allRules.set(t.name,n),t.entry&&(this.mainRule=n),n}computeRuleType(t){if(!t.fragment){if(kJ(t))return c7;{const e=CJ(t);return null!=e?e:t.name}}}parse(t,e={}){this.nodeBuilder.buildRootNode(t);const r=this.lexerResult=this.lexer.tokenize(t);this.wrapper.input=r.tokens;const n=e.rule?this.allRules.get(e.rule):this.mainRule;if(!n)throw new Error(e.rule?`No rule found with name '${e.rule}'`:"No main rule available.");const i=n.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:i,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(t,e){return r=>{const n=!this.isRecording()&&void 0!==t;if(n){const e={$type:t};this.stack.push(e),t===c7&&(e.value="")}let i;try{i=e(r)}catch(t){i=void 0}return void 0===i&&n&&(i=this.construct()),i}}extractHiddenTokens(t){const e=this.lexerResult.hidden;if(!e.length)return[];const r=t.startOffset;for(let t=0;tr)return e.splice(0,t)}return e.splice(0,e.length)}consume(t,e,r){const n=this.wrapper.wrapConsume(t,e);if(!this.isRecording()&&this.isValidToken(n)){const t=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(t);const e=this.nodeBuilder.buildLeafNode(n,r),{assignment:i,isCrossRef:a}=this.getAssignment(r),s=this.current;if(i){const t=VZ(r)?n.image:this.converter.convert(n.image,e);this.assign(i.operator,i.feature,t,e,a)}else if(h7(s)){let t=n.image;VZ(r)||(t=this.converter.convert(t,e).toString()),s.value+=t}}}isValidToken(t){return!t.isInsertedInRecovery&&!isNaN(t.startOffset)&&"number"==typeof t.endOffset&&!isNaN(t.endOffset)}subrule(t,e,r,n,i){let a;this.isRecording()||r||(a=this.nodeBuilder.buildCompositeNode(n));const s=this.wrapper.wrapSubrule(t,e,i);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(s,n,a)}performSubruleAssignment(t,e,r){const{assignment:n,isCrossRef:i}=this.getAssignment(e);if(n)this.assign(n.operator,n.feature,t,r,i);else if(!n){const e=this.current;if(h7(e))e.value+=t.toString();else if("object"==typeof t&&t){const r=this.assignWithoutOverride(t,e);this.stack.pop(),this.stack.push(r)}}}action(t,e){if(!this.isRecording()){let r=this.current;if(e.feature&&e.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode);this.nodeBuilder.buildCompositeNode(e).content.push(r.$cstNode);const n={$type:t};this.stack.push(n),this.assign(e.operator,e.feature,r,r.$cstNode,!1)}else r.$type=t}}construct(){if(this.isRecording())return;const t=this.current;return mQ(t),this.nodeBuilder.construct(t),this.stack.pop(),h7(t)?this.converter.convert(t.value,t.$cstNode):(SQ(this.astReflection,t),t)}getAssignment(t){if(!this.assignmentMap.has(t)){const e=yQ(t,$Z);this.assignmentMap.set(t,{assignment:e,isCrossRef:!!e&&GZ(e.terminal)})}return this.assignmentMap.get(t)}assign(t,e,r,n,i){const a=this.current;let s;switch(s=i&&"string"==typeof r?this.linker.buildReference(a,e,n,r):r,t){case"=":a[e]=s;break;case"?=":a[e]=!0;break;case"+=":Array.isArray(a[e])||(a[e]=[]),a[e].push(s)}}assignWithoutOverride(t,e){for(const[r,n]of Object.entries(e)){const e=t[r];void 0===e?t[r]=n:Array.isArray(e)&&Array.isArray(n)&&(n.push(...e),t[r]=n)}const r=t.$cstNode;return r&&(r.astNode=void 0,t.$cstNode=void 0),t}get definitionErrors(){return this.wrapper.definitionErrors}},g7=class{static{o(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(t){return t2.buildMismatchTokenMessage(t)}buildNotAllInputParsedMessage(t){return t2.buildNotAllInputParsedMessage(t)}buildNoViableAltMessage(t){return t2.buildNoViableAltMessage(t)}buildEarlyExitMessage(t){return t2.buildEarlyExitMessage(t)}},f7=class extends g7{static{o(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:t,actual:e}){return`Expecting ${t.LABEL?"`"+t.LABEL+"`":t.name.endsWith(":KW")?`keyword '${t.name.substring(0,t.name.length-3)}'`:`token of type '${t.name}'`} but found \`${e.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:t}){return`Expecting end of file but found \`${t.image}\`.`}},m7=class extends d7{static{o(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(t){this.resetState();const e=this.lexer.tokenize(t,{mode:"partial"});return this.tokens=e.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(t,e){const r=this.wrapper.DEFINE_RULE(u7(t.name),this.startImplementation(e).bind(this));return this.allRules.set(t.name,r),t.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(t){return e=>{const r=this.keepStackSize();try{t(e)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const t=this.elementStack.length;return this.stackSize=t,t}resetStackSize(t){this.removeUnexpectedElements(),this.stackSize=t}consume(t,e,r){this.wrapper.wrapConsume(t,e),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(t,e,r,n,i){this.before(n),this.wrapper.wrapSubrule(t,e,i),this.after(n)}before(t){this.isRecording()||this.elementStack.push(t)}after(t){if(!this.isRecording()){const e=this.elementStack.lastIndexOf(t);e>=0&&this.elementStack.splice(e)}}get currIdx(){return this.wrapper.currIdx}},y7={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new f7},v7=class extends c5{static{o(this,"ChevrotainWrapper")}constructor(t,e){const r=e&&"maxLookahead"in e;super(t,Object.assign(Object.assign(Object.assign({},y7),{lookaheadStrategy:r?new w4({maxLookahead:e.maxLookahead}):new L6({logging:e.skipValidations?()=>{}:void 0})}),e))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(t,e){return this.RULE(t,e)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(t,e){return this.consume(t,e)}wrapSubrule(t,e,r){return this.subrule(t,e,{ARGS:[r]})}wrapOr(t,e){this.or(t,e)}wrapOption(t,e){this.option(t,e)}wrapMany(t,e){this.many(t,e)}wrapAtLeastOne(t,e){this.atLeastOne(t,e)}};function x7(t,e,r){return b7({parser:e,tokens:r,ruleNames:new Map},t),e}function b7(t,e){const r=aJ(e,!1),n=ZX(e.rules).filter(mZ).filter((t=>r.has(t)));for(const e of n){const r=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(e,w7(r,e.definition))}}function w7(t,e,r=!1){let n;if(VZ(e))n=I7(t,e);else if(DZ(e))n=k7(t,e);else if($Z(e))n=w7(t,e.terminal);else if(GZ(e))n=N7(t,e);else if(tQ(e))n=T7(t,e);else if(PZ(e))n=C7(t,e);else if(lQ(e))n=S7(t,e);else if(YZ(e))n=A7(t,e);else{if(!jZ(e))throw new TK(e.$cstNode,`Unexpected element type: ${e.$type}`);{const r=t.consume++;n=o((()=>t.parser.consume(r,Z1,e)),"method")}}return R7(t,r?void 0:L7(e),n,e.cardinality)}function k7(t,e){const r=SJ(e);return()=>t.parser.action(r,e)}function T7(t,e){const r=e.rule.ref;if(mZ(r)){const n=t.subrule++,i=r.fragment,a=e.arguments.length>0?_7(r,e.arguments):()=>({});return s=>t.parser.subrule(n,M7(t,r),i,e,a(s))}if(CZ(r)){const n=t.consume++,i=O7(t,r.name);return()=>t.parser.consume(n,i,e)}if(!r)throw new TK(e.$cstNode,`Undefined rule: ${e.rule.$refText}`);_K()}function _7(t,e){const r=e.map((t=>E7(t.value)));return e=>{const n={};for(let i=0;ie(t)||r(t)}if(VK(t)){const e=E7(t.left),r=E7(t.right);return t=>e(t)&&r(t)}if(lZ(t)){const e=E7(t.value);return t=>!e(t)}if(gZ(t)){const e=t.parameter.ref.name;return t=>void 0!==t&&!0===t[e]}if(YK(t)){const e=Boolean(t.true);return()=>e}_K()}function C7(t,e){if(1===e.elements.length)return w7(t,e.elements[0]);{const r=[];for(const n of e.elements){const e={ALT:w7(t,n,!0)},i=L7(n);i&&(e.GATE=E7(i)),r.push(e)}const n=t.or++;return e=>t.parser.alternatives(n,r.map((t=>{const r={ALT:o((()=>t.ALT(e)),"ALT")},n=t.GATE;return n&&(r.GATE=()=>n(e)),r})))}}function S7(t,e){if(1===e.elements.length)return w7(t,e.elements[0]);const r=[];for(const n of e.elements){const e={ALT:w7(t,n,!0)},i=L7(n);i&&(e.GATE=E7(i)),r.push(e)}const n=t.or++,i=o(((t,e)=>`uGroup_${t}_${e.getRuleStack().join("-")}`),"idFunc"),a=o((e=>t.parser.alternatives(n,r.map(((r,a)=>{const s={ALT:o((()=>!0),"ALT")},l=t.parser;s.ALT=()=>{if(r.ALT(e),!l.isRecording()){const t=i(n,l);l.unorderedGroups.get(t)||l.unorderedGroups.set(t,[]);const e=l.unorderedGroups.get(t);void 0===(null==e?void 0:e[a])&&(e[a]=!0)}};const c=r.GATE;return s.GATE=c?()=>c(e):()=>{const t=l.unorderedGroups.get(i(n,l));return!(null==t?void 0:t[a])},s})))),"alternatives"),s=R7(t,L7(e),a,"*");return e=>{s(e),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function A7(t,e){const r=e.elements.map((e=>w7(t,e)));return t=>r.forEach((e=>e(t)))}function L7(t){if(YZ(t))return t.guardCondition}function N7(t,e,r=e.terminal){if(r){if(tQ(r)&&mZ(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;return r=>t.parser.subrule(i,M7(t,n),!1,e,r)}if(tQ(r)&&CZ(r.rule.ref)){const n=t.consume++,i=O7(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}if(VZ(r)){const n=t.consume++,i=O7(t,r.value);return()=>t.parser.consume(n,i,e)}throw new Error("Could not build cross reference parser")}{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=mJ(e.type.ref),n=null==r?void 0:r.terminal;if(!n)throw new Error("Could not find name assignment for type: "+SJ(e.type.ref));return N7(t,e,n)}}function I7(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function R7(t,e,r,n){const i=e&&E7(e);if(!n){if(i){const e=t.or++;return n=>t.parser.alternatives(e,[{ALT:o((()=>r(n)),"ALT"),GATE:o((()=>i(n)),"GATE")},{ALT:o5(),GATE:o((()=>!i(n)),"GATE")}])}return r}if("*"===n){const e=t.many++;return n=>t.parser.many(e,{DEF:o((()=>r(n)),"DEF"),GATE:i?()=>i(n):void 0})}if("+"===n){const e=t.many++;if(i){const n=t.or++;return a=>t.parser.alternatives(n,[{ALT:o((()=>t.parser.atLeastOne(e,{DEF:o((()=>r(a)),"DEF")})),"ALT"),GATE:o((()=>i(a)),"GATE")},{ALT:o5(),GATE:o((()=>!i(a)),"GATE")}])}return n=>t.parser.atLeastOne(e,{DEF:o((()=>r(n)),"DEF")})}if("?"===n){const e=t.optional++;return n=>t.parser.optional(e,{DEF:o((()=>r(n)),"DEF"),GATE:i?()=>i(n):void 0})}_K()}function M7(t,e){const r=D7(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function D7(t,e){if(mZ(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!mZ(n);){if(YZ(n)||PZ(n)||lQ(n)){i=n.elements.indexOf(r).toString()+":"+i}r=n,n=n.$container}return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function O7(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function P7(t){const e=t.Grammar,r=t.parser.Lexer,n=new m7(t);return x7(e,n,r.definition),n.finalize(),n}function B7(t){const e=$7(t);return e.finalize(),e}function $7(t){const e=t.Grammar,r=t.parser.Lexer;return x7(e,new p7(t),r.definition)}o(x7,"createParser"),o(b7,"buildRules"),o(w7,"buildElement"),o(k7,"buildAction"),o(T7,"buildRuleCall"),o(_7,"buildRuleCallPredicate"),o(E7,"buildPredicate"),o(C7,"buildAlternatives"),o(S7,"buildUnorderedGroup"),o(A7,"buildGroup"),o(L7,"getGuardCondition"),o(N7,"buildCrossReference"),o(I7,"buildKeyword"),o(R7,"wrap"),o(M7,"getRule"),o(D7,"getRuleName"),o(O7,"getToken"),o(P7,"createCompletionParser"),o(B7,"createLangiumParser"),o($7,"prepareLangiumParser");var F7,z7=class{static{o(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(t,e){const r=ZX(aJ(t,!1)),n=this.buildTerminalTokens(r),i=this.buildKeywordTokens(r,n,e);return n.forEach((t=>{const e=t.PATTERN;"object"==typeof e&&e&&"test"in e&&QQ(e)?i.unshift(t):i.push(t)})),i}flushLexingReport(t){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const t=[...this.diagnostics];return this.diagnostics=[],t}buildTerminalTokens(t){return t.filter(CZ).filter((t=>!t.fragment)).map((t=>this.buildTerminalToken(t))).toArray()}buildTerminalToken(t){const e=IJ(t),r=this.requiresCustomPattern(e)?this.regexPatternFunction(e):e,n={name:t.name,PATTERN:r};return"function"==typeof r&&(n.LINE_BREAKS=!0),t.hidden&&(n.GROUP=QQ(e)?$1.SKIPPED:"hidden"),n}requiresCustomPattern(t){return!(!t.flags.includes("u")&&!t.flags.includes("s"))||!(!t.source.includes("?<=")&&!t.source.includes("?{e.lastIndex=r;return e.exec(t)}}buildKeywordTokens(t,e,r){return t.filter(mZ).flatMap((t=>kQ(t).filter(VZ))).distinct((t=>t.value)).toArray().sort(((t,e)=>e.value.length-t.value.length)).map((t=>this.buildKeywordToken(t,e,Boolean(null==r?void 0:r.caseInsensitive))))}buildKeywordToken(t,e,r){const n=this.buildKeywordPattern(t,r),i={name:t.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(t,e)};return"function"==typeof n&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(t,e){return e?new RegExp(tJ(t.value)):t.value}findLongerAlt(t,e){return e.reduce(((e,r)=>{const n=null==r?void 0:r.PATTERN;return(null==n?void 0:n.source)&&eJ("^"+n.source+"$",t.value)&&e.push(r),e}),[])}},U7=class{static{o(this,"DefaultValueConverter")}convert(t,e){let r=e.grammarSource;if(GZ(r)&&(r=oJ(r)),tQ(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,t,e)}return t}runConverter(t,e,r){var n;switch(t.name.toUpperCase()){case"INT":return F7.convertInt(e);case"STRING":return F7.convertString(e);case"ID":return F7.convertID(e)}switch(null===(n=NJ(t))||void 0===n?void 0:n.toLowerCase()){case"number":return F7.convertNumber(e);case"boolean":return F7.convertBoolean(e);case"bigint":return F7.convertBigint(e);case"date":return F7.convertDate(e);default:return e}}};!function(t){function e(t){let e="";for(let n=1;n{"undefined"==typeof setImmediate?setTimeout(t,0):setImmediate(t)}))}d(G7,p(OX(),1)),o(q7,"delayNextTick");var j7=0,W7=10;function Y7(){return j7=performance.now(),new G7.CancellationTokenSource}function H7(t){W7=t}o(Y7,"startCancelableOperation"),o(H7,"setInterruptionPeriod");var V7=Symbol("OperationCancelled");function X7(t){return t===V7}async function K7(t){if(t===G7.CancellationToken.None)return;const e=performance.now();if(e-j7>=W7&&(j7=e,await q7(),j7=performance.now()),t.isCancellationRequested)throw V7}o(X7,"isOperationCancelled"),o(K7,"interruptAndCheck");var Z7,Q7,J7=class{static{o(this,"Deferred")}constructor(){this.promise=new Promise(((t,e)=>{this.resolve=e=>(t(e),this),this.reject=t=>(e(t),this)}))}},t8=class t{static{o(this,"FullTextDocument")}constructor(t,e,r,n){this._uri=t,this._languageId=e,this._version=r,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const e=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(e,r)}return this._content}update(e,r){for(const r of e)if(t.isIncremental(r)){const t=i8(r.range),e=this.offsetAt(t.start),n=this.offsetAt(t.end);this._content=this._content.substring(0,e)+r.text+this._content.substring(n,this._content.length);const i=Math.max(t.start.line,0),a=Math.max(t.end.line,0);let s=this._lineOffsets;const o=r8(r.text,!1,e);if(a-i===o.length)for(let t=0,e=o.length;tt?n=i:r=i+1}const i=r-1;return{line:i,character:(t=this.ensureBeforeEOL(t,e[i]))-e[i]}}offsetAt(t){const e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;const r=e[t.line];if(t.character<=0)return r;const n=t.line+1e&&n8(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const e=t;return null!=e&&"string"==typeof e.text&&void 0!==e.range&&(void 0===e.rangeLength||"number"==typeof e.rangeLength)}static isFull(t){const e=t;return null!=e&&"string"==typeof e.text&&void 0===e.range&&void 0===e.rangeLength}};function e8(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);e8(n,e),e8(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function a8(t){const e=i8(t.range);return e!==t.range?{newText:t.newText,range:e}:t}!function(t){function e(t,e,r,n){return new t8(t,e,r,n)}function r(t,e,r){if(t instanceof t8)return t.update(e,r),t;throw new Error("TextDocument.update: document must be created by TextDocument.create")}function n(t,e){const r=t.getText(),n=e8(e.map(a8),((t,e)=>{const r=t.range.start.line-e.range.start.line;return 0===r?t.range.start.character-e.range.start.character:r}));let i=0;const a=[];for(const e of n){const n=t.offsetAt(e.range.start);if(ni&&a.push(r.substring(i,n)),e.newText.length&&a.push(e.newText),i=t.offsetAt(e.range.end)}return a.push(r.substr(i)),a.join("")}o(e,"create"),t.create=e,o(r,"update"),t.update=r,o(n,"applyEdits"),t.applyEdits=n}(Z7||(Z7={})),o(e8,"mergeSort"),o(r8,"computeLineOffsets"),o(n8,"isEOL"),o(i8,"getWellformedRange"),o(a8,"getWellformedEdit"),(()=>{var t={470:t=>{function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r,n="",i=0,a=-1,s=0,o=0;o<=t.length;++o){if(o2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),a=o,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,a=o,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(a+1,o):n=t.slice(a+1,o),i=o-a-1;a=o,s=0}else 46===r&&-1!==s?++s:s=-1}return n}o(e,"e"),o(r,"r");var n={resolve:o((function(){for(var t,n="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s;a>=0?s=arguments[a]:(void 0===t&&(t=process.cwd()),s=t),e(s),0!==s.length&&(n=s+"/"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."}),"resolve"),normalize:o((function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t="."),t.length>0&&i&&(t+="/"),n?"/"+t:t}),"normalize"),isAbsolute:o((function(t){return e(t),t.length>0&&47===t.charCodeAt(0)}),"isAbsolute"),join:o((function(){if(0===arguments.length)return".";for(var t,r=0;r0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":n.normalize(t)}),"join"),relative:o((function(t,r){if(e(t),e(r),t===r)return"";if((t=n.resolve(t))===(r=n.resolve(r)))return"";for(var i=1;ic){if(47===r.charCodeAt(o+u))return r.slice(o+u+1);if(0===u)return r.slice(o+u)}else s>c&&(47===t.charCodeAt(i+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(i+u);if(d!==r.charCodeAt(o+u))break;47===d&&(h=u)}var p="";for(u=i+h+1;u<=a;++u)u!==a&&47!==t.charCodeAt(u)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(o+h):(o+=h,47===r.charCodeAt(o)&&++o,r.slice(o))}),"relative"),_makeLong:o((function(t){return t}),"_makeLong"),dirname:o((function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,i=-1,a=!0,s=t.length-1;s>=1;--s)if(47===(r=t.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)}),"dirname"),basename:o((function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,i=0,a=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var o=r.length-1,l=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),o>=0&&(c===r.charCodeAt(o)?-1==--o&&(a=n):(o=-1,a=l))}return i===a?a=l:-1===a&&(a=t.length),t.slice(i,a)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===a&&(s=!1,a=n+1);return-1===a?"":t.slice(i,a)}),"basename"),extname:o((function(t){e(t);for(var r=-1,n=0,i=-1,a=!0,s=0,o=t.length-1;o>=0;--o){var l=t.charCodeAt(o);if(47!==l)-1===i&&(a=!1,i=o+1),46===l?-1===r?r=o:1!==s&&(s=1):-1!==r&&(s=-1);else if(!a){n=o+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":t.slice(r,i)}),"extname"),format:o((function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return r=(e=t).dir||e.root,n=e.base||(e.name||"")+(e.ext||""),r?r===e.root?r+n:r+"/"+n:n;var e,r,n}),"format"),parse:o((function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,i=t.charCodeAt(0),a=47===i;a?(r.root="/",n=1):n=0;for(var s=-1,o=0,l=-1,c=!0,h=t.length-1,u=0;h>=n;--h)if(47!==(i=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===i?-1===s?s=h:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){o=h+1;break}return-1===s||-1===l||0===u||1===u&&s===l-1&&s===o+1?-1!==l&&(r.base=r.name=0===o&&a?t.slice(1,l):t.slice(o,l)):(0===o&&a?(r.name=t.slice(1,s),r.base=t.slice(1,l)):(r.name=t.slice(o,s),r.base=t.slice(o,l)),r.ext=t.slice(s,l)),o>0?r.dir=t.slice(0,o-1):a&&(r.dir="/"),r}),"parse"),sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}o(r,"r"),r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{let t;if(r.r(n),r.d(n,{URI:o((()=>u),"URI"),Utils:o((()=>E),"Utils")}),"object"==typeof process)t="win32"===process.platform;else if("object"==typeof navigator){let e=navigator.userAgent;t=e.indexOf("Windows")>=0}const e=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function s(t,r){if(!t.scheme&&r)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!e.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!i.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}o(s,"s");const l="",c="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static{o(this,"f")}static isUri(t){return t instanceof u||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"string"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString}scheme;authority;path;query;fragment;constructor(t,e,r,n,i,a=!1){"object"==typeof t?(this.scheme=t.scheme||l,this.authority=t.authority||l,this.path=t.path||l,this.query=t.query||l,this.fragment=t.fragment||l):(this.scheme=function(t,e){return t||e?t:"file"}(t,a),this.authority=e||l,this.path=function(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==c&&(e=c+e):e=c}return e}(this.scheme,r||l),this.query=n||l,this.fragment=i||l,s(this,a))}get fsPath(){return y(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:r,path:n,query:i,fragment:a}=t;return void 0===e?e=this.scheme:null===e&&(e=l),void 0===r?r=this.authority:null===r&&(r=l),void 0===n?n=this.path:null===n&&(n=l),void 0===i?i=this.query:null===i&&(i=l),void 0===a?a=this.fragment:null===a&&(a=l),e===this.scheme&&r===this.authority&&n===this.path&&i===this.query&&a===this.fragment?this:new p(e,r,n,i,a)}static parse(t,e=!1){const r=h.exec(t);return r?new p(r[2]||l,w(r[4]||l),w(r[5]||l),w(r[7]||l),w(r[9]||l),e):new p(l,l,l,l,l)}static file(e){let r=l;if(t&&(e=e.replace(/\\/g,c)),e[0]===c&&e[1]===c){const t=e.indexOf(c,2);-1===t?(r=e.substring(2),e=c):(r=e.substring(2,t),e=e.substring(t)||c)}return new p("file",r,e,l,l)}static from(t){const e=new p(t.scheme,t.authority,t.path,t.query,t.fragment);return s(e,!0),e}toString(t=!1){return v(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof u)return t;{const e=new p(t);return e._formatted=t.external,e._fsPath=t._sep===d?t.fsPath:null,e}}return t}}const d=t?1:void 0;class p extends u{static{o(this,"l")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(t=!1){return t?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=d),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function f(t,e,r){let n,i=-1;for(let a=0;a=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||e&&47===s||r&&91===s||r&&93===s||r&&58===s)-1!==i&&(n+=encodeURIComponent(t.substring(i,a)),i=-1),void 0!==n&&(n+=t.charAt(a));else{void 0===n&&(n=t.substr(0,a));const e=g[s];void 0!==e?(-1!==i&&(n+=encodeURIComponent(t.substring(i,a)),i=-1),n+=e):-1===i&&(i=a)}}return-1!==i&&(n+=encodeURIComponent(t.substring(i))),void 0!==n?n:t}function m(t){let e;for(let r=0;r1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?r?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,t&&(n=n.replace(/\//g,"\\")),n}function v(t,e){const r=e?m:f;let n="",{scheme:i,authority:a,path:s,query:o,fragment:l}=t;if(i&&(n+=i,n+=":"),(a||"file"===i)&&(n+=c,n+=c),a){let t=a.indexOf("@");if(-1!==t){const e=a.substr(0,t);a=a.substr(t+1),t=e.lastIndexOf(":"),-1===t?n+=r(e,!1,!1):(n+=r(e.substr(0,t),!1,!1),n+=":",n+=r(e.substr(t+1),!1,!0)),n+="@"}a=a.toLowerCase(),t=a.lastIndexOf(":"),-1===t?n+=r(a,!1,!0):(n+=r(a.substr(0,t),!1,!0),n+=a.substr(t))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const t=s.charCodeAt(1);t>=65&&t<=90&&(s=`/${String.fromCharCode(t+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const t=s.charCodeAt(0);t>=65&&t<=90&&(s=`${String.fromCharCode(t+32)}:${s.substr(2)}`)}n+=r(s,!0,!1)}return o&&(n+="?",n+=r(o,!1,!1)),l&&(n+="#",n+=e?l:f(l,!1,!1)),n}function x(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+x(t.substr(3)):t}}o(f,"d"),o(m,"p"),o(y,"m"),o(v,"y"),o(x,"v");const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(t){return t.match(b)?t.replace(b,(t=>x(t))):t}o(w,"C");var k=r(470);const T=k.posix||k,_="/";var E;!function(t){t.joinPath=function(t,...e){return t.with({path:T.join(t.path,...e)})},t.resolvePath=function(t,...e){let r=t.path,n=!1;r[0]!==_&&(r=_+r,n=!0);let i=T.resolve(r,...e);return n&&i[0]===_&&!t.authority&&(i=i.substring(1)),t.with({path:i})},t.dirname=function(t){if(0===t.path.length||t.path===_)return t;let e=T.dirname(t.path);return 1===e.length&&46===e.charCodeAt(0)&&(e=""),t.with({path:e})},t.basename=function(t){return T.basename(t.path)},t.extname=function(t){return T.extname(t.path)}}(E||(E={}))})(),Q7=n})();var s8,o8,l8,{URI:c8,Utils:h8}=Q7;!function(t){function e(t,e){return(null==t?void 0:t.toString())===(null==e?void 0:e.toString())}function r(t,e){const r="string"==typeof t?t:t.path,n="string"==typeof e?e:e.path,i=r.split("/").filter((t=>t.length>0)),a=n.split("/").filter((t=>t.length>0));let s=0;for(;snull!=n?n:n=Z7.create(t.toString(),r.getServices(t).LanguageMetaData.languageId,0,null!=e?e:"")}},d8=class{static{o(this,"DefaultLangiumDocuments")}constructor(t){this.documentMap=new Map,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.serviceRegistry=t.ServiceRegistry}get all(){return ZX(this.documentMap.values())}addDocument(t){const e=t.uri.toString();if(this.documentMap.has(e))throw new Error(`A document with the URI '${e}' is already present.`);this.documentMap.set(e,t)}getDocument(t){const e=t.toString();return this.documentMap.get(e)}async getOrCreateDocument(t,e){let r=this.getDocument(t);return r||(r=await this.langiumDocumentFactory.fromUri(t,e),this.addDocument(r),r)}createDocument(t,e,r){if(r)return this.langiumDocumentFactory.fromString(e,t,r).then((t=>(this.addDocument(t),t)));{const r=this.langiumDocumentFactory.fromString(e,t);return this.addDocument(r),r}}hasDocument(t){return this.documentMap.has(t.toString())}invalidateDocument(t){const e=t.toString(),r=this.documentMap.get(e);if(r){this.serviceRegistry.getServices(t).references.Linker.unlink(r),r.state=o8.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0}return r}deleteDocument(t){const e=t.toString(),r=this.documentMap.get(e);return r&&(r.state=o8.Changed,this.documentMap.delete(e)),r}},p8=Symbol("ref_resolving"),g8=class{static{o(this,"DefaultLinker")}constructor(t){this.reflection=t.shared.AstReflection,this.langiumDocuments=()=>t.shared.workspace.LangiumDocuments,this.scopeProvider=t.references.ScopeProvider,this.astNodeLocator=t.workspace.AstNodeLocator}async link(t,e=G7.CancellationToken.None){for(const r of TQ(t.parseResult.value))await K7(e),EQ(r).forEach((e=>this.doLink(e,t)))}doLink(t,e){var r;const n=t.reference;if(void 0===n._ref){n._ref=p8;try{const e=this.getCandidate(t);if(UX(e))n._ref=e;else if(n._nodeDescription=e,this.langiumDocuments().hasDocument(e.documentUri)){const r=this.loadAstNode(e);n._ref=null!=r?r:this.createLinkingError(t,e)}else n._ref=void 0}catch(e){console.error(`An error occurred while resolving reference to '${n.$refText}':`,e);const i=null!==(r=e.message)&&void 0!==r?r:String(e);n._ref=Object.assign(Object.assign({},t),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}e.references.push(n)}}unlink(t){for(const e of t.references)delete e._ref,delete e._nodeDescription;t.references=[]}getCandidate(t){const e=this.scopeProvider.getScope(t).getElement(t.reference.$refText);return null!=e?e:this.createLinkingError(t)}buildReference(t,e,r,n){const i=this,a={$refNode:r,$refText:n,get ref(){var r;if($X(this._ref))return this._ref;if(zX(this._nodeDescription)){const r=i.loadAstNode(this._nodeDescription);this._ref=null!=r?r:i.createLinkingError({reference:a,container:t,property:e},this._nodeDescription)}else if(void 0===this._ref){this._ref=p8;const n=bQ(t).$document,s=i.getLinkedNode({reference:a,container:t,property:e});if(s.error&&n&&n.state=t.end)return e.ref}if(r){const e=this.nameProvider.getNameNode(r);if(e&&(e===t||iK(t,e)))return r}}}findDeclarationNode(t){const e=this.findDeclaration(t);if(null==e?void 0:e.$cstNode){const t=this.nameProvider.getNameNode(e);return null!=t?t:e.$cstNode}}findReferences(t,e){const r=[];if(e.includeDeclaration){const e=this.getReferenceToSelf(t);e&&r.push(e)}let n=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t));return e.documentUri&&(n=n.filter((t=>s8.equals(t.sourceUri,e.documentUri)))),r.push(...n),ZX(r)}getReferenceToSelf(t){const e=this.nameProvider.getNameNode(t);if(e){const r=xQ(t),n=this.nodeLocator.getAstNodePath(t);return{sourceUri:r.uri,sourcePath:n,targetUri:r.uri,targetPath:n,segment:sK(e),local:!0}}}},v8=class{static{o(this,"MultiMap")}constructor(t){if(this.map=new Map,t)for(const[e,r]of t)this.add(e,r)}get size(){return QX.sum(ZX(this.map.values()).map((t=>t.length)))}clear(){this.map.clear()}delete(t,e){if(void 0===e)return this.map.delete(t);{const r=this.map.get(t);if(r){const n=r.indexOf(e);if(n>=0)return 1===r.length?this.map.delete(t):r.splice(n,1),!0}return!1}}get(t){var e;return null!==(e=this.map.get(t))&&void 0!==e?e:[]}has(t,e){if(void 0===e)return this.map.has(t);{const r=this.map.get(t);return!!r&&r.indexOf(e)>=0}}add(t,e){return this.map.has(t)?this.map.get(t).push(e):this.map.set(t,[e]),this}addAll(t,e){return this.map.has(t)?this.map.get(t).push(...e):this.map.set(t,Array.from(e)),this}forEach(t){this.map.forEach(((e,r)=>e.forEach((e=>t(e,r,this)))))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ZX(this.map.entries()).flatMap((([t,e])=>e.map((e=>[t,e]))))}keys(){return ZX(this.map.keys())}values(){return ZX(this.map.values()).flat()}entriesGroupedByKey(){return ZX(this.map.entries())}},x8=class{static{o(this,"BiMap")}get size(){return this.map.size}constructor(t){if(this.map=new Map,this.inverse=new Map,t)for(const[e,r]of t)this.set(e,r)}clear(){this.map.clear(),this.inverse.clear()}set(t,e){return this.map.set(t,e),this.inverse.set(e,t),this}get(t){return this.map.get(t)}getKey(t){return this.inverse.get(t)}delete(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.inverse.delete(e),!0)}},b8=class{static{o(this,"DefaultScopeComputation")}constructor(t){this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider}async computeExports(t,e=G7.CancellationToken.None){return this.computeExportsForNode(t.parseResult.value,t,void 0,e)}async computeExportsForNode(t,e,r=wQ,n=G7.CancellationToken.None){const i=[];this.exportNode(t,i,e);for(const a of r(t))await K7(n),this.exportNode(a,i,e);return i}exportNode(t,e,r){const n=this.nameProvider.getName(t);n&&e.push(this.descriptions.createDescription(t,n,r))}async computeLocalScopes(t,e=G7.CancellationToken.None){const r=t.parseResult.value,n=new v8;for(const i of kQ(r))await K7(e),this.processNode(i,t,n);return n}processNode(t,e,r){const n=t.$container;if(n){const i=this.nameProvider.getName(t);i&&r.add(n,this.descriptions.createDescription(t,i,e))}}},w8=class{static{o(this,"StreamScope")}constructor(t,e,r){var n;this.elements=t,this.outerScope=e,this.caseInsensitive=null!==(n=null==r?void 0:r.caseInsensitive)&&void 0!==n&&n}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(t){const e=this.caseInsensitive?this.elements.find((e=>e.name.toLowerCase()===t.toLowerCase())):this.elements.find((e=>e.name===t));return e||(this.outerScope?this.outerScope.getElement(t):void 0)}},k8=class{static{o(this,"MapScope")}constructor(t,e,r){var n;this.elements=new Map,this.caseInsensitive=null!==(n=null==r?void 0:r.caseInsensitive)&&void 0!==n&&n;for(const e of t){const t=this.caseInsensitive?e.name.toLowerCase():e.name;this.elements.set(t,e)}this.outerScope=e}getElement(t){const e=this.caseInsensitive?t.toLowerCase():t,r=this.elements.get(e);return r||(this.outerScope?this.outerScope.getElement(t):void 0)}getAllElements(){let t=ZX(this.elements.values());return this.outerScope&&(t=t.concat(this.outerScope.getAllElements())),t}},T8={getElement(){},getAllElements:()=>XX},_8=class{static{o(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(t){this.toDispose.push(t)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach((t=>t.dispose()))}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},E8=class extends _8{static{o(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(t){return this.throwIfDisposed(),this.cache.has(t)}set(t,e){this.throwIfDisposed(),this.cache.set(t,e)}get(t,e){if(this.throwIfDisposed(),this.cache.has(t))return this.cache.get(t);if(e){const r=e();return this.cache.set(t,r),r}}delete(t){return this.throwIfDisposed(),this.cache.delete(t)}clear(){this.throwIfDisposed(),this.cache.clear()}},C8=class extends _8{static{o(this,"ContextCache")}constructor(t){super(),this.cache=new Map,this.converter=null!=t?t:t=>t}has(t,e){return this.throwIfDisposed(),this.cacheForContext(t).has(e)}set(t,e,r){this.throwIfDisposed(),this.cacheForContext(t).set(e,r)}get(t,e,r){this.throwIfDisposed();const n=this.cacheForContext(t);if(n.has(e))return n.get(e);if(r){const t=r();return n.set(e,t),t}}delete(t,e){return this.throwIfDisposed(),this.cacheForContext(t).delete(e)}clear(t){if(this.throwIfDisposed(),t){const e=this.converter(t);this.cache.delete(e)}else this.cache.clear()}cacheForContext(t){const e=this.converter(t);let r=this.cache.get(e);return r||(r=new Map,this.cache.set(e,r)),r}},S8=class extends C8{static{o(this,"DocumentCache")}constructor(t,e){super((t=>t.toString())),e?(this.toDispose.push(t.workspace.DocumentBuilder.onDocumentPhase(e,(t=>{this.clear(t.uri.toString())}))),this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{for(const t of e)this.clear(t)})))):this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{const r=t.concat(e);for(const t of r)this.clear(t)})))}},A8=class extends E8{static{o(this,"WorkspaceCache")}constructor(t,e){super(),e?(this.toDispose.push(t.workspace.DocumentBuilder.onBuildPhase(e,(()=>{this.clear()}))),this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{e.length>0&&this.clear()})))):this.toDispose.push(t.workspace.DocumentBuilder.onUpdate((()=>{this.clear()})))}},L8=class{static{o(this,"DefaultScopeProvider")}constructor(t){this.reflection=t.shared.AstReflection,this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider,this.indexManager=t.shared.workspace.IndexManager,this.globalScopeCache=new A8(t.shared)}getScope(t){const e=[],r=this.reflection.getReferenceType(t),n=xQ(t.container).precomputedScopes;if(n){let i=t.container;do{const t=n.get(i);t.length>0&&e.push(ZX(t).filter((t=>this.reflection.isSubtype(t.type,r)))),i=i.$container}while(i)}let i=this.getGlobalScope(r,t);for(let t=e.length-1;t>=0;t--)i=this.createScope(e[t],i);return i}createScope(t,e,r){return new w8(ZX(t),e,r)}createScopeForNodes(t,e,r){const n=ZX(t).map((t=>{const e=this.nameProvider.getName(t);if(e)return this.descriptions.createDescription(t,e)})).nonNullable();return new w8(n,e,r)}getGlobalScope(t,e){return this.globalScopeCache.get(t,(()=>new k8(this.indexManager.allElements(t))))}};function N8(t){return"string"==typeof t.$comment}function I8(t){return"object"==typeof t&&!!t&&("$ref"in t||"$error"in t)}o(N8,"isAstNodeWithComment"),o(I8,"isIntermediateReference");var R8,M8=class{static{o(this,"DefaultJsonSerializer")}constructor(t){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=t.shared.workspace.LangiumDocuments,this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider,this.commentProvider=t.documentation.CommentProvider}serialize(t,e){const r=null!=e?e:{},n=null==e?void 0:e.replacer,i=o(((t,e)=>this.replacer(t,e,r)),"defaultReplacer"),a=n?(t,e)=>n(t,e,i):i;try{return this.currentDocument=xQ(t),JSON.stringify(t,a,null==e?void 0:e.space)}finally{this.currentDocument=void 0}}deserialize(t,e){const r=null!=e?e:{},n=JSON.parse(t);return this.linkNode(n,n,r),n}replacer(t,e,{refText:r,sourceText:n,textRegions:i,comments:a,uriConverter:s}){var o,l,c,h;if(!this.ignoreProperties.has(t)){if(FX(e)){const t=e.ref,n=r?e.$refText:void 0;if(t){const r=xQ(t);let i="";this.currentDocument&&this.currentDocument!==r&&(i=s?s(r.uri,e):r.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(t)}`,$refText:n}}return{$error:null!==(l=null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==l?l:"Could not resolve reference",$refText:n}}if($X(e)){let r;if(i&&(r=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},e)),t&&!e.$document||!(null==r?void 0:r.$textRegion)||(r.$textRegion.documentURI=null===(c=this.currentDocument)||void 0===c?void 0:c.uri.toString())),n&&!t&&(null!=r||(r=Object.assign({},e)),r.$sourceText=null===(h=e.$cstNode)||void 0===h?void 0:h.text),a){null!=r||(r=Object.assign({},e));const t=this.commentProvider.getComment(e);t&&(r.$comment=t.replace(/\r/g,""))}return null!=r?r:e}return e}}addAstNodeRegionWithAssignmentsTo(t){const e=o((t=>({offset:t.offset,end:t.end,length:t.length,range:t.range})),"createDocumentSegment");if(t.$cstNode){const r=(t.$textRegion=e(t.$cstNode)).assignments={};return Object.keys(t).filter((t=>!t.startsWith("$"))).forEach((n=>{const i=cJ(t.$cstNode,n).map(e);0!==i.length&&(r[n]=i)})),t}}linkNode(t,e,r,n,i,a){for(const[n,i]of Object.entries(t))if(Array.isArray(i))for(let a=0;a{await this.handleException((()=>t.call(e,r,n,i)),"An error occurred during validation",n,r)}}async handleException(t,e,r,n){try{await t()}catch(t){if(X7(t))throw t;console.error(`${e}:`,t),t instanceof Error&&t.stack&&console.error(t.stack);r("error",`${e}: ${t instanceof Error?t.message:String(t)}`,{node:n})}}addEntry(t,e){if("AstNode"!==t)for(const r of this.reflection.getAllSubTypes(t))this.entries.add(r,e);else this.entries.add("AstNode",e)}getChecks(t,e){let r=ZX(this.entries.get(t)).concat(this.entries.get("AstNode"));return e&&(r=r.filter((t=>e.includes(t.category)))),r.map((t=>t.check))}registerBeforeDocument(t,e=this){this.entriesBefore.push(this.wrapPreparationException(t,"An error occurred during set-up of the validation",e))}registerAfterDocument(t,e=this){this.entriesAfter.push(this.wrapPreparationException(t,"An error occurred during tear-down of the validation",e))}wrapPreparationException(t,e,r){return async(n,i,a,s)=>{await this.handleException((()=>t.call(r,n,i,a,s)),e,i,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}},F8=class{static{o(this,"DefaultDocumentValidator")}constructor(t){this.validationRegistry=t.validation.ValidationRegistry,this.metadata=t.LanguageMetaData}async validateDocument(t,e={},r=G7.CancellationToken.None){const n=t.parseResult,i=[];if(await K7(r),!e.categories||e.categories.includes("built-in")){if(this.processLexingErrors(n,i,e),e.stopAfterLexingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===P8.LexingError})))return i;if(this.processParsingErrors(n,i,e),e.stopAfterParsingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===P8.ParsingError})))return i;if(this.processLinkingErrors(t,i,e),e.stopAfterLinkingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===P8.LinkingError})))return i}try{i.push(...await this.validateAst(n.value,e,r))}catch(t){if(X7(t))throw t;console.error("An error occurred during validation:",t)}return await K7(r),i}processLexingErrors(t,e,r){var n,i,a;const s=[...t.lexerErrors,...null!==(i=null===(n=t.lexerReport)||void 0===n?void 0:n.diagnostics)&&void 0!==i?i:[]];for(const t of s){const r=null!==(a=t.severity)&&void 0!==a?a:"error",n={severity:U8(r),range:{start:{line:t.line-1,character:t.column-1},end:{line:t.line-1,character:t.column+t.length-1}},message:t.message,data:G8(r),source:this.getSource()};e.push(n)}}processParsingErrors(t,e,r){for(const r of t.parserErrors){let t;if(isNaN(r.token.startOffset)){if("previousToken"in r){const e=r.previousToken;if(isNaN(e.startOffset)){const e={line:0,character:0};t={start:e,end:e}}else{const r={line:e.endLine-1,character:e.endColumn};t={start:r,end:r}}}}else t=aK(r.token);if(t){const n={severity:U8("error"),range:t,message:r.message,data:O8(P8.ParsingError),source:this.getSource()};e.push(n)}}}processLinkingErrors(t,e,r){for(const r of t.references){const t=r.error;if(t){const r={node:t.container,property:t.property,index:t.index,data:{code:P8.LinkingError,containerType:t.container.$type,property:t.property,refText:t.reference.$refText}};e.push(this.toDiagnostic("error",t.message,r))}}}async validateAst(t,e,r=G7.CancellationToken.None){const n=[],i=o(((t,e,r)=>{n.push(this.toDiagnostic(t,e,r))}),"acceptor");return await this.validateAstBefore(t,e,i,r),await this.validateAstNodes(t,e,i,r),await this.validateAstAfter(t,e,i,r),n}async validateAstBefore(t,e,r,n=G7.CancellationToken.None){var i;const a=this.validationRegistry.checksBefore;for(const s of a)await K7(n),await s(t,r,null!==(i=e.categories)&&void 0!==i?i:[],n)}async validateAstNodes(t,e,r,n=G7.CancellationToken.None){await Promise.all(TQ(t).map((async t=>{await K7(n);const i=this.validationRegistry.getChecks(t.$type,e.categories);for(const e of i)await e(t,r,n)})))}async validateAstAfter(t,e,r,n=G7.CancellationToken.None){var i;const a=this.validationRegistry.checksAfter;for(const s of a)await K7(n),await s(t,r,null!==(i=e.categories)&&void 0!==i?i:[],n)}toDiagnostic(t,e,r){return{message:e,range:z8(r),severity:U8(t),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function z8(t){if(t.range)return t.range;let e;return"string"==typeof t.property?e=hJ(t.node.$cstNode,t.property,t.index):"string"==typeof t.keyword&&(e=pJ(t.node.$cstNode,t.keyword,t.index)),null!=e||(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function U8(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function G8(t){switch(t){case"error":return O8(P8.LexingError);case"warning":return O8(P8.LexingWarning);case"info":return O8(P8.LexingInfo);case"hint":return O8(P8.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}o(z8,"getDiagnosticRange"),o(U8,"toDiagnosticSeverity"),o(G8,"toDiagnosticData"),(B8=P8||(P8={})).LexingError="lexing-error",B8.LexingWarning="lexing-warning",B8.LexingInfo="lexing-info",B8.LexingHint="lexing-hint",B8.ParsingError="parsing-error",B8.LinkingError="linking-error";var q8=class{static{o(this,"DefaultAstNodeDescriptionProvider")}constructor(t){this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider}createDescription(t,e,r){const n=null!=r?r:xQ(t);null!=e||(e=this.nameProvider.getName(t));const i=this.astNodeLocator.getAstNodePath(t);if(!e)throw new Error(`Node at path ${i} has no name.`);let a;const s=o((()=>{var e;return null!=a?a:a=sK(null!==(e=this.nameProvider.getNameNode(t))&&void 0!==e?e:t.$cstNode)}),"nameSegmentGetter");return{node:t,name:e,get nameSegment(){return s()},selectionSegment:sK(t.$cstNode),type:t.$type,documentUri:n.uri,path:i}}},j8=class{static{o(this,"DefaultReferenceDescriptionProvider")}constructor(t){this.nodeLocator=t.workspace.AstNodeLocator}async createDescriptions(t,e=G7.CancellationToken.None){const r=[],n=t.parseResult.value;for(const t of TQ(n))await K7(e),EQ(t).filter((t=>!UX(t))).forEach((t=>{const e=this.createDescription(t);e&&r.push(e)}));return r}createDescription(t){const e=t.reference.$nodeDescription,r=t.reference.$refNode;if(!e||!r)return;const n=xQ(t.container).uri;return{sourceUri:n,sourcePath:this.nodeLocator.getAstNodePath(t.container),targetUri:e.documentUri,targetPath:e.path,segment:sK(r),local:s8.equals(e.documentUri,n)}}},W8=class{static{o(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(t){if(t.$container){const e=this.getAstNodePath(t.$container),r=this.getPathSegment(t);return e+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:t,$containerIndex:e}){if(!t)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==e?t+this.indexSeparator+e:t}getAstNode(t,e){return e.split(this.segmentSeparator).reduce(((t,e)=>{if(!t||0===e.length)return t;const r=e.indexOf(this.indexSeparator);if(r>0){const n=e.substring(0,r),i=parseInt(e.substring(r+1)),a=t[n];return null==a?void 0:a[i]}return t[e]}),t)}},Y8={};d(Y8,p(DX(),1));var H8,V8=class{static{o(this,"DefaultConfigurationProvider")}constructor(t){this._ready=new J7,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Y8.Emitter,this.serviceRegistry=t.ServiceRegistry}get ready(){return this._ready.promise}initialize(t){var e,r;this.workspaceConfig=null!==(r=null===(e=t.capabilities.workspace)||void 0===e?void 0:e.configuration)&&void 0!==r&&r}async initialized(t){if(this.workspaceConfig){if(t.register){const e=this.serviceRegistry.all;t.register({section:e.map((t=>this.toSectionName(t.LanguageMetaData.languageId)))})}if(t.fetchConfiguration){const e=this.serviceRegistry.all.map((t=>({section:this.toSectionName(t.LanguageMetaData.languageId)}))),r=await t.fetchConfiguration(e);e.forEach(((t,e)=>{this.updateSectionConfiguration(t.section,r[e])}))}}this._ready.resolve()}updateConfiguration(t){t.settings&&Object.keys(t.settings).forEach((e=>{const r=t.settings[e];this.updateSectionConfiguration(e,r),this.onConfigurationSectionUpdateEmitter.fire({section:e,configuration:r})}))}updateSectionConfiguration(t,e){this.settings[t]=e}async getConfiguration(t,e){await this.ready;const r=this.toSectionName(t);if(this.settings[r])return this.settings[r][e]}toSectionName(t){return`${t}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};!function(t){function e(t){return{dispose:o((async()=>await t()),"dispose")}}o(e,"create"),t.create=e}(H8||(H8={}));var X8=class{static{o(this,"DefaultDocumentBuilder")}constructor(t){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new v8,this.documentPhaseListeners=new v8,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=o8.Changed,this.langiumDocuments=t.workspace.LangiumDocuments,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.textDocuments=t.workspace.TextDocuments,this.indexManager=t.workspace.IndexManager,this.serviceRegistry=t.ServiceRegistry}async build(t,e={},r=G7.CancellationToken.None){var n,i;for(const r of t){const t=r.uri.toString();if(r.state===o8.Validated){if("boolean"==typeof e.validation&&e.validation)r.state=o8.IndexedReferences,r.diagnostics=void 0,this.buildState.delete(t);else if("object"==typeof e.validation){const a=this.buildState.get(t),s=null===(n=null==a?void 0:a.result)||void 0===n?void 0:n.validationChecks;if(s){const n=(null!==(i=e.validation.categories)&&void 0!==i?i:R8.all).filter((t=>!s.includes(t)));n.length>0&&(this.buildState.set(t,{completed:!1,options:{validation:Object.assign(Object.assign({},e.validation),{categories:n})},result:a.result}),r.state=o8.IndexedReferences)}}}else this.buildState.delete(t)}this.currentState=o8.Changed,await this.emitUpdate(t.map((t=>t.uri)),[]),await this.buildDocuments(t,e,r)}async update(t,e,r=G7.CancellationToken.None){this.currentState=o8.Changed;for(const t of e)this.langiumDocuments.deleteDocument(t),this.buildState.delete(t.toString()),this.indexManager.remove(t);for(const e of t){if(!this.langiumDocuments.invalidateDocument(e)){const t=this.langiumDocumentFactory.fromModel({$type:"INVALID"},e);t.state=o8.Changed,this.langiumDocuments.addDocument(t)}this.buildState.delete(e.toString())}const n=ZX(t).concat(e).map((t=>t.toString())).toSet();this.langiumDocuments.all.filter((t=>!n.has(t.uri.toString())&&this.shouldRelink(t,n))).forEach((t=>{this.serviceRegistry.getServices(t.uri).references.Linker.unlink(t),t.state=Math.min(t.state,o8.ComputedScopes),t.diagnostics=void 0})),await this.emitUpdate(t,e),await K7(r);const i=this.sortDocuments(this.langiumDocuments.all.filter((t=>{var e;return t.stater(t,e))))}sortDocuments(t){let e=0,r=t.length-1;for(;e=0&&!this.hasTextDocument(t[r]);)r--;evoid 0!==t.error))||this.indexManager.isAffected(t,e)}onUpdate(t){return this.updateListeners.push(t),H8.create((()=>{const e=this.updateListeners.indexOf(t);e>=0&&this.updateListeners.splice(e,1)}))}async buildDocuments(t,e,r){this.prepareBuild(t,e),await this.runCancelable(t,o8.Parsed,r,(t=>this.langiumDocumentFactory.update(t,r))),await this.runCancelable(t,o8.IndexedContent,r,(t=>this.indexManager.updateContent(t,r))),await this.runCancelable(t,o8.ComputedScopes,r,(async t=>{const e=this.serviceRegistry.getServices(t.uri).references.ScopeComputation;t.precomputedScopes=await e.computeLocalScopes(t,r)})),await this.runCancelable(t,o8.Linked,r,(t=>this.serviceRegistry.getServices(t.uri).references.Linker.link(t,r))),await this.runCancelable(t,o8.IndexedReferences,r,(t=>this.indexManager.updateReferences(t,r)));const n=t.filter((t=>this.shouldValidate(t)));await this.runCancelable(n,o8.Validated,r,(t=>this.validate(t,r)));for(const e of t){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}}prepareBuild(t,e){for(const r of t){const t=r.uri.toString(),n=this.buildState.get(t);n&&!n.completed||this.buildState.set(t,{completed:!1,options:e,result:null==n?void 0:n.result})}}async runCancelable(t,e,r,n){const i=t.filter((t=>t.statet.state===e));await this.notifyBuildPhase(a,e,r),this.currentState=e}onBuildPhase(t,e){return this.buildPhaseListeners.add(t,e),H8.create((()=>{this.buildPhaseListeners.delete(t,e)}))}onDocumentPhase(t,e){return this.documentPhaseListeners.add(t,e),H8.create((()=>{this.documentPhaseListeners.delete(t,e)}))}waitUntil(t,e,r){let n;if(e&&"path"in e?n=e:r=e,null!=r||(r=G7.CancellationToken.None),n){const e=this.langiumDocuments.getDocument(n);if(e&&e.state>t)return Promise.resolve(n)}return this.currentState>=t?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(V7):new Promise(((e,i)=>{const a=this.onBuildPhase(t,(()=>{if(a.dispose(),s.dispose(),n){const t=this.langiumDocuments.getDocument(n);e(null==t?void 0:t.uri)}else e(void 0)})),s=r.onCancellationRequested((()=>{a.dispose(),s.dispose(),i(V7)}))}))}async notifyDocumentPhase(t,e,r){const n=this.documentPhaseListeners.get(e).slice();for(const e of n)try{await e(t,r)}catch(t){if(!X7(t))throw t}}async notifyBuildPhase(t,e,r){if(0===t.length)return;const n=this.buildPhaseListeners.get(e).slice();for(const e of n)await K7(r),await e(t,r)}shouldValidate(t){return Boolean(this.getBuildOptions(t).validation)}async validate(t,e){var r,n;const i=this.serviceRegistry.getServices(t.uri).validation.DocumentValidator,a=this.getBuildOptions(t).validation,s="object"==typeof a?a:void 0,o=await i.validateDocument(t,s,e);t.diagnostics?t.diagnostics.push(...o):t.diagnostics=o;const l=this.buildState.get(t.uri.toString());if(l){null!==(r=l.result)&&void 0!==r||(l.result={});const t=null!==(n=null==s?void 0:s.categories)&&void 0!==n?n:R8.all;l.result.validationChecks?l.result.validationChecks.push(...t):l.result.validationChecks=[...t]}}getBuildOptions(t){var e,r;return null!==(r=null===(e=this.buildState.get(t.uri.toString()))||void 0===e?void 0:e.options)&&void 0!==r?r:{}}},K8=class{static{o(this,"DefaultIndexManager")}constructor(t){this.symbolIndex=new Map,this.symbolByTypeIndex=new C8,this.referenceIndex=new Map,this.documents=t.workspace.LangiumDocuments,this.serviceRegistry=t.ServiceRegistry,this.astReflection=t.AstReflection}findAllReferences(t,e){const r=xQ(t).uri,n=[];return this.referenceIndex.forEach((t=>{t.forEach((t=>{s8.equals(t.targetUri,r)&&t.targetPath===e&&n.push(t)}))})),ZX(n)}allElements(t,e){let r=ZX(this.symbolIndex.keys());return e&&(r=r.filter((t=>!e||e.has(t)))),r.map((e=>this.getFileDescriptions(e,t))).flat()}getFileDescriptions(t,e){var r;if(!e)return null!==(r=this.symbolIndex.get(t))&&void 0!==r?r:[];const n=this.symbolByTypeIndex.get(t,e,(()=>{var r;return(null!==(r=this.symbolIndex.get(t))&&void 0!==r?r:[]).filter((t=>this.astReflection.isSubtype(t.type,e)))}));return n}remove(t){const e=t.toString();this.symbolIndex.delete(e),this.symbolByTypeIndex.clear(e),this.referenceIndex.delete(e)}async updateContent(t,e=G7.CancellationToken.None){const r=this.serviceRegistry.getServices(t.uri),n=await r.references.ScopeComputation.computeExports(t,e),i=t.uri.toString();this.symbolIndex.set(i,n),this.symbolByTypeIndex.clear(i)}async updateReferences(t,e=G7.CancellationToken.None){const r=this.serviceRegistry.getServices(t.uri),n=await r.workspace.ReferenceDescriptionProvider.createDescriptions(t,e);this.referenceIndex.set(t.uri.toString(),n)}isAffected(t,e){const r=this.referenceIndex.get(t.uri.toString());return!!r&&r.some((t=>!t.local&&e.has(t.targetUri.toString())))}},Z8=class{static{o(this,"DefaultWorkspaceManager")}constructor(t){this.initialBuildOptions={},this._ready=new J7,this.serviceRegistry=t.ServiceRegistry,this.langiumDocuments=t.workspace.LangiumDocuments,this.documentBuilder=t.workspace.DocumentBuilder,this.fileSystemProvider=t.workspace.FileSystemProvider,this.mutex=t.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(t){var e;this.folders=null!==(e=t.workspaceFolders)&&void 0!==e?e:void 0}initialized(t){return this.mutex.write((t=>{var e;return this.initializeWorkspace(null!==(e=this.folders)&&void 0!==e?e:[],t)}))}async initializeWorkspace(t,e=G7.CancellationToken.None){const r=await this.performStartup(t);await K7(e),await this.documentBuilder.build(r,this.initialBuildOptions,e)}async performStartup(t){const e=this.serviceRegistry.all.flatMap((t=>t.LanguageMetaData.fileExtensions)),r=[],n=o((t=>{r.push(t),this.langiumDocuments.hasDocument(t.uri)||this.langiumDocuments.addDocument(t)}),"collector");return await this.loadAdditionalDocuments(t,n),await Promise.all(t.map((t=>[t,this.getRootFolder(t)])).map((async t=>this.traverseFolder(...t,e,n)))),this._ready.resolve(),r}loadAdditionalDocuments(t,e){return Promise.resolve()}getRootFolder(t){return c8.parse(t.uri)}async traverseFolder(t,e,r,n){const i=await this.fileSystemProvider.readDirectory(e);await Promise.all(i.map((async e=>{if(this.includeEntry(t,e,r))if(e.isDirectory)await this.traverseFolder(t,e.uri,r,n);else if(e.isFile){const t=await this.langiumDocuments.getOrCreateDocument(e.uri);n(t)}})))}includeEntry(t,e,r){const n=s8.basename(e.uri);if(n.startsWith("."))return!1;if(e.isDirectory)return"node_modules"!==n&&"out"!==n;if(e.isFile){const t=s8.extname(e.uri);return r.includes(t)}return!1}},Q8=class{static{o(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(t,e,r,n,i){return P1.buildUnexpectedCharactersMessage(t,e,r,n,i)}buildUnableToPopLexerModeMessage(t){return P1.buildUnableToPopLexerModeMessage(t)}},J8={mode:"full"},t9=class{static{o(this,"DefaultLexer")}constructor(t){this.errorMessageProvider=t.parser.LexerErrorMessageProvider,this.tokenBuilder=t.parser.TokenBuilder;const e=this.tokenBuilder.buildTokens(t.Grammar,{caseInsensitive:t.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(e);const r=n9(e)?Object.values(e):e,n="production"===t.LanguageMetaData.mode;this.chevrotainLexer=new $1(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(t,e=J8){var r,n,i;const a=this.chevrotainLexer.tokenize(t);return{tokens:a.tokens,errors:a.errors,hidden:null!==(r=a.groups.hidden)&&void 0!==r?r:[],report:null===(i=(n=this.tokenBuilder).flushLexingReport)||void 0===i?void 0:i.call(n,t)}}toTokenTypeDictionary(t){if(n9(t))return t;const e=r9(t)?Object.values(t.modes).flat():t,r={};return e.forEach((t=>r[t.name]=t)),r}};function e9(t){return Array.isArray(t)&&(0===t.length||"name"in t[0])}function r9(t){return t&&"modes"in t&&"defaultMode"in t}function n9(t){return!e9(t)&&!r9(t)}function i9(t,e,r){let n,i;"string"==typeof t?(i=e,n=r):(i=t.range.start,n=e),i||(i=H5.create(0,0));return f9({index:0,tokens:c9({lines:s9(t),position:i,options:k9(n)}),position:i})}function a9(t,e){const r=k9(e),n=s9(t);if(0===n.length)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return Boolean(null==s?void 0:s.exec(i))&&Boolean(null==o?void 0:o.exec(a))}function s9(t){let e="";e="string"==typeof t?t:t.text;return e.split(WQ)}o(e9,"isTokenTypeArray"),o(r9,"isIMultiModeLexerDefinition"),o(n9,"isTokenTypeDictionary"),o(i9,"parseJSDoc"),o(a9,"isJSDoc"),o(s9,"getLines");var o9=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,l9=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function c9(t){var e,r,n;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o=h.length){if(i.length>0){const t=H5.create(a,s);i.push({type:"break",content:"",range:V5.create(t,t)})}}else{o9.lastIndex=u;const t=o9.exec(h);if(t){const e=t[0],r=t[1],n=H5.create(a,s+u),o=H5.create(a,s+u+e.length);i.push({type:"tag",content:r,range:V5.create(n,o)}),u+=e.length,u=p9(h,u)}if(u0&&"break"===i[i.length-1].type?i.slice(0,-1):i}function h9(t,e,r,n){const i=[];if(0===t.length){const t=H5.create(r,n),a=H5.create(r,n+e.length);i.push({type:"text",content:e,range:V5.create(t,a)})}else{let a=0;for(const s of t){const t=s.index,o=e.substring(a,t);o.length>0&&i.push({type:"text",content:e.substring(a,t),range:V5.create(H5.create(r,a+n),H5.create(r,t+n))});let l=o.length+1;const c=s[1];if(i.push({type:"inline-tag",content:c,range:V5.create(H5.create(r,a+l+n),H5.create(r,a+l+c.length+n))}),l+=c.length,4===s.length){l+=s[2].length;const t=s[3];i.push({type:"text",content:t,range:V5.create(H5.create(r,a+l+n),H5.create(r,a+l+t.length+n))})}else i.push({type:"text",content:"",range:V5.create(H5.create(r,a+l+n),H5.create(r,a+l+n))});a=t+s[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:V5.create(H5.create(r,a+n),H5.create(r,a+n+s.length))})}return i}o(c9,"tokenize"),o(h9,"buildInlineTokens");var u9=/\S/,d9=/\s*$/;function p9(t,e){const r=t.substring(e).match(u9);return r?e+r.index:t.length}function g9(t){const e=t.match(d9);if(e&&"number"==typeof e.index)return e.index}function f9(t){var e,r,n,i;const a=H5.create(t.position.line,t.position.character);if(0===t.tokens.length)return new _9([],V5.create(a,a));const s=[];for(;t.indexe.name===t))}getTags(t){return this.getAllTags().filter((e=>e.name===t))}getAllTags(){return this.elements.filter((t=>"name"in t))}toString(){let t="";for(const e of this.elements)if(0===t.length)t=e.toString();else{const r=e.toString();t+=N9(t)+r}return t.trim()}toMarkdown(t){let e="";for(const r of this.elements)if(0===e.length)e=r.toMarkdown(t);else{const n=r.toMarkdown(t);e+=N9(e)+n}return e.trim()}},E9=class{static{o(this,"JSDocTagImpl")}constructor(t,e,r,n){this.name=t,this.content=e,this.inline=r,this.range=n}toString(){let t=`@${this.name}`;const e=this.content.toString();return 1===this.content.inlines.length?t=`${t} ${e}`:this.content.inlines.length>1&&(t=`${t}\n${e}`),this.inline?`{${t}}`:t}toMarkdown(t){var e,r;return null!==(r=null===(e=null==t?void 0:t.renderTag)||void 0===e?void 0:e.call(t,this))&&void 0!==r?r:this.toMarkdownDefault(t)}toMarkdownDefault(t){const e=this.content.toMarkdown(t);if(this.inline){const r=C9(this.name,e,null!=t?t:{});if("string"==typeof r)return r}let r="";"italic"===(null==t?void 0:t.tag)||void 0===(null==t?void 0:t.tag)?r="*":"bold"===(null==t?void 0:t.tag)?r="**":"bold-italic"===(null==t?void 0:t.tag)&&(r="***");let n=`${r}@${this.name}${r}`;return 1===this.content.inlines.length?n=`${n} — ${e}`:this.content.inlines.length>1&&(n=`${n}\n${e}`),this.inline?`{${n}}`:n}};function C9(t,e,r){var n,i;if("linkplain"===t||"linkcode"===t||"link"===t){const a=e.indexOf(" ");let s=e;if(a>0){const t=p9(e,a);s=e.substring(t),e=e.substring(0,a)}("linkcode"===t||"link"===t&&"code"===r.link)&&(s=`\`${s}\``);return null!==(i=null===(n=r.renderLink)||void 0===n?void 0:n.call(r,e,s))&&void 0!==i?i:S9(e,s)}}function S9(t,e){try{return c8.parse(t,!0),`[${e}](${t})`}catch(e){return t}}o(C9,"renderInlineTag"),o(S9,"renderLinkDefault");var A9=class{static{o(this,"JSDocTextImpl")}constructor(t,e){this.inlines=t,this.range=e}toString(){let t="";for(let e=0;er.range.start.line&&(t+="\n")}return t}toMarkdown(t){let e="";for(let r=0;rn.range.start.line&&(e+="\n")}return e}},L9=class{static{o(this,"JSDocLineImpl")}constructor(t,e){this.text=t,this.range=e}toString(){return this.text}toMarkdown(){return this.text}};function N9(t){return t.endsWith("\n")?"\n":"\n\n"}o(N9,"fillNewlines");var I9,R9=class{static{o(this,"JSDocDocumentationProvider")}constructor(t){this.indexManager=t.shared.workspace.IndexManager,this.commentProvider=t.documentation.CommentProvider}getDocumentation(t){const e=this.commentProvider.getComment(t);if(e&&a9(e)){return i9(e).toMarkdown({renderLink:o(((e,r)=>this.documentationLinkRenderer(t,e,r)),"renderLink"),renderTag:o((e=>this.documentationTagRenderer(t,e)),"renderTag")})}}documentationLinkRenderer(t,e,r){var n;const i=null!==(n=this.findNameInPrecomputedScopes(t,e))&&void 0!==n?n:this.findNameInGlobalScope(t,e);if(i&&i.nameSegment){const t=i.nameSegment.range.start.line+1,e=i.nameSegment.range.start.character+1;return`[${r}](${i.documentUri.with({fragment:`L${t},${e}`}).toString()})`}}documentationTagRenderer(t,e){}findNameInPrecomputedScopes(t,e){const r=xQ(t).precomputedScopes;if(!r)return;let n=t;do{const t=r.get(n).find((t=>t.name===e));if(t)return t;n=n.$container}while(n)}findNameInGlobalScope(t,e){const r=this.indexManager.allElements().find((t=>t.name===e));return r}},M9=class{static{o(this,"DefaultCommentProvider")}constructor(t){this.grammarConfig=()=>t.parser.GrammarConfig}getComment(t){var e;return N8(t)?t.$comment:null===(e=uK(t.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===e?void 0:e.text}},D9=class{static{o(this,"DefaultAsyncParser")}constructor(t){this.syncParser=t.parser.LangiumParser}parse(t,e){return Promise.resolve(this.syncParser.parse(t))}},O9=class{static{o(this,"AbstractThreadedAsyncParser")}constructor(t){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=t.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const e=this.queue.shift();e&&(t.lock(),e.resolve(t))}})),this.workerPool.push(t)}}async parse(t,e){const r=await this.acquireParserWorker(e),n=new J7;let i;const a=e.onCancellationRequested((()=>{i=setTimeout((()=>{this.terminateWorker(r)}),this.terminationDelay)}));return r.parse(t).then((t=>{const e=this.hydrator.hydrate(t);n.resolve(e)})).catch((t=>{n.reject(t)})).finally((()=>{a.dispose(),clearTimeout(i)})),n.promise}terminateWorker(t){t.terminate();const e=this.workerPool.indexOf(t);e>=0&&this.workerPool.splice(e,1)}async acquireParserWorker(t){this.initializeWorkers();for(const t of this.workerPool)if(t.ready)return t.lock(),t;const e=new J7;return t.onCancellationRequested((()=>{const t=this.queue.indexOf(e);t>=0&&this.queue.splice(t,1),e.reject(V7)})),this.queue.push(e),e.promise}},P9=class{static{o(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(t,e,r,n){this.onReadyEmitter=new Y8.Emitter,this.deferred=new J7,this._ready=!0,this._parsing=!1,this.sendMessage=t,this._terminate=n,e((t=>{const e=t;this.deferred.resolve(e),this.unlock()})),r((t=>{this.deferred.reject(t),this.unlock()}))}terminate(){this.deferred.reject(V7),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(t){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new J7,this.sendMessage(t),this.deferred.promise}},B9=class{static{o(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new G7.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(t){this.cancelWrite();const e=Y7();return this.previousTokenSource=e,this.enqueue(this.writeQueue,t,e.token)}read(t){return this.enqueue(this.readQueue,t)}enqueue(t,e,r=G7.CancellationToken.None){const n=new J7,i={action:e,deferred:n,cancellationToken:r};return t.push(i),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;const t=[];if(this.writeQueue.length>0)t.push(this.writeQueue.shift());else{if(!(this.readQueue.length>0))return;t.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(t.map((async({action:t,deferred:e,cancellationToken:r})=>{try{const n=await Promise.resolve().then((()=>t(r)));e.resolve(n)}catch(t){X7(t)?e.resolve(void 0):e.reject(t)}}))),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$9=class{static{o(this,"DefaultHydrator")}constructor(t){this.grammarElementIdMap=new x8,this.tokenTypeIdMap=new x8,this.grammar=t.Grammar,this.lexer=t.parser.Lexer,this.linker=t.references.Linker}dehydrate(t){return{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport?this.dehydrateLexerReport(t.lexerReport):void 0,parserErrors:t.parserErrors.map((t=>Object.assign(Object.assign({},t),{message:t.message}))),value:this.dehydrateAstNode(t.value,this.createDehyrationContext(t.value))}}dehydrateLexerReport(t){return t}createDehyrationContext(t){const e=new Map,r=new Map;for(const r of TQ(t))e.set(r,{});if(t.$cstNode)for(const e of rK(t.$cstNode))r.set(e,{});return{astNodes:e,cstNodes:r}}dehydrateAstNode(t,e){const r=e.astNodes.get(t);r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,void 0!==t.$cstNode&&(r.$cstNode=this.dehydrateCstNode(t.$cstNode,e));for(const[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Array.isArray(i)){const t=[];r[n]=t;for(const r of i)$X(r)?t.push(this.dehydrateAstNode(r,e)):FX(r)?t.push(this.dehydrateReference(r,e)):t.push(r)}else $X(i)?r[n]=this.dehydrateAstNode(i,e):FX(i)?r[n]=this.dehydrateReference(i,e):void 0!==i&&(r[n]=i);return r}dehydrateReference(t,e){const r={};return r.$refText=t.$refText,t.$refNode&&(r.$refNode=e.cstNodes.get(t.$refNode)),r}dehydrateCstNode(t,e){const r=e.cstNodes.get(t);return WX(t)?r.fullText=t.fullText:r.grammarSource=this.getGrammarElementId(t.grammarSource),r.hidden=t.hidden,r.astNode=e.astNodes.get(t.astNode),qX(t)?r.content=t.content.map((t=>this.dehydrateCstNode(t,e))):jX(t)&&(r.tokenType=t.tokenType.name,r.offset=t.offset,r.length=t.length,r.startLine=t.range.start.line,r.startColumn=t.range.start.character,r.endLine=t.range.end.line,r.endColumn=t.range.end.character),r}hydrate(t){const e=t.value,r=this.createHydrationContext(e);return"$cstNode"in e&&this.hydrateCstNode(e.$cstNode,r),{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport,parserErrors:t.parserErrors,value:this.hydrateAstNode(e,r)}}createHydrationContext(t){const e=new Map,r=new Map;for(const r of TQ(t))e.set(r,{});let n;if(t.$cstNode)for(const e of rK(t.$cstNode)){let t;"fullText"in e?(t=new l7(e.fullText),n=t):"content"in e?t=new s7:"tokenType"in e&&(t=this.hydrateCstLeafNode(e)),t&&(r.set(e,t),t.root=n)}return{astNodes:e,cstNodes:r}}hydrateAstNode(t,e){const r=e.astNodes.get(t);r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,t.$cstNode&&(r.$cstNode=e.cstNodes.get(t.$cstNode));for(const[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Array.isArray(i)){const t=[];r[n]=t;for(const a of i)$X(a)?t.push(this.setParent(this.hydrateAstNode(a,e),r)):FX(a)?t.push(this.hydrateReference(a,r,n,e)):t.push(a)}else $X(i)?r[n]=this.setParent(this.hydrateAstNode(i,e),r):FX(i)?r[n]=this.hydrateReference(i,r,n,e):void 0!==i&&(r[n]=i);return r}setParent(t,e){return t.$container=e,t}hydrateReference(t,e,r,n){return this.linker.buildReference(e,r,n.cstNodes.get(t.$refNode),t.$refText)}hydrateCstNode(t,e,r=0){const n=e.cstNodes.get(t);if("number"==typeof t.grammarSource&&(n.grammarSource=this.getGrammarElement(t.grammarSource)),n.astNode=e.astNodes.get(t.astNode),qX(n))for(const i of t.content){const t=this.hydrateCstNode(i,e,r++);n.content.push(t)}return n}hydrateCstLeafNode(t){const e=this.getTokenType(t.tokenType),r=t.offset,n=t.length,i=t.startLine,a=t.startColumn,s=t.endLine,o=t.endColumn,l=t.hidden;return new a7(r,n,{start:{line:i,character:a},end:{line:s,character:o}},e,l)}getTokenType(t){return this.lexer.definition[t]}getGrammarElementId(t){if(t)return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(t)}getGrammarElement(t){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();return this.grammarElementIdMap.getKey(t)}createGrammarElementIdMap(){let t=0;for(const e of TQ(this.grammar))zK(e)&&this.grammarElementIdMap.set(e,t++)}};function F9(t){return{documentation:{CommentProvider:o((t=>new M9(t)),"CommentProvider"),DocumentationProvider:o((t=>new R9(t)),"DocumentationProvider")},parser:{AsyncParser:o((t=>new D9(t)),"AsyncParser"),GrammarConfig:o((t=>UJ(t)),"GrammarConfig"),LangiumParser:o((t=>B7(t)),"LangiumParser"),CompletionParser:o((t=>P7(t)),"CompletionParser"),ValueConverter:o((()=>new U7),"ValueConverter"),TokenBuilder:o((()=>new z7),"TokenBuilder"),Lexer:o((t=>new t9(t)),"Lexer"),ParserErrorMessageProvider:o((()=>new f7),"ParserErrorMessageProvider"),LexerErrorMessageProvider:o((()=>new Q8),"LexerErrorMessageProvider")},workspace:{AstNodeLocator:o((()=>new W8),"AstNodeLocator"),AstNodeDescriptionProvider:o((t=>new q8(t)),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:o((t=>new j8(t)),"ReferenceDescriptionProvider")},references:{Linker:o((t=>new g8(t)),"Linker"),NameProvider:o((()=>new m8),"NameProvider"),ScopeProvider:o((t=>new L8(t)),"ScopeProvider"),ScopeComputation:o((t=>new b8(t)),"ScopeComputation"),References:o((t=>new y8(t)),"References")},serializer:{Hydrator:o((t=>new $9(t)),"Hydrator"),JsonSerializer:o((t=>new M8(t)),"JsonSerializer")},validation:{DocumentValidator:o((t=>new F8(t)),"DocumentValidator"),ValidationRegistry:o((t=>new $8(t)),"ValidationRegistry")},shared:o((()=>t.shared),"shared")}}function z9(t){return{ServiceRegistry:o((t=>new D8(t)),"ServiceRegistry"),workspace:{LangiumDocuments:o((t=>new d8(t)),"LangiumDocuments"),LangiumDocumentFactory:o((t=>new u8(t)),"LangiumDocumentFactory"),DocumentBuilder:o((t=>new X8(t)),"DocumentBuilder"),IndexManager:o((t=>new K8(t)),"IndexManager"),WorkspaceManager:o((t=>new Z8(t)),"WorkspaceManager"),FileSystemProvider:o((e=>t.fileSystemProvider(e)),"FileSystemProvider"),WorkspaceLock:o((()=>new B9),"WorkspaceLock"),ConfigurationProvider:o((t=>new V8(t)),"ConfigurationProvider")}}}function U9(t,e,r,n,i,a,s,o,l){return j9([t,e,r,n,i,a,s,o,l].reduce(H9,{}))}o(F9,"createDefaultCoreModule"),o(z9,"createDefaultSharedCoreModule"),(I9||(I9={})).merge=(t,e)=>H9(H9({},t),e),o(U9,"inject");var G9=Symbol("isProxy");function q9(t){if(t&&t[G9])for(const e of Object.values(t))q9(e);return t}function j9(t,e){const r=new Proxy({},{deleteProperty:o((()=>!1),"deleteProperty"),set:o((()=>{throw new Error("Cannot set property on injected service container")}),"set"),get:o(((n,i)=>i===G9||Y9(n,i,t,e||r)),"get"),getOwnPropertyDescriptor:o(((n,i)=>(Y9(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i))),"getOwnPropertyDescriptor"),has:o(((e,r)=>r in t),"has"),ownKeys:o((()=>[...Object.getOwnPropertyNames(t)]),"ownKeys")});return r}o(q9,"eagerLoad"),o(j9,"_inject");var W9=Symbol();function Y9(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===W9)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}if(e in r){const i=r[e];t[e]=W9;try{t[e]="function"==typeof i?i(n):j9(i,n)}catch(r){throw t[e]=r instanceof Error?r:void 0,r}return t[e]}}function H9(t,e){if(e)for(const[r,n]of Object.entries(e))if(void 0!==n){const e=t[r];t[r]=null!==e&&null!==n&&"object"==typeof e&&"object"==typeof n?H9(e,n):n}return t}o(Y9,"_resolve"),o(H9,"_merge");var V9,X9,K9={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]};(X9=V9||(V9={})).REGULAR="indentation-sensitive",X9.IGNORE_INDENTATION="ignore-indentation";var Z9=class extends z7{static{o(this,"IndentationAwareTokenBuilder")}constructor(t=K9){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options=Object.assign(Object.assign({},K9),t),this.indentTokenType=X1({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=X1({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(t,e){const r=super.buildTokens(t,e);if(!e9(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:a,ignoreIndentationDelimiters:s}=this.options;let o,l,c;const h=[];for(const t of r){for(const[e,r]of s)t.name===e?t.PUSH_MODE=V9.IGNORE_INDENTATION:t.name===r&&(t.POP_MODE=!0);t.name===i?o=t:t.name===n?l=t:t.name===a?c=t:h.push(t)}if(!o||!l||!c)throw new Error("Some indentation/whitespace tokens not found!");if(s.length>0){return{modes:{[V9.REGULAR]:[o,l,...h,c],[V9.IGNORE_INDENTATION]:[...h,c]},defaultMode:V9.REGULAR}}return[o,l,c,...h]}flushLexingReport(t){const e=super.flushLexingReport(t);return Object.assign(Object.assign({},e),{remainingDedents:this.flushRemainingDedents(t)})}isStartOfLine(t,e){return 0===e||"\r\n".includes(t[e-1])}matchWhitespace(t,e,r,n){var i;this.whitespaceRegExp.lastIndex=e;const a=this.whitespaceRegExp.exec(t);return{currIndentLevel:null!==(i=null==a?void 0:a[0].length)&&void 0!==i?i:0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(t,e,r,n){const i=this.getLineNumber(e,n);return Q1(t,r,n,n+r.length,i,i,1,r.length)}getLineNumber(t,e){return t.substring(0,e).split(/\r\n|\r|\n/).length}indentMatcher(t,e,r,n){if(!this.isStartOfLine(t,e))return null;const{currIndentLevel:i,prevIndentLevel:a,match:s}=this.matchWhitespace(t,e,r,n);return i<=a?null:(this.indentationStack.push(i),s)}dedentMatcher(t,e,r,n){var i,a,s,o;if(!this.isStartOfLine(t,e))return null;const{currIndentLevel:l,prevIndentLevel:c,match:h}=this.matchWhitespace(t,e,r,n);if(l>=c)return null;const u=this.indentationStack.lastIndexOf(l);if(-1===u)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${l} at offset: ${e}. Current indentation stack: ${this.indentationStack}`,offset:e,length:null!==(a=null===(i=null==h?void 0:h[0])||void 0===i?void 0:i.length)&&void 0!==a?a:0,line:this.getLineNumber(t,e),column:1}),null;const d=this.indentationStack.length-u-1,p=null!==(o=null===(s=t.substring(0,e).match(/[\r\n]+$/))||void 0===s?void 0:s[0].length)&&void 0!==o?o:1;for(let n=0;n1;)e.push(this.createIndentationTokenInstance(this.dedentTokenType,t,"",t.length)),this.indentationStack.pop();return this.indentationStack=[0],e}},Q9=class extends t9{static{o(this,"IndentationAwareLexer")}constructor(t){if(super(t),!(t.parser.TokenBuilder instanceof Z9))throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder");this.indentationTokenBuilder=t.parser.TokenBuilder}tokenize(t,e=J8){const r=super.tokenize(t),n=r.report;"full"===(null==e?void 0:e.mode)&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:i,dedentTokenType:a}=this.indentationTokenBuilder,s=i.tokenTypeIdx,o=a.tokenTypeIdx,l=[],c=r.tokens.length-1;for(let t=0;t=0&&l.push(r.tokens[c]),r.tokens=l,r}},J9={};h(J9,{AstUtils:()=>fQ,BiMap:()=>x8,Cancellation:()=>G7,ContextCache:()=>C8,CstUtils:()=>BX,DONE_RESULT:()=>KX,Deferred:()=>J7,Disposable:()=>H8,DisposableCache:()=>_8,DocumentCache:()=>S8,EMPTY_STREAM:()=>XX,ErrorWithLocation:()=>TK,GrammarUtils:()=>kK,MultiMap:()=>v8,OperationCancelled:()=>V7,Reduction:()=>QX,RegExpUtils:()=>NQ,SimpleCache:()=>E8,StreamImpl:()=>YX,TreeStreamImpl:()=>eK,URI:()=>c8,UriUtils:()=>s8,WorkspaceCache:()=>A8,assertUnreachable:()=>_K,delayNextTick:()=>q7,interruptAndCheck:()=>K7,isOperationCancelled:()=>X7,loadGrammarFromJson:()=>att,setInterruptionPeriod:()=>H7,startCancelableOperation:()=>Y7,stream:()=>ZX}),d(J9,Y8);var ttt=class{static{o(this,"EmptyFileSystemProvider")}readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},ett={fileSystemProvider:o((()=>new ttt),"fileSystemProvider")},rtt={Grammar:o((()=>{}),"Grammar"),LanguageMetaData:o((()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})),"LanguageMetaData")},ntt={AstReflection:o((()=>new pQ),"AstReflection")};function itt(){const t=U9(z9(ett),ntt),e=U9(F9({shared:t}),rtt);return t.ServiceRegistry.register(e),e}function att(t){var e;const r=itt(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,c8.parse(`memory://${null!==(e=n.name)&&void 0!==e?e:"grammar"}.langium`)),n}o(itt,"createMinimalGrammarServices"),o(att,"loadGrammarFromJson"),d(PX,J9);var stt=Object.defineProperty,ott=o(((t,e)=>stt(t,"name",{value:e,configurable:!0})),"__name"),ltt="Statement",ctt="Architecture";function htt(t){return Ktt.isInstance(t,ctt)}o(htt,"isArchitecture"),ott(htt,"isArchitecture");var utt="Axis",dtt="Branch";function ptt(t){return Ktt.isInstance(t,dtt)}o(ptt,"isBranch"),ott(ptt,"isBranch");var gtt="Checkout",ftt="CherryPicking",mtt="Commit";function ytt(t){return Ktt.isInstance(t,mtt)}o(ytt,"isCommit"),ott(ytt,"isCommit");var vtt="Common";function xtt(t){return Ktt.isInstance(t,vtt)}o(xtt,"isCommon"),ott(xtt,"isCommon");var btt="Curve",wtt="Edge",ktt="Entry",Ttt="GitGraph";function _tt(t){return Ktt.isInstance(t,Ttt)}o(_tt,"isGitGraph"),ott(_tt,"isGitGraph");var Ett="Group",Ctt="Info";function Stt(t){return Ktt.isInstance(t,Ctt)}o(Stt,"isInfo"),ott(Stt,"isInfo");var Att="Junction",Ltt="Merge";function Ntt(t){return Ktt.isInstance(t,Ltt)}o(Ntt,"isMerge"),ott(Ntt,"isMerge");var Itt="Option",Rtt="Packet";function Mtt(t){return Ktt.isInstance(t,Rtt)}o(Mtt,"isPacket"),ott(Mtt,"isPacket");var Dtt="PacketBlock";function Ott(t){return Ktt.isInstance(t,Dtt)}o(Ott,"isPacketBlock"),ott(Ott,"isPacketBlock");var Ptt="Pie";function Btt(t){return Ktt.isInstance(t,Ptt)}o(Btt,"isPie"),ott(Btt,"isPie");var $tt="PieSection";function Ftt(t){return Ktt.isInstance(t,$tt)}o(Ftt,"isPieSection"),ott(Ftt,"isPieSection");var ztt,Utt,Gtt,qtt,jtt,Wtt,Ytt="Radar",Htt="Service",Vtt="Direction",Xtt=class extends GX{static{o(this,"MermaidAstReflection")}static{ott(this,"MermaidAstReflection")}getAllTypes(){return[ctt,utt,dtt,gtt,ftt,mtt,vtt,btt,Vtt,wtt,ktt,Ttt,Ett,Ctt,Att,Ltt,Itt,Rtt,Dtt,Ptt,$tt,Ytt,Htt,ltt]}computeIsSubtype(t,e){switch(t){case dtt:case gtt:case ftt:case mtt:case Ltt:return this.isSubtype(ltt,e);case Vtt:return this.isSubtype(Ttt,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;if("Entry:axis"===e)return utt;throw new Error(`${e} is not a valid reference id.`)}getTypeMetaData(t){switch(t){case ctt:return{name:ctt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case utt:return{name:utt,properties:[{name:"label"},{name:"name"}]};case dtt:return{name:dtt,properties:[{name:"name"},{name:"order"}]};case gtt:return{name:gtt,properties:[{name:"branch"}]};case ftt:return{name:ftt,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case mtt:return{name:mtt,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case vtt:return{name:vtt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case btt:return{name:btt,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case wtt:return{name:wtt,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case ktt:return{name:ktt,properties:[{name:"axis"},{name:"value"}]};case Ttt:return{name:Ttt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case Ett:return{name:Ett,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Ctt:return{name:Ctt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case Att:return{name:Att,properties:[{name:"id"},{name:"in"}]};case Ltt:return{name:Ltt,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case Itt:return{name:Itt,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case Rtt:return{name:Rtt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case Dtt:return{name:Dtt,properties:[{name:"end"},{name:"label"},{name:"start"}]};case Ptt:return{name:Ptt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case $tt:return{name:$tt,properties:[{name:"label"},{name:"value"}]};case Ytt:return{name:Ytt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case Htt:return{name:Htt,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case Vtt:return{name:Vtt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:t,properties:[]}}}},Ktt=new Xtt,Ztt=ott((()=>ztt??(ztt=att('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"InfoGrammar"),Qtt=ott((()=>Utt??(Utt=att('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PacketGrammar"),Jtt=ott((()=>Gtt??(Gtt=att('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PieGrammar"),tet=ott((()=>qtt??(qtt=att('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"ArchitectureGrammar"),eet=ott((()=>jtt??(jtt=att('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"GitGraphGrammar"),ret=ott((()=>Wtt??(Wtt=att('{"$type":"Grammar","isDeclared":true,"name":"Radar","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"RadarGrammar"),net={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iet={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},aet={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},set={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},oet={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cet={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},het={AstReflection:ott((()=>new Xtt),"AstReflection")},uet={Grammar:ott((()=>Ztt()),"Grammar"),LanguageMetaData:ott((()=>net),"LanguageMetaData"),parser:{}},det={Grammar:ott((()=>Qtt()),"Grammar"),LanguageMetaData:ott((()=>iet),"LanguageMetaData"),parser:{}},pet={Grammar:ott((()=>Jtt()),"Grammar"),LanguageMetaData:ott((()=>aet),"LanguageMetaData"),parser:{}},get={Grammar:ott((()=>tet()),"Grammar"),LanguageMetaData:ott((()=>set),"LanguageMetaData"),parser:{}},fet={Grammar:ott((()=>eet()),"Grammar"),LanguageMetaData:ott((()=>oet),"LanguageMetaData"),parser:{}},met={Grammar:ott((()=>ret()),"Grammar"),LanguageMetaData:ott((()=>cet),"LanguageMetaData"),parser:{}},yet={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},vet=class extends U7{static{o(this,"AbstractMermaidValueConverter")}static{ott(this,"AbstractMermaidValueConverter")}runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return void 0===n&&(n=this.runCustomConverter(t,e,r)),void 0===n?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){const n=yet[t.name];if(void 0===n)return;const i=n.exec(e);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},xet=class extends vet{static{o(this,"CommonValueConverter")}static{ott(this,"CommonValueConverter")}runCustomConverter(t,e,r){}},bet=class extends z7{static{o(this,"AbstractMermaidTokenBuilder")}static{ott(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){const n=super.buildKeywordTokens(t,e,r);return n.forEach((t=>{this.keywords.has(t.name)&&void 0!==t.PATTERN&&(t.PATTERN=new RegExp(t.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))})),n}};(class extends bet{static{o(this,"CommonTokenBuilder")}static{ott(this,"CommonTokenBuilder")}});var wet={},ket={info:ott((async()=>{const{createInfoServices:t}=await Promise.resolve().then((function(){return NRt})),e=t().Info.parser.LangiumParser;wet.info=e}),"info"),packet:ott((async()=>{const{createPacketServices:t}=await Promise.resolve().then((function(){return IRt})),e=t().Packet.parser.LangiumParser;wet.packet=e}),"packet"),pie:ott((async()=>{const{createPieServices:t}=await Promise.resolve().then((function(){return RRt})),e=t().Pie.parser.LangiumParser;wet.pie=e}),"pie"),architecture:ott((async()=>{const{createArchitectureServices:t}=await Promise.resolve().then((function(){return MRt})),e=t().Architecture.parser.LangiumParser;wet.architecture=e}),"architecture"),gitGraph:ott((async()=>{const{createGitGraphServices:t}=await Promise.resolve().then((function(){return DRt})),e=t().GitGraph.parser.LangiumParser;wet.gitGraph=e}),"gitGraph"),radar:ott((async()=>{const{createRadarServices:t}=await Promise.resolve().then((function(){return ORt})),e=t().Radar.parser.LangiumParser;wet.radar=e}),"radar")};async function Tet(t,e){const r=ket[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);wet[t]||await r();const n=wet[t].parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new _et(n);return n.value}o(Tet,"parse"),ott(Tet,"parse");var _et=class extends Error{static{o(this,"MermaidParseError")}constructor(t){super(`Parsing failed: ${t.lexerErrors.map((t=>t.message)).join("\n")} ${t.parserErrors.map((t=>t.message)).join("\n")}`),this.result=t}static{ott(this,"MermaidParseError")}},Eet=class extends bet{static{o(this,"PieTokenBuilder")}static{ott(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Cet=class extends vet{static{o(this,"PieValueConverter")}static{ott(this,"PieValueConverter")}runCustomConverter(t,e,r){if("PIE_SECTION_LABEL"===t.name)return e.replace(/"/g,"").trim()}},Aet={parser:{TokenBuilder:ott((()=>new Eet),"TokenBuilder"),ValueConverter:ott((()=>new Cet),"ValueConverter")}};function Let(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),pet,Aet);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}o(Let,"createPieServices"),ott(Let,"createPieServices");var Net=class extends bet{static{o(this,"ArchitectureTokenBuilder")}static{ott(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Iet=class extends vet{static{o(this,"ArchitectureValueConverter")}static{ott(this,"ArchitectureValueConverter")}runCustomConverter(t,e,r){return"ARCH_ICON"===t.name?e.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===t.name?e.replace(/["()]/g,""):"ARCH_TITLE"===t.name?e.replace(/[[\]]/g,"").trim():void 0}},Ret={parser:{TokenBuilder:ott((()=>new Net),"TokenBuilder"),ValueConverter:ott((()=>new Iet),"ValueConverter")}};function Met(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),get,Ret);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}o(Met,"createArchitectureServices"),ott(Met,"createArchitectureServices");var Det=class extends bet{static{o(this,"GitGraphTokenBuilder")}static{ott(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Oet={parser:{TokenBuilder:ott((()=>new Det),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Pet(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),fet,Oet);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}o(Pet,"createGitGraphServices"),ott(Pet,"createGitGraphServices");var Bet=class extends bet{static{o(this,"RadarTokenBuilder")}static{ott(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},$et={parser:{TokenBuilder:ott((()=>new Bet),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Fet(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),met,$et);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}o(Fet,"createRadarServices"),ott(Fet,"createRadarServices");var zet=class extends bet{static{o(this,"InfoTokenBuilder")}static{ott(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Uet={parser:{TokenBuilder:ott((()=>new zet),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Get(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),uet,Uet);return e.ServiceRegistry.register(r),{shared:e,Info:r}}o(Get,"createInfoServices"),ott(Get,"createInfoServices");var qet=class extends bet{static{o(this,"PacketTokenBuilder")}static{ott(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},jet={parser:{TokenBuilder:ott((()=>new qet),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Wet(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),det,jet);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}o(Wet,"createPacketServices"),ott(Wet,"createPacketServices");var Yet={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Het=Lt.gitGraph,Vet=o((()=>Ok({...Het,...Gt().gitGraph})),"getConfig"),Xet=new NX((()=>{const t=Vet(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}}));function Ket(){return wk({length:7})}function Zet(t,e){const r=Object.create(null);return t.reduce(((t,n)=>{const i=e(n);return r[i]||(r[i]=!0,t.push(n)),t}),[])}o(Ket,"getID"),o(Zet,"uniqBy");var Qet=o((function(t){Xet.records.direction=t}),"setDirection"),Jet=o((function(t){y.debug("options str",t),t=t?.trim(),t=t||"{}";try{Xet.records.options=JSON.parse(t)}catch(t){y.error("error while parsing gitGraph options",t.message)}}),"setOptions"),trt=o((function(){return Xet.records.options}),"getOptions"),ert=o((function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;y.info("commit",e,r,n,i),y.debug("Entering commit:",e,r,n,i);const a=Vet();r=Lr.sanitizeText(r,a),e=Lr.sanitizeText(e,a),i=i?.map((t=>Lr.sanitizeText(t,a)));const s={id:r||Xet.records.seq+"-"+Ket(),message:e,seq:Xet.records.seq++,type:n??Yet.NORMAL,tags:i??[],parents:null==Xet.records.head?[]:[Xet.records.head.id],branch:Xet.records.currBranch};Xet.records.head=s,y.info("main branch",a.mainBranchName),Xet.records.commits.set(s.id,s),Xet.records.branches.set(Xet.records.currBranch,s.id),y.debug("in pushCommit "+s.id)}),"commit"),rrt=o((function(t){let e=t.name;const r=t.order;if(e=Lr.sanitizeText(e,Vet()),Xet.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Xet.records.branches.set(e,null!=Xet.records.head?Xet.records.head.id:null),Xet.records.branchConfig.set(e,{name:e,order:r}),art(e),y.debug("in createBranch")}),"branch"),nrt=o((t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Vet();e=Lr.sanitizeText(e,a),r&&(r=Lr.sanitizeText(r,a));const s=Xet.records.branches.get(Xet.records.currBranch),o=Xet.records.branches.get(e),l=s?Xet.records.commits.get(s):void 0,c=o?Xet.records.commits.get(o):void 0;if(l&&c&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Xet.records.currBranch===e){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(void 0===l||!l){const t=new Error(`Incorrect usage of "merge". Current branch (${Xet.records.currBranch})has no commits`);throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},t}if(!Xet.records.branches.has(e)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},t}if(void 0===c||!c){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},t}if(l===c){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(r&&Xet.records.commits.has(r)){const t=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom Id");throw t.hash={text:`merge ${e} ${r} ${n} ${i?.join(" ")}`,token:`merge ${e} ${r} ${n} ${i?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i?.join(" ")}`]},t}const h=o||"",u={id:r||`${Xet.records.seq}-${Ket()}`,message:`merged branch ${e} into ${Xet.records.currBranch}`,seq:Xet.records.seq++,parents:null==Xet.records.head?[]:[Xet.records.head.id,h],branch:Xet.records.currBranch,type:Yet.MERGE,customType:n,customId:!!r,tags:i??[]};Xet.records.head=u,Xet.records.commits.set(u.id,u),Xet.records.branches.set(Xet.records.currBranch,u.id),y.debug(Xet.records.branches),y.debug("in mergeBranch")}),"merge"),irt=o((function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;y.debug("Entering cherryPick:",e,r,n);const a=Vet();if(e=Lr.sanitizeText(e,a),r=Lr.sanitizeText(r,a),n=n?.map((t=>Lr.sanitizeText(t,a))),i=Lr.sanitizeText(i,a),!e||!Xet.records.commits.has(e)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const s=Xet.records.commits.get(e);if(void 0===s||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&(!Array.isArray(s.parents)||!s.parents.includes(i))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const o=s.branch;if(s.type===Yet.MERGE&&!i){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!r||!Xet.records.commits.has(r)){if(o===Xet.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const t=Xet.records.branches.get(Xet.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Xet.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const a=Xet.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Xet.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const l={id:Xet.records.seq+"-"+Ket(),message:`cherry-picked ${s?.message} into ${Xet.records.currBranch}`,seq:Xet.records.seq++,parents:null==Xet.records.head?[]:[Xet.records.head.id,s.id],branch:Xet.records.currBranch,type:Yet.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Yet.MERGE?`|parent:${i}`:""}`]};Xet.records.head=l,Xet.records.commits.set(l.id,l),Xet.records.branches.set(Xet.records.currBranch,l.id),y.debug(Xet.records.branches),y.debug("in cherryPick")}}),"cherryPick"),art=o((function(t){if(t=Lr.sanitizeText(t,Vet()),!Xet.records.branches.has(t)){const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}{Xet.records.currBranch=t;const e=Xet.records.branches.get(Xet.records.currBranch);Xet.records.head=void 0!==e&&e?Xet.records.commits.get(e)??null:null}}),"checkout");function srt(t,e,r){const n=t.indexOf(e);-1===n?t.push(r):t.splice(n,1,r)}function ort(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let r="";t.forEach((function(t){r+=t===e?"\t*":"\t|"}));const n=[r,e.id,e.seq];for(const t in Xet.records.branches)Xet.records.branches.get(t)===e.id&&n.push(t);if(y.debug(n.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){const r=Xet.records.commits.get(e.parents[0]);srt(t,e,r),e.parents[1]&&t.push(Xet.records.commits.get(e.parents[1]))}else{if(0==e.parents.length)return;if(e.parents[0]){const r=Xet.records.commits.get(e.parents[0]);srt(t,e,r)}}ort(t=Zet(t,(t=>t.id)))}o(srt,"upsert"),o(ort,"prettyPrintCommitHistory");var lrt=o((function(){y.debug(Xet.records.commits);ort([prt()[0]])}),"prettyPrint"),crt=o((function(){Xet.reset(),qr()}),"clear"),hrt=o((function(){const t=[...Xet.records.branchConfig.values()].map(((t,e)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${e}`)})).sort(((t,e)=>(t.order??0)-(e.order??0))).map((({name:t})=>({name:t})));return t}),"getBranchesAsObjArray"),urt=o((function(){return Xet.records.branches}),"getBranches"),drt=o((function(){return Xet.records.commits}),"getCommits"),prt=o((function(){const t=[...Xet.records.commits.values()];return t.forEach((function(t){y.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t}),"getCommitsArray"),grt={commitType:Yet,getConfig:Vet,setDirection:Qet,setOptions:Jet,getOptions:trt,commit:ert,branch:rrt,merge:nrt,cherryPick:irt,checkout:art,prettyPrint:lrt,clear:crt,getBranchesAsObjArray:hrt,getBranches:urt,getCommits:drt,getCommitsArray:prt,getCurrentBranch:o((function(){return Xet.records.currBranch}),"getCurrentBranch"),getDirection:o((function(){return Xet.records.direction}),"getDirection"),getHead:o((function(){return Xet.records.head}),"getHead"),setAccTitle:jr,getAccTitle:Wr,getAccDescription:Hr,setAccDescription:Yr,setDiagramTitle:Vr,getDiagramTitle:Xr},frt=o(((t,e)=>{IX(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)mrt(r,e)}),"populate"),mrt=o(((t,e)=>{const r={Commit:o((t=>e.commit(yrt(t))),"Commit"),Branch:o((t=>e.branch(vrt(t))),"Branch"),Merge:o((t=>e.merge(xrt(t))),"Merge"),Checkout:o((t=>e.checkout(brt(t))),"Checkout"),CherryPicking:o((t=>e.cherryPick(wrt(t))),"CherryPicking")}[t.$type];r?r(t):y.error(`Unknown statement type: ${t.$type}`)}),"parseStatement"),yrt=o((t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?Yet[t.type]:Yet.NORMAL,tags:t.tags??void 0})),"parseCommit"),vrt=o((t=>({name:t.name,order:t.order??0})),"parseBranch"),xrt=o((t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?Yet[t.type]:void 0,tags:t.tags??void 0})),"parseMerge"),brt=o((t=>t.branch),"parseCheckout"),wrt=o((t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent})),"parseCherryPicking"),krt={parse:o((async t=>{const e=await Tet("gitGraph",t);y.debug(e),frt(e,grt)}),"parse")},Trt=Qr()?.gitGraph,_rt=10,Ert=40,Crt=new Map,Srt=new Map,Art=new Map,Lrt=[],Nrt=0,Irt="LR",Rrt=o((()=>{Crt.clear(),Srt.clear(),Art.clear(),Nrt=0,Lrt=[],Irt="LR"}),"clear"),Mrt=o((t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|/gi):t).forEach((t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)})),e}),"drawText"),Drt=o((t=>{let e,r,n;return"BT"===Irt?(r=o(((t,e)=>t<=e),"comparisonFunc"),n=1/0):(r=o(((t,e)=>t>=e),"comparisonFunc"),n=0),t.forEach((t=>{const i="TB"===Irt||"BT"==Irt?Srt.get(t)?.y:Srt.get(t)?.x;void 0!==i&&r(i,n)&&(e=t,n=i)})),e}),"findClosestParent"),Ort=o((t=>{let e="",r=1/0;return t.forEach((t=>{const n=Srt.get(t).y;n<=r&&(e=t,r=n)})),e||void 0}),"findClosestParentBT"),Prt=o(((t,e,r)=>{let n=r,i=r;const a=[];t.forEach((t=>{const r=e.get(t);if(!r)throw new Error(`Commit not found for key ${t}`);r.parents.length?(n=$rt(r),i=Math.max(n,i)):a.push(r),Frt(r,n)})),n=i,a.forEach((t=>{zrt(t,n,r)})),t.forEach((t=>{const r=e.get(t);if(r?.parents.length){const t=Ort(r.parents);n=Srt.get(t).y-Ert,n<=i&&(i=n);const e=Crt.get(r.branch).pos,a=n-_rt;Srt.set(r.id,{x:e,y:a})}}))}),"setParallelBTPos"),Brt=o((t=>{const e=Drt(t.parents.filter((t=>null!==t)));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=Srt.get(e)?.y;if(void 0===r)throw new Error(`Closest parent position not found for commit ${t.id}`);return r}),"findClosestParentPos"),$rt=o((t=>Brt(t)+Ert),"calculateCommitPosition"),Frt=o(((t,e)=>{const r=Crt.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+_rt;return Srt.set(t.id,{x:n,y:i}),{x:n,y:i}}),"setCommitPosition"),zrt=o(((t,e,r)=>{const n=Crt.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Srt.set(t.id,{x:a,y:i})}),"setRootPosition"),Urt=o(((t,e,r,n,i,a)=>{if(a===Yet.HIGHLIGHT)t.append("rect").attr("x",r.x-10).attr("y",r.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%8} ${n}-outer`),t.append("rect").attr("x",r.x-6).attr("y",r.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%8} ${n}-inner`);else if(a===Yet.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`);else{const s=t.append("circle");if(s.attr("cx",r.x),s.attr("cy",r.y),s.attr("r",e.type===Yet.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%8}`),a===Yet.MERGE){const a=t.append("circle");a.attr("cx",r.x),a.attr("cy",r.y),a.attr("r",6),a.attr("class",`commit ${n} ${e.id} commit${i%8}`)}if(a===Yet.REVERSE){t.append("path").attr("d",`M ${r.x-5},${r.y-5}L${r.x+5},${r.y+5}M${r.x-5},${r.y+5}L${r.x+5},${r.y-5}`).attr("class",`commit ${n} ${e.id} commit${i%8}`)}}}),"drawCommitBullet"),Grt=o(((t,e,r,n)=>{if(e.type!==Yet.CHERRY_PICK&&(e.customId&&e.type===Yet.MERGE||e.type!==Yet.MERGE)&&Trt?.showCommitLabel){const i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),o=s.node()?.getBBox();if(o&&(a.attr("x",r.posWithOffset-o.width/2-2).attr("y",r.y+13.5).attr("width",o.width+4).attr("height",o.height+4),"TB"===Irt||"BT"===Irt?(a.attr("x",r.x-(o.width+16+5)).attr("y",r.y-12),s.attr("x",r.x-(o.width+16)).attr("y",r.y+o.height-12)):s.attr("x",r.posWithOffset-o.width/2),Trt.rotateCommitLabel))if("TB"===Irt||"BT"===Irt)s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),a.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const t=-7.5-(o.width+10)/25*9.5,e=10+o.width/25*8.5;i.attr("transform","translate("+t+", "+e+") rotate(-45, "+n+", "+r.y+")")}}}),"drawCommitLabel"),qrt=o(((t,e,r,n)=>{if(e.tags.length>0){let i=0,a=0,s=0;const o=[];for(const n of e.tags.reverse()){const e=t.insert("polygon"),l=t.append("circle"),c=t.append("text").attr("y",r.y-16-i).attr("class","tag-label").text(n),h=c.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),s=Math.max(s,h.height),c.attr("x",r.posWithOffset-h.width/2),o.push({tag:c,hole:l,rect:e,yOffset:i}),i+=20}for(const{tag:t,hole:e,rect:i,yOffset:l}of o){const o=s/2,c=r.y-19.2-l;if(i.attr("class","tag-label-bkg").attr("points",`\n ${n-a/2-2},${c+2} \n ${n-a/2-2},${c-2}\n ${r.posWithOffset-a/2-4},${c-o-2}\n ${r.posWithOffset+a/2+4},${c-o-2}\n ${r.posWithOffset+a/2+4},${c+o+2}\n ${r.posWithOffset-a/2-4},${c+o+2}`),e.attr("cy",c).attr("cx",n-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Irt||"BT"===Irt){const s=n+l;i.attr("class","tag-label-bkg").attr("points",`\n ${r.x},${s+2}\n ${r.x},${s-2}\n ${r.x+_rt},${s-o-2}\n ${r.x+_rt+a+4},${s-o-2}\n ${r.x+_rt+a+4},${s+o+2}\n ${r.x+_rt},${s+o+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),e.attr("cx",r.x+2).attr("cy",s).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),t.attr("x",r.x+5).attr("y",s+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}}),"drawCommitTags"),jrt=o((t=>{switch(t.customType??t.type){case Yet.NORMAL:return"commit-normal";case Yet.REVERSE:return"commit-reverse";case Yet.HIGHLIGHT:return"commit-highlight";case Yet.MERGE:return"commit-merge";case Yet.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}}),"getCommitClassType"),Wrt=o(((t,e,r,n)=>{const i={x:0,y:0};if(!(t.parents.length>0)){if("TB"===e)return 30;if("BT"===e){return(n.get(t.id)??i).y-Ert}return 0}{const r=Drt(t.parents);if(r){const a=n.get(r)??i;if("TB"===e)return a.y+Ert;if("BT"===e){return(n.get(t.id)??i).y-Ert}return a.x+Ert}}return 0}),"calculatePosition"),Yrt=o(((t,e,r)=>{const n="BT"===Irt&&r?e:e+_rt,i="TB"===Irt||"BT"===Irt?n:Crt.get(t.branch)?.pos,a="TB"===Irt||"BT"===Irt?Crt.get(t.branch)?.pos:n;if(void 0===a||void 0===i)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:i,posWithOffset:n}}),"getCommitPosition"),Hrt=o(((t,e,r)=>{if(!Trt)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels");let a="TB"===Irt||"BT"===Irt?30:0;const s=[...e.keys()],l=Trt?.parallelCommits??!1,c=o(((t,r)=>{const n=e.get(t)?.seq,i=e.get(r)?.seq;return void 0!==n&&void 0!==i?n-i:0}),"sortKeys");let h=s.sort(c);"BT"===Irt&&(l&&Prt(h,e,a),h=h.reverse()),h.forEach((t=>{const s=e.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);l&&(a=Wrt(s,Irt,a,Srt));const o=Yrt(s,a,l);if(r){const t=jrt(s),e=s.customType??s.type,r=Crt.get(s.branch)?.index??0;Urt(n,s,o,t,r,e),Grt(i,s,o,a),qrt(i,s,o,a)}"TB"===Irt||"BT"===Irt?Srt.set(s.id,{x:o.x,y:o.posWithOffset}):Srt.set(s.id,{x:o.posWithOffset,y:o.y}),a="BT"===Irt&&l?a+Ert:a+Ert+_rt,a>Nrt&&(Nrt=a)}))}),"drawCommits"),Vrt=o(((t,e,r,n,i)=>{const a=("TB"===Irt||"BT"===Irt?r.xt.branch===a),"isOnBranchToGetCurve"),l=o((r=>r.seq>t.seq&&r.seql(t)&&s(t)))}),"shouldRerouteArrow"),Xrt=o(((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(Lrt.every((t=>Math.abs(t-n)>=10)))return Lrt.push(n),n;const i=Math.abs(t-e);return Xrt(t,e-i/5,r+1)}),"findLane"),Krt=o(((t,e,r,n)=>{const i=Srt.get(e.id),a=Srt.get(r.id);if(void 0===i||void 0===a)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const s=Vrt(e,r,i,a,n);let o,l="",c="",h=0,u=0,d=Crt.get(r.branch)?.index;if(r.type===Yet.MERGE&&e.id!==r.parents[0]&&(d=Crt.get(e.branch)?.index),s){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",h=10,u=10;const t=i.ya.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=r.type===Yet.MERGE&&e.id!==r.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${c} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+h} ${i.y} ${l} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x===a.x&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):"BT"===Irt?(i.xa.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=r.type===Yet.MERGE&&e.id!==r.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${l} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`),i.x===a.x&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.ya.y&&(o=r.type===Yet.MERGE&&e.id!==r.parents[0]?`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${c} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(void 0===o)throw new Error("Line definition not found");t.append("path").attr("d",o).attr("class","arrow arrow"+d%8)}),"drawArrow"),Zrt=o(((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach((t=>{const n=e.get(t);n.parents&&n.parents.length>0&&n.parents.forEach((t=>{Krt(r,e.get(t),n,e)}))}))}),"drawArrows"),Qrt=o(((t,e)=>{const r=t.append("g");e.forEach(((t,e)=>{const n=e%8,i=Crt.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const a=r.append("line");a.attr("x1",0),a.attr("y1",i),a.attr("x2",Nrt),a.attr("y2",i),a.attr("class","branch branch"+n),"TB"===Irt?(a.attr("y1",30),a.attr("x1",i),a.attr("y2",Nrt),a.attr("x2",i)):"BT"===Irt&&(a.attr("y1",Nrt),a.attr("x1",i),a.attr("y2",30),a.attr("x2",i)),Lrt.push(i);const s=t.name,o=Mrt(s),l=r.insert("rect"),c=r.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+n);c.node().appendChild(o);const h=o.getBBox();l.attr("class","branchLabelBkg label"+n).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===Trt?.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),c.attr("transform","translate("+(-h.width-14-(!0===Trt?.rotateCommitLabel?30:0))+", "+(i-h.height/2-1)+")"),"TB"===Irt?(l.attr("x",i-h.width/2-10).attr("y",0),c.attr("transform","translate("+(i-h.width/2-5)+", 0)")):"BT"===Irt?(l.attr("x",i-h.width/2-10).attr("y",Nrt),c.attr("transform","translate("+(i-h.width/2-5)+", "+Nrt+")")):l.attr("transform","translate(-19, "+(i-h.height/2)+")")}))}),"drawBranches"),Jrt=o((function(t,e,r,n,i){return Crt.set(t,{pos:e,index:r}),e+=50+(i?40:0)+("TB"===Irt||"BT"===Irt?n.width/2:0)}),"setBranchPosition"),tnt=o((function(t,e,r,n){if(Rrt(),y.debug("in gitgraph renderer",t+"\n","id:",e,r),!Trt)throw new Error("GitGraph config not found");const i=Trt.rotateCommitLabel??!1,a=n.db;Art=a.getCommits();const s=a.getBranchesAsObjArray();Irt=a.getDirection();const o=Ga(`[id="${e}"]`);let l=0;s.forEach(((t,e)=>{const r=Mrt(t.name),n=o.append("g"),a=n.insert("g").attr("class","branchLabel"),s=a.insert("g").attr("class","label branch-label");s.node()?.appendChild(r);const c=r.getBBox();l=Jrt(t.name,l,e,c,i),s.remove(),a.remove(),n.remove()})),Hrt(o,Art,!1),Trt.showBranches&&Qrt(o,s),Zrt(o,Art),Hrt(o,Art,!0),Pk.insertTitle(o,"gitTitleText",Trt.titleTopMargin??0,a.getDiagramTitle()),rn(void 0,o,Trt.diagramPadding,Trt.useMaxWidth)}),"draw"),ent={draw:tnt},rnt=o((t=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map((e=>`\n .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${e} { fill: ${t["git"+e]}; }\n .arrow${e} { stroke: ${t["git"+e]}; }\n `)).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles"),nnt={parser:krt,db:grt,renderer:ent,styles:rnt},int=Object.freeze({__proto__:null,diagram:nnt}),ant=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_isoWeek=n()}(t,(function(){var t="day";return function(e,r,n){var i=o((function(e){return e.add(4-e.isoWeekday(),t)}),"a"),a=r.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),t);var r,a,s,o=i(this),l=(r=this.isoWeekYear(),s=4-(a=(this.$u?n.utc:n)().year(r).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(s+=7),a.add(s,t));return o.diff(l,"week")+1},a.isoWeekday=function(t){return this.$utils().u(t)?this.day()||7:this.day(this.day()%7?t:t-7)};var s=a.startOf;a.startOf=function(t,e){var r=this.$utils(),n=!!r.u(e)||e;return"isoweek"===r.p(t)?n?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(t,e)}}}))}}),snt=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/customParseFormat.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_customParseFormat=n()}(t,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},l=o((function(t){return(t=+t)+(t>68?1900:2e3)}),"a"),c=o((function(t){return function(e){this[t]=+e}}),"f"),h=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),r=60*e[1]+(+e[2]||0);return 0===r?0:"+"===e[0]?-r:r}(t)}],u=o((function(t){var e=s[t];return e&&(e.indexOf?e:e.s.concat(e.f))}),"u"),d=o((function(t,e){var r,n=s.meridiem;if(n){for(var i=1;i<=24;i+=1)if(t.indexOf(n(i,0,e))>-1){r=i>12;break}}else r=t===(e?"pm":"PM");return r}),"d"),p={A:[a,function(t){this.afternoon=d(t,!1)}],a:[a,function(t){this.afternoon=d(t,!0)}],Q:[r,function(t){this.month=3*(t-1)+1}],S:[r,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[n,c("day")],Do:[a,function(t){var e=s.ordinal,r=t.match(/\d+/);if(this.day=r[0],e)for(var n=1;n<=31;n+=1)e(n).replace(/\[|\]/g,"")===t&&(this.day=n)}],w:[i,c("week")],ww:[n,c("week")],M:[i,c("month")],MM:[n,c("month")],MMM:[a,function(t){var e=u("months"),r=(u("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[a,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(t){this.year=l(t)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function g(r){var n,i;n=r,i=s&&s.formats;for(var a=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,r,n){var a=n&&n.toUpperCase();return r||i[n]||t[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,r){return e||r.slice(1)}))}))).match(e),o=a.length,l=0;l-1)return new Date(("X"===e?1e3:1)*t);var i=g(e)(t),a=i.year,s=i.month,o=i.day,l=i.hours,c=i.minutes,h=i.seconds,u=i.milliseconds,d=i.zone,p=i.week,f=new Date,m=o||(a||s?1:f.getDate()),y=a||f.getFullYear(),v=0;a&&!s||(v=s>0?s-1:f.getMonth());var x,b=l||0,w=c||0,k=h||0,T=u||0;return d?new Date(Date.UTC(y,v,m,b,w,k,T+60*d.offset*1e3)):r?new Date(Date.UTC(y,v,m,b,w,k,T)):(x=new Date(y,v,m,b,w,k,T),p&&(x=n(x).week(p).toDate()),x)}catch(t){return new Date("")}}(e,o,n,r),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&e!=this.format(o)&&(this.$d=new Date("")),s={}}else if(o instanceof Array)for(var d=o.length,p=1;p<=d;p+=1){a[1]=o[p-1];var f=r.apply(this,a);if(f.isValid()){this.$d=f.$d,this.$L=f.$L,this.init();break}p===d&&(this.$d=new Date(""))}else i.call(this,t)}}}))}}),ont=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_advancedFormat=n()}(t,(function(){return function(t,e){var r=e.prototype,n=r.format;r.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return n.bind(this)(t);var i=this.$utils(),a=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return r.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return r.ordinal(e.week(),"W");case"w":case"ww":return i.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return i.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return i.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}}));return n.bind(this)(a)}}}))}}),lnt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],l=[1,31],c=[1,32],h=[1,33],u=[1,34],d=[1,9],p=[1,10],g=[1,11],f=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],w=[1,20],k=[1,21],T=[1,22],_=[1,23],E=[1,25],C=[1,35],S={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:n.setWeekday("monday");break;case 9:n.setWeekday("tuesday");break;case 10:n.setWeekday("wednesday");break;case 11:n.setWeekday("thursday");break;case 12:n.setWeekday("friday");break;case 13:n.setWeekday("saturday");break;case 14:n.setWeekday("sunday");break;case 15:n.setWeekend("friday");break;case 16:n.setWeekend("saturday");break;case 17:n.setDateFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 18:n.enableInclusiveEndDates(),this.$=a[o].substr(18);break;case 19:n.TopAxis(),this.$=a[o].substr(8);break;case 20:n.setAxisFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 21:n.setTickInterval(a[o].substr(13)),this.$=a[o].substr(13);break;case 22:n.setExcludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 23:n.setIncludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 24:n.setTodayMarker(a[o].substr(12)),this.$=a[o].substr(12);break;case 27:n.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 28:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 29:case 30:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 31:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 33:n.addTask(a[o-1],a[o]),this.$="task";break;case 34:this.$=a[o-1],n.setClickEvent(a[o-1],a[o],null);break;case 35:this.$=a[o-2],n.setClickEvent(a[o-2],a[o-1],a[o]);break;case 36:this.$=a[o-2],n.setClickEvent(a[o-2],a[o-1],null),n.setLink(a[o-2],a[o]);break;case 37:this.$=a[o-3],n.setClickEvent(a[o-3],a[o-2],a[o-1]),n.setLink(a[o-3],a[o]);break;case 38:this.$=a[o-2],n.setClickEvent(a[o-2],a[o],null),n.setLink(a[o-2],a[o-1]);break;case 39:this.$=a[o-3],n.setClickEvent(a[o-3],a[o-1],a[o]),n.setLink(a[o-3],a[o-2]);break;case 40:this.$=a[o-1],n.setLink(a[o-1],a[o]);break;case 41:case 47:this.$=a[o-1]+" "+a[o];break;case 42:case 43:case 45:this.$=a[o-2]+" "+a[o-1]+" "+a[o];break;case 44:case 46:this.$=a[o-3]+" "+a[o-2]+" "+a[o-1]+" "+a[o]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:l,18:c,19:18,20:h,21:u,22:d,23:p,24:g,25:f,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:T,36:_,37:24,38:E,40:C},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:l,18:c,19:18,20:h,21:u,22:d,23:p,24:g,25:f,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:T,36:_,37:24,38:E,40:C},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},A=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 15:case 18:case 21:case 24:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:case 9:case 10:case 12:case 13:break;case 11:return 10;case 14:this.begin("href");break;case 16:return 43;case 17:this.begin("callbackname");break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 22:return 42;case 23:this.begin("click");break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}}),"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return t}();function L(){this.yy={}}return S.lexer=A,o(L,"Parser"),L.prototype=S,S.Parser=L,new L}();lnt.parser=lnt;var cnt=lnt,hnt=p(Wy(),1),unt=p(g(),1),dnt=p(ant(),1),pnt=p(snt(),1),gnt=p(ont(),1);unt.default.extend(dnt.default),unt.default.extend(pnt.default),unt.default.extend(gnt.default);var fnt,mnt,ynt={friday:5,saturday:6},vnt="",xnt="",bnt=void 0,wnt="",knt=[],Tnt=[],_nt=new Map,Ent=[],Cnt=[],Snt="",Ant="",Lnt=["active","done","crit","milestone"],Nnt=[],Int=!1,Rnt=!1,Mnt="sunday",Dnt="saturday",Ont=0,Pnt=o((function(){Ent=[],Cnt=[],Snt="",Nnt=[],git=0,fnt=void 0,mnt=void 0,vit=[],vnt="",xnt="",Ant="",bnt=void 0,wnt="",knt=[],Tnt=[],Int=!1,Rnt=!1,Ont=0,_nt=new Map,qr(),Mnt="sunday",Dnt="saturday"}),"clear"),Bnt=o((function(t){xnt=t}),"setAxisFormat"),$nt=o((function(){return xnt}),"getAxisFormat"),Fnt=o((function(t){bnt=t}),"setTickInterval"),znt=o((function(){return bnt}),"getTickInterval"),Unt=o((function(t){wnt=t}),"setTodayMarker"),Gnt=o((function(){return wnt}),"getTodayMarker"),qnt=o((function(t){vnt=t}),"setDateFormat"),jnt=o((function(){Int=!0}),"enableInclusiveEndDates"),Wnt=o((function(){return Int}),"endDatesAreInclusive"),Ynt=o((function(){Rnt=!0}),"enableTopAxis"),Hnt=o((function(){return Rnt}),"topAxisEnabled"),Vnt=o((function(t){Ant=t}),"setDisplayMode"),Xnt=o((function(){return Ant}),"getDisplayMode"),Knt=o((function(){return vnt}),"getDateFormat"),Znt=o((function(t){knt=t.toLowerCase().split(/[\s,]+/)}),"setIncludes"),Qnt=o((function(){return knt}),"getIncludes"),Jnt=o((function(t){Tnt=t.toLowerCase().split(/[\s,]+/)}),"setExcludes"),tit=o((function(){return Tnt}),"getExcludes"),eit=o((function(){return _nt}),"getLinks"),rit=o((function(t){Snt=t,Ent.push(t)}),"addSection"),nit=o((function(){return Ent}),"getSections"),iit=o((function(){let t=Tit();let e=0;for(;!t&&e<10;)t=Tit(),e++;return Cnt=vit}),"getTasks"),ait=o((function(t,e,r,n){return!n.includes(t.format(e.trim()))&&(!(!r.includes("weekends")||t.isoWeekday()!==ynt[Dnt]&&t.isoWeekday()!==ynt[Dnt]+1)||(!!r.includes(t.format("dddd").toLowerCase())||r.includes(t.format(e.trim()))))}),"isInvalidDate"),sit=o((function(t){Mnt=t}),"setWeekday"),oit=o((function(){return Mnt}),"getWeekday"),lit=o((function(t){Dnt=t}),"setWeekend"),cit=o((function(t,e,r,n){if(!r.length||t.manualEndTime)return;let i,a;i=t.startTime instanceof Date?(0,unt.default)(t.startTime):(0,unt.default)(t.startTime,e,!0),i=i.add(1,"d"),a=t.endTime instanceof Date?(0,unt.default)(t.endTime):(0,unt.default)(t.endTime,e,!0);const[s,o]=hit(i,a,e,r,n);t.endTime=s.toDate(),t.renderEndTime=o}),"checkTaskDates"),hit=o((function(t,e,r,n,i){let a=!1,s=null;for(;t<=e;)a||(s=e.toDate()),a=ait(t,r,n,i),a&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,s]}),"fixTaskDates"),uit=o((function(t,e,r){r=r.trim();const n=/^after\s+(?[\d\w- ]+)/.exec(r);if(null!==n){let t=null;for(const e of n.groups.ids.split(" ")){let r=wit(e);void 0!==r&&(!t||r.endTime>t.endTime)&&(t=r)}if(t)return t.endTime;const e=new Date;return e.setHours(0,0,0,0),e}let i=(0,unt.default)(r,e.trim(),!0);if(i.isValid())return i.toDate();{y.debug("Invalid date:"+r),y.debug("With date format:"+e.trim());const t=new Date(r);if(void 0===t||isNaN(t.getTime())||t.getFullYear()<-1e4||t.getFullYear()>1e4)throw new Error("Invalid date:"+r);return t}}),"getStartDate"),dit=o((function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==e?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]}),"parseDuration"),pit=o((function(t,e,r,n=!1){r=r.trim();const i=/^until\s+(?[\d\w- ]+)/.exec(r);if(null!==i){let t=null;for(const e of i.groups.ids.split(" ")){let r=wit(e);void 0!==r&&(!t||r.startTime{window.open(r,"_self")})),_nt.set(t,r))})),Eit(t,"clickable")}),"setLink"),Eit=o((function(t,e){t.split(",").forEach((function(t){let r=wit(t);void 0!==r&&r.classes.push(e)}))}),"setClass"),Cit=o((function(t,e,r){if("loose"!==Qr().securityLevel)return;if(void 0===e)return;let n=[];if("string"==typeof r){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{Pk.runFunc(e,...n)}))}),"setClickFun"),Sit=o((function(t,e){Nnt.push((function(){const r=document.querySelector(`[id="${t}"]`);null!==r&&r.addEventListener("click",(function(){e()}))}),(function(){const r=document.querySelector(`[id="${t}-text"]`);null!==r&&r.addEventListener("click",(function(){e()}))}))}),"pushFun"),Ait=o((function(t,e,r){t.split(",").forEach((function(t){Cit(t,e,r)})),Eit(t,"clickable")}),"setClickEvent"),Lit=o((function(t){Nnt.forEach((function(e){e(t)}))}),"bindFunctions"),Nit={getConfig:o((()=>Qr().gantt),"getConfig"),clear:Pnt,setDateFormat:qnt,getDateFormat:Knt,enableInclusiveEndDates:jnt,endDatesAreInclusive:Wnt,enableTopAxis:Ynt,topAxisEnabled:Hnt,setAxisFormat:Bnt,getAxisFormat:$nt,setTickInterval:Fnt,getTickInterval:znt,setTodayMarker:Unt,getTodayMarker:Gnt,setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,setDisplayMode:Vnt,getDisplayMode:Xnt,setAccDescription:Yr,getAccDescription:Hr,addSection:rit,getSections:nit,getTasks:iit,addTask:bit,findTaskById:wit,addTaskOrg:kit,setIncludes:Znt,getIncludes:Qnt,setExcludes:Jnt,getExcludes:tit,setClickEvent:Ait,setLink:_it,getLinks:eit,bindFunctions:Lit,parseDuration:dit,isInvalidDate:ait,setWeekday:sit,getWeekday:oit,setWeekend:lit};function Iit(t,e,r){let n=!0;for(;n;)n=!1,r.forEach((function(r){const i=new RegExp("^\\s*"+r+"\\s*$");t[0].match(i)&&(e[r]=!0,t.shift(1),n=!0)}))}o(Iit,"getTaskTags");var Rit,Mit=p(g(),1),Dit=o((function(){y.debug("Something is calling, setConf, remove the call")}),"setConf"),Oit={monday:Ml,tuesday:Dl,wednesday:Ol,thursday:Pl,friday:Bl,saturday:$l,sunday:Rl},Pit=o(((t,e)=>{let r=[...t].map((()=>-1/0)),n=[...t].sort(((t,e)=>t.startTime-e.startTime||t.order-e.order)),i=0;for(const t of n)for(let n=0;n=r[n]){r[n]=t.endTime,t.order=n+e,n>i&&(i=n);break}return i}),"getMaxIntersections"),Bit=o((function(t,e,r,n){const i=Qr().gantt,a=Qr().securityLevel;let s;"sandbox"===a&&(s=Ga("#i"+e));const l=Ga("sandbox"===a?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===a?s.nodes()[0].contentDocument:document,h=c.getElementById(e);void 0===(Rit=h.parentElement.offsetWidth)&&(Rit=1200),void 0!==i.useWidth&&(Rit=i.useWidth);const u=n.db.getTasks();let d=[];for(const t of u)d.push(t.type);d=E(d);const p={};let g=2*i.topPadding;if("compact"===n.db.getDisplayMode()||"compact"===i.displayMode){const t={};for(const e of u)void 0===t[e.section]?t[e.section]=[e]:t[e.section].push(e);let e=0;for(const r of Object.keys(t)){const n=Pit(t[r],e)+1;e+=n,g+=n*(i.barHeight+i.barGap),p[r]=n}}else{g+=u.length*(i.barHeight+i.barGap);for(const t of d)p[t]=u.filter((e=>e.type===t)).length}h.setAttribute("viewBox","0 0 "+Rit+" "+g);const f=l.select(`[id="${e}"]`),m=Ah().domain([hn(u,(function(t){return t.startTime})),cn(u,(function(t){return t.endTime}))]).rangeRound([0,Rit-i.leftPadding-i.rightPadding]);function v(t,e){const r=t.startTime,n=e.startTime;let i=0;return r>n?i=1:rt.order)))].map((e=>t.find((t=>t.order===e))));f.append("g").selectAll("rect").data(h).enter().append("rect").attr("x",0).attr("y",(function(t,e){return t.order*r+a-2})).attr("width",(function(){return c-i.rightPadding/2})).attr("height",r).attr("class",(function(t){for(const[e,r]of d.entries())if(t.type===r)return"section section"+e%i.numberSectionStyles;return"section section0"}));const u=f.append("g").selectAll("rect").data(t).enter(),p=n.db.getLinks();u.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?m(t.startTime)+s+.5*(m(t.endTime)-m(t.startTime))-.5*o:m(t.startTime)+s})).attr("y",(function(t,e){return t.order*r+a})).attr("width",(function(t){return t.milestone?o:m(t.renderEndTime||t.endTime)-m(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,e){return e=t.order,(m(t.startTime)+s+.5*(m(t.endTime)-m(t.startTime))).toString()+"px "+(e*r+a+.5*o).toString()+"px"})).attr("class",(function(t){let e="";t.classes.length>0&&(e=t.classes.join(" "));let r=0;for(const[e,n]of d.entries())t.type===n&&(r=e%i.numberSectionStyles);let n="";return t.active?t.crit?n+=" activeCrit":n=" active":t.done?n=t.crit?" doneCrit":" done":t.crit&&(n+=" crit"),0===n.length&&(n=" task"),t.milestone&&(n=" milestone "+n),n+=r,n+=" "+e,"task"+n})),u.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",i.fontSize).attr("x",(function(t){let e=m(t.startTime),r=m(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(m(t.endTime)-m(t.startTime))-.5*o),t.milestone&&(r=e+o);const n=this.getBBox().width;return n>r-e?r+n+1.5*i.leftPadding>c?e+s-5:r+s+5:(r-e)/2+e+s})).attr("y",(function(t,e){return t.order*r+i.barHeight/2+(i.fontSize/2-2)+a})).attr("text-height",o).attr("class",(function(t){const e=m(t.startTime);let r=m(t.endTime);t.milestone&&(r=e+o);const n=this.getBBox().width;let a="";t.classes.length>0&&(a=t.classes.join(" "));let s=0;for(const[e,r]of d.entries())t.type===r&&(s=e%i.numberSectionStyles);let l="";return t.active&&(l=t.crit?"activeCritText"+s:"activeText"+s),t.done?l=t.crit?l+" doneCritText"+s:l+" doneText"+s:t.crit&&(l=l+" critText"+s),t.milestone&&(l+=" milestoneText"),n>r-e?r+n+1.5*i.leftPadding>c?a+" taskTextOutsideLeft taskTextOutside"+s+" "+l:a+" taskTextOutsideRight taskTextOutside"+s+" "+l+" width-"+n:a+" taskText taskText"+s+" "+l+" width-"+n}));if("sandbox"===Qr().securityLevel){let t;t=Ga("#i"+e);const r=t.nodes()[0].contentDocument;u.filter((function(t){return p.has(t.id)})).each((function(t){var e=r.querySelector("#"+t.id),n=r.querySelector("#"+t.id+"-text");const i=e.parentNode;var a=r.createElement("a");a.setAttribute("xlink:href",p.get(t.id)),a.setAttribute("target","_top"),i.appendChild(a),a.appendChild(e),a.appendChild(n)}))}}function w(t,e,r,a,s,o,l,c){if(0===l.length&&0===c.length)return;let h,u;for(const{startTime:t,endTime:e}of o)(void 0===h||tu)&&(u=e);if(!h||!u)return;if((0,Mit.default)(u).diff((0,Mit.default)(h),"year")>5)return void y.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");const d=n.db.getDateFormat(),p=[];let g=null,v=(0,Mit.default)(h);for(;v.valueOf()<=u;)n.db.isInvalidDate(v,d,l,c)?g?g.end=v:g={start:v,end:v}:g&&(p.push(g),g=null),v=v.add(1,"d");f.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return m(t.start)+r})).attr("y",i.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return m(e)-m(t.start)})).attr("height",s-e-i.gridLineStartPadding).attr("transform-origin",(function(e,n){return(m(e.start)+r+.5*(m(e.end)-m(e.start))).toString()+"px "+(n*t+.5*s).toString()+"px"})).attr("class","exclude-range")}function k(t,e,r,a){let s=Un(m).tickSize(-a+e+i.gridLineStartPadding).tickFormat(ac(n.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(null!==o){const t=o[1],e=o[2],r=n.db.getWeekday()||i.weekday;switch(e){case"millisecond":s.ticks(fl.every(t));break;case"second":s.ticks(Tl.every(t));break;case"minute":s.ticks(_l.every(t));break;case"hour":s.ticks(Cl.every(t));break;case"day":s.ticks(Al.every(t));break;case"week":s.ticks(Oit[r].every(t));break;case"month":s.ticks(Hl.every(t))}}if(f.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(s).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let r=zn(m).tickSize(-a+e+i.gridLineStartPadding).tickFormat(ac(n.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(null!==o){const t=o[1],e=o[2],a=n.db.getWeekday()||i.weekday;switch(e){case"millisecond":r.ticks(fl.every(t));break;case"second":r.ticks(Tl.every(t));break;case"minute":r.ticks(_l.every(t));break;case"hour":r.ticks(Cl.every(t));break;case"day":r.ticks(Al.every(t));break;case"week":r.ticks(Oit[a].every(t));break;case"month":r.ticks(Hl.every(t))}}f.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(r).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function T(t,e){let r=0;const n=Object.keys(p).map((t=>[t,p[t]]));f.append("g").selectAll("text").data(n).enter().append((function(t){const e=t[0].split(Lr.lineBreakRegex),r=-(e.length-1)/2,n=c.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("dy",r+"em");for(const[t,r]of e.entries()){const e=c.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttribute("alignment-baseline","central"),e.setAttribute("x","10"),t>0&&e.setAttribute("dy","1em"),e.textContent=r,n.appendChild(e)}return n})).attr("x",10).attr("y",(function(i,a){if(!(a>0))return i[1]*t/2+e;for(let s=0;s`\n .mermaid-main-font {\n font-family: ${t.fontFamily};\n }\n\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n font-family: ${t.fontFamily};\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: ${t.fontFamily};\n }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n font-family: ${t.fontFamily};\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\n\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.titleColor||t.textColor};\n font-family: ${t.fontFamily};\n }\n`),"getStyles")},Fit=Object.freeze({__proto__:null,diagram:$it}),zit={parse:o((async t=>{const e=await Tet("info",t);y.debug(e)}),"parse")},Uit={version:t},Git={getVersion:o((()=>Uit.version),"getVersion")},qit=o(((t,e,r)=>{y.debug("rendering info diagram\n"+t);const n=ag(e);Rr(n,100,400,!0);n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)}),"draw"),jit={parser:zit,db:Git,renderer:{draw:qit}},Wit=Object.freeze({__proto__:null,diagram:jit}),Yit=Lt.pie,Hit={sections:new Map,showData:!1,config:Yit},Vit=Hit.sections,Xit=Hit.showData,Kit=structuredClone(Yit),Zit=o((()=>structuredClone(Kit)),"getConfig"),Qit=o((()=>{Vit=new Map,Xit=Hit.showData,qr()}),"clear"),Jit=o((({label:t,value:e})=>{Vit.has(t)||(Vit.set(t,e),y.debug(`added new section: ${t}, with value: ${e}`))}),"addSection"),tat={getConfig:Zit,clear:Qit,setDiagramTitle:Vr,getDiagramTitle:Xr,setAccTitle:jr,getAccTitle:Wr,setAccDescription:Yr,getAccDescription:Hr,addSection:Jit,getSections:o((()=>Vit),"getSections"),setShowData:o((t=>{Xit=t}),"setShowData"),getShowData:o((()=>Xit),"getShowData")},eat=o(((t,e)=>{IX(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)}),"populateDb"),rat={parse:o((async t=>{const e=await Tet("pie",t);y.debug(e),eat(e,tat)}),"parse")},nat=o((t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`),"getStyles"),iat=o((t=>{const e=[...t.entries()].map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value));return yu().value((t=>t.value))(e)}),"createPieArcs"),aat=o(((t,e,r,n)=>{y.debug("rendering pie chart\n"+t);const i=n.db,a=Qr(),s=Ok(i.getConfig(),a.pie),o=18,l=450,c=ag(e),h=c.append("g");h.attr("transform","translate(225,225)");const{themeVariables:u}=a;let[d]=Dk(u.pieOuterStrokeWidth);d??=2;const p=s.textPosition,g=Math.min(450,l)/2-40,f=lu().innerRadius(0).outerRadius(g),m=lu().innerRadius(g*p).outerRadius(g*p);h.append("circle").attr("cx",0).attr("cy",0).attr("r",g+d/2).attr("class","pieOuterCircle");const v=i.getSections(),x=iat(v),b=So([u.pie1,u.pie2,u.pie3,u.pie4,u.pie5,u.pie6,u.pie7,u.pie8,u.pie9,u.pie10,u.pie11,u.pie12]);h.selectAll("mySlices").data(x).enter().append("path").attr("d",f).attr("fill",(t=>b(t.data.label))).attr("class","pieCircle");let w=0;v.forEach((t=>{w+=t})),h.selectAll("mySlices").data(x).enter().append("text").text((t=>(t.data.value/w*100).toFixed(0)+"%")).attr("transform",(t=>"translate("+m.centroid(t)+")")).style("text-anchor","middle").attr("class","slice"),h.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const k=h.selectAll(".legend").data(b.domain()).enter().append("g").attr("class","legend").attr("transform",((t,e)=>"translate(216,"+(22*e-22*b.domain().length/2)+")"));k.append("rect").attr("width",o).attr("height",o).style("fill",b).style("stroke",b),k.data(x).append("text").attr("x",22).attr("y",14).text((t=>{const{label:e,value:r}=t.data;return i.getShowData()?`${e} [${r}]`:e}));const T=Math.max(...k.selectAll("text").nodes().map((t=>t?.getBoundingClientRect().width??0))),_=512+T;c.attr("viewBox",`0 0 ${_} 450`),Rr(c,l,_,s.useMaxWidth)}),"draw"),sat={parser:rat,db:tat,renderer:{draw:aat},styles:nat},oat=Object.freeze({__proto__:null,diagram:sat}),lat=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],h=[2,36],u=[1,37],d=[1,36],p=[1,38],g=[1,35],f=[1,43],m=[1,41],y=[1,14],v=[1,23],x=[1,18],b=[1,19],w=[1,20],k=[1,21],T=[1,22],_=[1,24],E=[1,25],C=[1,26],S=[1,27],A=[1,28],L=[1,29],N=[1,32],I=[1,33],R=[1,34],M=[1,39],D=[1,40],O=[1,42],P=[1,44],B=[1,62],$=[1,61],F=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],z=[1,65],U=[1,66],G=[1,67],q=[1,68],j=[1,69],W=[1,70],Y=[1,71],H=[1,72],V=[1,73],X=[1,74],K=[1,75],Z=[1,76],Q=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],tt=[1,91],et=[1,92],rt=[1,99],nt=[1,93],it=[1,96],at=[1,94],st=[1,95],ot=[1,97],lt=[1,98],ct=[1,102],ht=[10,55,56,57],ut=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],dt={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 23:case 68:this.$=a[o];break;case 24:case 69:this.$=a[o-1]+""+a[o];break;case 26:this.$=a[o-1]+a[o];break;case 27:this.$=[a[o].trim()];break;case 28:a[o-2].push(a[o].trim()),this.$=a[o-2];break;case 29:this.$=a[o-4],n.addClass(a[o-2],a[o]);break;case 37:this.$=[];break;case 42:this.$=a[o].trim(),n.setDiagramTitle(this.$);break;case 43:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 44:case 45:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 46:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 47:n.addPoint(a[o-3],"",a[o-1],a[o],[]);break;case 48:n.addPoint(a[o-4],a[o-3],a[o-1],a[o],[]);break;case 49:n.addPoint(a[o-4],"",a[o-2],a[o-1],a[o]);break;case 50:n.addPoint(a[o-5],a[o-4],a[o-2],a[o-1],a[o]);break;case 51:n.setXAxisLeftText(a[o-2]),n.setXAxisRightText(a[o]);break;case 52:a[o-1].text+=" ⟶ ",n.setXAxisLeftText(a[o-1]);break;case 53:n.setXAxisLeftText(a[o]);break;case 54:n.setYAxisBottomText(a[o-2]),n.setYAxisTopText(a[o]);break;case 55:a[o-1].text+=" ⟶ ",n.setYAxisBottomText(a[o-1]);break;case 56:n.setYAxisBottomText(a[o]);break;case 57:n.setQuadrant1Text(a[o]);break;case 58:n.setQuadrant2Text(a[o]);break;case 59:n.setQuadrant3Text(a[o]);break;case 60:n.setQuadrant4Text(a[o]);break;case 64:case 66:this.$={text:a[o],type:"text"};break;case 65:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 67:this.$={text:a[o],type:"markdown"}}}),"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(l,[2,61]),t(l,[2,62]),t(l,[2,63]),{1:[2,30]},{1:[2,31]},t(c,h,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:d,10:p,12:g,13:f,14:m,18:y,25:v,35:x,37:b,39:w,41:k,42:T,48:_,50:E,51:C,52:S,53:A,54:L,60:N,61:I,63:R,64:M,65:D,66:O,67:P}),t(s,[2,34]),{27:45,55:n,56:i,57:a},t(c,[2,37]),t(c,h,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:d,10:p,12:g,13:f,14:m,18:y,25:v,35:x,37:b,39:w,41:k,42:T,48:_,50:E,51:C,52:S,53:A,54:L,60:N,61:I,63:R,64:M,65:D,66:O,67:P}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(c,[2,45]),t(c,[2,46]),{18:[1,50]},{4:u,5:d,10:p,12:g,13:f,14:m,43:51,58:31,60:N,61:I,63:R,64:M,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:52,58:31,60:N,61:I,63:R,64:M,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:53,58:31,60:N,61:I,63:R,64:M,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:54,58:31,60:N,61:I,63:R,64:M,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:55,58:31,60:N,61:I,63:R,64:M,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:56,58:31,60:N,61:I,63:R,64:M,65:D,66:O,67:P},{4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,44:[1,57],47:[1,58],58:60,59:59,63:R,64:M,65:D,66:O,67:P},t(F,[2,64]),t(F,[2,66]),t(F,[2,67]),t(F,[2,70]),t(F,[2,71]),t(F,[2,72]),t(F,[2,73]),t(F,[2,74]),t(F,[2,75]),t(F,[2,76]),t(F,[2,77]),t(F,[2,78]),t(F,[2,79]),t(F,[2,80]),t(s,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:64,4:z,5:U,6:G,7:q,8:j,9:W,10:Y,11:H,12:V,13:X,14:K,15:Z,21:63},t(c,[2,53],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,49:[1,77],63:R,64:M,65:D,66:O,67:P}),t(c,[2,56],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,49:[1,78],63:R,64:M,65:D,66:O,67:P}),t(c,[2,57],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:R,64:M,65:D,66:O,67:P}),t(c,[2,58],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:R,64:M,65:D,66:O,67:P}),t(c,[2,59],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:R,64:M,65:D,66:O,67:P}),t(c,[2,60],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:R,64:M,65:D,66:O,67:P}),{45:[1,79]},{44:[1,80]},t(F,[2,65]),t(F,[2,81]),t(F,[2,82]),t(F,[2,83]),{3:82,4:z,5:U,6:G,7:q,8:j,9:W,10:Y,11:H,12:V,13:X,14:K,15:Z,18:[1,81]},t(Q,[2,23]),t(Q,[2,1]),t(Q,[2,2]),t(Q,[2,3]),t(Q,[2,4]),t(Q,[2,5]),t(Q,[2,6]),t(Q,[2,7]),t(Q,[2,8]),t(Q,[2,9]),t(Q,[2,10]),t(Q,[2,11]),t(Q,[2,12]),t(c,[2,52],{58:31,43:83,4:u,5:d,10:p,12:g,13:f,14:m,60:N,61:I,63:R,64:M,65:D,66:O,67:P}),t(c,[2,55],{58:31,43:84,4:u,5:d,10:p,12:g,13:f,14:m,60:N,61:I,63:R,64:M,65:D,66:O,67:P}),{46:[1,85]},{45:[1,86]},{4:J,5:tt,6:et,8:rt,11:nt,13:it,16:89,17:at,18:st,19:ot,20:lt,22:88,23:87},t(Q,[2,24]),t(c,[2,51],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:R,64:M,65:D,66:O,67:P}),t(c,[2,54],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:R,64:M,65:D,66:O,67:P}),t(c,[2,47],{22:88,16:89,23:100,4:J,5:tt,6:et,8:rt,11:nt,13:it,17:at,18:st,19:ot,20:lt}),{46:[1,101]},t(c,[2,29],{10:ct}),t(ht,[2,27],{16:103,4:J,5:tt,6:et,8:rt,11:nt,13:it,17:at,18:st,19:ot,20:lt}),t(ut,[2,25]),t(ut,[2,13]),t(ut,[2,14]),t(ut,[2,15]),t(ut,[2,16]),t(ut,[2,17]),t(ut,[2,18]),t(ut,[2,19]),t(ut,[2,20]),t(ut,[2,21]),t(ut,[2,22]),t(c,[2,49],{10:ct}),t(c,[2,48],{22:88,16:89,23:104,4:J,5:tt,6:et,8:rt,11:nt,13:it,17:at,18:st,19:ot,20:lt}),{4:J,5:tt,6:et,8:rt,11:nt,13:it,16:89,17:at,18:st,19:ot,20:lt,22:105},t(ut,[2,26]),t(c,[2,50],{10:ct}),t(ht,[2,28],{16:103,4:J,5:tt,6:et,8:rt,11:nt,13:it,17:at,18:st,19:ot,20:lt})],defaultActions:{8:[2,30],9:[2,31]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},pt=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:case 1:case 3:break;case 2:return 55;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 23:case 25:case 31:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 24:this.begin("string");break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return t}();function gt(){this.yy={}}return dt.lexer=pt,o(gt,"Parser"),gt.prototype=dt,dt.Parser=gt,new gt}();lat.parser=lat;var cat=lat,hat=bt(),uat=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{o(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:Lt.quadrantChart?.chartWidth||500,chartWidth:Lt.quadrantChart?.chartHeight||500,titlePadding:Lt.quadrantChart?.titlePadding||10,titleFontSize:Lt.quadrantChart?.titleFontSize||20,quadrantPadding:Lt.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:Lt.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:Lt.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:Lt.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:Lt.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:Lt.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:Lt.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:Lt.quadrantChart?.pointTextPadding||5,pointLabelFontSize:Lt.quadrantChart?.pointLabelFontSize||12,pointRadius:Lt.quadrantChart?.pointRadius||5,xAxisPosition:Lt.quadrantChart?.xAxisPosition||"top",yAxisPosition:Lt.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:Lt.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:Lt.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:hat.quadrant1Fill,quadrant2Fill:hat.quadrant2Fill,quadrant3Fill:hat.quadrant3Fill,quadrant4Fill:hat.quadrant4Fill,quadrant1TextFill:hat.quadrant1TextFill,quadrant2TextFill:hat.quadrant2TextFill,quadrant3TextFill:hat.quadrant3TextFill,quadrant4TextFill:hat.quadrant4TextFill,quadrantPointFill:hat.quadrantPointFill,quadrantPointTextFill:hat.quadrantPointTextFill,quadrantXAxisTextFill:hat.quadrantXAxisTextFill,quadrantYAxisTextFill:hat.quadrantYAxisTextFill,quadrantTitleFill:hat.quadrantTitleFill,quadrantInternalBorderStrokeFill:hat.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:hat.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,y.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,e){this.classes.set(t,e)}setConfig(t){y.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){y.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,e,r,n){const i=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,a={top:"top"===t&&e?i:0,bottom:"bottom"===t&&e?i:0},s=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,o={left:"left"===this.config.yAxisPosition&&r?s:0,right:"right"===this.config.yAxisPosition&&r?s:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:n?l:0},h=this.config.quadrantPadding+o.left,u=this.config.quadrantPadding+a.top+c.top,d=this.config.chartWidth-2*this.config.quadrantPadding-o.left-o.right,p=this.config.chartHeight-2*this.config.quadrantPadding-a.top-a.bottom-c.top;return{xAxisSpace:a,yAxisSpace:o,titleSpace:c,quadrantSpace:{quadrantLeft:h,quadrantTop:u,quadrantWidth:d,quadrantHalfWidth:d/2,quadrantHeight:p,quadrantHalfHeight:p/2}}}getAxisLabels(t,e,r,n){const{quadrantSpace:i,titleSpace:a}=n,{quadrantHalfHeight:s,quadrantHeight:o,quadrantLeft:l,quadrantHalfWidth:c,quadrantTop:h,quadrantWidth:u}=i,d=Boolean(this.data.xAxisRightText),p=Boolean(this.data.yAxisTopText),g=[];return this.data.xAxisLeftText&&e&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(d?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&e&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+c+(d?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&r&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+u+this.config.quadrantPadding,y:h+o-(p?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&r&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+u+this.config.quadrantPadding,y:h+s-(p?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(t){const{quadrantSpace:e}=t,{quadrantHalfHeight:r,quadrantLeft:n,quadrantHalfWidth:i,quadrantTop:a}=e,s=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n+i,y:a,width:i,height:r,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n,y:a,width:i,height:r,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n,y:a+r,width:i,height:r,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n+i,y:a+r,width:i,height:r,fill:this.themeConfig.quadrant4Fill}];for(const t of s)t.text.x=t.x+t.width/2,0===this.data.points.length?(t.text.y=t.y+t.height/2,t.text.horizontalPos="middle"):(t.text.y=t.y+this.config.quadrantTextTopPadding,t.text.horizontalPos="top");return s}getQuadrantPoints(t){const{quadrantSpace:e}=t,{quadrantHeight:r,quadrantLeft:n,quadrantTop:i,quadrantWidth:a}=e,s=ul().domain([0,1]).range([n,a+n]),o=ul().domain([0,1]).range([r+i,i]),l=this.data.points.map((t=>{const e=this.classes.get(t.className);e&&(t={...e,...t});return{x:s(t.x),y:o(t.y),fill:t.color??this.themeConfig.quadrantPointFill,radius:t.radius??this.config.pointRadius,text:{text:t.text,fill:this.themeConfig.quadrantPointTextFill,x:s(t.x),y:o(t.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:t.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:t.strokeWidth??"0px"}}));return l}getBorders(t){const e=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:r}=t,{quadrantHalfHeight:n,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:s,quadrantTop:o,quadrantWidth:l}=r;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-e,y1:o,x2:a+l+e,y2:o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+l,y1:o+e,x2:a+l,y2:o+i-e},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-e,y1:o+i,x2:a+l+e,y2:o+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:o+e,x2:a,y2:o+i-e},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+s,y1:o+e,x2:a+s,y2:o+i-e},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+e,y1:o+n,x2:a+l-e,y2:o+n}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),e=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),r=this.config.showTitle&&!!this.data.titleText,n=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(n,t,e,r);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(n,t,e,i),borderLines:this.getBorders(i),title:this.getTitle(r)}}},dat=class extends Error{static{o(this,"InvalidStyleError")}constructor(t,e,r){super(`value for ${t} ${e} is invalid, please use a valid ${r}`),this.name="InvalidStyleError"}};function pat(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function gat(t){return!/^\d+$/.test(t)}function fat(t){return!/^\d+px$/.test(t)}o(pat,"validateHexCode"),o(gat,"validateNumber"),o(fat,"validateSizeInPixels");var mat=Qr();function yat(t){return hr(t.trim(),mat)}o(yat,"textSanitizer");var vat=new uat;function xat(t){vat.setData({quadrant1Text:yat(t.text)})}function bat(t){vat.setData({quadrant2Text:yat(t.text)})}function wat(t){vat.setData({quadrant3Text:yat(t.text)})}function kat(t){vat.setData({quadrant4Text:yat(t.text)})}function Tat(t){vat.setData({xAxisLeftText:yat(t.text)})}function _at(t){vat.setData({xAxisRightText:yat(t.text)})}function Eat(t){vat.setData({yAxisTopText:yat(t.text)})}function Cat(t){vat.setData({yAxisBottomText:yat(t.text)})}function Sat(t){const e={};for(const r of t){const[t,n]=r.trim().split(/\s*:\s*/);if("radius"===t){if(gat(n))throw new dat(t,n,"number");e.radius=parseInt(n)}else if("color"===t){if(pat(n))throw new dat(t,n,"hex code");e.color=n}else if("stroke-color"===t){if(pat(n))throw new dat(t,n,"hex code");e.strokeColor=n}else{if("stroke-width"!==t)throw new Error(`style named ${t} is not supported.`);if(fat(n))throw new dat(t,n,"number of pixels (eg. 10px)");e.strokeWidth=n}}return e}function Aat(t,e,r,n,i){const a=Sat(i);vat.addPoints([{x:r,y:n,text:yat(t.text),className:e,...a}])}function Lat(t,e){vat.addClass(t,Sat(e))}function Nat(t){vat.setConfig({chartWidth:t})}function Iat(t){vat.setConfig({chartHeight:t})}function Rat(){const t=Qr(),{themeVariables:e,quadrantChart:r}=t;return r&&vat.setConfig(r),vat.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),vat.setData({titleText:Xr()}),vat.build()}o(xat,"setQuadrant1Text"),o(bat,"setQuadrant2Text"),o(wat,"setQuadrant3Text"),o(kat,"setQuadrant4Text"),o(Tat,"setXAxisLeftText"),o(_at,"setXAxisRightText"),o(Eat,"setYAxisTopText"),o(Cat,"setYAxisBottomText"),o(Sat,"parseStyles"),o(Aat,"addPoint"),o(Lat,"addClass"),o(Nat,"setWidth"),o(Iat,"setHeight"),o(Rat,"getQuadrantData");var Mat={setWidth:Nat,setHeight:Iat,setQuadrant1Text:xat,setQuadrant2Text:bat,setQuadrant3Text:wat,setQuadrant4Text:kat,setXAxisLeftText:Tat,setXAxisRightText:_at,setYAxisTopText:Eat,setYAxisBottomText:Cat,parseStyles:Sat,addPoint:Aat,addClass:Lat,getQuadrantData:Rat,clear:o((function(){vat.clear(),qr()}),"clear"),setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr},Dat=o(((t,e,r,n)=>{function i(t){return"top"===t?"hanging":"middle"}function a(t){return"left"===t?"start":"middle"}function s(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}o(i,"getDominantBaseLine"),o(a,"getTextAnchor"),o(s,"getTransformation");const l=Qr();y.debug("Rendering quadrant chart\n"+t);const c=l.securityLevel;let h;"sandbox"===c&&(h=Ga("#i"+e));const u=Ga("sandbox"===c?h.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),d=u.append("g").attr("class","main"),p=l.quadrantChart?.chartWidth??500,g=l.quadrantChart?.chartHeight??500;Rr(u,g,p,l.quadrantChart?.useMaxWidth??!0),u.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const f=n.db.getQuadrantData(),m=d.append("g").attr("class","quadrants"),v=d.append("g").attr("class","border"),x=d.append("g").attr("class","data-points"),b=d.append("g").attr("class","labels"),w=d.append("g").attr("class","title");f.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",f.title.fill).attr("font-size",f.title.fontSize).attr("dominant-baseline",i(f.title.horizontalPos)).attr("text-anchor",a(f.title.verticalPos)).attr("transform",s(f.title)).text(f.title.text),f.borderLines&&v.selectAll("line").data(f.borderLines).enter().append("line").attr("x1",(t=>t.x1)).attr("y1",(t=>t.y1)).attr("x2",(t=>t.x2)).attr("y2",(t=>t.y2)).style("stroke",(t=>t.strokeFill)).style("stroke-width",(t=>t.strokeWidth));const k=m.selectAll("g.quadrant").data(f.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)),k.append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>i(t.text.horizontalPos))).attr("text-anchor",(t=>a(t.text.verticalPos))).attr("transform",(t=>s(t.text))).text((t=>t.text.text));b.selectAll("g.label").data(f.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text((t=>t.text)).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>i(t.horizontalPos))).attr("text-anchor",(t=>a(t.verticalPos))).attr("transform",(t=>s(t)));const T=x.selectAll("g.data-point").data(f.points).enter().append("g").attr("class","data-point");T.append("circle").attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("r",(t=>t.radius)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeColor)).attr("stroke-width",(t=>t.strokeWidth)),T.append("text").attr("x",0).attr("y",0).text((t=>t.text.text)).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>i(t.text.horizontalPos))).attr("text-anchor",(t=>a(t.text.verticalPos))).attr("transform",(t=>s(t.text)))}),"draw"),Oat={parser:cat,db:Mat,renderer:{draw:Dat},styles:o((()=>""),"styles")},Pat=Object.freeze({__proto__:null,diagram:Oat}),Bat=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],l=[1,5,10,12,14,16,18,19,21,23,34,35,36],c=[1,25],h=[1,26],u=[1,28],d=[1,29],p=[1,30],g=[1,31],f=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[1,43],k=[1,42],T=[1,47],_=[1,50],E=[1,10,12,14,16,18,19,21,23,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],L={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 5:n.setOrientation(a[o]);break;case 9:n.setDiagramTitle(a[o].text.trim());break;case 12:n.setLineData({text:"",type:"text"},a[o]);break;case 13:n.setLineData(a[o-1],a[o]);break;case 14:n.setBarData({text:"",type:"text"},a[o]);break;case 15:n.setBarData(a[o-1],a[o]);break;case 16:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 17:case 18:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 19:case 27:this.$=a[o-1];break;case 20:this.$=[Number(a[o-2]),...a[o]];break;case 21:this.$=[Number(a[o])];break;case 22:n.setXAxisTitle(a[o]);break;case 23:n.setXAxisTitle(a[o-1]);break;case 24:n.setXAxisTitle({type:"text",text:""});break;case 25:n.setXAxisBand(a[o]);break;case 26:n.setXAxisRangeData(Number(a[o-2]),Number(a[o]));break;case 28:this.$=[a[o-2],...a[o]];break;case 29:this.$=[a[o]];break;case 30:n.setYAxisTitle(a[o]);break;case 31:n.setYAxisTitle(a[o-1]);break;case 32:n.setYAxisTitle({type:"text",text:""});break;case 33:n.setYAxisRangeData(Number(a[o-2]),Number(a[o]));break;case 37:case 38:this.$={text:a[o],type:"text"};break;case 39:this.$={text:a[o],type:"markdown"};break;case 40:this.$=a[o];break;case 41:this.$=a[o-1]+""+a[o]}}),"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(l,[2,34]),t(l,[2,35]),t(l,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(l,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:45,15:44,27:T,33:46,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:49,17:48,24:_,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:52,17:51,24:_,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(C,[2,37],{40:55,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b}),t(C,[2,38]),t(C,[2,39]),t(S,[2,40]),t(S,[2,42]),t(S,[2,43]),t(S,[2,44]),t(S,[2,45]),t(S,[2,46]),t(S,[2,47]),t(S,[2,48]),t(S,[2,49]),t(S,[2,50]),t(S,[2,51]),t(E,[2,10]),t(E,[2,22],{30:41,29:56,24:w,27:k}),t(E,[2,24]),t(E,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},t(E,[2,11]),t(E,[2,30],{33:60,27:T}),t(E,[2,32]),{31:[1,61]},t(E,[2,12]),{17:62,24:_},{25:63,27:A},t(E,[2,14]),{17:65,24:_},t(E,[2,16]),t(E,[2,17]),t(S,[2,41]),t(E,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(E,[2,31]),{27:[1,69]},t(E,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(E,[2,15]),t(E,[2,26]),t(E,[2,27]),{11:59,32:72,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},t(E,[2,33]),t(E,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},N=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return t}();function I(){this.yy={}}return L.lexer=N,o(I,"Parser"),I.prototype=L,L.Parser=I,new I}();Bat.parser=Bat;var $at=Bat;function Fat(t){return"bar"===t.type}function zat(t){return"band"===t.type}function Uat(t){return"linear"===t.type}o(Fat,"isBarPlot"),o(zat,"isBandAxisData"),o(Uat,"isLinearAxisData");var Gat=class{constructor(t){this.parentGroup=t}static{o(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce(((t,e)=>Math.max(e.length,t)),0)*e,height:e};const r={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const i of t){const t=g_(n,1,i),a=t?t.width:i.length*e,s=t?t.height:e;r.width=Math.max(r.width,a),r.height=Math.max(r.height,s)}return n.remove(),r}},qat=class{constructor(t,e,r,n){this.axisConfig=t,this.title=e,this.textDimensionCalculator=r,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{o(this,"BaseAxis")}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t=>t.toString())),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const r=this.getLabelDimension(),n=.2*t.width;this.outerPadding=Math.min(r.width/2,n);const i=r.height+2*this.axisConfig.labelPadding;this.labelTextHeight=r.height,i<=e&&(e-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),r=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,r<=e&&(e-=r,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const r=this.getLabelDimension(),n=.2*t.height;this.outerPadding=Math.min(r.height/2,n);const i=r.width+2*this.axisConfig.labelPadding;i<=e&&(e-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),r=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,r<=e&&(e-=r,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"})))}),this.showTick){const e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${e},${this.getScaleValue(t)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${e} L ${this.getScaleValue(t)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},jat=class extends qat{static{o(this,"BandAxis")}constructor(t,e,r,n,i){super(t,n,i,e),this.categories=r,this.scale=Lh().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Lh().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),y.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Wat=class extends qat{static{o(this,"LinearAxis")}constructor(t,e,r,n,i){super(t,n,i,e),this.domain=r,this.scale=ul().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=ul().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function Yat(t,e,r,n){const i=new Gat(n);return zat(t)?new jat(e,r,t.categories,t.title,i):new Wat(e,r,[t.min,t.max],t.title,i)}o(Yat,"getAxis");var Hat=class{constructor(t,e,r,n){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{o(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),r=Math.max(e.width,t.width),n=e.height+2*this.chartConfig.titlePadding;return e.width<=r&&e.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=r,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Vat(t,e,r,n){const i=new Gat(n);return new Hat(i,t,e,r)}o(Vat,"getChartTitleComponent");var Xat=class{constructor(t,e,r,n,i){this.plotData=t,this.xAxis=e,this.yAxis=r,this.orientation=n,this.plotIndex=i}static{o(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let e;return e="horizontal"===this.orientation?gu().y((t=>t[0])).x((t=>t[1]))(t):gu().x((t=>t[0])).y((t=>t[1]))(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Kat=class{constructor(t,e,r,n,i,a){this.barData=t,this.boundingRect=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}static{o(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])])),e=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),r=e/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-r,height:e,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:t[0]-r,y:t[1],width:e,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},Zat=class{constructor(t,e,r){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0}}static{o(this,"BasePlot")}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[e,r]of this.chartData.plots.entries())switch(r.type){case"line":{const n=new Xat(r,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...n.getDrawableElement())}break;case"bar":{const n=new Kat(r,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...n.getDrawableElement())}}return t}};function Qat(t,e,r){return new Zat(t,e,r)}o(Qat,"getPlotComponent");var Jat,tst=class{constructor(t,e,r,n){this.chartConfig=t,this.chartData=e,this.componentStore={title:Vat(t,e,r,n),plot:Qat(t,e,r),xAxis:Yat(e.xAxis,t.xAxis,{titleColor:r.xAxisTitleColor,labelColor:r.xAxisLabelColor,tickColor:r.xAxisTickColor,axisLineColor:r.xAxisLineColor},n),yAxis:Yat(e.yAxis,t.yAxis,{titleColor:r.yAxisTitleColor,labelColor:r.yAxisLabelColor,tickColor:r.yAxisTickColor,axisLineColor:r.yAxisLineColor},n)}}static{o(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,r=0,n=0,i=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:i,height:a});t-=s.width,e-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),n=s.height,e-=s.height,this.componentStore.xAxis.setAxisPosition("bottom"),s=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=s.height,this.componentStore.yAxis.setAxisPosition("left"),s=this.componentStore.yAxis.calculateSpace({width:t,height:e}),r=s.width,t-=s.width,t>0&&(i+=t,t=0),e>0&&(a+=e,e=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([r,r+i]),this.componentStore.xAxis.setBoundingBoxXY({x:r,y:n+a}),this.componentStore.yAxis.setRange([n,n+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((t=>Fat(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,r=0,n=0,i=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});t-=o.width,e-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),r=o.height,e-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=o.width,n=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=o.height,i=r+o.height,t>0&&(a+=t,t=0),e>0&&(s+=e,e=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.yAxis.setRange([n,n+a]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some((t=>Fat(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},est=class{static{o(this,"XYChartBuilder")}static build(t,e,r,n){return new tst(t,e,r,n).getDrawableElement()}},rst=0,nst=hst(),ist=cst(),ast=ust(),sst=ist.plotColorPalette.split(",").map((t=>t.trim())),ost=!1,lst=!1;function cst(){const t=bt(),e=Gt();return Ok(t.xyChart,e.themeVariables.xyChart)}function hst(){const t=Gt();return Ok(Lt.xyChart,t.xyChart)}function ust(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function dst(t){const e=Gt();return hr(t.trim(),e)}function pst(t){Jat=t}function gst(t){nst.chartOrientation="horizontal"===t?"horizontal":"vertical"}function fst(t){ast.xAxis.title=dst(t.text)}function mst(t,e){ast.xAxis={type:"linear",title:ast.xAxis.title,min:t,max:e},ost=!0}function yst(t){ast.xAxis={type:"band",title:ast.xAxis.title,categories:t.map((t=>dst(t.text)))},ost=!0}function vst(t){ast.yAxis.title=dst(t.text)}function xst(t,e){ast.yAxis={type:"linear",title:ast.yAxis.title,min:t,max:e},lst=!0}function bst(t){const e=Math.min(...t),r=Math.max(...t),n=Uat(ast.yAxis)?ast.yAxis.min:1/0,i=Uat(ast.yAxis)?ast.yAxis.max:-1/0;ast.yAxis={type:"linear",title:ast.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}function wst(t){let e=[];if(0===t.length)return e;if(!ost){const e=Uat(ast.xAxis)?ast.xAxis.min:1/0,r=Uat(ast.xAxis)?ast.xAxis.max:-1/0;mst(Math.min(e,1),Math.max(r,t.length))}if(lst||bst(t),zat(ast.xAxis)&&(e=ast.xAxis.categories.map(((e,r)=>[e,t[r]]))),Uat(ast.xAxis)){const r=ast.xAxis.min,n=ast.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let t=r;t<=n;t+=i)a.push(`${t}`);e=a.map(((e,r)=>[e,t[r]]))}return e}function kst(t){return sst[0===t?0:t%sst.length]}function Tst(t,e){const r=wst(e);ast.plots.push({type:"line",strokeFill:kst(rst),strokeWidth:2,data:r}),rst++}function _st(t,e){const r=wst(e);ast.plots.push({type:"bar",fill:kst(rst),data:r}),rst++}function Est(){if(0===ast.plots.length)throw Error("No Plot to render, please provide a plot with some data");return ast.title=Xr(),est.build(nst,ast,ist,Jat)}function Cst(){return ist}function Sst(){return nst}o(cst,"getChartDefaultThemeConfig"),o(hst,"getChartDefaultConfig"),o(ust,"getChartDefaultData"),o(dst,"textSanitizer"),o(pst,"setTmpSVGG"),o(gst,"setOrientation"),o(fst,"setXAxisTitle"),o(mst,"setXAxisRangeData"),o(yst,"setXAxisBand"),o(vst,"setYAxisTitle"),o(xst,"setYAxisRangeData"),o(bst,"setYAxisRangeFromPlotData"),o(wst,"transformDataWithoutCategory"),o(kst,"getPlotColorFromPalette"),o(Tst,"setLineData"),o(_st,"setBarData"),o(Est,"getDrawableElem"),o(Cst,"getChartThemeConfig"),o(Sst,"getChartConfig");var Ast=o((function(){qr(),rst=0,nst=hst(),ast={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},ist=cst(),sst=ist.plotColorPalette.split(",").map((t=>t.trim())),ost=!1,lst=!1}),"clear"),Lst={getDrawableElem:Est,clear:Ast,setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr,setOrientation:gst,setXAxisTitle:fst,setXAxisRangeData:mst,setXAxisBand:yst,setYAxisTitle:vst,setYAxisRangeData:xst,setLineData:Tst,setBarData:_st,setTmpSVGG:pst,getChartThemeConfig:Cst,getChartConfig:Sst},Nst=o(((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig();function l(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function h(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}o(l,"getDominantBaseLine"),o(c,"getTextAnchor"),o(h,"getTextTransformation"),y.debug("Rendering xychart chart\n"+t);const u=ag(e),d=u.append("g").attr("class","main"),p=d.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Rr(u,s.height,s.width,!0),u.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),f={};function m(t){let e=d,r="";for(const[n]of t.entries()){let i=d;n>0&&f[r]&&(i=f[r]),r+=t[n],e=f[r],e||(e=f[r]=i.append("g").attr("class",t[n]))}return e}o(m,"getGroup");for(const t of g){if(0===t.data.length)continue;const e=m(t.groupTexts);switch(t.type){case"rect":e.selectAll("rect").data(t.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":e.selectAll("text").data(t.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>l(t.verticalPos))).attr("text-anchor",(t=>c(t.horizontalPos))).attr("transform",(t=>h(t))).text((t=>t.text));break;case"path":e.selectAll("path").data(t.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth))}}}),"draw"),Ist={parser:$at,db:Lst,renderer:{draw:Nst}},Rst=Object.freeze({__proto__:null,diagram:Ist}),Mst=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],l=[2,7],c=[1,26],h=[1,27],u=[1,28],d=[1,29],p=[1,33],g=[1,34],f=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],w=[1,32],k=[1,30],T=[1,39],_=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],C=[1,61],S=[89,90],A=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],L=[27,29],N=[1,70],I=[1,71],R=[1,72],M=[1,73],D=[1,74],O=[1,75],P=[1,76],B=[1,83],$=[1,80],F=[1,84],z=[1,85],U=[1,86],G=[1,87],q=[1,88],j=[1,89],W=[1,90],Y=[1,91],H=[1,92],V=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],X=[63,64],K=[1,101],Z=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Q=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],J=[1,110],tt=[1,106],et=[1,107],rt=[1,108],nt=[1,109],it=[1,111],at=[1,116],st=[1,117],ot=[1,114],lt=[1,115],ct={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 4:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:n.setDirection("TB");break;case 18:n.setDirection("BT");break;case 19:n.setDirection("RL");break;case 20:n.setDirection("LR");break;case 21:n.addRequirement(a[o-3],a[o-4]);break;case 22:n.addRequirement(a[o-5],a[o-6]),n.setClass([a[o-5]],a[o-3]);break;case 23:n.setNewReqId(a[o-2]);break;case 24:n.setNewReqText(a[o-2]);break;case 25:n.setNewReqRisk(a[o-2]);break;case 26:n.setNewReqVerifyMethod(a[o-2]);break;case 29:this.$=n.RequirementType.REQUIREMENT;break;case 30:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=n.RiskLevel.LOW_RISK;break;case 36:this.$=n.RiskLevel.MED_RISK;break;case 37:this.$=n.RiskLevel.HIGH_RISK;break;case 38:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=n.VerifyType.VERIFY_TEST;break;case 42:n.addElement(a[o-3]);break;case 43:n.addElement(a[o-5]),n.setClass([a[o-5]],a[o-3]);break;case 44:n.setNewElementType(a[o-2]);break;case 45:n.setNewElementDocRef(a[o-2]);break;case 48:n.addRelationship(a[o-2],a[o],a[o-4]);break;case 49:n.addRelationship(a[o-2],a[o-4],a[o]);break;case 50:this.$=n.Relationships.CONTAINS;break;case 51:this.$=n.Relationships.COPIES;break;case 52:this.$=n.Relationships.DERIVES;break;case 53:this.$=n.Relationships.SATISFIES;break;case 54:this.$=n.Relationships.VERIFIES;break;case 55:this.$=n.Relationships.REFINES;break;case 56:this.$=n.Relationships.TRACES;break;case 57:this.$=a[o-2],n.defineClass(a[o-1],a[o]);break;case 58:n.setClass(a[o-1],a[o]);break;case 59:n.setClass([a[o-2]],a[o]);break;case 60:case 62:case 65:this.$=[a[o]];break;case 61:case 63:this.$=a[o-2].concat([a[o]]);break;case 64:this.$=a[o-2],n.setCssStyle(a[o-1],a[o]);break;case 66:a[o-2].push(a[o]),this.$=a[o-2];break;case 68:this.$=a[o-1]+a[o]}}),"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:43,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:44,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:45,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:46,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:47,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:48,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:49,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:50,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:C,89:T,90:_},{30:63,33:62,75:C,89:T,90:_},{30:64,33:62,75:C,89:T,90:_},t(S,[2,29]),t(S,[2,30]),t(S,[2,31]),t(S,[2,32]),t(S,[2,33]),t(S,[2,34]),t(A,[2,81]),t(A,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(L,[2,79]),t(L,[2,80]),{27:[1,67],29:[1,68]},t(L,[2,85]),t(L,[2,86]),{62:69,65:N,66:I,67:R,68:M,69:D,70:O,71:P},{62:77,65:N,66:I,67:R,68:M,69:D,70:O,71:P},{30:78,33:62,75:C,89:T,90:_},{73:79,75:B,76:$,78:81,79:82,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H},t(V,[2,60]),t(V,[2,62]),{73:93,75:B,76:$,78:81,79:82,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H},{30:94,33:62,75:C,76:$,89:T,90:_},{5:[1,95]},{30:96,33:62,75:C,89:T,90:_},{5:[1,97]},{30:98,33:62,75:C,89:T,90:_},{63:[1,99]},t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),{64:[1,100]},t(E,[2,59],{76:$}),t(E,[2,64],{76:K}),{33:103,75:[1,102],89:T,90:_},t(Z,[2,65],{79:104,75:B,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H}),t(Q,[2,67]),t(Q,[2,69]),t(Q,[2,70]),t(Q,[2,71]),t(Q,[2,72]),t(Q,[2,73]),t(Q,[2,74]),t(Q,[2,75]),t(Q,[2,76]),t(Q,[2,77]),t(Q,[2,78]),t(E,[2,57],{76:K}),t(E,[2,58],{76:$}),{5:J,28:105,31:tt,34:et,36:rt,38:nt,40:it},{27:[1,112],76:$},{5:at,40:st,56:113,57:ot,59:lt},{27:[1,118],76:$},{33:119,89:T,90:_},{33:120,89:T,90:_},{75:B,78:121,79:82,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H},t(V,[2,61]),t(V,[2,63]),t(Q,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:J,28:126,31:tt,34:et,36:rt,38:nt,40:it},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:at,40:st,56:130,57:ot,59:lt},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(Z,[2,66],{79:104,75:B,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H}),{33:132,89:T,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:J,28:145,31:tt,34:et,36:rt,38:nt,40:it},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:at,40:st,56:152,57:ot,59:lt},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:J,28:159,31:tt,34:et,36:rt,38:nt,40:it},{5:J,28:160,31:tt,34:et,36:rt,38:nt,40:it},{5:J,28:161,31:tt,34:et,36:rt,38:nt,40:it},{5:J,28:162,31:tt,34:et,36:rt,38:nt,40:it},{5:at,40:st,56:163,57:ot,59:lt},{5:at,40:st,56:164,57:ot,59:lt},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},ht=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 58:case 65:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:case 14:case 15:case 56:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 66:return"qString";case 67:return e.yytext=e.yytext.trim(),89;case 69:return 80;case 70:return 76}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return t}();function ut(){this.yy={}}return ct.lexer=ht,o(ut,"Parser"),ut.prototype=ct,ct.Parser=ut,new ut}();Mst.parser=Mst;var Dst=Mst,Ost=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=jr,this.getAccTitle=Wr,this.setAccDescription=Yr,this.getAccDescription=Hr,this.setDiagramTitle=Vr,this.getDiagramTitle=Xr,this.getConfig=o((()=>Qr().requirement),"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{o(this,"RequirementDB")}getDirection(){return this.direction}setDirection(t){this.direction=t}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(t,e){return this.requirements.has(t)||this.requirements.set(t,{name:t,type:e,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=t)}setNewReqText(t){void 0!==this.latestRequirement&&(this.latestRequirement.text=t)}setNewReqRisk(t){void 0!==this.latestRequirement&&(this.latestRequirement.risk=t)}setNewReqVerifyMethod(t){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=t)}addElement(t){return this.elements.has(t)||(this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),y.info("Added new element: ",t)),this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){void 0!==this.latestElement&&(this.latestElement.type=t)}setNewElementDocRef(t){void 0!==this.latestElement&&(this.latestElement.docRef=t)}addRelationship(t,e,r){this.relations.push({type:t,src:e,dst:r})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,qr()}setCssStyle(t,e){for(const r of t){const t=this.requirements.get(r)??this.elements.get(r);if(!e||!t)return;for(const r of e)r.includes(",")?t.cssStyles.push(...r.split(",")):t.cssStyles.push(r)}}setClass(t,e){for(const r of t){const t=this.requirements.get(r)??this.elements.get(r);if(t)for(const r of e){t.classes.push(r);const e=this.classes.get(r)?.styles;e&&t.cssStyles.push(...e)}}}defineClass(t,e){for(const r of t){let t=this.classes.get(r);void 0===t&&(t={id:r,styles:[],textStyles:[]},this.classes.set(r,t)),e&&e.forEach((function(e){if(/color/.exec(e)){const r=e.replace("fill","bgFill");t.textStyles.push(r)}t.styles.push(e)})),this.requirements.forEach((t=>{t.classes.includes(r)&&t.cssStyles.push(...e.flatMap((t=>t.split(","))))})),this.elements.forEach((t=>{t.classes.includes(r)&&t.cssStyles.push(...e.flatMap((t=>t.split(","))))}))}}getClasses(){return this.classes}getData(){const t=Qr(),e=[],r=[];for(const r of this.requirements.values()){const n=r;n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),n.shape="requirementBox",n.look=t.look,e.push(n)}for(const r of this.elements.values()){const n=r;n.shape="requirementBox",n.look=t.look,n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),e.push(n)}for(const e of this.relations){let n=0;const i=e.type===this.Relationships.CONTAINS,a={id:`${e.src}-${e.dst}-${n}`,start:this.requirements.get(e.src)?.name??this.elements.get(e.src)?.name,end:this.requirements.get(e.dst)?.name??this.elements.get(e.dst)?.name,label:`<<${e.type}>>`,classes:"relationshipLine",style:["fill:none",i?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:i?"normal":"dashed",arrowTypeStart:i?"requirement_contains":"",arrowTypeEnd:i?"":"requirement_arrow",look:t.look};r.push(a),n++}return{nodes:e,edges:r,other:{},config:t,direction:this.getDirection()}}},Pst=o((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n .divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n .labelBkg {\n background-color: ${t.edgeLabelBackground};\n }\n\n`),"getStyles"),Bst={};h(Bst,{draw:()=>$st});var $st=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s}=Qr(),o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=OA(s),o.nodeSpacing=a?.nodeSpacing??50,o.rankSpacing=a?.rankSpacing??50,o.markers=["requirement_contains","requirement_arrow"],o.diagramId=e,await DA(o,l);Pk.insertTitle(l,"requirementDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,"requirementDiagram",a?.useMaxWidth??!0)}),"draw"),Fst={parser:Dst,get db(){return new Ost},renderer:Bst,styles:Pst},zst=Object.freeze({__proto__:null,diagram:Fst}),Ust=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],l=[1,13],c=[1,14],h=[1,16],u=[1,17],d=[1,18],p=[1,24],g=[1,25],f=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],w=[1,32],k=[1,33],T=[1,34],_=[1,35],E=[1,36],C=[1,37],S=[1,38],A=[1,39],L=[1,41],N=[1,42],I=[1,43],R=[1,44],M=[1,45],D=[1,46],O=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],P=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],z=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],U=[68,69,70],G=[1,122],q={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 3:return n.apply(a[o]),a[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:a[o-1].push(a[o]),this.$=a[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=a[o];break;case 15:a[o].type="createParticipant",this.$=a[o];break;case 16:a[o-1].unshift({type:"boxStart",boxData:n.parseBoxData(a[o-2])}),a[o-1].push({type:"boxEnd",boxText:a[o-2]}),this.$=a[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-2]),sequenceIndexStep:Number(a[o-1]),sequenceVisible:!0,signalType:n.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:n.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:n.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:n.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:n.LINETYPE.ACTIVE_START,actor:a[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:n.LINETYPE.ACTIVE_END,actor:a[o-1].actor};break;case 29:n.setDiagramTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 30:n.setDiagramTitle(a[o].substring(7)),this.$=a[o].substring(7);break;case 31:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 32:case 33:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 34:a[o-1].unshift({type:"loopStart",loopText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.LOOP_START}),a[o-1].push({type:"loopEnd",loopText:a[o-2],signalType:n.LINETYPE.LOOP_END}),this.$=a[o-1];break;case 35:a[o-1].unshift({type:"rectStart",color:n.parseMessage(a[o-2]),signalType:n.LINETYPE.RECT_START}),a[o-1].push({type:"rectEnd",color:n.parseMessage(a[o-2]),signalType:n.LINETYPE.RECT_END}),this.$=a[o-1];break;case 36:a[o-1].unshift({type:"optStart",optText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.OPT_START}),a[o-1].push({type:"optEnd",optText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.OPT_END}),this.$=a[o-1];break;case 37:a[o-1].unshift({type:"altStart",altText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.ALT_START}),a[o-1].push({type:"altEnd",signalType:n.LINETYPE.ALT_END}),this.$=a[o-1];break;case 38:a[o-1].unshift({type:"parStart",parText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.PAR_START}),a[o-1].push({type:"parEnd",signalType:n.LINETYPE.PAR_END}),this.$=a[o-1];break;case 39:a[o-1].unshift({type:"parStart",parText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.PAR_OVER_START}),a[o-1].push({type:"parEnd",signalType:n.LINETYPE.PAR_END}),this.$=a[o-1];break;case 40:a[o-1].unshift({type:"criticalStart",criticalText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.CRITICAL_START}),a[o-1].push({type:"criticalEnd",signalType:n.LINETYPE.CRITICAL_END}),this.$=a[o-1];break;case 41:a[o-1].unshift({type:"breakStart",breakText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.BREAK_START}),a[o-1].push({type:"breakEnd",optText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.BREAK_END}),this.$=a[o-1];break;case 43:this.$=a[o-3].concat([{type:"option",optionText:n.parseMessage(a[o-1]),signalType:n.LINETYPE.CRITICAL_OPTION},a[o]]);break;case 45:this.$=a[o-3].concat([{type:"and",parText:n.parseMessage(a[o-1]),signalType:n.LINETYPE.PAR_AND},a[o]]);break;case 47:this.$=a[o-3].concat([{type:"else",altText:n.parseMessage(a[o-1]),signalType:n.LINETYPE.ALT_ELSE},a[o]]);break;case 48:a[o-3].draw="participant",a[o-3].type="addParticipant",a[o-3].description=n.parseMessage(a[o-1]),this.$=a[o-3];break;case 49:a[o-1].draw="participant",a[o-1].type="addParticipant",this.$=a[o-1];break;case 50:a[o-3].draw="actor",a[o-3].type="addParticipant",a[o-3].description=n.parseMessage(a[o-1]),this.$=a[o-3];break;case 51:a[o-1].draw="actor",a[o-1].type="addParticipant",this.$=a[o-1];break;case 52:a[o-1].type="destroyParticipant",this.$=a[o-1];break;case 53:this.$=[a[o-1],{type:"addNote",placement:a[o-2],actor:a[o-1].actor,text:a[o]}];break;case 54:a[o-2]=[].concat(a[o-1],a[o-1]).slice(0,2),a[o-2][0]=a[o-2][0].actor,a[o-2][1]=a[o-2][1].actor,this.$=[a[o-1],{type:"addNote",placement:n.PLACEMENT.OVER,actor:a[o-2].slice(0,2),text:a[o]}];break;case 55:this.$=[a[o-1],{type:"addLinks",actor:a[o-1].actor,text:a[o]}];break;case 56:this.$=[a[o-1],{type:"addALink",actor:a[o-1].actor,text:a[o]}];break;case 57:this.$=[a[o-1],{type:"addProperties",actor:a[o-1].actor,text:a[o]}];break;case 58:this.$=[a[o-1],{type:"addDetails",actor:a[o-1].actor,text:a[o]}];break;case 61:this.$=[a[o-2],a[o]];break;case 63:this.$=n.PLACEMENT.LEFTOF;break;case 64:this.$=n.PLACEMENT.RIGHTOF;break;case 65:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o],activate:!0},{type:"activeStart",signalType:n.LINETYPE.ACTIVE_START,actor:a[o-1].actor}];break;case 66:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeEnd",signalType:n.LINETYPE.ACTIVE_END,actor:a[o-4].actor}];break;case 67:this.$=[a[o-3],a[o-1],{type:"addMessage",from:a[o-3].actor,to:a[o-1].actor,signalType:a[o-2],msg:a[o]}];break;case 68:this.$={type:"addParticipant",actor:a[o]};break;case 69:this.$=n.LINETYPE.SOLID_OPEN;break;case 70:this.$=n.LINETYPE.DOTTED_OPEN;break;case 71:this.$=n.LINETYPE.SOLID;break;case 72:this.$=n.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=n.LINETYPE.DOTTED;break;case 74:this.$=n.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=n.LINETYPE.SOLID_CROSS;break;case 76:this.$=n.LINETYPE.DOTTED_CROSS;break;case 77:this.$=n.LINETYPE.SOLID_POINT;break;case 78:this.$=n.LINETYPE.DOTTED_POINT;break;case 79:this.$=n.parseMessage(a[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,12:12,13:l,14:c,17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},t(O,[2,5]),{9:47,12:12,13:l,14:c,17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},t(O,[2,7]),t(O,[2,8]),t(O,[2,14]),{12:48,50:C,52:S,53:A},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:D},{22:55,70:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(O,[2,29]),t(O,[2,30]),{32:[1,61]},{34:[1,62]},t(O,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:D},{22:72,70:D},{22:73,70:D},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:D},{22:90,70:D},{22:91,70:D},{22:92,70:D},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(O,[2,6]),t(O,[2,15]),t(P,[2,9],{10:93}),t(O,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(O,[2,21]),{5:[1,97]},{5:[1,98]},t(O,[2,24]),t(O,[2,25]),t(O,[2,26]),t(O,[2,27]),t(O,[2,28]),t(O,[2,31]),t(O,[2,32]),t(B,i,{7:99}),t(B,i,{7:100}),t(B,i,{7:101}),t($,i,{40:102,7:103}),t(F,i,{42:104,7:105}),t(F,i,{7:105,42:106}),t(z,i,{45:107,7:108}),t(B,i,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:D},t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),{22:118,70:D},{22:120,58:119,70:D},{70:[2,63]},{70:[2,64]},{56:121,81:G},{56:123,81:G},{56:124,81:G},{56:125,81:G},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:C,52:S,53:A},{5:[1,131]},t(O,[2,19]),t(O,[2,20]),t(O,[2,22]),t(O,[2,23]),{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[1,132],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[1,133],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[1,134],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{16:[1,135]},{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[2,46],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,49:[1,136],50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{16:[1,137]},{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[2,44],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,48:[1,138],50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{16:[1,139]},{16:[1,140]},{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[2,42],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,47:[1,141],50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{4:a,5:s,8:8,9:10,12:12,13:l,14:c,16:[1,142],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:R,62:M,70:D},{15:[1,143]},t(O,[2,49]),{15:[1,144]},t(O,[2,51]),t(O,[2,52]),{22:145,70:D},{22:146,70:D},{56:147,81:G},{56:148,81:G},{56:149,81:G},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(O,[2,16]),t(P,[2,10]),{12:151,50:C,52:S,53:A},t(P,[2,12]),t(P,[2,13]),t(O,[2,18]),t(O,[2,34]),t(O,[2,35]),t(O,[2,36]),t(O,[2,37]),{15:[1,152]},t(O,[2,38]),{15:[1,153]},t(O,[2,39]),t(O,[2,40]),{15:[1,154]},t(O,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:G},{56:158,81:G},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:D},t(P,[2,11]),t($,i,{7:103,40:160}),t(F,i,{7:105,42:161}),t(z,i,{7:108,45:162}),t(O,[2,48]),t(O,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},j=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return t}();function W(){this.yy={}}return q.lexer=j,o(W,"Parser"),W.prototype=q,q.Parser=W,new W}();Ust.parser=Ust;var Gst=Ust,qst={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},jst={FILLED:0,OPEN:1},Wst={LEFTOF:0,RIGHTOF:1,OVER:2},Yst=class{constructor(){this.state=new NX((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}))),this.setAccTitle=jr,this.setAccDescription=Yr,this.setDiagramTitle=Vr,this.getAccTitle=Wr,this.getAccDescription=Hr,this.getDiagramTitle=Xr,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Qr().wrap),this.LINETYPE=qst,this.ARROWTYPE=jst,this.PLACEMENT=Wst}static{o(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,r,n){let i=this.state.records.currentBox;const a=this.state.records.actors.get(t);if(a){if(this.state.records.currentBox&&a.box&&this.state.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:this.state.records.currentBox,a.box=i,a&&e===a.name&&null==r)return}if(null==r?.text&&(r={text:e,type:n}),null!=n&&null!=r.text||(r={text:e,type:n}),this.state.records.actors.set(t,{box:i,name:e,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,r=0;if(!t)return 0;for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some((t=>t.name))}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:Qr().sequence?.wrap??!1}clear(){this.state.reset(),qr()}parseMessage(t){const e=t.trim(),{wrap:r,cleanedText:n}=this.extractWrap(e),i={text:n,wrap:r};return y.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let r=e?.[1]?e[1].trim():"transparent",n=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{const e=(new Option).style;e.color=r,e.color!==r&&(r="transparent",n=t.trim())}const{wrap:i,cleanedText:a}=this.extractWrap(n);return{text:a?hr(a,Qr()):void 0,color:r,wrap:i}}addNote(t,e,r){const n={actor:t,placement:e,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const r=this.getActor(t);try{let t=hr(e.text,Qr());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const n=JSON.parse(t);this.insertLinks(r,n)}catch(t){y.error("error while parsing actor link text",t)}}addALink(t,e){const r=this.getActor(t);try{const t={};let n=hr(e.text,Qr());const i=n.indexOf("@");n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");const a=n.slice(0,i-1).trim(),s=n.slice(i+1).trim();t[a]=s,this.insertLinks(r,t)}catch(t){y.error("error while parsing actor link text",t)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const r in e)t.links[r]=e[r]}addProperties(t,e){const r=this.getActor(t);try{const t=hr(e.text,Qr()),n=JSON.parse(t);this.insertProperties(r,n)}catch(t){y.error("error while parsing actor properties text",t)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const r in e)t.properties[r]=e[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const r=this.getActor(t),n=document.getElementById(e.text);try{const t=n.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(r,e.properties),e.links&&this.insertLinks(r,e.links)}catch(t){y.error("error while parsing actor details text",t)}}getActorProperty(t,e){if(void 0!==t?.properties)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach((t=>{this.apply(t)}));else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":jr(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return Qr().sequence}},Hst=o((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`),"getStyles"),Vst=p(Wy(),1),Xst="actor-man",Kst=o((function(t,e){return SH(t,e)}),"drawRect"),Zst=o((function(t,e,r,n,i){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const c=t.append("g");c.attr("id","actor"+s+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",l);var h="";void 0!==o.class&&(h=" "+o.class);let u=o.width>r?o.width:r;const d=c.append("rect");if(d.attr("class","actorPopupMenuPanel"+h),d.attr("x",o.x),d.attr("y",o.height),d.attr("fill",o.fill),d.attr("stroke",o.stroke),d.attr("width",u),d.attr("height",o.height),d.attr("rx",o.rx),d.attr("ry",o.ry),null!=a){var p=20;for(let t in a){var g=c.append("a"),f=(0,Vst.sanitizeUrl)(a[t]);g.attr("xlink:href",f),g.attr("target","_blank"),kot(n)(t,g,o.x+10,o.height+p,u,20,{class:"actor"},n),p+=30}}return d.attr("height",p),{height:o.height+p,width:u}}),"drawPopup"),Qst=o((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),Jst=o((async function(t,e,r=null){let n=t.append("foreignObject");const i=await Ar(e.text,Gt()),a=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),"noteText"===e.class){const r=t.node().firstChild;r.setAttribute("height",a.height+2*e.textMargin);const i=r.getBBox();n.attr("x",Math.round(i.x+i.width/2-a.width/2)).attr("y",Math.round(i.y+i.height/2-a.height/2))}else if(r){let{startx:t,stopx:i,starty:s}=r;if(t>i){const e=t;t=i,i=e}n.attr("x",Math.round(t+Math.abs(t-i)/2-a.width/2)),"loopText"===e.class?n.attr("y",Math.round(s)):n.attr("y",Math.round(s-a.height))}return[n]}),"drawKatex"),tot=o((function(t,e){let r=0,n=0;const i=e.text.split(Lr.lineBreakRegex),[a,s]=Dk(e.fontSize);let l=[],c=0,h=o((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":h=o((()=>Math.round(e.y+(r+n+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":h=o((()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin)),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,u]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==a&&(c=o*a);const i=t.append("text");i.attr("x",e.x),i.attr("y",h()),void 0!==e.anchor&&i.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&i.style("font-family",e.fontFamily),void 0!==s&&i.style("font-size",s),void 0!==e.fontWeight&&i.style("font-weight",e.fontWeight),void 0!==e.fill&&i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class),void 0!==e.dy?i.attr("dy",e.dy):0!==c&&i.attr("dy",c);const d=u||"​";if(e.tspan){const t=i.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(d)}else i.text(d);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(n+=(i._groups||i)[0][0].getBBox().height,r=n),l.push(i)}return l}),"drawText"),eot=o((function(t,e){function r(t,e,r,n,i){return t+","+e+" "+(t+r)+","+e+" "+(t+r)+","+(e+n-i)+" "+(t+r-1.2*i)+","+(e+n)+" "+t+","+(e+n)}o(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,tot(t,e),n}),"drawLabel"),rot=-1,not=o(((t,e,r,n)=>{t.select&&r.forEach((r=>{const i=e.get(r),a=t.select("#actor"+i.actorCnt);!n.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):n.mirrorActors&&a.attr("y2",i.stopy)}))}),"fixLifeLineHeights"),iot=o((function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();var l=o;n||(rot++,Object.keys(e.links||{}).length&&!r.forceMenus&&l.attr("onclick",Qst(`actor${rot}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+rot).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),l=o.append("g"),e.actorCnt=rot,null!=e.links&&l.attr("id","root-"+rot));const c=RH();var h="actor";e.properties?.class?h=e.properties.class:c.fill="#eaeaea",h+=n?" actor-bottom":" actor-top",c.x=e.x,c.y=i,c.width=e.width,c.height=e.height,c.class=h,c.rx=3,c.ry=3,c.name=e.name;const u=Kst(l,c);if(e.rectData=c,e.properties?.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?IH(l,c.x+c.width-20,c.y+10,t.substr(1)):NH(l,c.x+c.width-20,c.y+10,t)}wot(r,Cr(e.description))(e.description,l,c.x,c.y,c.width,c.height,{class:"actor actor-box"},r);let d=e.height;if(u.node){const t=u.node().getBBox();e.height=t.height,d=t.height}return d}),"drawActorTypeParticipant"),aot=o((function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,o=t.append("g").lower();n||(rot++,o.append("line").attr("id","actor"+rot).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=rot);const l=t.append("g");let c=Xst;c+=n?" actor-bottom":" actor-top",l.attr("class",c),l.attr("name",e.name);const h=RH();h.x=e.x,h.y=i,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor",h.rx=3,h.ry=3,l.append("line").attr("id","actor-man-torso"+rot).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+rot).attr("x1",a-18).attr("y1",i+33).attr("x2",a+18).attr("y2",i+33),l.append("line").attr("x1",a-18).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+18-2).attr("y2",i+60);const u=l.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",i+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const d=l.node().getBBox();return e.height=d.height,wot(r,Cr(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:"actor actor-man"},r),e.height}),"drawActorTypeActor"),sot=o((async function(t,e,r,n){switch(e.type){case"actor":return await aot(t,e,r,n);case"participant":return await iot(t,e,r,n)}}),"drawActor"),oot=o((function(t,e,r){const n=t.append("g");uot(n,e),e.name&&wot(r)(e.name,n,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),n.lower()}),"drawBox"),lot=o((function(t){return t.append("g")}),"anchorElement"),cot=o((function(t,e,r,n,i){const a=RH(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=r-e.starty,Kst(s,a)}),"drawActivation"),hot=o((async function(t,e,r,n){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:s,labelBoxWidth:l,messageFontFamily:c,messageFontSize:h,messageFontWeight:u}=n,d=t.append("g"),p=o((function(t,e,r,n){return d.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",n).attr("class","loopLine")}),"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach((function(t){p(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}));let g=MH();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=l||50,g.height=s||20,g.textMargin=a,g.class="labelText",eot(d,g),g=xot(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+i+a,g.anchor="middle",g.valign="middle",g.textMargin=a,g.class="loopText",g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.wrap=!0;let f=Cr(g.text)?await Jst(d,g,e):tot(d,g);if(void 0!==e.sectionTitles)for(const[t,r]of Object.entries(e.sectionTitles))if(r.message){g.text=r.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[t].y+i+a,g.class="loopText",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.wrap=e.wrap,Cr(g.text)?(e.starty=e.sections[t].y,await Jst(d,g,e)):tot(d,g);let n=Math.round(f.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[t].height+=n-(i+a)}return e.height=Math.round(e.stopy-e.starty),d}),"drawLoop"),uot=o((function(t,e){AH(t,e)}),"drawBackgroundRect"),dot=o((function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")}),"insertDatabaseIcon"),pot=o((function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")}),"insertComputerIcon"),got=o((function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")}),"insertClockIcon"),fot=o((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")}),"insertArrowHead"),mot=o((function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"insertArrowFilledHead"),yot=o((function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)}),"insertSequenceNumber"),vot=o((function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")}),"insertArrowCrossHead"),xot=o((function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}}),"getTextObj"),bot=o((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),wot=function(){function t(t,e,r,n,a,s,o){i(e.append("text").attr("x",r+a/2).attr("y",n+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,r,n,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l,[d,p]=Dk(c),g=t.split(Lr.lineBreakRegex);for(let t=0;tt.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:o((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:o((function(t){this.boxes.push(t)}),"addBox"),addActor:o((function(t){this.actors.push(t)}),"addActor"),addLoop:o((function(t){this.loops.push(t)}),"addLoop"),addMessage:o((function(t){this.messages.push(t)}),"addMessage"),addNote:o((function(t){this.notes.push(t)}),"addNote"),lastActor:o((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:o((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:o((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:o((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o((function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Oot(Qr())}),"init"),updateVal:o((function(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])}),"updateVal"),updateBounds:o((function(t,e,r,n){const i=this;let a=0;function s(s){return o((function(o){a++;const l=i.sequenceItems.length-a+1;i.updateVal(o,"starty",e-l*_ot.boxMargin,Math.min),i.updateVal(o,"stopy",n+l*_ot.boxMargin,Math.max),i.updateVal(Eot.data,"startx",t-l*_ot.boxMargin,Math.min),i.updateVal(Eot.data,"stopx",r+l*_ot.boxMargin,Math.max),"activation"!==s&&(i.updateVal(o,"startx",t-l*_ot.boxMargin,Math.min),i.updateVal(o,"stopx",r+l*_ot.boxMargin,Math.max),i.updateVal(Eot.data,"starty",e-l*_ot.boxMargin,Math.min),i.updateVal(Eot.data,"stopy",n+l*_ot.boxMargin,Math.max))}),"updateItemBounds")}o(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))}),"updateBounds"),insert:o((function(t,e,r,n){const i=Lr.getMin(t,r),a=Lr.getMax(t,r),s=Lr.getMin(e,n),o=Lr.getMax(e,n);this.updateVal(Eot.data,"startx",i,Math.min),this.updateVal(Eot.data,"starty",s,Math.min),this.updateVal(Eot.data,"stopx",a,Math.max),this.updateVal(Eot.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),newActivation:o((function(t,e,r){const n=r.get(t.from),i=Pot(t.from).length||0,a=n.x+n.width/2+(i-1)*_ot.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+_ot.activationWidth,stopy:void 0,actor:t.from,anchored:Tot.anchorElement(e)})}),"newActivation"),endActivation:o((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:o((function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}}),"createLoop"),newLoop:o((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:o((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:o((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:o((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Eot.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:o((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:o((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:o((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Lr.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:o((function(){return this.verticalPos}),"getVerticalPos"),getBounds:o((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Cot=o((async function(t,e){Eot.bumpVerticalPos(_ot.boxMargin),e.height=_ot.boxMargin,e.starty=Eot.getVerticalPos();const r=RH();r.x=e.startx,r.y=e.starty,r.width=e.width||_ot.width,r.class="note";const n=t.append("g"),i=Tot.drawRect(n,r),a=MH();a.x=e.startx,a.y=e.starty,a.width=r.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=_ot.noteFontFamily,a.fontSize=_ot.noteFontSize,a.fontWeight=_ot.noteFontWeight,a.anchor=_ot.noteAlign,a.textMargin=_ot.noteMargin,a.valign="center";const s=Cr(a.text)?await Jst(n,a):tot(n,a),o=Math.round(s.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",o+2*_ot.noteMargin),e.height+=o+2*_ot.noteMargin,Eot.bumpVerticalPos(o+2*_ot.noteMargin),e.stopy=e.starty+o+2*_ot.noteMargin,e.stopx=e.startx+r.width,Eot.insert(e.startx,e.starty,e.stopx,e.stopy),Eot.models.addNote(e)}),"drawNote"),Sot=o((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),Aot=o((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),Lot=o((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Not(t,e){Eot.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Lr.splitBreaks(i).length,s=Cr(i),o=s?await Sr(i,Qr()):Pk.calculateTextDimensions(i,Sot(_ot));if(!s){const t=o.height/a;e.height+=t,Eot.bumpVerticalPos(t)}let l,c=o.height-10;const h=o.width;if(r===n){l=Eot.getVerticalPos()+c,_ot.rightAngles||(c+=_ot.boxMargin,l=Eot.getVerticalPos()+c),c+=30;const t=Lr.getMax(h/2,_ot.width/2);Eot.insert(r-t,Eot.getVerticalPos()-10+c,n+t,Eot.getVerticalPos()+30+c)}else c+=_ot.boxMargin,l=Eot.getVerticalPos()+c,Eot.insert(r,l-10,n,l);return Eot.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,Eot.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}o(Not,"boundMessage");var Iot=o((async function(t,e,r,n){const{startx:i,stopx:a,starty:s,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,u=Pk.calculateTextDimensions(o,Sot(_ot)),d=MH();d.x=i,d.y=s+10,d.width=a-i,d.class="messageText",d.dy="1em",d.text=o,d.fontFamily=_ot.messageFontFamily,d.fontSize=_ot.messageFontSize,d.fontWeight=_ot.messageFontWeight,d.anchor=_ot.messageAlign,d.valign="center",d.textMargin=_ot.wrapPadding,d.tspan=!1,Cr(d.text)?await Jst(t,d,{startx:i,stopx:a,starty:r}):tot(t,d);const p=u.width;let g;i===a?g=_ot.rightAngles?t.append("path").attr("d",`M ${i},${r} H ${i+Lr.getMax(_ot.width/2,p/2)} V ${r+25} H ${i}`):t.append("path").attr("d","M "+i+","+r+" C "+(i+60)+","+(r-10)+" "+(i+60)+","+(r+30)+" "+i+","+(r+20)):(g=t.append("line"),g.attr("x1",i),g.attr("y1",r),g.attr("x2",a),g.attr("y2",r)),l===n.db.LINETYPE.DOTTED||l===n.db.LINETYPE.DOTTED_CROSS||l===n.db.LINETYPE.DOTTED_POINT||l===n.db.LINETYPE.DOTTED_OPEN||l===n.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let f="";_ot.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),l!==n.db.LINETYPE.SOLID&&l!==n.db.LINETYPE.DOTTED||g.attr("marker-end","url("+f+"#arrowhead)"),l!==n.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==n.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+f+"#arrowhead)"),g.attr("marker-end","url("+f+"#arrowhead)")),l!==n.db.LINETYPE.SOLID_POINT&&l!==n.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+f+"#filled-head)"),l!==n.db.LINETYPE.SOLID_CROSS&&l!==n.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+f+"#crosshead)"),(h||_ot.showSequenceNumbers)&&(g.attr("marker-start","url("+f+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}),"drawMessage"),Rot=o((function(t,e,r,n,i,a,s){let o,l=0,c=0,h=0;for(const t of n){const n=e.get(t),a=n.box;o&&o!=a&&(s||Eot.models.addBox(o),c+=_ot.boxMargin+o.margin),a&&a!=o&&(s||(a.x=l+c,a.y=i),c+=a.margin),n.width=n.width||_ot.width,n.height=Lr.getMax(n.height||_ot.height,_ot.height),n.margin=n.margin||_ot.actorMargin,h=Lr.getMax(h,n.height),r.get(n.name)&&(c+=n.width/2),n.x=l+c,n.starty=Eot.getVerticalPos(),Eot.insert(n.x,i,n.x+n.width,n.height),l+=n.width+c,n.box&&(n.box.width=l+a.margin-n.box.x),c=n.margin,o=n.box,Eot.models.addActor(n)}o&&!s&&Eot.models.addBox(o),Eot.bumpVerticalPos(h)}),"addActorRenderingData"),Mot=o((async function(t,e,r,n){if(n){let n=0;Eot.bumpVerticalPos(2*_ot.boxMargin);for(const i of r){const r=e.get(i);r.stopy||(r.stopy=Eot.getVerticalPos());const a=await Tot.drawActor(t,r,_ot,!0);n=Lr.getMax(n,a)}Eot.bumpVerticalPos(n+_ot.boxMargin)}else for(const n of r){const r=e.get(n);await Tot.drawActor(t,r,_ot,!1)}}),"drawActors"),Dot=o((function(t,e,r,n){let i=0,a=0;for(const s of r){const r=e.get(s),o=Got(r),l=Tot.drawPopup(t,r,o,_ot,_ot.forceMenus,n);l.height>i&&(i=l.height),l.width+r.x>a&&(a=l.width+r.x)}return{maxHeight:i,maxWidth:a}}),"drawActorsPopup"),Oot=o((function(t){N(_ot,t),t.fontFamily&&(_ot.actorFontFamily=_ot.noteFontFamily=_ot.messageFontFamily=t.fontFamily),t.fontSize&&(_ot.actorFontSize=_ot.noteFontSize=_ot.messageFontSize=t.fontSize),t.fontWeight&&(_ot.actorFontWeight=_ot.noteFontWeight=_ot.messageFontWeight=t.fontWeight)}),"setConf"),Pot=o((function(t){return Eot.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),Bot=o((function(t,e){const r=e.get(t),n=Pot(t);return[n.reduce((function(t,e){return Lr.getMin(t,e.startx)}),r.x+r.width/2-1),n.reduce((function(t,e){return Lr.getMax(t,e.stopx)}),r.x+r.width/2+1)]}),"activationBounds");function $ot(t,e,r,n,i){Eot.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const r=t[e.id].width,i=Sot(_ot);e.message=Pk.wrapLabel(`[${e.message}]`,r-2*_ot.wrapPadding,i),e.width=r,e.wrap=!0;const s=Pk.calculateTextDimensions(e.message,i),o=Lr.getMax(s.height,_ot.labelBoxHeight);a=n+o,y.debug(`${o} - ${e.message}`)}i(e),Eot.bumpVerticalPos(a)}function Fot(t,e,r,n,i,a,s){function l(r,n){r.x{t.add(e.from),t.add(e.to)})),f=f.filter((e=>t.has(e)))}Rot(h,u,d,f,0,m,!1);const k=await Yot(m,u,w,n);function T(t,e){const r=Eot.endActivation(t);r.starty+18>e&&(r.starty=e-6,e+=12),Tot.drawActivation(h,r,e,_ot,Pot(t.from).length),Eot.insert(r.startx,e-10,r.stopx,e)}Tot.insertArrowHead(h),Tot.insertArrowCrossHead(h),Tot.insertArrowFilledHead(h),Tot.insertSequenceNumber(h),o(T,"activeEnd");let _=1,E=1;const C=[],S=[];let A=0;for(const t of m){let e,r,i;switch(t.type){case n.db.LINETYPE.NOTE:Eot.resetVerticalPos(),r=t.noteModel,await Cot(h,r);break;case n.db.LINETYPE.ACTIVE_START:Eot.newActivation(t,h,u);break;case n.db.LINETYPE.ACTIVE_END:T(t,Eot.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.LOOP_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"loop",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.RECT_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin,(t=>Eot.newLoop(void 0,t.message)));break;case n.db.LINETYPE.RECT_END:e=Eot.endLoop(),S.push(e),Eot.models.addLoop(e),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos());break;case n.db.LINETYPE.OPT_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.OPT_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"opt",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.ALT_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.ALT_ELSE:$ot(k,t,_ot.boxMargin+_ot.boxTextMargin,_ot.boxMargin,(t=>Eot.addSectionToLoop(t)));break;case n.db.LINETYPE.ALT_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"alt",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t))),Eot.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:$ot(k,t,_ot.boxMargin+_ot.boxTextMargin,_ot.boxMargin,(t=>Eot.addSectionToLoop(t)));break;case n.db.LINETYPE.PAR_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"par",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.AUTONUMBER:_=t.message.start||_,E=t.message.step||E,t.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.CRITICAL_OPTION:$ot(k,t,_ot.boxMargin+_ot.boxTextMargin,_ot.boxMargin,(t=>Eot.addSectionToLoop(t)));break;case n.db.LINETYPE.CRITICAL_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"critical",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.BREAK_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.BREAK_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"break",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;default:try{i=t.msgModel,i.starty=Eot.getVerticalPos(),i.sequenceIndex=_,i.sequenceVisible=n.db.showSequenceNumbers();const e=await Not(0,i);Fot(t,i,e,A,u,d,p),C.push({messageModel:i,lineStartY:e}),Eot.models.addMessage(i)}catch(t){y.error("error while drawing message",t)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(_+=E),A++}y.debug("createdActors",d),y.debug("destroyedActors",p),await Mot(h,u,f,!1);for(const t of C)await Iot(h,t.messageModel,t.lineStartY,n);_ot.mirrorActors&&await Mot(h,u,f,!0),S.forEach((t=>Tot.drawBackgroundRect(h,t))),not(h,u,f,_ot);for(const t of Eot.models.boxes)t.height=Eot.getVerticalPos()-t.y,Eot.insert(t.x,t.y,t.x+t.width,t.height),t.startx=t.x,t.starty=t.y,t.stopx=t.startx+t.width,t.stopy=t.starty+t.height,t.stroke="rgb(0,0,0, 0.5)",Tot.drawBox(h,t,_ot);x&&Eot.bumpVerticalPos(_ot.boxMargin);const L=Dot(h,u,f,c),{bounds:N}=Eot.getBounds();void 0===N.startx&&(N.startx=0),void 0===N.starty&&(N.starty=0),void 0===N.stopx&&(N.stopx=0),void 0===N.stopy&&(N.stopy=0);let I=N.stopy-N.starty;I{const r=Sot(_ot);let n=e.actorKeys.reduce(((e,r)=>e+(t.get(r).width+(t.get(r).margin||0))),0);n-=2*_ot.boxTextMargin,e.wrap&&(e.name=Pk.wrapLabel(e.name,n-2*_ot.wrapPadding,r));const a=Pk.calculateTextDimensions(e.name,r);i=Lr.getMax(a.height,i);const s=Lr.getMax(n,a.width+2*_ot.wrapPadding);if(e.margin=_ot.boxTextMargin,nt.textMaxHeight=i)),Lr.getMax(n,_ot.height)}o(qot,"calculateActorMargins");var jot=o((async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=Cr(t.message)?await Sr(t.message,Qr()):Pk.calculateTextDimensions(o?Pk.wrapLabel(t.message,_ot.width,Aot(_ot)):t.message,Aot(_ot));const c={width:o?_ot.width:Lr.getMax(_ot.width,l.width+2*_ot.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(c.width=o?Lr.getMax(_ot.width,l.width):Lr.getMax(n.width/2+i.width/2,l.width+2*_ot.noteMargin),c.startx=a+(n.width+_ot.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(c.width=o?Lr.getMax(_ot.width,l.width+2*_ot.noteMargin):Lr.getMax(n.width/2+i.width/2,l.width+2*_ot.noteMargin),c.startx=a-c.width+(n.width-_ot.actorMargin)/2):t.to===t.from?(l=Pk.calculateTextDimensions(o?Pk.wrapLabel(t.message,Lr.getMax(_ot.width,n.width),Aot(_ot)):t.message,Aot(_ot)),c.width=o?Lr.getMax(_ot.width,n.width):Lr.getMax(n.width,_ot.width,l.width+2*_ot.noteMargin),c.startx=a+(n.width-c.width)/2):(c.width=Math.abs(a+n.width/2-(s+i.width/2))+_ot.actorMargin,c.startx=a2,d=o((t=>l?-t:t),"adjustValue");t.from===t.to?h=c:(t.activate&&!u&&(h+=d(_ot.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(c-=d(3)));const p=[n,i,a,s],g=Math.abs(c-h);t.wrap&&t.message&&(t.message=Pk.wrapLabel(t.message,Lr.getMax(g+2*_ot.wrapPadding,_ot.width),Sot(_ot)));const f=Pk.calculateTextDimensions(t.message,Sot(_ot));return{width:Lr.getMax(t.wrap?0:f.width+2*_ot.wrapPadding,g+2*_ot.wrapPadding,_ot.width),height:0,startx:c,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}}),"buildMessageModel"),Yot=o((async function(t,e,r,n){const i={},a=[];let s,o,l;for(const r of t){switch(r.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:r.message&&(s=a.pop(),i[s.id]=s,i[r.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const t=e.get(r.from?r.from:r.to.actor),n=Pot(r.from?r.from:r.to.actor).length,i=t.x+t.width/2+(n-1)*_ot.activationWidth/2,a={startx:i,stopx:i+_ot.activationWidth,actor:r.from,enabled:!0};Eot.activations.push(a)}break;case n.db.LINETYPE.ACTIVE_END:{const t=Eot.activations.map((t=>t.actor)).lastIndexOf(r.from);Eot.activations.splice(t,1).splice(0,1)}}void 0!==r.placement?(o=await jot(r,e,n),r.noteModel=o,a.forEach((t=>{s=t,s.from=Lr.getMin(s.from,o.startx),s.to=Lr.getMax(s.to,o.startx+o.width),s.width=Lr.getMax(s.width,Math.abs(s.from-s.to))-_ot.labelBoxWidth}))):(l=Wot(r,e,n),r.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach((t=>{if(s=t,l.startx===l.stopx){const t=e.get(r.from),n=e.get(r.to);s.from=Lr.getMin(t.x-l.width/2,t.x-t.width/2,s.from),s.to=Lr.getMax(n.x+l.width/2,n.x+t.width/2,s.to),s.width=Lr.getMax(s.width,Math.abs(s.to-s.from))-_ot.labelBoxWidth}else s.from=Lr.getMin(l.startx,s.from),s.to=Lr.getMax(l.stopx,s.to),s.width=Lr.getMax(s.width,l.width)-_ot.labelBoxWidth})))}return Eot.activations=[],y.debug("Loop type widths:",i),i}),"calculateLoopBounds"),Hot={parser:Gst,get db(){return new Yst},renderer:{bounds:Eot,drawActors:Mot,drawActorsPopup:Dot,setConf:Oot,draw:zot},styles:Hst,init:o((t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,Jr({sequence:{wrap:t.wrap}}))}),"init")},Vot=Object.freeze({__proto__:null,diagram:Hot}),Xot=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,42],s=[1,26],l=[1,24],c=[1,25],h=[1,32],u=[1,33],d=[1,34],p=[1,45],g=[1,35],f=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],w=[1,30],k=[1,31],T=[1,44],_=[1,46],E=[1,43],C=[1,47],S=[1,9],A=[1,8,9],L=[1,58],N=[1,59],I=[1,60],R=[1,61],M=[1,62],D=[1,63],O=[1,64],P=[1,8,9,41],B=[1,76],$=[1,8,9,12,13,22,39,41,44,66,67,68,69,70,71,72,77,79],F=[1,8,9,12,13,17,20,22,39,41,44,48,58,66,67,68,69,70,71,72,77,79,84,99,101,102],z=[13,58,84,99,101,102],U=[13,58,71,72,84,99,101,102],G=[13,58,66,67,68,69,70,84,99,101,102],q=[1,98],j=[1,115],W=[1,107],Y=[1,113],H=[1,108],V=[1,109],X=[1,110],K=[1,111],Z=[1,112],Q=[1,114],J=[22,58,59,80,84,85,86,87,88,89],tt=[1,8,9,39,41,44],et=[1,8,9,22],rt=[1,143],nt=[1,8,9,59],it=[1,8,9,22,58,59,80,84,85,86,87,88,89],at={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,DOT:17,className:18,classLiteralName:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,CLASS:46,ANNOTATION_START:47,ANNOTATION_END:48,MEMBER:49,SEPARATOR:50,relation:51,NOTE_FOR:52,noteText:53,NOTE:54,CLASSDEF:55,classList:56,stylesOpt:57,ALPHA:58,COMMA:59,direction_tb:60,direction_bt:61,direction_rl:62,direction_lr:63,relationType:64,lineType:65,AGGREGATION:66,EXTENSION:67,COMPOSITION:68,DEPENDENCY:69,LOLLIPOP:70,LINE:71,DOTTED_LINE:72,CALLBACK:73,LINK:74,LINK_TARGET:75,CLICK:76,CALLBACK_NAME:77,CALLBACK_ARGS:78,HREF:79,STYLE:80,CSSCLASS:81,style:82,styleComponent:83,NUM:84,COLON:85,UNIT:86,SPACE:87,BRKT:88,PCT:89,commentToken:90,textToken:91,graphCodeTokens:92,textNoTagsToken:93,TAGSTART:94,TAGEND:95,"==":96,"--":97,DEFAULT:98,MINUS:99,keywords:100,UNICODE_TEXT:101,BQUOTE_STR:102,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",17:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"CLASS",47:"ANNOTATION_START",48:"ANNOTATION_END",49:"MEMBER",50:"SEPARATOR",52:"NOTE_FOR",54:"NOTE",55:"CLASSDEF",58:"ALPHA",59:"COMMA",60:"direction_tb",61:"direction_bt",62:"direction_rl",63:"direction_lr",66:"AGGREGATION",67:"EXTENSION",68:"COMPOSITION",69:"DEPENDENCY",70:"LOLLIPOP",71:"LINE",72:"DOTTED_LINE",73:"CALLBACK",74:"LINK",75:"LINK_TARGET",76:"CLICK",77:"CALLBACK_NAME",78:"CALLBACK_ARGS",79:"HREF",80:"STYLE",81:"CSSCLASS",84:"NUM",85:"COLON",86:"UNIT",87:"SPACE",88:"BRKT",89:"PCT",92:"graphCodeTokens",94:"TAGSTART",95:"TAGEND",96:"==",97:"--",98:"DEFAULT",99:"MINUS",100:"keywords",101:"UNICODE_TEXT",102:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,3],[15,2],[18,1],[18,3],[18,1],[18,2],[18,2],[18,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,6],[43,2],[43,3],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[56,1],[56,3],[32,1],[32,1],[32,1],[32,1],[51,3],[51,2],[51,2],[51,1],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[57,1],[57,3],[82,1],[82,2],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[93,1],[93,1],[93,1],[93,1],[16,1],[16,1],[16,1],[16,1],[19,1],[53,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 8:this.$=a[o-1];break;case 9:case 12:case 14:this.$=a[o];break;case 10:case 13:this.$=a[o-2]+"."+a[o];break;case 11:case 15:case 95:this.$=a[o-1]+a[o];break;case 16:case 17:this.$=a[o-1]+"~"+a[o]+"~";break;case 18:n.addRelation(a[o]);break;case 19:a[o-1].title=n.cleanupLabel(a[o]),n.addRelation(a[o-1]);break;case 30:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 31:case 32:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 33:n.addClassesToNamespace(a[o-3],a[o-1]);break;case 34:n.addClassesToNamespace(a[o-4],a[o-1]);break;case 35:this.$=a[o],n.addNamespace(a[o]);break;case 36:case 46:case 59:case 92:this.$=[a[o]];break;case 37:this.$=[a[o-1]];break;case 38:a[o].unshift(a[o-2]),this.$=a[o];break;case 40:n.setCssClass(a[o-2],a[o]);break;case 41:n.addMembers(a[o-3],a[o-1]);break;case 42:n.setCssClass(a[o-5],a[o-3]),n.addMembers(a[o-5],a[o-1]);break;case 43:this.$=a[o],n.addClass(a[o]);break;case 44:this.$=a[o-1],n.addClass(a[o-1]),n.setClassLabel(a[o-1],a[o]);break;case 45:n.addAnnotation(a[o],a[o-2]);break;case 47:a[o].push(a[o-1]),this.$=a[o];break;case 48:case 50:case 51:break;case 49:n.addMember(a[o-1],n.cleanupLabel(a[o]));break;case 52:this.$={id1:a[o-2],id2:a[o],relation:a[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 53:this.$={id1:a[o-3],id2:a[o],relation:a[o-1],relationTitle1:a[o-2],relationTitle2:"none"};break;case 54:this.$={id1:a[o-3],id2:a[o],relation:a[o-2],relationTitle1:"none",relationTitle2:a[o-1]};break;case 55:this.$={id1:a[o-4],id2:a[o],relation:a[o-2],relationTitle1:a[o-3],relationTitle2:a[o-1]};break;case 56:n.addNote(a[o],a[o-1]);break;case 57:n.addNote(a[o]);break;case 58:this.$=a[o-2],n.defineClass(a[o-1],a[o]);break;case 60:this.$=a[o-2].concat([a[o]]);break;case 61:n.setDirection("TB");break;case 62:n.setDirection("BT");break;case 63:n.setDirection("RL");break;case 64:n.setDirection("LR");break;case 65:this.$={type1:a[o-2],type2:a[o],lineType:a[o-1]};break;case 66:this.$={type1:"none",type2:a[o],lineType:a[o-1]};break;case 67:this.$={type1:a[o-1],type2:"none",lineType:a[o]};break;case 68:this.$={type1:"none",type2:"none",lineType:a[o]};break;case 69:this.$=n.relationType.AGGREGATION;break;case 70:this.$=n.relationType.EXTENSION;break;case 71:this.$=n.relationType.COMPOSITION;break;case 72:this.$=n.relationType.DEPENDENCY;break;case 73:this.$=n.relationType.LOLLIPOP;break;case 74:this.$=n.lineType.LINE;break;case 75:this.$=n.lineType.DOTTED_LINE;break;case 76:case 82:this.$=a[o-2],n.setClickEvent(a[o-1],a[o]);break;case 77:case 83:this.$=a[o-3],n.setClickEvent(a[o-2],a[o-1]),n.setTooltip(a[o-2],a[o]);break;case 78:this.$=a[o-2],n.setLink(a[o-1],a[o]);break;case 79:this.$=a[o-3],n.setLink(a[o-2],a[o-1],a[o]);break;case 80:this.$=a[o-3],n.setLink(a[o-2],a[o-1]),n.setTooltip(a[o-2],a[o]);break;case 81:this.$=a[o-4],n.setLink(a[o-3],a[o-2],a[o]),n.setTooltip(a[o-3],a[o-1]);break;case 84:this.$=a[o-3],n.setClickEvent(a[o-2],a[o-1],a[o]);break;case 85:this.$=a[o-4],n.setClickEvent(a[o-3],a[o-2],a[o-1]),n.setTooltip(a[o-3],a[o]);break;case 86:this.$=a[o-3],n.setLink(a[o-2],a[o]);break;case 87:this.$=a[o-4],n.setLink(a[o-3],a[o-1],a[o]);break;case 88:this.$=a[o-4],n.setLink(a[o-3],a[o-1]),n.setTooltip(a[o-3],a[o]);break;case 89:this.$=a[o-5],n.setLink(a[o-4],a[o-2],a[o]),n.setTooltip(a[o-4],a[o-1]);break;case 90:this.$=a[o-2],n.setCssStyle(a[o-1],a[o]);break;case 91:n.setCssClass(a[o-1],a[o]);break;case 93:a[o-2].push(a[o]),this.$=a[o-2]}}),"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,47:s,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(S,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,18],{22:[1,50]}),t(A,[2,20]),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),{34:[1,51]},{36:[1,52]},t(A,[2,32]),t(A,[2,48],{51:53,64:56,65:57,13:[1,54],22:[1,55],66:L,67:N,68:I,69:R,70:M,71:D,72:O}),{39:[1,65]},t(P,[2,39],{39:[1,67],44:[1,66]}),t(A,[2,50]),t(A,[2,51]),{16:68,58:p,84:T,99:_,101:E},{16:39,18:69,19:40,58:p,84:T,99:_,101:E,102:C},{16:39,18:70,19:40,58:p,84:T,99:_,101:E,102:C},{16:39,18:71,19:40,58:p,84:T,99:_,101:E,102:C},{58:[1,72]},{13:[1,73]},{16:39,18:74,19:40,58:p,84:T,99:_,101:E,102:C},{13:B,53:75},{56:77,58:[1,78]},t(A,[2,61]),t(A,[2,62]),t(A,[2,63]),t(A,[2,64]),t($,[2,12],{16:39,19:40,18:80,17:[1,79],20:[1,81],58:p,84:T,99:_,101:E,102:C}),t($,[2,14],{20:[1,82]}),{15:83,16:84,58:p,84:T,99:_,101:E},{16:39,18:85,19:40,58:p,84:T,99:_,101:E,102:C},t(F,[2,118]),t(F,[2,119]),t(F,[2,120]),t(F,[2,121]),t([1,8,9,12,13,20,22,39,41,44,66,67,68,69,70,71,72,77,79],[2,122]),t(S,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,18:21,38:22,43:23,16:39,19:40,5:86,33:e,35:r,37:n,42:i,46:a,47:s,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C}),{5:87,10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,47:s,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C},t(A,[2,19]),t(A,[2,30]),t(A,[2,31]),{13:[1,89],16:39,18:88,19:40,58:p,84:T,99:_,101:E,102:C},{51:90,64:56,65:57,66:L,67:N,68:I,69:R,70:M,71:D,72:O},t(A,[2,49]),{65:91,71:D,72:O},t(z,[2,68],{64:92,66:L,67:N,68:I,69:R,70:M}),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(G,[2,74]),t(G,[2,75]),{8:[1,94],24:95,40:93,43:23,46:a},{16:96,58:p,84:T,99:_,101:E},{45:97,49:q},{48:[1,99]},{13:[1,100]},{13:[1,101]},{77:[1,102],79:[1,103]},{22:j,57:104,58:W,80:Y,82:105,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},{58:[1,116]},{13:B,53:117},t(A,[2,57]),t(A,[2,123]),{22:j,57:118,58:W,59:[1,119],80:Y,82:105,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},t(J,[2,59]),{16:39,18:120,19:40,58:p,84:T,99:_,101:E,102:C},t($,[2,15]),t($,[2,16]),t($,[2,17]),{39:[2,35]},{15:122,16:84,17:[1,121],39:[2,9],58:p,84:T,99:_,101:E},t(tt,[2,43],{11:123,12:[1,124]}),t(S,[2,7]),{9:[1,125]},t(et,[2,52]),{16:39,18:126,19:40,58:p,84:T,99:_,101:E,102:C},{13:[1,128],16:39,18:127,19:40,58:p,84:T,99:_,101:E,102:C},t(z,[2,67],{64:129,66:L,67:N,68:I,69:R,70:M}),t(z,[2,66]),{41:[1,130]},{24:95,40:131,43:23,46:a},{8:[1,132],41:[2,36]},t(P,[2,40],{39:[1,133]}),{41:[1,134]},{41:[2,46],45:135,49:q},{16:39,18:136,19:40,58:p,84:T,99:_,101:E,102:C},t(A,[2,76],{13:[1,137]}),t(A,[2,78],{13:[1,139],75:[1,138]}),t(A,[2,82],{13:[1,140],78:[1,141]}),{13:[1,142]},t(A,[2,90],{59:rt}),t(nt,[2,92],{83:144,22:j,58:W,80:Y,84:H,85:V,86:X,87:K,88:Z,89:Q}),t(it,[2,94]),t(it,[2,96]),t(it,[2,97]),t(it,[2,98]),t(it,[2,99]),t(it,[2,100]),t(it,[2,101]),t(it,[2,102]),t(it,[2,103]),t(it,[2,104]),t(A,[2,91]),t(A,[2,56]),t(A,[2,58],{59:rt}),{58:[1,145]},t($,[2,13]),{15:146,16:84,58:p,84:T,99:_,101:E},{39:[2,11]},t(tt,[2,44]),{13:[1,147]},{1:[2,4]},t(et,[2,54]),t(et,[2,53]),{16:39,18:148,19:40,58:p,84:T,99:_,101:E,102:C},t(z,[2,65]),t(A,[2,33]),{41:[1,149]},{24:95,40:150,41:[2,37],43:23,46:a},{45:151,49:q},t(P,[2,41]),{41:[2,47]},t(A,[2,45]),t(A,[2,77]),t(A,[2,79]),t(A,[2,80],{75:[1,152]}),t(A,[2,83]),t(A,[2,84],{13:[1,153]}),t(A,[2,86],{13:[1,155],75:[1,154]}),{22:j,58:W,80:Y,82:156,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},t(it,[2,95]),t(J,[2,60]),{39:[2,10]},{14:[1,157]},t(et,[2,55]),t(A,[2,34]),{41:[2,38]},{41:[1,158]},t(A,[2,81]),t(A,[2,85]),t(A,[2,87]),t(A,[2,88],{75:[1,159]}),t(nt,[2,93],{83:144,22:j,58:W,80:Y,84:H,85:V,86:X,87:K,88:Z,89:Q}),t(tt,[2,8]),t(P,[2,42]),t(A,[2,89])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,35],122:[2,11],125:[2,4],135:[2,47],146:[2,10],150:[2,38]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},st=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){case 0:return 60;case 1:return 61;case 2:return 62;case 3:return 63;case 4:case 5:case 14:case 31:case 36:case 40:case 47:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 19:case 22:case 24:case 58:case 61:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 35:return 8;case 15:case 16:return 7;case 17:case 37:case 45:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 77;case 23:return 78;case 25:return"STR";case 26:this.begin("string");break;case 27:return 80;case 28:return 55;case 29:return this.begin("namespace"),42;case 30:case 39:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:case 43:return this.popState(),41;case 34:case 44:return"EOF_IN_STRUCT";case 38:return this.begin("class"),46;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 46:return"OPEN_IN_STRUCT";case 48:return"MEMBER";case 49:return 81;case 50:return 73;case 51:return 74;case 52:return 76;case 53:return 52;case 54:return 54;case 55:return 47;case 56:return 48;case 57:return 79;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:case 65:case 66:case 67:return 75;case 68:case 69:return 67;case 70:case 71:return 69;case 72:return 68;case 73:return 66;case 74:return 70;case 75:return 71;case 76:return 72;case 77:return 22;case 78:return 44;case 79:return 99;case 80:return 17;case 81:return"PLUS";case 82:return 85;case 83:return 59;case 84:case 85:return 88;case 86:return 89;case 87:case 88:return"EQUALS";case 89:return 58;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 84;case 94:return 101;case 95:case 96:return 87;case 97:return 9}}),"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return t}();function ot(){this.yy={}}return at.lexer=st,o(ot,"Parser"),ot.prototype=at,at.Parser=ot,new ot}();Xot.parser=Xot;var Kot=Xot,Zot=["#","+","~","-",""],Qot=class{static{o(this,"ClassMember")}constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const r=hr(t,Qr());this.parseMember(r)}getDisplayDetails(){let t=this.visibility+br(this.id);"method"===this.memberType&&(t+=`(${br(this.parameters.trim())})`,this.returnType&&(t+=" : "+br(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const r=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(r){const t=r[1]?r[1].trim():"";if(Zot.includes(t)&&(this.visibility=t),this.id=r[2],this.parameters=r[3]?r[3].trim():"",e=r[4]?r[4].trim():"",this.returnType=r[5]?r[5].trim():"",""===e){const t=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(t)&&(e=t,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const r=t.length,n=t.substring(0,1),i=t.substring(r-1);Zot.includes(n)&&(this.visibility=n),/[$*]/.exec(i)&&(e=i),this.id=t.substring(""===this.visibility?0:1,""===e?r:r-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const r=`${this.visibility?"\\"+this.visibility:""}${br(this.id)}${"method"===this.memberType?`(${br(this.parameters)})${this.returnType?" : "+br(this.returnType):""}`:""}`;this.text=r.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},Jot="classId-",tlt=0,elt=o((t=>Lr.sanitizeText(t,Qr())),"sanitizeText"),rlt=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=o((t=>{let e=Ga(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Ga("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Ga(t).select("svg").selectAll("g.node").on("mouseover",(t=>{const r=Ga(t.currentTarget);if(null===r.attr("title"))return;const n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(r.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/<br\/>/g,"
    ")),r.classed("hover",!0)})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0);Ga(t.currentTarget).classed("hover",!1)}))}),"setupToolTips"),this.direction="TB",this.setAccTitle=jr,this.getAccTitle=Wr,this.setAccDescription=Yr,this.getAccDescription=Hr,this.setDiagramTitle=Vr,this.getDiagramTitle=Xr,this.getConfig=o((()=>Qr().class),"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{o(this,"ClassDB")}splitClassNameAndType(t){const e=Lr.sanitizeText(t,Qr());let r="",n=e;if(e.indexOf("~")>0){const t=e.split("~");n=elt(t[0]),r=elt(t[1])}return{className:n,type:r}}setClassLabel(t,e){const r=Lr.sanitizeText(t,Qr());e&&(e=elt(e));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=e,this.classes.get(n).text=`${e}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(t){const e=Lr.sanitizeText(t,Qr()),{className:r,type:n}=this.splitClassNameAndType(e);if(this.classes.has(r))return;const i=Lr.sanitizeText(r,Qr());this.classes.set(i,{id:i,type:n,label:i,text:`${i}${n?`<${n}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:Jot+i+"-"+tlt}),tlt++}addInterface(t,e){const r={id:`interface${this.interfaces.length}`,label:t,classId:e};this.interfaces.push(r)}lookUpDomId(t){const e=Lr.sanitizeText(t,Qr());if(this.classes.has(e))return this.classes.get(e).domId;throw new Error("Class not found: "+e)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",qr()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(t){y.debug("Adding relation: "+JSON.stringify(t));const e=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1!==this.relationType.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==this.relationType.LOLLIPOP||e.includes(t.relation.type1)?(this.addClass(t.id1),this.addClass(t.id2)):(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2="interface"+(this.interfaces.length-1)):(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1="interface"+(this.interfaces.length-1)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=Lr.sanitizeText(t.relationTitle1.trim(),Qr()),t.relationTitle2=Lr.sanitizeText(t.relationTitle2.trim(),Qr()),this.relations.push(t)}addAnnotation(t,e){const r=this.splitClassNameAndType(t).className;this.classes.get(r).annotations.push(e)}addMember(t,e){this.addClass(t);const r=this.splitClassNameAndType(t).className,n=this.classes.get(r);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?n.annotations.push(elt(t.substring(2,t.length-2))):t.indexOf(")")>0?n.methods.push(new Qot(t,"method")):t&&n.members.push(new Qot(t,"attribute"))}}addMembers(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>this.addMember(t,e))))}addNote(t,e){const r={id:`note${this.notes.length}`,class:e,text:t};this.notes.push(r)}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),elt(t.trim())}setCssClass(t,e){t.split(",").forEach((t=>{let r=t;/\d/.exec(t[0])&&(r=Jot+r);const n=this.classes.get(r);n&&(n.cssClasses+=" "+e)}))}defineClass(t,e){for(const r of t){let t=this.styleClasses.get(r);void 0===t&&(t={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,t)),e&&e.forEach((e=>{if(/color/.exec(e)){const r=e.replace("fill","bgFill");t.textStyles.push(r)}t.styles.push(e)})),this.classes.forEach((t=>{t.cssClasses.includes(r)&&t.styles.push(...e.flatMap((t=>t.split(","))))}))}}setTooltip(t,e){t.split(",").forEach((t=>{void 0!==e&&(this.classes.get(t).tooltip=elt(e))}))}getTooltip(t,e){return e&&this.namespaces.has(e)?this.namespaces.get(e).classes.get(t).tooltip:this.classes.get(t).tooltip}setLink(t,e,r){const n=Qr();t.split(",").forEach((t=>{let i=t;/\d/.exec(t[0])&&(i=Jot+i);const a=this.classes.get(i);a&&(a.link=Pk.formatUrl(e,n),"sandbox"===n.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof r?elt(r):"_blank")})),this.setCssClass(t,"clickable")}setClickEvent(t,e,r){t.split(",").forEach((t=>{this.setClickFunc(t,e,r),this.classes.get(t).haveCallback=!0})),this.setCssClass(t,"clickable")}setClickFunc(t,e,r){const n=Lr.sanitizeText(t,Qr());if("loose"!==Qr().securityLevel)return;if(void 0===e)return;const i=n;if(this.classes.has(i)){const t=this.lookUpDomId(i);let n=[];if("string"==typeof r){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{const r=document.querySelector(`[id="${t}"]`);null!==r&&r.addEventListener("click",(()=>{Pk.runFunc(e,...n)}),!1)}))}}bindFunctions(t){this.functions.forEach((e=>{e(t)}))}getDirection(){return this.direction}setDirection(t){this.direction=t}addNamespace(t){this.namespaces.has(t)||(this.namespaces.set(t,{id:t,classes:new Map,children:{},domId:Jot+t+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,e){if(this.namespaces.has(t))for(const r of e){const{className:e}=this.splitClassNameAndType(r);this.classes.get(e).parent=t,this.namespaces.get(t).classes.set(e,this.classes.get(e))}}setCssStyle(t,e){const r=this.classes.get(t);if(e&&r)for(const t of e)t.includes(",")?r.styles.push(...t.split(",")):r.styles.push(t)}getArrowMarker(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}getData(){const t=[],e=[],r=Qr();for(const e of this.namespaces.keys()){const n=this.namespaces.get(e);if(n){const e={id:n.id,label:n.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:r.look};t.push(e)}}for(const e of this.classes.keys()){const n=this.classes.get(e);if(n){const e=n;e.parentId=n.parent,e.look=r.look,t.push(e)}}let n=0;for(const i of this.notes){n++;const a={id:i.id,label:i.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look};t.push(a);const s=this.classes.get(i.class)?.id??"";if(s){const t={id:`edgeNote${n}`,start:i.id,end:s,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};e.push(t)}}for(const e of this.interfaces){const n={id:e.id,label:e.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};t.push(n)}n=0;for(const t of this.relations){n++;const i={id:Fk(t.id1,t.id2,{prefix:"id",counter:n}),start:t.id1,end:t.id2,type:"normal",label:t.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(t.relation.type1),arrowTypeEnd:this.getArrowMarker(t.relation.type2),startLabelRight:"none"===t.relationTitle1?"":t.relationTitle1,endLabelLeft:"none"===t.relationTitle2?"":t.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:t.style||"",pattern:1==t.relation.lineType?"dashed":"solid",look:r.look};e.push(i)}return{nodes:t,edges:e,other:{},config:r,direction:this.getDirection()}}},nlt=o((t=>`g.classGroup text {\n fill: ${t.nodeBorder||t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n\n.labelBkg {\n background: ${t.mainBkg};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),ilt=o(((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const e of t.doc)"dir"===e.stmt&&(r=e.value);return r}),"getDir"),alt=o((function(t,e){return e.db.getClasses()}),"getClasses"),slt=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Qr(),o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=OA(s),o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await DA(o,l);Pk.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,"classDiagram",a?.useMaxWidth??!0)}),"draw"),olt={getClasses:alt,draw:slt,getDir:ilt},llt={parser:Kot,get db(){return new rlt},renderer:olt,styles:nlt,init:o((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},clt=Object.freeze({__proto__:null,diagram:llt}),hlt={parser:Kot,get db(){return new rlt},renderer:olt,styles:nlt,init:o((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},ult=Object.freeze({__proto__:null,diagram:hlt}),dlt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],l=[1,16],c=[1,17],h=[1,18],u=[1,19],d=[1,32],p=[1,20],g=[1,21],f=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],w=[1,29],k=[1,30],T=[1,31],_=[1,34],E=[1,35],C=[1,36],S=[1,37],A=[1,33],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],N=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],R={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 3:return n.setRootDoc(a[o]),a[o];case 4:this.$=[];break;case 5:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 6:case 7:case 12:this.$=a[o];break;case 8:this.$="nl";break;case 13:const t=a[o-1];t.description=n.trimColon(a[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:const e=n.trimColon(a[o]);this.$={stmt:"relation",state1:a[o-3],state2:a[o-1],description:e};break;case 19:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 20:var l=a[o],c=a[o-2].trim();if(a[o].match(":")){var h=a[o].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 22:this.$={stmt:"state",id:a[o],type:"fork"};break;case 23:this.$={stmt:"state",id:a[o],type:"join"};break;case 24:this.$={stmt:"state",id:a[o],type:"choice"};break;case 25:this.$={stmt:"state",id:n.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 29:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 30:case 31:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[o-1].trim(),classes:a[o].trim()};break;case 34:this.$={stmt:"style",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 35:this.$={stmt:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 36:n.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:n.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:n.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:n.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[o].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:a[o-2].trim(),classes:[a[o].trim()],type:"default",description:""}}}),"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,7]),t(L,[2,8]),t(L,[2,9]),t(L,[2,10]),t(L,[2,11]),t(L,[2,12],{14:[1,39],15:[1,40]}),t(L,[2,16]),{18:[1,41]},t(L,[2,18],{20:[1,42]}),{23:[1,43]},t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(L,[2,28]),{34:[1,48]},{36:[1,49]},t(L,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(N,[2,42],{55:[1,54]}),t(N,[2,43],{55:[1,55]}),t(L,[2,36]),t(L,[2,37]),t(L,[2,38]),t(L,[2,39]),t(L,[2,6]),t(L,[2,13]),{13:56,24:d,54:A},t(L,[2,17]),t(I,i,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(L,[2,29]),t(L,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(L,[2,14],{14:[1,67]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,68],22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(L,[2,32]),t(L,[2,33]),t(L,[2,34]),t(L,[2,35]),t(N,[2,44]),t(N,[2,45]),t(L,[2,15]),t(L,[2,19]),t(I,i,{7:72}),t(L,[2,26]),t(L,[2,27]),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,73],22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},M=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 67:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return e.yytext=e.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}}),"anonymous"),rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return t}();function D(){this.yy={}}return R.lexer=M,o(D,"Parser"),D.prototype=R,R.Parser=D,new D}();dlt.parser=dlt;var plt=dlt,glt="state",flt="relation",mlt="default",ylt="divider",vlt="fill:none",xlt="fill: #333",blt="text",wlt="normal",klt="rect",Tlt="rectWithTitle",_lt="divider",Elt="roundedWithTitle",Clt="statediagram",Slt="transition",Alt="parent",Llt="note",Nlt="----parent",Ilt=o(((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const e of t.doc)"dir"===e.stmt&&(r=e.value);return r}),"getDir"),Rlt=o((function(t,e){return e.db.getClasses()}),"getClasses"),Mlt=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Qr();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["barb"],o.diagramId=e,await DA(o,l);Pk.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,Clt,a?.useMaxWidth??!0)}),"draw"),Dlt={getClasses:Rlt,draw:Mlt,getDir:Ilt},Olt=new Map,Plt=0;function Blt(t="",e=0,r="",n="----"){return`state-${t}${null!==r&&r.length>0?`${n}${r}`:""}-${e}`}o(Blt,"stateDomId");var $lt=o(((t,e,r,n,i,a,s,o)=>{y.trace("items",e),e.forEach((e=>{switch(e.stmt){case glt:case mlt:qlt(t,e,r,n,i,a,s,o);break;case flt:{qlt(t,e.state1,r,n,i,a,s,o),qlt(t,e.state2,r,n,i,a,s,o);const l={id:"edge"+Plt,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:vlt,labelStyle:"",label:Lr.sanitizeText(e.description,Qr()),arrowheadStyle:xlt,labelpos:"c",labelType:blt,thickness:wlt,classes:Slt,look:s};i.push(l),Plt++}}}))}),"setupDoc"),Flt=o(((t,e="TB")=>{let r=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(r=e.value);return r}),"getDir");function zlt(t,e,r){if(!e.id||""===e.id||""===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach((t=>{if(r.get(t)){const n=r.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...n.styles]}})));const n=t.find((t=>t.id===e.id));n?Object.assign(n,e):t.push(e)}function Ult(t){return t?.classes?.join(" ")??""}function Glt(t){return t?.styles??[]}o(zlt,"insertOrUpdateNode"),o(Ult,"getClassesFromDbInfo"),o(Glt,"getStylesFromDbInfo");var qlt=o(((t,e,r,n,i,a,s,o)=>{const l=e.id,c=r.get(l),h=Ult(c),u=Glt(c);if(y.info("dataFetcher parsedItem",e,c,u),"root"!==l){let r=klt;!0===e.start?r="stateStart":!1===e.start&&(r="stateEnd"),e.type!==mlt&&(r=e.type),Olt.get(l)||Olt.set(l,{id:l,shape:r,description:Lr.sanitizeText(l,Qr()),cssClasses:`${h} statediagram-state`,cssStyles:u});const c=Olt.get(l);e.description&&(Array.isArray(c.description)?(c.shape=Tlt,c.description.push(e.description)):c.description?.length>0?(c.shape=Tlt,c.description===l?c.description=[e.description]:c.description=[c.description,e.description]):(c.shape=klt,c.description=e.description),c.description=Lr.sanitizeTextOrArray(c.description,Qr())),1===c.description?.length&&c.shape===Tlt&&("group"===c.type?c.shape=Elt:c.shape=klt),!c.type&&e.doc&&(y.info("Setting cluster for XCX",l,Flt(e)),c.type="group",c.isGroup=!0,c.dir=Flt(e),c.shape=e.type===ylt?_lt:Elt,c.cssClasses=`${c.cssClasses} statediagram-cluster ${a?"statediagram-cluster-alt":""}`);const d={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:Blt(l,Plt),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:s};if(d.shape===_lt&&(d.label=""),t&&"root"!==t.id&&(y.trace("Setting node ",l," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,cssClasses:"statediagram-note",cssStyles:[],cssCompilesStyles:[],id:l+"----note-"+Plt,domId:Blt(l,Plt,Llt),type:c.type,isGroup:"group"===c.type,padding:Qr().flowchart.padding,look:s,position:e.note.position},r=l+Nlt,a={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+Nlt,domId:Blt(l,Plt,Alt),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Plt++,a.id=r,t.parentId=r,zlt(n,a,o),zlt(n,t,o),zlt(n,d,o);let h=l,u=t.id;"left of"===e.note.position&&(h=t.id,u=l),i.push({id:h+"-"+u,start:h,end:u,arrowhead:"none",arrowTypeEnd:"",style:vlt,labelStyle:"",classes:"transition note-edge",arrowheadStyle:xlt,labelpos:"c",labelType:blt,thickness:wlt,look:s})}else zlt(n,d,o)}e.doc&&(y.trace("Adding nodes children "),$lt(e,e.doc,r,n,i,!a,s,o))}),"dataFetcher"),jlt=o((()=>{Olt.clear(),Plt=0}),"reset"),Wlt="[*]",Ylt="start",Hlt="color",Vlt="fill";function Xlt(){return new Map}o(Xlt,"newClassesList");var Klt,Zlt=o((()=>({relations:[],states:new Map,documents:{}})),"newDoc"),Qlt=o((t=>JSON.parse(JSON.stringify(t))),"clone"),Jlt=class{static{o(this,"StateDB")}constructor(t){this.clear(),this.version=t,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}version;nodes=[];edges=[];rootDoc=[];classes=Xlt();documents={root:Zlt()};currentDocument=this.documents.root;startEndCount=0;dividerCnt=0;static relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};setRootDoc(t){y.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc}docTranslator(t,e,r){if(e.stmt===flt)this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);else if(e.stmt===glt&&("[*]"===e.id?(e.id=r?t.id+"_start":t.id+"_end",e.start=r):e.id=e.id.trim()),e.doc){const t=[];let r,n=[];for(r=0;r0&&n.length>0){const r={stmt:glt,id:xk(),type:"divider",doc:Qlt(n)};t.push(Qlt(r)),e.doc=t}e.doc.forEach((t=>this.docTranslator(e,t,!0)))}}getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}extract(t){let e;e=t.doc?t.doc:t,y.info(e),this.clear(!0),y.info("Extract initial document:",e),e.forEach((t=>{switch(y.warn("Statement",t.stmt),t.stmt){case glt:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case flt:this.addRelation(t.state1,t.state2,t.description);break;case"classDef":this.addStyleClass(t.id.trim(),t.classes);break;case"style":{const e=t.id.trim().split(","),r=t.styleClass.split(",");e.forEach((t=>{let e=this.getState(t);if(void 0===e){const r=t.trim();this.addState(r),e=this.getState(r)}e.styles=r.map((t=>t.replace(/;/g,"")?.trim()))}))}break;case"applyClass":this.setCssClass(t.id.trim(),t.styleClass)}}));const r=this.getStates(),n=Qr().look;jlt(),qlt(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n,this.classes),this.nodes.forEach((t=>{if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]");t.label=t.label[0]}}))}addState(t,e="default",r=null,n=null,i=null,a=null,s=null,o=null){const l=t?.trim();if(this.currentDocument.states.has(l)?(this.currentDocument.states.get(l).doc||(this.currentDocument.states.get(l).doc=r),this.currentDocument.states.get(l).type||(this.currentDocument.states.get(l).type=e)):(y.info("Adding state ",l,n),this.currentDocument.states.set(l,{id:l,descriptions:[],type:e,doc:r,note:i,classes:[],styles:[],textStyles:[]})),n&&(y.info("Setting state description",l,n),"string"==typeof n&&this.addDescription(l,n.trim()),"object"==typeof n&&n.forEach((t=>this.addDescription(l,t.trim())))),i){const t=this.currentDocument.states.get(l);t.note=i,t.note.text=Lr.sanitizeText(t.note.text,Qr())}if(a){y.info("Setting state classes",l,a);("string"==typeof a?[a]:a).forEach((t=>this.setCssClass(l,t.trim())))}if(s){y.info("Setting state styles",l,s);("string"==typeof s?[s]:s).forEach((t=>this.setStyle(l,t.trim())))}if(o){y.info("Setting state styles",l,s);("string"==typeof o?[o]:o).forEach((t=>this.setTextStyle(l,t.trim())))}}clear(t){this.nodes=[],this.edges=[],this.documents={root:Zlt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Xlt(),t||qr()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){y.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(t=""){let e=t;return t===Wlt&&(this.startEndCount++,e=`start${this.startEndCount}`),e}startTypeIfNeeded(t="",e="default"){return t===Wlt?Ylt:e}endIdIfNeeded(t=""){let e=t;return"[*]"===t&&(this.startEndCount++,e=`end${this.startEndCount}`),e}endTypeIfNeeded(t="",e="default"){return"[*]"===t?"end":e}addRelationObjs(t,e,r){let n=this.startIdIfNeeded(t.id.trim()),i=this.startTypeIfNeeded(t.id.trim(),t.type),a=this.startIdIfNeeded(e.id.trim()),s=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(n,i,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:n,id2:a,relationTitle:Lr.sanitizeText(r,Qr())})}addRelation(t,e,r){if("object"==typeof t)this.addRelationObjs(t,e,r);else{const n=this.startIdIfNeeded(t.trim()),i=this.startTypeIfNeeded(t),a=this.endIdIfNeeded(e.trim()),s=this.endTypeIfNeeded(e);this.addState(n,i),this.addState(a,s),this.currentDocument.relations.push({id1:n,id2:a,title:Lr.sanitizeText(r,Qr())})}}addDescription(t,e){const r=this.currentDocument.states.get(t),n=e.startsWith(":")?e.replace(":","").trim():e;r.descriptions.push(Lr.sanitizeText(n,Qr()))}cleanupLabel(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const r=this.classes.get(t);null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(Hlt).exec(t)){const t=e.replace(Vlt,"bgFill").replace(Hlt,Vlt);r.textStyles.push(t)}r.styles.push(e)}))}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach((t=>{let r=this.getState(t);if(void 0===r){const e=t.trim();this.addState(e),r=this.getState(e)}r.classes.push(e)}))}setStyle(t,e){const r=this.getState(t);void 0!==r&&r.styles.push(e)}setTextStyle(t,e){const r=this.getState(t);void 0!==r&&r.textStyles.push(e)}getDirectionStatement(){return this.rootDoc.find((t=>"dir"===t.stmt))}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t&&":"===t[0]?t.substr(1).trim():t.trim()}getData(){const t=Qr();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Ilt(this.getRootDocV2())}}getConfig(){return Qr().state}getAccTitle=Wr;setAccTitle=jr;getAccDescription=Hr;setAccDescription=Yr;setDiagramTitle=Vr;getDiagramTitle=Xr},tct=o((t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),ect={},rct=o(((t,e)=>{ect[t]=e}),"set"),nct=o((t=>ect[t]),"get"),ict=o((()=>Object.keys(ect)),"keys"),act=o((()=>ict().length),"size"),sct={get:nct,set:rct,keys:ict,size:act},oct=o((t=>t.append("circle").attr("class","start-state").attr("r",Qr().state.sizeUnit).attr("cx",Qr().state.padding+Qr().state.sizeUnit).attr("cy",Qr().state.padding+Qr().state.sizeUnit)),"drawStartState"),lct=o((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Qr().state.textHeight).attr("class","divider").attr("x2",2*Qr().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),cct=o(((t,e)=>{const r=t.append("text").attr("x",2*Qr().state.padding).attr("y",Qr().state.textHeight+2*Qr().state.padding).attr("font-size",Qr().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Qr().state.padding).attr("y",Qr().state.padding).attr("width",n.width+2*Qr().state.padding).attr("height",n.height+2*Qr().state.padding).attr("rx",Qr().state.radius),r}),"drawSimpleState"),hct=o(((t,e)=>{const r=o((function(t,e,r){const n=t.append("tspan").attr("x",2*Qr().state.padding).text(e);r||n.attr("dy",Qr().state.textHeight)}),"addTspan"),n=t.append("text").attr("x",2*Qr().state.padding).attr("y",Qr().state.textHeight+1.3*Qr().state.padding).attr("font-size",Qr().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=n.height,a=t.append("text").attr("x",Qr().state.padding).attr("y",i+.4*Qr().state.padding+Qr().state.dividerMargin+Qr().state.textHeight).attr("class","state-description");let s=!0,l=!0;e.descriptions.forEach((function(t){s||(r(a,t,l),l=!1),s=!1}));const c=t.append("line").attr("x1",Qr().state.padding).attr("y1",Qr().state.padding+i+Qr().state.dividerMargin/2).attr("y2",Qr().state.padding+i+Qr().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),u=Math.max(h.width,n.width);return c.attr("x2",u+3*Qr().state.padding),t.insert("rect",":first-child").attr("x",Qr().state.padding).attr("y",Qr().state.padding).attr("width",u+2*Qr().state.padding).attr("height",h.height+i+2*Qr().state.padding).attr("rx",Qr().state.radius),t}),"drawDescrState"),uct=o(((t,e,r)=>{const n=Qr().state.padding,i=2*Qr().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Qr().state.titleShift).attr("font-size",Qr().state.fontSize).attr("class","state-title").text(e.id),c=l.node().getBBox().width+i;let h,u=Math.max(c,s);u===s&&(u+=i);const d=t.node().getBBox();e.doc,h=o-n,c>s&&(h=(s-u)/2+n),Math.abs(o-d.x)s&&(h=o-(c-s)/2);const p=1-Qr().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",p).attr("class",r?"alt-composit":"composit").attr("width",u).attr("height",d.height+Qr().state.textHeight+Qr().state.titleShift+1).attr("rx","0"),l.attr("x",h+n),c<=s&&l.attr("x",o+(u-i)/2-c/2+n),t.insert("rect",":first-child").attr("x",h).attr("y",Qr().state.titleShift-Qr().state.textHeight-Qr().state.padding).attr("width",u).attr("height",3*Qr().state.textHeight).attr("rx",Qr().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",Qr().state.titleShift-Qr().state.textHeight-Qr().state.padding).attr("width",u).attr("height",d.height+3+2*Qr().state.textHeight).attr("rx",Qr().state.radius),t}),"addTitleAndBox"),dct=o((t=>(t.append("circle").attr("class","end-state-outer").attr("r",Qr().state.sizeUnit+Qr().state.miniPadding).attr("cx",Qr().state.padding+Qr().state.sizeUnit+Qr().state.miniPadding).attr("cy",Qr().state.padding+Qr().state.sizeUnit+Qr().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Qr().state.sizeUnit).attr("cx",Qr().state.padding+Qr().state.sizeUnit+2).attr("cy",Qr().state.padding+Qr().state.sizeUnit+2))),"drawEndState"),pct=o(((t,e)=>{let r=Qr().state.forkWidth,n=Qr().state.forkHeight;if(e.parentId){let t=r;r=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Qr().state.padding).attr("y",Qr().state.padding)}),"drawForkJoinState"),gct=o(((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split(Lr.lineBreakRegex);let l=1.25*Qr().state.noteMargin;for(const t of o){const n=t.trim();if(n.length>0){const t=a.append("tspan");if(t.text(n),0===l){l+=t.node().getBBox().height}i+=l,t.attr("x",e+Qr().state.noteMargin),t.attr("y",r+i+1.25*Qr().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}}),"_drawLongText"),fct=o(((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Qr().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=gct(t,0,0,n);return r.attr("height",a+2*Qr().state.noteMargin),r.attr("width",i+2*Qr().state.noteMargin),r}),"drawNote"),mct=o((function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");"start"===e.type&&oct(i),"end"===e.type&&dct(i),"fork"!==e.type&&"join"!==e.type||pct(i,e),"note"===e.type&&fct(e.note.text,i),"divider"===e.type&&lct(i),"default"===e.type&&0===e.descriptions.length&&cct(i,e),"default"===e.type&&e.descriptions.length>0&&hct(i,e);const a=i.node().getBBox();return n.width=a.width+2*Qr().state.padding,n.height=a.height+2*Qr().state.padding,sct.set(r,n),n}),"drawState"),yct=0,vct=o((function(t,e,r){const n=o((function(t){switch(t){case Jlt.relationType.AGGREGATION:return"aggregation";case Jlt.relationType.EXTENSION:return"extension";case Jlt.relationType.COMPOSITION:return"composition";case Jlt.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const i=e.points,a=gu().x((function(t){return t.x})).y((function(t){return t.y})).curve(Tu),s=t.append("path").attr("d",a(i)).attr("id","edge"+yct).attr("class","transition");let l="";if(Qr().state.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),s.attr("marker-end","url("+l+"#"+n(Jlt.relationType.DEPENDENCY)+"End)"),void 0!==r.title){const n=t.append("g").attr("class","stateLabel"),{x:i,y:a}=Pk.calcLabelPosition(e.points),s=Lr.getRows(r.title);let o=0;const l=[];let c=0,h=0;for(let t=0;t<=s.length;t++){const e=n.append("text").attr("text-anchor","middle").text(s[t]).attr("x",i).attr("y",a+o),r=e.node().getBBox();if(c=Math.max(c,r.width),h=Math.min(h,r.x),y.info(r.x,i,a+o),0===o){const t=e.node().getBBox();o=t.height,y.info("Title height",o,a)}l.push(e)}let u=o*s.length;if(s.length>1){const t=(s.length-1)*o*.5;l.forEach(((e,r)=>e.attr("y",a+r*o-t))),u=o*s.length}const d=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",i-c/2-Qr().state.padding/2).attr("y",a-u/2-Qr().state.padding/2-3.5).attr("width",c+Qr().state.padding).attr("height",u+Qr().state.padding),y.info(d)}yct++}),"drawEdge"),xct={},bct=o((function(){}),"setConf"),wct=o((function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"insertMarkers"),kct=o((function(t,e,r,n){Klt=Qr().state;const i=Qr().securityLevel;let a;"sandbox"===i&&(a=Ga("#i"+e));const s=Ga("sandbox"===i?a.nodes()[0].contentDocument.body:"body"),o="sandbox"===i?a.nodes()[0].contentDocument:document;y.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);wct(l);const c=n.db.getRootDoc();_ct(c,l,void 0,!1,s,o,n);const h=Klt.padding,u=l.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Rr(l,p,1.75*d,Klt.useMaxWidth),l.attr("viewBox",`${u.x-Klt.padding} ${u.y-Klt.padding} `+d+" "+p)}),"draw"),Tct=o((t=>t?t.length*Klt.fontSizeFactor:1),"getLabelWidth"),_ct=o(((t,e,r,n,i,a,s)=>{const o=new Cj({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l{const e=t.parentElement;let r=0,n=0;e&&(e.parentElement&&(r=e.parentElement.getBBox().width),n=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(n)&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",r-n-8)}))}else y.debug("No Node "+t+": "+JSON.stringify(o.node(t)))}));let f=g.getBBox();o.edges().forEach((function(t){void 0!==t&&void 0!==o.edge(t)&&(y.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),vct(e,o.edge(t),o.edge(t).relation))})),f=g.getBBox();const m={id:r||"root",label:r||"root",width:0,height:0};return m.width=f.width+2*Klt.padding,m.height=f.height+2*Klt.padding,y.debug("Doc rendered",m,o),m}),"renderDoc"),Ect={parser:plt,get db(){return new Jlt(1)},renderer:{setConf:bct,draw:kct},styles:tct,init:o((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},Cct=Object.freeze({__proto__:null,diagram:Ect}),Sct={parser:plt,get db(){return new Jlt(2)},renderer:Dlt,styles:tct,init:o((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},Act=Object.freeze({__proto__:null,diagram:Sct}),Lct=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],l=[1,14],c={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:n.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 12:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 13:n.addTask(a[o-1],a[o]),this.$="task"}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},h=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return t}();function u(){this.yy={}}return c.lexer=h,o(u,"Parser"),u.prototype=c,c.Parser=u,new u}();Lct.parser=Lct;var Nct=Lct,Ict="",Rct=[],Mct=[],Dct=[],Oct=o((function(){Rct.length=0,Mct.length=0,Ict="",Dct.length=0,qr()}),"clear"),Pct=o((function(t){Ict=t,Rct.push(t)}),"addSection"),Bct=o((function(){return Rct}),"getSections"),$ct=o((function(){let t=Gct();let e=0;for(;!t&&e<100;)t=Gct(),e++;return Mct.push(...Dct),Mct}),"getTasks"),Fct=o((function(){const t=[];Mct.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),zct=o((function(t,e){const r=e.substr(1).split(":");let n=0,i=[];1===r.length?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map((t=>t.trim())),s={section:Ict,type:Ict,people:a,task:t,score:n};Dct.push(s)}),"addTask"),Uct=o((function(t){const e={section:Ict,type:Ict,description:t,task:t,classes:[]};Mct.push(e)}),"addTaskOrg"),Gct=o((function(){const t=o((function(t){return Dct[t].processed}),"compileTask");let e=!0;for(const[r,n]of Dct.entries())t(r),e=e&&n.processed;return e}),"compileTasks"),qct=o((function(){return Fct()}),"getActors"),jct={getConfig:o((()=>Qr().journey),"getConfig"),clear:Oct,setDiagramTitle:Vr,getDiagramTitle:Xr,setAccTitle:jr,getAccTitle:Wr,setAccDescription:Yr,getAccDescription:Hr,addSection:Pct,getSections:Bct,getTasks:$ct,addTask:zct,addTaskOrg:Uct,getActors:qct},Wct=o((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n font-family: ${t.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),Yct=o((function(t,e){return SH(t,e)}),"drawRect"),Hct=o((function(t,e){const r=15,n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",r).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const n=lu().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function s(t){const n=lu().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),o(a,"smile"),o(s,"sad"),o(l,"ambivalent"),e.score>3?a(i):e.score<3?s(i):l(i),n}),"drawFace"),Vct=o((function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),void 0!==r.class&&r.attr("class",r.class),void 0!==e.title&&r.append("title").text(e.title),r}),"drawCircle"),Xct=o((function(t,e){return LH(t,e)}),"drawText"),Kct=o((function(t,e){function r(t,e,r,n,i){return t+","+e+" "+(t+r)+","+e+" "+(t+r)+","+(e+n-i)+" "+(t+r-1.2*i)+","+(e+n)+" "+t+","+(e+n)}o(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Xct(t,e)}),"drawLabel"),Zct=o((function(t,e,r){const n=t.append("g"),i=RH();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Yct(n,i),eht(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)}),"drawSection"),Qct=-1,Jct=o((function(t,e,r){const n=e.x+r.width/2,i=t.append("g");Qct++;i.append("line").attr("id","task"+Qct).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Hct(i,{cx:n,cy:300+30*(5-e.score),score:e.score});const a=RH();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=r.width,a.height=r.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,Yct(i,a);let s=e.x+14;e.people.forEach((t=>{const r=e.actors[t].color,n={cx:s,cy:e.y,r:7,fill:r,stroke:"#000",title:t,pos:e.actors[t].position};Vct(i,n),s+=10})),eht(r)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},r,e.colour)}),"drawTask"),tht=o((function(t,e){AH(t,e)}),"drawBackgroundRect"),eht=function(){function t(t,e,r,i,a,s,o,l){n(e.append("text").attr("x",r+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,r,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(//gi);for(let t=0;t{const i=iht[n].color,a={cx:20,cy:r,r:7,fill:i,stroke:"#000",pos:iht[n].position};rht.drawCircle(t,a);const s={x:40,y:r+7,fill:"#666",text:n,textMargin:5|e.boxTextMargin};rht.drawText(t,s),r+=20}))}o(aht,"drawActorLegend");var sht=Qr().journey,oht=sht.leftMargin,lht=o((function(t,e,r,n){const i=Qr().journey,a=Qr().securityLevel;let s;"sandbox"===a&&(s=Ga("#i"+e));const o=Ga("sandbox"===a?s.nodes()[0].contentDocument.body:"body");cht.init();const l=o.select("#"+e);rht.initGraphics(l);const c=n.db.getTasks(),h=n.db.getDiagramTitle(),u=n.db.getActors();for(const t in iht)delete iht[t];let d=0;u.forEach((t=>{iht[t]={color:i.actorColours[d%i.actorColours.length],position:d},d++})),aht(l),cht.insert(0,0,oht,50*Object.keys(iht).length),dht(l,c,0);const p=cht.getBounds();h&&l.append("text").text(h).attr("x",oht).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=p.stopy-p.starty+2*i.diagramMarginY,f=oht+p.stopx+2*i.diagramMarginX;Rr(l,g,f,i.useMaxWidth),l.append("line").attr("x1",oht).attr("y1",4*i.height).attr("x2",f-oht-4).attr("y2",4*i.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=h?70:0;l.attr("viewBox",`${p.startx} -25 ${f} ${g+m}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",g+m+25)}),"draw"),cht={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:o((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:o((function(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])}),"updateVal"),updateBounds:o((function(t,e,r,n){const i=Qr().journey,a=this;let s=0;function l(l){return o((function(o){s++;const c=a.sequenceItems.length-s+1;a.updateVal(o,"starty",e-c*i.boxMargin,Math.min),a.updateVal(o,"stopy",n+c*i.boxMargin,Math.max),a.updateVal(cht.data,"startx",t-c*i.boxMargin,Math.min),a.updateVal(cht.data,"stopx",r+c*i.boxMargin,Math.max),"activation"!==l&&(a.updateVal(o,"startx",t-c*i.boxMargin,Math.min),a.updateVal(o,"stopx",r+c*i.boxMargin,Math.max),a.updateVal(cht.data,"starty",e-c*i.boxMargin,Math.min),a.updateVal(cht.data,"stopy",n+c*i.boxMargin,Math.max))}),"updateItemBounds")}o(l,"updateFn"),this.sequenceItems.forEach(l())}),"updateBounds"),insert:o((function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(cht.data,"startx",i,Math.min),this.updateVal(cht.data,"starty",s,Math.min),this.updateVal(cht.data,"stopx",a,Math.max),this.updateVal(cht.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),bumpVerticalPos:o((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:o((function(){return this.verticalPos}),"getVerticalPos"),getBounds:o((function(){return this.data}),"getBounds")},hht=sht.sectionFills,uht=sht.sectionColours,dht=o((function(t,e,r){const n=Qr().journey;let i="";const a=r+(2*n.height+n.diagramMarginY);let s=0,o="#CCC",l="black",c=0;for(const[r,h]of e.entries()){if(i!==h.section){o=hht[s%hht.length],c=s%hht.length,l=uht[s%uht.length];let a=0;const u=h.section;for(let t=r;t(iht[e]&&(t[e]=iht[e]),t)),{});h.x=r*n.taskMargin+r*n.width+oht,h.y=a,h.width=n.diagramMarginX,h.height=n.diagramMarginY,h.colour=l,h.fill=o,h.num=c,h.actors=u,rht.drawTask(t,h,n),cht.insert(h.x,h.y,h.x+h.width+n.taskMargin,450)}}),"drawTasks"),pht={setConf:nht,draw:lht},ght={parser:Nct,db:jct,renderer:pht,styles:Wct,init:o((t=>{pht.setConf(t.journey),jct.clear()}),"init")},fht=Object.freeze({__proto__:null,diagram:ght}),mht=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,11,12,14,16,17,20,21],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],l=[1,16],c=[1,17],h={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:n.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),n.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),n.getCommonDb().setAccDescription(this.$);break;case 12:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 15:n.addTask(a[o],0,""),this.$=a[o];break;case 16:n.addEvent(a[o].substr(2)),this.$=a[o]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:14,19:15,20:l,21:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:r,12:n,14:i,16:a,17:s,18:14,19:15,20:l,21:c},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,19]},{15:[1,20]},t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,4]),t(e,[2,9]),t(e,[2,10])],defaultActions:{},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},u=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s[^:\n]+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return t}();function d(){this.yy={}}return h.lexer=u,o(d,"Parser"),d.prototype=h,h.Parser=d,new d}();mht.parser=mht;var yht=mht,vht={};h(vht,{addEvent:()=>Nht,addSection:()=>Cht,addTask:()=>Lht,addTaskOrg:()=>Iht,clear:()=>Eht,default:()=>Mht,getCommonDb:()=>_ht,getSections:()=>Sht,getTasks:()=>Aht});var xht="",bht=0,wht=[],kht=[],Tht=[],_ht=o((()=>$r),"getCommonDb"),Eht=o((function(){wht.length=0,kht.length=0,xht="",Tht.length=0,qr()}),"clear"),Cht=o((function(t){xht=t,wht.push(t)}),"addSection"),Sht=o((function(){return wht}),"getSections"),Aht=o((function(){let t=Rht();let e=0;for(;!t&&e<100;)t=Rht(),e++;return kht.push(...Tht),kht}),"getTasks"),Lht=o((function(t,e,r){const n={id:bht++,section:xht,type:xht,task:t,score:e||0,events:r?[r]:[]};Tht.push(n)}),"addTask"),Nht=o((function(t){Tht.find((t=>t.id===bht-1)).events.push(t)}),"addEvent"),Iht=o((function(t){const e={section:xht,type:xht,description:t,task:t,classes:[]};kht.push(e)}),"addTaskOrg"),Rht=o((function(){const t=o((function(t){return Tht[t].processed}),"compileTask");let e=!0;for(const[r,n]of Tht.entries())t(r),e=e&&n.processed;return e}),"compileTasks"),Mht={clear:Eht,getCommonDb:_ht,addSection:Cht,getSections:Sht,getTasks:Aht,addTask:Lht,addTaskOrg:Iht,addEvent:Nht},Dht=o((function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),void 0!==e.class&&r.attr("class",e.class),r}),"drawRect"),Oht=o((function(t,e){const r=15,n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",r).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const n=lu().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function s(t){const n=lu().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),o(a,"smile"),o(s,"sad"),o(l,"ambivalent"),e.score>3?a(i):e.score<3?s(i):l(i),n}),"drawFace"),Pht=o((function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),void 0!==r.class&&r.attr("class",r.class),void 0!==e.title&&r.append("title").text(e.title),r}),"drawCircle"),Bht=o((function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),void 0!==e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(r),n}),"drawText"),$ht=o((function(t,e){function r(t,e,r,n,i){return t+","+e+" "+(t+r)+","+e+" "+(t+r)+","+(e+n-i)+" "+(t+r-1.2*i)+","+(e+n)+" "+t+","+(e+n)}o(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Bht(t,e)}),"drawLabel"),Fht=o((function(t,e,r){const n=t.append("g"),i=jht();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Dht(n,i),Wht(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)}),"drawSection"),zht=-1,Uht=o((function(t,e,r){const n=e.x+r.width/2,i=t.append("g");zht++;i.append("line").attr("id","task"+zht).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Oht(i,{cx:n,cy:300+30*(5-e.score),score:e.score});const a=jht();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=r.width,a.height=r.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,Dht(i,a),Wht(r)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},r,e.colour)}),"drawTask"),Ght=o((function(t,e){Dht(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()}),"drawBackgroundRect"),qht=o((function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}}),"getTextObj"),jht=o((function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),Wht=function(){function t(t,e,r,i,a,s,o,l){n(e.append("text").attr("x",r+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,r,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(//gi);for(let t=0;t)/).reverse(),i=[],a=r.attr("y"),s=parseFloat(r.attr("dy")),o=r.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let s=0;se||"
    "===t)&&(i.pop(),o.text(i.join(" ").trim()),i="
    "===t?[""]:[t],o=r.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))}))}o(Hht,"wrap");var Vht=o((function(t,e,r,n){const i=r%12-1,a=t.append("g");e.section=i,a.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+i);const s=a.append("g"),o=a.append("g"),l=o.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Hht,e.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return e.height=l.height+1.1*c*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,o.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),Kht(s,e,i,n),e}),"drawNode"),Xht=o((function(t,e,r){const n=t.append("g"),i=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Hht,e.width).node().getBBox(),a=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),i.height+1.1*a*.5+e.padding}),"getVirtualNodeHeight"),Kht=o((function(t,e,r){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)}),"defaultBkg"),Zht={drawRect:Dht,drawCircle:Pht,drawSection:Fht,drawText:Bht,drawLabel:$ht,drawTask:Uht,drawBackgroundRect:Ght,getTextObj:qht,getNoteRect:jht,initGraphics:Yht,drawNode:Vht,getVirtualNodeHeight:Xht},Qht=o((function(t,e,r,n){const i=Qr(),a=i.leftMargin??50;y.debug("timeline",n.db);const s=i.securityLevel;let o;"sandbox"===s&&(o=Ga("#i"+e));const l=Ga("sandbox"===s?o.nodes()[0].contentDocument.body:"body").select("#"+e);l.append("g");const c=n.db.getTasks(),h=n.db.getCommonDb().getDiagramTitle();y.debug("task",c),Zht.initGraphics(l);const u=n.db.getSections();y.debug("sections",u);let d=0,p=0,g=0,f=0,m=50+a,v=50;f=50;let x=0,b=!0;u.forEach((function(t){const e={number:x,descr:t,section:x,width:150,padding:20,maxHeight:d},r=Zht.getVirtualNodeHeight(l,e,i);y.debug("sectionHeight before draw",r),d=Math.max(d,r+20)}));let w=0,k=0;y.debug("tasks.length",c.length);for(const[t,e]of c.entries()){const r={number:t,descr:e,section:e.section,width:150,padding:20,maxHeight:p},n=Zht.getVirtualNodeHeight(l,r,i);y.debug("taskHeight before draw",n),p=Math.max(p,n+20),w=Math.max(w,e.events.length);let a=0;for(const t of e.events){const r={descr:t,section:e.section,number:e.section,width:150,padding:20,maxHeight:50};a+=Zht.getVirtualNodeHeight(l,r,i)}k=Math.max(k,a)}y.debug("maxSectionHeight before draw",d),y.debug("maxTaskHeight before draw",p),u&&u.length>0?u.forEach((t=>{const e=c.filter((e=>e.section===t)),r={number:x,descr:t,section:x,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:d};y.debug("sectionNode",r);const n=l.append("g"),a=Zht.drawNode(n,r,x,i);y.debug("sectionNode output",a),n.attr("transform",`translate(${m}, 50)`),v+=d+50,e.length>0&&Jht(l,e,x,m,v,p,i,w,k,d,!1),m+=200*Math.max(e.length,1),v=50,x++})):(b=!1,Jht(l,c,x,m,v,p,i,w,k,d,!0));const T=l.node().getBBox();y.debug("bounds",T),h&&l.append("text").text(h).attr("x",T.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),g=b?d+p+150:p+100;l.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",g).attr("x2",T.width+3*a).attr("y2",g).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),Mr(void 0,l,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)}),"draw"),Jht=o((function(t,e,r,n,i,a,s,o,l,c,h){for(const o of e){const e={descr:o.task,section:r,number:r,width:150,padding:20,maxHeight:a};y.debug("taskNode",e);const u=t.append("g").attr("class","taskWrapper"),d=Zht.drawNode(u,e,r,s).height;if(y.debug("taskHeight after draw",d),u.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,d),o.events){const e=t.append("g").attr("class","lineWrapper");let u=a;i+=100,u+=tut(t,o.events,r,n,i,s),i-=100,e.append("line").attr("x1",n+95).attr("y1",i+a).attr("x2",n+95).attr("y2",i+a+(h?a:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}n+=200,h&&!s.timeline?.disableMulticolor&&r++}i-=10}),"drawTasks"),tut=o((function(t,e,r,n,i,a){let s=0;const o=i;i+=100;for(const o of e){const e={descr:o,section:r,number:r,width:150,padding:20,maxHeight:50};y.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),c=Zht.drawNode(l,e,r,a).height;s+=c,l.attr("transform",`translate(${n}, ${i})`),i=i+10+c}return i=o,s}),"drawEvents"),eut={setConf:o((()=>{}),"setConf"),draw:Qht},rut=o((t=>{let e="";for(let e=0;e`\n .edge {\n stroke-width: 3;\n }\n ${rut(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`),"getStyles")},iut=Object.freeze({__proto__:null,diagram:nut});function aut(t){return(aut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function out(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}),"n"),e:o((function(t){throw t}),"e"),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:o((function(){r=r.call(t)}),"s"),n:o((function(){var t=r.next();return s=t.done,t}),"n"),e:o((function(t){l=!0,a=t}),"e"),f:o((function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}),"f")}}o(aut,"_typeof"),o(sut,"_classCallCheck"),o(out,"_defineProperties"),o(lut,"_createClass"),o(cut,"_defineProperty$1"),o(hut,"_slicedToArray"),o(uut,"_toConsumableArray"),o(dut,"_arrayWithoutHoles"),o(put,"_arrayWithHoles"),o(gut,"_iterableToArray"),o(fut,"_iterableToArrayLimit"),o(mut,"_unsupportedIterableToArray"),o(yut,"_arrayLikeToArray"),o(vut,"_nonIterableSpread"),o(xut,"_nonIterableRest"),o(but,"_createForOfIteratorHelper");var wut="undefined"==typeof window?null:window,kut=wut?wut.navigator:null;wut&&wut.document;var Tut=aut(""),_ut=aut({}),Eut=aut((function(){})),Cut="undefined"==typeof HTMLElement?"undefined":aut(HTMLElement),Sut=o((function(t){return t&&t.instanceString&&Lut(t.instanceString)?t.instanceString():null}),"instanceStr"),Aut=o((function(t){return null!=t&&aut(t)==Tut}),"string"),Lut=o((function(t){return null!=t&&aut(t)===Eut}),"fn"),Nut=o((function(t){return!Put(t)&&(Array.isArray?Array.isArray(t):null!=t&&t instanceof Array)}),"array"),Iut=o((function(t){return null!=t&&aut(t)===_ut&&!Nut(t)&&t.constructor===Object}),"plainObject"),Rut=o((function(t){return null!=t&&aut(t)===_ut}),"object"),Mut=o((function(t){return null!=t&&aut(t)===aut(1)&&!isNaN(t)}),"number"),Dut=o((function(t){return Mut(t)&&Math.floor(t)===t}),"integer"),Out=o((function(t){return"undefined"===Cut?void 0:null!=t&&t instanceof HTMLElement}),"htmlElement"),Put=o((function(t){return But(t)||$ut(t)}),"elementOrCollection"),But=o((function(t){return"collection"===Sut(t)&&t._private.single}),"element"),$ut=o((function(t){return"collection"===Sut(t)&&!t._private.single}),"collection"),Fut=o((function(t){return"core"===Sut(t)}),"core"),zut=o((function(t){return"stylesheet"===Sut(t)}),"stylesheet"),Uut=o((function(t){return"event"===Sut(t)}),"event"),Gut=o((function(t){return null==t||!(""!==t&&!t.match(/^\s+$/))}),"emptyString"),qut=o((function(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement}),"domElement"),jut=o((function(t){return Iut(t)&&Mut(t.x1)&&Mut(t.x2)&&Mut(t.y1)&&Mut(t.y2)}),"boundingBox"),Wut=o((function(t){return Rut(t)&&Lut(t.then)}),"promise"),Yut=o((function(){return kut&&kut.userAgent.match(/msie|trident|edge/i)}),"ms"),Hut=o((function(t,e){e||(e=o((function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var t=[],e=0;ee?1:0}),"ascending"),tdt=o((function(t,e){return-1*Jut(t,e)}),"descending"),edt=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}o(h,"hue2rgb");var u=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(t);if(u){if((r=parseInt(u[1]))<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(n=parseFloat(u[2]))<0||n>100)return;if(n/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(a=u[4])&&((a=parseFloat(a))<0||a>1))return;if(0===n)s=l=c=Math.round(255*i);else{var d=i<.5?i*(1+n):i+n-i*n,p=2*i-d;s=Math.round(255*h(p,d,r+1/3)),l=Math.round(255*h(p,d,r)),c=Math.round(255*h(p,d,r-1/3))}e=[s,l,c,a]}return e}),"hsl2tuple"),idt=o((function(t){var e,r=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(t);if(r){e=[];for(var n=[],i=1;i<=3;i++){var a=r[i];if("%"===a[a.length-1]&&(n[i]=!0),a=parseFloat(a),n[i]&&(a=a/100*255),a<0||a>255)return;e.push(Math.floor(a))}var s=n[1]||n[2]||n[3],o=n[1]&&n[2]&&n[3];if(s&&!o)return;var l=r[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;e.push(l)}}return e}),"rgb2tuple"),adt=o((function(t){return odt[t.toLowerCase()]}),"colorname2tuple"),sdt=o((function(t){return(Nut(t)?t:null)||adt(t)||rdt(t)||idt(t)||ndt(t)}),"color2tuple"),odt={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ldt=o((function(t){for(var e=t.map,r=t.keys,n=r.length,i=0;i=e||r<0||d&&t-h>=a}function v(){var t=ydt();if(y(t))return x(t);l=setTimeout(v,m(t))}function x(t){return l=void 0,p&&n?g(t):(n=i=void 0,s)}function b(){void 0!==l&&clearTimeout(l),h=0,n=c=i=l=void 0}function w(){return void 0===l?s:x(ydt())}function k(){var t=ydt(),r=y(t);if(n=arguments,i=this,c=t,r){if(void 0===l)return f(c);if(d)return clearTimeout(l),l=setTimeout(v,e),g(c)}return void 0===l&&(l=setTimeout(v,e)),s}return e=Ydt(e)||0,udt(r)&&(u=!!r.leading,a=(d="maxWait"in r)?Hdt(Ydt(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),o(g,"invokeFunc"),o(f,"leadingEdge"),o(m,"remainingWait"),o(y,"shouldInvoke"),o(v,"timerExpired"),o(x,"trailingEdge"),o(b,"cancel"),o(w,"flush"),o(k,"debounced"),k.cancel=b,k.flush=w,k}o(Xdt,"debounce");var Kdt=Xdt,Zdt=wut?wut.performance:null,Qdt=Zdt&&Zdt.now?function(){return Zdt.now()}:function(){return Date.now()},Jdt=function(){if(wut){if(wut.requestAnimationFrame)return function(t){wut.requestAnimationFrame(t)};if(wut.mozRequestAnimationFrame)return function(t){wut.mozRequestAnimationFrame(t)};if(wut.webkitRequestAnimationFrame)return function(t){wut.webkitRequestAnimationFrame(t)};if(wut.msRequestAnimationFrame)return function(t){wut.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout((function(){t(Qdt())}),1e3/60)}}(),tpt=o((function(t){return Jdt(t)}),"requestAnimationFrame"),ept=Qdt,rpt=9261,npt=65599,ipt=5381,apt=o((function(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rpt,n=r;!(e=t.next()).done;)n=n*npt+e.value|0;return n}),"hashIterableInts"),spt=o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rpt;return e*npt+t|0}),"hashInt"),opt=o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ipt;return(e<<5)+e+t|0}),"hashIntAlt"),lpt=o((function(t,e){return 2097152*t+e}),"combineHashes"),cpt=o((function(t){return 2097152*t[0]+t[1]}),"combineHashesArray"),hpt=o((function(t,e){return[spt(t[0],e[0]),opt(t[1],e[1])]}),"hashArrays"),upt=o((function(t,e){var r={value:0,done:!1},n=0,i=t.length;return apt({next:o((function(){return n=0&&(t[n]!==e||(t.splice(n,1),!r));n--);}),"removeFromArray"),Dpt=o((function(t){t.splice(0,t.length)}),"clearArray"),Opt=o((function(t,e){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==t&&void 0!==e&&Fut(t)){var n=e.group;if(null==n&&(n=e.data&&null!=e.data.source&&null!=e.data.target?"edges":"nodes"),"nodes"===n||"edges"===n){this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:e.data||{},position:e.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!e.selected,selectable:void 0===e.selectable||!!e.selectable,locked:!!e.locked,grabbed:!1,grabbable:void 0===e.grabbable||!!e.grabbable,pannable:void 0===e.pannable?"edges"===n:!!e.pannable,active:!1,classes:new zpt,animation:{current:[],queue:[]},rscratch:{},scratch:e.scratch||{},edges:[],children:[],parent:e.parent&&e.parent.isNode()?e.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),e.renderedPosition){var a=e.renderedPosition,s=t.pan(),o=t.zoom();i.position={x:(a.x-s.x)/o,y:(a.y-s.y)/o}}var l=[];Nut(e.classes)?l=e.classes:Aut(e.classes)&&(l=e.classes.split(/\s+/));for(var c=0,h=l.length;ce?1:0}),"defaultCmp"),h=o((function(t,e,i,a,s){var o;if(null==i&&(i=0),null==s&&(s=r),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=t.length);ir;0<=r?e++:e--)c.push(e);return c}.apply(this).reverse()).length;af;0<=f?++d:--d)m.push(a(t,n));return m}),"nsmallest"),f=o((function(t,e,n,i){var a,s,o;for(null==i&&(i=r),a=t[n];n>e&&i(a,s=t[o=n-1>>1])<0;)t[n]=s,n=o;return t[n]=a}),"_siftdown"),m=o((function(t,e,n){var i,a,s,o,l;for(null==n&&(n=r),a=t.length,l=e,s=t[e],i=2*e+1;i0;){var k=v.pop(),T=m(k),_=k.id();if(d[_]=T,T!==1/0)for(var E=k.neighborhood().intersect(g),C=0;C0)for(r.unshift(e);u[i];){var a=u[i];r.unshift(a.edge),r.unshift(a.node),i=(n=a.node).id()}return s.spawn(r)}),"pathTo")}}),"dijkstra")},Vpt={kruskal:o((function(t){t=t||function(t){return 1};for(var e=this.byGroup(),r=e.nodes,n=e.edges,i=r.length,a=new Array(i),s=r,l=o((function(t){for(var e=0;e0;){if(w(),T++,h===d){for(var _=[],E=i,C=d,S=x[C];_.unshift(E),null!=S&&_.unshift(S),null!=(E=v[C]);)S=x[C=E.id()];return{found:!0,distance:p[h],path:this.spawn(_),steps:T}}f[h]=!0;for(var A=c._private.edges,L=0;LS&&(g[C]=S,v[C]=E,x[C]=w),!i){var A=E*h+_;!i&&g[A]>S&&(g[A]=S,v[A]=_,x[A]=w)}}}for(var L=0;L1&&void 0!==arguments[1]?arguments[1]:a,n=x(t),i=[],s=n;;){if(null==s)return e.spawn();var o=v(s),c=o.edge,h=o.pred;if(i.unshift(s[0]),s.same(r)&&i.length>0)break;null!=c&&i.unshift(c),s=h}return l.spawn(i)}),"pathTo"),k=0;k=0;c--){var h=l[c],u=h[1],d=h[2];(e[u]===s&&e[d]===o||e[u]===o&&e[d]===s)&&l.splice(c,1)}for(var p=0;pn;){var i=Math.floor(Math.random()*e.length);e=rgt(i,t,e),r--}return e}),"contractUntil"),igt={kargerStein:o((function(){var t=this,e=this.byGroup(),r=e.nodes,n=e.edges;n.unmergeBy((function(t){return t.isLoop()}));var i=r.length,a=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/egt);if(!(i<2)){for(var c=[],h=0;h1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=1/0,i=e;i1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=-1/0,i=e;i1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=0,i=0,a=e;a1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];n?t=t.slice(e,r):(r0&&t.splice(0,e));for(var s=0,o=t.length-1;o>=0;o--){var l=t[o];a?isFinite(l)||(t[o]=-1/0,s++):t.splice(o,1)}i&&t.sort((function(t,e){return t-e}));var c=t.length,h=Math.floor(c/2);return c%2!=0?t[h+1+s]:(t[h-1+s]+t[h+s])/2}),"median"),pgt=o((function(t){return Math.PI*t/180}),"deg2rad"),ggt=o((function(t,e){return Math.atan2(e,t)-Math.PI/2}),"getAngleFromDisp"),fgt=Math.log2||function(t){return Math.log(t)/Math.log(2)},mgt=o((function(t){return t>0?1:t<0?-1:0}),"signum"),ygt=o((function(t,e){return Math.sqrt(vgt(t,e))}),"dist"),vgt=o((function(t,e){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n}),"sqdist"),xgt=o((function(t){for(var e=t.length,r=0,n=0;n=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(null!=t.w&&null!=t.h&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}),"makeBoundingBox"),Egt=o((function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}}),"copyBoundingBox"),Cgt=o((function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0}),"clearBoundingBox"),Sgt=o((function(t,e,r){return{x1:t.x1+e,x2:t.x2+e,y1:t.y1+r,y2:t.y2+r,w:t.w,h:t.h}}),"shiftBoundingBox"),Agt=o((function(t,e){t.x1=Math.min(t.x1,e.x1),t.x2=Math.max(t.x2,e.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,e.y1),t.y2=Math.max(t.y2,e.y2),t.h=t.y2-t.y1}),"updateBoundingBox"),Lgt=o((function(t,e,r){t.x1=Math.min(t.x1,e),t.x2=Math.max(t.x2,e),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r),t.y2=Math.max(t.y2,r),t.h=t.y2-t.y1}),"expandBoundingBoxByPoint"),Ngt=o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.x1-=e,t.x2+=e,t.y1-=e,t.y2+=e,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBox"),Igt=o((function(t){var e,r,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)e=r=n=i=a[0];else if(2===a.length)e=n=a[0],i=r=a[1];else if(4===a.length){var s=hut(a,4);e=s[0],r=s[1],n=s[2],i=s[3]}return t.x1-=i,t.x2+=r,t.y1-=e,t.y2+=n,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBoxSides"),Rgt=o((function(t,e){t.x1=e.x1,t.y1=e.y1,t.x2=e.x2,t.y2=e.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1}),"assignBoundingBox"),Mgt=o((function(t,e){return!(t.x1>e.x2)&&(!(e.x1>t.x2)&&(!(t.x2e.y2)&&!(e.y1>t.y2)))))))}),"boundingBoxesIntersect"),Dgt=o((function(t,e,r){return t.x1<=e&&e<=t.x2&&t.y1<=r&&r<=t.y2}),"inBoundingBox"),Ogt=o((function(t,e){return Dgt(t,e.x,e.y)}),"pointInBoundingBox"),Pgt=o((function(t,e){return Dgt(t,e.x1,e.y1)&&Dgt(t,e.x2,e.y2)}),"boundingBoxInBoundingBox"),Bgt=o((function(t,e,r,n,i,a,s){var o,l,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",h="auto"===c?sft(i,a):c,u=i/2,d=a/2,p=(h=Math.min(h,u,d))!==u,g=h!==d;if(p){var f=r-u+h-s,m=n-d-s,y=r+u-h+s,v=m;if((o=Jgt(t,e,r,n,f,m,y,v,!1)).length>0)return o}if(g){var x=r+u+s,b=n-d+h-s,w=x,k=n+d-h+s;if((o=Jgt(t,e,r,n,x,b,w,k,!1)).length>0)return o}if(p){var T=r-u+h-s,_=n+d+s,E=r+u-h+s,C=_;if((o=Jgt(t,e,r,n,T,_,E,C,!1)).length>0)return o}if(g){var S=r-u-s,A=n-d+h-s,L=S,N=n+d-h+s;if((o=Jgt(t,e,r,n,S,A,L,N,!1)).length>0)return o}var I=r-u+h,R=n-d+h;if((l=Zgt(t,e,r,n,I,R,h+s)).length>0&&l[0]<=I&&l[1]<=R)return[l[0],l[1]];var M=r+u-h,D=n-d+h;if((l=Zgt(t,e,r,n,M,D,h+s)).length>0&&l[0]>=M&&l[1]<=D)return[l[0],l[1]];var O=r+u-h,P=n+d-h;if((l=Zgt(t,e,r,n,O,P,h+s)).length>0&&l[0]>=O&&l[1]>=P)return[l[0],l[1]];var B=r-u+h,$=n+d-h;return(l=Zgt(t,e,r,n,B,$,h+s)).length>0&&l[0]<=B&&l[1]>=$?[l[0],l[1]]:[]}),"roundRectangleIntersectLine"),$gt=o((function(t,e,r,n,i,a,s){var o=s,l=Math.min(r,i),c=Math.max(r,i),h=Math.min(n,a),u=Math.max(n,a);return l-o<=t&&t<=c+o&&h-o<=e&&e<=u+o}),"inLineVicinity"),Fgt=o((function(t,e,r,n,i,a,s,o,l){var c=Math.min(r,s,i)-l,h=Math.max(r,s,i)+l,u=Math.min(n,o,a)-l,d=Math.max(n,o,a)+l;return!(th||ed)}),"inBezierVicinity"),zgt=o((function(t,e,r,n){var i=e*e-4*t*(r-=n);if(i<0)return[];var a=Math.sqrt(i),s=2*t;return[(-e+a)/s,(-e-a)/s]}),"solveQuadratic"),Ugt=o((function(t,e,r,n,i){var a,s,o,l,c,h,u,d;return 0===t&&(t=1e-5),o=-27*(n/=t)+(e/=t)*(9*(r/=t)-e*e*2),a=(s=(3*r-e*e)/9)*s*s+(o/=54)*o,i[1]=0,u=e/3,a>0?(c=(c=o+Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),h=(h=o-Math.sqrt(a))<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-u+c+h,u+=(c+h)/2,i[4]=i[2]=-u,u=Math.sqrt(3)*(-h+c)/2,i[3]=u,void(i[5]=-u)):(i[5]=i[3]=0,0===a?(d=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3),i[0]=2*d-u,void(i[4]=i[2]=-(d+u))):(l=(s=-s)*s*s,l=Math.acos(o/Math.sqrt(l)),d=2*Math.sqrt(s),i[0]=-u+d*Math.cos(l/3),i[2]=-u+d*Math.cos((l+2*Math.PI)/3),void(i[4]=-u+d*Math.cos((l+4*Math.PI)/3))))}),"solveCubic"),Ggt=o((function(t,e,r,n,i,a,s,o){var l=[];Ugt(1*r*r-4*r*i+2*r*s+4*i*i-4*i*s+s*s+n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o,9*r*i-3*r*r-3*r*s-6*i*i+3*i*s+9*n*a-3*n*n-3*n*o-6*a*a+3*a*o,3*r*r-6*r*i+r*s-r*t+2*i*i+2*i*t-s*t+3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e,1*r*i-r*r+r*t-i*t+n*a-n*n+n*e-a*e,l);for(var c=[],h=0;h<6;h+=2)Math.abs(l[h+1])<1e-7&&l[h]>=0&&l[h]<=1&&c.push(l[h]);c.push(1),c.push(0);for(var u,d,p,g=-1,f=0;f=0?pl?(t-i)*(t-i)+(e-a)*(e-a):c-u}),"sqdistToFiniteLine"),jgt=o((function(t,e,r){for(var n,i,a,s,o=0,l=0;l=t&&t>=a||n<=t&&t<=a))continue;(t-n)/(a-n)*(s-i)+i>e&&o++}return o%2!=0}),"pointInsidePolygonPoints"),Wgt=o((function(t,e,r,n,i,a,s,o,l){var c,h=new Array(r.length);null!=o[0]?(c=Math.atan(o[1]/o[0]),o[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=o;for(var u,d=Math.cos(-c),p=Math.sin(-c),g=0;g0){var f=Vgt(h,-l);u=Hgt(f)}else u=h;return jgt(t,e,u)}),"pointInsidePolygon"),Ygt=o((function(t,e,r,n,i,a,s,o){for(var l=new Array(2*r.length),c=0;c=0&&g<=1&&m.push(g),f>=0&&f<=1&&m.push(f),0===m.length)return[];var y=m[0]*o[0]+t,v=m[0]*o[1]+e;return m.length>1?m[0]==m[1]?[y,v]:[y,v,m[1]*o[0]+t,m[1]*o[1]+e]:[y,v]}),"intersectLineCircle"),Qgt=o((function(t,e,r){return e<=t&&t<=r||r<=t&&t<=e?t:t<=e&&e<=r||r<=e&&e<=t?e:r}),"midOfThree"),Jgt=o((function(t,e,r,n,i,a,s,o,l){var c=t-i,h=r-t,u=s-i,d=e-a,p=n-e,g=o-a,f=u*d-g*c,m=h*d-p*c,y=g*h-u*p;if(0!==y){var v=f/y,x=m/y,b=-.001;return b<=v&&v<=1.001&&b<=x&&x<=1.001||l?[t+v*h,e+v*p]:[]}return 0===f||0===m?Qgt(t,r,s)===s?[s,o]:Qgt(t,r,i)===i?[i,a]:Qgt(i,s,r)===r?[r,n]:[]:[]}),"finiteLinesIntersect"),tft=o((function(t,e,r,n,i,a,s,o){var l,c,h,u,d,p,g=[],f=new Array(r.length),m=!0;if(null==a&&(m=!1),m){for(var y=0;y0){var v=Vgt(f,-o);c=Hgt(v)}else c=f}else c=r;for(var x=0;x2){for(var p=[h[0],h[1]],g=Math.pow(p[0]-t,2)+Math.pow(p[1]-e,2),f=1;fh&&(h=e)}),"set"),get:o((function(t){return c[t]}),"get")},d=0;d0?v.edgesTo(y)[0]:y.edgesTo(v)[0];var b=n(x);y=y.id(),h[y]>h[f]+b&&(h[y]=h[f]+b,d.nodes.indexOf(y)<0?d.push(y):d.updateItem(y),c[y]=0,o[y]=[]),h[y]==h[f]+b&&(c[y]=c[y]+c[f],o[y].push(f))}else for(var w=0;w0;){for(var E=r.pop(),C=0;C0&&s.push(r[o]);0!==s.length&&i.push(n.collection(s))}return i}),"assign"),Lft=o((function(t,e){for(var r=0;r5&&void 0!==arguments[5]?arguments[5]:Mft,s=n,o=0;o=2?Fft(t,e,r,0,Pft,Bft):Fft(t,e,r,0,Oft)}),"euclidean"),squaredEuclidean:o((function(t,e,r){return Fft(t,e,r,0,Pft)}),"squaredEuclidean"),manhattan:o((function(t,e,r){return Fft(t,e,r,0,Oft)}),"manhattan"),max:o((function(t,e,r){return Fft(t,e,r,-1/0,$ft)}),"max")};function Uft(t,e,r,n,i,a){var s;return s=Lut(t)?t:zft[t]||zft.euclidean,0===e&&Lut(t)?s(i,a):s(e,r,n,i,a)}zft["squared-euclidean"]=zft.squaredEuclidean,zft.squaredeuclidean=zft.squaredEuclidean,o(Uft,"clusteringDistance");var Gft=Rpt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),qft=o((function(t){return Gft(t)}),"setOptions"),jft=o((function(t,e,r,n,i){var a="kMedoids"!==i?function(t){return r[t]}:function(t){return n[t](r)},s=o((function(t){return n[t](e)}),"getQ"),l=r,c=e;return Uft(t,n.length,a,s,l,c)}),"getDist"),Wft=o((function(t,e,r){for(var n=r.length,i=new Array(n),a=new Array(n),s=new Array(e),o=null,l=0;lr)return!1}return!0}),"haveMatricesConverged"),Kft=o((function(t,e,r){for(var n=0;ni&&(i=e[l][c],a=c);s[a].push(t[l])}for(var h=0;h=i.threshold||"dendrogram"===i.mode&&1===t.length)return!1;var g,f=e[s],m=e[n[s]];g="dendrogram"===i.mode?{left:f,right:m,key:f.key}:{value:f.value.concat(m.value),key:f.key},t[f.index]=g,t.splice(m.index,1),e[f.key]=g;for(var y=0;yr[m.key][v.key]&&(a=r[m.key][v.key])):"max"===i.linkage?(a=r[f.key][v.key],r[f.key][v.key]0&&n.push(i);return n}),"findExemplars"),bmt=o((function(t,e,r){for(var n=[],i=0;is&&(a=l,s=e[i*t+l])}a>0&&n.push(a)}for(var c=0;cl&&(o=c,l=h)}r[i]=a[o]}return n=bmt(t,e,r)}),"assign"),kmt=o((function(t){for(var e,r,n,i,a,s,o=this.cy(),l=this.nodes(),c=mmt(t),h={},u=0;u=C?(S=C,C=L,A=N):L>S&&(S=L);for(var I=0;I0?1:0;T[k%c.minIterations*e+B]=$,P+=$}if(P>0&&(k>=c.minIterations-1||k==c.maxIterations-1)){for(var F=0,z=0;z1||s>1)&&(h=!0),u[e]=[],t.outgoers().forEach((function(t){t.isEdge()&&u[e].push(t.id())}))}else d[e]=[void 0,t.target().id()]})):c.forEach((function(t){var e=t.id();t.isNode()?(t.degree(!0)%2&&(r?n?h=!0:n=e:r=e),u[e]=[],t.connectedEdges().forEach((function(t){return u[e].push(t.id())}))):d[e]=[t.source().id(),t.target().id()]}));var p={found:!1,trail:void 0};if(h)return p;if(n&&r)if(l){if(i&&n!=i)return p;i=n}else{if(i&&n!=i&&r!=i)return p;i||(i=n)}else i||(i=c[0].id());var g=o((function(t){for(var e,r,n,i=t,a=[t];u[i].length;)e=u[i].shift(),r=d[e][0],i!=(n=d[e][1])?(u[n]=u[n].filter((function(t){return t!=e})),i=n):l||i==r||(u[r]=u[r].filter((function(t){return t!=e})),i=r),a.unshift(e),a.unshift(i);return a}),"walk"),f=[],m=[];for(m=g(i);1!=m.length;)0==u[m[0]].length?(f.unshift(c.getElementById(m.shift())),f.unshift(c.getElementById(m.shift()))):m=g(m.shift()).concat(m);for(var y in f.unshift(c.getElementById(m.shift())),u)if(u[y].length)return p;return p.found=!0,p.trail=this.spawn(f,!0),p}),"hierholzer")},Cmt=o((function(){var t=this,e={},r=0,n=0,i=[],a=[],s={},l=o((function(r,n){for(var s=a.length-1,o=[],l=t.spawn();a[s].x!=r||a[s].y!=n;)o.push(a.pop().edge),s--;o.push(a.pop().edge),o.forEach((function(r){var n=r.connectedNodes().intersection(t);l.merge(r),n.forEach((function(r){var n=r.id(),i=r.connectedEdges().intersection(t);l.merge(r),e[n].cutVertex?l.merge(i.filter((function(t){return t.isLoop()}))):l.merge(i)}))})),i.push(l)}),"buildComponent"),c=o((function o(c,h,u){c===u&&(n+=1),e[h]={id:r,low:r++,cutVertex:!1};var d,p,g,f,m=t.getElementById(h).connectedEdges().intersection(t);0===m.size()?i.push(t.spawn(t.getElementById(h))):m.forEach((function(t){d=t.source().id(),p=t.target().id(),(g=d===h?p:d)!==u&&(f=t.id(),s[f]||(s[f]=!0,a.push({x:h,y:g,edge:t})),g in e?e[h].low=Math.min(e[h].low,e[g].id):(o(c,g,h),e[h].low=Math.min(e[h].low,e[g].low),e[h].id<=e[g].low&&(e[h].cutVertex=!0,l(h,g))))}))}),"biconnectedSearch");t.forEach((function(t){if(t.isNode()){var r=t.id();r in e||(n=0,c(r,r),e[r].cutVertex=n>1)}}));var h=Object.keys(e).filter((function(t){return e[t].cutVertex})).map((function(e){return t.getElementById(e)}));return{cut:t.spawn(h),components:i}}),"hopcroftTarjanBiconnected"),Smt={hopcroftTarjanBiconnected:Cmt,htbc:Cmt,htb:Cmt,hopcroftTarjanBiconnectedComponents:Cmt},Amt=o((function(){var t=this,e={},r=0,n=[],i=[],a=t.spawn(t),s=o((function s(o){if(i.push(o),e[o]={index:r,low:r++,explored:!1},t.getElementById(o).connectedEdges().intersection(t).forEach((function(t){var r=t.target().id();r!==o&&(r in e||s(r),e[r].explored||(e[o].low=Math.min(e[o].low,e[r].low)))})),e[o].index===e[o].low){for(var l=t.spawn();;){var c=i.pop();if(l.merge(t.getElementById(c)),e[c].low=e[o].index,e[c].explored=!0,c===o)break}var h=l.edgesWith(l),u=l.merge(h);n.push(u),a=a.difference(u)}}),"stronglyConnectedSearch");return t.forEach((function(t){if(t.isNode()){var r=t.id();r in e||s(r)}})),{cut:a,components:n}}),"tarjanStronglyConnected"),Lmt={};[qpt,Hpt,Vpt,Kpt,Qpt,tgt,igt,dft,gft,mft,vft,Rft,amt,gmt,Tmt,Emt,Smt,{tarjanStronglyConnected:Amt,tsc:Amt,tscc:Amt,tarjanStronglyConnectedComponents:Amt}].forEach((function(t){edt(Lmt,t)}));var Nmt=o((function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))}),"api");Nmt.prototype={fulfill:o((function(t){return Imt(this,1,"fulfillValue",t)}),"fulfill"),reject:o((function(t){return Imt(this,2,"rejectReason",t)}),"reject"),then:o((function(t,e){var r=this,n=new Nmt;return r.onFulfilled.push(Dmt(t,n,"fulfill")),r.onRejected.push(Dmt(e,n,"reject")),Rmt(r),n.proxy}),"then")};var Imt=o((function(t,e,r,n){return 0===t.state&&(t.state=e,t[r]=n,Rmt(t)),t}),"deliver"),Rmt=o((function(t){1===t.state?Mmt(t,"onFulfilled",t.fulfillValue):2===t.state&&Mmt(t,"onRejected",t.rejectReason)}),"execute"),Mmt=o((function(t,e,r){if(0!==t[e].length){var n=t[e];t[e]=[];var i=o((function(){for(var t=0;t0:void 0}),"animatedImpl")}),"animated"),clearQueue:o((function(){return o((function(){var t=this,e=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var r=0;r-1}o($yt,"listCacheHas");var Fyt=$yt;function zyt(t,e){var r=this.__data__,n=Ryt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}o(zyt,"listCacheSet");var Uyt=zyt;function Gyt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t0&&this.spawn(n).updateStyle().emit("class"),e}),"classes"),addClass:o((function(t){return this.toggleClass(t,!0)}),"addClass"),hasClass:o((function(t){var e=this[0];return null!=e&&e._private.classes.has(t)}),"hasClass"),toggleClass:o((function(t,e){Nut(t)||(t=t.match(/\S+/g)||[]);for(var r=this,n=void 0===e,i=[],a=0,s=r.length;a0&&this.spawn(i).updateStyle().emit("class"),r}),"toggleClass"),removeClass:o((function(t){return this.toggleClass(t,!1)}),"removeClass"),flashClass:o((function(t,e){var r=this;if(null==e)e=250;else if(0===e)return r;return r.addClass(t),setTimeout((function(){r.removeClass(t)}),e),r}),"flashClass")};Zvt.className=Zvt.classNames=Zvt.classes;var Qvt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:Qut,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Qvt.variable="(?:[\\w-.]|(?:\\\\"+Qvt.metaChar+"))+",Qvt.className="(?:[\\w-]|(?:\\\\"+Qvt.metaChar+"))+",Qvt.value=Qvt.string+"|"+Qvt.number,Qvt.id=Qvt.variable,function(){var t,e,r;for(t=Qvt.comparatorOp.split("|"),r=0;r=0||"="!==e&&(Qvt.comparatorOp+="|\\!"+e)}();var Jvt=o((function(){return{checks:[]}}),"newQuery"),txt=0,ext=1,rxt=2,nxt=3,ixt=4,axt=5,sxt=6,oxt=7,lxt=8,cxt=9,hxt=10,uxt=11,dxt=12,pxt=13,gxt=14,fxt=15,mxt=16,yxt=17,vxt=18,xxt=19,bxt=20,wxt=[{selector:":selected",matches:o((function(t){return t.selected()}),"matches")},{selector:":unselected",matches:o((function(t){return!t.selected()}),"matches")},{selector:":selectable",matches:o((function(t){return t.selectable()}),"matches")},{selector:":unselectable",matches:o((function(t){return!t.selectable()}),"matches")},{selector:":locked",matches:o((function(t){return t.locked()}),"matches")},{selector:":unlocked",matches:o((function(t){return!t.locked()}),"matches")},{selector:":visible",matches:o((function(t){return t.visible()}),"matches")},{selector:":hidden",matches:o((function(t){return!t.visible()}),"matches")},{selector:":transparent",matches:o((function(t){return t.transparent()}),"matches")},{selector:":grabbed",matches:o((function(t){return t.grabbed()}),"matches")},{selector:":free",matches:o((function(t){return!t.grabbed()}),"matches")},{selector:":removed",matches:o((function(t){return t.removed()}),"matches")},{selector:":inside",matches:o((function(t){return!t.removed()}),"matches")},{selector:":grabbable",matches:o((function(t){return t.grabbable()}),"matches")},{selector:":ungrabbable",matches:o((function(t){return!t.grabbable()}),"matches")},{selector:":animated",matches:o((function(t){return t.animated()}),"matches")},{selector:":unanimated",matches:o((function(t){return!t.animated()}),"matches")},{selector:":parent",matches:o((function(t){return t.isParent()}),"matches")},{selector:":childless",matches:o((function(t){return t.isChildless()}),"matches")},{selector:":child",matches:o((function(t){return t.isChild()}),"matches")},{selector:":orphan",matches:o((function(t){return t.isOrphan()}),"matches")},{selector:":nonorphan",matches:o((function(t){return t.isChild()}),"matches")},{selector:":compound",matches:o((function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}),"matches")},{selector:":loop",matches:o((function(t){return t.isLoop()}),"matches")},{selector:":simple",matches:o((function(t){return t.isSimple()}),"matches")},{selector:":active",matches:o((function(t){return t.active()}),"matches")},{selector:":inactive",matches:o((function(t){return!t.active()}),"matches")},{selector:":backgrounding",matches:o((function(t){return t.backgrounding()}),"matches")},{selector:":nonbackgrounding",matches:o((function(t){return!t.backgrounding()}),"matches")}].sort((function(t,e){return tdt(t.selector,e.selector)})),kxt=function(){for(var t,e={},r=0;r0&&c.edgeCount>0)return Ept("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Ept("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Ept("The selector `"+t+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0}),"parse"),Ixt=o((function(){if(null!=this.toStringCache)return this.toStringCache;for(var t=o((function(t){return null==t?"":t}),"clean"),e=o((function(e){return Aut(e)?'"'+e+'"':t(e)}),"cleanVal"),r=o((function(t){return" "+t+" "}),"space"),n=o((function(n,a){var s=n.type,o=n.value;switch(s){case txt:var l=t(o);return l.substring(0,l.length-1);case nxt:var c=n.field,h=n.operator;return"["+c+r(t(h))+e(o)+"]";case axt:var u=n.operator,d=n.field;return"["+t(u)+d+"]";case ixt:return"["+n.field+"]";case sxt:var p=n.operator;return"[["+n.field+r(t(p))+e(o)+"]]";case oxt:return o;case lxt:return"#"+o;case cxt:return"."+o;case yxt:case fxt:return i(n.parent,a)+r(">")+i(n.child,a);case vxt:case mxt:return i(n.ancestor,a)+" "+i(n.descendant,a);case xxt:var g=i(n.left,a),f=i(n.subject,a),m=i(n.right,a);return g+(g.length>0?" ":"")+f+m;case bxt:return""}}),"checkToString"),i=o((function(t,e){return t.checks.reduce((function(r,i,a){return r+(e===t&&0===a?"$":"")+n(i,e)}),"")}),"queryToString"),a="",s=0;s1&&s=0&&(e=e.replace("!",""),h=!0),e.indexOf("@")>=0&&(e=e.replace("@",""),c=!0),(s||l||c)&&(i=s||o?""+t:"",a=""+r),c&&(t=i=i.toLowerCase(),r=a=a.toLowerCase()),e){case"*=":n=i.indexOf(a)>=0;break;case"$=":n=i.indexOf(a,i.length-a.length)>=0;break;case"^=":n=0===i.indexOf(a);break;case"=":n=t===r;break;case">":u=!0,n=t>r;break;case">=":u=!0,n=t>=r;break;case"<":u=!0,n=t0;){var c=i.shift();e(c),a.add(c.id()),s&&n(i,a,c)}return t}function Zxt(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1];return Kxt(this,t,e,Zxt)},o(Qxt,"addParent"),Xxt.forEachUp=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kxt(this,t,e,Qxt)},o(Jxt,"addParentAndChildren"),Xxt.forEachUpAndDown=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kxt(this,t,e,Jxt)},Xxt.ancestors=Xxt.parents,(Yxt=Hxt={data:Xvt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Xvt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Xvt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Xvt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Xvt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Xvt.removeData({field:"rscratch",triggerEvent:!1}),id:o((function(){var t=this[0];if(t)return t._private.data.id}),"id")}).attr=Yxt.data,Yxt.removeAttr=Yxt.removeData;var tbt,ebt,rbt=Hxt,nbt={};function ibt(t){return function(e){var r=this;if(void 0===e&&(e=!0),0!==r.length&&r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se})),minIndegree:abt("indegree",(function(t,e){return te})),minOutdegree:abt("outdegree",(function(t,e){return te}))}),edt(nbt,{totalDegree:o((function(t){for(var e=0,r=this.nodes(),n=0;n0,h=c;c&&(l=l[0]);var u=h?l.position():{x:0,y:0};return i={x:o.x-u.x,y:o.y-u.y},void 0===t?i:i[t]}for(var d=0;d0,m=f;f&&(g=g[0]);var y=m?g.position():{x:0,y:0};void 0!==e?p.position(t,e+y[t]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}),"relativePosition")},tbt.modelPosition=tbt.point=tbt.position,tbt.modelPositions=tbt.points=tbt.positions,tbt.renderedPoint=tbt.renderedPosition,tbt.relativePoint=tbt.relativePosition;var lbt,cbt,hbt=ebt;lbt=cbt={},cbt.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},cbt.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp((function(e){if(e.isParent()){var r=e._private;r.compoundBoundsClean=!1,r.bbCache=null,t||e.emitAndNotify("bounds")}})),this):this},cbt.updateCompoundBounds=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(t){if(t.isParent()){var e=t._private,r=t.children(),n="include"===t.pstyle("compound-sizing-wrt-labels").value,i={width:{val:t.pstyle("min-width").pfValue,left:t.pstyle("min-width-bias-left"),right:t.pstyle("min-width-bias-right")},height:{val:t.pstyle("min-height").pfValue,top:t.pstyle("min-height-bias-top"),bottom:t.pstyle("min-height-bias-bottom")}},a=r.boundingBox({includeLabels:n,includeOverlays:!1,useCache:!1}),s=e.position;0!==a.w&&0!==a.h||((a={w:t.pstyle("width").pfValue,h:t.pstyle("height").pfValue}).x1=s.x-a.w/2,a.x2=s.x+a.w/2,a.y1=s.y-a.h/2,a.y2=s.y+a.h/2),o(v,"computeBiasValues"),o(x,"computePaddingValues");var l=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(c=100*c/i.width.val);var h=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(h=100*h/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var d=v(i.width.val-a.w,l,c),p=d.biasDiff,g=d.biasComplementDiff,f=v(i.height.val-a.h,h,u),m=f.biasDiff,y=f.biasComplementDiff;e.autoPadding=x(a.w,a.h,t.pstyle("padding"),t.pstyle("padding-relative-to").value),e.autoWidth=Math.max(a.w,i.width.val),s.x=(-p+a.x1+a.x2+g)/2,e.autoHeight=Math.max(a.h,i.height.val),s.y=(-m+a.y1+a.y2+y)/2}function v(t,e,r){var n=0,i=0,a=e+r;return t>0&&a>0&&(n=e/a*t,i=r/a*t),{biasDiff:n,biasComplementDiff:i}}function x(t,e,r,n){if("%"!==r.units)return"px"===r.units?r.pfValue:0;switch(n){case"width":return t>0?r.pfValue*t:0;case"height":return e>0?r.pfValue*e:0;case"average":return t>0&&e>0?r.pfValue*(t+e)/2:0;case"min":return t>0&&e>0?t>e?r.pfValue*e:r.pfValue*t:0;case"max":return t>0&&e>0?t>e?r.pfValue*t:r.pfValue*e:0;default:return 0}}}o(r,"update");for(var n=0;nt.x2?n:t.x2,t.y1=rt.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)}),"updateBounds"),pbt=o((function(t,e){return null==e?t:dbt(t,e.x1,e.y1,e.x2,e.y2)}),"updateBoundsFromBox"),gbt=o((function(t,e,r){return Ppt(t,e,r)}),"prefixedProperty"),fbt=o((function(t,e,r){if(!e.cy().headless()){var n,i,a=e._private,s=a.rstyle,o=s.arrowWidth/2;if("none"!==e.pstyle(r+"-arrow-shape").value){"source"===r?(n=s.srcX,i=s.srcY):"target"===r?(n=s.tgtX,i=s.tgtY):(n=s.midX,i=s.midY);var l=a.arrowBounds=a.arrowBounds||{},c=l[r]=l[r]||{};c.x1=n-o,c.y1=i-o,c.x2=n+o,c.y2=i+o,c.w=c.x2-c.x1,c.h=c.y2-c.y1,Ngt(c,1),dbt(t,c.x1,c.y1,c.x2,c.y2)}}}),"updateBoundsFromArrow"),mbt=o((function(t,e,r){if(!e.cy().headless()){var n;n=r?r+"-":"";var i=e._private,a=i.rstyle;if(e.pstyle(n+"label").strValue){var s,l,c,h,u=e.pstyle("text-halign"),d=e.pstyle("text-valign"),p=gbt(a,"labelWidth",r),g=gbt(a,"labelHeight",r),f=gbt(a,"labelX",r),m=gbt(a,"labelY",r),y=e.pstyle(n+"text-margin-x").pfValue,v=e.pstyle(n+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle(n+"text-rotation"),w=e.pstyle("text-outline-width").pfValue,k=e.pstyle("text-border-width").pfValue/2,T=e.pstyle("text-background-padding").pfValue,_=g,E=p,C=E/2,S=_/2;if(x)s=f-C,l=f+C,c=m-S,h=m+S;else{switch(u.value){case"left":s=f-E,l=f;break;case"center":s=f-C,l=f+C;break;case"right":s=f,l=f+E}switch(d.value){case"top":c=m-_,h=m;break;case"center":c=m-S,h=m+S;break;case"bottom":c=m,h=m+_}}var A=y-Math.max(w,k)-T-2,L=y+Math.max(w,k)+T+2,N=v-Math.max(w,k)-T-2,I=v+Math.max(w,k)+T+2;s+=A,l+=L,c+=N,h+=I;var R=r||"main",M=i.labelBounds,D=M[R]=M[R]||{};D.x1=s,D.y1=c,D.x2=l,D.y2=h,D.w=l-s,D.h=h-c,D.leftPad=A,D.rightPad=L,D.topPad=N,D.botPad=I;var O=x&&"autorotate"===b.strValue,P=null!=b.pfValue&&0!==b.pfValue;if(O||P){var B=O?gbt(i.rstyle,"labelAngle",r):b.pfValue,$=Math.cos(B),F=Math.sin(B),z=(s+l)/2,U=(c+h)/2;if(!x){switch(u.value){case"left":z=l;break;case"right":z=s}switch(d.value){case"top":U=h;break;case"bottom":U=c}}var G=o((function(t,e){return{x:(t-=z)*$-(e-=U)*F+z,y:t*F+e*$+U}}),"rotate"),q=G(s,c),j=G(s,h),W=G(l,c),Y=G(l,h);s=Math.min(q.x,j.x,W.x,Y.x),l=Math.max(q.x,j.x,W.x,Y.x),c=Math.min(q.y,j.y,W.y,Y.y),h=Math.max(q.y,j.y,W.y,Y.y)}var H=R+"Rot",V=M[H]=M[H]||{};V.x1=s,V.y1=c,V.x2=l,V.y2=h,V.w=l-s,V.h=h-c,dbt(t,s,c,l,h),dbt(i.labelBounds.all,s,c,l,h)}return t}}),"updateBoundsFromLabel"),ybt=o((function(t,e){if(!e.cy().headless()){var r=e.pstyle("outline-opacity").value,n=e.pstyle("outline-width").value;if(r>0&&n>0){var i=e.pstyle("outline-offset").value,a=e.pstyle("shape").value,s=n+i,o=(t.w+2*s)/t.w,l=(t.h+2*s)/t.h,c=0;["diamond","pentagon","round-triangle"].includes(a)?(o=(t.w+2.4*s)/t.w,c=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(a)?o=(t.w+2.4*s)/t.w:"star"===a?(o=(t.w+2.8*s)/t.w,l=(t.h+2.6*s)/t.h,c=-s/3.8):"triangle"===a?(o=(t.w+2.8*s)/t.w,l=(t.h+2.4*s)/t.h,c=-s/1.4):"vee"===a&&(o=(t.w+4.4*s)/t.w,l=(t.h+3.8*s)/t.h,c=.5*-s);var h=t.h*l-t.h,u=t.w*o-t.w;if(Igt(t,[Math.ceil(h/2),Math.ceil(u/2)]),0!==c){var d=Sgt(t,0,c);Agt(t,d)}}}}),"updateBoundsFromOutline"),vbt=o((function(t,e){var r,n,i,a,s,l,c=t._private.cy,h=c.styleEnabled(),u=c.headless(),d=_gt(),p=t._private,g=t.isNode(),f=t.isEdge(),m=p.rstyle,y=g&&h?t.pstyle("bounds-expansion").pfValue:[0],v=o((function(t){return"none"!==t.pstyle("display").value}),"isDisplayed"),x=!h||v(t)&&(!f||v(t.source())&&v(t.target()));if(x){var b=0;h&&e.includeOverlays&&0!==t.pstyle("overlay-opacity").value&&(b=t.pstyle("overlay-padding").value);var w=0;h&&e.includeUnderlays&&0!==t.pstyle("underlay-opacity").value&&(w=t.pstyle("underlay-padding").value);var k=Math.max(b,w),T=0;if(h&&(T=t.pstyle("width").pfValue/2),g&&e.includeNodes){var _=t.position();s=_.x,l=_.y;var E=t.outerWidth()/2,C=t.outerHeight()/2;dbt(d,r=s-E,i=l-C,n=s+E,a=l+C),h&&e.includeOutlines&&ybt(d,t)}else if(f&&e.includeEdges)if(h&&!u){var S=t.pstyle("curve-style").strValue;if(r=Math.min(m.srcX,m.midX,m.tgtX),n=Math.max(m.srcX,m.midX,m.tgtX),i=Math.min(m.srcY,m.midY,m.tgtY),a=Math.max(m.srcY,m.midY,m.tgtY),dbt(d,r-=T,i-=T,n+=T,a+=T),"haystack"===S){var A=m.haystackPts;if(A&&2===A.length){if(r=A[0].x,i=A[0].y,r>(n=A[1].x)){var L=r;r=n,n=L}if(i>(a=A[1].y)){var N=i;i=a,a=N}dbt(d,r-T,i-T,n+T,a+T)}}else if("bezier"===S||"unbundled-bezier"===S||S.endsWith("segments")||S.endsWith("taxi")){var I;switch(S){case"bezier":case"unbundled-bezier":I=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":I=m.linePts}if(null!=I)for(var R=0;R(n=O.x)){var P=r;r=n,n=P}if((i=D.y)>(a=O.y)){var B=i;i=a,a=B}dbt(d,r-=T,i-=T,n+=T,a+=T)}if(h&&e.includeEdges&&f&&(fbt(d,t,"mid-source"),fbt(d,t,"mid-target"),fbt(d,t,"source"),fbt(d,t,"target")),h)if("yes"===t.pstyle("ghost").value){var $=t.pstyle("ghost-offset-x").pfValue,F=t.pstyle("ghost-offset-y").pfValue;dbt(d,d.x1+$,d.y1+F,d.x2+$,d.y2+F)}var z=p.bodyBounds=p.bodyBounds||{};Rgt(z,d),Igt(z,y),Ngt(z,1),h&&(r=d.x1,n=d.x2,i=d.y1,a=d.y2,dbt(d,r-k,i-k,n+k,a+k));var U=p.overlayBounds=p.overlayBounds||{};Rgt(U,d),Igt(U,y),Ngt(U,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?Cgt(G.all):G.all=_gt(),h&&e.includeLabels&&(e.includeMainLabels&&mbt(d,t,null),f&&(e.includeSourceLabels&&mbt(d,t,"source"),e.includeTargetLabels&&mbt(d,t,"target")))}return d.x1=ubt(d.x1),d.y1=ubt(d.y1),d.x2=ubt(d.x2),d.y2=ubt(d.y2),d.w=ubt(d.x2-d.x1),d.h=ubt(d.y2-d.y1),d.w>0&&d.h>0&&x&&(Igt(d,y),Ngt(d,1)),d}),"boundingBoxImpl"),xbt=o((function(t){var e=0,r=o((function(t){return(t?1:0)<0&&void 0!==arguments[0]?arguments[0]:qbt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;l--)s(l);return this},Wbt.removeAllListeners=function(){return this.removeListener("*")},Wbt.emit=Wbt.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Nut(e)||(e=[e]),Vbt(this,(function(t,a){null!=r&&(n=[{event:a.event,type:a.type,namespace:a.namespace,callback:r}],i=n.length);for(var s=o((function(r){var i=n[r];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&t.eventMatches(t.context,i,a)){var s=[a];null!=e&&Opt(s,e),t.beforeEmit(t.context,i,a),i.conf&&i.conf.one&&(t.listeners=t.listeners.filter((function(t){return t!==i})));var o=t.callbackContext(t.context,i,a),l=i.callback.apply(o,s);t.afterEmit(t.context,i,a),!1===l&&(a.stopPropagation(),a.preventDefault())}}),"_loop2"),l=0;l1&&!n){var i=this.length-1,a=this[i],s=a._private.data.id;this[i]=void 0,this[t]=a,r.set(s,{ele:a,index:t})}return this.length--,this}),"unmergeAt"),unmergeOne:o((function(t){t=t[0];var e=this._private,r=t._private.data.id,n=e.map.get(r);if(!n)return this;var i=n.index;return this.unmergeAt(i),this}),"unmergeOne"),unmerge:o((function(t){var e=this._private.cy;if(!t)return this;if(t&&Aut(t)){var r=t;t=e.mutableElements().filter(r)}for(var n=0;n=0;e--){t(this[e])&&this.unmergeAt(e)}return this}),"unmergeBy"),map:o((function(t,e){for(var r=[],n=this,i=0;in&&(n=o,r=s)}return{value:n,ele:r}}),"max"),min:o((function(t,e){for(var r,n=1/0,i=this,a=0;a=0&&i1&&void 0!==arguments[1])||arguments[1],r=this[0],n=r.cy();if(n.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,n.style().apply(r));var i=r._private.style[t];return null!=i?i:e?n.style().getDefaultProperty(t):null}}),"parsedStyle"),numericStyle:o((function(t){var e=this[0];if(e.cy().styleEnabled()&&e){var r=e.pstyle(t);return void 0!==r.pfValue?r.pfValue:r.value}}),"numericStyle"),numericStyleUnits:o((function(t){var e=this[0];if(e.cy().styleEnabled())return e?e.pstyle(t).units:void 0}),"numericStyleUnits"),renderedStyle:o((function(t){var e=this.cy();if(!e.styleEnabled())return this;var r=this[0];return r?e.style().getRenderedStyle(r,t):void 0}),"renderedStyle"),style:o((function(t,e){var r=this.cy();if(!r.styleEnabled())return this;var n=r.style();if(Iut(t)){var i=t;n.applyBypass(this,i,false),this.emitAndNotify("style")}else if(Aut(t)){if(void 0===e){var a=this[0];return a?n.getStylePropertyValue(a,t):void 0}n.applyBypass(this,t,e,false),this.emitAndNotify("style")}else if(void 0===t){var s=this[0];return s?n.getRawStyle(s):void 0}return this}),"style"),removeStyle:o((function(t){var e=this.cy();if(!e.styleEnabled())return this;var r=e.style(),n=this;if(void 0===t)for(var i=0;i0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)}),"neighborhood"),closedNeighborhood:o((function(t){return this.neighborhood().add(this).filter(t)}),"closedNeighborhood"),openNeighborhood:o((function(t){return this.neighborhood(t)}),"openNeighborhood")}),bwt.neighbourhood=bwt.neighborhood,bwt.closedNeighbourhood=bwt.closedNeighborhood,bwt.openNeighbourhood=bwt.openNeighborhood,edt(bwt,{source:Vxt(o((function(t){var e,r=this[0];return r&&(e=r._private.source||r.cy().collection()),e&&t?e.filter(t):e}),"sourceImpl"),"source"),target:Vxt(o((function(t){var e,r=this[0];return r&&(e=r._private.target||r.cy().collection()),e&&t?e.filter(t):e}),"targetImpl"),"target"),sources:_wt({attr:"source"}),targets:_wt({attr:"target"})}),o(_wt,"defineSourceFunction"),edt(bwt,{edgesWith:Vxt(Ewt(),"edgesWith"),edgesTo:Vxt(Ewt({thisIsSrc:!0}),"edgesTo")}),o(Ewt,"defineEdgesWithFunction"),edt(bwt,{connectedEdges:Vxt((function(t){for(var e=[],r=0;r0);return a}),"components"),component:o((function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}),"component")}),bwt.componentsOf=bwt.components;var Swt=o((function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t){var i=new $pt,a=!1;if(e){if(e.length>0&&Iut(e[0])&&!But(e[0])){a=!0;for(var s=[],l=new zpt,c=0,h=e.length;c0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),s=a._private,l=[],c=[],h=0,u=i.length;h0){for(var P=t.length===i.length?i:new Swt(a,t),B=0;B0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this,n=[],i={},a=r._private.cy;function s(t){for(var e=t._private.edges,r=0;r0&&(t?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var L=0;L0?i=o:n=o}while(Math.abs(a)>s&&++c=a?x(e,o):0===l?o:w(e,n,n+h)}o(g,"A"),o(f,"B"),o(m,"C"),o(y,"calcBezier"),o(v,"getSlope"),o(x,"newtonRaphsonIterate"),o(b,"calcSampleValues"),o(w,"binarySubdivide"),o(k,"getTForX");var T=!1;function _(){T=!0,t===e&&r===n||b()}o(_,"precompute");var E=o((function(i){return T||_(),t===e&&r===n?i:0===i?0:1===i?1:y(k(i),e,n)}),"f");E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var C="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return C},E}o(Nwt,"generateCubicBezier");var Iwt=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,r,n){var i={x:e.x+n.dx*r,v:e.v+n.dv*r,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function r(r,n){var i={dx:r.v,dv:t(r)},a=e(r,.5*n,i),s=e(r,.5*n,a),o=e(r,n,s),l=1/6*(i.dx+2*(a.dx+s.dx)+o.dx),c=1/6*(i.dv+2*(a.dv+s.dv)+o.dv);return r.x=r.x+l*n,r.v=r.v+c*n,r}return o(t,"springAccelerationForState"),o(e,"springEvaluateStateWithDerivative"),o(r,"springIntegrateState"),o((function t(e,n,i){var a,s,o,l={x:-1,v:0,tension:null,friction:null},c=[0],h=0,u=1e-4;for(e=parseFloat(e)||500,n=parseFloat(n)||20,i=i||null,l.tension=e,l.friction=n,s=(a=null!==i)?(h=t(e,n))/i*.016:.016;o=r(o||l,s),c.push(1+o.x),h+=16,Math.abs(o.x)>u&&Math.abs(o.v)>u;);return a?function(t){return c[t*(c.length-1)|0]}:h}),"springRK4Factory")}(),Rwt=o((function(t,e,r,n){var i=Nwt(t,e,r,n);return function(t,e,r){return t+(e-t)*i(r)}}),"cubicBezier"),Mwt={linear:o((function(t,e,r){return t+(e-t)*r}),"linear"),ease:Rwt(.25,.1,.25,1),"ease-in":Rwt(.42,0,1,1),"ease-out":Rwt(0,0,.58,1),"ease-in-out":Rwt(.42,0,.58,1),"ease-in-sine":Rwt(.47,0,.745,.715),"ease-out-sine":Rwt(.39,.575,.565,1),"ease-in-out-sine":Rwt(.445,.05,.55,.95),"ease-in-quad":Rwt(.55,.085,.68,.53),"ease-out-quad":Rwt(.25,.46,.45,.94),"ease-in-out-quad":Rwt(.455,.03,.515,.955),"ease-in-cubic":Rwt(.55,.055,.675,.19),"ease-out-cubic":Rwt(.215,.61,.355,1),"ease-in-out-cubic":Rwt(.645,.045,.355,1),"ease-in-quart":Rwt(.895,.03,.685,.22),"ease-out-quart":Rwt(.165,.84,.44,1),"ease-in-out-quart":Rwt(.77,0,.175,1),"ease-in-quint":Rwt(.755,.05,.855,.06),"ease-out-quint":Rwt(.23,1,.32,1),"ease-in-out-quint":Rwt(.86,0,.07,1),"ease-in-expo":Rwt(.95,.05,.795,.035),"ease-out-expo":Rwt(.19,1,.22,1),"ease-in-out-expo":Rwt(1,0,0,1),"ease-in-circ":Rwt(.6,.04,.98,.335),"ease-out-circ":Rwt(.075,.82,.165,1),"ease-in-out-circ":Rwt(.785,.135,.15,.86),spring:o((function(t,e,r){if(0===r)return Mwt.linear;var n=Iwt(t,e,r);return function(t,e,r){return t+(e-t)*n(r)}}),"spring"),"cubic-bezier":Rwt};function Dwt(t,e,r,n,i){if(1===n)return r;if(e===r)return r;var a=i(e,r,n);return null==t||((t.roundValue||t.color)&&(a=Math.round(a)),void 0!==t.min&&(a=Math.max(a,t.min)),void 0!==t.max&&(a=Math.min(a,t.max))),a}function Owt(t,e){return null!=t.pfValue||null!=t.value?null==t.pfValue||null!=e&&"%"===e.type.units?t.value:t.pfValue:t}function Pwt(t,e,r,n,i){var a=null!=i?i.type:null;r<0?r=0:r>1&&(r=1);var s=Owt(t,i),o=Owt(e,i);if(Mut(s)&&Mut(o))return Dwt(a,s,o,r,n);if(Nut(s)&&Nut(o)){for(var l=[],c=0;c0?("spring"===u&&d.push(s.duration),s.easingImpl=Mwt[u].apply(null,d)):s.easingImpl=Mwt[u]}var p,g=s.easingImpl;if(p=0===s.duration?1:(r-l)/s.duration,s.applying&&(p=s.progress),p<0?p=0:p>1&&(p=1),null==s.delay){var f=s.startPosition,m=s.position;if(m&&i&&!t.locked()){var y={};$wt(f.x,m.x)&&(y.x=Pwt(f.x,m.x,p,g)),$wt(f.y,m.y)&&(y.y=Pwt(f.y,m.y,p,g)),t.position(y)}var v=s.startPan,x=s.pan,b=a.pan,w=null!=x&&n;w&&($wt(v.x,x.x)&&(b.x=Pwt(v.x,x.x,p,g)),$wt(v.y,x.y)&&(b.y=Pwt(v.y,x.y,p,g)),t.emit("pan"));var k=s.startZoom,T=s.zoom,_=null!=T&&n;_&&($wt(k,T)&&(a.zoom=Tgt(a.minZoom,Pwt(k,T,p,g),a.maxZoom)),t.emit("zoom")),(w||_)&&t.emit("viewport");var E=s.style;if(E&&E.length>0&&i){for(var C=0;C=0;e--){(0,t[e])()}t.splice(0,t.length)}),"callbacks"),u=a.length-1;u>=0;u--){var d=a[u],p=d._private;p.stopped?(a.splice(u,1),p.hooked=!1,p.playing=!1,p.started=!1,h(p.frames)):(p.playing||p.applying)&&(p.playing&&p.applying&&(p.applying=!1),p.started||Fwt(0,d,t),Bwt(e,d,t,r),p.applying&&(p.applying=!1),h(p.frames),null!=p.step&&p.step(t),d.completed()&&(a.splice(u,1),p.hooked=!1,p.playing=!1,p.started=!1,h(p.completes)),l=!0)}return r||0!==a.length||0!==s.length||n.push(e),l}o(i,"stepOne");for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}o(Dwt,"getEasedValue"),o(Owt,"getValue"),o(Pwt,"ease"),o(Bwt,"step$1"),o($wt,"valid"),o(Fwt,"startAnimation"),o(zwt,"stepAll");var Uwt={animate:Xvt.animate(),animation:Xvt.animation(),animated:Xvt.animated(),clearQueue:Xvt.clearQueue(),delay:Xvt.delay(),delayAnimation:Xvt.delayAnimation(),stop:Xvt.stop(),addToAnimationPool:o((function(t){this.styleEnabled()&&this._private.aniEles.merge(t)}),"addToAnimationPool"),stopAnimationLoop:o((function(){this._private.animationsRunning=!1}),"stopAnimationLoop"),startAnimationLoop:o((function(){var t=this;if(t._private.animationsRunning=!0,t.styleEnabled()){o(r,"headlessStep");var e=t.renderer();e&&e.beforeRender?e.beforeRender(o((function(e,r){zwt(r,t)}),"rendererAnimationStep"),e.beforeRenderPriorities.animations):r()}function r(){t._private.animationsRunning&&tpt(o((function(e){zwt(e,t),r()}),"animationStep"))}}),"startAnimationLoop")},Gwt={qualifierCompare:o((function(t,e){return null==t||null==e?null==t&&null==e:t.sameText(e)}),"qualifierCompare"),eventMatches:o((function(t,e,r){var n=e.qualifier;return null==n||t!==r.target&&But(r.target)&&n.matches(r.target)}),"eventMatches"),addEventFields:o((function(t,e){e.cy=t,e.target=t}),"addEventFields"),callbackContext:o((function(t,e,r){return null!=e.qualifier?r.target:t}),"callbackContext")},qwt=o((function(t){return Aut(t)?new qxt(t):t}),"argSelector"),jwt={createEmitter:o((function(){var t=this._private;return t.emitter||(t.emitter=new jbt(Gwt,this)),this}),"createEmitter"),emitter:o((function(){return this._private.emitter}),"emitter"),on:o((function(t,e,r){return this.emitter().on(t,qwt(e),r),this}),"on"),removeListener:o((function(t,e,r){return this.emitter().removeListener(t,qwt(e),r),this}),"removeListener"),removeAllListeners:o((function(){return this.emitter().removeAllListeners(),this}),"removeAllListeners"),one:o((function(t,e,r){return this.emitter().one(t,qwt(e),r),this}),"one"),once:o((function(t,e,r){return this.emitter().one(t,qwt(e),r),this}),"once"),emit:o((function(t,e){return this.emitter().emit(t,e),this}),"emit"),emitAndNotify:o((function(t,e){return this.emit(t),this.notify(t,e),this}),"emitAndNotify")};Xvt.eventAliasesOn(jwt);var Wwt={png:o((function(t){return t=t||{},this._private.renderer.png(t)}),"png"),jpg:o((function(t){var e=this._private.renderer;return(t=t||{}).bg=t.bg||"#fff",e.jpg(t)}),"jpg")};Wwt.jpeg=Wwt.jpg;var Ywt={layout:o((function(t){var e=this;if(null!=t)if(null!=t.name){var r,n=t.name,i=e.extension("layout",n);if(null!=i)return r=Aut(t.eles)?e.$(t.eles):null!=t.eles?t.eles:e.$(),new i(edt({},t,{cy:e,eles:r}));Tpt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Tpt("A `name` must be specified to make a layout");else Tpt("Layout options must be specified to make a layout")}),"layout")};Ywt.createLayout=Ywt.makeLayout=Ywt.layout;var Hwt={notify:o((function(t,e){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var n=r.batchNotifications[t]=r.batchNotifications[t]||this.collection();null!=e&&n.merge(e)}else if(r.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(t,e)}}),"notify"),notifications:o((function(t){var e=this._private;return void 0===t?e.notificationsEnabled:(e.notificationsEnabled=!!t,this)}),"notifications"),noNotifications:o((function(t){this.notifications(!1),t(),this.notifications(!0)}),"noNotifications"),batching:o((function(){return this._private.batchCount>0}),"batching"),startBatch:o((function(){var t=this._private;return null==t.batchCount&&(t.batchCount=0),0===t.batchCount&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this}),"startBatch"),endBatch:o((function(){var t=this._private;if(0===t.batchCount)return this;if(t.batchCount--,0===t.batchCount){t.batchStyleEles.updateStyle();var e=this.renderer();Object.keys(t.batchNotifications).forEach((function(r){var n=t.batchNotifications[r];n.empty()?e.notify(r):e.notify(r,n)}))}return this}),"endBatch"),batch:o((function(t){return this.startBatch(),t(),this.endBatch(),this}),"batch"),batchData:o((function(t){var e=this;return this.batch((function(){for(var r=Object.keys(t),n=0;n0;)e.removeChild(e.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach((function(t){var e=t._private;e.rscratch={},e.rstyle={},e.animation.current=[],e.animation.queue=[]}))}),"destroyRenderer"),onRender:o((function(t){return this.on("render",t)}),"onRender"),offRender:o((function(t){return this.off("render",t)}),"offRender")};Xwt.invalidateDimensions=Xwt.resize;var Kwt={collection:o((function(t,e){return Aut(t)?this.$(t):Put(t)?t.collection():Nut(t)?(e||(e={}),new Swt(this,t,e.unique,e.removed)):new Swt(this)}),"collection"),nodes:o((function(t){var e=this.$((function(t){return t.isNode()}));return t?e.filter(t):e}),"nodes"),edges:o((function(t){var e=this.$((function(t){return t.isEdge()}));return t?e.filter(t):e}),"edges"),$:o((function(t){var e=this._private.elements;return t?e.filter(t):e.spawnSelf()}),"$"),mutableElements:o((function(){return this._private.elements}),"mutableElements")};Kwt.elements=Kwt.filter=Kwt.$;var Zwt={},Qwt="t";Zwt.apply=function(t){for(var e=this,r=e._private.cy.collection(),n=0;n0;if(d||u&&p){var g=void 0;d&&p||d?g=c.properties:p&&(g=c.mappedProperties);for(var f=0;f1&&(y=1),l.color){var k=i.valueMin[0],T=i.valueMax[0],_=i.valueMin[1],E=i.valueMax[1],C=i.valueMin[2],S=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],L=null==i.valueMax[3]?1:i.valueMax[3],N=[Math.round(k+(T-k)*y),Math.round(_+(E-_)*y),Math.round(C+(S-C)*y),Math.round(A+(L-A)*y)];r={bypass:i.bypass,name:i.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else{if(!l.number)return!1;var I=i.valueMin+(i.valueMax-i.valueMin)*y;r=this.parse(i.name,I,i.bypass,p)}if(!r)return m(),!1;r.mapping=i,i=r;break;case s.data:for(var R=i.field.split("."),M=d.data,D=0;D0&&a>0){for(var o={},l=!1,c=0;c0?t.delayAnimation(s).play().promise().then(e):e()})).then((function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1}))}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Zwt.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);null!=o&&o(r,n)&&a(s)},Zwt.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,(function(t){return t.triggersZOrder}),(function(){i._private.cy.notify("zorder",t)}))},Zwt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,(function(t){return t.triggersBounds}),(function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==e||"bezier"!==r&&"bezier"!==n||t.parallelEdges().forEach((function(t){t.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==e||"none"!==r&&"none"!==n||t.connectedEdges().forEach((function(t){t.dirtyBoundingBoxCache()}))}))},Zwt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var Jwt={applyBypass:function(t,e,r,n){var i=[];if("*"===e||"**"===e){if(void 0!==r)for(var a=0;ae.length?a.substr(e.length):""}function l(){r=r.length>n.length?r.substr(n.length):""}for(a=a.replace(/[/][*](\s|.)+?[*][/]/g,""),o(s,"removeSelAndBlockFromRemaining"),o(l,"removePropAndValFromRem");;){if(a.match(/^\s*$/))break;var c=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Ept("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}e=c[0];var h=c[1];if("core"!==h)if(new qxt(h).invalid){Ept("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),s();continue}var u=c[2],d=!1;r=u;for(var p=[];;){if(r.match(/^\s*$/))break;var g=r.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Ept("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),d=!0;break}n=g[0];var f=g[1],m=g[2];if(this.properties[f])i.parse(f,m)?(p.push({name:f,val:m}),l()):(Ept("Skipping property: Invalid property definition in: "+n),l());else Ept("Skipping property: Invalid property name in: "+n),l()}if(d){s();break}i.selector(h);for(var y=0;y=7&&"d"===e[0]&&(h=new RegExp(l.data.regex).exec(e))){if(r)return!1;var p=l.data;return{name:t,value:h,strValue:""+e,mapped:p,field:h[1],bypass:r}}if(e.length>=10&&"m"===e[0]&&(u=new RegExp(l.mapData.regex).exec(e))){if(r)return!1;if(d.multiple)return!1;var g=l.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(t,u[4]);if(!f||f.mapped)return!1;var m=this.parse(t,u[5]);if(!m||m.mapped)return!1;if(f.pfValue===m.pfValue||f.strValue===m.strValue)return Ept("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+f.strValue+"`"),this.parse(t,f.strValue);if(d.color){var y=f.value,v=m.value;if(!(y[0]!==v[0]||y[1]!==v[1]||y[2]!==v[2]||y[3]!==v[3]&&(null!=y[3]&&1!==y[3]||null!=v[3]&&1!==v[3])))return!1}return{name:t,value:u,strValue:""+e,mapped:g,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:f.value,valueMax:m.value,bypass:r}}}if(d.multiple&&"multiple"!==n){var x;if(x=c?e.split(/\s+/):Nut(e)?e:[e],d.evenMultiple&&x.length%2!=0)return null;for(var b=[],w=[],k=[],T="",_=!1,E=0;E0?" ":"")+C.strValue}return d.validate&&!d.validate(b,w)?null:d.singleEnum&&_?1===b.length&&Aut(b[0])?{name:t,value:b[0],strValue:b[0],bypass:r}:null:{name:t,value:b,pfValue:k,strValue:T,bypass:r,units:w}}var S=o((function(){for(var n=0;nd.max||d.strictMax&&e===d.max))return null;var R={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:r};return d.unitless||"px"!==A&&"em"!==A?R.pfValue=e:R.pfValue="px"!==A&&A?this.getEmSizeInPixels()*e:e,"ms"!==A&&"s"!==A||(R.pfValue="ms"===A?e:1e3*e),"deg"!==A&&"rad"!==A||(R.pfValue="rad"===A?e:pgt(e)),"%"===A&&(R.pfValue=e/100),R}if(d.propList){var M=[],D=""+e;if("none"===D);else{for(var O=D.split(/\s*,\s*|\s+/),P=0;P0&&o>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0)return{zoom:a=(a=(a=Math.min((s-2*e)/r.w,(o-2*e)/r.h))>this._private.maxZoom?this._private.maxZoom:a)=r.minZoom&&(r.maxZoom=e),this}),"zoomRange"),minZoom:o((function(t){return void 0===t?this._private.minZoom:this.zoomRange({min:t})}),"minZoom"),maxZoom:o((function(t){return void 0===t?this._private.maxZoom:this.zoomRange({max:t})}),"maxZoom"),getZoomedViewport:o((function(t){var e,r,n=this._private,i=n.pan,a=n.zoom,s=!1;if(n.zoomingEnabled||(s=!0),Mut(t)?r=t:Iut(t)&&(r=t.level,null!=t.position?e=sgt(t.position,a,i):null!=t.renderedPosition&&(e=t.renderedPosition),null==e||n.panningEnabled||(s=!0)),r=(r=r>n.maxZoom?n.maxZoom:r)e.maxZoom||!e.zoomingEnabled?a=!0:(e.zoom=o,i.push("zoom"))}if(n&&(!a||!t.cancelOnFailedZoom)&&e.panningEnabled){var l=t.pan;Mut(l.x)&&(e.pan.x=l.x,s=!1),Mut(l.y)&&(e.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this}),"viewport"),center:o((function(t){var e=this.getCenterPan(t);return e&&(this._private.pan=e,this.emit("pan viewport"),this.notify("viewport")),this}),"center"),getCenterPan:o((function(t,e){if(this._private.panningEnabled){if(Aut(t)){var r=t;t=this.mutableElements().filter(r)}else Put(t)||(t=this.mutableElements());if(0!==t.length){var n=t.boundingBox(),i=this.width(),a=this.height();return{x:(i-(e=void 0===e?this._private.zoom:e)*(n.x1+n.x2))/2,y:(a-e*(n.y1+n.y2))/2}}}}),"getCenterPan"),reset:o((function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this}),"reset"),invalidateSize:o((function(){this._private.sizeCache=null}),"invalidateSize"),size:o((function(){var t,e,r=this._private,n=r.container,i=this;return r.sizeCache=r.sizeCache||(n?(t=i.window().getComputedStyle(n),e=o((function(e){return parseFloat(t.getPropertyValue(e))}),"val"),{width:n.clientWidth-e("padding-left")-e("padding-right"),height:n.clientHeight-e("padding-top")-e("padding-bottom")}):{width:1,height:1})}),"size"),width:o((function(){return this.size().width}),"width"),height:o((function(){return this.size().height}),"height"),extent:o((function(){var t=this._private.pan,e=this._private.zoom,r=this.renderedExtent(),n={x1:(r.x1-t.x)/e,x2:(r.x2-t.x)/e,y1:(r.y1-t.y)/e,y2:(r.y2-t.y)/e};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}),"extent"),renderedExtent:o((function(){var t=this.width(),e=this.height();return{x1:0,y1:0,x2:t,y2:e,w:t,h:e}}),"renderedExtent"),multiClickDebounceTime:o((function(t){return t?(this._private.multiClickDebounceTime=t,this):this._private.multiClickDebounceTime}),"multiClickDebounceTime")};ckt.centre=ckt.center,ckt.autolockNodes=ckt.autolock,ckt.autoungrabifyNodes=ckt.autoungrabify;var hkt={data:Xvt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Xvt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Xvt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Xvt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};hkt.attr=hkt.data,hkt.removeAttr=hkt.removeData;var ukt=o((function(t){var e=this,r=(t=edt({},t)).container;r&&!Out(r)&&Out(r[0])&&(r=r[0]);var n=r?r._cyreg:null;(n=n||{})&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];r&&(r._cyreg=n),n.cy=e;var a=void 0!==wut&&void 0!==r&&!t.headless,s=t;s.layout=edt({name:a?"grid":"null"},s.layout),s.renderer=edt({name:a?"canvas":"null"},s.renderer);var l=o((function(t,e,r){return void 0!==e?e:void 0!==r?r:t}),"defVal"),c=this._private={container:r,ready:!1,options:s,elements:new Swt(this),listeners:[],aniEles:new Swt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:void 0===s.styleEnabled?a:s.styleEnabled,zoom:Mut(s.zoom)?s.zoom:1,pan:{x:Iut(s.pan)&&Mut(s.pan.x)?s.pan.x:0,y:Iut(s.pan)&&Mut(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var h=o((function(t,e){if(t.some(Wut))return Pmt.all(t).then(e);e(t)}),"loadExtData");c.styleEnabled&&e.setStyle([]);var u=edt({},s,s.renderer);e.initRenderer(u);var d=o((function(t,r,n){e.notifications(!1);var i=e.mutableElements();i.length>0&&i.remove(),null!=t&&(Iut(t)||Nut(t))&&e.add(t),e.one("layoutready",(function(t){e.notifications(!0),e.emit(t),e.one("load",r),e.emitAndNotify("load")})).one("layoutstop",(function(){e.one("done",n),e.emit("done")}));var a=edt({},e._private.options.layout);a.eles=e.elements(),e.layout(a).run()}),"setElesAndLayout");h([s.style,s.elements],(function(t){var r=t[0],a=t[1];c.styleEnabled&&e.style().append(r),d(a,(function(){e.startAnimationLoop(),c.ready=!0,Lut(s.ready)&&e.on("ready",s.ready);for(var t=0;t0,c=!!e.boundingBox,h=r.extent(),u=_gt(c?e.boundingBox:{x1:h.x1,y1:h.y1,w:h.w,h:h.h});if(Put(e.roots))t=e.roots;else if(Nut(e.roots)){for(var d=[],p=0;p0;){var R=I(),M=S(R,L);if(M)R.outgoers().filter((function(t){return t.isNode()&&n.has(t)})).forEach(N);else if(null===M){Ept("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var D=0;if(e.avoidOverlap)for(var O=0;O0&&x[0].length<=3?a/2:0),o=2*Math.PI/x[n].length*i;return 0===n&&1===x[0].length&&(s=1),{x:X+s*Math.cos(o),y:K+s*Math.sin(o)}}var l=x[n].length,h=Math.max(1===l?0:c?(u.w-2*e.padding-Z.w)/((e.grid?J:l)-1):(u.w-2*e.padding-Z.w)/((e.grid?J:l)+1),D);return{x:X+(i+1-(l+1)/2)*h,y:K+(n+1-(G+1)/2)*Q}}),"getPosition");return n.nodes().layoutPositions(this,e,tt),this};var vkt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function xkt(t){this.options=edt({},vkt,t)}o(xkt,"CircleLayout"),xkt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s,l=_gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),c=l.x1+l.w/2,h=l.y1+l.h/2,u=(void 0===e.sweep?2*Math.PI-2*Math.PI/a.length:e.sweep)/Math.max(1,a.length-1),d=0,p=0;p1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),v=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(y*y+v*v));s=Math.max(x,s)}var b=o((function(t,r){var n=e.startAngle+r*u*(i?1:-1),a=s*Math.cos(n),o=s*Math.sin(n);return{x:c+a,y:h+o}}),"getPos");return n.nodes().layoutPositions(this,e,b),this};var bkt,wkt={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:o((function(t){return t.degree()}),"concentric"),levelWidth:o((function(t){return t.maxDegree()/4}),"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function kkt(t){this.options=edt({},wkt,t)}o(kkt,"ConcentricLayout"),kkt.prototype.run=function(){for(var t=this.options,e=t,r=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=_gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o=s.x1+s.w/2,l=s.y1+s.h/2,c=[],h=0,u=0;u0)Math.abs(v[0].value-b.value)>=m&&(v=[],y.push(v));v.push(b)}var w=h+e.minNodeSpacing;if(!e.avoidOverlap){var k=y.length>0&&y[0].length>1,T=(Math.min(s.w,s.h)/2-w)/(y.length+k?1:0);w=Math.min(w,T)}for(var _=0,E=0;E1&&e.avoidOverlap){var L=Math.cos(A)-Math.cos(0),N=Math.sin(A)-Math.sin(0),I=Math.sqrt(w*w/(L*L+N*N));_=Math.max(I,_)}C.r=_,_+=w}if(e.equidistant){for(var R=0,M=0,D=0;D=t.numIter)&&(Ikt(n,t),n.temperature=n.temperature*t.coolingFactor,!(n.temperature=t.animationThreshold&&a(),tpt(e)):(qkt(n,t),l())}),"frame");u()}else{for(;h;)h=s(c),c++;qkt(n,t),l()}return this},_kt.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},_kt.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Ekt=o((function(t,e,r){for(var n=r.eles.edges(),i=r.eles.nodes(),a=_gt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:r.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},o=r.eles.components(),l={},c=0;c0){s.graphSet.push(w);for(c=0;cn.count?0:n.graph}),"findLCA"),Skt=o((function t(e,r,n,i){var a=i.graphSet[n];if(-10)var o=(c=n.nodeOverlap*s)*i/(f=Math.sqrt(i*i+a*a)),l=c*a/f;else{var c,h=Pkt(t,i,a),u=Pkt(e,-1*i,-1*a),d=u.x-h.x,p=u.y-h.y,g=d*d+p*p,f=Math.sqrt(g);o=(c=(t.nodeRepulsion+e.nodeRepulsion)/g)*d/f,l=c*p/f}t.isLocked||(t.offsetX-=o,t.offsetY-=l),e.isLocked||(e.offsetX+=o,e.offsetY+=l)}}),"nodeRepulsion"),Okt=o((function(t,e,r,n){if(r>0)var i=t.maxX-e.minX;else i=e.maxX-t.minX;if(n>0)var a=t.maxY-e.minY;else a=e.maxY-t.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0}),"nodesOverlap"),Pkt=o((function(t,e,r){var n=t.positionX,i=t.positionY,a=t.height||1,s=t.width||1,o=r/e,l=a/s,c={};return 0===e&&0r?(c.x=n,c.y=i+a/2,c):0e&&-1*l<=o&&o<=l?(c.x=n-s/2,c.y=i-s*r/2/e,c):0=l)?(c.x=n+a*e/2/r,c.y=i+a/2,c):0>r&&(o<=-1*l||o>=l)?(c.x=n-a*e/2/r,c.y=i-a/2,c):c}),"findClippingPoint"),Bkt=o((function(t,e){for(var r=0;r1){var g=e.gravity*u/p,f=e.gravity*d/p;h.offsetX+=g,h.offsetY+=f}}}}}),"calculateGravityForces"),Fkt=o((function(t,e){var r=[],n=0,i=-1;for(r.push.apply(r,t.graphSet[0]),i+=t.graphSet[0].length;n<=i;){var a=r[n++],s=t.idToIndex[a],o=t.layoutNodes[s],l=o.children;if(0r)var i={x:r*t/n,y:r*e/n};else i={x:t,y:e};return i}),"limitForce"),Gkt=o((function t(e,r){var n=e.parentId;if(null!=n){var i=r.layoutNodes[r.idToIndex[n]],a=!1;return(null==i.maxX||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(null==i.minX||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(null==i.minY||e.minY-i.padTopg&&(u+=p+e.componentSpacing,h=0,d=0,p=0)}}}),"separateComponents"),jkt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:o((function(t){}),"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function Wkt(t){this.options=edt({},jkt,t)}o(Wkt,"GridLayout"),Wkt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=_gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(0===a.h||0===a.w)n.nodes().layoutPositions(this,e,(function(t){return{x:a.x1,y:a.y1}}));else{var s=i.size(),l=Math.sqrt(s*a.h/a.w),c=Math.round(l),h=Math.round(a.w/a.h*l),u=o((function(t){if(null==t)return Math.min(c,h);Math.min(c,h)==c?c=t:h=t}),"small"),d=o((function(t){if(null==t)return Math.max(c,h);Math.max(c,h)==c?c=t:h=t}),"large"),p=e.rows,g=null!=e.cols?e.cols:e.columns;if(null!=p&&null!=g)c=p,h=g;else if(null!=p&&null==g)c=p,h=Math.ceil(s/c);else if(null==p&&null!=g)h=g,c=Math.ceil(s/h);else if(h*c>s){var f=u(),m=d();(f-1)*m>=s?u(f-1):(m-1)*f>=s&&d(m-1)}else for(;h*c=s?d(v+1):u(y+1)}var x=a.w/h,b=a.h/c;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w=h&&(R=0,I++)}),"moveToNextCell"),D={},O=0;O(n=qgt(t,e,b[w],b[w+1],b[w+2],b[w+3])))return y(r,n),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(b=a.allpts,w=0;w+5(n=Ggt(t,e,b[w],b[w+1],b[w+2],b[w+3],b[w+4],b[w+5])))return y(r,n),!0;m=m||i.source,x=x||i.target;var k=s.getArrowWidth(o,c),T=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w0&&(v(m),v(x))}function b(t,e,r){return Ppt(t,e,r)}function w(r,n){var i,a=r._private,s=f;i=n?n+"-":"",r.boundingBox();var l=a.labelBounds[n||"main"],c=r.pstyle(i+"label").value;if("yes"===r.pstyle("text-events").strValue&&c){var h=b(a.rscratch,"labelX",n),u=b(a.rscratch,"labelY",n),d=b(a.rscratch,"labelAngle",n),p=r.pstyle(i+"text-margin-x").pfValue,g=r.pstyle(i+"text-margin-y").pfValue,m=l.x1-s-p,v=l.x2+s-p,x=l.y1-s-g,w=l.y2+s-g;if(d){var k=Math.cos(d),T=Math.sin(d),_=o((function(t,e){return{x:(t-=h)*k-(e-=u)*T+h,y:t*T+e*k+u}}),"rotate"),E=_(m,x),C=_(m,w),S=_(v,x),A=_(v,w),L=[E.x+p,E.y+g,S.x+p,S.y+g,A.x+p,A.y+g,C.x+p,C.y+g];if(jgt(t,e,L))return y(r),!0}else if(Dgt(l,t,e))return y(r),!0}}r&&(c=c.interactive),o(y,"addEle"),o(v,"checkNode"),o(x,"checkEdge"),o(b,"preprop"),o(w,"checkLabel");for(var k=c.length-1;k>=0;k--){var T=c[k];T.isNode()?v(T)||w(T):x(T)||w(T)||w(T,"source")||w(T,"target")}return h},getAllInBox:function(t,e,r,n){for(var i=this.getCachedZSortedEles().interactive,a=[],s=Math.min(t,r),o=Math.max(t,r),l=Math.min(e,n),c=Math.max(e,n),h=_gt({x1:t=s,y1:e=l,x2:r=o,y2:n=c}),u=0;u0?-(Math.PI-t.ang):Math.PI+t.ang}),"invertVec"),CTt=o((function(t,e,r,n,i){if(t!==wTt?_Tt(e,t,kTt):ETt(TTt,kTt),_Tt(e,r,TTt),oTt=kTt.nx*TTt.ny-kTt.ny*TTt.nx,lTt=kTt.nx*TTt.nx-kTt.ny*-TTt.ny,uTt=Math.asin(Math.max(-1,Math.min(1,oTt))),Math.abs(uTt)<1e-6)return rTt=e.x,nTt=e.y,void(pTt=fTt=0);cTt=1,hTt=!1,lTt<0?uTt<0?uTt=Math.PI+uTt:(uTt=Math.PI-uTt,cTt=-1,hTt=!0):uTt>0&&(cTt=-1,hTt=!0),fTt=void 0!==e.radius?e.radius:n,dTt=uTt/2,mTt=Math.min(kTt.len/2,TTt.len/2),i?(gTt=Math.abs(Math.cos(dTt)*fTt/Math.sin(dTt)))>mTt?(gTt=mTt,pTt=Math.abs(gTt*Math.sin(dTt)/Math.cos(dTt))):pTt=fTt:(gTt=Math.min(mTt,fTt),pTt=Math.abs(gTt*Math.sin(dTt)/Math.cos(dTt))),xTt=e.x+TTt.nx*gTt,bTt=e.y+TTt.ny*gTt,rTt=xTt-TTt.ny*pTt*cTt,nTt=bTt+TTt.nx*pTt*cTt,yTt=e.x+kTt.nx*gTt,vTt=e.y+kTt.ny*gTt,wTt=e}),"calcCornerArc");function STt(t,e){0===e.radius?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ATt(t,e,r,n){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return 0===n||0===e.radius?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(CTt(t,e,r,n,i),{cx:rTt,cy:nTt,radius:pTt,startX:yTt,startY:vTt,stopX:xTt,stopY:bTt,startAngle:kTt.ang+Math.PI/2*cTt,endAngle:TTt.ang-Math.PI/2*cTt,counterClockwise:hTt})}o(STt,"drawPreparedRoundCorner"),o(ATt,"getRoundCorner");var LTt={};function NTt(t){var e=[];if(null!=t){for(var r=0;r0?Math.max(t-e,0):Math.min(t+e,0)}),"subDWH"),A=S(E,T),L=S(C,_),N=!1;"auto"===y?m=Math.abs(A)>Math.abs(L)?i:n:y===c||y===l?(m=n,N=!0):y!==a&&y!==s||(m=i,N=!0);var I,R=m===n,M=R?L:A,D=R?C:E,O=mgt(D),P=!1;(N&&(x||w)||!(y===l&&D<0||y===c&&D>0||y===a&&D>0||y===s&&D<0)||(M=(O*=-1)*Math.abs(M),P=!0),x)?I=(b<0?1+b:b)*M:I=(b<0?M:0)+b*O;var B=o((function(t){return Math.abs(t)=Math.abs(M)}),"getIsTooClose"),$=B(I),F=B(Math.abs(M)-Math.abs(I));if(($||F)&&!P)if(R){var z=Math.abs(D)<=d/2,U=Math.abs(E)<=p/2;if(z){var G=(h.x1+h.x2)/2,q=h.y1,j=h.y2;r.segpts=[G,q,G,j]}else if(U){var W=(h.y1+h.y2)/2,Y=h.x1,H=h.x2;r.segpts=[Y,W,H,W]}else r.segpts=[h.x1,h.y2]}else{var V=Math.abs(D)<=u/2,X=Math.abs(C)<=g/2;if(V){var K=(h.y1+h.y2)/2,Z=h.x1,Q=h.x2;r.segpts=[Z,K,Q,K]}else if(X){var J=(h.x1+h.x2)/2,tt=h.y1,et=h.y2;r.segpts=[J,tt,J,et]}else r.segpts=[h.x2,h.y1]}else if(R){var rt=h.y1+I+(f?d/2*O:0),nt=h.x1,it=h.x2;r.segpts=[nt,rt,it,rt]}else{var at=h.x1+I+(f?u/2*O:0),st=h.y1,ot=h.y2;r.segpts=[at,st,at,ot]}if(r.isRound){var lt=t.pstyle("taxi-radius").value,ct="arc-radius"===t.pstyle("radius-type").value[0];r.radii=new Array(r.segpts.length/2).fill(lt),r.isArcRadius=new Array(r.segpts.length/2).fill(ct)}},LTt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if("bezier"===r.edgeType){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,c=e.srcShape,h=e.tgtShape,u=e.srcCornerRadius,d=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,f=!Mut(r.startX)||!Mut(r.startY),m=!Mut(r.arrowStartX)||!Mut(r.arrowStartY),y=!Mut(r.endX)||!Mut(r.endY),v=!Mut(r.arrowEndX)||!Mut(r.arrowEndY),x=3*(this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth),b=ygt({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),w=bd.poolIndex()){var p=u;u=d,d=p}var g=o.srcPos=u.position(),f=o.tgtPos=d.position(),m=o.srcW=u.outerWidth(),y=o.srcH=u.outerHeight(),v=o.tgtW=d.outerWidth(),x=o.tgtH=d.outerHeight(),b=o.srcShape=r.nodeShapes[e.getNodeShape(u)],w=o.tgtShape=r.nodeShapes[e.getNodeShape(d)],k=o.srcCornerRadius="auto"===u.pstyle("corner-radius").value?"auto":u.pstyle("corner-radius").pfValue,T=o.tgtCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,_=o.tgtRs=d._private.rscratch,E=o.srcRs=u._private.rscratch;o.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var C=0;C0){var W=c,Y=vgt(W,lgt(e)),H=vgt(W,lgt(j)),V=Y;if(H2)vgt(W,{x:j[2],y:j[3]})0){var ot=h,lt=vgt(ot,lgt(e)),ct=vgt(ot,lgt(st)),ht=lt;if(ct2)vgt(ot,{x:st[2],y:st[3]})=l||v){h={cp:f,segment:y};break}}if(h)break}var x=h.cp,b=h.segment,w=(l-d)/b.length,k=b.t1-b.t0,T=o?b.t0+k*w:b.t1-k*w;T=Tgt(0,T,1),e=wgt(x.p0,x.p1,x.p2,T),i=BTt(x.p0,x.p1,x.p2,T);break;case"straight":case"segments":case"haystack":for(var _,E,C,S,A=0,L=n.allpts.length,N=0;N+3=l));N+=2);var I=(l-E)/_;I=Tgt(0,I,1),e=kgt(C,S,I),i=PTt(C,S)}s("labelX",r,e.x),s("labelY",r,e.y),s("labelAutoAngle",r,i)}}),"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(t)}},DTt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},DTt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Ppt(r.rscratch,"labelWrapCachedLines",e)||[],l="wrap"!==s?1:Math.max(o.length,1),c=i.height/l,h=c*a,u=i.width,d=i.height+(l-1)*(a-1)*c;Bpt(r.rstyle,"labelWidth",e,u),Bpt(r.rscratch,"labelWidth",e,u),Bpt(r.rstyle,"labelHeight",e,d),Bpt(r.rscratch,"labelHeight",e,d),Bpt(r.rscratch,"labelLineHeight",e,h)},DTt.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=o((function(t,n){return n?(Bpt(r.rscratch,t,e,n),n):Ppt(r.rscratch,t,e)}),"rscratch");if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var l=t.pstyle("text-wrap").value;if("wrap"===l){var c=s("labelKey");if(null!=c&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var h=i.split("\n"),u=t.pstyle("text-max-width").pfValue,d="anywhere"===t.pstyle("text-overflow-wrap").value,p=[],g=/[\s\u200b]+|$/g,f=0;fu){var x,b="",w=0,k=but(m.matchAll(g));try{for(k.s();!(x=k.n()).done;){var T=x.value,_=T[0],E=m.substring(w,T.index);w=T.index+_.length;var C=0===b.length?E:b+E+_;this.calculateLabelDimensions(t,C).width<=u?b+=E+_:(b&&p.push(b),b=E+_)}}catch(t){k.e(t)}finally{k.f()}b.match(/^[\s\u200b]+$/)||p.push(b)}else p.push(m)}s("labelWrapCachedLines",p),i=s("labelWrapCachedText",p.join("\n")),s("labelWrapKey",c)}else if("ellipsis"===l){var S=t.pstyle("text-max-width").pfValue,A="",L=!1;if(this.calculateLabelDimensions(t,i).widthS)break;A+=i[N],N===i.length-1&&(L=!0)}return L||(A+="…"),A}return i},DTt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if("auto"!==e)return e;if(!t.isNode())return"center";switch(r){case"left":return"right";case"right":return"left";default:return"center"}},DTt.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window().document,i=dpt(e,t._private.labelDimsKey),a=r.labelDimCache||(r.labelDimCache=[]),s=a[i];if(null!=s)return s;var o=t.pstyle("font-style").strValue,l=t.pstyle("font-size").pfValue,c=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,u=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=n.createElement("canvas"),d=this.labelCalcCanvasContext=u.getContext("2d");var p=u.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}d.font="".concat(o," ").concat(h," ").concat(l,"px ").concat(c);for(var g=0,f=0,m=e.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(e.merge(t),r)for(var n=0;n=t.desktopTapThreshold2}var C=a(e);f&&(t.hoverData.tapholdCancelled=!0);var A=o((function(){var e=t.hoverData.dragDelta=t.hoverData.dragDelta||[];0===e.length?(e.push(b[0]),e.push(b[1])):(e[0]+=b[0],e[1]+=b[1])}),"updateDragDelta");r=!0,i(g,["mousemove","vmousemove","tapdrag"],e,{x:h[0],y:h[1]});var L=o((function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||n.emit({originalEvent:e,type:"boxstart",position:{x:h[0],y:h[1]}}),p[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()}),"goIntoBoxMode");if(3===t.hoverData.which){if(f){var N={originalEvent:e,type:"cxtdrag",position:{x:h[0],y:h[1]}};x?x.emit(N):n.emit(N),t.hoverData.cxtDragged=!0,t.hoverData.cxtOver&&g===t.hoverData.cxtOver||(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:h[0],y:h[1]}}),t.hoverData.cxtOver=g,g&&g.emit({originalEvent:e,type:"cxtdragover",position:{x:h[0],y:h[1]}}))}}else if(t.hoverData.dragging){if(r=!0,n.panningEnabled()&&n.userPanningEnabled()){var I;if(t.hoverData.justStartedPan){var R=t.hoverData.mdownPos;I={x:(h[0]-R[0])*l,y:(h[1]-R[1])*l},t.hoverData.justStartedPan=!1}else I={x:b[0]*l,y:b[1]*l};n.panBy(I),n.emit("dragpan"),t.hoverData.dragged=!0}h=t.projectIntoViewport(e.clientX,e.clientY)}else if(1!=p[4]||null!=x&&!x.pannable()){if(x&&x.pannable()&&x.active()&&x.unactivate(),x&&x.grabbed()||g==y||(y&&i(y,["mouseout","tapdragout"],e,{x:h[0],y:h[1]}),g&&i(g,["mouseover","tapdragover"],e,{x:h[0],y:h[1]}),t.hoverData.last=g),x)if(f){if(n.boxSelectionEnabled()&&C)x&&x.grabbed()&&(v(w),x.emit("freeon"),w.emit("free"),t.dragData.didDrag&&(x.emit("dragfreeon"),w.emit("dragfree"))),L();else if(x&&x.grabbed()&&t.nodeIsDraggable(x)){var M=!t.dragData.didDrag;M&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||m(w,{inDragLayer:!0});var D={x:0,y:0};if(Mut(b[0])&&Mut(b[1])&&(D.x+=b[0],D.y+=b[1],M)){var O=t.hoverData.dragDelta;O&&Mut(O[0])&&Mut(O[1])&&(D.x+=O[0],D.y+=O[1])}t.hoverData.draggingEles=!0,w.silentShift(D).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else A();r=!0}else if(f){if(t.hoverData.dragging||!n.boxSelectionEnabled()||!C&&n.panningEnabled()&&n.userPanningEnabled()){if(!t.hoverData.selecting&&n.panningEnabled()&&n.userPanningEnabled()){s(x,t.hoverData.downs)&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,p[4]=0,t.data.bgActivePosistion=lgt(u),t.redrawHint("select",!0),t.redraw())}}else L();x&&x.pannable()&&x.active()&&x.unactivate()}return p[2]=h[0],p[3]=h[1],r?(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1):void 0}}),"mousemoveHandler"),!1),t.registerBinding(e,"mouseup",o((function(e){if((1!==t.hoverData.which||1===e.which||!t.hoverData.capture)&&t.hoverData.capture){t.hoverData.capture=!1;var n=t.cy,s=t.projectIntoViewport(e.clientX,e.clientY),l=t.selection,c=t.findNearestElement(s[0],s[1],!0,!1),h=t.dragData.possibleDragElements,u=t.hoverData.down,d=a(e);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,u&&u.unactivate(),3===t.hoverData.which){var p={originalEvent:e,type:"cxttapend",position:{x:s[0],y:s[1]}};if(u?u.emit(p):n.emit(p),!t.hoverData.cxtDragged){var g={originalEvent:e,type:"cxttap",position:{x:s[0],y:s[1]}};u?u.emit(g):n.emit(g)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(1===t.hoverData.which){if(i(c,["mouseup","tapend","vmouseup"],e,{x:s[0],y:s[1]}),t.dragData.didDrag||t.hoverData.dragged||t.hoverData.selecting||t.hoverData.isOverThresholdDrag||(i(u,["click","tap","vclick"],e,{x:s[0],y:s[1]}),L=!1,e.timeStamp-N<=n.multiClickDebounceTime()?(A&&clearTimeout(A),L=!0,N=null,i(u,["dblclick","dbltap","vdblclick"],e,{x:s[0],y:s[1]})):(A=setTimeout((function(){L||i(u,["oneclick","onetap","voneclick"],e,{x:s[0],y:s[1]})}),n.multiClickDebounceTime()),N=e.timeStamp)),null!=u||t.dragData.didDrag||t.hoverData.selecting||t.hoverData.dragged||a(e)||(n.$(r).unselect(["tapunselect"]),h.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=h=n.collection()),c!=u||t.dragData.didDrag||t.hoverData.selecting||null!=c&&c._private.selectable&&(t.hoverData.dragging||("additive"===n.selectionType()||d?c.selected()?c.unselect(["tapunselect"]):c.select(["tapselect"]):d||(n.$(r).unmerge(c).unselect(["tapunselect"]),c.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var f=n.collection(t.getAllInBox(l[0],l[1],l[2],l[3]));t.redrawHint("select",!0),f.length>0&&t.redrawHint("eles",!0),n.emit({type:"boxend",originalEvent:e,position:{x:s[0],y:s[1]}});var m=o((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");"additive"===n.selectionType()||d||n.$(r).unmerge(f).unselect(),f.emit("box").stdFilter(m).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!l[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var y=u&&u.grabbed();v(h),y&&(u.emit("freeon"),h.emit("free"),t.dragData.didDrag&&(u.emit("dragfreeon"),h.emit("dragfree")))}}l[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}),"mouseupHandler"),!1);var R,M,D,O,P,B,$,F,z,U,G,q,j,W=o((function(e){if(!t.scrollingPage){var r=t.cy,n=r.zoom(),i=r.pan(),a=t.projectIntoViewport(e.clientX,e.clientY),s=[a[0]*n+i.x,a[1]*n+i.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||C())e.preventDefault();else if(r.panningEnabled()&&r.userPanningEnabled()&&r.zoomingEnabled()&&r.userZoomingEnabled()){var o;e.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout((function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()}),150),o=null!=e.deltaY?e.deltaY/-250:null!=e.wheelDeltaY?e.wheelDeltaY/1e3:e.wheelDelta/1e3,o*=t.wheelSensitivity,1===e.deltaMode&&(o*=33);var l=r.zoom()*Math.pow(10,o);"gesturechange"===e.type&&(l=t.gestureStartZoom*e.scale),r.zoom({level:l,renderedPosition:{x:s[0],y:s[1]}}),r.emit("gesturechange"===e.type?"pinchzoom":"scrollzoom")}}}),"wheelHandler");t.registerBinding(t.container,"wheel",W,!0),t.registerBinding(e,"scroll",o((function(e){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout((function(){t.scrollingPage=!1}),250)}),"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",o((function(e){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||e.preventDefault()}),"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",(function(e){t.hasTouchStarted||W(e)}),!0),t.registerBinding(t.container,"mouseout",o((function(e){var r=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseout",position:{x:r[0],y:r[1]}})}),"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",o((function(e){var r=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseover",position:{x:r[0],y:r[1]}})}),"mouseOverHandler"),!1);var Y,H,V,X,K,Z,Q,J=o((function(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-e))}),"distance"),tt=o((function(t,e,r,n){return(r-t)*(r-t)+(n-e)*(n-e)}),"distanceSq");if(t.registerBinding(t.container,"touchstart",Y=o((function(e){if(t.hasTouchStarted=!0,S(e)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var r=t.cy,n=t.touchData.now,a=t.touchData.earlier;if(e.touches[0]){var s=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);n[0]=s[0],n[1]=s[1]}if(e.touches[1]){s=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);n[2]=s[0],n[3]=s[1]}if(e.touches[2]){s=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);n[4]=s[0],n[5]=s[1]}if(e.touches[1]){t.touchData.singleTouchMoved=!0,v(t.dragData.touchDragEles);var l=t.findContainerClientCoords();z=l[0],U=l[1],G=l[2],q=l[3],R=e.touches[0].clientX-z,M=e.touches[0].clientY-U,D=e.touches[1].clientX-z,O=e.touches[1].clientY-U,j=0<=R&&R<=G&&0<=D&&D<=G&&0<=M&&M<=q&&0<=O&&O<=q;var c=r.pan(),h=r.zoom();P=J(R,M,D,O),B=tt(R,M,D,O),F=[(($=[(R+D)/2,(M+O)/2])[0]-c.x)/h,($[1]-c.y)/h];if(B<4e4&&!e.touches[2]){var u=t.findNearestElement(n[0],n[1],!0,!0),p=t.findNearestElement(n[2],n[3],!0,!0);return u&&u.isNode()?(u.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),t.touchData.start=u):p&&p.isNode()?(p.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),t.touchData.start=p):r.emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,void t.redraw()}}if(e.touches[2])r.boxSelectionEnabled()&&e.preventDefault();else if(e.touches[1]);else if(e.touches[0]){var g=t.findNearestElements(n[0],n[1],!0,!0),f=g[0];if(null!=f&&(f.activate(),t.touchData.start=f,t.touchData.starts=g,t.nodeIsGrabbable(f))){var x=t.dragData.touchDragEles=r.collection(),w=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),f.selected()?(w=r.$((function(e){return e.selected()&&t.nodeIsGrabbable(e)})),m(w,{addToList:x})):y(f,{addToList:x}),d(f);var k=o((function(t){return{originalEvent:e,type:t,position:{x:n[0],y:n[1]}}}),"makeEvent");f.emit(k("grabon")),w?w.forEach((function(t){t.emit(k("grab"))})):f.emit(k("grab"))}i(f,["touchstart","tapstart","vmousedown"],e,{x:n[0],y:n[1]}),null==f&&(t.data.bgActivePosistion={x:s[0],y:s[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout((function(){!1!==t.touchData.singleTouchMoved||t.pinching||t.touchData.selecting||i(t.touchData.start,["taphold"],e,{x:n[0],y:n[1]})}),t.tapholdDuration)}if(e.touches.length>=1){for(var T=t.touchData.startPosition=[null,null,null,null,null,null],_=0;_=t.touchTapThreshold2}if(r&&t.touchData.cxt){e.preventDefault();var b=e.touches[0].clientX-z,w=e.touches[0].clientY-U,k=e.touches[1].clientX-z,T=e.touches[1].clientY-U,_=tt(b,w,k,T);if(_/B>=2.25||_>=22500){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var E={originalEvent:e,type:"cxttapend",position:{x:o[0],y:o[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(E),t.touchData.start=null):a.emit(E)}}if(r&&t.touchData.cxt){E={originalEvent:e,type:"cxtdrag",position:{x:o[0],y:o[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(E):a.emit(E),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var C=t.findNearestElement(o[0],o[1],!0,!0);t.touchData.cxtOver&&C===t.touchData.cxtOver||(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:o[0],y:o[1]}}),t.touchData.cxtOver=C,C&&C.emit({originalEvent:e,type:"cxtdragover",position:{x:o[0],y:o[1]}}))}else if(r&&e.touches[2]&&a.boxSelectionEnabled())e.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||a.emit({originalEvent:e,type:"boxstart",position:{x:o[0],y:o[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,n[4]=1,n&&0!==n.length&&void 0!==n[0]?(n[2]=(o[0]+o[2]+o[4])/3,n[3]=(o[1]+o[3]+o[5])/3):(n[0]=(o[0]+o[2]+o[4])/3,n[1]=(o[1]+o[3]+o[5])/3,n[2]=(o[0]+o[2]+o[4])/3+1,n[3]=(o[1]+o[3]+o[5])/3+1),t.redrawHint("select",!0),t.redraw();else if(r&&e.touches[1]&&!t.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(e.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),Z=t.dragData.touchDragEles){t.redrawHint("drag",!0);for(var A=0;A0&&!t.hoverData.draggingEles&&!t.swipePanning&&null!=t.data.bgActivePosistion&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}}),"touchmoveHandler"),!1),t.registerBinding(e,"touchcancel",V=o((function(e){var r=t.touchData.start;t.touchData.capture=!1,r&&r.unactivate()}),"touchcancelHandler")),t.registerBinding(e,"touchend",X=o((function(e){var n=t.touchData.start;if(t.touchData.capture){0===e.touches.length&&(t.touchData.capture=!1),e.preventDefault();var a=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var s,l=t.cy,c=l.zoom(),h=t.touchData.now,u=t.touchData.earlier;if(e.touches[0]){var d=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);h[0]=d[0],h[1]=d[1]}if(e.touches[1]){d=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);h[2]=d[0],h[3]=d[1]}if(e.touches[2]){d=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);h[4]=d[0],h[5]=d[1]}if(n&&n.unactivate(),t.touchData.cxt){if(s={originalEvent:e,type:"cxttapend",position:{x:h[0],y:h[1]}},n?n.emit(s):l.emit(s),!t.touchData.cxtDragged){var p={originalEvent:e,type:"cxttap",position:{x:h[0],y:h[1]}};n?n.emit(p):l.emit(p)}return t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,void t.redraw()}if(!e.touches[2]&&l.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var g=l.collection(t.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,t.redrawHint("select",!0),l.emit({type:"boxend",originalEvent:e,position:{x:h[0],y:h[1]}});var f=o((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");g.emit("box").stdFilter(f).select().emit("boxselect"),g.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(null!=n&&n.unactivate(),e.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(e.touches[1]);else if(e.touches[0]);else if(!e.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var m=t.dragData.touchDragEles;if(null!=n){var y=n._private.grabbed;v(m),t.redrawHint("drag",!0),t.redrawHint("eles",!0),y&&(n.emit("freeon"),m.emit("free"),t.dragData.didDrag&&(n.emit("dragfreeon"),m.emit("dragfree"))),i(n,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]}),n.unactivate(),t.touchData.start=null}else{var x=t.findNearestElement(h[0],h[1],!0,!0);i(x,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]})}var b=t.touchData.startPosition[0]-h[0],w=b*b,k=t.touchData.startPosition[1]-h[1],T=(w+k*k)*c*c;t.touchData.singleTouchMoved||(n||l.$(":selected").unselect(["tapunselect"]),i(n,["tap","vclick"],e,{x:h[0],y:h[1]}),K=!1,e.timeStamp-Q<=l.multiClickDebounceTime()?(Z&&clearTimeout(Z),K=!0,Q=null,i(n,["dbltap","vdblclick"],e,{x:h[0],y:h[1]})):(Z=setTimeout((function(){K||i(n,["onetap","voneclick"],e,{x:h[0],y:h[1]})}),l.multiClickDebounceTime()),Q=e.timeStamp)),null!=n&&!t.dragData.didDrag&&n._private.selectable&&T0)return p[0]}return null}),"getCurveT"),g=Object.keys(d),f=0;f0?c:Bgt(i,a,t,e,r,n,s,o)}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o){var l=2*(o="auto"===o?sft(n,i):o);if(Wgt(t,e,this.points,a,s,n,i-l,[0,-1],r))return!0;if(Wgt(t,e,this.points,a,s,n-l,i,[0,-1],r))return!0;var c=n/2+2*r,h=i/2+2*r;return!!jgt(t,e,[a-c,s-h,a-c,s,a+c,s,a+c,s-h])||(!!Kgt(t,e,l,l,a+n/2-o,s+i/2-o,r)||!!Kgt(t,e,l,l,a-n/2+o,s+i/2-o,r))}),"checkPoint")}},registerNodeShapes:function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",nft(3,0)),this.generateRoundPolygon("round-triangle",nft(3,0)),this.generatePolygon("rectangle",nft(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r),this.generatePolygon("pentagon",nft(5,0)),this.generateRoundPolygon("round-pentagon",nft(5,0)),this.generatePolygon("hexagon",nft(6,0)),this.generateRoundPolygon("round-hexagon",nft(6,0)),this.generatePolygon("heptagon",nft(7,0)),this.generateRoundPolygon("round-heptagon",nft(7,0)),this.generatePolygon("octagon",nft(8,0)),this.generateRoundPolygon("round-octagon",nft(8,0));var n=new Array(20),i=aft(5,0),a=aft(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=t.deqFastCost*f)break}else if(i){if(p>=t.deqCost*l||p>=t.deqAvgCost*o)break}else if(g>=t.deqNoDrawCost*KTt)break;var m=t.deq(e,u,h);if(!(m.length>0))break;for(var y=0;y0&&(t.onDeqd(e,c),!i&&t.shouldRedraw(e,c,u,h)&&n())}),"dequeue"),a=t.priority||kpt;r.beforeRender(i,a(e))}}),"setupDequeueingImpl")}),"setupDequeueing")},QTt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bpt;sut(this,t),this.idsByKey=new $pt,this.keyForId=new $pt,this.cachesByLvl=new $pt,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return o(t,"ElementTextureCacheLookup"),lut(t,[{key:"getIdsFor",value:o((function(t){null==t&&Tpt("Can not get id list for null key");var e=this.idsByKey,r=this.idsByKey.get(t);return r||(r=new zpt,e.set(t,r)),r}),"getIdsFor")},{key:"addIdForKey",value:o((function(t,e){null!=t&&this.getIdsFor(t).add(e)}),"addIdForKey")},{key:"deleteIdForKey",value:o((function(t,e){null!=t&&this.getIdsFor(t).delete(e)}),"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:o((function(t){return null==t?0:this.getIdsFor(t).size}),"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:o((function(t){var e=t.id(),r=this.keyForId.get(e),n=this.getKey(t);this.deleteIdForKey(r,e),this.addIdForKey(n,e),this.keyForId.set(e,n)}),"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:o((function(t){var e=t.id(),r=this.keyForId.get(e);this.deleteIdForKey(r,e),this.keyForId.delete(e)}),"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:o((function(t){var e=t.id();return this.keyForId.get(e)!==this.getKey(t)}),"keyHasChangedFor")},{key:"isInvalid",value:o((function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}),"isInvalid")},{key:"getCachesAt",value:o((function(t){var e=this.cachesByLvl,r=this.lvls,n=e.get(t);return n||(n=new $pt,e.set(t,n),r.push(t)),n}),"getCachesAt")},{key:"getCache",value:o((function(t,e){return this.getCachesAt(e).get(t)}),"getCache")},{key:"get",value:o((function(t,e){var r=this.getKey(t),n=this.getCache(r,e);return null!=n&&this.updateKeyMappingFor(t),n}),"get")},{key:"getForCachedKey",value:o((function(t,e){var r=this.keyForId.get(t.id());return this.getCache(r,e)}),"getForCachedKey")},{key:"hasCache",value:o((function(t,e){return this.getCachesAt(e).has(t)}),"hasCache")},{key:"has",value:o((function(t,e){var r=this.getKey(t);return this.hasCache(r,e)}),"has")},{key:"setCache",value:o((function(t,e,r){r.key=t,this.getCachesAt(e).set(t,r)}),"setCache")},{key:"set",value:o((function(t,e,r){var n=this.getKey(t);this.setCache(n,e,r),this.updateKeyMappingFor(t)}),"set")},{key:"deleteCache",value:o((function(t,e){this.getCachesAt(e).delete(t)}),"deleteCache")},{key:"delete",value:o((function(t,e){var r=this.getKey(t);this.deleteCache(r,e)}),"_delete")},{key:"invalidateKey",value:o((function(t){var e=this;this.lvls.forEach((function(r){return e.deleteCache(t,r)}))}),"invalidateKey")},{key:"invalidate",value:o((function(t){var e=t.id(),r=this.keyForId.get(e);this.deleteKeyMappingFor(t);var n=this.doesEleInvalidateKey(t);return n&&this.invalidateKey(r),n||0===this.getNumberOfIdsForKey(r)}),"invalidate")}]),t}(),JTt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},t_t=Rpt({getKey:null,doesEleInvalidateKey:bpt,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:xpt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),e_t=o((function(t,e){var r=this;r.renderer=t,r.onDequeues=[];var n=t_t(e);edt(r,n),r.lookup=new QTt(n.getKey,n.doesEleInvalidateKey),r.setupDequeueing()}),"ElementTextureCache"),r_t=e_t.prototype;r_t.reasons=JTt,r_t.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},r_t.getRetiredTextureQueue=function(t){var e=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return e[t]=e[t]||[]},r_t.getElementQueue=function(){var t=this.eleCacheQueue=this.eleCacheQueue||new Wpt((function(t,e){return e.reqs-t.reqs}));return t},r_t.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},r_t.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,l=s.cy.zoom(),c=this.lookup;if(!e||0===e.w||0===e.h||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed())return null;if(!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(null==n&&(n=Math.ceil(fgt(l*r))),n<-4)n=-4;else if(l>=7.99||n>3)return null;var h=Math.pow(2,n),u=e.h*h,d=e.w*h,p=s.eleTextBiggerThanMin(t,h);if(!this.isVisible(t,p))return null;var g,f=c.get(t,n);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(g=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||d>1024)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=o((function(){return a.recycleTexture(g,d)||a.addTexture(g,d)}),"addNewTxr");y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;A--)C=a.getElement(t,e,r,A,JTt.downscale);S()}else{var L;if(!w&&!k&&!T)for(var N=n-1;N>=-4;N--){var I=c.get(t,N);if(I){L=I;break}}if(b(L))return a.queueElement(t,n),L;y.context.translate(y.usedWidth,0),y.context.scale(h,h),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/h,1/h),y.context.translate(-y.usedWidth,0)}return f={x:y.usedWidth,texture:y,level:n,scale:h,width:d,height:u,scaledLabelShown:p},y.usedWidth+=Math.ceil(d+8),y.eleCaches.push(f),c.set(t,n,f),a.checkTextureFullness(y),f},r_t.invalidateElements=function(t){for(var e=0;e=.2*t.width&&this.retireTexture(t)},r_t.checkTextureFullness=function(t){var e=this.getTextureQueue(t.height);t.usedWidth/t.width>.8&&t.fullnessChecks>=10?Mpt(e,t):t.fullnessChecks++},r_t.retireTexture=function(t){var e=t.height,r=this.getTextureQueue(e),n=this.lookup;Mpt(r,t),t.retired=!0;for(var i=t.eleCaches,a=0;a=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,Dpt(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Mpt(n,a),r.push(a),a}},r_t.queueElement=function(t,e){var r=this.getElementQueue(),n=this.getElementKeyToQueue(),i=this.getKey(t),a=n[i];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,r.updateItem(a);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};r.push(s),n[i]=s}},r_t.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<1&&r.size()>0;s++){var o=r.pop(),l=o.key,c=o.eles[0],h=a.hasCache(c,o.level);if(n[l]=null,!h){i.push(o);var u=e.getBoundingBox(c);e.getElement(c,u,t,o.level,JTt.dequeue)}}return i},r_t.removeFromQueue=function(t){var e=this.getElementQueue(),r=this.getElementKeyToQueue(),n=this.getKey(t),i=r[n];null!=i&&(1===i.eles.length?(i.reqs=vpt,e.updateItem(i),e.pop(),r[n]=null):i.eles.unmerge(t))},r_t.onDequeue=function(t){this.onDequeues.push(t)},r_t.offDequeue=function(t){Mpt(this.onDequeues,t)},r_t.setupDequeueing=ZTt.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:o((function(t,e,r){return t.dequeue(e,r)}),"deq"),onDeqd:o((function(t,e){for(var r=0;r=3.99||r>2)return null;n.validateLayersElesOrdering(r,t);var s,l,c=n.layersByLevel,h=Math.pow(2,r),u=c[r]=c[r]||[],d=n.levelIsComplete(r,t),p=o((function(){var e=o((function(e){if(n.validateLayersElesOrdering(e,t),n.levelIsComplete(e,t))return l=c[e],!0}),"canUseAsTmpLvl"),i=o((function(t){if(!l)for(var n=r+t;-4<=n&&n<=2&&!e(n);n+=t);}),"checkLvls");i(1),i(-1);for(var a=u.length-1;a>=0;a--){var s=u[a];s.invalid&&Mpt(u,s)}}),"checkTempLevels");if(d)return u;p();var g=o((function(){if(!s){s=_gt();for(var e=0;e32767||a>32767)return null;if(i*a>16e6)return null;var o=n.makeLayer(s,r);if(null!=e){var l=u.indexOf(e)+1;u.splice(l,0,o)}else(void 0===t.insert||t.insert)&&u.unshift(o);return o}),"makeLayer");if(n.skipping&&!a)return null;for(var m=null,y=t.length/1,v=!a,x=0;x=y||!Pgt(m.bb,b.boundingBox()))&&!(m=f({insert:!0,after:m})))return null;l||v?n.queueLayer(m,b):n.drawEleInLayer(m,b,r,e),m.eles.push(b),k[r]=m}}return l||(v?null:u)},i_t.getEleLevelForLayerLevel=function(t,e){return t},i_t.drawEleInLayer=function(t,e,r,n){var i=this.renderer,a=t.context,s=e.boundingBox();0!==s.w&&0!==s.h&&e.visible()&&(r=this.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(a,!1),i.drawCachedElement(a,e,null,null,r,true),i.setImgSmoothing(a,!0))},i_t.levelIsComplete=function(t,e){var r=this.layersByLevel[t];if(!r||0===r.length)return!1;for(var n=0,i=0;i0)return!1;if(a.invalid)return!1;n+=a.eles.length}return n===e.length},i_t.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){t=!0;break}}return t},i_t.invalidateElements=function(t){var e=this;0!==t.length&&(e.lastInvalidationTime=ept(),0!==t.length&&e.haveLayers()&&e.updateElementsInLayers(t,o((function(t,r,n){e.invalidateLayer(t)}),"invalAssocLayers")))},i_t.invalidateLayer=function(t){if(this.lastInvalidationTime=ept(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Mpt(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this,l=e._private.rscratch;if((!a||e.visible())&&!l.badLine&&null!=l.allpts&&!isNaN(l.allpts[0])){var c;r&&(c=r,t.translate(-c.x1,-c.y1));var h=a?e.pstyle("opacity").value:1,u=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,f=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=h*u,x=h*u,b=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(s.eleStrokeStyle(t,e,r),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=g,t.lineCap=f,s.eleStrokeStyle(t,e,r),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")}),"drawLine"),w=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;t.lineWidth=g+m,t.lineCap=f,m>0?(s.colorStrokeStyle(t,y[0],y[1],y[2],r),"straight-triangle"===d?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")):t.lineCap="butt"}),"drawLineOutline"),k=o((function(){i&&s.drawEdgeOverlay(t,e)}),"drawOverlay"),T=o((function(){i&&s.drawEdgeUnderlay(t,e)}),"drawUnderlay"),_=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;s.drawArrowheads(t,e,r)}),"drawArrows"),E=o((function(){s.drawElementText(t,e,null,n)}),"drawText");t.lineJoin="round";var C="yes"===e.pstyle("ghost").value;if(C){var S=e.pstyle("ghost-offset-x").pfValue,A=e.pstyle("ghost-offset-y").pfValue,L=e.pstyle("ghost-opacity").value,N=v*L;t.translate(S,A),b(N),_(N),t.translate(-S,-A)}else w();T(),b(),_(),k(),E(),r&&t.translate(c.x1,c.y1)}}},k_t=o((function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(e,r){if(r.visible()){var n=r.pstyle("".concat(t,"-opacity")).value;if(0!==n){var i=this,a=i.usePaths(),s=r._private.rscratch,o=2*r.pstyle("".concat(t,"-padding")).pfValue,l=r.pstyle("".concat(t,"-color")).value;e.lineWidth=o,"self"!==s.edgeType||a?e.lineCap="round":e.lineCap="butt",i.colorStrokeStyle(e,l[0],l[1],l[2],n),i.drawEdgePath(r,e,s.allpts,"solid")}}}}),"drawEdgeOverlayUnderlay");w_t.drawEdgeOverlay=k_t("overlay"),w_t.drawEdgeUnderlay=k_t("underlay"),w_t.drawEdgePath=function(t,e,r,n){var i,a=t._private.rscratch,s=e,o=!1,l=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var u=r.join("$");a.pathCacheKey&&a.pathCacheKey===u?(i=e=a.pathCache,o=!0):(i=e=new Path2D,a.pathCacheKey=u,a.pathCache=i)}if(s.setLineDash)switch(n){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(c),s.lineDashOffset=h;break;case"solid":s.setLineDash([])}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+35&&void 0!==arguments[5]?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath(),s?t.stroke():t.fill()}__t.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(fgt(r*n));e=Math.pow(2,i)}return!(t.pstyle("font-size").pfValue*e5&&void 0!==arguments[5])||arguments[5],s=this;if(null==n){if(a&&!s.eleTextBiggerThanMin(e))return}else if(!1===n)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),u=e.pstyle("source-label"),d=e.pstyle("target-label");if(c||(!h||!h.value)&&(!u||!u.value)&&(!d||!d.value))return;t.textAlign="center",t.textBaseline="bottom"}var p,g=!r;r&&(p=r,t.translate(-p.x1,-p.y1)),null==i?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(p.x1,p.y1)},__t.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&void 0!==arguments[2])||arguments[2],n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)},o(E_t,"roundRect"),__t.getTextAngle=function(t,e){var r,n=t._private.rscratch,i=e?e+"-":"",a=t.pstyle(i+"text-rotation");if("autorotate"===a.strValue){var s=Ppt(n,"labelAngle",e);r=t.isEdge()?s:0}else r="none"===a.strValue?0:a.pfValue;return r},__t.drawText=function(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!i||0!==o&&0!==e.pstyle("text-opacity").value){"main"===r&&(r=null);var l,c,h=Ppt(s,"labelX",r),u=Ppt(s,"labelY",r),d=this.getLabelText(e,r);if(null!=d&&""!==d&&!isNaN(h)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p,g=r?r+"-":"",f=Ppt(s,"labelWidth",r),m=Ppt(s,"labelHeight",r),y=e.pstyle(g+"text-margin-x").pfValue,v=e.pstyle(g+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;switch(x&&(b="center",w="center"),h+=y,u+=v,0!==(p=n?this.getTextAngle(e,r):0)&&(l=h,c=u,t.translate(l,c),t.rotate(p),h=0,u=0),w){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m}var k=e.pstyle("text-background-opacity").value,T=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,E=e.pstyle("text-background-padding").pfValue,C=e.pstyle("text-background-shape").strValue,S=0===C.indexOf("round"),A=2;if(k>0||_>0&&T>0){var L=h-E;switch(b){case"left":L-=f;break;case"center":L-=f/2}var N=u-m-E,I=f+2*E,R=m+2*E;if(k>0){var M=t.fillStyle,D=e.pstyle("text-background-color").value;t.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+k*o+")",S?E_t(t,L,N,I,R,A):t.fillRect(L,N,I,R),t.fillStyle=M}if(_>0&&T>0){var O=t.strokeStyle,P=t.lineWidth,B=e.pstyle("text-border-color").value,$=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+T*o+")",t.lineWidth=_,t.setLineDash)switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([])}if(S?E_t(t,L,N,I,R,A,"stroke"):t.strokeRect(L,N,I,R),"double"===$){var F=_/2;S?E_t(t,L+F,N+F,I-2*F,R-2*F,A,"stroke"):t.strokeRect(L+F,N+F,I-2*F,R-2*F)}t.setLineDash&&t.setLineDash([]),t.lineWidth=P,t.strokeStyle=O}}var z=2*e.pstyle("text-outline-width").pfValue;if(z>0&&(t.lineWidth=z),"wrap"===e.pstyle("text-wrap").value){var U=Ppt(s,"labelWrapCachedLines",r),G=Ppt(s,"labelLineHeight",r),q=f/2,j=this.getLabelJustification(e);switch("auto"===j||("left"===b?"left"===j?h+=-f:"center"===j&&(h+=-q):"center"===b?"left"===j?h+=-q:"right"===j&&(h+=q):"right"===b&&("center"===j?h+=q:"right"===j&&(h+=f))),w){case"top":case"center":case"bottom":u-=(U.length-1)*G}for(var W=0;W0&&t.strokeText(U[W],h,u),t.fillText(U[W],h,u),u+=G}else z>0&&t.strokeText(d,h,u),t.fillText(d,h,u);0!==p&&(t.rotate(-p),t.translate(-l,-c))}}};var C_t={drawNode:function(t,e,r){var n,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],l=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],c=this,h=e._private,u=h.rscratch,d=e.position();if(Mut(d.x)&&Mut(d.y)&&(!l||e.visible())){var p,g,f=l?e.effectiveOpacity():1,m=c.usePaths(),y=!1,v=e.padding();n=e.width()+2*v,i=e.height()+2*v,r&&(g=r,t.translate(-g.x1,-g.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),k=new Array(b.length),T=0,_=0;_0&&void 0!==arguments[0]?arguments[0]:N;c.eleFillStyle(t,e,r)}),"setupShapeColor"),Y=o((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$;c.colorStrokeStyle(t,I[0],I[1],I[2],e)}),"setupBorderColor"),H=o((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;c.colorStrokeStyle(t,z[0],z[1],z[2],e)}),"setupOutlineColor"),V=o((function(t,e,r,n){var i,a=c.nodePathCache=c.nodePathCache||[],s=ppt("polygon"===r?r+","+n.join(","):r,""+e,""+t,""+j),o=a[s],l=!1;return null!=o?(i=o,l=!0,u.pathCache=i):(i=new Path2D,a[s]=u.pathCache=i),{path:i,cacheHit:l}}),"getPath"),X=e.pstyle("shape").strValue,K=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(d.x,d.y);var Z=V(n,i,X,K);p=Z.path,y=Z.cacheHit}var Q=o((function(){if(!y){var r=d;m&&(r={x:0,y:0}),c.nodeShapes[c.getNodeShape(e)].draw(p||t,r.x,r.y,n,i,j,u)}m?t.fill(p):t.fill()}),"drawShape"),J=o((function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=h.backgrounding,a=0,s=0;s0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;c.hasPie(e)&&(c.drawPie(t,e,a),r&&(m||c.nodeShapes[c.getNodeShape(e)].draw(t,d.x,d.y,n,i,j,u)))}),"drawPie"),et=o((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=(A>0?A:-A)*e,n=A>0?0:255;0!==A&&(c.colorFillStyle(t,n,n,n,r),m?t.fill(p):t.fill())}),"darken"),rt=o((function(){if(L>0){if(t.lineWidth=L,t.lineCap=D,t.lineJoin=M,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(P),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([])}if("center"!==O){if(t.save(),t.lineWidth*=2,"inside"===O)m?t.clip(p):t.clip();else{var e=new Path2D;e.rect(-n/2-L,-i/2-L,n+2*L,i+2*L),e.addPath(p),t.clip(e,"evenodd")}m?t.stroke(p):t.stroke(),t.restore()}else m?t.stroke(p):t.stroke();if("double"===R){t.lineWidth=L/3;var r=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(p):t.stroke(),t.globalCompositeOperation=r}t.setLineDash&&t.setLineDash([])}}),"drawBorder"),nt=o((function(){if(F>0){if(t.lineWidth=F,t.lineCap="butt",t.setLineDash)switch(U){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([])}var r=d;m&&(r={x:0,y:0});var a=c.getNodeShape(e),s=L;"inside"===O&&(s=0),"outside"===O&&(s*=2);var o,l=(n+s+(F+q))/n,h=(i+s+(F+q))/i,u=n*l,p=i*h,g=c.nodeShapes[a].points;if(m)o=V(u,p,a,g).path;if("ellipse"===a)c.drawEllipsePath(o||t,r.x,r.y,u,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var f=0,y=0,v=0;"round-diamond"===a?f=1.4*(s+q+F):"round-heptagon"===a?(f=1.075*(s+q+F),v=-(s/2+q+F)/35):"round-hexagon"===a?f=1.12*(s+q+F):"round-pentagon"===a?(f=1.13*(s+q+F),v=-(s/2+q+F)/15):"round-tag"===a?(f=1.12*(s+q+F),y=.07*(s/2+F+q)):"round-triangle"===a&&(f=(s+q+F)*(Math.PI/2),v=-(s+q/2+F)/Math.PI),0!==f&&(u=n*(l=(n+f)/n),["round-hexagon","round-tag"].includes(a)||(p=i*(h=(i+f)/i)));for(var x=u/2,b=p/2,w=(j="auto"===j?oft(u,p):j)+(s+F+q)/2,k=new Array(g.length/2),T=new Array(g.length/2),_=0;_0){if(n=n||r.position(),null==i||null==a){var u=r.padding();i=r.width()+2*u,a=r.height()+2*u}this.colorFillStyle(e,l[0],l[1],l[2],o),this.nodeShapes[c].draw(e,n.x,n.y,i+2*s,a+2*s,h),e.fill()}}}}),"drawNodeOverlayUnderlay");C_t.drawNodeOverlay=S_t("overlay"),C_t.drawNodeUnderlay=S_t("underlay"),C_t.hasPie=function(t){return(t=t[0])._private.hasPie},C_t.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=n.x,o=n.y,l=e.width(),c=e.height(),h=Math.min(l,c)/2,u=0;this.usePaths()&&(s=0,o=0),"%"===a.units?h*=a.pfValue:void 0!==a.pfValue&&(h=a.pfValue/2);for(var d=1;d<=i.pieBackgroundN;d++){var p=e.pstyle("pie-"+d+"-background-size").value,g=e.pstyle("pie-"+d+"-background-color").value,f=e.pstyle("pie-"+d+"-background-opacity").value*r,m=p/100;m+u>1&&(m=1-u);var y=1.5*Math.PI+2*Math.PI*u,v=y+2*Math.PI*m;0===p||u>=1||u+m>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,h,y,v),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],f),t.fill(),u+=m)}};var A_t,L_t={};function N_t(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function I_t(t,e,r){var n=N_t(t,t.VERTEX_SHADER,e),i=N_t(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function R_t(t,e,r){void 0===r&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function M_t(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function D_t(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return[a,s=Math.round(t.canvasHeight-s)]}function O_t(t,e,r){var n=t[0]/255,i=t[1]/255,a=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=i*s,o[2]=a*s,o[3]=s,o}function P_t(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function B_t(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function $_t(t,e){var r=t.createTexture();return r.buffer=function(e){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function F_t(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function z_t(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function U_t(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function G_t(t,e,r,n){var i=hut(F_t(t,e),2),a=i[0],s=i[1],o=z_t(t,s,n),l=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,o,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,a,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,a,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),l}function q_t(t,e,r,n){var i=hut(F_t(t,r),3),a=i[0],s=i[1],o=i[2],l=z_t(t,s,e*a),c=a*o,h=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,e*c,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),s===t.FLOAT?t.vertexAttribPointer(n,a,s,!1,c,0):s===t.INT&&t.vertexAttribIPointer(n,a,s,c,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var u=new Array(e),d=0;de.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(u[e.NODE]=!0,u[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),w=void 0!==s?s:b,k=r.pan(),T={x:k.x,y:k.y},_={zoom:b,pan:{x:k.x,y:k.y}},E=e.prevViewport;void 0===E||_.zoom!==E.zoom||_.pan.x!==E.pan.x||_.pan.y!==E.pan.y||m&&!f||(e.motionBlurPxRatio=1),l&&(T=l),w*=c,T.x*=c,T.y*=c;var C=e.getCachedZSortedEles();function S(t,r,n,i,a){var s=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",e.colorFillStyle(t,255,255,255,e.motionBlurTransparency),t.fillRect(r,n,i,a),t.globalCompositeOperation=s}function A(t,r){var a,o,c,u;e.clearingMotionBlur||t!==h.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]&&t!==h.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]?(a=T,o=w,c=e.canvasWidth,u=e.canvasHeight):(a={x:k.x*g,y:k.y*g},o=b*g,c=e.canvasWidth*g,u=e.canvasHeight*g),t.setTransform(1,0,0,1,0,0),"motionBlur"===r?S(t,0,0,c,u):n||void 0!==r&&!r||t.clearRect(0,0,c,u),i||(t.translate(a.x,a.y),t.scale(o,o)),l&&t.translate(l.x,l.y),s&&t.scale(s,s)}if(o(S,"mbclear"),o(A,"setContextTransform"),d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var L=e.data.bufferContexts[e.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:c*e.textureMult}),(_=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}u[e.DRAG]=!1,u[e.NODE]=!1;var N=h.contexts[e.NODE],I=e.textureCache.texture;_=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),p?S(N,0,0,_.width,_.height):N.clearRect(0,0,_.width,_.height);var R=x.core("outside-texture-bg-color").value,M=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,R[0],R[1],R[2],M),N.fillRect(0,0,_.width,_.height);b=r.zoom();A(N,!1),N.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/c,_.height/_.zoom/c),N.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/c,_.height/_.zoom/c)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),O=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),P=e.hideEdgesOnViewport&&O,B=[];if(B[e.NODE]=!u[e.NODE]&&p&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!u[e.DRAG]&&p&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),u[e.NODE]||i||a||B[e.NODE]){var $=p&&!B[e.NODE]&&1!==g;A(N=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:h.contexts[e.NODE]),p&&!$?"motionBlur":void 0),P?e.drawCachedNodes(N,C.nondrag,c,D):e.drawLayeredElements(N,C.nondrag,c,D),e.debug&&e.drawDebugPoints(N,C.nondrag),i||p||(u[e.NODE]=!1)}if(!a&&(u[e.DRAG]||i||B[e.DRAG])){$=p&&!B[e.DRAG]&&1!==g;A(N=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:h.contexts[e.DRAG]),p&&!$?"motionBlur":void 0),P?e.drawCachedNodes(N,C.drag,c,D):e.drawCachedElements(N,C.drag,c,D),e.debug&&e.drawDebugPoints(N,C.drag),i||p||(u[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,A),p&&1!==g){var F=h.contexts[e.NODE],z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],U=h.contexts[e.DRAG],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],q=o((function(t,r,n){t.setTransform(1,0,0,1,0,0),n||!v?t.clearRect(0,0,e.canvasWidth,e.canvasHeight):S(t,0,0,e.canvasWidth,e.canvasHeight);var i=g;t.drawImage(r,0,0,e.canvasWidth*i,e.canvasHeight*i,0,0,e.canvasWidth,e.canvasHeight)}),"drawMotionBlur");(u[e.NODE]||B[e.NODE])&&(q(F,z,B[e.NODE]),u[e.NODE]=!1),(u[e.DRAG]||B[e.DRAG])&&(q(U,G,B[e.DRAG]),u[e.DRAG]=!1)}e.prevViewport=_,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),p&&(e.motionBlurTimeout=setTimeout((function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,u[e.NODE]=!0,u[e.DRAG]=!0,e.redraw()}),100)),n||r.emit("render")},L_t.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,c=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=c||i.contexts[r.SELECT_BOX];if(e(h),1==r.selection[4]&&(r.hoverData.selecting||r.touchData.selecting)){var u=r.cy.zoom(),d=a.core("selection-box-border-width").value/u;h.lineWidth=d,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),d>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){u=r.cy.zoom();var p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/u,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var f=Math.round(1e3/g),m="1 frame = "+g+" ms = "+f+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!A_t){var y=h.measureText(m);A_t=y.actualBoundingBoxAscent}h.fillText(m,0,A_t);h.strokeRect(0,A_t+10,250,20),h.fillRect(0,A_t+10,250*Math.min(f/60,1),20)}o||(l[r.SELECT_BOX]=!1)}},o(N_t,"compileShader"),o(I_t,"createProgram"),o(R_t,"createTextureCanvas"),o(M_t,"getEffectivePanZoom"),o(D_t,"modelToRenderedPosition"),o(O_t,"toWebGLColor"),o(P_t,"indexToVec4"),o(B_t,"vec4ToIndex"),o($_t,"createTexture"),o(F_t,"getTypeInfo"),o(z_t,"createTypedArray"),o(U_t,"createTypedArrayView"),o(G_t,"createBufferStaticDraw"),o(q_t,"createBufferDynamicDraw"),o(j_t,"createPickingFrameBuffer");var W_t="undefined"!=typeof Float32Array?Float32Array:Array;function Y_t(){var t=new W_t(9);return W_t!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function H_t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function V_t(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=r[0],p=r[1],g=r[2],f=r[3],m=r[4],y=r[5],v=r[6],x=r[7],b=r[8];return t[0]=d*n+p*s+g*c,t[1]=d*i+p*o+g*h,t[2]=d*a+p*l+g*u,t[3]=f*n+m*s+y*c,t[4]=f*i+m*o+y*h,t[5]=f*a+m*l+y*u,t[6]=v*n+x*s+b*c,t[7]=v*i+x*o+b*h,t[8]=v*a+x*l+b*u,t}function X_t(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=d*n+p*s+c,t[7]=d*i+p*o+h,t[8]=d*a+p*l+u,t}function K_t(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=Math.sin(r),p=Math.cos(r);return t[0]=p*n+d*s,t[1]=p*i+d*o,t[2]=p*a+d*l,t[3]=p*s-d*n,t[4]=p*o-d*i,t[5]=p*l-d*a,t[6]=c,t[7]=h,t[8]=u,t}function Z_t(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Q_t(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),o(Y_t,"create"),o(H_t,"identity"),o(V_t,"multiply"),o(X_t,"translate"),o(K_t,"rotate"),o(Z_t,"scale"),o(Q_t,"projection");var J_t={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},tEt=Rpt({getKey:null,drawElement:null,getBoundingBox:null,getRotation:null,getRotationPoint:null,getRotationOffset:null,isVisible:null,getPadding:null}),eEt=function(){function t(e,r){sut(this,t),this.debugID=Math.floor(1e4*Math.random()),this.r=e,this.atlasSize=r.webglTexSize,this.rows=r.webglTexRows,this.enableWrapping=r.enableWrapping,this.texHeight=Math.floor(this.atlasSize/this.rows),this.maxTexWidth=this.atlasSize,this.texture=null,this.canvas=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=r.createTextureCanvas(e,this.atlasSize,this.atlasSize),this.scratch=r.createTextureCanvas(e,this.atlasSize,this.texHeight,"scratch")}return o(t,"Atlas"),lut(t,[{key:"getKeys",value:o((function(){return new Set(this.keyToLocation.keys())}),"getKeys")},{key:"getScale",value:o((function(t){var e=t.w,r=t.h,n=this.texHeight,i=this.maxTexWidth,a=n/r,s=e*a,o=r*a;return s>i&&(s=e*(a=i/e),o=r*a),{scale:a,texW:s,texH:o}}),"getScale")},{key:"draw",value:o((function(t,e,r){var n=this,i=this.atlasSize,a=this.rows,s=this.texHeight,l=this.getScale(e),c=l.scale,h=l.texW,u=l.texH,d=[null,null],p=o((function(t,n){if(r&&n){var i=n.context,a=t.x,o=t.row,l=a,h=s*o;i.save(),i.translate(l,h),i.scale(c,c),r(i,e),i.restore()}}),"drawAt"),g=o((function(){p(n.freePointer,n.canvas),d[0]={x:n.freePointer.x,y:n.freePointer.row*s,w:h,h:u},d[1]={x:n.freePointer.x+h,y:n.freePointer.row*s,w:0,h:u},n.freePointer.x+=h,n.freePointer.x==i&&(n.freePointer.x=0,n.freePointer.row++)}),"drawNormal"),f=o((function(){var t=n.scratch,e=n.canvas;t.clear(),p({x:0,row:0},t);var r=i-n.freePointer.x,a=h-r,o=s,l=n.freePointer.x,c=n.freePointer.row*s,g=r;e.context.drawImage(t,0,0,g,o,l,c,g,o),d[0]={x:l,y:c,w:g,h:u};var f=r,m=(n.freePointer.row+1)*s,y=a;e&&e.context.drawImage(t,f,0,y,o,0,m,y,o),d[1]={x:0,y:m,w:y,h:u},n.freePointer.x=a,n.freePointer.row++}),"drawWrapped"),m=o((function(){n.freePointer.x=0,n.freePointer.row++}),"moveToStartOfNextRow");if(this.freePointer.x+h<=i)g();else{if(this.freePointer.row>=a-1)return!1;this.freePointer.x===i?(m(),g()):this.enableWrapping?f():(m(),g())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}),"draw")},{key:"getOffsets",value:o((function(t){return this.keyToLocation.get(t)}),"getOffsets")},{key:"isEmpty",value:o((function(){return 0===this.freePointer.x&&0===this.freePointer.row}),"isEmpty")},{key:"canFit",value:o((function(t){var e=this.atlasSize,r=this.rows,n=this.getScale(t).texW;return!(this.freePointer.x+n>e)||this.freePointer.row1&&void 0!==arguments[1]?arguments[1]:{},n=r.forceRedraw,i=void 0!==n&&n,a=r.filterEle,s=void 0===a?function(){return!0}:a,o=r.filterType,l=void 0===o?function(){return!0}:o,c=!1,h=but(t);try{for(h.s();!(e=h.n()).done;){var u=e.value;if(s(u)){var d,p=u.id(),g=but(this.getRenderTypes());try{for(g.s();!(d=g.n()).done;){var f=d.value;if(l(f.type)){var m=f.getKey(u);i?(f.atlasCollection.deleteKey(p,m),f.atlasCollection.styleKeyNeedsRedraw.add(m),c=!0):c|=f.atlasCollection.checkKeyIsInvalid(p,m)}}}catch(t){g.e(t)}finally{g.f()}}}}catch(t){h.e(t)}finally{h.f()}return c}),"invalidate")},{key:"gc",value:o((function(){var t,e=but(this.getRenderTypes());try{for(e.s();!(t=e.n()).done;){t.value.atlasCollection.gc()}}catch(t){e.e(t)}finally{e.f()}}),"gc")},{key:"isRenderable",value:o((function(t,e){var r=this.getRenderTypeOpts(e);return r&&r.isVisible(t)}),"isRenderable")},{key:"startBatch",value:o((function(){this.batchAtlases=[]}),"startBatch")},{key:"getAtlasCount",value:o((function(){return this.batchAtlases.length}),"getAtlasCount")},{key:"getAtlases",value:o((function(){return this.batchAtlases}),"getAtlases")},{key:"getOrCreateAtlas",value:o((function(t,e,r){var n=this.renderTypes.get(r),i=n.getKey(t),a=t.id();return n.atlasCollection.draw(a,i,e,(function(r){n.drawElement(r,t,e,!0,!0)}))}),"getOrCreateAtlas")},{key:"getAtlasIndexForBatch",value:o((function(t){var e=this.batchAtlases.indexOf(t);if(e<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return;this.batchAtlases.push(t),e=this.batchAtlases.length-1}return e}),"getAtlasIndexForBatch")},{key:"getIndexArray",value:o((function(){return Array.from({length:this.maxAtlases},(function(t,e){return e}))}),"getIndexArray")},{key:"getAtlasInfo",value:o((function(t,e){var r=this.renderTypes.get(e),n=r.getBoundingBox(t),i=this.getOrCreateAtlas(t,n,e),a=this.getAtlasIndexForBatch(i);if(void 0!==a){var s=r.getKey(t),o=hut(i.getOffsets(s),2),l=o[0];return{atlasID:a,tex:l,tex1:l,tex2:o[1],bb:n,type:e,styleKey:s}}}),"getAtlasInfo")},{key:"canAddToCurrentBatch",value:o((function(t,e){if(this.batchAtlases.length===this.maxAtlasesPerBatch){var r=this.renderTypes.get(e),n=r.getKey(t),i=r.atlasCollection.getAtlas(n);return i&&this.batchAtlases.includes(i)}return!0}),"canAddToCurrentBatch")},{key:"setTransformMatrix",value:o((function(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=e.bb,a=e.type,s=e.tex1,o=e.tex2,l=this.getRenderTypeOpts(a),c=l.getPadding?l.getPadding(r):0,h=s.w/(s.w+o.w);n||(h=1-h);var u,d,p=this.getAdjustedBB(i,c,n,h);H_t(t);var g=l.getRotation?l.getRotation(r):0;if(0!==g){var f=l.getRotationPoint(r),m=f.x,y=f.y;X_t(t,t,[m,y]),K_t(t,t,g);var v=l.getRotationOffset(r);u=v.x+p.xOffset,d=v.y}else u=p.x1,d=p.y1;X_t(t,t,[u,d]),Z_t(t,t,[p.w,p.h])}),"setTransformMatrix")},{key:"getTransformMatrix",value:o((function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Y_t();return this.setTransformMatrix(n,t,e,r),n}),"getTransformMatrix")},{key:"getAdjustedBB",value:o((function(t,e,r,n){var i=t.x1,a=t.y1,s=t.w,o=t.h;e&&(i-=e,a-=e,s+=2*e,o+=2*e);var l=0,c=s*n;return r&&n<1?s=c:!r&&n<1&&(i+=l=s-c,s=c),{x1:i,y1:a,w:s,h:o,xOffset:l}}),"getAdjustedBB")},{key:"getDebugInfo",value:o((function(){var t,e=[],r=but(this.renderTypes);try{for(r.s();!(t=r.n()).done;){var n=hut(t.value,2),i=n[0],a=n[1].atlasCollection.getCounts(),s=a.keyCount,o=a.atlasCount;e.push({type:i,keyCount:s,atlasCount:o})}}catch(t){r.e(t)}finally{r.f()}return e}),"getDebugInfo")}]),t}(),aEt=function(){function t(e,r,n){sut(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.maxAtlases=n.webglTexPerBatch,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,n.enableWrapping=!0,n.createTextureCanvas=R_t,this.atlasManager=new iEt(e,n),this.program=this.createShaderProgram(J_t.SCREEN),this.pickingProgram=this.createShaderProgram(J_t.PICKING),this.vao=this.createVAO(),this.debugInfo=[]}return o(t,"ElementDrawingWebGL"),lut(t,[{key:"addTextureRenderType",value:o((function(t,e){this.atlasManager.addRenderType(t,e)}),"addTextureRenderType")},{key:"invalidate",value:o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.type,n=this.atlasManager;return r?n.invalidate(t,{filterType:o((function(t){return t===r}),"filterType"),forceRedraw:!0}):n.invalidate(t)}),"invalidate")},{key:"gc",value:o((function(){this.atlasManager.gc()}),"gc")},{key:"createShaderProgram",value:o((function(t){var e=this.gl,r="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; \n\n // what are we rendering?\n in int aVertType;\n\n // for picking\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex1; // x/y/w/h of texture in atlas\n in vec4 aTex2; \n\n // for any transforms that are needed\n in vec4 aScaleRotate1; // vectors use fewer attributes than matrices\n in vec2 aTranslate1;\n in vec4 aScaleRotate2;\n in vec2 aTranslate2;\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in float aLineWidth;\n in vec4 aEdgeColor;\n\n out vec2 vTexCoord;\n out vec4 vEdgeColor;\n flat out int vAtlasId;\n flat out vec4 vIndex;\n flat out int vVertType;\n\n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition;\n\n if(aVertType == ".concat(0,") {\n float texX;\n float texY;\n float texW;\n float texH;\n mat3 texMatrix;\n\n int vid = gl_VertexID;\n if(vid <= 5) {\n texX = aTex1.x;\n texY = aTex1.y;\n texW = aTex1.z;\n texH = aTex1.w;\n texMatrix = mat3(\n vec3(aScaleRotate1.xy, 0.0),\n vec3(aScaleRotate2.zw, 0.0),\n vec3(aTranslate1, 1.0)\n );\n } else {\n texX = aTex2.x;\n texY = aTex2.y;\n texW = aTex2.z;\n texH = aTex2.w;\n texMatrix = mat3(\n vec3(aScaleRotate2.xy, 0.0),\n vec3(aScaleRotate2.zw, 0.0),\n vec3(aTranslate2, 1.0)\n );\n }\n\n if(vid == 1 || vid == 2 || vid == 4 || vid == 7 || vid == 8 || vid == 10) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5 || vid == 8 || vid == 10 || vid == 11) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * texMatrix * vec3(position, 1.0), 1.0);\n } \n else if(aVertType == ").concat(1," && vid < 6) {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vEdgeColor = aEdgeColor;\n } \n else if(aVertType == ").concat(2," && vid < 6) {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0 = pointA;\n vec2 p1 = pointB;\n vec2 p2 = pointC;\n vec2 pos = position;\n if(position.x == 1.0) {\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth;\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vEdgeColor = aEdgeColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n mat3 transform = mat3(\n vec3(aScaleRotate1.xy, 0.0),\n vec3(aScaleRotate1.zw, 0.0),\n vec3(aTranslate1, 1.0)\n );\n gl_Position = vec4(uPanZoomMatrix * transform * vec3(position, 1.0), 1.0);\n vEdgeColor = aEdgeColor;\n } else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vIndex = aIndex;\n vVertType = aVertType;\n }\n "),n=this.atlasManager.getIndexArray(),i=I_t(e,r,"#version 300 es\n precision highp float;\n\n // define texture unit for each node in the batch\n ".concat(n.map((function(t){return"uniform sampler2D uTexture".concat(t,";")})).join("\n\t"),"\n\n uniform vec4 uBGColor;\n\n in vec2 vTexCoord;\n in vec4 vEdgeColor;\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n\n out vec4 outColor;\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n ").concat(n.map((function(t){return"if(vAtlasId == ".concat(t,") outColor = texture(uTexture").concat(t,", vTexCoord);")})).join("\n\telse "),"\n } else if(vVertType == ").concat(3,") {\n // blend arrow color with background (using premultiplied alpha)\n outColor.rgb = vEdgeColor.rgb + (uBGColor.rgb * (1.0 - vEdgeColor.a)); \n outColor.a = 1.0; // make opaque, masks out line under arrow\n } else {\n outColor = vEdgeColor;\n }\n\n ").concat(t.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "));i.aPosition=e.getAttribLocation(i,"aPosition"),i.aIndex=e.getAttribLocation(i,"aIndex"),i.aVertType=e.getAttribLocation(i,"aVertType"),i.aAtlasId=e.getAttribLocation(i,"aAtlasId"),i.aTex1=e.getAttribLocation(i,"aTex1"),i.aTex2=e.getAttribLocation(i,"aTex2"),i.aScaleRotate1=e.getAttribLocation(i,"aScaleRotate1"),i.aTranslate1=e.getAttribLocation(i,"aTranslate1"),i.aScaleRotate2=e.getAttribLocation(i,"aScaleRotate2"),i.aTranslate2=e.getAttribLocation(i,"aTranslate2"),i.aPointAPointB=e.getAttribLocation(i,"aPointAPointB"),i.aPointCPointD=e.getAttribLocation(i,"aPointCPointD"),i.aLineWidth=e.getAttribLocation(i,"aLineWidth"),i.aEdgeColor=e.getAttribLocation(i,"aEdgeColor"),i.uPanZoomMatrix=e.getUniformLocation(i,"uPanZoomMatrix"),i.uAtlasSize=e.getUniformLocation(i,"uAtlasSize"),i.uBGColor=e.getUniformLocation(i,"uBGColor"),i.uTextures=[];for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:J_t.SCREEN;this.panZoomMatrix=t,this.debugInfo=e,this.renderTarget=r,this.startBatch()}),"startFrame")},{key:"startBatch",value:o((function(){this.instanceCount=0,this.atlasManager.startBatch()}),"startBatch")},{key:"endFrame",value:o((function(){this.endBatch()}),"endFrame")},{key:"getTempMatrix",value:o((function(){return this.tempMatrix=this.tempMatrix||Y_t()}),"getTempMatrix")},{key:"drawTexture",value:o((function(t,e,r){var n=this.atlasManager;if(n.isRenderable(t,r)){n.canAddToCurrentBatch(t,r)||this.endBatch();var i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=0,P_t(e,this.indexBuffer.getView(i));var a=n.getAtlasInfo(t,r,a),s=a.atlasID,o=a.tex1,l=a.tex2;this.atlasIdBuffer.getView(i)[0]=s;var c=this.tex1Buffer.getView(i);c[0]=o.x,c[1]=o.y,c[2]=o.w,c[3]=o.h;var h=this.tex2Buffer.getView(i);h[0]=l.x,h[1]=l.y,h[2]=l.w,h[3]=l.h;for(var u=this.getTempMatrix(),d=0,p=[1,2];d=this.maxInstances&&this.endBatch()}}),"drawTexture")},{key:"drawEdgeArrow",value:o((function(t,e,r){var n,i,a,s=t._private.rscratch;if(("source"===r?(n=s.arrowStartX,i=s.arrowStartY,a=s.srcArrowAngle):(n=s.arrowEndX,i=s.arrowEndY,a=s.tgtArrowAngle),!(isNaN(n)||null==n||isNaN(i)||null==i||isNaN(a)||null==a))&&"none"!==t.pstyle(r+"-arrow-shape").value){var o=t.pstyle(r+"-arrow-color").value,l=t.pstyle("opacity").value*t.pstyle("line-opacity").value,c=t.pstyle("width").pfValue,h=t.pstyle("arrow-scale").value,u=this.r.getArrowWidth(c,h),d=this.getTempMatrix();H_t(d),X_t(d,d,[n,i]),Z_t(d,d,[u,u]),K_t(d,d,a);var p=this.instanceCount;this.vertTypeBuffer.getView(p)[0]=3,P_t(e,this.indexBuffer.getView(p)),O_t(o,l,this.edgeColorBuffer.getView(p));var g=this.scaleRotate1Buffer.getView(p);g[0]=d[0],g[1]=d[1],g[2]=d[3],g[3]=d[4];var f=this.translate1Buffer.getView(p);f[0]=d[6],f[1]=d[7],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}),"drawEdgeArrow")},{key:"drawEdgeLine",value:o((function(t,e){var r=t.pstyle("opacity").value,n=t.pstyle("line-opacity").value,i=t.pstyle("width").pfValue,a=t.pstyle("line-color").value,s=r*n,o=this.getEdgePoints(t);if(o.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==o.length){var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=1,P_t(e,this.indexBuffer.getView(l)),O_t(a,s,this.edgeColorBuffer.getView(l)),this.lineWidthBuffer.getView(l)[0]=i;var c=this.pointAPointBBuffer.getView(l);c[0]=o[0],c[1]=o[1],c[2]=o[2],c[3]=o[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var h=0;h=this.maxInstances&&this.endBatch()}}),"drawEdgeLine")},{key:"getEdgePoints",value:o((function(t){var e=t._private.rscratch.allpts;if(4==e.length)return e;var r=this.getNumSegments(t);return this.getCurveSegmentPoints(e,r)}),"getEdgePoints")},{key:"getNumSegments",value:o((function(t){return Math.min(Math.max(15,5),this.maxInstances)}),"getNumSegments")},{key:"getCurveSegmentPoints",value:o((function(t,e){if(4==t.length)return t;for(var r=Array(2*(e+1)),n=0;n<=e;n++)if(0==n)r[0]=t[0],r[1]=t[1];else if(n==e)r[2*n]=t[t.length-2],r[2*n+1]=t[t.length-1];else{var i=n/e;this.setCurvePoint(t,i,r,2*n)}return r}),"getCurveSegmentPoints")},{key:"setCurvePoint",value:o((function(t,e,r,n){if(!(t.length<=2)){for(var i=Array(t.length-2),a=0;a0}),"isVisible")},{key:"getStyle",value:o((function(t,e){return{opacity:e.pstyle("".concat(t,"-opacity")).value,color:e.pstyle("".concat(t,"-color")).value,shape:e.pstyle("".concat(t,"-shape")).value}}),"getStyle")},{key:"getPadding",value:o((function(t,e){return e.pstyle("".concat(t,"-padding")).pfValue}),"getPadding")},{key:"draw",value:o((function(t,e,r,n){if(this.isVisible(t,r)){var i=this.r,a=n.w,s=n.h,o=a/2,l=s/2,c=this.getStyle(t,r),h=c.shape,u=c.color,d=c.opacity;e.save(),e.fillStyle=sEt(u,d),"round-rectangle"===h||"roundrectangle"===h?i.drawRoundRectanglePath(e,o,l,a,s,"auto"):"ellipse"===h&&i.drawEllipsePath(e,o,l,a,s),e.fill(),e.restore()}}),"draw")}]),t}();function lEt(t){var e=t&&t.style&&t.style.backgroundColor||"white";return sdt(e)}o(lEt,"getBGColor");var cEt={};function hEt(t){var e=t.render;t.render=function(r){r=r||{};var n=t.cy;t.webgl&&(n.zoom()>7.99?(uEt(t),e.call(t,r)):(dEt(t),bEt(t,r,J_t.SCREEN)))};var r=t.matchCanvasSize;t.matchCanvasSize=function(e){r.call(t,e),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0},t.findNearestElements=function(e,r,n,i){return xEt(t,e,r)};var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0};var i=t.notify;t.notify=function(e,r){i.call(t,e,r),"viewport"===e||"bounds"===e?t.pickingFrameBuffer.needsDraw=!0:"background"===e&&t.eleDrawing.invalidate(r,{type:"node-body"})}}function uEt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function dEt(t){var e=o((function(e){e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.canvasWidth,t.canvasHeight),e.restore()}),"clear");e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function pEt(t){var e=t.canvasWidth,r=t.canvasHeight,n=M_t(t),i=n.pan,a=n.zoom,s=Y_t();X_t(s,s,[i.x,i.y]),Z_t(s,s,[a,a]);var o=Y_t();Q_t(o,e,r);var l=Y_t();return V_t(l,o,s),l}function gEt(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=M_t(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function fEt(t,e){t.drawSelectionRectangle(e,(function(e){return gEt(t,e)}))}function mEt(t){var e=t.data.contexts[t.NODE];e.save(),gEt(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function yEt(t){var e=o((function(e,r,n){for(var i=e.atlasManager.getRenderTypeOpts(r),a=t.data.contexts[t.NODE],s=i.atlasCollection.atlases,o=0;o=0&&k.add(_)}return k}function xEt(t,e,r){var n,i,a,s=vEt(t,e,r),o=t.getCachedZSortedEles(),l=but(s);try{for(l.s();!(a=l.n()).done;){var c=o[a.value];if(!n&&c.isNode()&&(n=c),!i&&c.isEdge()&&(i=c),n&&i)break}}catch(t){l.e(t)}finally{l.f()}return[n,i].filter(Boolean)}function bEt(t,e,r){var n,i;t.webglDebug&&(i=[],n=performance.now());var a=t.eleDrawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&fEt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var l=o((function(t,e){e+=1,t.isNode()?(a.drawTexture(t,e,"node-underlay"),a.drawTexture(t,e,"node-body"),a.drawTexture(t,e,"node-label"),a.drawTexture(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"edge-label"))}),"draw"),c=t.data.contexts[t.WEBGL];r.screen?(c.clearColor(0,0,0,0),c.enable(c.BLEND),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA)):c.disable(c.BLEND),c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT),c.viewport(0,0,c.canvas.width,c.canvas.height);var h=pEt(t),u=t.getCachedZSortedEles();if(s=u.length,a.startFrame(h,i,r),r.screen){for(var d=0;d0&&(n|=r.eleDrawing.invalidate(e)),n&&c()})),hEt(r)},o(hEt,"overrideCanvasRendererFunctions"),o(uEt,"clearWebgl"),o(dEt,"clearCanvas"),o(pEt,"createPanZoomMatrix"),o(gEt,"setContextTransform"),o(fEt,"drawSelectionRectangle"),o(mEt,"drawAxes"),o(yEt,"drawAtlases"),o(vEt,"getPickingIndexes"),o(xEt,"findNearestElementsWebgl"),o(bEt,"renderWebgl");var wEt,kEt={drawPolygonPath:function(t,e,r,n,i,a){var s=n/2,o=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],r+o*a[1]);for(var l=1;l0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)d.translate(-r.x1*l,-r.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(r.x1*l,r.y1*l);else{var g=e.pan(),f={x:g.x*l,y:g.y*l};l*=e.zoom(),d.translate(f.x,f.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-f.x,-f.y)}t.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=t.bg,d.rect(0,0,i,a),d.fill())}return u},o(LEt,"b64ToBlob"),o(NEt,"b64UriToB64"),o(IEt,"output"),AEt.png=function(t){return IEt(t,this.bufferCanvasImage(t),"image/png")},AEt.jpg=function(t){return IEt(t,this.bufferCanvasImage(t),"image/jpeg")};var REt={nodeShapeImpl:function(t,e,r,n,i,a,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,i,a);case"polygon":return this.drawPolygonPath(e,r,n,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,i,a,o);case"barrel":return this.drawBarrelPath(e,r,n,i,a)}}},MEt=OEt,DEt=OEt.prototype;function OEt(t){var e=this,r=e.cy.window().document;t.webgl&&(DEt.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(DEt.CANVAS_LAYERS),contexts:new Array(DEt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(DEt.CANVAS_LAYERS),bufferCanvases:new Array(DEt.BUFFER_COUNT),bufferContexts:new Array(DEt.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var a=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Yut()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var c=0;ce&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>r&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-r)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-r),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var r=this.rect.y;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var n=new c(e,r),i=t.inverseTransformPoint(n);this.setLocation(i.x,i.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=h},function(t,e,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}o(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(0),s=r(6),l=r(3),c=r(1),h=r(13),u=r(12),d=r(11);function p(t,e,r){n.call(this,r),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in o(p,"LGraph"),p.prototype=Object.create(n.prototype),n)p[g]=n[g];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(t,e,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.edges.push(i),i)},p.prototype.remove=function(t){var e=t;if(t instanceof l){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var r=e.edges.slice(),n=r.length,i=0;i-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(o,1),a.target!=a.source&&a.target.edges.splice(h,1),-1==(s=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(s,1)}},p.prototype.updateLeftTop=function(){for(var t,e,r,n=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l(t=c.getTop())&&(n=t),a>(e=c.getLeft())&&(a=e)}return n==i.MAX_VALUE?null:(r=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-r,this.top=n-r,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,r,n,a,s,o=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,u=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g(e=f.getLeft())&&(o=e),l<(r=f.getRight())&&(l=r),c>(n=f.getTop())&&(c=n),u<(a=f.getBottom())&&(u=a)}var m=new h(o,c,l-o,u-c);o==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},p.calculateBounds=function(t){for(var e,r,n,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d(e=p.getLeft())&&(s=e),o<(r=p.getRight())&&(o=r),l>(n=p.getTop())&&(l=n),c<(a=p.getBottom())&&(c=a)}return new h(s,l,o-s,c-l)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,r=e.length,n=0;n=this.nodes.length){var l=0;i.forEach((function(e){e.owner==t&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=p},function(t,e,r){var n,i=r(1);function a(t){n=r(5),this.layout=t,this.graphs=[],this.edges=[]}o(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},a.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=r,r=t;var a=(n=e).getOwner(),s=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==s)return r.isInterGraph=!1,a.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},a.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var r,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var a=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(a=1);var s=a*r[0],o=r[1]/a;r[0]s)return r[0]=n,r[1]=l,r[2]=a,r[3]=x,!1;if(ia)return r[0]=o,r[1]=i,r[2]=y,r[3]=s,!1;if(na?(r[0]=h,r[1]=u,T=!0):(r[0]=c,r[1]=l,T=!0):E===S&&(n>a?(r[0]=o,r[1]=l,T=!0):(r[0]=d,r[1]=u,T=!0)),-C===S?a>n?(r[2]=v,r[3]=x,_=!0):(r[2]=y,r[3]=m,_=!0):C===S&&(a>n?(r[2]=f,r[3]=m,_=!0):(r[2]=b,r[3]=x,_=!0)),T&&_)return!1;if(n>a?i>s?(A=this.getCardinalDirection(E,S,4),L=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-E,S,3),L=this.getCardinalDirection(-C,S,1)):i>s?(A=this.getCardinalDirection(-E,S,1),L=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(E,S,2),L=this.getCardinalDirection(C,S,4)),!T)switch(A){case 1:I=l,N=n+-g/S,r[0]=N,r[1]=I;break;case 2:N=d,I=i+p*S,r[0]=N,r[1]=I;break;case 3:I=u,N=n+g/S,r[0]=N,r[1]=I;break;case 4:N=h,I=i+-p*S,r[0]=N,r[1]=I}if(!_)switch(L){case 1:M=m,R=a+-k/S,r[2]=R,r[3]=M;break;case 2:R=b,M=s+w*S,r[2]=R,r[3]=M;break;case 3:M=x,R=a+k/S,r[2]=R,r[3]=M;break;case 4:R=v,M=s+-w*S,r[2]=R,r[3]=M}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=r.x,y=r.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new n((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}o(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r0&&e;){for(o.push(c[0]);o.length>0&&e;){var h=o[0];o.splice(0,1),s.add(h);var u=h.getEdges();for(a=0;a-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(r),a=0;a=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&l.push(t),n.set(t,e)}}))}r=r.concat(l),1!=e.length&&2!=e.length||(i=!0,a=e[0])}return a},p.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=p},function(t,e,r){function n(){}o(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(4);function i(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);ea.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),r=0;r0&&void 0!==arguments[0])||arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),i=new Set,t=0;t(l=e.getEstimatedSize()*this.gravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*a):(s>(l=e.getEstimatedSize()*this.compoundGravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=l.length||h>=l[0].length))for(var u=0;ut}),"_defaultCompareFunction")}]),t}();t.exports=s},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=r,this.match_score=n,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;rt.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(t,e){for(var r,n=this.getChild().getNodes(),i=0;i0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r1)for(o=0;on&&(n=Math.floor(s.y)),a=Math.floor(s.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(u.WORLD_CENTER_X-s.x/2,u.WORLD_CENTER_Y-s.y/2))},x.radialLayout=function(t,e,r){var n=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(e,null,0,359,0,n);var i=y.calculateBounds(t),a=new v;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(r.x),a.setWorldOrgY(r.y);for(var s=0;s1;){var y=f[0];f.splice(0,1);var v=h.indexOf(y);v>=0&&h.splice(v,1),g--,u--}d=null!=e?(h.indexOf(f[0])+1)%g:0;for(var b=Math.abs(n-r)/u,w=d;p!=u;w=++w%g){var k=h[w].getOtherEnd(t);if(k!=e){var T=(r+p*b)%360,_=(T+b)%360;x.branchRadialLayout(k,t,T,_,i+a,a),p++}}},x.maxDiagonalInTree=function(t){for(var e=f.MIN_VALUE,r=0;re&&(e=n)}return e},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var r=[],n=this.graphManager.getAllNodes(),i=0;i1){var n="DummyCompound_"+r;t.memberGroups[n]=e[r];var i=e[r][0].getParent(),a=new s(t.graphManager);a.id=n,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[n]=a;var o=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c=0;t--){var e=this.compoundOrder[t],r=e.id,n=e.paddingLeft,i=e.paddingTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,n,i)}},x.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var n=t.idToDummyNode[r],i=n.paddingLeft,a=n.paddingTop;t.adjustLocations(e[r],n.rect.x,n.rect.y,i,a)}))},x.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var n=r.getNodes(),i=0;i0)return this.toBeTiled[e]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[e]=!0,!0},x.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),r=0,n=0;nl&&(l=h.rect.height)}r+=l+t.verticalPadding}},x.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var i=e[n];r.tiledMemberPack[n]=r.tileNodes(t[n],i.paddingLeft+i.paddingRight),i.rect.width=r.tiledMemberPack[n].width,i.rect.height=r.tiledMemberPack[n].height}))},x.prototype.tileNodes=function(t,e){var r={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:c.TILING_PADDING_VERTICAL,horizontalPadding:c.TILING_PADDING_HORIZONTAL};t.sort((function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:t.rect.width*t.rect.height0&&(a+=t.horizontalPadding),t.rowWidth[r]=a,t.width0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[r]&&(o=t.rowHeight[r],t.rowHeight[r]=s,o=t.rowHeight[r]-o),t.height+=o,t.rows[r].push(e)},x.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,n=0;nr&&(e=n,r=t.rowWidth[n]);return e},x.prototype.canAddHorizontal=function(t,e,r){var n=this.getShortestRowIndex(t);if(n<0)return!0;var i=t.rowWidth[n];if(i+t.horizontalPadding+e<=t.width)return!0;var a,s,o=0;return t.rowHeight[n]0&&(o=r+t.verticalPadding-t.rowHeight[n]),a=t.width-i>=e+t.horizontalPadding?(t.height+o)/(i+e+t.horizontalPadding):(t.height+o)/t.width,o=r+t.verticalPadding,(s=t.widtha&&e!=r){n.splice(-1,1),t.rows[r].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[r]=t.rowWidth[r]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;os&&(s=n[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=s,t.rowHeight[r]0)for(var c=i;c<=a;c++)l[0]+=this.grid[c][s-1].length+this.grid[c][s].length-1;if(a0)for(c=s;c<=o;c++)l[3]+=this.grid[i-1][c].length+this.grid[i][c].length-1;for(var u,d,p=f.MAX_VALUE,g=0;g0)s=r.getGraphManager().add(r.newGraph(),a),this.processChildrenList(s,u,r)}},p.prototype.stop=function(){return this.stopped=!0,this};var f=o((function(t){t("layout","cose-bilkent",p)}),"register");"undefined"!=typeof cytoscape&&f(cytoscape),t.exports=f}])}))}}),ZEt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],p=[6,7,11],g=[1,6,13,15,16,19,22],f=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return n;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",a[o].id),n.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 16:n.getLogger().trace("Icon: ",a[o]),n.decorateNode({icon:a[o]});break;case 17:case 21:n.decorateNode({class:a[o]});break;case 18:n.getLogger().trace("SPACELIST");break;case 19:n.getLogger().trace("Node: ",a[o].id),n.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 20:n.decorateNode({icon:a[o]});break;case 25:n.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:n.getType(a[o-2],a[o])};break;case 26:this.$={id:a[o],descr:a[o],type:n.nodeType.DEFAULT};break;case 27:n.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:n.getType(a[o-2],a[o])}}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},{6:h,7:u,10:23,11:d},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:l}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:h,7:u,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},t(g,[2,14],{7:f,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(g,[2,13],{7:f,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},x=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return t.getLogger().trace("Found comment",e.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 24:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return t.getLogger().trace("Long description:",e.yytext),20}}),"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return t}();function b(){this.yy={}}return v.lexer=x,o(b,"Parser"),b.prototype=v,v.Parser=b,new b}();ZEt.parser=ZEt;var QEt=ZEt,JEt=[],tCt=0,eCt={},rCt=o((()=>{JEt=[],tCt=0,eCt={}}),"clear"),nCt=o((function(t){for(let e=JEt.length-1;e>=0;e--)if(JEt[e].levelJEt.length>0?JEt[0]:null),"getMindmap"),aCt=o(((t,e,r,n)=>{y.info("addNode",t,e,r,n);const i=Qr();let a=i.mindmap?.padding??Lt.mindmap.padding;switch(n){case sCt.ROUNDED_RECT:case sCt.RECT:case sCt.HEXAGON:a*=2}const s={id:tCt++,nodeId:hr(e,i),level:t,descr:hr(r,i),type:n,children:[],width:i.mindmap?.maxNodeWidth??Lt.mindmap.maxNodeWidth,padding:a},o=nCt(t);if(o)o.children.push(s),JEt.push(s);else{if(0!==JEt.length)throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")');JEt.push(s)}}),"addNode"),sCt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},oCt=o(((t,e)=>{switch(y.debug("In get type",t,e),t){case"[":return sCt.RECT;case"(":return")"===e?sCt.ROUNDED_RECT:sCt.CLOUD;case"((":return sCt.CIRCLE;case")":return sCt.CLOUD;case"))":return sCt.BANG;case"{{":return sCt.HEXAGON;default:return sCt.DEFAULT}}),"getType"),lCt=o(((t,e)=>{eCt[t]=e}),"setElementForId"),cCt=o((t=>{if(!t)return;const e=Qr(),r=JEt[JEt.length-1];t.icon&&(r.icon=hr(t.icon,e)),t.class&&(r.class=hr(t.class,e))}),"decorateNode"),hCt=o((t=>{switch(t){case sCt.DEFAULT:return"no-border";case sCt.RECT:return"rect";case sCt.ROUNDED_RECT:return"rounded-rect";case sCt.CIRCLE:return"circle";case sCt.CLOUD:return"cloud";case sCt.BANG:return"bang";case sCt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),uCt=o((()=>y),"getLogger"),dCt=o((t=>eCt[t]),"getElementById"),pCt={clear:rCt,addNode:aCt,getMindmap:iCt,nodeType:sCt,getType:oCt,setElementForId:lCt,decorateNode:cCt,type2Str:hCt,getLogger:uCt,getElementById:dCt},gCt=p(KEt(),1),fCt=o((function(t,e,r,n){e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 ${r.height-5} v${10-r.height} q0,-5 5,-5 h${r.width-10} q5,0 5,5 v${r.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",r.height).attr("x2",r.width).attr("y2",r.height)}),"defaultBkg"),mCt=o((function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("width",r.width)}),"rectBkg"),yCt=o((function(t,e,r){const n=r.width,i=r.height,a=.15*n,s=.25*n,o=.35*n,l=.2*n;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${.25*n},${-1*n*.1}\n a${o},${o} 1 0,1 ${.4*n},${-1*n*.1}\n a${s},${s} 1 0,1 ${.35*n},${1*n*.2}\n\n a${a},${a} 1 0,1 ${.15*n},${1*i*.35}\n a${l},${l} 1 0,1 ${-1*n*.15},${1*i*.65}\n\n a${s},${a} 1 0,1 ${-1*n*.25},${.15*n}\n a${o},${o} 1 0,1 ${-1*n*.5},0\n a${a},${a} 1 0,1 ${-1*n*.25},${-1*n*.15}\n\n a${a},${a} 1 0,1 ${-1*n*.1},${-1*i*.35}\n a${l},${l} 1 0,1 ${.1*n},${-1*i*.65}\n\n H0 V0 Z`)}),"cloudBkg"),vCt=o((function(t,e,r){const n=r.width,i=r.height,a=.15*n;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${.25*n},${-1*i*.1}\n a${a},${a} 1 0,0 ${.25*n},0\n a${a},${a} 1 0,0 ${.25*n},0\n a${a},${a} 1 0,0 ${.25*n},${1*i*.1}\n\n a${a},${a} 1 0,0 ${.15*n},${1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${1*i*.34}\n a${a},${a} 1 0,0 ${-1*n*.15},${1*i*.33}\n\n a${a},${a} 1 0,0 ${-1*n*.25},${.15*i}\n a${a},${a} 1 0,0 ${-1*n*.25},0\n a${a},${a} 1 0,0 ${-1*n*.25},0\n a${a},${a} 1 0,0 ${-1*n*.25},${-1*i*.15}\n\n a${a},${a} 1 0,0 ${-1*n*.1},${-1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${-1*i*.34}\n a${a},${a} 1 0,0 ${.1*n},${-1*i*.33}\n\n H0 V0 Z`)}),"bangBkg"),xCt=o((function(t,e,r){e.append("circle").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("r",r.width/2)}),"circleBkg");function bCt(t,e,r,n,i){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(i.width-e)/2+", "+r+")")}o(bCt,"insertPolygonShape");var wCt=o((function(t,e,r){const n=r.height,i=n/4,a=r.width-r.padding+2*i;bCt(e,a,n,[{x:i,y:0},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:i,y:-n},{x:0,y:-n/2}],r)}),"hexagonBkg"),kCt=o((function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("rx",r.padding).attr("ry",r.padding).attr("width",r.width)}),"roundedRectBkg"),TCt=o((async function(t,e,r,n,i){const a=i.htmlLabels,s=n%11,o=e.append("g");r.section=s;let l="section-"+s;s<0&&(l+=" section-root"),o.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+l);const c=o.append("g"),h=o.append("g"),u=r.descr.replace(/()/g,"\n");await v_(h,u,{useHtmlLabels:a,width:r.width,classes:"mindmap-node-label"},i),a||h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=h.node().getBBox(),[p]=Dk(i.fontSize);if(r.height=d.height+1.1*p*.5+r.padding,r.width=d.width+2*r.padding,r.icon)if(r.type===t.nodeType.CIRCLE){r.height+=50,r.width+=50;o.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),h.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")")}else{r.width+=50;const t=r.height;r.height=Math.max(t,60);const e=Math.abs(r.height-t);o.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+e/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),h.attr("transform","translate("+(25+r.width/2)+", "+(e/2+r.padding/2)+")")}else if(a){const t=(r.width-d.width)/2,e=(r.height-d.height)/2;h.attr("transform","translate("+t+", "+e+")")}else{const t=r.width/2,e=r.padding/2;h.attr("transform","translate("+t+", "+e+")")}switch(r.type){case t.nodeType.DEFAULT:fCt(t,c,r,s);break;case t.nodeType.ROUNDED_RECT:kCt(t,c,r,s);break;case t.nodeType.RECT:mCt(t,c,r,s);break;case t.nodeType.CIRCLE:c.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),xCt(t,c,r,s);break;case t.nodeType.CLOUD:yCt(t,c,r,s);break;case t.nodeType.BANG:vCt(t,c,r,s);break;case t.nodeType.HEXAGON:wCt(t,c,r,s)}return t.setElementForId(r.id,o),r.height}),"drawNode"),_Ct=o((function(t,e){const r=t.getElementById(e.id),n=e.x||0,i=e.y||0;r.attr("transform","translate("+n+","+i+")")}),"positionNode");async function ECt(t,e,r,n,i){await TCt(t,e,r,n,i),r.children&&await Promise.all(r.children.map(((r,a)=>ECt(t,e,r,n<0?a:n,i))))}function CCt(t,e){e.edges().map(((e,r)=>{const n=e.data();if(e[0]._private.bodyBounds){const i=e[0]._private.rscratch;y.trace("Edge: ",r,n),t.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}}))}function SCt(t,e,r,n){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:n,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach((i=>{SCt(i,e,r,n+1),e.add({group:"edges",data:{id:`${t.id}_${i.id}`,source:t.id,target:i.id,depth:n,section:i.section}})}))}function ACt(t,e){return new Promise((r=>{const n=Ga("body").append("div").attr("id","cy").attr("style","display:none"),i=HEt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});n.remove(),SCt(t,i,e,0),i.nodes().forEach((function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}})),i.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),i.ready((t=>{y.info("Ready",t),r(i)}))}))}function LCt(t,e){e.nodes().map(((e,r)=>{const n=e.data();n.x=e.position().x,n.y=e.position().y,_Ct(t,n);const i=t.getElementById(n.nodeId);y.info("Id:",r,"Position: (",e.position().x,", ",e.position().y,")",n),i.attr("transform",`translate(${e.position().x-n.width/2}, ${e.position().y-n.height/2})`),i.attr("attr",`apa-${r})`)}))}HEt.use(gCt.default),o(ECt,"drawNodes"),o(CCt,"drawEdges"),o(SCt,"addNodes"),o(ACt,"layoutMindmap"),o(LCt,"positionNodes");var NCt=o((async(t,e,r,n)=>{y.debug("Rendering mindmap diagram\n"+t);const i=n.db,a=i.getMindmap();if(!a)return;const s=Qr();s.htmlLabels=!1;const o=ag(e),l=o.append("g");l.attr("class","mindmap-edges");const c=o.append("g");c.attr("class","mindmap-nodes"),await ECt(i,c,a,-1,s);const h=await ACt(a,s);CCt(l,h),LCt(i,h),Mr(void 0,o,s.mindmap?.padding??Lt.mindmap.padding,s.mindmap?.useMaxWidth??Lt.mindmap.useMaxWidth)}),"draw"),ICt={draw:NCt},RCt=o((t=>{let e="";for(let e=0;e`\n .edge {\n stroke-width: 3;\n }\n ${RCt(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")},DCt=Object.freeze({__proto__:null,diagram:MCt}),OCt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],p=[6,7,11],g=[1,31],f=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return n;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",a[o-1].id),n.addNode(a[o-2].length,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 16:n.getLogger().info("Node: ",a[o].id),n.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 17:n.getLogger().trace("Icon: ",a[o]),n.decorateNode({icon:a[o]});break;case 18:case 23:n.decorateNode({class:a[o]});break;case 19:n.getLogger().trace("SPACELIST");break;case 20:n.getLogger().trace("Node: ",a[o-1].id),n.addNode(0,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 21:n.getLogger().trace("Node: ",a[o].id),n.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 22:n.decorateNode({icon:a[o]});break;case 27:n.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:n.getType(a[o-2],a[o])};break;case 28:this.$={id:a[o],descr:a[o],type:0};break;case 29:n.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:n.getType(a[o-2],a[o])};break;case 30:this.$=a[o-1]+a[o];break;case 31:this.$=a[o]}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:l},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:l},{6:h,7:u,10:23,11:d},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:l}),t(p,[2,19]),t(p,[2,21],{15:30,24:g}),t(p,[2,22]),t(p,[2,23]),t(f,[2,25]),t(f,[2,26]),t(f,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:l},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(p,[2,16],{15:37,24:g}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(f,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(p,[2,15],{24:b}),t(f,[2,30]),{22:[1,41]},t(f,[2,27]),t(f,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},k=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const r=/\n\s*/g;return e.yytext=e.yytext.replace(r,"
    "),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}}),"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return t}();function T(){this.yy={}}return w.lexer=k,o(T,"Parser"),T.prototype=w,w.Parser=T,new T}();OCt.parser=OCt;var PCt=OCt,BCt=[],$Ct=[],FCt=0,zCt={},UCt=o((()=>{BCt=[],$Ct=[],FCt=0,zCt={}}),"clear"),GCt=o((t=>{if(0===BCt.length)return null;const e=BCt[0].level;let r=null;for(let t=BCt.length-1;t>=0;t--)if(BCt[t].level!==e||r||(r=BCt[t]),BCt[t].levelt.parentId===n.id));for(const e of i){const i={id:e.id,parentId:n.id,label:hr(e.label??"",r),isGroup:!1,ticket:e?.ticket,priority:e?.priority,assigned:e?.assigned,icon:e?.icon,shape:"kanbanItem",level:e.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(i)}}return{nodes:t,edges:[],other:{},config:Qr()}}),"getData"),WCt=o(((t,e,r,n,i)=>{const a=Qr();let s=a.mindmap?.padding??Lt.mindmap.padding;switch(n){case YCt.ROUNDED_RECT:case YCt.RECT:case YCt.HEXAGON:s*=2}const o={id:hr(e,a)||"kbn"+FCt++,level:t,label:hr(r,a),width:a.mindmap?.maxNodeWidth??Lt.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(void 0!==i){let t;t=i.includes("\n")?i+"\n":"{\n"+i+"\n}";const e=oy(t,{schema:sy});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(o.shape=e?.shape),e?.label&&(o.label=e?.label),e?.icon&&(o.icon=e?.icon.toString()),e?.assigned&&(o.assigned=e?.assigned.toString()),e?.ticket&&(o.ticket=e?.ticket.toString()),e?.priority&&(o.priority=e?.priority)}const l=GCt(t);l?o.parentId=l.id||"kbn"+FCt++:$Ct.push(o),BCt.push(o)}),"addNode"),YCt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},HCt=o(((t,e)=>{switch(y.debug("In get type",t,e),t){case"[":return YCt.RECT;case"(":return")"===e?YCt.ROUNDED_RECT:YCt.CLOUD;case"((":return YCt.CIRCLE;case")":return YCt.CLOUD;case"))":return YCt.BANG;case"{{":return YCt.HEXAGON;default:return YCt.DEFAULT}}),"getType"),VCt=o(((t,e)=>{zCt[t]=e}),"setElementForId"),XCt=o((t=>{if(!t)return;const e=Qr(),r=BCt[BCt.length-1];t.icon&&(r.icon=hr(t.icon,e)),t.class&&(r.cssClasses=hr(t.class,e))}),"decorateNode"),KCt=o((t=>{switch(t){case YCt.DEFAULT:return"no-border";case YCt.RECT:return"rect";case YCt.ROUNDED_RECT:return"rounded-rect";case YCt.CIRCLE:return"circle";case YCt.CLOUD:return"cloud";case YCt.BANG:return"bang";case YCt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),ZCt=o((()=>y),"getLogger"),QCt=o((t=>zCt[t]),"getElementById"),JCt={clear:UCt,addNode:WCt,getSections:qCt,getData:jCt,nodeType:YCt,getType:HCt,setElementForId:VCt,decorateNode:XCt,type2Str:KCt,getLogger:ZCt,getElementById:QCt},tSt=o((async(t,e,r,n)=>{y.debug("Rendering kanban diagram\n"+t);const i=n.db.getData(),a=Qr();a.htmlLabels=!1;const s=ag(e),o=s.append("g");o.attr("class","sections");const l=s.append("g");l.attr("class","items");const c=i.nodes.filter((t=>t.isGroup));let h=0;const u=[];let d=25;for(const t of c){const e=a?.kanban?.sectionWidth||200;h+=1,t.x=e*h+10*(h-1)/2,t.width=e,t.y=0,t.height=3*e,t.rx=5,t.ry=5,t.cssClasses=t.cssClasses+" section-"+h;const r=await XE(o,t);d=Math.max(d,r?.labelBBox?.height),u.push(r)}let p=0;for(const t of c){const e=u[p];p+=1;const r=a?.kanban?.sectionWidth||200,n=3*-r/2+d;let s=n;const o=i.nodes.filter((e=>e.parentId===t.id));for(const e of o){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=t.x,e.width=r-15;const n=(await GS(l,e,{config:a})).node().getBBox();e.y=s+n.height/2,await WS(e),s=e.y+n.height/2+5}const c=e.cluster.select("rect"),h=Math.max(s-n+30,50)+(d-25);c.attr("height",h)}Mr(void 0,s,a.mindmap?.padding??Lt.kanban.padding,a.mindmap?.useMaxWidth??Lt.kanban.useMaxWidth)}),"draw"),eSt={draw:tSt},rSt=o((t=>{let e="";for(let e=0;et.darkMode?ot(e,r):st(e,r)),"adjuster");for(let n=0;n`\n .edge {\n stroke-width: 3;\n }\n ${rSt(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")},iSt=Object.freeze({__proto__:null,diagram:nSt}),aSt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 7:const t=n.findOrCreateNode(a[o-4].trim().replaceAll('""','"')),e=n.findOrCreateNode(a[o-2].trim().replaceAll('""','"')),r=parseFloat(a[o].trim());n.addLink(t,e,r);break;case 8:case 9:case 11:this.$=a[o];break;case 10:this.$=a[o-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},a=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return t}();function s(){this.yy={}}return i.lexer=a,o(s,"Parser"),s.prototype=i,i.Parser=s,new s}();aSt.parser=aSt;var sSt=aSt,oSt=[],lSt=[],cSt=new Map,hSt=o((()=>{oSt=[],lSt=[],cSt=new Map,qr()}),"clear"),uSt=class{constructor(t,e,r=0){this.source=t,this.target=e,this.value=r}static{o(this,"SankeyLink")}},dSt=o(((t,e,r)=>{oSt.push(new uSt(t,e,r))}),"addLink"),pSt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},gSt=o((t=>{t=Lr.sanitizeText(t,Qr());let e=cSt.get(t);return void 0===e&&(e=new pSt(t),cSt.set(t,e),lSt.push(e)),e}),"findOrCreateNode"),fSt=o((()=>lSt),"getNodes"),mSt=o((()=>oSt),"getLinks"),ySt=o((()=>({nodes:lSt.map((t=>({id:t.ID}))),links:oSt.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),vSt={nodesMap:cSt,getConfig:o((()=>Qr().sankey),"getConfig"),getNodes:fSt,getLinks:mSt,getGraph:ySt,addLink:dSt,findOrCreateNode:gSt,getAccTitle:Wr,setAccTitle:jr,getAccDescription:Hr,setAccDescription:Yr,getDiagramTitle:Xr,setDiagramTitle:Vr,clear:hSt};function xSt(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r=i)&&(r=i)}return r}function bSt(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function wSt(t,e){let r=0;if(void 0===e)for(let e of t)(e=+e)&&(r+=e);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function kSt(t){return t.target.depth}function TSt(t){return t.depth}function _St(t,e){return e-1-t.height}function ESt(t,e){return t.sourceLinks.length?t.depth:e-1}function CSt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?bSt(t.sourceLinks,kSt)-1:0}function SSt(t){return function(){return t}}function ASt(t,e){return NSt(t.source,e.source)||t.index-e.index}function LSt(t,e){return NSt(t.target,e.target)||t.index-e.index}function NSt(t,e){return t.y0-e.y0}function ISt(t){return t.value}function RSt(t){return t.index}function MSt(t){return t.nodes}function DSt(t){return t.links}function OSt(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function PSt({nodes:t}){for(const e of t){let t=e.y0,r=t;for(const r of e.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const t of e.targetLinks)t.y1=r+t.width/2,r+=t.width}}function BSt(){let t,e,r,n=0,i=0,a=1,s=1,l=24,c=8,h=RSt,u=ESt,d=MSt,p=DSt,g=6;function f(){const t={nodes:d.apply(null,arguments),links:p.apply(null,arguments)};return m(t),y(t),v(t),x(t),k(t),PSt(t),t}function m({nodes:t,links:e}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const n=new Map(t.map(((e,r)=>[h(e,r,t),e])));for(const[t,r]of e.entries()){r.index=t;let{source:e,target:i}=r;"object"!=typeof e&&(e=r.source=OSt(n,e)),"object"!=typeof i&&(i=r.target=OSt(n,i)),e.sourceLinks.push(r),i.targetLinks.push(r)}if(null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}function y({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(wSt(e.sourceLinks,ISt),wSt(e.targetLinks,ISt)):e.fixedValue}function v({nodes:t}){const e=t.length;let r=new Set(t),n=new Set,i=0;for(;r.size;){for(const t of r){t.depth=i;for(const{target:e}of t.sourceLinks)n.add(e)}if(++i>e)throw new Error("circular link");r=n,n=new Set}}function x({nodes:t}){const e=t.length;let r=new Set(t),n=new Set,i=0;for(;r.size;){for(const t of r){t.height=i;for(const{source:e}of t.targetLinks)n.add(e)}if(++i>e)throw new Error("circular link");r=n,n=new Set}}function b({nodes:t}){const r=xSt(t,(t=>t.depth))+1,i=(a-n-l)/(r-1),s=new Array(r);for(const e of t){const t=Math.max(0,Math.min(r-1,Math.floor(u.call(null,e,r))));e.layer=t,e.x0=n+t*i,e.x1=e.x0+l,s[t]?s[t].push(e):s[t]=[e]}if(e)for(const t of s)t.sort(e);return s}function w(e){const r=bSt(e,(e=>(s-i-(e.length-1)*t)/wSt(e,ISt)));for(const n of e){let e=i;for(const i of n){i.y0=e,i.y1=e+i.value*r,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*r}e=(s-e+t)/(n.length+1);for(let t=0;tt.length))-1)),w(r);for(let t=0;t0))continue;let i=(e/n-t.y0)*r;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(NSt),E(a,n)}}function _(t,r,n){for(let i=t.length-2;i>=0;--i){const a=t[i];for(const t of a){let e=0,n=0;for(const{target:r,value:i}of t.sourceLinks){let a=i*(r.layer-t.layer);e+=I(t,r)*a,n+=a}if(!(n>0))continue;let i=(e/n-t.y0)*r;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(NSt),E(a,n)}}function E(e,r){const n=e.length>>1,a=e[n];S(e,a.y0-t,n-1,r),C(e,a.y1+t,n+1,r),S(e,s,e.length-1,r),C(e,i,0,r)}function C(e,r,n,i){for(;n1e-6&&(a.y0+=s,a.y1+=s),r=a.y1+t}}function S(e,r,n,i){for(;n>=0;--n){const a=e[n],s=(a.y1-r)*i;s>1e-6&&(a.y0-=s,a.y1-=s),r=a.y0-t}}function A({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(LSt);for(const{target:{targetLinks:e}}of t)e.sort(ASt)}}function L(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(LSt),r.sort(ASt)}function N(e,r){let n=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:a}of e.sourceLinks){if(i===r)break;n+=a+t}for(const{source:t,width:i}of r.targetLinks){if(t===e)break;n-=i}return n}function I(e,r){let n=r.y0-(r.targetLinks.length-1)*t/2;for(const{source:i,width:a}of r.targetLinks){if(i===e)break;n+=a+t}for(const{target:t,width:i}of e.sourceLinks){if(t===r)break;n-=i}return n}return o(f,"sankey"),f.update=function(t){return PSt(t),t},f.nodeId=function(t){return arguments.length?(h="function"==typeof t?t:SSt(t),f):h},f.nodeAlign=function(t){return arguments.length?(u="function"==typeof t?t:SSt(t),f):u},f.nodeSort=function(t){return arguments.length?(e=t,f):e},f.nodeWidth=function(t){return arguments.length?(l=+t,f):l},f.nodePadding=function(e){return arguments.length?(c=t=+e,f):c},f.nodes=function(t){return arguments.length?(d="function"==typeof t?t:SSt(t),f):d},f.links=function(t){return arguments.length?(p="function"==typeof t?t:SSt(t),f):p},f.linkSort=function(t){return arguments.length?(r=t,f):r},f.size=function(t){return arguments.length?(n=i=0,a=+t[0],s=+t[1],f):[a-n,s-i]},f.extent=function(t){return arguments.length?(n=+t[0][0],a=+t[1][0],i=+t[0][1],s=+t[1][1],f):[[n,i],[a,s]]},f.iterations=function(t){return arguments.length?(g=+t,f):g},o(m,"computeNodeLinks"),o(y,"computeNodeValues"),o(v,"computeNodeDepths"),o(x,"computeNodeHeights"),o(b,"computeNodeLayers"),o(w,"initializeNodeBreadths"),o(k,"computeNodeBreadths"),o(T,"relaxLeftToRight"),o(_,"relaxRightToLeft"),o(E,"resolveCollisions"),o(C,"resolveCollisionsTopToBottom"),o(S,"resolveCollisionsBottomToTop"),o(A,"reorderNodeLinks"),o(L,"reorderLinks"),o(N,"targetTop"),o(I,"sourceTop"),f}o(xSt,"max"),o(bSt,"min"),o(wSt,"sum"),o(kSt,"targetDepth"),o(TSt,"left"),o(_St,"right"),o(ESt,"justify"),o(CSt,"center"),o(SSt,"constant"),o(ASt,"ascendingSourceBreadth"),o(LSt,"ascendingTargetBreadth"),o(NSt,"ascendingBreadth"),o(ISt,"value"),o(RSt,"defaultId"),o(MSt,"defaultNodes"),o(DSt,"defaultLinks"),o(OSt,"find"),o(PSt,"computeLinkBreadths"),o(BSt,"Sankey");var $St=Math.PI,FSt=2*$St,zSt=1e-6,USt=FSt-zSt;function GSt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function qSt(){return new GSt}o(GSt,"Path"),o(qSt,"path"),GSt.prototype=qSt.prototype={constructor:GSt,moveTo:o((function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)}),"moveTo"),closePath:o((function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}),"closePath"),lineTo:o((function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)}),"lineTo"),quadraticCurveTo:o((function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)}),"quadraticCurveTo"),bezierCurveTo:o((function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)}),"bezierCurveTo"),arcTo:o((function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,c=a-t,h=s-e,u=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>zSt)if(Math.abs(h*o-l*c)>zSt&&i){var d=r-a,p=n-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan(($St-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>zSt&&(this._+="L"+(t+x*c)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+b*o)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;}),"arcTo"),arc:o((function(t,e,r,n,i,a){t=+t,e=+e,a=!!a;var s=(r=+r)*Math.cos(n),o=r*Math.sin(n),l=t+s,c=e+o,h=1^a,u=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>zSt||Math.abs(this._y1-c)>zSt)&&(this._+="L"+l+","+c),r&&(u<0&&(u=u%FSt+FSt),u>USt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>zSt&&(this._+="A"+r+","+r+",0,"+ +(u>=$St)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))}),"arc"),rect:o((function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"}),"rect"),toString:o((function(){return this._}),"toString")};var jSt=qSt;function WSt(t){return o((function(){return t}),"constant")}function YSt(t){return t[0]}function HSt(t){return t[1]}o(WSt,"default"),o(YSt,"x"),o(HSt,"y");var VSt=Array.prototype.slice;function XSt(t){return t.source}function KSt(t){return t.target}function ZSt(t){var e=XSt,r=KSt,n=YSt,i=HSt,a=null;function s(){var s,o=VSt.call(arguments),l=e.apply(this,o),c=r.apply(this,o);if(a||(a=s=jSt()),t(a,+n.apply(this,(o[0]=l,o)),+i.apply(this,o),+n.apply(this,(o[0]=c,o)),+i.apply(this,o)),s)return a=null,s+""||null}return o(s,"link"),s.source=function(t){return arguments.length?(e=t,s):e},s.target=function(t){return arguments.length?(r=t,s):r},s.x=function(t){return arguments.length?(n="function"==typeof t?t:WSt(+t),s):n},s.y=function(t){return arguments.length?(i="function"==typeof t?t:WSt(+t),s):i},s.context=function(t){return arguments.length?(a=null==t?null:t,s):a},s}function QSt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function JSt(){return ZSt(QSt)}function tAt(t){return[t.source.x1,t.y0]}function eAt(t){return[t.target.x0,t.y1]}function rAt(){return JSt().source(tAt).target(eAt)}o(XSt,"linkSource"),o(KSt,"linkTarget"),o(ZSt,"link"),o(QSt,"curveHorizontal"),o(JSt,"linkHorizontal"),o(tAt,"horizontalSource"),o(eAt,"horizontalTarget"),o(rAt,"default");var nAt=class t{static{o(this,"Uid")}static{this.count=0}static next(e){return new t(e+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},iAt={left:TSt,right:_St,center:CSt,justify:ESt},aAt=o((function(t,e,r,n){const{securityLevel:i,sankey:a}=Qr(),s=tn.sankey;let l;"sandbox"===i&&(l=Ga("#i"+e));const c=Ga("sandbox"===i?l.nodes()[0].contentDocument.body:"body"),h="sandbox"===i?c.select(`[id="${e}"]`):Ga(`[id="${e}"]`),u=a?.width??s.width,d=a?.height??s.width,p=a?.useMaxWidth??s.useMaxWidth,g=a?.nodeAlignment??s.nodeAlignment,f=a?.prefix??s.prefix,m=a?.suffix??s.suffix,y=a?.showValues??s.showValues,v=n.db.getGraph(),x=iAt[g],b=BSt().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(y?15:0)).nodeAlign(x).extent([[0,0],[u,d]]);b(v);const w=So(Ih);h.append("g").attr("class","nodes").selectAll(".node").data(v.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=nAt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>w(t.id)));const k=o((({id:t,value:e})=>y?`${t}\n${f}${Math.round(100*e)/100}${m}`:t),"getText");h.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(v.nodes).join("text").attr("x",(t=>t.x0(t.y1+t.y0)/2)).attr("dy",(y?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0(t.uid=nAt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>w(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>w(t.target.id)))}let E;switch(_){case"gradient":E=o((t=>t.uid),"coloring");break;case"source":E=o((t=>w(t.source.id)),"coloring");break;case"target":E=o((t=>w(t.target.id)),"coloring");break;default:E=_}T.append("path").attr("d",rAt()).attr("stroke",E).attr("stroke-width",(t=>Math.max(1,t.width))),Mr(void 0,h,0,p)}),"draw"),sAt={draw:aAt},oAt=o((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),lAt=o((t=>`.label {\n font-family: ${t.fontFamily};\n }`),"getStyles"),cAt=sSt.parse.bind(sSt);sSt.parse=t=>cAt(oAt(t));var hAt={styles:lAt,parser:sSt,db:vSt,renderer:sAt},uAt=Object.freeze({__proto__:null,diagram:hAt}),dAt={packet:[]},pAt=structuredClone(dAt),gAt=Lt.packet,fAt=o((()=>{const t=Ok({...gAt,...Gt().packet});return t.showBits&&(t.paddingY+=10),t}),"getConfig"),mAt=o((()=>pAt.packet),"getPacket"),yAt={pushWord:o((t=>{t.length>0&&pAt.packet.push(t)}),"pushWord"),getPacket:mAt,getConfig:fAt,clear:o((()=>{qr(),pAt=structuredClone(dAt)}),"clear"),setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr},vAt=o((t=>{IX(t,yAt);let e=-1,r=[],n=1;const{bitsPerRow:i}=yAt.getConfig();for(let{start:a,end:s,label:o}of t.blocks){if(s&&s{if(void 0===t.end&&(t.end=t.start),t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);return t.end+1<=e*r?[t,void 0]:[{start:t.start,end:e*r-1,label:t.label},{start:e*r,end:t.end,label:t.label}]}),"getNextFittingBlock"),bAt={parse:o((async t=>{const e=await Tet("packet",t);y.debug(e),vAt(e)}),"parse")},wAt=o(((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:c}=a,h=i.getPacket(),u=i.getDiagramTitle(),d=s+o,p=d*(h.length+1)-(u?0:s),g=l*c+2,f=ag(e);f.attr("viewbox",`0 0 ${g} ${p}`),Rr(f,p,g,a.useMaxWidth);for(const[t,e]of h.entries())kAt(f,e,t,a);f.append("text").text(u).attr("x",g/2).attr("y",p-d/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")}),"draw"),kAt=o(((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const c=t.append("g"),h=r*(n+a)+a;for(const t of e){const e=t.start%o*s+1,r=(t.end-t.start+1)*s-i;if(c.append("rect").attr("x",e).attr("y",h).attr("width",r).attr("height",n).attr("class","packetBlock"),c.append("text").attr("x",e+r/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(t.label),!l)continue;const a=t.end===t.start,u=h-2;c.append("text").attr("x",e+(a?r/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",a?"middle":"start").text(t.start),a||c.append("text").attr("x",e+r).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(t.end)}}),"drawWord"),TAt={draw:wAt},_At={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},EAt=o((({packet:t}={})=>{const e=Ok(_At,t);return`\n\t.packetByte {\n\t\tfont-size: ${e.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${e.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${e.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${e.labelColor};\n\t\tfont-size: ${e.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${e.titleColor};\n\t\tfont-size: ${e.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${e.blockStrokeColor};\n\t\tstroke-width: ${e.blockStrokeWidth};\n\t\tfill: ${e.blockFillColor};\n\t}\n\t`}),"styles"),CAt={parser:bAt,db:yAt,renderer:TAt,styles:EAt},SAt=Object.freeze({__proto__:null,diagram:CAt}),AAt={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},LAt={axes:[],curves:[],options:AAt},NAt=structuredClone(LAt),IAt=Lt.radar,RAt=o((()=>Ok({...IAt,...Gt().radar})),"getConfig"),MAt=o((()=>NAt.axes),"getAxes"),DAt=o((()=>NAt.curves),"getCurves"),OAt=o((()=>NAt.options),"getOptions"),PAt=o((t=>{NAt.axes=t.map((t=>({name:t.name,label:t.label??t.name})))}),"setAxes"),BAt=o((t=>{NAt.curves=t.map((t=>({name:t.name,label:t.label??t.name,entries:$At(t.entries)})))}),"setCurves"),$At=o((t=>{if(null==t[0].axis)return t.map((t=>t.value));const e=MAt();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map((e=>{const r=t.find((t=>t.axis?.$refText===e.name));if(void 0===r)throw new Error("Missing entry for axis "+e.label);return r.value}))}),"computeCurveEntries"),FAt=o((t=>{const e=t.reduce(((t,e)=>(t[e.name]=e,t)),{});NAt.options={showLegend:e.showLegend?.value??AAt.showLegend,ticks:e.ticks?.value??AAt.ticks,max:e.max?.value??AAt.max,min:e.min?.value??AAt.min,graticule:e.graticule?.value??AAt.graticule}}),"setOptions"),zAt={getAxes:MAt,getCurves:DAt,getOptions:OAt,setAxes:PAt,setCurves:BAt,setOptions:FAt,getConfig:RAt,clear:o((()=>{qr(),NAt=structuredClone(LAt)}),"clear"),setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr},UAt=o((t=>{IX(t,zAt);const{axes:e,curves:r,options:n}=t;zAt.setAxes(e),zAt.setCurves(r),zAt.setOptions(n)}),"populate"),GAt={parse:o((async t=>{const e=await Tet("radar",t);y.debug(e),UAt(e)}),"parse")},qAt=o(((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),c=i.getDiagramTitle(),h=ag(e),u=jAt(h,l),d=o.max??Math.max(...s.map((t=>Math.max(...t.entries)))),p=o.min,g=Math.min(l.width,l.height)/2;WAt(u,a,g,o.ticks,o.graticule),YAt(u,a,g,l),HAt(u,a,s,p,d,o.graticule,l),KAt(u,s,o.showLegend,l),u.append("text").attr("class","radarTitle").text(c).attr("x",0).attr("y",-l.height/2-l.marginTop)}),"draw"),jAt=o(((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i=e.marginLeft+e.width/2,a=e.marginTop+e.height/2;return t.attr("viewbox",`0 0 ${r} ${n}`).attr("width",r).attr("height",n),t.append("g").attr("transform",`translate(${i}, ${a})`)}),"drawFrame"),WAt=o(((t,e,r,n,i)=>{if("circle"===i)for(let e=0;e{const r=2*e*Math.PI/i-Math.PI/2;return`${s*Math.cos(r)},${s*Math.sin(r)}`})).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}}),"drawGraticule"),YAt=o(((t,e,r,n)=>{const i=e.length;for(let a=0;a{if(e.entries.length!==o)return;const c=e.entries.map(((t,e)=>{const r=2*Math.PI*e/o-Math.PI/2,a=VAt(t,n,i,l);return{x:a*Math.cos(r),y:a*Math.sin(r)}}));"circle"===a?t.append("path").attr("d",XAt(c,s.curveTension)).attr("class",`radarCurve-${r}`):"polygon"===a&&t.append("polygon").attr("points",c.map((t=>`${t.x},${t.y}`)).join(" ")).attr("class",`radarCurve-${r}`)}))}function VAt(t,e,r,n){return n*(Math.min(Math.max(t,e),r)-e)/(r-e)}function XAt(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const n=t.append("g").attr("transform",`translate(${i}, ${a+20*r})`);n.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${r}`),n.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)}))}o(HAt,"drawCurves"),o(VAt,"relativeRadius"),o(XAt,"closedRoundCurve"),o(KAt,"drawLegend");var ZAt={draw:qAt},QAt=o(((t,e)=>{let r="";for(let n=0;n{const e=Ok(bt(),Gt().themeVariables);return{themeVariables:e,radarOptions:Ok(e.radar,t)}}),"buildRadarStyleOptions"),tLt=o((({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=JAt(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${r.axisColor};\n\t\tstroke-width: ${r.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${r.axisLabelFontSize}px;\n\t\tcolor: ${r.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${r.graticuleColor};\n\t\tfill-opacity: ${r.graticuleOpacity};\n\t\tstroke: ${r.graticuleColor};\n\t\tstroke-width: ${r.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${r.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${QAt(e,r)}\n\t`}),"styles"),eLt={parser:GAt,db:zAt,renderer:ZAt,styles:tLt},rLt=Object.freeze({__proto__:null,diagram:eLt}),nLt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,7],r=[1,13],n=[1,14],i=[1,15],a=[1,19],s=[1,16],l=[1,17],c=[1,18],h=[8,30],u=[8,21,28,29,30,31,32,40,44,47],d=[1,23],p=[1,24],g=[8,15,16,21,28,29,30,31,32,40,44,47],f=[8,15,16,21,27,28,29,30,31,32,40,44,47],m=[1,49],y={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 4:n.getLogger().debug("Rule: separator (NL) ");break;case 5:n.getLogger().debug("Rule: separator (Space) ");break;case 6:n.getLogger().debug("Rule: separator (EOF) ");break;case 7:n.getLogger().debug("Rule: hierarchy: ",a[o-1]),n.setHierarchy(a[o-1]);break;case 8:n.getLogger().debug("Stop NL ");break;case 9:n.getLogger().debug("Stop EOF ");break;case 10:n.getLogger().debug("Stop NL2 ");break;case 11:n.getLogger().debug("Stop EOF2 ");break;case 12:n.getLogger().debug("Rule: statement: ",a[o]),"number"==typeof a[o].length?this.$=a[o]:this.$=[a[o]];break;case 13:n.getLogger().debug("Rule: statement #2: ",a[o-1]),this.$=[a[o-1]].concat(a[o]);break;case 14:n.getLogger().debug("Rule: link: ",a[o],t),this.$={edgeTypeStr:a[o],label:""};break;case 15:n.getLogger().debug("Rule: LABEL link: ",a[o-3],a[o-1],a[o]),this.$={edgeTypeStr:a[o],label:a[o-1]};break;case 18:const e=parseInt(a[o]),r=n.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:n.getLogger().debug("Rule: (nodeStatement link node) ",a[o-2],a[o-1],a[o]," typestr: ",a[o-1].edgeTypeStr);const i=n.edgeStrToEdgeData(a[o-1].edgeTypeStr);this.$=[{id:a[o-2].id,label:a[o-2].label,type:a[o-2].type,directions:a[o-2].directions},{id:a[o-2].id+"-"+a[o].id,start:a[o-2].id,end:a[o].id,label:a[o-1].label,type:"edge",directions:a[o].directions,arrowTypeEnd:i,arrowTypeStart:"arrow_open"},{id:a[o].id,label:a[o].label,type:n.typeStr2Type(a[o].typeStr),directions:a[o].directions}];break;case 24:n.getLogger().debug("Rule: nodeStatement (abc88 node size) ",a[o-1],a[o]),this.$={id:a[o-1].id,label:a[o-1].label,type:n.typeStr2Type(a[o-1].typeStr),directions:a[o-1].directions,widthInColumns:parseInt(a[o],10)};break;case 25:n.getLogger().debug("Rule: nodeStatement (node) ",a[o]),this.$={id:a[o].id,label:a[o].label,type:n.typeStr2Type(a[o].typeStr),directions:a[o].directions,widthInColumns:1};break;case 26:n.getLogger().debug("APA123",this?this:"na"),n.getLogger().debug("COLUMNS: ",a[o]),this.$={type:"column-setting",columns:"auto"===a[o]?-1:parseInt(a[o])};break;case 27:n.getLogger().debug("Rule: id-block statement : ",a[o-2],a[o-1]),n.generateId(),this.$={...a[o-2],type:"composite",children:a[o-1]};break;case 28:n.getLogger().debug("Rule: blockStatement : ",a[o-2],a[o-1],a[o]);const s=n.generateId();this.$={id:s,type:"composite",label:"",children:a[o-1]};break;case 29:n.getLogger().debug("Rule: node (NODE_ID separator): ",a[o]),this.$={id:a[o]};break;case 30:n.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",a[o-1],a[o]),this.$={id:a[o-1],label:a[o].label,typeStr:a[o].typeStr,directions:a[o].directions};break;case 31:n.getLogger().debug("Rule: dirList: ",a[o]),this.$=[a[o]];break;case 32:n.getLogger().debug("Rule: dirList: ",a[o-1],a[o]),this.$=[a[o-1]].concat(a[o]);break;case 33:n.getLogger().debug("Rule: nodeShapeNLabel: ",a[o-2],a[o-1],a[o]),this.$={typeStr:a[o-2]+a[o],label:a[o-1]};break;case 34:n.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",a[o-3],a[o-2]," #3:",a[o-1],a[o]),this.$={typeStr:a[o-3]+a[o],label:a[o-2],directions:a[o-1]};break;case 35:case 36:this.$={type:"classDef",id:a[o-1].trim(),css:a[o].trim()};break;case 37:this.$={type:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 38:this.$={type:"applyStyles",id:a[o-1].trim(),stylesStr:a[o].trim()}}}),"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:a,40:s,44:l,47:c},{8:[1,20]},t(h,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:e,28:r,29:n,31:i,32:a,40:s,44:l,47:c}),t(u,[2,16],{14:22,15:d,16:p}),t(u,[2,17]),t(u,[2,18]),t(u,[2,19]),t(u,[2,20]),t(u,[2,21]),t(u,[2,22]),t(g,[2,25],{27:[1,25]}),t(u,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:a,40:s,44:l,47:c},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},t(f,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},t(h,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},t(g,[2,24]),{11:37,13:4,14:22,15:d,16:p,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:a,40:s,44:l,47:c},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},t(f,[2,30]),{18:[1,43]},{18:[1,44]},t(g,[2,23]),{18:[1,45]},{30:[1,46]},t(u,[2,28]),t(u,[2,35]),t(u,[2,36]),t(u,[2,37]),t(u,[2,38]),{37:[1,47]},{34:48,35:m},{15:[1,50]},t(u,[2,27]),t(f,[2,33]),{39:[1,51]},{34:52,35:m,39:[2,31]},{32:[2,15]},t(f,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},v=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){case 0:return 10;case 1:return t.getLogger().debug("Found space-block"),31;case 2:return t.getLogger().debug("Found nl-block"),31;case 3:return t.getLogger().debug("Found space-block"),29;case 4:t.getLogger().debug(".",e.yytext);break;case 5:t.getLogger().debug("_",e.yytext);break;case 6:return 5;case 7:return e.yytext=-1,28;case 8:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 14:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 15:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 16:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),38;case 75:return t.getLogger().debug("Lex: NODE_ID",e.yytext),32;case 76:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 79:return"NODE_DESCR";case 81:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 84:t.getLogger().debug("LEX POPPING"),this.popState();break;case 85:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 91:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 92:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 94:case 95:case 96:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 97:case 98:case 99:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 101:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 103:case 104:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 105:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}}),"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return t}();function x(){this.yy={}}return y.lexer=v,o(x,"Parser"),x.prototype=y,y.Parser=x,new x}();nLt.parser=nLt;var iLt=nLt,aLt=new Map,sLt=[],oLt=new Map,lLt="color",cLt="fill",hLt=Qr(),uLt=new Map,dLt=o((t=>Lr.sanitizeText(t,hLt)),"sanitizeText"),pLt=o((function(t,e=""){let r=uLt.get(t);r||(r={id:t,styles:[],textStyles:[]},uLt.set(t,r)),null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(lLt).exec(t)){const t=e.replace(cLt,"bgFill").replace(lLt,cLt);r.textStyles.push(t)}r.styles.push(e)}))}),"addStyleClass"),gLt=o((function(t,e=""){const r=aLt.get(t);null!=e&&(r.styles=e.split(","))}),"addStyle2Node"),fLt=o((function(t,e){t.split(",").forEach((function(t){let r=aLt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},aLt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)}))}),"setCssClass"),mLt=o(((t,e)=>{const r=t.flat(),n=[];for(const t of r)if(t.label&&(t.label=dLt(t.label)),"classDef"!==t.type)if("applyClass"!==t.type)if("applyStyles"!==t.type)if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){const e=(oLt.get(t.id)??0)+1;oLt.set(t.id,e),t.id=e+"-"+t.id,sLt.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);const e=aLt.get(t.id);if(void 0===e?aLt.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&&mLt(t.children,t),"space"===t.type){const e=t.width??1;for(let r=0;r{y.debug("Clear called"),qr(),vLt={id:"root",type:"composite",children:[],columns:-1},aLt=new Map([["root",vLt]]),yLt=[],uLt=new Map,sLt=[],oLt=new Map}),"clear");function bLt(t){switch(y.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return y.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function wLt(t){return y.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function kLt(t){switch(t.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}o(bLt,"typeStr2Type"),o(wLt,"edgeTypeStr2Type"),o(kLt,"edgeStrToEdgeData");var TLt=0,_Lt=o((()=>(TLt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+TLt)),"generateId"),ELt=o((t=>{vLt.children=t,mLt(t,vLt),yLt=vLt.children}),"setHierarchy"),CLt=o((t=>{const e=aLt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1}),"getColumns"),SLt=o((()=>[...aLt.values()]),"getBlocksFlat"),ALt=o((()=>yLt||[]),"getBlocks"),LLt=o((()=>sLt),"getEdges"),NLt=o((t=>aLt.get(t)),"getBlock"),ILt=o((t=>{aLt.set(t.id,t)}),"setBlock"),RLt=o((()=>console),"getLogger"),MLt=o((function(){return uLt}),"getClasses"),DLt={getConfig:o((()=>Gt().block),"getConfig"),typeStr2Type:bLt,edgeTypeStr2Type:wLt,edgeStrToEdgeData:kLt,getLogger:RLt,getBlocksFlat:SLt,getBlocks:ALt,getEdges:LLt,setHierarchy:ELt,getBlock:NLt,setBlock:ILt,getColumns:CLt,getClasses:MLt,clear:xLt,generateId:_Lt},OLt=o(((t,e)=>{const r=tt,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return J(n,i,a,e)}),"fade"),PLt=o((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span,p {\n color: ${t.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${OLt(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${OLt(t.mainBkg,.5)};\n fill: ${OLt(t.clusterBkg,.5)};\n stroke: ${OLt(t.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span,p {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles"),BLt=o(((t,e,r,n)=>{e.forEach((e=>{HLt[e](t,r,n)}))}),"insertMarkers"),$Lt=o(((t,e,r)=>{y.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),FLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),zLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),ULt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),GLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),qLt=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"point"),jLt=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"circle"),WLt=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")}),"cross"),YLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb"),HLt={extension:$Lt,composition:FLt,aggregation:zLt,dependency:ULt,lollipop:GLt,point:qLt,circle:jLt,cross:WLt,barb:YLt},VLt=BLt,XLt=Qr()?.block?.padding??8;function KLt(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}o(KLt,"calculateBlockPosition");var ZLt=o((t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};y.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),"space"!==n.type&&(i>e&&(e=i/(t.widthInColumns??1)),a>r&&(r=a))}return{width:e,height:r}}),"getMaxChildSize");function QLt(t,e,r=0,n=0){y.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"sieblingWidth",r),t?.size?.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(const r of t.children)QLt(r,e);const s=ZLt(t);i=s.width,a=s.height,y.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const e of t.children)e.size&&(y.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${i} ${a} ${JSON.stringify(e.size)}`),e.size.width=i*(e.widthInColumns??1)+XLt*((e.widthInColumns??1)-1),e.size.height=a,e.size.x=0,e.size.y=0,y.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${i} maxHeight:${a}`));for(const r of t.children)QLt(r,e,i,a);const o=t.columns??-1;let l=0;for(const e of t.children)l+=e.widthInColumns??1;let c=t.children.length;o>0&&o0?Math.min(t.children.length,o):t.children.length;if(e>0){const r=(u-e*XLt-XLt)/e;y.debug("abc95 (growing to fit) width",t.id,u,t.size?.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:u,height:d,x:0,y:0}}y.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function JLt(t,e){y.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const r=t.columns??-1;if(y.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const e=t?.children[0]?.size?.width??0,n=t.children.length*e+(t.children.length-1)*XLt;y.debug("widthOfChildren 88",n,"posX");let i=0;y.debug("abc91 block?.size?.x",t.id,t?.size?.x);let a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-XLt,s=0;for(const e of t.children){const n=t;if(!e.size)continue;const{width:o,height:l}=e.size,{px:c,py:h}=KLt(r,i);if(h!=s&&(s=h,a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-XLt,y.debug("New row in layout for block",t.id," and child ",e.id,s)),y.debug(`abc89 layout blocks (child) id: ${e.id} Pos: ${i} (px, py) ${c},${h} (${n?.size?.x},${n?.size?.y}) parent: ${n.id} width: ${o}${XLt}`),n.size){const t=o/2;e.size.x=a+XLt+t,y.debug(`abc91 layout blocks (calc) px, pyid:${e.id} startingPos=X${a} new startingPosX${e.size.x} ${t} padding=${XLt} width=${o} halfWidth=${t} => x:${e.size.x} y:${e.size.y} ${e.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(e?.widthInColumns??1)/2}`),a=e.size.x+t,e.size.y=n.size.y-n.size.height/2+h*(l+XLt)+l/2+XLt,y.debug(`abc88 layout blocks (calc) px, pyid:${e.id}startingPosX${a}${XLt}${t}=>x:${e.size.x}y:${e.size.y}${e.widthInColumns}(width * (child?.w || 1)) / 2${o*(e?.widthInColumns??1)/2}`)}e.children&&JLt(e),i+=e?.widthInColumns??1,y.debug("abc88 columnsPos",e,i)}}y.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function tNt(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=tNt(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}function eNt(t){const e=t.getBlock("root");if(!e)return;QLt(e,t,0,0),JLt(e),y.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=tNt(e);return{x:r,y:n,width:i-r,height:a-n}}function rNt(t,e){e&&t.attr("style",e)}function nNt(t){const e=Ga(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=r.append("span");return a.html(n),rNt(a,t.labelStyle),a.attr("class",i),rNt(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}o(QLt,"setBlockSizes"),o(JLt,"layoutBlocks"),o(tNt,"findBounds"),o(eNt,"layout"),o(rNt,"applyStyle"),o(nNt,"addHtmlLabel");var iNt=o(((t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),yr(Qr().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),y.debug("vertexText"+i);return nNt({isNode:n,label:y_($k(i)),labelStyle:e.replace("fill:","color:")})}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let n=[];n="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const e of n){const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),r?n.setAttribute("class","title-row"):n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}return t}}),"createLabel"),aNt=o(((t,e,r,n,i)=>{e.arrowTypeStart&&oNt(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&oNt(t,"end",e.arrowTypeEnd,r,n,i)}),"addEdgeMarkers"),sNt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},oNt=o(((t,e,r,n,i,a)=>{const s=sNt[r];if(!s)return void y.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)}),"addEdgeMarker"),lNt={},cNt={},hNt=o(((t,e)=>{const r=Qr(),n=yr(r.flowchart.htmlLabels),i="markdown"===e.labelType?v_(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:!0},r):iNt(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(i);let o,l=i.getBBox();if(n){const t=i.children[0],e=Ga(i);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}if(s.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),lNt[e.id]=a,e.width=l.width,e.height=l.height,e.startLabelLeft){const r=iNt(e.startLabelLeft,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].startLeft=n,uNt(o,e.startLabelLeft)}if(e.startLabelRight){const r=iNt(e.startLabelRight,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=n.node().appendChild(r),i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].startRight=n,uNt(o,e.startLabelRight)}if(e.endLabelLeft){const r=iNt(e.endLabelLeft,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].endLeft=n,uNt(o,e.endLabelLeft)}if(e.endLabelRight){const r=iNt(e.endLabelRight,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].endRight=n,uNt(o,e.endLabelRight)}return i}),"insertEdgeLabel");function uNt(t,e){Qr().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}o(uNt,"setTerminalWidth");var dNt=o(((t,e)=>{y.debug("Moving label abc88 ",t.id,t.label,lNt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Qr(),{subGraphTitleTotalMargin:i}=qy(n);if(t.label){const n=lNt[t.id];let a=t.x,s=t.y;if(r){const n=Pk.calcLabelPosition(r);y.debug("Moving label "+t.label+" from (",a,",",s,") to (",n.x,",",n.y,") abc88"),e.updatedPath&&(a=n.x,s=n.y)}n.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=cNt[t.id].startLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.startLabelRight){const e=cNt[t.id].startRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelLeft){const e=cNt[t.id].endLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelRight){const e=cNt[t.id].endRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}}),"positionEdgeLabel"),pNt=o(((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),gNt=o(((t,e,r)=>{y.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let t=r.y{y.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach((t=>{if(pNt(e,t)||i)n=t,i||r.push(t);else{const a=gNt(e,n,t);let s=!1;r.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),r.some((t=>t.x===a.x&&t.y===a.y))||r.push(a),i=!0}})),r}),"cutPathAtIntersect"),mNt=o((function(t,e,r,n,i,a,s){let o=r.points;y.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const c=a.node(e.v);var h=a.node(e.w);h?.intersect&&c?.intersect&&(o=o.slice(1,r.points.length-1),o.unshift(c.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(y.debug("to cluster abc88",n[r.toCluster]),o=fNt(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(y.debug("from cluster abc88",n[r.fromCluster]),o=fNt(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const u=o.filter((t=>!Number.isNaN(t.y)));let d=Tu;!r.curve||"graph"!==i&&"flowchart"!==i||(d=r.curve);const{x:p,y:g}=XS(r),f=gu().x(p).y(g).curve(d);let m;switch(r.thickness){case"normal":m="edge-thickness-normal";break;case"thick":case"invisible":m="edge-thickness-thick";break;default:m=""}switch(r.pattern){case"solid":m+=" edge-pattern-solid";break;case"dotted":m+=" edge-pattern-dotted";break;case"dashed":m+=" edge-pattern-dashed"}const v=t.append("path").attr("d",f(u)).attr("id",r.id).attr("class"," "+m+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";(Qr().flowchart.arrowMarkerAbsolute||Qr().state.arrowMarkerAbsolute)&&(x=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,x=x.replace(/\(/g,"\\("),x=x.replace(/\)/g,"\\)")),aNt(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b}),"insertEdge"),yNt=o((t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e}),"expandAndDeduplicateDirections"),vNt=o(((t,e,r)=>{const n=yNt(t),i=e.height+2*r.padding,a=i/2,s=e.width+2*a+r.padding,o=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:a,y:0},{x:s/2,y:2*o},{x:s-a,y:0},{x:s,y:0},{x:s,y:-i/3},{x:s+2*o,y:-i/2},{x:s,y:-2*i/3},{x:s,y:-i},{x:s-a,y:-i},{x:s/2,y:-i-2*o},{x:a,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*o,y:-i/2},{x:0,y:-i/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:a,y:0},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:a,y:-i},{x:s-a,y:-i},{x:s,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:s,y:-i+a},{x:0,y:-i}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:s,y:0},{x:0,y:-a},{x:0,y:-i+a},{x:s,y:-i}]:n.has("right")&&n.has("left")?[{x:a,y:0},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i},{x:0,y:-i/2}]:n.has("up")&&n.has("down")?[{x:s/2,y:0},{x:0,y:-o},{x:a,y:-o},{x:a,y:-i+o},{x:0,y:-i+o},{x:s/2,y:-i},{x:s,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o},{x:s,y:-o}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:s,y:-a},{x:0,y:-i}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:0,y:-i}]:n.has("left")&&n.has("up")?[{x:s,y:0},{x:0,y:-a},{x:s,y:-i}]:n.has("left")&&n.has("down")?[{x:s,y:0},{x:0,y:0},{x:s,y:-i}]:n.has("right")?[{x:a,y:-o},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i+o}]:n.has("left")?[{x:a,y:0},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i},{x:0,y:-i/2}]:n.has("up")?[{x:a,y:-o},{x:a,y:-i+o},{x:0,y:-i+o},{x:s/2,y:-i},{x:s,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o}]:n.has("down")?[{x:s/2,y:0},{x:0,y:-o},{x:a,y:-o},{x:a,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o},{x:s,y:-o}]:[{x:0,y:0}]}),"getArrowPoints");function xNt(t,e){return t.intersect(e)}o(xNt,"intersectNode");var bNt=xNt;function wNt(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);n.x0}o(ENt,"intersectLine"),o(CNt,"sameSign");var SNt=ENt,ANt=LNt;function LNt(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,c=i-t.height/2-o,h=0;h1&&a.sort((function(t,e){var n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return a{var r,n,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),r=0===o?0:c*s/o,n=c):(s<0&&(l=-l),r=l,n=0===s?0:l*o/s),{x:i+r,y:a+n}}),"intersectRect"),INt={node:bNt,circle:_Nt,ellipse:kNt,polygon:ANt,rect:NNt},RNt=o((async(t,e,r,n)=>{const i=Qr();let a;const s=e.useHtmlLabels||yr(i.flowchart.htmlLabels);a=r||"node default";const l=t.insert("g").attr("class",a).attr("id",e.domId||e.id),c=l.insert("g").attr("class","label").attr("style",e.labelStyle);let h;h=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const u=c.node();let d;d="markdown"===e.labelType?v_(c,hr($k(h),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):u.appendChild(iNt(hr($k(h),i),e.labelStyle,!1,n));let p=d.getBBox();const g=e.padding/2;if(yr(i.flowchart.htmlLabels)){const t=d.children[0],e=Ga(d),r=t.getElementsByTagName("img");if(r){const t=""===h.replace(/]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,r=5,n=parseInt(t,10)*r+"px";e.style.minWidth=n,e.style.maxWidth=n}else e.style.width="100%";r(e)}o(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return s?c.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):c.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:l,bbox:p,halfPadding:g,label:c}}),"labelHelper"),MNt=o(((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height}),"updateNodeBounds");function DNt(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}o(DNt,"insertPolygonShape");var ONt=o((async(t,e)=>{e.useHtmlLabels||Qr().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,"node "+e.classes,!0);y.info("Classes = ",e.classes);const a=r.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-n.width/2-i).attr("y",-n.height/2-i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},r}),"note"),PNt=ONt,BNt=o((t=>t?" "+t:""),"formatClass"),$Nt=o(((t,e)=>`${e||"node default"}${BNt(t.classes)} ${BNt(t.class)}`),"getClassesFromNode"),FNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding+(n.height+e.padding),a=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];y.info("Question main (Circle)");const s=DNt(r,i,i,a);return s.attr("style",e.style),MNt(e,s),e.intersect=function(t){return y.warn("Intersect called"),INt.polygon(e,a,t)},r}),"question"),zNt=o(((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}],i=r.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" "));return i.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return INt.circle(e,14,t)},r}),"choice"),UNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.height+e.padding,a=i/4,s=n.width+2*a+e.padding,o=[{x:a,y:0},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=DNt(r,s,i,o);return l.attr("style",e.style),MNt(e,l),e.intersect=function(t){return INt.polygon(e,o,t)},r}),"hexagon"),GNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,void 0,!0),i=n.height+2*e.padding,a=i/2,s=n.width+2*a+e.padding,o=vNt(e.directions,n,e),l=DNt(r,s,i,o);return l.attr("style",e.style),MNt(e,l),e.intersect=function(t){return INt.polygon(e,o,t)},r}),"block_arrow"),qNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return DNt(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(t){return INt.polygon(e,s,t)},r}),"rect_left_inv_arrow"),jNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"lean_right"),WNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"lean_left"),YNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"trapezoid"),HNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"inv_trapezoid"),VNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"rect_right_inv_arrow"),XNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return MNt(e,c),e.intersect=function(t){const r=INt.rect(e,t),n=r.x-e.x;if(0!=a&&(Math.abs(n)e.height/2-s)){let i=s*s*(1-n*n/(a*a));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r}),"cylinder"),KNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,c=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(JNt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{y.warn(`Unknown node property ${t}`)}))}return MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},r}),"rect"),ZNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,c=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(JNt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{y.warn(`Unknown node property ${t}`)}))}return MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},r}),"composite"),QNt=o((async(t,e)=>{const{shapeSvg:r}=await RNt(t,e,"label",!0);y.trace("Classes = ",e.class);const n=r.insert("rect",":first-child");if(n.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(JNt(n,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{y.warn(`Unknown node property ${t}`)}))}return MNt(e,n),e.intersect=function(t){return INt.rect(e,t)},r}),"labelRect");function JNt(t,e,r,n){const i=[],a=o((t=>{i.push(t,0)}),"addBorder"),s=o((t=>{i.push(0,t)}),"skipBorder");e.includes("t")?(y.debug("add top border"),a(r)):s(r),e.includes("r")?(y.debug("add right border"),a(n)):s(n),e.includes("b")?(y.debug("add bottom border"),a(r)):s(r),e.includes("l")?(y.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}o(JNt,"applyNodePropertyBorders");var tIt=o(((t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,y.info("Label text abc79",l,o,"object"==typeof o);const c=s.node().appendChild(iNt(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(yr(Qr().flowchart.htmlLabels)){const t=c.children[0],e=Ga(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}y.info("Text 2",o);const u=o.slice(1,o.length);let d=c.getBBox();const p=s.node().appendChild(iNt(u.join?u.join("
    "):u,e.labelStyle,!0,!0));if(yr(Qr().flowchart.htmlLabels)){const t=p.children[0],e=Ga(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const g=e.padding/2;return Ga(p).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+g+5)+")"),Ga(c).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return MNt(e,s),e.intersect=function(t){return INt.rect(e,t)},r}),"stadium"),rIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,$Nt(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),y.info("Circle main"),MNt(e,a),e.intersect=function(t){return y.info("Circle intersect",e,n.width/2+i,t),INt.circle(e,n.width/2+i,t)},r}),"circle"),nIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,$Nt(e,void 0),!0),a=r.insert("g",":first-child"),s=a.insert("circle"),o=a.insert("circle");return a.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+5).attr("width",n.width+e.padding+10).attr("height",n.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),y.info("DoubleCircle main"),MNt(e,s),e.intersect=function(t){return y.info("DoubleCircle intersect",e,n.width/2+i+5,t),INt.circle(e,n.width/2+i+5,t)},r}),"doublecircle"),iIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"subroutine"),aIt=o(((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),MNt(e,n),e.intersect=function(t){return INt.circle(e,7,t)},r}),"start"),sIt=o(((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;"LR"===r&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return MNt(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return INt.rect(e,t)},n}),"forkJoin"),oIt=o(((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),MNt(e,i),e.intersect=function(t){return INt.circle(e,7,t)},r}),"end"),lIt=o(((t,e)=>{const r=e.padding/2;let n;n=e.classes?"node "+e.classes:"node default";const i=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=i.insert("rect",":first-child"),s=i.insert("line"),o=i.insert("line");let l=0,c=4;const h=i.insert("g").attr("class","label");let u=0;const d=e.classData.annotations?.[0],p=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",g=h.node().appendChild(iNt(p,e.labelStyle,!0,!0));let f=g.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=g.children[0],e=Ga(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}e.classData.annotations[0]&&(c+=f.height+4,l+=f.width);let m=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(Qr().flowchart.htmlLabels?m+="<"+e.classData.type+">":m+="<"+e.classData.type+">");const y=h.node().appendChild(iNt(m,e.labelStyle,!0,!0));Ga(y).attr("class","classTitle");let v=y.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=y.children[0],e=Ga(y);v=t.getBoundingClientRect(),e.attr("width",v.width),e.attr("height",v.height)}c+=v.height+4,v.width>l&&(l=v.width);const x=[];e.classData.members.forEach((t=>{const r=t.getDisplayDetails();let n=r.displayText;Qr().flowchart.htmlLabels&&(n=n.replace(//g,">"));const i=h.node().appendChild(iNt(n,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=i.children[0],e=Ga(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,x.push(i)})),c+=8;const b=[];if(e.classData.methods.forEach((t=>{const r=t.getDisplayDetails();let n=r.displayText;Qr().flowchart.htmlLabels&&(n=n.replace(//g,">"));const i=h.node().appendChild(iNt(n,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=i.children[0],e=Ga(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,b.push(i)})),c+=8,d){let t=(l-f.width)/2;Ga(g).attr("transform","translate( "+(-1*l/2+t)+", "+-1*c/2+")"),u=f.height+4}let w=(l-v.width)/2;return Ga(y).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+u)+")"),u+=v.height+4,s.attr("class","divider").attr("x1",-l/2-r).attr("x2",l/2+r).attr("y1",-c/2-r+8+u).attr("y2",-c/2-r+8+u),u+=8,x.forEach((t=>{Ga(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u+4)+")");const e=t?.getBBox();u+=(e?.height??0)+4})),u+=8,o.attr("class","divider").attr("x1",-l/2-r).attr("x2",l/2+r).attr("y1",-c/2-r+8+u).attr("y2",-c/2-r+8+u),u+=8,b.forEach((t=>{Ga(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u)+")");const e=t?.getBBox();u+=(e?.height??0)+4})),a.attr("style",e.style).attr("class","outer title-state").attr("x",-l/2-r).attr("y",-c/2-r).attr("width",l+e.padding).attr("height",c+e.padding),MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},i}),"class_box"),cIt={rhombus:FNt,composite:ZNt,question:FNt,rect:KNt,labelRect:QNt,rectWithTitle:tIt,choice:zNt,circle:rIt,doublecircle:nIt,stadium:eIt,hexagon:UNt,block_arrow:GNt,rect_left_inv_arrow:qNt,lean_right:jNt,lean_left:WNt,trapezoid:YNt,inv_trapezoid:HNt,rect_right_inv_arrow:VNt,cylinder:XNt,start:aIt,end:oIt,note:PNt,subroutine:iIt,fork:sIt,join:sIt,class_box:lIt},hIt={},uIt=o((async(t,e,r)=>{let n,i;if(e.link){let a;"sandbox"===Qr().securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await cIt[e.shape](n,e,r)}else i=await cIt[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),hIt[e.id]=n,e.haveCallback&&hIt[e.id].attr("class",hIt[e.id].attr("class")+" clickable"),n}),"insertNode"),dIt=o((t=>{const e=hIt[t.id];y.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r}),"positionNode");function pIt(t,e,r=!1){const n=t;let i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i+=" flowchart-label";let a,s=0,o="";switch(n.type){case"round":s=5,o="rect";break;case"composite":s=0,o="composite",a=0;break;case"square":case"group":default:o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"doublecircle":o="doublecircle"}const l=yk(n?.styles??[]),c=n.label,h=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:o,labelText:c,rx:s,ry:s,class:i,style:l.style,id:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:a??Gt()?.block?.padding??0}}async function gIt(t,e,r){const n=pIt(e,0,!1);if("group"===n.type)return;const i=Gt(),a=await uIt(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}async function fIt(t,e,r){const n=pIt(e,0,!0);if("space"!==r.getBlock(n.id).type){const r=Gt();await uIt(t,n,{config:r}),e.intersect=n?.intersect,dIt(n)}}async function mIt(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await mIt(t,i.children,r,n)}async function yIt(t,e,r){await mIt(t,e,r,gIt)}async function vIt(t,e,r){await mIt(t,e,r,fIt)}async function xIt(t,e,r,n,i){const a=new Cj({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of r)t.size&&a.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const r of e)if(r.start&&r.end){const e=n.getBlock(r.start),s=n.getBlock(r.end);if(e?.size&&s?.size){const n=e.size,o=s.size,l=[{x:n.x,y:n.y},{x:n.x+(o.x-n.x)/2,y:n.y+(o.y-n.y)/2},{x:o.x,y:o.y}];mNt(t,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),r.label&&(await hNt(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),dNt({...r,x:l[1].x,y:l[1].y},{originalPath:l}))}}}o(pIt,"getNodeFromBlock"),o(gIt,"calculateBlockSize"),o(fIt,"insertBlockPositioned"),o(mIt,"performOperations"),o(yIt,"calculateBlockSizes"),o(vIt,"insertBlocks"),o(xIt,"insertEdges");var bIt=o((function(t,e){return e.db.getClasses()}),"getClasses"),wIt=o((async function(t,e,r,n){const{securityLevel:i,block:a}=Gt(),s=n.db;let o;"sandbox"===i&&(o=Ga("#i"+e));const l=Ga("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):Ga(`[id="${e}"]`);VLt(c,["point","circle","cross"],n.type,e);const h=s.getBlocks(),u=s.getBlocksFlat(),d=s.getEdges(),p=c.insert("g").attr("class","block");await yIt(p,h,s);const g=eNt(s);if(await vIt(p,h,s),await xIt(p,d,u,s,e),g){const t=g,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,n=t.width+10,{useMaxWidth:i}=a;Rr(c,r,n,!!i),y.debug("Here Bounds",g,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}}),"draw"),kIt={parser:iLt,db:DLt,renderer:{draw:wIt,getClasses:bIt},styles:PLt},TIt=Object.freeze({__proto__:null,diagram:kIt}),_It=l({"../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof t?t.layoutBase=n():r.layoutBase=n()}),"webpackUniversalModuleDefinition")(t,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?o((function(){return t.default}),"getDefault"):o((function(){return t}),"getModuleExports");return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=28)}([function(t,e,r){function n(){}o(n,"LayoutConstants"),n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){var n=r(2),i=r(8),a=r(9);function s(t,e,r){n.call(this,r),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=r,this.bendpoints=[],this.source=t,this.target=e}for(var l in o(s,"LEdge"),s.prototype=Object.create(n.prototype),n)s[l]=n[l];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(t,e){for(var r=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(r.getOwner()==e)return r;if(r.getOwner()==n)break;r=r.getOwner().getParent()}return null},s.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){function n(t){this.vGraphObject=t}o(n,"LGraphObject"),t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(13),s=r(0),l=r(16),c=r(5);function h(t,e,r,s){null==r&&null==s&&(s=e),n.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=r&&null!=e?new a(e.x,e.y,r.width,r.height):new a}for(var u in o(h,"LNode"),h.prototype=Object.create(n.prototype),n)h[u]=n[u];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(t){this.rect.width=t},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(t){this.rect.height=t},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},h.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},h.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},h.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},h.prototype.getEdgeListToNode=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.target==t){if(n.source!=r)throw"Incorrect edge source!";e.push(n)}})),e},h.prototype.getEdgesBetween=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.source!=r&&n.target!=r)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},h.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(r){if(r.source==e)t.add(r.target);else{if(r.target!=e)throw"Incorrect incidency!";t.add(r.source)}})),t},h.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),r=0;re?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(r+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>r?(this.rect.y-=(this.labelHeight-r)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(r+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var r=this.rect.y;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var n=new c(e,r),i=t.inverseTransformPoint(n);this.setLocation(i.x,i.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=h},function(t,e,r){var n=r(0);function i(){}for(var a in o(i,"FDLayoutConstants"),n)i[a]=n[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}o(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(0),s=r(7),l=r(3),c=r(1),h=r(13),u=r(12),d=r(11);function p(t,e,r){n.call(this,r),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in o(p,"LGraph"),p.prototype=Object.create(n.prototype),n)p[g]=n[g];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(t,e,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.edges.push(i),i)},p.prototype.remove=function(t){var e=t;if(t instanceof l){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var r=e.edges.slice(),n=r.length,i=0;i-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(o,1),a.target!=a.source&&a.target.edges.splice(h,1),-1==(s=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(s,1)}},p.prototype.updateLeftTop=function(){for(var t,e,r,n=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l(t=c.getTop())&&(n=t),a>(e=c.getLeft())&&(a=e)}return n==i.MAX_VALUE?null:(r=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-r,this.top=n-r,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,r,n,a,s,o=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,u=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g(e=f.getLeft())&&(o=e),l<(r=f.getRight())&&(l=r),c>(n=f.getTop())&&(c=n),u<(a=f.getBottom())&&(u=a)}var m=new h(o,c,l-o,u-c);o==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},p.calculateBounds=function(t){for(var e,r,n,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d(e=p.getLeft())&&(s=e),o<(r=p.getRight())&&(o=r),l>(n=p.getTop())&&(l=n),c<(a=p.getBottom())&&(c=a)}return new h(s,l,o-s,c-l)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,r=e.length,n=0;n=this.nodes.length){var l=0;i.forEach((function(e){e.owner==t&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=p},function(t,e,r){var n,i=r(1);function a(t){n=r(6),this.layout=t,this.graphs=[],this.edges=[]}o(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},a.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=r,r=t;var a=(n=e).getOwner(),s=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==s)return r.isInterGraph=!1,a.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},a.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var r,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var a=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(a=1);var s=a*r[0],o=r[1]/a;r[0]s)return r[0]=n,r[1]=l,r[2]=a,r[3]=x,!1;if(ia)return r[0]=o,r[1]=i,r[2]=y,r[3]=s,!1;if(na?(r[0]=h,r[1]=u,T=!0):(r[0]=c,r[1]=l,T=!0):E===S&&(n>a?(r[0]=o,r[1]=l,T=!0):(r[0]=d,r[1]=u,T=!0)),-C===S?a>n?(r[2]=v,r[3]=x,_=!0):(r[2]=y,r[3]=m,_=!0):C===S&&(a>n?(r[2]=f,r[3]=m,_=!0):(r[2]=b,r[3]=x,_=!0)),T&&_)return!1;if(n>a?i>s?(A=this.getCardinalDirection(E,S,4),L=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-E,S,3),L=this.getCardinalDirection(-C,S,1)):i>s?(A=this.getCardinalDirection(-E,S,1),L=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(E,S,2),L=this.getCardinalDirection(C,S,4)),!T)switch(A){case 1:I=l,N=n+-g/S,r[0]=N,r[1]=I;break;case 2:N=d,I=i+p*S,r[0]=N,r[1]=I;break;case 3:I=u,N=n+g/S,r[0]=N,r[1]=I;break;case 4:N=h,I=i+-p*S,r[0]=N,r[1]=I}if(!_)switch(L){case 1:M=m,R=a+-k/S,r[2]=R,r[3]=M;break;case 2:R=b,M=s+w*S,r[2]=R,r[3]=M;break;case 3:M=x,R=a+k/S,r[2]=R,r[3]=M;break;case 4:R=v,M=s+-w*S,r[2]=R,r[3]=M}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=r.x,y=r.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new n((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r=0){var h=(-l+Math.sqrt(l*l-4*o*c))/(2*o),u=(-l-Math.sqrt(l*l-4*o*c))/(2*o);return h>=0&&h<=1?[h]:u>=0&&u<=1?[u]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,r){function n(){}o(n,"IMath"),n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}o(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r0&&e;){for(o.push(c[0]);o.length>0&&e;){var h=o[0];o.splice(0,1),s.add(h);var u=h.getEdges();for(a=0;a-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(r),a=0;a=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&l.push(t),n.set(t,e)}}))}r=r.concat(l),1!=e.length&&2!=e.length||(i=!0,a=e[0])}return a},p.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=p},function(t,e,r){function n(){}o(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(5);function i(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);ea.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),r=0;r0&&void 0!==arguments[0])||arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),i=new Set,t=0;t(l=e.getEstimatedSize()*this.gravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*a):(s>(l=e.getEstimatedSize()*this.compoundGravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=l.length||h>=l[0].length))for(var u=0;ut}),"_defaultCompareFunction")}]),t}();t.exports=s},function(t,e,r){function n(){}o(n,"SVD"),n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e,r,i=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=(e=[this.m,i],r=o((function t(e){if(0==e.length)return 0;for(var r=[],n=0;n0;)e.push(0);return e}(this.n),s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),l=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),h=0;h=0;N--)if(0!==this.s[N]){for(var I=N+1;I=0;$--){if(function(t,e){return t&&e}($0;){var H=void 0,V=void 0;for(H=S-2;H>=-1&&-1!==H;H--)if(Math.abs(a[H])<=Y+W*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){a[H]=0;break}if(H===S-2)V=4;else{var X=void 0;for(X=S-1;X>=H&&X!==H;X--){var K=(X!==S?Math.abs(a[X]):0)+(X!==H+1?Math.abs(a[X-1]):0);if(Math.abs(this.s[X])<=Y+W*K){this.s[X]=0;break}}X===H?V=3:X===S-1?V=1:(V=2,H=X)}switch(H++,V){case 1:var Z=a[S-2];a[S-2]=0;for(var Q=S-2;Q>=H;Q--){var J=n.hypot(this.s[Q],Z),tt=this.s[Q]/J,et=Z/J;this.s[Q]=J,Q!==H&&(Z=-et*a[Q-1],a[Q-1]=tt*a[Q-1]);for(var rt=0;rt=this.s[H+1]);){var St=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=St,HMath.abs(e)?(r=e/t,r=Math.abs(t)*Math.sqrt(1+r*r)):0!=e?(r=t/e,r=Math.abs(e)*Math.sqrt(1+r*r)):r=0,r},t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=r,this.match_score=n,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r{var e={45:(t,e,r)=>{var n={};n.layoutBase=r(551),n.CoSEConstants=r(806),n.CoSEEdge=r(767),n.CoSEGraph=r(880),n.CoSEGraphManager=r(578),n.CoSELayout=r(765),n.CoSENode=r(991),n.ConstraintHandler=r(902),t.exports=n},806:(t,e,r)=>{var n=r(551).FDLayoutConstants;function i(){}for(var a in o(i,"CoSEConstants"),n)i[a]=n[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,t.exports=i},767:(t,e,r)=>{var n=r(551).FDLayoutEdge;function i(t,e,r){n.call(this,t,e,r)}for(var a in o(i,"CoSEEdge"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},880:(t,e,r)=>{var n=r(551).LGraph;function i(t,e,r){n.call(this,t,e,r)}for(var a in o(i,"CoSEGraph"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},578:(t,e,r)=>{var n=r(551).LGraphManager;function i(t){n.call(this,t)}for(var a in o(i,"CoSEGraphManager"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},765:(t,e,r)=>{var n=r(551).FDLayout,i=r(578),a=r(880),s=r(991),l=r(767),c=r(806),h=r(902),u=r(551).FDLayoutConstants,d=r(551).LayoutConstants,p=r(551).Point,g=r(551).PointD,f=r(551).DimensionD,m=r(551).Layout,y=r(551).Integer,v=r(551).IGeometry,x=r(551).LGraph,b=r(551).Transform,w=r(551).LinkedList;function k(){n.call(this),this.toBeTiled={},this.constraints={}}for(var T in o(k,"CoSELayout"),k.prototype=Object.create(n.prototype),n)k[T]=n[T];k.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},k.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},k.prototype.newNode=function(t){return new s(this.graphManager,t)},k.prototype.newEdge=function(t){return new l(null,null,t)},k.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},k.prototype.initSpringEmbedder=function(){n.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},k.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},k.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r)}}else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(h.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},k.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r0&&this.updateDisplacements();for(e=0;e0&&(n.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var s=new Map,l=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var h=this.constraints.alignmentConstraint.vertical;for(r=0;r=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),r=t[n],t[n]=t[e],t[e]=r;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var r=s.has(e.left)?s.get(e.left):e.left,n=s.has(e.right)?s.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(r).push({right:n,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(n).push({left:r,gap:e.gap})}else{var i=l.has(e.top)?l.get(e.top):e.top,a=l.has(e.bottom)?l.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(a)||(t.nodesInRelativeVertical.push(a),t.nodeToRelativeConstraintMapVertical.set(a,[]),t.dummyToNodeForHorizontalAlignment.has(a)?t.nodeToTempPositionMapVertical.set(a,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(a,t.idToNodeMap.get(a).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:e.gap})}}));else{var d=new Map,p=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=s.has(t.left)?s.get(t.left):t.left,r=s.has(t.right)?s.get(t.right):t.right;d.has(e)?d.get(e).push(r):d.set(e,[r]),d.has(r)?d.get(r).push(e):d.set(r,[e])}else{var n=l.has(t.top)?l.get(t.top):t.top,i=l.has(t.bottom)?l.get(t.bottom):t.bottom;p.has(n)?p.get(n).push(i):p.set(n,[i]),p.has(i)?p.get(i).push(n):p.set(i,[n])}}));var g=o((function(t,e){var r=[],n=[],i=new w,a=new Set,s=0;return t.forEach((function(o,l){if(!a.has(l)){r[s]=[],n[s]=!1;var c=l;for(i.push(c),a.add(c),r[s].push(c);0!=i.length;){c=i.shift(),e.has(c)&&(n[s]=!0),t.get(c).forEach((function(t){a.has(t)||(i.push(t),a.add(t),r[s].push(t))}))}s++}})),{components:r,isFixed:n}}),"constructComponents"),f=g(d,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var m=g(p,t.fixedNodesOnVertical);this.componentsOnVertical=m.components,this.fixedComponentsOnVertical=m.isFixed}}},k.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var r=t.idToNodeMap.get(e.nodeId);r.displacementX=0,r.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,r=0;r1)for(o=0;on&&(n=Math.floor(s.y)),a=Math.floor(s.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(d.WORLD_CENTER_X-s.x/2,d.WORLD_CENTER_Y-s.y/2))},k.radialLayout=function(t,e,r){var n=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(e,null,0,359,0,n);var i=x.calculateBounds(t),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(r.x),a.setWorldOrgY(r.y);for(var s=0;s1;){var m=f[0];f.splice(0,1);var y=h.indexOf(m);y>=0&&h.splice(y,1),g--,u--}d=null!=e?(h.indexOf(f[0])+1)%g:0;for(var x=Math.abs(n-r)/u,b=d;p!=u;b=++b%g){var w=h[b].getOtherEnd(t);if(w!=e){var T=(r+p*x)%360,_=(T+x)%360;k.branchRadialLayout(w,t,T,_,i+a,a),p++}}},k.maxDiagonalInTree=function(t){for(var e=y.MIN_VALUE,r=0;re&&(e=n)}return e},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var r=[],n=this.graphManager.getAllNodes(),i=0;i1){var n="DummyCompound_"+r;t.memberGroups[n]=e[r];var i=e[r][0].getParent(),a=new s(t.graphManager);a.id=n,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[n]=a;var o=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;ci?(n.rect.x-=(n.labelWidth-i)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-i)/2):"right"==n.labelPosHorizontal&&n.setWidth(i+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(a+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>a?(n.rect.y-=(n.labelHeight-a)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-a)/2):"bottom"==n.labelPosVertical&&n.setHeight(a+n.labelHeight))}}))},k.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,n=e.paddingLeft,i=e.paddingTop,a=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,n,i,a,s)}},k.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var n=t.idToDummyNode[r],i=n.paddingLeft,a=n.paddingTop,s=n.labelMarginLeft,o=n.labelMarginTop;t.adjustLocations(e[r],n.rect.x,n.rect.y,i,a,s,o)}))},k.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var n=r.getNodes(),i=0;i0)return this.toBeTiled[e]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[e]=!0,!0},k.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),r=0,n=0;nh&&(h=d.rect.height)}r+=h+t.verticalPadding}},k.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var i=e[n];if(r.tiledMemberPack[n]=r.tileNodes(t[n],i.paddingLeft+i.paddingRight),i.rect.width=r.tiledMemberPack[n].width,i.rect.height=r.tiledMemberPack[n].height,i.setCenter(r.tiledMemberPack[n].centerX,r.tiledMemberPack[n].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,s=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(s+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>s?(i.rect.y-=(i.labelHeight-s)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-s)/2):"bottom"==i.labelPosVertical&&i.setHeight(s+i.labelHeight))}}))},k.prototype.tileNodes=function(t,e){var r=this.tileNodesByFavoringDim(t,e,!0),n=this.tileNodesByFavoringDim(t,e,!1),i=this.getOrgRatio(r);return this.getOrgRatio(n)o&&(o=t.getWidth())}));var l,h=a/i,u=s/i,d=Math.pow(r-n,2)+4*(h+n)*(u+r)*i,p=(n-r+Math.sqrt(d))/(2*(h+n));e?(l=Math.ceil(p))==p&&l++:l=Math.floor(p);var g=l*(h+n)-n;return o>g&&(g=o),g+=2*n},k.prototype.tileNodesByFavoringDim=function(t,e,r){var n=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,s={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:i,centerX:0,centerY:0};a&&(s.idealRowWidth=this.calcIdealRowWidth(t,r));var l=o((function(t){return t.rect.width*t.rect.height}),"getNodeArea"),h=o((function(t,e){return l(e)-l(t)}),"areaCompareFcn");t.sort((function(t,e){var r=h;return s.idealRowWidth?(r=a)(t.id,e.id):r(t,e)}));for(var u=0,d=0,p=0;p0&&(a+=t.horizontalPadding),t.rowWidth[r]=a,t.width0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[r]&&(o=t.rowHeight[r],t.rowHeight[r]=s,o=t.rowHeight[r]-o),t.height+=o,t.rows[r].push(e)},k.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,n=0;nr&&(e=n,r=t.rowWidth[n]);return e},k.prototype.canAddHorizontal=function(t,e,r){if(t.idealRowWidth){var n=t.rows.length-1;return t.rowWidth[n]+e+t.horizontalPadding<=t.idealRowWidth}var i=this.getShortestRowIndex(t);if(i<0)return!0;var a=t.rowWidth[i];if(a+t.horizontalPadding+e<=t.width)return!0;var s,o,l=0;return t.rowHeight[i]0&&(l=r+t.verticalPadding-t.rowHeight[i]),s=t.width-a>=e+t.horizontalPadding?(t.height+l)/(a+e+t.horizontalPadding):(t.height+l)/t.width,l=r+t.verticalPadding,(o=t.widtha&&e!=r){n.splice(-1,1),t.rows[r].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[r]=t.rowWidth[r]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;os&&(s=n[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=s,t.rowHeight[r]0)for(var h=i;h<=a;h++)l[0]+=this.grid[h][s-1].length+this.grid[h][s].length-1;if(a0)for(h=s;h<=o;h++)l[3]+=this.grid[i-1][h].length+this.grid[i][h].length-1;for(var d,p,g=y.MAX_VALUE,f=0;f{var n=r(551).FDLayoutNode,i=r(551).IMath;function a(t,e,r,i){n.call(this,t,e,r,i)}for(var s in o(a,"CoSENode"),a.prototype=Object.create(n.prototype),n)a[s]=n[s];a.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(t,e){for(var r,n=this.getChild().getNodes(),i=0;i{function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0){var a=0;n.forEach((function(t){"horizontal"==e?(p.set(t,c.has(t)?h[c.get(t)]:i.get(t)),a+=p.get(t)):(p.set(t,c.has(t)?u[c.get(t)]:i.get(t)),a+=p.get(t))})),a/=n.length,t.forEach((function(t){r.has(t)||p.set(t,a)}))}else{var s=0;t.forEach((function(t){s+="horizontal"==e?c.has(t)?h[c.get(t)]:i.get(t):c.has(t)?u[c.get(t)]:i.get(t)})),s/=t.length,t.forEach((function(t){p.set(t,s)}))}}));for(var m=o((function(){var n=f.shift();t.get(n).forEach((function(t){if(p.get(t.id)s&&(s=v),xo&&(o=x)}}catch(t){d=!0,g=t}finally{try{!l&&m.return&&m.return()}finally{if(d)throw g}}var b=(n+s)/2-(a+o)/2,w=!0,k=!1,T=void 0;try{for(var _,E=t[Symbol.iterator]();!(w=(_=E.next()).done);w=!0){var C=_.value;p.set(C,p.get(C)+b)}}catch(t){k=!0,T=t}finally{try{!w&&E.return&&E.return()}finally{if(k)throw T}}}))}return p}),"findAppropriatePositionForRelativePlacement"),x=o((function(t){var e=0,r=0,n=0,i=0;if(t.forEach((function(t){t.left?h[c.get(t.left)]-h[c.get(t.right)]>=0?e++:r++:u[c.get(t.top)]-u[c.get(t.bottom)]>=0?n++:i++})),e>r&&n>i)for(var a=0;ar)for(var s=0;si)for(var o=0;o1)e.fixedNodeConstraint.forEach((function(t,e){T[e]=[t.position.x,t.position.y],_[e]=[h[c.get(t.nodeId)],u[c.get(t.nodeId)]]})),E=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var r=e.alignmentConstraint.vertical,i=o((function(e){var i=new Set;r[e].forEach((function(t){i.add(t)}));var a=new Set([].concat(n(i)).filter((function(t){return S.has(t)}))),s=void 0;s=a.size>0?h[c.get(a.values().next().value)]:y(i).x,r[e].forEach((function(e){T[t]=[s,u[c.get(e)]],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop2"),a=0;a0?h[c.get(i.values().next().value)]:y(r).y,s[e].forEach((function(e){T[t]=[h[c.get(e)],a],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop3"),d=0;dI&&(I=N[M].length,R=M);if(I0){var X={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var r={x:h[c.get(t.nodeId)],y:u[c.get(t.nodeId)]},n=t.position,i=m(n,r);X.x+=i.x,X.y+=i.y})),X.x/=e.fixedNodeConstraint.length,X.y/=e.fixedNodeConstraint.length,h.forEach((function(t,e){h[e]+=X.x})),u.forEach((function(t,e){u[e]+=X.y})),e.fixedNodeConstraint.forEach((function(t){h[c.get(t.nodeId)]=t.position.x,u[c.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var K=e.alignmentConstraint.vertical,Z=o((function(t){var e=new Set;K[t].forEach((function(t){e.add(t)}));var r=new Set([].concat(n(e)).filter((function(t){return S.has(t)}))),i=void 0;i=r.size>0?h[c.get(r.values().next().value)]:y(e).x,e.forEach((function(t){S.has(t)||(h[c.get(t)]=i)}))}),"_loop4"),Q=0;Q0?u[c.get(r.values().next().value)]:y(e).y,e.forEach((function(t){S.has(t)||(u[c.get(t)]=i)}))}),"_loop5"),et=0;et{e.exports=t}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}return o(n,"__webpack_require__"),n(45)})()}))}}),CIt=l({"../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.31.0/node_modules/cytoscape-fcose/cytoscape-fcose.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n(EIt()):"function"==typeof define&&define.amd?define(["cose-base"],n):"object"==typeof t?t.cytoscapeFcose=n(EIt()):r.cytoscapeFcose=n(r.coseBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return(()=>{var e={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n{var n=function(){function t(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&o.return&&o.return()}finally{if(i)throw a}}return r}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=r(140).layoutBase.LinkedList,a={getTopMostNodes:function(t){for(var e={},r=0;r0&&o.merge(t)}));for(var h=0;h1){h=l[0],u=h.connectedEdges().length,l.forEach((function(t){t.connectedEdges().length0&&n.set("dummy"+(n.size+1),g),f},relocateComponent:function(t,e,r){if(!r.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if("draft"==r.quality){var l=!0,c=!1,h=void 0;try{for(var u,d=e.nodeIndexes[Symbol.iterator]();!(l=(u=d.next()).done);l=!0){var p=u.value,g=n(p,2),f=g[0],m=g[1],y=r.cy.getElementById(f);if(y){var v=y.boundingBox(),x=e.xCoords[m]-v.w/2,b=e.xCoords[m]+v.w/2,w=e.yCoords[m]-v.h/2,k=e.yCoords[m]+v.h/2;xa&&(a=b),wo&&(o=k)}}}catch(t){c=!0,h=t}finally{try{!l&&d.return&&d.return()}finally{if(c)throw h}}var T=t.x-(a+i)/2,_=t.y-(o+s)/2;e.xCoords=e.xCoords.map((function(t){return t+T})),e.yCoords=e.yCoords.map((function(t){return t+_}))}else{Object.keys(e).forEach((function(t){var r=e[t],n=r.getRect().x,l=r.getRect().x+r.getRect().width,c=r.getRect().y,h=r.getRect().y+r.getRect().height;na&&(a=l),co&&(o=h)}));var E=t.x-(a+i)/2,C=t.y-(o+s)/2;Object.keys(e).forEach((function(t){var r=e[t];r.setCenter(r.getCenterX()+E,r.getCenterY()+C)}))}}},calcBoundingBox:function(t,e,r,n){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,l=void 0,c=void 0,h=void 0,u=void 0,d=t.descendants().not(":parent"),p=d.length,g=0;g(l=e[n.get(f.id())]-f.width()/2)&&(i=l),a<(c=e[n.get(f.id())]+f.width()/2)&&(a=c),s>(h=r[n.get(f.id())]-f.height()/2)&&(s=h),o<(u=r[n.get(f.id())]+f.height()/2)&&(o=u)}var m={};return m.topLeftX=i,m.topLeftY=s,m.width=a-i,m.height=o-s,m},calcParentsWithoutChildren:function(t,e){var r=t.collection();return e.nodes(":parent").forEach((function(t){var e=!1;t.children().forEach((function(t){"none"!=t.css("display")&&(e=!0)})),e||r.merge(t)})),r}};t.exports=a},816:(t,e,r)=>{var n=r(548),i=r(140).CoSELayout,a=r(140).CoSENode,s=r(140).layoutBase.PointD,l=r(140).layoutBase.DimensionD,c=r(140).layoutBase.LayoutConstants,h=r(140).layoutBase.FDLayoutConstants,u=r(140).CoSEConstants,d=o((function(t,e){var r=t.cy,d=t.eles,p=d.nodes(),g=d.edges(),f=void 0,m=void 0,y=void 0,v={};t.randomize&&(f=e.nodeIndexes,m=e.xCoords,y=e.yCoords);var x=o((function(t){return"function"==typeof t}),"isFn"),b=o((function(t,e){return x(t)?t(e):t}),"optFn"),w=n.calcParentsWithoutChildren(r,d),k=o((function t(e,r,i,o){for(var c=r.length,h=0;h0){t(i.getGraphManager().add(i.newGraph(),p),d,i,o)}}}),"processChildrenList"),T=o((function(e,r,n){for(var i=0,a=0,s=0;s0?u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=i/a:x(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH)}),"processEdges"),_=o((function(t,e){e.fixedNodeConstraint&&(t.constraints.fixedNodeConstraint=e.fixedNodeConstraint),e.alignmentConstraint&&(t.constraints.alignmentConstraint=e.alignmentConstraint),e.relativePlacementConstraint&&(t.constraints.relativePlacementConstraint=e.relativePlacementConstraint)}),"processConstraints");null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=h.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=h.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=h.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=h.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?c.QUALITY=2:c.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=h.ANIMATE=c.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var E=new i,C=E.newGraphManager();return k(C.addRoot(),n.getTopMostNodes(p),E,t),T(E,C,g),_(E,t),E.runLayout(),v}),"coseLayout");t.exports={coseLayout:d}},212:(t,e,r)=>{var n=function(){function t(t,e){for(var r=0;r0)if(d){var p=s.getTopMostNodes(t.eles.nodes());if((a=s.connectComponents(e,t.eles,p)).forEach((function(t){var e=t.boundingBox();h.push({x:e.x1+e.w/2,y:e.y1+e.h/2})})),t.randomize&&a.forEach((function(e){t.eles=e,n.push(l(t))})),"default"==t.quality||"proof"==t.quality){var g=e.collection();if(t.tile){var f=0,m={nodeIndexes:new Map,xCoords:[],yCoords:[]},y=[];if(a.forEach((function(t,e){0==t.edges().length&&(t.nodes().forEach((function(e,r){g.merge(t.nodes()[r]),e.isParent()||(m.nodeIndexes.set(t.nodes()[r].id(),f++),m.xCoords.push(t.nodes()[0].position().x),m.yCoords.push(t.nodes()[0].position().y))})),y.push(e))})),g.length>1){var v=g.boundingBox();h.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),a.push(g),n.push(m);for(var x=y.length-1;x>=0;x--)a.splice(y[x],1),n.splice(y[x],1),h.splice(y[x],1)}}a.forEach((function(e,r){t.eles=e,i.push(c(t,n[r])),s.relocateComponent(h[r],i[r],t)}))}else a.forEach((function(e,r){s.relocateComponent(h[r],n[r],t)}));var b=new Set;if(a.length>1){var w=[],k=r.filter((function(t){return"none"==t.css("display")}));a.forEach((function(e,r){var a=void 0;if("draft"==t.quality&&(a=n[r].nodeIndexes),e.nodes().not(k).length>0){var o={edges:[],nodes:[]},l=void 0;e.nodes().not(k).forEach((function(e){if("draft"==t.quality)if(e.isParent()){var c=s.calcBoundingBox(e,n[r].xCoords,n[r].yCoords,a);o.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=a.get(e.id()),o.nodes.push({x:n[r].xCoords[l]-e.boundingbox().w/2,y:n[r].yCoords[l]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else i[r][e.id()]&&o.nodes.push({x:i[r][e.id()].getLeft(),y:i[r][e.id()].getTop(),width:i[r][e.id()].getWidth(),height:i[r][e.id()].getHeight()})})),e.edges().forEach((function(e){var l=e.source(),c=e.target();if("none"!=l.css("display")&&"none"!=c.css("display"))if("draft"==t.quality){var h=a.get(l.id()),u=a.get(c.id()),d=[],p=[];if(l.isParent()){var g=s.calcBoundingBox(l,n[r].xCoords,n[r].yCoords,a);d.push(g.topLeftX+g.width/2),d.push(g.topLeftY+g.height/2)}else d.push(n[r].xCoords[h]),d.push(n[r].yCoords[h]);if(c.isParent()){var f=s.calcBoundingBox(c,n[r].xCoords,n[r].yCoords,a);p.push(f.topLeftX+f.width/2),p.push(f.topLeftY+f.height/2)}else p.push(n[r].xCoords[u]),p.push(n[r].yCoords[u]);o.edges.push({startX:d[0],startY:d[1],endX:p[0],endY:p[1]})}else i[r][l.id()]&&i[r][c.id()]&&o.edges.push({startX:i[r][l.id()].getCenterX(),startY:i[r][l.id()].getCenterY(),endX:i[r][c.id()].getCenterX(),endY:i[r][c.id()].getCenterY()})})),o.nodes.length>0&&(w.push(o),b.add(r))}}));var T=u.packComponents(w,t.randomize).shifts;if("draft"==t.quality)n.forEach((function(t,e){var r=t.xCoords.map((function(t){return t+T[e].dx})),n=t.yCoords.map((function(t){return t+T[e].dy}));t.xCoords=r,t.yCoords=n}));else{var _=0;b.forEach((function(t){Object.keys(i[t]).forEach((function(e){var r=i[t][e];r.setCenter(r.getCenterX()+T[_].dx,r.getCenterY()+T[_].dy)})),_++}))}}}else{var E=t.eles.boundingBox();if(h.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),t.randomize){var C=l(t);n.push(C)}"default"==t.quality||"proof"==t.quality?(i.push(c(t,n[0])),s.relocateComponent(h[0],i[0],t)):s.relocateComponent(h[0],n[0],t)}var S=o((function(e,r){if("default"==t.quality||"proof"==t.quality){"number"==typeof e&&(e=r);var a=void 0,s=void 0,o=e.data("id");return i.forEach((function(t){o in t&&(a={x:t[o].getRect().getCenterX(),y:t[o].getRect().getCenterY()},s=t[o])})),t.nodeDimensionsIncludeLabels&&(s.labelWidth&&("left"==s.labelPosHorizontal?a.x+=s.labelWidth/2:"right"==s.labelPosHorizontal&&(a.x-=s.labelWidth/2)),s.labelHeight&&("top"==s.labelPosVertical?a.y+=s.labelHeight/2:"bottom"==s.labelPosVertical&&(a.y-=s.labelHeight/2))),null==a&&(a={x:e.position("x"),y:e.position("y")}),{x:a.x,y:a.y}}var l=void 0;return n.forEach((function(t){var r=t.nodeIndexes.get(e.id());null!=r&&(l={x:t.xCoords[r],y:t.yCoords[r]})})),null==l&&(l={x:e.position("x"),y:e.position("y")}),{x:l.x,y:l.y}}),"getPositions");if("default"==t.quality||"proof"==t.quality||t.randomize){var A=s.calcParentsWithoutChildren(e,r),L=r.filter((function(t){return"none"==t.css("display")}));t.eles=r.not(L),r.nodes().not(":parent").not(L).layoutPositions(this,t,S),A.length>0&&A.forEach((function(t){t.position(S(t))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}),"run")}]),t}();t.exports=u},657:(t,e,r)=>{var n=r(548),i=r(140).layoutBase.Matrix,a=r(140).layoutBase.SVD,s=o((function(t){var e=t.cy,r=t.eles,s=r.nodes(),l=r.nodes(":parent"),c=new Map,h=new Map,u=new Map,d=[],p=[],g=[],f=[],m=[],y=[],v=[],x=[],b=void 0,w=1e8,k=1e-9,T=t.piTol,_=t.samplingType,E=t.nodeSeparation,C=void 0,S=o((function(){for(var t=0,e=0,r=!1;e=i;){s=n[i++];for(var g=d[s],f=0;fc&&(c=m[x],u=x)}return u}),"BFS"),L=o((function(t){var e=void 0;if(t){e=Math.floor(Math.random()*b);for(var r=0;r=1)break;c=l}for(var d=0;d=1)break;c=l}for(var m=0;m0&&(n.isParent()?d[e].push(u.get(n.id())):d[e].push(n.id()))}))}));var U=o((function(t){var r=h.get(t),n=void 0;c.get(t).forEach((function(i){n=e.getElementById(i).isParent()?u.get(i):i,d[r].push(n),d[h.get(n)].push(t)}))}),"_loop"),G=!0,q=!1,j=void 0;try{for(var W,Y=c.keys()[Symbol.iterator]();!(G=(W=Y.next()).done);G=!0){U(W.value)}}catch(t){q=!0,j=t}finally{try{!G&&Y.return&&Y.return()}finally{if(q)throw j}}var H=void 0;if((b=h.size)>2){C=b{var n=r(212),i=o((function(t){t&&t("layout","fcose",n)}),"register");"undefined"!=typeof cytoscape&&i(cytoscape),t.exports=i},140:e=>{e.exports=t}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}return o(n,"__webpack_require__"),n(579)})()}))}}),SIt={L:"left",R:"right",T:"top",B:"bottom"},AIt={L:o((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:o((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:o((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:o((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")},LIt={L:o(((t,e)=>t-e+2),"L"),R:o(((t,e)=>t-2),"R"),T:o(((t,e)=>t-e+2),"T"),B:o(((t,e)=>t-2),"B")},NIt=o((function(t){return RIt(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),IIt=o((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),RIt=o((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),MIt=o((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),DIt=o((function(t,e){const r=RIt(t)&&MIt(e),n=MIt(t)&&RIt(e);return r||n}),"isArchitectureDirectionXY"),OIt=o((function(t){const e=t[0],r=t[1],n=RIt(e)&&MIt(r),i=MIt(e)&&RIt(r);return n||i}),"isArchitecturePairXY"),PIt=o((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),BIt=o((function(t,e){const r=`${t}${e}`;return PIt(r)?r:void 0}),"getArchitectureDirectionPair"),$It=o((function([t,e],r){const n=r[0],i=r[1];return RIt(n)?MIt(i)?[t+("L"===n?-1:1),e+("T"===i?1:-1)]:[t+("L"===n?-1:1),e]:RIt(i)?[t+("L"===i?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),FIt=o((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),zIt=o((function(t,e){return DIt(t,e)?"bend":RIt(t)?"horizontal":"vertical"}),"getArchitectureDirectionAlignment"),UIt=o((function(t){return"service"===t.type}),"isArchitectureService"),GIt=o((function(t){return"junction"===t.type}),"isArchitectureJunction"),qIt=o((t=>t.data()),"edgeData"),jIt=o((t=>t.data()),"nodeData"),WIt=Lt.architecture,YIt=new NX((()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:WIt,dataStructures:void 0,elements:{}}))),HIt=o((()=>{YIt.reset(),qr()}),"clear"),VIt=o((function({id:t,icon:e,in:r,title:n,iconText:i}){if(void 0!==YIt.records.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${YIt.records.registeredIds[t]}`);if(void 0!==r){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===YIt.records.registeredIds[r])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===YIt.records.registeredIds[r])throw new Error(`The service [${t}]'s parent is not a group`)}YIt.records.registeredIds[t]="node",YIt.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}}),"addService"),XIt=o((()=>Object.values(YIt.records.nodes).filter(UIt)),"getServices"),KIt=o((function({id:t,in:e}){YIt.records.registeredIds[t]="node",YIt.records.nodes[t]={id:t,type:"junction",edges:[],in:e}}),"addJunction"),ZIt=o((()=>Object.values(YIt.records.nodes).filter(GIt)),"getJunctions"),QIt=o((()=>Object.values(YIt.records.nodes)),"getNodes"),JIt=o((t=>YIt.records.nodes[t]),"getNode"),tRt=o((function({id:t,icon:e,in:r,title:n}){if(void 0!==YIt.records.registeredIds[t])throw new Error(`The group id [${t}] is already in use by another ${YIt.records.registeredIds[t]}`);if(void 0!==r){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===YIt.records.registeredIds[r])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===YIt.records.registeredIds[r])throw new Error(`The group [${t}]'s parent is not a group`)}YIt.records.registeredIds[t]="group",YIt.records.groups[t]={id:t,icon:e,title:n,in:r}}),"addGroup"),eRt=o((()=>Object.values(YIt.records.groups)),"getGroups"),rRt=o((function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!IIt(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(!IIt(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(void 0===YIt.records.nodes[t]&&void 0===YIt.records.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===YIt.records.nodes[e]&&void 0===YIt.records.groups[t])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const c=YIt.records.nodes[t].in,h=YIt.records.nodes[e].in;if(s&&c&&h&&c==h)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(o&&c&&h&&c==h)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const u={lhsId:t,lhsDir:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:o,title:l};YIt.records.edges.push(u),YIt.records.nodes[t]&&YIt.records.nodes[e]&&(YIt.records.nodes[t].edges.push(YIt.records.edges[YIt.records.edges.length-1]),YIt.records.nodes[e].edges.push(YIt.records.edges[YIt.records.edges.length-1]))}),"addEdge"),nRt=o((()=>YIt.records.edges),"getEdges"),iRt=o((()=>{if(void 0===YIt.records.dataStructures){const t={},e=Object.entries(YIt.records.nodes).reduce(((e,[r,n])=>(e[r]=n.edges.reduce(((e,n)=>{const i=JIt(n.lhsId)?.in,a=JIt(n.rhsId)?.in;if(i&&a&&i!==a){const e=zIt(n.lhsDir,n.rhsDir);"bend"!==e&&(t[i]??={},t[i][a]=e,t[a]??={},t[a][i]=e)}if(n.lhsId===r){const t=BIt(n.lhsDir,n.rhsDir);t&&(e[t]=n.rhsId)}else{const t=BIt(n.rhsDir,n.lhsDir);t&&(e[t]=n.lhsId)}return e}),{}),e)),{}),r=Object.keys(e)[0],n={[r]:1},i=Object.keys(e).reduce(((t,e)=>e===r?t:{...t,[e]:1}),{}),a=o((t=>{const r={[t]:[0,0]},a=[t];for(;a.length>0;){const t=a.shift();if(t){n[t]=1,delete i[t];const s=e[t],[o,l]=r[t];Object.entries(s).forEach((([t,e])=>{n[e]||(r[e]=$It([o,l],t),a.push(e))}))}}return r}),"BFS"),s=[a(r)];for(;Object.keys(i).length>0;)s.push(a(Object.keys(i)[0]));YIt.records.dataStructures={adjList:e,spatialMaps:s,groupAlignments:t}}return YIt.records.dataStructures}),"getDataStructures"),aRt=o(((t,e)=>{YIt.records.elements[t]=e}),"setElementForId"),sRt=o((t=>YIt.records.elements[t]),"getElementById"),oRt={clear:HIt,setDiagramTitle:Vr,getDiagramTitle:Xr,setAccTitle:jr,getAccTitle:Wr,setAccDescription:Yr,getAccDescription:Hr,addService:VIt,getServices:XIt,addJunction:KIt,getJunctions:ZIt,getNodes:QIt,getNode:JIt,addGroup:tRt,getGroups:eRt,addEdge:rRt,getEdges:nRt,setElementForId:aRt,getElementById:sRt,getDataStructures:iRt};function lRt(t){const e=Qr().architecture;return e?.[t]?e[t]:WIt[t]}o(lRt,"getConfigField");var cRt=o(((t,e)=>{IX(t,e),t.groups.map(e.addGroup),t.services.map((t=>e.addService({...t,type:"service"}))),t.junctions.map((t=>e.addJunction({...t,type:"junction"}))),t.edges.map(e.addEdge)}),"populateDb"),hRt={parse:o((async t=>{const e=await Tet("architecture",t);y.debug(e),cRt(e,oRt)}),"parse")},uRt=o((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles"),dRt=p(CIt(),1),pRt=o((t=>`${t}`),"wrapIcon"),gRt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:pRt('')},server:{body:pRt('')},disk:{body:pRt('')},internet:{body:pRt('')},cloud:{body:pRt('')},unknown:By,blank:{body:pRt("")}}},fRt=o((async function(t,e){const r=lRt("padding"),n=lRt("iconSize"),i=n/2,a=n/6,s=a/2;await Promise.all(e.edges().map((async e=>{const{source:n,sourceDir:o,sourceArrow:l,sourceGroup:c,target:h,targetDir:u,targetArrow:d,targetGroup:p,label:g}=qIt(e);let{x:f,y:m}=e[0].sourceEndpoint();const{x:y,y:v}=e[0].midpoint();let{x:x,y:b}=e[0].targetEndpoint();const w=r+4;if(c&&(RIt(o)?f+="L"===o?-w:w:m+="T"===o?-w:w+18),p&&(RIt(u)?x+="L"===u?-w:w:b+="T"===u?-w:w+18),c||"junction"!==oRt.getNode(n)?.type||(RIt(o)?f+="L"===o?i:-i:m+="T"===o?i:-i),p||"junction"!==oRt.getNode(h)?.type||(RIt(u)?x+="L"===u?i:-i:b+="T"===u?i:-i),e[0]._private.rscratch){const e=t.insert("g");if(e.insert("path").attr("d",`M ${f},${m} L ${y},${v} L${x},${b} `).attr("class","edge"),l){const t=RIt(o)?LIt[o](f,a):f-s,r=MIt(o)?LIt[o](m,a):m-s;e.insert("polygon").attr("points",AIt[o](a)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(d){const t=RIt(u)?LIt[u](x,a):x-s,r=MIt(u)?LIt[u](b,a):b-s;e.insert("polygon").attr("points",AIt[u](a)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(g){const t=DIt(o,u)?"XY":RIt(o)?"X":"Y";let r=0;r="X"===t?Math.abs(f-x):"Y"===t?Math.abs(m-b)/1.5:Math.abs(f-x)/2;const n=e.append("g");if(await v_(n,g,{useHtmlLabels:!1,width:r,classes:"architecture-service-label"},Qr()),n.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)n.attr("transform","translate("+y+", "+v+")");else if("Y"===t)n.attr("transform","translate("+y+", "+v+") rotate(-90)");else if("XY"===t){const t=BIt(o,u);if(t&&OIt(t)){const e=n.node().getBoundingClientRect(),[r,i]=FIt(t);n.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*r*i*45})`);const a=n.node().getBoundingClientRect();n.attr("transform",`\n translate(${y}, ${v-e.height/2})\n translate(${r*a.width/2}, ${i*a.height/2})\n rotate(${-1*r*i*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges"),mRt=o((async function(t,e){const r=.75*lRt("padding"),n=lRt("fontSize"),i=lRt("iconSize")/2;await Promise.all(e.nodes().map((async e=>{const a=jIt(e);if("group"===a.type){const{h:s,w:o,x1:l,y1:c}=e.boundingBox();t.append("rect").attr("x",l+i).attr("y",c+i).attr("width",o).attr("height",s).attr("class","node-bkg");const h=t.append("g");let u=l,d=c;if(a.icon){const t=h.append("g");t.html(`${await Gy(a.icon,{height:r,width:r,fallbackPrefix:gRt.prefix})}`),t.attr("transform","translate("+(u+i+1)+", "+(d+i+1)+")"),u+=r,d+=n/2-1-2}if(a.label){const t=h.append("g");await v_(t,a.label,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},Qr()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(u+i+4)+", "+(d+i+2)+")")}}})))}),"drawGroups"),yRt=o((async function(t,e,r){for(const n of r){const r=e.append("g"),i=lRt("iconSize");if(n.title){const t=r.append("g");await v_(t,n.title,{useHtmlLabels:!1,width:1.5*i,classes:"architecture-service-label"},Qr()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+i/2+", "+i+")")}const a=r.append("g");if(n.icon)a.html(`${await Gy(n.icon,{height:i,width:i,fallbackPrefix:gRt.prefix})}`);else if(n.iconText){a.html(`${await Gy("blank",{height:i,width:i,fallbackPrefix:gRt.prefix})}`);const t=a.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(n.iconText),e=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/e)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+n.id).attr("d",`M0 ${i} v${-i} q0,-5 5,-5 h${i} q5,0 5,5 v${i} H0 Z`);r.attr("class","architecture-service");const{width:s,height:o}=r._groups[0][0].getBBox();n.width=s,n.height=o,t.setElementForId(n.id,r)}return 0}),"drawServices"),vRt=o((function(t,e,r){r.forEach((r=>{const n=e.append("g"),i=lRt("iconSize");n.append("g").append("rect").attr("id","node-"+r.id).attr("fill-opacity","0").attr("width",i).attr("height",i),n.attr("class","architecture-junction");const{width:a,height:s}=n._groups[0][0].getBBox();n.width=a,n.height=s,t.setElementForId(r.id,n)}))}),"drawJunctions");function xRt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:lRt("iconSize"),height:lRt("iconSize")},classes:"node-service"})}))}function bRt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:lRt("iconSize"),height:lRt("iconSize")},classes:"node-junction"})}))}function wRt(t,e){e.nodes().map((e=>{const r=jIt(e);if("group"===r.type)return;r.x=e.position().x,r.y=e.position().y;t.getElementById(r.id).attr("transform","translate("+(r.x||0)+","+(r.y||0)+")")}))}function kRt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}function TRt(t,e){t.forEach((t=>{const{lhsId:r,rhsId:n,lhsInto:i,lhsGroup:a,rhsInto:s,lhsDir:o,rhsDir:l,rhsGroup:c,title:h}=t,u=DIt(t.lhsDir,t.rhsDir)?"segments":"straight",d={id:`${r}-${n}`,label:h,source:r,sourceDir:o,sourceArrow:i,sourceGroup:a,sourceEndpoint:"L"===o?"0 50%":"R"===o?"100% 50%":"T"===o?"50% 0":"50% 100%",target:n,targetDir:l,targetArrow:s,targetGroup:c,targetEndpoint:"L"===l?"0 50%":"R"===l?"100% 50%":"T"===l?"50% 0":"50% 100%"};e.add({group:"edges",data:d,classes:u})}))}function _Rt(t,e,r){const n=o(((t,e)=>Object.entries(t).reduce(((t,[n,i])=>{let a=0;const s=Object.entries(i);if(1===s.length)return t[n]=s[0][1],t;for(let i=0;i{const r={},i={};return Object.entries(e).forEach((([e,[n,a]])=>{const s=t.getNode(e)?.in??"default";r[a]??={},r[a][s]??=[],r[a][s].push(e),i[n]??={},i[n][s]??=[],i[n][s].push(e)})),{horiz:Object.values(n(r,"horizontal")).filter((t=>t.length>1)),vert:Object.values(n(i,"vertical")).filter((t=>t.length>1))}})),[a,s]=i.reduce((([t,e],{horiz:r,vert:n})=>[[...t,...r],[...e,...n]]),[[],[]]);return{horizontal:a,vertical:s}}function ERt(t){const e=[],r=o((t=>`${t[0]},${t[1]}`),"posToStr"),n=o((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const i=Object.fromEntries(Object.entries(t).map((([t,e])=>[r(e),t]))),a=[r([0,0])],s={},o={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const t=a.shift();if(t){s[t]=1;const l=i[t];if(l){const c=n(t);Object.entries(o).forEach((([t,n])=>{const o=r([c[0]+n[0],c[1]+n[1]]),h=i[o];h&&!s[o]&&(a.push(o),e.push({[SIt[t]]:h,[SIt[NIt(t)]]:l,gap:1.5*lRt("iconSize")}))}))}}}})),e}function CRt(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise((l=>{const c=Ga("body").append("div").attr("id","cy").attr("style","display:none"),h=HEt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${lRt("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${lRt("padding")}px`}}]});c.remove(),kRt(r,h),xRt(t,h),bRt(e,h),TRt(n,h);const u=_Rt(i,a,s),d=ERt(a),p=h.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[e,r]=t.connectedNodes(),{parent:n}=jIt(e),{parent:i}=jIt(r);return n===i?1.5*lRt("iconSize"):.5*lRt("iconSize")},edgeElasticity(t){const[e,r]=t.connectedNodes(),{parent:n}=jIt(e),{parent:i}=jIt(r);return n===i?.45:.001},alignmentConstraint:u,relativePlacementConstraint:d});p.one("layoutstop",(()=>{function t(t,e,r,n){let i,a;const{x:s,y:o}=t,{x:l,y:c}=e;a=(n-o+(s-r)*(o-c)/(s-l))/Math.sqrt(1+Math.pow((o-c)/(s-l),2)),i=Math.sqrt(Math.pow(n-o,2)+Math.pow(r-s,2)-Math.pow(a,2));i/=Math.sqrt(Math.pow(l-s,2)+Math.pow(c-o,2));let h=(l-s)*(n-o)-(c-o)*(r-s);switch(!0){case h>=0:h=1;break;case h<0:h=-1}let u=(l-s)*(r-s)+(c-o)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}return a=Math.abs(a)*h,i*=u,{distances:a,weights:i}}o(t,"getSegmentWeights"),h.startBatch();for(const e of Object.values(h.edges()))if(e.data?.()){const{x:r,y:n}=e.source().position(),{x:i,y:a}=e.target().position();if(r!==i&&n!==a){const r=e.sourceEndpoint(),n=e.targetEndpoint(),{sourceDir:i}=qIt(e),[a,s]=MIt(i)?[r.x,n.y]:[n.x,r.y],{weights:o,distances:l}=t(r,n,a,s);e.style("segment-distances",l),e.style("segment-weights",o)}}h.endBatch(),p.run()})),p.run(),h.ready((t=>{y.info("Ready",t),l(h)}))}))}zy([{name:gRt.prefix,icons:gRt}]),HEt.use(dRt.default),o(xRt,"addServices"),o(bRt,"addJunctions"),o(wRt,"positionNodes"),o(kRt,"addGroups"),o(TRt,"addEdges"),o(_Rt,"getAlignments"),o(ERt,"getRelativeConstraints"),o(CRt,"layoutArchitecture");var SRt=o((async(t,e,r,n)=>{const i=n.db,a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),c=i.getDataStructures(),h=ag(e),u=h.append("g");u.attr("class","architecture-edges");const d=h.append("g");d.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await yRt(i,d,a),vRt(i,d,s);const g=await CRt(a,s,o,l,i,c);await fRt(u,g),await mRt(p,g),wRt(i,g),Mr(void 0,h,lRt("padding"),lRt("useMaxWidth"))}),"draw"),ARt={parser:hRt,db:oRt,renderer:{draw:SRt},styles:uRt},LRt=Object.freeze({__proto__:null,diagram:ARt}),NRt=Object.freeze({__proto__:null,InfoModule:Uet,createInfoServices:Get}),IRt=Object.freeze({__proto__:null,PacketModule:jet,createPacketServices:Wet}),RRt=Object.freeze({__proto__:null,PieModule:Aet,createPieServices:Let}),MRt=Object.freeze({__proto__:null,ArchitectureModule:Ret,createArchitectureServices:Met}),DRt=Object.freeze({__proto__:null,GitGraphModule:Oet,createGitGraphServices:Pet}),ORt=Object.freeze({__proto__:null,RadarModule:$et,createRadarServices:Fet});return()=>HI}));