agent-whiteboard 1.0.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 (163) hide show
  1. package/CHANGELOG.md +470 -0
  2. package/LICENSE +21 -0
  3. package/README.md +313 -0
  4. package/bin/cli.js +30 -0
  5. package/dist/client/apple-touch-icon.png +0 -0
  6. package/dist/client/assets/KaTeX_AMS-Regular-0cdd387c.woff2 +0 -0
  7. package/dist/client/assets/KaTeX_AMS-Regular-30da91e8.woff +0 -0
  8. package/dist/client/assets/KaTeX_AMS-Regular-68534840.ttf +0 -0
  9. package/dist/client/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf +0 -0
  10. package/dist/client/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff +0 -0
  11. package/dist/client/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 +0 -0
  12. package/dist/client/assets/KaTeX_Caligraphic-Regular-3398dd02.woff +0 -0
  13. package/dist/client/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 +0 -0
  14. package/dist/client/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf +0 -0
  15. package/dist/client/assets/KaTeX_Fraktur-Bold-74444efd.woff2 +0 -0
  16. package/dist/client/assets/KaTeX_Fraktur-Bold-9163df9c.ttf +0 -0
  17. package/dist/client/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff +0 -0
  18. package/dist/client/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf +0 -0
  19. package/dist/client/assets/KaTeX_Fraktur-Regular-51814d27.woff2 +0 -0
  20. package/dist/client/assets/KaTeX_Fraktur-Regular-5e28753b.woff +0 -0
  21. package/dist/client/assets/KaTeX_Main-Bold-0f60d1b8.woff2 +0 -0
  22. package/dist/client/assets/KaTeX_Main-Bold-138ac28d.ttf +0 -0
  23. package/dist/client/assets/KaTeX_Main-Bold-c76c5d69.woff +0 -0
  24. package/dist/client/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf +0 -0
  25. package/dist/client/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 +0 -0
  26. package/dist/client/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff +0 -0
  27. package/dist/client/assets/KaTeX_Main-Italic-0d85ae7c.ttf +0 -0
  28. package/dist/client/assets/KaTeX_Main-Italic-97479ca6.woff2 +0 -0
  29. package/dist/client/assets/KaTeX_Main-Italic-f1d6ef86.woff +0 -0
  30. package/dist/client/assets/KaTeX_Main-Regular-c2342cd8.woff2 +0 -0
  31. package/dist/client/assets/KaTeX_Main-Regular-c6368d87.woff +0 -0
  32. package/dist/client/assets/KaTeX_Main-Regular-d0332f52.ttf +0 -0
  33. package/dist/client/assets/KaTeX_Math-BoldItalic-850c0af5.woff +0 -0
  34. package/dist/client/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 +0 -0
  35. package/dist/client/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf +0 -0
  36. package/dist/client/assets/KaTeX_Math-Italic-08ce98e5.ttf +0 -0
  37. package/dist/client/assets/KaTeX_Math-Italic-7af58c5e.woff2 +0 -0
  38. package/dist/client/assets/KaTeX_Math-Italic-8a8d2445.woff +0 -0
  39. package/dist/client/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf +0 -0
  40. package/dist/client/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 +0 -0
  41. package/dist/client/assets/KaTeX_SansSerif-Bold-ece03cfd.woff +0 -0
  42. package/dist/client/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 +0 -0
  43. package/dist/client/assets/KaTeX_SansSerif-Italic-3931dd81.ttf +0 -0
  44. package/dist/client/assets/KaTeX_SansSerif-Italic-91ee6750.woff +0 -0
  45. package/dist/client/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff +0 -0
  46. package/dist/client/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 +0 -0
  47. package/dist/client/assets/KaTeX_SansSerif-Regular-f36ea897.ttf +0 -0
  48. package/dist/client/assets/KaTeX_Script-Regular-036d4e95.woff2 +0 -0
  49. package/dist/client/assets/KaTeX_Script-Regular-1c67f068.ttf +0 -0
  50. package/dist/client/assets/KaTeX_Script-Regular-d96cdf2b.woff +0 -0
  51. package/dist/client/assets/KaTeX_Size1-Regular-6b47c401.woff2 +0 -0
  52. package/dist/client/assets/KaTeX_Size1-Regular-95b6d2f1.ttf +0 -0
  53. package/dist/client/assets/KaTeX_Size1-Regular-c943cc98.woff +0 -0
  54. package/dist/client/assets/KaTeX_Size2-Regular-2014c523.woff +0 -0
  55. package/dist/client/assets/KaTeX_Size2-Regular-a6b2099f.ttf +0 -0
  56. package/dist/client/assets/KaTeX_Size2-Regular-d04c5421.woff2 +0 -0
  57. package/dist/client/assets/KaTeX_Size3-Regular-500e04d5.ttf +0 -0
  58. package/dist/client/assets/KaTeX_Size3-Regular-6ab6b62e.woff +0 -0
  59. package/dist/client/assets/KaTeX_Size4-Regular-99f9c675.woff +0 -0
  60. package/dist/client/assets/KaTeX_Size4-Regular-a4af7d41.woff2 +0 -0
  61. package/dist/client/assets/KaTeX_Size4-Regular-c647367d.ttf +0 -0
  62. package/dist/client/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 +0 -0
  63. package/dist/client/assets/KaTeX_Typewriter-Regular-e14fed02.woff +0 -0
  64. package/dist/client/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf +0 -0
  65. package/dist/client/assets/arc-4691b008.js +1 -0
  66. package/dist/client/assets/architecture-7EHR7CIX-e08620e8.js +1 -0
  67. package/dist/client/assets/architectureDiagram-3BPJPVTR-9e2f2dbd.js +36 -0
  68. package/dist/client/assets/blockDiagram-GPEHLZMM-d9dd3f7a.js +132 -0
  69. package/dist/client/assets/bootstrap.min-21652813.js +6 -0
  70. package/dist/client/assets/c4Diagram-AAUBKEIU-4ed97d79.js +10 -0
  71. package/dist/client/assets/channel-9d07a35d.js +1 -0
  72. package/dist/client/assets/chunk-2J33WTMH-8049adc8.js +1 -0
  73. package/dist/client/assets/chunk-4BX2VUAB-fd7396be.js +1 -0
  74. package/dist/client/assets/chunk-55IACEB6-ae1ac93c.js +1 -0
  75. package/dist/client/assets/chunk-727SXJPM-7e3658d9.js +206 -0
  76. package/dist/client/assets/chunk-AQP2D5EJ-114f64b0.js +231 -0
  77. package/dist/client/assets/chunk-FMBD7UC4-f2647c5e.js +15 -0
  78. package/dist/client/assets/chunk-ND2GUHAM-0a2fcd8c.js +1 -0
  79. package/dist/client/assets/chunk-QZHKN3VN-d00b3f33.js +1 -0
  80. package/dist/client/assets/classDiagram-4FO5ZUOK-ebb5cc4a.js +1 -0
  81. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-ebb5cc4a.js +1 -0
  82. package/dist/client/assets/colors-98f238a0.js +1 -0
  83. package/dist/client/assets/cose-bilkent-S5V4N54A-1f808fd7.js +1 -0
  84. package/dist/client/assets/cytoscape.esm-1491e259.js +331 -0
  85. package/dist/client/assets/dagre-BM42HDAG-e8ec1c9d.js +4 -0
  86. package/dist/client/assets/defaultLocale-a8476f12.js +1 -0
  87. package/dist/client/assets/diagram-2AECGRRQ-83b385bf.js +43 -0
  88. package/dist/client/assets/diagram-5GNKFQAL-d9406c6a.js +10 -0
  89. package/dist/client/assets/diagram-KO2AKTUF-3db5b95a.js +3 -0
  90. package/dist/client/assets/diagram-LMA3HP47-fbd90397.js +24 -0
  91. package/dist/client/assets/diagram-OG6HWLK6-3c697534.js +24 -0
  92. package/dist/client/assets/embed-2b4adf34.js +201 -0
  93. package/dist/client/assets/erDiagram-TEJ5UH35-7f41448f.js +85 -0
  94. package/dist/client/assets/eventmodeling-FCH6USID-e6d9019e.js +1 -0
  95. package/dist/client/assets/flowDiagram-I6XJVG4X-38f05cc7.js +162 -0
  96. package/dist/client/assets/ganttDiagram-6RSMTGT7-39287f5a.js +292 -0
  97. package/dist/client/assets/gitGraph-WXDBUCRP-037e225a.js +1 -0
  98. package/dist/client/assets/gitGraphDiagram-PVQCEYII-3c2e3ef7.js +106 -0
  99. package/dist/client/assets/graph-f3dfaf53.js +1 -0
  100. package/dist/client/assets/index-4abf3da0.js +5 -0
  101. package/dist/client/assets/index-a1656aec.js +1 -0
  102. package/dist/client/assets/index-d674a6a4.css +1 -0
  103. package/dist/client/assets/info-J43DQDTF-51cd3390.js +1 -0
  104. package/dist/client/assets/infoDiagram-5YYISTIA-ef2826b7.js +2 -0
  105. package/dist/client/assets/init-a5b10ee5.js +1 -0
  106. package/dist/client/assets/ishikawaDiagram-YF4QCWOH-d0b8a2e0.js +70 -0
  107. package/dist/client/assets/journeyDiagram-JHISSGLW-586ffcf8.js +139 -0
  108. package/dist/client/assets/kanban-definition-UN3LZRKU-9e58e14f.js +89 -0
  109. package/dist/client/assets/katex-0cba7652.js +257 -0
  110. package/dist/client/assets/katex-4c9ea27f.js +257 -0
  111. package/dist/client/assets/layout-3a4eff80.js +1 -0
  112. package/dist/client/assets/linear-fed00341.js +1 -0
  113. package/dist/client/assets/mermaid-parser.core-7ee09942.js +173 -0
  114. package/dist/client/assets/mermaid.core-9fc8f6d2.js +306 -0
  115. package/dist/client/assets/mindmap-definition-RKZ34NQL-a40dd09f.js +96 -0
  116. package/dist/client/assets/ordinal-db88ae6f.js +1 -0
  117. package/dist/client/assets/packet-YPE3B663-f55b568a.js +1 -0
  118. package/dist/client/assets/pie-LRSECV5Y-88c1a5e6.js +1 -0
  119. package/dist/client/assets/pieDiagram-4H26LBE5-51aae5ea.js +30 -0
  120. package/dist/client/assets/quadrantDiagram-W4KKPZXB-bc4686f9.js +7 -0
  121. package/dist/client/assets/radar-GUYGQ44K-6ede145d.js +1 -0
  122. package/dist/client/assets/range-6bc2a9a0.js +1 -0
  123. package/dist/client/assets/requirementDiagram-4Y6WPE33-8466f5a1.js +84 -0
  124. package/dist/client/assets/sankeyDiagram-5OEKKPKP-fd54c1f6.js +40 -0
  125. package/dist/client/assets/sequenceDiagram-3UESZ5HK-baa63c66.js +162 -0
  126. package/dist/client/assets/stateDiagram-AJRCARHV-bb4f0d0b.js +1 -0
  127. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-9479cd12.js +1 -0
  128. package/dist/client/assets/step-171ad54a.js +1 -0
  129. package/dist/client/assets/time-043b3464.js +1 -0
  130. package/dist/client/assets/timeline-definition-PNZ67QCA-f64b58bd.js +120 -0
  131. package/dist/client/assets/treeView-BLDUP644-73ba1a83.js +1 -0
  132. package/dist/client/assets/treemap-LRROVOQU-98e47821.js +1 -0
  133. package/dist/client/assets/vennDiagram-CIIHVFJN-a410b1f7.js +34 -0
  134. package/dist/client/assets/wardley-L42UT6IY-a27badb9.js +1 -0
  135. package/dist/client/assets/wardleyDiagram-YWT4CUSO-527ffe52.js +78 -0
  136. package/dist/client/assets/xychartDiagram-2RQKCTM6-42b5914b.js +7 -0
  137. package/dist/client/favicon-16x16.png +0 -0
  138. package/dist/client/favicon-32x32.png +0 -0
  139. package/dist/client/favicon.ico +0 -0
  140. package/dist/client/icon-192.png +0 -0
  141. package/dist/client/icon-512.png +0 -0
  142. package/dist/client/index.html +18 -0
  143. package/dist/server/app.js +429 -0
  144. package/dist/server/channel.js +42 -0
  145. package/dist/server/events.js +90 -0
  146. package/dist/server/export-html.js +461 -0
  147. package/dist/server/index.js +79 -0
  148. package/dist/server/interaction.js +135 -0
  149. package/dist/server/mcp.js +421 -0
  150. package/dist/server/paths.js +11 -0
  151. package/dist/server/persist.js +56 -0
  152. package/dist/server/presentation.js +5 -0
  153. package/dist/server/render-core.js +213 -0
  154. package/dist/server/session.js +103 -0
  155. package/dist/server/slideshow.js +83 -0
  156. package/dist/server/snapshot-reader.js +190 -0
  157. package/dist/server/snapshot-writer.js +117 -0
  158. package/dist/server/snapshot.js +47 -0
  159. package/dist/server/step-frames-builder.js +70 -0
  160. package/dist/server/validate.js +140 -0
  161. package/dist/server/viewport-cache.js +69 -0
  162. package/dist/server/ws.js +71 -0
  163. package/package.json +92 -0
@@ -0,0 +1 @@
1
+ import{R as de,r as Yn,o as Ze,q as Pe,C as Re,u as K,v as xn}from"./step-171ad54a.js";import{b as Hn,t as Se,c as Wn,a as Ln}from"./linear-fed00341.js";import{i as Nn}from"./init-a5b10ee5.js";function ur(e,n){let t;if(n===void 0)for(const r of e)r!=null&&(t<r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let i of e)(i=n(i,++r,e))!=null&&(t<i||t===void 0&&i>=i)&&(t=i)}return t}function or(e,n){let t;if(n===void 0)for(const r of e)r!=null&&(t>r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let i of e)(i=n(i,++r,e))!=null&&(t>i||t===void 0&&i>=i)&&(t=i)}return t}const kn=Math.PI/180,In=180/Math.PI,ee=18,qe=.96422,ze=1,Qe=.82521,Ve=4/29,Q=6/29,_e=3*Q*Q,On=Q*Q*Q;function Je(e){if(e instanceof x)return new x(e.l,e.a,e.b,e.opacity);if(e instanceof L)return Xe(e);e instanceof de||(e=Yn(e));var n=fe(e.r),t=fe(e.g),r=fe(e.b),i=ce((.2225045*n+.7168786*t+.0606169*r)/ze),o,c;return n===t&&t===r?o=c=i:(o=ce((.4360747*n+.3850649*t+.1430804*r)/qe),c=ce((.0139322*n+.0971045*t+.7141733*r)/Qe)),new x(116*i-16,500*(o-i),200*(i-c),e.opacity)}function An(e,n,t,r){return arguments.length===1?Je(e):new x(e,n,t,r??1)}function x(e,n,t,r){this.l=+e,this.a=+n,this.b=+t,this.opacity=+r}Ze(x,An,Pe(Re,{brighter(e){return new x(this.l+ee*(e??1),this.a,this.b,this.opacity)},darker(e){return new x(this.l-ee*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,n=isNaN(this.a)?e:e+this.a/500,t=isNaN(this.b)?e:e-this.b/200;return n=qe*se(n),e=ze*se(e),t=Qe*se(t),new de(le(3.1338561*n-1.6168667*e-.4906146*t),le(-.9787684*n+1.9161415*e+.033454*t),le(.0719453*n-.2289914*e+1.4052427*t),this.opacity)}}));function ce(e){return e>On?Math.pow(e,1/3):e/_e+Ve}function se(e){return e>Q?e*e*e:_e*(e-Ve)}function le(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function fe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dn(e){if(e instanceof L)return new L(e.h,e.c,e.l,e.opacity);if(e instanceof x||(e=Je(e)),e.a===0&&e.b===0)return new L(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var n=Math.atan2(e.b,e.a)*In;return new L(n<0?n+360:n,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Me(e,n,t,r){return arguments.length===1?dn(e):new L(e,n,t,r??1)}function L(e,n,t,r){this.h=+e,this.c=+n,this.l=+t,this.opacity=+r}function Xe(e){if(isNaN(e.h))return new x(e.l,0,0,e.opacity);var n=e.h*kn;return new x(e.l,Math.cos(n)*e.c,Math.sin(n)*e.c,e.opacity)}Ze(L,Me,Pe(Re,{brighter(e){return new L(this.h,this.c,this.l+ee*(e??1),this.opacity)},darker(e){return new L(this.h,this.c,this.l-ee*(e??1),this.opacity)},rgb(){return Xe(this).rgb()}}));function Be(e){return function(n,t){var r=e((n=Me(n)).h,(t=Me(t)).h),i=K(n.c,t.c),o=K(n.l,t.l),c=K(n.opacity,t.opacity);return function(h){return n.h=r(h),n.c=i(h),n.l=o(h),n.opacity=c(h),n+""}}}const ar=Be(xn);var ir=Be(K);function Zn(e,n){e=e.slice();var t=0,r=e.length-1,i=e[t],o=e[r],c;return o<i&&(c=t,t=r,r=c,c=i,i=o,o=c),e[t]=n.floor(i),e[r]=n.ceil(o),e}const ge=new Date,he=new Date;function M(e,n,t,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),n(o,1),e(o),o),i.round=o=>{const c=i(o),h=i.ceil(o);return o-c<h-o?c:h},i.offset=(o,c)=>(n(o=new Date(+o),c==null?1:Math.floor(c)),o),i.range=(o,c,h)=>{const U=[];if(o=i.ceil(o),h=h==null?1:Math.floor(h),!(o<c)||!(h>0))return U;let y;do U.push(y=new Date(+o)),n(o,h),e(o);while(y<o&&o<c);return U},i.filter=o=>M(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,h)=>{if(c>=c)if(h<0)for(;++h<=0;)for(;n(c,-1),!o(c););else for(;--h>=0;)for(;n(c,1),!o(c););}),t&&(i.count=(o,c)=>(ge.setTime(+o),he.setTime(+c),e(ge),e(he),Math.floor(t(ge,he))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?c=>r(c)%o===0:c=>i.count(0,c)%o===0):i)),i}const ne=M(()=>{},(e,n)=>{e.setTime(+e+n)},(e,n)=>n-e);ne.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?M(n=>{n.setTime(Math.floor(n/e)*e)},(n,t)=>{n.setTime(+n+t*e)},(n,t)=>(t-n)/e):ne);ne.range;const N=1e3,Y=N*60,k=Y*60,I=k*24,Ce=I*7,Fe=I*30,me=I*365,z=M(e=>{e.setTime(e-e.getMilliseconds())},(e,n)=>{e.setTime(+e+n*N)},(e,n)=>(n-e)/N,e=>e.getUTCSeconds());z.range;const Ue=M(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*N)},(e,n)=>{e.setTime(+e+n*Y)},(e,n)=>(n-e)/Y,e=>e.getMinutes());Ue.range;const $e=M(e=>{e.setUTCSeconds(0,0)},(e,n)=>{e.setTime(+e+n*Y)},(e,n)=>(n-e)/Y,e=>e.getUTCMinutes());$e.range;const De=M(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*N-e.getMinutes()*Y)},(e,n)=>{e.setTime(+e+n*k)},(e,n)=>(n-e)/k,e=>e.getHours());De.range;const je=M(e=>{e.setUTCMinutes(0,0,0)},(e,n)=>{e.setTime(+e+n*k)},(e,n)=>(n-e)/k,e=>e.getUTCHours());je.range;const G=M(e=>e.setHours(0,0,0,0),(e,n)=>e.setDate(e.getDate()+n),(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Y)/I,e=>e.getDate()-1);G.range;const pe=M(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/I,e=>e.getUTCDate()-1);pe.range;const Ge=M(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/I,e=>Math.floor(e/I));Ge.range;function P(e){return M(n=>{n.setDate(n.getDate()-(n.getDay()+7-e)%7),n.setHours(0,0,0,0)},(n,t)=>{n.setDate(n.getDate()+t*7)},(n,t)=>(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*Y)/Ce)}const ue=P(0),te=P(1),Pn=P(2),Rn=P(3),V=P(4),qn=P(5),zn=P(6);ue.range;te.range;Pn.range;Rn.range;V.range;qn.range;zn.range;function R(e){return M(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-e)%7),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t*7)},(n,t)=>(t-n)/Ce)}const ve=R(0),re=R(1),Qn=R(2),Vn=R(3),_=R(4),_n=R(5),Jn=R(6);ve.range;re.range;Qn.range;Vn.range;_.range;_n.range;Jn.range;const we=M(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,n)=>{e.setMonth(e.getMonth()+n)},(e,n)=>n.getMonth()-e.getMonth()+(n.getFullYear()-e.getFullYear())*12,e=>e.getMonth());we.range;const Ee=M(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCMonth(e.getUTCMonth()+n)},(e,n)=>n.getUTCMonth()-e.getUTCMonth()+(n.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Ee.range;const O=M(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n)},(e,n)=>n.getFullYear()-e.getFullYear(),e=>e.getFullYear());O.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:M(n=>{n.setFullYear(Math.floor(n.getFullYear()/e)*e),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,t)=>{n.setFullYear(n.getFullYear()+t*e)});O.range;const d=M(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n)},(e,n)=>n.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());d.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:M(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/e)*e),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCFullYear(n.getUTCFullYear()+t*e)});d.range;function Ke(e,n,t,r,i,o){const c=[[z,1,N],[z,5,5*N],[z,15,15*N],[z,30,30*N],[o,1,Y],[o,5,5*Y],[o,15,15*Y],[o,30,30*Y],[i,1,k],[i,3,3*k],[i,6,6*k],[i,12,12*k],[r,1,I],[r,2,2*I],[t,1,Ce],[n,1,Fe],[n,3,3*Fe],[e,1,me]];function h(y,T,F){const D=T<y;D&&([y,T]=[T,y]);const w=F&&typeof F.range=="function"?F:U(y,T,F),A=w?w.range(y,+T+1):[];return D?A.reverse():A}function U(y,T,F){const D=Math.abs(T-y)/F,w=Hn(([,,X])=>X).right(c,D);if(w===c.length)return e.every(Se(y/me,T/me,F));if(w===0)return ne.every(Math.max(Se(y,T,F),1));const[A,J]=c[D/c[w-1][2]<c[w][2]/D?w-1:w];return A.every(J)}return[h,U]}const[cr,sr]=Ke(d,Ee,ve,Ge,je,$e),[Xn,Bn]=Ke(O,we,ue,G,De,Ue);function ye(e){if(0<=e.y&&e.y<100){var n=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return n.setFullYear(e.y),n}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Te(e){if(0<=e.y&&e.y<100){var n=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return n.setUTCFullYear(e.y),n}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function B(e,n,t){return{y:e,m:n,d:t,H:0,M:0,S:0,L:0}}function $n(e){var n=e.dateTime,t=e.date,r=e.time,i=e.periods,o=e.days,c=e.shortDays,h=e.months,U=e.shortMonths,y=$(i),T=j(i),F=$(o),D=j(o),w=$(c),A=j(c),J=$(h),X=j(h),oe=$(U),ae=j(U),H={a:yn,A:Tn,b:Mn,B:Cn,c:null,d:Ne,e:Ne,f:Ct,g:xt,G:Wt,H:yt,I:Tt,j:Mt,L:en,m:Ut,M:Dt,p:Un,q:Dn,Q:Oe,s:Ae,S:pt,u:vt,U:wt,V:bt,w:St,W:Ft,x:null,X:null,y:Yt,Y:Ht,Z:Lt,"%":Ie},W={a:pn,A:vn,b:wn,B:bn,c:null,d:ke,e:ke,f:Ot,g:_t,G:Xt,H:Nt,I:kt,j:It,L:tn,m:At,M:dt,p:Sn,q:Fn,Q:Oe,s:Ae,S:Zt,u:Pt,U:Rt,V:qt,w:zt,W:Qt,x:null,X:null,y:Vt,Y:Jt,Z:Bt,"%":Ie},ie={a:cn,A:sn,b:ln,B:fn,c:gn,d:We,e:We,f:ft,g:He,G:xe,H:Le,I:Le,j:it,L:lt,m:at,M:ct,p:an,q:ot,Q:ht,s:mt,S:st,u:et,U:nt,V:tt,w:Kn,W:rt,x:hn,X:mn,y:He,Y:xe,Z:ut,"%":gt};H.x=s(t,H),H.X=s(r,H),H.c=s(n,H),W.x=s(t,W),W.X=s(r,W),W.c=s(n,W);function s(a,l){return function(f){var u=[],v=-1,m=0,b=a.length,S,Z,be;for(f instanceof Date||(f=new Date(+f));++v<b;)a.charCodeAt(v)===37&&(u.push(a.slice(m,v)),(Z=Ye[S=a.charAt(++v)])!=null?S=a.charAt(++v):Z=S==="e"?" ":"0",(be=l[S])&&(S=be(f,Z)),u.push(S),m=v+1);return u.push(a.slice(m,v)),u.join("")}}function p(a,l){return function(f){var u=B(1900,void 0,1),v=E(u,a,f+="",0),m,b;if(v!=f.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(u.s*1e3+("L"in u?u.L:0));if(l&&!("Z"in u)&&(u.Z=0),"p"in u&&(u.H=u.H%12+u.p*12),u.m===void 0&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)return null;"w"in u||(u.w=1),"Z"in u?(m=Te(B(u.y,0,1)),b=m.getUTCDay(),m=b>4||b===0?re.ceil(m):re(m),m=pe.offset(m,(u.V-1)*7),u.y=m.getUTCFullYear(),u.m=m.getUTCMonth(),u.d=m.getUTCDate()+(u.w+6)%7):(m=ye(B(u.y,0,1)),b=m.getDay(),m=b>4||b===0?te.ceil(m):te(m),m=G.offset(m,(u.V-1)*7),u.y=m.getFullYear(),u.m=m.getMonth(),u.d=m.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),b="Z"in u?Te(B(u.y,0,1)).getUTCDay():ye(B(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+u.W*7-(b+5)%7:u.w+u.U*7-(b+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,Te(u)):ye(u)}}function E(a,l,f,u){for(var v=0,m=l.length,b=f.length,S,Z;v<m;){if(u>=b)return-1;if(S=l.charCodeAt(v++),S===37){if(S=l.charAt(v++),Z=ie[S in Ye?l.charAt(v++):S],!Z||(u=Z(a,f,u))<0)return-1}else if(S!=f.charCodeAt(u++))return-1}return u}function an(a,l,f){var u=y.exec(l.slice(f));return u?(a.p=T.get(u[0].toLowerCase()),f+u[0].length):-1}function cn(a,l,f){var u=w.exec(l.slice(f));return u?(a.w=A.get(u[0].toLowerCase()),f+u[0].length):-1}function sn(a,l,f){var u=F.exec(l.slice(f));return u?(a.w=D.get(u[0].toLowerCase()),f+u[0].length):-1}function ln(a,l,f){var u=oe.exec(l.slice(f));return u?(a.m=ae.get(u[0].toLowerCase()),f+u[0].length):-1}function fn(a,l,f){var u=J.exec(l.slice(f));return u?(a.m=X.get(u[0].toLowerCase()),f+u[0].length):-1}function gn(a,l,f){return E(a,n,l,f)}function hn(a,l,f){return E(a,t,l,f)}function mn(a,l,f){return E(a,r,l,f)}function yn(a){return c[a.getDay()]}function Tn(a){return o[a.getDay()]}function Mn(a){return U[a.getMonth()]}function Cn(a){return h[a.getMonth()]}function Un(a){return i[+(a.getHours()>=12)]}function Dn(a){return 1+~~(a.getMonth()/3)}function pn(a){return c[a.getUTCDay()]}function vn(a){return o[a.getUTCDay()]}function wn(a){return U[a.getUTCMonth()]}function bn(a){return h[a.getUTCMonth()]}function Sn(a){return i[+(a.getUTCHours()>=12)]}function Fn(a){return 1+~~(a.getUTCMonth()/3)}return{format:function(a){var l=s(a+="",H);return l.toString=function(){return a},l},parse:function(a){var l=p(a+="",!1);return l.toString=function(){return a},l},utcFormat:function(a){var l=s(a+="",W);return l.toString=function(){return a},l},utcParse:function(a){var l=p(a+="",!0);return l.toString=function(){return a},l}}}var Ye={"-":"",_:" ",0:"0"},C=/^\s*\d+/,jn=/^%/,Gn=/[\\^$*+?|[\]().{}]/g;function g(e,n,t){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<t?new Array(t-o+1).join(n)+i:i)}function En(e){return e.replace(Gn,"\\$&")}function $(e){return new RegExp("^(?:"+e.map(En).join("|")+")","i")}function j(e){return new Map(e.map((n,t)=>[n.toLowerCase(),t]))}function Kn(e,n,t){var r=C.exec(n.slice(t,t+1));return r?(e.w=+r[0],t+r[0].length):-1}function et(e,n,t){var r=C.exec(n.slice(t,t+1));return r?(e.u=+r[0],t+r[0].length):-1}function nt(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.U=+r[0],t+r[0].length):-1}function tt(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.V=+r[0],t+r[0].length):-1}function rt(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.W=+r[0],t+r[0].length):-1}function xe(e,n,t){var r=C.exec(n.slice(t,t+4));return r?(e.y=+r[0],t+r[0].length):-1}function He(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),t+r[0].length):-1}function ut(e,n,t){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(t,t+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),t+r[0].length):-1}function ot(e,n,t){var r=C.exec(n.slice(t,t+1));return r?(e.q=r[0]*3-3,t+r[0].length):-1}function at(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.m=r[0]-1,t+r[0].length):-1}function We(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.d=+r[0],t+r[0].length):-1}function it(e,n,t){var r=C.exec(n.slice(t,t+3));return r?(e.m=0,e.d=+r[0],t+r[0].length):-1}function Le(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.H=+r[0],t+r[0].length):-1}function ct(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.M=+r[0],t+r[0].length):-1}function st(e,n,t){var r=C.exec(n.slice(t,t+2));return r?(e.S=+r[0],t+r[0].length):-1}function lt(e,n,t){var r=C.exec(n.slice(t,t+3));return r?(e.L=+r[0],t+r[0].length):-1}function ft(e,n,t){var r=C.exec(n.slice(t,t+6));return r?(e.L=Math.floor(r[0]/1e3),t+r[0].length):-1}function gt(e,n,t){var r=jn.exec(n.slice(t,t+1));return r?t+r[0].length:-1}function ht(e,n,t){var r=C.exec(n.slice(t));return r?(e.Q=+r[0],t+r[0].length):-1}function mt(e,n,t){var r=C.exec(n.slice(t));return r?(e.s=+r[0],t+r[0].length):-1}function Ne(e,n){return g(e.getDate(),n,2)}function yt(e,n){return g(e.getHours(),n,2)}function Tt(e,n){return g(e.getHours()%12||12,n,2)}function Mt(e,n){return g(1+G.count(O(e),e),n,3)}function en(e,n){return g(e.getMilliseconds(),n,3)}function Ct(e,n){return en(e,n)+"000"}function Ut(e,n){return g(e.getMonth()+1,n,2)}function Dt(e,n){return g(e.getMinutes(),n,2)}function pt(e,n){return g(e.getSeconds(),n,2)}function vt(e){var n=e.getDay();return n===0?7:n}function wt(e,n){return g(ue.count(O(e)-1,e),n,2)}function nn(e){var n=e.getDay();return n>=4||n===0?V(e):V.ceil(e)}function bt(e,n){return e=nn(e),g(V.count(O(e),e)+(O(e).getDay()===4),n,2)}function St(e){return e.getDay()}function Ft(e,n){return g(te.count(O(e)-1,e),n,2)}function Yt(e,n){return g(e.getFullYear()%100,n,2)}function xt(e,n){return e=nn(e),g(e.getFullYear()%100,n,2)}function Ht(e,n){return g(e.getFullYear()%1e4,n,4)}function Wt(e,n){var t=e.getDay();return e=t>=4||t===0?V(e):V.ceil(e),g(e.getFullYear()%1e4,n,4)}function Lt(e){var n=e.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+g(n/60|0,"0",2)+g(n%60,"0",2)}function ke(e,n){return g(e.getUTCDate(),n,2)}function Nt(e,n){return g(e.getUTCHours(),n,2)}function kt(e,n){return g(e.getUTCHours()%12||12,n,2)}function It(e,n){return g(1+pe.count(d(e),e),n,3)}function tn(e,n){return g(e.getUTCMilliseconds(),n,3)}function Ot(e,n){return tn(e,n)+"000"}function At(e,n){return g(e.getUTCMonth()+1,n,2)}function dt(e,n){return g(e.getUTCMinutes(),n,2)}function Zt(e,n){return g(e.getUTCSeconds(),n,2)}function Pt(e){var n=e.getUTCDay();return n===0?7:n}function Rt(e,n){return g(ve.count(d(e)-1,e),n,2)}function rn(e){var n=e.getUTCDay();return n>=4||n===0?_(e):_.ceil(e)}function qt(e,n){return e=rn(e),g(_.count(d(e),e)+(d(e).getUTCDay()===4),n,2)}function zt(e){return e.getUTCDay()}function Qt(e,n){return g(re.count(d(e)-1,e),n,2)}function Vt(e,n){return g(e.getUTCFullYear()%100,n,2)}function _t(e,n){return e=rn(e),g(e.getUTCFullYear()%100,n,2)}function Jt(e,n){return g(e.getUTCFullYear()%1e4,n,4)}function Xt(e,n){var t=e.getUTCDay();return e=t>=4||t===0?_(e):_.ceil(e),g(e.getUTCFullYear()%1e4,n,4)}function Bt(){return"+0000"}function Ie(){return"%"}function Oe(e){return+e}function Ae(e){return Math.floor(+e/1e3)}var q,un,$t,jt,Gt;Et({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Et(e){return q=$n(e),un=q.format,$t=q.parse,jt=q.utcFormat,Gt=q.utcParse,q}function Kt(e){return new Date(e)}function er(e){return e instanceof Date?+e:+new Date(+e)}function on(e,n,t,r,i,o,c,h,U,y){var T=Wn(),F=T.invert,D=T.domain,w=y(".%L"),A=y(":%S"),J=y("%I:%M"),X=y("%I %p"),oe=y("%a %d"),ae=y("%b %d"),H=y("%B"),W=y("%Y");function ie(s){return(U(s)<s?w:h(s)<s?A:c(s)<s?J:o(s)<s?X:r(s)<s?i(s)<s?oe:ae:t(s)<s?H:W)(s)}return T.invert=function(s){return new Date(F(s))},T.domain=function(s){return arguments.length?D(Array.from(s,er)):D().map(Kt)},T.ticks=function(s){var p=D();return e(p[0],p[p.length-1],s??10)},T.tickFormat=function(s,p){return p==null?ie:y(p)},T.nice=function(s){var p=D();return(!s||typeof s.range!="function")&&(s=n(p[0],p[p.length-1],s??10)),s?D(Zn(p,s)):T},T.copy=function(){return Ln(T,on(e,n,t,r,i,o,c,h,U,y))},T}function lr(){return Nn.apply(on(Xn,Bn,O,we,ue,G,De,Ue,z,un).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{je as A,pe as B,ve as C,Ee as D,d as E,sr as F,cr as G,O as H,$t as I,Gt as J,$n as K,Me as L,ur as a,un as b,we as c,G as d,De as e,Ue as f,ne as g,te as h,ar as i,Pn as j,Rn as k,V as l,or as m,qn as n,zn as o,ue as p,In as q,kn as r,z as s,lr as t,An as u,ir as v,Zn as w,on as x,jt as y,$e as z};
@@ -0,0 +1,120 @@
1
+ import{_ as c,B as Wt,S as Pt,t as Bt,j as J,E as pt,d as gt,l as S,T as ft,H as Vt,O as Ft,U as zt,V as Gt,W as Ot}from"./mermaid.core-9fc8f6d2.js";import{d as ot}from"./arc-4691b008.js";import"./index-4abf3da0.js";import"./step-171ad54a.js";var tt=function(){var e=c(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],l=[1,15],a=[1,16],o=[1,19],p=[1,20],y={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:c(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:l,20:a,21:17,22:18,23:o,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:l,20:a,21:17,22:18,23:o,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:c(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:c(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,C=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),R={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(R.yy[F]=this.yy[F]);_.setInput(s,R.yy),R.yy.lexer=_,R.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}c(U,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}c(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`:
2
+ `+_.showPosition()+`
3
+ Expecting `+D.join(", ")+", got '"+(this.terminals_[$]||$)+"'":K="Parse error on line "+(M+1)+": Unexpected "+($==V?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(K,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:z,expected:D})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+$);switch(b[0]){case 1:h.push($),m.push(_.yytext),u.push(_.yylloc),h.push(b[1]),$=null,C=_.yyleng,v=_.yytext,M=_.yylineno,z=_.yylloc;break;case 2:if(I=this.productions_[b[1]][1],E.$=m[m.length-I],E._$={first_line:u[u.length-(I||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(I||1)].first_column,last_column:u[u.length-1].last_column},q&&(E._$.range=[u[u.length-(I||1)].range[0],u[u.length-1].range[1]]),T=this.performAction.apply(E,[v,C,M,R.yy,b[1],m,u].concat(L)),typeof T<"u")return T;I&&(h=h.slice(0,-1*I*2),m=m.slice(0,-1*I),u=u.slice(0,-1*I)),h.push(this.productions_[b[1]][0]),m.push(E.$),u.push(E._$),B=w[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},x=function(){var k={EOF:1,parseError:c(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:c(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===g.length?this.yylloc.first_column:0)+g[g.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+d+"^"},"showPosition"),test_match:c(function(s,d){var h,g,m;if(this.options.backtrack_lexer&&(m={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&&(m.yylloc.range=this.yylloc.range.slice(0))),g=s[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],h=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var u in m)this[u]=m[u];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,h,g;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),u=0;u<m.length;u++)if(h=this._input.match(this.rules[m[u]]),h&&(!d||h[0].length>d[0].length)){if(d=h,g=u,this.options.backtrack_lexer){if(s=this.test_match(h,m[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,m[g]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var d=this.next();return d||this.lex()},"lex"),begin:c(function(d){this.conditionStack.push(d)},"begin"),popState:c(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:c(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:c(function(d){this.begin(d)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(d,h,g,m){switch(g){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k}();y.lexer=x;function f(){this.yy={}}return c(f,"Parser"),f.prototype=y,y.Parser=f,new f}();tt.parser=tt;var Dt=tt,yt={};Wt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Ut,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var X="",mt=0,nt="LR",rt=[],Q=[],Z=[],xt=c(()=>Pt,"getCommonDb"),kt=c(function(){rt.length=0,Q.length=0,X="",Z.length=0,nt="LR",Bt()},"clear"),vt=c(function(e){nt=e},"setDirection"),bt=c(function(){return nt},"getDirection"),_t=c(function(e){X=e,rt.push(e)},"addSection"),wt=c(function(){return rt},"getSections"),St=c(function(){let e=lt();const t=100;let n=0;for(;!e&&n<t;)e=lt(),n++;return Q.push(...Z),Q},"getTasks"),Et=c(function(e,t,n){const i={id:mt++,section:X,type:X,task:e,score:t||0,events:n?[n]:[]};Z.push(i)},"addTask"),Tt=c(function(e){Z.find(n=>n.id===mt-1).events.push(e)},"addEvent"),$t=c(function(e){const t={section:X,type:X,description:e,task:e,classes:[]};Q.push(t)},"addTaskOrg"),lt=c(function(){const e=c(function(n){return Z[n].processed},"compileTask");let t=!0;for(const[n,i]of Z.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Ut={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,j=c(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Kt=c(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function l(p){const y=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);p.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}c(l,"smile");function a(p){const y=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);p.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}c(a,"sad");function o(p){p.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return c(o,"ambivalent"),t.score>3?l(r):t.score<3?a(r):o(r),i},"drawFace"),Xt=c(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),It=c(function(e,t){const n=t.text.replace(/<br\s*\/?>/gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const r=i.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(n),i},"drawText"),Zt=c(function(e,t){function n(r,l,a,o,p){return r+","+l+" "+(r+a)+","+l+" "+(r+a)+","+(l+o-p)+" "+(r+a-p*1.2)+","+(l+o)+" "+r+","+(l+o)}c(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,It(e,t)},"drawLabel"),qt=c(function(e,t,n){const i=e.append("g"),r=st();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,j(i,r),Ht(n)(t.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),et=-1,Jt=c(function(e,t,n,i){const r=t.x+n.width/2,l=e.append("g");et++;const a=300+5*30;l.append("line").attr("id",i+"-task"+et).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Kt(l,{cx:r,cy:300+(5-t.score)*30,score:t.score});const o=st();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class="task task-type-"+t.num,o.rx=3,o.ry=3,j(l,o),Ht(n)(t.task,l,o.x,o.y,o.width,o.height,{class:"task"},n,t.colour)},"drawTask"),Qt=c(function(e,t){j(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),jt=c(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),st=c(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ht=function(){function e(r,l,a,o,p,y,x,f){const k=l.append("text").attr("x",a+p/2).attr("y",o+y/2+5).style("font-color",f).style("text-anchor","middle").text(r);i(k,x)}c(e,"byText");function t(r,l,a,o,p,y,x,f,k){const{taskFontSize:s,taskFontFamily:d}=f,h=r.split(/<br\s*\/?>/gi);for(let g=0;g<h.length;g++){const m=g*s-s*(h.length-1)/2,u=l.append("text").attr("x",a+p/2).attr("y",o).attr("fill",k).style("text-anchor","middle").style("font-size",s).style("font-family",d);u.append("tspan").attr("x",a+p/2).attr("dy",m).text(h[g]),u.attr("y",o+y/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(u,x)}}c(t,"byTspan");function n(r,l,a,o,p,y,x,f){const k=l.append("switch"),d=k.append("foreignObject").attr("x",a).attr("y",o).attr("width",p).attr("height",y).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,k,a,o,p,y,x,f),i(d,x)}c(n,"byFo");function i(r,l){for(const a in l)a in l&&r.attr(a,l[a])}return c(i,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?n:r.textPlacement==="old"?e:t}}(),Yt=c(function(e,t){Nt=0,et=-1,e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function it(e,t){e.each(function(){var n=J(this),i=n.text().split(/(\s+|<br>)/).reverse(),r,l=[],a=1.1,o=n.attr("y"),p=parseFloat(n.attr("dy")),y=n.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",p+"em");for(let x=0;x<i.length;x++)r=i[i.length-1-x],l.push(r),y.text(l.join(" ").trim()),(y.node().getComputedTextLength()>t||r==="<br>")&&(l.pop(),y.text(l.join(" ").trim()),r==="<br>"?l=[""]:l=[r],y=n.append("tspan").attr("x",0).attr("y",o).attr("dy",a+"em").text(r))})}c(it,"wrap");var te=c(function(e,t,n,i,r,l=!1){var m,u,w;const{theme:a,look:o}=i,p=a==null?void 0:a.includes("redux"),y=((m=i==null?void 0:i.themeVariables)==null?void 0:m.THEME_COLOR_LIMIT)??12,x=n%y-1,f=e.append("g");t.section=x,f.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+x));const k=f.append("g"),s=f.append("g"),h=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),g=(u=i.fontSize)!=null&&u.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=h.height+g*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),p&&s.attr("transform",`translate(${t.width/2}, ${l?t.padding/2+3:t.padding})`),ne(k,t,x,r,i),o==="neo"&&(f.attr("data-look","neo"),p)){const v=a.includes("dark"),M=((w=e.node())==null?void 0:w.ownerSVGElement)??e.node(),C=J(M),P=C.attr("id")??"",V=P?`${P}-drop-shadow`:"drop-shadow";if(C.select(`#${V}`).empty()){const L=C.select("defs");(L.empty()?C.append("defs"):L).append("filter").attr("id",V).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",v?"0.2":"0.06").attr("flood-color",v?"#FFFFFF":"#000000")}}return t},"drawNode"),ee=c(function(e,t,n){var o;const i=e.append("g"),l=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),a=(o=n.fontSize)!=null&&o.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),l.height+a*1.1*.5+t.padding},"getVirtualNodeHeight"),ne=c(function(e,t,n,i,r){const{theme:l}=r,a=l!=null&&l.includes("redux")?0:5,o=5,p=a>0?`M0 ${t.height-o} v${-t.height+2*o} q0,-${a},${a},-${a} h${t.width-2*o} q${a},0,${a},${a} v${t.height-o} H0 Z`:`M0 ${t.height-o} v${-(t.height-o)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+Nt++).attr("class","node-bkg node-"+t.type).attr("d",p),l!=null&&l.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),W={drawRect:j,drawCircle:Xt,drawSection:qt,drawText:It,drawLabel:Zt,drawTask:Jt,drawBackgroundRect:Qt,getTextObj:jt,getNoteRect:st,initGraphics:Yt,drawNode:te,getVirtualNodeHeight:ee},re=c(function(e,t,n,i){var U,O,$;const r=gt(),{look:l,theme:a,themeVariables:o}=r,{useGradient:p,gradientStart:y,gradientStop:x}=o,f=((U=r.timeline)==null?void 0:U.leftMargin)??50;S.debug("timeline",i.db);const k=r.securityLevel;let s;k==="sandbox"&&(s=J("#i"+t));const h=(k==="sandbox"?J(s.nodes()[0].contentDocument.body):J("body")).select("#"+t);h.append("g");const g=i.db.getTasks(),m=i.db.getCommonDb().getDiagramTitle();S.debug("task",g),W.initGraphics(h,t);const u=i.db.getSections();S.debug("sections",u);let w=0,v=0,M=0,C=0,P=50+f,V=50;C=50;let L=0,_=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:w},T=W.getVirtualNodeHeight(h,b,r);S.debug("sectionHeight before draw",T),w=Math.max(w,T+20)});let R=0,F=0;S.debug("tasks.length",g.length);for(const[N,b]of g.entries()){const T={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},E=W.getVirtualNodeHeight(h,T,r);S.debug("taskHeight before draw",E),v=Math.max(v,E+20),R=Math.max(R,b.events.length);let H=0;for(const I of b.events){const B={descr:I,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};H+=W.getVirtualNodeHeight(h,B,r)}b.events.length>0&&(H+=(b.events.length-1)*10),F=Math.max(F,H)}S.debug("maxSectionHeight before draw",w),S.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=g.filter(I=>I.section===N),T={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:w};S.debug("sectionNode",T);const E=h.append("g"),H=W.drawNode(E,T,L,r,t);S.debug("sectionNode output",H),E.attr("transform",`translate(${P}, ${C})`),V+=w+50,b.length>0&&ct(h,b,L,P,V,v,r,R,F,w,!1,t),P+=200*Math.max(b.length,1),V=C,L++}):(_=!1,ct(h,g,L,P,V,v,r,R,F,w,!0,t));const z=h.node().getBBox();if(S.debug("bounds",z),m&&h.append("text").text(m).attr("x",l==="neo"?z.x*2+f:z.width/2-f).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),M=_?w+v+150:v+100,h.append("g").attr("class","lineWrapper").append("line").attr("x1",f).attr("y1",M).attr("x2",z.width+3*f).attr("y2",M).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),l==="neo"&&p&&a!=="neutral"){const N=h.select("defs"),T=(N.empty()?h.append("defs"):N).append("linearGradient").attr("id",h.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");T.append("stop").attr("offset","0%").attr("stop-color",y).attr("stop-opacity",1),T.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}ft(void 0,h,((O=r.timeline)==null?void 0:O.padding)??50,(($=r.timeline)==null?void 0:$.useMaxWidth)??!1)},"draw"),ct=c(function(e,t,n,i,r,l,a,o,p,y,x,f){var k;for(const s of t){const d={descr:s.task,section:n,number:n,width:150,padding:20,maxHeight:l};S.debug("taskNode",d);const h=e.append("g").attr("class","taskWrapper"),m=W.drawNode(h,d,n,a,f).height;if(S.debug("taskHeight after draw",m),h.attr("transform",`translate(${i}, ${r})`),l=Math.max(l,m),s.events){const u=e.append("g").attr("class","lineWrapper");let w=l;r+=100,w=w+se(e,s.events,n,i,r,a,f),r-=100,u.append("line").attr("x1",i+190/2).attr("y1",r+l).attr("x2",i+190/2).attr("y2",r+l+100+p+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${f}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,x&&!((k=a.timeline)!=null&&k.disableMulticolor)&&n++}r=r-10},"drawTasks"),se=c(function(e,t,n,i,r,l,a){let o=0;const p=r;r=r+100;for(const y of t){const x={descr:y,section:n,number:n,width:150,padding:20,maxHeight:50};S.debug("eventNode",x);const f=e.append("g").attr("class","eventWrapper"),s=W.drawNode(f,x,n,l,a,!0).height;o=o+s,f.attr("transform",`translate(${i}, ${r})`),r=r+10+s}return r=p,o},"drawEvents"),ie={setConf:c(()=>{},"setConf"),draw:re},Y=200,G=5,ae=Y+G*2,at=Y+100,oe=at+G*2,Lt=10,le=0,ht=20,Mt=20,dt=30,At=50,ce=c(function(e,t,n,i){var U,O,$,N,b;const r=gt(),l=((U=r.timeline)==null?void 0:U.leftMargin)??50;S.debug("timeline",i.db);const a=Vt(t);a.append("g");const o=i.db.getTasks(),p=i.db.getCommonDb().getDiagramTitle();S.debug("task",o),W.initGraphics(a);const y=i.db.getSections();S.debug("sections",y);let x=0,f=0;const k=50+l;let s=50;const d=s,h=k,g=ae+Mt,m=oe+At,u=h+g;let w=0;const v=y&&y.length>0,M=v?u:k+g,C=Math.max(50,g+m-G*2);y.forEach(function(T){const E={number:w,descr:T,section:w,width:C,padding:G,maxHeight:x},H=W.getVirtualNodeHeight(a,E,r);S.debug("sectionHeight before draw",H),x=Math.max(x,H)});let P=0;S.debug("tasks.length",o.length);for(const[T,E]of o.entries()){const H={number:T,descr:E,section:E.section,width:Y,padding:G,maxHeight:f},I=W.getVirtualNodeHeight(a,H,r);S.debug("taskHeight before draw",I),f=Math.max(f,I);let B=0;for(const D of E.events){const K={descr:D,section:E.section,number:E.section,width:at,padding:G,maxHeight:50};B+=W.getVirtualNodeHeight(a,K,r)}E.events.length>0&&(B+=(E.events.length-1)*Lt),P=Math.max(P,B)+le}S.debug("maxSectionHeight before draw",x),S.debug("maxTaskHeight before draw",f);const L=Math.max(f,P)+dt;v?y.forEach(T=>{const E=o.filter(Ct=>Ct.section===T),H={number:w,descr:T,section:w,width:C,padding:G,maxHeight:x};S.debug("sectionNode",H);const I=a.append("g"),B=W.drawNode(I,H,w,r);S.debug("sectionNode output",B);const D=M-g;I.attr("transform",`translate(${D}, ${s})`);const K=s+B.height+ht;E.length>0&&ut(a,E,w,M,K,f,r,L,!1);const A=E.length,Rt=B.height+ht+L*Math.max(A,1)-(A>0?dt*2:0);s+=Rt,w++}):ut(a,o,w,M,s,f,r,L,!0);let _=(O=a.node())==null?void 0:O.getBBox();if(!_)throw new Error("bbox not found");if(S.debug("bounds",_),p){if(a.append("text").text(p).attr("x",_.width/2-l).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),_=($=a.node())==null?void 0:$.getBBox(),!_)throw new Error("bbox not found");S.debug("bounds after title",_)}const[R]=Ft(r.fontSize),F=(R??16)*2,z=(R??16)*.5+20,q=a.append("g").attr("class","lineWrapper");q.append("line").attr("x1",M).attr("y1",d-F).attr("x2",M).attr("y2",_.y+_.height+z).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),q.lower(),ft(void 0,a,((N=r.timeline)==null?void 0:N.padding)??50,((b=r.timeline)==null?void 0:b.useMaxWidth)??!1)},"draw"),ut=c(function(e,t,n,i,r,l,a,o,p){var y;for(const x of t){const f={descr:x.task,section:n,number:n,width:Y,padding:G,maxHeight:l};S.debug("taskNode",f);const k=e.append("g").attr("class","taskWrapper"),s=W.drawNode(k,f,n,a),d=s.height;S.debug("taskHeight after draw",d);const h=i-Mt-s.width;if(k.attr("transform",`translate(${h}, ${r})`),l=Math.max(l,d),x.events&&x.events.length>0){const g=r,m=i+At;he(e,x.events,n,i,m,g,a)}r=r+o,p&&!((y=a.timeline)!=null&&y.disableMulticolor)&&n++}},"drawTasks"),he=c(function(e,t,n,i,r,l,a){let o=l;for(const p of t){const y={descr:p,section:n,number:n,width:at,padding:G,maxHeight:0};S.debug("eventNode",y);const x=e.append("g").attr("class","eventWrapper"),k=W.drawNode(x,y,n,a).height;x.attr("transform",`translate(${r}, ${o})`);const s=e.append("g").attr("class","lineWrapper"),d=o+k/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+k+Lt}return o-l},"drawEvents"),de={setConf:c(()=>{},"setConf"),draw:ce},ue=c(e=>{var o;const{theme:t}=pt(),n=t==null?void 0:t.includes("dark"),i=t==null?void 0:t.includes("color"),r=((o=e.svgId)==null?void 0:o.replace(/^#/,""))??"",l=r?`url(#${r}-drop-shadow)`:e.dropShadow??"none";let a="";for(let p=0;p<e.THEME_COLOR_LIMIT;p++){const y=`${17-3*p}`,x=i?e.borderColorArray[p]:e.mainBkg,f=i?e.borderColorArray[p]:e.nodeBorder;a+=`
7
+ .section-${p-1} rect,
8
+ .section-${p-1} path,
9
+ .section-${p-1} circle {
10
+ fill: ${n&&i?e.mainBkg:x};
11
+ stroke: ${f};
12
+ stroke-width: ${e.strokeWidth};
13
+ filter: ${l};
14
+ }
15
+
16
+ .section-${p-1} text {
17
+ fill: ${e.nodeBorder};
18
+ font-weight: ${e.fontWeight}
19
+ }
20
+
21
+ .node-icon-${p-1} {
22
+ font-size: 40px;
23
+ color: ${e["cScaleLabel"+p]};
24
+ }
25
+
26
+ .section-edge-${p-1} {
27
+ stroke: ${e["cScale"+p]};
28
+ }
29
+
30
+ .edge-depth-${p-1} {
31
+ stroke-width: ${y};
32
+ }
33
+
34
+ .section-${p-1} line {
35
+ stroke: ${e["cScaleInv"+p]};
36
+ stroke-width: 3;
37
+ }
38
+
39
+ .lineWrapper line {
40
+ stroke: ${e.nodeBorder};
41
+ stroke-width:${e.strokeWidth}
42
+ }
43
+
44
+ .disabled,
45
+ .disabled circle,
46
+ .disabled text {
47
+ fill: ${e.tertiaryColor??"lightgray"};
48
+ }
49
+
50
+ .disabled text {
51
+ fill: ${e.clusterBorder??"#efefef"};
52
+ }
53
+ `}return a},"genReduxSections"),pe=c(e=>{let t="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],zt(e["lineColor"+n])?e["lineColor"+n]=Gt(e["lineColor"+n],20):e["lineColor"+n]=Ot(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);t+=`
54
+ .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {
55
+ fill: ${e["cScale"+n]};
56
+ }
57
+ .section-${n-1} text {
58
+ fill: ${e["cScaleLabel"+n]};
59
+ }
60
+ .node-icon-${n-1} {
61
+ font-size: 40px;
62
+ color: ${e["cScaleLabel"+n]};
63
+ }
64
+ .section-edge-${n-1}{
65
+ stroke: ${e["cScale"+n]};
66
+ }
67
+ .edge-depth-${n-1}{
68
+ stroke-width: ${i};
69
+ }
70
+ .section-${n-1} line {
71
+ stroke: ${e["cScaleInv"+n]} ;
72
+ stroke-width: 3;
73
+ }
74
+
75
+ .lineWrapper line{
76
+ stroke: ${e["cScaleLabel"+n]} ;
77
+ }
78
+
79
+ .disabled, .disabled circle, .disabled text {
80
+ fill: ${e.tertiaryColor??"lightgray"};
81
+ }
82
+ .disabled text {
83
+ fill: ${e.clusterBorder??"#efefef"};
84
+ }
85
+ `}return t},"genSections"),ge=c(e=>{var a;const{theme:t}=pt(),n=t==null?void 0:t.includes("redux"),i=t==="neutral",r=((a=e.svgId)==null?void 0:a.replace(/^#/,""))??"";let l="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let o=0;o<e.THEME_COLOR_LIMIT;o++)l+=`
86
+ .section-${o-1}[data-look="neo"] rect,
87
+ .section-${o-1}[data-look="neo"] path,
88
+ .section-${o-1}[data-look="neo"] circle {
89
+ fill: ${e.mainBkg};
90
+ stroke: url(#${r}-gradient);
91
+ stroke-width: 2;
92
+ }
93
+ .section-${o-1}[data-look="neo"] line {
94
+ stroke: url(#${r}-gradient);
95
+ stroke-width: 2;
96
+ }`;return`
97
+ .edge {
98
+ stroke-width: 3;
99
+ }
100
+ ${n?ue(e):pe(e)}
101
+ ${l}
102
+ .section-root rect, .section-root path, .section-root circle {
103
+ fill: ${e.git0};
104
+ }
105
+ .section-root text {
106
+ fill: ${e.gitBranchLabel0};
107
+ }
108
+ .icon-container {
109
+ height:100%;
110
+ display: flex;
111
+ justify-content: center;
112
+ align-items: center;
113
+ }
114
+ .edge {
115
+ fill: none;
116
+ }
117
+ .eventWrapper {
118
+ filter: brightness(120%);
119
+ }
120
+ `},"getStyles"),fe=ge,ye={setConf:c(()=>{},"setConf"),draw:c((e,t,n,i)=>{var l,a;return(((a=(l=i==null?void 0:i.db)==null?void 0:l.getDirection)==null?void 0:a.call(l))??"LR")==="TD"?de.draw(e,t,n,i):ie.draw(e,t,n,i)},"draw")},be={db:yt,renderer:ye,parser:Dt,styles:fe};export{be as diagram};
@@ -0,0 +1 @@
1
+ import{T as o,e as a}from"./mermaid-parser.core-7ee09942.js";import"./index-4abf3da0.js";export{o as TreeViewModule,a as createTreeViewServices};
@@ -0,0 +1 @@
1
+ import{j as m,k as o}from"./mermaid-parser.core-7ee09942.js";import"./index-4abf3da0.js";export{m as TreemapModule,o as createTreemapServices};
@@ -0,0 +1,34 @@
1
+ import{aE as Wt,_ as S,C as Gt,D as Kt,E as St,s as Ht,g as Yt,n as Xt,o as Zt,b as Jt,c as Qt,t as $t,H as te,j as rt,a3 as ee,U as ne,V as se,W as ie,k as re}from"./mermaid.core-9fc8f6d2.js";import"./index-4abf3da0.js";import"./step-171ad54a.js";const oe=(t,n)=>Wt(t,"a",-n),kt=oe,_t=1e-10;function st(t,n){const s=le(t),e=s.filter(c=>ae(c,t));let i=0,r=0;const o=[];if(e.length>1){const c=Tt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-c.x,a.y-c.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(f.parentIndex.includes(a.parentIndex[m])){const x=t[a.parentIndex[m]],M=Math.atan2(a.x-x.x,a.y-x.y),T=Math.atan2(f.x-x.x,f.y-x.y);let _=T-M;_<0&&(_+=2*Math.PI);const w=T-_/2;let g=G(y,{x:x.x+x.radius*Math.sin(w),y:x.y+x.radius*Math.cos(w)});g>x.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:a,p2:f,large:g>x.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),f=a)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(G(t[u],c)>Math.abs(c.radius-t[u].radius)){f=!0;break}f?i=r=0:(i=c.radius*c.radius*Math.PI,o.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>G(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function G(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=G(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),c=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:c+u,y:f-a},{x:c-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),c=t(s);let f=s-n;if(o*c>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(c===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*o>=0&&(n=a),Math.abs(f)<r||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,x=new Array(m+1);x[0]=n,x[0].fx=t(n),x[0].id=0;for(let v=0;v<m;++v){const l=n.slice();l[v]=l[v]?l[v]*i:r,x[v+1]=l,x[v+1].fx=t(l),x[v+1].id=v+1}function M(v){for(let l=0;l<v.length;l++)x[m][l]=v[l];x[m].fx=v.fx}const T=(v,l)=>v.fx-l.fx,_=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(x.sort(T),s.history){const p=x.map(h=>{const L=h.slice();return L.fx=h.fx,L.id=h.id,L});p.sort((h,L)=>h.id-L.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p<m;++p)d=Math.max(d,Math.abs(x[0][p]-x[1][p]));if(Math.abs(x[0].fx-x[m].fx)<o&&d<c)break;for(let p=0;p<m;++p){_[p]=0;for(let h=0;h<m;++h)_[p]+=x[h][p];_[p]/=m}const l=x[m];if(Q(w,1+f,_,-f,l),w.fx=t(w),w.fx<x[0].fx)Q(b,1+u,_,-u,l),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=x[m-1].fx){let p=!1;if(w.fx>l.fx?(Q(g,1+a,_,-a,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(Q(g,1-a*f,_,a*f,l),g.fx=t(g),g.fx<w.fx?M(g):p=!0),p){if(y>=1)break;for(let h=1;h<x.length;++h)Q(x[h],1-y,x[0],y,x[h]),x[h].fx=t(x[h])}}else M(w)}return x.sort(T),{fx:x[0].fx,x:x[0]}}function ue(t,n,s,e,i,r,o){const c=s.fx,f=tt(s.fxprime,n);let u=c,a=c,y=f,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(x,M,T){for(let _=0;_<16;++_)if(i=(x+M)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=tt(e.fxprime,n),u>c+r*i*f||u>=T)M=i;else{if(Math.abs(y)<=-o*f)return i;y*(M-x)>=0&&(M=x),x=i,T=u}return 0}for(let x=0;x<10;++x){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=tt(e.fxprime,n),u>c+r*i*f||x&&u>=a)return m(d,i,a);if(Math.abs(y)<=-o*f)return i;if(y>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,c,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,o,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ht(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const y=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/y);Q(o,d,o,-1,i.fxprime),c=e,e=i,i=c}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),c=[];for(const a of o)c.push(r[a].x),c.push(r[a].y);const u=zt(a=>{const y={};for(let d=0;d<o.length;++d){const m=o[d];y[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(y,i)},c,n).x;for(let a=0;a<o.length;++a){const y=o[a];r[y].x=u[2*a],r[y].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);c.set(a,f.size+(c.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const d=String(f.sets[y]),m=`${a};${d}`,x=`${d};${a}`;c.set(m,f.size+(c.get(m)||0)),c.set(x,f.size+(c.get(x)||0))}}for(const f of e)f.sets.length<3&&(f.size=c.get(i(f.sets)))}const r=[],o=new Set;for(const c of e)if(c.sets.length===1)r.push(c.sets[0]);else if(c.sets.length===2){const f=c.sets[0],u=c.sets[1];o.add(i(c.sets)),o.add(i([u,f]))}r.sort((c,f)=>c===f?0:c<f?-1:1);for(let c=0;c<r.length;++c){const f=r[c];for(let u=c+1;u<r.length;++u){const a=r[u];o.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],c=s[r.sets[1]],f=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),a=ft(f,u,r.size);e[o][c]=e[c][o]=a;let y=0;r.size+1e-10>=Math.min(n[o].size,n[c].size)?y=1:r.size<=1e-10&&(y=-1),i[o][c]=i[c][o]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],c=t[2*r+1];for(let f=r+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[r][f],d=e[r][f],m=(u-o)*(u-o)+(a-c)*(a-c),x=Math.sqrt(m),M=m-y*y;d>0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(c-a),n[2*f]+=4*M*(u-o),n[2*f+1]+=4*M*(a-c))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const c=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/c));const f=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),x=he(f,m,n);(!u||x.fx<u.fx)&&(u=x)}const a=u.x,y={};for(let d=0;d<e.length;++d){const m=e[d];y[m.sets[0]]={x:a[2*d]*c,y:a[2*d+1]*c,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,c);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const y of t)if(y.sets.length===1){const d=y.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[d]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const m=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[m].size,e[x].size)&&(d=0),i[m].push({set:x,size:y.size,weight:d}),i[x].push({set:m,size:y.size,weight:d})}const r=[];Object.keys(i).forEach(y=>{let d=0;for(let m=0;m<i[y].length;++m)d+=i[y][m].size*i[y][m].weight;r.push({set:y,size:d})});function o(y,d){return d.size-y.size}r.sort(o);const c={};function f(y){return y.set in c}function u(y,d){e[d].x=y.x,e[d].y=y.y,c[d]=!0}u({x:0,y:0},r[0].set);for(let y=1;y<r.length;++y){const d=r[y].set,m=i[d].filter(f),x=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(x.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],l=ft(x.radius,v.radius,m[b].size),p=Et({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:l});M.push(...p)}}let T=1e50,_=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<T&&(T=g,_=w)}u(_,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],c=t[e.sets[1]];i=xt(o.radius,c.radius,G(o,c))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],f=t[e.sets[1]];i=xt(c.radius,f.radius,G(c,f))}else i=st(e.sets.map(c=>t[c]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&G(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const c of t){const f=c.x,u=c.y;c.x=r*f-o*u,c.y=o*f+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),c=n(r);o.parent=c}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;G(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function c(u,a,y){if(!u)return;const d=u.bounds;let m,x;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(y)x=r.yRange.max-d.yRange.min+o;else{x=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=m,M.y+=x,e.push(M)}let f=1;for(;f<i.length;)c(i[f],!0,!1),c(i[f+1],!1,!0),c(i[f+2],!0,!0),f+=3,r=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:c}=dt(r);if(o.max===o.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const m=Math.sqrt(i/Math.PI)*2;f=n/m,u=s/m}else f=n/(o.max-o.min),u=s/(c.max-c.min);const a=Math.min(u,f),y=(n-(o.max-o.min)*a)/2,d=(s-(c.max-c.min)*a)/2;return Ot(r.map(m=>({radius:a*m.radius,x:e+y+(m.x-o.min)*a,y:e+d+(m.y-c.min)*a,setid:m.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,c=!0,f=null,u=!0,a=!0,y=null,d=null,m=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(p){if(p in T)return T[p];var h=T[p]=_[w];return w+=1,w>=_.length&&(w=0),h},b=At,v=et;function l(p){let h=p.datum();const L=new Set;h.forEach(I=>{I.size==0&&I.sets.length==1&&L.add(I.sets[0])}),h=h.filter(I=>!I.sets.some(j=>L.has(j)));let k={},N={};if(h.length>0){let I=b(h,{lossFunction:v,distinct:m});c&&(I=Dt(I,o,d)),k=Nt(I,s,e,i,f),N=Lt(k,h,M)}const Y={};h.forEach(I=>{I.label&&(Y[I.sets]=I.label)});function B(I){if(I.sets in Y)return Y[I.sets];if(I.sets.length==1)return""+I.sets[0]}p.selectAll("svg").data([k]).enter().append("svg");const q=p.select("svg");n?q.attr("viewBox",`0 0 ${s} ${e}`):q.attr("width",s).attr("height",e);const U={};let z=!1;q.selectAll(".venn-area path").each(function(I){const j=this.getAttribute("d");I.sets.length==1&&j&&!m&&(z=!0,U[I.sets[0]]=Me(j))});function A(I){return j=>{const W=I.sets.map(Z=>{let H=U[Z],J=k[Z];return H||(H={x:s/2,y:e/2,radius:1}),J||(J={x:s/2,y:e/2,radius:1}),{x:H.x*(1-j)+J.x*j,y:H.y*(1-j)+J.y*j,radius:H.radius*(1-j)+J.radius*j}});return wt(W,x)}}const C=q.selectAll(".venn-area").data(h,I=>I.sets),O=C.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),P=O.append("path"),V=O.append("text").attr("class","label").text(I=>B(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(P.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),V.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function R(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let E=p;z&&typeof E.transition=="function"?(E=R(p),E.selectAll("path").attrTween("d",A)):E.selectAll("path").attr("d",I=>wt(I.sets.map(j=>k[j])),x);const F=E.selectAll("text").filter(I=>I.sets in N).text(I=>B(I)).attr("x",I=>Math.floor(N[I.sets].x)).attr("y",I=>Math.floor(N[I.sets].y));u&&(z?"on"in F?F.on("end",ot(k,B)):F.each("end",ot(k,B)):F.each(ot(k,B)));const D=R(C.exit()).remove();typeof C.transition=="function"&&D.selectAll("path").attrTween("d",A);const X=D.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(V.style("font-size","0px"),F.style("font-size",y),X.style("font-size","0px")),{circles:k,textCentres:N,nodes:C,enter:O,update:E,exit:D}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(m=p,l):m},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(r=p,l):r},l.layoutFunction=function(p){return arguments.length?(b=p,l):b},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(f=p,l):f},l.styled=function(p){return arguments.length?(a=p,l):a},l.orientation=function(p){return arguments.length?(o=p,l):o},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?et:p==="logRatio"?Ct:p,l):v},l}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),c=3,f=(r.length+o.length)/c;let u=o.pop(),a=[u],y=0;const d=1.1;e.textContent=null;const m=[];function x(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=x(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=x(u),y++)}const T=.35-y*d/2,_=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",_),g.setAttribute("y",w),g.setAttribute("dy",`${T+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-G(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-G(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=G(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=r&&(i=e[a],r=y)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:o[0],y:o[1]};let f=!0;for(const a of t)if(G(c,a)>a.radius){f=!1;break}for(const a of n)if(G(c,a)<a.radius){f=!1;break}if(f)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Tt(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const c=s[o],f=t[c],u=G(r,f);u+f.radius<=r.radius+1e-10?n[c].push(i):u+r.radius<=f.radius+1e-10&&n[i].push(c)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,c={},f={};for(let d=0;d<o.length;++d){c[o[d]]=!0;const m=i[o[d]];for(let x=0;x<m.length;++x)f[m[x]]=!0}const u=[],a=[];for(let d in t)d in c?u.push(t[d]):d in f||a.push(t[d]);const y=jt(u,a,s);e[o]=y,y.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
2
+ M`,t,n),e.push(`
3
+ m`,-s,0),e.push(`
4
+ a`,s,s,0,1,0,s*2,0),e.push(`
5
+ a`,s,s,0,1,0,-s*2,0),e.join(" ")}function Me(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function Pt(t){if(t.length===0)return[];const n={};return st(t,n),n.arcs}function Vt(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?r=>Math.round(r*s)/s:r=>r;if(t.length==1){const r=t[0].circle;return ke(e(r.x),e(r.y),e(r.radius))}const i=[`
6
+ M`,e(t[0].p2.x),e(t[0].p2.y)];for(const r of t){const o=e(r.circle.radius);i.push(`
7
+ A`,o,o,0,r.large?1:0,r.sweep?1:0,e(r.p1.x),e(r.p1.y))}return i.join(" ")}function wt(t,n){return Vt(Pt(t),n)}function we(t,n={}){const{lossFunction:s,layoutFunction:e=At,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:c=600,height:f=350,padding:u=15,scaleToFit:a=!1,symmetricalTextCentre:y=!1,distinct:d,round:m=2}=n;let x=e(t,{lossFunction:s==="default"||!s?et:s==="logRatio"?Ct:s,distinct:d});i&&(x=Dt(x,r,o));const M=Nt(x,c,f,u,a),T=Lt(M,t,y),_=new Map(Object.keys(M).map(b=>[b,{set:b,x:M[b].x,y:M[b].y,radius:M[b].radius}])),w=t.map(b=>{const v=b.sets.map(h=>_.get(h)),l=Pt(v),p=Vt(l,m);return{circles:v,arcs:l,path:p,area:b,has:new Set(b.sets)}});function g(b){let v="";for(const l of w)l.has.size>b.length&&b.every(p=>l.has.has(p))&&(v+=" "+l.path);return v}return w.map(({circles:b,arcs:v,path:l,area:p})=>({data:p,text:T[p.sets],circles:b,arcs:v,path:l,distinctPath:l+g(p.sets)}))}var gt=function(){var t=S(function(w,g,b,v){for(b=b||{},v=w.length;v--;b[w[v]]=g);return b},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],c=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],a=[1,56],y=[1,58],d=[1,59],m=[1,60],x=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:S(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:S(function(g,b,v,l,p,h,L){var k=h.length-1;switch(p){case 1:return h[k-1];case 2:case 3:case 4:this.$=[];break;case 5:h[k-1].push(h[k]),this.$=h[k-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=h[k];break;case 8:l.setDiagramTitle(h[k].substr(6)),this.$=h[k].substr(6);break;case 9:l.addSubsetData([h[k]],void 0,void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 10:l.addSubsetData([h[k-1]],h[k],void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 11:l.addSubsetData([h[k-2]],void 0,parseFloat(h[k])),l.setIndentMode&&l.setIndentMode(!0);break;case 12:l.addSubsetData([h[k-3]],h[k-2],parseFloat(h[k])),l.setIndentMode&&l.setIndentMode(!0);break;case 13:if(h[k].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(h[k]),l.addSubsetData(h[k],void 0,void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 14:if(h[k-1].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(h[k-1]),l.addSubsetData(h[k-1],h[k],void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 15:if(h[k-2].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(h[k-2]),l.addSubsetData(h[k-2],void 0,parseFloat(h[k])),l.setIndentMode&&l.setIndentMode(!0);break;case 16:if(h[k-3].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(h[k-3]),l.addSubsetData(h[k-3],h[k-2],parseFloat(h[k])),l.setIndentMode&&l.setIndentMode(!0);break;case 17:case 18:case 19:l.addTextData(h[k-1],h[k],void 0);break;case 20:case 21:l.addTextData(h[k-2],h[k-1],h[k]);break;case 23:l.addStyleData(h[k-1],h[k]);break;case 24:case 25:case 26:var N=l.getCurrentSets();if(!N)throw new Error("text requires set");l.addTextData(N,h[k],void 0);break;case 27:case 28:var N=l.getCurrentSets();if(!N)throw new Error("text requires set");l.addTextData(N,h[k-1],h[k]);break;case 29:case 41:this.$=[h[k]];break;case 30:case 42:this.$=[...h[k-2],h[k]];break;case 31:this.$=[h[k-2],h[k]];break;case 33:this.$=h[k].join(" ");break;case 34:this.$=[h[k]];break;case 35:h[k-1].push(h[k]),this.$=h[k-1];break;case 43:case 44:this.$=h[k];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[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(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:o}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:c,25:37,26:38,27:o},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(f,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(r,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:c,26:51},{16:u,20:a,21:[1,53],28:52,29:54,30:55,31:y,32:d,33:m},t(s,[2,12]),t(s,[2,16]),t(f,[2,30]),t(f,[2,31]),t(f,[2,32]),t(f,[2,33],{30:61,16:u,20:a,31:y,32:d,33:m}),t(x,[2,34]),t(x,[2,36]),t(x,[2,37]),t(x,[2,38]),t(x,[2,39]),t(x,[2,40]),t(x,[2,35])],defaultActions:{6:[2,1]},parseError:S(function(g,b){if(b.recoverable)this.trace(g);else{var v=new Error(g);throw v.hash=b,v}},"parseError"),parse:S(function(g){var b=this,v=[0],l=[],p=[null],h=[],L=this.table,k="",N=0,Y=0,B=2,q=1,U=h.slice.call(arguments,1),z=Object.create(this.lexer),A={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(A.yy[C]=this.yy[C]);z.setInput(g,A.yy),A.yy.lexer=z,A.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var O=z.yylloc;h.push(O);var P=z.options&&z.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(K){v.length=v.length-2*K,p.length=p.length-K,h.length=h.length-K}S(V,"popStack");function R(){var K;return K=l.pop()||z.lex()||q,typeof K!="number"&&(K instanceof Array&&(l=K,K=l.pop()),K=b.symbols_[K]||K),K}S(R,"lex");for(var E,F,D,X,I={},j,W,Z,H;;){if(F=v[v.length-1],this.defaultActions[F]?D=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=R()),D=L[F]&&L[F][E]),typeof D>"u"||!D.length||!D[0]){var J="";H=[];for(j in L[F])this.terminals_[j]&&j>B&&H.push("'"+this.terminals_[j]+"'");z.showPosition?J="Parse error on line "+(N+1)+`:
8
+ `+z.showPosition()+`
9
+ Expecting `+H.join(", ")+", got '"+(this.terminals_[E]||E)+"'":J="Parse error on line "+(N+1)+": Unexpected "+(E==q?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(J,{text:z.match,token:this.terminals_[E]||E,line:z.yylineno,loc:O,expected:H})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+E);switch(D[0]){case 1:v.push(E),p.push(z.yytext),h.push(z.yylloc),v.push(D[1]),E=null,Y=z.yyleng,k=z.yytext,N=z.yylineno,O=z.yylloc;break;case 2:if(W=this.productions_[D[1]][1],I.$=p[p.length-W],I._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},P&&(I._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),X=this.performAction.apply(I,[k,Y,N,A.yy,D[1],p,h].concat(U)),typeof X<"u")return X;W&&(v=v.slice(0,-1*W*2),p=p.slice(0,-1*W),h=h.slice(0,-1*W)),v.push(this.productions_[D[1]][0]),p.push(I.$),h.push(I._$),Z=L[v[v.length-2]][v[v.length-1]],v.push(Z);break;case 3:return!0}}return!0},"parse")},T=function(){var w={EOF:1,parseError:S(function(b,v){if(this.yy.parser)this.yy.parser.parseError(b,v);else throw new Error(b)},"parseError"),setInput:S(function(g,b){return this.yy=b||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var b=g.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:S(function(g){var b=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===l.length?this.yylloc.first_column:0)+l[l.length-v.length].length-v[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(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
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(g){this.unput(this.match.slice(g))},"less"),pastInput:S(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var g=this.pastInput(),b=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
11
+ `+b+"^"},"showPosition"),test_match:S(function(g,b){var v,l,p;if(this.options.backtrack_lexer&&(p={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&&(p.yylloc.range=this.yylloc.range.slice(0))),l=g[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in p)this[h]=p[h];return!1}return!1},"test_match"),next:S(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,b,v,l;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),h=0;h<p.length;h++)if(v=this._input.match(this.rules[p[h]]),v&&(!b||v[0].length>b[0].length)){if(b=v,l=h,this.options.backtrack_lexer){if(g=this.test_match(v,p[h]),g!==!1)return g;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(g=this.test_match(b,p[l]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
12
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var b=this.next();return b||this.lex()},"lex"),begin:S(function(b){this.conditionStack.push(b)},"begin"),popState:S(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:S(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:S(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:S(function(b){this.begin(b)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(b,v,l,p){switch(l){case 0:break;case 1:break;case 2:break;case 3:if(b.getIndentMode&&b.getIndentMode())return b.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:b.setIndentMode&&b.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;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(b.consumeIndentText)b.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;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 w}();M.lexer=T;function _(){this.yy={}}return S(_,"Parser"),_.prototype=M,M.Parser=_,new _}();gt.parser=gt;var Se=gt,yt=[],pt=[],mt=[],bt=new Set,vt,It=!1,_e=S((t,n,s)=>{const e=it(t).sort(),i=s??10/Math.pow(t.length,2);vt=e,e.length===1&&bt.add(e[0]),yt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),Ee=S(()=>yt,"getSubsetData"),nt=S(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Te=S(t=>t&&nt(t),"normalizeStyleValue"),ze=S((t,n,s)=>{const e=nt(n);pt.push({sets:it(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),Ae=S((t,n)=>{const s=it(t).sort(),e={};for(const[i,r]of n)e[i]=Te(r)??r;mt.push({targets:s,styles:e})},"addStyleData"),Re=S(()=>mt,"getStyleData"),it=S(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),Ce=S(t=>{const s=it(t).filter(e=>!bt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),De=S(()=>pt,"getTextData"),Ne=S(()=>vt,"getCurrentSets"),Oe=S(()=>It,"getIndentMode"),Fe=S(t=>{It=t},"setIndentMode"),je=Gt.venn;function Bt(){return Kt(je,St().venn)}S(Bt,"getConfig");var Le=S(()=>{$t(),yt.length=0,pt.length=0,mt.length=0,bt.clear(),vt=void 0,It=!1},"customClear"),Pe={getConfig:Bt,clear:Le,setAccTitle:Ht,getAccTitle:Yt,setDiagramTitle:Xt,getDiagramTitle:Zt,getAccDescription:Jt,setAccDescription:Qt,addSubsetData:_e,getSubsetData:Ee,addTextData:ze,addStyleData:Ae,validateUnionIdentifiers:Ce,getTextData:De,getStyleData:Re,getCurrentSets:Ne,getIndentMode:Oe,setIndentMode:Fe},Ve=S(t=>`
13
+ .venn-title {
14
+ font-size: 32px;
15
+ fill: ${t.vennTitleTextColor};
16
+ font-family: ${t.fontFamily};
17
+ }
18
+
19
+ .venn-circle text {
20
+ font-size: 48px;
21
+ font-family: ${t.fontFamily};
22
+ }
23
+
24
+ .venn-intersection text {
25
+ font-size: 48px;
26
+ fill: ${t.vennSetTextColor};
27
+ font-family: ${t.fontFamily};
28
+ }
29
+
30
+ .venn-text-node {
31
+ font-family: ${t.fontFamily};
32
+ color: ${t.vennSetTextColor};
33
+ }
34
+ `,"getStyles"),Be=Ve;function Ut(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}S(Ut,"buildStyleByKey");var Ue=S((t,n,s,e)=>{var q,U,z;const i=e.db,r=(q=i.getConfig)==null?void 0:q.call(i),{themeVariables:o,look:c,handDrawnSeed:f}=St(),u=c==="handDrawn",a=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),y=(U=i.getDiagramTitle)==null?void 0:U.call(i),d=i.getSubsetData(),m=i.getTextData(),x=Ut(i.getStyleData()),M=(r==null?void 0:r.width)??800,T=(r==null?void 0:r.height)??450,w=M/1600,g=y?48*w:0,b=o.primaryTextColor??o.textColor,v=te(n);v.attr("viewBox",`0 0 ${M} ${T}`),y&&v.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*w}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*w).style("fill",o.vennTitleTextColor||o.titleColor);const l=rt(document.createElement("div")),p=ve().width(M).height(T-g);l.datum(d).call(p);const h=u?ee.svg(l.select("svg").node()):void 0,L=we(d,{width:M,height:T-g,padding:(r==null?void 0:r.padding)??15}),k=new Map;for(const A of L){const C=$([...A.data.sets].sort());k.set(C,A)}m.length>0&&qt(r,k,l,m,w,x);const N=ne(o.background||"#f4f4f4");l.selectAll(".venn-circle").each(function(A,C){var j;const O=rt(this),V=$([...A.sets].sort()),R=x.get(V),E=(R==null?void 0:R.fill)||a[C%a.length]||o.primaryColor;O.classed(`venn-set-${C%8}`,!0);const F=(R==null?void 0:R["fill-opacity"])??.1,D=(R==null?void 0:R.stroke)||E,X=(R==null?void 0:R["stroke-width"])||`${5*w}`;if(u&&h){const W=k.get(V);if(W&&W.circles.length>0){const Z=W.circles[0],H=h.circle(Z.x,Z.y,Z.radius*2,{roughness:.7,seed:f,fill:kt(E,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+C*60,stroke:D,strokeWidth:parseFloat(String(X))});O.select("path").remove(),(j=O.node())==null||j.insertBefore(H,O.select("text").node())}}else O.select("path").style("fill",E).style("fill-opacity",F).style("stroke",D).style("stroke-width",X).style("stroke-opacity",.95);const I=(R==null?void 0:R.color)||(N?se(E,30):ie(E,30));O.select("text").style("font-size",`${48*w}px`).style("fill",I)}),u&&h?l.selectAll(".venn-intersection").each(function(A){var E;const C=rt(this),P=$([...A.sets].sort()),V=x.get(P),R=V==null?void 0:V.fill;if(R){const F=C.select("path"),D=F.attr("d");if(D){const X=h.path(D,{roughness:.7,seed:f,fill:kt(R,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),I=F.node();(E=I==null?void 0:I.parentNode)==null||E.insertBefore(X,I),F.remove()}}else C.select("path").style("fill-opacity",0);C.select("text").style("font-size",`${48*w}px`).style("fill",(V==null?void 0:V.color)??o.vennSetTextColor??b)}):(l.selectAll(".venn-intersection text").style("font-size",`${48*w}px`).style("fill",A=>{var P;const O=$([...A.sets].sort());return((P=x.get(O))==null?void 0:P.color)??o.vennSetTextColor??b}),l.selectAll(".venn-intersection path").style("fill-opacity",A=>{var P;const O=$([...A.sets].sort());return(P=x.get(O))!=null&&P.fill?1:0}).style("fill",A=>{var P;const O=$([...A.sets].sort());return((P=x.get(O))==null?void 0:P.fill)??"transparent"}));const Y=v.append("g").attr("transform",`translate(0, ${g})`),B=l.select("svg").node();if(B&&"childNodes"in B)for(const A of[...B.childNodes])(z=Y.node())==null||z.appendChild(A);re(v,T,M,(r==null?void 0:r.useMaxWidth)??!0)},"draw");function $(t){return t.join("|")}S($,"stableSetsKey");function qt(t,n,s,e,i,r){var a;const o=(t==null?void 0:t.useDebugLayout)??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const y of e){const d=$(y.sets),m=u.get(d);m?m.push(y):u.set(d,[y])}for(const[y,d]of u.entries()){const m=n.get(y);if(!(m!=null&&m.text))continue;const x=m.text.x,M=m.text.y,T=Math.min(...m.circles.map(U=>U.radius)),_=Math.min(...m.circles.map(U=>U.radius-Math.hypot(x-U.x,M-U.y)));let w=Number.isFinite(_)?Math.max(0,_):0;w===0&&Number.isFinite(T)&&(w=T*.6);const g=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&g.append("circle").attr("class","venn-text-debug-circle").attr("cx",x).attr("cy",M).attr("r",w).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const b=Math.max(80*i,w*2*.95),v=Math.max(60*i,w*2*.95),h=(m.data.label&&m.data.label.length>0?Math.min(32*i,w*.25):0)+(d.length<=2?30*i:0),L=x-b/2,k=M-v/2+h,N=Math.max(1,Math.ceil(Math.sqrt(d.length))),Y=Math.max(1,Math.ceil(d.length/N)),B=b/N,q=v/Y;for(const[U,z]of d.entries()){const A=U%N,C=Math.floor(U/N),O=L+B*(A+.5),P=k+q*(C+.5);o&&g.append("rect").attr("class","venn-text-debug-cell").attr("x",L+B*A).attr("y",k+q*C).attr("width",B).attr("height",q).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=B*.9,R=q*.9,E=g.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",R).attr("x",O-V/2).attr("y",P-R/2).attr("overflow","visible"),F=(a=r.get(z.id))==null?void 0:a.color,D=E.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(z.label??z.id);F&&D.style("color",F)}}}S(qt,"renderTextNodes");var qe={draw:Ue},He={parser:Se,db:Pe,renderer:qe,styles:Be};export{He as diagram};
@@ -0,0 +1 @@
1
+ import{W as l,l as o}from"./mermaid-parser.core-7ee09942.js";import"./index-4abf3da0.js";export{l as WardleyModule,o as createWardleyServices};
@@ -0,0 +1,78 @@
1
+ import{_ as y,l as et,d as V,t as zt,s as Lt,g as Tt,n as At,o as Xt,b as Et,c as Yt,I as It,E as Bt,D as Q,H as Ft,k as Rt}from"./mermaid.core-9fc8f6d2.js";import{p as Ot}from"./chunk-4BX2VUAB-fd7396be.js";import{p as Wt}from"./mermaid-parser.core-7ee09942.js";import"./index-4abf3da0.js";import"./step-171ad54a.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Ot(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new 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.");Gt(o,e)},"parse")},R,Ht=(R=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={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,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}},y(R,"WardleyBuilder"),R),b=new Ht;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),zt()}y(wt,"clear");var qt={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Lt,getAccTitle:Tt,setDiagramTitle:At,getDiagramTitle:Xt,getAccDescription:Et,setAccDescription:Yt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var J,K;et.debug(`Rendering Wardley map
2
+ `+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),L=v.getDiagramTitle(),M=((J=g.size)==null?void 0:J.width)??r.width,k=((K=g.size)==null?void 0:K.height)??r.height,N=Ft(o);N.selectAll("*").remove(),Rt(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),H=N.append("defs");H.append("marker").attr("id",`arrow-${o}`).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",d.evolutionStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-end-${o}`).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",d.linkStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-start-${o}`).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",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const I=M-r.padding*2,B=k-r.padding*2;L&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(L);const T=y(t=>r.padding+t/100*I,"projectX"),A=y(t=>k-r.padding-t/100*B,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+I/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+B/2})`).text(bt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(F.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===F.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/F.length;F.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}F.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*I,f=r.padding+l.end*I,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+I*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-B*s).attr("y2",k-r.padding-B*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,l=-1/0,x=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const z=(h+l)/2;S.x=z,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+15*2).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,z=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${z} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=A(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).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",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=C.filter(t=>t.sourceStrategy==="market");X.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.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),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:A(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=A(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const z=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(z)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const z=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-z,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",z).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=A(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
3
+ M ${s} ${i-l/2}
4
+ L ${s+h-x} ${i-l/2}
5
+ L ${s+h-x} ${i-l/2-8}
6
+ L ${s+h} ${i}
7
+ L ${s+h-x} ${i+l/2+8}
8
+ L ${s+h-x} ${i+l/2}
9
+ L ${s} ${i+l/2}
10
+ Z
11
+ `;t.append("path").attr("d",f).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+h/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.name)})}if(g.deaccelerators.length>0){const t=P.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
12
+ M ${s+h} ${i-l/2}
13
+ L ${s+x} ${i-l/2}
14
+ L ${s+x} ${i-l/2-8}
15
+ L ${s} ${i}
16
+ L ${s+x} ${i+l/2+8}
17
+ L ${s+x} ${i+l/2}
18
+ L ${s+h} ${i+l/2}
19
+ Z
20
+ `;t.append("path").attr("d",f).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+h/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.name)})}},"draw"),Ut={draw:Zt},Jt=y(({wardley:a}={})=>{const o=It(),e=Bt(),p=Q(o,e.themeVariables),r=Q(p.wardley,a);return`
21
+ .wardley-background {
22
+ fill: ${r.backgroundColor};
23
+ }
24
+ .wardley-axes line, .wardley-axes path {
25
+ stroke: ${r.axisColor};
26
+ }
27
+ .wardley-axis-label {
28
+ fill: ${r.axisTextColor};
29
+ }
30
+ .wardley-stage-label {
31
+ fill: ${r.axisTextColor};
32
+ }
33
+ .wardley-grid line {
34
+ stroke: ${r.gridColor};
35
+ }
36
+ .wardley-node circle {
37
+ fill: ${r.componentFill};
38
+ stroke: ${r.componentStroke};
39
+ }
40
+ .wardley-node-label {
41
+ fill: ${r.componentLabelColor};
42
+ }
43
+ .wardley-link {
44
+ stroke: ${r.linkStroke};
45
+ }
46
+ .wardley-link--dashed {
47
+ stroke-dasharray: 4 4;
48
+ }
49
+ .wardley-link-label {
50
+ fill: ${r.axisTextColor};
51
+ }
52
+ .wardley-trend line {
53
+ stroke: ${r.evolutionStroke};
54
+ }
55
+ .wardley-annotation-line {
56
+ stroke: ${r.annotationStroke};
57
+ }
58
+ .wardley-annotation circle {
59
+ fill: ${r.annotationFill};
60
+ stroke: ${r.annotationStroke};
61
+ }
62
+ .wardley-annotation text {
63
+ fill: ${r.annotationTextColor};
64
+ }
65
+ .wardley-annotations-box rect {
66
+ fill: ${r.annotationFill};
67
+ stroke: ${r.annotationStroke};
68
+ }
69
+ .wardley-annotations-box text {
70
+ fill: ${r.annotationTextColor};
71
+ }
72
+ .wardley-pipeline-box {
73
+ stroke: ${r.componentStroke};
74
+ }
75
+ .wardley-notes text {
76
+ fill: ${r.axisTextColor};
77
+ }
78
+ `},"styles"),oe={parser:at,db:qt,renderer:Ut,styles:Jt};export{oe as diagram};