@smartmemory/compose 0.2.52-beta → 0.2.54-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/.claude/skills/compose/SKILL.md +0 -8
  2. package/README.md +39 -0
  3. package/bin/compose.js +378 -3
  4. package/dist/assets/App-D_tvTs_n.js +896 -0
  5. package/dist/assets/abnfDiagram-VRR7QNED-Dhb7O5rp.js +1 -0
  6. package/dist/assets/arc-C4oVdnk2.js +1 -0
  7. package/dist/assets/architectureDiagram-ZJ3FMSHR-DqHrb5_F.js +36 -0
  8. package/dist/assets/blockDiagram-677ZJIJ3-DUyBayYK.js +132 -0
  9. package/dist/assets/{browser-CnKiSnlr.js → browser-Cr0recrN.js} +6 -6
  10. package/dist/assets/{c4Diagram-AHTNJAMY-DtDSNlOX.js → c4Diagram-LMCZKHZV-CxlkWMRK.js} +1 -1
  11. package/dist/assets/channel-xb4mQfuL.js +1 -0
  12. package/dist/assets/{chunk-QZHKN3VN-BMWFLZ8t.js → chunk-2Q5K7J3B-C6QJsyOQ.js} +1 -1
  13. package/dist/assets/{chunk-YZCP3GAM-CqjNXooj.js → chunk-32BRIVSS-D9NgYu9W.js} +1 -1
  14. package/dist/assets/{chunk-FMBD7UC4-BAa7Edp6.js → chunk-5VM5RSS4-DbD86rhK.js} +1 -1
  15. package/dist/assets/chunk-EX3LRPZG-E4m4xNMw.js +231 -0
  16. package/dist/assets/{chunk-4BX2VUAB-oXU2npoL.js → chunk-JWPE2WC7-DHGlRWbw.js} +1 -1
  17. package/dist/assets/chunk-MOJQB5TN-BblYnFUq.js +88 -0
  18. package/dist/assets/chunk-RYQCIY6F-CGT-88vL.js +1 -0
  19. package/dist/assets/chunk-V7JOEXUC-BJJmX0mc.js +206 -0
  20. package/dist/assets/{chunk-EDXVE4YY-Bse2kdRh.js → chunk-VR4S4FIN-B4ygduCD.js} +1 -1
  21. package/dist/assets/{chunk-55IACEB6-BEEk2FdH.js → chunk-XXDRQBXY-7APXuI2s.js} +1 -1
  22. package/dist/assets/classDiagram-OUVF2IWQ-BIvgPTgh.js +1 -0
  23. package/dist/assets/classDiagram-v2-EOCWNBFH-BIvgPTgh.js +1 -0
  24. package/dist/assets/{cose-bilkent-S5V4N54A-NYnH3mVW.js → cose-bilkent-JH36ORCC-DnVcT6R6.js} +1 -1
  25. package/dist/assets/cynefin-VYW2F7L2-C9qiUSfX.js +178 -0
  26. package/dist/assets/cynefinDiagram-TSTJHNR4-BowkQhEu.js +62 -0
  27. package/dist/assets/dagre-VKFMJZFB-Y5V-7U3p.js +4 -0
  28. package/dist/assets/diagram-FQU43EPY-I7wDE-Xp.js +3 -0
  29. package/dist/assets/diagram-G47NLZAW-DapGa1HI.js +24 -0
  30. package/dist/assets/diagram-NH7WQ7WH-CHO1JntO.js +24 -0
  31. package/dist/assets/diagram-OA4YK3LP-mBWP2D1G.js +30 -0
  32. package/dist/assets/diagram-WEI45ONY-C8KN8YnF.js +41 -0
  33. package/dist/assets/ebnfDiagram-CCIWWBDH-ZkJG9NOL.js +1 -0
  34. package/dist/assets/erDiagram-Q63AITRT-DGnL3kW1.js +85 -0
  35. package/dist/assets/flowDiagram-23GEKE2U-DHYupfOu.js +156 -0
  36. package/dist/assets/ganttDiagram-NO4QXBWP-B1B2zpwR.js +292 -0
  37. package/dist/assets/gitGraphDiagram-IHSO6WYX-B9_OP4Fs.js +106 -0
  38. package/dist/assets/graph-C9eacEi8.js +1 -0
  39. package/dist/assets/graph-xkel59g2.js +331 -0
  40. package/dist/assets/index-0Hq9436Q.js +119 -0
  41. package/dist/assets/index-LIwREYgH.css +1 -0
  42. package/dist/assets/infoDiagram-FWYZ7A6U-D-a34TqE.js +2 -0
  43. package/dist/assets/{ishikawaDiagram-UXIWVN3A-CK2IFFAP.js → ishikawaDiagram-FXEZZL3T-h0bUvXGV.js} +5 -5
  44. package/dist/assets/{journeyDiagram-VCZTEJTY-DAH5Stkf.js → journeyDiagram-5HDEW3XC-B4lm0RBa.js} +1 -1
  45. package/dist/assets/{kanban-definition-6JOO6SKY-Bi0aCqkv.js → kanban-definition-HUTT4EX6-msvfouRX.js} +7 -7
  46. package/dist/assets/katex-C5jXJg4s.js +257 -0
  47. package/dist/assets/layout-DEXfKzaS.js +1 -0
  48. package/dist/assets/{linear-ClGEGlS2.js → linear-B0trv2xN.js} +1 -1
  49. package/dist/assets/map-Czzmt4hB.js +1 -0
  50. package/dist/assets/{mindmap-definition-QFDTVHPH-Wjr-PgC6.js → mindmap-definition-LN4V7U3C-CvswbRgd.js} +7 -7
  51. package/dist/assets/{mobile-Chw8RWyH.js → mobile-CNLMhdFP.js} +2 -2
  52. package/dist/assets/pegDiagram-2B236MQR-DZEmIYC7.js +1 -0
  53. package/dist/assets/pieDiagram-ENE6RG2P-1ZfqxHkL.js +39 -0
  54. package/dist/assets/quadrantDiagram-ABIIQ3AL-Owx49uiJ.js +7 -0
  55. package/dist/assets/railroadDiagram-RFXS5EU6-B7RiaIGf.js +1 -0
  56. package/dist/assets/{requirementDiagram-MS252O5E-CU9Rlyq5.js → requirementDiagram-TGXJPOKE-fqmHs_5o.js} +3 -3
  57. package/dist/assets/sankeyDiagram-HTMAVEWB-D0Q3FeKV.js +40 -0
  58. package/dist/assets/sequenceDiagram-DBY2YBRQ-CnPuB3fy.js +162 -0
  59. package/dist/assets/sizeCapture-X5ZJPWSS-CsHoR37V.js +1 -0
  60. package/dist/assets/stateDiagram-2N3HPSRC-GVwpflU5.js +1 -0
  61. package/dist/assets/stateDiagram-v2-6OUMAXLB-DCGIHFu9.js +1 -0
  62. package/dist/assets/swimlanes-5IMT3BWC-DRR41dsQ.js +2 -0
  63. package/dist/assets/swimlanesDiagram-G3AALYLV-C4RhLkZo.js +8 -0
  64. package/dist/assets/{timeline-definition-GMOUNBTQ-C8SZmaLp.js → timeline-definition-FHXFAJF6-ePaEemL7.js} +3 -3
  65. package/dist/assets/vennDiagram-L72KCM5P-BAYP8dNF.js +34 -0
  66. package/dist/assets/wardleyDiagram-EHGQE667-jNVH5Adm.js +78 -0
  67. package/dist/assets/xychartDiagram-FW5EYKEG-BYDWGXbZ.js +7 -0
  68. package/dist/index.html +3 -3
  69. package/lib/agent-string.js +34 -0
  70. package/lib/build.js +542 -148
  71. package/lib/experiment-judge.js +145 -0
  72. package/lib/experiment-metrics.js +265 -0
  73. package/lib/experiment-pricing.js +60 -0
  74. package/lib/experiment-report.js +306 -0
  75. package/lib/experiment-sandbox.js +147 -0
  76. package/lib/experiment.js +539 -0
  77. package/lib/feature-events.js +10 -0
  78. package/lib/feature-json.js +1 -1
  79. package/lib/feature-writer.js +30 -0
  80. package/lib/flow-state.js +36 -0
  81. package/lib/gate-prompt.js +66 -6
  82. package/lib/lifecycle-modes.js +213 -0
  83. package/lib/new.js +6 -2
  84. package/lib/roadmap-graph/index.js +26 -28
  85. package/lib/roadmap-graph/vision-adapter.js +126 -0
  86. package/lib/smartmemory-client.js +139 -0
  87. package/lib/smartmemory-config.js +50 -0
  88. package/lib/smartmemory-ingest.js +115 -0
  89. package/lib/smartmemory-sync.js +275 -0
  90. package/lib/stratum-mcp-client.js +9 -0
  91. package/lib/triage.js +7 -1
  92. package/lib/vision-writer.js +30 -6
  93. package/package.json +1 -1
  94. package/pipelines/plan.stratum.yaml +161 -0
  95. package/server/artifact-manager.js +30 -3
  96. package/server/compose-mcp-tools.js +11 -9
  97. package/server/compose-mcp.js +4 -0
  98. package/server/feature-scan.js +87 -173
  99. package/server/gate-log-store.js +11 -1
  100. package/server/graph-export.js +0 -0
  101. package/server/index.js +3 -5
  102. package/server/lifecycle-guard.js +62 -25
  103. package/server/roadmap-graph-vision.js +138 -0
  104. package/server/smartmemory-routes.js +113 -0
  105. package/server/status-snapshot.js +8 -7
  106. package/server/vision-routes.js +64 -33
  107. package/server/vision-server.js +6 -0
  108. package/server/vision-store.js +13 -4
  109. package/.claude/skills/compose/references/hermes-tools.md +0 -80
  110. package/dist/assets/App-Ddhfx18X.js +0 -889
  111. package/dist/assets/_baseUniq-CoEVVYyC.js +0 -1
  112. package/dist/assets/arc-DFnGxuCB.js +0 -1
  113. package/dist/assets/architectureDiagram-Q4EWVU46-66rx01Tn.js +0 -36
  114. package/dist/assets/blockDiagram-DXYQGD6D-AE5PKSak.js +0 -132
  115. package/dist/assets/channel-CScyWprq.js +0 -1
  116. package/dist/assets/chunk-4TB4RGXK-5w2lZAjW.js +0 -206
  117. package/dist/assets/chunk-OYMX7WX6-CGr_YiAc.js +0 -231
  118. package/dist/assets/classDiagram-6PBFFD2Q-DibVYYdr.js +0 -1
  119. package/dist/assets/classDiagram-v2-HSJHXN6E-DibVYYdr.js +0 -1
  120. package/dist/assets/clone-ZMALIFmw.js +0 -1
  121. package/dist/assets/dagre-KV5264BT--mrfaTHR.js +0 -4
  122. package/dist/assets/diagram-5BDNPKRD-DjXvyFzh.js +0 -10
  123. package/dist/assets/diagram-G4DWMVQ6-BrrexEvm.js +0 -24
  124. package/dist/assets/diagram-MMDJMWI5-D3Q0OT2M.js +0 -43
  125. package/dist/assets/diagram-TYMM5635-DKTntmxE.js +0 -24
  126. package/dist/assets/erDiagram-SMLLAGMA-BWbR0dPj.js +0 -85
  127. package/dist/assets/flowDiagram-DWJPFMVM-Dj5M5XaY.js +0 -162
  128. package/dist/assets/ganttDiagram-T4ZO3ILL-DKppFh_5.js +0 -292
  129. package/dist/assets/gitGraphDiagram-UUTBAWPF-9xQ9O25V.js +0 -106
  130. package/dist/assets/graph-Cgmhvu1T.js +0 -1
  131. package/dist/assets/graph-DZe55uk8.js +0 -331
  132. package/dist/assets/index-BxRamj_i.css +0 -1
  133. package/dist/assets/index-D8uDfn8y.js +0 -123
  134. package/dist/assets/infoDiagram-42DDH7IO-DQYWVzVN.js +0 -2
  135. package/dist/assets/katex-DkKDou_j.js +0 -257
  136. package/dist/assets/layout-DN13RkA1.js +0 -1
  137. package/dist/assets/min-CXr-fUFS.js +0 -1
  138. package/dist/assets/pieDiagram-DEJITSTG-CVipbIlr.js +0 -30
  139. package/dist/assets/quadrantDiagram-34T5L4WZ-CHJFyhm-.js +0 -7
  140. package/dist/assets/sankeyDiagram-XADWPNL6-BSULeqST.js +0 -10
  141. package/dist/assets/sequenceDiagram-FGHM5R23-CCOKXvjj.js +0 -157
  142. package/dist/assets/stateDiagram-FHFEXIEX-B91gKA7Q.js +0 -1
  143. package/dist/assets/stateDiagram-v2-QKLJ7IA2-Dc8ur9ta.js +0 -1
  144. package/dist/assets/vennDiagram-DHZGUBPP-YvEPDlsM.js +0 -34
  145. package/dist/assets/wardley-RL74JXVD-TMBUq_w1.js +0 -162
  146. package/dist/assets/wardleyDiagram-NUSXRM2D-DzEkPrri.js +0 -20
  147. package/dist/assets/xychartDiagram-5P7HB3ND-BIiCeiYk.js +0 -7
  148. package/lib/roadmap-graph/collect.js +0 -178
@@ -0,0 +1 @@
1
+ import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-BblYnFUq.js";import{p as f}from"./chunk-JWPE2WC7-DHGlRWbw.js";import{_ as n,l as o}from"./App-D_tvTs_n.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-C9qiUSfX.js";import"./mobile-CNLMhdFP.js";import"./index-0Hq9436Q.js";import"./graph-xkel59g2.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},I={parser:R,db:a,renderer:u,styles:p};export{I as diagram};
@@ -0,0 +1 @@
1
+ import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./App-D_tvTs_n.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
@@ -0,0 +1,36 @@
1
+ import{p as gt}from"./chunk-JWPE2WC7-DHGlRWbw.js";import{_ as f,D as ut,W as pt,l as tt,b as mt,a as yt,n as wt,o as kt,g as xt,s as bt,p as vt,A as $t,y as Et,B as St,c as Z,ak as q,ai as _,i as At,d as Dt,q as Tt,aj as Ct,al as Bt}from"./App-D_tvTs_n.js";import{p as It}from"./cynefin-VYW2F7L2-C9qiUSfX.js";import{c as et,f as Lt}from"./graph-xkel59g2.js";import"./mobile-CNLMhdFP.js";import"./index-0Hq9436Q.js";var Q={L:"left",R:"right",T:"top",B:"bottom"},U={L:f(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:f(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:f(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:f(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},Y={L:f((e,t)=>e-t+2,"L"),R:f((e,t)=>e-2,"R"),T:f((e,t)=>e-t+2,"T"),B:f((e,t)=>e-2,"B")},jt=f(function(e){return I(e)?e==="L"?"R":"L":e==="T"?"B":"T"},"getOppositeArchitectureDirection"),K=f(function(e){const t=e;return t==="L"||t==="R"||t==="T"||t==="B"},"isArchitectureDirection"),I=f(function(e){const t=e;return t==="L"||t==="R"},"isArchitectureDirectionX"),P=f(function(e){const t=e;return t==="T"||t==="B"},"isArchitectureDirectionY"),V=f(function(e,t){const r=I(e)&&P(t),i=P(e)&&I(t);return r||i},"isArchitectureDirectionXY"),zt=f(function(e){const t=e[0],r=e[1],i=I(t)&&P(r),s=P(t)&&I(r);return i||s},"isArchitecturePairXY"),Ft=f(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),H=f(function(e,t){const r=`${e}${t}`;return Ft(r)?r:void 0},"getArchitectureDirectionPair"),Pt=f(function([e,t],r){const i=r[0],s=r[1];return I(i)?P(s)?[e+(i==="L"?-1:1),t+(s==="T"?1:-1)]:[e+(i==="L"?-1:1),t]:I(s)?[e+(s==="L"?1:-1),t+(i==="T"?1:-1)]:[e,t+(i==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Mt=f(function(e){return e==="LT"||e==="TL"?[1,1]:e==="BL"||e==="LB"?[1,-1]:e==="BR"||e==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Rt=f(function(e,t){return V(e,t)?"bend":I(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Ot=f(function(e){return e.type==="service"},"isArchitectureService"),Xt=f(function(e){return e.type==="junction"},"isArchitectureJunction"),it=f(e=>e.data(),"edgeData"),R=f(e=>e.data(),"nodeData"),Yt=St.architecture,O,rt=(O=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=mt,this.getAccTitle=yt,this.setDiagramTitle=wt,this.getDiagramTitle=kt,this.getAccDescription=xt,this.setAccDescription=bt,this.clear()}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",vt()}addService({id:t,icon:r,in:i,title:s,iconText:l}){if(this.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(i!==void 0){if(t===i)throw new Error(`The service [${t}] cannot be placed within itself`);if(this.registeredIds[i]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[i]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:r,iconText:l,title:s,edges:[],in:i}}getServices(){return Object.values(this.nodes).filter(Ot)}addJunction({id:t,in:r}){if(this.registeredIds[t]!==void 0)throw new Error(`The junction id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The junction [${t}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(Xt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:r,in:i,title:s}){var l,m,g;if(((l=this.registeredIds)==null?void 0:l[t])!==void 0)throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(i!==void 0){if(t===i)throw new Error(`The group [${t}] cannot be placed within itself`);if(((m=this.registeredIds)==null?void 0:m[i])===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(((g=this.registeredIds)==null?void 0:g[i])==="node")throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:r,title:s,in:i}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:r,lhsDir:i,rhsDir:s,lhsInto:l,rhsInto:m,lhsGroup:g,rhsGroup:p,title:u}){if(!K(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!K(s))throw new Error(`Invalid direction given for right hand side of edge ${t}--${r}. Expected (L,R,T,B) got ${String(s)}`);if(this.nodes[t]===void 0&&this.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[t].in,o=this.nodes[r].in;if(g&&h&&o&&h==o)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(p&&h&&o&&h==o)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const a={lhsId:t,lhsDir:i,lhsInto:l,lhsGroup:g,rhsId:r,rhsDir:s,rhsInto:m,rhsGroup:p,title:u};this.edges.push(a),this.nodes[t]&&this.nodes[r]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(t){if(t.members.length<2)throw new Error(`An align directive requires at least two members; got ${t.members.length}`);const r=new Set;t.members.forEach(i=>{if(this.registeredIds[i]!=="node")throw new Error(`align ${t.direction} references [${i}], which is not a service or junction`);if(r.has(i))throw new Error(`align ${t.direction} lists [${i}] more than once`);r.add(i)}),this.layoutHints.push(t)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const t={},r=Object.entries(this.nodes).reduce((p,[u,h])=>(p[u]=h.edges.reduce((o,a)=>{var n,b;const d=(n=this.getNode(a.lhsId))==null?void 0:n.in,c=(b=this.getNode(a.rhsId))==null?void 0:b.in;if(d&&c&&d!==c){const k=Rt(a.lhsDir,a.rhsDir);k!=="bend"&&(t[d]??(t[d]={}),t[d][c]=k,t[c]??(t[c]={}),t[c][d]=k)}if(a.lhsId===u){const k=H(a.lhsDir,a.rhsDir);k&&(o[k]=a.rhsId)}else{const k=H(a.rhsDir,a.lhsDir);k&&(o[k]=a.lhsId)}return o},{}),p),{}),i=Object.keys(r)[0],s={[i]:1},l=Object.keys(r).reduce((p,u)=>u===i?p:{...p,[u]:1},{}),m=f(p=>{const u={[p]:[0,0]},h=[p];for(;h.length>0;){const o=h.shift();if(o){s[o]=1,delete l[o];const a=r[o],[d,c]=u[o];Object.entries(a).forEach(([n,b])=>{s[b]||(u[b]=Pt([d,c],n),h.push(b))})}}return u},"BFS"),g=[m(i)];for(;Object.keys(l).length>0;)g.push(m(Object.keys(l)[0]));this.dataStructures={adjList:r,spatialMaps:g,groupAlignments:t}}return this.dataStructures}setElementForId(t,r){this.elements[t]=r}getElementById(t){return this.elements[t]}getConfig(){return $t({...Yt,...Et().architecture})}getConfigField(t){return this.getConfig()[t]}},f(O,"ArchitectureDB"),O),Gt=f((e,t)=>{var r;gt(e,t),e.groups.map(i=>t.addGroup(i)),e.services.map(i=>t.addService({...i,type:"service"})),e.junctions.map(i=>t.addJunction({...i,type:"junction"})),e.edges.map(i=>t.addEdge(i)),(r=e.alignments)==null||r.map(i=>t.addLayoutHint({direction:i.direction,members:[...i.members]}))},"populateDb"),st={parser:{yy:void 0},parse:f(async e=>{var i;const t=await It("architecture",e);tt.debug(t);const r=(i=st.parser)==null?void 0:i.yy;if(!(r instanceof rt))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(t,r)},"parse")},Nt=f(e=>`
2
+ .edge {
3
+ stroke-width: ${e.archEdgeWidth};
4
+ stroke: ${e.archEdgeColor};
5
+ fill: none;
6
+ }
7
+
8
+ .arrow {
9
+ fill: ${e.archEdgeArrowColor};
10
+ }
11
+
12
+ .node-bkg {
13
+ fill: none;
14
+ stroke: ${e.archGroupBorderColor};
15
+ stroke-width: ${e.archGroupBorderWidth};
16
+ stroke-dasharray: 8;
17
+ }
18
+ .node-icon-text {
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+
23
+ .node-icon-text > div {
24
+ color: #fff;
25
+ margin: 1px;
26
+ height: fit-content;
27
+ text-align: center;
28
+ overflow: hidden;
29
+ display: -webkit-box;
30
+ -webkit-box-orient: vertical;
31
+ }
32
+ `,"getStyles"),_t=Nt;function J(e,t){if(e===0)return t();const r=Math.random;let i=e>>>0;Math.random=function(){i=i+1831565813>>>0;let s=i;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=r}}f(J,"withSeededRandom");var M=f(e=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,"wrapIcon"),X={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:M('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:M('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:M('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:M('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:M('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:Bt,blank:{body:M("")}}},Ht=f(async function(e,t,r,i){const s=r.getConfigField("padding"),l=r.getConfigField("iconSize"),m=l/2,g=l/6,p=g/2;await Promise.all(t.edges().map(async u=>{var L,S;const{source:h,sourceDir:o,sourceArrow:a,sourceGroup:d,target:c,targetDir:n,targetArrow:b,targetGroup:k,label:x}=it(u);let{x:y,y:v}=u[0].sourceEndpoint();const{x:w,y:B}=u[0].midpoint();let{x:$,y:T}=u[0].targetEndpoint();const E=s+4;if(d&&(I(o)?y+=o==="L"?-E:E:v+=o==="T"?-E:E+18),k&&(I(n)?$+=n==="L"?-E:E:T+=n==="T"?-E:E+18),!d&&((L=r.getNode(h))==null?void 0:L.type)==="junction"&&(I(o)?y+=o==="L"?m:-m:v+=o==="T"?m:-m),!k&&((S=r.getNode(c))==null?void 0:S.type)==="junction"&&(I(n)?$+=n==="L"?m:-m:T+=n==="T"?m:-m),u[0]._private.rscratch){const A=e.insert("g");if(A.insert("path").attr("d",`M ${y},${v} L ${w},${B} L${$},${T} `).attr("class","edge").attr("id",`${i}-${Tt(h,c,{prefix:"L"})}`),a){const D=I(o)?Y[o](y,g):y-p,C=P(o)?Y[o](v,g):v-p;A.insert("polygon").attr("points",U[o](g)).attr("transform",`translate(${D},${C})`).attr("class","arrow")}if(b){const D=I(n)?Y[n]($,g):$-p,C=P(n)?Y[n](T,g):T-p;A.insert("polygon").attr("points",U[n](g)).attr("transform",`translate(${D},${C})`).attr("class","arrow")}if(x){const D=V(o,n)?"XY":I(o)?"X":"Y";let C=0;D==="X"?C=Math.abs(y-$):D==="Y"?C=Math.abs(v-T)/1.5:C=Math.abs(y-$)/2;const j=A.append("g");if(await q(j,x,{useHtmlLabels:!1,width:C,classes:"architecture-service-label"},Z()),j.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),D==="X")j.attr("transform","translate("+w+", "+B+")");else if(D==="Y")j.attr("transform","translate("+w+", "+B+") rotate(-90)");else if(D==="XY"){const z=H(o,n);if(z&&zt(z)){const F=j.node().getBoundingClientRect(),[G,N]=Mt(z);j.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*G*N*45})`);const W=j.node().getBoundingClientRect();j.attr("transform",`
33
+ translate(${w}, ${B-F.height/2})
34
+ translate(${G*W.width/2}, ${N*W.height/2})
35
+ rotate(${-1*G*N*45}, 0, ${F.height/2})
36
+ `)}}}}}))},"drawEdges"),Jt=f(async function(e,t,r,i){const l=r.getConfigField("padding")*.75,m=r.getConfigField("fontSize"),p=r.getConfigField("iconSize")/2;await Promise.all(t.nodes().map(async u=>{const h=R(u);if(h.type==="group"){const{h:o,w:a,x1:d,y1:c}=u.boundingBox(),n=e.append("rect");n.attr("id",`${i}-group-${h.id}`).attr("x",d+p).attr("y",c+p).attr("width",a).attr("height",o).attr("class","node-bkg");const b=e.append("g");let k=d,x=c;if(h.icon){const y=b.append("g");y.html(`<g>${await _(h.icon,{height:l,width:l,fallbackPrefix:X.prefix})}</g>`),y.attr("transform","translate("+(k+p+1)+", "+(x+p+1)+")"),k+=l,x+=m/2-1-2}if(h.label){const y=b.append("g");await q(y,h.label,{useHtmlLabels:!1,width:a,classes:"architecture-service-label"},Z()),y.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),y.attr("transform","translate("+(k+p+4)+", "+(x+p+2)+")")}r.setElementForId(h.id,n)}}))},"drawGroups"),Zt=f(async function(e,t,r,i){const s=Z();for(const l of r){const m=t.append("g"),g=e.getConfigField("iconSize");if(l.title){const o=m.append("g");await q(o,l.title,{useHtmlLabels:!1,width:g*1.5,classes:"architecture-service-label"},s),o.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),o.attr("transform","translate("+g/2+", "+g+")")}const p=m.append("g");if(l.icon)p.html(`<g>${await _(l.icon,{height:g,width:g,fallbackPrefix:X.prefix})}</g>`);else if(l.iconText){p.html(`<g>${await _("blank",{height:g,width:g,fallbackPrefix:X.prefix})}</g>`);const d=p.append("g").append("foreignObject").attr("width",g).attr("height",g).append("div").attr("class","node-icon-text").attr("style",`height: ${g}px;`).append("div").html(At(l.iconText,s)),c=parseInt(window.getComputedStyle(d.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;d.attr("style",`-webkit-line-clamp: ${Math.floor((g-2)/c)};`)}else p.append("path").attr("class","node-bkg").attr("id",`${i}-node-${l.id}`).attr("d",`M0,${g} V5 Q0,0 5,0 H${g-5} Q${g},0 ${g},5 V${g} Z`);m.attr("id",`${i}-service-${l.id}`).attr("class","architecture-service");const{width:u,height:h}=m.node().getBBox();l.width=u,l.height=h,e.setElementForId(l.id,m)}return 0},"drawServices"),qt=f(function(e,t,r,i){r.forEach(s=>{const l=t.append("g"),m=e.getConfigField("iconSize");l.append("g").append("rect").attr("id",`${i}-node-${s.id}`).attr("fill-opacity","0").attr("width",m).attr("height",m),l.attr("class","architecture-junction");const{width:p,height:u}=l._groups[0][0].getBBox();l.width=p,l.height=u,e.setElementForId(s.id,l)})},"drawJunctions");Ct([{name:X.prefix,icons:X}]);et.use(Lt);function ot(e,t,r){e.forEach(i=>{t.add({group:"nodes",data:{type:"service",id:i.id,icon:i.icon,label:i.title,parent:i.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}f(ot,"addServices");function nt(e,t,r){e.forEach(i=>{t.add({group:"nodes",data:{type:"junction",id:i.id,parent:i.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}f(nt,"addJunctions");function at(e,t){t.nodes().map(r=>{const i=R(r);if(i.type==="group")return;i.x=r.position().x,i.y=r.position().y,e.getElementById(i.id).attr("transform","translate("+(i.x||0)+","+(i.y||0)+")")})}f(at,"positionNodes");function ct(e,t){e.forEach(r=>{t.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}f(ct,"addGroups");function lt(e,t){e.forEach(r=>{const{lhsId:i,rhsId:s,lhsInto:l,lhsGroup:m,rhsInto:g,lhsDir:p,rhsDir:u,rhsGroup:h,title:o}=r,a=V(r.lhsDir,r.rhsDir)?"segments":"straight",d={id:`${i}-${s}`,label:o,source:i,sourceDir:p,sourceArrow:l,sourceGroup:m,sourceEndpoint:p==="L"?"0 50%":p==="R"?"100% 50%":p==="T"?"50% 0":"50% 100%",target:s,targetDir:u,targetArrow:g,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};t.add({group:"edges",data:d,classes:a})})}f(lt,"addEdges");function dt(e,t,r,i=[]){const s=f((a,d)=>Object.entries(a).reduce((c,[n,b])=>{var y;let k=0;const x=Object.entries(b);if(x.length===1)return c[n]=x[0][1],c;for(let v=0;v<x.length-1;v++)for(let w=v+1;w<x.length;w++){const[B,$]=x[v],[T,E]=x[w];if(((y=r[B])==null?void 0:y[T])===d)c[n]??(c[n]=[]),c[n]=[...c[n],...$,...E];else if(B==="default"||T==="default")c[n]??(c[n]=[]),c[n]=[...c[n],...$,...E];else{const S=`${n}-${k++}`;c[S]=$;const A=`${n}-${k++}`;c[A]=E}}return c},{}),"flattenAlignments"),l=t.map(a=>{const d={},c={};return Object.entries(a).forEach(([n,[b,k]])=>{var y,v,w;const x=((y=e.getNode(n))==null?void 0:y.in)??"default";d[k]??(d[k]={}),(v=d[k])[x]??(v[x]=[]),d[k][x].push(n),c[b]??(c[b]={}),(w=c[b])[x]??(w[x]=[]),c[b][x].push(n)}),{horiz:Object.values(s(d,"horizontal")).filter(n=>n.length>1),vert:Object.values(s(c,"vertical")).filter(n=>n.length>1)}}),[m,g]=l.reduce(([a,d],{horiz:c,vert:n})=>[[...a,...c],[...d,...n]],[[],[]]),p=new Set;i.forEach(a=>a.members.forEach(d=>p.add(d)));const u=f(a=>a.filter(d=>!d.some(c=>p.has(c))),"dropOverlapping"),h=u(m),o=u(g);return i.forEach(a=>{a.members.length<2||(a.direction==="row"?h.push([...a.members]):o.push([...a.members]))}),{horizontal:h,vertical:o}}f(dt,"getAlignments");function ht(e,t,r=[]){const i=[],s=t.getConfigField("iconSize"),l=t.getConfigField("idealEdgeLengthMultiplier"),m=l*s,g=new Set;r.forEach(h=>{for(let o=0;o<h.members.length-1;o++){const a=h.members[o],d=h.members[o+1];g.add(`${a}|${d}`),g.add(`${d}|${a}`),h.direction==="row"?i.push({left:a,right:d,gap:m}):i.push({top:a,bottom:d,gap:m})}});const p=f(h=>`${h[0]},${h[1]}`,"posToStr"),u=f(h=>h.split(",").map(o=>parseInt(o)),"strToPos");return e.forEach(h=>{const o=Object.fromEntries(Object.entries(h).map(([n,b])=>[p(b),n])),a=[p([0,0])],d={},c={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const n=a.shift();if(n){d[n]=1;const b=o[n];if(b){const k=u(n);Object.entries(c).forEach(([x,y])=>{const v=p([k[0]+y[0],k[1]+y[1]]),w=o[v];if(w&&!d[v]){if(a.push(v),g.has(`${b}|${w}`))return;i.push({[Q[x]]:w,[Q[jt(x)]]:b,gap:l*s})}})}}}}),i}f(ht,"getRelativeConstraints");function ft(e,t,r,i,s,{spatialMaps:l,groupAlignments:m}){return new Promise(g=>{const p=Dt("body").append("div").attr("id","cy").attr("style","display:none"),u=et({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{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":`${s.getConfigField("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:`${s.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});p.remove(),ct(r,u),ot(e,u,s),nt(t,u,s),lt(i,u);const h=s.getLayoutHints(),o=dt(s,l,m,h),a=ht(l,s,h),d=s.getConfigField("iconSize"),c=s.getConfigField("idealEdgeLengthMultiplier")*d,n=.5*d,b=s.getConfigField("edgeElasticity"),k=s.getConfigField("seed"),x=u.layout({name:"fcose",quality:"proof",randomize:s.getConfigField("randomize"),nodeSeparation:s.getConfigField("nodeSeparation"),numIter:s.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(y){const[v,w]=y.connectedNodes(),{parent:B}=R(v),{parent:$}=R(w);return B===$?c:n},edgeElasticity(y){const[v,w]=y.connectedNodes(),{parent:B}=R(v),{parent:$}=R(w);return B===$?b:.001},alignmentConstraint:o,relativePlacementConstraint:a});x.one("layoutstop",()=>{var v;function y(w,B,$,T){let E,L;const{x:S,y:A}=w,{x:D,y:C}=B;L=(T-A+(S-$)*(A-C)/(S-D))/Math.sqrt(1+Math.pow((A-C)/(S-D),2)),E=Math.sqrt(Math.pow(T-A,2)+Math.pow($-S,2)-Math.pow(L,2));const j=Math.sqrt(Math.pow(D-S,2)+Math.pow(C-A,2));E=E/j;let z=(D-S)*(T-A)-(C-A)*($-S);switch(!0){case z>=0:z=1;break;case z<0:z=-1;break}let F=(D-S)*($-S)+(C-A)*(T-A);switch(!0){case F>=0:F=1;break;case F<0:F=-1;break}return L=Math.abs(L)*z,E=E*F,{distances:L,weights:E}}f(y,"getSegmentWeights"),u.startBatch();for(const w of Object.values(u.edges()))if((v=w.data)!=null&&v.call(w)){const{x:B,y:$}=w.source().position(),{x:T,y:E}=w.target().position();if(B!==T&&$!==E){const L=w.sourceEndpoint(),S=w.targetEndpoint(),{sourceDir:A}=it(w),[D,C]=P(A)?[L.x,S.y]:[S.x,L.y],{weights:j,distances:z}=y(L,S,D,C);w.style("segment-distances",z),w.style("segment-weights",j)}}u.endBatch(),J(k,()=>x.run())});try{J(k,()=>x.run())}catch(y){throw y instanceof RangeError&&y.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):y}u.ready(y=>{tt.info("Ready",y),g(u)})})}f(ft,"layoutArchitecture");var Vt=f(async(e,t,r,i)=>{const s=i.db;s.setDiagramId(t);const l=s.getServices(),m=s.getJunctions(),g=s.getGroups(),p=s.getEdges(),u=s.getDataStructures(),h=ut(t),o=h.append("g");o.attr("class","architecture-edges");const a=h.append("g");a.attr("class","architecture-services");const d=h.append("g");d.attr("class","architecture-groups"),await Zt(s,a,l,t),qt(s,a,m,t);const c=await ft(l,m,g,p,s,u);await Ht(o,c,s,t),await Jt(d,c,s,t),at(s,c),pt(void 0,h,s.getConfigField("padding"),s.getConfigField("useMaxWidth"))},"draw"),Wt={draw:Vt},re={parser:st,get db(){return new rt},renderer:Wt,styles:_t};export{re as diagram};
@@ -0,0 +1,132 @@
1
+ import{g as de}from"./chunk-5VM5RSS4-DbD86rhK.js";import{aC as fe,aD as Ut,aE as pe,aF as ye,aG as xe,aH as be,aI as we,aJ as me,aK as Se,aL as Le,aM as ve,aN as Ee,aO as _e,aP as ke,aQ as Te,aR as De,aS as Ne,aT as Ie,aU as Ce,aV as Be,aW as Oe,aX as Re,aY as Ae,aZ as ze,a_ as Me,_ as u,y as nt,d as O,e as Pe,l as v,p as Fe,r as We,c as M,a$ as Ye,P as He,Q as Ke,L as Ue,b0 as Y,ak as Et,b1 as rt,au as Xe,x as at,k as Ve,b2 as je,i as Ot,b3 as Rt,b4 as Ge}from"./App-D_tvTs_n.js";import{G as Ze}from"./graph-C9eacEi8.js";import{c as qe}from"./channel-xb4mQfuL.js";import"./mobile-CNLMhdFP.js";import"./index-0Hq9436Q.js";import"./graph-xkel59g2.js";function Je(e){return Array.isArray(e)}function Qe(e){if(fe(e))return e;const t=Ut(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(pe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Ut(e)){case Me:case ze:case Ae:case Re:case Oe:case Be:case Ce:case Ie:case Ne:case De:case Te:case ke:case _e:case Ee:case ve:case Le:case Se:case me:case we:case be:case xe:case ye:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s<a.length;s++){const i=a[s];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function er(e,t){const a=t.valueOf().length;for(const s in t)Object.hasOwn(t,s)&&(Number.isNaN(Number(s))||Number(s)>=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=(function(){var e=u(function(N,b,d,y){for(d=d||{},y=N.length;y--;d[N[y]]=b);return d},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],h=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:u(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,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$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:"NODE_ID",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"},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],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(b,d,y,w,D,o,k){var f=o.length-1;switch(D){case 4:w.getLogger().debug("Rule: separator (NL) ");break;case 5:w.getLogger().debug("Rule: separator (Space) ");break;case 6:w.getLogger().debug("Rule: separator (EOF) ");break;case 7:w.getLogger().debug("Rule: hierarchy: ",o[f-1]),w.setHierarchy(o[f-1]);break;case 8:w.getLogger().debug("Stop NL ");break;case 9:w.getLogger().debug("Stop EOF ");break;case 10:w.getLogger().debug("Stop NL2 ");break;case 11:w.getLogger().debug("Stop EOF2 ");break;case 12:w.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:w.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:w.getLogger().debug("Rule: link: ",o[f],b),this.$={edgeTypeStr:o[f],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const E=parseInt(o[f]),T=w.generateId();this.$={id:T,type:"space",label:"",width:E,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const z=w.edgeStrToEdgeData(o[f-1].edgeTypeStr),F=w.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),q=w.edgeStrToThickness(o[f-1].edgeTypeStr),I=w.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:q,pattern:I,directions:o[f].directions,arrowTypeEnd:z,arrowTypeStart:F},{id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:w.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),w.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const K=w.generateId();this.$={id:K,type:"composite",label:"",children:o[f-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:w.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:p,16:m}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(x,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(h,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(b,d){if(d.recoverable)this.trace(b);else{var y=new Error(b);throw y.hash=d,y}},"parseError"),parse:u(function(b){var d=this,y=[0],w=[],D=[null],o=[],k=this.table,f="",E=0,T=0,z=2,F=1,q=o.slice.call(arguments,1),I=Object.create(this.lexer),K={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(K.yy[J]=this.yy[J]);I.setInput(b,K.yy),K.yy.lexer=I,K.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var et=I.yylloc;o.push(et);var ft=I.options&&I.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(U){y.length=y.length-2*U,D.length=D.length-U,o.length=o.length-U}u(ue,"popStack");function Ct(){var U;return U=w.pop()||I.lex()||F,typeof U!="number"&&(U instanceof Array&&(w=U,U=w.pop()),U=d.symbols_[U]||U),U}u(Ct,"lex");for(var H,$,V,pt,tt={},ct,Q,Bt,lt;;){if($=y[y.length-1],this.defaultActions[$]?V=this.defaultActions[$]:((H===null||typeof H>"u")&&(H=Ct()),V=k[$]&&k[$][H]),typeof V>"u"||!V.length||!V[0]){var yt="";lt=[];for(ct in k[$])this.terminals_[ct]&&ct>z&&lt.push("'"+this.terminals_[ct]+"'");I.showPosition?yt="Parse error on line "+(E+1)+`:
2
+ `+I.showPosition()+`
3
+ Expecting `+lt.join(", ")+", got '"+(this.terminals_[H]||H)+"'":yt="Parse error on line "+(E+1)+": Unexpected "+(H==F?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(yt,{text:I.match,token:this.terminals_[H]||H,line:I.yylineno,loc:et,expected:lt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+H);switch(V[0]){case 1:y.push(H),D.push(I.yytext),o.push(I.yylloc),y.push(V[1]),H=null,T=I.yyleng,f=I.yytext,E=I.yylineno,et=I.yylloc;break;case 2:if(Q=this.productions_[V[1]][1],tt.$=D[D.length-Q],tt._$={first_line:o[o.length-(Q||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Q||1)].first_column,last_column:o[o.length-1].last_column},ft&&(tt._$.range=[o[o.length-(Q||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(tt,[f,T,E,K.yy,V[1],D,o].concat(q)),typeof pt<"u")return pt;Q&&(y=y.slice(0,-1*Q*2),D=D.slice(0,-1*Q),o=o.slice(0,-1*Q)),y.push(this.productions_[V[1]][0]),D.push(tt.$),o.push(tt._$),Bt=k[y[y.length-2]][y[y.length-1]],y.push(Bt);break;case 3:return!0}}return!0},"parse")},C=(function(){var N={EOF:1,parseError:u(function(d,y){if(this.yy.parser)this.yy.parser.parseError(d,y);else throw new Error(d)},"parseError"),setInput:u(function(b,d){return this.yy=d||this.yy||{},this._input=b,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:u(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var d=b.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:u(function(b){var d=b.length,y=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var w=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),y.length-1&&(this.yylineno-=y.length-1);var D=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:y?(y.length===w.length?this.yylloc.first_column:0)+w[w.length-y.length].length-y[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(b){this.unput(this.match.slice(b))},"less"),pastInput:u(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var b=this.pastInput(),d=new Array(b.length+1).join("-");return b+this.upcomingInput()+`
5
+ `+d+"^"},"showPosition"),test_match:u(function(b,d){var y,w,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),w=b[0].match(/(?:\r\n?|\n).*/g),w&&(this.yylineno+=w.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:w?w[w.length-1].length-w[w.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,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(b[0].length),this.matched+=b[0],y=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var o in D)this[o]=D[o];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,d,y,w;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),o=0;o<D.length;o++)if(y=this._input.match(this.rules[D[o]]),y&&(!d||y[0].length>d[0].length)){if(d=y,w=o,this.options.backtrack_lexer){if(b=this.test_match(y,D[o]),b!==!1)return b;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(b=this.test_match(d,D[w]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var d=this.next();return d||this.lex()},"lex"),begin:u(function(d){this.conditionStack.push(d)},"begin"),popState:u(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:u(function(d){this.begin(d)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(d,y,w,D){switch(w){case 0:return d.getLogger().debug("Found block-beta"),10;case 1:return d.getLogger().debug("Found id-block"),29;case 2:return d.getLogger().debug("Found block"),10;case 3:d.getLogger().debug(".",y.yytext);break;case 4:d.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),d.getLogger().debug("COLUMNS (LEX)",y.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:d.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return d.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),d.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",d.getLogger().debug("COLUMNS (LEX)",y.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),d.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),d.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),d.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),d.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),d.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),d.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),d.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),d.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),d.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),d.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),d.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),d.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return d.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return d.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return d.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return d.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return d.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return d.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return d.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),d.getLogger().debug("LEX ARR START"),37;case 74:return d.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return d.getLogger().debug("Lex: EOF",y.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:d.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:d.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return d.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:d.getLogger().debug("LEX POPPING"),this.popState();break;case 84:d.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",d.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return d.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return d.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return d.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return d.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return d.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return d.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return d.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return d.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),d.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),d.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),d.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return d.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\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:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return N})();L.lexer=C;function B(){this.yy={}}return u(B,"Parser"),B.prototype=L,L.Parser=B,new B})();wt.parser=wt;var ar=wt,G=new Map,_t=[],mt=new Map,At="color",zt="fill",sr="bgFill",Xt=",",ht=new Map,kt="",ir=u(e=>Ve.sanitizeText(e,M()),"sanitizeText"),nr=u(function(e,t=""){let a=ht.get(e);a||(a={id:e,styles:[],textStyles:[]},ht.set(e,a)),t!=null&&t.split(Xt).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(At).exec(s)){const r=i.replace(zt,sr).replace(At,zt);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),cr=u(function(e,t=""){const a=G.get(e);t!=null&&(a.styles=t.split(Xt))},"addStyle2Node"),lr=u(function(e,t){e.split(",").forEach(function(a){let s=G.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},G.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Vt=u((e,t)=>{const a=e.flat(),s=[],i=a.find(r=>(r==null?void 0:r.type)==="column-setting"),c=(i==null?void 0:i.columns)??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&v.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=ir(r.label)),r.type==="classDef"){nr(r.id,r.css);continue}if(r.type==="applyClass"){lr(r.id,(r==null?void 0:r.styleClass)??"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&cr(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,_t.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=G.get(r.id);if(n===void 0?G.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Vt(r.children,r),r.type==="space"){const l=r.width??1;for(let g=0;g<l;g++){const h=Qe(r);h.id=h.id+"-"+g,G.set(h.id,h),s.push(h)}}else n===void 0&&s.push(r)}}t.children=s},"populateBlockDatabase"),Tt=[],it={id:"root",type:"composite",children:[],columns:-1},or=u(()=>{v.debug("Clear called"),Fe(),it={id:"root",type:"composite",children:[],columns:-1},G=new Map([["root",it]]),Tt=[],ht=new Map,_t=[],mt=new Map,kt=""},"clear");function jt(e){switch(v.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return v.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"}}u(jt,"typeStr2Type");function Gt(e){switch(v.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}u(Gt,"edgeTypeStr2Type");function Zt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}u(Zt,"edgeStrToEdgeData");function qt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}u(qt,"edgeStrToEdgeStartData");function Jt(e){return e.includes("==")?"thick":"normal"}u(Jt,"edgeStrToThickness");function Qt(e){return e.includes(".-")?"dotted":"solid"}u(Qt,"edgeStrToPattern");var Mt=0,hr=u(()=>(Mt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Mt),"generateId"),gr=u(e=>{it.children=e,Vt(e,it),Tt=it.children},"setHierarchy"),ur=u(e=>{const t=G.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),dr=u(()=>[...G.values()],"getBlocksFlat"),fr=u(()=>Tt||[],"getBlocks"),pr=u(()=>_t,"getEdges"),yr=u(e=>G.get(e),"getBlock"),xr=u(e=>{G.set(e.id,e)},"setBlock"),br=u(e=>{kt=e},"setDiagramId"),wr=u(()=>kt,"getDiagramId"),mr=u(()=>v,"getLogger"),Sr=u(function(){return ht},"getClasses"),Lr={getConfig:u(()=>nt().block,"getConfig"),typeStr2Type:jt,edgeTypeStr2Type:Gt,edgeStrToEdgeData:Zt,edgeStrToEdgeStartData:qt,edgeStrToThickness:Jt,edgeStrToPattern:Qt,getLogger:mr,getBlocksFlat:dr,getBlocks:fr,getEdges:pr,setHierarchy:gr,getBlock:yr,setBlock:xr,getColumns:ur,getClasses:Sr,clear:or,generateId:hr,setDiagramId:br,getDiagramId:wr},vr=Lr,bt=u((e,t)=>{const a=qe,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return We(s,i,c,t)},"fade"),Er=u(e=>`.label {
7
+ font-family: ${e.fontFamily};
8
+ color: ${e.nodeTextColor||e.textColor};
9
+ }
10
+ .cluster-label text {
11
+ fill: ${e.titleColor};
12
+ }
13
+ .cluster-label span,p {
14
+ color: ${e.titleColor};
15
+ }
16
+
17
+
18
+
19
+ .label text,span,p {
20
+ fill: ${e.nodeTextColor||e.textColor};
21
+ color: ${e.nodeTextColor||e.textColor};
22
+ }
23
+
24
+ .node rect,
25
+ .node circle,
26
+ .node ellipse,
27
+ .node polygon,
28
+ .node path {
29
+ fill: ${e.mainBkg};
30
+ stroke: ${e.nodeBorder};
31
+ stroke-width: 1px;
32
+ }
33
+ .flowchart-label text {
34
+ text-anchor: middle;
35
+ }
36
+ // .flowchart-label .text-outer-tspan {
37
+ // text-anchor: middle;
38
+ // }
39
+ // .flowchart-label .text-inner-tspan {
40
+ // text-anchor: start;
41
+ // }
42
+
43
+ .node .label {
44
+ text-align: center;
45
+ }
46
+ .node.clickable {
47
+ cursor: pointer;
48
+ }
49
+
50
+ .arrowheadPath {
51
+ fill: ${e.arrowheadColor};
52
+ }
53
+
54
+ .edgePath .path {
55
+ stroke: ${e.lineColor};
56
+ stroke-width: 2.0px;
57
+ }
58
+
59
+ .flowchart-link {
60
+ stroke: ${e.lineColor};
61
+ fill: none;
62
+ }
63
+
64
+ .edgeLabel {
65
+ background-color: ${e.edgeLabelBackground};
66
+ /*
67
+ * This is for backward compatibility with existing code that didn't
68
+ * add a \`<p>\` around edge labels.
69
+ *
70
+ * TODO: We should probably remove this in a future release.
71
+ */
72
+ p {
73
+ margin: 0;
74
+ padding: 0;
75
+ display: inline;
76
+ }
77
+ rect {
78
+ opacity: 0.5;
79
+ background-color: ${e.edgeLabelBackground};
80
+ fill: ${e.edgeLabelBackground};
81
+ }
82
+ text-align: center;
83
+ }
84
+
85
+ /* For html labels only */
86
+ .labelBkg {
87
+ background-color: ${e.edgeLabelBackground};
88
+ }
89
+
90
+ .node .cluster {
91
+ // fill: ${bt(e.mainBkg,.5)};
92
+ fill: ${bt(e.clusterBkg,.5)};
93
+ stroke: ${bt(e.clusterBorder,.2)};
94
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
95
+ stroke-width: 1px;
96
+ }
97
+
98
+ .cluster text {
99
+ fill: ${e.titleColor};
100
+ }
101
+
102
+ .cluster span,p {
103
+ color: ${e.titleColor};
104
+ }
105
+ /* .cluster div {
106
+ color: ${e.titleColor};
107
+ } */
108
+
109
+ div.mermaidTooltip {
110
+ position: absolute;
111
+ text-align: center;
112
+ max-width: 200px;
113
+ padding: 2px;
114
+ font-family: ${e.fontFamily};
115
+ font-size: 12px;
116
+ background: ${e.tertiaryColor};
117
+ border: 1px solid ${e.border2};
118
+ border-radius: 2px;
119
+ pointer-events: none;
120
+ z-index: 100;
121
+ }
122
+
123
+ .flowchartTitleText {
124
+ text-anchor: middle;
125
+ font-size: 18px;
126
+ fill: ${e.textColor};
127
+ }
128
+ ${de()}
129
+ `,"getStyles"),_r=Er,kr=u((e,t,a,s)=>{t.forEach(i=>{zr[i](e,a,s)})},"insertMarkers"),Tr=u((e,t,a)=>{v.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).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"),Dr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).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"),Nr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).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"),Ir=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).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"),Cr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).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),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).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"),Br=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).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"),Or=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).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"),Rr=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).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"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).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"),Ar=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-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"),zr={extension:Tr,composition:Dr,aggregation:Nr,dependency:Ir,lollipop:Cr,point:Br,circle:Or,cross:Rr,barb:Ar},Mr=kr;function St(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}u(St,"calculateBlockPosition");var Pr=u(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(v.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function gt(e,t,a=0,s=0,i=8){var n,l,g,h,p,m,x,S,_,L,C;v.debug("setBlockSizes abc95 (start)",e.id,(n=e==null?void 0:e.size)==null?void 0:n.x,"block width =",e==null?void 0:e.size,"siblingWidth",a),(l=e==null?void 0:e.size)!=null&&l.width||(e.size={width:a,height:s,x:0,y:0});let c=0,r=0;if(((g=e.children)==null?void 0:g.length)>0){for(const o of e.children)gt(o,t,0,0,i);const B=Pr(e);c=B.width,r=B.height,v.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",c,r);for(const o of e.children)o.size&&(v.debug(`abc95 Setting size of children of ${e.id} id=${o.id} ${c} ${r} ${JSON.stringify(o.size)}`),o.size.width=c*(o.widthInColumns??1)+i*((o.widthInColumns??1)-1),o.size.height=r,o.size.x=0,o.size.y=0,v.debug(`abc95 updating size of ${e.id} children child:${o.id} maxWidth:${c} maxHeight:${r}`));for(const o of e.children)gt(o,t,c,r,i);const N=e.columns??-1;let b=0;for(const o of e.children)b+=o.widthInColumns??1;let d=e.children.length;N>0&&N<b&&(d=N);const y=Math.ceil(b/d);let w=d*(c+i)+i,D=y*(r+i)+i;if(w<a){v.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${w}`),w=a,D=s;const o=(a-d*i-i)/d,k=(s-y*i-i)/y;v.debug("Size indata abc88",e.id,"childWidth",o,"maxWidth",c),v.debug("Size indata abc88",e.id,"childHeight",k,"maxHeight",r),v.debug("Size indata abc88 xSize",d,"padding",i);for(const f of e.children)f.size&&(f.size.width=o,f.size.height=k,f.size.x=0,f.size.y=0)}if(v.debug(`abc95 (finale calc) ${e.id} xSize ${d} ySize ${y} columns ${N}${e.children.length} width=${Math.max(w,((h=e.size)==null?void 0:h.width)||0)}`),w<(((p=e==null?void 0:e.size)==null?void 0:p.width)||0)){w=((m=e==null?void 0:e.size)==null?void 0:m.width)||0;const o=N>0?Math.min(e.children.length,N):e.children.length;if(o>0){const k=(w-o*i-i)/o;v.debug("abc95 (growing to fit) width",e.id,w,(x=e.size)==null?void 0:x.width,k);for(const f of e.children)f.size&&(f.size.width=k)}}e.size={width:w,height:D,x:0,y:0}}v.debug("setBlockSizes abc94 (done)",e.id,(S=e==null?void 0:e.size)==null?void 0:S.x,(_=e==null?void 0:e.size)==null?void 0:_.width,(L=e==null?void 0:e.size)==null?void 0:L.y,(C=e==null?void 0:e.size)==null?void 0:C.height)}u(gt,"setBlockSizes");function Dt(e,t,a=8){var i,c,r,n,l,g,h,p,m,x,S,_,L,C,B,N,b;v.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(i=e==null?void 0:e.size)==null?void 0:i.x} y: ${(c=e==null?void 0:e.size)==null?void 0:c.y} width: ${(r=e==null?void 0:e.size)==null?void 0:r.width}`);const s=e.columns??-1;if(v.debug("layoutBlocks columns abc95",e.id,"=>",s,e),e.children&&e.children.length>0){const d=((l=(n=e==null?void 0:e.children[0])==null?void 0:n.size)==null?void 0:l.width)??0,y=e.children.length*d+(e.children.length-1)*a;v.debug("widthOfChildren 88",y,"posX");const w=new Map;{let E=0;for(const T of e.children){if(!T.size)continue;const{py:z}=St(s,E),F=w.get(z)??0;T.size.height>F&&w.set(z,T.size.height);let q=(T==null?void 0:T.widthInColumns)??1;s>0&&(q=Math.min(q,s-E%s)),E+=q}}const D=new Map;{let E=0;const T=[...w.keys()].sort((z,F)=>z-F);for(const z of T)D.set(z,E),E+=(w.get(z)??0)+a}let o=0;v.debug("abc91 block?.size?.x",e.id,(g=e==null?void 0:e.size)==null?void 0:g.x);let k=(h=e==null?void 0:e.size)!=null&&h.x?((p=e==null?void 0:e.size)==null?void 0:p.x)+(-((m=e==null?void 0:e.size)==null?void 0:m.width)/2||0):-a,f=0;for(const E of e.children){const T=e;if(!E.size)continue;const{width:z,height:F}=E.size,{px:q,py:I}=St(s,o);if(I!=f&&(f=I,k=(x=e==null?void 0:e.size)!=null&&x.x?((S=e==null?void 0:e.size)==null?void 0:S.x)+(-((_=e==null?void 0:e.size)==null?void 0:_.width)/2||0):-a,v.debug("New row in layout for block",e.id," and child ",E.id,f)),v.debug(`abc89 layout blocks (child) id: ${E.id} Pos: ${o} (px, py) ${q},${I} (${(L=T==null?void 0:T.size)==null?void 0:L.x},${(C=T==null?void 0:T.size)==null?void 0:C.y}) parent: ${T.id} width: ${z}${a}`),T.size){const J=z/2;E.size.x=k+a+J,v.debug(`abc91 layout blocks (calc) px, pyid:${E.id} startingPos=X${k} new startingPosX${E.size.x} ${J} padding=${a} width=${z} halfWidth=${J} => x:${E.size.x} y:${E.size.y} ${E.widthInColumns} (width * (child?.w || 1)) / 2 ${z*((E==null?void 0:E.widthInColumns)??1)/2}`),k=E.size.x+J;const et=D.get(I)??0,ft=w.get(I)??F;E.size.y=T.size.y-T.size.height/2+et+ft/2+a,v.debug(`abc88 layout blocks (calc) px, pyid:${E.id}startingPosX${k}${a}${J}=>x:${E.size.x}y:${E.size.y}${E.widthInColumns}(width * (child?.w || 1)) / 2${z*((E==null?void 0:E.widthInColumns)??1)/2}`)}E.children&&Dt(E,t,a);let K=(E==null?void 0:E.widthInColumns)??1;s>0&&(K=Math.min(K,s-o%s)),o+=K,v.debug("abc88 columnsPos",E,o)}}v.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(B=e==null?void 0:e.size)==null?void 0:B.x} y: ${(N=e==null?void 0:e.size)==null?void 0:N.y} width: ${(b=e==null?void 0:e.size)==null?void 0:b.width}`)}u(Dt,"layoutBlocks");function Nt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2<t&&(t=c-n/2),r-l/2<a&&(a=r-l/2),c+n/2>s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Nt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}u(Nt,"findBounds");function $t(e){var g,h;const t=e.getBlock("root");if(!t)return;const a=((h=(g=M())==null?void 0:g.block)==null?void 0:h.padding)??8;gt(t,e,0,0,a),Dt(t,e,a),v.debug("getBlocks",JSON.stringify(t,null,2));const{minX:s,minY:i,maxX:c,maxY:r}=Nt(t),n=r-i,l=c-s;return{x:s,y:i,width:l,height:n}}u($t,"layout");var Fr=u(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=M(),n=Y(r);return await Et(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),j=Fr,Wr=u((e,t,a,s,i)=>{t.arrowTypeStart&&Pt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Pt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Yr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Pt=u((e,t,a,s,i,c)=>{const r=Yr[a];if(!r){v.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),Lt={},W={},Hr=u(async(e,t)=>{const a=M(),s=Y(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await Et(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),g=l;if(s){const p=n.children[0],m=O(n);l=p.getBoundingClientRect(),g=l,m.attr("width",l.width),m.attr("height",l.height)}else{const p=O(n).select("text").node();p&&typeof p.getBBox=="function"&&(g=p.getBBox())}c.attr("transform",rt(g,s)),Lt[t.id]=i,t.width=l.width,t.height=l.height;let h;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),x=await j(m,t.startLabelLeft,t.labelStyle);h=x;let S=x.getBBox();if(s){const _=x.children[0],L=O(x);S=_.getBoundingClientRect(),L.attr("width",S.width),L.attr("height",S.height)}m.attr("transform",rt(S,s)),W[t.id]||(W[t.id]={}),W[t.id].startLeft=p,st(h,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),x=await j(m,t.startLabelRight,t.labelStyle);h=x;let S=x.getBBox();if(s){const _=x.children[0],L=O(x);S=_.getBoundingClientRect(),L.attr("width",S.width),L.attr("height",S.height)}m.attr("transform",rt(S,s)),W[t.id]||(W[t.id]={}),W[t.id].startRight=p,st(h,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),x=await j(p,t.endLabelLeft,t.labelStyle);h=x;let S=x.getBBox();if(s){const _=x.children[0],L=O(x);S=_.getBoundingClientRect(),L.attr("width",S.width),L.attr("height",S.height)}m.attr("transform",rt(S,s)),W[t.id]||(W[t.id]={}),W[t.id].endLeft=p,st(h,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),x=await j(p,t.endLabelRight,t.labelStyle);h=x;let S=x.getBBox();if(s){const _=x.children[0],L=O(x);S=_.getBoundingClientRect(),L.attr("width",S.width),L.attr("height",S.height)}m.attr("transform",rt(S,s)),W[t.id]||(W[t.id]={}),W[t.id].endRight=p,st(h,t.endLabelRight)}return n},"insertEdgeLabel");function st(e,t){Y(M())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}u(st,"setTerminalWidth");var Kr=u((e,t)=>{v.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=M(),{subGraphTitleTotalMargin:i}=Xe(s);if(e.label){const c=Lt[e.id];let r=e.x,n=e.y;if(a){const l=at.calcLabelPosition(a);v.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=W[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=at.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=W[e.id].startRight;let r=e.x,n=e.y;if(a){const l=at.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=W[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=at.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=W[e.id].endRight;let r=e.x,n=e.y;if(a){const l=at.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Ur=u((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),Xr=u((e,t,a)=>{v.debug(`intersection calc abc89:
130
+ outsidePoint: ${JSON.stringify(t)}
131
+ insidePoint : ${JSON.stringify(a)}
132
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.x<t.x?r-c:r+c;const l=e.height/2,g=Math.abs(t.y-a.y),h=Math.abs(t.x-a.x);if(Math.abs(i-t.y)*r>Math.abs(s-t.x)*l){let p=a.y<t.y?t.y-l-i:i-l-t.y;n=h*p/g;const m={x:a.x<t.x?a.x+n:a.x-h+n,y:a.y<t.y?a.y+g-p:a.y-g+p};return n===0&&(m.x=t.x,m.y=t.y),h===0&&(m.x=t.x),g===0&&(m.y=t.y),v.debug(`abc89 topp/bott calc, Q ${g}, q ${p}, R ${h}, r ${n}`,m),m}else{a.x<t.x?n=t.x-r-s:n=s-r-t.x;let p=g*n/h,m=a.x<t.x?a.x+h-n:a.x-h+n,x=a.y<t.y?a.y+p:a.y-p;return v.debug(`sides calc abc89, Q ${g}, q ${p}, R ${h}, r ${n}`,{_x:m,_y:x}),n===0&&(m=t.x,x=t.y),h===0&&(m=t.x),g===0&&(x=t.y),{x:m,y:x}}},"intersection"),Ft=u((e,t)=>{v.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Ur(t,c)&&!i){const r=Xr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Vr=u(function(e,t,a,s,i,c,r){let n=a.points;v.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const g=c.node(t.v);var h=c.node(t.w);h!=null&&h.intersect&&(g!=null&&g.intersect)&&(n=n.slice(1,a.points.length-1),n.unshift(g.intersect(n[0])),n.push(h.intersect(n[n.length-1]))),a.toCluster&&(v.debug("to cluster abc88",s[a.toCluster]),n=Ft(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(v.debug("from cluster abc88",s[a.fromCluster]),n=Ft(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const p=n.filter(b=>!Number.isNaN(b.y));let m=Ke;a.curve&&(i==="graph"||i==="flowchart")&&(m=a.curve);const{x,y:S}=Ye(a),_=He().x(x).y(S).curve(m);let L;switch(a.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-thick";break;default:L=""}switch(a.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break}const C=e.append("path").attr("d",_(p)).attr("id",a.id).attr("class"," "+L+(a.classes?" "+a.classes:"")).attr("style",a.style);let B="";(M().flowchart.arrowMarkerAbsolute||M().state.arrowMarkerAbsolute)&&(B=Ue(!0)),Wr(C,a,B,r,i);let N={};return l&&(N.updatedPath=n),N.originalPath=a.points,N},"insertEdge"),jr=u(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),Gr=u((e,t,a,s)=>{const i=jr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,g=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*g},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*g,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*g},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*g,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-g},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r+g}]:i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:[{x:0,y:0}]},"getArrowPoints");function te(e,t){return e.intersect(t)}u(te,"intersectNode");var Zr=te;function ee(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),g=Math.abs(t*a*r/l);s.x<i&&(g=-g);var h=Math.abs(t*a*n/l);return s.y<c&&(h=-h),{x:i+g,y:c+h}}u(ee,"intersectEllipse");var re=ee;function ae(e,t,a){return re(e,t,t,a)}u(ae,"intersectCircle");var qr=ae;function se(e,t,a,s){var i,c,r,n,l,g,h,p,m,x,S,_,L,C,B;if(i=t.y-e.y,r=e.x-t.x,l=t.x*e.y-e.x*t.y,m=i*a.x+r*a.y+l,x=i*s.x+r*s.y+l,!(m!==0&&x!==0&&vt(m,x))&&(c=s.y-a.y,n=a.x-s.x,g=s.x*a.y-a.x*s.y,h=c*e.x+n*e.y+g,p=c*t.x+n*t.y+g,!(h!==0&&p!==0&&vt(h,p))&&(S=i*n-c*r,S!==0)))return _=Math.abs(S/2),L=r*g-n*l,C=L<0?(L-_)/S:(L+_)/S,L=c*l-i*g,B=L<0?(L-_)/S:(L+_)/S,{x:C,y:B}}u(se,"intersectLine");function vt(e,t){return e*t>0}u(vt,"sameSign");var Jr=se,Qr=ie;function ie(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(S){r=Math.min(r,S.x),n=Math.min(n,S.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,g=i-e.height/2-n,h=0;h<t.length;h++){var p=t[h],m=t[h<t.length-1?h+1:0],x=Jr(e,a,{x:l+p.x,y:g+p.y},{x:l+m.x,y:g+m.y});x&&c.push(x)}return c.length?(c.length>1&&c.sort(function(S,_){var L=S.x-a.x,C=S.y-a.y,B=Math.sqrt(L*L+C*C),N=_.x-a.x,b=_.y-a.y,d=Math.sqrt(N*N+b*b);return B<d?-1:B===d?0:1}),c[0]):e}u(ie,"intersectPolygon");var $r=u((e,t)=>{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,g;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,g=n):(i<0&&(r=-r),l=r,g=i===0?0:r*c/i),{x:a+l,y:s+g}},"intersectRect"),ta=$r,R={node:Zr,circle:qr,ellipse:re,polygon:Qr,rect:ta},P=u(async(e,t,a,s)=>{const i=M();let c;const r=t.useHtmlLabels||Y(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let g;t.labelText===void 0?g="":g=typeof t.labelText=="string"?t.labelText:t.labelText[0];let h;t.labelType==="markdown"?h=Et(l,Ot(Rt(g),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await j(l,Ot(Rt(g),i),t.labelStyle,!1,s);let p=h.getBBox();const m=t.padding/2;if(Y(i)){const x=h.children[0],S=O(h);await Ge(x,g),p=x.getBoundingClientRect(),S.attr("width",p.width),S.attr("height",p.height)}return r?l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):l.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:m,label:l}},"labelHelper"),A=u((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function Z(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}u(Z,"insertPolygonShape");var ea=u(async(e,t)=>{t.useHtmlLabels||Y(M())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await P(e,t,"node "+t.classes,!0);v.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),A(t,r),t.intersect=function(n){return R.rect(t,n)},s},"note"),ra=ea,Wt=u(e=>e?" "+e:"","formatClass"),X=u((e,t)=>`${t||"node default"}${Wt(e.classes)} ${Wt(e.class)}`,"getClassesFromNode"),Yt=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];v.info("Question main (Circle)");const l=Z(a,r,r,n);return l.attr("style",t.style),A(t,l),t.intersect=function(g){return v.warn("Intersect called"),R.polygon(t,n,g)},a},"question"),aa=u((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return R.circle(t,14,r)},a},"choice"),sa=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],g=Z(a,n,c,l);return g.attr("style",t.style),A(t,g),t.intersect=function(h){return R.polygon(t,l,h)},a},"hexagon"),ia=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,g=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,h=Gr(t.directions,s,t,g),p=Z(a,g,c,h);return p.attr("style",t.style),A(t,p),t.intersect=function(m){return R.polygon(t,h,m)},a},"block_arrow"),na=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return Z(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return R.polygon(t,r,l)},a},"rect_left_inv_arrow"),ca=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=Z(a,i,c,r);return n.attr("style",t.style),A(t,n),t.intersect=function(l){return R.polygon(t,r,l)},a},"lean_right"),la=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=Z(a,i,c,r);return n.attr("style",t.style),A(t,n),t.intersect=function(l){return R.polygon(t,r,l)},a},"lean_left"),oa=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=Z(a,i,c,r);return n.attr("style",t.style),A(t,n),t.intersect=function(l){return R.polygon(t,r,l)},a},"trapezoid"),ha=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=Z(a,i,c,r);return n.attr("style",t.style),A(t,n),t.intersect=function(l){return R.polygon(t,r,l)},a},"inv_trapezoid"),ga=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=Z(a,i,c,r);return n.attr("style",t.style),A(t,n),t.intersect=function(l){return R.polygon(t,r,l)},a},"rect_right_inv_arrow"),ua=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,g=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return A(t,g),t.intersect=function(h){const p=R.rect(t,h),m=p.x-t.x;if(c!=0&&(Math.abs(m)<t.width/2||Math.abs(m)==t.width/2&&Math.abs(p.y-t.y)>t.height/2-r)){let x=r*r*(1-m*m/(c*c));x!=0&&(x=Math.sqrt(x)),x=r-x,h.y-t.y>0&&(x=-x),p.y+=x}return p},a},"cylinder"),da=u(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await P(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(ut(c,t.props.borders,r,n),h.delete("borders")),h.forEach(p=>{v.warn(`Unknown node property ${p}`)})}return A(t,c),t.intersect=function(h){return R.rect(t,h)},a},"rect"),fa=u(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await P(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(ut(c,t.props.borders,r,n),h.delete("borders")),h.forEach(p=>{v.warn(`Unknown node property ${p}`)})}return A(t,c),t.intersect=function(h){return R.rect(t,h)},a},"composite"),pa=u(async(e,t)=>{const{shapeSvg:a}=await P(e,t,"label",!0);v.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ut(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{v.warn(`Unknown node property ${n}`)})}return A(t,s),t.intersect=function(r){return R.rect(t,r)},a},"labelRect");function ut(e,t,a,s){const i=[],c=u(n=>{i.push(n,0)},"addBorder"),r=u(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(v.debug("add top border"),c(a)):r(a),t.includes("r")?(v.debug("add right border"),c(s)):r(s),t.includes("b")?(v.debug("add bottom border"),c(a)):r(a),t.includes("l")?(v.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}u(ut,"applyNodePropertyBorders");var ya=u(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,v.info("Label text abc79",l,n,typeof n=="object");const g=await j(r,l,t.labelStyle,!0,!0);let h={width:0,height:0};if(Y(M())){const _=g.children[0],L=O(g);h=_.getBoundingClientRect(),L.attr("width",h.width),L.attr("height",h.height)}v.info("Text 2",n);const p=n.slice(1,n.length);let m=g.getBBox();const x=await j(r,p.join?p.join("<br/>"):p,t.labelStyle,!0,!0);if(Y(M())){const _=x.children[0],L=O(x);h=_.getBoundingClientRect(),L.attr("width",h.width),L.attr("height",h.height)}const S=t.padding/2;return O(x).attr("transform","translate( "+(h.width>m.width?0:(m.width-h.width)/2)+", "+(m.height+S+5)+")"),O(g).attr("transform","translate( "+(h.width<m.width?0:-(m.width-h.width)/2)+", 0)"),h=r.node().getBBox(),r.attr("transform","translate("+-h.width/2+", "+(-h.height/2-S+3)+")"),i.attr("class","outer title-state").attr("x",-h.width/2-S).attr("y",-h.height/2-S).attr("width",h.width+t.padding).attr("height",h.height+t.padding),c.attr("class","divider").attr("x1",-h.width/2-S).attr("x2",h.width/2+S).attr("y1",-h.height/2-S+m.height+S).attr("y2",-h.height/2-S+m.height+S),A(t,i),t.intersect=function(_){return R.rect(t,_)},s},"rectWithTitle"),xa=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return A(t,r),t.intersect=function(n){return R.rect(t,n)},a},"stadium"),ba=u(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await P(e,t,X(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),v.info("Circle main"),A(t,c),t.intersect=function(r){return v.info("Circle intersect",t,s.width/2+i,r),R.circle(t,s.width/2+i,r)},a},"circle"),wa=u(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await P(e,t,X(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),v.info("DoubleCircle main"),A(t,n),t.intersect=function(g){return v.info("DoubleCircle intersect",t,s.width/2+i+c,g),R.circle(t,s.width/2+i+c,g)},a},"doublecircle"),ma=u(async(e,t)=>{const{shapeSvg:a,bbox:s}=await P(e,t,X(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=Z(a,i,c,r);return n.attr("style",t.style),A(t,n),t.intersect=function(l){return R.polygon(t,r,l)},a},"subroutine"),Sa=u((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),A(t,s),t.intersect=function(i){return R.circle(t,7,i)},a},"start"),Ht=u((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return A(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return R.rect(t,n)},s},"forkJoin"),La=u((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),A(t,i),t.intersect=function(c){return R.circle(t,7,c)},a},"end"),va=u(async(e,t)=>{var D;const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),g=r.insert("line");let h=0,p=s;const m=r.insert("g").attr("class","label");let x=0;const S=(D=t.classData.annotations)==null?void 0:D[0],_=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",L=await j(m,_,t.labelStyle,!0,!0);let C=L.getBBox();if(Y(M())){const o=L.children[0],k=O(L);C=o.getBoundingClientRect(),k.attr("width",C.width),k.attr("height",C.height)}t.classData.annotations[0]&&(p+=C.height+s,h+=C.width);let B=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(Y(M())?B+="&lt;"+t.classData.type+"&gt;":B+="<"+t.classData.type+">");const N=await j(m,B,t.labelStyle,!0,!0);O(N).attr("class","classTitle");let b=N.getBBox();if(Y(M())){const o=N.children[0],k=O(N);b=o.getBoundingClientRect(),k.attr("width",b.width),k.attr("height",b.height)}p+=b.height+s,b.width>h&&(h=b.width);const d=[];t.classData.members.forEach(async o=>{const k=o.getDisplayDetails();let f=k.displayText;Y(M())&&(f=f.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const E=await j(m,f,k.cssStyle?k.cssStyle:t.labelStyle,!0,!0);let T=E.getBBox();if(Y(M())){const z=E.children[0],F=O(E);T=z.getBoundingClientRect(),F.attr("width",T.width),F.attr("height",T.height)}T.width>h&&(h=T.width),p+=T.height+s,d.push(E)}),p+=i;const y=[];if(t.classData.methods.forEach(async o=>{const k=o.getDisplayDetails();let f=k.displayText;Y(M())&&(f=f.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const E=await j(m,f,k.cssStyle?k.cssStyle:t.labelStyle,!0,!0);let T=E.getBBox();if(Y(M())){const z=E.children[0],F=O(E);T=z.getBoundingClientRect(),F.attr("width",T.width),F.attr("height",T.height)}T.width>h&&(h=T.width),p+=T.height+s,y.push(E)}),p+=i,S){let o=(h-C.width)/2;O(L).attr("transform","translate( "+(-1*h/2+o)+", "+-1*p/2+")"),x=C.height+s}let w=(h-b.width)/2;return O(N).attr("transform","translate( "+(-1*h/2+w)+", "+(-1*p/2+x)+")"),x+=b.height+s,l.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,d.forEach(o=>{O(o).attr("transform","translate( "+-h/2+", "+(-1*p/2+x+i/2)+")");const k=o==null?void 0:o.getBBox();x+=((k==null?void 0:k.height)??0)+s}),x+=i,g.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,y.forEach(o=>{O(o).attr("transform","translate( "+-h/2+", "+(-1*p/2+x)+")");const k=o==null?void 0:o.getBBox();x+=((k==null?void 0:k.height)??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-h/2-a).attr("y",-(p/2)-a).attr("width",h+t.padding).attr("height",p+t.padding),A(t,n),t.intersect=function(o){return R.rect(t,o)},r},"class_box"),Kt={rhombus:Yt,composite:fa,question:Yt,rect:da,labelRect:pa,rectWithTitle:ya,choice:aa,circle:ba,doublecircle:wa,stadium:xa,hexagon:sa,block_arrow:ia,rect_left_inv_arrow:na,lean_right:ca,lean_left:la,trapezoid:oa,inv_trapezoid:ha,rect_right_inv_arrow:ga,cylinder:ua,start:Sa,end:La,note:ra,subroutine:ma,fork:Ht,join:Ht,class_box:va},ot={},ne=u(async(e,t,a)=>{let s,i;if(t.link){let c;M().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Kt[t.shape](s,t,a)}else i=await Kt[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),ot[t.id]=s,t.haveCallback&&ot[t.id].attr("class",ot[t.id].attr("class")+" clickable"),s},"insertNode"),Ea=u(e=>{const t=ot[e.id];v.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function It(e,t,a=!1){var x,S,_;const s=e;let i="default";(((x=s==null?void 0:s.classes)==null?void 0:x.length)||0)>0&&(i=((s==null?void 0:s.classes)??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=je((s==null?void 0:s.styles)??[]),g=s.label,h=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:g,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:a,intersect:void 0,type:s.type,padding:n??((_=(S=nt())==null?void 0:S.block)==null?void 0:_.padding)??0,widthInColumns:s.widthInColumns??1}}u(It,"getNodeFromBlock");async function ce(e,t,a){const s=It(t,a,!1);if(s.type==="group")return;const i=nt(),c=await ne(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}u(ce,"calculateBlockSize");async function le(e,t,a){const s=It(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=nt();await ne(e,s,{config:c}),t.intersect=s==null?void 0:s.intersect,Ea(s)}}u(le,"insertBlockPositioned");async function dt(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await dt(e,i.children,a,s)}u(dt,"performOperations");async function oe(e,t,a){await dt(e,t,a,ce)}u(oe,"calculateBlockSizes");async function he(e,t,a){await dt(e,t,a,le)}u(he,"insertBlocks");async function ge(e,t,a,s,i){const c=new Ze({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n!=null&&n.size&&(l!=null&&l.size)){const g=n.size,h=l.size,p=[{x:g.x,y:g.y},{x:g.x+(h.x-g.x)/2,y:g.y+(h.y-g.y)/2},{x:h.x,y:h.y}],m=i?`${i}-${r.id}`:r.id,x=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",S=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",_=`${x} ${S} flowchart-link LS-a1 LE-b1`;Vr(e,{v:r.start,w:r.end,name:m},{...r,id:m,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:_},void 0,"block",c,i),r.label&&(await Hr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:_}),Kr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}u(ge,"insertEdges");var _a=u(function(e,t){return t.db.getClasses()},"getClasses"),ka=u(async function(e,t,a,s){const{securityLevel:i,block:c}=nt(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=O("#i"+t));const l=i==="sandbox"?O(n.nodes()[0].contentDocument.body):O("body"),g=i==="sandbox"?l.select(`[id="${t}"]`):O(`[id="${t}"]`);Mr(g,["point","circle","cross"],s.type,t);const p=r.getBlocks(),m=r.getBlocksFlat(),x=r.getEdges(),S=g.insert("g").attr("class","block");await oe(S,p,r);const _=$t(r);if(await he(S,p,r),await ge(S,x,m,r,t),_){const L=_,C=Math.max(1,Math.round(.125*(L.width/L.height))),B=L.height+C+10,N=L.width+10,{useMaxWidth:b}=c;Pe(g,B,N,!!b),v.debug("Here Bounds",_,L),g.attr("viewBox",`${L.x-5} ${L.y-5} ${L.width+10} ${L.height+10}`)}},"draw"),Ta={draw:ka,getClasses:_a},Aa={parser:ar,db:vr,renderer:Ta,styles:_r};export{Aa as diagram};
@@ -1,8 +1,8 @@
1
- import{g as re}from"./mobile-Chw8RWyH.js";function oe(r,o){for(var i=0;i<o.length;i++){const e=o[i];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const n=Object.getOwnPropertyDescriptor(e,t);n&&Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var z={},Q,Bt;function ie(){return Bt||(Bt=1,Q=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Q}var W={},_={},At;function U(){if(At)return _;At=1;let r;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return _.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},_.getSymbolTotalCodewords=function(e){return o[e]},_.getBCHDigit=function(i){let e=0;for(;i!==0;)e++,i>>>=1;return e},_.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');r=e},_.isKanjiModeEnabled=function(){return typeof r<"u"},_.toSJIS=function(e){return r(e)},_}var Z={},Rt;function yt(){return Rt||(Rt=1,(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+i)}}r.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{return o(e)}catch{return t}}})(Z)),Z}var X,Tt;function se(){if(Tt)return X;Tt=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(o){const i=Math.floor(o/8);return(this.buffer[i]>>>7-o%8&1)===1},put:function(o,i){for(let e=0;e<i;e++)this.putBit((o>>>i-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),o&&(this.buffer[i]|=128>>>this.length%8),this.length++}},X=r,X}var x,It;function ue(){if(It)return x;It=1;function r(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return r.prototype.set=function(o,i,e,t){const n=o*this.size+i;this.data[n]=e,t&&(this.reservedBit[n]=!0)},r.prototype.get=function(o,i){return this.data[o*this.size+i]},r.prototype.xor=function(o,i,e){this.data[o*this.size+i]^=e},r.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},x=r,x}var $={},Nt;function ae(){return Nt||(Nt=1,(function(r){const o=U().getSymbolSize;r.getRowColCoords=function(e){if(e===1)return[];const t=Math.floor(e/7)+2,n=o(e),s=n===145?26:Math.ceil((n-13)/(2*t-2))*2,a=[n-7];for(let u=1;u<t-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},r.getPositions=function(e){const t=[],n=r.getRowColCoords(e),s=n.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||t.push([n[a],n[u]]);return t}})($)),$}var tt={},Pt;function ce(){if(Pt)return tt;Pt=1;const r=U().getSymbolSize,o=7;return tt.getPositions=function(e){const t=r(e);return[[0,0],[t-o,0],[0,t-o]]},tt}var et={},Mt;function fe(){return Mt||(Mt=1,(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};r.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){const n=t.size;let s=0,a=0,u=0,c=null,d=null;for(let p=0;p<n;p++){a=u=0,c=d=null;for(let h=0;h<n;h++){let f=t.get(p,h);f===c?a++:(a>=5&&(s+=o.N1+(a-5)),c=f,a=1),f=t.get(h,p),f===d?u++:(u>=5&&(s+=o.N1+(u-5)),d=f,u=1)}a>=5&&(s+=o.N1+(a-5)),u>=5&&(s+=o.N1+(u-5))}return s},r.getPenaltyN2=function(t){const n=t.size;let s=0;for(let a=0;a<n-1;a++)for(let u=0;u<n-1;u++){const c=t.get(a,u)+t.get(a,u+1)+t.get(a+1,u)+t.get(a+1,u+1);(c===4||c===0)&&s++}return s*o.N2},r.getPenaltyN3=function(t){const n=t.size;let s=0,a=0,u=0;for(let c=0;c<n;c++){a=u=0;for(let d=0;d<n;d++)a=a<<1&2047|t.get(c,d),d>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|t.get(d,c),d>=10&&(u===1488||u===93)&&s++}return s*o.N3},r.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let u=0;u<s;u++)n+=t.data[u];return Math.abs(Math.ceil(n*100/s/5)-10)*o.N4};function i(e,t,n){switch(e){case r.Patterns.PATTERN000:return(t+n)%2===0;case r.Patterns.PATTERN001:return t%2===0;case r.Patterns.PATTERN010:return n%3===0;case r.Patterns.PATTERN011:return(t+n)%3===0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2===0;case r.Patterns.PATTERN101:return t*n%2+t*n%3===0;case r.Patterns.PATTERN110:return(t*n%2+t*n%3)%2===0;case r.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}r.applyMask=function(t,n){const s=n.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)n.isReserved(u,a)||n.xor(u,a,i(t,u,a))},r.getBestMask=function(t,n){const s=Object.keys(r.Patterns).length;let a=0,u=1/0;for(let c=0;c<s;c++){n(c),r.applyMask(c,t);const d=r.getPenaltyN1(t)+r.getPenaltyN2(t)+r.getPenaltyN3(t)+r.getPenaltyN4(t);r.applyMask(c,t),d<u&&(u=d,a=c)}return a}})(et)),et}var J={},St;function Wt(){if(St)return J;St=1;const r=yt(),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return J.getBlocksCount=function(t,n){switch(n){case r.L:return o[(t-1)*4+0];case r.M:return o[(t-1)*4+1];case r.Q:return o[(t-1)*4+2];case r.H:return o[(t-1)*4+3];default:return}},J.getTotalCodewordsCount=function(t,n){switch(n){case r.L:return i[(t-1)*4+0];case r.M:return i[(t-1)*4+1];case r.Q:return i[(t-1)*4+2];case r.H:return i[(t-1)*4+3];default:return}},J}var nt={},K={},bt;function le(){if(bt)return K;bt=1;const r=new Uint8Array(512),o=new Uint8Array(256);return(function(){let e=1;for(let t=0;t<255;t++)r[t]=e,o[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)r[t]=r[t-255]})(),K.log=function(e){if(e<1)throw new Error("log("+e+")");return o[e]},K.exp=function(e){return r[e]},K.mul=function(e,t){return e===0||t===0?0:r[o[e]+o[t]]},K}var Lt;function de(){return Lt||(Lt=1,(function(r){const o=le();r.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let s=0;s<e.length;s++)for(let a=0;a<t.length;a++)n[s+a]^=o.mul(e[s],t[a]);return n},r.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const s=n[0];for(let u=0;u<t.length;u++)n[u]^=o.mul(t[u],s);let a=0;for(;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n},r.generateECPolynomial=function(e){let t=new Uint8Array([1]);for(let n=0;n<e;n++)t=r.mul(t,new Uint8Array([1,o.exp(n)]));return t}})(nt)),nt}var rt,Dt;function ge(){if(Dt)return rt;Dt=1;const r=de();function o(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(e){this.degree=e,this.genPoly=r.generateECPolynomial(this.degree)},o.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=r.mod(t,this.genPoly),s=this.degree-n.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(n,s),a}return n},rt=o,rt}var ot={},it={},st={},qt;function Zt(){return qt||(qt=1,st.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),st}var L={},vt;function Xt(){if(vt)return L;vt=1;const r="[0-9]+",o="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const e="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
2
- ]))+`;L.KANJI=new RegExp(i,"g"),L.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),L.BYTE=new RegExp(e,"g"),L.NUMERIC=new RegExp(r,"g"),L.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),n=new RegExp("^"+r+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return L.testKanji=function(u){return t.test(u)},L.testNumeric=function(u){return n.test(u)},L.testAlphanumeric=function(u){return s.test(u)},L}var _t;function F(){return _t||(_t=1,(function(r){const o=Zt(),i=Xt();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!o.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},r.getBestModeForData=function(n){return i.testNumeric(n)?r.NUMERIC:i.testAlphanumeric(n)?r.ALPHANUMERIC:i.testKanji(n)?r.KANJI:r.BYTE},r.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},r.isValid=function(n){return n&&n.bit&&n.ccBits};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}r.from=function(n,s){if(r.isValid(n))return n;try{return e(n)}catch{return s}}})(it)),it}var Ut;function he(){return Ut||(Ut=1,(function(r){const o=U(),i=Wt(),e=yt(),t=F(),n=Zt(),s=7973,a=o.getBCHDigit(s);function u(h,f,N){for(let P=1;P<=40;P++)if(f<=r.getCapacity(P,N,h))return P}function c(h,f){return t.getCharCountIndicator(h,f)+4}function d(h,f){let N=0;return h.forEach(function(P){const S=c(P.mode,f);N+=S+P.getBitsLength()}),N}function p(h,f){for(let N=1;N<=40;N++)if(d(h,N)<=r.getCapacity(N,f,t.MIXED))return N}r.from=function(f,N){return n.isValid(f)?parseInt(f,10):N},r.getCapacity=function(f,N,P){if(!n.isValid(f))throw new Error("Invalid QR Code version");typeof P>"u"&&(P=t.BYTE);const S=o.getSymbolTotalCodewords(f),R=i.getTotalCodewordsCount(f,N),M=(S-R)*8;if(P===t.MIXED)return M;const T=M-c(P,f);switch(P){case t.NUMERIC:return Math.floor(T/10*3);case t.ALPHANUMERIC:return Math.floor(T/11*2);case t.KANJI:return Math.floor(T/13);case t.BYTE:default:return Math.floor(T/8)}},r.getBestVersionForData=function(f,N){let P;const S=e.from(N,e.M);if(Array.isArray(f)){if(f.length>1)return p(f,S);if(f.length===0)return 1;P=f[0]}else P=f;return u(P.mode,P.getLength(),S)},r.getEncodedBits=function(f){if(!n.isValid(f)||f<7)throw new Error("Invalid QR Code version");let N=f<<12;for(;o.getBCHDigit(N)-a>=0;)N^=s<<o.getBCHDigit(N)-a;return f<<12|N}})(ot)),ot}var ut={},Ft;function me(){if(Ft)return ut;Ft=1;const r=U(),o=1335,i=21522,e=r.getBCHDigit(o);return ut.getEncodedBits=function(n,s){const a=n.bit<<3|s;let u=a<<10;for(;r.getBCHDigit(u)-e>=0;)u^=o<<r.getBCHDigit(u)-e;return(a<<10|u)^i},ut}var at={},ct,kt;function we(){if(kt)return ct;kt=1;const r=F();function o(i){this.mode=r.NUMERIC,this.data=i.toString()}return o.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t,n,s;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),s=parseInt(n,10),e.put(s,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),s=parseInt(n,10),e.put(s,a*3+1))},ct=o,ct}var ft,zt;function ye(){if(zt)return ft;zt=1;const r=F(),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(e){this.mode=r.ALPHANUMERIC,this.data=e}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let s=o.indexOf(this.data[n])*45;s+=o.indexOf(this.data[n+1]),t.put(s,11)}this.data.length%2&&t.put(o.indexOf(this.data[n]),6)},ft=i,ft}var lt,Vt;function Ce(){if(Vt)return lt;Vt=1;const r=F();function o(i){this.mode=r.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return o.getBitsLength=function(e){return e*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){for(let e=0,t=this.data.length;e<t;e++)i.put(this.data[e],8)},lt=o,lt}var dt,Kt;function Ee(){if(Kt)return dt;Kt=1;const r=F(),o=U();function i(e){this.mode=r.KANJI,this.data=e}return i.getBitsLength=function(t){return t*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=o.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},dt=i,dt}var gt={exports:{}},Ht;function pe(){return Ht||(Ht=1,(function(r){var o={single_source_shortest_paths:function(i,e,t){var n={},s={};s[e]=0;var a=o.PriorityQueue.make();a.push(e,0);for(var u,c,d,p,h,f,N,P,S;!a.empty();){u=a.pop(),c=u.value,p=u.cost,h=i[c]||{};for(d in h)h.hasOwnProperty(d)&&(f=h[d],N=p+f,P=s[d],S=typeof s[d]>"u",(S||P>N)&&(s[d]=N,a.push(d,N),n[d]=c))}if(typeof t<"u"&&typeof s[t]>"u"){var R=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(R)}return n},extract_shortest_path_from_predecessor_list:function(i,e){for(var t=[],n=e;n;)t.push(n),i[n],n=i[n];return t.reverse(),t},find_path:function(i,e,t){var n=o.single_source_shortest_paths(i,e,t);return o.extract_shortest_path_from_predecessor_list(n,t)},PriorityQueue:{make:function(i){var e=o.PriorityQueue,t={},n;i=i||{};for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t.queue=[],t.sorter=i.sorter||e.default_sorter,t},default_sorter:function(i,e){return i.cost-e.cost},push:function(i,e){var t={value:i,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=o})(gt)),gt.exports}var Jt;function Be(){return Jt||(Jt=1,(function(r){const o=F(),i=we(),e=ye(),t=Ce(),n=Ee(),s=Xt(),a=U(),u=pe();function c(R){return unescape(encodeURIComponent(R)).length}function d(R,M,T){const B=[];let b;for(;(b=R.exec(T))!==null;)B.push({data:b[0],index:b.index,mode:M,length:b[0].length});return B}function p(R){const M=d(s.NUMERIC,o.NUMERIC,R),T=d(s.ALPHANUMERIC,o.ALPHANUMERIC,R);let B,b;return a.isKanjiModeEnabled()?(B=d(s.BYTE,o.BYTE,R),b=d(s.KANJI,o.KANJI,R)):(B=d(s.BYTE_KANJI,o.BYTE,R),b=[]),M.concat(T,B,b).sort(function(C,y){return C.index-y.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function h(R,M){switch(M){case o.NUMERIC:return i.getBitsLength(R);case o.ALPHANUMERIC:return e.getBitsLength(R);case o.KANJI:return n.getBitsLength(R);case o.BYTE:return t.getBitsLength(R)}}function f(R){return R.reduce(function(M,T){const B=M.length-1>=0?M[M.length-1]:null;return B&&B.mode===T.mode?(M[M.length-1].data+=T.data,M):(M.push(T),M)},[])}function N(R){const M=[];for(let T=0;T<R.length;T++){const B=R[T];switch(B.mode){case o.NUMERIC:M.push([B,{data:B.data,mode:o.ALPHANUMERIC,length:B.length},{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.ALPHANUMERIC:M.push([B,{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.KANJI:M.push([B,{data:B.data,mode:o.BYTE,length:c(B.data)}]);break;case o.BYTE:M.push([{data:B.data,mode:o.BYTE,length:c(B.data)}])}}return M}function P(R,M){const T={},B={start:{}};let b=["start"];for(let g=0;g<R.length;g++){const C=R[g],y=[];for(let l=0;l<C.length;l++){const A=C[l],m=""+g+l;y.push(m),T[m]={node:A,lastCount:0},B[m]={};for(let E=0;E<b.length;E++){const w=b[E];T[w]&&T[w].node.mode===A.mode?(B[w][m]=h(T[w].lastCount+A.length,A.mode)-h(T[w].lastCount,A.mode),T[w].lastCount+=A.length):(T[w]&&(T[w].lastCount=A.length),B[w][m]=h(A.length,A.mode)+4+o.getCharCountIndicator(A.mode,M))}}b=y}for(let g=0;g<b.length;g++)B[b[g]].end=0;return{map:B,table:T}}function S(R,M){let T;const B=o.getBestModeForData(R);if(T=o.from(M,B),T!==o.BYTE&&T.bit<B.bit)throw new Error('"'+R+'" cannot be encoded with mode '+o.toString(T)+`.
4
- Suggested mode is: `+o.toString(B));switch(T===o.KANJI&&!a.isKanjiModeEnabled()&&(T=o.BYTE),T){case o.NUMERIC:return new i(R);case o.ALPHANUMERIC:return new e(R);case o.KANJI:return new n(R);case o.BYTE:return new t(R)}}r.fromArray=function(M){return M.reduce(function(T,B){return typeof B=="string"?T.push(S(B,null)):B.data&&T.push(S(B.data,B.mode)),T},[])},r.fromString=function(M,T){const B=p(M,a.isKanjiModeEnabled()),b=N(B),g=P(b,T),C=u.find_path(g.map,"start","end"),y=[];for(let l=1;l<C.length-1;l++)y.push(g.table[C[l]].node);return r.fromArray(f(y))},r.rawSplit=function(M){return r.fromArray(p(M,a.isKanjiModeEnabled()))}})(at)),at}var Ot;function Ae(){if(Ot)return W;Ot=1;const r=U(),o=yt(),i=se(),e=ue(),t=ae(),n=ce(),s=fe(),a=Wt(),u=ge(),c=he(),d=me(),p=F(),h=Be();function f(g,C){const y=g.size,l=n.getPositions(C);for(let A=0;A<l.length;A++){const m=l[A][0],E=l[A][1];for(let w=-1;w<=7;w++)if(!(m+w<=-1||y<=m+w))for(let I=-1;I<=7;I++)E+I<=-1||y<=E+I||(w>=0&&w<=6&&(I===0||I===6)||I>=0&&I<=6&&(w===0||w===6)||w>=2&&w<=4&&I>=2&&I<=4?g.set(m+w,E+I,!0,!0):g.set(m+w,E+I,!1,!0))}}function N(g){const C=g.size;for(let y=8;y<C-8;y++){const l=y%2===0;g.set(y,6,l,!0),g.set(6,y,l,!0)}}function P(g,C){const y=t.getPositions(C);for(let l=0;l<y.length;l++){const A=y[l][0],m=y[l][1];for(let E=-2;E<=2;E++)for(let w=-2;w<=2;w++)E===-2||E===2||w===-2||w===2||E===0&&w===0?g.set(A+E,m+w,!0,!0):g.set(A+E,m+w,!1,!0)}}function S(g,C){const y=g.size,l=c.getEncodedBits(C);let A,m,E;for(let w=0;w<18;w++)A=Math.floor(w/3),m=w%3+y-8-3,E=(l>>w&1)===1,g.set(A,m,E,!0),g.set(m,A,E,!0)}function R(g,C,y){const l=g.size,A=d.getEncodedBits(C,y);let m,E;for(m=0;m<15;m++)E=(A>>m&1)===1,m<6?g.set(m,8,E,!0):m<8?g.set(m+1,8,E,!0):g.set(l-15+m,8,E,!0),m<8?g.set(8,l-m-1,E,!0):m<9?g.set(8,15-m-1+1,E,!0):g.set(8,15-m-1,E,!0);g.set(l-8,8,1,!0)}function M(g,C){const y=g.size;let l=-1,A=y-1,m=7,E=0;for(let w=y-1;w>0;w-=2)for(w===6&&w--;;){for(let I=0;I<2;I++)if(!g.isReserved(A,w-I)){let v=!1;E<C.length&&(v=(C[E]>>>m&1)===1),g.set(A,w-I,v),m--,m===-1&&(E++,m=7)}if(A+=l,A<0||y<=A){A-=l,l=-l;break}}}function T(g,C,y){const l=new i;y.forEach(function(I){l.put(I.mode.bit,4),l.put(I.getLength(),p.getCharCountIndicator(I.mode,g)),I.write(l)});const A=r.getSymbolTotalCodewords(g),m=a.getTotalCodewordsCount(g,C),E=(A-m)*8;for(l.getLengthInBits()+4<=E&&l.put(0,4);l.getLengthInBits()%8!==0;)l.putBit(0);const w=(E-l.getLengthInBits())/8;for(let I=0;I<w;I++)l.put(I%2?17:236,8);return B(l,g,C)}function B(g,C,y){const l=r.getSymbolTotalCodewords(C),A=a.getTotalCodewordsCount(C,y),m=l-A,E=a.getBlocksCount(C,y),w=l%E,I=E-w,v=Math.floor(l/E),V=Math.floor(m/E),te=V+1,Ct=v-V,ee=new u(Ct);let O=0;const H=new Array(E),Et=new Array(E);let j=0;const ne=new Uint8Array(g.buffer);for(let k=0;k<E;k++){const G=k<I?V:te;H[k]=ne.slice(O,O+G),Et[k]=ee.encode(H[k]),O+=G,j=Math.max(j,G)}const Y=new Uint8Array(l);let pt=0,D,q;for(D=0;D<j;D++)for(q=0;q<E;q++)D<H[q].length&&(Y[pt++]=H[q][D]);for(D=0;D<Ct;D++)for(q=0;q<E;q++)Y[pt++]=Et[q][D];return Y}function b(g,C,y,l){let A;if(Array.isArray(g))A=h.fromArray(g);else if(typeof g=="string"){let v=C;if(!v){const V=h.rawSplit(g);v=c.getBestVersionForData(V,y)}A=h.fromString(g,v||40)}else throw new Error("Invalid data");const m=c.getBestVersionForData(A,y);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=m;else if(C<m)throw new Error(`
1
+ import{g as re}from"./mobile-CNLMhdFP.js";function oe(r,o){for(var i=0;i<o.length;i++){const e=o[i];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const n=Object.getOwnPropertyDescriptor(e,t);n&&Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var z={},Q,Bt;function ie(){return Bt||(Bt=1,Q=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Q}var $={},_={},At;function U(){if(At)return _;At=1;let r;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return _.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},_.getSymbolTotalCodewords=function(e){return o[e]},_.getBCHDigit=function(i){let e=0;for(;i!==0;)e++,i>>>=1;return e},_.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');r=e},_.isKanjiModeEnabled=function(){return typeof r<"u"},_.toSJIS=function(e){return r(e)},_}var W={},Rt;function yt(){return Rt||(Rt=1,(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+i)}}r.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{return o(e)}catch{return t}}})(W)),W}var Z,Tt;function se(){if(Tt)return Z;Tt=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(o){const i=Math.floor(o/8);return(this.buffer[i]>>>7-o%8&1)===1},put:function(o,i){for(let e=0;e<i;e++)this.putBit((o>>>i-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),o&&(this.buffer[i]|=128>>>this.length%8),this.length++}},Z=r,Z}var X,It;function ue(){if(It)return X;It=1;function r(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return r.prototype.set=function(o,i,e,t){const n=o*this.size+i;this.data[n]=e,t&&(this.reservedBit[n]=!0)},r.prototype.get=function(o,i){return this.data[o*this.size+i]},r.prototype.xor=function(o,i,e){this.data[o*this.size+i]^=e},r.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},X=r,X}var x={},Nt;function ae(){return Nt||(Nt=1,(function(r){const o=U().getSymbolSize;r.getRowColCoords=function(e){if(e===1)return[];const t=Math.floor(e/7)+2,n=o(e),s=n===145?26:Math.ceil((n-13)/(2*t-2))*2,a=[n-7];for(let u=1;u<t-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},r.getPositions=function(e){const t=[],n=r.getRowColCoords(e),s=n.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||t.push([n[a],n[u]]);return t}})(x)),x}var tt={},Pt;function ce(){if(Pt)return tt;Pt=1;const r=U().getSymbolSize,o=7;return tt.getPositions=function(e){const t=r(e);return[[0,0],[t-o,0],[0,t-o]]},tt}var et={},Mt;function fe(){return Mt||(Mt=1,(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};r.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){const n=t.size;let s=0,a=0,u=0,c=null,d=null;for(let p=0;p<n;p++){a=u=0,c=d=null;for(let h=0;h<n;h++){let f=t.get(p,h);f===c?a++:(a>=5&&(s+=o.N1+(a-5)),c=f,a=1),f=t.get(h,p),f===d?u++:(u>=5&&(s+=o.N1+(u-5)),d=f,u=1)}a>=5&&(s+=o.N1+(a-5)),u>=5&&(s+=o.N1+(u-5))}return s},r.getPenaltyN2=function(t){const n=t.size;let s=0;for(let a=0;a<n-1;a++)for(let u=0;u<n-1;u++){const c=t.get(a,u)+t.get(a,u+1)+t.get(a+1,u)+t.get(a+1,u+1);(c===4||c===0)&&s++}return s*o.N2},r.getPenaltyN3=function(t){const n=t.size;let s=0,a=0,u=0;for(let c=0;c<n;c++){a=u=0;for(let d=0;d<n;d++)a=a<<1&2047|t.get(c,d),d>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|t.get(d,c),d>=10&&(u===1488||u===93)&&s++}return s*o.N3},r.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let u=0;u<s;u++)n+=t.data[u];return Math.abs(Math.ceil(n*100/s/5)-10)*o.N4};function i(e,t,n){switch(e){case r.Patterns.PATTERN000:return(t+n)%2===0;case r.Patterns.PATTERN001:return t%2===0;case r.Patterns.PATTERN010:return n%3===0;case r.Patterns.PATTERN011:return(t+n)%3===0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2===0;case r.Patterns.PATTERN101:return t*n%2+t*n%3===0;case r.Patterns.PATTERN110:return(t*n%2+t*n%3)%2===0;case r.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}r.applyMask=function(t,n){const s=n.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)n.isReserved(u,a)||n.xor(u,a,i(t,u,a))},r.getBestMask=function(t,n){const s=Object.keys(r.Patterns).length;let a=0,u=1/0;for(let c=0;c<s;c++){n(c),r.applyMask(c,t);const d=r.getPenaltyN1(t)+r.getPenaltyN2(t)+r.getPenaltyN3(t)+r.getPenaltyN4(t);r.applyMask(c,t),d<u&&(u=d,a=c)}return a}})(et)),et}var J={},St;function $t(){if(St)return J;St=1;const r=yt(),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return J.getBlocksCount=function(t,n){switch(n){case r.L:return o[(t-1)*4+0];case r.M:return o[(t-1)*4+1];case r.Q:return o[(t-1)*4+2];case r.H:return o[(t-1)*4+3];default:return}},J.getTotalCodewordsCount=function(t,n){switch(n){case r.L:return i[(t-1)*4+0];case r.M:return i[(t-1)*4+1];case r.Q:return i[(t-1)*4+2];case r.H:return i[(t-1)*4+3];default:return}},J}var nt={},K={},bt;function le(){if(bt)return K;bt=1;const r=new Uint8Array(512),o=new Uint8Array(256);return(function(){let e=1;for(let t=0;t<255;t++)r[t]=e,o[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)r[t]=r[t-255]})(),K.log=function(e){if(e<1)throw new Error("log("+e+")");return o[e]},K.exp=function(e){return r[e]},K.mul=function(e,t){return e===0||t===0?0:r[o[e]+o[t]]},K}var Lt;function de(){return Lt||(Lt=1,(function(r){const o=le();r.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let s=0;s<e.length;s++)for(let a=0;a<t.length;a++)n[s+a]^=o.mul(e[s],t[a]);return n},r.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const s=n[0];for(let u=0;u<t.length;u++)n[u]^=o.mul(t[u],s);let a=0;for(;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n},r.generateECPolynomial=function(e){let t=new Uint8Array([1]);for(let n=0;n<e;n++)t=r.mul(t,new Uint8Array([1,o.exp(n)]));return t}})(nt)),nt}var rt,Dt;function ge(){if(Dt)return rt;Dt=1;const r=de();function o(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(e){this.degree=e,this.genPoly=r.generateECPolynomial(this.degree)},o.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=r.mod(t,this.genPoly),s=this.degree-n.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(n,s),a}return n},rt=o,rt}var ot={},it={},st={},qt;function Wt(){return qt||(qt=1,st.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),st}var L={},vt;function Zt(){if(vt)return L;vt=1;const r="[0-9]+",o="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const e="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
2
+ ]))+`;L.KANJI=new RegExp(i,"g"),L.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),L.BYTE=new RegExp(e,"g"),L.NUMERIC=new RegExp(r,"g"),L.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),n=new RegExp("^"+r+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return L.testKanji=function(u){return t.test(u)},L.testNumeric=function(u){return n.test(u)},L.testAlphanumeric=function(u){return s.test(u)},L}var _t;function F(){return _t||(_t=1,(function(r){const o=Wt(),i=Zt();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!o.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},r.getBestModeForData=function(n){return i.testNumeric(n)?r.NUMERIC:i.testAlphanumeric(n)?r.ALPHANUMERIC:i.testKanji(n)?r.KANJI:r.BYTE},r.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},r.isValid=function(n){return n&&n.bit&&n.ccBits};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}r.from=function(n,s){if(r.isValid(n))return n;try{return e(n)}catch{return s}}})(it)),it}var Ut;function he(){return Ut||(Ut=1,(function(r){const o=U(),i=$t(),e=yt(),t=F(),n=Wt(),s=7973,a=o.getBCHDigit(s);function u(h,f,N){for(let P=1;P<=40;P++)if(f<=r.getCapacity(P,N,h))return P}function c(h,f){return t.getCharCountIndicator(h,f)+4}function d(h,f){let N=0;return h.forEach(function(P){const S=c(P.mode,f);N+=S+P.getBitsLength()}),N}function p(h,f){for(let N=1;N<=40;N++)if(d(h,N)<=r.getCapacity(N,f,t.MIXED))return N}r.from=function(f,N){return n.isValid(f)?parseInt(f,10):N},r.getCapacity=function(f,N,P){if(!n.isValid(f))throw new Error("Invalid QR Code version");typeof P>"u"&&(P=t.BYTE);const S=o.getSymbolTotalCodewords(f),R=i.getTotalCodewordsCount(f,N),M=(S-R)*8;if(P===t.MIXED)return M;const T=M-c(P,f);switch(P){case t.NUMERIC:return Math.floor(T/10*3);case t.ALPHANUMERIC:return Math.floor(T/11*2);case t.KANJI:return Math.floor(T/13);case t.BYTE:default:return Math.floor(T/8)}},r.getBestVersionForData=function(f,N){let P;const S=e.from(N,e.M);if(Array.isArray(f)){if(f.length>1)return p(f,S);if(f.length===0)return 1;P=f[0]}else P=f;return u(P.mode,P.getLength(),S)},r.getEncodedBits=function(f){if(!n.isValid(f)||f<7)throw new Error("Invalid QR Code version");let N=f<<12;for(;o.getBCHDigit(N)-a>=0;)N^=s<<o.getBCHDigit(N)-a;return f<<12|N}})(ot)),ot}var ut={},Ft;function me(){if(Ft)return ut;Ft=1;const r=U(),o=1335,i=21522,e=r.getBCHDigit(o);return ut.getEncodedBits=function(n,s){const a=n.bit<<3|s;let u=a<<10;for(;r.getBCHDigit(u)-e>=0;)u^=o<<r.getBCHDigit(u)-e;return(a<<10|u)^i},ut}var at={},ct,kt;function we(){if(kt)return ct;kt=1;const r=F();function o(i){this.mode=r.NUMERIC,this.data=i.toString()}return o.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t,n,s;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),s=parseInt(n,10),e.put(s,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),s=parseInt(n,10),e.put(s,a*3+1))},ct=o,ct}var ft,zt;function ye(){if(zt)return ft;zt=1;const r=F(),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(e){this.mode=r.ALPHANUMERIC,this.data=e}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let s=o.indexOf(this.data[n])*45;s+=o.indexOf(this.data[n+1]),t.put(s,11)}this.data.length%2&&t.put(o.indexOf(this.data[n]),6)},ft=i,ft}var lt,Vt;function Ce(){if(Vt)return lt;Vt=1;const r=F();function o(i){this.mode=r.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return o.getBitsLength=function(e){return e*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){for(let e=0,t=this.data.length;e<t;e++)i.put(this.data[e],8)},lt=o,lt}var dt,Kt;function Ee(){if(Kt)return dt;Kt=1;const r=F(),o=U();function i(e){this.mode=r.KANJI,this.data=e}return i.getBitsLength=function(t){return t*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=o.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},dt=i,dt}var gt={exports:{}},Ht;function pe(){return Ht||(Ht=1,(function(r){var o={single_source_shortest_paths:function(i,e,t){var n={},s={};s[e]=0;var a=o.PriorityQueue.make();a.push(e,0);for(var u,c,d,p,h,f,N,P,S;!a.empty();){u=a.pop(),c=u.value,p=u.cost,h=i[c]||{};for(d in h)h.hasOwnProperty(d)&&(f=h[d],N=p+f,P=s[d],S=typeof s[d]>"u",(S||P>N)&&(s[d]=N,a.push(d,N),n[d]=c))}if(typeof t<"u"&&typeof s[t]>"u"){var R=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(R)}return n},extract_shortest_path_from_predecessor_list:function(i,e){for(var t=[],n=e;n;)t.push(n),i[n],n=i[n];return t.reverse(),t},find_path:function(i,e,t){var n=o.single_source_shortest_paths(i,e,t);return o.extract_shortest_path_from_predecessor_list(n,t)},PriorityQueue:{make:function(i){var e=o.PriorityQueue,t={},n;i=i||{};for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t.queue=[],t.sorter=i.sorter||e.default_sorter,t},default_sorter:function(i,e){return i.cost-e.cost},push:function(i,e){var t={value:i,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=o})(gt)),gt.exports}var Jt;function Be(){return Jt||(Jt=1,(function(r){const o=F(),i=we(),e=ye(),t=Ce(),n=Ee(),s=Zt(),a=U(),u=pe();function c(R){return unescape(encodeURIComponent(R)).length}function d(R,M,T){const B=[];let b;for(;(b=R.exec(T))!==null;)B.push({data:b[0],index:b.index,mode:M,length:b[0].length});return B}function p(R){const M=d(s.NUMERIC,o.NUMERIC,R),T=d(s.ALPHANUMERIC,o.ALPHANUMERIC,R);let B,b;return a.isKanjiModeEnabled()?(B=d(s.BYTE,o.BYTE,R),b=d(s.KANJI,o.KANJI,R)):(B=d(s.BYTE_KANJI,o.BYTE,R),b=[]),M.concat(T,B,b).sort(function(C,y){return C.index-y.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function h(R,M){switch(M){case o.NUMERIC:return i.getBitsLength(R);case o.ALPHANUMERIC:return e.getBitsLength(R);case o.KANJI:return n.getBitsLength(R);case o.BYTE:return t.getBitsLength(R)}}function f(R){return R.reduce(function(M,T){const B=M.length-1>=0?M[M.length-1]:null;return B&&B.mode===T.mode?(M[M.length-1].data+=T.data,M):(M.push(T),M)},[])}function N(R){const M=[];for(let T=0;T<R.length;T++){const B=R[T];switch(B.mode){case o.NUMERIC:M.push([B,{data:B.data,mode:o.ALPHANUMERIC,length:B.length},{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.ALPHANUMERIC:M.push([B,{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.KANJI:M.push([B,{data:B.data,mode:o.BYTE,length:c(B.data)}]);break;case o.BYTE:M.push([{data:B.data,mode:o.BYTE,length:c(B.data)}])}}return M}function P(R,M){const T={},B={start:{}};let b=["start"];for(let g=0;g<R.length;g++){const C=R[g],y=[];for(let l=0;l<C.length;l++){const A=C[l],m=""+g+l;y.push(m),T[m]={node:A,lastCount:0},B[m]={};for(let E=0;E<b.length;E++){const w=b[E];T[w]&&T[w].node.mode===A.mode?(B[w][m]=h(T[w].lastCount+A.length,A.mode)-h(T[w].lastCount,A.mode),T[w].lastCount+=A.length):(T[w]&&(T[w].lastCount=A.length),B[w][m]=h(A.length,A.mode)+4+o.getCharCountIndicator(A.mode,M))}}b=y}for(let g=0;g<b.length;g++)B[b[g]].end=0;return{map:B,table:T}}function S(R,M){let T;const B=o.getBestModeForData(R);if(T=o.from(M,B),T!==o.BYTE&&T.bit<B.bit)throw new Error('"'+R+'" cannot be encoded with mode '+o.toString(T)+`.
4
+ Suggested mode is: `+o.toString(B));switch(T===o.KANJI&&!a.isKanjiModeEnabled()&&(T=o.BYTE),T){case o.NUMERIC:return new i(R);case o.ALPHANUMERIC:return new e(R);case o.KANJI:return new n(R);case o.BYTE:return new t(R)}}r.fromArray=function(M){return M.reduce(function(T,B){return typeof B=="string"?T.push(S(B,null)):B.data&&T.push(S(B.data,B.mode)),T},[])},r.fromString=function(M,T){const B=p(M,a.isKanjiModeEnabled()),b=N(B),g=P(b,T),C=u.find_path(g.map,"start","end"),y=[];for(let l=1;l<C.length-1;l++)y.push(g.table[C[l]].node);return r.fromArray(f(y))},r.rawSplit=function(M){return r.fromArray(p(M,a.isKanjiModeEnabled()))}})(at)),at}var Ot;function Ae(){if(Ot)return $;Ot=1;const r=U(),o=yt(),i=se(),e=ue(),t=ae(),n=ce(),s=fe(),a=$t(),u=ge(),c=he(),d=me(),p=F(),h=Be();function f(g,C){const y=g.size,l=n.getPositions(C);for(let A=0;A<l.length;A++){const m=l[A][0],E=l[A][1];for(let w=-1;w<=7;w++)if(!(m+w<=-1||y<=m+w))for(let I=-1;I<=7;I++)E+I<=-1||y<=E+I||(w>=0&&w<=6&&(I===0||I===6)||I>=0&&I<=6&&(w===0||w===6)||w>=2&&w<=4&&I>=2&&I<=4?g.set(m+w,E+I,!0,!0):g.set(m+w,E+I,!1,!0))}}function N(g){const C=g.size;for(let y=8;y<C-8;y++){const l=y%2===0;g.set(y,6,l,!0),g.set(6,y,l,!0)}}function P(g,C){const y=t.getPositions(C);for(let l=0;l<y.length;l++){const A=y[l][0],m=y[l][1];for(let E=-2;E<=2;E++)for(let w=-2;w<=2;w++)E===-2||E===2||w===-2||w===2||E===0&&w===0?g.set(A+E,m+w,!0,!0):g.set(A+E,m+w,!1,!0)}}function S(g,C){const y=g.size,l=c.getEncodedBits(C);let A,m,E;for(let w=0;w<18;w++)A=Math.floor(w/3),m=w%3+y-8-3,E=(l>>w&1)===1,g.set(A,m,E,!0),g.set(m,A,E,!0)}function R(g,C,y){const l=g.size,A=d.getEncodedBits(C,y);let m,E;for(m=0;m<15;m++)E=(A>>m&1)===1,m<6?g.set(m,8,E,!0):m<8?g.set(m+1,8,E,!0):g.set(l-15+m,8,E,!0),m<8?g.set(8,l-m-1,E,!0):m<9?g.set(8,15-m-1+1,E,!0):g.set(8,15-m-1,E,!0);g.set(l-8,8,1,!0)}function M(g,C){const y=g.size;let l=-1,A=y-1,m=7,E=0;for(let w=y-1;w>0;w-=2)for(w===6&&w--;;){for(let I=0;I<2;I++)if(!g.isReserved(A,w-I)){let v=!1;E<C.length&&(v=(C[E]>>>m&1)===1),g.set(A,w-I,v),m--,m===-1&&(E++,m=7)}if(A+=l,A<0||y<=A){A-=l,l=-l;break}}}function T(g,C,y){const l=new i;y.forEach(function(I){l.put(I.mode.bit,4),l.put(I.getLength(),p.getCharCountIndicator(I.mode,g)),I.write(l)});const A=r.getSymbolTotalCodewords(g),m=a.getTotalCodewordsCount(g,C),E=(A-m)*8;for(l.getLengthInBits()+4<=E&&l.put(0,4);l.getLengthInBits()%8!==0;)l.putBit(0);const w=(E-l.getLengthInBits())/8;for(let I=0;I<w;I++)l.put(I%2?17:236,8);return B(l,g,C)}function B(g,C,y){const l=r.getSymbolTotalCodewords(C),A=a.getTotalCodewordsCount(C,y),m=l-A,E=a.getBlocksCount(C,y),w=l%E,I=E-w,v=Math.floor(l/E),V=Math.floor(m/E),te=V+1,Ct=v-V,ee=new u(Ct);let O=0;const H=new Array(E),Et=new Array(E);let j=0;const ne=new Uint8Array(g.buffer);for(let k=0;k<E;k++){const G=k<I?V:te;H[k]=ne.slice(O,O+G),Et[k]=ee.encode(H[k]),O+=G,j=Math.max(j,G)}const Y=new Uint8Array(l);let pt=0,D,q;for(D=0;D<j;D++)for(q=0;q<E;q++)D<H[q].length&&(Y[pt++]=H[q][D]);for(D=0;D<Ct;D++)for(q=0;q<E;q++)Y[pt++]=Et[q][D];return Y}function b(g,C,y,l){let A;if(Array.isArray(g))A=h.fromArray(g);else if(typeof g=="string"){let v=C;if(!v){const V=h.rawSplit(g);v=c.getBestVersionForData(V,y)}A=h.fromString(g,v||40)}else throw new Error("Invalid data");const m=c.getBestVersionForData(A,y);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=m;else if(C<m)throw new Error(`
5
5
  The chosen QR Code version cannot contain this amount of data.
6
6
  Minimum version required to store current data is: `+m+`.
7
- `);const E=T(C,y,A),w=r.getSymbolSize(C),I=new e(w);return f(I,C),N(I),P(I,C),R(I,y,0),C>=7&&S(I,C),M(I,E),isNaN(l)&&(l=s.getBestMask(I,R.bind(null,I,y))),s.applyMask(l,I),R(I,y,l),{modules:I,version:C,errorCorrectionLevel:y,maskPattern:l,segments:A}}return W.create=function(C,y){if(typeof C>"u"||C==="")throw new Error("No input text");let l=o.M,A,m;return typeof y<"u"&&(l=o.from(y.errorCorrectionLevel,o.M),A=c.from(y.version),m=s.from(y.maskPattern),y.toSJISFunc&&r.setToSJISFunction(y.toSJISFunc)),b(C,A,l,m)},W}var ht={},mt={},jt;function xt(){return jt||(jt=1,(function(r){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let e=i.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+i);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(n){return[n,n]}))),e.length===6&&e.push("F","F");const t=parseInt(e.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,s=e.scale||4;return{width:n,scale:n?4:s,margin:t,color:{dark:o(e.color.dark||"#000000ff"),light:o(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},r.getImageWidth=function(e,t){const n=r.getScale(e,t);return Math.floor((e+t.margin*2)*n)},r.qrToImageData=function(e,t,n){const s=t.modules.size,a=t.modules.data,u=r.getScale(s,n),c=Math.floor((s+n.margin*2)*u),d=n.margin*u,p=[n.color.light,n.color.dark];for(let h=0;h<c;h++)for(let f=0;f<c;f++){let N=(h*c+f)*4,P=n.color.light;if(h>=d&&f>=d&&h<c-d&&f<c-d){const S=Math.floor((h-d)/u),R=Math.floor((f-d)/u);P=p[a[S*s+R]?1:0]}e[N++]=P.r,e[N++]=P.g,e[N++]=P.b,e[N]=P.a}}})(mt)),mt}var Yt;function Re(){return Yt||(Yt=1,(function(r){const o=xt();function i(t,n,s){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=s,n.width=s,n.style.height=s+"px",n.style.width=s+"px"}function e(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(n,s,a){let u=a,c=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=e()),u=o.getOptions(u);const d=o.getImageWidth(n.modules.size,u),p=c.getContext("2d"),h=p.createImageData(d,d);return o.qrToImageData(h.data,n,u),i(p,c,d),p.putImageData(h,0,0),c},r.renderToDataURL=function(n,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=r.render(n,s,u),d=u.type||"image/png",p=u.rendererOpts||{};return c.toDataURL(d,p.quality)}})(ht)),ht}var wt={},Gt;function Te(){if(Gt)return wt;Gt=1;const r=xt();function o(t,n){const s=t.a/255,a=n+'="'+t.hex+'"';return s<1?a+" "+n+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function i(t,n,s){let a=t+n;return typeof s<"u"&&(a+=" "+s),a}function e(t,n,s){let a="",u=0,c=!1,d=0;for(let p=0;p<t.length;p++){const h=Math.floor(p%n),f=Math.floor(p/n);!h&&!c&&(c=!0),t[p]?(d++,p>0&&h>0&&t[p-1]||(a+=c?i("M",h+s,.5+f+s):i("m",u,0),u=0,c=!1),h+1<n&&t[p+1]||(a+=i("h",d),d=0)):u++}return a}return wt.render=function(n,s,a){const u=r.getOptions(s),c=n.modules.size,d=n.modules.data,p=c+u.margin*2,h=u.color.light.a?"<path "+o(u.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",f="<path "+o(u.color.dark,"stroke")+' d="'+e(d,c,u.margin)+'"/>',N='viewBox="0 0 '+p+" "+p+'"',S='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+N+' shape-rendering="crispEdges">'+h+f+`</svg>
8
- `;return typeof a=="function"&&a(null,S),S},wt}var Qt;function Ie(){if(Qt)return z;Qt=1;const r=ie(),o=Ae(),i=Re(),e=Te();function t(n,s,a,u,c){const d=[].slice.call(arguments,1),p=d.length,h=typeof d[p-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(p<2)throw new Error("Too few arguments provided");p===2?(c=a,a=s,s=u=void 0):p===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(a=s,s=u=void 0):p===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(f,N){try{const P=o.create(a,u);f(n(P,s,u))}catch(P){N(P)}})}try{const f=o.create(a,u);c(null,n(f,s,u))}catch(f){c(f)}}return z.create=o.create,z.toCanvas=t.bind(null,i.render),z.toDataURL=t.bind(null,i.renderToDataURL),z.toString=t.bind(null,function(n,s,a){return e.render(n,a)}),z}var $t=Ie();const Ne=re($t),Me=oe({__proto__:null,default:Ne},[$t]);export{Me as b};
7
+ `);const E=T(C,y,A),w=r.getSymbolSize(C),I=new e(w);return f(I,C),N(I),P(I,C),R(I,y,0),C>=7&&S(I,C),M(I,E),isNaN(l)&&(l=s.getBestMask(I,R.bind(null,I,y))),s.applyMask(l,I),R(I,y,l),{modules:I,version:C,errorCorrectionLevel:y,maskPattern:l,segments:A}}return $.create=function(C,y){if(typeof C>"u"||C==="")throw new Error("No input text");let l=o.M,A,m;return typeof y<"u"&&(l=o.from(y.errorCorrectionLevel,o.M),A=c.from(y.version),m=s.from(y.maskPattern),y.toSJISFunc&&r.setToSJISFunction(y.toSJISFunc)),b(C,A,l,m)},$}var ht={},mt={},jt;function Xt(){return jt||(jt=1,(function(r){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let e=i.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+i);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(n){return[n,n]}))),e.length===6&&e.push("F","F");const t=parseInt(e.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,s=e.scale||4;return{width:n,scale:n?4:s,margin:t,color:{dark:o(e.color.dark||"#000000ff"),light:o(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},r.getImageWidth=function(e,t){const n=r.getScale(e,t);return Math.floor((e+t.margin*2)*n)},r.qrToImageData=function(e,t,n){const s=t.modules.size,a=t.modules.data,u=r.getScale(s,n),c=Math.floor((s+n.margin*2)*u),d=n.margin*u,p=[n.color.light,n.color.dark];for(let h=0;h<c;h++)for(let f=0;f<c;f++){let N=(h*c+f)*4,P=n.color.light;if(h>=d&&f>=d&&h<c-d&&f<c-d){const S=Math.floor((h-d)/u),R=Math.floor((f-d)/u);P=p[a[S*s+R]?1:0]}e[N++]=P.r,e[N++]=P.g,e[N++]=P.b,e[N]=P.a}}})(mt)),mt}var Yt;function Re(){return Yt||(Yt=1,(function(r){const o=Xt();function i(t,n,s){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=s,n.width=s,n.style.height=s+"px",n.style.width=s+"px"}function e(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(n,s,a){let u=a,c=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=e()),u=o.getOptions(u);const d=o.getImageWidth(n.modules.size,u),p=c.getContext("2d"),h=p.createImageData(d,d);return o.qrToImageData(h.data,n,u),i(p,c,d),p.putImageData(h,0,0),c},r.renderToDataURL=function(n,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=r.render(n,s,u),d=u.type||"image/png",p=u.rendererOpts||{};return c.toDataURL(d,p.quality)}})(ht)),ht}var wt={},Gt;function Te(){if(Gt)return wt;Gt=1;const r=Xt();function o(t,n){const s=t.a/255,a=n+'="'+t.hex+'"';return s<1?a+" "+n+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function i(t,n,s){let a=t+n;return typeof s<"u"&&(a+=" "+s),a}function e(t,n,s){let a="",u=0,c=!1,d=0;for(let p=0;p<t.length;p++){const h=Math.floor(p%n),f=Math.floor(p/n);!h&&!c&&(c=!0),t[p]?(d++,p>0&&h>0&&t[p-1]||(a+=c?i("M",h+s,.5+f+s):i("m",u,0),u=0,c=!1),h+1<n&&t[p+1]||(a+=i("h",d),d=0)):u++}return a}return wt.render=function(n,s,a){const u=r.getOptions(s),c=n.modules.size,d=n.modules.data,p=c+u.margin*2,h=u.color.light.a?"<path "+o(u.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",f="<path "+o(u.color.dark,"stroke")+' d="'+e(d,c,u.margin)+'"/>',N='viewBox="0 0 '+p+" "+p+'"',S='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+N+' shape-rendering="crispEdges">'+h+f+`</svg>
8
+ `;return typeof a=="function"&&a(null,S),S},wt}var Qt;function Ie(){if(Qt)return z;Qt=1;const r=ie(),o=Ae(),i=Re(),e=Te();function t(n,s,a,u,c){const d=[].slice.call(arguments,1),p=d.length,h=typeof d[p-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(p<2)throw new Error("Too few arguments provided");p===2?(c=a,a=s,s=u=void 0):p===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(a=s,s=u=void 0):p===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(f,N){try{const P=o.create(a,u);f(n(P,s,u))}catch(P){N(P)}})}try{const f=o.create(a,u);c(null,n(f,s,u))}catch(f){c(f)}}return z.create=o.create,z.toCanvas=t.bind(null,i.render),z.toDataURL=t.bind(null,i.renderToDataURL),z.toString=t.bind(null,function(n,s,a){return e.render(n,a)}),z}var xt=Ie();const Ne=re(xt),Me=oe({__proto__:null,default:Ne},[xt]);export{Me as b};