@chrome-acp/proxy-server 1.0.14 → 1.0.16
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.
- package/dist/mcp/types.d.ts +29 -32
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +26 -4
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/{architectureDiagram-VXUJARFQ-wjPFzNar.js → architectureDiagram-VXUJARFQ-ERfmZBZO.js} +2 -2
- package/public/assets/{architectureDiagram-VXUJARFQ-wjPFzNar.js.map → architectureDiagram-VXUJARFQ-ERfmZBZO.js.map} +1 -1
- package/public/assets/{blockDiagram-VD42YOAC-Bow3HM3P.js → blockDiagram-VD42YOAC-Do2HjB0Z.js} +2 -2
- package/public/assets/{blockDiagram-VD42YOAC-Bow3HM3P.js.map → blockDiagram-VD42YOAC-Do2HjB0Z.js.map} +1 -1
- package/public/assets/{c4Diagram-YG6GDRKO-SQHtWv3g.js → c4Diagram-YG6GDRKO-DJnxx7fH.js} +2 -2
- package/public/assets/{c4Diagram-YG6GDRKO-SQHtWv3g.js.map → c4Diagram-YG6GDRKO-DJnxx7fH.js.map} +1 -1
- package/public/assets/channel-ByUlP8on.js +2 -0
- package/public/assets/{channel-pKLLLs1E.js.map → channel-ByUlP8on.js.map} +1 -1
- package/public/assets/{chunk-ABZYJK2D-x9qEUFTA.js → chunk-ABZYJK2D-4V3xBx2D.js} +3 -3
- package/public/assets/{chunk-ABZYJK2D-x9qEUFTA.js.map → chunk-ABZYJK2D-4V3xBx2D.js.map} +1 -1
- package/public/assets/{chunk-ATLVNIR6-D0SaqbxC.js → chunk-ATLVNIR6-DCub4004.js} +2 -2
- package/public/assets/{chunk-ATLVNIR6-D0SaqbxC.js.map → chunk-ATLVNIR6-DCub4004.js.map} +1 -1
- package/public/assets/{chunk-B4BG7PRW-CSi9IqPy.js → chunk-B4BG7PRW-DH_dyws5.js} +2 -2
- package/public/assets/{chunk-B4BG7PRW-CSi9IqPy.js.map → chunk-B4BG7PRW-DH_dyws5.js.map} +1 -1
- package/public/assets/{chunk-DI55MBZ5-CjGu8W9o.js → chunk-DI55MBZ5-BdKNset0.js} +2 -2
- package/public/assets/{chunk-DI55MBZ5-CjGu8W9o.js.map → chunk-DI55MBZ5-BdKNset0.js.map} +1 -1
- package/public/assets/{chunk-EXTU4WIE-FY5Pwz_y.js → chunk-EXTU4WIE-BhjM7T9E.js} +2 -2
- package/public/assets/{chunk-EXTU4WIE-FY5Pwz_y.js.map → chunk-EXTU4WIE-BhjM7T9E.js.map} +1 -1
- package/public/assets/{chunk-JA3XYJ7Z-BkoNu2jJ.js → chunk-JA3XYJ7Z-DFEpfAPm.js} +2 -2
- package/public/assets/{chunk-JA3XYJ7Z-BkoNu2jJ.js.map → chunk-JA3XYJ7Z-DFEpfAPm.js.map} +1 -1
- package/public/assets/{chunk-JZLCHNYA-DC3nqPAp.js → chunk-JZLCHNYA--0HCyKSB.js} +2 -2
- package/public/assets/{chunk-JZLCHNYA-DC3nqPAp.js.map → chunk-JZLCHNYA--0HCyKSB.js.map} +1 -1
- package/public/assets/{chunk-N4CR4FBY-B6bbaafi.js → chunk-N4CR4FBY-BbZEJGzH.js} +3 -3
- package/public/assets/{chunk-N4CR4FBY-B6bbaafi.js.map → chunk-N4CR4FBY-BbZEJGzH.js.map} +1 -1
- package/public/assets/{chunk-QN33PNHL-DKVBKRLD.js → chunk-QN33PNHL-BUlRs8Gu.js} +2 -2
- package/public/assets/{chunk-QN33PNHL-DKVBKRLD.js.map → chunk-QN33PNHL-BUlRs8Gu.js.map} +1 -1
- package/public/assets/{chunk-QXUST7PY-CV4pkmTu.js → chunk-QXUST7PY-t91kbxTi.js} +2 -2
- package/public/assets/{chunk-QXUST7PY-CV4pkmTu.js.map → chunk-QXUST7PY-t91kbxTi.js.map} +1 -1
- package/public/assets/{chunk-S3R3BYOJ-6YeBT-eZ.js → chunk-S3R3BYOJ-DKNuA38_.js} +2 -2
- package/public/assets/{chunk-S3R3BYOJ-6YeBT-eZ.js.map → chunk-S3R3BYOJ-DKNuA38_.js.map} +1 -1
- package/public/assets/{chunk-TZMSLE5B-CZ4oRZWD.js → chunk-TZMSLE5B-ZI5Is7DP.js} +2 -2
- package/public/assets/{chunk-TZMSLE5B-CZ4oRZWD.js.map → chunk-TZMSLE5B-ZI5Is7DP.js.map} +1 -1
- package/public/assets/classDiagram-2ON5EDUG-DvJh-abz.js +2 -0
- package/public/assets/{classDiagram-2ON5EDUG-D8v77MD7.js.map → classDiagram-2ON5EDUG-DvJh-abz.js.map} +1 -1
- package/public/assets/classDiagram-v2-WZHVMYZB-DPnIn5s9.js +2 -0
- package/public/assets/{classDiagram-v2-WZHVMYZB-DrGCW_EL.js.map → classDiagram-v2-WZHVMYZB-DPnIn5s9.js.map} +1 -1
- package/public/assets/clone--vBohEtN.js +2 -0
- package/public/assets/{clone-cscKn85s.js.map → clone--vBohEtN.js.map} +1 -1
- package/public/assets/{code-block-IT6T5CEO-Cir7lBBX.js → code-block-IT6T5CEO-nC1YczKC.js} +2 -2
- package/public/assets/{code-block-IT6T5CEO-Cir7lBBX.js.map → code-block-IT6T5CEO-nC1YczKC.js.map} +1 -1
- package/public/assets/{dagre-6UL2VRFP-CW0qvz_s.js → dagre-6UL2VRFP-CUvrKiYW.js} +2 -2
- package/public/assets/{dagre-6UL2VRFP-CW0qvz_s.js.map → dagre-6UL2VRFP-CUvrKiYW.js.map} +1 -1
- package/public/assets/{dagre-Cl3mneui.js → dagre-yyBB715u.js} +2 -2
- package/public/assets/{dagre-Cl3mneui.js.map → dagre-yyBB715u.js.map} +1 -1
- package/public/assets/{diagram-PSM6KHXK-CsGot5qe.js → diagram-PSM6KHXK-D1PbEKpY.js} +2 -2
- package/public/assets/{diagram-PSM6KHXK-CsGot5qe.js.map → diagram-PSM6KHXK-D1PbEKpY.js.map} +1 -1
- package/public/assets/{diagram-QEK2KX5R-Dk_Ips1R.js → diagram-QEK2KX5R-43BWK26_.js} +2 -2
- package/public/assets/{diagram-QEK2KX5R-Dk_Ips1R.js.map → diagram-QEK2KX5R-43BWK26_.js.map} +1 -1
- package/public/assets/{diagram-S2PKOQOG-DVCkBYgt.js → diagram-S2PKOQOG-BqCGm98C.js} +2 -2
- package/public/assets/{diagram-S2PKOQOG-DVCkBYgt.js.map → diagram-S2PKOQOG-BqCGm98C.js.map} +1 -1
- package/public/assets/{erDiagram-Q2GNP2WA-CDMoNqWr.js → erDiagram-Q2GNP2WA-DT8X0Bkj.js} +2 -2
- package/public/assets/{erDiagram-Q2GNP2WA-CDMoNqWr.js.map → erDiagram-Q2GNP2WA-DT8X0Bkj.js.map} +1 -1
- package/public/assets/{flowDiagram-NV44I4VS-CRYIfhzR.js → flowDiagram-NV44I4VS-t9Tw5aTg.js} +2 -2
- package/public/assets/{flowDiagram-NV44I4VS-CRYIfhzR.js.map → flowDiagram-NV44I4VS-t9Tw5aTg.js.map} +1 -1
- package/public/assets/{ganttDiagram-JELNMOA3-BbkuHdg9.js → ganttDiagram-JELNMOA3-BBKujC33.js} +2 -2
- package/public/assets/{ganttDiagram-JELNMOA3-BbkuHdg9.js.map → ganttDiagram-JELNMOA3-BBKujC33.js.map} +1 -1
- package/public/assets/{gitGraphDiagram-NY62KEGX-o3Bg7nmx.js → gitGraphDiagram-NY62KEGX-9rrEkUeV.js} +2 -2
- package/public/assets/{gitGraphDiagram-NY62KEGX-o3Bg7nmx.js.map → gitGraphDiagram-NY62KEGX-9rrEkUeV.js.map} +1 -1
- package/public/assets/{graphlib-CJzlAqCt.js → graphlib-CDA3kMcX.js} +2 -2
- package/public/assets/{graphlib-CJzlAqCt.js.map → graphlib-CDA3kMcX.js.map} +1 -1
- package/public/assets/{infoDiagram-WHAUD3N6-BIutCfum.js → infoDiagram-WHAUD3N6-BGL4Sxno.js} +2 -2
- package/public/assets/{infoDiagram-WHAUD3N6-BIutCfum.js.map → infoDiagram-WHAUD3N6-BGL4Sxno.js.map} +1 -1
- package/public/assets/{journeyDiagram-XKPGCS4Q-TLxotP0p.js → journeyDiagram-XKPGCS4Q-CHcHWwKh.js} +2 -2
- package/public/assets/{journeyDiagram-XKPGCS4Q-TLxotP0p.js.map → journeyDiagram-XKPGCS4Q-CHcHWwKh.js.map} +1 -1
- package/public/assets/{kanban-definition-3W4ZIXB7-B_QHM6Sw.js → kanban-definition-3W4ZIXB7-BMr9yQtH.js} +2 -2
- package/public/assets/{kanban-definition-3W4ZIXB7-B_QHM6Sw.js.map → kanban-definition-3W4ZIXB7-BMr9yQtH.js.map} +1 -1
- package/public/assets/katex-BXZ6-Hmb.js +1 -0
- package/public/assets/{line-B9W3o98k.js → line-BxFlNVl2.js} +2 -2
- package/public/assets/{line-B9W3o98k.js.map → line-BxFlNVl2.js.map} +1 -1
- package/public/assets/main-rtUrro6N.js +379 -0
- package/public/assets/main-rtUrro6N.js.map +1 -0
- package/public/assets/mermaid-VLURNSYL-Dt6lsMZf.js +1 -0
- package/public/assets/{mermaid.core-CpgIepIq.js → mermaid.core-CHOGuA8G.js} +4 -4
- package/public/assets/{mermaid.core-CpgIepIq.js.map → mermaid.core-CHOGuA8G.js.map} +1 -1
- package/public/assets/{mindmap-definition-VGOIOE7T-BJ758uf4.js → mindmap-definition-VGOIOE7T-CQ3jo7T_.js} +2 -2
- package/public/assets/{mindmap-definition-VGOIOE7T-BJ758uf4.js.map → mindmap-definition-VGOIOE7T-CQ3jo7T_.js.map} +1 -1
- package/public/assets/{pieDiagram-ADFJNKIX-Dd8dtgHZ.js → pieDiagram-ADFJNKIX-BskQ5vji.js} +2 -2
- package/public/assets/{pieDiagram-ADFJNKIX-Dd8dtgHZ.js.map → pieDiagram-ADFJNKIX-BskQ5vji.js.map} +1 -1
- package/public/assets/{quadrantDiagram-AYHSOK5B-DelknGes.js → quadrantDiagram-AYHSOK5B-Bim0kCz4.js} +2 -2
- package/public/assets/{quadrantDiagram-AYHSOK5B-DelknGes.js.map → quadrantDiagram-AYHSOK5B-Bim0kCz4.js.map} +1 -1
- package/public/assets/radix-CWcw-_TU.js +2 -0
- package/public/assets/radix-CWcw-_TU.js.map +1 -0
- package/public/assets/react-DC6mq9sj.js +10 -0
- package/public/assets/react-DC6mq9sj.js.map +1 -0
- package/public/assets/{requirementDiagram-UZGBJVZJ-CGCbxKd6.js → requirementDiagram-UZGBJVZJ-BThYhHgo.js} +2 -2
- package/public/assets/{requirementDiagram-UZGBJVZJ-CGCbxKd6.js.map → requirementDiagram-UZGBJVZJ-BThYhHgo.js.map} +1 -1
- package/public/assets/{sankeyDiagram-TZEHDZUN-UOBpib_k.js → sankeyDiagram-TZEHDZUN-Cu7jxbPR.js} +2 -2
- package/public/assets/{sankeyDiagram-TZEHDZUN-UOBpib_k.js.map → sankeyDiagram-TZEHDZUN-Cu7jxbPR.js.map} +1 -1
- package/public/assets/{sequenceDiagram-WL72ISMW-BuIva0Lb.js → sequenceDiagram-WL72ISMW-CYpkyiQa.js} +2 -2
- package/public/assets/{sequenceDiagram-WL72ISMW-BuIva0Lb.js.map → sequenceDiagram-WL72ISMW-CYpkyiQa.js.map} +1 -1
- package/public/assets/{stateDiagram-FKZM4ZOC-DMM22UFw.js → stateDiagram-FKZM4ZOC-CpduAaAE.js} +2 -2
- package/public/assets/{stateDiagram-FKZM4ZOC-DMM22UFw.js.map → stateDiagram-FKZM4ZOC-CpduAaAE.js.map} +1 -1
- package/public/assets/stateDiagram-v2-4FDKWEC3-BbGisRuk.js +2 -0
- package/public/assets/{stateDiagram-v2-4FDKWEC3-DoQv2RVT.js.map → stateDiagram-v2-4FDKWEC3-BbGisRuk.js.map} +1 -1
- package/public/assets/{timeline-definition-IT6M3QCI-BuulvLu6.js → timeline-definition-IT6M3QCI-zPIkl5WF.js} +2 -2
- package/public/assets/{timeline-definition-IT6M3QCI-BuulvLu6.js.map → timeline-definition-IT6M3QCI-zPIkl5WF.js.map} +1 -1
- package/public/assets/{xychartDiagram-PRI3JC2R-BNUCwm4v.js → xychartDiagram-PRI3JC2R-BqEbqHoy.js} +2 -2
- package/public/assets/{xychartDiagram-PRI3JC2R-BNUCwm4v.js.map → xychartDiagram-PRI3JC2R-BqEbqHoy.js.map} +1 -1
- package/public/index.html +3 -3
- package/public/sw.js +2 -1
- package/public/assets/channel-pKLLLs1E.js +0 -2
- package/public/assets/classDiagram-2ON5EDUG-D8v77MD7.js +0 -2
- package/public/assets/classDiagram-v2-WZHVMYZB-DrGCW_EL.js +0 -2
- package/public/assets/clone-cscKn85s.js +0 -2
- package/public/assets/katex-Bnbp0kKK.js +0 -1
- package/public/assets/main-BxrWPNWG.js +0 -379
- package/public/assets/main-BxrWPNWG.js.map +0 -1
- package/public/assets/mermaid-VLURNSYL-Dwtbd3VO.js +0 -1
- package/public/assets/radix-CyrXeX7S.js +0 -2
- package/public/assets/radix-CyrXeX7S.js.map +0 -1
- package/public/assets/react-BU7bKLEa.js +0 -10
- package/public/assets/react-BU7bKLEa.js.map +0 -1
- package/public/assets/stateDiagram-v2-4FDKWEC3-DoQv2RVT.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as e,h as t,p as n}from"./src-CK1-XQNk.js";import{A as r,I as i,L as a,N as o,O as s,b as c,d as l,h as u,s as d,y as f}from"./chunk-ABZYJK2D-x9qEUFTA.js";import{a as p,p as m,r as h,u as g}from"./chunk-S3R3BYOJ-6YeBT-eZ.js";import{n as _,r as v}from"./chunk-JA3XYJ7Z-BkoNu2jJ.js";import{t as y}from"./chunk-CVBHYZKI-D5XSWNoQ.js";import{a as b,i as x,r as S,t as C}from"./chunk-ATLVNIR6-D0SaqbxC.js";function w(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function T(e,t){return e[0]===t[0]&&e[1]===t[1]}function E(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)w(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];T(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)w(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),w(r,t,n)})(c,s,-i)}return c}function D(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),E(e,r,n,i||1)}var O=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=D(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function k(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var A=class extends O{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=D(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)k([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},j=class extends O{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},M=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=D(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=k(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},N=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=D(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=k(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},P=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=D(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=k(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},F={},I=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},ee=0,te=1,ne=2,re={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function ie(e,t){return e.type===t}function ae(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:ee,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:te,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:ne,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!ie(a,ne);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return ae(`M0,0`+e);i++,o=re[a.text],r=a.text}else ie(a,te)?o=re[r]:(i++,o=re[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!ie(t,te))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof re[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function L(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function oe(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(ce(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function se(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function ce(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=se(e,t,-u),[n,r]=se(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=ce(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],D=[n+C*x,r-w*b],O=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,D,O].concat(f);{f=[E,D,O].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=se(f[t][0],f[t][1],u),r=se(f[t+1][0],f[t+1][1],u),i=se(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var le={randOffset:function(e,t){return R(e,t)},randOffsetWithRange:function(e,t,n){return Se(e,t,n)},ellipse:function(e,t,n,r,i){return he(e,t,i,me(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return z(e,t,n,r,i,!0)}};function ue(e,t,n,r,i){return{type:`path`,ops:z(e,t,n,r,i)}}function de(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...z(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...z(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?ue(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function fe(e,t,n,r,i){return function(e,t){return de(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function pe(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=we(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:we(n[0],1.5*(1+.22*t.roughness),be(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=we(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:we(a,1.5*(1+.22*t.roughness),be(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function me(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=R(o*c,n),s+=R(s*c,n),{increment:a,rx:o,ry:s}}function he(e,t,n,r){let[i,a]=Ee(r.increment,e,t,r.rx,r.ry,1,r.increment*Se(.1,Se(.4,1,n),n),n),o=Te(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Ee(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Te(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function ge(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=R(.01*d,c),f+=R(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=De(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=De(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...z(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...z(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function _e(e,t){let n=oe(L(ae(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...z(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Oe(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...z(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function ve(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+R(e,t),r[0][1]+R(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+R(e,t),r[a][1]+R(e,t)]})}}return{type:`fillPath`,ops:n}}function ye(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!F[n])switch(n){case`zigzag`:F[n]||(F[n]=new A(t));break;case`cross-hatch`:F[n]||(F[n]=new j(t));break;case`dots`:F[n]||(F[n]=new M(t));break;case`dashed`:F[n]||(F[n]=new N(t));break;case`zigzag-line`:F[n]||(F[n]=new P(t));break;default:n=`hachure`,F[n]||(F[n]=new O(t))}return F[n]}(t,le).fillPolygons(e,t)}function be(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function xe(e){return e.randomizer||=new I(e.seed||0),e.randomizer.next()}function Se(e,t,n,r=1){return n.roughness*r*(xe(n)*(t-e)+e)}function R(e,t,n=1){return Se(-e,e,t,n)}function z(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Ce(e,t,n,r,i,!0,!1);if(o)return s;let c=Ce(e,t,n,r,i,!0,!0);return s.concat(c)}function Ce(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*xe(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=R(p,i,l),m=R(m,i,l);let h=[],g=()=>R(d,i,l),_=()=>R(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:R(u,i,l)),t+(v?0:R(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function we(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+R(t,n),e[0][1]+R(t,n)]),r.push([e[0][0]+R(t,n),e[0][1]+R(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+R(t,n),e[i][1]+R(t,n)]),i===e.length-1&&r.push([e[i][0]+R(t,n),e[i][1]+R(t,n)]);return Te(r,null,n)}function Te(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+R(e,n),t[1]+R(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Ce(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Ee(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=R(.5,s)-Math.PI/2;l.push([R(a,s)+t+.9*r*Math.cos(u-e),R(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[R(a,s)+t+r*Math.cos(o),R(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([R(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),R(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([R(a,s)+t+.98*r*Math.cos(u+o),R(a,s)+n+.98*i*Math.sin(u+o)]),l.push([R(a,s)+t+.9*r*Math.cos(u+.5*o),R(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function De(e,t,n,r,i,a,o,s,c){let l=a+R(.1,c),u=[];u.push([R(s,c)+t+.9*r*Math.cos(l-e),R(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([R(s,c)+t+r*Math.cos(a),R(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Te(u,null,c)}function Oe(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:R(l[0],s)),o[1]+(f?0:R(l[0],s))]}),u=f?[i,a]:[i+R(l[p],s),a+R(l[p],s)],c.push({op:`bcurveTo`,data:[e+R(l[p],s),t+R(l[p],s),n+R(l[p],s),r+R(l[p],s),u[0],u[1]]});return c}function ke(e){return[...e]}function Ae(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(ke(e[0]),ke(e[1]),ke(e[2]),ke(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(ke(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function je(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Me(e,t,n){let r=je(t,n);if(r===0)return je(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),je(e,Ne(t,n,i))}function Ne(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Pe(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(je(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Ne(a,o,r),u=Ne(o,s,r),d=Ne(s,c,r),f=Ne(l,u,r),p=Ne(u,d,r),m=Ne(f,p,r);Pe([a,l,f,m],0,n,i),Pe([m,p,d,c],0,n,i)}var a,o;return i}function Fe(e,t){return Ie(e,0,e.length,t)}function Ie(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Me(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Ie(e,t,l+1,r,a),Ie(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Le(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Pe(e,3*n,t,r);return n&&n>0?Ie(r,0,r.length,n):r}var B=`none`,Re=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[ue(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=fe(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(ve([i],a)):o.push(ye([i],a))}return a.stroke!==B&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=me(n,r,a),c=he(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=he(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(ye([c.estimatedPoints],a));return a.stroke!==B&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[de(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=ge(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=ge(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=R(.01*l,o),u+=R(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),ye([m],o)}(e,t,n,r,i,a,c));return c.stroke!==B&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=pe(e,n);if(n.fill&&n.fill!==B)if(n.fillStyle===`solid`){let t=pe(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Le(Ae([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Le(Ae(r),10,(1+n.roughness)/2))}t.length&&r.push(ye([t],n))}return n.stroke!==B&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=de(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(ve([e],n)):r.push(ye([e],n))),n.stroke!==B&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==B,a=n.stroke!==B,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=oe(L(ae(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Le(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=Fe(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=_e(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=_e(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(ve(s,n));else r.push(ye(s,n));return a&&(o?s.forEach((e=>{r.push(de(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:B};break;case`fillPath`:t={d:this.opsToPath(e),stroke:B,strokeWidth:0,fill:n.fill||B};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||B,strokeWidth:n,fill:B}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},ze=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Re(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},Be=`http://www.w3.org/2000/svg`,Ve=class{constructor(e,t){this.svg=e,this.gen=new Re(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(Be,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(Be,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(Be,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(Be,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},V={canvas:(e,t)=>new ze(e,t),svg:(e,t)=>new Ve(e,t),generator:e=>new Re(e),newSeed:()=>Re.newSeed()},H=t(async(e,r,a)=>{let o,s=r.useHtmlLabels||u(c()?.htmlLabels);o=a||`node default`;let d=e.insert(`g`).attr(`class`,o).attr(`id`,r.domId||r.id),f=d.insert(`g`).attr(`class`,`label`).attr(`style`,g(r.labelStyle)),h;h=r.label===void 0?``:typeof r.label==`string`?r.label:r.label[0];let v=await _(f,i(p(h),c()),{useHtmlLabels:s,width:r.width||c().flowchart?.wrappingWidth,cssClasses:`markdown-node-label`,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),y=v.getBBox(),b=(r?.padding??0)/2;if(s){let e=v.children[0],r=n(v),i=e.getElementsByTagName(`img`);if(i){let e=h.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...i].map(n=>new Promise(r=>{function i(){if(n.style.display=`flex`,n.style.flexDirection=`column`,e){let[e=l.fontSize]=m(c().fontSize?c().fontSize:window.getComputedStyle(document.body).fontSize),t=e*5+`px`;n.style.minWidth=t,n.style.maxWidth=t}else n.style.width=`100%`;r(n)}t(i,`setupImage`),setTimeout(()=>{n.complete&&i()}),n.addEventListener(`error`,i),n.addEventListener(`load`,i)})))}y=e.getBoundingClientRect(),r.attr(`width`,y.width),r.attr(`height`,y.height)}return s?f.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`):f.attr(`transform`,`translate(0, `+-y.height/2+`)`),r.centerLabel&&f.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`),f.insert(`rect`,`:first-child`),{shapeSvg:d,bbox:y,halfPadding:b,label:f}},`labelHelper`),He=t(async(e,t,r)=>{let a=r.useHtmlLabels||u(c()?.flowchart?.htmlLabels),o=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await _(o,i(p(t),c()),{useHtmlLabels:a,width:r.width||c()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),l=s.getBBox(),d=r.padding/2;if(u(c()?.flowchart?.htmlLabels)){let e=s.children[0],t=n(s);l=e.getBoundingClientRect(),t.attr(`width`,l.width),t.attr(`height`,l.height)}return a?o.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):o.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&o.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:d,label:o}},`insertLabel`),U=t((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),W=t((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function G(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}t(G,`createPathFromPoints`);function K(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}t(K,`generateFullSineWavePoints`);function Ue(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(Ue,`generateCirclePoints`);var We=t((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function Ge(e,t){t&&e.attr(`style`,t)}t(Ge,`applyStyle`);async function Ke(e){let t=n(document.createElementNS(`http://www.w3.org/2000/svg`,`foreignObject`)),r=t.append(`xhtml:div`),a=c(),l=e.label;e.label&&s(e.label)&&(l=await o(e.label.replace(d.lineBreakRegex,`
|
|
1
|
+
import{g as e,h as t,p as n}from"./src-CK1-XQNk.js";import{A as r,I as i,L as a,N as o,O as s,b as c,d as l,h as u,s as d,y as f}from"./chunk-ABZYJK2D-4V3xBx2D.js";import{a as p,p as m,r as h,u as g}from"./chunk-S3R3BYOJ-DKNuA38_.js";import{n as _,r as v}from"./chunk-JA3XYJ7Z-DFEpfAPm.js";import{t as y}from"./chunk-CVBHYZKI-D5XSWNoQ.js";import{a as b,i as x,r as S,t as C}from"./chunk-ATLVNIR6-DCub4004.js";function w(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function T(e,t){return e[0]===t[0]&&e[1]===t[1]}function E(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)w(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];T(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)w(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),w(r,t,n)})(c,s,-i)}return c}function D(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),E(e,r,n,i||1)}var O=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=D(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function k(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var A=class extends O{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=D(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)k([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},j=class extends O{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},M=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=D(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=k(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},N=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=D(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=k(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},P=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=D(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=k(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},F={},I=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},ee=0,te=1,ne=2,re={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function ie(e,t){return e.type===t}function ae(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:ee,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:te,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:ne,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!ie(a,ne);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return ae(`M0,0`+e);i++,o=re[a.text],r=a.text}else ie(a,te)?o=re[r]:(i++,o=re[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!ie(t,te))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof re[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function L(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function oe(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(ce(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function se(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function ce(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=se(e,t,-u),[n,r]=se(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=ce(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],D=[n+C*x,r-w*b],O=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,D,O].concat(f);{f=[E,D,O].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=se(f[t][0],f[t][1],u),r=se(f[t+1][0],f[t+1][1],u),i=se(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var le={randOffset:function(e,t){return R(e,t)},randOffsetWithRange:function(e,t,n){return Se(e,t,n)},ellipse:function(e,t,n,r,i){return he(e,t,i,me(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return z(e,t,n,r,i,!0)}};function ue(e,t,n,r,i){return{type:`path`,ops:z(e,t,n,r,i)}}function de(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...z(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...z(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?ue(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function fe(e,t,n,r,i){return function(e,t){return de(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function pe(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=we(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:we(n[0],1.5*(1+.22*t.roughness),be(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=we(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:we(a,1.5*(1+.22*t.roughness),be(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function me(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=R(o*c,n),s+=R(s*c,n),{increment:a,rx:o,ry:s}}function he(e,t,n,r){let[i,a]=Ee(r.increment,e,t,r.rx,r.ry,1,r.increment*Se(.1,Se(.4,1,n),n),n),o=Te(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Ee(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Te(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function ge(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=R(.01*d,c),f+=R(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=De(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=De(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...z(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...z(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function _e(e,t){let n=oe(L(ae(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...z(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Oe(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...z(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function ve(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+R(e,t),r[0][1]+R(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+R(e,t),r[a][1]+R(e,t)]})}}return{type:`fillPath`,ops:n}}function ye(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!F[n])switch(n){case`zigzag`:F[n]||(F[n]=new A(t));break;case`cross-hatch`:F[n]||(F[n]=new j(t));break;case`dots`:F[n]||(F[n]=new M(t));break;case`dashed`:F[n]||(F[n]=new N(t));break;case`zigzag-line`:F[n]||(F[n]=new P(t));break;default:n=`hachure`,F[n]||(F[n]=new O(t))}return F[n]}(t,le).fillPolygons(e,t)}function be(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function xe(e){return e.randomizer||=new I(e.seed||0),e.randomizer.next()}function Se(e,t,n,r=1){return n.roughness*r*(xe(n)*(t-e)+e)}function R(e,t,n=1){return Se(-e,e,t,n)}function z(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Ce(e,t,n,r,i,!0,!1);if(o)return s;let c=Ce(e,t,n,r,i,!0,!0);return s.concat(c)}function Ce(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*xe(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=R(p,i,l),m=R(m,i,l);let h=[],g=()=>R(d,i,l),_=()=>R(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:R(u,i,l)),t+(v?0:R(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function we(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+R(t,n),e[0][1]+R(t,n)]),r.push([e[0][0]+R(t,n),e[0][1]+R(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+R(t,n),e[i][1]+R(t,n)]),i===e.length-1&&r.push([e[i][0]+R(t,n),e[i][1]+R(t,n)]);return Te(r,null,n)}function Te(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+R(e,n),t[1]+R(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Ce(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Ee(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=R(.5,s)-Math.PI/2;l.push([R(a,s)+t+.9*r*Math.cos(u-e),R(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[R(a,s)+t+r*Math.cos(o),R(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([R(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),R(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([R(a,s)+t+.98*r*Math.cos(u+o),R(a,s)+n+.98*i*Math.sin(u+o)]),l.push([R(a,s)+t+.9*r*Math.cos(u+.5*o),R(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function De(e,t,n,r,i,a,o,s,c){let l=a+R(.1,c),u=[];u.push([R(s,c)+t+.9*r*Math.cos(l-e),R(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([R(s,c)+t+r*Math.cos(a),R(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Te(u,null,c)}function Oe(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:R(l[0],s)),o[1]+(f?0:R(l[0],s))]}),u=f?[i,a]:[i+R(l[p],s),a+R(l[p],s)],c.push({op:`bcurveTo`,data:[e+R(l[p],s),t+R(l[p],s),n+R(l[p],s),r+R(l[p],s),u[0],u[1]]});return c}function ke(e){return[...e]}function Ae(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(ke(e[0]),ke(e[1]),ke(e[2]),ke(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(ke(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function je(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Me(e,t,n){let r=je(t,n);if(r===0)return je(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),je(e,Ne(t,n,i))}function Ne(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Pe(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(je(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Ne(a,o,r),u=Ne(o,s,r),d=Ne(s,c,r),f=Ne(l,u,r),p=Ne(u,d,r),m=Ne(f,p,r);Pe([a,l,f,m],0,n,i),Pe([m,p,d,c],0,n,i)}var a,o;return i}function Fe(e,t){return Ie(e,0,e.length,t)}function Ie(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Me(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Ie(e,t,l+1,r,a),Ie(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Le(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Pe(e,3*n,t,r);return n&&n>0?Ie(r,0,r.length,n):r}var B=`none`,Re=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[ue(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=fe(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(ve([i],a)):o.push(ye([i],a))}return a.stroke!==B&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=me(n,r,a),c=he(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=he(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(ye([c.estimatedPoints],a));return a.stroke!==B&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[de(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=ge(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=ge(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=R(.01*l,o),u+=R(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),ye([m],o)}(e,t,n,r,i,a,c));return c.stroke!==B&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=pe(e,n);if(n.fill&&n.fill!==B)if(n.fillStyle===`solid`){let t=pe(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Le(Ae([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Le(Ae(r),10,(1+n.roughness)/2))}t.length&&r.push(ye([t],n))}return n.stroke!==B&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=de(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(ve([e],n)):r.push(ye([e],n))),n.stroke!==B&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==B,a=n.stroke!==B,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=oe(L(ae(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Le(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=Fe(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=_e(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=_e(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(ve(s,n));else r.push(ye(s,n));return a&&(o?s.forEach((e=>{r.push(de(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:B};break;case`fillPath`:t={d:this.opsToPath(e),stroke:B,strokeWidth:0,fill:n.fill||B};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||B,strokeWidth:n,fill:B}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},ze=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Re(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},Be=`http://www.w3.org/2000/svg`,Ve=class{constructor(e,t){this.svg=e,this.gen=new Re(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(Be,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(Be,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(Be,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(Be,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},V={canvas:(e,t)=>new ze(e,t),svg:(e,t)=>new Ve(e,t),generator:e=>new Re(e),newSeed:()=>Re.newSeed()},H=t(async(e,r,a)=>{let o,s=r.useHtmlLabels||u(c()?.htmlLabels);o=a||`node default`;let d=e.insert(`g`).attr(`class`,o).attr(`id`,r.domId||r.id),f=d.insert(`g`).attr(`class`,`label`).attr(`style`,g(r.labelStyle)),h;h=r.label===void 0?``:typeof r.label==`string`?r.label:r.label[0];let v=await _(f,i(p(h),c()),{useHtmlLabels:s,width:r.width||c().flowchart?.wrappingWidth,cssClasses:`markdown-node-label`,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),y=v.getBBox(),b=(r?.padding??0)/2;if(s){let e=v.children[0],r=n(v),i=e.getElementsByTagName(`img`);if(i){let e=h.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...i].map(n=>new Promise(r=>{function i(){if(n.style.display=`flex`,n.style.flexDirection=`column`,e){let[e=l.fontSize]=m(c().fontSize?c().fontSize:window.getComputedStyle(document.body).fontSize),t=e*5+`px`;n.style.minWidth=t,n.style.maxWidth=t}else n.style.width=`100%`;r(n)}t(i,`setupImage`),setTimeout(()=>{n.complete&&i()}),n.addEventListener(`error`,i),n.addEventListener(`load`,i)})))}y=e.getBoundingClientRect(),r.attr(`width`,y.width),r.attr(`height`,y.height)}return s?f.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`):f.attr(`transform`,`translate(0, `+-y.height/2+`)`),r.centerLabel&&f.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`),f.insert(`rect`,`:first-child`),{shapeSvg:d,bbox:y,halfPadding:b,label:f}},`labelHelper`),He=t(async(e,t,r)=>{let a=r.useHtmlLabels||u(c()?.flowchart?.htmlLabels),o=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await _(o,i(p(t),c()),{useHtmlLabels:a,width:r.width||c()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),l=s.getBBox(),d=r.padding/2;if(u(c()?.flowchart?.htmlLabels)){let e=s.children[0],t=n(s);l=e.getBoundingClientRect(),t.attr(`width`,l.width),t.attr(`height`,l.height)}return a?o.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):o.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&o.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:d,label:o}},`insertLabel`),U=t((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),W=t((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function G(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}t(G,`createPathFromPoints`);function K(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}t(K,`generateFullSineWavePoints`);function Ue(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(Ue,`generateCirclePoints`);var We=t((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function Ge(e,t){t&&e.attr(`style`,t)}t(Ge,`applyStyle`);async function Ke(e){let t=n(document.createElementNS(`http://www.w3.org/2000/svg`,`foreignObject`)),r=t.append(`xhtml:div`),a=c(),l=e.label;e.label&&s(e.label)&&(l=await o(e.label.replace(d.lineBreakRegex,`
|
|
2
2
|
`),a));let u=`<span class="`+(e.isNode?`nodeLabel`:`edgeLabel`)+`" `+(e.labelStyle?`style="`+e.labelStyle+`"`:``)+`>`+l+`</span>`;return r.html(i(u,a)),Ge(r,e.labelStyle),r.style(`display`,`inline-block`),r.style(`padding-right`,`1px`),r.style(`white-space`,`nowrap`),r.attr(`xmlns`,`http://www.w3.org/1999/xhtml`),t.node()}t(Ke,`addHtmlLabel`);var qe=t(async(t,n,r,i)=>{let a=t||``;if(typeof a==`object`&&(a=a[0]),u(c().flowchart.htmlLabels))return a=a.replace(/\\n|\n/g,`<br />`),e.info(`vertexText`+a),await Ke({isNode:i,label:p(a).replace(/fa[blrs]?:fa-[\w-]+/g,e=>`<i class='${e.replace(`:`,` `)}'></i>`),labelStyle:n&&n.replace(`fill:`,`color:`)});{let e=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);e.setAttribute(`style`,n.replace(`color:`,`fill:`));let t=[];t=typeof a==`string`?a.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(a)?a:[];for(let n of t){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);t.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),t.setAttribute(`dy`,`1em`),t.setAttribute(`x`,`0`),r?t.setAttribute(`class`,`title-row`):t.setAttribute(`class`,`row`),t.textContent=n.trim(),e.appendChild(t)}return e}},`createLabel`),q=t((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),Je=t(async(t,r)=>{e.info(`Creating subgraph rect for `,r.id,r);let i=c(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:l}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:m}=x(r),h=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.id).attr(`data-look`,r.look),g=u(i.flowchart.htmlLabels),v=h.insert(`g`).attr(`class`,`cluster-label `),S=await _(v,r.label,{style:r.labelStyle,useHtmlLabels:g,isNode:!0}),C=S.getBBox();if(u(i.flowchart.htmlLabels)){let e=S.children[0],t=n(S);C=e.getBoundingClientRect(),t.attr(`width`,C.width),t.attr(`height`,C.height)}let w=r.width<=C.width+r.padding?C.width+r.padding:r.width;r.width<=C.width+r.padding?r.diff=(w-r.width)/2-r.padding:r.diff=-r.padding;let T=r.height,E=r.x-w/2,D=r.y-T/2;e.trace(`Data `,r,JSON.stringify(r));let O;if(r.look===`handDrawn`){let t=V.svg(h),n=b(r,{roughness:.7,fill:s,stroke:l,fillWeight:3,seed:o}),i=t.path(q(E,D,w,T,0),n);O=h.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`),O.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),O.select(`path`).attr(`style`,m.join(`;`).replace(`fill`,`stroke`))}else O=h.insert(`rect`,`:first-child`),O.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,E).attr(`y`,D).attr(`width`,w).attr(`height`,T);let{subGraphTitleTopMargin:k}=y(i);if(v.attr(`transform`,`translate(${r.x-C.width/2}, ${r.y-r.height/2+k})`),d){let e=v.select(`span`);e&&e.attr(`style`,d)}let A=O.node().getBBox();return r.offsetX=0,r.width=A.width,r.height=A.height,r.offsetY=C.height-r.padding/2,r.intersect=function(e){return We(r,e)},{cluster:h,labelBBox:C}},`rect`),Ye={rect:Je,squareRect:Je,roundedWithTitle:t(async(e,t)=>{let r=c(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:o,compositeBackground:s,compositeTitleBackground:l,nodeBorder:d}=i,f=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.id).attr(`data-id`,t.id).attr(`data-look`,t.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=m.node().appendChild(await qe(t.label,t.labelStyle,void 0,!0)),_=g.getBBox();if(u(r.flowchart.htmlLabels)){let e=g.children[0],t=n(g);_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}let v=0*t.padding,y=v/2,b=(t.width<=_.width+t.padding?_.width+t.padding:t.width)+v;t.width<=_.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height+v,S=t.height+v-_.height-6,C=t.x-b/2,w=t.y-x/2;t.width=b;let T=t.y-t.height/2-y+_.height+2,E;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=V.svg(f),r=t.rx||t.ry?n.path(q(C,w,b,x,10),{roughness:.7,fill:l,fillStyle:`solid`,stroke:d,seed:a}):n.rectangle(C,w,b,x,{seed:a});E=f.insert(()=>r,`:first-child`);let i=n.rectangle(C,T,b,S,{fill:e?o:s,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});E=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else E=p.insert(`rect`,`:first-child`),E.attr(`class`,`outer`).attr(`x`,C).attr(`y`,w).attr(`width`,b).attr(`height`,x).attr(`data-look`,t.look),h.attr(`class`,`inner`).attr(`x`,C).attr(`y`,T).attr(`width`,b).attr(`height`,S);return m.attr(`transform`,`translate(${t.x-_.width/2}, ${w+1-(u(r.flowchart.htmlLabels)?0:3)})`),t.height=E.node().getBBox().height,t.offsetX=0,t.offsetY=_.height-t.padding/2,t.labelBBox=_,t.intersect=function(e){return We(t,e)},{cluster:f,labelBBox:_}},`roundedWithTitle`),noteGroup:t((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.id),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return We(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:t((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=c(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.id).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,l=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-l/2,f=t.y-u/2;t.width=l;let p;if(t.look===`handDrawn`){let e=V.svg(a).rectangle(d,f,l,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else p=o.insert(`rect`,`:first-child`),p.attr(`class`,`divider`).attr(`x`,d).attr(`y`,f).attr(`width`,l).attr(`height`,u).attr(`data-look`,t.look);return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return We(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:t(async(t,r)=>{e.info(`Creating subgraph rect for `,r.id,r);let i=c(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:l}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:m}=x(r),h=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.id).attr(`data-look`,r.look),g=u(i.flowchart.htmlLabels),v=h.insert(`g`).attr(`class`,`cluster-label `),S=await _(v,r.label,{style:r.labelStyle,useHtmlLabels:g,isNode:!0,width:r.width}),C=S.getBBox();if(u(i.flowchart.htmlLabels)){let e=S.children[0],t=n(S);C=e.getBoundingClientRect(),t.attr(`width`,C.width),t.attr(`height`,C.height)}let w=r.width<=C.width+r.padding?C.width+r.padding:r.width;r.width<=C.width+r.padding?r.diff=(w-r.width)/2-r.padding:r.diff=-r.padding;let T=r.height,E=r.x-w/2,D=r.y-T/2;e.trace(`Data `,r,JSON.stringify(r));let O;if(r.look===`handDrawn`){let t=V.svg(h),n=b(r,{roughness:.7,fill:s,stroke:l,fillWeight:4,seed:o}),i=t.path(q(E,D,w,T,r.rx),n);O=h.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`),O.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),O.select(`path`).attr(`style`,m.join(`;`).replace(`fill`,`stroke`))}else O=h.insert(`rect`,`:first-child`),O.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,E).attr(`y`,D).attr(`width`,w).attr(`height`,T);let{subGraphTitleTopMargin:k}=y(i);if(v.attr(`transform`,`translate(${r.x-C.width/2}, ${r.y-r.height/2+k})`),d){let e=v.select(`span`);e&&e.attr(`style`,d)}let A=O.node().getBBox();return r.offsetX=0,r.width=A.width,r.height=A.height,r.offsetY=C.height-r.padding/2,r.intersect=function(e){return We(r,e)},{cluster:h,labelBBox:C}},`kanbanSection`)},Xe=new Map,Ze=t(async(e,t)=>{let n=await Ye[t.shape||`rect`](e,t);return Xe.set(t.id,n),n},`insertCluster`),Qe=t(()=>{Xe=new Map},`clear`);function $e(e,t){return e.intersect(t)}t($e,`intersectNode`);var et=$e;function tt(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}t(tt,`intersectEllipse`);var nt=tt;function rt(e,t,n){return nt(e,t,t,n)}t(rt,`intersectCircle`);var it=rt;function at(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&ot(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&ot(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}t(at,`intersectLine`);function ot(e,t){return e*t>0}t(ot,`sameSign`);var st=at;function ct(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=st(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}t(ct,`intersectPolygon`);var J={node:et,circle:it,ellipse:nt,polygon:ct,rect:We};function lt(t,n){let{labelStyles:r}=x(n);n.labelStyle=r;let i=W(n),a=i;i||(a=`anchor`);let o=t.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=V.svg(o),l=b(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,g(s)),U(n,d),n.intersect=function(t){return e.info(`Circle intersect`,n,1,t),J.circle(n,1,t)},o}t(lt,`anchor`);function ut(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}t(ut,`generateArcPoints`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.width+t.padding+20,s=a.height+t.padding,c=s/2,l=c/(2.5+s/50),{cssStyles:u}=t,d=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...ut(-o/2,-s/2,-o/2,s/2,l,c,!1),{x:o/2,y:s/2},...ut(o/2,s/2,o/2,-s/2,l,c,!0)],f=V.svg(i),p=b(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=G(d),h=f.path(m,p),g=i.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container`),u&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,r),g.attr(`transform`,`translate(${l/2}, 0)`),U(t,g),t.intersect=function(e){return J.polygon(t,d,e)},i}t(dt,`bowTieRect`);function Y(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}t(Y,`insertPolygonShape`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.height+t.padding,s=a.width+t.padding+12,c=s,l=-o,u=[{x:12,y:l},{x:c,y:l},{x:c,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}],d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=b(t,{}),r=G(u),a=e.path(r,n);d=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-s/2}, ${o/2})`),f&&d.attr(`style`,f)}else d=Y(i,s,o,u);return r&&d.attr(`style`,r),U(t,d),t.intersect=function(e){return J.polygon(t,u,e)},i}t(ft,`card`);function pt(e,t){let{nodeStyles:n}=x(t);t.label=``;let r=e.insert(`g`).attr(`class`,W(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=V.svg(r),c=b(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=G(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return J.polygon(t,o,e)},r}t(pt,`choice`);async function mt(t,n,r){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await H(t,n,W(n)),l=r?.padding??c,u=s.width/2+l,d,{cssStyles:f}=n;if(n.look===`handDrawn`){let e=V.svg(o),t=b(n,{}),r=e.circle(0,0,u*2,t);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,g(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return U(n,d),n.calcIntersect=function(e,t){let n=e.width/2;return J.circle(e,n,t)},n.intersect=function(t){return e.info(`Circle intersect`,n,u,t),J.circle(n,u,t)},o}t(mt,`circle`);function ht(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
3
3
|
M ${i.x},${i.y} L ${o.x},${o.y}`}t(ht,`createLine`);function gt(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r,n.label=``;let a=t.insert(`g`).attr(`class`,W(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=V.svg(a),l=b(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=ht(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),U(n,p),n.intersect=function(t){return e.info(`crossedCircle intersect`,n,{radius:o,point:t}),J.circle(n,o,t)},a}t(gt,`crossedCircle`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(X,`generateCirclePoints`);async function _t(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:u}=t,d=[...X(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...X(s/2+l*2,-l,l,20,-180,-270),...X(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...X(s/2,c/2,l,20,0,90)],f=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...X(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...X(s/2+s*.1,-l,l,20,-180,-270),...X(s/2+s*.1,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...X(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2,y:c/2+l}],p=V.svg(i),m=b(t,{fill:`none`});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=G(d).replace(`Z`,``),g=p.path(h,m),_=G(f),v=p.path(_,{...m}),y=i.insert(`g`,`:first-child`);return y.insert(()=>v,`:first-child`).attr(`stroke-opacity`,0),y.insert(()=>g,`:first-child`),y.attr(`class`,`text`),u&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(${l}, 0)`),o.attr(`transform`,`translate(${-s/2+l-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,y),t.intersect=function(e){return J.polygon(t,f,e)},i}t(_t,`curlyBraceLeft`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}t(Z,`generateCirclePoints`);async function vt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:u}=t,d=[...Z(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...Z(s/2+l*2,-l,l,20,-180,-270),...Z(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...Z(s/2,c/2,l,20,0,90)],f=[{x:-s/2,y:-c/2-l},{x:s/2,y:-c/2-l},...Z(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...Z(s/2+l*2,-l,l,20,-180,-270),...Z(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...Z(s/2,c/2,l,20,0,90),{x:s/2,y:c/2+l},{x:-s/2,y:c/2+l}],p=V.svg(i),m=b(t,{fill:`none`});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=G(d).replace(`Z`,``),g=p.path(h,m),_=G(f),v=p.path(_,{...m}),y=i.insert(`g`,`:first-child`);return y.insert(()=>v,`:first-child`).attr(`stroke-opacity`,0),y.insert(()=>g,`:first-child`),y.attr(`class`,`text`),u&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(${-l}, 0)`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,y),t.intersect=function(e){return J.polygon(t,f,e)},i}t(vt,`curlyBraceRight`);function Q(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(Q,`generateCirclePoints`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:u}=t,d=[...Q(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...Q(s/2+l*2,-l,l,20,-180,-270),...Q(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...Q(s/2,c/2,l,20,0,90)],f=[...Q(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...Q(-s/2-l/2,-l,l,20,0,90),...Q(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...Q(-s/2+l+l/2,c/2,l,30,-180,-270)],p=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...Q(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...Q(s/2+l*2,-l,l,20,-180,-270),...Q(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...Q(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2-l-l/2,y:c/2+l},...Q(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...Q(-s/2-l/2,-l,l,20,0,90),...Q(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...Q(-s/2+l+l/2,c/2,l,30,-180,-270)],m=V.svg(i),h=b(t,{fill:`none`});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=G(d).replace(`Z`,``),_=m.path(g,h),v=G(f).replace(`Z`,``),y=m.path(v,h),S=G(p),C=m.path(S,{...h}),w=i.insert(`g`,`:first-child`);return w.insert(()=>C,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>_,`:first-child`),w.insert(()=>y,`:first-child`),w.attr(`class`,`text`),u&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${l-l/4}, 0)`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,w),t.intersect=function(e){return J.polygon(t,p,e)},i}t(yt,`curlyBraces`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(80,(a.width+(t.padding??0)*2)*1.25,t?.width??0),s=Math.max(20,a.height+(t.padding??0)*2,t?.height??0),c=s/2,{cssStyles:l}=t,u=V.svg(i),d=b(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=o,p=s,m=f-c,h=p/4,g=[{x:m,y:0},{x:h,y:0},{x:0,y:p/2},{x:h,y:p},{x:m,y:p},...Ue(-m,-p/2,c,50,270,90)],_=G(g),v=u.path(_,d),y=i.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container`),l&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,l),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),y.attr(`transform`,`translate(${-o/2}, ${-s/2})`),U(t,y),t.intersect=function(e){return J.polygon(t,g,e)},i}t(bt,`curvedTrapezoid`);var xt=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),St=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),Ct=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`);async function wt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+t.padding,t.width??0),c=s/2,l=c/(2.5+s/50),u=Math.max(a.height+l+t.padding,t.height??0),d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=St(0,0,s,u,c,l),r=Ct(0,l,s,u,c,l),a=e.path(n,b(t,{})),o=e.path(r,b(t,{fill:`none`}));d=i.insert(()=>o,`:first-child`),d=i.insert(()=>a,`:first-child`),d.attr(`class`,`basic label-container`),f&&d.attr(`style`,f)}else{let e=xt(0,0,s,u,c,l);d=i.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,g(f)).attr(`style`,r)}return d.attr(`label-offset-y`,l),d.attr(`transform`,`translate(${-s/2}, ${-(u/2+l)})`),U(t,d),o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(e){let n=J.rect(t,e),r=n.x-(t.x??0);if(c!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-l)){let i=l*l*(1-r*r/(c*c));i>0&&(i=Math.sqrt(i)),i=l-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}t(wt,`cylinder`);async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+t.padding,c=a.height+t.padding,l=c*.2,u=-s/2,d=-c/2-l/2,{cssStyles:f}=t,p=V.svg(i),m=b(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:u,y:d+l},{x:-u,y:d+l},{x:-u,y:-d},{x:u,y:-d},{x:u,y:d},{x:-u,y:d},{x:-u,y:d+l}],g=p.polygon(h.map(e=>[e.x,e.y]),m),_=i.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container`),f&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${u+(t.padding??0)/2-(a.x-(a.left??0))}, ${d+l+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,_),t.intersect=function(e){return J.rect(t,e)},i}t(Tt,`dividedRectangle`);async function Et(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s}=await H(t,n,W(n)),c=o.width/2+s+5,l=o.width/2+s,u,{cssStyles:d}=n;if(n.look===`handDrawn`){let e=V.svg(a),t=b(n,{roughness:.2,strokeWidth:2.5}),r=b(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,c*2,t),o=e.circle(0,0,l*2,r);u=a.insert(`g`,`:first-child`),u.attr(`class`,g(n.cssClasses)).attr(`style`,g(d)),u.node()?.appendChild(i),u.node()?.appendChild(o)}else{u=a.insert(`g`,`:first-child`);let e=u.insert(`circle`,`:first-child`),t=u.insert(`circle`);u.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,c).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,l).attr(`cx`,0).attr(`cy`,0)}return U(n,u),n.intersect=function(t){return e.info(`DoubleCircle intersect`,n,c,t),J.circle(n,c,t)},a}t(Et,`doublecircle`);function Dt(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.label=``,n.labelStyle=i;let o=t.insert(`g`).attr(`class`,W(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=V.svg(o),{nodeBorder:l}=r,u=b(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),U(n,f),n.intersect=function(t){return e.info(`filledCircle intersect`,n,{radius:7,point:t}),J.circle(n,7,t)},o}t(Dt,`filledCircle`);async function Ot(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await H(t,n,W(n)),c=o.width+(n.padding??0),l=c+o.height,u=c+o.height,d=[{x:0,y:-l},{x:u,y:-l},{x:u/2,y:0}],{cssStyles:f}=n,p=V.svg(a),m=b(n,{});n.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=G(d),g=p.path(h,m),_=a.insert(()=>g,`:first-child`).attr(`transform`,`translate(${-l/2}, ${l/2})`);return f&&n.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,f),i&&n.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,i),n.width=c,n.height=l,U(n,_),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-l/2+(n.padding??0)/2+(o.y-(o.top??0))})`),n.intersect=function(t){return e.info(`Triangle intersect`,n,d,t),J.polygon(n,d,t)},a}t(Ot,`flippedTriangle`);function kt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=x(t);t.label=``;let o=e.insert(`g`).attr(`class`,W(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=V.svg(o),p=b(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),U(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return J.rect(t,e)},o}t(kt,`forkJoin`);async function At(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o}=await H(t,n,W(n)),s=Math.max(80,o.width+(n.padding??0)*2,n?.width??0),c=Math.max(50,o.height+(n.padding??0)*2,n?.height??0),l=c/2,{cssStyles:u}=n,d=V.svg(a),f=b(n,{});n.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=[{x:-s/2,y:-c/2},{x:s/2-l,y:-c/2},...Ue(-s/2+l,0,l,50,90,270),{x:s/2-l,y:c/2},{x:-s/2,y:c/2}],m=G(p),h=d.path(m,f),g=a.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container`),u&&n.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,u),i&&n.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,i),U(n,g),n.intersect=function(t){return e.info(`Pill intersect`,n,{radius:l,point:t}),J.polygon(n,p,t)},a}t(At,`halfRoundedRectangle`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.height+(t.padding??0),s=a.width+(t.padding??0)*2.5,{cssStyles:c}=t,l=V.svg(i),u=b(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=s/2,f=d/6;d+=f;let p=o/2,m=p/2,h=d-m,g=[{x:-h,y:-p},{x:0,y:-p},{x:h,y:-p},{x:d,y:0},{x:h,y:p},{x:0,y:p},{x:-h,y:p},{x:-d,y:0}],_=G(g),v=l.path(_,u),y=i.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container`),c&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,c),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),t.width=s,t.height=o,U(t,y),t.intersect=function(e){return J.polygon(t,g,e)},i}t(jt,`hexagon`);async function Mt(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await H(t,n,W(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=V.svg(a),u=b(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=G(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),U(n,m),n.intersect=function(t){return e.info(`Pill intersect`,n,{points:d}),J.polygon(n,d,t)},a}t(Mt,`hourglass`);async function Nt(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await H(t,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:g}=r,{stylesMap:_}=C(n),y=-h/2,S=-m/2,w=n.label?8:0,T=V.svg(u),E=b(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=T.rectangle(y,S,h,m,E),O=Math.max(h,d.width),k=m+d.height+w,A=T.rectangle(-O/2,-k/2,O,k,{...E,fill:`transparent`,stroke:`none`}),j=u.insert(()=>D,`:first-child`),M=u.insert(()=>A);if(n.icon){let e=u.append(`g`);e.html(`<g>${await v(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${_.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-k/2:k/2-d.height})`),j.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),U(n,M),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],J.polygon(n,o,t)},u}t(Nt,`icon`);async function Pt(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await H(t,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:g}=r,{stylesMap:_}=C(n),y=V.svg(u),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`),S.stroke=_.get(`fill`)??g;let w=u.append(`g`);n.icon&&w.html(`<g>${await v(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let T=w.node().getBBox(),E=T.width,D=T.height,O=T.x,k=T.y,A=Math.max(E,D)*Math.SQRT2+40,j=y.circle(0,0,A,S),M=Math.max(A,d.width),N=A+d.height+p,P=y.rectangle(-M/2,-N/2,M,N,{...S,fill:`transparent`,stroke:`none`}),F=u.insert(()=>j,`:first-child`),I=u.insert(()=>P);return w.attr(`transform`,`translate(${-E/2-O},${m?d.height/2+p/2-D/2-k:-d.height/2-p/2-D/2-k})`),w.attr(`style`,`color: ${_.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-N/2:N/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),U(n,I),n.intersect=function(t){return e.info(`iconSquare intersect`,n,t),J.rect(n,t)},u}t(Pt,`iconCircle`);async function Ft(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await H(t,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:_,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,T=-h/2,E=n.label?8:0,D=V.svg(u),O=b(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`),O.stroke=S.get(`fill`)??y;let k=D.path(q(w,T,g,h,5),O),A=Math.max(g,d.width),j=h+d.height+E,M=D.rectangle(-A/2,-j/2,A,j,{...O,fill:`transparent`,stroke:`none`}),N=u.insert(()=>k,`:first-child`).attr(`class`,`icon-shape2`),P=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await v(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+E/2-i/2-o:-d.height/2-E/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-j/2:j/2-d.height})`),N.attr(`transform`,`translate(0,${m?d.height/2+E/2:-d.height/2-E/2})`),U(n,P),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+E},{x:r+g/2,y:i-a/2+d.height+E},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+E},{x:r-d.width/2,y:i-a/2+d.height+E}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],J.polygon(n,o,t)},u}t(Ft,`iconRounded`);async function It(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await H(t,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:_,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,T=-h/2,E=n.label?8:0,D=V.svg(u),O=b(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`),O.stroke=S.get(`fill`)??y;let k=D.path(q(w,T,g,h,.1),O),A=Math.max(g,d.width),j=h+d.height+E,M=D.rectangle(-A/2,-j/2,A,j,{...O,fill:`transparent`,stroke:`none`}),N=u.insert(()=>k,`:first-child`),P=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await v(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+E/2-i/2-o:-d.height/2-E/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-j/2:j/2-d.height})`),N.attr(`transform`,`translate(0,${m?d.height/2+E/2:-d.height/2-E/2})`),U(n,P),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+E},{x:r+g/2,y:i-a/2+d.height+E},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+E},{x:r-d.width/2,y:i-a/2+d.height+E}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],J.polygon(n,o,t)},u}t(It,`iconSquare`);async function Lt(t,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=x(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await H(t,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,v=n.label?8:0,y=V.svg(f),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=y.rectangle(g,_,u,d,S),w=Math.max(u,p.width),T=d+p.height+v,E=y.rectangle(-w/2,-T/2,w,T,{...S,fill:`none`,stroke:`none`}),D=f.insert(()=>C,`:first-child`),O=f.insert(()=>E);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?T/2-d:-T/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),D.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),U(n,O),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+v},{x:r+u/2,y:i-a/2+p.height+v},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+v},{x:r-p.width/2,y:i-a/2+p.height+v}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],J.polygon(n,o,t)},f}t(Lt,`imageSquare`);async function Rt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0)*2,t?.width??0),s=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=b(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(Rt,`inv_trapezoid`);async function zt(e,t,n){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await H(e,t,W(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=V.svg(a),n=b(t,{}),r=f||p?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,g(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,g(f)).attr(`ry`,g(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return U(t,d),t.calcIntersect=function(e,t){return J.rect(e,t)},t.intersect=function(e){return J.rect(t,e)},a}t(zt,`drawRect`);async function Bt(e,t){let{shapeSvg:n,bbox:r,label:i}=await H(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),U(t,a),t.intersect=function(e){return J.rect(t,e)},n}t(Bt,`labelRect`);async function Vt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),c=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-(3*s)/6,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=b(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(Vt,`lean_left`);async function Ht(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),c=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=b(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(Ht,`lean_right`);function Ut(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let a=t.insert(`g`).attr(`class`,W(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=V.svg(a),d=b(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=G(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),U(n,m),n.intersect=function(t){return e.info(`lightningBolt intersect`,n,t),J.polygon(n,l,t)},a}t(Ut,`lightningBolt`);var Wt=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),Gt=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),Kt=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0),t.width??0),c=s/2,l=c/(2.5+s/50),u=Math.max(a.height+l+(t.padding??0),t.height??0),d=u*.1,f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=Gt(0,0,s,u,c,l,d),r=Kt(0,l,s,u,c,l),a=b(t,{}),o=e.path(n,a),m=e.path(r,a);i.insert(()=>m,`:first-child`).attr(`class`,`line`),f=i.insert(()=>o,`:first-child`),f.attr(`class`,`basic label-container`),p&&f.attr(`style`,p)}else{let e=Wt(0,0,s,u,c,l,d);f=i.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,g(p)).attr(`style`,r)}return f.attr(`label-offset-y`,l),f.attr(`transform`,`translate(${-s/2}, ${-(u/2+l)})`),U(t,f),o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+l-(a.y-(a.top??0))})`),t.intersect=function(e){let n=J.rect(t,e),r=n.x-(t.x??0);if(c!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-l)){let i=l*l*(1-r*r/(c*c));i>0&&(i=Math.sqrt(i)),i=l-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}t(qt,`linedCylinder`);async function Jt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/4,u=c+l,{cssStyles:d}=t,f=V.svg(i),p=b(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-s/2-s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:u/2},...K(-s/2-s/2*.1,u/2,s/2+s/2*.1,u/2,l,.8),{x:s/2+s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:-u/2},{x:-s/2,y:-u/2},{x:-s/2,y:u/2*1.1},{x:-s/2,y:-u/2}],h=f.polygon(m.map(e=>[e.x,e.y]),p),g=i.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,r),g.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),U(t,g),t.intersect=function(e){return J.polygon(t,m,e)},i}t(Jt,`linedWaveEdgedRect`);async function Yt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=-s/2,u=-c/2,{cssStyles:d}=t,f=V.svg(i),p=b(t,{}),m=[{x:l-5,y:u+5},{x:l-5,y:u+c+5},{x:l+s-5,y:u+c+5},{x:l+s-5,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u+c-5},{x:l+s+5,y:u+c-5},{x:l+s+5,y:u-5},{x:l+5,y:u-5},{x:l+5,y:u},{x:l,y:u},{x:l,y:u+5}],h=[{x:l,y:u+5},{x:l+s-5,y:u+5},{x:l+s-5,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u},{x:l,y:u}];t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let g=G(m),_=f.path(g,p),v=G(h),y=f.path(v,{...p,fill:`none`}),S=i.insert(()=>y,`:first-child`);return S.insert(()=>_,`:first-child`),S.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${-(a.width/2)-5-(a.x-(a.left??0))}, ${-(a.height/2)+5-(a.y-(a.top??0))})`),U(t,S),t.intersect=function(e){return J.polygon(t,m,e)},i}t(Yt,`multiRect`);async function Xt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/4,u=c+l,d=-s/2,f=-u/2,{cssStyles:p}=t,m=K(d-5,f+u+5,d+s-5,f+u+5,l,.8),h=m?.[m.length-1],g=[{x:d-5,y:f+5},{x:d-5,y:f+u+5},...m,{x:d+s-5,y:h.y-5},{x:d+s,y:h.y-5},{x:d+s,y:h.y-10},{x:d+s+5,y:h.y-10},{x:d+s+5,y:f-5},{x:d+5,y:f-5},{x:d+5,y:f},{x:d,y:f},{x:d,y:f+5}],_=[{x:d,y:f+5},{x:d+s-5,y:f+5},{x:d+s-5,y:h.y-5},{x:d+s,y:h.y-5},{x:d+s,y:f},{x:d,y:f}],v=V.svg(i),y=b(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=G(g),C=v.path(S,y),w=G(_),T=v.path(w,y),E=i.insert(()=>C,`:first-child`);return E.insert(()=>T),E.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-(a.width/2)-5-(a.x-(a.left??0))}, ${-(a.height/2)+5-l/2-(a.y-(a.top??0))})`),U(t,E),t.intersect=function(e){return J.polygon(t,g,e)},i}t(Xt,`multiWaveEdgedRectangle`);async function Zt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r,t.useHtmlLabels||f().flowchart?.htmlLabels!==!1||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await H(e,t,W(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),u=-c/2,d=-l/2,{cssStyles:p}=t,m=V.svg(a),h=b(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=m.rectangle(u,d,c,l,h),_=a.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,p),i&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),U(t,_),t.intersect=function(e){return J.rect(t,e)},a}t(Zt,`note`);var Qt=t((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function $t(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.width+t.padding+(a.height+t.padding),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=b(t,{}),r=Qt(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),U(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=J.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}t($t,`question`);async function en(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0),t?.width??0),c=Math.max(a.height+(t.padding??0),t?.height??0),l=-s/2,u=-c/2,d=u/2,f=[{x:l+d,y:u},{x:l,y:0},{x:l+d,y:-u},{x:-l,y:-u},{x:-l,y:u}],{cssStyles:p}=t,m=V.svg(i),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=G(f),_=m.path(g,h),v=i.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,r),v.attr(`transform`,`translate(${-d/2},0)`),o.attr(`transform`,`translate(${-d/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),U(t,v),t.intersect=function(e){return J.polygon(t,f,e)},i}t(en,`rect_left_inv_arrow`);async function tn(t,r){let{labelStyles:i,nodeStyles:a}=x(r);r.labelStyle=i;let o;o=r.cssClasses?`node `+r.cssClasses:`node default`;let s=t.insert(`g`).attr(`class`,o).attr(`id`,r.domId||r.id),l=s.insert(`g`),d=s.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=d.node().appendChild(await qe(p,r.labelStyle,!0,!0)),h={width:0,height:0};if(u(c()?.flowchart?.htmlLabels)){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}e.info(`Text 2`,f);let g=f||[],_=m.getBBox(),v=d.node().appendChild(await qe(g.join?g.join(`<br/>`):g,r.labelStyle,!0,!0)),y=v.children[0],S=n(v);h=y.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(v).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-C+3)+`)`);let w=h.width+(r.padding||0),T=h.height+(r.padding||0),E=-h.width/2-C,D=-h.height/2-C,O,k;if(r.look===`handDrawn`){let t=V.svg(s),n=b(r,{}),i=t.path(q(E,D,w,T,r.rx||0),n),a=t.line(-h.width/2-C,-h.height/2-C+_.height+C,h.width/2+C,-h.height/2-C+_.height+C,n);k=s.insert(()=>(e.debug(`Rough node insert CXC`,i),a),`:first-child`),O=s.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`)}else O=l.insert(`rect`,`:first-child`),k=l.insert(`line`),O.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),k.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+_.height+C).attr(`y2`,-h.height/2-C+_.height+C);return U(r,O),r.intersect=function(e){return J.rect(r,e)},s}t(tn,`rectWithTitle`);function nn(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}t(nn,`generateArcPoints`);async function rn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=t?.padding??0,s=t?.padding??0,c=(t?.width?t?.width:a.width)+o*2,l=(t?.height?t?.height:a.height)+s*2,u=t.radius||5,d=t.taper||5,{cssStyles:f}=t,p=V.svg(i),m=b(t,{});t.stroke&&(m.stroke=t.stroke),t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-c/2+d,y:-l/2},{x:c/2-d,y:-l/2},...nn(c/2-d,-l/2,c/2,-l/2+d,u,u,!0),{x:c/2,y:-l/2+d},{x:c/2,y:l/2-d},...nn(c/2,l/2-d,c/2-d,l/2,u,u,!0),{x:c/2-d,y:l/2},{x:-c/2+d,y:l/2},...nn(-c/2+d,l/2,-c/2,l/2-d,u,u,!0),{x:-c/2,y:l/2-d},{x:-c/2,y:-l/2+d},...nn(-c/2,-l/2+d,-c/2+d,-l/2,u,u,!0)],g=G(h),_=p.path(g,m),v=i.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),U(t,v),t.intersect=function(e){return J.polygon(t,h,e)},i}t(rn,`roundedRect`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=t?.padding??0,c=Math.max(a.width+(t.padding??0)*2,t?.width??0),l=Math.max(a.height+(t.padding??0)*2,t?.height??0),u=-a.width/2-s,d=-a.height/2-s,{cssStyles:f}=t,p=V.svg(i),m=b(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:u,y:d},{x:u+c+8,y:d},{x:u+c+8,y:d+l},{x:u-8,y:d+l},{x:u-8,y:d},{x:u,y:d},{x:u,y:d+l}],_=p.polygon(h.map(e=>[e.x,e.y]),m),v=i.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container`).attr(`style`,g(f)),r&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,r),f&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${-c/2+4+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-(a.y-(a.top??0))})`),U(t,v),t.intersect=function(e){return J.rect(t,e)},i}t(an,`shadedProcess`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=-s/2,u=-c/2,{cssStyles:d}=t,f=V.svg(i),p=b(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:l,y:u},{x:l,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u-c/2}],h=G(m),g=f.path(h,p),_=i.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),_.attr(`transform`,`translate(0, ${c/4})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))}, ${-c/4+(t.padding??0)-(a.y-(a.top??0))})`),U(t,_),t.intersect=function(e){return J.polygon(t,m,e)},i}t(on,`slopedRect`);async function sn(e,t){return zt(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??(t?.padding||0)*2,labelPaddingY:(t?.padding||0)*1})}t(sn,`squareRect`);async function cn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.height+t.padding,s=a.width+o/4+t.padding,c=o/2,{cssStyles:l}=t,u=V.svg(i),d=b(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=[{x:-s/2+c,y:-o/2},{x:s/2-c,y:-o/2},...Ue(-s/2+c,0,c,50,90,270),{x:s/2-c,y:o/2},...Ue(s/2-c,0,c,50,270,450)],p=G(f),m=u.path(p,d),h=i.insert(()=>m,`:first-child`);return h.attr(`class`,`basic label-container outer-path`),l&&t.look!==`handDrawn`&&h.selectChildren(`path`).attr(`style`,l),r&&t.look!==`handDrawn`&&h.selectChildren(`path`).attr(`style`,r),U(t,h),t.intersect=function(e){return J.polygon(t,f,e)},i}t(cn,`stadium`);async function ln(e,t){return zt(e,t,{rx:5,ry:5,classes:`flowchart-node`})}t(ln,`state`);function un(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c}=n,l=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),u=V.svg(l),d=b(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=u.circle(0,0,14,{...d,stroke:o,strokeWidth:2}),p=s??c,m=u.circle(0,0,5,{...d,fill:p,stroke:p,strokeWidth:2,fillStyle:`solid`}),h=l.insert(()=>f,`:first-child`);return h.insert(()=>m),a&&h.selectAll(`path`).attr(`style`,a),i&&h.selectAll(`path`).attr(`style`,i),U(t,h),t.intersect=function(e){return J.circle(t,7,e)},l}t(un,`stateEnd`);function dn(e,t,{config:{themeVariables:n}}){let{lineColor:r}=n,i=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),a;if(t.look===`handDrawn`){let e=V.svg(i).circle(0,0,14,S(r));a=i.insert(()=>e),a.attr(`class`,`state-start`).attr(`r`,7).attr(`width`,14).attr(`height`,14)}else a=i.insert(`circle`,`:first-child`),a.attr(`class`,`state-start`).attr(`r`,7).attr(`width`,14).attr(`height`,14);return U(t,a),t.intersect=function(e){return J.circle(t,7,e)},i}t(dn,`stateStart`);async function fn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=(t?.padding||0)/2,s=a.width+t.padding,c=a.height+t.padding,l=-a.width/2-o,u=-a.height/2-o,d=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look===`handDrawn`){let e=V.svg(i),n=b(t,{}),r=e.rectangle(l-8,u,s+16,c,n),a=e.line(l,u,l,u+c,n),o=e.line(l+s,u,l+s,u+c,n);i.insert(()=>a,`:first-child`),i.insert(()=>o,`:first-child`);let d=i.insert(()=>r,`:first-child`),{cssStyles:f}=t;d.attr(`class`,`basic label-container`).attr(`style`,g(f)),U(t,d)}else{let e=Y(i,s,c,d);r&&e.attr(`style`,r),U(t,e)}return t.intersect=function(e){return J.polygon(t,d,e)},i}t(fn,`subroutine`);async function pn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0)*2,t?.width??0),s=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=-o/2,l=-s/2,u=.2*s,d=.2*s,{cssStyles:f}=t,p=V.svg(i),m=b(t,{}),h=[{x:c-u/2,y:l},{x:c+o+u/2,y:l},{x:c+o+u/2,y:l+s},{x:c-u/2,y:l+s}],g=[{x:c+o-u/2,y:l+s},{x:c+o+u/2,y:l+s},{x:c+o+u/2,y:l+s-d}];t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let _=G(h),v=p.path(_,m),y=G(g),S=p.path(y,{...m,fillStyle:`solid`}),C=i.insert(()=>S,`:first-child`);return C.insert(()=>v,`:first-child`),C.attr(`class`,`basic label-container`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),U(t,C),t.intersect=function(e){return J.polygon(t,h,e)},i}t(pn,`taggedRect`);async function mn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/4,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=V.svg(i),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...K(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,y=[{x:_+s-u,y:(v+c)*1.4},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...K(_+s,(v+c)*1.3,_+s-u,(v+c)*1.5,-c*.03,.5)],S=G(g),C=m.path(S,h),w=G(y),T=m.path(w,{...h,fillStyle:`solid`}),E=i.insert(()=>T,`:first-child`);return E.insert(()=>C,`:first-child`),E.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),U(t,E),t.intersect=function(e){return J.polygon(t,g,e)},i}t(mn,`taggedWaveEdgedRectangle`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+t.padding,t?.width||0),s=Math.max(a.height+t.padding,t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),U(t,u),t.intersect=function(e){return J.rect(t,e)},i}t(hn,`text`);var gn=t((e,t,n,r,i,a)=>`M${e},${t}
|
|
4
4
|
a${i},${a} 0,0,1 0,${-r}
|
|
@@ -52,4 +52,4 @@ import{g as e,h as t,p as n}from"./src-CK1-XQNk.js";import{A as r,I as i,L as a,
|
|
|
52
52
|
q-5,0 -5,-5
|
|
53
53
|
Z
|
|
54
54
|
`,d=i.append(`path`).attr(`id`,`node-`+t.id).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),U(t,d),t.calcIntersect=function(e,t){return J.rect(e,t)},t.intersect=function(e){return J.rect(t,e)},i}t(In,`defaultMindmapNode`);async function Ln(e,t){return mt(e,t,{padding:t.padding??0})}t(Ln,`mindmapCircle`);var Rn=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:sn},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:rn},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:cn},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:fn},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:wt},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:mt},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Pn},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:Fn},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:$t},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:jt},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:Ht},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:Vt},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:bn},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:Rt},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:Et},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:hn},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:ft},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:an},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:dn},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:un},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:kt},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:Mt},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:_t},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:vt},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:yt},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:Ut},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:Cn},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:At},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:yn},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:qt},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:bt},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Tt},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:Sn},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:Tn},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:Dt},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:xn},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:Ot},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:on},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:Xt},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:Yt},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:dt},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:gt},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:mn},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:pn},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:wn},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:en},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:Jt}],zn=t(()=>{let e={state:ln,choice:pt,note:Zt,rectWithTitle:tn,labelRect:Bt,iconSquare:It,iconCircle:Pt,icon:Nt,iconRounded:Ft,imageSquare:Lt,anchor:lt,kanbanItem:Nn,mindmapCircle:Ln,defaultMindmapNode:In,classBox:An,erBox:En,requirementBox:jn},t=[...Object.entries(e),...Rn.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(t)},`generateShapeMap`)();function Bn(e){return e in zn}t(Bn,`isValidShape`);var Vn=new Map;async function Hn(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let a=t.shape?zn[t.shape]:void 0;if(!a)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;n.config.securityLevel===`sandbox`?o=`_top`:t.linkTarget&&(o=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return t.tooltip&&i.attr(`title`,t.tooltip),Vn.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}t(Hn,`insertNode`);var Un=t((e,t)=>{Vn.set(t.id,e)},`setNodeElem`),Wn=t(()=>{Vn.clear()},`clear`),Gn=t(t=>{let n=Vn.get(t.id);e.trace(`Transforming node`,t.diff,t,`translate(`+(t.x-t.width/2-5)+`, `+t.width/2+`)`);let r=t.diff||0;return t.clusterNode?n.attr(`transform`,`translate(`+(t.x+r-t.width/2)+`, `+(t.y-t.height/2-8)+`)`):n.attr(`transform`,`translate(`+t.x+`, `+t.y+`)`),r},`positionNode`);export{Hn as a,Gn as c,V as d,Ze as i,Un as l,Wn as n,Bn as o,qe as r,H as s,Qe as t,U as u};
|
|
55
|
-
//# sourceMappingURL=chunk-JZLCHNYA
|
|
55
|
+
//# sourceMappingURL=chunk-JZLCHNYA--0HCyKSB.js.map
|