@objectstack/console 9.4.0 → 9.5.1
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/assets/{AdapterProvider-BNNEwHx0.js → AdapterProvider-BrKPQ1rE.js} +1 -1
- package/dist/assets/{AiPendingActionsPage-DOSHy962.js → AiPendingActionsPage-BcncanbT.js} +1 -1
- package/dist/assets/{ApiConsolePage-CruwU0Up.js → ApiConsolePage-C6tVqeCx.js} +1 -1
- package/dist/assets/AppDocsIndex-D--pdm0E.js +1 -0
- package/dist/assets/{AppManagementPage-BohnYqad.js → AppManagementPage-B66TgUPL.js} +1 -1
- package/dist/assets/{ApprovalsInboxPage-BGmv2uNL.js → ApprovalsInboxPage-C8mv1Yo5.js} +1 -1
- package/dist/assets/{AuditLogPage-KrpMMNiw.js → AuditLogPage-CS-Jundr.js} +1 -1
- package/dist/assets/{ComponentNavView-JMyYlvFq.js → ComponentNavView-Br-wa130.js} +1 -1
- package/dist/assets/{ConsoleFloatingChatbot-C7wdj16w.js → ConsoleFloatingChatbot-CIsrrZv4.js} +1 -1
- package/dist/assets/{DashboardView-DUqOAEyx.js → DashboardView-HNhMjAZZ.js} +1 -1
- package/dist/assets/{DashboardWidgetInspector-Dhe9hv9A.js → DashboardWidgetInspector-Cr6cJ0BC.js} +1 -1
- package/dist/assets/{DeveloperHubPage-D4ErhCeD.js → DeveloperHubPage-B3I-35Xy.js} +1 -1
- package/dist/assets/{ExpressionProvider-Cj6XEnZF.js → ExpressionProvider-CqfGEBur.js} +1 -1
- package/dist/assets/{FlowRunsPage-CJsr4xgF.js → FlowRunsPage-CATcsy8B.js} +1 -1
- package/dist/assets/{IntegrationsPage-zbcGFqxM.js → IntegrationsPage-Cq1qq5jk.js} +1 -1
- package/dist/assets/{InterfaceListPage-BJRTel_h.js → InterfaceListPage-OHu23CRA.js} +1 -1
- package/dist/assets/{ManagedByBadge-DOMbPlbf.js → ManagedByBadge-BodEaDXN.js} +1 -1
- package/dist/assets/{MarketplaceInstalledPage-CSgqJuot.js → MarketplaceInstalledPage-B5oYOVdC.js} +1 -1
- package/dist/assets/{MarketplacePackagePage-0TU_eJIx.js → MarketplacePackagePage-DnmqDFCq.js} +1 -1
- package/dist/assets/{MarketplacePage-YO75QMEO.js → MarketplacePage-C5lziiq9.js} +1 -1
- package/dist/assets/{MetadataInspector-CamKLf7x.js → MetadataInspector-BMHaVCoM.js} +1 -1
- package/dist/assets/{MetadataProvider-Bxendsnd.js → MetadataProvider-Cvue7gQ0.js} +1 -1
- package/dist/assets/{PageView-z1PfFaQS.js → PageView-H7j3JwJI.js} +1 -1
- package/dist/assets/{ProfilePage-5QuBSV4z.js → ProfilePage-BBeI_CPu.js} +1 -1
- package/dist/assets/{PublicFormsPage-CMTz6MfD.js → PublicFormsPage-Bhp5KfIY.js} +1 -1
- package/dist/assets/{RecordDetailView-DOcGflPY.js → RecordDetailView-CGxfnls1.js} +1 -1
- package/dist/assets/{RecordFormPage-C1M3jdnG.js → RecordFormPage-B8sjq5K3.js} +1 -1
- package/dist/assets/{ReportDefaultInspector-DDBJTAYx.js → ReportDefaultInspector-CmSJUILm.js} +1 -1
- package/dist/assets/{ReportView-CItKDFSn.js → ReportView-_NBbKT5l.js} +1 -1
- package/dist/assets/{RuntimeDraftBar-QF3pF8K2.js → RuntimeDraftBar-DroTFTnx.js} +1 -1
- package/dist/assets/{SearchResultsPage-Mdphx8Ca.js → SearchResultsPage-D9HdE2xf.js} +1 -1
- package/dist/assets/{SettingsHub-CtfOIqOJ.js → SettingsHub-Ca4TQg_Q.js} +1 -1
- package/dist/assets/{SettingsView-One2JiPG.js → SettingsView-6GSnMLNA.js} +1 -1
- package/dist/assets/{SystemHubPage-Dzi5_s3T.js → SystemHubPage-maebng1S.js} +1 -1
- package/dist/assets/architecture-7EHR7CIX-BdMnUPE0.js +1 -0
- package/dist/assets/architectureDiagram-3BPJPVTR-SscyJlk0.js +36 -0
- package/dist/assets/blockDiagram-GPEHLZMM-D6-9deBJ.js +132 -0
- package/dist/assets/c4Diagram-AAUBKEIU-VLeNt7tD.js +10 -0
- package/dist/assets/channel-ByUUDCyR.js +1 -0
- package/dist/assets/chunk-2J33WTMH-DyXQVMuc.js +1 -0
- package/dist/assets/chunk-3OPIFGDE-3g0dk_di.js +62 -0
- package/dist/assets/chunk-4BX2VUAB-BpAZJ7ZC.js +1 -0
- package/dist/assets/chunk-55IACEB6-BhOjfCrn.js +1 -0
- package/dist/assets/chunk-5ZQYHXKU-DG12s6lW.js +2 -0
- package/dist/assets/chunk-727SXJPM-DwSFE_v-.js +206 -0
- package/dist/assets/chunk-AQP2D5EJ-DWgSztUW.js +231 -0
- package/dist/assets/chunk-BSJP7CBP-okvguKD4.js +1 -0
- package/dist/assets/chunk-CSCIHK7Q-DfSAlgJl.js +124 -0
- package/dist/assets/chunk-FMBD7UC4-CZzqt4RW.js +15 -0
- package/dist/assets/chunk-KSCS5N6A-IxEh4Ag5.js +10 -0
- package/dist/assets/chunk-L5ZTLDWV-DW1lPBoG.js +1 -0
- package/dist/assets/chunk-LZXEDZCA-C_-aaYcd.js +1 -0
- package/dist/assets/chunk-ND2GUHAM-C1toj0H3.js +1 -0
- package/dist/assets/chunk-NNHCCRGN-Ud6GGuM7.js +159 -0
- package/dist/assets/chunk-NZK2D7GU-H2MwBqQV.js +1 -0
- package/dist/assets/chunk-O5CBEL6O-BzyWPZhZ.js +70 -0
- package/dist/assets/chunk-QZHKN3VN-ujroCBCz.js +1 -0
- package/dist/assets/chunk-WU5MYG2G-DwQt8tuZ.js +1 -0
- package/dist/assets/chunk-XPW4576I-DPNxFY7Q.js +32 -0
- package/dist/assets/classDiagram-4FO5ZUOK-B7mTyEXp.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-B7mTyEXp.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-HKJWDQRL.js +1 -0
- package/dist/assets/cytoscape.esm-h6BdjjI9.js +321 -0
- package/dist/assets/dagre-BM42HDAG-CU8nx02l.js +4 -0
- package/dist/assets/dagre-Bx709z4p.js +1 -0
- package/dist/assets/{data-adapter-Dl2IvbPC.js → data-adapter-SqbPGFBI.js} +1 -1
- package/dist/assets/diagram-2AECGRRQ-CormMz8j.js +43 -0
- package/dist/assets/diagram-5GNKFQAL-Dh1SagBx.js +10 -0
- package/dist/assets/diagram-KO2AKTUF-DcG6Z05V.js +3 -0
- package/dist/assets/diagram-LMA3HP47-DrVLZ6ZE.js +24 -0
- package/dist/assets/diagram-OG6HWLK6-C4_MMUc2.js +24 -0
- package/dist/assets/dist-Cna34lZe.js +1 -0
- package/dist/assets/erDiagram-TEJ5UH35-BZH_OrBL.js +85 -0
- package/dist/assets/eventmodeling-FCH6USID-CFiyy8DS.js +1 -0
- package/dist/assets/flowDiagram-I6XJVG4X-CnjHQUK0.js +162 -0
- package/dist/assets/{framework-D7UWfRl4.js → framework-CVigpa4L.js} +11 -11
- package/dist/assets/ganttDiagram-6RSMTGT7-rVbHlqzo.js +292 -0
- package/dist/assets/gitGraph-WXDBUCRP-9vsQCBlr.js +1 -0
- package/dist/assets/gitGraphDiagram-PVQCEYII-CH2LgClA.js +106 -0
- package/dist/assets/graphlib-B8gBHxth.js +1 -0
- package/dist/assets/{highlighted-body-OFNGDK62-Dgcl8-h_.js → highlighted-body-OFNGDK62-B0SlzSfX.js} +1 -1
- package/dist/assets/index-TlmJdKxQ.js +4 -0
- package/dist/assets/index-mrmp6qU6.css +2 -0
- package/dist/assets/info-J43DQDTF-CfWeH1Bg.js +1 -0
- package/dist/assets/infoDiagram-5YYISTIA-CRC7ojj-.js +2 -0
- package/dist/assets/ishikawaDiagram-YF4QCWOH-8v73fBR1.js +70 -0
- package/dist/assets/journeyDiagram-JHISSGLW-DbRK-WaU.js +139 -0
- package/dist/assets/kanban-definition-UN3LZRKU-BggLxHvZ.js +89 -0
- package/dist/assets/katex-Vhh-h91d.js +257 -0
- package/dist/assets/{marketplaceApi-Do90JxGv.js → marketplaceApi-Cw1CUgrg.js} +1 -1
- package/dist/assets/mergeServerFields-DKhjl-pc.js +7 -0
- package/dist/assets/mermaid-GHXKKRXX-DOu_26de.js +1 -0
- package/dist/assets/mermaid-parser.core-iuxcj-n_.js +3 -0
- package/dist/assets/mermaid.core-C41Aiku8.js +8 -0
- package/dist/assets/metadata-admin-2GXysZST.js +19 -0
- package/dist/assets/mindmap-definition-RKZ34NQL-kqhi9XCR.js +96 -0
- package/dist/assets/packet-YPE3B663-C0xexAqH.js +1 -0
- package/dist/assets/pie-LRSECV5Y-DbQVOiyX.js +1 -0
- package/dist/assets/pieDiagram-4H26LBE5-9fHcPmFE.js +30 -0
- package/dist/assets/{plugin-calendar-DSvXqOQV.js → plugin-calendar-BWXBFRkE.js} +1 -1
- package/dist/assets/plugin-charts-Ck5EMx6H.js +7 -0
- package/dist/assets/{plugin-chatbot-D6s22V14.js → plugin-chatbot-CBg5Zd15.js} +7 -7
- package/dist/assets/{plugin-dashboard-PEMuLOVn.js → plugin-dashboard-DJturdHm.js} +1 -1
- package/dist/assets/plugin-form-CM6RvRf2.js +1 -0
- package/dist/assets/{plugin-gantt-CB1bbY8J.js → plugin-gantt-DO7NQ-4h.js} +1 -1
- package/dist/assets/plugin-grid-BsA9XQ8Q.js +6 -0
- package/dist/assets/{plugin-kanban-BxxI6fit.js → plugin-kanban-DTWtfUzv.js} +1 -1
- package/dist/assets/{plugin-map-B-TiJAz8.js → plugin-map-B-PDDoET.js} +1 -1
- package/dist/assets/plugin-markdown--e1MOP0x.js +113 -0
- package/dist/assets/{plugin-report-jQPIUbaf.js → plugin-report-BTvuqkOa.js} +1 -1
- package/dist/assets/{plugin-timeline-BNRp2sKQ.js → plugin-timeline-Dmqt8jd_.js} +1 -1
- package/dist/assets/{plugin-view-BeiRMGis.js → plugin-view-CmAdMV7R.js} +1 -1
- package/dist/assets/{plugins-views-D0zS0yz2.js → plugins-views-BP1sk9hy.js} +1 -1
- package/dist/assets/quadrantDiagram-W4KKPZXB-CaMxia_k.js +7 -0
- package/dist/assets/radar-GUYGQ44K-DapGfmwo.js +1 -0
- package/dist/assets/requirementDiagram-4Y6WPE33-CXwY4Gdd.js +84 -0
- package/dist/assets/{resolveActionParams-eRBdMG9b.js → resolveActionParams-CWIOgcoF.js} +1 -1
- package/dist/assets/rough.esm-CSKSodPl.js +1 -0
- package/dist/assets/runtime-config-BeHVOPm3.js +1 -0
- package/dist/assets/sankeyDiagram-5OEKKPKP-KEb3hSPZ.js +40 -0
- package/dist/assets/sequenceDiagram-3UESZ5HK-BfbOOh3M.js +162 -0
- package/dist/assets/{skeletons-DNzeXHI1.js → skeletons-D42JPA2I.js} +1 -1
- package/dist/assets/{src-LBsSMdO2.js → src-B-bY4wJT.js} +1 -1
- package/dist/assets/src-CVz7aDdY.js +1 -0
- package/dist/assets/stateDiagram-AJRCARHV-BLJI6xj_.js +1 -0
- package/dist/assets/stateDiagram-v2-BHNVJYJU-DPQJ1_JB.js +1 -0
- package/dist/assets/timeline-definition-PNZ67QCA-aiklZXLq.js +120 -0
- package/dist/assets/treeView-BLDUP644-Byr_7ESV.js +1 -0
- package/dist/assets/treemap-LRROVOQU-B6DiJnlo.js +1 -0
- package/dist/assets/{types-D2P-aXxM.js → types-HYNWZWMw.js} +1 -1
- package/dist/assets/ui-components-BK0FqwOC.js +42 -0
- package/dist/assets/{ui-layout-DYMEUX5t.js → ui-layout-DM7b0Gu1.js} +1 -1
- package/dist/assets/{useActionModal-VGsmP3uO.js → useActionModal-DcFjU7Dq.js} +1 -1
- package/dist/assets/vendor-charts-fo4ZbB_t.js +39 -0
- package/dist/assets/vendor-i18n-Bz5UncqE.js +1 -0
- package/dist/assets/{vendor-markdown-BXE1apAC.js → vendor-markdown-DIJxJfmj.js} +3 -3
- package/dist/assets/vennDiagram-CIIHVFJN-DsKC4yvC.js +34 -0
- package/dist/assets/wardley-L42UT6IY-f1iiSYpj.js +1 -0
- package/dist/assets/wardleyDiagram-YWT4CUSO-DbrUmWlY.js +78 -0
- package/dist/assets/xychartDiagram-2RQKCTM6-B4biX1Sz.js +7 -0
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/index-BjfDho4T.js +0 -4
- package/dist/assets/index-CJFqfWpW.css +0 -2
- package/dist/assets/mergeServerFields-Co1NIO7_.js +0 -7
- package/dist/assets/mermaid-GHXKKRXX-BY4z2Mh6.js +0 -1
- package/dist/assets/metadata-admin-B-99o4dC.js +0 -19
- package/dist/assets/plugin-charts-EoSn84Ag.js +0 -7
- package/dist/assets/plugin-form-MXrWd_1Z.js +0 -1
- package/dist/assets/plugin-grid-D9HjQh3d.js +0 -6
- package/dist/assets/plugin-markdown-BUIHw2kZ.js +0 -113
- package/dist/assets/runtime-config-ir5bt3TX.js +0 -1
- package/dist/assets/ui-components-Clv7N77v.js +0 -42
- package/dist/assets/vendor-charts-DAigH0Ti.js +0 -39
- package/dist/assets/vendor-i18n-CdF5ccW5.js +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{u as e}from"./vendor-charts-fo4ZbB_t.js";import{n as t,r as n}from"./src-CVz7aDdY.js";import{A as r,B as i,M as a,T as o,b as s,g as c,x as l,z as u}from"./chunk-CSCIHK7Q-DfSAlgJl.js";import{a as d,r as f,u as p}from"./chunk-5ZQYHXKU-DG12s6lW.js";import{n as m,r as h}from"./chunk-O5CBEL6O-BzyWPZhZ.js";import{n as g,t as _}from"./chunk-L5ZTLDWV-DW1lPBoG.js";import{a as v,i as y,r as b,t as x}from"./chunk-NZK2D7GU-H2MwBqQV.js";import{t as S}from"./rough.esm-CSKSodPl.js";var C=t(async(t,n,r)=>{let i,a=n.useHtmlLabels||c(l()?.htmlLabels);i=r||`node default`;let o=t.insert(`g`).attr(`class`,i).attr(`id`,n.domId||n.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,p(n.labelStyle)),f;f=n.label===void 0?``:typeof n.label==`string`?n.label:n.label[0];let h=!!n.icon||!!n.img,g=n.labelType===`markdown`,v=await m(s,u(d(f),l()),{useHtmlLabels:a,width:n.width||l().flowchart?.wrappingWidth,classes:g?`markdown-node-label`:``,style:n.labelStyle,addSvgBackground:h,markdown:g},l()),y=v.getBBox(),b=(n?.padding??0)/2;if(a){let t=v.children[0],n=e(v);await _(t,f),y=t.getBoundingClientRect(),n.attr(`width`,y.width),n.attr(`height`,y.height)}return a?s.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`):s.attr(`transform`,`translate(0, `+-y.height/2+`)`),n.centerLabel&&s.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:y,halfPadding:b,label:s}},`labelHelper`),w=t(async(t,n,r)=>{let i=r.useHtmlLabels??o(l()),a=t.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await m(a,u(d(n),l()),{useHtmlLabels:i,width:r.width||l()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=s.getBBox(),f=r.padding/2;if(o(l())){let t=s.children[0],n=e(s);c=t.getBoundingClientRect(),n.attr(`width`,c.width),n.attr(`height`,c.height)}return i?a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`):a.attr(`transform`,`translate(0, `+-c.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:t,bbox:c,halfPadding:f,label:a}},`insertLabel`),T=t((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),E=t((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function D(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}t(D,`createPathFromPoints`);function O(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(O,`generateFullSineWavePoints`);function k(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(k,`generateCirclePoints`);function A(e){let n=Array.from(e.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=t((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}t(A,`mergePaths`);var j=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`),M=t(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=l(),c=o(s);return await m(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`),N=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`),P=t(async(t,r)=>{n.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:h}=y(r),_=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),b=o(i),x=_.insert(`g`).attr(`class`,`cluster-label `),C;C=r.labelType===`markdown`?await m(x,r.label,{style:r.labelStyle,useHtmlLabels:b,isNode:!0,width:r.width}):await M(x,r.label,r.labelStyle||``,!1,!0);let w=C.getBBox();if(o(i)){let t=C.children[0],n=e(C);w=t.getBoundingClientRect(),n.attr(`width`,w.width),n.attr(`height`,w.height)}let T=r.width<=w.width+r.padding?w.width+r.padding:r.width;r.width<=w.width+r.padding?r.diff=(T-r.width)/2-r.padding:r.diff=-r.padding;let E=r.height,D=r.x-T/2,O=r.y-E/2;n.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),t=v(r,{roughness:.7,fill:c,stroke:u,fillWeight:3,seed:s}),i=e.path(N(D,O,T,E,0),t);k=_.insert(()=>(n.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,h.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=g(i);if(x.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=x.select(`span`);e&&e.attr(`style`,d)}let P=k.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`rect`),F={rect:P,squareRect:P,roundedWithTitle:t(async(t,n)=>{let r=l(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:s,compositeBackground:c,compositeTitleBackground:u,nodeBorder:d}=i,f=t.insert(`g`).attr(`class`,n.cssClasses).attr(`id`,n.domId).attr(`data-id`,n.id).attr(`data-look`,n.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=await M(m,n.label,n.labelStyle,void 0,!0),_=g.getBBox();if(o(r)){let t=g.children[0],n=e(g);_=t.getBoundingClientRect(),n.attr(`width`,_.width),n.attr(`height`,_.height)}let v=0*n.padding,y=v/2,b=(n.width<=_.width+n.padding?_.width+n.padding:n.width)+v;n.width<=_.width+n.padding?n.diff=(b-n.width)/2-n.padding:n.diff=-n.padding;let x=n.height+v,C=n.height+v-_.height-6,w=n.x-b/2,T=n.y-x/2;n.width=b;let E=n.y-n.height/2-y+_.height+2,D;if(n.look===`handDrawn`){let e=n.cssClasses.includes(`statediagram-cluster-alt`),t=S.svg(f),r=n.rx||n.ry?t.path(N(w,T,b,x,10),{roughness:.7,fill:u,fillStyle:`solid`,stroke:d,seed:a}):t.rectangle(w,T,b,x,{seed:a});D=f.insert(()=>r,`:first-child`);let i=t.rectangle(w,E,b,C,{fill:e?s:c,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});D=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else D=p.insert(`rect`,`:first-child`),D.attr(`class`,`outer`).attr(`x`,w).attr(`y`,T).attr(`width`,b).attr(`height`,x).attr(`data-look`,n.look),h.attr(`class`,`inner`).attr(`x`,w).attr(`y`,E).attr(`width`,b).attr(`height`,C);return m.attr(`transform`,`translate(${n.x-_.width/2}, ${T+1-(o(r)?0:3)})`),n.height=D.node().getBBox().height,n.offsetX=0,n.offsetY=_.height-n.padding/2,n.labelBBox=_,n.intersect=function(e){return j(n,e)},{cluster:f,labelBBox:_}},`roundedWithTitle`),noteGroup:t((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),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 j(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:t((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=l(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,c=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-c/2,f=t.y-u/2;t.width=c;let p;if(t.look===`handDrawn`){let e=S.svg(a).rectangle(d,f,c,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,d).attr(`y`,f).attr(`width`,c).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 j(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:t(async(t,r)=>{n.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:h}=y(r),_=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),b=o(i),x=_.insert(`g`).attr(`class`,`cluster-label `),C=await m(x,r.label,{style:r.labelStyle,useHtmlLabels:b,isNode:!0,width:r.width}),w=C.getBBox();if(o(i)){let t=C.children[0],n=e(C);w=t.getBoundingClientRect(),n.attr(`width`,w.width),n.attr(`height`,w.height)}let T=r.width<=w.width+r.padding?w.width+r.padding:r.width;r.width<=w.width+r.padding?r.diff=(T-r.width)/2-r.padding:r.diff=-r.padding;let E=r.height,D=r.x-T/2,O=r.y-E/2;n.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),t=v(r,{roughness:.7,fill:c,stroke:u,fillWeight:4,seed:s}),i=e.path(N(D,O,T,E,r.rx),t);k=_.insert(()=>(n.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,h.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=g(i);if(x.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=x.select(`span`);e&&e.attr(`style`,d)}let M=k.node().getBBox();return r.offsetX=0,r.width=M.width,r.height=M.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`kanbanSection`)},I=new Map,ee=t(async(e,t)=>{let n=await F[t.shape||`rect`](e,t);return I.set(t.id,n),n},`insertCluster`),te=t(()=>{I=new Map},`clear`);function L(e,t){return e.intersect(t)}t(L,`intersectNode`);var R=L;function ne(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(ne,`intersectEllipse`);var z=ne;function B(e,t,n){return z(e,t,t,n)}t(B,`intersectCircle`);var V=B;function H(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&&re(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&&re(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(H,`intersectLine`);function re(e,t){return e*t>0}t(re,`sameSign`);var ie=H;function U(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=ie(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(U,`intersectPolygon`);var W={node:R,circle:V,ellipse:z,polygon:U,rect:j};function G(e,t){let{labelStyles:r}=y(t);t.labelStyle=r;let i=E(t),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,t.domId||t.id),{cssStyles:s}=t,c=S.svg(o),l=v(t,{fill:`black`,stroke:`none`,fillStyle:`solid`});t.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`,p(s)),T(t,d),t.intersect=function(e){return n.info(`Circle intersect`,t,1,e),W.circle(t,1,e)},o}t(G,`anchor`);function K(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(K,`generateArcPoints`);function ae(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}t(ae,`calculateArcSagitta`);async function oe(e,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=t(e=>e+s,`calcTotalHeight`),l=t(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await C(e,n,E(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ae(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:b}=n,x=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...K(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...K(g/2,_/2,g/2,-_/2,p,m,!0)],w=S.svg(u),O=v(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`);let k=D(x),A=w.path(k,O),j=u.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,i),j.attr(`transform`,`translate(${p/2}, 0)`),T(n,j),n.intersect=function(e){return W.polygon(n,x,e)},u}t(oe,`bowTieRect`);function q(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(q,`insertPolygonShape`);var se=12;async function ce(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+se),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+se,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+se},{x:0+se,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=v(t,{}),r=D(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(s,l,u,p);return r&&m.attr(`style`,r),T(t,m),t.intersect=function(e){return W.polygon(t,p,e)},s}t(ce,`card`);function le(e,t){let{nodeStyles:n}=y(t);t.label=``;let r=e.insert(`g`).attr(`class`,E(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=S.svg(r),c=v(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=D(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 W.polygon(t,o,e)},r}t(le,`choice`);async function ue(e,t,r){let{labelStyles:i,nodeStyles:a}=y(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await C(e,t,E(t)),l=r?.padding??c,u=t.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=S.svg(o),n=v(t,{}),r=e.circle(0,0,u*2,n);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(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 T(t,d),t.calcIntersect=function(e,t){let n=e.width/2;return W.circle(e,n,t)},t.intersect=function(e){return n.info(`Circle intersect`,t,u,e),W.circle(t,u,e)},o}t(ue,`circle`);function de(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}
|
|
2
|
+
M ${i.x},${i.y} L ${o.x},${o.y}`}t(de,`createLine`);function fe(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r,t.label=``;let a=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:s}=t,c=S.svg(a),l=v(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=de(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),T(t,p),t.intersect=function(e){return n.info(`crossedCircle intersect`,t,{radius:o,point:e}),W.circle(t,o,e)},a}t(fe,`crossedCircle`);function J(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(J,`generateCirclePoints`);async function pe(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=S.svg(i),g=v(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=D(p).replace(`Z`,``),b=h.path(_,g),x=D(m),w=h.path(x,{...g}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,m,e)},i}t(pe,`curlyBraceLeft`);function Y(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(Y,`generateCirclePoints`);async function me(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],m=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=S.svg(i),g=v(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=D(p).replace(`Z`,``),b=h.path(_,g),x=D(m),w=h.path(x,{...g}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,m,e)},i}t(me,`curlyBraceRight`);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 he(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],m=[...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],g=S.svg(i),_=v(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let b=D(p).replace(`Z`,``),x=g.path(b,_),w=D(m).replace(`Z`,``),O=g.path(w,_),k=D(h),A=g.path(k,{..._}),j=i.insert(`g`,`:first-child`);return j.insert(()=>A,`:first-child`).attr(`stroke-opacity`,0),j.insert(()=>x,`:first-child`),j.insert(()=>O,`:first-child`),j.attr(`class`,`text`),f&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,j),t.intersect=function(e){return W.polygon(t,h,e)},i}t(he,`curlyBraces`);async function ge(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=S.svg(s),m=v(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=l,g=u,_=h-d,b=g/4,x=[{x:_,y:0},{x:b,y:0},{x:0,y:g/2},{x:b,y:g},{x:_,y:g},...k(-_,-g/2,d,50,270,90)],w=D(x),O=p.path(w,m),A=s.insert(()=>O,`:first-child`);return A.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,r),A.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,A),t.intersect=function(e){return W.polygon(t,x,e)},s}t(ge,`curvedTrapezoid`);var _e=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`),ve=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`),ye=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),be=8,xe=8;async function Se(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-o,t.width<xe&&(t.width=xe);let n=e/2/(2.5+e/50);t.height=(t.height??0)-a-n*3,t.height<be&&(t.height=be)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t.width?t.width:c.width)+o,d=u/2,f=d/(2.5+u/50),m=(t.height?t.height:c.height)+a+f,h,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=ve(0,0,u,m,d,f),r=ye(0,f,u,m,d,f),i=v(t,{}),a=e.path(n,i),o=e.path(r,v(t,{fill:`none`}));h=s.insert(()=>o,`:first-child`),h=s.insert(()=>a,`:first-child`),h.attr(`class`,`basic label-container`),g&&h.attr(`style`,g)}else{let e=_e(0,0,u,m,d,f);h=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(g)).attr(`style`,r)}return h.attr(`label-offset-y`,f),h.attr(`transform`,`translate(${-u/2}, ${-(m/2+f)})`),T(t,h),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(e){let n=W.rect(t,e),r=n.x-(t.x??0);if(d!=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-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}t(Se,`cylinder`);async function Ce(e,t,n){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await C(e,t,E(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:m}=t,{cssStyles:h}=t;if(n?.rx&&n.ry&&(f=n.rx,m=n.ry),t.look===`handDrawn`){let e=S.svg(a),n=v(t,{}),r=f||m?e.path(N(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`,p(h))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,p(f)).attr(`ry`,p(m)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return T(t,d),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return W.rect(t,e)},a}t(Ce,`drawRect`);async function we(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ce(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=S.svg(c),n=v(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}t(we,`datastore`);async function Te(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=S.svg(o),g=v(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=h.polygon(_.map(e=>[e.x,e.y]),g),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),T(t,x),t.intersect=function(e){return W.rect(t,e)},o}t(Te,`dividedRectangle`);async function Ee(e,t){let{labelStyles:r,nodeStyles:i}=y(t),a=t.look===`neo`?12:5;t.labelStyle=r;let o=t.padding??0,s=t.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.width?t?.width/2:l.width/2)+(s??0),d=u-a,f,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=v(t,{roughness:.2,strokeWidth:2.5}),r=v(t,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,n),a=e.circle(0,0,d*2,r);f=c.insert(`g`,`:first-child`),f.attr(`class`,p(t.cssClasses)).attr(`style`,p(m)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=c.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return T(t,f),t.intersect=function(e){return n.info(`DoubleCircle intersect`,t,u,e),W.circle(t,u,e)},c}t(Ee,`doublecircle`);function De(e,t,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=y(t);t.label=``,t.labelStyle=i;let o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=S.svg(o),{nodeBorder:l}=r,u=v(t,{fillStyle:`solid`});t.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&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),T(t,f),t.intersect=function(e){return n.info(`filledCircle intersect`,t,{radius:7,point:e}),W.circle(t,7,e)},o}t(De,`filledCircle`);var Oe=10,ke=10;async function Ae(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let a=t.padding??0,o=t.look===`neo`?a*2:a;(t.width||t.height)&&(t.height=t?.height??0,t.height<Oe&&(t.height=Oe),t.width=(t?.width??0)-o-o/2,t.width<ke&&(t.width=ke));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+(o??0),d=t?.height?t?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=t,h=S.svg(s),g=v(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=D(p),b=h.path(_,g),x=s.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),t.width=u,t.height=d,T(t,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(t.padding??0)/2+(c.y-(c.top??0))})`),t.intersect=function(e){return n.info(`Triangle intersect`,t,p,e),W.polygon(t,p,e)},s}t(Ae,`flippedTriangle`);function je(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=y(t);t.label=``;let o=e.insert(`g`).attr(`class`,E(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=S.svg(o),p=v(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),T(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 W.rect(t,e)},o}t(je,`forkJoin`);async function Me(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let a=t.look===`neo`?16:t.padding??0,o=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10),t.width=(t?.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:Math.max(15,c.width))+a*2,u=(t?.height?t?.height:Math.max(10,c.height))+o*2,d=u/2,{cssStyles:f}=t,p=S.svg(s),m=v(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...k(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],g=D(h),_=p.path(g,m),b=s.insert(()=>_,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),i&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,i),T(t,b),t.intersect=function(e){return n.info(`Pill intersect`,t,{radius:d,point:e}),W.polygon(t,h,e)},s}t(Me,`halfRoundedRectangle`);var Ne=t((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function Pe(e,t){let{labelStyles:n,nodeStyles:r}=y(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=v(t,{}),r=Ne(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,T(t,m),t.intersect=function(e){return W.polygon(t,p,e)},c}t(Pe,`hexagon`);async function Fe(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.label=``,t.labelStyle=r;let{shapeSvg:a}=await C(e,t,E(t)),o=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:c}=t,l=S.svg(a),u=v(t,{});t.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=D(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),T(t,m),t.intersect=function(e){return n.info(`Pill intersect`,t,{points:d}),W.polygon(t,d,e)},a}t(Fe,`hourglass`);async function Ie(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(e,t,`icon-shape default`),p=t.pos===`t`,m=c,g=c,{nodeBorder:_}=r,{stylesMap:b}=x(t),w=-g/2,E=-m/2,D=t.label?8:0,O=S.svg(u),k=v(t,{stroke:`none`,fill:`none`});t.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`);let A=O.rectangle(w,E,g,m,k),j=Math.max(g,d.width),M=m+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),P=u.insert(()=>A,`:first-child`),F=u.insert(()=>N);if(t.icon){let e=u.append(`g`);e.html(`<g>${await h(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??_};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-M/2:M/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+D/2:-d.height/2-D/2})`),T(t,F),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let r=t.x??0,i=t.y??0,a=t.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+D},{x:r+g/2,y:i-a/2+d.height+D},{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+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/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-g/2,y:i-a/2+m}],W.polygon(t,o,e)},u}t(Ie,`icon`);async function Le(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(e,t,`icon-shape default`),p=t.label?8:0,m=t.pos===`t`,{nodeBorder:g,mainBkg:_}=r,{stylesMap:b}=x(t),w=S.svg(u),E=v(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`),E.stroke=b.get(`fill`)??_;let D=u.append(`g`);t.icon&&D.html(`<g>${await h(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let O=D.node().getBBox(),k=O.width,A=O.height,j=O.x,M=O.y,N=Math.max(k,A)*Math.SQRT2+40,P=w.circle(0,0,N,E),F=Math.max(N,d.width),I=N+d.height+p,ee=w.rectangle(-F/2,-I/2,F,I,{...E,fill:`transparent`,stroke:`none`}),te=u.insert(()=>P,`:first-child`),L=u.insert(()=>ee);return D.attr(`transform`,`translate(${-k/2-j},${m?d.height/2+p/2-A/2-M:-d.height/2-p/2-A/2-M})`),D.attr(`style`,`color: ${b.get(`stroke`)??g};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),te.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),T(t,L),t.intersect=function(e){return n.info(`iconSquare intersect`,t,e),W.rect(t,e)},u}t(Le,`iconCircle`);async function Re(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(e,t,`icon-shape default`),m=t.pos===`t`,g=c+f*2,_=c+f*2,{nodeBorder:b,mainBkg:w}=r,{stylesMap:E}=x(t),D=-_/2,O=-g/2,k=t.label?8:0,A=S.svg(u),j=v(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,_,g,5),j),P=Math.max(_,d.width),F=g+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>M,`:first-child`).attr(`class`,`icon-shape2`),te=u.insert(()=>I);if(t.icon){let e=u.append(`g`);e.html(`<g>${await h(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+k/2:-d.height/2-k/2})`),T(t,te),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let r=t.x??0,i=t.y??0,a=t.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+k},{x:r+_/2,y:i-a/2+d.height+k},{x:r+_/2,y:i+a/2},{x:r-_/2,y:i+a/2},{x:r-_/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-_/2,y:i-a/2},{x:r+_/2,y:i-a/2},{x:r+_/2,y:i-a/2+g},{x:r+d.width/2,y:i-a/2+g},{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+g},{x:r-_/2,y:i-a/2+g}],W.polygon(t,o,e)},u}t(Re,`iconRounded`);async function ze(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(e,t,`icon-shape default`),m=t.pos===`t`,g=c+f*2,_=c+f*2,{nodeBorder:b,mainBkg:w}=r,{stylesMap:E}=x(t),D=-_/2,O=-g/2,k=t.label?8:0,A=S.svg(u),j=v(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,_,g,.1),j),P=Math.max(_,d.width),F=g+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>M,`:first-child`),te=u.insert(()=>I);if(t.icon){let e=u.append(`g`);e.html(`<g>${await h(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+k/2:-d.height/2-k/2})`),T(t,te),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let r=t.x??0,i=t.y??0,a=t.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+k},{x:r+_/2,y:i-a/2+d.height+k},{x:r+_/2,y:i+a/2},{x:r-_/2,y:i+a/2},{x:r-_/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-_/2,y:i-a/2},{x:r+_/2,y:i-a/2},{x:r+_/2,y:i-a/2+g},{x:r+d.width/2,y:i-a/2+g},{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+g},{x:r-_/2,y:i-a/2+g}],W.polygon(t,o,e)},u}t(ze,`iconSquare`);async function Be(e,t,{config:{flowchart:r}}){let i=new Image;i.src=t?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));t.imageAspectRatio=a/o;let{labelStyles:s}=y(t);t.labelStyle=s;let c=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let l=Math.max(t.label?c??0:0,t?.assetWidth??a),u=t.constraint===`on`&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,d=t.constraint===`on`?u/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await C(e,t,`image-shape default`),h=t.pos===`t`,g=-u/2,_=-d/2,b=t.label?8:0,x=S.svg(f),w=v(t,{});t.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let E=x.rectangle(g,_,u,d,w),D=Math.max(u,p.width),O=d+p.height+b,k=x.rectangle(-D/2,-O/2,D,O,{...w,fill:`none`,stroke:`none`}),A=f.insert(()=>E,`:first-child`),j=f.insert(()=>k);if(t.img){let e=f.append(`image`);e.attr(`href`,t.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?O/2-d:-O/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),A.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),T(t,j),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let r=t.x??0,i=t.y??0,a=t.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+b},{x:r+u/2,y:i-a/2+p.height+b},{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+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{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}],W.polygon(t,o,e)},f}t(Be,`imageSquare`);async function Ve(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(c.width+(o??0)*2,t?.width??0),u=Math.max(c.height+(a??0)*2,t?.height??0),d=[{x:0,y:0},{x:l,y:0},{x:l+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=v(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),p&&f.attr(`style`,p)}else f=q(s,l,u,d);return r&&f.attr(`style`,r),t.width=l,t.height=u,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(Ve,`inv_trapezoid`);async function He(e,t){let{shapeSvg:n,bbox:r,label:i}=await C(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))})`),T(t,a),t.intersect=function(e){return W.rect(t,e)},n}t(He,`labelRect`);async function Ue(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=v(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(Ue,`lean_left`);async function We(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=v(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(We,`lean_right`);function Ge(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.label=``,t.labelStyle=r;let a=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:o}=t,s=Math.max(35,t?.width??0),c=Math.max(35,t?.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=S.svg(a),d=v(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=D(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),T(t,m),t.intersect=function(e){return n.info(`lightningBolt intersect`,t,e),W.polygon(t,l,e)},a}t(Ge,`lightningBolt`);var Ke=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`),qe=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`),Je=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ye=10,Xe=10;async function Ze(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<Xe&&(t.width=Xe);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<Ye&&(t.height=Ye)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),m=(t?.height?t?.height:c.height)+f+o*2,h=m*.1,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=qe(0,0,u,m,d,f,h),r=Je(0,f,u,m,d,f),i=v(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),g=s.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Ke(0,0,u,m,d,f,h);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(_)).attr(`style`,r)}return g.attr(`label-offset-y`,f),g.attr(`transform`,`translate(${-u/2}, ${-(m/2+f)})`),T(t,g),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=W.rect(t,e),r=n.x-(t.x??0);if(d!=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-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}t(Ze,`linedCylinder`);async function Qe(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=S.svg(s),g=v(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...O(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=h.polygon(_.map(e=>[e.x,e.y]),g),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),T(t,x),t.intersect=function(e){return W.polygon(t,_,e)},s}t(Qe,`linedWaveEdgedRect`);async function $e(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,b=S.svg(c),x=v(t,{}),w=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],O=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let k=D(w),j=b.path(k,x),M=D(O),N=b.path(M,x);t.look!==`handDrawn`&&(j=A(j),N=A(N));let P=c.insert(`g`,`:first-child`);return P.insert(()=>j),P.insert(()=>N),P.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),T(t,P),t.intersect=function(e){return W.polygon(t,w,e)},c}t($e,`multiRect`);async function et(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,b=O(h-10,g+m+10,h+d-10,g+m+10,p,.8),x=b?.[b.length-1],w=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...b,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],k=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:g},{x:h,y:g}],A=S.svg(i),j=v(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let M=D(w),N=A.path(M,j),P=D(k),F=A.path(P,j),I=i.insert(()=>N,`:first-child`);return I.insert(()=>F),I.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,r),I.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),T(t,I),t.intersect=function(e){return W.polygon(t,w,e)},i}t(et,`multiWaveEdgedRectangle`);async function tt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await C(e,t,E(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=S.svg(a),g=v(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=h.rectangle(f,p,u,d,g),b=a.insert(()=>_,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,b),t.intersect=function(e){return W.rect(t,e)},a}t(tt,`note`);var nt=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 rt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),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=S.svg(i),n=v(t,{}),r=nt(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=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),T(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=W.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}t(rt,`question`);async function it(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width??c.width)+(t.look===`neo`?a*2:a),d=(t?.height??c.height)+(t.look===`neo`?o*2:o),f=-u/2,p=-d/2,m=p/2,h=[{x:f+m,y:p},{x:f,y:0},{x:f+m,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:g}=t,_=S.svg(s),b=v(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=D(h),w=_.path(x,b),O=s.insert(()=>w,`:first-child`);return O.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-m/2},0)`),l.attr(`transform`,`translate(${-m/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,h,e)},s}t(it,`rect_left_inv_arrow`);async function at(t,r){let{labelStyles:i,nodeStyles:a}=y(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=t.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),u=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await M(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(l())){let t=m.children[0],n=e(m);h=t.getBoundingClientRect(),n.attr(`width`,h.width),n.attr(`height`,h.height)}n.info(`Text 2`,f);let g=f||[],_=m.getBBox(),b=await M(d,Array.isArray(g)?g.join(`<br/>`):g,r.labelStyle,!0,!0),x=b.children[0],C=e(b);h=x.getBoundingClientRect(),C.attr(`width`,h.width),C.attr(`height`,h.height);let w=(r.padding||0)/2;e(b).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+w+5)+`)`),e(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-w+3)+`)`);let E=h.width+(r.padding||0),D=h.height+(r.padding||0),O=-h.width/2-w,k=-h.height/2-w,A,j;if(r.look===`handDrawn`){let e=S.svg(c),t=v(r,{}),i=e.path(N(O,k,E,D,r.rx||0),t),a=e.line(-h.width/2-w,-h.height/2-w+_.height+w,h.width/2+w,-h.height/2-w+_.height+w,t);j=c.insert(()=>(n.debug(`Rough node insert CXC`,i),a),`:first-child`),A=c.insert(()=>(n.debug(`Rough node insert CXC`,i),i),`:first-child`)}else A=u.insert(`rect`,`:first-child`),j=u.insert(`line`),A.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-w).attr(`y`,-h.height/2-w).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),j.attr(`class`,`divider`).attr(`x1`,-h.width/2-w).attr(`x2`,h.width/2+w).attr(`y1`,-h.height/2-w+_.height+w).attr(`y2`,-h.height/2-w+_.height+w);return T(r,A),r.intersect=function(e){return W.rect(r,e)},c}t(at,`rectWithTitle`);async function ot(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ce(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}t(ot,`roundedRect`);var Z=8;async function st(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,f=u,m=Z-l/2,h=-u/2,{cssStyles:g}=t,_=S.svg(o),b=v(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m+d,y:h},{x:m+d,y:h+f},{x:m-Z,y:h+f},{x:m-Z,y:h},{x:m,y:h},{x:m,y:h+f}],w=_.polygon(x.map(e=>[e.x,e.y]),b),D=o.insert(()=>w,`:first-child`);return D.attr(`class`,`basic label-container outer-path`).attr(`style`,p(g)),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),g&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return W.rect(t,e)},o}t(st,`shadedProcess`);async function ct(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=S.svg(s),b=v(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],w=D(x),O=_.path(w,b),k=s.insert(()=>O,`:first-child`);return k.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,r),k.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),T(t,k),t.intersect=function(e){return W.polygon(t,x,e)},s}t(ct,`slopedRect`);async function lt(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Ce(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}t(lt,`squareRect`);async function ut(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=S.svg(s),m=v(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...k(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...k(u/2-d,0,d,50,270,450)],g=D(h),_=p.path(g,m),b=s.insert(()=>_,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),T(t,b),t.intersect=function(e){return W.polygon(t,h,e)},s}t(ut,`stadium`);async function dt(e,t){return Ce(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}t(dt,`state`);function ft(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=S.svg(u),f=v(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return T(t,_),t.intersect=function(e){return W.circle(t,(t.width??0)/2,e)},u}t(ft,`stateEnd`);function pt(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=S.svg(a).circle(0,0,t.width,b(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return T(t,o),t.intersect=function(e){return W.circle(t,(t.width??7)/2,e)},a}t(pt,`stateStart`);var mt=8;async function ht(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+2*mt+a,u=(t?.height??c.height)+o,d=l-2*mt,f=u,m=-l/2,h=-u/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=S.svg(s),n=v(t,{}),r=e.rectangle(m,h,d+16,f,n),i=e.line(m+mt,h,m+mt,h+f,n),a=e.line(m+mt+d,h,m+mt+d,h+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,p(c)),T(t,o)}else{let e=q(s,d,f,g);r&&e.attr(`style`,r),T(t,e)}return t.intersect=function(e){return W.polygon(t,g,e)},s}t(ht,`subroutine`);var gt=.2;async function _t(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-gt*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height?t?.height:c.height)+o*2,u=gt*l,d=gt*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=S.svg(s),b=v(t,{}),x=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],w=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let O=D(x),k=_.path(O,b),A=D(w),j=_.path(A,{...b,fillStyle:`solid`}),M=s.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),T(t,M),t.intersect=function(e){return W.polygon(t,x,e)},s}t(_t,`taggedRect`);async function vt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(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/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=S.svg(i),h=v(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...O(-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,b=-f/2-d*.4,x=[{x:_+s-u,y:(b+c)*1.3},{x:_+s,y:b+c-d},{x:_+s,y:(b+c)*.9},...O(_+s,(b+c)*1.25,_+s-u,(b+c)*1.3,-c*.02,.5)],w=D(g),k=m.path(w,h),A=D(x),j=m.path(A,{...h,fillStyle:`solid`}),M=i.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.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))})`),T(t,M),t.intersect=function(e){return W.polygon(t,g,e)},i}t(vt,`taggedWaveEdgedRectangle`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),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),T(t,u),t.intersect=function(e){return W.rect(t,e)},i}t(yt,`text`);var bt=t((e,t,n,r,i,a)=>`M${e},${t}
|
|
3
|
+
a${i},${a} 0,0,1 0,${-r}
|
|
4
|
+
l${n},0
|
|
5
|
+
a${i},${a} 0,0,1 0,${r}
|
|
6
|
+
M${n},${-r}
|
|
7
|
+
a${i},${a} 0,0,0 0,${r}
|
|
8
|
+
l${-n},0`,`createCylinderPathD`),xt=t((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),St=t((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Ct=5,wt=10;async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2;if(t.width||t.height){let e=t.height??0;t.height=(t.height??0)-a,t.height<Ct&&(t.height=Ct);let n=e/2/(2.5+e/50);t.width=(t.width??0)-a-n*3,t.width<wt&&(t.width=wt)}let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t.height?t.height:s.height)+a,u=l/2,d=u/(2.5+l/50),f=(t.width?t.width:s.width)+d+a,{cssStyles:m}=t,h;if(t.look===`handDrawn`){let e=S.svg(o),n=xt(0,0,f,l,d,u),r=St(0,0,f,l,d,u),i=e.path(n,v(t,{})),a=e.path(r,v(t,{fill:`none`}));h=o.insert(()=>a,`:first-child`),h=o.insert(()=>i,`:first-child`),h.attr(`class`,`basic label-container`),m&&h.attr(`style`,m)}else{let e=bt(0,0,f,l,d,u);h=o.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,p(m)).attr(`style`,r),h.attr(`class`,`basic label-container outer-path`),m&&h.selectAll(`path`).attr(`style`,m),r&&h.selectAll(`path`).attr(`style`,r)}return h.attr(`label-offset-x`,d),h.attr(`transform`,`translate(${-f/2}, ${l/2} )`),c.attr(`transform`,`translate(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,h),t.intersect=function(e){let n=W.rect(t,e),r=n.y-(t.y??0);if(u!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-d)){let i=d*d*(1-r*r/(u*u));i!=0&&(i=Math.sqrt(Math.abs(i))),i=d-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},o}t(Tt,`tiltedCylinder`);async function Et(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=v(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(Et,`trapezoid`);async function Dt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=S.svg(s),p=v(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=D(m),g=f.path(h,p),_=s.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),T(t,_),t.intersect=function(e){return W.polygon(t,m,e)},s}t(Dt,`trapezoidalPentagon`);var Ot=10,kt=10;async function At(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let a=t.padding??0,o=t.look===`neo`?a*2:a;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<kt&&(t.width=kt),t.height=t?.height??0,t.height<Ot&&(t.height=Ot));let{shapeSvg:s,bbox:u,label:d}=await C(e,t,E(t)),f=c(l().flowchart?.htmlLabels),p=(t?.width?t?.width:u.width)+o,m=t?.height?t?.height:p+u.height,h=m,g=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-m}],{cssStyles:_}=t,b=S.svg(s),x=v(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=D(g),O=b.path(w,x),k=s.insert(()=>O,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return _&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,_),i&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,i),t.width=p,t.height=m,T(t,k),d.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))}, ${m/2-(u.height+(t.padding??0)/(f?2:1)-(u.y-(u.top??0)))})`),t.intersect=function(e){return n.info(`Triangle intersect`,t,g,e),W.polygon(t,g,e)},s}t(At,`triangle`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,g=14-d,_=g>0?g/2:0,b=S.svg(c),x=v(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=[{x:-d/2-_,y:m/2},...O(-d/2-_,m/2,d/2+_,m/2,p,.8),{x:d/2+_,y:-m/2},{x:-d/2-_,y:-m/2}],k=D(w),A=b.path(k,x),j=c.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),T(t,j),t.intersect=function(e){return W.polygon(t,w,e)},c}t(jt,`waveEdgedRectangle`);async function Mt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=S.svg(s),h=v(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-l/2,y:f/2},...O(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...O(l/2,-f/2,-l/2,-f/2,d,-1)],_=D(g),b=m.path(_,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),T(t,x),t.intersect=function(e){return W.polygon(t,g,e)},s}t(Mt,`waveRectangle`);var Q=10;async function Nt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,g=S.svg(o),_=v(t,{}),b=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],x=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q}
|
|
9
|
+
M${p-Q},${m} L${p+d},${m}
|
|
10
|
+
M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let w=g.path(x,_),D=o.insert(()=>w,`:first-child`);return D.attr(`transform`,`translate(${Q/2}, ${Q/2})`),D.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return W.polygon(t,b,e)},o}t(Nt,`windowPane`);var Pt=new Set([`redux-color`,`redux-dark-color`]),Ft=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function It(t,n){let r=n;r.alias&&(n.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:l,nodeBorder:u,borderColorArray:d}=a;if(n.look===`handDrawn`){let{themeVariables:e}=s(),{background:r}=e;await It(t,{...n,id:n.id+`-background`,domId:(n.domId||n.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let p=s();n.useHtmlLabels=p.htmlLabels;let m=p.er?.diagramPadding??10,h=p.er?.entityPadding??6,{cssStyles:g}=n,{labelStyles:_,nodeStyles:b}=y(n);if(r.attributes.length===0&&n.label){let e={rx:0,ry:0,labelPaddingX:m,labelPaddingY:m*1.5,classes:``};f(n.label,p)+e.labelPaddingX*2<p.er.minEntityWidth&&(n.width=p.er.minEntityWidth);let a=await Ce(t,n,e);if(i!=null&&Pt.has(i)){let e=r.colorIndex??0;a.attr(`data-color-id`,`color-${e%d.length}`)}if(!c(p.htmlLabels)){let e=a.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return a}p.htmlLabels||(m*=1.25,h*=1.25);let x=E(n);x||=`node default`;let C=t.insert(`g`).attr(`class`,x).attr(`id`,n.domId||n.id),w=await Lt(C,n.label??``,p,0,0,[`name`],_);w.height+=h;let D=0,O=[],k=[],A=0,j=0,M=0,N=0,P=!0,F=!0;for(let e of r.attributes){let t=await Lt(C,e.type,p,0,D,[`attribute-type`],_);A=Math.max(A,t.width+m);let n=await Lt(C,e.name,p,0,D,[`attribute-name`],_);j=Math.max(j,n.width+m);let r=await Lt(C,e.keys.join(),p,0,D,[`attribute-keys`],_);M=Math.max(M,r.width+m);let i=await Lt(C,e.comment,p,0,D,[`attribute-comment`],_);N=Math.max(N,i.width+m);let a=Math.max(t.height,n.height,r.height,i.height)+h;k.push({yOffset:D,rowHeight:a}),D+=a}let I=4;M<=m&&(P=!1,M=0,I--),N<=m&&(F=!1,N=0,I--);let ee=C.node().getBBox();if(w.width+m*2-(A+j+M+N)>0){let e=w.width+m*2-(A+j+M+N);A+=e/I,j+=e/I,M>0&&(M+=e/I),N>0&&(N+=e/I)}let te=A+j+M+N,L=S.svg(C),R=v(n,{});n.look!==`handDrawn`&&(R.roughness=0,R.fillStyle=`solid`);let ne=0;k.length>0&&(ne=k.reduce((e,t)=>e+(t?.rowHeight??0),0));let z=Math.max(ee.width+m*2,n?.width||0,te),B=Math.max((ne??0)+w.height,n?.height||0),V=-z/2,H=-B/2;if(C.selectAll(`g:not(:first-child)`).each((t,n,r)=>{let i=e(r[n]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=A:i.attr(`class`).includes(`attribute-keys`)?o+=A+j:i.attr(`class`).includes(`attribute-comment`)&&(o+=A+j+M))}i.attr(`transform`,`translate(${V+m/2+o}, ${s+H+w.height+h/2})`)}),C.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(H+h/2)+`)`),i!=null&&Pt.has(i)){let e=r.colorIndex??0;C.attr(`data-color-id`,`color-${e%d.length}`)}let re=L.rectangle(V,H,z,B,R),ie=C.insert(()=>re,`:first-child`).attr(`class`,`outer-path`).attr(`style`,g.join(``));O.push(0);for(let[e,t]of k.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=L.rectangle(V,w.height+H+t?.yOffset,z,t?.rowHeight,{...R,fill:n?o:l,stroke:u});C.insert(()=>r,`g.label`).attr(`style`,g.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let U=1e-4,G=Rt(V,w.height+H,z+V,w.height+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R);if(C.insert(()=>K).attr(`class`,`divider`),G=Rt(A+V,w.height+H,A+V,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`),P){let e=A+j+V;G=Rt(e,w.height+H,e,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}if(F){let e=A+j+M+V;G=Rt(e,w.height+H,e,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}for(let e of O){let t=w.height+H+e;G=Rt(V,t,z+V,t,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}if(T(n,ie),b&&n.look!==`handDrawn`)if(i!=null&&Ft.has(i))C.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);C.selectAll(`path`).attr(`style`,e??``),C.selectAll(`.row-rect-even path`).attr(`style`,b)}return n.intersect=function(e){return W.rect(n,e)},C}t(It,`erBox`);async function Lt(t,n,r,i=0,o=0,s=[],l=``){let u=t.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,l);n!==a(n)&&(n=a(n),n=n.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await m(u,n,{width:f(n,r)+100,style:l,useHtmlLabels:r.htmlLabels},r));if(n.includes(`<`)||n.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let p=d.getBBox();if(c(r.htmlLabels)){let t=d.children[0];t.style.textAlign=`start`;let n=e(d);p=t.getBoundingClientRect(),n.attr(`width`,p.width),n.attr(`height`,p.height)}return p}t(Lt,`addText`);function Rt(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}t(Rt,`lineToPolygon`);async function zt(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Bt(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Bt(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Bt(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Bt(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}t(zt,`textHelper`);async function Bt(n,a,o,l=[]){let u=n.insert(`g`).attr(`class`,`label`).attr(`style`,l.join(`; `)),p=s(),h=`useHtmlLabels`in a?a.useHtmlLabels:c(p.htmlLabels)??!0,g=``;g=`text`in a?a.text:a.label,!h&&g.startsWith(`\\`)&&(g=g.substring(1)),r(g)&&(h=!0);let _=await m(u,i(d(g)),{width:f(g,p)+50,classes:`markdown-node-label`,useHtmlLabels:h},p),v,y=1;if(h){let n=_.children[0],r=e(_);y=n.innerHTML.split(`<br>`).length,n.innerHTML.includes(`</math>`)&&(y+=n.innerHTML.split(`<mrow>`).length-1);let i=n.getElementsByTagName(`img`);if(i){let e=g.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=p.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,t=parseInt(e,10)*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)})))}v=n.getBoundingClientRect(),r.attr(`width`,v.width),r.attr(`height`,v.height)}else{l.includes(`font-weight: bolder`)&&e(_).selectAll(`tspan`).attr(`font-weight`,``),y=_.children.length;let t=_.children[0];(_.textContent===``||_.textContent.includes(`>`))&&(t.textContent=g[0]+g.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),g[1]===` `&&(t.textContent=t.textContent[0]+` `+t.textContent.substring(1))),t.textContent===`undefined`&&(t.textContent=``),v=_.getBBox()}return u.attr(`transform`,`translate(0,`+(-v.height/(2*y)+o)+`)`),v.height}t(Bt,`addText`);async function Vt(t,n){let r=l(),{themeVariables:i}=r,{useGradient:a}=i,o=r.class.padding??12,s=o,u=n.useHtmlLabels??c(r.htmlLabels)??!0,d=n;d.annotations=d.annotations??[],d.members=d.members??[],d.methods=d.methods??[];let{shapeSvg:f,bbox:p}=await zt(t,n,r,u,s),{labelStyles:m,nodeStyles:h}=y(n);n.labelStyle=m,n.cssStyles=d.styles||``;let g=d.styles?.join(`;`)||h||``;n.cssStyles||=g.replaceAll(`!important`,``).split(`;`);let _=d.members.length===0&&d.methods.length===0&&!r.class?.hideEmptyMembersBox,b=S.svg(f),x=v(n,{});n.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let C=Math.max(n.width??0,p.width),w=Math.max(n.height??0,p.height),E=(n.height??0)>p.height;d.members.length===0&&d.methods.length===0?w+=s:d.members.length>0&&d.methods.length===0&&(w+=s*2);let D=-C/2,O=-w/2,k=_?o*2:d.members.length===0&&d.methods.length===0?-o:0;E&&(k=o*2);let A=b.rectangle(D-o,O-o-(_?o:d.members.length===0&&d.methods.length===0?-o/2:0),C+2*o,w+2*o+k,x),j=f.insert(()=>A,`:first-child`);j.attr(`class`,`basic label-container outer-path`);let M=j.node().getBBox(),N=f.select(`.annotation-group`).node().getBBox().height-(_?o/2:0)||0,P=f.select(`.label-group`).node().getBBox().height-(_?o/2:0)||0,F=f.select(`.members-group`).node().getBBox().height-(_?o/2:0)||0,I=(N+P+O+o-(O-o-(_?o:d.members.length===0&&d.methods.length===0?-o/2:0)))/2;if(f.selectAll(`.text`).each((t,n,i)=>{let a=e(i[n]),c=a.attr(`transform`),l=0;if(c){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);e&&(l=parseFloat(e[2]))}let p=l+O+o-(_?o:d.members.length===0&&d.methods.length===0?-o/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(F,s/2);p=E?Math.max(I,N+P+e+O+s*2+o)+s*2:N+P+e+O+s*4+o}d.members.length===0&&d.methods.length===0&&r.class?.hideEmptyMembersBox&&(p=d.annotations.length>0?l-s:l),u||(p-=4);let m=D;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(m=-a.node()?.getBBox().width/2||0,f.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),a.attr(`transform`,`translate(${m}, ${p})`)}),d.members.length>0||d.methods.length>0||_){let e=N+P+O+o,t=b.line(M.x,e,M.x+M.width,e+.001,x);f.insert(()=>t).attr(`class`,`divider${n.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,g)}if(_||d.members.length>0||d.methods.length>0){let e=N+P+F+O+s*2+o,t=b.line(M.x,E?Math.max(I,e):e,M.x+M.width,(E?Math.max(I,e):e)+.001,x);f.insert(()=>t).attr(`class`,`divider${n.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,g)}if(d.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,g),j.select(`:nth-child(2)`).attr(`style`,g),f.selectAll(`.divider`).select(`path`).attr(`style`,g),n.labelStyle?f.selectAll(`span`).attr(`style`,n.labelStyle):f.selectAll(`span`).attr(`style`,g),!u){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(g);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}else if(m){let t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}}}return T(n,j),n.intersect=function(e){return W.rect(n,e)},f}t(Vt,`classBox`);async function Ht(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let a=n,o=n,s=`verifyMethod`in n,c=E(n),{themeVariables:u}=l(),{borderColorArray:d,requirementEdgeLabelBackground:f}=u,p=t.insert(`g`).attr(`class`,c).attr(`id`,n.domId??n.id),m;m=s?await $(p,`<<${a.type}>>`,0,n.labelStyle):await $(p,`<<Element>>`,0,n.labelStyle);let h=m,g=await $(p,a.name,h,n.labelStyle+`; font-weight: bold;`);if(h+=g+20,s){let e=await $(p,`${a.requirementId?`ID: ${a.requirementId}`:``}`,h,n.labelStyle);h+=e;let t=await $(p,`${a.text?`Text: ${a.text}`:``}`,h,n.labelStyle);h+=t;let r=await $(p,`${a.risk?`Risk: ${a.risk}`:``}`,h,n.labelStyle);h+=r,await $(p,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,h,n.labelStyle)}else{let e=await $(p,`${o.type?`Type: ${o.type}`:``}`,h,n.labelStyle);h+=e,await $(p,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,h,n.labelStyle)}let _=(p.node()?.getBBox().width??200)+20,b=(p.node()?.getBBox().height??200)+20,x=-_/2,C=-b/2,w=S.svg(p),D=v(n,{});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=w.rectangle(x,C,_,b,D),k=p.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),d?.length){let e=n.colorIndex??0;p.attr(`data-color-id`,`color-${e%d.length}`)}if(p.selectAll(`.label`).each((t,n,r)=>{let i=e(r[n]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-b/2,l=x+20/2;(n===0||n===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),h>m+g+20){let e=C+m+g+20,t;if(n.look===`neo`){let n=.001,r=[[x,e],[x+_,e],[x+_,e+n],[x,e+n]];t=w.polygon(r,D)}else t=w.line(x,e,x+_,e,D);p.insert(()=>t).attr(`class`,`divider`)}return T(n,k),n.intersect=function(e){return W.rect(n,e)},i&&n.look!==`handDrawn`&&(f||d?.length)&&p.selectAll(`path`).attr(`style`,i),p}t(Ht,`requirementBox`);async function $(t,n,r,a=``){if(n===``)return 0;let o=t.insert(`g`).attr(`class`,`label`).attr(`style`,a),s=l(),c=s.htmlLabels??!0,u=await m(o,i(d(n)),{width:f(n,s)+50,classes:`markdown-node-label`,useHtmlLabels:c,style:a},s),p;if(c){let t=u.children[0],n=e(u);p=t.getBoundingClientRect(),n.attr(`width`,p.width),n.attr(`height`,p.height)}else{let e=u.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);p=u.getBBox(),p.height+=6}return o.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}t($,`addText`);var Ut=t(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function Wt(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await w(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await w(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:g}=await w(o,`assigned`in t&&t.assigned||``,f);t.width=a;let _=t?.width||0,b=Math.max(m.height,g.height)/2,x=Math.max(s.height+20,t?.height||0)+b,D=-_/2,O=-x/2;c.attr(`transform`,`translate(`+(l-_/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-_/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+_/2-g.width-20)+`, `+(-b+s.height/2)+`)`);let k,{rx:A,ry:j}=t,{cssStyles:M}=t;if(t.look===`handDrawn`){let e=S.svg(o),n=v(t,{}),r=A||j?e.path(N(D,O,_,x,A||0),n):e.rectangle(D,O,_,x,n);k=o.insert(()=>r,`:first-child`),k.attr(`class`,`basic label-container`).attr(`style`,M||null)}else{k=o.insert(`rect`,`:first-child`),k.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,A??5).attr(`ry`,j??5).attr(`x`,D).attr(`y`,O).attr(`width`,_).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=D+2,r=O+Math.floor((A??0)/2),i=O+x-Math.floor((A??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Ut(e))}}return T(t,k),t.height=x,t.intersect=function(e){return W.rect(t,e)},o}t(Wt,`kanbanItem`);async function Gt(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await C(e,t,E(t)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=t,m=o.width+20,h=o.height+20,g=Math.max(l,m),_=Math.max(u,h);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let b,x=`M0 0
|
|
11
|
+
a${d},${d} 1 0,0 ${g*.25},${-1*_*.1}
|
|
12
|
+
a${d},${d} 1 0,0 ${g*.25},0
|
|
13
|
+
a${d},${d} 1 0,0 ${g*.25},0
|
|
14
|
+
a${d},${d} 1 0,0 ${g*.25},${_*.1}
|
|
15
|
+
|
|
16
|
+
a${d},${d} 1 0,0 ${g*.15},${_*.33}
|
|
17
|
+
a${d*.8},${d*.8} 1 0,0 0,${_*.34}
|
|
18
|
+
a${d},${d} 1 0,0 ${-1*g*.15},${_*.33}
|
|
19
|
+
|
|
20
|
+
a${d},${d} 1 0,0 ${-1*g*.25},${_*.15}
|
|
21
|
+
a${d},${d} 1 0,0 ${-1*g*.25},0
|
|
22
|
+
a${d},${d} 1 0,0 ${-1*g*.25},0
|
|
23
|
+
a${d},${d} 1 0,0 ${-1*g*.25},${-1*_*.15}
|
|
24
|
+
|
|
25
|
+
a${d},${d} 1 0,0 ${-1*g*.1},${-1*_*.33}
|
|
26
|
+
a${d*.8},${d*.8} 1 0,0 0,${-1*_*.34}
|
|
27
|
+
a${d},${d} 1 0,0 ${g*.1},${-1*_*.33}
|
|
28
|
+
H0 V0 Z`;if(t.look===`handDrawn`){let e=S.svg(a),n=v(t,{}),r=e.path(x,n);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,p(f))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-g/2}, ${-_/2})`),T(t,b),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return n.info(`Bang intersect`,t,e),W.rect(t,e)},a}t(Gt,`bang`);async function Kt(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await C(e,t,E(t)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,m=.35*l,h=.2*l,{cssStyles:g}=t,_,b=`M0 0
|
|
29
|
+
a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}
|
|
30
|
+
a${m},${m} 1 0,1 ${l*.4},${-1*l*.1}
|
|
31
|
+
a${f},${f} 1 0,1 ${l*.35},${l*.2}
|
|
32
|
+
|
|
33
|
+
a${d},${d} 1 0,1 ${l*.15},${u*.35}
|
|
34
|
+
a${h},${h} 1 0,1 ${-1*l*.15},${u*.65}
|
|
35
|
+
|
|
36
|
+
a${f},${d} 1 0,1 ${-1*l*.25},${l*.15}
|
|
37
|
+
a${m},${m} 1 0,1 ${-1*l*.5},0
|
|
38
|
+
a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
39
|
+
|
|
40
|
+
a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}
|
|
41
|
+
a${h},${h} 1 0,1 ${l*.1},${-1*u*.65}
|
|
42
|
+
H0 V0 Z`;if(t.look===`handDrawn`){let e=S.svg(a),n=v(t,{}),r=e.path(b,n);_=a.insert(()=>r,`:first-child`),_.attr(`class`,`basic label-container`).attr(`style`,p(g))}else _=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),_.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,_),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return n.info(`Cloud intersect`,t,e),W.rect(t,e)},a}t(Kt,`cloud`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await C(e,t,E(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
|
|
43
|
+
M${-c/2} ${l/2-5}
|
|
44
|
+
v${-l+10}
|
|
45
|
+
q0,-5 5,-5
|
|
46
|
+
h${c-10}
|
|
47
|
+
q5,0 5,5
|
|
48
|
+
v${l-5}
|
|
49
|
+
H${-c/2}
|
|
50
|
+
Z
|
|
51
|
+
`:`
|
|
52
|
+
M${-c/2} ${l/2-5}
|
|
53
|
+
v${-l+10}
|
|
54
|
+
q0,-5 5,-5
|
|
55
|
+
h${c-10}
|
|
56
|
+
q5,0 5,5
|
|
57
|
+
v${l-10}
|
|
58
|
+
q0,5 -5,5
|
|
59
|
+
h${-(c-10)}
|
|
60
|
+
q-5,0 -5,-5
|
|
61
|
+
Z
|
|
62
|
+
`;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let d=i.append(`path`).attr(`id`,t.domId).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()),T(t,d),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return W.rect(t,e)},i}t(qt,`defaultMindmapNode`);async function Jt(e,t){return ue(e,t,{padding:t.padding??0})}t(Jt,`mindmapCircle`);var Yt=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:lt},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:ot},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:ut},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:ht},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:Se},{semanticName:`Data Store`,name:`Data Store`,shortName:`datastore`,description:`Data flow diagram data store`,aliases:[`data-store`],handler:we},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:ue},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Gt},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:Kt},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:rt},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:Pe},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:We},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:Ue},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:Et},{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:Ve},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:Ee},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:yt},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:ce},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:st},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:pt},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:ft},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:je},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:Fe},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:pe},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:me},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:he},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:Ge},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:jt},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:Me},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:Tt},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:Ze},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:ge},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Te},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:At},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:Nt},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:De},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:Dt},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:Ae},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:ct},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:et},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:$e},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:oe},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:fe},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:vt},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:_t},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:Mt},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:it},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:Qe}],Xt=t(()=>{let e=[...Object.entries({state:dt,choice:le,note:tt,rectWithTitle:at,labelRect:He,iconSquare:ze,iconCircle:Le,icon:Ie,iconRounded:Re,imageSquare:Be,anchor:G,kanbanItem:Wt,mindmapCircle:Jt,defaultMindmapNode:qt,classBox:Vt,erBox:It,requirementBox:Ht}),...Yt.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)();function Zt(e){return e in Xt}t(Zt,`isValidShape`);var Qt=new Map;async function $t(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let a=t.shape?Xt[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 r.attr(`data-look`,p(t.look)),t.tooltip&&i.attr(`title`,t.tooltip),Qt.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}t($t,`insertNode`);var en=t((e,t)=>{Qt.set(t.id,e)},`setNodeElem`),tn=t(()=>{Qt.clear()},`clear`),nn=t(e=>{let t=Qt.get(e.id);n.trace(`Transforming node`,e.diff,e,`translate(`+(e.x-e.width/2-5)+`, `+e.width/2+`)`);let r=e.diff||0;return e.clusterNode?t.attr(`transform`,`translate(`+(e.x+r-e.width/2)+`, `+(e.y-e.height/2-8)+`)`):t.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`),r},`positionNode`);export{$t as a,nn as c,ee as i,en as l,tn as n,Zt as o,M as r,C as s,te as t,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./src-CVz7aDdY.js";function t(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}e(t,`populateCommonDb`);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as e}from"./vendor-charts-fo4ZbB_t.js";import{n as t}from"./src-CVz7aDdY.js";var n=t((t,n)=>{let r;return n===`sandbox`&&(r=e(`#i`+t)),e(n===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${t}"]`)},`getDiagramElement`);export{n as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{At as e,Ct as t,Dt as n,Et as r,St as i,Tt as a,_t as o,bt as s,dt as c,ft as l,gt as u,ht as ee,lt as te,mt as ne,pt as re,u as ie,ut as ae,vt as oe,wt as se,xt as ce,yt as le}from"./vendor-charts-fo4ZbB_t.js";import{n as d,r as f}from"./src-CVz7aDdY.js";import{R as ue,h as p,p as de,r as fe,s as m}from"./chunk-CSCIHK7Q-DfSAlgJl.js";import{t as pe}from"./dist-Cna34lZe.js";function h(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function me(){}function g(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function _(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var v=`[object RegExp]`,y=`[object String]`,b=`[object Number]`,x=`[object Boolean]`,S=`[object Arguments]`,he=`[object Symbol]`,ge=`[object Date]`,_e=`[object Map]`,ve=`[object Set]`,ye=`[object Array]`,be=`[object ArrayBuffer]`,xe=`[object Object]`,Se=`[object DataView]`,Ce=`[object Uint8Array]`,we=`[object Uint8ClampedArray]`,C=`[object Uint16Array]`,w=`[object Uint32Array]`,T=`[object Int8Array]`,E=`[object Int16Array]`,D=`[object Int32Array]`,O=`[object Float32Array]`,k=`[object Float64Array]`,A=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)();function j(e){return A.Buffer!==void 0&&A.Buffer.isBuffer(e)}function Te(e){return Number.isSafeInteger(e)&&e>=0}function M(e){return e!=null&&typeof e!=`function`&&Te(e.length)}function Ee(e){return e===`__proto__`}function N(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function P(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function De(e,t){return F(e,void 0,e,new Map,t)}function F(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(N(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=F(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,F(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(F(a,void 0,n,r,i));return t}if(j(e))return e.subarray();if(P(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=F(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),I(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),I(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),I(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,I(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),I(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),I(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),I(t,e,n,r,i),t}if(typeof e==`object`&&Oe(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),I(t,e,n,r,i),t}return e}function I(e,t,n=e,r,i){let a=[...Object.keys(t),...g(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=F(t[s],s,n,r,i))}}function Oe(e){switch(_(e)){case S:case ye:case be:case Se:case x:case ge:case O:case k:case T:case E:case D:case _e:case b:case xe:case v:case ve:case y:case he:case Ce:case we:case C:case w:return!0;default:return!1}}function ke(e,t){return De(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(_(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),I(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case b:case y:case x:{let t=new e.constructor(e?.valueOf());return I(t,e),t}case S:{let t={};return I(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function L(e){return ke(e)}function R(e){return typeof e==`object`&&!!e&&_(e)===`[object Arguments]`}function z(e){return typeof e==`object`&&!!e}function Ae(e){return z(e)&&M(e)}function B(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(B.Cache||Map),n}B.Cache=Map;function V(e){return P(e)}function je(e){if(N(e))return e;if(Array.isArray(e)||P(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function Me(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=H(i,t,r,new Map)}return i}function H(e,t,n,r){if(N(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return je(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...g(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Ee(o))continue;let s=t[o],c=e[o];if(R(s)&&(s={...s}),R(c)&&(c={...c}),j(s)&&(s=L(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(Ae(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||z(c)&&z(s)&&(h(c)||h(s)||V(c)||V(s))?e[o]=H(c,s,n,r):c==null&&h(s)?e[o]=H({},s,n,r):c==null&&V(s)?e[o]=L(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function Ne(e,...t){return Me(e,...t,me)}var Pe=pe(),Fe={curveBasis:a,curveBasisClosed:se,curveBasisOpen:t,curveBumpX:r,curveBumpY:n,curveBundle:i,curveCardinalClosed:s,curveCardinalOpen:le,curveCardinal:ce,curveCatmullRomClosed:o,curveCatmullRomOpen:u,curveCatmullRom:oe,curveLinear:e,curveLinearClosed:ee,curveMonotoneX:re,curveMonotoneY:ne,curveNatural:l,curveStep:c,curveStepAfter:te,curveStepBefore:ae},Ie=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Le=d(function(e,t){let n=Re(e,/(?:init\b)|(?:initialize\b)/),r={};if(Array.isArray(n)){let e=n.map(e=>e.args);ue(e),r=fe(r,[...e])}else r=n.args;if(!r)return;let i=de(e,t),a=`config`;return r[a]!==void 0&&(i===`flowchart-v2`&&(i=`flowchart`),r[i]=r[a],delete r[a]),r},`detectInit`),Re=d(function(e,t=null){try{let n=RegExp(`[%]{2}(?![{]${Ie.source})(?=[}][%]{2}).*
|
|
2
|
+
`,`ig`);e=e.trim().replace(n,``).replace(/'/gm,`"`),f.debug(`Detecting diagram directive${t===null?``:` type:`+t} based on the text:${e}`);let r,i=[];for(;(r=p.exec(e))!==null;)if(r.index===p.lastIndex&&p.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){let e=r[1]?r[1]:r[2],t=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:e,args:t})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(n){return f.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},`detectDirective`),ze=d(function(e){return e.replace(p,``)},`removeDirectives`),Be=d(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`);function U(e,t){return e?Fe[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}d(U,`interpolateToCurve`);function Ve(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,Pe.sanitizeUrl)(n)}d(Ve,`formatUrl`);var He=d((e,...t)=>{let n=e.split(`.`),r=n.length-1,i=n[r],a=window;for(let t=0;t<r;t++)if(a=a[n[t]],!a){f.error(`Function name: ${e} not found in window`);return}a[i](...t)},`runFunc`);function W(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}d(W,`distance`);function Ue(e){let t,n=0;return e.forEach(e=>{n+=W(e,t),t=e}),G(e,n/2)}d(Ue,`traverseEdge`);function We(e){return e.length===1?e[0]:Ue(e)}d(We,`calcLabelPosition`);var Ge=d((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),G=d((e,t)=>{let n,r=t;for(let t of e){if(n){let e=W(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:Ge((1-i)*n.x+i*t.x,5),y:Ge((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),Ke=d((e,t,n)=>{f.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());let r=G(t,25),i=e?10:5,a=Math.atan2(t[0].y-r.y,t[0].x-r.x),o={x:0,y:0};return o.x=Math.sin(a)*i+(t[0].x+r.x)/2,o.y=-Math.cos(a)*i+(t[0].y+r.y)/2,o},`calcCardinalityPosition`);function qe(e,t,n){let r=structuredClone(n);f.info(`our points`,r),t!==`start_left`&&t!==`start_right`&&r.reverse();let i=G(r,25+e),a=10+e*.5,o=Math.atan2(r[0].y-i.y,r[0].x-i.x),s={x:0,y:0};return t===`start_left`?(s.x=Math.sin(o+Math.PI)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o+Math.PI)*a+(r[0].y+i.y)/2):t===`end_right`?(s.x=Math.sin(o-Math.PI)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o-Math.PI)*a+(r[0].y+i.y)/2-5):t===`end_left`?(s.x=Math.sin(o)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2-5):(s.x=Math.sin(o)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2),s}d(qe,`calcTerminalLabelPosition`);function K(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}d(K,`getStylesFromArray`);var Je=0,Ye=d(()=>(Je++,`id-`+Math.random().toString(36).substr(2,12)+`-`+Je),`generateId`);function Xe(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}d(Xe,`makeRandomHex`);var Ze=d(e=>Xe(e.length),`random`),Qe=d(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),$e=d(function(e,t){let n=t.text.replace(m.lineBreakRegex,` `),[,r]=Z(t.fontSize),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.style(`text-anchor`,t.anchor),i.style(`font-family`,t.fontFamily),i.style(`font-size`,r),i.style(`font-weight`,t.fontWeight),i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.attr(`fill`,t.fill),a.text(n),i},`drawSimpleText`),et=B((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),m.lineBreakRegex.test(e)))return e;let r=e.split(` `).filter(Boolean),i=[],a=``;return r.forEach((e,o)=>{let s=J(`${e} `,n),c=J(a,n);if(s>t){let{hyphenatedStrings:r,remainingWord:o}=tt(e,t,`-`,n);i.push(a,...r),a=o}else c+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(` `);o+1===r.length&&i.push(a)}),i.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),tt=B((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let c=`${o}${e}`;if(J(c,r)>=t){let e=s+1,t=i.length===e,r=`${c}${n}`;a.push(t?c:r),o=``}else o=c}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function q(e,t){return Y(e,t).height}d(q,`calculateTextHeight`);function J(e,t){return Y(e,t).width}d(J,`calculateTextWidth`);var Y=B((e,t)=>{let{fontSize:n=12,fontFamily:r=`Arial`,fontWeight:i=400}=t;if(!e)return{width:0,height:0};let[,a]=Z(n),o=[`sans-serif`,r],s=e.split(m.lineBreakRegex),c=[],l=ie(`body`);if(!l.remove)return{width:0,height:0,lineHeight:0};let u=l.append(`svg`);for(let e of o){let t=0,n={width:0,height:0,lineHeight:0};for(let r of s){let o=Qe();o.text=r||``;let s=$e(u,o).style(`font-size`,a).style(`font-weight`,i).style(`font-family`,e),c=(s._groups||s)[0][0].getBBox();if(c.width===0&&c.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,c.width)),t=Math.round(c.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}c.push(n)}return u.remove(),c[isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),nt=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{d(this,`InitIDGenerator`)}},X,rt=d(function(e){return X||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),X.innerHTML=e,unescape(X.textContent)},`entityDecode`);function it(e){return`str`in e}d(it,`isDetailedError`);var at=d((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),Z=d(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`);function Q(e,t){return Ne({},e,t)}d(Q,`cleanAndMerge`);var ot={assignWithDepth:fe,wrapLabel:et,calculateTextHeight:q,calculateTextWidth:J,calculateTextDimensions:Y,cleanAndMerge:Q,detectInit:Le,detectDirective:Re,isSubstringInArray:Be,interpolateToCurve:U,calcLabelPosition:We,calcCardinalityPosition:Ke,calcTerminalLabelPosition:qe,formatUrl:Ve,getStylesFromArray:K,generateId:Ye,random:Ze,runFunc:He,entityDecode:rt,insertTitle:at,isLabelCoordinateInPath:$,parseFontSize:Z,InitIDGenerator:nt},st=d(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),ct=d(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),lt=d((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`);function ut(e){return e??null}d(ut,`handleUndefinedAttr`);function $(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}d($,`isLabelCoordinateInPath`);export{k as A,he as B,S as C,Se as D,x as E,b as F,_ as G,w as H,xe as I,v as L,D as M,T as N,ge as O,_e as P,ve as R,j as S,ye as T,Ce as U,C as V,we as W,et as _,ct as a,N as b,lt as c,U as d,it as f,ot as g,ze as h,Q as i,E as j,O as k,K as l,Ze as m,q as n,st as o,Z as p,J as r,Ye as s,Y as t,ut as u,V as v,be as w,M as x,R as y,y as z};
|