isorite 0.14.0 → 0.16.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 (99) hide show
  1. package/dist/main.js +757 -98
  2. package/docs/terminal.md +3 -1
  3. package/guide/out-of-the-base/web-and-code-links.md +3 -1
  4. package/package.json +1 -1
  5. package/web/_app/immutable/assets/0.BEFtmzIh.css +1 -0
  6. package/web/_app/immutable/assets/4.LR47AJKA.css +1 -0
  7. package/web/_app/immutable/assets/NoteList.C2GYAaLW.css +1 -0
  8. package/web/_app/immutable/chunks/{BWE_HS0c.js → 0B47b24t.js} +1 -1
  9. package/web/_app/immutable/chunks/{CzYPMYd4.js → 1j--pDqt.js} +1 -1
  10. package/web/_app/immutable/chunks/{e2LGvGEb.js → AnnzTlE8.js} +1 -1
  11. package/web/_app/immutable/chunks/{DRcTlHZP.js → B7LnLClC.js} +1 -1
  12. package/web/_app/immutable/chunks/{ZwM5k8r0.js → BAVnZFPa.js} +1 -1
  13. package/web/_app/immutable/chunks/BHORylQC.js +1 -0
  14. package/web/_app/immutable/chunks/{BiATTH-R.js → BLe29cGh.js} +1 -1
  15. package/web/_app/immutable/chunks/{C8h1oeAZ.js → BLzZIf7l.js} +1 -1
  16. package/web/_app/immutable/chunks/BMijTvgG.js +1 -0
  17. package/web/_app/immutable/chunks/{DCZYeMlH.js → BPpUSQ2Y.js} +1 -1
  18. package/web/_app/immutable/chunks/{kG4HctVa.js → BQeONalw.js} +1 -1
  19. package/web/_app/immutable/chunks/{CtkUy_15.js → BZX8cNYL.js} +1 -1
  20. package/web/_app/immutable/chunks/{Bb_N98K9.js → BiHyHFlW.js} +1 -1
  21. package/web/_app/immutable/chunks/{BGW1TKtR.js → BtYMl4bD.js} +1 -1
  22. package/web/_app/immutable/chunks/{DKqMzyyE.js → BtcGx-KQ.js} +1 -1
  23. package/web/_app/immutable/chunks/{BK31dpt6.js → Bytzbt5l.js} +1 -1
  24. package/web/_app/immutable/chunks/{DDAG55ce.js → C1FDDux-.js} +1 -1
  25. package/web/_app/immutable/chunks/C7qBBO-i.js +1 -0
  26. package/web/_app/immutable/chunks/{NyWzYSz1.js → C8FxuPry.js} +1 -1
  27. package/web/_app/immutable/chunks/{CdY1G_wk.js → C9Qdslk3.js} +1 -1
  28. package/web/_app/immutable/chunks/CA-rzUq8.js +524 -0
  29. package/web/_app/immutable/chunks/{CMIt1Ma8.js → CSKABQj2.js} +1 -1
  30. package/web/_app/immutable/chunks/CSTv2fL0.js +1 -0
  31. package/web/_app/immutable/chunks/{Dzi94aDH.js → CTuuQ66F.js} +1 -1
  32. package/web/_app/immutable/chunks/{PsfIQCJ1.js → CUB9vnd0.js} +1 -1
  33. package/web/_app/immutable/chunks/{DrVtdHUW.js → CUNetmvQ.js} +1 -1
  34. package/web/_app/immutable/chunks/{Djr0h_v1.js → CVqwkR8N.js} +1 -1
  35. package/web/_app/immutable/chunks/{CTDYUZPz.js → CWc-mNzo.js} +1 -1
  36. package/web/_app/immutable/chunks/{CryuQgNh.js → CZSmkKvQ.js} +1 -1
  37. package/web/_app/immutable/chunks/{BA78_vo5.js → CcE14TDI.js} +1 -1
  38. package/web/_app/immutable/chunks/{DBLoWLMb.js → CglDFp51.js} +1 -1
  39. package/web/_app/immutable/chunks/{DjUnonHY.js → Ch5Z7cbP.js} +1 -1
  40. package/web/_app/immutable/chunks/{DFuPQaNa.js → Cpjqsnqr.js} +1 -1
  41. package/web/_app/immutable/chunks/{Bd-WxALw.js → CwHHpacD.js} +1 -1
  42. package/web/_app/immutable/chunks/{UDPiRmKc.js → D7jLdCNu.js} +1 -1
  43. package/web/_app/immutable/chunks/{CIYFNih-.js → D9uNsgxP.js} +1 -1
  44. package/web/_app/immutable/chunks/{CFf_dAzX.js → DAVMwq6b.js} +1 -1
  45. package/web/_app/immutable/chunks/{C2npZzkn.js → DEQsS4Ez.js} +1 -1
  46. package/web/_app/immutable/chunks/{B-DzK7Gb.js → DFo4P1vU.js} +1 -1
  47. package/web/_app/immutable/chunks/{CdmC_l9F.js → DH_19--P.js} +1 -1
  48. package/web/_app/immutable/chunks/{l1LsK1sB.js → DJQ6favH.js} +1 -1
  49. package/web/_app/immutable/chunks/{BvPxdlBc.js → DJT73ARj.js} +1 -1
  50. package/web/_app/immutable/chunks/{BCGaqnao.js → DW5uy3Jw.js} +1 -1
  51. package/web/_app/immutable/chunks/{BT_btfh0.js → DWwu8a1P.js} +1 -1
  52. package/web/_app/immutable/chunks/{BhEqJU15.js → DY0M2GMn.js} +1 -1
  53. package/web/_app/immutable/chunks/{TanDZqdf.js → DbtvzL7r.js} +1 -1
  54. package/web/_app/immutable/chunks/DtEVmiYo.js +1 -0
  55. package/web/_app/immutable/chunks/{CT4_O9X_.js → DxRGLDbV.js} +1 -1
  56. package/web/_app/immutable/chunks/{D6sVhEz3.js → Ih6r6QR2.js} +1 -1
  57. package/web/_app/immutable/chunks/{BXBhaEho.js → Kem7IXj7.js} +1 -1
  58. package/web/_app/immutable/chunks/{Ct_EK1xu.js → MrW4zd8l.js} +1 -1
  59. package/web/_app/immutable/chunks/{BqipEJXw.js → Mwr1r9aw.js} +1 -1
  60. package/web/_app/immutable/chunks/{D1LK3xRu.js → OG9GsKke.js} +1 -1
  61. package/web/_app/immutable/chunks/{DymLl-qY.js → Qej0SEux.js} +1 -1
  62. package/web/_app/immutable/chunks/TmxIGCN3.js +1 -0
  63. package/web/_app/immutable/chunks/{CPSlCQsu.js → Wv-ICQRy.js} +4 -4
  64. package/web/_app/immutable/chunks/{B35sQTcK.js → ZTEErEOd.js} +1 -1
  65. package/web/_app/immutable/chunks/{Cf-5I5_6.js → e7GRa0yc.js} +1 -1
  66. package/web/_app/immutable/chunks/{C5Z-Y7Lu.js → f7mFVWQS.js} +1 -1
  67. package/web/_app/immutable/chunks/{Bj-5n5Pb.js → hjSZ041d.js} +1 -1
  68. package/web/_app/immutable/chunks/{DHJ8FcFD.js → mhWk5y4o.js} +1 -1
  69. package/web/_app/immutable/chunks/{CMikI1NP.js → zasx25UV.js} +3 -3
  70. package/web/_app/immutable/entry/app.B9TPZNFw.js +2 -0
  71. package/web/_app/immutable/entry/start.WU9HKeyT.js +1 -0
  72. package/web/_app/immutable/nodes/0.C9NFEqJd.js +3 -0
  73. package/web/_app/immutable/nodes/1.B5PJwWOG.js +1 -0
  74. package/web/_app/immutable/nodes/2.DRtC7zjs.js +1 -0
  75. package/web/_app/immutable/nodes/3.EEMisvUL.js +1 -0
  76. package/web/_app/immutable/nodes/4.DthmsFQC.js +19 -0
  77. package/web/_app/immutable/nodes/5.CEu0DlpQ.js +1 -0
  78. package/web/_app/immutable/nodes/6.DzvF0ZPt.js +1 -0
  79. package/web/_app/version.json +1 -1
  80. package/web/index.html +16 -16
  81. package/web/_app/immutable/assets/0.BPP604gH.css +0 -1
  82. package/web/_app/immutable/assets/4.fOHsAKBF.css +0 -1
  83. package/web/_app/immutable/assets/NoteList.E6jC-AtZ.css +0 -1
  84. package/web/_app/immutable/chunks/BPrp4s2r.js +0 -1
  85. package/web/_app/immutable/chunks/CAlIuau0.js +0 -1
  86. package/web/_app/immutable/chunks/Cl5gQm2e.js +0 -1
  87. package/web/_app/immutable/chunks/DFKYo3Wx.js +0 -1
  88. package/web/_app/immutable/chunks/DxVFSMVD.js +0 -523
  89. package/web/_app/immutable/chunks/X3aTZRe_.js +0 -1
  90. package/web/_app/immutable/chunks/ej_0XxR7.js +0 -1
  91. package/web/_app/immutable/entry/app.BzA5QYtw.js +0 -2
  92. package/web/_app/immutable/entry/start.BOh0Gj31.js +0 -1
  93. package/web/_app/immutable/nodes/0.BmaxMLzC.js +0 -2
  94. package/web/_app/immutable/nodes/1.IQDu8pD1.js +0 -1
  95. package/web/_app/immutable/nodes/2.D2Oi-ADx.js +0 -1
  96. package/web/_app/immutable/nodes/3.CF1W85jb.js +0 -1
  97. package/web/_app/immutable/nodes/4.BMYBn904.js +0 -15
  98. package/web/_app/immutable/nodes/5.1vm6WZdM.js +0 -1
  99. package/web/_app/immutable/nodes/6.C9ia8cDm.js +0 -1
@@ -1,2 +1,2 @@
1
- import{_ as e,a as t,f as n,i as r,o as i,s as a,u as o,x as s}from"./C2npZzkn.js";import{n as c,r as l}from"./DciMwFJ1.js";import{PeleError as u,c as d,d as f,g as p,i as m,s as h,u as g}from"./CMikI1NP.js";var _=class{type=`sankey`;nodes=[];links=[];title;accTitle;accDescr;lookup=new Map;findOrCreateNode(e){let t=this.lookup.get(e);return t===void 0&&(t={id:e,index:this.nodes.length},this.lookup.set(e,t),this.nodes.push(t)),t}addLink(e,t,n){this.links.push({source:e,target:t,value:n})}},v=[`$end`,`STUCK`,`SANKEY`,`NEWLINE`,`COMMA`,`DQUOTE`,`NON_ESCAPED_TEXT`,`ESCAPED_TEXT`,`EOF`];function y(e){return e>=32&&e<=126&&e!==34&&e!==44||e>=160&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}function b(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},l=t=>e.slice(s,s+t.length).toLowerCase()===t&&!p(e.charCodeAt(s+t.length));for(;s<t;){let u=e.charCodeAt(s),d=s,f=s;if(o===2){if(u===34&&e.charCodeAt(s+1)!==34){a.length>0&&(o=a.pop()),c(5,s,s+1);continue}for(;f<t;){let t=e.codePointAt(f);if(y(t)||t===44||t===13||t===10)f+=t>65535?2:1;else if(t===34&&e.charCodeAt(f+1)===34)f+=2;else break}c(7,s,f)}else{if(o===0&&(u|32)==115){let e=l(`sankey-beta`)?11:l(`sankey`)?6:0;if(e>0){a.push(o),o=1,c(2,s,s+e);continue}}if(u===10||u===13&&e.charCodeAt(s+1)===10){c(3,s,u===10?s+1:s+2);continue}if(u===44){c(4,s,s+1);continue}if(u===34){a.push(o),o=2,c(5,s,s+1);continue}for(;f<t;){let t=e.codePointAt(f);if(!y(t))break;f+=t>65535?2:1}c(6,s,f)}if(f===d)return c(1,s,s),{types:n,texts:r,starts:i}}return c(o===2?7:8,t,t),c(0,t,t),{types:n,texts:r,starts:i}}var x=/[\n\r]+/g,S=/[\x00-\x08\x0b\x0c\x0e-\x1f\ud800-\udfff\ufffe\uffff]/u;function C(e){return e===10||e===13?!1:e<128?e===32||e===9||e===11||e===12:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function w(e,t){let n=0,r=e.length;for(;n<r&&C(e.charCodeAt(n));)n++;for(;r>n&&C(e.charCodeAt(r-1));)r--;let i=e.slice(n,r),a=i.replace(x,`
1
+ import{_ as e,a as t,f as n,i as r,o as i,s as a,u as o,x as s}from"./DEQsS4Ez.js";import{n as c,r as l}from"./DciMwFJ1.js";import{PeleError as u,c as d,d as f,g as p,i as m,s as h,u as g}from"./zasx25UV.js";var _=class{type=`sankey`;nodes=[];links=[];title;accTitle;accDescr;lookup=new Map;findOrCreateNode(e){let t=this.lookup.get(e);return t===void 0&&(t={id:e,index:this.nodes.length},this.lookup.set(e,t),this.nodes.push(t)),t}addLink(e,t,n){this.links.push({source:e,target:t,value:n})}},v=[`$end`,`STUCK`,`SANKEY`,`NEWLINE`,`COMMA`,`DQUOTE`,`NON_ESCAPED_TEXT`,`ESCAPED_TEXT`,`EOF`];function y(e){return e>=32&&e<=126&&e!==34&&e!==44||e>=160&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}function b(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},l=t=>e.slice(s,s+t.length).toLowerCase()===t&&!p(e.charCodeAt(s+t.length));for(;s<t;){let u=e.charCodeAt(s),d=s,f=s;if(o===2){if(u===34&&e.charCodeAt(s+1)!==34){a.length>0&&(o=a.pop()),c(5,s,s+1);continue}for(;f<t;){let t=e.codePointAt(f);if(y(t)||t===44||t===13||t===10)f+=t>65535?2:1;else if(t===34&&e.charCodeAt(f+1)===34)f+=2;else break}c(7,s,f)}else{if(o===0&&(u|32)==115){let e=l(`sankey-beta`)?11:l(`sankey`)?6:0;if(e>0){a.push(o),o=1,c(2,s,s+e);continue}}if(u===10||u===13&&e.charCodeAt(s+1)===10){c(3,s,u===10?s+1:s+2);continue}if(u===44){c(4,s,s+1);continue}if(u===34){a.push(o),o=2,c(5,s,s+1);continue}for(;f<t;){let t=e.codePointAt(f);if(!y(t))break;f+=t>65535?2:1}c(6,s,f)}if(f===d)return c(1,s,s),{types:n,texts:r,starts:i}}return c(o===2?7:8,t,t),c(0,t,t),{types:n,texts:r,starts:i}}var x=/[\n\r]+/g,S=/[\x00-\x08\x0b\x0c\x0e-\x1f\ud800-\udfff\ufffe\uffff]/u;function C(e){return e===10||e===13?!1:e<128?e===32||e===9||e===11||e===12:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function w(e,t){let n=0,r=e.length;for(;n<r&&C(e.charCodeAt(n));)n++;for(;r>n&&C(e.charCodeAt(r-1));)r--;let i=e.slice(n,r),a=i.replace(x,`
2
2
  `),o=a.trim();if(t!==void 0){let s=a.length-a.trimStart().length;t.push([[0,n,0],[r,e.length,0]],d(i,x,1),[[0,s,0],[s+o.length,a.length,0]])}return o}function T(e,t,n=e){let{types:r,texts:i,starts:a}=b(e),o=0,s=(t,r)=>{let i=[];n!==e&&w(n,i);let a=t>0&&t>=e.length?m(i,e.length-1)+1:m(i,t);return h(`sankey`,n,a,r)},c=e=>{let t=r[o],n=t===1?v[r[o-1]]:v[t];throw s(a[o],`Expecting ${e}, got '${n}'`)},l=(e,t=``)=>{r[o]!==e&&c(`'${v[e]}'${t}`),o++},u=()=>{if(r[o]===6)return i[o++];r[o]!==5&&c(`'DQUOTE', 'NON_ESCAPED_TEXT'`),o++,r[o]!==7&&c(`'ESCAPED_TEXT'`);let e=i[o++];return l(5),e},d=()=>{let e=a[o],t=u().trim().replaceAll(`""`,`"`);if(S.test(f(t)))throw s(e,`Invalid XML character in node name`);return t};for(l(2),l(3);;){let e=d();l(4,`, 'NEWLINE', 'EOF'`);let n=d();l(4,`, 'NEWLINE', 'EOF'`);let i=a[o],c=parseFloat(u());if(!Number.isFinite(c))throw s(i,`Expecting a number`);let f=t.findOrCreateNode(e),p=t.findOrCreateNode(n);if(t.addLink(f,p,c),r[o]!==3)break;o++}r[o]===8&&o++,r[o]!==0&&c(`'NEWLINE', 'EOF'`)}var ee=6;function E(e,t){if(e.length>8)e.sort(t);else for(let n=1;n<e.length;n++){let r=e[n],i=n-1;for(;i>=0&&t(e[i],r)>0;)e[i+1]=e[i],i--;e[i+1]=r}}function D(e,t){let n=e.nodes.length,r=e.links.map(e=>({source:e.source.index,target:e.target.index,value:Number.isFinite(e.value)&&e.value>0?e.value:0,thickness:0,sourceY:0,targetY:0})),i=[],a=[];for(let e=0;e<n;e++)i.push([]),a.push([]);r.forEach((e,t)=>{i[e.source].push(t),a[e.target].push(t)});let o=new Int32Array(n),s=new Int32Array(n),c=[];for(let e=0;e<n;e++)s[e]=a[e].length,s[e]===0&&c.push(e);for(let e=0;e<c.length;e++){let t=c[e];for(let e of i[t]){let n=r[e].target;o[n]<o[t]+1&&(o[n]=o[t]+1),--s[n]===0&&c.push(n)}}if(c.length<n){let t=0;for(;s[t]===0;)t++;let i=new Uint8Array(n);for(;i[t]===0;){i[t]=1;for(let e of a[t])if(s[r[e].source]>0){t=r[e].source;break}}throw new u(`Sankey diagrams cannot have circular links, and "${e.nodes[t].id}" is part of one.`,`semantic`,{type:`sankey`})}let l=1;for(let e=0;e<n;e++)o[e]+1>l&&(l=o[e]+1);let d=new Int32Array(n);for(let e=n-1;e>=0;e--){let t=c[e];for(let e of i[t])d[t]<d[r[e].target]+1&&(d[t]=d[r[e].target]+1)}let f=0;for(let e of r)e.value>f&&(f=e.value);let p=f>0?1/f:0,m=[],h=new Float64Array(n),g=[];for(let e=0;e<l;e++)g.push([]);let _=l>1?(t.width-t.nodeWidth)/(l-1):0;for(let e=0;e<n;e++){let n;if(t.alignment===`left`)n=o[e];else if(t.alignment===`right`)n=l-1-d[e];else if(t.alignment===`center`){if(n=o[e],a[e].length===0&&i[e].length>0){n=l;for(let t of i[e])o[r[t].target]-1<n&&(n=o[r[t].target]-1)}}else n=i[e].length>0?o[e]:l-1;let s=0,c=0,u=0,f=0;for(let t of a[e])s+=r[t].value*p,u+=r[t].value;for(let t of i[e])c+=r[t].value*p,f+=r[t].value;h[e]=Math.max(s,c),m.push({layer:n,value:Math.max(u,f),x:n*_,y:0,height:0}),g[n].push(e)}let v=1;for(let e of g)e.length>v&&(v=e.length);let y=v>1?Math.min(t.nodePadding,t.height/(v-1)):t.nodePadding,b=1/0;for(let e of g){let n=0;for(let t of e)n+=h[t];n>0&&(b=Math.min(b,(t.height-(e.length-1)*y)/n))}(!Number.isFinite(b)||b<0)&&(b=0);let x=Math.max(0,t.labelHeight-y),S=e=>{for(let n of g){let r=(n.length-1)*y;for(let t of n)r+=Math.max(h[t]*e,x);if(r>t.height+1e-6)return!1}return!0};if(x>0&&!S(b)){if(S(0)){let e=0;for(let t=0;t<40;t++){let t=(e+b)/2;S(t)?e=t:b=t}b=e}else x=0}let C=new Float64Array(n);for(let e of r)e.thickness=e.value*p*b;for(let e of g){let n=0;for(let t of e)m[t].height=h[t]*b,C[t]=Math.max(0,x-m[t].height)/2,m[t].y=n+C[t],n+=m[t].height+2*C[t]+y;let r=(t.height-n+y)/(e.length+1);e.forEach((e,t)=>m[e].y+=r*(t+1))}let w=e=>m[e].y+m[e].height/2,T=new Float64Array(r.length),D=new Float64Array(r.length),O=(e,t)=>w(r[e].target)-w(r[t].target)||e-t,k=(e,t)=>w(r[e].source)-w(r[t].source)||e-t,te=(e,t)=>w(e)-w(t)||e-t,A=e=>{let t=0;E(i[e],O);for(let n of i[e])T[n]=t+r[n].thickness/2,t+=r[n].thickness},j=e=>{let t=0;E(a[e],k);for(let n of a[e])D[n]=t+r[n].thickness/2,t+=r[n].thickness},M=()=>{for(let e=0;e<n;e++)A(e),j(e)},N=(e,n,o)=>{for(let t of e){let e=o?a[t]:i[t];if(e.length===0)continue;o?j(t):A(t);let s=0,c=0,l=0;for(let n of e){let e=o?m[r[n].source].y+T[n]-D[n]:m[r[n].target].y+D[n]-T[n];s+=e*r[n].thickness,c+=r[n].thickness,l+=w(o?r[n].source:r[n].target)-m[t].height/2}let u=c>0?s/c:l/e.length;m[t].y+=(u-m[t].y)*n}E(e,te);let s=0;for(let t of e)m[t].y-C[t]<s&&(m[t].y=s+C[t]),s=m[t].y+m[t].height+C[t]+y;s=t.height;for(let t=e.length-1;t>=0;t--){let n=e[t];m[n].y+m[n].height+C[n]>s&&(m[n].y=s-m[n].height-C[n]),s=m[n].y-C[n]-y}};M();for(let e=0;e<ee;e++){let t=.99**e;for(let e=l-2;e>=0;e--)N(g[e],t,!1);M();for(let e=1;e<l;e++)N(g[e],t,!0);M()}for(let e=0;e<r.length;e++)r[e].sourceY=m[r[e].source].y+T[e],r[e].targetY=m[r[e].target].y+D[e];return{nodes:m,links:r}}var O=6,k=15,te=1.8,A=300;function j(e){let t=2166136261,n=5381;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n,33)+i|0}return(t>>>0).toString(36)+(n>>>0).toString(36)}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e,t,n,r,i){let a=e[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function ne(e,t){let n=e[t];return typeof n==`string`||typeof n==`number`&&Number.isFinite(n)?String(n):``}function re(e){return Math.abs(e)<0x38d7ea4c68000?Math.round(e*100)/100:e}function ie(e){return typeof e==`string`?a([`fill:${e}`]).shape:``}function P(e,t,n){let r=M(t.sankey)?t.sankey:{},i=N(r,`width`,600,1,1e4);return c(n,i,160,t=>F(e,r,n,t,i))}function F(a,c,u,d,p){let m=u.fontSize??16,h=Math.round(m*.625),_=Math.max(h,Math.round(m*.875*Math.min(1,d/p))),v=u.measurer??g(u.fontFamily,u.fontFamilyMono),y=u.padding??8,b=N(c,`height`,400,1,1e4),x=Math.min(N(c,`nodeWidth`,10,1,200),d),S=c.showValues!==!1,C=f(ne(c,`prefix`)),w=f(ne(c,`suffix`)),T=c.labelStyle===`outlined`,ee=c.nodeAlignment===`left`||c.nodeAlignment===`right`||c.nodeAlignment===`center`?c.nodeAlignment:`justify`,E=typeof c.linkColor==`string`?c.linkColor:`gradient`,P=e=>D(a,{width:d,height:b,nodeWidth:x,nodePadding:N(c,`nodePadding`,12,0,200)+(S?k:0),labelHeight:e*1.15,alignment:ee}),F=P(_),I=new Map,L=1;for(let e of F.nodes){let t=(I.get(e.layer)??0)+1;I.set(e.layer,t),t>L&&(L=t)}let R=Math.max(h,Math.round(b/L/te));R<_&&(_=R,F=P(_));let{nodes:z,links:ae}=F,B=_*1.5,V=new Map;if(M(c.nodeColors))for(let[e,t]of Object.entries(c.nodeColors)){let n=ie(t);n&&V.set(e,n)}let H=e=>V.get(a.nodes[e].id)??``,U=e=>/^ style="fill:(.*);"$/.exec(H(e))?.[1]??n(e),W=0,G=0;z.forEach(e=>{e.value>G&&(G=e.value,W=e.layer)});let K=0,q=d,J=0,Y=b,oe=z.map((e,t)=>{let n=f(a.nodes[t].id),r=S?`${C}${re(e.value)}${w}`:``,i=v.width(r?`${n} ${r}`:n,_,0),o=T?e.layer>=W:e.x<d/2,s=o?e.x+x+O:e.x-O,c=e.y+e.height/2;return K=Math.min(K,o?s:s-i),q=Math.max(q,o?s+i:s),J=Math.min(J,c-_*.75),Y=Math.max(Y,c+_*.75),{value:r,width:i,after:o,left:o?s:s-i,y:c}}),X=new Map;if(z.length<=A)for(let e of oe){let t=Math.floor(e.y/B);for(let n of[t-2,t-1,t,t+1,t+2]){let t=X.get(n);t?t.push(e):X.set(n,[e])}}let se=``,ce=``;z.forEach((e,i)=>{let o=a.nodes[i].id,c=f(o),l=Math.max(e.height,1);ce+=`<rect class="pele-sankey-node" data-id="${r(o)}" x="${s(e.x)}" y="${s(e.y)}" width="${s(x)}" height="${s(l)}" rx="${s(Math.min(2,l/2))}" fill="${n(i)}"${H(i)}/>`;let u=oe[i],d=(e,t)=>(X.get(Math.floor(t/B))??[]).some(n=>n!==u&&Math.abs(n.y-t)<B&&e<n.left+n.width+O&&e+u.width>n.left-O);if(z.length<=A&&d(u.left,u.y))e:for(let t of[0,-B,B])for(let n of[u.after,!u.after]){let r=n?e.x+x+O:e.x-O-u.width,a=u.y+t;if(d(r,a)||r<K||r+u.width>q||a-_*.75<J||a+_*.75>Y||z.some((e,t)=>t!==i&&r<e.x+x+O&&r+u.width>e.x-O&&a-_*.75<e.y+e.height&&a+_*.75>e.y))continue;let o=Math.max(0,e.y-a,a-e.y-e.height);if(!z.some((t,n)=>n!==i&&t.x===e.x&&Math.max(0,t.y-a,a-t.y-t.height)<=o)){u.left=r,u.y=a,u.after=n;break e}}let{value:p,after:m,y:h}=u,g=m?e.x+x+O:e.x-O,v=` x="${s(g)}" y="${s(h+_*.35)}" text-anchor="${m?`start`:`end`}"`,y=t(c)+(p?` <tspan class="pele-sankey-value" fill="var(--_m)">${t(p)}</tspan>`:``);se+=`<g class="pele-label" data-id="${r(o)}">`+(T?`<text${v} fill="none" stroke="var(--_bg)" stroke-width="3" stroke-linejoin="round">${t(c)}${p?` `+t(p):``}</text>`:``)+`<text${v}>${y}</text></g>`});let le=E===`gradient`||E===`source`||E===`target`?``:ie(E),ue=u.idPrefix??``,de=E===`gradient`&&/^[\w-]+$/.test(ue),Z=new Map,fe=``;for(let e of ae){let i=E===`target`?e.target:e.source,o=Math.max(e.thickness,1)/2,c=z[e.source].x+x,l=z[e.target].x,u=`fill="${n(i)}"${le||H(i)}`;if(de){let t=`x1="${s(c)}" x2="${s(l)}"><stop offset="0" stop-color="${U(e.source)}"/><stop offset="1" stop-color="${U(e.target)}"/>`,n=`${ue}-sankey-${j(t)}`;Z.set(n,`<linearGradient id="${n}" gradientUnits="userSpaceOnUse" ${t}</linearGradient>`),u=`fill="url(#${n}) ${U(e.source)}"`}let d=s((c+l)/2),f=r(a.nodes[e.source].id),p=r(a.nodes[e.target].id);fe+=`<path class="pele-sankey-link" data-id="${f}-&gt;${p}" d="M${s(c)},${s(e.sourceY-o)}C${d},${s(e.sourceY-o)} ${d},${s(e.targetY-o)} ${s(l)},${s(e.targetY-o)}L${s(l)},${s(e.targetY+o)}C${d},${s(e.targetY+o)} ${d},${s(e.sourceY+o)} ${s(c)},${s(e.sourceY+o)}Z" ${u}><title>${f} → ${p}: ${t(C)}${re(e.value)}${t(w)}</title></path>`}let Q=o(a.title,!1,v,m,l(u),1),pe=Q.height>0?Q.height+12:0,me=Math.max(q-K,Q.width),he=y-K+(me-(q-K))/2,ge=y+pe-J,$=Math.ceil(me+2*y),_e=Math.ceil(Y-J+pe+2*y);return{svg:e(`sankey`,$,_e,m,u,a,i(Q,$/2,y+Q.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${s(he)},${s(ge)})">`+(Z.size>0?`<defs>${[...Z.values()].join(``)}</defs>`:``)+`<g class="pele-sankey-links" fill-opacity="0.4">${fe}</g><g class="pele-sankey-nodes">${ce}</g><g class="pele-labels" font-size="${_}">${se}</g></g>`),width:$,height:_e,links:[]}}var I={type:`sankey`,parse(e,t,n){let r=new _;return n&&(r.title=n),T(w(e),r,e),r},render:P};export{I as sankey};
@@ -1,2 +1,2 @@
1
- import{_ as e,b as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./C2npZzkn.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,i as d,s as f}from"./BXBhaEho.js";import{t as p}from"./DDAG55ce.js";import{a as m,i as h,o as g}from"./BA78_vo5.js";import{PeleError as _,g as v,h as y,s as b,u as x}from"./CMikI1NP.js";var S=1e5;function C(e){switch(e){case`[]`:return`square`;case`()`:return`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}function w(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}function T(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}function E(e){return e.includes(`==`)?`thick`:`normal`}function D(e){return e.includes(`.-`)?`dotted`:`solid`}function O(e,t){let n=e.flat(),r=-1;for(let e of n)if(e.type===`column-setting`){r=e.columns??-1;break}return{list:n,at:0,parent:t,children:[],columns:r}}var k=class{type=`block`;title;root={id:`root`,type:`composite`,children:[],columns:-1};blocks=[];edges=[];classes=new Map;byId=new Map;typeStr2Type=C;edgeStrToEdgeData=w;edgeStrToEdgeStartData=T;edgeStrToThickness=E;edgeStrToPattern=D;warn;pending=new Set;edgeCount=new Map;ids=0;colors=0;spaces=0;constructor(e={}){this.warn=e.warn}generateId(){return`id-`+ ++this.ids}addStyleClass(e,t=``){let n=this.classes.get(e);n||(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n));for(let e of t.split(`,`)){let t=e.indexOf(`;`),r=(t===-1?e:e.slice(0,t)+e.slice(t+1)).trim();e.includes(`color`)&&n.textStyles.push(r.replace(`fill`,`bgFill`).replace(`color`,`fill`)),n.styles.push(r)}}addStyle2Node(e,t=``){this.named(e).styles=t.split(`,`)}setCssClass(e,t){for(let n of e.split(`,`))(this.named(n.trim()).classes??=[]).push(t)}named(e){let t=this.byId.get(e);return t===void 0&&(t={id:e,type:`na`,children:[]},this.byId.set(e,t),this.pending.add(e)),t}setHierarchy(e){let t=[O(e,this.root)];for(;t.length>0;){let e=t[t.length-1];if(e.at===e.list.length){e.parent.children=e.children,t.pop();continue}let n=e.list[e.at++];switch(e.columns>0&&n.type!==`column-setting`&&typeof n.widthInColumns==`number`&&n.widthInColumns>e.columns&&this.warn?.(`Block ${n.id} width ${n.widthInColumns} exceeds configured column width ${e.columns}`),n.type){case`classDef`:this.addStyleClass(n.id,n.css);continue;case`applyClass`:this.setCssClass(n.id,n.styleClass??``);continue;case`applyStyles`:n.stylesStr&&this.addStyle2Node(n.id,n.stylesStr);continue;case`column-setting`:e.parent.columns=n.columns??-1;continue;case`edge`:{let e=(this.edgeCount.get(n.id)??0)+1;this.edgeCount.set(n.id,e),n.id=e+`-`+n.id,this.edges.push(n);continue}}n.id??=this.generateId(),n.label||=n.type===`composite`?``:n.id;let r=this.byId.get(n.id),i=r===void 0||this.pending.delete(n.id);i?(r&&(n.classes=r.classes,n.styles=r.styles),n.type===`composite`&&(n.colorIndex=this.colors++),this.byId.set(n.id,n)):(n.type!==`na`&&(r.type=n.type),n.label!==n.id&&(r.label=n.label));let a=n.children;if(n.children=[],n.type===`space`){let t=n.width??1;if(!(t<=S-this.spaces))throw new _(`A block diagram can hold at most ${S} space blocks.`,`limit`,{type:`block`});this.spaces+=Math.max(t,0);for(let r=0;r<t;r++){let t={...n,id:n.id+`-`+r,children:[]};this.byId.set(t.id,t),e.children.push(t)}}else i&&e.children.push(n);a&&a.length>0&&t.push(O(a,n))}this.blocks=this.root.children??[]}},A=`$end.INVALID.BLOCK_DIAGRAM_KEY.id-block.COLUMNS.MD_STR.STR.SPACE_BLOCK.DEFAULT.LINKSTYLE.INTERPOLATE.classDef.DEFAULT_CLASSDEF_ID.CLASSDEF_ID.CLASSDEF_STYLEOPTS.class.CLASSENTITY_IDS.STYLECLASS.style.STYLE_ENTITY_IDS.STYLE_DEFINITION_DATA.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.end.NODE_DSTART.NODE_DEND.BLOCK_ARROW_START.BLOCK_ARROW_END.DIR.NODE_ID.LINK.START_LINK.LINK_LABEL.SIZE.EOF`.split(`.`),j=[`right`,`left`,`x`,`y`,`up`,`down`],M=new Uint8Array(128);for(let e of[9,10,11,12,13,32,40,41,45,58,60,61,62,91,123,125])M[e]=1;function ee(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=(e,t,a)=>(n.push(e),r.push(t),i.push(s),s=a,!0),l=(t,n)=>c(t,e.slice(s,n),n),u=e=>{a.push(o),o=e},d=()=>{a.length>0&&(o=a.pop())},f=n=>{for(;n<t&&y(e.charCodeAt(n));)n++;return n},p=n=>{for(;n<t;){let t=e.charCodeAt(n);if(t<48||t>57)break;n++}return n},m=n=>{for(;n<t&&v(e.charCodeAt(n));)n++;return n},h=t=>e.startsWith(t,s)&&!v(e.charCodeAt(s+t.length)),g=()=>(e.charCodeAt(s+1)===96?(u(2),s+=2):(u(1),s++),!0),_=t=>{if(e.charCodeAt(t)!==46)return-1;do t++;while(e.charCodeAt(t)===46);if(e.charCodeAt(t)!==45)return-1;let n=e.charCodeAt(t+1);return n===120||n===111||n===62?t+2:t+1},b=t=>{let n=e.charCodeAt(t);(n===120||n===111||n===60)&&t++;let r=e.charCodeAt(t);if(r===46)return _(t);if(r!==45&&r!==61)return-1;let i=t+1;for(;e.charCodeAt(i)===r;)i++;if(i-t===1)return r===45?_(i):-1;let a=e.charCodeAt(i);return a===120||a===111||a===62?i+1:i-t>=3?i:-1},x=()=>{let t=b(s);if(t>=0)return l(33,f(t));let n=e.charCodeAt(s)===60?s+1:s,r=e.charCodeAt(n),i=e.charCodeAt(n+1);return r===45&&(i===45||i===46)||r===61&&i===61?(u(6),l(34,f(n+2))):!1},S=n=>{let r=e.indexOf(`
1
+ import{_ as e,b as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./DEQsS4Ez.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,i as d,s as f}from"./Kem7IXj7.js";import{t as p}from"./C1FDDux-.js";import{a as m,i as h,o as g}from"./CcE14TDI.js";import{PeleError as _,g as v,h as y,s as b,u as x}from"./zasx25UV.js";var S=1e5;function C(e){switch(e){case`[]`:return`square`;case`()`:return`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}function w(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}function T(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}function E(e){return e.includes(`==`)?`thick`:`normal`}function D(e){return e.includes(`.-`)?`dotted`:`solid`}function O(e,t){let n=e.flat(),r=-1;for(let e of n)if(e.type===`column-setting`){r=e.columns??-1;break}return{list:n,at:0,parent:t,children:[],columns:r}}var k=class{type=`block`;title;root={id:`root`,type:`composite`,children:[],columns:-1};blocks=[];edges=[];classes=new Map;byId=new Map;typeStr2Type=C;edgeStrToEdgeData=w;edgeStrToEdgeStartData=T;edgeStrToThickness=E;edgeStrToPattern=D;warn;pending=new Set;edgeCount=new Map;ids=0;colors=0;spaces=0;constructor(e={}){this.warn=e.warn}generateId(){return`id-`+ ++this.ids}addStyleClass(e,t=``){let n=this.classes.get(e);n||(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n));for(let e of t.split(`,`)){let t=e.indexOf(`;`),r=(t===-1?e:e.slice(0,t)+e.slice(t+1)).trim();e.includes(`color`)&&n.textStyles.push(r.replace(`fill`,`bgFill`).replace(`color`,`fill`)),n.styles.push(r)}}addStyle2Node(e,t=``){this.named(e).styles=t.split(`,`)}setCssClass(e,t){for(let n of e.split(`,`))(this.named(n.trim()).classes??=[]).push(t)}named(e){let t=this.byId.get(e);return t===void 0&&(t={id:e,type:`na`,children:[]},this.byId.set(e,t),this.pending.add(e)),t}setHierarchy(e){let t=[O(e,this.root)];for(;t.length>0;){let e=t[t.length-1];if(e.at===e.list.length){e.parent.children=e.children,t.pop();continue}let n=e.list[e.at++];switch(e.columns>0&&n.type!==`column-setting`&&typeof n.widthInColumns==`number`&&n.widthInColumns>e.columns&&this.warn?.(`Block ${n.id} width ${n.widthInColumns} exceeds configured column width ${e.columns}`),n.type){case`classDef`:this.addStyleClass(n.id,n.css);continue;case`applyClass`:this.setCssClass(n.id,n.styleClass??``);continue;case`applyStyles`:n.stylesStr&&this.addStyle2Node(n.id,n.stylesStr);continue;case`column-setting`:e.parent.columns=n.columns??-1;continue;case`edge`:{let e=(this.edgeCount.get(n.id)??0)+1;this.edgeCount.set(n.id,e),n.id=e+`-`+n.id,this.edges.push(n);continue}}n.id??=this.generateId(),n.label||=n.type===`composite`?``:n.id;let r=this.byId.get(n.id),i=r===void 0||this.pending.delete(n.id);i?(r&&(n.classes=r.classes,n.styles=r.styles),n.type===`composite`&&(n.colorIndex=this.colors++),this.byId.set(n.id,n)):(n.type!==`na`&&(r.type=n.type),n.label!==n.id&&(r.label=n.label));let a=n.children;if(n.children=[],n.type===`space`){let t=n.width??1;if(!(t<=S-this.spaces))throw new _(`A block diagram can hold at most ${S} space blocks.`,`limit`,{type:`block`});this.spaces+=Math.max(t,0);for(let r=0;r<t;r++){let t={...n,id:n.id+`-`+r,children:[]};this.byId.set(t.id,t),e.children.push(t)}}else i&&e.children.push(n);a&&a.length>0&&t.push(O(a,n))}this.blocks=this.root.children??[]}},A=`$end.INVALID.BLOCK_DIAGRAM_KEY.id-block.COLUMNS.MD_STR.STR.SPACE_BLOCK.DEFAULT.LINKSTYLE.INTERPOLATE.classDef.DEFAULT_CLASSDEF_ID.CLASSDEF_ID.CLASSDEF_STYLEOPTS.class.CLASSENTITY_IDS.STYLECLASS.style.STYLE_ENTITY_IDS.STYLE_DEFINITION_DATA.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.end.NODE_DSTART.NODE_DEND.BLOCK_ARROW_START.BLOCK_ARROW_END.DIR.NODE_ID.LINK.START_LINK.LINK_LABEL.SIZE.EOF`.split(`.`),j=[`right`,`left`,`x`,`y`,`up`,`down`],M=new Uint8Array(128);for(let e of[9,10,11,12,13,32,40,41,45,58,60,61,62,91,123,125])M[e]=1;function ee(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=(e,t,a)=>(n.push(e),r.push(t),i.push(s),s=a,!0),l=(t,n)=>c(t,e.slice(s,n),n),u=e=>{a.push(o),o=e},d=()=>{a.length>0&&(o=a.pop())},f=n=>{for(;n<t&&y(e.charCodeAt(n));)n++;return n},p=n=>{for(;n<t;){let t=e.charCodeAt(n);if(t<48||t>57)break;n++}return n},m=n=>{for(;n<t&&v(e.charCodeAt(n));)n++;return n},h=t=>e.startsWith(t,s)&&!v(e.charCodeAt(s+t.length)),g=()=>(e.charCodeAt(s+1)===96?(u(2),s+=2):(u(1),s++),!0),_=t=>{if(e.charCodeAt(t)!==46)return-1;do t++;while(e.charCodeAt(t)===46);if(e.charCodeAt(t)!==45)return-1;let n=e.charCodeAt(t+1);return n===120||n===111||n===62?t+2:t+1},b=t=>{let n=e.charCodeAt(t);(n===120||n===111||n===60)&&t++;let r=e.charCodeAt(t);if(r===46)return _(t);if(r!==45&&r!==61)return-1;let i=t+1;for(;e.charCodeAt(i)===r;)i++;if(i-t===1)return r===45?_(i):-1;let a=e.charCodeAt(i);return a===120||a===111||a===62?i+1:i-t>=3?i:-1},x=()=>{let t=b(s);if(t>=0)return l(33,f(t));let n=e.charCodeAt(s)===60?s+1:s,r=e.charCodeAt(n),i=e.charCodeAt(n+1);return r===45&&(i===45||i===46)||r===61&&i===61?(u(6),l(34,f(n+2))):!1},S=n=>{let r=e.indexOf(`
2
2
  `,s);return r===-1&&(r=t),d(),l(n,r)},C=(t,n)=>{let r=m(s);if(r===s)return!1;for(;e.charCodeAt(r)===44;){let e=f(r+1),t=m(e);if(t===e)break;r=t}return o=n,l(t,r)},w=n=>{if(y(n))return s=f(s+1),!0;let r;switch(n){case 98:if(e.startsWith(`block`,s)){if(h(`block-beta`))return l(2,s+10);if(e.charCodeAt(s+5)===58)return l(3,s+6);if(!v(e.charCodeAt(s+5)))return l(2,s+5)}break;case 99:if(e.startsWith(`columns`,s)){if(r=f(s+7),r>s+7){if(e.startsWith(`auto`,r)&&!v(e.charCodeAt(r+4)))return c(4,`-1`,r+4);let t=p(r);if(t>r)return c(4,e.slice(r,t),t)}}else if(e.startsWith(`class`,s)){let t=e.startsWith(`Def`,s+5),n=t?s+8:s+5;if(r=f(n),r>n)return u(t?7:9),l(t?11:15,r)}break;case 34:return g();case 115:if(e.startsWith(`space`,s)){if(e.charCodeAt(s+5)===58){let t=p(s+6);if(t>s+6)return c(7,e.slice(s+6,t),t)}if(!v(e.charCodeAt(s+5)))return c(7,`1`,s+5)}else if(e.startsWith(`style`,s)&&(r=f(s+5),r>s+5))return u(11),l(18,r);break;case 100:if(h(`default`))return l(8,s+7);break;case 108:if(h(`linkStyle`))return l(9,s+9);break;case 105:if(h(`interpolate`))return l(10,s+11);break;case 97:if(e.startsWith(`accTitle`,s)){if(r=f(s+8),e.charCodeAt(r)===58)return u(13),l(21,f(r+1))}else if(e.startsWith(`accDescr`,s)){r=f(s+8);let t=e.charCodeAt(r);if(t===58)return u(14),l(23,f(r+1));if(t===123)return u(15),s=f(r+1),!0}break;case 101:if(h(`end`))return l(26,f(s+3));break;case 45:return e.charCodeAt(s+1)===41?(u(3),l(27,s+2)):x();case 61:return x();case 60:return e.charCodeAt(s+1)===91?(u(4),l(29,s+2)):x();case 40:{let t=e.charCodeAt(s+1),n=t===45||t===91?2:t===40?e.charCodeAt(s+2)===40?3:2:1;return u(3),l(27,s+n)}case 41:case 123:return u(3),l(27,e.charCodeAt(s+1)===n?s+2:s+1);case 62:return u(3),l(27,s+1);case 91:{let t=e.charCodeAt(s+1);return u(3),l(27,t===91||t===124||t===40||t===92||t===47?s+2:s+1)}case 58:{let t=p(s+1);return t>s+1&&c(36,e.slice(s+1,t),t)}}for(r=s;r<t;){let t=e.charCodeAt(r);if(t<128?M[t]===1:y(t))break;r++}return r>s&&l(32,r)},T=t=>{let n=e.charCodeAt(s+1),r=0;switch(t){case 34:return g();case 40:r=n===45?2:n===40?e.charCodeAt(s+2)===40?3:2:1;break;case 41:r=n===41?e.charCodeAt(s+2)===41?3:2:n===93?2:1;break;case 125:r=n===125?2:1;break;case 45:r=n===41?2:0;break;case 93:r=n===93||n===41||n===62?2:1;break;case 92:case 47:r=n===93?2:0}return r!==0&&(d(),l(28,s+r))},E=t=>{if(t===41)return d(),d(),c(30,`]>`,f(s+1));let n=f(t===44?s+1:s);for(let r of j)if(e.startsWith(r,n)){let i=f(n+r.length);return c(31,e.slice(t===44?n:s,i),i)}return!1};for(;;){if(s>=t){let e=-1;switch(o){case 0:e=37;break;case 1:e=6;break;case 8:e=14;break;case 10:e=17;break;case 12:e=20;break;case 13:e=22;break;case 14:e=24;break;case 15:e=25}s=t,e!==-1&&c(e,``,t);break}let a=e.charCodeAt(s),p=!0;switch(o){case 0:p=w(a);break;case 1:if(a===34)d(),s++;else{let n=e.indexOf(`"`,s);l(6,n===-1?t:n)}break;case 2:if(a===96)p=e.charCodeAt(s+1)===34,p&&(d(),s+=2);else if(a===34)p=!1;else{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===96||t===34)break;n++}l(5,n)}break;case 3:p=T(a);break;case 4:if(a===34)g();else if(a===93&&e.charCodeAt(s+1)===62){let t=f(s+2);p=e.charCodeAt(t)===40,p&&(u(5),s=t+1)}else p=!1;break;case 5:p=E(a);break;case 6:if(a===34)e.charCodeAt(s+1)===96?g():(l(35,s+1),u(1));else{let e=b(f(s));p=e>=0,p&&(d(),l(33,f(e)))}break;case 7:{let t=12,n=e.startsWith(`DEFAULT`,s)?s+7:s,r=f(n);(n===s||r===n)&&(t=13,n=m(s),r=f(n)),p=n>s&&r>n,p&&(o=8,l(t,r));break}case 8:S(14);break;case 9:p=C(16,10);break;case 10:S(17);break;case 11:p=C(19,12);break;case 12:S(20);break;case 13:S(22);break;case 14:S(24);break;case 15:if(a===125)d(),s++;else{let n=e.indexOf(`}`,s);l(25,n===-1?t:n)}}if(!p)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}return n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var N=`'NODE_ID', 'COLUMNS', 'SPACE_BLOCK', 'BLOCK_DIAGRAM_KEY', 'id-block', 'classDef', 'class', 'style'`;function P(e){let t=e[e.length-1];return Array.isArray(t)?(e.pop(),e.concat(t)):e}function te(e,t){let{types:n,texts:r,starts:i}=ee(e),a=0,o=t=>{let r=n[a];throw r===1?b(`block`,e,i[a],``,!0):b(`block`,e,i[a],`Expecting ${t}, got '${A[r]}'`)},s=e=>(n[a]!==e&&o(`'${A[e]}'`),r[a++]),c=()=>{let e=s(32);if(n[a]===27){let t=r[a++];return{id:e,label:s(6),typeStr:t+s(28)}}if(n[a]===29){let t=r[a++],i=s(6),o=[s(31)];for(;n[a]===31;)o.push(r[a++]);return{id:e,label:i,typeStr:t+s(30),directions:o}}return{id:e}},l=()=>{let e=c(),i=n[a]===36?parseInt(r[a++],10):1,o={id:e.id,label:e.label,type:t.typeStr2Type(e.typeStr),directions:e.directions,widthInColumns:i},l;for(;n[a]===33||n[a]===34;){let e=``;n[a++]===34&&(s(35),e=s(6),s(33));let i=r[a-1],u=c(),d=t.edgeStrToEdgeData(i),f=t.edgeStrToEdgeStartData(i),p=t.edgeStrToThickness(i),m=t.edgeStrToPattern(i);l??=[{id:o.id,label:o.label,type:o.type,directions:o.directions}],o={id:u.id,label:u.label,type:t.typeStr2Type(u.typeStr),directions:u.directions},l.push({id:l[l.length-1].id+`-`+u.id,start:l[l.length-1].id,end:u.id,label:e,type:`edge`,thickness:p,pattern:m,directions:u.directions,arrowTypeEnd:d,arrowTypeStart:f},o)}return l??o};s(2);let u=[],d=[];for(;;)switch(n[a]){case 32:d.push(l());break;case 4:d.push({type:`column-setting`,columns:parseInt(r[a++],10)});break;case 7:{let e=parseInt(r[a++],10);d.push({id:t.generateId(),type:`space`,label:``,width:e,children:[]});break}case 2:a++,u.push({list:d,header:void 0}),d=[];break;case 3:a++,n[a]!==32&&o(`'NODE_ID'`),u.push({list:d,header:l()}),d=[];break;case 26:{let e=u.pop();if(e===void 0||d.length===0)return o(N);a++;let n=t.generateId(),r=P(d);d=e.list,d.push(e.header===void 0?{id:n,type:`composite`,label:``,children:r}:{...e.header,type:`composite`,children:r});break}case 11:{a++;let e=s(13).trim();d.push({type:`classDef`,id:e,css:s(14).trim()});break}case 15:{a++;let e=s(16).trim();d.push({type:`applyClass`,id:e,styleClass:s(17).trim()});break}case 18:{a++;let e=s(19).trim();d.push({type:`applyStyles`,id:e,stylesStr:s(20).trim()});break}case 37:u.length>0&&o(N+`, 'end'`),d.length===0&&o(N),t.setHierarchy(P(d));return;default:o(d.length===0?N:N+(u.length>0?`, 'end'`:`, 'EOF'`))}}var F=1,I=2,L=4,R=8,z=7,B=20,V=12;function ne(e){let t=0;if(e)for(let n of e)switch(n.trim()){case`right`:t|=F;break;case`left`:t|=I;break;case`up`:t|=L;break;case`down`:t|=R;break;case`x`:t|=F|I;break;case`y`:t|=L|R}return t}var H=(e,t)=>e&t?1:0;function U(e){return e!==0&&(e&(L|R))===0?`x`:e!==0&&(e&(F|I))===0?`y`:``}function re(e,t,n){let r=U(e),i=H(e,I)-H(e,F),a=H(e,L)-H(e,R);if(r===`x`){let r=Math.max(n+8,14)+2*z,a=Math.min(r/2,B);return{w:Math.max(t+12,16)+a*(e===(F|I)?2:1),h:r,dx:i*a/2,dy:0}}if(r===`y`){let r=Math.max(t+16,14)+2*z,i=Math.min(r/2,B);return{w:r,h:Math.max(n+8,16)+i*(e===(L|R)?2:1),dx:0,dy:a*i/2}}return{w:Math.max(t+16,24)+V*(H(e,I)+H(e,F)),h:Math.max(n+8,24)+V*(H(e,L)+H(e,R)),dx:i*V/2,dy:a*V/2}}function ie(e,t,n,r){let i=U(e),a=t/2,o=n/2,c;if(i===`x`){let t=Math.min(o,B),n=o-z,r=e&I?-a+t:-a,i=e&F?a-t:a;c=[r,-n,i,-n],e&F&&c.push(i,-o,a,0,i,o),c.push(i,n,r,n),e&I&&c.push(r,o,-a,0,r,-o)}else if(i===`y`){let t=Math.min(a,B),n=a-z,r=e&L?-o+t:-o,i=e&R?o-t:o;c=[n,r,n,i],e&R&&c.push(a,i,0,o,-a,i),c.push(-n,i,-n,r),e&L&&c.push(-a,r,0,-o,a,r)}else{let t=e&I?-a+V:-a,n=e&F?a-V:a,r=e&L?-o+V:-o,i=e&R?o-V:o,s=(t+n)/2,l=(r+i)/2,u=Math.min(10,(n-t)/2),d=Math.min(10,(i-r)/2);c=[t,r],e&L&&c.push(s-u,r,s,-o,s+u,r),c.push(n,r),e&F&&c.push(n,l-d,a,l,n,l+d),c.push(n,i),e&R&&c.push(s+u,i,s,o,s-u,i),c.push(t,i),e&I&&c.push(t,l+d,-a,l,t,l-d)}let l=``;for(let e=0;e<c.length;e+=2)l+=(e?` `:``)+s(c[e])+`,`+s(c[e+1]);return`<polygon points="${l}" stroke-linejoin="round"${r}/>`}var ae=1e3;function W(e,t){if(e===0||!Number.isInteger(e))throw new _(`Columns must be an integer !== 0.`,`semantic`,{type:`block`});if(t<0||!Number.isInteger(t))throw new _(`Position must be a non-negative integer.`+t,`semantic`,{type:`block`});return e<0?{px:t,py:0}:{px:t%e,py:Math.floor(t/e)}}function G(e,t,n){let r=e.columns,i=[],a=0,o=0,s=0,c=0;for(let n of e.children){let{px:e,py:l}=W(r,a),u=n.span>=1?Math.min(n.span,ae):1;if(r>0&&u>r-e&&(u=r-e),n.span=u,n.col=e,n.row=l,a+=u,e+u>o&&(o=e+u),l===i.length&&i.push(0),n.children.length===0?i[l]=-1:i[l]>=0&&n.nh>i[l]&&(i[l]=n.nh),n.space)continue;let d=(n.nw-t*(u-1))/u;d>s&&(s=d),n.nh>c&&(c=n.nh)}let l=(i.length-1)*t;for(let e=0;e<i.length;e++)i[e]<0&&(i[e]=c),l+=i[e];e.cols=o,e.heights=i,e.nw=Math.max(e.nw,o*s+(o-1)*t+2*n),e.nh=l+2*n+e.head}function K(e,t,n){let{cols:r,heights:i}=e,a=i.length,o=(e.w-2*n-(r-1)*t)/r,s=e.h-2*n-e.head-(a-1)*t,c=0;for(let e of i)c+=e;let l=c>0?s/c:0,u=c>0?0:s/a,d=e.x-e.w/2+n,f=e.y-e.h/2+n+e.head,p=0;for(let n of e.children){for(;p<n.row;p++)f+=i[p]*l+u+t;n.w=o*n.span+t*(n.span-1),n.h=i[p]*l+u,n.x=d+n.col*(o+t)+n.w/2,n.y=f+n.h/2}}function oe(e,t){let n=[e];for(let e=0;e<n.length;e++)for(let t of n[e].children)n.push(t);for(let e=n.length-1;e>=0;e--){let r=n[e];r.children.length>0&&G(r,t,e===0?0:t)}e.w=e.nw,e.h=e.nh,e.x=e.w/2,e.y=e.h/2;for(let e=0;e<n.length;e++){let r=n[e];r.children.length>0&&K(r,t,e===0?0:t)}return{width:e.w,height:e.h}}var se=12,ce=200,q=8,le=` fill="var(--_s)" stroke="var(--_b)"`,ue=` stroke="var(--_b)"`,de=[],fe=[],pe=[],me=[`default`],he=2e6,ge=new Map([[`square`,`rect`],[`round`,`rounded`],[`circle`,`circle`],[`doublecircle`,`dbl-circ`],[`diamond`,`diam`],[`hexagon`,`hex`],[`stadium`,`stadium`],[`subroutine`,`fr-rect`],[`cylinder`,`cyl`],[`rect_left_inv_arrow`,`odd`],[`lean_right`,`lean-r`],[`lean_left`,`lean-l`],[`trapezoid`,`trap-b`],[`inv_trapezoid`,`trap-t`]]),_e=new Set([`circle`,`dbl-circ`,`diam`]),ve=new Set([`stadium`,`hex`,`odd`,`lean-r`,`lean-l`,`trap-b`,`trap-t`]);function J(e){return e.kind===0&&(e.shape===`circle`||e.shape===`dbl-circ`)}function Y(e,t,n){let r=e.bw/2,i=e.bh/2,a=Math.abs(t-e.x),o=i;return J(e)?o=Math.sqrt(Math.max(r*r-a*a,0)):e.kind===0&&e.shape===`diam`?o=i*Math.max(1-a/r,0):e.kind===0?o=i-g(e.shape,e.bw,e.bh,n>0?2:0):e.kind===1&&U(e.mask)===`x`&&(o=i-z),e.y+n*o}function X(e,t,n){let r=e.bw/2,i=e.bh/2,a=Math.abs(t-e.y),o=r;return J(e)?o=Math.sqrt(Math.max(i*i-a*a,0)):e.kind===0&&e.shape===`diam`?o=r*Math.max(1-a/i,0):e.kind===0?o=r-g(e.shape,e.bw,e.bh,n>0?1:3):e.kind===1&&U(e.mask)===`y`&&(o=r-z),e.x+n*o}function Z(e,t,n,r){let i=t-e.x,a=n-e.y,o=e.bw/2,s=e.bh/2,c;c=J(e)?o/(Math.hypot(i,a)||1):e.kind===0&&e.shape===`diam`?1/(Math.abs(i)/o+Math.abs(a)/s||1):Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),c===1/0&&(c=0),r.push(e.x+i*c,e.y+a*c)}function ye(e,t,n,r,i){let a=i.x-i.bw/2+1,o=i.x+i.bw/2-1,s=i.y-i.bh/2+1,c=i.y+i.bh/2-1;if(e<a&&n<a||e>o&&n>o||t<s&&r<s||t>c&&r>c)return!1;if(e===n||t===r)return!0;let l=n-e,u=r-t,d=(n,r)=>Math.sign(l*(r-t)-u*(n-e)),f=d(a,s);return f===0||d(o,s)!==f||d(o,c)!==f||d(a,c)!==f}function Q(e,t,n,r){let i=0;for(let a of r)if(a!==t&&a!==n){for(let t=0;t+3<e.length;t+=2)if(ye(e[t],e[t+1],e[t+2],e[t+3],a)){i++;break}}return i}function be(e,t,n,r){let i=e.x-e.bw/2,a=e.x+e.bw/2,o=e.y-e.bh/2,s=e.y+e.bh/2,c=t.x-t.bw/2,l=t.x+t.bw/2,u=t.y-t.bh/2,d=t.y+t.bh/2,f=Math.max(i,c),p=Math.min(a,l),m=Math.max(o,u),h=Math.min(s,d),g=p-f>6,_=h-m>6;if(g&&_){let n=e.bw*e.bh<=t.bw*t.bh?e:t,r=n===e?t:e,i=n.y-n.bh/2-(r.y-r.bh/2),a=r.y+r.bh/2-(n.y+n.bh/2),o=n.x-n.bw/2-(r.x-r.bw/2),s=r.x+r.bw/2-(n.x+n.bw/2),c=Math.min(i,a,o,s),l;return l=c===a?[n.x,Y(n,n.x,1),n.x,r.y+r.bh/2]:c===i?[n.x,Y(n,n.x,-1),n.x,r.y-r.bh/2]:c===s?[X(n,n.y,1),n.y,r.x+r.bw/2,n.y]:[X(n,n.y,-1),n.y,r.x-r.bw/2,n.y],n===e?l:[l[2],l[3],l[0],l[1]]}if(g){let r=Math.min(6,(p-f)/2),i=Math.min(Math.max((f+p)/2+n,f+r),p-r),a=t.y>e.y?1:-1;return[i,Y(e,i,a),i,Y(t,i,-a)]}if(_){let r=Math.min(6,(h-m)/2),i=Math.min(Math.max((m+h)/2+n,m+r),h-r),a=t.x>e.x?1:-1;return[X(e,i,a),i,X(t,i,-a),i]}let v=t.x>e.x?1:-1,y=t.y>e.y?1:-1,b=[X(e,e.y,v),e.y,t.x,e.y,t.x,Y(t,t.x,-y)],x=[e.x,Y(e,e.x,y),e.x,t.y,X(t,t.y,-v),t.y],S=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y),C=S?b:x;if(r===void 0)return C;let w=Q(C,e,t,r);if(w===0)return C;let T=S?x:b,E=Q(T,e,t,r);if(E<w&&(C=T,w=E),w===0)return C;let D=[];return Z(e,t.x,t.y,D),Z(t,e.x,e.y,D),Q(D,e,t,r)<w?D:C}function xe(e,t,n){let r=e.length,i=e[0],a=e[1],o=e[r-2],c=e[r-1],l=e[2]-i,u=e[3]-a,d=Math.hypot(l,u);l/=d||1,u/=d||1;let f=o-e[r-4],p=c-e[r-3],m=Math.hypot(f,p);if(f/=m||1,p/=m||1,r===4&&t+n>d){let e=d/(t+n);t*=e,n*=e}t=Math.min(t,d),n=Math.min(n,m);let h=`M${s(i+l*t)},${s(a+u*t)}`;if(r===6){let r=Math.max(0,Math.min(q,d-t,m-n));h+=`L${s(e[2]-l*r)},${s(e[3]-u*r)}Q${s(e[2])},${s(e[3])} ${s(e[2]+f*r)},${s(e[3]+p*r)}`}return h+=`L${s(o-f*n)},${s(c-p*n)}`,{d:h,sx:i,sy:a,sdx:-l,sdy:-u,ex:o,ey:c,edx:f,edy:p}}function Se(e,t){let n=e.bw/2,r=e.bh/2,i=Math.max(1,Math.min(10+5*(t-1),n,r));if(J(e)){let t=e.x+n*Math.SQRT1_2,r=e.y-n*Math.SQRT1_2,a=2*Math.asin(Math.min(1,i/(2*n))),o=i=>Math.atan2(e.y-n*Math.sin(i)-r,e.x+n*Math.cos(i)-t);return[t,r,i,o(Math.PI/4+a),o(Math.PI/4-a)]}if(e.kind===0&&e.shape===`diam`){let t=Math.atan2(r,n);return[e.x+n/2,e.y-r/2,i,t+Math.PI,t]}return[e.x+n,e.y-r,i,Math.PI,Math.PI/2]}function Ce(e,t,n,r){let[i,a,o,c,l]=Se(e,t),u=c+n/o,d=l-r/o,f=(d-u)%(2*Math.PI);f<=0&&(f+=2*Math.PI);let p=i+o*Math.cos(u),m=a+o*Math.sin(u),h=i+o*Math.cos(d),g=a+o*Math.sin(d),_=i+o*Math.cos(c),v=a+o*Math.sin(c),y=i+o*Math.cos(l),b=a+o*Math.sin(l),x=Math.hypot(_-p,v-m),S=Math.hypot(y-h,b-g);return{d:`M${s(p)},${s(m)}A${s(o)},${s(o)} 0 ${+(f>Math.PI)} 1 ${s(h)},${s(g)}`,sx:_,sy:v,sdx:x>0?(_-p)/x:Math.sin(c),sdy:x>0?(v-m)/x:-Math.cos(c),ex:y,ey:b,edx:S>0?(y-h)/S:-Math.sin(l),edy:S>0?(b-g)/S:Math.cos(l)}}var $=[.5,.3,.7,.15,.85];function we(e,t,n,r,i,a,o){if(o===void 0)return .5;for(let s of $){let c=e[t]+(e[t+2]-e[t])*s,l=e[t+1]+(e[t+3]-e[t+1])*s,u=!0;for(let e of o)if(e!==i&&e!==a&&Math.abs(c-e.x)<(n+e.bw)/2&&Math.abs(l-e.y)<(r+e.bh)/2){u=!1;break}if(u)return s}return .5}function Te(e,t,n){return c(n,r=>Ee(e,t,n,r))}function Ee(c,g,_,v){let y=_.fontSize??16,b=Math.round(y*.875),S=_.measurer??x(_.fontFamily,_.fontFamilyMono),C=_.padding??8,w=_.icons,T=g.block?.padding,E=Math.min(typeof T==`number`&&T>=0?Math.min(T,200):se,v?6:1/0),D=v?80:ce,O=e=>{let t=[],n=e=>{for(let n of e)for(let e of n.split(`;`))t.push(e)};for(let t of e.classes&&e.classes.length>0?e.classes:me){let e=c.classes.get(t);e&&n(e.styles)}return e.styles&&n(e.styles),a(t)},k=(e,t)=>{let n=e.type,r=n===`space`?a(de):O(e),i=+!!r.bold|(r.italic?2:0),s=r.fontSize??y,c=0,u=``,d,f=0,p=0,m=0,g=0,b=0,x=0;if(n===`space`)c=3,d=o(void 0,!1,S,s,D);else if(n===`composite`)c=2,d=o(e.label,!1,S,s,v?l(_):4e3,i),m=d.height>0?d.height+4:0,f=d.width+2*E,p=m+2*E;else if(n===`block_arrow`){c=1,d=o(e.label,!1,S,s,D,i);let t=!0;for(let e of d.lines)for(let n of e)(n.icon!==void 0||n.text.trim()!==``)&&(t=!1);g=ne(e.directions);let n=t?re(g,0,0):re(g,d.width,d.height);f=n.w,p=n.h,b=n.dx,x=n.dy}else{u=ge.get(n??``)??`rect`,d=o(e.label,!1,S,s,D,i);let t=h(u,d.width,d.height);f=t.w,p=u===`cyl`?Math.max(t.h,d.height+40):t.h,x=t.dy}return{children:[],columns:c===2?e.columns??-1:-1,span:c===3?1:e.widthInColumns??1,space:c===3,head:m,nw:f,nh:p,col:0,row:0,cols:0,heights:pe,x:0,y:0,w:0,h:0,block:e,kind:c,index:t,shape:u,label:d,style:r,mask:g,dx:b,dy:x,bw:0,bh:0}},A=k(c.root,0);A.nw=0,A.nh=0;let j=[A],M=new Map;for(let e=0;e<j.length;e++){let t=j[e];if(t.kind===2)for(let e of t.block.children??fe){let n=k(e,j.length);t.children.push(n),j.push(n),n.kind!==3&&M.set(e.id,n)}}let ee=oe(A,E),N=[];for(let e of j)e.kind===0&&_e.has(e.shape)?(e.bw=e.nw,e.bh=e.nh):e.kind===1?(e.bw=e.span>1?e.w:e.nw,e.bh=e.nh):(e.bw=e.w,e.bh=e.kind===0&&ve.has(e.shape)?e.nh:e.h),e.kind===0&&e.shape===`cyl`&&(e.dy=Math.min(12,Math.max(6,e.bw/14))/2),(e.kind===0||e.kind===1)&&N.push(e);let P=new Map,te=new Set,F=[],I=[];for(let e of c.edges){let t=M.get(e.start??``),n=M.get(e.end??``);if(t===void 0||n===void 0)continue;let r=Math.min(t.index,n.index)*j.length+Math.max(t.index,n.index);P.set(r,(P.get(r)??0)+1),e.label&&te.add(r),F.push([t,n]),I.push(e)}let L=I.length*N.length<=he?N:void 0,R=new Map,z=[],B=0,V=0,H=ee.width,U=ee.height,ae=(e,t,n,r)=>{e-n/2<B&&(B=e-n/2),e+n/2>H&&(H=e+n/2),t-r/2<V&&(V=t-r/2),t+r/2>U&&(U=t+r/2)};for(let e=0;e<I.length;e++){let[t,n]=F[e],r=Math.min(t.index,n.index)*j.length+Math.max(t.index,n.index),i=P.get(r)??1,a=R.get(r)??0;R.set(r,a+1);let s=o(I[e].label,!1,S,b,ce),c,l,u;if(t===n){let[e,n,r]=Se(t,a+1);c=[],ae(e,n,2*r+2,2*r+2),l=e+r+6+s.width/2,u=n-r/2}else{let e=te.has(r)?Math.round(b*1.5)+2:14;c=be(t,n,(a-(i-1)/2)*e,L);let o=c.length,d=Math.abs(c[2]-c[0])+Math.abs(c[3]-c[1]),f=Math.abs(c[o-2]-c[o-4])+Math.abs(c[o-1]-c[o-3]),p=o===6&&f>d?2:0,m=s.width>0?we(c,p,s.width+8,s.height,t,n,L):.5;l=c[p]+(c[p+2]-c[p])*m,u=c[p+1]+(c[p+3]-c[p+1])*m}s.width>0&&ae(l,u,s.width+8,s.height),z.push({edge:I[e],points:c,loop:t===n?a+1:0,label:s,lx:l,ly:u})}let W=p(c.title,S,y,v?l(_):4e3),G=W.height>0?W.height+12:0,K=Math.max(H-B,W.width),q=C-B+(K-(H-B))/2,J=C+G-V;for(let e of j)e.x+=q,e.y+=J;let Y=Math.ceil(K+2*C),X=Math.ceil(U-V+G+2*C),Z=``,ye=``;for(let e=1;e<j.length;e++){let a=j[e];if(a.kind===3)continue;let o=t((a.block.classes??de).join(` `)),c=r(a.block.id);if(a.kind===2){let e=a.y-a.h/2;Z+=`<g class="pele-cluster${o}" data-id="${c}"><rect x="${s(a.x-a.w/2)}" y="${s(e)}" width="${s(a.w)}" height="${s(a.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${n(a.style.shape)}/>`+i(a.label,a.x,e+(a.head+E)/2+2,` class="pele-cluster-label" fill="var(--_m)"${a.style.text}`,w)+`</g>`;continue}let l=a.kind===1;ye+=`<g class="pele-node pele-shape-${l?`block-arrow`:a.shape}${o}" data-id="${c}" transform="translate(${s(a.x)},${s(a.y)})">`+(l?ie(a.mask,a.bw,a.bh,le+a.style.shape):m(a.shape,a.bw,a.bh,le+a.style.shape,ue+a.style.line))+i(a.label,a.dx,a.dy,` class="pele-label"${a.style.text}`,w)+`</g>`}let Q=``,$=``;for(let e=0;e<z.length;e++){let{edge:t,points:n,loop:i,label:a}=z[e],o=t.arrowTypeStart??``,s=t.arrowTypeEnd??``,c;if(i>0)c=Ce(F[e][0],i,u(o),u(s));else{for(let e=0;e<n.length;e+=2)n[e]+=q,n[e+1]+=J;c=xe(n,u(o),u(s))}let l=r(t.id);if(Q+=`<g class="pele-edge" data-id="${l}"><path d="${c.d}"${t.thickness===`thick`?` stroke-width="2.5"`:``}${t.pattern===`dotted`?` stroke-dasharray="3 4"`:``}/>`+f(o,c.sx,c.sy,c.sdx,c.sdy,`var(--_l)`)+f(s,c.ex,c.ey,c.edx,c.edy,`var(--_l)`)+`</g>`,a.width>0){let n=z[e].lx+q,r=z[e].ly+J;$+=d(t.id,a,n,r,``,w)}}return{svg:e(`block`,Y,X,y,_,c,i(W,Y/2,C+W.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(Z?`<g class="pele-clusters">${Z}</g>`:``)+(Q?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${Q}</g>`:``)+`<g class="pele-nodes">${ye}</g>`+($?`<g class="pele-edge-labels" font-size="${b}">${$}</g>`:``)),width:Y,height:X,links:[]}}var De={type:`block`,math:!0,parse(e,t,n){let r=new k;return r.title=n,te(e,r),r},render:Te};export{De as block};
@@ -1,2 +1,2 @@
1
- import{_ as e,o as t,u as n}from"./C2npZzkn.js";import{a as r,c as i,d as a,g as o,h as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./CTDYUZPz.js";import{u as _}from"./CMikI1NP.js";function v(e,t){return{type:`info`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
1
+ import{_ as e,o as t,u as n}from"./DEQsS4Ez.js";import{a as r,c as i,d as a,g as o,h as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./CWc-mNzo.js";import{u as _}from"./zasx25UV.js";function v(e,t){return{type:`info`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0}}var y=[c(`showInfo`),c(`info`),r,h,f,l,g,p,d,m];function b(e){let t=new s(u(e,y,`info`),y,`info`),n={$type:`Info`};for(;t.kind===5;)t.i++;for(t.expect(1);t.kind===5;)t.i++;if(t.accept(0))for(;t.kind===5;)t.i++;for(;t.kind!==-1;){let e=t.kind;if(e===2?n.accDescr=i(t.take()):e===3?n.accTitle=o(t.take()):e===4?n.title=a(t.take()):t.fail(`a title or the end of input`),t.kind===-1)break;for(t.kind!==5&&t.fail(`a line break or the end of input`);t.kind===5;)t.i++}return n}var x=`1.10.0`;function S(r,i,a){let o=a.fontSize??16,s=a.measurer??_(a.fontFamily,a.fontFamilyMono),c=a.padding??8,l=n(r.title,!1,s,o,4e3,1),u=l.height>0?l.height+8:0,d=n(`Pele v${x}`,!1,s,o,4e3),f=Math.ceil(Math.max(l.width,d.width)+2*c),p=Math.ceil(u+d.height+2*c),m=t(l,f/2,c+l.height/2,` class="pele-title" font-weight="var(--_tw)"`)+t(d,f/2,c+u+d.height/2,` class="pele-version" fill="var(--_m)"`);return{svg:e(`info`,f,p,o,a,r,m),width:f,height:p,links:[]}}var C={type:`info`,parse:(e,t,n)=>v(b(e),n),render:S};export{C as info};
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./C2npZzkn.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,s as d}from"./BXBhaEho.js";import{a as f}from"./BA78_vo5.js";import{o as p,t as m}from"./DKqMzyyE.js";import{n as h}from"./C8h1oeAZ.js";import{PeleError as g,g as _,h as v,s as y,u as b}from"./CMikI1NP.js";var x=new Set([`label`,`type`,`descr`,`techn`,`sprite`,`tags`,`link`,`bgColor`,`fontColor`,`borderColor`,`shadowing`,`shape`,`legendText`,`legendSprite`]),S=new Set([`label`,`descr`,`techn`,`sprite`,`tags`,`link`,`textColor`,`lineColor`]);function C(e,t){let{key:n,value:r}=t;`from`in e&&(n===`offsetX`||n===`offsetY`)?e[n]=parseInt(r):(`from`in e?S:x).has(n)?e[n]=r:(e.extra??=new Map).set(n,r)}function w(e,t,n){n!==void 0&&(typeof n==`string`?e[t]=n:C(e,n))}function T(e,t,n){n===void 0?e[t]??=``:w(e,t,n)}function E(e,t){e.labelAttr=void 0,typeof t==`object`?(e.label=``,e.labelAttr=t,C(e,t)):e.label=t??``}var D=class{type=`c4`;c4Type;title;accTitle;accDescr;shapes=[];boundaries=[{alias:`global`,label:`global`,type:`global`,parent:void 0}];rels=[];shapeInRow=4;boundaryInRow=2;shapeIndex=new Map;boundaryIndex=new Map;relIndex=new Map;current=this.boundaries[0];stack=[];setC4Type(e){this.c4Type=e}setTitle(e){this.title=e}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./DEQsS4Ez.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,s as d}from"./Kem7IXj7.js";import{a as f}from"./CcE14TDI.js";import{o as p,t as m}from"./BtcGx-KQ.js";import{n as h}from"./BLzZIf7l.js";import{PeleError as g,g as _,h as v,s as y,u as b}from"./zasx25UV.js";var x=new Set([`label`,`type`,`descr`,`techn`,`sprite`,`tags`,`link`,`bgColor`,`fontColor`,`borderColor`,`shadowing`,`shape`,`legendText`,`legendSprite`]),S=new Set([`label`,`descr`,`techn`,`sprite`,`tags`,`link`,`textColor`,`lineColor`]);function C(e,t){let{key:n,value:r}=t;`from`in e&&(n===`offsetX`||n===`offsetY`)?e[n]=parseInt(r):(`from`in e?S:x).has(n)?e[n]=r:(e.extra??=new Map).set(n,r)}function w(e,t,n){n!==void 0&&(typeof n==`string`?e[t]=n:C(e,n))}function T(e,t,n){n===void 0?e[t]??=``:w(e,t,n)}function E(e,t){e.labelAttr=void 0,typeof t==`object`?(e.label=``,e.labelAttr=t,C(e,t)):e.label=t??``}var D=class{type=`c4`;c4Type;title;accTitle;accDescr;shapes=[];boundaries=[{alias:`global`,label:`global`,type:`global`,parent:void 0}];rels=[];shapeInRow=4;boundaryInRow=2;shapeIndex=new Map;boundaryIndex=new Map;relIndex=new Map;current=this.boundaries[0];stack=[];setC4Type(e){this.c4Type=e}setTitle(e){this.title=e}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
2
  `)}element(e,t,n,r){let i=typeof n==`string`?t.get(n):void 0;return i===void 0&&(i={alias:``,label:``,parent:void 0},e.push(i),typeof n==`string`?(i.alias=n,t.set(n,i)):(i.aliasAttr=n,C(i,n))),E(i,r),i}addPersonOrSystem(e,t){let n=this.element(this.shapes,this.shapeIndex,t[0],t[1]);T(n,`descr`,t[2]),this.finishShape(n,e,t,3)}addContainer(e,t){let n=this.element(this.shapes,this.shapeIndex,t[0],t[1]);T(n,`techn`,t[2]),T(n,`descr`,t[3]),this.finishShape(n,e,t,4)}addComponent(e,t){this.addContainer(e,t)}finishShape(e,t,n,r){w(e,`sprite`,n[r]),w(e,`tags`,n[r+1]),w(e,`link`,n[r+2]),e.kind=t,e.parent=this.current}boundary(e,t){let n=this.element(this.boundaries,this.boundaryIndex,e[0],e[1]);return e[2]===void 0?n.type=t:w(n,`type`,e[2]),n}open(e){e.parent=this.current,this.stack.push(this.current),this.current=e}addPersonOrSystemBoundary(e,t=`system`){let n=this.boundary(e,t);w(n,`tags`,e[3]),w(n,`link`,e[4]),this.open(n)}addContainerBoundary(e){this.addPersonOrSystemBoundary(e,`container`)}addDeploymentNode(e,t){let n=this.boundary(t,`node`);T(n,`descr`,t[3]),w(n,`sprite`,t[4]),w(n,`tags`,t[5]),w(n,`link`,t[6]),n.nodeType=e,this.open(n)}popBoundaryParseStack(){this.current=this.stack.pop()??this.boundaries[0]}addRel(e,t){let n=t[0],r=t[1];if(n===void 0||r===void 0||t[2]===void 0)return;let i=typeof n==`string`&&typeof r==`string`,a=i?this.relIndex.get(n)?.get(r):void 0;if(a===void 0){if(a={type:e,from:``,to:``,label:``},this.rels.push(a),i){let e=this.relIndex.get(n);e===void 0&&this.relIndex.set(n,e=new Map),e.set(r,a)}typeof n==`string`?a.from=n:a.fromAttr=n,typeof r==`string`?a.to=r:a.toAttr=r}a.type=e,E(a,t[2]),T(a,`techn`,t[3]),T(a,`descr`,t[4]),w(a,`sprite`,t[5]),w(a,`tags`,t[6]),w(a,`link`,t[7])}getC4Shape(e){return this.shapeIndex.get(e)??this.boundaryIndex.get(e)}updateElStyle(e,t){let n=typeof t[0]==`string`?this.getC4Shape(t[0]):void 0;n!==void 0&&(w(n,`bgColor`,t[1]),w(n,`fontColor`,t[2]),w(n,`borderColor`,t[3]),w(n,`shadowing`,t[4]),w(n,`shape`,t[5]),w(n,`sprite`,t[6]),w(n,`techn`,t[7]),w(n,`legendText`,t[8]),w(n,`legendSprite`,t[9]))}updateRelStyle(e,t){let n=t[0],r=t[1],i=typeof n==`string`&&typeof r==`string`?this.relIndex.get(n)?.get(r):void 0;if(i===void 0)return;w(i,`textColor`,t[2]),w(i,`lineColor`,t[3]);let a=t[4],o=t[5];typeof a==`string`?i.offsetX=parseInt(a):a!==void 0&&C(i,a),typeof o==`string`?i.offsetY=parseInt(o):o!==void 0&&C(i,o)}updateLayoutConfig(e,t){let n=e=>e===void 0?NaN:parseInt(typeof e==`string`?e:e.value),r=n(t[0]),i=n(t[1]);r>=1&&(this.shapeInRow=r),i>=1&&(this.boundaryInRow=i)}},O=`$end.INVALID.direction_tb.direction_bt.direction_rl.direction_lr.title.accDescription.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.NEWLINE.C4_CONTEXT.C4_CONTAINER.C4_COMPONENT.C4_DYNAMIC.C4_DEPLOYMENT.PERSON.PERSON_EXT.SYSTEM.SYSTEM_DB.SYSTEM_QUEUE.SYSTEM_EXT.SYSTEM_EXT_DB.SYSTEM_EXT_QUEUE.CONTAINER.CONTAINER_DB.CONTAINER_QUEUE.CONTAINER_EXT.CONTAINER_EXT_DB.CONTAINER_EXT_QUEUE.COMPONENT.COMPONENT_DB.COMPONENT_QUEUE.COMPONENT_EXT.COMPONENT_EXT_DB.COMPONENT_EXT_QUEUE.ENTERPRISE_BOUNDARY.SYSTEM_BOUNDARY.BOUNDARY.CONTAINER_BOUNDARY.NODE.NODE_L.NODE_R.REL.BIREL.REL_U.REL_D.REL_L.REL_R.REL_B.REL_INDEX.UPDATE_EL_STYLE.UPDATE_REL_STYLE.UPDATE_LAYOUT_CONFIG.EOF_IN_STRUCT.ATTRIBUTE_EMPTY.STR.STR_KEY.STR_VALUE.LBRACE.RBRACE.EOF`.split(`.`),k=new Map([[`C4Context`,14],[`C4Container`,15],[`C4Component`,16],[`C4Dynamic`,17],[`C4Deployment`,18],[`Person`,19],[`Person_Ext`,20],[`System`,21],[`SystemDb`,22],[`SystemQueue`,23],[`System_Ext`,24],[`SystemDb_Ext`,25],[`SystemQueue_Ext`,26],[`Container`,27],[`ContainerDb`,28],[`ContainerQueue`,29],[`Container_Ext`,30],[`ContainerDb_Ext`,31],[`ContainerQueue_Ext`,32],[`Component`,33],[`ComponentDb`,34],[`ComponentQueue`,35],[`Component_Ext`,36],[`ComponentDb_Ext`,37],[`ComponentQueue_Ext`,38],[`Enterprise_Boundary`,39],[`System_Boundary`,40],[`Boundary`,41],[`Container_Boundary`,42],[`Deployment_Node`,43],[`Node`,43],[`Node_L`,44],[`Node_R`,45],[`Rel`,46],[`BiRel`,47],[`Rel_Up`,48],[`Rel_U`,48],[`Rel_Down`,49],[`Rel_D`,49],[`Rel_Left`,50],[`Rel_L`,50],[`Rel_Right`,51],[`Rel_R`,51],[`Rel_Back`,52],[`RelIndex`,53],[`UpdateElementStyle`,54],[`UpdateRelStyle`,55],[`UpdateLayoutConfig`,56]]),A=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],j=/[\n\r\u2028\u2029]/g,M=/title[^\S\r\n]*(?=[\r\n]|$)\s*/y;function N(e){let t=e.length,n=[],r=[],i=[],a=0,o=9,s=0,c=!1,l=-2,u=-1,d=0,f=(e,t,a)=>{n.push(e),r.push(t),i.push(a),s=a},p=n=>{for(;n<t&&v(e.charCodeAt(n));)n++;return n},m=(n,r)=>{let i=e.indexOf(n,r);return i===-1?t:i},h=(n,r)=>{let i=s+n.length;if(!e.startsWith(n,s)||!v(e.charCodeAt(i)))return!1;let a=++i;for(;i<t;){let t=e.charCodeAt(i);if(t===35||t===10||t===59)break;i++}return i!==a&&(f(r,s,i),!0)};for(;;){if(c){f(0,t,t);break}s>=t&&(c=!0);let n=e.charCodeAt(s);if(a===0){if(s>=t){f(64,t,t);continue}if(l!==-1&&s>=d&&(l<s&&(l=e.indexOf(`direction`,s)),l!==-1&&(u<s&&(j.lastIndex=s,u=j.test(e)?j.lastIndex-1:t),l<u))){let t=!1;for(let n=0;n<4&&!t;n++)A[n].lastIndex=s,A[n].test(e)&&(f(2+n,s,A[n].lastIndex),t=!0);if(t)continue;d=u}if(n===116){if(M.lastIndex=s,M.test(e)){s=M.lastIndex;continue}if(h(`title`,6))continue}if(n===97){if(h(`accDescription`,7))continue;let t=e.startsWith(`accTitle`,s);if(t||e.startsWith(`accDescr`,s)){let n=p(s+8),r=e.charCodeAt(n);if(r===58){f(t?8:10,s,p(n+1)),o=t?9:11,a=7;continue}if(r===123&&!t){s=p(n+1),a=8;continue}}}if(n===37&&e.charCodeAt(s+1)===37){let n=m(`
3
3
  `,s+2);for(;n<t&&(e.charCodeAt(n)===10||e.charCodeAt(n)===13);)n++;s=n;continue}if(v(n)){let n=s,r=-1;for(;n<t;){let t=e.charCodeAt(n);if(!v(t))break;t===10&&(r=n),n++}r===-1?s=n:f(13,s,r+1);continue}if(n===123){f(62,s,s+1);continue}if(n===125){f(63,s,s+1);continue}if(_(n)){let n=s+1;for(;n<t&&_(e.charCodeAt(n));)n++;let r=n-s<=19?k.get(e.slice(s,n)):void 0;if(r!==void 0){r>18&&(a=1),f(r,s,n);continue}}f(1,s,s);break}if(a===1){if(s>=t)f(57,t,t);else if(n===40){let t=s+1;for(;e.charCodeAt(t)===32;)t++;e.charCodeAt(t)===44?f(58,s,t+1):s++,a=2}else if(n===41)s++,a=0;else{f(1,s,s);break}}else if(a===2){if(s>=t)continue;if(n===41)s++,a=0;else if(n===44)e.charCodeAt(s+1)===44?f(58,s,s+2):s++;else{let t=s;for(;e.charCodeAt(t)===32;)t++;let n=e.charCodeAt(t);n===34?e.charCodeAt(t+1)===34?f(58,s,t+2):(s=t+1,a=3):n===36?(s=t+1,a=4):f(59,s,m(`,`,s))}}else if(a===3)n===34?(s++,a=2):f(59,s,m(`"`,s));else if(a===4)f(60,s,m(`=`,s)),a=5;else if(a===5){if(s>=t)continue;let r=s+1;if(n===61)for(;e.charCodeAt(r)===32;)r++;if(n!==61||e.charCodeAt(r)!==34){f(1,s,s);break}s=r+1,a=6}else if(a===6){if(s>=t)continue;n===34?(s++,a=2):f(61,s,m(`"`,s))}else a===7?(f(o,s,m(`
4
4
  `,s)),a=0):n===125?(s++,a=0):f(12,s,m(`}`,s))}return{types:n,starts:r,ends:i}}var P=[`person`,`external_person`,`system`,`system_db`,`system_queue`,`external_system`,`external_system_db`,`external_system_queue`,`container`,`container_db`,`container_queue`,`external_container`,`external_container_db`,`external_container_queue`,`component`,`component_db`,`component_queue`,`external_component`,`external_component_db`,`external_component_queue`],F=[`rel`,`birel`,`rel_u`,`rel_d`,`rel_l`,`rel_r`,`rel_b`,`rel`],I=[`node`,`nodeL`,`nodeR`],ee=`'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'C4_CONTEXT', 'C4_CONTAINER', 'C4_COMPONENT', 'C4_DYNAMIC', 'C4_DEPLOYMENT'`,te=`'STR', 'STR_KEY', 'ATTRIBUTE', 'ATTRIBUTE_EMPTY'`;function L(e){return e===6||e===7||e===8||e===10||e===12}function ne(e){return e>=19&&e<=56}function R(e,t){let{types:n,starts:r,ends:i}=N(e),a=0,o=t=>e.slice(r[t],i[t]),s=t=>{let i=n[a];throw i===1?y(`c4`,e,r[a],``,!0):y(`c4`,e,r[a],`Expecting ${t}, got '${O[i]}'`)},c=e=>{n[a]!==e&&s(`'${O[e]}'`),a++},l=()=>{let e=[];for(;;){let t=n[a];if(t===59)e.push(o(a++).trim());else if(t===58)e.push(``),a++;else if(t===60)a++,n[a]!==61&&s(`'STR_VALUE'`),e.push({key:o(a-1).trim(),value:o(a).trim()}),a++;else break}return e.length===0&&s(te),e},u=e=>{e===6?t.setTitle(o(a++).substring(6)):e===7?t.setAccDescription(o(a++).substring(15)):e===12?t.setAccDescription(o(a++).trim()):(a++,e===8?(n[a]!==9&&s(`'acc_title_value'`),t.setTitle(o(a++).trim())):(n[a]!==11&&s(`'acc_descr_value'`),t.setAccDescription(o(a++).trim())))},d=e=>{a++;let r=l();if(e<=26)t.addPersonOrSystem(P[e-19],r);else if(e<=32)t.addContainer(P[e-19],r);else if(e<=38)t.addComponent(P[e-19],r);else{if(e<=45)return e===39?r.splice(2,0,`ENTERPRISE`):e===40?r.splice(2,0,`SYSTEM`):e===42&&r.splice(2,0,`CONTAINER`),e>=43?t.addDeploymentNode(I[e-43],r):e===42?t.addContainerBoundary(r):t.addPersonOrSystemBoundary(r),n[a]===62?(a++,c(13)):n[a]===13?(a++,c(62),n[a]===13&&a++):s(`'NEWLINE', 'LBRACE'`),!0;e<=53?(e===53&&r.splice(0,1),t.addRel(F[e-46],r)):e===54?t.updateElStyle(`update_el_style`,r):e===55?t.updateRelStyle(`update_rel_style`,r):t.updateLayoutConfig(`update_layout_config`,r)}return!1},f=n[a];(f<14||f>18)&&s(ee),a++,c(13);let p=0,m=0;for(;;){let e=n[a];if(m===3||m===4){if(e===13){a++,m=2;continue}if(m===3&&ne(e)){m=1;continue}}else if(ne(e)){d(e)?(p++,m=1):m=4;continue}else if(L(e)&&m!==1){u(e),m=3;continue}else m!==2&&s(`'title', 'accDescription', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'PERSON', 'REL'`);if(p>0)e!==63&&s(`'NEWLINE', 'RBRACE'`),a++,t.popBoundaryParseStack(),p--,m=4;else{e!==64&&s(`'NEWLINE', 'EOF'`),a++,c(0),t.setC4Type(o(0));return}}}var z=28,B=20,V=7,H=8,U=30,W=88,G=160,re=8,ie=26,ae=e=>Math.min(12,Math.max(6,e/14)),oe=e=>Math.min(12,e/4);function K(e,t,n,r,i,a,o,s){let c=0,l=1;if(o===0){if(i<e||i>n)return 1/0}else{let t=(e-i)/o,r=(n-i)/o;c=Math.max(c,Math.min(t,r)),l=Math.min(l,Math.max(t,r))}if(s===0){if(a<t||a>r)return 1/0}else{let e=(t-a)/s,n=(r-a)/s;c=Math.max(c,Math.min(e,n)),l=Math.min(l,Math.max(e,n))}return c<=l?c:1/0}function q(e,t,n,r,i,a,o,s){let c=o/n,l=s/r,u=(i-e)/n,d=(a-t)/r,f=c*c+l*l,p=2*(c*u+l*d),m=u*u+d*d-1,h=p*p-4*f*m;if(f===0||h<0)return 1/0;let g=(-p-Math.sqrt(h))/(2*f);return g>=0&&g<=1?g:m<=0?0:1/0}function J(e,t,n,r,i){let{x:a,y:o,w:s,h:c}=e,l=r-t,u=i-n;if(e.form===`person`)return Math.min(K(a,o+ie,a+s,o+c,t,n,l,u),q(a+s/2,o+14,13,13,t,n,l,u));if(e.form===`cyl`){let e=ae(s);return Math.min(K(a,o+e,a+s,o+c-e,t,n,l,u),q(a+s/2,o+e,s/2,e,t,n,l,u),q(a+s/2,o+c-e,s/2,e,t,n,l,u))}if(e.form===`h-cyl`){let e=oe(c);return Math.min(K(a+e,o,a+s-e,o+c,t,n,l,u),q(a+e,o+c/2,e,c/2,t,n,l,u),q(a+s-e,o+c/2,e,c/2,t,n,l,u))}return K(a,o,a+s,o+c,t,n,l,u)}function se(e,t,n,r,i){for(let a=2;a<e.length;a+=2){let o=e[a-2],s=e[a-1];if(K(t,n,r,i,o,s,e[a]-o,e[a+1]-s)<=1)return!0}return!1}function Y(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.w>=t.x+t.w&&e.y+e.h>=t.y+t.h}function ce(e,t,n){let r=e.x+e.w/2,i=e.y+e.h/2,a=t.x+t.w/2,o=t.y+t.h/2,s=Y(e,t);if(s||Y(t,e)){let n=s?e:t,r=s?t:e,i=r.x+r.w/2,a=r.y+r.h/2,o=r.x-n.x,c=n.x+n.w-r.x-r.w,l=r.y-n.y,u=n.y+n.h-r.y-r.h,d=Math.min(o,c,l,u),f=d===o?n.x:d===c?n.x+n.w:i,p=d===o||d===c?a:d===u?n.y+n.h:n.y,m=Math.min(J(r,f,p,i,a),1),h=f+(i-f)*m,g=p+(a-p)*m;return s?[f,p,h,g]:[h,g,f,p]}let c=r,l=i,u=a,d=o,f=Math.max(e.x,t.x),p=Math.min(e.x+e.w,t.x+t.w),m=Math.max(e.y,t.y),h=Math.min(e.y+e.h,t.y+t.h);f<p?c=u=(f+p)/2:m<h&&(l=d=(m+h)/2);let g=Math.hypot(u-c,d-l)||1,_=-(d-l)/g*n,v=(u-c)/g*n,y=J(e,u+_,d+v,c+_,l+v),b=J(t,c+_,l+v,u+_,d+v);return y<=1&&b<=1?(c+=_,l+=v,u+=_,d+=v):(c=r,l=i,u=a,d=o,y=Math.min(J(e,u,d,c,l),1),b=Math.min(J(t,c,l,u,d),1)),[u+(c-u)*y,d+(l-d)*y,c+(u-c)*b,l+(d-l)*b]}var le=6,ue=3,de=12,fe=class{upright=[];level=[];frames=[[],[]];taken=new Map;squeezed=0;free(e,t,n,r){let i=Math.min(n,r),a=Math.max(n,r),o=(e,n)=>{for(let r=0;r<e.length;r+=3)if(Math.abs(e[r]-t)<n&&e[r+1]<a&&e[r+2]>i)return!0;return!1};return!o(e?this.upright:this.level,le)&&!o(this.frames[+!e],ue)}crossings(e){let t=0;for(let n=2;n<e.length;n+=2){let r=e[n]===e[n-2],i=r?e[n]:e[n+1],a=Math.min(r?e[n-1]:e[n-2],r?e[n+1]:e[n]),o=Math.max(r?e[n-1]:e[n-2],r?e[n+1]:e[n]),s=r?this.level:this.upright;for(let e=0;e<s.length;e+=3)s[e]>a&&s[e]<o&&s[e+1]<i&&s[e+2]>i&&t++}return t}frame(e){this.frames[0].push(e.x,e.y,e.y+e.h,e.x+e.w,e.y,e.y+e.h),this.frames[1].push(e.y,e.x,e.x+e.w,e.y+e.h,e.x,e.x+e.w)}take(e){for(let t=2;t<e.length;t+=2)e[t]===e[t-2]?this.upright.push(e[t],Math.min(e[t-1],e[t+1]),Math.max(e[t-1],e[t+1])):e[t+1]===e[t-1]&&this.level.push(e[t+1],Math.min(e[t-2],e[t]),Math.max(e[t-2],e[t]))}ports(e,t,n,r,i){let a=this.taken.get(e)??[],o=[];for(let e=0;e<9&&o.length<4;e++){let s=n+(e&1?1:-1)*Math.ceil(e/2)*de;if(s<r||s>i)continue;let c=!0;for(let e=0;e<a.length;e+=2)a[e]===t&&Math.abs(a[e+1]-s)<de&&(c=!1);c&&o.push(s)}return o.length?o:[n]}claim(e,t,n){let r=this.taken.get(e);r?r.push(t,n):this.taken.set(e,[t,n])}};function pe(e,t,n){let r=e.length,i=Math.sign(e[2]-e[0]),a=Math.sign(e[3]-e[1]),o=`M${s(e[0]+i*t)},${s(e[1]+a*t)}`;for(let t=2;t<r-2;t+=2){let n=e[t],r=e[t+1],i=Math.sign(n-e[t-2]),a=Math.sign(r-e[t-1]),c=Math.sign(e[t+2]-n),l=Math.sign(e[t+3]-r),u=Math.min(H,Math.abs(n-e[t-2]+r-e[t-1])/2,Math.abs(e[t+2]-n+e[t+3]-r)/2);o+=`${i?`H`+s(n-i*u):`V`+s(r-a*u)}Q${s(n)},${s(r)} ${s(n+c*u)},${s(r+l*u)}`}let c=Math.sign(e[r-2]-e[r-4]),l=Math.sign(e[r-1]-e[r-3]);return o+(c?`H`+s(e[r-2]-c*n):`V`+s(e[r-1]-l*n))}function me(e,t,n,r){for(let i of t)if(i!==n&&i!==r&&se(e,i.x,i.y,i.x+i.w,i.y+i.h))return!1;return!0}function he(e,t,n,r,i){let a=e.length;return{d:pe(e,n,r),sx:e[0],sy:e[1],sdx:-Math.sign(e[2]-e[0]),sdy:-Math.sign(e[3]-e[1]),ex:e[a-2],ey:e[a-1],edx:Math.sign(e[a-2]-e[a-4]),edy:Math.sign(e[a-1]-e[a-3]),x0:e[t],y0:e[t+1],x1:e[t+2],y1:e[t+3],nx:0,ny:0,lean:0,room:G,...i,points:e}}function ge(e,t){let n=[],r=(e+t)/2,i=Math.max(V,(t-e)/4);for(let a=0;a<9;a++){let o=r+(a&1?1:-1)*Math.ceil(a/2)*i;o>=e+le&&o<=t-le&&n.push(o)}return n}function _e(e,t,n,r,i,a){let o=e.x+e.w/2,s=e.y+e.h/2,c=t.x+t.w/2,l=t.y+t.h/2,u,d=(i,a,o)=>{if(!me(i,n,e,t))return;for(let e=2;e<i.length;e+=2){let t=i[e]===i[e-2];if(!r.free(t,t?i[e]:i[e+1],t?i[e-1]:i[e-2],t?i[e+1]:i[e]))return}let s=r.crossings(i)*1e6;for(let e=2;e<i.length;e+=2)s+=Math.abs(i[e]-i[e-2])+Math.abs(i[e+1]-i[e-1]);(!u||s<u.cost)&&(u={points:i,cost:s,upright:a,sides:o})};if(e.x+e.w<=t.x||t.x+t.w<=e.x){let n=c>o,i=Math.sign(l-s),a=n?[1,0]:[0,1],f=ge(n?e.x+e.w:t.x+t.w,n?t.x:e.x);e:for(let n of r.ports(e,a[0],s+i*e.h/4,e.y+8,e.y+e.h-8))for(let s of r.ports(t,a[1],l-i*t.h/4,t.y+8,t.y+t.h-8))for(let r of f){let i=r+(o-r)*Math.min(J(e,r,n,o,n),1),l=r+(c-r)*Math.min(J(t,r,s,c,s),1),f=u;if(d([i,n,r,n,r,s,l,s],!0,a),u!==f)break e}}if(e.y+e.h<=t.y||t.y+t.h<=e.y){let n=l>s,i=Math.sign(c-o),a=n?[3,2]:[2,3],f=ge(n?e.y+e.h:t.y+t.h,n?t.y:e.y);e:for(let n of r.ports(e,a[0],o+i*e.w/4,e.x+8,e.x+e.w-8))for(let o of r.ports(t,a[1],c-i*t.w/4,t.x+8,t.x+t.w-8))for(let r of f){let i=r+(s-r)*Math.min(J(e,n,r,n,s),1),c=r+(l-r)*Math.min(J(t,o,r,o,l),1),f=u;if(d([n,i,n,r,o,r,o,c],!1,a),u!==f)break e}}if(!u)return;let{points:f,upright:p,sides:m}=u;return r.take(f),r.claim(e,m[0],p?f[1]:f[0]),r.claim(t,m[1],p?f[7]:f[6]),he(f,2,i,a,{room:p?W:G})}function ve(e,t,n,r,i,a,o){if(e===t){let t=Math.min(e.h/2-4,10),n=Math.hypot(z,t),r=e.x+e.w,i=e.y+e.h/2,c=z/n,l=t/n;return{d:`M${s(r+c*a)},${s(i-t-l*a)}C${s(r+z)},${s(i-t*2)} ${s(r+z)},${s(i+t*2)} ${s(r+c*o)},${s(i+t+l*o)}`,sx:r,sy:i-t,sdx:-c,sdy:l,ex:r,ey:i+t,edx:-c,edy:-l,x0:r+z+4,y0:i,x1:r+z+4,y1:i,nx:1,ny:0,lean:0,room:64,points:[]}}let[c,l,u,d]=ce(e,t,n),f=c===u,p=!1;if(r&&!Y(e,t)&&!Y(t,e))for(let n of r)n!==e&&n!==t&&K(n.x,n.y,n.x+n.w,n.y+n.h,c,l,u-c,d-l)<=1&&(p=!0);if(r&&p&&!f&&l!==d){let n=_e(e,t,r,i,a,o);if(n)return n;i.squeezed++}if(r&&p&&(f||l===d)){let n=n=>{let i=n?-1/0:1/0,a=e=>{let t=f?e.x:e.y;i=n?Math.max(i,t+(f?e.w:e.h)):Math.min(i,t)};a(e),a(t);for(let n of r)n!==e&&n!==t&&K(n.x,n.y,n.x+n.w,n.y+n.h,c,l,u-c,d-l)<=1&&a(n);return i},s=f?Math.min(e.y,t.y):Math.min(e.x,t.x),p=f?Math.max(e.y+e.h,t.y+t.h):Math.max(e.x+e.w,t.x+t.w),m=(n,i)=>{for(let a of r){if(a===e||a===t)continue;let r=f?a.y<p&&a.y+a.h>s:a.x<p&&a.x+a.w>s,o=f?a.x:a.y,c=o+(f?a.w:a.h);if(r&&(n?c>i:o<i))return!1}return!0},h=e.x+e.w/2,g=e.y+e.h/2,_=t.x+t.w/2,v=t.y+t.h/2,y=Math.sign(f?v-g:_-h),b=a=>{let o=n(a),s=a?1:-1,c=f?+!!a:a?3:2,l=f?i.ports(e,c,g+y*e.h/4,e.y+8,e.y+e.h-8)[0]:i.ports(e,c,h+y*e.w/4,e.x+8,e.x+e.w-8)[0],u=f?i.ports(t,c,v-y*t.h/4,t.y+8,t.y+t.h-8)[0]:i.ports(t,c,_-y*t.w/4,t.x+8,t.x+t.w-8)[0],d=n=>{if(f){let r=n+(h-n)*Math.min(J(e,n,l,h,l),1),i=n+(_-n)*Math.min(J(t,n,u,_,u),1);return[r,l,n,l,n,u,i,u]}let r=n+(g-n)*Math.min(J(e,l,n,l,g),1),i=n+(v-n)*Math.min(J(t,u,n,u,v),1);return[l,r,l,n,u,n,u,i]},p=d(o+s*B);for(let n=0;n<=4;n++){let a=o+s*(B+n*V),m=d(a);if(me(m,r,e,t)&&(p=m,i.free(f,a,l,u)))return{points:p,side:c,p0:l,p1:u,step:n}}return{points:p,side:c,p0:l,p1:u,step:5}},x=f?d>l:u<c,S=m(x,n(x)),C=m(!x,n(!x)),w=b(x),T=S===C?b(!x):void 0,E=e=>i.crossings(e.points)*8+e.step,D=C&&!S||T&&E(T)<E(w)?!x:x,{points:O,side:k,p0:A,p1:j,step:M}=D===x?w:T??b(!x),N=D?1:-1;return M>4&&i.squeezed++,i.take(O),i.claim(e,k,A),i.claim(t,k,j),he(O,2,a,o,f?{nx:N,lean:U,room:W}:{room:G})}let m=Math.hypot(u-c,d-l)||1,h=(u-c)/m,g=(d-l)/m;return(f||l===d)&&i.take([c,l,u,d]),{d:`M${s(c+h*a)},${s(l+g*a)}L${s(u-h*o)},${s(d-g*o)}`,sx:c,sy:l,sdx:-h,sdy:-g,ex:u,ey:d,edx:h,edy:g,x0:c,y0:l,x1:u,y1:d,nx:n?-g:0,ny:n?h:0,lean:0,room:Math.abs(h)>Math.abs(g)?W:G,points:[c,l,u,d]}}var ye=216,be=64,xe=14,Se=12,Ce=W+re+24,we=88,Te=B+8,X=48,Z=16,Ee=10,De=new Map([[`person`,`person`],[`box`,`rect`],[`rounded`,`rect`],[`component`,`rect`],[`cylinder`,`cyl`],[`database`,`cyl`],[`db`,`cyl`],[`queue`,`h-cyl`],[`pipe`,`h-cyl`]]);function Oe(e){let t=De.get((e.shape??``).toLowerCase())??De.get((e.sprite??``).toLowerCase());if(t)return t;if(e.tags)for(let t of e.tags.split(`,`)){let e=De.get(t.trim().toLowerCase());if(e)return e}let n=e.kind;return n.endsWith(`person`)?`person`:n.endsWith(`_db`)?`cyl`:n.endsWith(`_queue`)?`h-cyl`:`rect`}function ke(e,t,n,r,i=ye){let a=Oe(e),s=a===`h-cyl`?36:0,c=a===`person`?ie:a===`cyl`?24:0,l=i-2*xe-s,u=[o(`«`+e.kind.replace(/_/g,` `)+`»`,!1,t,r-1,l),o(e.label,!1,t,n,l,1),o(e.techn?`[${e.techn}]`:void 0,!1,t,r,l),o(e.descr,!1,t,r,l)],d=0,f=u[3].height>0?4:0;for(let e of u)d=Math.max(d,e.width),f+=e.height;return{shape:e,form:a,labels:u,textH:f,x:0,y:0,w:Math.max(i,d+2*xe+s),h:Math.max(be,f+2*Se+c)}}function Ae(e,t,n,r,i){let a=0,o=0;for(let s=0;s<e.length;s+=t){let c=Math.min(e.length,s+t),l=0,u=0;for(let t=s;t<c;t++)u=Math.max(u,e[t].h);for(let t=s;t<c;t++){let r=e[t];r.x=l,r.y=o,i&&(r.h=u),l+=r.w+n}a=Math.max(a,l-n),o+=u+r}return[a,e.length>0?o-r:0]}function je(e,t,n,r,i,a){let s=i===void 0?Te:12,c=new Map;for(let a of e.boundaries){let e=i===void 0?4e3:Math.max(80,i-2*Z-2*Te*2),l=a.parent?[o(a.label,!1,t,n,e,1),o(a.type?`[${a.type}]`:void 0,!1,t,r,e),o(a.descr,!1,t,r,e)]:[],u=0,d=0;for(let e of l)u+=e.height,d=Math.max(d,e.width);c.set(a,{boundary:a,kids:[],nodes:[],labels:l,head:u>0?u+Ee+6+B:s,headW:d,headX:Z,x:0,y:0,w:0,h:0,form:`rect`})}let l=c.get(e.boundaries[0]);for(let e of c.values()){let t=e.boundary.parent;t&&c.get(t)?.kids.push(e)}let u=[l],d=new Map([[l.boundary,0]]);for(let e=0;e<u.length;e++)for(let t of u[e].kids)d.set(t.boundary,d.get(u[e].boundary)+1),u.push(t);for(let a of e.shapes)if(a.parent){let e=d.get(a.parent)??0,o=i===void 0?ye:Math.max(100,Math.min(ye,i-2*e*s-32));c.get(a.parent)?.nodes.push(ke(a,t,n,r,o))}let f=Math.max(1,e.shapeInRow),p=Math.max(1,e.boundaryInRow),m=new Map;for(let e=u.length-1;e>=0;e--){let t=u[e],n=i===void 0?Ce:a,r=(e,t,n)=>{if(i===void 0)return t;let r=1;for(let t of e)r=Math.max(r,t.w);return Math.max(1,Math.min(t,Math.floor((i+n-2*s)/(r+n))))},[o,c]=Ae(t.nodes,r(t.nodes,f,n),n,we,!0),[d,h]=Ae(t.kids,r(t.kids,p,X),X,X,!1),g=c>0&&h>0?X:0,_=t===l?0:s;m.set(t,c+g),t.w=Math.max(o,d,t.headW+2*Z-2*_)+2*_,t.h=(_&&t.head)+c+g+h+_}let h=new Map;for(let e of u){let t=e.x+(e===l?0:s),n=e.y+(e===l?0:e.head);for(let r of e.nodes)r.x+=t,r.y+=n,h.set(r.shape,r);for(let r of e.kids)r.x+=t,r.y+=n+m.get(e);e!==l&&h.set(e.boundary,e)}return{order:u,boxes:h}}var Me=7,Q=36,Ne=24,Pe=2e3,$=8,Fe=[.5,.4,.6,.3,.7,.2,.8],Ie=2e6;function Le(e,t,n){let r=[];return e&&r.push(`fill:`+e),t&&r.push(`stroke:`+t),n&&r.push(`color:`+n),a(r)}function Re(e,t,n,r,i){return t?m(e,p(t.includes(`¶ß`)?t.replace(/\ufb02\u00b0\u00b0?/g,`#`).replace(/\u00b6\u00df/g,`;`):t),n,r,i):e}function ze(e,t,n){return c(n,r=>{if(!r)return Be(e,t,n,!1)[0];let[i,a]=Be(e,t,n,!0,Q);for(let r=Q+Ne;a>0&&r<=Q+3*Ne;r+=Ne){let[o,s]=Be(e,t,n,!0,r);s<a&&([i,a]=[o,s])}return i})}function Be(a,c,p,m,_=Q){let v=p.fontSize??16,y=Math.round(v*.8125),x=p.measurer??b(p.fontFamily,p.fontFamilyMono),S=p.padding??8,C=[],{order:w,boxes:T}=je(a,x,v,y,m?Math.max(80,(p.maxWidth??320)-2*S):void 0,_),E=w[0],D=0,O=0,k=E.w,A=E.h,j=(e,t,n,r)=>{D=Math.min(D,e),O=Math.min(O,t),k=Math.max(k,n),A=Math.max(A,r)},M=[],N=new Map;for(let e of a.rels){let t=e.fromAttr?void 0:a.getC4Shape(e.from),n=e.toAttr?void 0:a.getC4Shape(e.to),r=t&&T.get(t),i=n&&T.get(n);if(!r||!i)throw new g(`C4 rel "${e.from}" -> "${e.to}" references an unknown shape or boundary`,`semantic`,{type:`c4`});M.push(r,i);let o=N.get(r);o||N.set(r,o=new Set),o.add(i)}let P=[],F=[];for(let e of w)for(let t of e.nodes)P.push(t),F.push(t.x+$,t.y+$,t.x+t.w-$,t.y+t.h-$);let I=a.rels.length*(P.length+w.length+3*a.rels.length)<=Ie,ee=(e,t,n,r)=>{let i=0;for(let a=0;a<F.length;a+=4){let o=Math.min(n,F[a+2])-Math.max(e,F[a]);if(o<=0)continue;let s=Math.min(r,F[a+3])-Math.max(t,F[a+1]);s>0&&(i+=o*s)}return i},te=e=>e?Math.max(-Pe,Math.min(Pe,e)):0,L=``,ne=u(`arrow_point`),R=new fe;for(let e of w)e!==E&&R.frame(e);let z=a.rels.map((e,n)=>{let i=M[n*2],a=M[n*2+1],o=Le(void 0,e.lineColor,void 0),s=o.stroke?t(o.stroke):`var(--_l)`,c=e.type===`birel`||e.type===`rel_b`,l=e.type!==`rel_b`,u=ve(i,a,i!==a&&N.get(a)?.has(i)===!0?Me:0,I?P:void 0,R,c?ne:0,l?ne:0);return j(Math.min(u.x0,u.x1),Math.min(u.y0,u.y1),Math.max(u.x0,u.x1),Math.max(u.y0,u.y1)),c&&I&&F.push(u.sx-8,u.sy-8,u.sx+8,u.sy+8),l&&I&&F.push(u.ex-8,u.ey-8,u.ex+8,u.ey+8),L+=`<g class="pele-edge" data-id="${r(e.from+`-`+e.to)}"${o.line}><path d="${u.d}"/>`+(c?d(`arrow_point`,u.sx,u.sy,u.sdx,u.sdy,s):``)+(l?d(`arrow_point`,u.ex,u.ey,u.edx,u.edy,s):``)+`</g>`,u});for(let e of w){if(!I||e.headW===0)continue;let t=e.y+Ee,n=e.y+e.head-B,r=1/0;for(let i of[Z,(e.w-e.headW)/2,e.w-Z-e.headW]){let a=0;for(let r of z)se(r.points,e.x+i-4,t,e.x+i+e.headW+4,n)&&a++;if(a<r&&(r=a,e.headX=i),a===0)break}F.push(e.x+e.headX-4,t,e.x+e.headX+e.headW+4,n)}let V=``;a.rels.forEach((e,t)=>{let n=z[t],c=e.from+`-`+e.to,l=Le(void 0,void 0,e.textColor),u=(a.c4Type===`C4Dynamic`?t+1+`: `:``)+e.label,d=o(u,!1,x,y,n.room),f=o(e.techn?`[${e.techn}]`:void 0,!1,x,y,n.room,2),h=Math.max(d.width,f.width)+re,g=d.height+f.height;if(g===0)return;let _=Math.abs(n.nx)*(h/2)+Math.abs(n.ny)*(g/2)+2,v=n.lean?Math.max(0,Math.min(n.lean,_-14)):_,b=n.nx*v+(m?0:te(e.offsetX)),S=n.ny*v+(m?0:te(e.offsetY)),w=.5;if(I){let e=1/0,t=b!==n.nx*v||S!==n.ny*v;for(let r=0;r<(t?2:1)&&e>0;r++){let t=r?n.nx*v:b,i=r?n.ny*v:S;for(let r of Fe){let a=n.x0+(n.x1-n.x0)*r+t,o=n.y0+(n.y1-n.y0)*r+i,s=ee(a-h/2,o-g/2,a+h/2,o+g/2);if(s<e&&(e=s,w=r,b=t,S=i),s===0)break}}}let T=n.x0+(n.x1-n.x0)*w+b,E=n.y0+(n.y1-n.y0)*w+S-g/2;I&&F.push(T-h/2,E,T+h/2,E+g),j(T-h/2,E,T+h/2,E+g),V+=`<g class="pele-edge-label" data-id="${r(c)}">`+(e.descr?`<title>${r(e.descr)}</title>`:``)+`<rect x="${s(T-h/2)}" y="${s(E)}" width="${s(h)}" height="${s(g)}" rx="3" fill="var(--_bg)"/>`+Re(i(d,T,E+d.height/2,l.text)+i(f,T,E+d.height+f.height/2,` class="pele-c4-techn" fill="var(--_m)"${l.text}`),e.link,c,C,p)+`</g>`});let H=``,U=``;for(let e of w){if(e!==E){let t=e.boundary,i=Le(t.bgColor,t.borderColor,t.fontColor),a=e.x+e.headX,o=e.y+Ee,c=h(e.labels[0],a,o,` class="pele-cluster-label" font-weight="var(--_hw)"${i.text}`);o+=e.labels[0].height,c+=h(e.labels[1],a,o,` class="pele-c4-type" font-size="${y}" fill="var(--_m)"${i.text}`),o+=e.labels[1].height,c+=h(e.labels[2],a,o,` class="pele-c4-descr" font-size="${y}" fill="var(--_m)"${i.text}`),H+=`<g class="pele-cluster pele-c4-${t.nodeType?`node`:`boundary`}" data-id="${r(t.alias)}"><rect x="${s(e.x)}" y="${s(e.y)}" width="${s(e.w)}" height="${s(e.h)}" fill="none" stroke="var(--_b)"${t.nodeType?``:` stroke-dasharray="6 4"`}${n(i.shape)}/>`+Re(c,t.link,t.alias,C,p)+`</g>`}for(let t of e.nodes){let e=t.shape,n=e.kind.startsWith(`external`),a=Le(e.bgColor,e.borderColor,e.fontColor),o=` stroke="var(--_b)"`+(n?` stroke-dasharray="4 3"`:``),{w:c,h:l,form:u,labels:d}=t,m=u===`h-cyl`?-oe(l)/2:0,h=u===`person`?ie/2:u===`cyl`?ae(c)/2:0,g=` fill="var(--_m)"${a.text}`,_=h-t.textH/2,v=i(d[0],m,_+d[0].height/2,` class="pele-c4-type" font-size="${y-1}"${g}`);_+=d[0].height,v+=i(d[1],m,_+d[1].height/2,` class="pele-label" font-weight="var(--_hw)"${a.text}`),_+=d[1].height,v+=i(d[2],m,_+d[2].height/2,` class="pele-c4-techn" font-size="${y}"${g}`),_+=d[2].height+4,v+=i(d[3],m,_+d[3].height/2,` class="pele-c4-descr" font-size="${y}"${a.text}`),U+=`<g class="pele-node pele-shape-${u} pele-c4-${e.kind}${n?` pele-c4-external`:``}" data-id="${r(e.alias)}" transform="translate(${s(t.x+c/2)},${s(t.y+l/2)})">`+Re(f(u,c,l,` fill="var(${n?`--_bg`:`--_s`})"${o}${a.shape}`,o+a.line)+v,e.link,e.alias,C,p)+`</g>`}}let W=o(a.title,!1,x,v,m?l(p):4e3,1),G=W.height>0?W.height+12:0,K=Math.max(k-D,W.width),q=Math.ceil(K+2*S),J=Math.ceil(A-O+G+2*S),Y=S-D+(K-(k-D))/2,ce=S+G-O;return[{svg:e(`c4`,q,J,v,p,a,i(W,q/2,S+W.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${s(Y)},${s(ce)})">`+(H?`<g class="pele-clusters">${H}</g>`:``)+(L?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${L}</g>`:``)+(U?`<g class="pele-nodes">${U}</g>`:``)+(V?`<g class="pele-edge-labels" font-size="${y}">${V}</g>`:``)+`</g>`),width:q,height:J,links:C},R.squeezed]}var Ve={type:`c4`,parse(e,t,n){let r=new D;return n&&(r.title=n),R(e,r),r},render:ze};export{Ve as c4};
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,b as n,d as r,i,o as a,p as o,s,u as c,x as l,y as u}from"./C2npZzkn.js";import{a as d,t as f}from"./DciMwFJ1.js";import{a as p,i as m,l as h,s as g}from"./BXBhaEho.js";import{t as _}from"./DDAG55ce.js";import{r as v}from"./BCGaqnao.js";import{i as y,n as b,r as x,t as ee}from"./D1LK3xRu.js";import{PeleError as S,a as C,b as w,r as T,u as te,v as E,x as D,y as O}from"./CMikI1NP.js";var k=`EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN`.split(` `),A=1,j=2,M=new Uint8Array(128);for(let e=48;e<=57;e++)M[e]=A;for(let e=65;e<=90;e++)M[e]=M[e+32]=A;M[95]=A;for(let e of`!#$&*+/=?^|~`)M[e.charCodeAt(0)]=j;var ne=[0,12,5,14,3,9,2,2,2,2,2,4,3,4,8,5,5,7,6,4,5];function N(e){return e<128&&(M[e]&A)!==0}function P(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function re(e,t,n){switch(n){case 97:return e.startsWith(`actor`,t)?2:0;case 115:return e.startsWith(`systemBoundary`,t)?3:e.startsWith(`style`,t)?16:0;case 101:return e.startsWith(`end`,t)?4:P(e,t,`extend`)?18:0;case 69:return P(e,t,`extend`)?18:0;case 100:return e.startsWith(`direction`,t)?5:0;case 84:return e.startsWith(`TD`,t)?6:e.startsWith(`TB`,t)?7:0;case 66:return e.startsWith(`BT`,t)?8:0;case 76:return e.startsWith(`LR`,t)?9:0;case 82:return e.startsWith(`RL`,t)?10:0;case 110:return e.startsWith(`note`,t)?11:0;case 102:return e.startsWith(`for`,t)?12:e.startsWith(`false`,t)?20:0;case 106:return e.startsWith(`json`,t)?13:0;case 99:return e.startsWith(`classDef`,t)?14:e.startsWith(`class`,t)?15:0;case 105:case 73:return P(e,t,`include`)?17:0;case 116:return e.startsWith(`true`,t)?19:0;case 117:return+!!e.startsWith(`usecase-beta`,t);default:return 0}}function F(e,t){[e,t]=C(e,t);let n=1,r=0;for(let i=0;i<t;i++){let a=e.charCodeAt(i);a!==10&&a!==13||(a===13&&i+1<t&&e.charCodeAt(i+1)===10&&i++,n++,r=i+1)}return[n,t-r+1]}function ie(e,t,n){let[r,i]=F(e,t);return`line ${r}, column ${i} [${C(e,t)[1]},${C(e,n)[1]})`}function ae(e,t,n){for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===n)return r+1;if(t===10||t===13)return-1}return-1}function oe(e,t){let n=e.charCodeAt(t);return n!==34&&n!==39||n===34&&e.charCodeAt(t+1)===96||ae(e,t,n)!==-1}function se(e,t,n){let[r,i]=F(e,t),[a,o]=[C(e,t)[1],C(e,t+n)[1]];return new S(`Error lexing usecase diagram: unexpected character: ->${e.charAt(t)}<- at offset: ${a}, skipped ${o-a} characters. at line ${r}, column ${i} [${a},${o})`,`syntax`,{type:`usecase`,line:r,column:i})}function ce(e){let t=[],n=[],r=[],i=e.length,a=0,o=!0,s=!1;for(;a<i;){let c=e.charCodeAt(a);if(c===32||c===9){a++;continue}let l,u=a+1,d=!1;if(c<128&&(M[c]&A)!==0){if(l=0,c===97&&o&&e.startsWith(`acc`,a)){let t=e.startsWith(`Descr`,a+3);if(t||e.startsWith(`Title`,a+3)){let n=a+8;for(;E(e.charCodeAt(n));)n++;let r=e.charCodeAt(n);if(r===58)for(l=t?42:41,u=n+1;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else if(r===123&&t&&!s){let t=e.indexOf(`}`,n+1);t===-1?s=!0:(l=40,u=t+1)}}}else if(c===106&&e.startsWith(`json`,a)&&E(e.charCodeAt(a+4))){let s=a+5;for(;E(e.charCodeAt(s));)s++;let c=s;for(;N(e.charCodeAt(s));)s++;if(s>c){for(;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===64){for(s++;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===123){t.push(43),n.push(a),r.push(s),a=s;let c=0,l=!1,u=!1,d=s;for(;d<i;d++){let t=e.charCodeAt(d);if(l)u?u=!1:t===92?u=!0:t===34&&(l=!1);else if(t===34)l=!0;else if(t===123)c++;else if(t===125&&--c===0)break}t.push(d<i?44:45),n.push(s),a=d<i?d+1:i,r.push(a),o=!1;continue}}}}if(l===0){for(;u<i&&N(e.charCodeAt(u));)u++;let t=re(e,a,c);if(t!==0)t===1||u-a===ne[t]?(l=t,u=a+ne[t]):l=21;else if((c===111||c===120)&&e.charCodeAt(a+1)===45&&e.charCodeAt(a+2)===45)l=c===111?56:58,u=a+3;else if(O(c)){let t=a+1;for(;O(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===46&&O(e.charCodeAt(t+1))){for(l=22,u=t+2;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=21}else for(l=21;e.charCodeAt(u)===45&&N(e.charCodeAt(u+1));)for(l=27,u+=2;N(e.charCodeAt(u));)u++}}else if(c===10)l=39,d=!0;else if(c===13)l=39,d=!0,e.charCodeAt(u)===10&&u++;else if(c===34||c===39){if(c===34&&e.charCodeAt(a+1)===96){let t=e.indexOf('`"',a+2);l=t===-1?37:36,u=t===-1?i:t+2}else if(l=35,u=ae(e,a,c),u===-1){let t=a+1;for(;t<i&&!oe(e,t);)t++;throw se(e,a,t-a)}}else if(c===37){if(o&&e.charCodeAt(u)===37)for(l=38;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else l=31}else if(c===45){if(e.charCodeAt(u)!==45)l=29;else{for(;e.charCodeAt(u)===45;)u++;let t=e.charCodeAt(u),n=u-a===2;n&&t===124&&e.charCodeAt(u+1)===62?(l=46,u+=2):t===62?(l=53,u++):n&&(t===111||t===120)?(l=t===111?55:57,u++):l=59}}else if(c===46){let t=e.charCodeAt(u);if(t===46&&e.charCodeAt(u+1)===62)l=47,u+=2;else if(O(t)){for(l=22;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=30}else if(c===60){if(e.charCodeAt(u)===60){if(t.push(48),n.push(a),r.push(a+2),o=!1,a+=2,a>=i)break;if(e.charCodeAt(a)===62&&e.charCodeAt(a+1)===62)l=49,u=a+2;else{let o=a,s=!1;for(;o<i;o++){let t=e.charCodeAt(o);if(t===10||t===13)break;if(t===62&&e.charCodeAt(o+1)===62){s=!0;break}}if(s&&e.slice(a,o).trim()!==``)t.push(50),n.push(a),r.push(o),l=49,a=o,u=o+2;else{for(;o<i&&e.charCodeAt(o)!==10&&e.charCodeAt(o)!==13;)o++;if(o===a){for(;o<i&&(e.charCodeAt(o)===10||e.charCodeAt(o)===13);)o++;throw se(e,a,o-a)}l=51,u=o}}}else if(e.charCodeAt(u)===45&&e.charCodeAt(u+1)===45)for(l=54,u+=2;e.charCodeAt(u)===45;)u++;else l=33}else if(c===58)e.charCodeAt(u)===58&&e.charCodeAt(u+1)===58?(l=52,u+=2):l=25;else if(c===64)e.charCodeAt(u)===123?(l=60,u++):l=23;else if(c===123)l=61;else if(c===125)l=62;else if(c===91)l=63;else if(c===93)l=64;else if(c===40)l=65;else if(c===41)l=66;else if(c===44)l=24;else if(c===35){for(;D(e.charCodeAt(u));)u++;l=u>a+1?26:32}else if(c===92)e.charCodeAt(u)===44?(l=28,u++):l=33;else if(c<127&&c>32)l=(M[c]&j)===0?33:32;else for(l=34;u<i;){let t=e.charCodeAt(u);if(t>=32&&t<127||t===9||t===10||t===13)break;u++}t.push(l),n.push(a),r.push(u),a=u,o=d}for(let e=0;e<3;e++)t.push(0),n.push(i),r.push(i);return{types:t,starts:n,ends:r}}function le(){return{type:`usecase`,actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,direction:`LR`,title:void 0,accTitle:``,accDescr:``,accDescription:``,source:``,headerSpan:[0,0],statements:[]}}function ue(){return{elements:[],boundaries:[],jsons:[],relationships:[],notes:[],metadata:[],classes:[],styles:[],classDefs:[],direction:void 0,accTitle:``,accDescription:``}}function I(e,t){if(t.length===0)return;let n=new Set(e);for(let r of t)n.has(r)||(n.add(r),e.push(r))}function de(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let{key:n,value:r}of e)if(n===`icon`)t.clear(),t.add(`actor`);else if(n===`animate`||n===`animation`)t.clear(),t.add(`edge`);else if(n===`type`)t.clear(),r===`rect`||r===`package`?t.add(`boundary`):(r===`normal`||r===`hollow`||r===`awesome`)&&t.add(`actor`);else if(n===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}function fe(e,t,n,r,i){let a=le(),{actors:o,useCases:s,systemBoundaries:c}=a,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=t=>ie(e,t[0],t[1]),h=(t,n)=>{let[r,i]=F(e,n[0]);return new S(t,`semantic`,{type:`usecase`,line:r,column:i})},g=(e,t)=>{throw h(`${e} at ${m(t)}`,t)},_=(e,t,n,r,i)=>{let a=e=>e===void 0?``:` (label "${e}")`;throw h(`${e} at ${m(t)}${a(r)}; previous declaration at ${m(n)}${a(i)}`,t)},v=(e,t,n)=>g(`Metadata property '${n.key}' is invalid for ${t} '${e}'`,n.keySpan),y=(e,t)=>{let n=p.get(e);(n===void 0||t<n)&&p.set(e,t)},b=e=>[...e].sort((e,t)=>(p.get(e.id)??0)-(p.get(t.id)??0)),x=(e,t)=>{l.set(e.id,{kind:t,span:e.span,generated:e.generated,label:e.label.text})},ee=(e,t)=>{let n=l.get(e.id);if(!n)return;let r=e.generated?e.label.text:void 0,i=n.generated?n.label:void 0;n.kind!==t&&_(`ID '${e.id}' is declared as both ${n.kind} and ${t}`,e.span,n.span,r,i),(n.generated||e.generated)&&_(`Generated ID '${e.id}' collides with another declaration`,e.span,n.span,r,i)},C=(e,t,n)=>{let r=l.get(e);r&&_(`ID '${e}' is declared more than once (${r.kind} and ${t})`,n,r.span,void 0,r.generated?r.label:void 0),l.set(e,{kind:t,span:n,generated:!1})},w=(e,t,n)=>{let{key:r,value:i}=t,a=a=>{!n&&a!==void 0&&a!==i&&_(`Actor '${e.id}' has conflicting ${r} metadata`,t.keySpan,e.span)};r===`type`&&(i===`normal`||i===`hollow`||i===`awesome`)?(a(e.actorType),e.actorType=i):r===`icon`&&typeof i==`string`?(a(e.icon),e.icon=i):r===`business`&&typeof i==`boolean`?(a(e.business),e.business=i):v(e.id,`actor`,t)},T=(e,t,n)=>{for(let r of t??[])e.kind===`actor`?w(e,r,n):r.key===`business`&&typeof r.value==`boolean`?(!n&&e.business!==void 0&&e.business!==r.value&&_(`Use case '${e.id}' has conflicting business metadata`,r.keySpan,e.span),e.business=r.value):v(e.id,`usecase`,r)},te=e=>{let t;if(e.kind===`actor`){s.delete(e.id);let n={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],type:e.icon?`icon`:e.actorType??`normal`,styles:o.get(e.id)?.styles??[]};e.icon&&(n.icon=e.icon),o.set(e.id,n),t=n}else o.delete(e.id),t={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],shape:e.shape??`ellipse`,styles:s.get(e.id)?.styles??[]},s.set(e.id,t);e.stereotype&&(t.stereotype=e.stereotype),e.parent?.id&&(t.parentId=e.parent.id)},E=e=>{ee(e,e.kind);let t=e.parent?.id?e.parent:void 0,n=u.get(e.id);if(n)(n.label.text!==e.label.text||n.label.type!==e.label.type)&&_(`ID '${e.id}' has conflicting labels`,e.span,n.span),e.shape&&n.shape&&e.shape!==n.shape&&_(`Use case '${e.id}' has conflicting shapes`,e.span,n.span),t&&n.parent?.id&&t.id!==n.parent.id&&_(`Element '${e.id}' belongs to more than one system boundary`,t.span,n.parent.span),e.stereotype&&n.stereotype&&e.stereotype!==n.stereotype&&_(`Element '${e.id}' has conflicting stereotypes`,e.span,n.stereotypeSpan??n.span),n.shape??=e.shape,n.parent??=e.parent,n.stereotype??=e.stereotype,n.stereotypeSpan??=e.stereotype?e.span:void 0,I(n.classes,e.classes),T(n,e.metadata,!1);else{let n={kind:e.kind,id:e.id,label:e.label,span:e.span,generated:e.generated,classes:[...e.classes],parent:t,shape:e.shape,stereotype:e.stereotype,stereotypeSpan:e.stereotype?e.span:void 0};T(n,e.metadata,!1),u.set(e.id,n),x(e,e.kind)}},D=e=>{ee(e,`boundary`);let t=d.get(e.id);t?((t.label.text!==e.label.text||t.label.type!==e.label.type)&&_(`Boundary '${e.id}' has conflicting titles`,e.span,t.span),I(t.classes,e.classes)):(d.set(e.id,{...e,classes:[...e.classes],members:[]}),x(e,`boundary`))},O=e=>{e.classed&&!e.declares&&g(`Relationship endpoint '${e.id}' uses ::: without declaring the node`,e.span);let t=l.get(e.id);return t?t.kind:(u.set(e.id,{...e,kind:`usecase`,shape:`ellipse`,classes:[]}),x(e,`usecase`),y(e.id,e.span[0]),`usecase`)},k=(e,t)=>{let n=l.get(e)?.kind;return(n===`actor`?o.get(e):n===`usecase`?s.get(e):n===`boundary`?c.get(e):n===`json`?a.jsonNodes.get(e):f.get(e))??g(`Class/style target '${e}' is unresolved or anonymous`,t)},A=[];for(let{source:e,target:n}of t.relationships)y(e.id,e.span[0]),y(n.id,n.span[0]);for(let e of t.elements)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>E(e)});for(let e of t.boundaries)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>D(e)});for(let e of t.jsons)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>C(e.id,`json`,e.span)});for(let{id:e,idSpan:n}of t.relationships)e&&n&&A.push({offset:n[0],run:()=>C(e,`edge`,n)});A.sort((e,t)=>e.offset-t.offset);for(let e of A)e.run();for(let e of b(u.values()))te(e);for(let e of b(d.values()))c.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:`rect`,members:[],classes:[],styles:[]});for(let e of b(t.jsons))a.jsonNodes.set(e.id,{id:e.id,value:e.value,propertyOrder:e.propertyOrder,classes:[...e.classes],styles:[]});let j=0;for(let e of t.relationships){let{source:t,target:n,type:r}=e,i=O(t),o=O(n),s=e=>e===`actor`||e===`usecase`||e===`json`;s(i)||_(`Relationship source '${t.id}' cannot be ${i}`,t.span,l.get(t.id).span),s(o)||_(`Relationship target '${n.id}' cannot be ${o}`,n.span,l.get(n.id).span),(r===`include`||r===`extend`)&&(i!==`usecase`||o!==`usecase`)&&g(`${r} relationship requires use-case endpoints`,e.span),r===`generalization`&&(i===`json`||i!==o)&&g(`Generalization requires actor-to-actor or use-case-to-use-case endpoints`,e.span),r===`association`&&(i===`json`||o===`json`)&&e.arrowType>2&&g(`JSON relationship '${t.id}' to '${n.id}' permits only point, reversed-point, or markerless solid association`,e.span);let c=e.id??`edge-${j++}`,u={id:c,explicitId:!!e.id,source:t.id,target:n.id,type:r,arrowType:e.arrowType,minlen:e.minlen,classes:[],styles:[],animate:!1};e.label&&(u.label=e.label.text,u.labelType=e.label.type),a.relationships.push(u),f.set(c,u)}let M=new Map(o),ne=new Map(s);o.clear(),s.clear();for(let e of b(u.values())){let t=M.get(e.id),n=ne.get(e.id);t?o.set(e.id,t):n?s.set(e.id,n):te(e)}for(let{target:e,span:n,properties:r,statement:i}of t.metadata){let t=l.get(e);if(!t){let t=de(r);return g(`Metadata target '${e}' is unresolved${t?` (metadata implies ${t})`:``}`,n)}let a=t.kind;a===`actor`||a===`usecase`?T(u.get(e),r,!0):a===`edge`&&(i.kind=`edgeMetadata`,i.edges=[{id:e,span:i.span,idSpan:n,metadata:i.metadata}],delete i.nodes);let o=d.get(e),s=f.get(e);for(let t of a===`actor`||a===`usecase`?[]:r){let{key:n,value:r}=t;a===`boundary`&&o&&n===`type`&&(r===`rect`||r===`package`)?o.type=r:a===`edge`&&s&&n===`animate`&&typeof r==`boolean`?s.animate=r:a===`edge`&&s&&n===`animation`&&(r===`fast`||r===`slow`)?(s.animation=r,s.animate=!0):v(e,a,t)}}for(let e of a.relationships)e.animation&&(e.animate=!0);for(let e of u.values())e.kind===`actor`?(e.icon&&e.actorType&&e.actorType!==`normal`&&g(`Actor '${e.id}' cannot combine icon with type '${e.actorType}'`,e.span),e.business&&(e.icon||e.actorType===`awesome`)&&g(`Business actor '${e.id}' must use normal or hollow geometry`,e.span)):e.shape===`rect`&&e.business&&g(`Rectangular use case '${e.id}' cannot be a business use case`,e.span),te(e);for(let e of[...t.elements].sort((e,t)=>e.span[0]-t.span[0])){if(!e.parent?.id)continue;let t=d.get(e.parent.id).members;t.includes(e.id)||t.push(e.id)}for(let e of d.values()){let t=c.get(e.id);t.type=e.type??`rect`,t.members=e.members,t.classes=[...e.classes]}let N=0;for(let e of t.notes){let t=l.get(e.target);if(!t)return g(`Note target '${e.target}' is unresolved`,e.span);t.kind!==`actor`&&t.kind!==`usecase`&&_(`Note target '${e.target}' must be an actor or use case, not ${t.kind}`,e.span,t.span);let n=`note-${N++}`;a.notes.set(n,{id:n,target:e.target,label:e.label.text,labelType:e.label.type})}for(let e of t.classDefs)for(let t of e.ids)a.classDefs.set(t,{id:t,styles:[...e.styles]});for(let e of t.classes)for(let t of e.targets)I(k(t.id,t.span).classes,e.classes);for(let e of t.styles)k(e.target,e.span).styles.push(...e.styles);return a.direction=t.direction??a.direction,a.title=i,a.accTitle=t.accTitle,a.accDescription=t.accDescription,a.accDescr=t.accDescription.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,b as n,d as r,i,o as a,p as o,s,u as c,x as l,y as u}from"./DEQsS4Ez.js";import{a as d,t as f}from"./DciMwFJ1.js";import{a as p,i as m,l as h,s as g}from"./Kem7IXj7.js";import{t as _}from"./C1FDDux-.js";import{r as v}from"./DW5uy3Jw.js";import{i as y,n as b,r as x,t as ee}from"./OG9GsKke.js";import{PeleError as S,a as C,b as w,r as T,u as te,v as E,x as D,y as O}from"./zasx25UV.js";var k=`EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN`.split(` `),A=1,j=2,M=new Uint8Array(128);for(let e=48;e<=57;e++)M[e]=A;for(let e=65;e<=90;e++)M[e]=M[e+32]=A;M[95]=A;for(let e of`!#$&*+/=?^|~`)M[e.charCodeAt(0)]=j;var ne=[0,12,5,14,3,9,2,2,2,2,2,4,3,4,8,5,5,7,6,4,5];function N(e){return e<128&&(M[e]&A)!==0}function P(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function re(e,t,n){switch(n){case 97:return e.startsWith(`actor`,t)?2:0;case 115:return e.startsWith(`systemBoundary`,t)?3:e.startsWith(`style`,t)?16:0;case 101:return e.startsWith(`end`,t)?4:P(e,t,`extend`)?18:0;case 69:return P(e,t,`extend`)?18:0;case 100:return e.startsWith(`direction`,t)?5:0;case 84:return e.startsWith(`TD`,t)?6:e.startsWith(`TB`,t)?7:0;case 66:return e.startsWith(`BT`,t)?8:0;case 76:return e.startsWith(`LR`,t)?9:0;case 82:return e.startsWith(`RL`,t)?10:0;case 110:return e.startsWith(`note`,t)?11:0;case 102:return e.startsWith(`for`,t)?12:e.startsWith(`false`,t)?20:0;case 106:return e.startsWith(`json`,t)?13:0;case 99:return e.startsWith(`classDef`,t)?14:e.startsWith(`class`,t)?15:0;case 105:case 73:return P(e,t,`include`)?17:0;case 116:return e.startsWith(`true`,t)?19:0;case 117:return+!!e.startsWith(`usecase-beta`,t);default:return 0}}function F(e,t){[e,t]=C(e,t);let n=1,r=0;for(let i=0;i<t;i++){let a=e.charCodeAt(i);a!==10&&a!==13||(a===13&&i+1<t&&e.charCodeAt(i+1)===10&&i++,n++,r=i+1)}return[n,t-r+1]}function ie(e,t,n){let[r,i]=F(e,t);return`line ${r}, column ${i} [${C(e,t)[1]},${C(e,n)[1]})`}function ae(e,t,n){for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===n)return r+1;if(t===10||t===13)return-1}return-1}function oe(e,t){let n=e.charCodeAt(t);return n!==34&&n!==39||n===34&&e.charCodeAt(t+1)===96||ae(e,t,n)!==-1}function se(e,t,n){let[r,i]=F(e,t),[a,o]=[C(e,t)[1],C(e,t+n)[1]];return new S(`Error lexing usecase diagram: unexpected character: ->${e.charAt(t)}<- at offset: ${a}, skipped ${o-a} characters. at line ${r}, column ${i} [${a},${o})`,`syntax`,{type:`usecase`,line:r,column:i})}function ce(e){let t=[],n=[],r=[],i=e.length,a=0,o=!0,s=!1;for(;a<i;){let c=e.charCodeAt(a);if(c===32||c===9){a++;continue}let l,u=a+1,d=!1;if(c<128&&(M[c]&A)!==0){if(l=0,c===97&&o&&e.startsWith(`acc`,a)){let t=e.startsWith(`Descr`,a+3);if(t||e.startsWith(`Title`,a+3)){let n=a+8;for(;E(e.charCodeAt(n));)n++;let r=e.charCodeAt(n);if(r===58)for(l=t?42:41,u=n+1;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else if(r===123&&t&&!s){let t=e.indexOf(`}`,n+1);t===-1?s=!0:(l=40,u=t+1)}}}else if(c===106&&e.startsWith(`json`,a)&&E(e.charCodeAt(a+4))){let s=a+5;for(;E(e.charCodeAt(s));)s++;let c=s;for(;N(e.charCodeAt(s));)s++;if(s>c){for(;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===64){for(s++;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===123){t.push(43),n.push(a),r.push(s),a=s;let c=0,l=!1,u=!1,d=s;for(;d<i;d++){let t=e.charCodeAt(d);if(l)u?u=!1:t===92?u=!0:t===34&&(l=!1);else if(t===34)l=!0;else if(t===123)c++;else if(t===125&&--c===0)break}t.push(d<i?44:45),n.push(s),a=d<i?d+1:i,r.push(a),o=!1;continue}}}}if(l===0){for(;u<i&&N(e.charCodeAt(u));)u++;let t=re(e,a,c);if(t!==0)t===1||u-a===ne[t]?(l=t,u=a+ne[t]):l=21;else if((c===111||c===120)&&e.charCodeAt(a+1)===45&&e.charCodeAt(a+2)===45)l=c===111?56:58,u=a+3;else if(O(c)){let t=a+1;for(;O(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===46&&O(e.charCodeAt(t+1))){for(l=22,u=t+2;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=21}else for(l=21;e.charCodeAt(u)===45&&N(e.charCodeAt(u+1));)for(l=27,u+=2;N(e.charCodeAt(u));)u++}}else if(c===10)l=39,d=!0;else if(c===13)l=39,d=!0,e.charCodeAt(u)===10&&u++;else if(c===34||c===39){if(c===34&&e.charCodeAt(a+1)===96){let t=e.indexOf('`"',a+2);l=t===-1?37:36,u=t===-1?i:t+2}else if(l=35,u=ae(e,a,c),u===-1){let t=a+1;for(;t<i&&!oe(e,t);)t++;throw se(e,a,t-a)}}else if(c===37){if(o&&e.charCodeAt(u)===37)for(l=38;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else l=31}else if(c===45){if(e.charCodeAt(u)!==45)l=29;else{for(;e.charCodeAt(u)===45;)u++;let t=e.charCodeAt(u),n=u-a===2;n&&t===124&&e.charCodeAt(u+1)===62?(l=46,u+=2):t===62?(l=53,u++):n&&(t===111||t===120)?(l=t===111?55:57,u++):l=59}}else if(c===46){let t=e.charCodeAt(u);if(t===46&&e.charCodeAt(u+1)===62)l=47,u+=2;else if(O(t)){for(l=22;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=30}else if(c===60){if(e.charCodeAt(u)===60){if(t.push(48),n.push(a),r.push(a+2),o=!1,a+=2,a>=i)break;if(e.charCodeAt(a)===62&&e.charCodeAt(a+1)===62)l=49,u=a+2;else{let o=a,s=!1;for(;o<i;o++){let t=e.charCodeAt(o);if(t===10||t===13)break;if(t===62&&e.charCodeAt(o+1)===62){s=!0;break}}if(s&&e.slice(a,o).trim()!==``)t.push(50),n.push(a),r.push(o),l=49,a=o,u=o+2;else{for(;o<i&&e.charCodeAt(o)!==10&&e.charCodeAt(o)!==13;)o++;if(o===a){for(;o<i&&(e.charCodeAt(o)===10||e.charCodeAt(o)===13);)o++;throw se(e,a,o-a)}l=51,u=o}}}else if(e.charCodeAt(u)===45&&e.charCodeAt(u+1)===45)for(l=54,u+=2;e.charCodeAt(u)===45;)u++;else l=33}else if(c===58)e.charCodeAt(u)===58&&e.charCodeAt(u+1)===58?(l=52,u+=2):l=25;else if(c===64)e.charCodeAt(u)===123?(l=60,u++):l=23;else if(c===123)l=61;else if(c===125)l=62;else if(c===91)l=63;else if(c===93)l=64;else if(c===40)l=65;else if(c===41)l=66;else if(c===44)l=24;else if(c===35){for(;D(e.charCodeAt(u));)u++;l=u>a+1?26:32}else if(c===92)e.charCodeAt(u)===44?(l=28,u++):l=33;else if(c<127&&c>32)l=(M[c]&j)===0?33:32;else for(l=34;u<i;){let t=e.charCodeAt(u);if(t>=32&&t<127||t===9||t===10||t===13)break;u++}t.push(l),n.push(a),r.push(u),a=u,o=d}for(let e=0;e<3;e++)t.push(0),n.push(i),r.push(i);return{types:t,starts:n,ends:r}}function le(){return{type:`usecase`,actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,direction:`LR`,title:void 0,accTitle:``,accDescr:``,accDescription:``,source:``,headerSpan:[0,0],statements:[]}}function ue(){return{elements:[],boundaries:[],jsons:[],relationships:[],notes:[],metadata:[],classes:[],styles:[],classDefs:[],direction:void 0,accTitle:``,accDescription:``}}function I(e,t){if(t.length===0)return;let n=new Set(e);for(let r of t)n.has(r)||(n.add(r),e.push(r))}function de(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let{key:n,value:r}of e)if(n===`icon`)t.clear(),t.add(`actor`);else if(n===`animate`||n===`animation`)t.clear(),t.add(`edge`);else if(n===`type`)t.clear(),r===`rect`||r===`package`?t.add(`boundary`):(r===`normal`||r===`hollow`||r===`awesome`)&&t.add(`actor`);else if(n===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}function fe(e,t,n,r,i){let a=le(),{actors:o,useCases:s,systemBoundaries:c}=a,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=t=>ie(e,t[0],t[1]),h=(t,n)=>{let[r,i]=F(e,n[0]);return new S(t,`semantic`,{type:`usecase`,line:r,column:i})},g=(e,t)=>{throw h(`${e} at ${m(t)}`,t)},_=(e,t,n,r,i)=>{let a=e=>e===void 0?``:` (label "${e}")`;throw h(`${e} at ${m(t)}${a(r)}; previous declaration at ${m(n)}${a(i)}`,t)},v=(e,t,n)=>g(`Metadata property '${n.key}' is invalid for ${t} '${e}'`,n.keySpan),y=(e,t)=>{let n=p.get(e);(n===void 0||t<n)&&p.set(e,t)},b=e=>[...e].sort((e,t)=>(p.get(e.id)??0)-(p.get(t.id)??0)),x=(e,t)=>{l.set(e.id,{kind:t,span:e.span,generated:e.generated,label:e.label.text})},ee=(e,t)=>{let n=l.get(e.id);if(!n)return;let r=e.generated?e.label.text:void 0,i=n.generated?n.label:void 0;n.kind!==t&&_(`ID '${e.id}' is declared as both ${n.kind} and ${t}`,e.span,n.span,r,i),(n.generated||e.generated)&&_(`Generated ID '${e.id}' collides with another declaration`,e.span,n.span,r,i)},C=(e,t,n)=>{let r=l.get(e);r&&_(`ID '${e}' is declared more than once (${r.kind} and ${t})`,n,r.span,void 0,r.generated?r.label:void 0),l.set(e,{kind:t,span:n,generated:!1})},w=(e,t,n)=>{let{key:r,value:i}=t,a=a=>{!n&&a!==void 0&&a!==i&&_(`Actor '${e.id}' has conflicting ${r} metadata`,t.keySpan,e.span)};r===`type`&&(i===`normal`||i===`hollow`||i===`awesome`)?(a(e.actorType),e.actorType=i):r===`icon`&&typeof i==`string`?(a(e.icon),e.icon=i):r===`business`&&typeof i==`boolean`?(a(e.business),e.business=i):v(e.id,`actor`,t)},T=(e,t,n)=>{for(let r of t??[])e.kind===`actor`?w(e,r,n):r.key===`business`&&typeof r.value==`boolean`?(!n&&e.business!==void 0&&e.business!==r.value&&_(`Use case '${e.id}' has conflicting business metadata`,r.keySpan,e.span),e.business=r.value):v(e.id,`usecase`,r)},te=e=>{let t;if(e.kind===`actor`){s.delete(e.id);let n={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],type:e.icon?`icon`:e.actorType??`normal`,styles:o.get(e.id)?.styles??[]};e.icon&&(n.icon=e.icon),o.set(e.id,n),t=n}else o.delete(e.id),t={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],shape:e.shape??`ellipse`,styles:s.get(e.id)?.styles??[]},s.set(e.id,t);e.stereotype&&(t.stereotype=e.stereotype),e.parent?.id&&(t.parentId=e.parent.id)},E=e=>{ee(e,e.kind);let t=e.parent?.id?e.parent:void 0,n=u.get(e.id);if(n)(n.label.text!==e.label.text||n.label.type!==e.label.type)&&_(`ID '${e.id}' has conflicting labels`,e.span,n.span),e.shape&&n.shape&&e.shape!==n.shape&&_(`Use case '${e.id}' has conflicting shapes`,e.span,n.span),t&&n.parent?.id&&t.id!==n.parent.id&&_(`Element '${e.id}' belongs to more than one system boundary`,t.span,n.parent.span),e.stereotype&&n.stereotype&&e.stereotype!==n.stereotype&&_(`Element '${e.id}' has conflicting stereotypes`,e.span,n.stereotypeSpan??n.span),n.shape??=e.shape,n.parent??=e.parent,n.stereotype??=e.stereotype,n.stereotypeSpan??=e.stereotype?e.span:void 0,I(n.classes,e.classes),T(n,e.metadata,!1);else{let n={kind:e.kind,id:e.id,label:e.label,span:e.span,generated:e.generated,classes:[...e.classes],parent:t,shape:e.shape,stereotype:e.stereotype,stereotypeSpan:e.stereotype?e.span:void 0};T(n,e.metadata,!1),u.set(e.id,n),x(e,e.kind)}},D=e=>{ee(e,`boundary`);let t=d.get(e.id);t?((t.label.text!==e.label.text||t.label.type!==e.label.type)&&_(`Boundary '${e.id}' has conflicting titles`,e.span,t.span),I(t.classes,e.classes)):(d.set(e.id,{...e,classes:[...e.classes],members:[]}),x(e,`boundary`))},O=e=>{e.classed&&!e.declares&&g(`Relationship endpoint '${e.id}' uses ::: without declaring the node`,e.span);let t=l.get(e.id);return t?t.kind:(u.set(e.id,{...e,kind:`usecase`,shape:`ellipse`,classes:[]}),x(e,`usecase`),y(e.id,e.span[0]),`usecase`)},k=(e,t)=>{let n=l.get(e)?.kind;return(n===`actor`?o.get(e):n===`usecase`?s.get(e):n===`boundary`?c.get(e):n===`json`?a.jsonNodes.get(e):f.get(e))??g(`Class/style target '${e}' is unresolved or anonymous`,t)},A=[];for(let{source:e,target:n}of t.relationships)y(e.id,e.span[0]),y(n.id,n.span[0]);for(let e of t.elements)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>E(e)});for(let e of t.boundaries)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>D(e)});for(let e of t.jsons)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>C(e.id,`json`,e.span)});for(let{id:e,idSpan:n}of t.relationships)e&&n&&A.push({offset:n[0],run:()=>C(e,`edge`,n)});A.sort((e,t)=>e.offset-t.offset);for(let e of A)e.run();for(let e of b(u.values()))te(e);for(let e of b(d.values()))c.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:`rect`,members:[],classes:[],styles:[]});for(let e of b(t.jsons))a.jsonNodes.set(e.id,{id:e.id,value:e.value,propertyOrder:e.propertyOrder,classes:[...e.classes],styles:[]});let j=0;for(let e of t.relationships){let{source:t,target:n,type:r}=e,i=O(t),o=O(n),s=e=>e===`actor`||e===`usecase`||e===`json`;s(i)||_(`Relationship source '${t.id}' cannot be ${i}`,t.span,l.get(t.id).span),s(o)||_(`Relationship target '${n.id}' cannot be ${o}`,n.span,l.get(n.id).span),(r===`include`||r===`extend`)&&(i!==`usecase`||o!==`usecase`)&&g(`${r} relationship requires use-case endpoints`,e.span),r===`generalization`&&(i===`json`||i!==o)&&g(`Generalization requires actor-to-actor or use-case-to-use-case endpoints`,e.span),r===`association`&&(i===`json`||o===`json`)&&e.arrowType>2&&g(`JSON relationship '${t.id}' to '${n.id}' permits only point, reversed-point, or markerless solid association`,e.span);let c=e.id??`edge-${j++}`,u={id:c,explicitId:!!e.id,source:t.id,target:n.id,type:r,arrowType:e.arrowType,minlen:e.minlen,classes:[],styles:[],animate:!1};e.label&&(u.label=e.label.text,u.labelType=e.label.type),a.relationships.push(u),f.set(c,u)}let M=new Map(o),ne=new Map(s);o.clear(),s.clear();for(let e of b(u.values())){let t=M.get(e.id),n=ne.get(e.id);t?o.set(e.id,t):n?s.set(e.id,n):te(e)}for(let{target:e,span:n,properties:r,statement:i}of t.metadata){let t=l.get(e);if(!t){let t=de(r);return g(`Metadata target '${e}' is unresolved${t?` (metadata implies ${t})`:``}`,n)}let a=t.kind;a===`actor`||a===`usecase`?T(u.get(e),r,!0):a===`edge`&&(i.kind=`edgeMetadata`,i.edges=[{id:e,span:i.span,idSpan:n,metadata:i.metadata}],delete i.nodes);let o=d.get(e),s=f.get(e);for(let t of a===`actor`||a===`usecase`?[]:r){let{key:n,value:r}=t;a===`boundary`&&o&&n===`type`&&(r===`rect`||r===`package`)?o.type=r:a===`edge`&&s&&n===`animate`&&typeof r==`boolean`?s.animate=r:a===`edge`&&s&&n===`animation`&&(r===`fast`||r===`slow`)?(s.animation=r,s.animate=!0):v(e,a,t)}}for(let e of a.relationships)e.animation&&(e.animate=!0);for(let e of u.values())e.kind===`actor`?(e.icon&&e.actorType&&e.actorType!==`normal`&&g(`Actor '${e.id}' cannot combine icon with type '${e.actorType}'`,e.span),e.business&&(e.icon||e.actorType===`awesome`)&&g(`Business actor '${e.id}' must use normal or hollow geometry`,e.span)):e.shape===`rect`&&e.business&&g(`Rectangular use case '${e.id}' cannot be a business use case`,e.span),te(e);for(let e of[...t.elements].sort((e,t)=>e.span[0]-t.span[0])){if(!e.parent?.id)continue;let t=d.get(e.parent.id).members;t.includes(e.id)||t.push(e.id)}for(let e of d.values()){let t=c.get(e.id);t.type=e.type??`rect`,t.members=e.members,t.classes=[...e.classes]}let N=0;for(let e of t.notes){let t=l.get(e.target);if(!t)return g(`Note target '${e.target}' is unresolved`,e.span);t.kind!==`actor`&&t.kind!==`usecase`&&_(`Note target '${e.target}' must be an actor or use case, not ${t.kind}`,e.span,t.span);let n=`note-${N++}`;a.notes.set(n,{id:n,target:e.target,label:e.label.text,labelType:e.label.type})}for(let e of t.classDefs)for(let t of e.ids)a.classDefs.set(t,{id:t,styles:[...e.styles]});for(let e of t.classes)for(let t of e.targets)I(k(t.id,t.span).classes,e.classes);for(let e of t.styles)k(e.target,e.span).styles.push(...e.styles);return a.direction=t.direction??a.direction,a.title=i,a.accTitle=t.accTitle,a.accDescription=t.accDescription,a.accDescr=t.accDescription.replace(/\n\s+/g,`
2
2
  `),a.source=e,a.headerSpan=n,a.statements=r,a}var L=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}offset};function pe(e){let t=new Map,n=[],r=[],i=e.length,a=0,o=``,s=0,c=()=>{for(;a<i;){let t=e.charCodeAt(a);if(t!==32&&t!==9&&t!==10&&t!==13)return;a++}},l=t=>{a++;let n=``;for(;a<i;){let r=a,i=e[a++];if(i===`"`)return n;if(i.charCodeAt(0)<32)throw new L(r);if(i!==`\\`){t&&(n+=i);continue}let o=a,s=e[a++],c;if(s===`"`||s===`\\`||s===`/`)c=s;else if(s===`b`)c=`\b`;else if(s===`f`)c=`\f`;else if(s===`n`)c=`
3
3
  `;else if(s===`r`)c=`\r`;else if(s===`t`)c=` `;else if(s===`u`){let t=e.slice(a,a+4);if(!/^[\dA-Fa-f]{4}$/.test(t))throw new L(a);c=String.fromCharCode(parseInt(t,16)),a+=4}else throw new L(o);t&&(n+=c)}throw new L(a)},u=t=>{for(let n=0;n<t.length;n++)if(e[a+n]!==t[n])throw new L(a+n);a+=t.length},d=()=>{if(e.charCodeAt(a)===45&&a++,e.charCodeAt(a)===48)a++;else if(O(e.charCodeAt(a)))for(;O(e.charCodeAt(a));)a++;else throw new L(a);if(e.charCodeAt(a)===46){if(a++,!O(e.charCodeAt(a)))throw new L(a);for(;O(e.charCodeAt(a));)a++}if((e.charCodeAt(a)|32)==101){if(a++,(e.charCodeAt(a)===43||e.charCodeAt(a)===45)&&a++,!O(e.charCodeAt(a)))throw new L(a);for(;O(e.charCodeAt(a));)a++}};for(c();;)if(s===0){c();let i=e.charCodeAt(a);if(s=2,i===123){a++;let i=[];t.set(o,i),n.push(o),c(),e.charCodeAt(a)===125?a++:(r.push({object:!0,pointer:o,keys:i,ranges:new Map,key:``,from:0,index:0}),s=1)}else if(i===91)a++,c(),e.charCodeAt(a)===93?a++:(r.push({object:!1,pointer:o,keys:[],ranges:new Map,key:``,from:0,index:0}),o+=`/0`,s=0);else if(i===34)l(!1);else if(i===116)u(`true`);else if(i===102)u(`false`);else if(i===110)u(`null`);else if(i===45||O(i))d();else throw new L(a)}else if(s===1){let i=r[r.length-1];if(e.charCodeAt(a)!==34)throw new L(a);let u=l(!0),d=i.ranges.get(u);if(d===void 0)i.keys.push(u);else for(let e=d[0];e<d[1];e++)t.delete(n[e]);if(i.key=u,i.from=n.length,c(),e.charCodeAt(a)!==58)throw new L(a);a++,o=`${i.pointer}/${u.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`,s=0}else{let t=r[r.length-1];if(t===void 0)break;t.object?t.ranges.set(t.key,[t.from,n.length]):t.index++,c();let i=e.charCodeAt(a);if(i===(t.object?125:93))a++,r.pop();else{if(i!==44)throw new L(a);a++,c(),o=`${t.pointer}/${t.index}`,s=+!!t.object}}if(c(),a!==i)throw new L(a);return t}function me(e,t,n,r){let i=Math.min(Math.max(t,0),e.length);for(let t=0;t<i;t++){let i=e.charCodeAt(t);i===13?(n++,r=1):i===10?(t===0||e.charCodeAt(t-1)!==13)&&(n++,r=1):r++}return[n,r]}function he(e,t,n,r){let i=/\bposition (\d+)\b/.exec(e);if(i)return me(t,parseInt(i[1],10),n,r);let a=/\bline (\d+) column (\d+)\b/.exec(e);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10);return[n+e-1,e===1?r+t-1:t]}if(/unexpected end|end of json input/i.test(e))return me(t,t.length,n,r)}function ge(e,t,n){return new S(`${e} (line ${t}, column ${n})`,`syntax`,{type:`usecase`,line:t,column:n})}function _e(e,t){let n;try{n=JSON.parse(e)}catch(n){let r=n instanceof Error?n.message:String(n),i=T(e);if(i!==e)try{JSON.parse(i)}catch(e){e instanceof Error&&(r=e.message)}let[a,o]=t(),s=he(r,i,a,o);if(!s){let e=0;try{pe(i)}catch(t){t instanceof L&&(e=t.offset)}s=me(i,e,a,o)}throw ge(`Invalid JSON: ${r}`,s[0],s[1])}if(typeof n!=`object`||!n||Array.isArray(n)){let[e,n]=t();throw ge(`JSON value must have an object root`,e,n)}return{value:n,propertyOrder:pe(e)}}var ve=1,ye=2,be=4,xe=8,Se=16,Ce=32,we=64,Te=`DEPENDENCY_ARROW|GENERALIZATION|FORWARD_SOLID|BACKWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|BACKWARD_CIRCLE|FORWARD_CROSS|BACKWARD_CROSS`,Ee=`IDENTIFIER|PLAIN_STRING|MARKDOWN_STRING`,De=`PLAIN_STRING|MARKDOWN_STRING|LABEL_TEXT`,Oe=`ACC_TITLE_LINE|ACC_DESCR_LINE|ACC_DESCR_BLOCK|DIRECTION|ACTOR|SYSTEM_BOUNDARY|NOTE|JSON_DECLARATION_START|CLASS_DEF|CLASS|STYLE`,ke=`WORD|PLAIN_STRING|NUMBER|HASH_COLOR|CSS_IDENTIFIER|CSS_ESCAPED_COMMA|DASH|DOT|PERCENT|CSS_PUNCTUATION|COLON|LPAREN|RPAREN|LBRACKET|RBRACKET|LBRACE|RBRACE|AT|MARKERLESS_SOLID`,R=new Uint8Array(67);function z(e,t){for(let n of e.split(`|`))if(n===`WORD`)for(let e=1;e<=21;e++)R[e]|=t;else R[k.indexOf(n)]|=t}z(`NEWLINE|COMMENT|${Oe}|${Ee}`,ve),z(`IDENTIFIER|${Te}`,ye),z(ke,be),z(`STEREOTYPE_START|CLASS_SEPARATOR|IDENTIFIER|${Te}|NEWLINE|EOF`,xe),z(`NEWLINE|COMMENT|ACTOR|${Ee}`,Se),z(`FORWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|FORWARD_CROSS`,Ce),z(`NEWLINE|IDENTIFIER|PLAIN_STRING|RBRACE`,we);var Ae=new Set([`allowmixing`,`newpage`,`package`,`rectangle`,`skinparam`]),B=``,V=[],H=[],U=[],W=0,je=0,G,Me,Ne=[],Pe=0,Fe=0;function K(e){return B.slice(H[e],U[e])}function q(e){return[H[e],U[e]]}function Ie(e){let[t,n]=F(B,H[W]);throw new S(`Error parsing usecase diagram: ${e} at ${ie(B,H[W],U[W])}`,`syntax`,{type:`usecase`,line:t,column:n})}function Le(e){Ie(`Expecting token of type --> ${e} <-- but found --> '${K(W)}' <--`)}function J(e){return V[W]!==e&&Le(k[e]),W++}function Y(e){Ie(`Expecting: one of these possible Token sequences:
4
4
  ${e.split(`|`).map((e,t)=>` ${t+1}. [${e}]`).join(`
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Cl5gQm2e.js","./Bd-WxALw.js","./C2npZzkn.js","./DciMwFJ1.js","./BXBhaEho.js","./DDAG55ce.js","./BA78_vo5.js","./DKqMzyyE.js","./D6QVYUu9.js","./BCGaqnao.js","./D1LK3xRu.js","./CggtIYAM.js","./UDPiRmKc.js","./CTDYUZPz.js","./CdmC_l9F.js","./BZmnMkFw.js","./B-DzK7Gb.js","./kG4HctVa.js","./DCZYeMlH.js","./Bb_N98K9.js","./CT4_O9X_.js","./CtkUy_15.js","./BWE_HS0c.js","./CdY1G_wk.js","./ZwM5k8r0.js","./CgA1WoRv.js","./TanDZqdf.js","./CFf_dAzX.js","./CzYPMYd4.js","./Ct_EK1xu.js","./BiATTH-R.js","./B35sQTcK.js","./CryuQgNh.js","./Ce_hS451.js","./C8h1oeAZ.js","./CMIt1Ma8.js","./DjUnonHY.js","./C5Z-Y7Lu.js","./DrVtdHUW.js","./D6sVhEz3.js","./Bj-5n5Pb.js","./Cf-5I5_6.js","./Djr0h_v1.js","./BhEqJU15.js","./BqipEJXw.js","./l1LsK1sB.js","./BT_btfh0.js","./BK31dpt6.js","./PsfIQCJ1.js","./DHJ8FcFD.js","./DRcTlHZP.js","./DFuPQaNa.js","./BvPxdlBc.js"])))=>i.map(i=>d[i]);
2
- import{ht as e}from"./e2LGvGEb.js";import{t}from"./CRzLMJPS.js";function n(e){return e<128?e===32||e>=9&&e<=13:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function r(e){return e===32||e===9}function i(e){return e===10||e===13||e===8232||e===8233}function a(e){return e>=48&&e<=57}function o(e){return e>=65&&e<=90||e>=97&&e<=122}function s(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95}var l=class extends Error{code;type;mermaidType;line;column;snippet;constructor(e,t=`syntax`,n={}){super(e),this.name=`PeleError`,this.code=t,this.type=n.type??null,this.mermaidType=n.mermaidType??null,this.line=n.line??0,this.column=n.column??0,this.snippet=n.snippet??``}};function u(e,t,n){return Array.from(e.matchAll(t),e=>[e.index,e.index+e[0].length,n])}function d(e,t){let n=0;for(let[r,i,a]of e){let e=r-n;if(t<e)break;if(t<e+a)return r+Math.min(t-e,i-r-1);n+=i-r-a}return t+n}function f(e,t){for(let n=e.length-1;n>=0;n--)t=d(e[n],t);return t}var p;function m(e,t){let n=p;p=e;try{return t()}finally{p=n}}function h(e,t){return p!==void 0&&e===p.parsed?p.find(t):[e,t]}function g(e,t){[e,t]=h(e,t);let n=1,r=0;for(let i=e.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DtEVmiYo.js","./CwHHpacD.js","./DEQsS4Ez.js","./DciMwFJ1.js","./Kem7IXj7.js","./C1FDDux-.js","./CcE14TDI.js","./BtcGx-KQ.js","./D6QVYUu9.js","./DW5uy3Jw.js","./OG9GsKke.js","./CggtIYAM.js","./D7jLdCNu.js","./CWc-mNzo.js","./DH_19--P.js","./BZmnMkFw.js","./DFo4P1vU.js","./BQeONalw.js","./BPpUSQ2Y.js","./BiHyHFlW.js","./DxRGLDbV.js","./BZX8cNYL.js","./0B47b24t.js","./C9Qdslk3.js","./BAVnZFPa.js","./CgA1WoRv.js","./DbtvzL7r.js","./DAVMwq6b.js","./1j--pDqt.js","./MrW4zd8l.js","./BLe29cGh.js","./ZTEErEOd.js","./CZSmkKvQ.js","./Ce_hS451.js","./BLzZIf7l.js","./CSKABQj2.js","./Ch5Z7cbP.js","./f7mFVWQS.js","./CUNetmvQ.js","./Ih6r6QR2.js","./hjSZ041d.js","./e7GRa0yc.js","./CVqwkR8N.js","./DY0M2GMn.js","./Mwr1r9aw.js","./DJQ6favH.js","./DWwu8a1P.js","./Bytzbt5l.js","./CUB9vnd0.js","./mhWk5y4o.js","./B7LnLClC.js","./Cpjqsnqr.js","./DJT73ARj.js"])))=>i.map(i=>d[i]);
2
+ import{_t as e}from"./AnnzTlE8.js";import{t}from"./CRzLMJPS.js";function n(e){return e<128?e===32||e>=9&&e<=13:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function r(e){return e===32||e===9}function i(e){return e===10||e===13||e===8232||e===8233}function a(e){return e>=48&&e<=57}function o(e){return e>=65&&e<=90||e>=97&&e<=122}function s(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95}var l=class extends Error{code;type;mermaidType;line;column;snippet;constructor(e,t=`syntax`,n={}){super(e),this.name=`PeleError`,this.code=t,this.type=n.type??null,this.mermaidType=n.mermaidType??null,this.line=n.line??0,this.column=n.column??0,this.snippet=n.snippet??``}};function u(e,t,n){return Array.from(e.matchAll(t),e=>[e.index,e.index+e[0].length,n])}function d(e,t){let n=0;for(let[r,i,a]of e){let e=r-n;if(t<e)break;if(t<e+a)return r+Math.min(t-e,i-r-1);n+=i-r-a}return t+n}function f(e,t){for(let n=e.length-1;n>=0;n--)t=d(e[n],t);return t}var p;function m(e,t){let n=p;p=e;try{return t()}finally{p=n}}function h(e,t){return p!==void 0&&e===p.parsed?p.find(t):[e,t]}function g(e,t){[e,t]=h(e,t);let n=1,r=0;for(let i=e.indexOf(`
3
3
  `);i!==-1&&i<t;i=e.indexOf(`
4
4
  `,i+1))n++,r=i+1;let i=e.indexOf(`
5
5
  `,t);i===-1&&(i=e.length);let a=t-r+1,o=e.slice(r,i);return{line:n,column:a,snippet:o+`
@@ -42,4 +42,4 @@ ${r}`,`syntax`,{type:e,...a})}var v=`amp:38,lt:60,gt:62,quot:34,apos:39,nbsp:160
42
42
  `,e+1))o++;n=n.slice(s.length),t?.push([[0,s.length,0]])}return n=Ge(n,i,t),{text:ze(n),title:a,config:i,withComments:n,lineOffset:o}}var qe=/#\w+;/g,Je=/^\+?\d+$/,Ye=RegExp(`[\\n\\r\u2028\u2029]`,`g`);function Xe(e){if(e===void 0)return;let t=[];return e.push(t),t}function Ze(e,t,r){let i=Xe(r),a=e.indexOf(t);if(a===-1)return e;let o=``,s=0;for(;a!==-1;){Ye.lastIndex=a;let r=Ye.test(e)?Ye.lastIndex-1:e.length,c=!1,l=-1;for(let i=a+t.length;i<r;i++){let t=e.charCodeAt(i);if(t===58)c=!0;else if(t===35){if(c){l=i;break}}else n(t)&&(c=!1)}if(l!==-1){let t=e.lastIndexOf(`;`,r-1);t>l&&(i?.push([t,t+1,0]),o+=e.slice(s,t),s=t+1)}a=r>=e.length?-1:e.indexOf(t,r+1)}return s===0?e:o+e.slice(s)}function Qe(e,t){if(!e.includes(`#`))return e;e=Ze(Ze(e,`style`,t),`classDef`,t);let n=Xe(t);return e.replace(qe,(e,t)=>{let r=e.substring(1,e.length-1),i=(Je.test(r)?`fl°°`:`fl°`)+r+`¶ß`;return n?.push([t,t+e.length,i.length]),i})}function Z(e){return e.ownerDocument?.defaultView??globalThis}function $e(e,t){let n=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0);return n>0?n:0}function et(e,t,n,r,i){let a=t.width/n,o=t.height/n,s=(e,t,n)=>t>=n?Math.min(Math.max(e,n-t),0):Math.min(Math.max(e,0),n-t);return{x:s(r,a,e.width),y:s(i,o,e.height),width:a,height:o}}var Q=1.25,tt=48,nt=`--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_b:var(--pele-border,#8a8a8a);position:absolute;top:var(--pele-zoom-top,8px);right:var(--pele-zoom-right,8px);bottom:var(--pele-zoom-bottom,auto);left:var(--pele-zoom-left,auto);display:flex;flex-direction:column;gap:2px;padding:2px;width:auto;max-width:none;border:1px solid var(--_b);border-radius:var(--pele-radius,4px);background:var(--_bg);color:var(--_fg);line-height:0`,rt=`appearance:none;display:grid;place-items:center;width:24px;height:24px;margin:0;padding:0;border:0;border-radius:calc(var(--pele-radius,4px) - 1px);background:transparent;color:inherit;font:inherit;cursor:var(--pele-zoom-cursor,pointer)`,it={zoomIn:`M5 12h14M12 5v14`,zoomOut:`M5 12h14`,reset:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8M3 3v5h5`},at={zoomIn:`Zoom in`,zoomOut:`Zoom out`,reset:`Reset zoom`};function ot(e,t={}){return st(e,t,!0)}function st(e,t,n){let r=null,i={width:0,height:0},a={width:0,height:0},o={width:0,height:0},s=!1,c=``,l={width:``,height:``,maxWidth:``,margin:``,display:``},u=0,d=0,f=0,p=0,m=()=>Z(e),h=()=>i.width>0&&a.width>0?a.width/i.width:1,g=()=>Math.max(h(),t.maxScale??3),_=()=>r!==null&&i.width>0&&(t.always===!0||h()<.999),v=()=>{if(!r||u!==0)return;let t=r.getBoundingClientRect();a={width:t.width,height:t.height},o={width:Math.max(a.width,e.clientWidth),height:Math.max(a.height,e.clientHeight)},s=o.width>a.width+1||o.height>a.height+1,s||(o=a);let n=m().getComputedStyle(e);c=[`Top`,`Right`,`Bottom`,`Left`].map(e=>`${-(parseFloat(n.getPropertyValue(`padding-${e.toLowerCase()}`))||0)}px`).join(` `)},y,b={},x=!1,S=()=>{if(t.controls===!1)return;let n=_();if(!y){if(!n)return;let r=e.ownerDocument;y=r.createElement(`div`),y.className=`pele pele-zoom`,y.setAttribute(`style`,nt);let i={zoomIn:()=>T((u||h())*Q*Q),zoomOut:()=>T((u||h())/(Q*Q)),reset:()=>w()};for(let e of[`zoomIn`,`zoomOut`,`reset`]){let n=r.createElement(`button`),a=t.labels?.[e]??at[e];n.type=`button`,n.className=`pele-zoom-${e===`zoomIn`?`in`:e===`zoomOut`?`out`:`reset`}`,n.setAttribute(`style`,rt),n.setAttribute(`aria-label`,a),n.title=a,n.innerHTML=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${it[e]}"/></svg>`,n.addEventListener(`click`,i[e]),b[e]=n,y.append(n)}}n&&!x&&m().getComputedStyle(e).position===`static`&&(e.style.position=`relative`,x=!0),n&&y.parentNode!==e&&e.append(y),y.hidden=!n,y.style.display=n?`flex`:`none`;let r=(e,t)=>{e&&(e.disabled=t,e.style.opacity=t?`0.35`:``,e.style.cursor=t?`default`:`var(--pele-zoom-cursor,pointer)`)};r(b.zoomIn,(u||h())>=g()*.999),r(b.zoomOut,u===0),b.reset&&(b.reset.style.display=u===0?`none`:`grid`)},C=e=>y!==void 0&&e.target instanceof m().Node&&y.contains(e.target),w=()=>{r&&(u=0,r.setAttribute(`viewBox`,`0 0 ${i.width} ${i.height}`),r.style.width=l.width,r.style.height=l.height,r.style.maxWidth=l.maxWidth,r.style.margin=l.margin,r.style.display=l.display,r.style.cursor=``,r.style.userSelect=``,v(),r.style.touchAction=_()?`pan-y`:``,_()?r.setAttribute(`tabindex`,`0`):r.removeAttribute(`tabindex`),B(_()),S())},T=(e,t,n)=>{if(!r||(u===0&&v(),!_()))return;let i=u||h(),a=Math.min(Math.max(e,h()),g());if(a<=h()*1.001){w();return}let l=r.getBoundingClientRect(),p=t??l.left+l.width/2,m=n??l.top+l.height/2,y=(u?d:0)+(p-l.left)/i,b=(u?f:0)+(m-l.top)/i;u=a;let x=l;s&&(r.style.maxWidth=`none`,r.style.margin=c,r.style.display=`block`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,x=r.getBoundingClientRect()),E(y-(p-x.left)/u,b-(m-x.top)/u),r.style.cursor=`grab`,r.style.userSelect=`none`,r.style.touchAction=`none`,S()},E=(e,t)=>{if(!r)return;let n=et(i,o,u,e,t);d=n.x,f=n.y,r.setAttribute(`viewBox`,`${d} ${f} ${n.width} ${n.height}`)},D=(e,t)=>{u!==0&&E(d-e/u,f-t/u)},O=()=>{j();let t=e.clientWidth+e.clientHeight;t!==p&&(p=t,w())},k,A,j=()=>{if(!n)return;let t=m();t!==A&&(k?.disconnect(),A=t,k=t.ResizeObserver?new t.ResizeObserver(O):void 0,k?.observe(e))},M=()=>{j();let t=e.firstElementChild;r=t&&t.localName===`svg`?t:null,u=0,r?(i={width:Number(r.getAttribute(`width`))||0,height:Number(r.getAttribute(`height`))||0},l={width:r.style.width,height:r.style.height,maxWidth:r.style.maxWidth,margin:r.style.margin,display:r.style.display},w()):(y?.remove(),B(!1))},N=new Map,P=!1,F=0,I=0,L=()=>{let[e,t]=[...N.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),x:(e.x+t.x)/2,y:(e.y+t.y)/2}},R=t=>{!_()||C(t)||t.pointerType===`mouse`&&t.button!==0||(N.set(t.pointerId,{x:t.clientX,y:t.clientY}),F=0,N.size===2&&(I=L().distance),(N.size===2||u!==0)&&(e.setPointerCapture?.(t.pointerId),r&&(r.style.cursor=`grabbing`)))},ee=e=>{let t=N.get(e.pointerId);if(t){if(N.size===2){let t=L();N.set(e.pointerId,{x:e.clientX,y:e.clientY});let n=L();I>0&&n.distance>0&&T((u||h())*(n.distance/t.distance),n.x,n.y),D(n.x-t.x,n.y-t.y),P=!0;return}N.set(e.pointerId,{x:e.clientX,y:e.clientY}),u!==0&&(F+=Math.abs(e.clientX-t.x)+Math.abs(e.clientY-t.y),F>4&&(P=!0),D(e.clientX-t.x,e.clientY-t.y))}},te=e=>{N.delete(e.pointerId)&&(I=0,N.size===0&&r&&u!==0&&(r.style.cursor=`grab`))},ne=e=>{P&&(P=!1,e.preventDefault(),e.stopPropagation())},re=e=>{if(!(e.ctrlKey||e.metaKey)||!_())return;e.preventDefault(),u===0&&v();let t=Math.min(Math.max(-e.deltaY,-24),24);T((u||h())*2**(t*.02),e.clientX,e.clientY)},ie=e=>{!_()||C(e)||(e.preventDefault(),u===0?T(Math.max(1,h()*2),e.clientX,e.clientY):w())},ae=e=>{if(!_()||C(e)||e.ctrlKey||e.metaKey||e.altKey)return;let t=e.key;if(t===`+`||t===`=`)T((u||h())*Q);else if(t===`-`)T((u||h())/Q);else{if(u===0)return;if(t===`0`||t===`Escape`)w();else if(t===`ArrowLeft`)D(tt,0);else if(t===`ArrowRight`)D(-tt,0);else if(t===`ArrowUp`)D(0,tt);else if(t===`ArrowDown`)D(0,-tt);else return}e.preventDefault()},oe=e=>{if(!r||e.target!==r)return;let t=!0;try{t=r.matches(`:focus-visible`)}catch{}r.style.outline=t?``:`none`},z=0,se=e=>{_()&&(e.preventDefault(),u===0&&v(),z=u||h())},ce=e=>{if(z===0)return;e.preventDefault();let{scale:t,clientX:n,clientY:r}=e;T(z*t,n,r)},le=()=>{z=0},ue=[[`pointerdown`,R],[`pointermove`,ee],[`pointerup`,te],[`pointercancel`,te],[`click`,ne,{capture:!0}],[`dblclick`,ie],[`keydown`,ae],[`focusin`,oe]];for(let[t,n,r]of ue)e.addEventListener(t,n,r);let de=[[`wheel`,re,{passive:!1}],[`gesturestart`,se,{passive:!1}],[`gesturechange`,ce,{passive:!1}],[`gestureend`,le,{passive:!1}]],fe=!1;function B(t){if(t!==fe){fe=t;for(let[n,r,i]of de)t?e.addEventListener(n,r,i):e.removeEventListener(n,r,i);t||(z=0)}}return p=e.clientWidth+e.clientHeight,M(),{get scale(){return u||h()},get fit(){return h()},zoomBy(e){T((u||h())*e)},zoomTo(e){T(e)},reset:w,refresh:M,resized:O,destroy(){w(),r&&(r.style.touchAction=``,r.removeAttribute(`tabindex`)),y?.remove(),x&&(e.style.position=``),k?.disconnect(),B(!1);for(let[t,n,r]of ue)e.removeEventListener(t,n,r)}}}function ct(e,t){let n=t?Z(t).getComputedStyle(t):e;return{family:n.getPropertyValue(`--pele-font`).trim()||e.fontFamily||void 0,mono:n.getPropertyValue(`--pele-font-mono`).trim()||void 0}}function lt(e){return[...new Set([e.ownerDocument?.fonts,globalThis.document?.fonts])].filter(e=>e!==void 0)}var ut=new WeakMap;function dt(e){let t=ut.get(e);return t||(t=e.ready.then(()=>{ut.delete(e),he()}),ut.set(e,t)),t}var ft=new WeakMap;function pt(e,t){Promise.all(e.map(dt)).then(()=>{let e=t.deref();e&&ft.get(e)?.()})}var mt=new WeakMap,ht=0,gt=Math.random().toString(36).slice(2,7),_t=`position:relative;height:1.3em;margin-top:-1.3em;line-height:1.3;font-size:0.8em;color:var(--pele-error,#e45756);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;`,vt=`margin:0;font-size:0.8em;font-family:var(--pele-font-mono,monospace);color:var(--pele-error,#e45756);white-space:pre-wrap;`;function yt(e){return e instanceof Error?e.message:String(e)}function bt(e){let t=e.split(`
43
43
  `).filter(e=>e.trim()!==``);return t.length>1?`${t[0]} ${t[t.length-1]}`:t[0]??``}function xt(e,t,n,r={}){mt.get(t)?.destroy();let i=n,a=r,o,s,c=!1,l,u,d,f=`pele-${gt}-${++ht}`,p={},m,h=-1,g=!1,_=!1,v=!1,y=(n,r)=>{let{onRender:i,onError:s,sanitize:c,...l}=a,d={...l,idPrefix:l.idPrefix??f,fontFamily:l.fontFamily??p.family,fontFamilyMono:l.fontFamilyMono??p.mono,maxWidth:void 0};r&&(u=e.render(o,d),m=void 0);let g=a.maxWidth??$e(t,n);return h=g,g>0&&g<u.width&&(m??=e.render(o,{...d,maxWidth:1}).svg!==u.svg,m)?e.render(o,{...d,maxWidth:g}):u},b=e=>{a.sanitize?t.replaceChildren(a.sanitize(e)):t.innerHTML=e},x,S=()=>{let e=d?t.firstElementChild:null;if(e?.style&&(e.style.opacity=l===void 0?``:`0.4`),l===void 0){x?.remove(),x=void 0;return}let n=t.ownerDocument;if(!n)return;x??=n.createElement(`div`),x.className=`pele pele-error`;let r=yt(l);e?(x.textContent=bt(r),x.title=r,x.setAttribute(`style`,_t),x.parentNode!==t&&t.append(x)):(x.textContent=r,x.removeAttribute(`title`),x.setAttribute(`style`,vt),t.replaceChildren(x))},C=e=>{l=e,S(),a.onError?.(e)},w=()=>{if(_||v)return;let e=lt(t).filter(e=>e.status===`loading`);e.length!==0&&(_=!0,pt(e,new WeakRef(R)))},T=()=>{_=!1,g=!0,M()},E=(e,n=!e)=>{let r=Z(t).getComputedStyle(t),i=t.firstElementChild??null,f={fonts:p,natural:u,adapts:m,drawnFor:h,stale:g},_;try{if(e&&(p=ct(r,i),g=t.isConnected===!1),_=y(r,e),n&&_.svg===d?.svg){e&&(s=o),c&&l!==void 0&&(l=void 0,S());return}b(_.svg)}catch(e){throw{fonts:p,natural:u,adapts:m,drawnFor:h,stale:g}=f,e}if(e&&(s=o),e&&!i&&t.firstElementChild){let e=ct(r,t.firstElementChild);if(e.family!==p.family||e.mono!==p.mono){let t={fonts:p,natural:u,adapts:m,drawnFor:h};p=e;try{let e=y(r,!0);b(e.svg),_=e}catch{({fonts:p,natural:u,adapts:m,drawnFor:h}=t)}}}d=_,c&&(l=void 0),S(),D?.refresh(),w(),a.onRender?.(_)},D,O=!1,k=()=>{let e=a.zoom??`auto`;e!==O&&(D?.destroy(),O=e,D=e===!1?void 0:st(t,typeof e==`object`?e:{always:e===!0},!1))},A=()=>t.isConnected===!1||!(t.clientWidth>0),j=()=>t.isConnected!==!1&&!(t.clientWidth>0),M=()=>{if(v||(L(),!o||A()))return;let e=Z(t).getComputedStyle(t),n=ct(e,t.firstElementChild??null);try{if(g||n.family!==p.family||n.mono!==p.mono)E(!0,!0);else if(m!==!1&&a.maxWidth===void 0){let n=$e(t,e);n!==h&&n!==d?.width&&E(!1)}}catch(e){g=!1,c&&(l=e),o!==s&&(o=s,c=!1),S(),a.onError?.(e)}D?.resized(),w()},N,P,F,I=()=>{F!==void 0&&N?.cancelAnimationFrame(F),F=void 0},L=()=>{let e=Z(t);e!==N&&(P?.disconnect(),I(),N=e,P=e.ResizeObserver?new e.ResizeObserver(()=>{if(F===void 0){if(!e.requestAnimationFrame)return M();F=e.requestAnimationFrame(()=>{F=void 0,M()})}}):void 0,P?.observe(t))},R={get result(){return d},get source(){return i},get error(){return l},get zoom(){return D},update(t,n=a){let r=!c||t!==i||n.limit!==a.limit||n.maxEdges!==a.maxEdges||n.config!==a.config;i=t,a=n;let l=o;if(r)try{l=e.parse(t,n)}catch(e){c=!1,C(e),k();return}let u=d;if(o=l,c=!0,j())g=!0,k();else{try{E(!0)}catch(e){if(d!==u)throw k(),e;o=s,c=!1,C(e)}k()}},refresh:M,destroy(){v=!0,P?.disconnect(),P=void 0,I(),N=void 0,D?.destroy(),ft.delete(R),mt.get(t)===R&&mt.delete(t)}};ft.set(R,T);try{o=e.parse(n,r),c=!0,E(!0)}catch(e){if(d)throw e;o=s,c=!1,C(e)}return k(),L(),mt.set(t,R),R}var St=new Map;function Ct(...e){for(let t of e)St.set(t.type,t)}function wt(e){return St.has(e)}var Tt=5e4,Et=4e6,Dt=5e3;function Ot(e){try{return e()}catch(e){throw e instanceof RangeError?new l(`Diagram is nested too deeply.`,`limit`):e}}function kt(e,t){try{return t()}catch(t){if(t instanceof RangeError)throw new l(`Diagram is nested too deeply.`,`limit`,e);if(t instanceof l){t.type??=e.type,t.mermaidType??=e.mermaidType;let n=D(t.message);n!==t.message&&(t.stack=t.stack?.replace(t.message,()=>n),t.message=n),t.snippet=D(t.snippet)}throw t}}var At=new WeakMap;function jt(e,t=Tt,n=Dt,r){if(e.length>t)throw new l(`Diagram source is longer than the limit of ${t} characters.`,`limit`);let i=Ke(e),a=Ne(i.text);if(a===null)throw new l(`No diagram type detected for the given text.`,`unsupported-diagram`);let o=St.get(a.type);if(o===void 0)throw new l(`Diagram type "${a.type}" is not supported yet.`,`unsupported-diagram`,a);let s=r?{...r,...i.config}:i.config,c=o.keepComments===!0,u=Qe(c?i.withComments:i.text)+`
44
44
  `,d=kt(a,()=>m({parsed:u,find:Mt(e,c)},()=>o.parse(u,s,i.title,i.lineOffset,{maxEdges:n})));return{...a,diagram:o,model:d,config:s}}function Mt(e,t){let n,r=``;return i=>{if(n===void 0){n=[];let i=Ke(e,n);Qe(t?i.withComments:ze(i.withComments,n),n),r=Be(e)+`
45
- `}return[r,f(n,i)]}}function Nt(e,t){if(typeof e==`string`)return jt(e,t.limit,t.maxEdges,t.config);let n=At.get(e);if(n===void 0)throw TypeError(`render() takes diagram text or a model that parse() returned.`);return n}function $(e){return Ne(Ke(e).text)?.type??null}function Pt(e){try{let t=$(e);return t!==null&&St.has(t)}catch{return!1}}function Ft(e,t={}){return Ot(()=>{let n=jt(e,t.limit,t.maxEdges,t.config),r=n.model;return Object.defineProperty(r,"mermaidType",{value:n.mermaidType,enumerable:!0}),At.set(r,n),r})}function It(e,t={}){return Ot(()=>{let{type:n,mermaidType:r,diagram:i,model:a,config:o}=Nt(e,t),s=o[i.section??n],c=typeof s==`object`&&!!s&&!Array.isArray(s)&&s.useMaxWidth===!1,u=t.responsive??!c,d=t.icons,f=d&&(e=>d(O(e))),p=kt({type:n,mermaidType:r},()=>F(i.math?t.math:void 0,()=>j(f,()=>i.render(a,o,{...t,responsive:u,icons:f})))),m=t.outputLimit??Et;if(p.svg.length>m)throw new l(`Diagram output is longer than the limit of ${m} characters.`,`limit`,{type:n,mermaidType:r});for(let e of p.links)e.id=O(e.id);return{type:n,mermaidType:r,...p}})}function Lt(e,t,n={}){return xt({parse:Ft,render:It},e,t,n)}var Rt=e({PeleError:()=>l,detectType:()=>$,enableZoom:()=>ot,forgetTextWidths:()=>he,load:()=>Vt,mount:()=>Lt,mountAsync:()=>Ut,parse:()=>Ft,register:()=>Ct,registered:()=>wt,render:()=>It,renderAsync:()=>Ht,supports:()=>Pt}),zt=new Map([[`flowchart`,()=>t(()=>import(`./Cl5gQm2e.js`).then(e=>e.flowchart),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)],[`pie`,()=>t(()=>import(`./UDPiRmKc.js`).then(e=>e.pie),__vite__mapDeps([12,2,3,13]),import.meta.url)],[`er`,()=>t(()=>import(`./CdmC_l9F.js`).then(e=>e.er),__vite__mapDeps([14,2,3,4,5,7,15,9,10]),import.meta.url)],[`mindmap`,()=>t(()=>import(`./B-DzK7Gb.js`).then(e=>e.mindmap),__vite__mapDeps([16,2,3,17,5,6]),import.meta.url)],[`kanban`,()=>t(()=>import(`./DCZYeMlH.js`).then(e=>e.kanban),__vite__mapDeps([18,2,3,17,5,7]),import.meta.url)],[`timeline`,()=>t(()=>import(`./Bb_N98K9.js`).then(e=>e.timeline),__vite__mapDeps([19,20,2,21,3,4]),import.meta.url)],[`journey`,()=>t(()=>import(`./BWE_HS0c.js`).then(e=>e.journey),__vite__mapDeps([22,20,2,21,3]),import.meta.url)],[`class`,()=>t(()=>import(`./CdY1G_wk.js`).then(e=>e.classDiagram),__vite__mapDeps([23,2,3,4,5,6,7,15,8,9,10]),import.meta.url)],[`quadrantChart`,()=>t(()=>import(`./ZwM5k8r0.js`).then(e=>e.quadrantChart),__vite__mapDeps([24,2,3,25]),import.meta.url)],[`xychart`,()=>t(()=>import(`./TanDZqdf.js`).then(e=>e.xychart),__vite__mapDeps([26,2,3,25]),import.meta.url)],[`state`,()=>t(()=>import(`./CFf_dAzX.js`).then(e=>e.state),__vite__mapDeps([27,2,3,4,5,6,7,10]),import.meta.url)],[`gantt`,()=>t(()=>import(`./CzYPMYd4.js`).then(e=>e.gantt),__vite__mapDeps([28,2,3,7]),import.meta.url)],[`architecture`,()=>t(()=>import(`./Ct_EK1xu.js`).then(e=>e.architecture),__vite__mapDeps([29,2,3,4,13]),import.meta.url)],[`requirement`,()=>t(()=>import(`./BiATTH-R.js`).then(e=>e.requirement),__vite__mapDeps([30,2,3,4,5,10]),import.meta.url)],[`sankey`,()=>t(()=>import(`./B35sQTcK.js`).then(e=>e.sankey),__vite__mapDeps([31,2,3]),import.meta.url)],[`packet`,()=>t(()=>import(`./CryuQgNh.js`).then(e=>e.packet),__vite__mapDeps([32,2,3,13,33,34]),import.meta.url)],[`radar`,()=>t(()=>import(`./CMIt1Ma8.js`).then(e=>e.radar),__vite__mapDeps([35,2,3,13]),import.meta.url)],[`treemap`,()=>t(()=>import(`./DjUnonHY.js`).then(e=>e.treemap),__vite__mapDeps([36,2,3,13,33]),import.meta.url)],[`info`,()=>t(()=>import(`./C5Z-Y7Lu.js`).then(e=>e.info),__vite__mapDeps([37,2,13]),import.meta.url)],[`sequence`,()=>t(()=>import(`./DrVtdHUW.js`).then(e=>e.sequence),__vite__mapDeps([38,2,3,4,5,34]),import.meta.url)],[`gitGraph`,()=>t(()=>import(`./D6sVhEz3.js`).then(e=>e.gitGraph),__vite__mapDeps([39,2,21,3,13]),import.meta.url)],[`c4`,()=>t(()=>import(`./Bj-5n5Pb.js`).then(e=>e.c4),__vite__mapDeps([40,2,3,4,6,7,34]),import.meta.url)],[`block`,()=>t(()=>import(`./Cf-5I5_6.js`).then(e=>e.block),__vite__mapDeps([41,2,3,4,5,6]),import.meta.url)],[`railroad`,()=>t(()=>import(`./Djr0h_v1.js`).then(e=>e.railroad),__vite__mapDeps([42,2,3,13]),import.meta.url)],[`agentflow`,()=>t(()=>import(`./BhEqJU15.js`).then(e=>e.agentflow),__vite__mapDeps([43,2,3,4,6,7,8,9,10,11]),import.meta.url)],[`treeView`,()=>t(()=>import(`./BqipEJXw.js`).then(e=>e.treeView),__vite__mapDeps([44,2,3,13,34,45]),import.meta.url)],[`cynefin`,()=>t(()=>import(`./BT_btfh0.js`).then(e=>e.cynefin),__vite__mapDeps([46,2,4,13]),import.meta.url)],[`wardley`,()=>t(()=>import(`./BK31dpt6.js`).then(e=>e.wardley),__vite__mapDeps([47,2,3,4,13,45]),import.meta.url)],[`eventmodeling`,()=>t(()=>import(`./PsfIQCJ1.js`).then(e=>e.eventmodeling),__vite__mapDeps([48,2,3,4,13,34,45]),import.meta.url)],[`usecase`,()=>t(()=>import(`./DHJ8FcFD.js`).then(e=>e.usecase),__vite__mapDeps([49,2,3,4,5,9,10]),import.meta.url)],[`venn`,()=>t(()=>import(`./DRcTlHZP.js`).then(e=>e.venn),__vite__mapDeps([50,2]),import.meta.url)],[`ishikawa`,()=>t(()=>import(`./DFuPQaNa.js`).then(e=>e.ishikawa),__vite__mapDeps([51,2,3,4,34]),import.meta.url)],[`swimlane`,()=>t(()=>import(`./BvPxdlBc.js`).then(e=>e.swimlane),__vite__mapDeps([52,2,4,1,3,5,6,7,8,9,10,11]),import.meta.url)]]),Bt=new Map;function Vt(e){if(e===null)return Promise.resolve(!1);if(wt(e))return Promise.resolve(!0);let t=Bt.get(e);if(t===void 0){let n=zt.get(e);if(n===void 0)return Promise.resolve(!1);t=n().then(e=>(Ct(e),!0),t=>{throw Bt.delete(e),t}),Bt.set(e,t)}return t}async function Ht(e,t={}){let n=null;try{n=$(e)}catch{}return await Vt(n),It(e,t)}async function Ut(e,t,n={}){let r=null;try{r=$(t)}catch{}return await Vt(r),Lt(e,t,n)}export{l as PeleError,i as _,h as a,o as b,u as c,O as d,$ as detectType,ot as enableZoom,M as f,he as forgetTextWidths,c as g,n as h,f as i,ee as l,Vt as load,R as m,Lt as mount,Ut as mountAsync,je as n,g as o,I as p,Ft as parse,D as r,Ct as register,wt as registered,It as render,Ht as renderAsync,_ as s,Pt as supports,Rt as t,me as u,r as v,s as x,a as y};
45
+ `}return[r,f(n,i)]}}function Nt(e,t){if(typeof e==`string`)return jt(e,t.limit,t.maxEdges,t.config);let n=At.get(e);if(n===void 0)throw TypeError(`render() takes diagram text or a model that parse() returned.`);return n}function $(e){return Ne(Ke(e).text)?.type??null}function Pt(e){try{let t=$(e);return t!==null&&St.has(t)}catch{return!1}}function Ft(e,t={}){return Ot(()=>{let n=jt(e,t.limit,t.maxEdges,t.config),r=n.model;return Object.defineProperty(r,"mermaidType",{value:n.mermaidType,enumerable:!0}),At.set(r,n),r})}function It(e,t={}){return Ot(()=>{let{type:n,mermaidType:r,diagram:i,model:a,config:o}=Nt(e,t),s=o[i.section??n],c=typeof s==`object`&&!!s&&!Array.isArray(s)&&s.useMaxWidth===!1,u=t.responsive??!c,d=t.icons,f=d&&(e=>d(O(e))),p=kt({type:n,mermaidType:r},()=>F(i.math?t.math:void 0,()=>j(f,()=>i.render(a,o,{...t,responsive:u,icons:f})))),m=t.outputLimit??Et;if(p.svg.length>m)throw new l(`Diagram output is longer than the limit of ${m} characters.`,`limit`,{type:n,mermaidType:r});for(let e of p.links)e.id=O(e.id);return{type:n,mermaidType:r,...p}})}function Lt(e,t,n={}){return xt({parse:Ft,render:It},e,t,n)}var Rt=e({PeleError:()=>l,detectType:()=>$,enableZoom:()=>ot,forgetTextWidths:()=>he,load:()=>Vt,mount:()=>Lt,mountAsync:()=>Ut,parse:()=>Ft,register:()=>Ct,registered:()=>wt,render:()=>It,renderAsync:()=>Ht,supports:()=>Pt}),zt=new Map([[`flowchart`,()=>t(()=>import(`./DtEVmiYo.js`).then(e=>e.flowchart),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)],[`pie`,()=>t(()=>import(`./D7jLdCNu.js`).then(e=>e.pie),__vite__mapDeps([12,2,3,13]),import.meta.url)],[`er`,()=>t(()=>import(`./DH_19--P.js`).then(e=>e.er),__vite__mapDeps([14,2,3,4,5,7,15,9,10]),import.meta.url)],[`mindmap`,()=>t(()=>import(`./DFo4P1vU.js`).then(e=>e.mindmap),__vite__mapDeps([16,2,3,17,5,6]),import.meta.url)],[`kanban`,()=>t(()=>import(`./BPpUSQ2Y.js`).then(e=>e.kanban),__vite__mapDeps([18,2,3,17,5,7]),import.meta.url)],[`timeline`,()=>t(()=>import(`./BiHyHFlW.js`).then(e=>e.timeline),__vite__mapDeps([19,20,2,21,3,4]),import.meta.url)],[`journey`,()=>t(()=>import(`./0B47b24t.js`).then(e=>e.journey),__vite__mapDeps([22,20,2,21,3]),import.meta.url)],[`class`,()=>t(()=>import(`./C9Qdslk3.js`).then(e=>e.classDiagram),__vite__mapDeps([23,2,3,4,5,6,7,15,8,9,10]),import.meta.url)],[`quadrantChart`,()=>t(()=>import(`./BAVnZFPa.js`).then(e=>e.quadrantChart),__vite__mapDeps([24,2,3,25]),import.meta.url)],[`xychart`,()=>t(()=>import(`./DbtvzL7r.js`).then(e=>e.xychart),__vite__mapDeps([26,2,3,25]),import.meta.url)],[`state`,()=>t(()=>import(`./DAVMwq6b.js`).then(e=>e.state),__vite__mapDeps([27,2,3,4,5,6,7,10]),import.meta.url)],[`gantt`,()=>t(()=>import(`./1j--pDqt.js`).then(e=>e.gantt),__vite__mapDeps([28,2,3,7]),import.meta.url)],[`architecture`,()=>t(()=>import(`./MrW4zd8l.js`).then(e=>e.architecture),__vite__mapDeps([29,2,3,4,13]),import.meta.url)],[`requirement`,()=>t(()=>import(`./BLe29cGh.js`).then(e=>e.requirement),__vite__mapDeps([30,2,3,4,5,10]),import.meta.url)],[`sankey`,()=>t(()=>import(`./ZTEErEOd.js`).then(e=>e.sankey),__vite__mapDeps([31,2,3]),import.meta.url)],[`packet`,()=>t(()=>import(`./CZSmkKvQ.js`).then(e=>e.packet),__vite__mapDeps([32,2,3,13,33,34]),import.meta.url)],[`radar`,()=>t(()=>import(`./CSKABQj2.js`).then(e=>e.radar),__vite__mapDeps([35,2,3,13]),import.meta.url)],[`treemap`,()=>t(()=>import(`./Ch5Z7cbP.js`).then(e=>e.treemap),__vite__mapDeps([36,2,3,13,33]),import.meta.url)],[`info`,()=>t(()=>import(`./f7mFVWQS.js`).then(e=>e.info),__vite__mapDeps([37,2,13]),import.meta.url)],[`sequence`,()=>t(()=>import(`./CUNetmvQ.js`).then(e=>e.sequence),__vite__mapDeps([38,2,3,4,5,34]),import.meta.url)],[`gitGraph`,()=>t(()=>import(`./Ih6r6QR2.js`).then(e=>e.gitGraph),__vite__mapDeps([39,2,21,3,13]),import.meta.url)],[`c4`,()=>t(()=>import(`./hjSZ041d.js`).then(e=>e.c4),__vite__mapDeps([40,2,3,4,6,7,34]),import.meta.url)],[`block`,()=>t(()=>import(`./e7GRa0yc.js`).then(e=>e.block),__vite__mapDeps([41,2,3,4,5,6]),import.meta.url)],[`railroad`,()=>t(()=>import(`./CVqwkR8N.js`).then(e=>e.railroad),__vite__mapDeps([42,2,3,13]),import.meta.url)],[`agentflow`,()=>t(()=>import(`./DY0M2GMn.js`).then(e=>e.agentflow),__vite__mapDeps([43,2,3,4,6,7,8,9,10,11]),import.meta.url)],[`treeView`,()=>t(()=>import(`./Mwr1r9aw.js`).then(e=>e.treeView),__vite__mapDeps([44,2,3,13,34,45]),import.meta.url)],[`cynefin`,()=>t(()=>import(`./DWwu8a1P.js`).then(e=>e.cynefin),__vite__mapDeps([46,2,4,13]),import.meta.url)],[`wardley`,()=>t(()=>import(`./Bytzbt5l.js`).then(e=>e.wardley),__vite__mapDeps([47,2,3,4,13,45]),import.meta.url)],[`eventmodeling`,()=>t(()=>import(`./CUB9vnd0.js`).then(e=>e.eventmodeling),__vite__mapDeps([48,2,3,4,13,34,45]),import.meta.url)],[`usecase`,()=>t(()=>import(`./mhWk5y4o.js`).then(e=>e.usecase),__vite__mapDeps([49,2,3,4,5,9,10]),import.meta.url)],[`venn`,()=>t(()=>import(`./B7LnLClC.js`).then(e=>e.venn),__vite__mapDeps([50,2]),import.meta.url)],[`ishikawa`,()=>t(()=>import(`./Cpjqsnqr.js`).then(e=>e.ishikawa),__vite__mapDeps([51,2,3,4,34]),import.meta.url)],[`swimlane`,()=>t(()=>import(`./DJT73ARj.js`).then(e=>e.swimlane),__vite__mapDeps([52,2,4,1,3,5,6,7,8,9,10,11]),import.meta.url)]]),Bt=new Map;function Vt(e){if(e===null)return Promise.resolve(!1);if(wt(e))return Promise.resolve(!0);let t=Bt.get(e);if(t===void 0){let n=zt.get(e);if(n===void 0)return Promise.resolve(!1);t=n().then(e=>(Ct(e),!0),t=>{throw Bt.delete(e),t}),Bt.set(e,t)}return t}async function Ht(e,t={}){let n=null;try{n=$(e)}catch{}return await Vt(n),It(e,t)}async function Ut(e,t,n={}){let r=null;try{r=$(t)}catch{}return await Vt(r),Lt(e,t,n)}export{l as PeleError,i as _,h as a,o as b,u as c,O as d,$ as detectType,ot as enableZoom,M as f,he as forgetTextWidths,c as g,n as h,f as i,ee as l,Vt as load,R as m,Lt as mount,Ut as mountAsync,je as n,g as o,I as p,Ft as parse,D as r,Ct as register,wt as registered,It as render,Ht as renderAsync,_ as s,Pt as supports,Rt as t,me as u,r as v,s as x,a as y};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.C9NFEqJd.js","../chunks/AnnzTlE8.js","../chunks/BMijTvgG.js","../chunks/xihTtKlq.js","../chunks/Wv-ICQRy.js","../chunks/CA-rzUq8.js","../chunks/CRzLMJPS.js","../chunks/BxTFtVqu.js","../chunks/yxd8jSz3.js","../assets/drawn.D6lJzDcc.css","../chunks/CTuuQ66F.js","../chunks/CSTv2fL0.js","../assets/ground.hxi5N5fC.css","../chunks/BHORylQC.js","../chunks/TmxIGCN3.js","../assets/FolderField._A4_sc1Z.css","../assets/NoteList.C2GYAaLW.css","../assets/0.BEFtmzIh.css","../nodes/1.B5PJwWOG.js","../nodes/2.DRtC7zjs.js","../chunks/C7qBBO-i.js","../nodes/3.EEMisvUL.js","../nodes/4.DthmsFQC.js","../assets/4.LR47AJKA.css","../nodes/5.CEu0DlpQ.js","../nodes/6.DzvF0ZPt.js","../assets/6.C00vyVPo.css"])))=>i.map(i=>d[i]);
2
+ import{A as e,I as t,J as n,K as r,M as i,N as a,O as o,P as s,Q as c,S as l,U as u,V as d,Z as f,ct as p,et as m,i as h,it as g,l as _,lt as v,n as y,nt as b,pt as x,q as S,r as C,rt as w}from"../chunks/AnnzTlE8.js";import{t as T}from"../chunks/CRzLMJPS.js";import"../chunks/xihTtKlq.js";var E={},D=s(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),O=s(`<!> <!>`,1);function k(s,C){v(C,!0);let T=h(C,`components`,23,()=>[]),E=h(C,`data_0`,3,null),k=h(C,`data_1`,3,null);n(()=>C.stores.page.set(C.page)),S(()=>{C.stores,C.page,C.constructors,T(),C.form,E(),k(),C.stores.page.notify()});let A=w(!1),j=w(!1),M=w(null);y(()=>{let e=C.stores.page.subscribe(()=>{d(A)&&(b(j,!0),u().then(()=>{b(M,document.title||`untitled page`,!0)}))});return b(A,!0),e});let N=g(()=>C.constructors[1]);var P=O(),F=c(P),I=e=>{let t=g(()=>C.constructors[0]);var n=a(),r=c(n);l(r,()=>d(t),(e,t)=>{_(t(e,{get data(){return E()},get form(){return C.form},get params(){return C.page.params},children:(e,t)=>{var n=a(),r=c(n);l(r,()=>d(N),(e,t)=>{_(t(e,{get data(){return k()},get form(){return C.form},get params(){return C.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),i(e,n)},L=e=>{let t=g(()=>C.constructors[0]);var n=a(),r=c(n);l(r,()=>d(t),(e,t)=>{_(t(e,{get data(){return E()},get form(){return C.form},get params(){return C.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),i(e,n)};o(F,e=>{C.constructors[1]?e(I):e(L,-1)});var R=m(F,2),z=n=>{var a=D(),s=f(a),c=n=>{var a=t();r(()=>e(a,d(M))),i(n,a)};o(s,e=>{d(j)&&e(c)}),x(a),i(n,a)};o(R,e=>{d(A)&&e(z)}),i(s,P),p()}var A=C(k),j=[()=>T(()=>import(`../nodes/0.C9NFEqJd.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),()=>T(()=>import(`../nodes/1.B5PJwWOG.js`),__vite__mapDeps([18,1,3,10,2]),import.meta.url),()=>T(()=>import(`../nodes/2.DRtC7zjs.js`),__vite__mapDeps([19,1,2,3,4,20]),import.meta.url),()=>T(()=>import(`../nodes/3.EEMisvUL.js`),__vite__mapDeps([21,1,2,3,4,10,20]),import.meta.url),()=>T(()=>import(`../nodes/4.DthmsFQC.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,14,15,23]),import.meta.url),()=>T(()=>import(`../nodes/5.CEu0DlpQ.js`),__vite__mapDeps([24,1,3,13,2,4,14,15,16,20]),import.meta.url),()=>T(()=>import(`../nodes/6.DzvF0ZPt.js`),__vite__mapDeps([25,1,3,11,12,20,26]),import.meta.url)],M=[],N={"/":[2],"/atlas":[3],"/notes":[5],"/n/[...id]":[4],"/parts":[6]},P={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},F=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.decode])),I=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.encode])),L=!0,R=(e,t)=>F[e](t),z=()=>T(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{R as decode,F as decoders,N as dictionary,I as encoders,z as get_error_template,L as hash,P as hooks,E as matchers,j as nodes,A as root,M as server_loads};
@@ -0,0 +1 @@
1
+ export{a as load_css,n as start}from"../chunks/BMijTvgG.js";