@softistx/pulsarix-widget 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +32 -27
  2. package/dist/chunks/{abnfDiagram-XWFEHMT6.xef4vppv.js → abnfDiagram-XWFEHMT6.rxx9wyp3.js} +1 -1
  3. package/dist/chunks/architecture-WOLXFQ4H.hwrxbct0.js +1 -0
  4. package/dist/chunks/architectureDiagram-CSQXQB3N.mrm0pgc0.js +36 -0
  5. package/dist/chunks/{blockDiagram-BEDRHYPZ.wgdr8xfr.js → blockDiagram-BEDRHYPZ.f4dfpk7e.js} +11 -11
  6. package/dist/chunks/{c4Diagram-M2UUVUY5.t09pndbz.js → c4Diagram-M2UUVUY5.rz43j1my.js} +3 -3
  7. package/dist/chunks/{chat-markdown-CQ4fSIYN.cv3fprzq.js → chat-markdown-BSu4FB_l.xgn4yj83.js} +29 -29
  8. package/dist/chunks/{classDiagram-v2-KXABOMEV.9yfjtevj.js → classDiagram-v2-KXABOMEV.m96cfcad.js} +8 -8
  9. package/dist/chunks/cose-bilkent-JH36ORCC.zz2rwyw6.js +1 -0
  10. package/dist/chunks/cynefin-EF2NZ3EQ.y29bn1cz.js +1 -0
  11. package/dist/chunks/{cynefinDiagram-NJNITYFG.k6mhek0s.js → cynefinDiagram-NJNITYFG.az2k68wq.js} +1 -1
  12. package/dist/chunks/{dagre-KIHZ2IZ3.sqeg911s.js → dagre-KIHZ2IZ3.mgwg8bc4.js} +2 -2
  13. package/dist/chunks/{diagram-7YQZDPLS.k1qvmctj.js → diagram-7YQZDPLS.x8fg6705.js} +2 -2
  14. package/dist/chunks/{diagram-QBROCOUO.v7fe7e4g.js → diagram-QBROCOUO.db60dsss.js} +24 -24
  15. package/dist/chunks/{diagram-RJJCUUZO.12s15pm6.js → diagram-RJJCUUZO.a7e9w297.js} +4 -4
  16. package/dist/chunks/{diagram-WERXNKYE.tmrcv4we.js → diagram-WERXNKYE.a04f53kd.js} +2 -2
  17. package/dist/chunks/diagram-YHHI257C.v19jhmrh.js +3 -0
  18. package/dist/chunks/{diagram-YR4HJLHV.nytxr7pa.js → diagram-YR4HJLHV.c5e87gmw.js} +1 -1
  19. package/dist/chunks/{ebnfDiagram-N527522P.6eqw92nv.js → ebnfDiagram-N527522P.bjrxfgze.js} +1 -1
  20. package/dist/chunks/editor-shortcuts-dialog-Cz3T8435.5ve4nsaw.js +1 -0
  21. package/dist/chunks/editor.yak1qktd.js +4 -0
  22. package/dist/chunks/{elk-O5DQBFGD.a5rqryhg.js → elk-O5DQBFGD.1ydp0b7a.js} +13 -13
  23. package/dist/chunks/emoji-picker-00Bw2c2b.gzznrrz5.js +4 -0
  24. package/dist/chunks/{erDiagram-K3K3BIDK.exfeddaa.js → erDiagram-K3K3BIDK.g171ckq1.js} +8 -8
  25. package/dist/chunks/eventmodeling-K75KTNOO.46qfxqj7.js +1 -0
  26. package/dist/chunks/{flow-diagram-Byy7DBZZ.pf5vdbkn.js → flow-diagram-DGZOc1z1.3gbgbm5m.js} +6 -6
  27. package/dist/chunks/flowDiagram-Z6JWZHQI.f0eaj70g.js +1 -0
  28. package/dist/chunks/{ganttDiagram-3PRQTZWP.0tjaeqjw.js → ganttDiagram-3PRQTZWP.3b9dh4nr.js} +5 -5
  29. package/dist/chunks/gitGraph-VSP46ZUC.swware7n.js +1 -0
  30. package/dist/chunks/{gitGraphDiagram-VXDFKS5L.6vvbj88t.js → gitGraphDiagram-VXDFKS5L.thyp7vsd.js} +22 -22
  31. package/dist/chunks/{grid-E2QIVN74.frpdy6t3.js → grid-E2QIVN74.entqjpa3.js} +1 -1
  32. package/dist/chunks/illustration-BcaGDjvB.1q9xtmyq.js +1 -0
  33. package/dist/chunks/{index.3pn4wy4j.js → index.0g1t1pjx.js} +1 -1
  34. package/dist/chunks/{index.zjykrx6y.js → index.35d4zbh8.js} +4 -4
  35. package/dist/chunks/index.5fcbba6e.js +2 -0
  36. package/dist/chunks/{index.d8b8y928.js → index.6pzexww5.js} +10 -10
  37. package/dist/chunks/{index.mcyw2bze.js → index.8vaktk8x.js} +1 -1
  38. package/dist/chunks/{index.xrg5yg8d.js → index.8zg579vd.js} +2 -2
  39. package/dist/chunks/{index.sv013f1z.js → index.9n1y396a.js} +1 -1
  40. package/dist/chunks/{index.kh3f3gw8.js → index.a3njhfdd.js} +2 -2
  41. package/dist/chunks/{index.a6rz456z.js → index.cw97ff3b.js} +2 -2
  42. package/dist/chunks/{index.fv9af3wd.js → index.d57x7pg9.js} +6 -6
  43. package/dist/chunks/{index.0kv7tp87.js → index.g2ba0pke.js} +2 -2
  44. package/dist/chunks/index.h1xzvasx.js +2 -0
  45. package/dist/chunks/{index.93zpfh3k.js → index.qr6a02kx.js} +2 -2
  46. package/dist/chunks/index.rkgfxpm3.js +44 -0
  47. package/dist/chunks/index.sw8gvntb.js +2 -0
  48. package/dist/chunks/{index.7q6v461v.js → index.v02zf4zg.js} +2 -2
  49. package/dist/chunks/{index.f6jhkm5c.js → index.w1516g8q.js} +35 -35
  50. package/dist/chunks/{index.pyz71tqx.js → index.w4emtsqw.js} +2 -2
  51. package/dist/chunks/{index.nsckd1vt.js → index.yhmqh641.js} +2 -2
  52. package/dist/chunks/{index.nrd5w1x0.js → index.zkngte5k.js} +2 -2
  53. package/dist/chunks/{index.yfbwd99n.js → index.zkx4ryzt.js} +104 -104
  54. package/dist/chunks/info-OHQRW6UA.1er9b42t.js +1 -0
  55. package/dist/chunks/{infoDiagram-EZ3ZOAHP.qh2bwz3m.js → infoDiagram-EZ3ZOAHP.833fvq8n.js} +2 -2
  56. package/dist/chunks/{ishikawaDiagram-S3EKX5GW.w2v6vnwd.js → ishikawaDiagram-S3EKX5GW.q3evaw24.js} +5 -5
  57. package/dist/chunks/{journeyDiagram-POQNLL5X.ftkfdsrw.js → journeyDiagram-POQNLL5X.9werrmpy.js} +5 -5
  58. package/dist/chunks/{kanban-definition-BH5XI6FM.9scqhcx5.js → kanban-definition-BH5XI6FM.f3ssda0m.js} +7 -7
  59. package/dist/chunks/markup-color-chrome-ykGNUl8y.pcgw4znz.js +1 -0
  60. package/dist/chunks/markup-custom-color-MM-HnrqY.sygnt3gs.js +1 -0
  61. package/dist/chunks/mention-list-6cR5VSPa.x0x55xzp.js +1 -0
  62. package/dist/chunks/{mermaid.core.tnh468qk.js → mermaid.core.5cqab0cw.js} +7 -7
  63. package/dist/chunks/{mindmap-definition-WVAN44T4.gskntx1f.js → mindmap-definition-WVAN44T4.pjjxgse0.js} +6 -6
  64. package/dist/chunks/packet-JDAUHWVQ.t5jwb2rb.js +1 -0
  65. package/dist/chunks/panel.2vwd6k3h.js +7 -0
  66. package/dist/chunks/{pegDiagram-D4NLKWP3.yb58dpky.js → pegDiagram-D4NLKWP3.mdacgbzb.js} +1 -1
  67. package/dist/chunks/pie-XZMESJXO.pe88zesw.js +1 -0
  68. package/dist/chunks/pieDiagram-36ENHN4W.fb0d6a9w.js +39 -0
  69. package/dist/chunks/plated-illustration-pTqcYOQg.6b9fm4a7.js +1 -0
  70. package/dist/chunks/{quadrantDiagram-ZQUDMS73.1a721ces.js → quadrantDiagram-ZQUDMS73.m5cgqatg.js} +4 -4
  71. package/dist/chunks/radar-ABXABTNO.jtbddwfq.js +1 -0
  72. package/dist/chunks/railroad-I3PHUGI6.kvyt0f9s.js +1 -0
  73. package/dist/chunks/railroad-abnf-LNEFI6M7.ybx0vspg.js +1 -0
  74. package/dist/chunks/railroad-ebnf-DWYD2UWJ.yx4c4enn.js +1 -0
  75. package/dist/chunks/railroad-peg-JR7BVNR7.mb71eyqe.js +1 -0
  76. package/dist/chunks/{railroadDiagram-JIZHGYPL.xpgkt1zp.js → railroadDiagram-JIZHGYPL.w2e1k61e.js} +1 -1
  77. package/dist/chunks/{render-VIF2ZAQL.khtqjmgm.js → render-VIF2ZAQL.exs2rt60.js} +1 -1
  78. package/dist/chunks/{requirementDiagram-AXW2TVFA.ms6anxwg.js → requirementDiagram-AXW2TVFA.mrxb120d.js} +4 -4
  79. package/dist/chunks/{sankeyDiagram-FBCJTAIF.40yzed7d.js → sankeyDiagram-FBCJTAIF.csj5n1sg.js} +6 -6
  80. package/dist/chunks/{sequenceDiagram-3LA2ROMG.z0h3shw2.js → sequenceDiagram-3LA2ROMG.73qx1ab4.js} +11 -11
  81. package/dist/chunks/{sizeCapture-2Q2CQKSF.4dh5g271.js → sizeCapture-2Q2CQKSF.vfe8maj3.js} +1 -1
  82. package/dist/chunks/{stateDiagram-v2-ATKHQDJO.5ftcgs8s.js → stateDiagram-v2-ATKHQDJO.h4grfmy4.js} +8 -8
  83. package/dist/chunks/{swimlanes-YQL5WMAO.r6vmskrb.js → swimlanes-YQL5WMAO.e2y8jam1.js} +1 -1
  84. package/dist/chunks/swimlanesDiagram-UCCPES4V.dtthssd5.js +8 -0
  85. package/dist/chunks/{timeline-definition-7Z437IG3.eke70hfq.js → timeline-definition-7Z437IG3.2zxa6hz5.js} +9 -9
  86. package/dist/chunks/treeView-D4JQ5SDB.3kgztv30.js +1 -0
  87. package/dist/chunks/treemap-SAJKECNS.xj47e2ae.js +1 -0
  88. package/dist/chunks/{usecaseDiagram-RDK6N6HP.d8p4tnc6.js → usecaseDiagram-RDK6N6HP.61cdyktj.js} +57 -57
  89. package/dist/chunks/{vennDiagram-SHRQU5PJ.4s46abxd.js → vennDiagram-SHRQU5PJ.4tspw3rs.js} +7 -7
  90. package/dist/chunks/wardley-7MLQ67FV.pckbr6zr.js +1 -0
  91. package/dist/chunks/{wardleyDiagram-F3OXNVQS.mq49fny4.js → wardleyDiagram-F3OXNVQS.q2p8tshx.js} +4 -4
  92. package/dist/chunks/{xychartDiagram-GDYJKCDI.d7he0fxa.js → xychartDiagram-GDYJKCDI.69desp9j.js} +5 -5
  93. package/dist/index.js +48 -21
  94. package/dist/types/config.d.ts +1 -1
  95. package/dist/types/mount.d.ts +1 -1
  96. package/docs/integration.md +32 -26
  97. package/package.json +4 -4
  98. package/dist/chunks/architecture-WOLXFQ4H.pp4drcrh.js +0 -1
  99. package/dist/chunks/architectureDiagram-CSQXQB3N.0bddzt5e.js +0 -36
  100. package/dist/chunks/cose-bilkent-JH36ORCC.qam7r9b1.js +0 -1
  101. package/dist/chunks/cynefin-EF2NZ3EQ.wgr8qmb2.js +0 -1
  102. package/dist/chunks/diagram-YHHI257C.7735ve6v.js +0 -3
  103. package/dist/chunks/editor-shortcuts-dialog-VmvMTjnq.mm7ab69f.js +0 -1
  104. package/dist/chunks/editor.wb4jsrjy.js +0 -4
  105. package/dist/chunks/emoji-picker-bnO0yA8e.bymgjc9a.js +0 -4
  106. package/dist/chunks/eventmodeling-K75KTNOO.nkahp6zg.js +0 -1
  107. package/dist/chunks/flowDiagram-Z6JWZHQI.54yz6gfm.js +0 -1
  108. package/dist/chunks/gitGraph-VSP46ZUC.2a0am491.js +0 -1
  109. package/dist/chunks/illustration-BfueshiW.syv54ccw.js +0 -1
  110. package/dist/chunks/index.bs3ygyp2.js +0 -2
  111. package/dist/chunks/index.newjn1k4.js +0 -2
  112. package/dist/chunks/index.rn0vxns6.js +0 -44
  113. package/dist/chunks/index.yexf86bf.js +0 -2
  114. package/dist/chunks/info-OHQRW6UA.4824y3cd.js +0 -1
  115. package/dist/chunks/markup-color-chrome-ykGNUl8y.8cysjsfb.js +0 -1
  116. package/dist/chunks/markup-custom-color-CytmKw-R.d25j0pcj.js +0 -1
  117. package/dist/chunks/mention-list-5h2lZwEU.wffam6eb.js +0 -1
  118. package/dist/chunks/packet-JDAUHWVQ.w0pv2dxr.js +0 -1
  119. package/dist/chunks/panel.dq8vt40k.js +0 -7
  120. package/dist/chunks/pie-XZMESJXO.zq72f2fq.js +0 -1
  121. package/dist/chunks/pieDiagram-36ENHN4W.7pgn8ayz.js +0 -39
  122. package/dist/chunks/plated-illustration-VrnsTz7H.tcyq0sxa.js +0 -1
  123. package/dist/chunks/radar-ABXABTNO.288gs0b8.js +0 -1
  124. package/dist/chunks/railroad-I3PHUGI6.aadrd13j.js +0 -1
  125. package/dist/chunks/railroad-abnf-LNEFI6M7.6btgmncj.js +0 -1
  126. package/dist/chunks/railroad-ebnf-DWYD2UWJ.y44ppt8p.js +0 -1
  127. package/dist/chunks/railroad-peg-JR7BVNR7.328jgxkz.js +0 -1
  128. package/dist/chunks/swimlanesDiagram-UCCPES4V.exhrz16x.js +0 -8
  129. package/dist/chunks/treeView-D4JQ5SDB.xz61fh4x.js +0 -1
  130. package/dist/chunks/treemap-SAJKECNS.8gv7pmqr.js +0 -1
  131. package/dist/chunks/wardley-7MLQ67FV.6v9j3be8.js +0 -1
@@ -1,15 +1,15 @@
1
- import{e,ae,Qn,h,p,F,k,j,A,L,R,I,M,D,O,m,Y,K,g}from"./index.yfbwd99n.js";var fe=(t,s)=>Qn(t,"a",-s),St=fe;function kt(t,s){let i=de(t),n=i.filter((c)=>he(c,t)),r=0,o=0,a=[];if(n.length>1){let c=Wt(n);for(let f=0;f<n.length;++f){let l=n[f];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}n.sort((f,l)=>l.angle-f.angle);let d=n[n.length-1];for(let f=0;f<n.length;++f){let l=n[f];o+=(d.x+l.x)*(l.y-d.y);let S={x:(l.x+d.x)/2,y:(l.y+d.y)/2},y=null;for(let E=0;E<l.parentIndex.length;++E)if(d.parentIndex.includes(l.parentIndex[E])){let w=t[l.parentIndex[E]],N=Math.atan2(l.x-w.x,l.y-w.y),q=Math.atan2(d.x-w.x,d.y-w.y),V=q-N;if(V<0)V+=2*Math.PI;let P=q-V/2,b=ot(S,{x:w.x+w.radius*Math.sin(P),y:w.y+w.radius*Math.cos(P)});if(b>w.radius*2)b=w.radius*2;if(y==null||y.width>b)y={circle:w,width:b,p1:l,p2:d,large:b>w.radius,sweep:!0}}if(y!=null)a.push(y),r+=Et(y.circle.radius,y.width),d=l}}else{let c=t[0];for(let f=1;f<t.length;++f)if(t[f].radius<c.radius)c=t[f];let d=!1;for(let f=0;f<t.length;++f)if(ot(t[f],c)>Math.abs(c.radius-t[f].radius)){d=!0;break}if(d)r=o=0;else r=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-0.0000000001,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0})}if(o/=2,s)s.area=r+o,s.arcArea=r,s.polygonArea=o,s.arcs=a,s.innerPoints=n,s.intersectionPoints=i;return r+o}function he(t,s){return s.every((i)=>ot(t,i)<i.radius+0.0000000001)}function de(t){let s=[];for(let i=0;i<t.length;++i)for(let n=i+1;n<t.length;++n){let r=Gt(t[i],t[n]);for(let o of r)o.parentIndex=[i,n],s.push(o)}return s}function Et(t,s){return t*t*Math.acos(1-s/t)-(t-s)*Math.sqrt(s*(2*t-s))}function ot(t,s){return Math.sqrt((t.x-s.x)*(t.x-s.x)+(t.y-s.y)*(t.y-s.y))}function Rt(t,s,i){if(i>=t+s)return 0;if(i<=Math.abs(t-s))return Math.PI*Math.min(t,s)*Math.min(t,s);let n=t-(i*i-s*s+t*t)/(2*i),r=s-(i*i-t*t+s*s)/(2*i);return Et(t,n)+Et(s,r)}function Gt(t,s){let i=ot(t,s),n=t.radius,r=s.radius;if(i>=n+r||i<=Math.abs(n-r))return[];let o=(n*n-r*r+i*i)/(2*i),a=Math.sqrt(n*n-o*o),c=t.x+o*(s.x-t.x)/i,d=t.y+o*(s.y-t.y)/i,f=-(s.y-t.y)*(a/i),l=-(s.x-t.x)*(a/i);return[{x:c+f,y:d-l},{x:c-f,y:d+l}]}function Wt(t){let s={x:0,y:0};for(let i of t)s.x+=i.x,s.y+=i.y;return s.x/=t.length,s.y/=t.length,s}function ge(t,s,i,n){n=n||{};let r=n.maxIterations||100,o=n.tolerance||0.0000000001,a=t(s),c=t(i),d=i-s;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return s;if(c===0)return i;for(let f=0;f<r;++f){d/=2;let l=s+d,S=t(l);if(S*a>=0)s=l;if(Math.abs(d)<o||S===0)return l}return s+d}function Tt(t){let s=Array(t);for(let i=0;i<t;++i)s[i]=0;return s}function qt(t,s){return Tt(t).map(()=>Tt(s))}function pt(t,s){let i=0;for(let n=0;n<t.length;++n)i+=t[n]*s[n];return i}function zt(t){return Math.sqrt(pt(t,t))}function At(t,s,i){for(let n=0;n<s.length;++n)t[n]=s[n]*i}function gt(t,s,i,n,r){for(let o=0;o<t.length;++o)t[o]=s*i[o]+n*r[o]}function Kt(t,s,i){i=i||{};let n=i.maxIterations||s.length*200,r=i.nonZeroDelta||1.05,o=i.zeroDelta||0.001,a=i.minErrorDelta||0.000001,c=i.minErrorDelta||0.00001,d=i.rho!==void 0?i.rho:1,f=i.chi!==void 0?i.chi:2,l=i.psi!==void 0?i.psi:-0.5,S=i.sigma!==void 0?i.sigma:0.5,y,E=s.length,w=Array(E+1);w[0]=s,w[0].fx=t(s),w[0].id=0;for(let T=0;T<E;++T){let u=s.slice();u[T]=u[T]?u[T]*r:o,w[T+1]=u,w[T+1].fx=t(u),w[T+1].id=T+1}function N(T){for(let u=0;u<T.length;u++)w[E][u]=T[u];w[E].fx=T.fx}let q=(T,u)=>T.fx-u.fx,V=s.slice(),P=s.slice(),b=s.slice(),_=s.slice();for(let T=0;T<n;++T){if(w.sort(q),i.history){let v=w.map((x)=>{let W=x.slice();return W.fx=x.fx,W.id=x.id,W});v.sort((x,W)=>x.id-W.id),i.history.push({x:w[0].slice(),fx:w[0].fx,simplex:v})}y=0;for(let v=0;v<E;++v)y=Math.max(y,Math.abs(w[0][v]-w[1][v]));if(Math.abs(w[0].fx-w[E].fx)<a&&y<c)break;for(let v=0;v<E;++v){V[v]=0;for(let x=0;x<E;++x)V[v]+=w[x][v];V[v]/=E}let u=w[E];if(gt(P,1+d,V,-d,u),P.fx=t(P),P.fx<w[0].fx)if(gt(_,1+f,V,-f,u),_.fx=t(_),_.fx<P.fx)N(_);else N(P);else if(P.fx>=w[E-1].fx){let v=!1;if(P.fx>u.fx)if(gt(b,1+l,V,-l,u),b.fx=t(b),b.fx<u.fx)N(b);else v=!0;else if(gt(b,1-l*d,V,l*d,u),b.fx=t(b),b.fx<P.fx)N(b);else v=!0;if(v){if(S>=1)break;for(let x=1;x<w.length;++x)gt(w[x],1-S,w[0],S,w[x]),w[x].fx=t(w[x])}}else N(P)}return w.sort(q),{fx:w[0].fx,x:w[0]}}function xe(t,s,i,n,r,o,a){let c=i.fx,d=pt(i.fxprime,s),f=c,l=c,S=d,y=0;r=r||1,o=o||0.000001,a=a||0.1;function E(w,N,q){for(let V=0;V<16;++V)if(r=(w+N)/2,gt(n.x,1,i.x,r,s),f=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),f>c+o*r*d||f>=q)N=r;else{if(Math.abs(S)<=-a*d)return r;if(S*(N-w)>=0)N=w;w=r,q=f}return 0}for(let w=0;w<10;++w){if(gt(n.x,1,i.x,r,s),f=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),f>c+o*r*d||w&&f>=l)return E(y,r,l);if(Math.abs(S)<=-a*d)return r;if(S>=0)return E(r,y,f);l=f,y=r,r*=2}return r}function ye(t,s,i){let n={x:s.slice(),fx:0,fxprime:s.slice()},r={x:s.slice(),fx:0,fxprime:s.slice()},o=s.slice(),a,c,d=1,f;i=i||{},f=i.maxIterations||s.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),At(a,n.fxprime,-1);for(let l=0;l<f;++l){if(d=xe(t,a,n,r,d),i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:d});if(!d)At(a,n.fxprime,-1);else{gt(o,1,r.fxprime,-1,n.fxprime);let S=pt(n.fxprime,n.fxprime),y=Math.max(0,pt(o,r.fxprime)/S);gt(a,y,a,-1,r.fxprime),c=n,n=r,r=c}if(zt(n.fxprime)<=0.00001)break}if(i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:d});return n}function Ht(t,s={}){s.maxIterations=s.maxIterations||500;let i=s.initialLayout||ve,n=s.lossFunction||mt,r=pe(t,s),o=i(r,s),a=Object.keys(o),c=[];for(let l of a)c.push(o[l].x),c.push(o[l].y);let f=Kt((l)=>{let S={};for(let y=0;y<a.length;++y){let E=a[y];S[E]={x:l[2*y],y:l[2*y+1],radius:o[E].radius}}return n(S,r)},c,s).x;for(let l=0;l<a.length;++l){let S=a[l];o[S].x=f[2*l],o[S].y=f[2*l+1]}return o}var Yt=0.0000000001;function Ct(t,s,i){if(Math.min(t,s)*Math.min(t,s)*Math.PI<=i+Yt)return Math.abs(t-s);return ge((n)=>Rt(t,s,n)-i,0,t+s)}function pe(t,s={}){let i=s.distinct,n=t.map((c)=>Object.assign({},c));function r(c){return c.join(";")}if(i){let c=new Map;for(let d of n)for(let f=0;f<d.sets.length;f++){let l=String(d.sets[f]);c.set(l,d.size+(c.get(l)||0));for(let S=f+1;S<d.sets.length;S++){let y=String(d.sets[S]),E=`${l};${y}`,w=`${y};${l}`;c.set(E,d.size+(c.get(E)||0)),c.set(w,d.size+(c.get(w)||0))}}for(let d of n)if(d.sets.length<3)d.size=c.get(r(d.sets))}let o=[],a=new Set;for(let c of n)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){let d=c.sets[0],f=c.sets[1];a.add(r(c.sets)),a.add(r([f,d]))}o.sort((c,d)=>c===d?0:c<d?-1:1);for(let c=0;c<o.length;++c){let d=o[c];for(let f=c+1;f<o.length;++f){let l=o[f];if(!a.has(r([d,l])))n.push({sets:[d,l],size:0})}}return n}function me(t,s,i){let n=qt(s.length,s.length),r=qt(s.length,s.length);return t.filter((o)=>o.sets.length===2).forEach((o)=>{let a=i[o.sets[0]],c=i[o.sets[1]],d=Math.sqrt(s[a].size/Math.PI),f=Math.sqrt(s[c].size/Math.PI),l=Ct(d,f,o.size);n[a][c]=n[c][a]=l;let S=0;if(o.size+0.0000000001>=Math.min(s[a].size,s[c].size))S=1;else if(o.size<=0.0000000001)S=-1;r[a][c]=r[c][a]=S}),{distances:n,constraints:r}}function be(t,s,i,n){for(let o=0;o<s.length;++o)s[o]=0;let r=0;for(let o=0;o<i.length;++o){let a=t[2*o],c=t[2*o+1];for(let d=o+1;d<i.length;++d){let f=t[2*d],l=t[2*d+1],S=i[o][d],y=n[o][d],E=(f-a)*(f-a)+(l-c)*(l-c),w=Math.sqrt(E),N=E-S*S;if(y>0&&w<=S||y<0&&w>=S)continue;r+=2*N*N,s[2*o]+=4*N*(a-f),s[2*o+1]+=4*N*(c-l),s[2*d]+=4*N*(f-a),s[2*d+1]+=4*N*(l-c)}}return r}function ve(t,s={}){let i=Ie(t,s),n=s.lossFunction||mt;if(t.length>=8){let r=ke(t,s),o=n(r,t),a=n(i,t);if(o+0.00000001<a)i=r}return i}function ke(t,s={}){let i=s.restarts||10,n=[],r={};for(let y of t)if(y.sets.length===1)r[y.sets[0]]=n.length,n.push(y);let{distances:o,constraints:a}=me(t,n,r),c=zt(o.map(zt))/o.length;o=o.map((y)=>y.map((E)=>E/c));let d=(y,E)=>be(y,E,o,a),f=null;for(let y=0;y<i;++y){let E=Tt(o.length*2).map(Math.random),w=ye(d,E,s);if(!f||w.fx<f.fx)f=w}let l=f.x,S={};for(let y=0;y<n.length;++y){let E=n[y];S[E.sets[0]]={x:l[2*y]*c,y:l[2*y+1]*c,radius:Math.sqrt(E.size/Math.PI)}}if(s.history)for(let y of s.history)At(y.x,c);return S}function Ie(t,s){let i=s&&s.lossFunction?s.lossFunction:mt,n={},r={};for(let S of t)if(S.sets.length===1){let y=S.sets[0];n[y]={x:10000000000,y:10000000000,rowid:n.length,size:S.size,radius:Math.sqrt(S.size/Math.PI)},r[y]=[]}t=t.filter((S)=>S.sets.length===2);for(let S of t){let y=S.weight!=null?S.weight:1,E=S.sets[0],w=S.sets[1];if(S.size+Yt>=Math.min(n[E].size,n[w].size))y=0;r[E].push({set:w,size:S.size,weight:y}),r[w].push({set:E,size:S.size,weight:y})}let o=[];Object.keys(r).forEach((S)=>{let y=0;for(let E=0;E<r[S].length;++E)y+=r[S][E].size*r[S][E].weight;o.push({set:S,size:y})});function a(S,y){return y.size-S.size}o.sort(a);let c={};function d(S){return S.set in c}function f(S,y){n[y].x=S.x,n[y].y=S.y,c[y]=!0}f({x:0,y:0},o[0].set);for(let S=1;S<o.length;++S){let y=o[S].set,E=r[y].filter(d),w=n[y];if(E.sort(a),E.length===0)throw"ERROR: missing pairwise overlap information";let N=[];for(var l=0;l<E.length;++l){let P=n[E[l].set],b=Ct(w.radius,P.radius,E[l].size);N.push({x:P.x+b,y:P.y}),N.push({x:P.x-b,y:P.y}),N.push({y:P.y+b,x:P.x}),N.push({y:P.y-b,x:P.x});for(let _=l+1;_<E.length;++_){let T=n[E[_].set],u=Ct(w.radius,T.radius,E[_].size),v=Gt({x:P.x,y:P.y,radius:b},{x:T.x,y:T.y,radius:u});N.push(...v)}}let q=100000000000000000000000000000000000000000000000000,V=N[0];for(let P of N){n[y].x=P.x,n[y].y=P.y;let b=i(n,t);if(b<q)q=b,V=P}f(V,y)}return n}function mt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let a=t[n.sets[0]],c=t[n.sets[1]];r=Rt(a.radius,c.radius,ot(a,c))}else r=kt(n.sets.map((a)=>t[a]));let o=n.weight!=null?n.weight:1;i+=o*(r-n.size)*(r-n.size)}return i}function Xt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let c=t[n.sets[0]],d=t[n.sets[1]];r=Rt(c.radius,d.radius,ot(c,d))}else r=kt(n.sets.map((c)=>t[c]));let o=n.weight!=null?n.weight:1,a=Math.log((r+1)/(n.size+1));i+=o*a*a}return i}function Me(t,s,i){if(i==null)t.sort((r,o)=>o.radius-r.radius);else t.sort(i);if(t.length>0){let r=t[0].x,o=t[0].y;for(let a of t)a.x-=r,a.y-=o}if(t.length===2){if(ot(t[0],t[1])<Math.abs(t[1].radius-t[0].radius))t[1].x=t[0].x+t[0].radius-t[1].radius-0.0000000001,t[1].y=t[0].y}if(t.length>1){let r=Math.atan2(t[1].x,t[1].y)-s,o=Math.cos(r),a=Math.sin(r);for(let c of t){let{x:d,y:f}=c;c.x=o*d-a*f,c.y=a*d+o*f}}if(t.length>2){let r=Math.atan2(t[2].x,t[2].y)-s;while(r<0)r+=2*Math.PI;while(r>2*Math.PI)r-=2*Math.PI;if(r>Math.PI){let o=t[1].y/(0.0000000001+t[1].x);for(let a of t){var n=(a.x+o*a.y)/(1+o*o);a.x=2*n-a.x,a.y=2*n*o-a.y}}}}function Se(t){t.forEach((r)=>{r.parent=r});function s(r){if(r.parent!==r)r.parent=s(r.parent);return r.parent}function i(r,o){let a=s(r),c=s(o);a.parent=c}for(let r=0;r<t.length;++r)for(let o=r+1;o<t.length;++o){let a=t[r].radius+t[o].radius;if(ot(t[r],t[o])+0.0000000001<a)i(t[o],t[r])}let n=new Map;for(let r=0;r<t.length;++r){let o=s(t[r]).parent.setid;if(!n.has(o))n.set(o,[]);n.get(o).push(t[r])}return t.forEach((r)=>{delete r.parent}),Array.from(n.values())}function Dt(t){let s=(i)=>{let n=t.reduce((o,a)=>Math.max(o,a[i]+a.radius),Number.NEGATIVE_INFINITY),r=t.reduce((o,a)=>Math.min(o,a[i]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:r}};return{xRange:s("x"),yRange:s("y")}}function Zt(t,s,i){if(s==null)s=Math.PI/2;let n=$t(t).map((f)=>Object.assign({},f)),r=Se(n);for(let f of r){Me(f,s,i);let l=Dt(f);f.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),f.bounds=l}r.sort((f,l)=>l.size-f.size),n=r[0];let o=n.bounds,a=(o.xRange.max-o.xRange.min)/50;function c(f,l,S){if(!f)return;let y=f.bounds,E,w;if(l)E=o.xRange.max-y.xRange.min+a;else{E=o.xRange.max-y.xRange.max;let N=(y.xRange.max-y.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;if(N<0)E+=N}if(S)w=o.yRange.max-y.yRange.min+a;else{w=o.yRange.max-y.yRange.max;let N=(y.yRange.max-y.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;if(N<0)w+=N}for(let N of f)N.x+=E,N.y+=w,n.push(N)}let d=1;while(d<r.length)c(r[d],!0,!1),c(r[d+1],!1,!0),c(r[d+2],!0,!0),d+=3,o=Dt(n);return Qt(n)}function Jt(t,s,i,n,r){let o=$t(t);s-=2*n,i-=2*n;let{xRange:a,yRange:c}=Dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let d,f;if(r){let E=Math.sqrt(r/Math.PI)*2;d=s/E,f=i/E}else d=s/(a.max-a.min),f=i/(c.max-c.min);let l=Math.min(f,d),S=(s-(a.max-a.min)*l)/2,y=(i-(c.max-c.min)*l)/2;return Qt(o.map((E)=>({radius:l*E.radius,x:n+S+(E.x-a.min)*l,y:n+y+(E.y-c.min)*l,setid:E.setid})))}function Qt(t){let s={};for(let i of t)s[i.setid]=i;return s}function $t(t){return Object.keys(t).map((i)=>Object.assign(t[i],{setid:i}))}function te(t={}){let s=!1,i=600,n=350,r=15,o=1000,a=Math.PI/2,c=!0,d=null,f=!0,l=!0,S=null,y=null,E=!1,w=null,N=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,q={},V=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],P=0,b=function(v){if(v in q)return q[v];var x=q[v]=V[P];if(P+=1,P>=V.length)P=0;return x},_=Ht,T=mt;function u(v){let x=v.datum(),W=new Set;x.forEach((z)=>{if(z.size==0&&z.sets.length==1)W.add(z.sets[0])}),x=x.filter((z)=>!z.sets.some((J)=>W.has(J)));let C={},H={};if(x.length>0){let z=_(x,{lossFunction:T,distinct:E});if(c)z=Zt(z,a,y);C=Jt(z,i,n,r,d),H=ne(C,x,N)}let at={};x.forEach((z)=>{if(z.label)at[z.sets]=z.label});function nt(z){if(z.sets in at)return at[z.sets];if(z.sets.length==1)return""+z.sets[0]}v.selectAll("svg").data([C]).enter().append("svg");let Z=v.select("svg");if(s)Z.attr("viewBox",`0 0 ${i} ${n}`);else Z.attr("width",i).attr("height",n);let G={},X=!1;Z.selectAll(".venn-area path").each(function(z){let J=this.getAttribute("d");if(z.sets.length==1&&J&&!E)X=!0,G[z.sets[0]]=Ee(J)});function B(z){return(J)=>{let yt=z.sets.map((dt)=>{let ht=G[dt],rt=C[dt];if(!ht)ht={x:i/2,y:n/2,radius:1};if(!rt)rt={x:i/2,y:n/2,radius:1};return{x:ht.x*(1-J)+rt.x*J,y:ht.y*(1-J)+rt.y*J,radius:ht.radius*(1-J)+rt.radius*J}});return Ut(yt,w)}}let Q=Z.selectAll(".venn-area").data(x,(z)=>z.sets),st=Q.enter().append("g").attr("class",(z)=>`venn-area venn-${z.sets.length==1?"circle":"intersection"}${z.colour||z.color?" venn-coloured":""}`).attr("data-venn-sets",(z)=>z.sets.join("_")),tt=st.append("path"),lt=st.append("text").attr("class","label").text((z)=>nt(z)).attr("text-anchor","middle").attr("dy",".35em").attr("x",i/2).attr("y",n/2);if(l)tt.style("fill-opacity","0").filter((z)=>z.sets.length==1).style("fill",(z)=>z.colour?z.colour:z.color?z.color:b(z.sets)).style("fill-opacity",".25"),lt.style("fill",(z)=>{if(z.colour||z.color)return"#FFF";if(t.textFill)return t.textFill;return z.sets.length==1?b(z.sets):"#444"});function it(z){if(typeof z.transition==="function")return z.transition("venn").duration(o);return z}let et=v;if(X&&typeof et.transition==="function")et=it(v),et.selectAll("path").attrTween("d",B);else et.selectAll("path").attr("d",(z)=>Ut(z.sets.map((J)=>C[J])),w);let U=et.selectAll("text").filter((z)=>(z.sets in H)).text((z)=>nt(z)).attr("x",(z)=>Math.floor(H[z.sets].x)).attr("y",(z)=>Math.floor(H[z.sets].y));if(f)if(X)if("on"in U)U.on("end",wt(C,nt));else U.each("end",wt(C,nt));else U.each(wt(C,nt));let ft=it(Q.exit()).remove();if(typeof Q.transition==="function")ft.selectAll("path").attrTween("d",B);let ut=ft.selectAll("text").attr("x",i/2).attr("y",n/2);if(S!==null)lt.style("font-size","0px"),U.style("font-size",S),ut.style("font-size","0px");return{circles:C,textCentres:H,nodes:Q,enter:st,update:et,exit:ft}}return u.wrap=function(v){if(!arguments.length)return f;return f=v,u},u.useViewBox=function(){return s=!0,u},u.width=function(v){if(!arguments.length)return i;return i=v,u},u.height=function(v){if(!arguments.length)return n;return n=v,u},u.padding=function(v){if(!arguments.length)return r;return r=v,u},u.distinct=function(v){if(!arguments.length)return E;return E=v,u},u.colours=function(v){if(!arguments.length)return b;return b=v,u},u.colors=function(v){if(!arguments.length)return b;return b=v,u},u.fontSize=function(v){if(!arguments.length)return S;return S=v,u},u.round=function(v){if(!arguments.length)return w;return w=v,u},u.duration=function(v){if(!arguments.length)return o;return o=v,u},u.layoutFunction=function(v){if(!arguments.length)return _;return _=v,u},u.normalize=function(v){if(!arguments.length)return c;return c=v,u},u.scaleToFit=function(v){if(!arguments.length)return d;return d=v,u},u.styled=function(v){if(!arguments.length)return l;return l=v,u},u.orientation=function(v){if(!arguments.length)return a;return a=v,u},u.orientationOrder=function(v){if(!arguments.length)return y;return y=v,u},u.lossFunction=function(v){if(!arguments.length)return T;return T=v==="default"?mt:v==="logRatio"?Xt:v,u},u}function wt(t,s){return function(i){let n=this,r=t[i.sets[0]].radius||50,o=s(i)||"",a=o.split(/\s+/).reverse(),c=3,d=(o.length+a.length)/3,f=a.pop(),l=[f],S=0,y=1.1;n.textContent=null;let E=[];function w(b){let _=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return _.textContent=b,E.push(_),n.append(_),_}let N=w(f);while(!0){if(f=a.pop(),!f)break;l.push(f);let b=l.join(" ");if(N.textContent=b,b.length>d&&N.getComputedTextLength()>r)l.pop(),N.textContent=l.join(" "),l=[f],N=w(f),S++}let q=0.35-S*y/2,V=n.getAttribute("x"),P=n.getAttribute("y");E.forEach((b,_)=>{b.setAttribute("x",V),b.setAttribute("y",P),b.setAttribute("dy",`${q+_*y}em`)})}}function _t(t,s,i){let n=s[0].radius-ot(s[0],t);for(let r=1;r<s.length;++r){let o=s[r].radius-ot(s[r],t);if(o<=n)n=o}for(let r=0;r<i.length;++r){let o=ot(i[r],t)-i[r].radius;if(o<=n)n=o}return n}function ee(t,s,i){let n=[];for(let l of t)n.push({x:l.x,y:l.y}),n.push({x:l.x+l.radius/2,y:l.y}),n.push({x:l.x-l.radius/2,y:l.y}),n.push({x:l.x,y:l.y+l.radius/2}),n.push({x:l.x,y:l.y-l.radius/2});let r=n[0],o=_t(n[0],t,s);for(let l=1;l<n.length;++l){let S=_t(n[l],t,s);if(S>=o)r=n[l],o=S}let a=Kt((l)=>-1*_t({x:l[0],y:l[1]},t,s),[r.x,r.y],{maxIterations:500,minErrorDelta:0.0000000001}).x,c={x:i?0:a[0],y:a[1]},d=!0;for(let l of t)if(ot(c,l)>l.radius){d=!1;break}for(let l of s)if(ot(c,l)<l.radius){d=!1;break}if(d)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};let f={};if(kt(t,f),f.arcs.length===0)return{x:0,y:-1000,disjoint:!0};if(f.arcs.length==1)return{x:f.arcs[0].circle.x,y:f.arcs[0].circle.y};if(s.length)return ee(t,[]);return Wt(f.arcs.map((l)=>l.p1))}function we(t){let s={},i=Object.keys(t);for(let n of i)s[n]=[];for(let n=0;n<i.length;n++){let r=i[n],o=t[r];for(let a=n+1;a<i.length;++a){let c=i[a],d=t[c],f=ot(o,d);if(f+d.radius<=o.radius+0.0000000001)s[c].push(r);else if(f+o.radius<=d.radius+0.0000000001)s[r].push(c)}}return s}function ne(t,s,i){let n={},r=we(t);for(let o=0;o<s.length;++o){let a=s[o].sets,c={},d={};for(let y=0;y<a.length;++y){c[a[y]]=!0;let E=r[a[y]];for(let w=0;w<E.length;++w)d[E[w]]=!0}let f=[],l=[];for(let y in t)if(y in c)f.push(t[y]);else if(!(y in d))l.push(t[y]);let S=ee(f,l,i);if(n[a]=S,S.disjoint&&s[o].size>0)console.log("WARNING: area "+a+" not represented on screen")}return n}function _e(t,s,i){let n=[];return n.push(`
1
+ import{e,ne,Qn,f,h,B,k,j,A,L,R,I,M,P,O,p,X,Y,m}from"./index.zkx4ryzt.js";var fe=(t,s)=>Qn(t,"a",-s),St=fe;function kt(t,s){let i=de(t),n=i.filter((c)=>he(c,t)),r=0,o=0,a=[];if(n.length>1){let c=Wt(n);for(let d=0;d<n.length;++d){let l=n[d];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}n.sort((d,l)=>l.angle-d.angle);let g=n[n.length-1];for(let d=0;d<n.length;++d){let l=n[d];o+=(g.x+l.x)*(l.y-g.y);let S={x:(l.x+g.x)/2,y:(l.y+g.y)/2},y=null;for(let E=0;E<l.parentIndex.length;++E)if(g.parentIndex.includes(l.parentIndex[E])){let w=t[l.parentIndex[E]],D=Math.atan2(l.x-w.x,l.y-w.y),q=Math.atan2(g.x-w.x,g.y-w.y),F=q-D;if(F<0)F+=2*Math.PI;let N=q-F/2,b=ot(S,{x:w.x+w.radius*Math.sin(N),y:w.y+w.radius*Math.cos(N)});if(b>w.radius*2)b=w.radius*2;if(y==null||y.width>b)y={circle:w,width:b,p1:l,p2:g,large:b>w.radius,sweep:!0}}if(y!=null)a.push(y),r+=Et(y.circle.radius,y.width),g=l}}else{let c=t[0];for(let d=1;d<t.length;++d)if(t[d].radius<c.radius)c=t[d];let g=!1;for(let d=0;d<t.length;++d)if(ot(t[d],c)>Math.abs(c.radius-t[d].radius)){g=!0;break}if(g)r=o=0;else r=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-0.0000000001,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0})}if(o/=2,s)s.area=r+o,s.arcArea=r,s.polygonArea=o,s.arcs=a,s.innerPoints=n,s.intersectionPoints=i;return r+o}function he(t,s){return s.every((i)=>ot(t,i)<i.radius+0.0000000001)}function de(t){let s=[];for(let i=0;i<t.length;++i)for(let n=i+1;n<t.length;++n){let r=Gt(t[i],t[n]);for(let o of r)o.parentIndex=[i,n],s.push(o)}return s}function Et(t,s){return t*t*Math.acos(1-s/t)-(t-s)*Math.sqrt(s*(2*t-s))}function ot(t,s){return Math.sqrt((t.x-s.x)*(t.x-s.x)+(t.y-s.y)*(t.y-s.y))}function Rt(t,s,i){if(i>=t+s)return 0;if(i<=Math.abs(t-s))return Math.PI*Math.min(t,s)*Math.min(t,s);let n=t-(i*i-s*s+t*t)/(2*i),r=s-(i*i-t*t+s*s)/(2*i);return Et(t,n)+Et(s,r)}function Gt(t,s){let i=ot(t,s),n=t.radius,r=s.radius;if(i>=n+r||i<=Math.abs(n-r))return[];let o=(n*n-r*r+i*i)/(2*i),a=Math.sqrt(n*n-o*o),c=t.x+o*(s.x-t.x)/i,g=t.y+o*(s.y-t.y)/i,d=-(s.y-t.y)*(a/i),l=-(s.x-t.x)*(a/i);return[{x:c+d,y:g-l},{x:c-d,y:g+l}]}function Wt(t){let s={x:0,y:0};for(let i of t)s.x+=i.x,s.y+=i.y;return s.x/=t.length,s.y/=t.length,s}function ge(t,s,i,n){n=n||{};let r=n.maxIterations||100,o=n.tolerance||0.0000000001,a=t(s),c=t(i),g=i-s;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return s;if(c===0)return i;for(let d=0;d<r;++d){g/=2;let l=s+g,S=t(l);if(S*a>=0)s=l;if(Math.abs(g)<o||S===0)return l}return s+g}function Tt(t){let s=Array(t);for(let i=0;i<t;++i)s[i]=0;return s}function qt(t,s){return Tt(t).map(()=>Tt(s))}function pt(t,s){let i=0;for(let n=0;n<t.length;++n)i+=t[n]*s[n];return i}function zt(t){return Math.sqrt(pt(t,t))}function At(t,s,i){for(let n=0;n<s.length;++n)t[n]=s[n]*i}function gt(t,s,i,n,r){for(let o=0;o<t.length;++o)t[o]=s*i[o]+n*r[o]}function Kt(t,s,i){i=i||{};let n=i.maxIterations||s.length*200,r=i.nonZeroDelta||1.05,o=i.zeroDelta||0.001,a=i.minErrorDelta||0.000001,c=i.minErrorDelta||0.00001,g=i.rho!==void 0?i.rho:1,d=i.chi!==void 0?i.chi:2,l=i.psi!==void 0?i.psi:-0.5,S=i.sigma!==void 0?i.sigma:0.5,y,E=s.length,w=Array(E+1);w[0]=s,w[0].fx=t(s),w[0].id=0;for(let T=0;T<E;++T){let u=s.slice();u[T]=u[T]?u[T]*r:o,w[T+1]=u,w[T+1].fx=t(u),w[T+1].id=T+1}function D(T){for(let u=0;u<T.length;u++)w[E][u]=T[u];w[E].fx=T.fx}let q=(T,u)=>T.fx-u.fx,F=s.slice(),N=s.slice(),b=s.slice(),_=s.slice();for(let T=0;T<n;++T){if(w.sort(q),i.history){let v=w.map((x)=>{let W=x.slice();return W.fx=x.fx,W.id=x.id,W});v.sort((x,W)=>x.id-W.id),i.history.push({x:w[0].slice(),fx:w[0].fx,simplex:v})}y=0;for(let v=0;v<E;++v)y=Math.max(y,Math.abs(w[0][v]-w[1][v]));if(Math.abs(w[0].fx-w[E].fx)<a&&y<c)break;for(let v=0;v<E;++v){F[v]=0;for(let x=0;x<E;++x)F[v]+=w[x][v];F[v]/=E}let u=w[E];if(gt(N,1+g,F,-g,u),N.fx=t(N),N.fx<w[0].fx)if(gt(_,1+d,F,-d,u),_.fx=t(_),_.fx<N.fx)D(_);else D(N);else if(N.fx>=w[E-1].fx){let v=!1;if(N.fx>u.fx)if(gt(b,1+l,F,-l,u),b.fx=t(b),b.fx<u.fx)D(b);else v=!0;else if(gt(b,1-l*g,F,l*g,u),b.fx=t(b),b.fx<N.fx)D(b);else v=!0;if(v){if(S>=1)break;for(let x=1;x<w.length;++x)gt(w[x],1-S,w[0],S,w[x]),w[x].fx=t(w[x])}}else D(N)}return w.sort(q),{fx:w[0].fx,x:w[0]}}function xe(t,s,i,n,r,o,a){let c=i.fx,g=pt(i.fxprime,s),d=c,l=c,S=g,y=0;r=r||1,o=o||0.000001,a=a||0.1;function E(w,D,q){for(let F=0;F<16;++F)if(r=(w+D)/2,gt(n.x,1,i.x,r,s),d=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),d>c+o*r*g||d>=q)D=r;else{if(Math.abs(S)<=-a*g)return r;if(S*(D-w)>=0)D=w;w=r,q=d}return 0}for(let w=0;w<10;++w){if(gt(n.x,1,i.x,r,s),d=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),d>c+o*r*g||w&&d>=l)return E(y,r,l);if(Math.abs(S)<=-a*g)return r;if(S>=0)return E(r,y,d);l=d,y=r,r*=2}return r}function ye(t,s,i){let n={x:s.slice(),fx:0,fxprime:s.slice()},r={x:s.slice(),fx:0,fxprime:s.slice()},o=s.slice(),a,c,g=1,d;i=i||{},d=i.maxIterations||s.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),At(a,n.fxprime,-1);for(let l=0;l<d;++l){if(g=xe(t,a,n,r,g),i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:g});if(!g)At(a,n.fxprime,-1);else{gt(o,1,r.fxprime,-1,n.fxprime);let S=pt(n.fxprime,n.fxprime),y=Math.max(0,pt(o,r.fxprime)/S);gt(a,y,a,-1,r.fxprime),c=n,n=r,r=c}if(zt(n.fxprime)<=0.00001)break}if(i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:g});return n}function Ht(t,s={}){s.maxIterations=s.maxIterations||500;let i=s.initialLayout||ve,n=s.lossFunction||mt,r=pe(t,s),o=i(r,s),a=Object.keys(o),c=[];for(let l of a)c.push(o[l].x),c.push(o[l].y);let d=Kt((l)=>{let S={};for(let y=0;y<a.length;++y){let E=a[y];S[E]={x:l[2*y],y:l[2*y+1],radius:o[E].radius}}return n(S,r)},c,s).x;for(let l=0;l<a.length;++l){let S=a[l];o[S].x=d[2*l],o[S].y=d[2*l+1]}return o}var Yt=0.0000000001;function Ct(t,s,i){if(Math.min(t,s)*Math.min(t,s)*Math.PI<=i+Yt)return Math.abs(t-s);return ge((n)=>Rt(t,s,n)-i,0,t+s)}function pe(t,s={}){let i=s.distinct,n=t.map((c)=>Object.assign({},c));function r(c){return c.join(";")}if(i){let c=new Map;for(let g of n)for(let d=0;d<g.sets.length;d++){let l=String(g.sets[d]);c.set(l,g.size+(c.get(l)||0));for(let S=d+1;S<g.sets.length;S++){let y=String(g.sets[S]),E=`${l};${y}`,w=`${y};${l}`;c.set(E,g.size+(c.get(E)||0)),c.set(w,g.size+(c.get(w)||0))}}for(let g of n)if(g.sets.length<3)g.size=c.get(r(g.sets))}let o=[],a=new Set;for(let c of n)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){let g=c.sets[0],d=c.sets[1];a.add(r(c.sets)),a.add(r([d,g]))}o.sort((c,g)=>c===g?0:c<g?-1:1);for(let c=0;c<o.length;++c){let g=o[c];for(let d=c+1;d<o.length;++d){let l=o[d];if(!a.has(r([g,l])))n.push({sets:[g,l],size:0})}}return n}function me(t,s,i){let n=qt(s.length,s.length),r=qt(s.length,s.length);return t.filter((o)=>o.sets.length===2).forEach((o)=>{let a=i[o.sets[0]],c=i[o.sets[1]],g=Math.sqrt(s[a].size/Math.PI),d=Math.sqrt(s[c].size/Math.PI),l=Ct(g,d,o.size);n[a][c]=n[c][a]=l;let S=0;if(o.size+0.0000000001>=Math.min(s[a].size,s[c].size))S=1;else if(o.size<=0.0000000001)S=-1;r[a][c]=r[c][a]=S}),{distances:n,constraints:r}}function be(t,s,i,n){for(let o=0;o<s.length;++o)s[o]=0;let r=0;for(let o=0;o<i.length;++o){let a=t[2*o],c=t[2*o+1];for(let g=o+1;g<i.length;++g){let d=t[2*g],l=t[2*g+1],S=i[o][g],y=n[o][g],E=(d-a)*(d-a)+(l-c)*(l-c),w=Math.sqrt(E),D=E-S*S;if(y>0&&w<=S||y<0&&w>=S)continue;r+=2*D*D,s[2*o]+=4*D*(a-d),s[2*o+1]+=4*D*(c-l),s[2*g]+=4*D*(d-a),s[2*g+1]+=4*D*(l-c)}}return r}function ve(t,s={}){let i=Ie(t,s),n=s.lossFunction||mt;if(t.length>=8){let r=ke(t,s),o=n(r,t),a=n(i,t);if(o+0.00000001<a)i=r}return i}function ke(t,s={}){let i=s.restarts||10,n=[],r={};for(let y of t)if(y.sets.length===1)r[y.sets[0]]=n.length,n.push(y);let{distances:o,constraints:a}=me(t,n,r),c=zt(o.map(zt))/o.length;o=o.map((y)=>y.map((E)=>E/c));let g=(y,E)=>be(y,E,o,a),d=null;for(let y=0;y<i;++y){let E=Tt(o.length*2).map(Math.random),w=ye(g,E,s);if(!d||w.fx<d.fx)d=w}let l=d.x,S={};for(let y=0;y<n.length;++y){let E=n[y];S[E.sets[0]]={x:l[2*y]*c,y:l[2*y+1]*c,radius:Math.sqrt(E.size/Math.PI)}}if(s.history)for(let y of s.history)At(y.x,c);return S}function Ie(t,s){let i=s&&s.lossFunction?s.lossFunction:mt,n={},r={};for(let S of t)if(S.sets.length===1){let y=S.sets[0];n[y]={x:10000000000,y:10000000000,rowid:n.length,size:S.size,radius:Math.sqrt(S.size/Math.PI)},r[y]=[]}t=t.filter((S)=>S.sets.length===2);for(let S of t){let y=S.weight!=null?S.weight:1,E=S.sets[0],w=S.sets[1];if(S.size+Yt>=Math.min(n[E].size,n[w].size))y=0;r[E].push({set:w,size:S.size,weight:y}),r[w].push({set:E,size:S.size,weight:y})}let o=[];Object.keys(r).forEach((S)=>{let y=0;for(let E=0;E<r[S].length;++E)y+=r[S][E].size*r[S][E].weight;o.push({set:S,size:y})});function a(S,y){return y.size-S.size}o.sort(a);let c={};function g(S){return S.set in c}function d(S,y){n[y].x=S.x,n[y].y=S.y,c[y]=!0}d({x:0,y:0},o[0].set);for(let S=1;S<o.length;++S){let y=o[S].set,E=r[y].filter(g),w=n[y];if(E.sort(a),E.length===0)throw"ERROR: missing pairwise overlap information";let D=[];for(var l=0;l<E.length;++l){let N=n[E[l].set],b=Ct(w.radius,N.radius,E[l].size);D.push({x:N.x+b,y:N.y}),D.push({x:N.x-b,y:N.y}),D.push({y:N.y+b,x:N.x}),D.push({y:N.y-b,x:N.x});for(let _=l+1;_<E.length;++_){let T=n[E[_].set],u=Ct(w.radius,T.radius,E[_].size),v=Gt({x:N.x,y:N.y,radius:b},{x:T.x,y:T.y,radius:u});D.push(...v)}}let q=100000000000000000000000000000000000000000000000000,F=D[0];for(let N of D){n[y].x=N.x,n[y].y=N.y;let b=i(n,t);if(b<q)q=b,F=N}d(F,y)}return n}function mt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let a=t[n.sets[0]],c=t[n.sets[1]];r=Rt(a.radius,c.radius,ot(a,c))}else r=kt(n.sets.map((a)=>t[a]));let o=n.weight!=null?n.weight:1;i+=o*(r-n.size)*(r-n.size)}return i}function Xt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let c=t[n.sets[0]],g=t[n.sets[1]];r=Rt(c.radius,g.radius,ot(c,g))}else r=kt(n.sets.map((c)=>t[c]));let o=n.weight!=null?n.weight:1,a=Math.log((r+1)/(n.size+1));i+=o*a*a}return i}function Me(t,s,i){if(i==null)t.sort((r,o)=>o.radius-r.radius);else t.sort(i);if(t.length>0){let r=t[0].x,o=t[0].y;for(let a of t)a.x-=r,a.y-=o}if(t.length===2){if(ot(t[0],t[1])<Math.abs(t[1].radius-t[0].radius))t[1].x=t[0].x+t[0].radius-t[1].radius-0.0000000001,t[1].y=t[0].y}if(t.length>1){let r=Math.atan2(t[1].x,t[1].y)-s,o=Math.cos(r),a=Math.sin(r);for(let c of t){let{x:g,y:d}=c;c.x=o*g-a*d,c.y=a*g+o*d}}if(t.length>2){let r=Math.atan2(t[2].x,t[2].y)-s;while(r<0)r+=2*Math.PI;while(r>2*Math.PI)r-=2*Math.PI;if(r>Math.PI){let o=t[1].y/(0.0000000001+t[1].x);for(let a of t){var n=(a.x+o*a.y)/(1+o*o);a.x=2*n-a.x,a.y=2*n*o-a.y}}}}function Se(t){t.forEach((r)=>{r.parent=r});function s(r){if(r.parent!==r)r.parent=s(r.parent);return r.parent}function i(r,o){let a=s(r),c=s(o);a.parent=c}for(let r=0;r<t.length;++r)for(let o=r+1;o<t.length;++o){let a=t[r].radius+t[o].radius;if(ot(t[r],t[o])+0.0000000001<a)i(t[o],t[r])}let n=new Map;for(let r=0;r<t.length;++r){let o=s(t[r]).parent.setid;if(!n.has(o))n.set(o,[]);n.get(o).push(t[r])}return t.forEach((r)=>{delete r.parent}),Array.from(n.values())}function Dt(t){let s=(i)=>{let n=t.reduce((o,a)=>Math.max(o,a[i]+a.radius),Number.NEGATIVE_INFINITY),r=t.reduce((o,a)=>Math.min(o,a[i]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:r}};return{xRange:s("x"),yRange:s("y")}}function Zt(t,s,i){if(s==null)s=Math.PI/2;let n=$t(t).map((d)=>Object.assign({},d)),r=Se(n);for(let d of r){Me(d,s,i);let l=Dt(d);d.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),d.bounds=l}r.sort((d,l)=>l.size-d.size),n=r[0];let o=n.bounds,a=(o.xRange.max-o.xRange.min)/50;function c(d,l,S){if(!d)return;let y=d.bounds,E,w;if(l)E=o.xRange.max-y.xRange.min+a;else{E=o.xRange.max-y.xRange.max;let D=(y.xRange.max-y.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;if(D<0)E+=D}if(S)w=o.yRange.max-y.yRange.min+a;else{w=o.yRange.max-y.yRange.max;let D=(y.yRange.max-y.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;if(D<0)w+=D}for(let D of d)D.x+=E,D.y+=w,n.push(D)}let g=1;while(g<r.length)c(r[g],!0,!1),c(r[g+1],!1,!0),c(r[g+2],!0,!0),g+=3,o=Dt(n);return Qt(n)}function Jt(t,s,i,n,r){let o=$t(t);s-=2*n,i-=2*n;let{xRange:a,yRange:c}=Dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let g,d;if(r){let E=Math.sqrt(r/Math.PI)*2;g=s/E,d=i/E}else g=s/(a.max-a.min),d=i/(c.max-c.min);let l=Math.min(d,g),S=(s-(a.max-a.min)*l)/2,y=(i-(c.max-c.min)*l)/2;return Qt(o.map((E)=>({radius:l*E.radius,x:n+S+(E.x-a.min)*l,y:n+y+(E.y-c.min)*l,setid:E.setid})))}function Qt(t){let s={};for(let i of t)s[i.setid]=i;return s}function $t(t){return Object.keys(t).map((i)=>Object.assign(t[i],{setid:i}))}function te(t={}){let s=!1,i=600,n=350,r=15,o=1000,a=Math.PI/2,c=!0,g=null,d=!0,l=!0,S=null,y=null,E=!1,w=null,D=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,q={},F=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],N=0,b=function(v){if(v in q)return q[v];var x=q[v]=F[N];if(N+=1,N>=F.length)N=0;return x},_=Ht,T=mt;function u(v){let x=v.datum(),W=new Set;x.forEach((z)=>{if(z.size==0&&z.sets.length==1)W.add(z.sets[0])}),x=x.filter((z)=>!z.sets.some((J)=>W.has(J)));let C={},K={};if(x.length>0){let z=_(x,{lossFunction:T,distinct:E});if(c)z=Zt(z,a,y);C=Jt(z,i,n,r,g),K=se(C,x,D)}let at={};x.forEach((z)=>{if(z.label)at[z.sets]=z.label});function nt(z){if(z.sets in at)return at[z.sets];if(z.sets.length==1)return""+z.sets[0]}v.selectAll("svg").data([C]).enter().append("svg");let Z=v.select("svg");if(s)Z.attr("viewBox",`0 0 ${i} ${n}`);else Z.attr("width",i).attr("height",n);let G={},H=!1;Z.selectAll(".venn-area path").each(function(z){let J=this.getAttribute("d");if(z.sets.length==1&&J&&!E)H=!0,G[z.sets[0]]=Ee(J)});function V(z){return(J)=>{let yt=z.sets.map((dt)=>{let ht=G[dt],rt=C[dt];if(!ht)ht={x:i/2,y:n/2,radius:1};if(!rt)rt={x:i/2,y:n/2,radius:1};return{x:ht.x*(1-J)+rt.x*J,y:ht.y*(1-J)+rt.y*J,radius:ht.radius*(1-J)+rt.radius*J}});return Ut(yt,w)}}let Q=Z.selectAll(".venn-area").data(x,(z)=>z.sets),st=Q.enter().append("g").attr("class",(z)=>`venn-area venn-${z.sets.length==1?"circle":"intersection"}${z.colour||z.color?" venn-coloured":""}`).attr("data-venn-sets",(z)=>z.sets.join("_")),tt=st.append("path"),lt=st.append("text").attr("class","label").text((z)=>nt(z)).attr("text-anchor","middle").attr("dy",".35em").attr("x",i/2).attr("y",n/2);if(l)tt.style("fill-opacity","0").filter((z)=>z.sets.length==1).style("fill",(z)=>z.colour?z.colour:z.color?z.color:b(z.sets)).style("fill-opacity",".25"),lt.style("fill",(z)=>{if(z.colour||z.color)return"#FFF";if(t.textFill)return t.textFill;return z.sets.length==1?b(z.sets):"#444"});function it(z){if(typeof z.transition==="function")return z.transition("venn").duration(o);return z}let et=v;if(H&&typeof et.transition==="function")et=it(v),et.selectAll("path").attrTween("d",V);else et.selectAll("path").attr("d",(z)=>Ut(z.sets.map((J)=>C[J])),w);let U=et.selectAll("text").filter((z)=>(z.sets in K)).text((z)=>nt(z)).attr("x",(z)=>Math.floor(K[z.sets].x)).attr("y",(z)=>Math.floor(K[z.sets].y));if(d)if(H)if("on"in U)U.on("end",wt(C,nt));else U.each("end",wt(C,nt));else U.each(wt(C,nt));let ft=it(Q.exit()).remove();if(typeof Q.transition==="function")ft.selectAll("path").attrTween("d",V);let ut=ft.selectAll("text").attr("x",i/2).attr("y",n/2);if(S!==null)lt.style("font-size","0px"),U.style("font-size",S),ut.style("font-size","0px");return{circles:C,textCentres:K,nodes:Q,enter:st,update:et,exit:ft}}return u.wrap=function(v){if(!arguments.length)return d;return d=v,u},u.useViewBox=function(){return s=!0,u},u.width=function(v){if(!arguments.length)return i;return i=v,u},u.height=function(v){if(!arguments.length)return n;return n=v,u},u.padding=function(v){if(!arguments.length)return r;return r=v,u},u.distinct=function(v){if(!arguments.length)return E;return E=v,u},u.colours=function(v){if(!arguments.length)return b;return b=v,u},u.colors=function(v){if(!arguments.length)return b;return b=v,u},u.fontSize=function(v){if(!arguments.length)return S;return S=v,u},u.round=function(v){if(!arguments.length)return w;return w=v,u},u.duration=function(v){if(!arguments.length)return o;return o=v,u},u.layoutFunction=function(v){if(!arguments.length)return _;return _=v,u},u.normalize=function(v){if(!arguments.length)return c;return c=v,u},u.scaleToFit=function(v){if(!arguments.length)return g;return g=v,u},u.styled=function(v){if(!arguments.length)return l;return l=v,u},u.orientation=function(v){if(!arguments.length)return a;return a=v,u},u.orientationOrder=function(v){if(!arguments.length)return y;return y=v,u},u.lossFunction=function(v){if(!arguments.length)return T;return T=v==="default"?mt:v==="logRatio"?Xt:v,u},u}function wt(t,s){return function(i){let n=this,r=t[i.sets[0]].radius||50,o=s(i)||"",a=o.split(/\s+/).reverse(),c=3,g=(o.length+a.length)/3,d=a.pop(),l=[d],S=0,y=1.1;n.textContent=null;let E=[];function w(b){let _=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return _.textContent=b,E.push(_),n.append(_),_}let D=w(d);while(!0){if(d=a.pop(),!d)break;l.push(d);let b=l.join(" ");if(D.textContent=b,b.length>g&&D.getComputedTextLength()>r)l.pop(),D.textContent=l.join(" "),l=[d],D=w(d),S++}let q=0.35-S*y/2,F=n.getAttribute("x"),N=n.getAttribute("y");E.forEach((b,_)=>{b.setAttribute("x",F),b.setAttribute("y",N),b.setAttribute("dy",`${q+_*y}em`)})}}function _t(t,s,i){let n=s[0].radius-ot(s[0],t);for(let r=1;r<s.length;++r){let o=s[r].radius-ot(s[r],t);if(o<=n)n=o}for(let r=0;r<i.length;++r){let o=ot(i[r],t)-i[r].radius;if(o<=n)n=o}return n}function ee(t,s,i){let n=[];for(let l of t)n.push({x:l.x,y:l.y}),n.push({x:l.x+l.radius/2,y:l.y}),n.push({x:l.x-l.radius/2,y:l.y}),n.push({x:l.x,y:l.y+l.radius/2}),n.push({x:l.x,y:l.y-l.radius/2});let r=n[0],o=_t(n[0],t,s);for(let l=1;l<n.length;++l){let S=_t(n[l],t,s);if(S>=o)r=n[l],o=S}let a=Kt((l)=>-1*_t({x:l[0],y:l[1]},t,s),[r.x,r.y],{maxIterations:500,minErrorDelta:0.0000000001}).x,c={x:i?0:a[0],y:a[1]},g=!0;for(let l of t)if(ot(c,l)>l.radius){g=!1;break}for(let l of s)if(ot(c,l)<l.radius){g=!1;break}if(g)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};let d={};if(kt(t,d),d.arcs.length===0)return{x:0,y:-1000,disjoint:!0};if(d.arcs.length==1)return{x:d.arcs[0].circle.x,y:d.arcs[0].circle.y};if(s.length)return ee(t,[]);return Wt(d.arcs.map((l)=>l.p1))}function we(t){let s={},i=Object.keys(t);for(let n of i)s[n]=[];for(let n=0;n<i.length;n++){let r=i[n],o=t[r];for(let a=n+1;a<i.length;++a){let c=i[a],g=t[c],d=ot(o,g);if(d+g.radius<=o.radius+0.0000000001)s[c].push(r);else if(d+o.radius<=g.radius+0.0000000001)s[r].push(c)}}return s}function se(t,s,i){let n={},r=we(t);for(let o=0;o<s.length;++o){let a=s[o].sets,c={},g={};for(let y=0;y<a.length;++y){c[a[y]]=!0;let E=r[a[y]];for(let w=0;w<E.length;++w)g[E[w]]=!0}let d=[],l=[];for(let y in t)if(y in c)d.push(t[y]);else if(!(y in g))l.push(t[y]);let S=ee(d,l,i);if(n[a]=S,S.disjoint&&s[o].size>0)console.log("WARNING: area "+a+" not represented on screen")}return n}function _e(t,s,i){let n=[];return n.push(`
2
2
  M`,t,s),n.push(`
3
3
  m`,-i,0),n.push(`
4
4
  a`,i,i,0,1,0,i*2,0),n.push(`
5
- a`,i,i,0,1,0,-i*2,0),n.join(" ")}function Ee(t){let s=t.split(" ");return{x:Number.parseFloat(s[1]),y:Number.parseFloat(s[2]),radius:-Number.parseFloat(s[4])}}function se(t){if(t.length===0)return[];let s={};return kt(t,s),s.arcs}function ie(t,s){if(t.length===0)return"M 0 0";let i=Math.pow(10,s||0),n=s!=null?(o)=>Math.round(o*i)/i:(o)=>o;if(t.length==1){let o=t[0].circle;return _e(n(o.x),n(o.y),n(o.radius))}let r=[`
5
+ a`,i,i,0,1,0,-i*2,0),n.join(" ")}function Ee(t){let s=t.split(" ");return{x:Number.parseFloat(s[1]),y:Number.parseFloat(s[2]),radius:-Number.parseFloat(s[4])}}function ie(t){if(t.length===0)return[];let s={};return kt(t,s),s.arcs}function re(t,s){if(t.length===0)return"M 0 0";let i=Math.pow(10,s||0),n=s!=null?(o)=>Math.round(o*i)/i:(o)=>o;if(t.length==1){let o=t[0].circle;return _e(n(o.x),n(o.y),n(o.radius))}let r=[`
6
6
  M`,n(t[0].p2.x),n(t[0].p2.y)];for(let o of t){let a=n(o.circle.radius);r.push(`
7
- A`,a,a,0,o.large?1:0,o.sweep?1:0,n(o.p1.x),n(o.p1.y))}return r.join(" ")}function Ut(t,s){return ie(se(t),s)}function re(t,s={}){let{lossFunction:i,layoutFunction:n=Ht,normalize:r=!0,orientation:o=Math.PI/2,orientationOrder:a,width:c=600,height:d=350,padding:f=15,scaleToFit:l=!1,symmetricalTextCentre:S=!1,distinct:y,round:E=2}=s,w=n(t,{lossFunction:i==="default"||!i?mt:i==="logRatio"?Xt:i,distinct:y});if(r)w=Zt(w,o,a);let N=Jt(w,c,d,f,l),q=ne(N,t,S),V=new Map(Object.keys(N).map((_)=>[_,{set:_,x:N[_].x,y:N[_].y,radius:N[_].radius}])),P=t.map((_)=>{let T=_.sets.map((x)=>V.get(x)),u=se(T),v=ie(u,E);return{circles:T,arcs:u,path:v,area:_,has:new Set(_.sets)}});function b(_){let T="";for(let u of P)if(u.has.size>_.length&&_.every((v)=>u.has.has(v)))T+=" "+u.path;return T}return P.map(({circles:_,arcs:T,path:u,area:v})=>({data:v,text:q[v.sets],circles:_,arcs:T,path:u,distinctPath:u+b(v.sets)}))}var Nt=function(){var t=e(function(P,b,_,T){for(_=_||{},T=P.length;T--;_[P[T]]=b);return _},"o"),s=[5,8],i=[7,8,11,12,17,19,22,24],n=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],c=[1,39],d=[7,8,11,12,17,19,22,24,27],f=[1,57],l=[1,56],S=[1,58],y=[1,59],E=[1,60],w=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],N={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(b,_,T,u,v,x,W){var C=x.length-1;switch(v){case 1:return x[C-1];case 2:case 3:case 4:this.$=[];break;case 5:x[C-1].push(x[C]),this.$=x[C-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=x[C];break;case 8:u.setDiagramTitle(x[C].substr(6)),this.$=x[C].substr(6);break;case 9:if(u.addSubsetData([x[C]],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 10:if(u.addSubsetData([x[C-1]],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 11:if(u.addSubsetData([x[C-2]],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 12:if(u.addSubsetData([x[C-3]],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 13:if(x[C].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C]);if(u.addSubsetData(x[C],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 14:if(x[C-1].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-1]);if(u.addSubsetData(x[C-1],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 15:if(x[C-2].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-2]);if(u.addSubsetData(x[C-2],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 16:if(x[C-3].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-3]);if(u.addSubsetData(x[C-3],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 17:case 18:case 19:u.addTextData(x[C-1],x[C],void 0);break;case 20:case 21:u.addTextData(x[C-2],x[C-1],x[C]);break;case 23:u.addStyleData(x[C-1],x[C]);break;case 24:case 25:case 26:var H=u.getCurrentSets();if(!H)throw Error("text requires set");u.addTextData(H,x[C],void 0);break;case 27:case 28:var H=u.getCurrentSets();if(!H)throw Error("text requires set");u.addTextData(H,x[C-1],x[C]);break;case 29:case 41:this.$=[x[C]];break;case 30:case 42:this.$=[...x[C-2],x[C]];break;case 31:this.$=[x[C-2],x[C]];break;case 33:this.$=x[C].join(" ");break;case 34:this.$=[x[C]];break;case 35:x[C-1].push(x[C]),this.$=x[C-1];break;case 43:case 44:this.$=x[C];break}},"anonymous"),table:[t(s,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(i,[2,4],{6:5}),t(s,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(i,[2,5]),t(i,[2,6]),t(i,[2,7]),t(i,[2,8]),{13:16,20:n,21:r},{13:20,18:19,20:n,21:r},{13:20,18:21,20:n,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:r},t(i,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(i,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(i,[2,22]),t(i,[2,24],{14:[1,35]}),t(i,[2,25],{14:[1,36]}),t(i,[2,26]),{20:c,25:37,26:38,27:a},t(i,[2,10],{15:[1,40]}),{16:[1,41]},t(i,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:r},t(i,[2,17],{14:[1,45]}),t(i,[2,18],{14:[1,46]}),t(i,[2,19]),t(i,[2,27]),t(i,[2,28]),t(i,[2,23],{27:[1,47]}),t(d,[2,29]),{15:[1,48]},{16:[1,49]},t(i,[2,11]),{16:[1,50]},t(i,[2,15]),t(o,[2,42]),t(i,[2,20]),t(i,[2,21]),{20:c,26:51},{16:f,20:l,21:[1,53],28:52,29:54,30:55,31:S,32:y,33:E},t(i,[2,12]),t(i,[2,16]),t(d,[2,30]),t(d,[2,31]),t(d,[2,32]),t(d,[2,33],{30:61,16:f,20:l,31:S,32:y,33:E}),t(w,[2,34]),t(w,[2,36]),t(w,[2,37]),t(w,[2,38]),t(w,[2,39]),t(w,[2,40]),t(w,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(b,_){if(_.recoverable)this.trace(b);else{var T=Error(b);throw T.hash=_,T}},"parseError"),parse:e(function(b){var _=this,T=[0],u=[],v=[null],x=[],W=this.table,C="",H=0,at=0,nt=0,Z=2,G=1,X=x.slice.call(arguments,1),B=Object.create(this.lexer),Q={yy:{}};for(var st in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,st))Q.yy[st]=this.yy[st];if(B.setInput(b,Q.yy),Q.yy.lexer=B,Q.yy.parser=this,typeof B.yylloc>"u")B.yylloc={};var tt=B.yylloc;x.push(tt);var lt=B.options&&B.options.ranges;if(typeof Q.yy.parseError==="function")this.parseError=Q.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function it(ct){T.length=T.length-2*ct,v.length=v.length-ct,x.length=x.length-ct}e(it,"popStack");function et(){var ct=u.pop()||B.lex()||G;if(typeof ct!=="number"){if(ct instanceof Array)u=ct,ct=u.pop();ct=_.symbols_[ct]||ct}return ct}e(et,"lex");var U,ft,ut,z,J,yt,dt={},ht,rt,Bt,vt;while(!0){if(ut=T[T.length-1],this.defaultActions[ut])z=this.defaultActions[ut];else{if(U===null||typeof U>"u")U=et();z=W[ut]&&W[ut][U]}if(typeof z>"u"||!z.length||!z[0]){var Mt="";vt=[];for(ht in W[ut])if(this.terminals_[ht]&&ht>Z)vt.push("'"+this.terminals_[ht]+"'");if(B.showPosition)Mt="Parse error on line "+(H+1)+`:
8
- `+B.showPosition()+`
9
- Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'";else Mt="Parse error on line "+(H+1)+": Unexpected "+(U==G?"end of input":"'"+(this.terminals_[U]||U)+"'");this.parseError(Mt,{text:B.match,token:this.terminals_[U]||U,line:B.yylineno,loc:tt,expected:vt})}if(z[0]instanceof Array&&z.length>1)throw Error("Parse Error: multiple actions possible at state: "+ut+", token: "+U);switch(z[0]){case 1:if(T.push(U),v.push(B.yytext),x.push(B.yylloc),T.push(z[1]),U=null,!ft){if(at=B.yyleng,C=B.yytext,H=B.yylineno,tt=B.yylloc,nt>0)nt--}else U=ft,ft=null;break;case 2:if(rt=this.productions_[z[1]][1],dt.$=v[v.length-rt],dt._$={first_line:x[x.length-(rt||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(rt||1)].first_column,last_column:x[x.length-1].last_column},lt)dt._$.range=[x[x.length-(rt||1)].range[0],x[x.length-1].range[1]];if(yt=this.performAction.apply(dt,[C,at,H,Q.yy,z[1],v,x].concat(X)),typeof yt<"u")return yt;if(rt)T=T.slice(0,-1*rt*2),v=v.slice(0,-1*rt),x=x.slice(0,-1*rt);T.push(this.productions_[z[1]][0]),v.push(dt.$),x.push(dt._$),Bt=W[T[T.length-2]][T[T.length-1]],T.push(Bt);break;case 3:return!0}}return!0},"parse")},q=function(){var P={EOF:1,parseError:e(function(_,T){if(this.yy.parser)this.yy.parser.parseError(_,T);else throw Error(_)},"parseError"),setInput:e(function(b,_){if(this.yy=_||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];return this.offset=0,this},"setInput"),input:e(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var _=b.match(/(?:\r\n?|\n).*/g);if(_)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:e(function(b){var _=b.length,T=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1)this.yylineno-=T.length-1;var v=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===u.length?this.yylloc.first_column:0)+u[u.length-T.length].length-T[0].length:this.yylloc.first_column-_},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-_];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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).
7
+ A`,a,a,0,o.large?1:0,o.sweep?1:0,n(o.p1.x),n(o.p1.y))}return r.join(" ")}function Ut(t,s){return re(ie(t),s)}function oe(t,s={}){let{lossFunction:i,layoutFunction:n=Ht,normalize:r=!0,orientation:o=Math.PI/2,orientationOrder:a,width:c=600,height:g=350,padding:d=15,scaleToFit:l=!1,symmetricalTextCentre:S=!1,distinct:y,round:E=2}=s,w=n(t,{lossFunction:i==="default"||!i?mt:i==="logRatio"?Xt:i,distinct:y});if(r)w=Zt(w,o,a);let D=Jt(w,c,g,d,l),q=se(D,t,S),F=new Map(Object.keys(D).map((_)=>[_,{set:_,x:D[_].x,y:D[_].y,radius:D[_].radius}])),N=t.map((_)=>{let T=_.sets.map((x)=>F.get(x)),u=ie(T),v=re(u,E);return{circles:T,arcs:u,path:v,area:_,has:new Set(_.sets)}});function b(_){let T="";for(let u of N)if(u.has.size>_.length&&_.every((v)=>u.has.has(v)))T+=" "+u.path;return T}return N.map(({circles:_,arcs:T,path:u,area:v})=>({data:v,text:q[v.sets],circles:_,arcs:T,path:u,distinctPath:u+b(v.sets)}))}var Nt=function(){var t=e(function(N,b,_,T){for(_=_||{},T=N.length;T--;_[N[T]]=b);return _},"o"),s=[5,8],i=[7,8,11,12,17,19,22,24],n=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],c=[1,39],g=[7,8,11,12,17,19,22,24,27],d=[1,57],l=[1,56],S=[1,58],y=[1,59],E=[1,60],w=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],D={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(b,_,T,u,v,x,W){var C=x.length-1;switch(v){case 1:return x[C-1];case 2:case 3:case 4:this.$=[];break;case 5:x[C-1].push(x[C]),this.$=x[C-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=x[C];break;case 8:u.setDiagramTitle(x[C].substr(6)),this.$=x[C].substr(6);break;case 9:if(u.addSubsetData([x[C]],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 10:if(u.addSubsetData([x[C-1]],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 11:if(u.addSubsetData([x[C-2]],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 12:if(u.addSubsetData([x[C-3]],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 13:if(x[C].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C]);if(u.addSubsetData(x[C],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 14:if(x[C-1].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-1]);if(u.addSubsetData(x[C-1],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 15:if(x[C-2].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-2]);if(u.addSubsetData(x[C-2],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 16:if(x[C-3].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-3]);if(u.addSubsetData(x[C-3],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 17:case 18:case 19:u.addTextData(x[C-1],x[C],void 0);break;case 20:case 21:u.addTextData(x[C-2],x[C-1],x[C]);break;case 23:u.addStyleData(x[C-1],x[C]);break;case 24:case 25:case 26:var K=u.getCurrentSets();if(!K)throw Error("text requires set");u.addTextData(K,x[C],void 0);break;case 27:case 28:var K=u.getCurrentSets();if(!K)throw Error("text requires set");u.addTextData(K,x[C-1],x[C]);break;case 29:case 41:this.$=[x[C]];break;case 30:case 42:this.$=[...x[C-2],x[C]];break;case 31:this.$=[x[C-2],x[C]];break;case 33:this.$=x[C].join(" ");break;case 34:this.$=[x[C]];break;case 35:x[C-1].push(x[C]),this.$=x[C-1];break;case 43:case 44:this.$=x[C];break}},"anonymous"),table:[t(s,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(i,[2,4],{6:5}),t(s,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(i,[2,5]),t(i,[2,6]),t(i,[2,7]),t(i,[2,8]),{13:16,20:n,21:r},{13:20,18:19,20:n,21:r},{13:20,18:21,20:n,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:r},t(i,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(i,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(i,[2,22]),t(i,[2,24],{14:[1,35]}),t(i,[2,25],{14:[1,36]}),t(i,[2,26]),{20:c,25:37,26:38,27:a},t(i,[2,10],{15:[1,40]}),{16:[1,41]},t(i,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:r},t(i,[2,17],{14:[1,45]}),t(i,[2,18],{14:[1,46]}),t(i,[2,19]),t(i,[2,27]),t(i,[2,28]),t(i,[2,23],{27:[1,47]}),t(g,[2,29]),{15:[1,48]},{16:[1,49]},t(i,[2,11]),{16:[1,50]},t(i,[2,15]),t(o,[2,42]),t(i,[2,20]),t(i,[2,21]),{20:c,26:51},{16:d,20:l,21:[1,53],28:52,29:54,30:55,31:S,32:y,33:E},t(i,[2,12]),t(i,[2,16]),t(g,[2,30]),t(g,[2,31]),t(g,[2,32]),t(g,[2,33],{30:61,16:d,20:l,31:S,32:y,33:E}),t(w,[2,34]),t(w,[2,36]),t(w,[2,37]),t(w,[2,38]),t(w,[2,39]),t(w,[2,40]),t(w,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(b,_){if(_.recoverable)this.trace(b);else{var T=Error(b);throw T.hash=_,T}},"parseError"),parse:e(function(b){var _=this,T=[0],u=[],v=[null],x=[],W=this.table,C="",K=0,at=0,nt=0,Z=2,G=1,H=x.slice.call(arguments,1),V=Object.create(this.lexer),Q={yy:{}};for(var st in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,st))Q.yy[st]=this.yy[st];if(V.setInput(b,Q.yy),Q.yy.lexer=V,Q.yy.parser=this,typeof V.yylloc>"u")V.yylloc={};var tt=V.yylloc;x.push(tt);var lt=V.options&&V.options.ranges;if(typeof Q.yy.parseError==="function")this.parseError=Q.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function it(ct){T.length=T.length-2*ct,v.length=v.length-ct,x.length=x.length-ct}e(it,"popStack");function et(){var ct=u.pop()||V.lex()||G;if(typeof ct!=="number"){if(ct instanceof Array)u=ct,ct=u.pop();ct=_.symbols_[ct]||ct}return ct}e(et,"lex");var U,ft,ut,z,J,yt,dt={},ht,rt,Bt,vt;while(!0){if(ut=T[T.length-1],this.defaultActions[ut])z=this.defaultActions[ut];else{if(U===null||typeof U>"u")U=et();z=W[ut]&&W[ut][U]}if(typeof z>"u"||!z.length||!z[0]){var Mt="";vt=[];for(ht in W[ut])if(this.terminals_[ht]&&ht>Z)vt.push("'"+this.terminals_[ht]+"'");if(V.showPosition)Mt="Parse error on line "+(K+1)+`:
8
+ `+V.showPosition()+`
9
+ Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'";else Mt="Parse error on line "+(K+1)+": Unexpected "+(U==G?"end of input":"'"+(this.terminals_[U]||U)+"'");this.parseError(Mt,{text:V.match,token:this.terminals_[U]||U,line:V.yylineno,loc:tt,expected:vt})}if(z[0]instanceof Array&&z.length>1)throw Error("Parse Error: multiple actions possible at state: "+ut+", token: "+U);switch(z[0]){case 1:if(T.push(U),v.push(V.yytext),x.push(V.yylloc),T.push(z[1]),U=null,!ft){if(at=V.yyleng,C=V.yytext,K=V.yylineno,tt=V.yylloc,nt>0)nt--}else U=ft,ft=null;break;case 2:if(rt=this.productions_[z[1]][1],dt.$=v[v.length-rt],dt._$={first_line:x[x.length-(rt||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(rt||1)].first_column,last_column:x[x.length-1].last_column},lt)dt._$.range=[x[x.length-(rt||1)].range[0],x[x.length-1].range[1]];if(yt=this.performAction.apply(dt,[C,at,K,Q.yy,z[1],v,x].concat(H)),typeof yt<"u")return yt;if(rt)T=T.slice(0,-1*rt*2),v=v.slice(0,-1*rt),x=x.slice(0,-1*rt);T.push(this.productions_[z[1]][0]),v.push(dt.$),x.push(dt._$),Bt=W[T[T.length-2]][T[T.length-1]],T.push(Bt);break;case 3:return!0}}return!0},"parse")},q=function(){var N={EOF:1,parseError:e(function(_,T){if(this.yy.parser)this.yy.parser.parseError(_,T);else throw Error(_)},"parseError"),setInput:e(function(b,_){if(this.yy=_||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];return this.offset=0,this},"setInput"),input:e(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var _=b.match(/(?:\r\n?|\n).*/g);if(_)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:e(function(b){var _=b.length,T=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1)this.yylineno-=T.length-1;var v=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===u.length?this.yylloc.first_column:0)+u[u.length-T.length].length-T[0].length:this.yylloc.first_column-_},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-_];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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).
10
10
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(b){this.unput(this.match.slice(b))},"less"),pastInput:e(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:e(function(){var b=this.match;if(b.length<20)b+=this._input.substr(0,20-b.length);return(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var b=this.pastInput(),_=Array(b.length+1).join("-");return b+this.upcomingInput()+`
11
11
  `+_+"^"},"showPosition"),test_match:e(function(b,_){var T,u,v;if(this.options.backtrack_lexer){if(v={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)v.yylloc.range=this.yylloc.range.slice(0)}if(u=b[0].match(/(?:\r\n?|\n).*/g),u)this.yylineno+=u.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.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];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],T=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(T)return T;else if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var b,_,T,u;if(!this._more)this.yytext="",this.match="";var v=this._currentRules();for(var x=0;x<v.length;x++)if(T=this._input.match(this.rules[v[x]]),T&&(!_||T[0].length>_[0].length)){if(_=T,u=x,this.options.backtrack_lexer)if(b=this.test_match(T,v[x]),b!==!1)return b;else if(this._backtrack){_=!1;continue}else return!1;else if(!this.options.flex)break}if(_){if(b=this.test_match(_,v[u]),b!==!1)return b;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
12
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var _=this.next();if(_)return _;else return this.lex()},"lex"),begin:e(function(_){this.conditionStack.push(_)},"begin"),popState:e(function(){var _=this.conditionStack.length-1;if(_>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(_){if(_=this.conditionStack.length-1-Math.abs(_||0),_>=0)return this.conditionStack[_];else return"INITIAL"},"topState"),pushState:e(function(_){this.begin(_)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(_,T,u,v){var x=v;switch(u){case 0:break;case 1:break;case 2:break;case 3:if(_.getIndentMode&&_.getIndentMode())return _.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:if(_.setIndentMode)_.setIndentMode(!1);this.begin("INITIAL"),this.unput(T.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(_.consumeIndentText)_.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return T.yytext=T.yytext.slice(2,-2),14;break;case 17:return T.yytext=T.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return P}();N.lexer=q;function V(){this.yy={}}return e(V,"Parser"),V.prototype=N,N.Parser=V,new V}();Nt.parser=Nt;var ze=Nt,Ot=[],Lt=[],jt=[],Ft=new Set,Pt,Vt=!1,Ae=e((t,s,i)=>{let n=It(t).sort(),r=i??10/Math.pow(t.length,2);if(Pt=n,n.length===1)Ft.add(n[0]);Ot.push({sets:n,size:r,label:s?bt(s):void 0})},"addSubsetData"),Ce=e(()=>Ot,"getSubsetData"),bt=e((t)=>{let s=t.trim();if(s.length>=2&&s.startsWith('"')&&s.endsWith('"'))return s.slice(1,-1);return s},"normalizeText"),De=e((t)=>t?bt(t):t,"normalizeStyleValue"),Re=e((t,s,i)=>{let n=bt(s);Lt.push({sets:It(t).sort(),id:n,label:i?bt(i):void 0})},"addTextData"),Ne=e((t,s)=>{let i=It(t).sort(),n={};for(let[r,o]of s)n[r]=De(o)??o;jt.push({targets:i,styles:n})},"addStyleData"),Oe=e(()=>jt,"getStyleData"),It=e((t)=>t.map((s)=>bt(s)),"normalizeIdentifierList"),Le=e((t)=>{let i=It(t).filter((n)=>!Ft.has(n));if(i.length>0)throw Error(`unknown set identifier: ${i.join(", ")}`)},"validateUnionIdentifiers"),je=e(()=>Lt,"getTextData"),Fe=e(()=>Pt,"getCurrentSets"),Pe=e(()=>Vt,"getIndentMode"),Ve=e((t)=>{Vt=t},"setIndentMode"),Be=F.venn;function oe(){return K(Be,k().venn)}e(oe,"getConfig");var qe=e(()=>{A(),Ot.length=0,Lt.length=0,jt.length=0,Ft.clear(),Pt=void 0,Vt=!1},"customClear"),Ue={getConfig:oe,clear:qe,setAccTitle:L,getAccTitle:R,setDiagramTitle:D,getDiagramTitle:O,getAccDescription:M,setAccDescription:I,addSubsetData:Ae,getSubsetData:Ce,addTextData:Re,addStyleData:Ne,validateUnionIdentifiers:Le,getTextData:je,getStyleData:Oe,getCurrentSets:Fe,getIndentMode:Pe,setIndentMode:Ve},Ge=e((t)=>`
12
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var _=this.next();if(_)return _;else return this.lex()},"lex"),begin:e(function(_){this.conditionStack.push(_)},"begin"),popState:e(function(){var _=this.conditionStack.length-1;if(_>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(_){if(_=this.conditionStack.length-1-Math.abs(_||0),_>=0)return this.conditionStack[_];else return"INITIAL"},"topState"),pushState:e(function(_){this.begin(_)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(_,T,u,v){var x=v;switch(u){case 0:break;case 1:break;case 2:break;case 3:if(_.getIndentMode&&_.getIndentMode())return _.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:if(_.setIndentMode)_.setIndentMode(!1);this.begin("INITIAL"),this.unput(T.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(_.consumeIndentText)_.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return T.yytext=T.yytext.slice(2,-2),14;break;case 17:return T.yytext=T.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return N}();D.lexer=q;function F(){this.yy={}}return e(F,"Parser"),F.prototype=D,D.Parser=F,new F}();Nt.parser=Nt;var ze=Nt,Ot=[],Lt=[],jt=[],Ft=new Set,Pt,Vt=!1,Ae=e((t,s,i)=>{let n=It(t).sort(),r=i??10/Math.pow(t.length,2);if(Pt=n,n.length===1)Ft.add(n[0]);Ot.push({sets:n,size:r,label:s?bt(s):void 0})},"addSubsetData"),Ce=e(()=>Ot,"getSubsetData"),bt=e((t)=>{let s=t.trim();if(s.length>=2&&s.startsWith('"')&&s.endsWith('"'))return s.slice(1,-1);return s},"normalizeText"),De=e((t)=>t?bt(t):t,"normalizeStyleValue"),Re=e((t,s,i)=>{let n=bt(s);Lt.push({sets:It(t).sort(),id:n,label:i?bt(i):void 0})},"addTextData"),Ne=e((t,s)=>{let i=It(t).sort(),n={};for(let[r,o]of s)n[r]=De(o)??o;jt.push({targets:i,styles:n})},"addStyleData"),Oe=e(()=>jt,"getStyleData"),It=e((t)=>t.map((s)=>bt(s)),"normalizeIdentifierList"),Le=e((t)=>{let i=It(t).filter((n)=>!Ft.has(n));if(i.length>0)throw Error(`unknown set identifier: ${i.join(", ")}`)},"validateUnionIdentifiers"),je=e(()=>Lt,"getTextData"),Fe=e(()=>Pt,"getCurrentSets"),Pe=e(()=>Vt,"getIndentMode"),Ve=e((t)=>{Vt=t},"setIndentMode"),Be=B.venn;function ae(){return Y(Be,k().venn)}e(ae,"getConfig");var qe=e(()=>{A(),Ot.length=0,Lt.length=0,jt.length=0,Ft.clear(),Pt=void 0,Vt=!1},"customClear"),Ue={getConfig:ae,clear:qe,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I,addSubsetData:Ae,getSubsetData:Ce,addTextData:Re,addStyleData:Ne,validateUnionIdentifiers:Le,getTextData:je,getStyleData:Oe,getCurrentSets:Fe,getIndentMode:Pe,setIndentMode:Ve},Ge=e((t)=>`
13
13
  .venn-title {
14
14
  font-size: 32px;
15
15
  fill: ${t.vennTitleTextColor};
@@ -31,4 +31,4 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'";else Mt="Parse e
31
31
  font-family: ${t.fontFamily};
32
32
  color: ${t.vennSetTextColor};
33
33
  }
34
- `,"getStyles"),We=Ge;function le(t){let s=new Map;for(let i of t){let n=i.targets.join("|"),r=s.get(n);if(r)Object.assign(r,i.styles);else s.set(n,{...i.styles})}return s}e(le,"buildStyleByKey");var Ke=e((t,s,i,n)=>{let r=n.db,o=r.getConfig?.(),{themeVariables:a,look:c,handDrawnSeed:d}=k(),f=c==="handDrawn",l=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),S=r.getDiagramTitle?.(),y=r.getSubsetData(),E=r.getTextData(),w=le(r.getStyleData()),N=ue(y),q=o?.width??800,V=o?.height??450,P=1600,b=q/1600,_=S?48*b:0,T=a.primaryTextColor??a.textColor,u=Y(s);if(u.attr("viewBox",`0 0 ${q} ${V}`),S)u.append("text").text(S).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",a.vennTitleTextColor||a.titleColor);let v=m(document.createElement("div")),x=te().width(q).height(V-_);v.datum(N).call(x);let W=f?g.svg(v.select("svg").node()):void 0,C=re(N,{width:q,height:V-_,padding:o?.padding??15}),H=new Map;for(let G of C){let X=xt([...G.data.sets].sort());H.set(X,G)}if(E.length>0)ce(o,H,v,E,b,w);let at=ae(a.background||"#f4f4f4");if(v.selectAll(".venn-circle").each(function(G,X){let B=m(this),st=xt([...G.sets].sort()),tt=w.get(st),lt=l.length>0?l[X%l.length]:void 0,it=tt?.fill||lt||a.primaryColor;B.classed(`venn-set-${X%8}`,!0);let et=tt?.["fill-opacity"]??0.1,U=tt?.stroke||it,ft=tt?.["stroke-width"]||`${5*b}`;if(f&&W){let z=H.get(st);if(z&&z.circles.length>0){let J=z.circles[0],yt=W.circle(J.x,J.y,J.radius*2,{roughness:0.7,seed:d,fill:St(it,0.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+X*60,stroke:U,strokeWidth:parseFloat(String(ft))});B.select("path").remove(),B.node()?.insertBefore(yt,B.select("text").node())}}else B.select("path").style("fill",it).style("fill-opacity",et).style("stroke",U).style("stroke-width",ft).style("stroke-opacity",0.95);let ut=tt?.color||(at?h(it,30):p(it,30));B.select("text").style("font-size",`${48*b}px`).style("fill",ut)}),f&&W)v.selectAll(".venn-intersection").each(function(G){let X=m(this),Q=xt([...G.sets].sort()),st=w.get(Q),tt=st?.fill;if(tt){let lt=X.select("path"),it=lt.attr("d");if(it){let et=W.path(it,{roughness:0.7,seed:d,fill:St(tt,0.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),U=lt.node();U?.parentNode?.insertBefore(et,U),lt.remove()}}else X.select("path").style("fill-opacity",0);X.select("text").style("font-size",`${48*b}px`).style("fill",st?.color??a.vennSetTextColor??T)});else v.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",(G)=>{let B=xt([...G.sets].sort());return w.get(B)?.color??a.vennSetTextColor??T}),v.selectAll(".venn-intersection path").style("fill-opacity",(G)=>{let B=xt([...G.sets].sort());return w.get(B)?.fill?1:0}).style("fill",(G)=>{let B=xt([...G.sets].sort());return w.get(B)?.fill??"transparent"});let nt=u.append("g").attr("transform",`translate(0, ${_})`),Z=v.select("svg").node();if(Z&&"childNodes"in Z)for(let G of[...Z.childNodes])nt.node()?.appendChild(G);j(u,V,q,o?.useMaxWidth??!0)},"draw");function xt(t){return t.join("|")}e(xt,"stableSetsKey");function ce(t,s,i,n,r,o){let a=t?.useDebugLayout??!1,d=i.select("svg").append("g").attr("class","venn-text-nodes"),f=new Map;for(let l of n){let S=xt(l.sets),y=f.get(S);if(y)y.push(l);else f.set(S,[l])}for(let[l,S]of f.entries()){let y=s.get(l);if(!y?.text)continue;let E=y.text.x,w=y.text.y,N=Math.min(...y.circles.map((Z)=>Z.radius)),q=Math.min(...y.circles.map((Z)=>Z.radius-Math.hypot(E-Z.x,w-Z.y))),V=Number.isFinite(q)?Math.max(0,q):0;if(V===0&&Number.isFinite(N))V=N*0.6;let P=d.append("g").attr("class","venn-text-area").attr("font-size",`${40*r}px`);if(a)P.append("circle").attr("class","venn-text-debug-circle").attr("cx",E).attr("cy",w).attr("r",V).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*r).attr("stroke-dasharray",`${6*r} ${4*r}`);let b=Math.max(80*r,V*2*0.95),_=Math.max(60*r,V*2*0.95),v=(y.data.label&&y.data.label.length>0?Math.min(32*r,V*0.25):0)+(S.length<=2?30*r:0),x=E-b/2,W=w-_/2+v,C=Math.max(1,Math.ceil(Math.sqrt(S.length))),H=Math.max(1,Math.ceil(S.length/C)),at=b/C,nt=_/H;for(let[Z,G]of S.entries()){let X=Z%C,B=Math.floor(Z/C),Q=x+at*(X+0.5),st=W+nt*(B+0.5);if(a)P.append("rect").attr("class","venn-text-debug-cell").attr("x",x+at*X).attr("y",W+nt*B).attr("width",at).attr("height",nt).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*r).attr("stroke-dasharray",`${4*r} ${3*r}`);let tt=at*0.9,lt=nt*0.9,it=P.append("foreignObject").attr("class","venn-text-node-fo").attr("width",tt).attr("height",lt).attr("x",Q-tt/2).attr("y",st-lt/2).attr("overflow","visible"),et=o.get(G.id)?.color,U=it.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(G.label??G.id);if(et)U.style("color",et)}}}e(ce,"renderTextNodes");function ue(t){let s=new Set(t.map((r)=>[...r.sets].sort().join("|"))),i=new Map(t.filter((r)=>r.sets.length===1&&r.size!==void 0).map((r)=>[r.sets[0],r.size])),n=[];for(let r of t){if(r.sets.length<3)continue;let o=[...r.sets].sort();for(let a=0;a<o.length-1;a++)for(let c=a+1;c<o.length;c++){let d=[o[a],o[c]],f=d.join("|");if(!s.has(f)){s.add(f);let l=i.get(d[0]),S=i.get(d[1]),y=l!==void 0&&S!==void 0?Math.min(l,S)/4:2.5;n.push({sets:d,size:y,label:""})}}}return n.length>0?[...t,...n]:t}e(ue,"ensurePairwiseSubsets");var He={draw:Ke},rn={parser:ze,db:Ue,renderer:He,styles:We};export{rn as diagram};
34
+ `,"getStyles"),We=Ge;function le(t){let s=new Map;for(let i of t){let n=i.targets.join("|"),r=s.get(n);if(r)Object.assign(r,i.styles);else s.set(n,{...i.styles})}return s}e(le,"buildStyleByKey");var Ke=e((t,s,i,n)=>{let r=n.db,o=r.getConfig?.(),{themeVariables:a,look:c,handDrawnSeed:g}=k(),d=c==="handDrawn",l=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),S=r.getDiagramTitle?.(),y=r.getSubsetData(),E=r.getTextData(),w=le(r.getStyleData()),D=ue(y),q=o?.width??800,F=o?.height??450,N=1600,b=q/1600,_=S?48*b:0,T=a.primaryTextColor??a.textColor,u=X(s);if(u.attr("viewBox",`0 0 ${q} ${F}`),S)u.append("text").text(S).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",a.vennTitleTextColor||a.titleColor);let v=p(document.createElement("div")),x=te().width(q).height(F-_);v.datum(D).call(x);let W=d?m.svg(v.select("svg").node()):void 0,C=oe(D,{width:q,height:F-_,padding:o?.padding??15}),K=new Map;for(let G of C){let H=xt([...G.data.sets].sort());K.set(H,G)}if(E.length>0)ce(o,K,v,E,b,w);let at=ne(a.background||"#f4f4f4");if(v.selectAll(".venn-circle").each(function(G,H){let V=p(this),st=xt([...G.sets].sort()),tt=w.get(st),lt=l.length>0?l[H%l.length]:void 0,it=tt?.fill||lt||a.primaryColor;V.classed(`venn-set-${H%8}`,!0);let et=tt?.["fill-opacity"]??0.1,U=tt?.stroke||it,ft=tt?.["stroke-width"]||`${5*b}`;if(d&&W){let z=K.get(st);if(z&&z.circles.length>0){let J=z.circles[0],yt=W.circle(J.x,J.y,J.radius*2,{roughness:0.7,seed:g,fill:St(it,0.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+H*60,stroke:U,strokeWidth:parseFloat(String(ft))});V.select("path").remove(),V.node()?.insertBefore(yt,V.select("text").node())}}else V.select("path").style("fill",it).style("fill-opacity",et).style("stroke",U).style("stroke-width",ft).style("stroke-opacity",0.95);let ut=tt?.color||(at?f(it,30):h(it,30));V.select("text").style("font-size",`${48*b}px`).style("fill",ut)}),d&&W)v.selectAll(".venn-intersection").each(function(G){let H=p(this),Q=xt([...G.sets].sort()),st=w.get(Q),tt=st?.fill;if(tt){let lt=H.select("path"),it=lt.attr("d");if(it){let et=W.path(it,{roughness:0.7,seed:g,fill:St(tt,0.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),U=lt.node();U?.parentNode?.insertBefore(et,U),lt.remove()}}else H.select("path").style("fill-opacity",0);H.select("text").style("font-size",`${48*b}px`).style("fill",st?.color??a.vennSetTextColor??T)});else v.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.color??a.vennSetTextColor??T}),v.selectAll(".venn-intersection path").style("fill-opacity",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.fill?1:0}).style("fill",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.fill??"transparent"});let nt=u.append("g").attr("transform",`translate(0, ${_})`),Z=v.select("svg").node();if(Z&&"childNodes"in Z)for(let G of[...Z.childNodes])nt.node()?.appendChild(G);j(u,F,q,o?.useMaxWidth??!0)},"draw");function xt(t){return t.join("|")}e(xt,"stableSetsKey");function ce(t,s,i,n,r,o){let a=t?.useDebugLayout??!1,g=i.select("svg").append("g").attr("class","venn-text-nodes"),d=new Map;for(let l of n){let S=xt(l.sets),y=d.get(S);if(y)y.push(l);else d.set(S,[l])}for(let[l,S]of d.entries()){let y=s.get(l);if(!y?.text)continue;let E=y.text.x,w=y.text.y,D=Math.min(...y.circles.map((Z)=>Z.radius)),q=Math.min(...y.circles.map((Z)=>Z.radius-Math.hypot(E-Z.x,w-Z.y))),F=Number.isFinite(q)?Math.max(0,q):0;if(F===0&&Number.isFinite(D))F=D*0.6;let N=g.append("g").attr("class","venn-text-area").attr("font-size",`${40*r}px`);if(a)N.append("circle").attr("class","venn-text-debug-circle").attr("cx",E).attr("cy",w).attr("r",F).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*r).attr("stroke-dasharray",`${6*r} ${4*r}`);let b=Math.max(80*r,F*2*0.95),_=Math.max(60*r,F*2*0.95),v=(y.data.label&&y.data.label.length>0?Math.min(32*r,F*0.25):0)+(S.length<=2?30*r:0),x=E-b/2,W=w-_/2+v,C=Math.max(1,Math.ceil(Math.sqrt(S.length))),K=Math.max(1,Math.ceil(S.length/C)),at=b/C,nt=_/K;for(let[Z,G]of S.entries()){let H=Z%C,V=Math.floor(Z/C),Q=x+at*(H+0.5),st=W+nt*(V+0.5);if(a)N.append("rect").attr("class","venn-text-debug-cell").attr("x",x+at*H).attr("y",W+nt*V).attr("width",at).attr("height",nt).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*r).attr("stroke-dasharray",`${4*r} ${3*r}`);let tt=at*0.9,lt=nt*0.9,it=N.append("foreignObject").attr("class","venn-text-node-fo").attr("width",tt).attr("height",lt).attr("x",Q-tt/2).attr("y",st-lt/2).attr("overflow","visible"),et=o.get(G.id)?.color,U=it.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(G.label??G.id);if(et)U.style("color",et)}}}e(ce,"renderTextNodes");function ue(t){let s=new Set(t.map((r)=>[...r.sets].sort().join("|"))),i=new Map(t.filter((r)=>r.sets.length===1&&r.size!==void 0).map((r)=>[r.sets[0],r.size])),n=[];for(let r of t){if(r.sets.length<3)continue;let o=[...r.sets].sort();for(let a=0;a<o.length-1;a++)for(let c=a+1;c<o.length;c++){let g=[o[a],o[c]],d=g.join("|");if(!s.has(d)){s.add(d);let l=i.get(g[0]),S=i.get(g[1]),y=l!==void 0&&S!==void 0?Math.min(l,S)/4:2.5;n.push({sets:g,size:y,label:""})}}}return n.length>0?[...t,...n]:t}e(ue,"ensurePairwiseSubsets");var He={draw:Ke},rn={parser:ze,db:Ue,renderer:He,styles:We};export{rn as diagram};
@@ -0,0 +1 @@
1
+ import{Xo}from"./index.6pzexww5.js";export{Xo as createWardleyServices};
@@ -1,5 +1,5 @@
1
- import{ee}from"./index.3pn4wy4j.js";import{e,n,Me,k,j,A,L,R,I,M,D,O,u,Y,K}from"./index.yfbwd99n.js";import{se}from"./index.d8b8y928.js";var at=e((a,i)=>{let o=a<=1?a*100:a;if(o<0||o>100)throw Error(`${i} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return o},"toPercent"),G=e((a,i,o)=>({x:at(i,`${o} evolution`),y:at(a,`${o} visibility`)}),"toCoordinates"),lt=e((a)=>{if(!a)return;if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward";return},"getFlowFromPort"),Yt=e((a)=>{if(!a?.startsWith("+"))return{};let o=/^\+'([^']*)'/.exec(a)?.[1];if(a.includes("<>"))return{flow:"bidirectional",label:o};if(a.includes("<"))return{flow:"backward",label:o};if(a.includes(">"))return{flow:"forward",label:o};return{label:o}},"extractFlowFromArrow"),It=e((a,i)=>{if(ee(a,i),a.size)i.setSize(a.size.width,a.size.height);if(a.evolution){let o=a.evolution.stages.map((r)=>{if(r.secondName)return`${r.name.trim()} / ${r.secondName.trim()}`;return r.name.trim()}),g=a.evolution.stages.filter((r)=>r.boundary!==void 0).map((r)=>r.boundary);i.updateAxes({stages:o,stageBoundaries:g})}if(a.anchors.forEach((o)=>{let g=G(o.visibility,o.evolution,`Anchor "${o.name}"`);i.addNode(o.name,o.name,g.x,g.y,"anchor")}),a.components.forEach((o)=>{let g=G(o.visibility,o.evolution,`Component "${o.name}"`),r=o.label?(o.label.negX?-1:1)*o.label.offsetX:void 0,c=o.label?(o.label.negY?-1:1)*o.label.offsetY:void 0,b=o.decorator?.strategy;i.addNode(o.name,o.name,g.x,g.y,"component",r,c,o.inertia,b)}),a.notes.forEach((o)=>{let g=G(o.visibility,o.evolution,`Note "${o.text}"`);i.addNote(o.text,g.x,g.y)}),a.pipelines.forEach((o)=>{let g=i.getNode(o.parent);if(!g||typeof g.y!=="number")throw Error(`Pipeline "${o.parent}" must reference an existing component with coordinates.`);let r=g.y;i.startPipeline(o.parent),o.components.forEach((c)=>{let b=`${o.parent}_${c.name}`,T=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,w=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,J=at(c.evolution,`Pipeline component "${c.name}" evolution`);i.addNode(b,c.name,J,r,"pipeline-component",T,w),i.addPipelineComponent(o.parent,b)})}),a.links.forEach((o)=>{let g=!!o.arrow&&(o.arrow.includes("-.->")||o.arrow.includes(".-.")),r=lt(o.fromPort)??lt(o.toPort),{flow:c,label:b}=Yt(o.arrow);if(!r&&c)r=c;let T=o.linkLabel,w=b??T;i.addLink(i.resolveNodeId(o.from),i.resolveNodeId(o.to),g,w,r)}),a.evolves.forEach((o)=>{let g=i.getNode(o.component);if(g?.y!==void 0){let r=at(o.target,`Evolve target for "${o.component}"`);i.addTrend(o.component,r,g.y)}}),a.annotations.length>0){let o=a.annotations[0],g=G(o.x,o.y,"Annotations box");i.setAnnotationsBox(g.x,g.y)}a.annotation.forEach((o)=>{let g=G(o.x,o.y,`Annotation ${o.number}`);i.addAnnotation(o.number,[{x:g.x,y:g.y}],o.text)}),a.accelerators.forEach((o)=>{let g=G(o.x,o.y,`Accelerator "${o.name}"`);i.addAccelerator(o.name,g.x,g.y)}),a.deaccelerators.forEach((o)=>{let g=G(o.x,o.y,`Deaccelerator "${o.name}"`);i.addDeaccelerator(o.name,g.x,g.y)})},"populateDb"),ct={parser:{yy:void 0},parse:e(async(a)=>{let i=await se("wardley",a);n.debug(i);let o=ct.parser?.yy;if(!o||typeof o.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");It(i,o)},"parse")},Bt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(a){let i=this.nodes.get(a.id)??{id:a.id,label:a.label},o={...i,...a,className:a.className??i.className,labelOffsetX:a.labelOffsetX??i.labelOffsetX,labelOffsetY:a.labelOffsetY??i.labelOffsetY};this.nodes.set(a.id,o)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let i=this.nodes.get(a);if(i)i.isPipelineParent=!0}addPipelineComponent(a,i){let o=this.pipelines.get(a);if(o)o.componentIds.push(i);let g=this.nodes.get(i);if(g)g.inPipeline=!0}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,i){this.annotationsBox={x:a,y:i}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,i){this.size={width:a,height:i}}getNode(a){return this.nodes.get(a)}resolveNodeId(a){if(this.nodes.has(a))return a;for(let[i,o]of this.nodes)if(o.label===a)return i;return a}build(){let a=[];for(let i of this.nodes.values()){if(typeof i.x!=="number"||typeof i.y!=="number")throw Error(`Node "${i.label}" is missing coordinates`);a.push(i)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},P=new Bt;function pt(){return u()["wardley-beta"]}e(pt,"getConfig");function ht(a,i,o,g,r,c,b,T,w){P.addNode({id:a,label:i,x:o,y:g,className:r,labelOffsetX:c,labelOffsetY:b,inertia:T,sourceStrategy:w})}e(ht,"addNode");function ft(a,i,o=!1,g,r){P.addLink({source:a,target:i,dashed:o,label:g,flow:r})}e(ft,"addLink");function xt(a,i,o){P.addTrend({nodeId:a,targetX:i,targetY:o})}e(xt,"addTrend");function gt(a,i,o){P.addAnnotation({number:a,coordinates:i,text:o})}e(gt,"addAnnotation");function yt(a,i,o){P.addNote({text:a,x:i,y:o})}e(yt,"addNote");function ut(a,i,o){P.addAccelerator({name:a,x:i,y:o})}e(ut,"addAccelerator");function wt(a,i,o){P.addDeaccelerator({name:a,x:i,y:o})}e(wt,"addDeaccelerator");function mt(a,i){P.setAnnotationsBox(a,i)}e(mt,"setAnnotationsBox");function kt(a,i){P.setSize(a,i)}e(kt,"setSize");function bt(a){P.startPipeline(a)}e(bt,"startPipeline");function $t(a,i){P.addPipelineComponent(a,i)}e($t,"addPipelineComponent");function vt(a){P.setAxes(a)}e(vt,"updateAxes");function Pt(a){return P.getNode(a)}e(Pt,"getNode");function Ct(a){return P.resolveNodeId(a)}e(Ct,"resolveNodeId");function St(){return P.build()}e(St,"getWardleyData");function Mt(){P.clear(),A()}e(Mt,"clear");var Ft={getConfig:pt,addNode:ht,addLink:ft,addTrend:xt,addAnnotation:gt,addNote:yt,addAccelerator:ut,addDeaccelerator:wt,setAnnotationsBox:mt,setSize:kt,startPipeline:bt,addPipelineComponent:$t,updateAxes:vt,getNode:Pt,resolveNodeId:Ct,getWardleyData:St,clear:Mt,setAccTitle:L,getAccTitle:R,setDiagramTitle:D,getDiagramTitle:O,getAccDescription:M,setAccDescription:I},Rt=["Genesis","Custom Built","Product","Commodity"],Ot=e(()=>{let{themeVariables:a}=u();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),Dt=e(()=>{let a=u()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Gt=e((a,i,o,g)=>{n.debug(`Rendering Wardley map
2
- `+a);let r=Dt(),c=Ot(),b=r.nodeRadius*1.6,T=g.db,w=T.getWardleyData(),J=T.getDiagramTitle(),W=w.size?.width??r.width,C=w.size?.height??r.height,V=Y(i);V.selectAll("*").remove(),j(V,C,W,r.useMaxWidth),V.attr("viewBox",`0 0 ${W} ${C}`);let N=V.append("g").attr("class","wardley-map"),rt=V.append("defs");rt.append("marker").attr("id",`arrow-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.evolutionStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-end-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.linkStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-start-${i}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",c.linkStroke).attr("stroke","none"),N.append("rect").attr("class","wardley-background").attr("width",W).attr("height",C).attr("fill",c.backgroundColor);let _=W-r.padding*2,Z=C-r.padding*2;if(J)N.append("text").attr("class","wardley-title").attr("x",W/2).attr("y",r.padding/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(J);let H=e((t)=>r.padding+t/100*_,"projectX"),B=e((t)=>C-r.padding-t/100*Z,"projectY"),Q=N.append("g").attr("class","wardley-axes");Q.append("line").attr("x1",r.padding).attr("x2",W-r.padding).attr("y1",C-r.padding).attr("y2",C-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1),Q.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",C-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1);let Nt=w.axes.xLabel??"Evolution",zt=w.axes.yLabel??"Visibility";Q.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+_/2).attr("y",C-r.padding/4).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Nt),Q.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+Z/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+Z/2})`).text(zt);let U=w.axes.stages&&w.axes.stages.length>0?w.axes.stages:Rt;if(U.length>0){let t=N.append("g").attr("class","wardley-stages"),d=w.axes.stageBoundaries,s=[];if(d&&d.length===U.length){let l=0;d.forEach((h)=>{s.push({start:l,end:h}),l=h})}else{let l=1/U.length;U.forEach((h,f)=>{s.push({start:f*l,end:(f+1)*l})})}U.forEach((l,h)=>{let f=s[h],y=r.padding+f.start*_,x=r.padding+f.end*_,m=(y+x)/2;if(h>0)t.append("line").attr("x1",y).attr("x2",y).attr("y1",r.padding).attr("y2",C-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);t.append("text").attr("class","wardley-stage-label").attr("x",m).attr("y",C-r.padding/1.5).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(l)})}if(r.showGrid){let t=N.append("g").attr("class","wardley-grid");for(let d=1;d<4;d++){let s=d/4,l=r.padding+_*s;t.append("line").attr("x1",l).attr("x2",l).attr("y1",r.padding).attr("y2",C-r.padding).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",W-r.padding).attr("y1",C-r.padding-Z*s).attr("y2",C-r.padding-Z*s).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6")}}let p=new Map;if(w.nodes.forEach((t)=>{p.set(t.id,{x:H(t.x),y:B(t.y),node:t})}),w.pipelines.length>0){let t=N.append("g").attr("class","wardley-pipelines"),d=N.append("g").attr("class","wardley-pipeline-links");w.pipelines.forEach((s)=>{if(s.componentIds.length===0)return;let l=s.componentIds.map((x)=>({id:x,pos:p.get(x),node:w.nodes.find((m)=>m.id===x)})).filter((x)=>x.pos&&x.node).sort((x,m)=>x.node.x-m.node.x);for(let x=0;x<l.length-1;x++){let m=l[x],v=l[x+1];d.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",m.pos.x).attr("y1",m.pos.y).attr("x2",v.pos.x).attr("y2",v.pos.y).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,f=-1/0,y=0;if(s.componentIds.forEach((x)=>{let m=p.get(x);if(m)h=Math.min(h,m.x),f=Math.max(f,m.x),y=m.y}),h!==1/0&&f!==-1/0){let m=r.nodeRadius*4,v=y-m/2,z=p.get(s.nodeId);if(z){let E=(h+f)/2;z.x=E,z.y=v-b/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",v).attr("width",f-h+30).attr("height",m).attr("fill","none").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let st=N.append("g").attr("class","wardley-links"),it=new Map;w.pipelines.forEach((t)=>{it.set(t.nodeId,new Set(t.componentIds))});let dt=w.links.filter((t)=>{if(!p.has(t.source)||!p.has(t.target))return!1;if(it.get(t.target)?.has(t.source))return!1;return!0});st.selectAll("line").data(dt).enter().append("line").attr("class",(t)=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.x+f/x*h}).attr("y1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.y+y/x*h}).attr("x2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.x+f/x*h}).attr("y2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.y+y/x*h}).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(t)=>t.dashed?"6 6":null).attr("marker-end",(t)=>{if(t.flow==="forward"||t.flow==="bidirectional")return`url(#link-arrow-end-${i})`;return null}).attr("marker-start",(t)=>{if(t.flow==="backward"||t.flow==="bidirectional")return`url(#link-arrow-start-${i})`;return null}),st.selectAll("text").data(dt.filter((t)=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=s.y-d.y,f=s.x-d.x,y=Math.sqrt(f*f+h*h),x=8,m=h/y;return l+m*8}).attr("y",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.y+s.y)/2,h=s.x-d.x,f=s.y-d.y,y=Math.sqrt(h*h+f*f),x=8,m=-h/y;return l+m*8}).attr("fill",c.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=(d.y+s.y)/2,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y),m=8,v=y/x,z=-f/x,E=l+v*8,tt=h+z*8,q=Math.atan2(y,f)*180/Math.PI;if(q>90||q<-90)q+=180;return`rotate(${q} ${E} ${tt})`}).text((t)=>t.label);let Lt=N.append("g").attr("class","wardley-trends"),Tt=w.trends.map((t)=>{let d=p.get(t.nodeId);if(!d)return null;let s=H(t.targetX),l=B(t.targetY),h=s-d.x,f=l-d.y,y=Math.sqrt(h*h+f*f),x=r.nodeRadius+2,m=y>x?s-h/y*x:s,v=y>x?l-f/y*x:l;return{origin:d,targetX:s,targetY:l,adjustedX2:m,adjustedY2:v}}).filter((t)=>t!==null);Lt.selectAll("line").data(Tt).enter().append("line").attr("class","wardley-trend").attr("x1",(t)=>t.origin.x).attr("y1",(t)=>t.origin.y).attr("x2",(t)=>t.adjustedX2).attr("y2",(t)=>t.adjustedY2).attr("stroke",c.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${i})`);let X=N.append("g").attr("class","wardley-nodes").selectAll("g").data(w.nodes).enter().append("g").attr("class",(t)=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));X.filter((t)=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",c.componentStroke).attr("stroke-width",1),X.filter((t)=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",c.componentStroke).attr("stroke-width",1),X.filter((t)=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let F=X.filter((t)=>t.sourceStrategy==="market");F.append("circle").attr("class","wardley-market-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),X.filter((t)=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1);let ot=r.nodeRadius*0.7,S=r.nodeRadius*1.2;if(F.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x).attr("y1",(t)=>p.get(t.id).y-S).attr("x2",(t)=>p.get(t.id).x-S*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+S*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),F.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x-S*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+S*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x+S*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+S*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),F.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x+S*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+S*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x).attr("y2",(t)=>p.get(t.id).y-S).attr("stroke",c.componentStroke).attr("stroke-width",1),F.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y-S).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),F.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x-S*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+S*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),F.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x+S*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+S*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),X.filter((t)=>t.isPipelineParent===!0).append("rect").attr("x",(t)=>p.get(t.id).x-b/2).attr("y",(t)=>p.get(t.id).y-b/2).attr("width",b).attr("height",b).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1),X.filter((t)=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y-s/2}).attr("x2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y+s/2}).attr("stroke",c.componentStroke).attr("stroke-width",6),X.append("text").attr("x",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?d.x+t.labelOffsetX:d.x;let s=r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetX===void 0)s+=10;let l=t.labelOffsetX??s;return d.x+l}).attr("y",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?d.y+t.labelOffsetY:d.y-3;let s=-r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetY===void 0)s-=10;let l=t.labelOffsetY??s;return d.y+l}).attr("class","wardley-node-label").attr("fill",(t)=>{if(t.className==="evolved")return c.evolutionStroke;if(t.className==="anchor")return"#000";return c.componentLabelColor}).attr("font-size",r.labelFontSize).attr("font-weight",(t)=>t.className==="anchor"?"bold":"normal").attr("text-anchor",(t)=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",(t)=>t.className==="anchor"?"middle":"auto").text((t)=>t.label),w.annotations.length>0){let t=N.append("g").attr("class","wardley-annotations");if(w.annotations.forEach((d)=>{let s=d.coordinates.map((l)=>({x:H(l.x),y:B(l.y)}));if(s.length>1)for(let l=0;l<s.length-1;l++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[l].x).attr("y1",s[l].y).attr("x2",s[l+1].x).attr("y2",s[l+1].y).attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach((l)=>{let h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",l.x).attr("cy",l.y).attr("r",10).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",l.x).attr("y",l.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.number)})}),w.annotationsBox){let d=H(w.annotationsBox.x),s=B(w.annotationsBox.y),l=10,h=16,f=11,y=t.append("g").attr("class","wardley-annotations-box"),x=[...w.annotations].filter((v)=>v.text).sort((v,z)=>v.number-z.number),m=[];if(x.forEach((v,z)=>{let E=y.append("text").attr("x",d+l).attr("y",s+l+(z+1)*h).attr("font-size",f).attr("fill",c.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${v.number}. ${v.text}`);m.push(E)}),m.length>0){let v=0,z=0;m.forEach((nt)=>{let et=nt.node(),Et=et.getComputedTextLength();v=Math.max(v,Et);let Ht=et.getBBox();z=Math.max(z,Ht.height)});let E=v+l*2+105,tt=x.length*h+l*2+z/2,q=r.padding,Wt=W-r.padding-E,At=r.padding,Xt=C-r.padding-tt;d=Math.max(q,Math.min(d,Wt)),s=Math.max(At,Math.min(s,Xt)),m.forEach((nt,et)=>{nt.attr("x",d+l).attr("y",s+l+(et+1)*h)}),y.insert("rect","text").attr("x",d).attr("y",s).attr("width",E).attr("height",tt).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(w.notes.length>0){let t=N.append("g").attr("class","wardley-notes");w.notes.forEach((d)=>{let s=H(d.x),l=B(d.y);t.append("text").attr("x",s).attr("y",l).attr("text-anchor","start").attr("font-size",11).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.text)})}if(w.accelerators.length>0){let t=N.append("g").attr("class","wardley-accelerators");w.accelerators.forEach((d)=>{let s=H(d.x),l=B(d.y),h=60,f=30,y=20,x=`
1
+ import{ee}from"./index.0g1t1pjx.js";import{e,n,Ie,k,j,A,L,R,I,M,P,O,u,X,Y}from"./index.zkx4ryzt.js";import{oe}from"./index.6pzexww5.js";var at=e((a,i)=>{let o=a<=1?a*100:a;if(o<0||o>100)throw Error(`${i} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return o},"toPercent"),q=e((a,i,o)=>({x:at(i,`${o} evolution`),y:at(a,`${o} visibility`)}),"toCoordinates"),lt=e((a)=>{if(!a)return;if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward";return},"getFlowFromPort"),Yt=e((a)=>{if(!a?.startsWith("+"))return{};let o=/^\+'([^']*)'/.exec(a)?.[1];if(a.includes("<>"))return{flow:"bidirectional",label:o};if(a.includes("<"))return{flow:"backward",label:o};if(a.includes(">"))return{flow:"forward",label:o};return{label:o}},"extractFlowFromArrow"),It=e((a,i)=>{if(ee(a,i),a.size)i.setSize(a.size.width,a.size.height);if(a.evolution){let o=a.evolution.stages.map((r)=>{if(r.secondName)return`${r.name.trim()} / ${r.secondName.trim()}`;return r.name.trim()}),g=a.evolution.stages.filter((r)=>r.boundary!==void 0).map((r)=>r.boundary);i.updateAxes({stages:o,stageBoundaries:g})}if(a.anchors.forEach((o)=>{let g=q(o.visibility,o.evolution,`Anchor "${o.name}"`);i.addNode(o.name,o.name,g.x,g.y,"anchor")}),a.components.forEach((o)=>{let g=q(o.visibility,o.evolution,`Component "${o.name}"`),r=o.label?(o.label.negX?-1:1)*o.label.offsetX:void 0,c=o.label?(o.label.negY?-1:1)*o.label.offsetY:void 0,b=o.decorator?.strategy;i.addNode(o.name,o.name,g.x,g.y,"component",r,c,o.inertia,b)}),a.notes.forEach((o)=>{let g=q(o.visibility,o.evolution,`Note "${o.text}"`);i.addNote(o.text,g.x,g.y)}),a.pipelines.forEach((o)=>{let g=i.getNode(o.parent);if(!g||typeof g.y!=="number")throw Error(`Pipeline "${o.parent}" must reference an existing component with coordinates.`);let r=g.y;i.startPipeline(o.parent),o.components.forEach((c)=>{let b=`${o.parent}_${c.name}`,W=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,w=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,K=at(c.evolution,`Pipeline component "${c.name}" evolution`);i.addNode(b,c.name,K,r,"pipeline-component",W,w),i.addPipelineComponent(o.parent,b)})}),a.links.forEach((o)=>{let g=!!o.arrow&&(o.arrow.includes("-.->")||o.arrow.includes(".-.")),r=lt(o.fromPort)??lt(o.toPort),{flow:c,label:b}=Yt(o.arrow);if(!r&&c)r=c;let W=o.linkLabel,w=b??W;i.addLink(i.resolveNodeId(o.from),i.resolveNodeId(o.to),g,w,r)}),a.evolves.forEach((o)=>{let g=i.getNode(o.component);if(g?.y!==void 0){let r=at(o.target,`Evolve target for "${o.component}"`);i.addTrend(o.component,r,g.y)}}),a.annotations.length>0){let o=a.annotations[0],g=q(o.x,o.y,"Annotations box");i.setAnnotationsBox(g.x,g.y)}a.annotation.forEach((o)=>{let g=q(o.x,o.y,`Annotation ${o.number}`);i.addAnnotation(o.number,[{x:g.x,y:g.y}],o.text)}),a.accelerators.forEach((o)=>{let g=q(o.x,o.y,`Accelerator "${o.name}"`);i.addAccelerator(o.name,g.x,g.y)}),a.deaccelerators.forEach((o)=>{let g=q(o.x,o.y,`Deaccelerator "${o.name}"`);i.addDeaccelerator(o.name,g.x,g.y)})},"populateDb"),ct={parser:{yy:void 0},parse:e(async(a)=>{let i=await oe("wardley",a);n.debug(i);let o=ct.parser?.yy;if(!o||typeof o.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");It(i,o)},"parse")},Bt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(a){let i=this.nodes.get(a.id)??{id:a.id,label:a.label},o={...i,...a,className:a.className??i.className,labelOffsetX:a.labelOffsetX??i.labelOffsetX,labelOffsetY:a.labelOffsetY??i.labelOffsetY};this.nodes.set(a.id,o)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let i=this.nodes.get(a);if(i)i.isPipelineParent=!0}addPipelineComponent(a,i){let o=this.pipelines.get(a);if(o)o.componentIds.push(i);let g=this.nodes.get(i);if(g)g.inPipeline=!0}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,i){this.annotationsBox={x:a,y:i}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,i){this.size={width:a,height:i}}getNode(a){return this.nodes.get(a)}resolveNodeId(a){if(this.nodes.has(a))return a;for(let[i,o]of this.nodes)if(o.label===a)return i;return a}build(){let a=[];for(let i of this.nodes.values()){if(typeof i.x!=="number"||typeof i.y!=="number")throw Error(`Node "${i.label}" is missing coordinates`);a.push(i)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},C=new Bt;function pt(){return u()["wardley-beta"]}e(pt,"getConfig");function ht(a,i,o,g,r,c,b,W,w){C.addNode({id:a,label:i,x:o,y:g,className:r,labelOffsetX:c,labelOffsetY:b,inertia:W,sourceStrategy:w})}e(ht,"addNode");function ft(a,i,o=!1,g,r){C.addLink({source:a,target:i,dashed:o,label:g,flow:r})}e(ft,"addLink");function xt(a,i,o){C.addTrend({nodeId:a,targetX:i,targetY:o})}e(xt,"addTrend");function gt(a,i,o){C.addAnnotation({number:a,coordinates:i,text:o})}e(gt,"addAnnotation");function yt(a,i,o){C.addNote({text:a,x:i,y:o})}e(yt,"addNote");function ut(a,i,o){C.addAccelerator({name:a,x:i,y:o})}e(ut,"addAccelerator");function wt(a,i,o){C.addDeaccelerator({name:a,x:i,y:o})}e(wt,"addDeaccelerator");function mt(a,i){C.setAnnotationsBox(a,i)}e(mt,"setAnnotationsBox");function kt(a,i){C.setSize(a,i)}e(kt,"setSize");function bt(a){C.startPipeline(a)}e(bt,"startPipeline");function $t(a,i){C.addPipelineComponent(a,i)}e($t,"addPipelineComponent");function vt(a){C.setAxes(a)}e(vt,"updateAxes");function Pt(a){return C.getNode(a)}e(Pt,"getNode");function Ct(a){return C.resolveNodeId(a)}e(Ct,"resolveNodeId");function St(){return C.build()}e(St,"getWardleyData");function Mt(){C.clear(),A()}e(Mt,"clear");var Ft={getConfig:pt,addNode:ht,addLink:ft,addTrend:xt,addAnnotation:gt,addNote:yt,addAccelerator:ut,addDeaccelerator:wt,setAnnotationsBox:mt,setSize:kt,startPipeline:bt,addPipelineComponent:$t,updateAxes:vt,getNode:Pt,resolveNodeId:Ct,getWardleyData:St,clear:Mt,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I},Rt=["Genesis","Custom Built","Product","Commodity"],Ot=e(()=>{let{themeVariables:a}=u();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),Dt=e(()=>{let a=u()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Gt=e((a,i,o,g)=>{n.debug(`Rendering Wardley map
2
+ `+a);let r=Dt(),c=Ot(),b=r.nodeRadius*1.6,W=g.db,w=W.getWardleyData(),K=W.getDiagramTitle(),E=w.size?.width??r.width,S=w.size?.height??r.height,_=X(i);_.selectAll("*").remove(),j(_,S,E,r.useMaxWidth),_.attr("viewBox",`0 0 ${E} ${S}`);let z=_.append("g").attr("class","wardley-map"),rt=_.append("defs");rt.append("marker").attr("id",`arrow-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.evolutionStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-end-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.linkStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-start-${i}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",c.linkStroke).attr("stroke","none"),z.append("rect").attr("class","wardley-background").attr("width",E).attr("height",S).attr("fill",c.backgroundColor);let Z=E-r.padding*2,U=S-r.padding*2;if(K)z.append("text").attr("class","wardley-title").attr("x",E/2).attr("y",r.padding/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(K);let F=e((t)=>r.padding+t/100*Z,"projectX"),D=e((t)=>S-r.padding-t/100*U,"projectY"),Q=z.append("g").attr("class","wardley-axes");Q.append("line").attr("x1",r.padding).attr("x2",E-r.padding).attr("y1",S-r.padding).attr("y2",S-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1),Q.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1);let Nt=w.axes.xLabel??"Evolution",zt=w.axes.yLabel??"Visibility";Q.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+Z/2).attr("y",S-r.padding/4).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Nt),Q.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+U/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+U/2})`).text(zt);let J=w.axes.stages&&w.axes.stages.length>0?w.axes.stages:Rt;if(J.length>0){let t=z.append("g").attr("class","wardley-stages"),d=w.axes.stageBoundaries,s=[];if(d&&d.length===J.length){let l=0;d.forEach((h)=>{s.push({start:l,end:h}),l=h})}else{let l=1/J.length;J.forEach((h,f)=>{s.push({start:f*l,end:(f+1)*l})})}J.forEach((l,h)=>{let f=s[h],y=r.padding+f.start*Z,x=r.padding+f.end*Z,m=(y+x)/2;if(h>0)t.append("line").attr("x1",y).attr("x2",y).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);t.append("text").attr("class","wardley-stage-label").attr("x",m).attr("y",S-r.padding/1.5).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(l)})}if(r.showGrid){let t=z.append("g").attr("class","wardley-grid");for(let d=1;d<4;d++){let s=d/4,l=r.padding+Z*s;t.append("line").attr("x1",l).attr("x2",l).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",E-r.padding).attr("y1",S-r.padding-U*s).attr("y2",S-r.padding-U*s).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6")}}let p=new Map;if(w.nodes.forEach((t)=>{p.set(t.id,{x:F(t.x),y:D(t.y),node:t})}),w.pipelines.length>0){let t=z.append("g").attr("class","wardley-pipelines"),d=z.append("g").attr("class","wardley-pipeline-links");w.pipelines.forEach((s)=>{if(s.componentIds.length===0)return;let l=s.componentIds.map((x)=>({id:x,pos:p.get(x),node:w.nodes.find((m)=>m.id===x)})).filter((x)=>x.pos&&x.node).sort((x,m)=>x.node.x-m.node.x);for(let x=0;x<l.length-1;x++){let m=l[x],v=l[x+1];d.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",m.pos.x).attr("y1",m.pos.y).attr("x2",v.pos.x).attr("y2",v.pos.y).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,f=-1/0,y=0;if(s.componentIds.forEach((x)=>{let m=p.get(x);if(m)h=Math.min(h,m.x),f=Math.max(f,m.x),y=m.y}),h!==1/0&&f!==-1/0){let m=r.nodeRadius*4,v=y-m/2,T=p.get(s.nodeId);if(T){let B=(h+f)/2;T.x=B,T.y=v-b/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",v).attr("width",f-h+30).attr("height",m).attr("fill","none").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let st=z.append("g").attr("class","wardley-links"),it=new Map;w.pipelines.forEach((t)=>{it.set(t.nodeId,new Set(t.componentIds))});let dt=w.links.filter((t)=>{if(!p.has(t.source)||!p.has(t.target))return!1;if(it.get(t.target)?.has(t.source))return!1;return!0});st.selectAll("line").data(dt).enter().append("line").attr("class",(t)=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.x+f/x*h}).attr("y1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.y+y/x*h}).attr("x2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.x+f/x*h}).attr("y2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.y+y/x*h}).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(t)=>t.dashed?"6 6":null).attr("marker-end",(t)=>{if(t.flow==="forward"||t.flow==="bidirectional")return`url(#link-arrow-end-${i})`;return null}).attr("marker-start",(t)=>{if(t.flow==="backward"||t.flow==="bidirectional")return`url(#link-arrow-start-${i})`;return null}),st.selectAll("text").data(dt.filter((t)=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=s.y-d.y,f=s.x-d.x,y=Math.sqrt(f*f+h*h),x=8,m=h/y;return l+m*8}).attr("y",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.y+s.y)/2,h=s.x-d.x,f=s.y-d.y,y=Math.sqrt(h*h+f*f),x=8,m=-h/y;return l+m*8}).attr("fill",c.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=(d.y+s.y)/2,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y),m=8,v=y/x,T=-f/x,B=l+v*8,tt=h+T*8,V=Math.atan2(y,f)*180/Math.PI;if(V>90||V<-90)V+=180;return`rotate(${V} ${B} ${tt})`}).text((t)=>t.label);let Lt=z.append("g").attr("class","wardley-trends"),Tt=w.trends.map((t)=>{let d=p.get(t.nodeId);if(!d)return null;let s=F(t.targetX),l=D(t.targetY),h=s-d.x,f=l-d.y,y=Math.sqrt(h*h+f*f),x=r.nodeRadius+2,m=y>x?s-h/y*x:s,v=y>x?l-f/y*x:l;return{origin:d,targetX:s,targetY:l,adjustedX2:m,adjustedY2:v}}).filter((t)=>t!==null);Lt.selectAll("line").data(Tt).enter().append("line").attr("class","wardley-trend").attr("x1",(t)=>t.origin.x).attr("y1",(t)=>t.origin.y).attr("x2",(t)=>t.adjustedX2).attr("y2",(t)=>t.adjustedY2).attr("stroke",c.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${i})`);let H=z.append("g").attr("class","wardley-nodes").selectAll("g").data(w.nodes).enter().append("g").attr("class",(t)=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));H.filter((t)=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let G=H.filter((t)=>t.sourceStrategy==="market");G.append("circle").attr("class","wardley-market-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1);let ot=r.nodeRadius*0.7,N=r.nodeRadius*1.2;if(G.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x).attr("y1",(t)=>p.get(t.id).y-N).attr("x2",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),G.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),G.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x).attr("y2",(t)=>p.get(t.id).y-N).attr("stroke",c.componentStroke).attr("stroke-width",1),G.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y-N).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),G.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),G.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),H.filter((t)=>t.isPipelineParent===!0).append("rect").attr("x",(t)=>p.get(t.id).x-b/2).attr("y",(t)=>p.get(t.id).y-b/2).attr("width",b).attr("height",b).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y-s/2}).attr("x2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y+s/2}).attr("stroke",c.componentStroke).attr("stroke-width",6),H.append("text").attr("x",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?d.x+t.labelOffsetX:d.x;let s=r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetX===void 0)s+=10;let l=t.labelOffsetX??s;return d.x+l}).attr("y",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?d.y+t.labelOffsetY:d.y-3;let s=-r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetY===void 0)s-=10;let l=t.labelOffsetY??s;return d.y+l}).attr("class","wardley-node-label").attr("fill",(t)=>{if(t.className==="evolved")return c.evolutionStroke;if(t.className==="anchor")return"#000";return c.componentLabelColor}).attr("font-size",r.labelFontSize).attr("font-weight",(t)=>t.className==="anchor"?"bold":"normal").attr("text-anchor",(t)=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",(t)=>t.className==="anchor"?"middle":"auto").text((t)=>t.label),w.annotations.length>0){let t=z.append("g").attr("class","wardley-annotations");if(w.annotations.forEach((d)=>{let s=d.coordinates.map((l)=>({x:F(l.x),y:D(l.y)}));if(s.length>1)for(let l=0;l<s.length-1;l++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[l].x).attr("y1",s[l].y).attr("x2",s[l+1].x).attr("y2",s[l+1].y).attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach((l)=>{let h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",l.x).attr("cy",l.y).attr("r",10).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",l.x).attr("y",l.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.number)})}),w.annotationsBox){let d=F(w.annotationsBox.x),s=D(w.annotationsBox.y),l=10,h=16,f=11,y=t.append("g").attr("class","wardley-annotations-box"),x=[...w.annotations].filter((v)=>v.text).sort((v,T)=>v.number-T.number),m=[];if(x.forEach((v,T)=>{let B=y.append("text").attr("x",d+l).attr("y",s+l+(T+1)*h).attr("font-size",f).attr("fill",c.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${v.number}. ${v.text}`);m.push(B)}),m.length>0){let v=0,T=0;m.forEach((nt)=>{let et=nt.node(),Et=et.getComputedTextLength();v=Math.max(v,Et);let Ht=et.getBBox();T=Math.max(T,Ht.height)});let B=v+l*2+105,tt=x.length*h+l*2+T/2,V=r.padding,Wt=E-r.padding-B,At=r.padding,Xt=S-r.padding-tt;d=Math.max(V,Math.min(d,Wt)),s=Math.max(At,Math.min(s,Xt)),m.forEach((nt,et)=>{nt.attr("x",d+l).attr("y",s+l+(et+1)*h)}),y.insert("rect","text").attr("x",d).attr("y",s).attr("width",B).attr("height",tt).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(w.notes.length>0){let t=z.append("g").attr("class","wardley-notes");w.notes.forEach((d)=>{let s=F(d.x),l=D(d.y);t.append("text").attr("x",s).attr("y",l).attr("text-anchor","start").attr("font-size",11).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.text)})}if(w.accelerators.length>0){let t=z.append("g").attr("class","wardley-accelerators");w.accelerators.forEach((d)=>{let s=F(d.x),l=D(d.y),h=60,f=30,y=20,x=`
3
3
  M ${s} ${l-15}
4
4
  L ${s+60-20} ${l-15}
5
5
  L ${s+60-20} ${l-15-8}
@@ -8,7 +8,7 @@ import{ee}from"./index.3pn4wy4j.js";import{e,n,Me,k,j,A,L,R,I,M,D,O,u,Y,K}from".
8
8
  L ${s+60-20} ${l+15}
9
9
  L ${s} ${l+15}
10
10
  Z
11
- `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}if(w.deaccelerators.length>0){let t=N.append("g").attr("class","wardley-deaccelerators");w.deaccelerators.forEach((d)=>{let s=H(d.x),l=B(d.y),h=60,f=30,y=20,x=`
11
+ `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}if(w.deaccelerators.length>0){let t=z.append("g").attr("class","wardley-deaccelerators");w.deaccelerators.forEach((d)=>{let s=F(d.x),l=D(d.y),h=60,f=30,y=20,x=`
12
12
  M ${s+60} ${l-15}
13
13
  L ${s+20} ${l-15}
14
14
  L ${s+20} ${l-15-8}
@@ -17,7 +17,7 @@ import{ee}from"./index.3pn4wy4j.js";import{e,n,Me,k,j,A,L,R,I,M,D,O,u,Y,K}from".
17
17
  L ${s+20} ${l+15}
18
18
  L ${s+60} ${l+15}
19
19
  Z
20
- `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}},"draw"),qt={draw:Gt},jt=e(({wardley:a}={})=>{let i=Me(),o=k(),g=K(i,o.themeVariables),r=K(g.wardley,a);return`
20
+ `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}},"draw"),qt={draw:Gt},jt=e(({wardley:a}={})=>{let i=Ie(),o=k(),g=Y(i,o.themeVariables),r=Y(g.wardley,a);return`
21
21
  .wardley-background {
22
22
  fill: ${r.backgroundColor};
23
23
  }